rulesync 8.1.0 → 8.3.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.
@@ -33,12 +33,13 @@ var FeaturesSchema = z.array(FeatureSchema);
33
33
  var FeatureOptionsSchema = z.record(z.string(), z.unknown());
34
34
  var FeatureValueSchema = z.union([z.boolean(), FeatureOptionsSchema]);
35
35
  var PerFeatureConfigSchema = z.record(z.string(), FeatureValueSchema);
36
+ var PerTargetFeaturesValueSchema = z.union([
37
+ z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)),
38
+ PerFeatureConfigSchema
39
+ ]);
36
40
  var RulesyncFeaturesSchema = z.union([
37
41
  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
- )
42
+ z.record(z.string(), PerTargetFeaturesValueSchema)
42
43
  ]);
43
44
  var isFeatureValueEnabled = (value) => {
44
45
  if (value === true) return true;
@@ -81,6 +82,14 @@ var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
81
82
  var ToolTargetSchema = z2.enum(ALL_TOOL_TARGETS);
82
83
  var ToolTargetsSchema = z2.array(ToolTargetSchema);
83
84
  var RulesyncTargetsSchema = z2.array(z2.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
85
+ var RulesyncConfigTargetsObjectSchema = z2.record(z2.string(), PerTargetFeaturesValueSchema);
86
+ var RulesyncConfigTargetsSchema = z2.union([
87
+ RulesyncTargetsSchema,
88
+ RulesyncConfigTargetsObjectSchema
89
+ ]);
90
+ var isRulesyncConfigTargetsObject = (value) => {
91
+ return !Array.isArray(value);
92
+ };
84
93
 
85
94
  // src/config/config-resolver.ts
86
95
  import { dirname as dirname2, join as join3, resolve as resolve2 } from "path";
@@ -338,7 +347,7 @@ var SourceEntrySchema = z3.object({
338
347
  });
339
348
  var ConfigParamsSchema = z3.object({
340
349
  baseDirs: z3.array(z3.string()),
341
- targets: RulesyncTargetsSchema,
350
+ targets: RulesyncConfigTargetsSchema,
342
351
  features: RulesyncFeaturesSchema,
343
352
  verbose: z3.boolean(),
344
353
  delete: z3.boolean(),
@@ -365,10 +374,42 @@ var CONFLICTING_TARGET_PAIRS = [
365
374
  ["claudecode", "claudecode-legacy"]
366
375
  ];
367
376
  var LEGACY_TARGETS = ["augmentcode-legacy", "claudecode-legacy"];
377
+ var assertTargetsFeaturesExclusive = ({
378
+ targets,
379
+ features
380
+ }) => {
381
+ const targetsIsObject = targets !== void 0 && !Array.isArray(targets);
382
+ const featuresIsObject = features !== void 0 && !Array.isArray(features);
383
+ if (targetsIsObject && features !== void 0) {
384
+ throw new Error(
385
+ "Invalid config: when 'targets' is in object form, 'features' must be omitted. Declare per-target features inside the 'targets' object instead."
386
+ );
387
+ }
388
+ if (featuresIsObject && targets !== void 0) {
389
+ throw new Error(
390
+ "Invalid config: when 'features' is in object form, 'targets' must be omitted. Migrate to the 'targets' object form, e.g. `targets: { claudecode: [...] }`."
391
+ );
392
+ }
393
+ };
394
+ var assertTargetsOrFeaturesProvided = ({
395
+ targets,
396
+ features
397
+ }) => {
398
+ if (targets === void 0 && features === void 0) {
399
+ throw new Error("Invalid config: at least one of 'targets' or 'features' must be provided.");
400
+ }
401
+ };
368
402
  var Config = class _Config {
369
403
  baseDirs;
370
404
  targets;
371
405
  features;
406
+ /**
407
+ * Cached list of validated `ToolTarget` keys for the object form of
408
+ * `targets`. Populated in the constructor after `validateObjectFormTargetKeys`
409
+ * so `getTargets()` does not rebuild the `ALL_TOOL_TARGETS` set on every call.
410
+ * Undefined when `this.targets` is in array form.
411
+ */
412
+ objectFormTargetKeys;
372
413
  verbose;
373
414
  delete;
374
415
  global;
@@ -396,13 +437,19 @@ var Config = class _Config {
396
437
  check,
397
438
  sources
398
439
  }) {
399
- this.validateConflictingTargets(targets);
440
+ assertTargetsFeaturesExclusive({ targets, features });
441
+ assertTargetsOrFeaturesProvided({ targets, features });
442
+ const resolvedTargets = targets ?? [];
443
+ const resolvedFeatures = features ?? [];
444
+ this.validateObjectFormTargetKeys(resolvedTargets);
445
+ this.validateConflictingTargets(resolvedTargets);
400
446
  if (dryRun && check) {
401
447
  throw new Error("--dry-run and --check cannot be used together");
402
448
  }
403
449
  this.baseDirs = baseDirs;
404
- this.targets = targets;
405
- this.features = features;
450
+ this.targets = resolvedTargets;
451
+ this.features = resolvedFeatures;
452
+ this.objectFormTargetKeys = isRulesyncConfigTargetsObject(resolvedTargets) ? _Config.filterValidToolTargets(Object.keys(resolvedTargets)) : void 0;
406
453
  this.verbose = verbose;
407
454
  this.delete = isDelete;
408
455
  this.global = global ?? false;
@@ -415,11 +462,37 @@ var Config = class _Config {
415
462
  this.check = check ?? false;
416
463
  this.sources = sources ?? [];
417
464
  }
465
+ /**
466
+ * Rejects unknown keys (and the special `*` key) in the object form of
467
+ * `targets`. For the array form this is already enforced at the Zod schema
468
+ * level via `z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD)`; for the object form
469
+ * `z.record(z.string(), ...)` intentionally accepts any string key (to work
470
+ * around zod's `z.record(z.enum(...))` requiring ALL enum members), so
471
+ * runtime validation lives here instead.
472
+ */
473
+ validateObjectFormTargetKeys(targets) {
474
+ if (Array.isArray(targets)) return;
475
+ const validTargets = new Set(ALL_TOOL_TARGETS);
476
+ for (const key of Object.keys(targets)) {
477
+ if (key === "*") {
478
+ throw new Error(
479
+ "Invalid target '*' in object form: wildcard is only supported in the array form `targets: ['*']`. Per-target options cannot be attached to a wildcard."
480
+ );
481
+ }
482
+ if (!validTargets.has(key)) {
483
+ throw new Error(`Unknown target '${key}'. Valid targets: ${ALL_TOOL_TARGETS.join(", ")}.`);
484
+ }
485
+ }
486
+ }
418
487
  validateConflictingTargets(targets) {
488
+ const has = (target) => {
489
+ if (Array.isArray(targets)) {
490
+ return targets.includes(target);
491
+ }
492
+ return Object.prototype.hasOwnProperty.call(targets, target);
493
+ };
419
494
  for (const [target1, target2] of CONFLICTING_TARGET_PAIRS) {
420
- const hasTarget1 = targets.includes(target1);
421
- const hasTarget2 = targets.includes(target2);
422
- if (hasTarget1 && hasTarget2) {
495
+ if (has(target1) && has(target2)) {
423
496
  throw new Error(
424
497
  `Conflicting targets: '${target1}' and '${target2}' cannot be used together. Please choose one.`
425
498
  );
@@ -429,16 +502,45 @@ var Config = class _Config {
429
502
  getBaseDirs() {
430
503
  return this.baseDirs;
431
504
  }
505
+ /**
506
+ * Filter an arbitrary string-key list down to the known `ToolTarget` set,
507
+ * skipping `*` (which is only meaningful as an array element, not a key).
508
+ */
509
+ static filterValidToolTargets(keys) {
510
+ const validTargets = new Set(ALL_TOOL_TARGETS);
511
+ const result = [];
512
+ for (const key of keys) {
513
+ if (key === "*") continue;
514
+ if (!validTargets.has(key)) continue;
515
+ result.push(key);
516
+ }
517
+ return result;
518
+ }
432
519
  getTargets() {
433
- if (this.targets.includes("*")) {
520
+ if (this.objectFormTargetKeys !== void 0) {
521
+ return this.objectFormTargetKeys;
522
+ }
523
+ const arrayTargets = Array.isArray(this.targets) ? this.targets : [];
524
+ if (!Array.isArray(this.features)) {
525
+ return _Config.filterValidToolTargets(Object.keys(this.features));
526
+ }
527
+ if (arrayTargets.includes("*")) {
434
528
  return ALL_TOOL_TARGETS.filter(
435
529
  // eslint-disable-next-line no-type-assertion/no-type-assertion
436
530
  (target) => !LEGACY_TARGETS.includes(target)
437
531
  );
438
532
  }
439
- return this.targets.filter((target) => target !== "*");
533
+ return arrayTargets.filter((target) => target !== "*");
440
534
  }
441
535
  getFeatures(target) {
536
+ if (isRulesyncConfigTargetsObject(this.targets)) {
537
+ if (target) {
538
+ const value = this.targets[target];
539
+ if (!value) return [];
540
+ return _Config.normalizeTargetFeatures(value);
541
+ }
542
+ return _Config.collectAllFeatures(Object.values(this.targets));
543
+ }
442
544
  if (!Array.isArray(this.features)) {
443
545
  const perTargetFeatures = this.features;
444
546
  if (target) {
@@ -448,20 +550,7 @@ var Config = class _Config {
448
550
  }
449
551
  return _Config.normalizeTargetFeatures(targetFeatures);
450
552
  }
451
- const allFeatures = [];
452
- for (const features of Object.values(perTargetFeatures)) {
453
- if (!features) continue;
454
- const normalized = _Config.normalizeTargetFeatures(features);
455
- for (const feature of normalized) {
456
- if (!allFeatures.includes(feature)) {
457
- allFeatures.push(feature);
458
- }
459
- }
460
- if (allFeatures.length === ALL_FEATURES.length) {
461
- return allFeatures;
462
- }
463
- }
464
- return allFeatures;
553
+ return _Config.collectAllFeatures(Object.values(perTargetFeatures));
465
554
  }
466
555
  if (this.features.includes("*")) {
467
556
  return [...ALL_FEATURES];
@@ -489,23 +578,40 @@ var Config = class _Config {
489
578
  }
490
579
  return enabled;
491
580
  }
581
+ /**
582
+ * Collect the union of features across all per-target values.
583
+ * Used when `getFeatures()` is called without a target in object mode.
584
+ */
585
+ static collectAllFeatures(values) {
586
+ const allFeatures = [];
587
+ for (const value of values) {
588
+ if (!value) continue;
589
+ const normalized = _Config.normalizeTargetFeatures(value);
590
+ for (const feature of normalized) {
591
+ if (!allFeatures.includes(feature)) {
592
+ allFeatures.push(feature);
593
+ }
594
+ }
595
+ if (allFeatures.length === ALL_FEATURES.length) {
596
+ return allFeatures;
597
+ }
598
+ }
599
+ return allFeatures;
600
+ }
492
601
  /**
493
602
  * Returns the per-feature options object for a given target/feature, if any.
494
603
  * Returns `undefined` when no per-feature options were provided or when the
495
604
  * feature is not enabled for the given target.
496
605
  */
497
606
  getFeatureOptions(target, feature) {
498
- if (Array.isArray(this.features)) {
499
- return void 0;
500
- }
501
- const targetFeatures = this.features[target];
502
- if (!targetFeatures || Array.isArray(targetFeatures)) {
607
+ const value = isRulesyncConfigTargetsObject(this.targets) ? this.targets[target] : !Array.isArray(this.features) ? this.features[target] : void 0;
608
+ if (!value || Array.isArray(value)) {
503
609
  return void 0;
504
610
  }
505
- const perFeature = targetFeatures;
506
- const value = perFeature[feature];
507
- if (value && typeof value === "object" && isFeatureValueEnabled(value)) {
508
- return value;
611
+ const perFeature = value;
612
+ const featureValue = perFeature[feature];
613
+ if (featureValue && typeof featureValue === "object" && isFeatureValueEnabled(featureValue)) {
614
+ return featureValue;
509
615
  }
510
616
  return void 0;
511
617
  }
@@ -513,6 +619,13 @@ var Config = class _Config {
513
619
  * Check if per-target features configuration is being used.
514
620
  */
515
621
  hasPerTargetFeatures() {
622
+ return isRulesyncConfigTargetsObject(this.targets) || !Array.isArray(this.features);
623
+ }
624
+ /**
625
+ * Returns true if the deprecated object form under `features` is in use.
626
+ * Callers can use this to emit a migration warning.
627
+ */
628
+ hasDeprecatedFeaturesObjectForm() {
516
629
  return !Array.isArray(this.features);
517
630
  }
518
631
  getVerbose() {
@@ -557,6 +670,17 @@ var Config = class _Config {
557
670
  }
558
671
  };
559
672
 
673
+ // src/config/deprecation-warnings.ts
674
+ var deprecationWarningEmitted = false;
675
+ var emitFeaturesObjectFormDeprecationWarning = () => {
676
+ if (deprecationWarningEmitted) return;
677
+ if (process.env.RULESYNC_SILENT_DEPRECATION) return;
678
+ deprecationWarningEmitted = true;
679
+ console.warn(
680
+ "[rulesync] DEPRECATED: 'features' object form is deprecated. Use the new 'targets' object form instead: `targets: { claudecode: { rules: true, ignore: { fileMode: 'local' } } }`. See https://github.com/dyoshikawa/rulesync/blob/main/docs/guide/configuration.md for the migration guide."
681
+ );
682
+ };
683
+
560
684
  // src/config/config-resolver.ts
561
685
  var getDefaults = () => ({
562
686
  targets: ["agentsmd"],
@@ -583,6 +707,10 @@ var loadConfigFromFile = async (filePath) => {
583
707
  const jsonData = parseJsonc(fileContent);
584
708
  const parsed = ConfigFileSchema.parse(jsonData);
585
709
  const { $schema: _schema, ...configParams } = parsed;
710
+ assertTargetsFeaturesExclusive({
711
+ targets: configParams.targets,
712
+ features: configParams.features
713
+ });
586
714
  return configParams;
587
715
  };
588
716
  var mergeConfigs = (baseConfig, localConfig) => {
@@ -626,14 +754,35 @@ var ConfigResolver = class {
626
754
  const localConfigPath = join3(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
627
755
  const localConfig = await loadConfigFromFile(localConfigPath);
628
756
  const configByFile = mergeConfigs(baseConfig, localConfig);
757
+ try {
758
+ assertTargetsFeaturesExclusive({
759
+ targets: configByFile.targets,
760
+ features: configByFile.features
761
+ });
762
+ } catch (error) {
763
+ const detail = error instanceof Error ? error.message : String(error);
764
+ throw new Error(
765
+ `${detail} (detected after merging '${validatedConfigPath}' with '${localConfigPath}' \u2014 the two files combined produce the invalid combination; remove the conflicting field from one of them).`,
766
+ { cause: error }
767
+ );
768
+ }
629
769
  const resolvedGlobal = global ?? configByFile.global ?? getDefaults().global;
630
770
  const resolvedSimulateCommands = simulateCommands ?? configByFile.simulateCommands ?? getDefaults().simulateCommands;
631
771
  const resolvedSimulateSubagents = simulateSubagents ?? configByFile.simulateSubagents ?? getDefaults().simulateSubagents;
632
772
  const resolvedSimulateSkills = simulateSkills ?? configByFile.simulateSkills ?? getDefaults().simulateSkills;
633
773
  const resolvedGitignoreTargetsOnly = gitignoreTargetsOnly ?? configByFile.gitignoreTargetsOnly ?? getDefaults().gitignoreTargetsOnly;
774
+ const userProvidedFeatures = features ?? configByFile.features;
775
+ const userProvidedTargets = targets ?? configByFile.targets;
776
+ const targetsIsObject = userProvidedTargets !== void 0 && !Array.isArray(userProvidedTargets);
777
+ const featuresIsObject = userProvidedFeatures !== void 0 && !Array.isArray(userProvidedFeatures);
778
+ if (featuresIsObject) {
779
+ emitFeaturesObjectFormDeprecationWarning();
780
+ }
781
+ const resolvedFeatures = userProvidedFeatures ?? (targetsIsObject ? void 0 : getDefaults().features);
782
+ const resolvedTargets = userProvidedTargets ?? (featuresIsObject ? void 0 : getDefaults().targets);
634
783
  const configParams = {
635
- targets: targets ?? configByFile.targets ?? getDefaults().targets,
636
- features: features ?? configByFile.features ?? getDefaults().features,
784
+ targets: resolvedTargets,
785
+ features: resolvedFeatures,
637
786
  verbose: verbose ?? configByFile.verbose ?? getDefaults().verbose,
638
787
  delete: isDelete ?? configByFile.delete ?? getDefaults().delete,
639
788
  baseDirs: getBaseDirsInLightOfGlobal({
@@ -668,7 +817,7 @@ function getBaseDirsInLightOfGlobal({
668
817
  }
669
818
 
670
819
  // src/lib/generate.ts
671
- import { join as join136 } from "path";
820
+ import { join as join137 } from "path";
672
821
  import { intersection } from "es-toolkit";
673
822
 
674
823
  // src/features/commands/commands-processor.ts
@@ -8984,7 +9133,7 @@ var McpProcessor = class extends FeatureProcessor {
8984
9133
  };
8985
9134
 
8986
9135
  // src/features/permissions/permissions-processor.ts
8987
- import { z as z31 } from "zod/mini";
9136
+ import { z as z32 } from "zod/mini";
8988
9137
 
8989
9138
  // src/features/permissions/claudecode-permissions.ts
8990
9139
  import { join as join62 } from "path";
@@ -9313,6 +9462,7 @@ function convertClaudeToRulesyncPermissions(params) {
9313
9462
  import { join as join63 } from "path";
9314
9463
  import * as smolToml4 from "smol-toml";
9315
9464
  var RULESYNC_PROFILE_NAME = "rulesync";
9465
+ var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
9316
9466
  var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
9317
9467
  static getSettablePaths(_options = {}) {
9318
9468
  return {
@@ -9402,6 +9552,22 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
9402
9552
  });
9403
9553
  }
9404
9554
  };
9555
+ var CodexcliRulesFile = class extends ToolFile {
9556
+ validate() {
9557
+ return { success: true, error: null };
9558
+ }
9559
+ };
9560
+ function createCodexcliBashRulesFile({
9561
+ baseDir = process.cwd(),
9562
+ config
9563
+ }) {
9564
+ return new CodexcliRulesFile({
9565
+ baseDir,
9566
+ relativeDirPath: join63(".codex", "rules"),
9567
+ relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
9568
+ fileContent: buildCodexBashRulesContent(config)
9569
+ });
9570
+ }
9405
9571
  function convertRulesyncToCodexProfile({
9406
9572
  config,
9407
9573
  logger
@@ -9510,6 +9676,46 @@ function mapReadAction(action) {
9510
9676
  function mapWriteAction(action) {
9511
9677
  return action === "allow" ? "write" : "none";
9512
9678
  }
9679
+ function buildCodexBashRulesContent(config) {
9680
+ const bashRules = config.permission.bash ?? {};
9681
+ const entries = Object.entries(bashRules);
9682
+ const header = [
9683
+ "# Generated by Rulesync from .rulesync/permissions.json (permission.bash)",
9684
+ "# https://developers.openai.com/codex/rules"
9685
+ ];
9686
+ if (entries.length === 0) {
9687
+ return [...header, "# No bash permission rules were configured."].join("\n");
9688
+ }
9689
+ const ruleBlocks = entries.map(([pattern, action]) => {
9690
+ const tokens = toCommandPatternTokens(pattern);
9691
+ if (tokens.length === 0) {
9692
+ return null;
9693
+ }
9694
+ const serializedTokens = tokens.map((token) => JSON.stringify(token)).join(", ");
9695
+ const decision = mapBashActionToDecision(action);
9696
+ return [
9697
+ "",
9698
+ `# ${pattern}`,
9699
+ "prefix_rule(",
9700
+ ` pattern = [${serializedTokens}],`,
9701
+ ` decision = ${JSON.stringify(decision)},`,
9702
+ ` justification = ${JSON.stringify(`Generated from Rulesync permission.bash: ${pattern}`)},`,
9703
+ ")"
9704
+ ].join("\n");
9705
+ }).filter((block) => block !== null);
9706
+ if (ruleBlocks.length === 0) {
9707
+ return [...header, "# No valid bash patterns were found."].join("\n");
9708
+ }
9709
+ return [...header, ...ruleBlocks].join("\n");
9710
+ }
9711
+ function toCommandPatternTokens(commandPattern) {
9712
+ return commandPattern.trim().split(/\s+/).map((token) => token.trim()).filter((token) => token.length > 0);
9713
+ }
9714
+ function mapBashActionToDecision(action) {
9715
+ if (action === "allow") return "allow";
9716
+ if (action === "ask") return "prompt";
9717
+ return "forbidden";
9718
+ }
9513
9719
 
9514
9720
  // src/features/permissions/geminicli-permissions.ts
9515
9721
  import { join as join64 } from "path";
@@ -9675,16 +9881,200 @@ function parseGeminicliToolEntry({ entry }) {
9675
9881
  };
9676
9882
  }
9677
9883
 
9678
- // src/features/permissions/opencode-permissions.ts
9884
+ // src/features/permissions/kiro-permissions.ts
9679
9885
  import { join as join65 } from "path";
9680
- import { parse as parseJsonc5 } from "jsonc-parser";
9681
9886
  import { z as z30 } from "zod/mini";
9682
- var OpencodePermissionSchema = z30.union([
9683
- z30.enum(["allow", "ask", "deny"]),
9684
- z30.record(z30.string(), z30.enum(["allow", "ask", "deny"]))
9887
+ var KiroAgentSchema = z30.looseObject({
9888
+ allowedTools: z30.optional(z30.array(z30.string())),
9889
+ toolsSettings: z30.optional(z30.record(z30.string(), z30.unknown()))
9890
+ });
9891
+ var UnknownRecordSchema = z30.record(z30.string(), z30.unknown());
9892
+ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
9893
+ static getSettablePaths(_options = {}) {
9894
+ return {
9895
+ relativeDirPath: join65(".kiro", "agents"),
9896
+ relativeFilePath: "default.json"
9897
+ };
9898
+ }
9899
+ isDeletable() {
9900
+ return false;
9901
+ }
9902
+ static async fromFile({
9903
+ baseDir = process.cwd(),
9904
+ validate = true
9905
+ }) {
9906
+ const paths = this.getSettablePaths();
9907
+ const filePath = join65(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9908
+ const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9909
+ return new _KiroPermissions({
9910
+ baseDir,
9911
+ relativeDirPath: paths.relativeDirPath,
9912
+ relativeFilePath: paths.relativeFilePath,
9913
+ fileContent,
9914
+ validate
9915
+ });
9916
+ }
9917
+ static async fromRulesyncPermissions({
9918
+ baseDir = process.cwd(),
9919
+ rulesyncPermissions,
9920
+ validate = true,
9921
+ logger
9922
+ }) {
9923
+ const paths = this.getSettablePaths();
9924
+ const filePath = join65(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9925
+ const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9926
+ const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
9927
+ if (!parsedResult.success) {
9928
+ throw new Error(
9929
+ `Failed to parse existing Kiro agent config at ${filePath}: ${formatError(parsedResult.error)}`
9930
+ );
9931
+ }
9932
+ const config = rulesyncPermissions.getJson();
9933
+ const next = buildKiroPermissionsFromRulesync({ config, logger, existing: parsedResult.data });
9934
+ return new _KiroPermissions({
9935
+ baseDir,
9936
+ relativeDirPath: paths.relativeDirPath,
9937
+ relativeFilePath: paths.relativeFilePath,
9938
+ fileContent: JSON.stringify(next, null, 2),
9939
+ validate
9940
+ });
9941
+ }
9942
+ toRulesyncPermissions() {
9943
+ let parsed;
9944
+ try {
9945
+ parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
9946
+ } catch (error) {
9947
+ throw new Error(
9948
+ `Failed to parse Kiro permissions content in ${join65(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9949
+ { cause: error }
9950
+ );
9951
+ }
9952
+ const permission = {};
9953
+ const toolsSettings = parsed.toolsSettings ?? {};
9954
+ const shellSettings = asRecord(toolsSettings.shell);
9955
+ const shellAllow = asStringArray(shellSettings.allowedCommands);
9956
+ const shellDeny = asStringArray(shellSettings.deniedCommands);
9957
+ if (shellAllow.length > 0 || shellDeny.length > 0) {
9958
+ permission.bash = {};
9959
+ for (const pattern of shellAllow) permission.bash[pattern] = "allow";
9960
+ for (const pattern of shellDeny) permission.bash[pattern] = "deny";
9961
+ }
9962
+ const readSettings = asRecord(toolsSettings.read);
9963
+ const readAllow = asStringArray(readSettings.allowedPaths);
9964
+ const readDeny = asStringArray(readSettings.deniedPaths);
9965
+ if (readAllow.length > 0 || readDeny.length > 0) {
9966
+ permission.read = {};
9967
+ for (const pattern of readAllow) permission.read[pattern] = "allow";
9968
+ for (const pattern of readDeny) permission.read[pattern] = "deny";
9969
+ }
9970
+ const writeSettings = asRecord(toolsSettings.write);
9971
+ const writeAllow = asStringArray(writeSettings.allowedPaths);
9972
+ const writeDeny = asStringArray(writeSettings.deniedPaths);
9973
+ if (writeAllow.length > 0 || writeDeny.length > 0) {
9974
+ permission.write = {};
9975
+ for (const pattern of writeAllow) permission.write[pattern] = "allow";
9976
+ for (const pattern of writeDeny) permission.write[pattern] = "deny";
9977
+ }
9978
+ const allowedTools = new Set(parsed.allowedTools ?? []);
9979
+ if (allowedTools.has("web_fetch")) {
9980
+ permission.webfetch = { "*": "allow" };
9981
+ }
9982
+ if (allowedTools.has("web_search")) {
9983
+ permission.websearch = { "*": "allow" };
9984
+ }
9985
+ return this.toRulesyncPermissionsDefault({
9986
+ fileContent: JSON.stringify({ permission }, null, 2)
9987
+ });
9988
+ }
9989
+ validate() {
9990
+ return { success: true, error: null };
9991
+ }
9992
+ static forDeletion({
9993
+ baseDir = process.cwd(),
9994
+ relativeDirPath,
9995
+ relativeFilePath
9996
+ }) {
9997
+ return new _KiroPermissions({
9998
+ baseDir,
9999
+ relativeDirPath,
10000
+ relativeFilePath,
10001
+ fileContent: JSON.stringify({}, null, 2),
10002
+ validate: false
10003
+ });
10004
+ }
10005
+ };
10006
+ function buildKiroPermissionsFromRulesync({
10007
+ config,
10008
+ logger,
10009
+ existing
10010
+ }) {
10011
+ const nextAllowedTools = new Set(existing.allowedTools ?? []);
10012
+ const nextToolsSettings = { ...asRecord(existing.toolsSettings) };
10013
+ const shell = {
10014
+ allowedCommands: [],
10015
+ deniedCommands: []
10016
+ };
10017
+ const read = {
10018
+ allowedPaths: [],
10019
+ deniedPaths: []
10020
+ };
10021
+ const write = {
10022
+ allowedPaths: [],
10023
+ deniedPaths: []
10024
+ };
10025
+ for (const [category, rules] of Object.entries(config.permission)) {
10026
+ for (const [pattern, action] of Object.entries(rules)) {
10027
+ if (action === "ask") {
10028
+ logger?.warn(`Kiro permissions do not support "ask". Skipping ${category}:${pattern}`);
10029
+ continue;
10030
+ }
10031
+ if (category === "bash") {
10032
+ (action === "allow" ? shell.allowedCommands : shell.deniedCommands).push(pattern);
10033
+ } else if (category === "read") {
10034
+ (action === "allow" ? read.allowedPaths : read.deniedPaths).push(pattern);
10035
+ } else if (category === "edit" || category === "write") {
10036
+ (action === "allow" ? write.allowedPaths : write.deniedPaths).push(pattern);
10037
+ } else if (category === "webfetch" || category === "websearch") {
10038
+ if (pattern !== "*") {
10039
+ logger?.warn(
10040
+ `Kiro ${category} supports only wildcard (*) via allowedTools. Skipping rule: ${pattern}`
10041
+ );
10042
+ continue;
10043
+ }
10044
+ if (action === "allow")
10045
+ nextAllowedTools.add(category === "webfetch" ? "web_fetch" : "web_search");
10046
+ } else {
10047
+ logger?.warn(`Kiro permissions do not support category: ${category}. Skipping.`);
10048
+ }
10049
+ }
10050
+ }
10051
+ nextToolsSettings.shell = shell;
10052
+ nextToolsSettings.read = read;
10053
+ nextToolsSettings.write = write;
10054
+ return {
10055
+ ...existing,
10056
+ allowedTools: [...nextAllowedTools].toSorted(),
10057
+ toolsSettings: nextToolsSettings
10058
+ };
10059
+ }
10060
+ function asRecord(value) {
10061
+ const result = UnknownRecordSchema.safeParse(value);
10062
+ return result.success ? result.data : {};
10063
+ }
10064
+ function asStringArray(value) {
10065
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
10066
+ }
10067
+
10068
+ // src/features/permissions/opencode-permissions.ts
10069
+ import { join as join66 } from "path";
10070
+ import { parse as parseJsonc5 } from "jsonc-parser";
10071
+ import { z as z31 } from "zod/mini";
10072
+ var OpencodePermissionSchema = z31.union([
10073
+ z31.enum(["allow", "ask", "deny"]),
10074
+ z31.record(z31.string(), z31.enum(["allow", "ask", "deny"]))
9685
10075
  ]);
9686
- var OpencodePermissionsConfigSchema = z30.looseObject({
9687
- permission: z30.optional(z30.record(z30.string(), OpencodePermissionSchema))
10076
+ var OpencodePermissionsConfigSchema = z31.looseObject({
10077
+ permission: z31.optional(z31.record(z31.string(), OpencodePermissionSchema))
9688
10078
  });
9689
10079
  var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9690
10080
  json;
@@ -9701,7 +10091,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9701
10091
  static getSettablePaths({
9702
10092
  global = false
9703
10093
  } = {}) {
9704
- return global ? { relativeDirPath: join65(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
10094
+ return global ? { relativeDirPath: join66(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9705
10095
  }
9706
10096
  static async fromFile({
9707
10097
  baseDir = process.cwd(),
@@ -9709,9 +10099,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9709
10099
  global = false
9710
10100
  }) {
9711
10101
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9712
- const jsonDir = join65(baseDir, basePaths.relativeDirPath);
9713
- const jsoncPath = join65(jsonDir, "opencode.jsonc");
9714
- const jsonPath = join65(jsonDir, "opencode.json");
10102
+ const jsonDir = join66(baseDir, basePaths.relativeDirPath);
10103
+ const jsoncPath = join66(jsonDir, "opencode.jsonc");
10104
+ const jsonPath = join66(jsonDir, "opencode.json");
9715
10105
  let fileContent = await readFileContentOrNull(jsoncPath);
9716
10106
  let relativeFilePath = "opencode.jsonc";
9717
10107
  if (!fileContent) {
@@ -9736,9 +10126,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9736
10126
  global = false
9737
10127
  }) {
9738
10128
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9739
- const jsonDir = join65(baseDir, basePaths.relativeDirPath);
9740
- const jsoncPath = join65(jsonDir, "opencode.jsonc");
9741
- const jsonPath = join65(jsonDir, "opencode.json");
10129
+ const jsonDir = join66(baseDir, basePaths.relativeDirPath);
10130
+ const jsoncPath = join66(jsonDir, "opencode.jsonc");
10131
+ const jsonPath = join66(jsonDir, "opencode.json");
9742
10132
  let fileContent = await readFileContentOrNull(jsoncPath);
9743
10133
  let relativeFilePath = "opencode.jsonc";
9744
10134
  if (!fileContent) {
@@ -9812,9 +10202,10 @@ var permissionsProcessorToolTargetTuple = [
9812
10202
  "claudecode",
9813
10203
  "codexcli",
9814
10204
  "geminicli",
10205
+ "kiro",
9815
10206
  "opencode"
9816
10207
  ];
9817
- var PermissionsProcessorToolTargetSchema = z31.enum(permissionsProcessorToolTargetTuple);
10208
+ var PermissionsProcessorToolTargetSchema = z32.enum(permissionsProcessorToolTargetTuple);
9818
10209
  var toolPermissionsFactories = /* @__PURE__ */ new Map([
9819
10210
  [
9820
10211
  "claudecode",
@@ -9822,7 +10213,7 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
9822
10213
  class: ClaudecodePermissions,
9823
10214
  meta: {
9824
10215
  supportsProject: true,
9825
- supportsGlobal: false,
10216
+ supportsGlobal: true,
9826
10217
  supportsImport: true
9827
10218
  }
9828
10219
  }
@@ -9849,6 +10240,17 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
9849
10240
  }
9850
10241
  }
9851
10242
  ],
10243
+ [
10244
+ "kiro",
10245
+ {
10246
+ class: KiroPermissions,
10247
+ meta: {
10248
+ supportsProject: true,
10249
+ supportsGlobal: false,
10250
+ supportsImport: true
10251
+ }
10252
+ }
10253
+ ],
9852
10254
  [
9853
10255
  "opencode",
9854
10256
  {
@@ -9944,7 +10346,14 @@ var PermissionsProcessor = class extends FeatureProcessor {
9944
10346
  logger: this.logger,
9945
10347
  global: this.global
9946
10348
  });
9947
- return [toolPermissions];
10349
+ if (this.toolTarget !== "codexcli") {
10350
+ return [toolPermissions];
10351
+ }
10352
+ const bashRulesFile = createCodexcliBashRulesFile({
10353
+ baseDir: this.baseDir,
10354
+ config: rulesyncPermissions.getJson()
10355
+ });
10356
+ return [toolPermissions, bashRulesFile];
9948
10357
  }
9949
10358
  async convertToolFilesToRulesyncFiles(toolFiles) {
9950
10359
  const permissions = toolFiles.filter((f) => f instanceof ToolPermissions);
@@ -9959,25 +10368,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
9959
10368
  };
9960
10369
 
9961
10370
  // src/features/rules/rules-processor.ts
9962
- import { basename as basename10, dirname as dirname3, join as join135, relative as relative5 } from "path";
10371
+ import { basename as basename10, dirname as dirname3, join as join136, relative as relative5 } from "path";
9963
10372
  import { encode } from "@toon-format/toon";
9964
- import { z as z70 } from "zod/mini";
10373
+ import { z as z71 } from "zod/mini";
9965
10374
 
9966
10375
  // src/constants/general.ts
9967
10376
  var SKILL_FILE_NAME = "SKILL.md";
9968
10377
 
9969
10378
  // src/features/skills/agentsmd-skill.ts
9970
- import { join as join69 } from "path";
10379
+ import { join as join70 } from "path";
9971
10380
 
9972
10381
  // src/features/skills/simulated-skill.ts
9973
- import { join as join68 } from "path";
9974
- import { z as z32 } from "zod/mini";
10382
+ import { join as join69 } from "path";
10383
+ import { z as z33 } from "zod/mini";
9975
10384
 
9976
10385
  // src/features/skills/tool-skill.ts
9977
- import { join as join67 } from "path";
10386
+ import { join as join68 } from "path";
9978
10387
 
9979
10388
  // src/types/ai-dir.ts
9980
- import path2, { basename as basename3, join as join66, relative as relative4, resolve as resolve4 } from "path";
10389
+ import path2, { basename as basename3, join as join67, relative as relative4, resolve as resolve4 } from "path";
9981
10390
  var AiDir = class {
9982
10391
  /**
9983
10392
  * @example "."
@@ -10074,8 +10483,8 @@ var AiDir = class {
10074
10483
  * @returns Array of files with their relative paths and buffers
10075
10484
  */
10076
10485
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
10077
- const dirPath = join66(baseDir, relativeDirPath, dirName);
10078
- const glob = join66(dirPath, "**", "*");
10486
+ const dirPath = join67(baseDir, relativeDirPath, dirName);
10487
+ const glob = join67(dirPath, "**", "*");
10079
10488
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
10080
10489
  const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
10081
10490
  const files = await Promise.all(
@@ -10176,8 +10585,8 @@ var ToolSkill = class extends AiDir {
10176
10585
  }) {
10177
10586
  const settablePaths = getSettablePaths({ global });
10178
10587
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
10179
- const skillDirPath = join67(baseDir, actualRelativeDirPath, dirName);
10180
- const skillFilePath = join67(skillDirPath, SKILL_FILE_NAME);
10588
+ const skillDirPath = join68(baseDir, actualRelativeDirPath, dirName);
10589
+ const skillFilePath = join68(skillDirPath, SKILL_FILE_NAME);
10181
10590
  if (!await fileExists(skillFilePath)) {
10182
10591
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
10183
10592
  }
@@ -10201,16 +10610,16 @@ var ToolSkill = class extends AiDir {
10201
10610
  }
10202
10611
  requireMainFileFrontmatter() {
10203
10612
  if (!this.mainFile?.frontmatter) {
10204
- throw new Error(`Frontmatter is not defined in ${join67(this.relativeDirPath, this.dirName)}`);
10613
+ throw new Error(`Frontmatter is not defined in ${join68(this.relativeDirPath, this.dirName)}`);
10205
10614
  }
10206
10615
  return this.mainFile.frontmatter;
10207
10616
  }
10208
10617
  };
10209
10618
 
10210
10619
  // src/features/skills/simulated-skill.ts
10211
- var SimulatedSkillFrontmatterSchema = z32.looseObject({
10212
- name: z32.string(),
10213
- description: z32.string()
10620
+ var SimulatedSkillFrontmatterSchema = z33.looseObject({
10621
+ name: z33.string(),
10622
+ description: z33.string()
10214
10623
  });
10215
10624
  var SimulatedSkill = class extends ToolSkill {
10216
10625
  frontmatter;
@@ -10241,7 +10650,7 @@ var SimulatedSkill = class extends ToolSkill {
10241
10650
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
10242
10651
  if (!result.success) {
10243
10652
  throw new Error(
10244
- `Invalid frontmatter in ${join68(relativeDirPath, dirName)}: ${formatError(result.error)}`
10653
+ `Invalid frontmatter in ${join69(relativeDirPath, dirName)}: ${formatError(result.error)}`
10245
10654
  );
10246
10655
  }
10247
10656
  }
@@ -10300,8 +10709,8 @@ var SimulatedSkill = class extends ToolSkill {
10300
10709
  }) {
10301
10710
  const settablePaths = this.getSettablePaths();
10302
10711
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
10303
- const skillDirPath = join68(baseDir, actualRelativeDirPath, dirName);
10304
- const skillFilePath = join68(skillDirPath, SKILL_FILE_NAME);
10712
+ const skillDirPath = join69(baseDir, actualRelativeDirPath, dirName);
10713
+ const skillFilePath = join69(skillDirPath, SKILL_FILE_NAME);
10305
10714
  if (!await fileExists(skillFilePath)) {
10306
10715
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
10307
10716
  }
@@ -10378,7 +10787,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
10378
10787
  throw new Error("AgentsmdSkill does not support global mode.");
10379
10788
  }
10380
10789
  return {
10381
- relativeDirPath: join69(".agents", "skills")
10790
+ relativeDirPath: join70(".agents", "skills")
10382
10791
  };
10383
10792
  }
10384
10793
  static async fromDir(params) {
@@ -10405,11 +10814,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
10405
10814
  };
10406
10815
 
10407
10816
  // src/features/skills/factorydroid-skill.ts
10408
- import { join as join70 } from "path";
10817
+ import { join as join71 } from "path";
10409
10818
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10410
10819
  static getSettablePaths(_options) {
10411
10820
  return {
10412
- relativeDirPath: join70(".factory", "skills")
10821
+ relativeDirPath: join71(".factory", "skills")
10413
10822
  };
10414
10823
  }
10415
10824
  static async fromDir(params) {
@@ -10436,50 +10845,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10436
10845
  };
10437
10846
 
10438
10847
  // src/features/skills/rovodev-skill.ts
10439
- import { join as join72 } from "path";
10440
- import { z as z34 } from "zod/mini";
10848
+ import { join as join73 } from "path";
10849
+ import { z as z35 } from "zod/mini";
10441
10850
 
10442
10851
  // src/features/skills/rulesync-skill.ts
10443
- import { join as join71 } from "path";
10444
- import { z as z33 } from "zod/mini";
10445
- var RulesyncSkillFrontmatterSchemaInternal = z33.looseObject({
10446
- name: z33.string(),
10447
- description: z33.string(),
10448
- targets: z33._default(RulesyncTargetsSchema, ["*"]),
10449
- claudecode: z33.optional(
10450
- z33.looseObject({
10451
- "allowed-tools": z33.optional(z33.array(z33.string())),
10452
- model: z33.optional(z33.string()),
10453
- "disable-model-invocation": z33.optional(z33.boolean())
10852
+ import { join as join72 } from "path";
10853
+ import { z as z34 } from "zod/mini";
10854
+ var RulesyncSkillFrontmatterSchemaInternal = z34.looseObject({
10855
+ name: z34.string(),
10856
+ description: z34.string(),
10857
+ targets: z34._default(RulesyncTargetsSchema, ["*"]),
10858
+ claudecode: z34.optional(
10859
+ z34.looseObject({
10860
+ "allowed-tools": z34.optional(z34.array(z34.string())),
10861
+ model: z34.optional(z34.string()),
10862
+ "disable-model-invocation": z34.optional(z34.boolean())
10454
10863
  })
10455
10864
  ),
10456
- codexcli: z33.optional(
10457
- z33.looseObject({
10458
- "short-description": z33.optional(z33.string())
10865
+ codexcli: z34.optional(
10866
+ z34.looseObject({
10867
+ "short-description": z34.optional(z34.string())
10459
10868
  })
10460
10869
  ),
10461
- opencode: z33.optional(
10462
- z33.looseObject({
10463
- "allowed-tools": z33.optional(z33.array(z33.string()))
10870
+ opencode: z34.optional(
10871
+ z34.looseObject({
10872
+ "allowed-tools": z34.optional(z34.array(z34.string()))
10464
10873
  })
10465
10874
  ),
10466
- kilo: z33.optional(
10467
- z33.looseObject({
10468
- "allowed-tools": z33.optional(z33.array(z33.string()))
10875
+ kilo: z34.optional(
10876
+ z34.looseObject({
10877
+ "allowed-tools": z34.optional(z34.array(z34.string()))
10469
10878
  })
10470
10879
  ),
10471
- deepagents: z33.optional(
10472
- z33.looseObject({
10473
- "allowed-tools": z33.optional(z33.array(z33.string()))
10880
+ deepagents: z34.optional(
10881
+ z34.looseObject({
10882
+ "allowed-tools": z34.optional(z34.array(z34.string()))
10474
10883
  })
10475
10884
  ),
10476
- copilot: z33.optional(
10477
- z33.looseObject({
10478
- license: z33.optional(z33.string())
10885
+ copilot: z34.optional(
10886
+ z34.looseObject({
10887
+ license: z34.optional(z34.string())
10479
10888
  })
10480
10889
  ),
10481
- cline: z33.optional(z33.looseObject({})),
10482
- roo: z33.optional(z33.looseObject({}))
10890
+ cline: z34.optional(z34.looseObject({})),
10891
+ roo: z34.optional(z34.looseObject({}))
10483
10892
  });
10484
10893
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
10485
10894
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -10519,7 +10928,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10519
10928
  }
10520
10929
  getFrontmatter() {
10521
10930
  if (!this.mainFile?.frontmatter) {
10522
- throw new Error(`Frontmatter is not defined in ${join71(this.relativeDirPath, this.dirName)}`);
10931
+ throw new Error(`Frontmatter is not defined in ${join72(this.relativeDirPath, this.dirName)}`);
10523
10932
  }
10524
10933
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
10525
10934
  return result;
@@ -10545,8 +10954,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10545
10954
  dirName,
10546
10955
  global = false
10547
10956
  }) {
10548
- const skillDirPath = join71(baseDir, relativeDirPath, dirName);
10549
- const skillFilePath = join71(skillDirPath, SKILL_FILE_NAME);
10957
+ const skillDirPath = join72(baseDir, relativeDirPath, dirName);
10958
+ const skillFilePath = join72(skillDirPath, SKILL_FILE_NAME);
10550
10959
  if (!await fileExists(skillFilePath)) {
10551
10960
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
10552
10961
  }
@@ -10576,14 +10985,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10576
10985
  };
10577
10986
 
10578
10987
  // src/features/skills/rovodev-skill.ts
10579
- var RovodevSkillFrontmatterSchema = z34.looseObject({
10580
- name: z34.string(),
10581
- description: z34.string()
10988
+ var RovodevSkillFrontmatterSchema = z35.looseObject({
10989
+ name: z35.string(),
10990
+ description: z35.string()
10582
10991
  });
10583
10992
  var RovodevSkill = class _RovodevSkill extends ToolSkill {
10584
10993
  constructor({
10585
10994
  baseDir = process.cwd(),
10586
- relativeDirPath = join72(".rovodev", "skills"),
10995
+ relativeDirPath = join73(".rovodev", "skills"),
10587
10996
  dirName,
10588
10997
  frontmatter,
10589
10998
  body,
@@ -10612,8 +11021,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10612
11021
  }
10613
11022
  static getSettablePaths(_options) {
10614
11023
  return {
10615
- relativeDirPath: join72(".rovodev", "skills"),
10616
- alternativeSkillRoots: [join72(".agents", "skills")]
11024
+ relativeDirPath: join73(".rovodev", "skills"),
11025
+ alternativeSkillRoots: [join73(".agents", "skills")]
10617
11026
  };
10618
11027
  }
10619
11028
  getFrontmatter() {
@@ -10701,13 +11110,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10701
11110
  });
10702
11111
  const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10703
11112
  if (!result.success) {
10704
- const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11113
+ const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10705
11114
  throw new Error(
10706
- `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11115
+ `Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10707
11116
  );
10708
11117
  }
10709
11118
  if (result.data.name !== loaded.dirName) {
10710
- const skillFilePath = join72(
11119
+ const skillFilePath = join73(
10711
11120
  loaded.baseDir,
10712
11121
  loaded.relativeDirPath,
10713
11122
  loaded.dirName,
@@ -10749,11 +11158,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10749
11158
  };
10750
11159
 
10751
11160
  // src/features/skills/skills-processor.ts
10752
- import { basename as basename5, join as join90 } from "path";
10753
- import { z as z50 } from "zod/mini";
11161
+ import { basename as basename5, join as join91 } from "path";
11162
+ import { z as z51 } from "zod/mini";
10754
11163
 
10755
11164
  // src/types/dir-feature-processor.ts
10756
- import { join as join73 } from "path";
11165
+ import { join as join74 } from "path";
10757
11166
  var DirFeatureProcessor = class {
10758
11167
  baseDir;
10759
11168
  dryRun;
@@ -10793,7 +11202,7 @@ var DirFeatureProcessor = class {
10793
11202
  const mainFile = aiDir.getMainFile();
10794
11203
  let mainFileContent;
10795
11204
  if (mainFile) {
10796
- const mainFilePath = join73(dirPath, mainFile.name);
11205
+ const mainFilePath = join74(dirPath, mainFile.name);
10797
11206
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
10798
11207
  avoidBlockScalars: this.avoidBlockScalars
10799
11208
  });
@@ -10813,7 +11222,7 @@ var DirFeatureProcessor = class {
10813
11222
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
10814
11223
  otherFileContents.push(contentWithNewline);
10815
11224
  if (!dirHasChanges) {
10816
- const filePath = join73(dirPath, file.relativeFilePathToDirPath);
11225
+ const filePath = join74(dirPath, file.relativeFilePathToDirPath);
10817
11226
  const existingContent = await readFileContentOrNull(filePath);
10818
11227
  if (!fileContentsEquivalent({
10819
11228
  filePath,
@@ -10831,24 +11240,24 @@ var DirFeatureProcessor = class {
10831
11240
  if (this.dryRun) {
10832
11241
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
10833
11242
  if (mainFile) {
10834
- this.logger.info(`[DRY RUN] Would write: ${join73(dirPath, mainFile.name)}`);
10835
- changedPaths.push(join73(relativeDir, mainFile.name));
11243
+ this.logger.info(`[DRY RUN] Would write: ${join74(dirPath, mainFile.name)}`);
11244
+ changedPaths.push(join74(relativeDir, mainFile.name));
10836
11245
  }
10837
11246
  for (const file of otherFiles) {
10838
11247
  this.logger.info(
10839
- `[DRY RUN] Would write: ${join73(dirPath, file.relativeFilePathToDirPath)}`
11248
+ `[DRY RUN] Would write: ${join74(dirPath, file.relativeFilePathToDirPath)}`
10840
11249
  );
10841
- changedPaths.push(join73(relativeDir, file.relativeFilePathToDirPath));
11250
+ changedPaths.push(join74(relativeDir, file.relativeFilePathToDirPath));
10842
11251
  }
10843
11252
  } else {
10844
11253
  await ensureDir(dirPath);
10845
11254
  if (mainFile && mainFileContent) {
10846
- const mainFilePath = join73(dirPath, mainFile.name);
11255
+ const mainFilePath = join74(dirPath, mainFile.name);
10847
11256
  await writeFileContent(mainFilePath, mainFileContent);
10848
- changedPaths.push(join73(relativeDir, mainFile.name));
11257
+ changedPaths.push(join74(relativeDir, mainFile.name));
10849
11258
  }
10850
11259
  for (const [i, file] of otherFiles.entries()) {
10851
- const filePath = join73(dirPath, file.relativeFilePathToDirPath);
11260
+ const filePath = join74(dirPath, file.relativeFilePathToDirPath);
10852
11261
  const content = otherFileContents[i];
10853
11262
  if (content === void 0) {
10854
11263
  throw new Error(
@@ -10856,7 +11265,7 @@ var DirFeatureProcessor = class {
10856
11265
  );
10857
11266
  }
10858
11267
  await writeFileContent(filePath, content);
10859
- changedPaths.push(join73(relativeDir, file.relativeFilePathToDirPath));
11268
+ changedPaths.push(join74(relativeDir, file.relativeFilePathToDirPath));
10860
11269
  }
10861
11270
  }
10862
11271
  changedCount++;
@@ -10888,16 +11297,16 @@ var DirFeatureProcessor = class {
10888
11297
  };
10889
11298
 
10890
11299
  // src/features/skills/agentsskills-skill.ts
10891
- import { join as join74 } from "path";
10892
- import { z as z35 } from "zod/mini";
10893
- var AgentsSkillsSkillFrontmatterSchema = z35.looseObject({
10894
- name: z35.string(),
10895
- description: z35.string()
11300
+ import { join as join75 } from "path";
11301
+ import { z as z36 } from "zod/mini";
11302
+ var AgentsSkillsSkillFrontmatterSchema = z36.looseObject({
11303
+ name: z36.string(),
11304
+ description: z36.string()
10896
11305
  });
10897
11306
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10898
11307
  constructor({
10899
11308
  baseDir = process.cwd(),
10900
- relativeDirPath = join74(".agents", "skills"),
11309
+ relativeDirPath = join75(".agents", "skills"),
10901
11310
  dirName,
10902
11311
  frontmatter,
10903
11312
  body,
@@ -10929,7 +11338,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10929
11338
  throw new Error("AgentsSkillsSkill does not support global mode.");
10930
11339
  }
10931
11340
  return {
10932
- relativeDirPath: join74(".agents", "skills")
11341
+ relativeDirPath: join75(".agents", "skills")
10933
11342
  };
10934
11343
  }
10935
11344
  getFrontmatter() {
@@ -11009,9 +11418,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
11009
11418
  });
11010
11419
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11011
11420
  if (!result.success) {
11012
- const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11421
+ const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11013
11422
  throw new Error(
11014
- `Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11423
+ `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11015
11424
  );
11016
11425
  }
11017
11426
  return new _AgentsSkillsSkill({
@@ -11046,16 +11455,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
11046
11455
  };
11047
11456
 
11048
11457
  // src/features/skills/antigravity-skill.ts
11049
- import { join as join75 } from "path";
11050
- import { z as z36 } from "zod/mini";
11051
- var AntigravitySkillFrontmatterSchema = z36.looseObject({
11052
- name: z36.string(),
11053
- description: z36.string()
11458
+ import { join as join76 } from "path";
11459
+ import { z as z37 } from "zod/mini";
11460
+ var AntigravitySkillFrontmatterSchema = z37.looseObject({
11461
+ name: z37.string(),
11462
+ description: z37.string()
11054
11463
  });
11055
11464
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
11056
11465
  constructor({
11057
11466
  baseDir = process.cwd(),
11058
- relativeDirPath = join75(".agent", "skills"),
11467
+ relativeDirPath = join76(".agent", "skills"),
11059
11468
  dirName,
11060
11469
  frontmatter,
11061
11470
  body,
@@ -11087,11 +11496,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
11087
11496
  } = {}) {
11088
11497
  if (global) {
11089
11498
  return {
11090
- relativeDirPath: join75(".gemini", "antigravity", "skills")
11499
+ relativeDirPath: join76(".gemini", "antigravity", "skills")
11091
11500
  };
11092
11501
  }
11093
11502
  return {
11094
- relativeDirPath: join75(".agent", "skills")
11503
+ relativeDirPath: join76(".agent", "skills")
11095
11504
  };
11096
11505
  }
11097
11506
  getFrontmatter() {
@@ -11171,9 +11580,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
11171
11580
  });
11172
11581
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
11173
11582
  if (!result.success) {
11174
- const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11583
+ const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11175
11584
  throw new Error(
11176
- `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11585
+ `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11177
11586
  );
11178
11587
  }
11179
11588
  return new _AntigravitySkill({
@@ -11207,19 +11616,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
11207
11616
  };
11208
11617
 
11209
11618
  // src/features/skills/claudecode-skill.ts
11210
- import { join as join76 } from "path";
11211
- import { z as z37 } from "zod/mini";
11212
- var ClaudecodeSkillFrontmatterSchema = z37.looseObject({
11213
- name: z37.string(),
11214
- description: z37.string(),
11215
- "allowed-tools": z37.optional(z37.array(z37.string())),
11216
- model: z37.optional(z37.string()),
11217
- "disable-model-invocation": z37.optional(z37.boolean())
11619
+ import { join as join77 } from "path";
11620
+ import { z as z38 } from "zod/mini";
11621
+ var ClaudecodeSkillFrontmatterSchema = z38.looseObject({
11622
+ name: z38.string(),
11623
+ description: z38.string(),
11624
+ "allowed-tools": z38.optional(z38.array(z38.string())),
11625
+ model: z38.optional(z38.string()),
11626
+ "disable-model-invocation": z38.optional(z38.boolean())
11218
11627
  });
11219
11628
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
11220
11629
  constructor({
11221
11630
  baseDir = process.cwd(),
11222
- relativeDirPath = join76(".claude", "skills"),
11631
+ relativeDirPath = join77(".claude", "skills"),
11223
11632
  dirName,
11224
11633
  frontmatter,
11225
11634
  body,
@@ -11250,7 +11659,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
11250
11659
  global: _global = false
11251
11660
  } = {}) {
11252
11661
  return {
11253
- relativeDirPath: join76(".claude", "skills")
11662
+ relativeDirPath: join77(".claude", "skills")
11254
11663
  };
11255
11664
  }
11256
11665
  getFrontmatter() {
@@ -11347,9 +11756,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
11347
11756
  });
11348
11757
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11349
11758
  if (!result.success) {
11350
- const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11759
+ const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11351
11760
  throw new Error(
11352
- `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11761
+ `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11353
11762
  );
11354
11763
  }
11355
11764
  return new _ClaudecodeSkill({
@@ -11383,16 +11792,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
11383
11792
  };
11384
11793
 
11385
11794
  // src/features/skills/cline-skill.ts
11386
- import { join as join77 } from "path";
11387
- import { z as z38 } from "zod/mini";
11388
- var ClineSkillFrontmatterSchema = z38.looseObject({
11389
- name: z38.string(),
11390
- description: z38.string()
11795
+ import { join as join78 } from "path";
11796
+ import { z as z39 } from "zod/mini";
11797
+ var ClineSkillFrontmatterSchema = z39.looseObject({
11798
+ name: z39.string(),
11799
+ description: z39.string()
11391
11800
  });
11392
11801
  var ClineSkill = class _ClineSkill extends ToolSkill {
11393
11802
  constructor({
11394
11803
  baseDir = process.cwd(),
11395
- relativeDirPath = join77(".cline", "skills"),
11804
+ relativeDirPath = join78(".cline", "skills"),
11396
11805
  dirName,
11397
11806
  frontmatter,
11398
11807
  body,
@@ -11421,7 +11830,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11421
11830
  }
11422
11831
  static getSettablePaths(_options = {}) {
11423
11832
  return {
11424
- relativeDirPath: join77(".cline", "skills")
11833
+ relativeDirPath: join78(".cline", "skills")
11425
11834
  };
11426
11835
  }
11427
11836
  getFrontmatter() {
@@ -11509,13 +11918,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11509
11918
  });
11510
11919
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11511
11920
  if (!result.success) {
11512
- const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11921
+ const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11513
11922
  throw new Error(
11514
- `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11923
+ `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11515
11924
  );
11516
11925
  }
11517
11926
  if (result.data.name !== loaded.dirName) {
11518
- const skillFilePath = join77(
11927
+ const skillFilePath = join78(
11519
11928
  loaded.baseDir,
11520
11929
  loaded.relativeDirPath,
11521
11930
  loaded.dirName,
@@ -11556,21 +11965,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11556
11965
  };
11557
11966
 
11558
11967
  // src/features/skills/codexcli-skill.ts
11559
- import { join as join78 } from "path";
11560
- import { z as z39 } from "zod/mini";
11561
- var CodexCliSkillFrontmatterSchema = z39.looseObject({
11562
- name: z39.string(),
11563
- description: z39.string(),
11564
- metadata: z39.optional(
11565
- z39.looseObject({
11566
- "short-description": z39.optional(z39.string())
11968
+ import { join as join79 } from "path";
11969
+ import { z as z40 } from "zod/mini";
11970
+ var CodexCliSkillFrontmatterSchema = z40.looseObject({
11971
+ name: z40.string(),
11972
+ description: z40.string(),
11973
+ metadata: z40.optional(
11974
+ z40.looseObject({
11975
+ "short-description": z40.optional(z40.string())
11567
11976
  })
11568
11977
  )
11569
11978
  });
11570
11979
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11571
11980
  constructor({
11572
11981
  baseDir = process.cwd(),
11573
- relativeDirPath = join78(".codex", "skills"),
11982
+ relativeDirPath = join79(".codex", "skills"),
11574
11983
  dirName,
11575
11984
  frontmatter,
11576
11985
  body,
@@ -11601,7 +12010,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11601
12010
  global: _global = false
11602
12011
  } = {}) {
11603
12012
  return {
11604
- relativeDirPath: join78(".codex", "skills")
12013
+ relativeDirPath: join79(".codex", "skills")
11605
12014
  };
11606
12015
  }
11607
12016
  getFrontmatter() {
@@ -11691,9 +12100,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11691
12100
  });
11692
12101
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11693
12102
  if (!result.success) {
11694
- const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12103
+ const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11695
12104
  throw new Error(
11696
- `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12105
+ `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11697
12106
  );
11698
12107
  }
11699
12108
  return new _CodexCliSkill({
@@ -11727,17 +12136,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11727
12136
  };
11728
12137
 
11729
12138
  // src/features/skills/copilot-skill.ts
11730
- import { join as join79 } from "path";
11731
- import { z as z40 } from "zod/mini";
11732
- var CopilotSkillFrontmatterSchema = z40.looseObject({
11733
- name: z40.string(),
11734
- description: z40.string(),
11735
- license: z40.optional(z40.string())
12139
+ import { join as join80 } from "path";
12140
+ import { z as z41 } from "zod/mini";
12141
+ var CopilotSkillFrontmatterSchema = z41.looseObject({
12142
+ name: z41.string(),
12143
+ description: z41.string(),
12144
+ license: z41.optional(z41.string())
11736
12145
  });
11737
12146
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
11738
12147
  constructor({
11739
12148
  baseDir = process.cwd(),
11740
- relativeDirPath = join79(".github", "skills"),
12149
+ relativeDirPath = join80(".github", "skills"),
11741
12150
  dirName,
11742
12151
  frontmatter,
11743
12152
  body,
@@ -11769,7 +12178,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11769
12178
  throw new Error("CopilotSkill does not support global mode.");
11770
12179
  }
11771
12180
  return {
11772
- relativeDirPath: join79(".github", "skills")
12181
+ relativeDirPath: join80(".github", "skills")
11773
12182
  };
11774
12183
  }
11775
12184
  getFrontmatter() {
@@ -11855,9 +12264,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11855
12264
  });
11856
12265
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11857
12266
  if (!result.success) {
11858
- const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12267
+ const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11859
12268
  throw new Error(
11860
- `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12269
+ `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11861
12270
  );
11862
12271
  }
11863
12272
  return new _CopilotSkill({
@@ -11892,16 +12301,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11892
12301
  };
11893
12302
 
11894
12303
  // src/features/skills/cursor-skill.ts
11895
- import { join as join80 } from "path";
11896
- import { z as z41 } from "zod/mini";
11897
- var CursorSkillFrontmatterSchema = z41.looseObject({
11898
- name: z41.string(),
11899
- description: z41.string()
12304
+ import { join as join81 } from "path";
12305
+ import { z as z42 } from "zod/mini";
12306
+ var CursorSkillFrontmatterSchema = z42.looseObject({
12307
+ name: z42.string(),
12308
+ description: z42.string()
11900
12309
  });
11901
12310
  var CursorSkill = class _CursorSkill extends ToolSkill {
11902
12311
  constructor({
11903
12312
  baseDir = process.cwd(),
11904
- relativeDirPath = join80(".cursor", "skills"),
12313
+ relativeDirPath = join81(".cursor", "skills"),
11905
12314
  dirName,
11906
12315
  frontmatter,
11907
12316
  body,
@@ -11930,7 +12339,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11930
12339
  }
11931
12340
  static getSettablePaths(_options) {
11932
12341
  return {
11933
- relativeDirPath: join80(".cursor", "skills")
12342
+ relativeDirPath: join81(".cursor", "skills")
11934
12343
  };
11935
12344
  }
11936
12345
  getFrontmatter() {
@@ -12010,9 +12419,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
12010
12419
  });
12011
12420
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12012
12421
  if (!result.success) {
12013
- const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12422
+ const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12014
12423
  throw new Error(
12015
- `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12424
+ `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12016
12425
  );
12017
12426
  }
12018
12427
  return new _CursorSkill({
@@ -12047,17 +12456,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
12047
12456
  };
12048
12457
 
12049
12458
  // src/features/skills/deepagents-skill.ts
12050
- import { join as join81 } from "path";
12051
- import { z as z42 } from "zod/mini";
12052
- var DeepagentsSkillFrontmatterSchema = z42.looseObject({
12053
- name: z42.string(),
12054
- description: z42.string(),
12055
- "allowed-tools": z42.optional(z42.array(z42.string()))
12459
+ import { join as join82 } from "path";
12460
+ import { z as z43 } from "zod/mini";
12461
+ var DeepagentsSkillFrontmatterSchema = z43.looseObject({
12462
+ name: z43.string(),
12463
+ description: z43.string(),
12464
+ "allowed-tools": z43.optional(z43.array(z43.string()))
12056
12465
  });
12057
12466
  var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
12058
12467
  constructor({
12059
12468
  baseDir = process.cwd(),
12060
- relativeDirPath = join81(".deepagents", "skills"),
12469
+ relativeDirPath = join82(".deepagents", "skills"),
12061
12470
  dirName,
12062
12471
  frontmatter,
12063
12472
  body,
@@ -12086,7 +12495,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
12086
12495
  }
12087
12496
  static getSettablePaths(_options) {
12088
12497
  return {
12089
- relativeDirPath: join81(".deepagents", "skills")
12498
+ relativeDirPath: join82(".deepagents", "skills")
12090
12499
  };
12091
12500
  }
12092
12501
  getFrontmatter() {
@@ -12172,9 +12581,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
12172
12581
  });
12173
12582
  const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12174
12583
  if (!result.success) {
12175
- const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12584
+ const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12176
12585
  throw new Error(
12177
- `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12586
+ `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12178
12587
  );
12179
12588
  }
12180
12589
  return new _DeepagentsSkill({
@@ -12209,11 +12618,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
12209
12618
  };
12210
12619
 
12211
12620
  // src/features/skills/geminicli-skill.ts
12212
- import { join as join82 } from "path";
12213
- import { z as z43 } from "zod/mini";
12214
- var GeminiCliSkillFrontmatterSchema = z43.looseObject({
12215
- name: z43.string(),
12216
- description: z43.string()
12621
+ import { join as join83 } from "path";
12622
+ import { z as z44 } from "zod/mini";
12623
+ var GeminiCliSkillFrontmatterSchema = z44.looseObject({
12624
+ name: z44.string(),
12625
+ description: z44.string()
12217
12626
  });
12218
12627
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
12219
12628
  constructor({
@@ -12249,7 +12658,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
12249
12658
  global: _global = false
12250
12659
  } = {}) {
12251
12660
  return {
12252
- relativeDirPath: join82(".gemini", "skills")
12661
+ relativeDirPath: join83(".gemini", "skills")
12253
12662
  };
12254
12663
  }
12255
12664
  getFrontmatter() {
@@ -12329,9 +12738,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
12329
12738
  });
12330
12739
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12331
12740
  if (!result.success) {
12332
- const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12741
+ const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12333
12742
  throw new Error(
12334
- `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12743
+ `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12335
12744
  );
12336
12745
  }
12337
12746
  return new _GeminiCliSkill({
@@ -12366,16 +12775,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
12366
12775
  };
12367
12776
 
12368
12777
  // src/features/skills/junie-skill.ts
12369
- import { join as join83 } from "path";
12370
- import { z as z44 } from "zod/mini";
12371
- var JunieSkillFrontmatterSchema = z44.looseObject({
12372
- name: z44.string(),
12373
- description: z44.string()
12778
+ import { join as join84 } from "path";
12779
+ import { z as z45 } from "zod/mini";
12780
+ var JunieSkillFrontmatterSchema = z45.looseObject({
12781
+ name: z45.string(),
12782
+ description: z45.string()
12374
12783
  });
12375
12784
  var JunieSkill = class _JunieSkill extends ToolSkill {
12376
12785
  constructor({
12377
12786
  baseDir = process.cwd(),
12378
- relativeDirPath = join83(".junie", "skills"),
12787
+ relativeDirPath = join84(".junie", "skills"),
12379
12788
  dirName,
12380
12789
  frontmatter,
12381
12790
  body,
@@ -12407,7 +12816,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12407
12816
  throw new Error("JunieSkill does not support global mode.");
12408
12817
  }
12409
12818
  return {
12410
- relativeDirPath: join83(".junie", "skills")
12819
+ relativeDirPath: join84(".junie", "skills")
12411
12820
  };
12412
12821
  }
12413
12822
  getFrontmatter() {
@@ -12494,13 +12903,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12494
12903
  });
12495
12904
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12496
12905
  if (!result.success) {
12497
- const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12906
+ const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12498
12907
  throw new Error(
12499
- `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12908
+ `Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12500
12909
  );
12501
12910
  }
12502
12911
  if (result.data.name !== loaded.dirName) {
12503
- const skillFilePath = join83(
12912
+ const skillFilePath = join84(
12504
12913
  loaded.baseDir,
12505
12914
  loaded.relativeDirPath,
12506
12915
  loaded.dirName,
@@ -12542,17 +12951,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12542
12951
  };
12543
12952
 
12544
12953
  // src/features/skills/kilo-skill.ts
12545
- import { join as join84 } from "path";
12546
- import { z as z45 } from "zod/mini";
12547
- var KiloSkillFrontmatterSchema = z45.looseObject({
12548
- name: z45.string(),
12549
- description: z45.string(),
12550
- "allowed-tools": z45.optional(z45.array(z45.string()))
12954
+ import { join as join85 } from "path";
12955
+ import { z as z46 } from "zod/mini";
12956
+ var KiloSkillFrontmatterSchema = z46.looseObject({
12957
+ name: z46.string(),
12958
+ description: z46.string(),
12959
+ "allowed-tools": z46.optional(z46.array(z46.string()))
12551
12960
  });
12552
12961
  var KiloSkill = class _KiloSkill extends ToolSkill {
12553
12962
  constructor({
12554
12963
  baseDir = process.cwd(),
12555
- relativeDirPath = join84(".kilo", "skills"),
12964
+ relativeDirPath = join85(".kilo", "skills"),
12556
12965
  dirName,
12557
12966
  frontmatter,
12558
12967
  body,
@@ -12581,7 +12990,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12581
12990
  }
12582
12991
  static getSettablePaths({ global = false } = {}) {
12583
12992
  return {
12584
- relativeDirPath: global ? join84(".config", "kilo", "skills") : join84(".kilo", "skills")
12993
+ relativeDirPath: global ? join85(".config", "kilo", "skills") : join85(".kilo", "skills")
12585
12994
  };
12586
12995
  }
12587
12996
  getFrontmatter() {
@@ -12667,9 +13076,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12667
13076
  });
12668
13077
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12669
13078
  if (!result.success) {
12670
- const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13079
+ const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12671
13080
  throw new Error(
12672
- `Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13081
+ `Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12673
13082
  );
12674
13083
  }
12675
13084
  return new _KiloSkill({
@@ -12703,16 +13112,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12703
13112
  };
12704
13113
 
12705
13114
  // src/features/skills/kiro-skill.ts
12706
- import { join as join85 } from "path";
12707
- import { z as z46 } from "zod/mini";
12708
- var KiroSkillFrontmatterSchema = z46.looseObject({
12709
- name: z46.string(),
12710
- description: z46.string()
13115
+ import { join as join86 } from "path";
13116
+ import { z as z47 } from "zod/mini";
13117
+ var KiroSkillFrontmatterSchema = z47.looseObject({
13118
+ name: z47.string(),
13119
+ description: z47.string()
12711
13120
  });
12712
13121
  var KiroSkill = class _KiroSkill extends ToolSkill {
12713
13122
  constructor({
12714
13123
  baseDir = process.cwd(),
12715
- relativeDirPath = join85(".kiro", "skills"),
13124
+ relativeDirPath = join86(".kiro", "skills"),
12716
13125
  dirName,
12717
13126
  frontmatter,
12718
13127
  body,
@@ -12744,7 +13153,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12744
13153
  throw new Error("KiroSkill does not support global mode.");
12745
13154
  }
12746
13155
  return {
12747
- relativeDirPath: join85(".kiro", "skills")
13156
+ relativeDirPath: join86(".kiro", "skills")
12748
13157
  };
12749
13158
  }
12750
13159
  getFrontmatter() {
@@ -12832,13 +13241,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12832
13241
  });
12833
13242
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12834
13243
  if (!result.success) {
12835
- const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13244
+ const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12836
13245
  throw new Error(
12837
- `Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13246
+ `Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12838
13247
  );
12839
13248
  }
12840
13249
  if (result.data.name !== loaded.dirName) {
12841
- const skillFilePath = join85(
13250
+ const skillFilePath = join86(
12842
13251
  loaded.baseDir,
12843
13252
  loaded.relativeDirPath,
12844
13253
  loaded.dirName,
@@ -12880,17 +13289,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12880
13289
  };
12881
13290
 
12882
13291
  // src/features/skills/opencode-skill.ts
12883
- import { join as join86 } from "path";
12884
- import { z as z47 } from "zod/mini";
12885
- var OpenCodeSkillFrontmatterSchema = z47.looseObject({
12886
- name: z47.string(),
12887
- description: z47.string(),
12888
- "allowed-tools": z47.optional(z47.array(z47.string()))
13292
+ import { join as join87 } from "path";
13293
+ import { z as z48 } from "zod/mini";
13294
+ var OpenCodeSkillFrontmatterSchema = z48.looseObject({
13295
+ name: z48.string(),
13296
+ description: z48.string(),
13297
+ "allowed-tools": z48.optional(z48.array(z48.string()))
12889
13298
  });
12890
13299
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12891
13300
  constructor({
12892
13301
  baseDir = process.cwd(),
12893
- relativeDirPath = join86(".opencode", "skill"),
13302
+ relativeDirPath = join87(".opencode", "skill"),
12894
13303
  dirName,
12895
13304
  frontmatter,
12896
13305
  body,
@@ -12919,7 +13328,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12919
13328
  }
12920
13329
  static getSettablePaths({ global = false } = {}) {
12921
13330
  return {
12922
- relativeDirPath: global ? join86(".config", "opencode", "skill") : join86(".opencode", "skill")
13331
+ relativeDirPath: global ? join87(".config", "opencode", "skill") : join87(".opencode", "skill")
12923
13332
  };
12924
13333
  }
12925
13334
  getFrontmatter() {
@@ -13005,9 +13414,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
13005
13414
  });
13006
13415
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
13007
13416
  if (!result.success) {
13008
- const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13417
+ const skillDirPath = join87(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13009
13418
  throw new Error(
13010
- `Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13419
+ `Invalid frontmatter in ${join87(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13011
13420
  );
13012
13421
  }
13013
13422
  return new _OpenCodeSkill({
@@ -13041,16 +13450,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
13041
13450
  };
13042
13451
 
13043
13452
  // src/features/skills/replit-skill.ts
13044
- import { join as join87 } from "path";
13045
- import { z as z48 } from "zod/mini";
13046
- var ReplitSkillFrontmatterSchema = z48.looseObject({
13047
- name: z48.string(),
13048
- description: z48.string()
13453
+ import { join as join88 } from "path";
13454
+ import { z as z49 } from "zod/mini";
13455
+ var ReplitSkillFrontmatterSchema = z49.looseObject({
13456
+ name: z49.string(),
13457
+ description: z49.string()
13049
13458
  });
13050
13459
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
13051
13460
  constructor({
13052
13461
  baseDir = process.cwd(),
13053
- relativeDirPath = join87(".agents", "skills"),
13462
+ relativeDirPath = join88(".agents", "skills"),
13054
13463
  dirName,
13055
13464
  frontmatter,
13056
13465
  body,
@@ -13082,7 +13491,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
13082
13491
  throw new Error("ReplitSkill does not support global mode.");
13083
13492
  }
13084
13493
  return {
13085
- relativeDirPath: join87(".agents", "skills")
13494
+ relativeDirPath: join88(".agents", "skills")
13086
13495
  };
13087
13496
  }
13088
13497
  getFrontmatter() {
@@ -13162,9 +13571,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
13162
13571
  });
13163
13572
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
13164
13573
  if (!result.success) {
13165
- const skillDirPath = join87(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13574
+ const skillDirPath = join88(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13166
13575
  throw new Error(
13167
- `Invalid frontmatter in ${join87(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13576
+ `Invalid frontmatter in ${join88(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13168
13577
  );
13169
13578
  }
13170
13579
  return new _ReplitSkill({
@@ -13199,16 +13608,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
13199
13608
  };
13200
13609
 
13201
13610
  // src/features/skills/roo-skill.ts
13202
- import { join as join88 } from "path";
13203
- import { z as z49 } from "zod/mini";
13204
- var RooSkillFrontmatterSchema = z49.looseObject({
13205
- name: z49.string(),
13206
- description: z49.string()
13611
+ import { join as join89 } from "path";
13612
+ import { z as z50 } from "zod/mini";
13613
+ var RooSkillFrontmatterSchema = z50.looseObject({
13614
+ name: z50.string(),
13615
+ description: z50.string()
13207
13616
  });
13208
13617
  var RooSkill = class _RooSkill extends ToolSkill {
13209
13618
  constructor({
13210
13619
  baseDir = process.cwd(),
13211
- relativeDirPath = join88(".roo", "skills"),
13620
+ relativeDirPath = join89(".roo", "skills"),
13212
13621
  dirName,
13213
13622
  frontmatter,
13214
13623
  body,
@@ -13239,7 +13648,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
13239
13648
  global: _global = false
13240
13649
  } = {}) {
13241
13650
  return {
13242
- relativeDirPath: join88(".roo", "skills")
13651
+ relativeDirPath: join89(".roo", "skills")
13243
13652
  };
13244
13653
  }
13245
13654
  getFrontmatter() {
@@ -13327,13 +13736,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
13327
13736
  });
13328
13737
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
13329
13738
  if (!result.success) {
13330
- const skillDirPath = join88(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13739
+ const skillDirPath = join89(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13331
13740
  throw new Error(
13332
- `Invalid frontmatter in ${join88(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13741
+ `Invalid frontmatter in ${join89(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13333
13742
  );
13334
13743
  }
13335
13744
  if (result.data.name !== loaded.dirName) {
13336
- const skillFilePath = join88(
13745
+ const skillFilePath = join89(
13337
13746
  loaded.baseDir,
13338
13747
  loaded.relativeDirPath,
13339
13748
  loaded.dirName,
@@ -13374,14 +13783,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
13374
13783
  };
13375
13784
 
13376
13785
  // src/features/skills/skills-utils.ts
13377
- import { basename as basename4, join as join89 } from "path";
13786
+ import { basename as basename4, join as join90 } from "path";
13378
13787
  async function getLocalSkillDirNames(baseDir) {
13379
- const skillsDir = join89(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
13788
+ const skillsDir = join90(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
13380
13789
  const names = /* @__PURE__ */ new Set();
13381
13790
  if (!await directoryExists(skillsDir)) {
13382
13791
  return names;
13383
13792
  }
13384
- const dirPaths = await findFilesByGlobs(join89(skillsDir, "*"), { type: "dir" });
13793
+ const dirPaths = await findFilesByGlobs(join90(skillsDir, "*"), { type: "dir" });
13385
13794
  for (const dirPath of dirPaths) {
13386
13795
  const name = basename4(dirPath);
13387
13796
  if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
@@ -13412,7 +13821,7 @@ var skillsProcessorToolTargetTuple = [
13412
13821
  "roo",
13413
13822
  "rovodev"
13414
13823
  ];
13415
- var SkillsProcessorToolTargetSchema = z50.enum(skillsProcessorToolTargetTuple);
13824
+ var SkillsProcessorToolTargetSchema = z51.enum(skillsProcessorToolTargetTuple);
13416
13825
  var toolSkillFactories = /* @__PURE__ */ new Map([
13417
13826
  [
13418
13827
  "agentsmd",
@@ -13636,10 +14045,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13636
14045
  )
13637
14046
  );
13638
14047
  const localSkillNames = new Set(localDirNames);
13639
- const curatedDirPath = join90(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
14048
+ const curatedDirPath = join91(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13640
14049
  let curatedSkills = [];
13641
14050
  if (await directoryExists(curatedDirPath)) {
13642
- const curatedDirPaths = await findFilesByGlobs(join90(curatedDirPath, "*"), { type: "dir" });
14051
+ const curatedDirPaths = await findFilesByGlobs(join91(curatedDirPath, "*"), { type: "dir" });
13643
14052
  const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
13644
14053
  const nonConflicting = curatedDirNames.filter((name) => {
13645
14054
  if (localSkillNames.has(name)) {
@@ -13677,11 +14086,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13677
14086
  const seenDirNames = /* @__PURE__ */ new Set();
13678
14087
  const loadEntries = [];
13679
14088
  for (const root of roots) {
13680
- const skillsDirPath = join90(this.baseDir, root);
14089
+ const skillsDirPath = join91(this.baseDir, root);
13681
14090
  if (!await directoryExists(skillsDirPath)) {
13682
14091
  continue;
13683
14092
  }
13684
- const dirPaths = await findFilesByGlobs(join90(skillsDirPath, "*"), { type: "dir" });
14093
+ const dirPaths = await findFilesByGlobs(join91(skillsDirPath, "*"), { type: "dir" });
13685
14094
  for (const dirPath of dirPaths) {
13686
14095
  const dirName = basename5(dirPath);
13687
14096
  if (seenDirNames.has(dirName)) {
@@ -13712,11 +14121,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13712
14121
  const roots = toolSkillSearchRoots(paths);
13713
14122
  const toolSkills = [];
13714
14123
  for (const root of roots) {
13715
- const skillsDirPath = join90(this.baseDir, root);
14124
+ const skillsDirPath = join91(this.baseDir, root);
13716
14125
  if (!await directoryExists(skillsDirPath)) {
13717
14126
  continue;
13718
14127
  }
13719
- const dirPaths = await findFilesByGlobs(join90(skillsDirPath, "*"), { type: "dir" });
14128
+ const dirPaths = await findFilesByGlobs(join91(skillsDirPath, "*"), { type: "dir" });
13720
14129
  for (const dirPath of dirPaths) {
13721
14130
  const dirName = basename5(dirPath);
13722
14131
  const toolSkill = factory.class.forDeletion({
@@ -13780,11 +14189,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13780
14189
  };
13781
14190
 
13782
14191
  // src/features/subagents/agentsmd-subagent.ts
13783
- import { join as join92 } from "path";
14192
+ import { join as join93 } from "path";
13784
14193
 
13785
14194
  // src/features/subagents/simulated-subagent.ts
13786
- import { basename as basename6, join as join91 } from "path";
13787
- import { z as z51 } from "zod/mini";
14195
+ import { basename as basename6, join as join92 } from "path";
14196
+ import { z as z52 } from "zod/mini";
13788
14197
 
13789
14198
  // src/features/subagents/tool-subagent.ts
13790
14199
  var ToolSubagent = class extends ToolFile {
@@ -13836,9 +14245,9 @@ var ToolSubagent = class extends ToolFile {
13836
14245
  };
13837
14246
 
13838
14247
  // src/features/subagents/simulated-subagent.ts
13839
- var SimulatedSubagentFrontmatterSchema = z51.object({
13840
- name: z51.string(),
13841
- description: z51.optional(z51.string())
14248
+ var SimulatedSubagentFrontmatterSchema = z52.object({
14249
+ name: z52.string(),
14250
+ description: z52.optional(z52.string())
13842
14251
  });
13843
14252
  var SimulatedSubagent = class extends ToolSubagent {
13844
14253
  frontmatter;
@@ -13848,7 +14257,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13848
14257
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
13849
14258
  if (!result.success) {
13850
14259
  throw new Error(
13851
- `Invalid frontmatter in ${join91(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14260
+ `Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13852
14261
  );
13853
14262
  }
13854
14263
  }
@@ -13899,7 +14308,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13899
14308
  return {
13900
14309
  success: false,
13901
14310
  error: new Error(
13902
- `Invalid frontmatter in ${join91(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14311
+ `Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13903
14312
  )
13904
14313
  };
13905
14314
  }
@@ -13909,7 +14318,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13909
14318
  relativeFilePath,
13910
14319
  validate = true
13911
14320
  }) {
13912
- const filePath = join91(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
14321
+ const filePath = join92(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13913
14322
  const fileContent = await readFileContent(filePath);
13914
14323
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13915
14324
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13945,7 +14354,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13945
14354
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13946
14355
  static getSettablePaths() {
13947
14356
  return {
13948
- relativeDirPath: join92(".agents", "subagents")
14357
+ relativeDirPath: join93(".agents", "subagents")
13949
14358
  };
13950
14359
  }
13951
14360
  static async fromFile(params) {
@@ -13968,11 +14377,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13968
14377
  };
13969
14378
 
13970
14379
  // src/features/subagents/factorydroid-subagent.ts
13971
- import { join as join93 } from "path";
14380
+ import { join as join94 } from "path";
13972
14381
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
13973
14382
  static getSettablePaths(_options) {
13974
14383
  return {
13975
- relativeDirPath: join93(".factory", "droids")
14384
+ relativeDirPath: join94(".factory", "droids")
13976
14385
  };
13977
14386
  }
13978
14387
  static async fromFile(params) {
@@ -13995,16 +14404,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
13995
14404
  };
13996
14405
 
13997
14406
  // src/features/subagents/geminicli-subagent.ts
13998
- import { join as join95 } from "path";
13999
- import { z as z53 } from "zod/mini";
14407
+ import { join as join96 } from "path";
14408
+ import { z as z54 } from "zod/mini";
14000
14409
 
14001
14410
  // src/features/subagents/rulesync-subagent.ts
14002
- import { basename as basename7, join as join94 } from "path";
14003
- import { z as z52 } from "zod/mini";
14004
- var RulesyncSubagentFrontmatterSchema = z52.looseObject({
14005
- targets: z52._default(RulesyncTargetsSchema, ["*"]),
14006
- name: z52.string(),
14007
- description: z52.optional(z52.string())
14411
+ import { basename as basename7, join as join95 } from "path";
14412
+ import { z as z53 } from "zod/mini";
14413
+ var RulesyncSubagentFrontmatterSchema = z53.looseObject({
14414
+ targets: z53._default(RulesyncTargetsSchema, ["*"]),
14415
+ name: z53.string(),
14416
+ description: z53.optional(z53.string())
14008
14417
  });
14009
14418
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
14010
14419
  frontmatter;
@@ -14013,7 +14422,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
14013
14422
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
14014
14423
  if (!parseResult.success && rest.validate !== false) {
14015
14424
  throw new Error(
14016
- `Invalid frontmatter in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
14425
+ `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
14017
14426
  );
14018
14427
  }
14019
14428
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -14046,7 +14455,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
14046
14455
  return {
14047
14456
  success: false,
14048
14457
  error: new Error(
14049
- `Invalid frontmatter in ${join94(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14458
+ `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14050
14459
  )
14051
14460
  };
14052
14461
  }
@@ -14054,7 +14463,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
14054
14463
  static async fromFile({
14055
14464
  relativeFilePath
14056
14465
  }) {
14057
- const filePath = join94(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
14466
+ const filePath = join95(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
14058
14467
  const fileContent = await readFileContent(filePath);
14059
14468
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14060
14469
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14073,9 +14482,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
14073
14482
  };
14074
14483
 
14075
14484
  // src/features/subagents/geminicli-subagent.ts
14076
- var GeminiCliSubagentFrontmatterSchema = z53.looseObject({
14077
- name: z53.string(),
14078
- description: z53.optional(z53.string())
14485
+ var GeminiCliSubagentFrontmatterSchema = z54.looseObject({
14486
+ name: z54.string(),
14487
+ description: z54.optional(z54.string())
14079
14488
  });
14080
14489
  var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14081
14490
  frontmatter;
@@ -14085,7 +14494,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14085
14494
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
14086
14495
  if (!result.success) {
14087
14496
  throw new Error(
14088
- `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14497
+ `Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14089
14498
  );
14090
14499
  }
14091
14500
  }
@@ -14098,7 +14507,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14098
14507
  }
14099
14508
  static getSettablePaths(_options = {}) {
14100
14509
  return {
14101
- relativeDirPath: join95(".gemini", "agents")
14510
+ relativeDirPath: join96(".gemini", "agents")
14102
14511
  };
14103
14512
  }
14104
14513
  getFrontmatter() {
@@ -14166,7 +14575,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14166
14575
  return {
14167
14576
  success: false,
14168
14577
  error: new Error(
14169
- `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14578
+ `Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14170
14579
  )
14171
14580
  };
14172
14581
  }
@@ -14184,7 +14593,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14184
14593
  global = false
14185
14594
  }) {
14186
14595
  const paths = this.getSettablePaths({ global });
14187
- const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
14596
+ const filePath = join96(baseDir, paths.relativeDirPath, relativeFilePath);
14188
14597
  const fileContent = await readFileContent(filePath);
14189
14598
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14190
14599
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14220,11 +14629,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
14220
14629
  };
14221
14630
 
14222
14631
  // src/features/subagents/roo-subagent.ts
14223
- import { join as join96 } from "path";
14632
+ import { join as join97 } from "path";
14224
14633
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
14225
14634
  static getSettablePaths() {
14226
14635
  return {
14227
- relativeDirPath: join96(".roo", "subagents")
14636
+ relativeDirPath: join97(".roo", "subagents")
14228
14637
  };
14229
14638
  }
14230
14639
  static async fromFile(params) {
@@ -14247,11 +14656,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
14247
14656
  };
14248
14657
 
14249
14658
  // src/features/subagents/rovodev-subagent.ts
14250
- import { join as join97 } from "path";
14251
- import { z as z54 } from "zod/mini";
14252
- var RovodevSubagentFrontmatterSchema = z54.looseObject({
14253
- name: z54.string(),
14254
- description: z54.optional(z54.string())
14659
+ import { join as join98 } from "path";
14660
+ import { z as z55 } from "zod/mini";
14661
+ var RovodevSubagentFrontmatterSchema = z55.looseObject({
14662
+ name: z55.string(),
14663
+ description: z55.optional(z55.string())
14255
14664
  });
14256
14665
  var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14257
14666
  frontmatter;
@@ -14261,7 +14670,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14261
14670
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
14262
14671
  if (!result.success) {
14263
14672
  throw new Error(
14264
- `Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14673
+ `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14265
14674
  );
14266
14675
  }
14267
14676
  }
@@ -14273,7 +14682,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14273
14682
  }
14274
14683
  static getSettablePaths(_options = {}) {
14275
14684
  return {
14276
- relativeDirPath: join97(".rovodev", "subagents")
14685
+ relativeDirPath: join98(".rovodev", "subagents")
14277
14686
  };
14278
14687
  }
14279
14688
  getFrontmatter() {
@@ -14336,7 +14745,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14336
14745
  return {
14337
14746
  success: false,
14338
14747
  error: new Error(
14339
- `Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14748
+ `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14340
14749
  )
14341
14750
  };
14342
14751
  }
@@ -14353,7 +14762,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14353
14762
  global = false
14354
14763
  }) {
14355
14764
  const paths = this.getSettablePaths({ global });
14356
- const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
14765
+ const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
14357
14766
  const fileContent = await readFileContent(filePath);
14358
14767
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14359
14768
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14392,19 +14801,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
14392
14801
  };
14393
14802
 
14394
14803
  // src/features/subagents/subagents-processor.ts
14395
- import { basename as basename9, join as join108 } from "path";
14396
- import { z as z63 } from "zod/mini";
14804
+ import { basename as basename9, join as join109 } from "path";
14805
+ import { z as z64 } from "zod/mini";
14397
14806
 
14398
14807
  // src/features/subagents/claudecode-subagent.ts
14399
- import { join as join98 } from "path";
14400
- import { z as z55 } from "zod/mini";
14401
- var ClaudecodeSubagentFrontmatterSchema = z55.looseObject({
14402
- name: z55.string(),
14403
- description: z55.optional(z55.string()),
14404
- model: z55.optional(z55.string()),
14405
- tools: z55.optional(z55.union([z55.string(), z55.array(z55.string())])),
14406
- permissionMode: z55.optional(z55.string()),
14407
- skills: z55.optional(z55.union([z55.string(), z55.array(z55.string())]))
14808
+ import { join as join99 } from "path";
14809
+ import { z as z56 } from "zod/mini";
14810
+ var ClaudecodeSubagentFrontmatterSchema = z56.looseObject({
14811
+ name: z56.string(),
14812
+ description: z56.optional(z56.string()),
14813
+ model: z56.optional(z56.string()),
14814
+ tools: z56.optional(z56.union([z56.string(), z56.array(z56.string())])),
14815
+ permissionMode: z56.optional(z56.string()),
14816
+ skills: z56.optional(z56.union([z56.string(), z56.array(z56.string())]))
14408
14817
  });
14409
14818
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14410
14819
  frontmatter;
@@ -14414,7 +14823,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14414
14823
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
14415
14824
  if (!result.success) {
14416
14825
  throw new Error(
14417
- `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14826
+ `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14418
14827
  );
14419
14828
  }
14420
14829
  }
@@ -14426,7 +14835,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14426
14835
  }
14427
14836
  static getSettablePaths(_options = {}) {
14428
14837
  return {
14429
- relativeDirPath: join98(".claude", "agents")
14838
+ relativeDirPath: join99(".claude", "agents")
14430
14839
  };
14431
14840
  }
14432
14841
  getFrontmatter() {
@@ -14505,7 +14914,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14505
14914
  return {
14506
14915
  success: false,
14507
14916
  error: new Error(
14508
- `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14917
+ `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14509
14918
  )
14510
14919
  };
14511
14920
  }
@@ -14523,7 +14932,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14523
14932
  global = false
14524
14933
  }) {
14525
14934
  const paths = this.getSettablePaths({ global });
14526
- const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
14935
+ const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
14527
14936
  const fileContent = await readFileContent(filePath);
14528
14937
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14529
14938
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14558,16 +14967,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14558
14967
  };
14559
14968
 
14560
14969
  // src/features/subagents/codexcli-subagent.ts
14561
- import { join as join99 } from "path";
14970
+ import { join as join100 } from "path";
14562
14971
  import * as smolToml5 from "smol-toml";
14563
- import { z as z56 } from "zod/mini";
14564
- var CodexCliSubagentTomlSchema = z56.looseObject({
14565
- name: z56.string(),
14566
- description: z56.optional(z56.string()),
14567
- developer_instructions: z56.optional(z56.string()),
14568
- model: z56.optional(z56.string()),
14569
- model_reasoning_effort: z56.optional(z56.string()),
14570
- sandbox_mode: z56.optional(z56.string())
14972
+ import { z as z57 } from "zod/mini";
14973
+ var CodexCliSubagentTomlSchema = z57.looseObject({
14974
+ name: z57.string(),
14975
+ description: z57.optional(z57.string()),
14976
+ developer_instructions: z57.optional(z57.string()),
14977
+ model: z57.optional(z57.string()),
14978
+ model_reasoning_effort: z57.optional(z57.string()),
14979
+ sandbox_mode: z57.optional(z57.string())
14571
14980
  });
14572
14981
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14573
14982
  body;
@@ -14578,7 +14987,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14578
14987
  CodexCliSubagentTomlSchema.parse(parsed);
14579
14988
  } catch (error) {
14580
14989
  throw new Error(
14581
- `Invalid TOML in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14990
+ `Invalid TOML in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14582
14991
  { cause: error }
14583
14992
  );
14584
14993
  }
@@ -14590,7 +14999,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14590
14999
  }
14591
15000
  static getSettablePaths(_options = {}) {
14592
15001
  return {
14593
- relativeDirPath: join99(".codex", "agents")
15002
+ relativeDirPath: join100(".codex", "agents")
14594
15003
  };
14595
15004
  }
14596
15005
  getBody() {
@@ -14602,7 +15011,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14602
15011
  parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
14603
15012
  } catch (error) {
14604
15013
  throw new Error(
14605
- `Failed to parse TOML in ${join99(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15014
+ `Failed to parse TOML in ${join100(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14606
15015
  { cause: error }
14607
15016
  );
14608
15017
  }
@@ -14683,7 +15092,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14683
15092
  global = false
14684
15093
  }) {
14685
15094
  const paths = this.getSettablePaths({ global });
14686
- const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
15095
+ const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
14687
15096
  const fileContent = await readFileContent(filePath);
14688
15097
  const subagent = new _CodexCliSubagent({
14689
15098
  baseDir,
@@ -14721,13 +15130,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14721
15130
  };
14722
15131
 
14723
15132
  // src/features/subagents/copilot-subagent.ts
14724
- import { join as join100 } from "path";
14725
- import { z as z57 } from "zod/mini";
15133
+ import { join as join101 } from "path";
15134
+ import { z as z58 } from "zod/mini";
14726
15135
  var REQUIRED_TOOL = "agent/runSubagent";
14727
- var CopilotSubagentFrontmatterSchema = z57.looseObject({
14728
- name: z57.string(),
14729
- description: z57.optional(z57.string()),
14730
- tools: z57.optional(z57.union([z57.string(), z57.array(z57.string())]))
15136
+ var CopilotSubagentFrontmatterSchema = z58.looseObject({
15137
+ name: z58.string(),
15138
+ description: z58.optional(z58.string()),
15139
+ tools: z58.optional(z58.union([z58.string(), z58.array(z58.string())]))
14731
15140
  });
14732
15141
  var normalizeTools = (tools) => {
14733
15142
  if (!tools) {
@@ -14747,7 +15156,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14747
15156
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
14748
15157
  if (!result.success) {
14749
15158
  throw new Error(
14750
- `Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15159
+ `Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14751
15160
  );
14752
15161
  }
14753
15162
  }
@@ -14759,7 +15168,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14759
15168
  }
14760
15169
  static getSettablePaths(_options = {}) {
14761
15170
  return {
14762
- relativeDirPath: join100(".github", "agents")
15171
+ relativeDirPath: join101(".github", "agents")
14763
15172
  };
14764
15173
  }
14765
15174
  getFrontmatter() {
@@ -14837,7 +15246,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14837
15246
  return {
14838
15247
  success: false,
14839
15248
  error: new Error(
14840
- `Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15249
+ `Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14841
15250
  )
14842
15251
  };
14843
15252
  }
@@ -14855,7 +15264,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14855
15264
  global = false
14856
15265
  }) {
14857
15266
  const paths = this.getSettablePaths({ global });
14858
- const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
15267
+ const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
14859
15268
  const fileContent = await readFileContent(filePath);
14860
15269
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14861
15270
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14891,11 +15300,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14891
15300
  };
14892
15301
 
14893
15302
  // src/features/subagents/cursor-subagent.ts
14894
- import { join as join101 } from "path";
14895
- import { z as z58 } from "zod/mini";
14896
- var CursorSubagentFrontmatterSchema = z58.looseObject({
14897
- name: z58.string(),
14898
- description: z58.optional(z58.string())
15303
+ import { join as join102 } from "path";
15304
+ import { z as z59 } from "zod/mini";
15305
+ var CursorSubagentFrontmatterSchema = z59.looseObject({
15306
+ name: z59.string(),
15307
+ description: z59.optional(z59.string())
14899
15308
  });
14900
15309
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14901
15310
  frontmatter;
@@ -14905,7 +15314,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14905
15314
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
14906
15315
  if (!result.success) {
14907
15316
  throw new Error(
14908
- `Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15317
+ `Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14909
15318
  );
14910
15319
  }
14911
15320
  }
@@ -14917,7 +15326,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14917
15326
  }
14918
15327
  static getSettablePaths(_options = {}) {
14919
15328
  return {
14920
- relativeDirPath: join101(".cursor", "agents")
15329
+ relativeDirPath: join102(".cursor", "agents")
14921
15330
  };
14922
15331
  }
14923
15332
  getFrontmatter() {
@@ -14984,7 +15393,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14984
15393
  return {
14985
15394
  success: false,
14986
15395
  error: new Error(
14987
- `Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15396
+ `Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14988
15397
  )
14989
15398
  };
14990
15399
  }
@@ -15002,7 +15411,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
15002
15411
  global = false
15003
15412
  }) {
15004
15413
  const paths = this.getSettablePaths({ global });
15005
- const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
15414
+ const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
15006
15415
  const fileContent = await readFileContent(filePath);
15007
15416
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15008
15417
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15038,12 +15447,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
15038
15447
  };
15039
15448
 
15040
15449
  // src/features/subagents/deepagents-subagent.ts
15041
- import { join as join102 } from "path";
15042
- import { z as z59 } from "zod/mini";
15043
- var DeepagentsSubagentFrontmatterSchema = z59.looseObject({
15044
- name: z59.string(),
15045
- description: z59.optional(z59.string()),
15046
- model: z59.optional(z59.string())
15450
+ import { join as join103 } from "path";
15451
+ import { z as z60 } from "zod/mini";
15452
+ var DeepagentsSubagentFrontmatterSchema = z60.looseObject({
15453
+ name: z60.string(),
15454
+ description: z60.optional(z60.string()),
15455
+ model: z60.optional(z60.string())
15047
15456
  });
15048
15457
  var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15049
15458
  frontmatter;
@@ -15053,7 +15462,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15053
15462
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
15054
15463
  if (!result.success) {
15055
15464
  throw new Error(
15056
- `Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15465
+ `Invalid frontmatter in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15057
15466
  );
15058
15467
  }
15059
15468
  }
@@ -15063,7 +15472,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15063
15472
  }
15064
15473
  static getSettablePaths(_options = {}) {
15065
15474
  return {
15066
- relativeDirPath: join102(".deepagents", "agents")
15475
+ relativeDirPath: join103(".deepagents", "agents")
15067
15476
  };
15068
15477
  }
15069
15478
  getFrontmatter() {
@@ -15138,7 +15547,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15138
15547
  return {
15139
15548
  success: false,
15140
15549
  error: new Error(
15141
- `Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15550
+ `Invalid frontmatter in ${join103(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15142
15551
  )
15143
15552
  };
15144
15553
  }
@@ -15156,7 +15565,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15156
15565
  global = false
15157
15566
  }) {
15158
15567
  const paths = this.getSettablePaths({ global });
15159
- const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
15568
+ const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
15160
15569
  const fileContent = await readFileContent(filePath);
15161
15570
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15162
15571
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15191,11 +15600,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
15191
15600
  };
15192
15601
 
15193
15602
  // src/features/subagents/junie-subagent.ts
15194
- import { join as join103 } from "path";
15195
- import { z as z60 } from "zod/mini";
15196
- var JunieSubagentFrontmatterSchema = z60.looseObject({
15197
- name: z60.optional(z60.string()),
15198
- description: z60.string()
15603
+ import { join as join104 } from "path";
15604
+ import { z as z61 } from "zod/mini";
15605
+ var JunieSubagentFrontmatterSchema = z61.looseObject({
15606
+ name: z61.optional(z61.string()),
15607
+ description: z61.string()
15199
15608
  });
15200
15609
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15201
15610
  frontmatter;
@@ -15205,7 +15614,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15205
15614
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
15206
15615
  if (!result.success) {
15207
15616
  throw new Error(
15208
- `Invalid frontmatter in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15617
+ `Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15209
15618
  );
15210
15619
  }
15211
15620
  }
@@ -15220,7 +15629,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15220
15629
  throw new Error("JunieSubagent does not support global mode.");
15221
15630
  }
15222
15631
  return {
15223
- relativeDirPath: join103(".junie", "agents")
15632
+ relativeDirPath: join104(".junie", "agents")
15224
15633
  };
15225
15634
  }
15226
15635
  getFrontmatter() {
@@ -15296,7 +15705,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15296
15705
  return {
15297
15706
  success: false,
15298
15707
  error: new Error(
15299
- `Invalid frontmatter in ${join103(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15708
+ `Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15300
15709
  )
15301
15710
  };
15302
15711
  }
@@ -15314,7 +15723,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15314
15723
  global = false
15315
15724
  }) {
15316
15725
  const paths = this.getSettablePaths({ global });
15317
- const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
15726
+ const filePath = join104(baseDir, paths.relativeDirPath, relativeFilePath);
15318
15727
  const fileContent = await readFileContent(filePath);
15319
15728
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15320
15729
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15349,15 +15758,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
15349
15758
  };
15350
15759
 
15351
15760
  // src/features/subagents/kilo-subagent.ts
15352
- import { join as join105 } from "path";
15761
+ import { join as join106 } from "path";
15353
15762
 
15354
15763
  // src/features/subagents/opencode-style-subagent.ts
15355
- import { basename as basename8, join as join104 } from "path";
15356
- import { z as z61 } from "zod/mini";
15357
- var OpenCodeStyleSubagentFrontmatterSchema = z61.looseObject({
15358
- description: z61.optional(z61.string()),
15359
- mode: z61._default(z61.string(), "subagent"),
15360
- name: z61.optional(z61.string())
15764
+ import { basename as basename8, join as join105 } from "path";
15765
+ import { z as z62 } from "zod/mini";
15766
+ var OpenCodeStyleSubagentFrontmatterSchema = z62.looseObject({
15767
+ description: z62.optional(z62.string()),
15768
+ mode: z62._default(z62.string(), "subagent"),
15769
+ name: z62.optional(z62.string())
15361
15770
  });
15362
15771
  var OpenCodeStyleSubagent = class extends ToolSubagent {
15363
15772
  frontmatter;
@@ -15367,7 +15776,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
15367
15776
  const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
15368
15777
  if (!result.success) {
15369
15778
  throw new Error(
15370
- `Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15779
+ `Invalid frontmatter in ${join105(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15371
15780
  );
15372
15781
  }
15373
15782
  }
@@ -15409,7 +15818,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
15409
15818
  return {
15410
15819
  success: false,
15411
15820
  error: new Error(
15412
- `Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15821
+ `Invalid frontmatter in ${join105(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15413
15822
  )
15414
15823
  };
15415
15824
  }
@@ -15425,7 +15834,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15425
15834
  global = false
15426
15835
  } = {}) {
15427
15836
  return {
15428
- relativeDirPath: global ? join105(".config", "kilo", "agent") : join105(".kilo", "agent")
15837
+ relativeDirPath: global ? join106(".config", "kilo", "agent") : join106(".kilo", "agent")
15429
15838
  };
15430
15839
  }
15431
15840
  static fromRulesyncSubagent({
@@ -15469,7 +15878,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15469
15878
  global = false
15470
15879
  }) {
15471
15880
  const paths = this.getSettablePaths({ global });
15472
- const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
15881
+ const filePath = join106(baseDir, paths.relativeDirPath, relativeFilePath);
15473
15882
  const fileContent = await readFileContent(filePath);
15474
15883
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15475
15884
  const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15505,23 +15914,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15505
15914
  };
15506
15915
 
15507
15916
  // src/features/subagents/kiro-subagent.ts
15508
- import { join as join106 } from "path";
15509
- import { z as z62 } from "zod/mini";
15510
- var KiroCliSubagentJsonSchema = z62.looseObject({
15511
- name: z62.string(),
15512
- description: z62.optional(z62.nullable(z62.string())),
15513
- prompt: z62.optional(z62.nullable(z62.string())),
15514
- tools: z62.optional(z62.nullable(z62.array(z62.string()))),
15515
- toolAliases: z62.optional(z62.nullable(z62.record(z62.string(), z62.string()))),
15516
- toolSettings: z62.optional(z62.nullable(z62.unknown())),
15517
- toolSchema: z62.optional(z62.nullable(z62.unknown())),
15518
- hooks: z62.optional(z62.nullable(z62.record(z62.string(), z62.array(z62.unknown())))),
15519
- model: z62.optional(z62.nullable(z62.string())),
15520
- mcpServers: z62.optional(z62.nullable(z62.record(z62.string(), z62.unknown()))),
15521
- useLegacyMcpJson: z62.optional(z62.nullable(z62.boolean())),
15522
- resources: z62.optional(z62.nullable(z62.array(z62.string()))),
15523
- allowedTools: z62.optional(z62.nullable(z62.array(z62.string()))),
15524
- includeMcpJson: z62.optional(z62.nullable(z62.boolean()))
15917
+ import { join as join107 } from "path";
15918
+ import { z as z63 } from "zod/mini";
15919
+ var KiroCliSubagentJsonSchema = z63.looseObject({
15920
+ name: z63.string(),
15921
+ description: z63.optional(z63.nullable(z63.string())),
15922
+ prompt: z63.optional(z63.nullable(z63.string())),
15923
+ tools: z63.optional(z63.nullable(z63.array(z63.string()))),
15924
+ toolAliases: z63.optional(z63.nullable(z63.record(z63.string(), z63.string()))),
15925
+ toolSettings: z63.optional(z63.nullable(z63.unknown())),
15926
+ toolSchema: z63.optional(z63.nullable(z63.unknown())),
15927
+ hooks: z63.optional(z63.nullable(z63.record(z63.string(), z63.array(z63.unknown())))),
15928
+ model: z63.optional(z63.nullable(z63.string())),
15929
+ mcpServers: z63.optional(z63.nullable(z63.record(z63.string(), z63.unknown()))),
15930
+ useLegacyMcpJson: z63.optional(z63.nullable(z63.boolean())),
15931
+ resources: z63.optional(z63.nullable(z63.array(z63.string()))),
15932
+ allowedTools: z63.optional(z63.nullable(z63.array(z63.string()))),
15933
+ includeMcpJson: z63.optional(z63.nullable(z63.boolean()))
15525
15934
  });
15526
15935
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15527
15936
  body;
@@ -15532,7 +15941,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15532
15941
  KiroCliSubagentJsonSchema.parse(parsed);
15533
15942
  } catch (error) {
15534
15943
  throw new Error(
15535
- `Invalid JSON in ${join106(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15944
+ `Invalid JSON in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15536
15945
  { cause: error }
15537
15946
  );
15538
15947
  }
@@ -15544,7 +15953,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15544
15953
  }
15545
15954
  static getSettablePaths(_options = {}) {
15546
15955
  return {
15547
- relativeDirPath: join106(".kiro", "agents")
15956
+ relativeDirPath: join107(".kiro", "agents")
15548
15957
  };
15549
15958
  }
15550
15959
  getBody() {
@@ -15556,7 +15965,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15556
15965
  parsed = JSON.parse(this.body);
15557
15966
  } catch (error) {
15558
15967
  throw new Error(
15559
- `Failed to parse JSON in ${join106(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15968
+ `Failed to parse JSON in ${join107(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15560
15969
  { cause: error }
15561
15970
  );
15562
15971
  }
@@ -15637,7 +16046,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15637
16046
  global = false
15638
16047
  }) {
15639
16048
  const paths = this.getSettablePaths({ global });
15640
- const filePath = join106(baseDir, paths.relativeDirPath, relativeFilePath);
16049
+ const filePath = join107(baseDir, paths.relativeDirPath, relativeFilePath);
15641
16050
  const fileContent = await readFileContent(filePath);
15642
16051
  const subagent = new _KiroSubagent({
15643
16052
  baseDir,
@@ -15675,7 +16084,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15675
16084
  };
15676
16085
 
15677
16086
  // src/features/subagents/opencode-subagent.ts
15678
- import { join as join107 } from "path";
16087
+ import { join as join108 } from "path";
15679
16088
  var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
15680
16089
  var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15681
16090
  getToolTarget() {
@@ -15685,7 +16094,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15685
16094
  global = false
15686
16095
  } = {}) {
15687
16096
  return {
15688
- relativeDirPath: global ? join107(".config", "opencode", "agent") : join107(".opencode", "agent")
16097
+ relativeDirPath: global ? join108(".config", "opencode", "agent") : join108(".opencode", "agent")
15689
16098
  };
15690
16099
  }
15691
16100
  static fromRulesyncSubagent({
@@ -15729,7 +16138,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15729
16138
  global = false
15730
16139
  }) {
15731
16140
  const paths = this.getSettablePaths({ global });
15732
- const filePath = join107(baseDir, paths.relativeDirPath, relativeFilePath);
16141
+ const filePath = join108(baseDir, paths.relativeDirPath, relativeFilePath);
15733
16142
  const fileContent = await readFileContent(filePath);
15734
16143
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15735
16144
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15782,7 +16191,7 @@ var subagentsProcessorToolTargetTuple = [
15782
16191
  "roo",
15783
16192
  "rovodev"
15784
16193
  ];
15785
- var SubagentsProcessorToolTargetSchema = z63.enum(subagentsProcessorToolTargetTuple);
16194
+ var SubagentsProcessorToolTargetSchema = z64.enum(subagentsProcessorToolTargetTuple);
15786
16195
  var toolSubagentFactories = /* @__PURE__ */ new Map([
15787
16196
  [
15788
16197
  "agentsmd",
@@ -15973,7 +16382,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15973
16382
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
15974
16383
  */
15975
16384
  async loadRulesyncFiles() {
15976
- const subagentsDir = join108(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
16385
+ const subagentsDir = join109(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15977
16386
  const dirExists = await directoryExists(subagentsDir);
15978
16387
  if (!dirExists) {
15979
16388
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -15988,7 +16397,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15988
16397
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
15989
16398
  const rulesyncSubagents = [];
15990
16399
  for (const mdFile of mdFiles) {
15991
- const filepath = join108(subagentsDir, mdFile);
16400
+ const filepath = join109(subagentsDir, mdFile);
15992
16401
  try {
15993
16402
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
15994
16403
  relativeFilePath: mdFile,
@@ -16018,7 +16427,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
16018
16427
  const factory = this.getFactory(this.toolTarget);
16019
16428
  const paths = factory.class.getSettablePaths({ global: this.global });
16020
16429
  const subagentFilePaths = await findFilesByGlobs(
16021
- join108(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
16430
+ join109(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
16022
16431
  );
16023
16432
  if (forDeletion) {
16024
16433
  const toolSubagents2 = subagentFilePaths.map(
@@ -16085,49 +16494,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
16085
16494
  };
16086
16495
 
16087
16496
  // src/features/rules/agentsmd-rule.ts
16088
- import { join as join111 } from "path";
16497
+ import { join as join112 } from "path";
16089
16498
 
16090
16499
  // src/features/rules/tool-rule.ts
16091
- import { join as join110 } from "path";
16500
+ import { join as join111 } from "path";
16092
16501
 
16093
16502
  // src/features/rules/rulesync-rule.ts
16094
- import { join as join109 } from "path";
16095
- import { z as z64 } from "zod/mini";
16096
- var RulesyncRuleFrontmatterSchema = z64.object({
16097
- root: z64.optional(z64.boolean()),
16098
- localRoot: z64.optional(z64.boolean()),
16099
- targets: z64._default(RulesyncTargetsSchema, ["*"]),
16100
- description: z64.optional(z64.string()),
16101
- globs: z64.optional(z64.array(z64.string())),
16102
- agentsmd: z64.optional(
16103
- z64.looseObject({
16503
+ import { join as join110 } from "path";
16504
+ import { z as z65 } from "zod/mini";
16505
+ var RulesyncRuleFrontmatterSchema = z65.object({
16506
+ root: z65.optional(z65.boolean()),
16507
+ localRoot: z65.optional(z65.boolean()),
16508
+ targets: z65._default(RulesyncTargetsSchema, ["*"]),
16509
+ description: z65.optional(z65.string()),
16510
+ globs: z65.optional(z65.array(z65.string())),
16511
+ agentsmd: z65.optional(
16512
+ z65.looseObject({
16104
16513
  // @example "path/to/subproject"
16105
- subprojectPath: z64.optional(z64.string())
16514
+ subprojectPath: z65.optional(z65.string())
16106
16515
  })
16107
16516
  ),
16108
- claudecode: z64.optional(
16109
- z64.looseObject({
16517
+ claudecode: z65.optional(
16518
+ z65.looseObject({
16110
16519
  // Glob patterns for conditional rules (takes precedence over globs)
16111
16520
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
16112
- paths: z64.optional(z64.array(z64.string()))
16521
+ paths: z65.optional(z65.array(z65.string()))
16113
16522
  })
16114
16523
  ),
16115
- cursor: z64.optional(
16116
- z64.looseObject({
16117
- alwaysApply: z64.optional(z64.boolean()),
16118
- description: z64.optional(z64.string()),
16119
- globs: z64.optional(z64.array(z64.string()))
16524
+ cursor: z65.optional(
16525
+ z65.looseObject({
16526
+ alwaysApply: z65.optional(z65.boolean()),
16527
+ description: z65.optional(z65.string()),
16528
+ globs: z65.optional(z65.array(z65.string()))
16120
16529
  })
16121
16530
  ),
16122
- copilot: z64.optional(
16123
- z64.looseObject({
16124
- excludeAgent: z64.optional(z64.union([z64.literal("code-review"), z64.literal("coding-agent")]))
16531
+ copilot: z65.optional(
16532
+ z65.looseObject({
16533
+ excludeAgent: z65.optional(z65.union([z65.literal("code-review"), z65.literal("coding-agent")]))
16125
16534
  })
16126
16535
  ),
16127
- antigravity: z64.optional(
16128
- z64.looseObject({
16129
- trigger: z64.optional(z64.string()),
16130
- globs: z64.optional(z64.array(z64.string()))
16536
+ antigravity: z65.optional(
16537
+ z65.looseObject({
16538
+ trigger: z65.optional(z65.string()),
16539
+ globs: z65.optional(z65.array(z65.string()))
16131
16540
  })
16132
16541
  )
16133
16542
  });
@@ -16138,7 +16547,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
16138
16547
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
16139
16548
  if (!parseResult.success && rest.validate !== false) {
16140
16549
  throw new Error(
16141
- `Invalid frontmatter in ${join109(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
16550
+ `Invalid frontmatter in ${join110(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
16142
16551
  );
16143
16552
  }
16144
16553
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -16173,7 +16582,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
16173
16582
  return {
16174
16583
  success: false,
16175
16584
  error: new Error(
16176
- `Invalid frontmatter in ${join109(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16585
+ `Invalid frontmatter in ${join110(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16177
16586
  )
16178
16587
  };
16179
16588
  }
@@ -16182,7 +16591,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
16182
16591
  relativeFilePath,
16183
16592
  validate = true
16184
16593
  }) {
16185
- const filePath = join109(
16594
+ const filePath = join110(
16186
16595
  process.cwd(),
16187
16596
  this.getSettablePaths().recommended.relativeDirPath,
16188
16597
  relativeFilePath
@@ -16281,7 +16690,7 @@ var ToolRule = class extends ToolFile {
16281
16690
  rulesyncRule,
16282
16691
  validate = true,
16283
16692
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
16284
- nonRootPath = { relativeDirPath: join110(".agents", "memories") }
16693
+ nonRootPath = { relativeDirPath: join111(".agents", "memories") }
16285
16694
  }) {
16286
16695
  const params = this.buildToolRuleParamsDefault({
16287
16696
  baseDir,
@@ -16292,7 +16701,7 @@ var ToolRule = class extends ToolFile {
16292
16701
  });
16293
16702
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
16294
16703
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
16295
- params.relativeDirPath = join110(rulesyncFrontmatter.agentsmd.subprojectPath);
16704
+ params.relativeDirPath = join111(rulesyncFrontmatter.agentsmd.subprojectPath);
16296
16705
  params.relativeFilePath = "AGENTS.md";
16297
16706
  }
16298
16707
  return params;
@@ -16341,7 +16750,7 @@ var ToolRule = class extends ToolFile {
16341
16750
  }
16342
16751
  };
16343
16752
  function buildToolPath(toolDir, subDir, excludeToolDir) {
16344
- return excludeToolDir ? subDir : join110(toolDir, subDir);
16753
+ return excludeToolDir ? subDir : join111(toolDir, subDir);
16345
16754
  }
16346
16755
 
16347
16756
  // src/features/rules/agentsmd-rule.ts
@@ -16370,8 +16779,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
16370
16779
  validate = true
16371
16780
  }) {
16372
16781
  const isRoot = relativeFilePath === "AGENTS.md";
16373
- const relativePath = isRoot ? "AGENTS.md" : join111(".agents", "memories", relativeFilePath);
16374
- const fileContent = await readFileContent(join111(baseDir, relativePath));
16782
+ const relativePath = isRoot ? "AGENTS.md" : join112(".agents", "memories", relativeFilePath);
16783
+ const fileContent = await readFileContent(join112(baseDir, relativePath));
16375
16784
  return new _AgentsMdRule({
16376
16785
  baseDir,
16377
16786
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -16426,21 +16835,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
16426
16835
  };
16427
16836
 
16428
16837
  // src/features/rules/antigravity-rule.ts
16429
- import { join as join112 } from "path";
16430
- import { z as z65 } from "zod/mini";
16431
- var AntigravityRuleFrontmatterSchema = z65.looseObject({
16432
- trigger: z65.optional(
16433
- z65.union([
16434
- z65.literal("always_on"),
16435
- z65.literal("glob"),
16436
- z65.literal("manual"),
16437
- z65.literal("model_decision"),
16438
- z65.string()
16838
+ import { join as join113 } from "path";
16839
+ import { z as z66 } from "zod/mini";
16840
+ var AntigravityRuleFrontmatterSchema = z66.looseObject({
16841
+ trigger: z66.optional(
16842
+ z66.union([
16843
+ z66.literal("always_on"),
16844
+ z66.literal("glob"),
16845
+ z66.literal("manual"),
16846
+ z66.literal("model_decision"),
16847
+ z66.string()
16439
16848
  // accepts any string for forward compatibility
16440
16849
  ])
16441
16850
  ),
16442
- globs: z65.optional(z65.string()),
16443
- description: z65.optional(z65.string())
16851
+ globs: z66.optional(z66.string()),
16852
+ description: z66.optional(z66.string())
16444
16853
  });
16445
16854
  function parseGlobsString(globs) {
16446
16855
  if (!globs) {
@@ -16585,7 +16994,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16585
16994
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
16586
16995
  if (!result.success) {
16587
16996
  throw new Error(
16588
- `Invalid frontmatter in ${join112(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16997
+ `Invalid frontmatter in ${join113(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16589
16998
  );
16590
16999
  }
16591
17000
  }
@@ -16609,7 +17018,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16609
17018
  relativeFilePath,
16610
17019
  validate = true
16611
17020
  }) {
16612
- const filePath = join112(
17021
+ const filePath = join113(
16613
17022
  baseDir,
16614
17023
  this.getSettablePaths().nonRoot.relativeDirPath,
16615
17024
  relativeFilePath
@@ -16749,7 +17158,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16749
17158
  };
16750
17159
 
16751
17160
  // src/features/rules/augmentcode-legacy-rule.ts
16752
- import { join as join113 } from "path";
17161
+ import { join as join114 } from "path";
16753
17162
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16754
17163
  toRulesyncRule() {
16755
17164
  const rulesyncFrontmatter = {
@@ -16809,8 +17218,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16809
17218
  }) {
16810
17219
  const settablePaths = this.getSettablePaths();
16811
17220
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
16812
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : join113(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16813
- const fileContent = await readFileContent(join113(baseDir, relativePath));
17221
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : join114(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17222
+ const fileContent = await readFileContent(join114(baseDir, relativePath));
16814
17223
  return new _AugmentcodeLegacyRule({
16815
17224
  baseDir,
16816
17225
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -16839,7 +17248,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16839
17248
  };
16840
17249
 
16841
17250
  // src/features/rules/augmentcode-rule.ts
16842
- import { join as join114 } from "path";
17251
+ import { join as join115 } from "path";
16843
17252
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16844
17253
  toRulesyncRule() {
16845
17254
  return this.toRulesyncRuleDefault();
@@ -16870,7 +17279,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16870
17279
  relativeFilePath,
16871
17280
  validate = true
16872
17281
  }) {
16873
- const filePath = join114(
17282
+ const filePath = join115(
16874
17283
  baseDir,
16875
17284
  this.getSettablePaths().nonRoot.relativeDirPath,
16876
17285
  relativeFilePath
@@ -16910,7 +17319,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16910
17319
  };
16911
17320
 
16912
17321
  // src/features/rules/claudecode-legacy-rule.ts
16913
- import { join as join115 } from "path";
17322
+ import { join as join116 } from "path";
16914
17323
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16915
17324
  static getSettablePaths({
16916
17325
  global,
@@ -16952,7 +17361,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16952
17361
  if (isRoot) {
16953
17362
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16954
17363
  const fileContent2 = await readFileContent(
16955
- join115(baseDir, rootDirPath, paths.root.relativeFilePath)
17364
+ join116(baseDir, rootDirPath, paths.root.relativeFilePath)
16956
17365
  );
16957
17366
  return new _ClaudecodeLegacyRule({
16958
17367
  baseDir,
@@ -16966,8 +17375,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16966
17375
  if (!paths.nonRoot) {
16967
17376
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16968
17377
  }
16969
- const relativePath = join115(paths.nonRoot.relativeDirPath, relativeFilePath);
16970
- const fileContent = await readFileContent(join115(baseDir, relativePath));
17378
+ const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
17379
+ const fileContent = await readFileContent(join116(baseDir, relativePath));
16971
17380
  return new _ClaudecodeLegacyRule({
16972
17381
  baseDir,
16973
17382
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17026,10 +17435,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
17026
17435
  };
17027
17436
 
17028
17437
  // src/features/rules/claudecode-rule.ts
17029
- import { join as join116 } from "path";
17030
- import { z as z66 } from "zod/mini";
17031
- var ClaudecodeRuleFrontmatterSchema = z66.object({
17032
- paths: z66.optional(z66.array(z66.string()))
17438
+ import { join as join117 } from "path";
17439
+ import { z as z67 } from "zod/mini";
17440
+ var ClaudecodeRuleFrontmatterSchema = z67.object({
17441
+ paths: z67.optional(z67.array(z67.string()))
17033
17442
  });
17034
17443
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17035
17444
  frontmatter;
@@ -17067,7 +17476,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17067
17476
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
17068
17477
  if (!result.success) {
17069
17478
  throw new Error(
17070
- `Invalid frontmatter in ${join116(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17479
+ `Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17071
17480
  );
17072
17481
  }
17073
17482
  }
@@ -17097,7 +17506,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17097
17506
  if (isRoot) {
17098
17507
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
17099
17508
  const fileContent2 = await readFileContent(
17100
- join116(baseDir, rootDirPath, paths.root.relativeFilePath)
17509
+ join117(baseDir, rootDirPath, paths.root.relativeFilePath)
17101
17510
  );
17102
17511
  return new _ClaudecodeRule({
17103
17512
  baseDir,
@@ -17112,8 +17521,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17112
17521
  if (!paths.nonRoot) {
17113
17522
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17114
17523
  }
17115
- const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
17116
- const filePath = join116(baseDir, relativePath);
17524
+ const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
17525
+ const filePath = join117(baseDir, relativePath);
17117
17526
  const fileContent = await readFileContent(filePath);
17118
17527
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
17119
17528
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -17224,7 +17633,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17224
17633
  return {
17225
17634
  success: false,
17226
17635
  error: new Error(
17227
- `Invalid frontmatter in ${join116(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17636
+ `Invalid frontmatter in ${join117(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17228
17637
  )
17229
17638
  };
17230
17639
  }
@@ -17244,10 +17653,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
17244
17653
  };
17245
17654
 
17246
17655
  // src/features/rules/cline-rule.ts
17247
- import { join as join117 } from "path";
17248
- import { z as z67 } from "zod/mini";
17249
- var ClineRuleFrontmatterSchema = z67.object({
17250
- description: z67.string()
17656
+ import { join as join118 } from "path";
17657
+ import { z as z68 } from "zod/mini";
17658
+ var ClineRuleFrontmatterSchema = z68.object({
17659
+ description: z68.string()
17251
17660
  });
17252
17661
  var ClineRule = class _ClineRule extends ToolRule {
17253
17662
  static getSettablePaths(_options = {}) {
@@ -17290,7 +17699,7 @@ var ClineRule = class _ClineRule extends ToolRule {
17290
17699
  validate = true
17291
17700
  }) {
17292
17701
  const fileContent = await readFileContent(
17293
- join117(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17702
+ join118(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17294
17703
  );
17295
17704
  return new _ClineRule({
17296
17705
  baseDir,
@@ -17316,7 +17725,7 @@ var ClineRule = class _ClineRule extends ToolRule {
17316
17725
  };
17317
17726
 
17318
17727
  // src/features/rules/codexcli-rule.ts
17319
- import { join as join118 } from "path";
17728
+ import { join as join119 } from "path";
17320
17729
  var CodexcliRule = class _CodexcliRule extends ToolRule {
17321
17730
  static getSettablePaths({
17322
17731
  global,
@@ -17351,7 +17760,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
17351
17760
  if (isRoot) {
17352
17761
  const relativePath2 = paths.root.relativeFilePath;
17353
17762
  const fileContent2 = await readFileContent(
17354
- join118(baseDir, paths.root.relativeDirPath, relativePath2)
17763
+ join119(baseDir, paths.root.relativeDirPath, relativePath2)
17355
17764
  );
17356
17765
  return new _CodexcliRule({
17357
17766
  baseDir,
@@ -17365,8 +17774,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
17365
17774
  if (!paths.nonRoot) {
17366
17775
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17367
17776
  }
17368
- const relativePath = join118(paths.nonRoot.relativeDirPath, relativeFilePath);
17369
- const fileContent = await readFileContent(join118(baseDir, relativePath));
17777
+ const relativePath = join119(paths.nonRoot.relativeDirPath, relativeFilePath);
17778
+ const fileContent = await readFileContent(join119(baseDir, relativePath));
17370
17779
  return new _CodexcliRule({
17371
17780
  baseDir,
17372
17781
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17425,12 +17834,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
17425
17834
  };
17426
17835
 
17427
17836
  // src/features/rules/copilot-rule.ts
17428
- import { join as join119 } from "path";
17429
- import { z as z68 } from "zod/mini";
17430
- var CopilotRuleFrontmatterSchema = z68.object({
17431
- description: z68.optional(z68.string()),
17432
- applyTo: z68.optional(z68.string()),
17433
- excludeAgent: z68.optional(z68.union([z68.literal("code-review"), z68.literal("coding-agent")]))
17837
+ import { join as join120 } from "path";
17838
+ import { z as z69 } from "zod/mini";
17839
+ var CopilotRuleFrontmatterSchema = z69.object({
17840
+ description: z69.optional(z69.string()),
17841
+ applyTo: z69.optional(z69.string()),
17842
+ excludeAgent: z69.optional(z69.union([z69.literal("code-review"), z69.literal("coding-agent")]))
17434
17843
  });
17435
17844
  var CopilotRule = class _CopilotRule extends ToolRule {
17436
17845
  frontmatter;
@@ -17462,7 +17871,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17462
17871
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
17463
17872
  if (!result.success) {
17464
17873
  throw new Error(
17465
- `Invalid frontmatter in ${join119(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17874
+ `Invalid frontmatter in ${join120(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17466
17875
  );
17467
17876
  }
17468
17877
  }
@@ -17552,8 +17961,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17552
17961
  const paths = this.getSettablePaths({ global });
17553
17962
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
17554
17963
  if (isRoot) {
17555
- const relativePath2 = join119(paths.root.relativeDirPath, paths.root.relativeFilePath);
17556
- const filePath2 = join119(baseDir, relativePath2);
17964
+ const relativePath2 = join120(paths.root.relativeDirPath, paths.root.relativeFilePath);
17965
+ const filePath2 = join120(baseDir, relativePath2);
17557
17966
  const fileContent2 = await readFileContent(filePath2);
17558
17967
  return new _CopilotRule({
17559
17968
  baseDir,
@@ -17568,8 +17977,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17568
17977
  if (!paths.nonRoot) {
17569
17978
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17570
17979
  }
17571
- const relativePath = join119(paths.nonRoot.relativeDirPath, relativeFilePath);
17572
- const filePath = join119(baseDir, relativePath);
17980
+ const relativePath = join120(paths.nonRoot.relativeDirPath, relativeFilePath);
17981
+ const filePath = join120(baseDir, relativePath);
17573
17982
  const fileContent = await readFileContent(filePath);
17574
17983
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
17575
17984
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -17615,7 +18024,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17615
18024
  return {
17616
18025
  success: false,
17617
18026
  error: new Error(
17618
- `Invalid frontmatter in ${join119(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
18027
+ `Invalid frontmatter in ${join120(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17619
18028
  )
17620
18029
  };
17621
18030
  }
@@ -17671,12 +18080,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
17671
18080
  };
17672
18081
 
17673
18082
  // src/features/rules/cursor-rule.ts
17674
- import { join as join120 } from "path";
17675
- import { z as z69 } from "zod/mini";
17676
- var CursorRuleFrontmatterSchema = z69.object({
17677
- description: z69.optional(z69.string()),
17678
- globs: z69.optional(z69.string()),
17679
- alwaysApply: z69.optional(z69.boolean())
18083
+ import { join as join121 } from "path";
18084
+ import { z as z70 } from "zod/mini";
18085
+ var CursorRuleFrontmatterSchema = z70.object({
18086
+ description: z70.optional(z70.string()),
18087
+ globs: z70.optional(z70.string()),
18088
+ alwaysApply: z70.optional(z70.boolean())
17680
18089
  });
17681
18090
  var CursorRule = class _CursorRule extends ToolRule {
17682
18091
  frontmatter;
@@ -17693,7 +18102,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17693
18102
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17694
18103
  if (!result.success) {
17695
18104
  throw new Error(
17696
- `Invalid frontmatter in ${join120(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
18105
+ `Invalid frontmatter in ${join121(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17697
18106
  );
17698
18107
  }
17699
18108
  }
@@ -17809,7 +18218,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17809
18218
  relativeFilePath,
17810
18219
  validate = true
17811
18220
  }) {
17812
- const filePath = join120(
18221
+ const filePath = join121(
17813
18222
  baseDir,
17814
18223
  this.getSettablePaths().nonRoot.relativeDirPath,
17815
18224
  relativeFilePath
@@ -17819,7 +18228,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17819
18228
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17820
18229
  if (!result.success) {
17821
18230
  throw new Error(
17822
- `Invalid frontmatter in ${join120(baseDir, relativeFilePath)}: ${formatError(result.error)}`
18231
+ `Invalid frontmatter in ${join121(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17823
18232
  );
17824
18233
  }
17825
18234
  return new _CursorRule({
@@ -17856,7 +18265,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17856
18265
  return {
17857
18266
  success: false,
17858
18267
  error: new Error(
17859
- `Invalid frontmatter in ${join120(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
18268
+ `Invalid frontmatter in ${join121(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17860
18269
  )
17861
18270
  };
17862
18271
  }
@@ -17876,7 +18285,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17876
18285
  };
17877
18286
 
17878
18287
  // src/features/rules/deepagents-rule.ts
17879
- import { join as join121 } from "path";
18288
+ import { join as join122 } from "path";
17880
18289
  var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17881
18290
  constructor({ fileContent, root, ...rest }) {
17882
18291
  super({
@@ -17903,8 +18312,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17903
18312
  }) {
17904
18313
  const settablePaths = this.getSettablePaths();
17905
18314
  const isRoot = relativeFilePath === "AGENTS.md";
17906
- const relativePath = isRoot ? join121(".deepagents", "AGENTS.md") : join121(".deepagents", "memories", relativeFilePath);
17907
- const fileContent = await readFileContent(join121(baseDir, relativePath));
18315
+ const relativePath = isRoot ? join122(".deepagents", "AGENTS.md") : join122(".deepagents", "memories", relativeFilePath);
18316
+ const fileContent = await readFileContent(join122(baseDir, relativePath));
17908
18317
  return new _DeepagentsRule({
17909
18318
  baseDir,
17910
18319
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17959,7 +18368,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17959
18368
  };
17960
18369
 
17961
18370
  // src/features/rules/factorydroid-rule.ts
17962
- import { join as join122 } from "path";
18371
+ import { join as join123 } from "path";
17963
18372
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17964
18373
  constructor({ fileContent, root, ...rest }) {
17965
18374
  super({
@@ -17999,8 +18408,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17999
18408
  const paths = this.getSettablePaths({ global });
18000
18409
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
18001
18410
  if (isRoot) {
18002
- const relativePath2 = join122(paths.root.relativeDirPath, paths.root.relativeFilePath);
18003
- const fileContent2 = await readFileContent(join122(baseDir, relativePath2));
18411
+ const relativePath2 = join123(paths.root.relativeDirPath, paths.root.relativeFilePath);
18412
+ const fileContent2 = await readFileContent(join123(baseDir, relativePath2));
18004
18413
  return new _FactorydroidRule({
18005
18414
  baseDir,
18006
18415
  relativeDirPath: paths.root.relativeDirPath,
@@ -18013,8 +18422,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
18013
18422
  if (!paths.nonRoot) {
18014
18423
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18015
18424
  }
18016
- const relativePath = join122(paths.nonRoot.relativeDirPath, relativeFilePath);
18017
- const fileContent = await readFileContent(join122(baseDir, relativePath));
18425
+ const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
18426
+ const fileContent = await readFileContent(join123(baseDir, relativePath));
18018
18427
  return new _FactorydroidRule({
18019
18428
  baseDir,
18020
18429
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18073,7 +18482,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
18073
18482
  };
18074
18483
 
18075
18484
  // src/features/rules/geminicli-rule.ts
18076
- import { join as join123 } from "path";
18485
+ import { join as join124 } from "path";
18077
18486
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
18078
18487
  static getSettablePaths({
18079
18488
  global,
@@ -18108,7 +18517,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
18108
18517
  if (isRoot) {
18109
18518
  const relativePath2 = paths.root.relativeFilePath;
18110
18519
  const fileContent2 = await readFileContent(
18111
- join123(baseDir, paths.root.relativeDirPath, relativePath2)
18520
+ join124(baseDir, paths.root.relativeDirPath, relativePath2)
18112
18521
  );
18113
18522
  return new _GeminiCliRule({
18114
18523
  baseDir,
@@ -18122,8 +18531,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
18122
18531
  if (!paths.nonRoot) {
18123
18532
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18124
18533
  }
18125
- const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
18126
- const fileContent = await readFileContent(join123(baseDir, relativePath));
18534
+ const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
18535
+ const fileContent = await readFileContent(join124(baseDir, relativePath));
18127
18536
  return new _GeminiCliRule({
18128
18537
  baseDir,
18129
18538
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18182,7 +18591,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
18182
18591
  };
18183
18592
 
18184
18593
  // src/features/rules/goose-rule.ts
18185
- import { join as join124 } from "path";
18594
+ import { join as join125 } from "path";
18186
18595
  var GooseRule = class _GooseRule extends ToolRule {
18187
18596
  static getSettablePaths({
18188
18597
  global,
@@ -18217,7 +18626,7 @@ var GooseRule = class _GooseRule extends ToolRule {
18217
18626
  if (isRoot) {
18218
18627
  const relativePath2 = paths.root.relativeFilePath;
18219
18628
  const fileContent2 = await readFileContent(
18220
- join124(baseDir, paths.root.relativeDirPath, relativePath2)
18629
+ join125(baseDir, paths.root.relativeDirPath, relativePath2)
18221
18630
  );
18222
18631
  return new _GooseRule({
18223
18632
  baseDir,
@@ -18231,8 +18640,8 @@ var GooseRule = class _GooseRule extends ToolRule {
18231
18640
  if (!paths.nonRoot) {
18232
18641
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18233
18642
  }
18234
- const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
18235
- const fileContent = await readFileContent(join124(baseDir, relativePath));
18643
+ const relativePath = join125(paths.nonRoot.relativeDirPath, relativeFilePath);
18644
+ const fileContent = await readFileContent(join125(baseDir, relativePath));
18236
18645
  return new _GooseRule({
18237
18646
  baseDir,
18238
18647
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18291,7 +18700,7 @@ var GooseRule = class _GooseRule extends ToolRule {
18291
18700
  };
18292
18701
 
18293
18702
  // src/features/rules/junie-rule.ts
18294
- import { join as join125 } from "path";
18703
+ import { join as join126 } from "path";
18295
18704
  var JunieRule = class _JunieRule extends ToolRule {
18296
18705
  static getSettablePaths(_options = {}) {
18297
18706
  return {
@@ -18320,8 +18729,8 @@ var JunieRule = class _JunieRule extends ToolRule {
18320
18729
  }) {
18321
18730
  const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
18322
18731
  const settablePaths = this.getSettablePaths();
18323
- const relativePath = isRoot ? join125(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join125(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
18324
- const fileContent = await readFileContent(join125(baseDir, relativePath));
18732
+ const relativePath = isRoot ? join126(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join126(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
18733
+ const fileContent = await readFileContent(join126(baseDir, relativePath));
18325
18734
  return new _JunieRule({
18326
18735
  baseDir,
18327
18736
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -18376,7 +18785,7 @@ var JunieRule = class _JunieRule extends ToolRule {
18376
18785
  };
18377
18786
 
18378
18787
  // src/features/rules/kilo-rule.ts
18379
- import { join as join126 } from "path";
18788
+ import { join as join127 } from "path";
18380
18789
  var KiloRule = class _KiloRule extends ToolRule {
18381
18790
  static getSettablePaths({
18382
18791
  global,
@@ -18411,7 +18820,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18411
18820
  if (isRoot) {
18412
18821
  const relativePath2 = paths.root.relativeFilePath;
18413
18822
  const fileContent2 = await readFileContent(
18414
- join126(baseDir, paths.root.relativeDirPath, relativePath2)
18823
+ join127(baseDir, paths.root.relativeDirPath, relativePath2)
18415
18824
  );
18416
18825
  return new _KiloRule({
18417
18826
  baseDir,
@@ -18425,8 +18834,8 @@ var KiloRule = class _KiloRule extends ToolRule {
18425
18834
  if (!paths.nonRoot) {
18426
18835
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18427
18836
  }
18428
- const relativePath = join126(paths.nonRoot.relativeDirPath, relativeFilePath);
18429
- const fileContent = await readFileContent(join126(baseDir, relativePath));
18837
+ const relativePath = join127(paths.nonRoot.relativeDirPath, relativeFilePath);
18838
+ const fileContent = await readFileContent(join127(baseDir, relativePath));
18430
18839
  return new _KiloRule({
18431
18840
  baseDir,
18432
18841
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18485,7 +18894,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18485
18894
  };
18486
18895
 
18487
18896
  // src/features/rules/kiro-rule.ts
18488
- import { join as join127 } from "path";
18897
+ import { join as join128 } from "path";
18489
18898
  var KiroRule = class _KiroRule extends ToolRule {
18490
18899
  static getSettablePaths(_options = {}) {
18491
18900
  return {
@@ -18500,7 +18909,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18500
18909
  validate = true
18501
18910
  }) {
18502
18911
  const fileContent = await readFileContent(
18503
- join127(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18912
+ join128(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18504
18913
  );
18505
18914
  return new _KiroRule({
18506
18915
  baseDir,
@@ -18554,7 +18963,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18554
18963
  };
18555
18964
 
18556
18965
  // src/features/rules/opencode-rule.ts
18557
- import { join as join128 } from "path";
18966
+ import { join as join129 } from "path";
18558
18967
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18559
18968
  static getSettablePaths({
18560
18969
  global,
@@ -18589,7 +18998,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18589
18998
  if (isRoot) {
18590
18999
  const relativePath2 = paths.root.relativeFilePath;
18591
19000
  const fileContent2 = await readFileContent(
18592
- join128(baseDir, paths.root.relativeDirPath, relativePath2)
19001
+ join129(baseDir, paths.root.relativeDirPath, relativePath2)
18593
19002
  );
18594
19003
  return new _OpenCodeRule({
18595
19004
  baseDir,
@@ -18603,8 +19012,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18603
19012
  if (!paths.nonRoot) {
18604
19013
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18605
19014
  }
18606
- const relativePath = join128(paths.nonRoot.relativeDirPath, relativeFilePath);
18607
- const fileContent = await readFileContent(join128(baseDir, relativePath));
19015
+ const relativePath = join129(paths.nonRoot.relativeDirPath, relativeFilePath);
19016
+ const fileContent = await readFileContent(join129(baseDir, relativePath));
18608
19017
  return new _OpenCodeRule({
18609
19018
  baseDir,
18610
19019
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18663,7 +19072,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18663
19072
  };
18664
19073
 
18665
19074
  // src/features/rules/qwencode-rule.ts
18666
- import { join as join129 } from "path";
19075
+ import { join as join130 } from "path";
18667
19076
  var QwencodeRule = class _QwencodeRule extends ToolRule {
18668
19077
  static getSettablePaths(_options = {}) {
18669
19078
  return {
@@ -18682,8 +19091,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18682
19091
  validate = true
18683
19092
  }) {
18684
19093
  const isRoot = relativeFilePath === "QWEN.md";
18685
- const relativePath = isRoot ? "QWEN.md" : join129(".qwen", "memories", relativeFilePath);
18686
- const fileContent = await readFileContent(join129(baseDir, relativePath));
19094
+ const relativePath = isRoot ? "QWEN.md" : join130(".qwen", "memories", relativeFilePath);
19095
+ const fileContent = await readFileContent(join130(baseDir, relativePath));
18687
19096
  return new _QwencodeRule({
18688
19097
  baseDir,
18689
19098
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -18735,7 +19144,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18735
19144
  };
18736
19145
 
18737
19146
  // src/features/rules/replit-rule.ts
18738
- import { join as join130 } from "path";
19147
+ import { join as join131 } from "path";
18739
19148
  var ReplitRule = class _ReplitRule extends ToolRule {
18740
19149
  static getSettablePaths(_options = {}) {
18741
19150
  return {
@@ -18757,7 +19166,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18757
19166
  }
18758
19167
  const relativePath = paths.root.relativeFilePath;
18759
19168
  const fileContent = await readFileContent(
18760
- join130(baseDir, paths.root.relativeDirPath, relativePath)
19169
+ join131(baseDir, paths.root.relativeDirPath, relativePath)
18761
19170
  );
18762
19171
  return new _ReplitRule({
18763
19172
  baseDir,
@@ -18823,7 +19232,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18823
19232
  };
18824
19233
 
18825
19234
  // src/features/rules/roo-rule.ts
18826
- import { join as join131 } from "path";
19235
+ import { join as join132 } from "path";
18827
19236
  var RooRule = class _RooRule extends ToolRule {
18828
19237
  static getSettablePaths(_options = {}) {
18829
19238
  return {
@@ -18838,7 +19247,7 @@ var RooRule = class _RooRule extends ToolRule {
18838
19247
  validate = true
18839
19248
  }) {
18840
19249
  const fileContent = await readFileContent(
18841
- join131(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
19250
+ join132(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18842
19251
  );
18843
19252
  return new _RooRule({
18844
19253
  baseDir,
@@ -18907,7 +19316,7 @@ var RooRule = class _RooRule extends ToolRule {
18907
19316
  };
18908
19317
 
18909
19318
  // src/features/rules/rovodev-rule.ts
18910
- import { join as join132 } from "path";
19319
+ import { join as join133 } from "path";
18911
19320
  var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
18912
19321
  var RovodevRule = class _RovodevRule extends ToolRule {
18913
19322
  /**
@@ -18951,7 +19360,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18951
19360
  root: rovodevAgents,
18952
19361
  alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
18953
19362
  nonRoot: {
18954
- relativeDirPath: join132(".rovodev", ".rulesync", "modular-rules")
19363
+ relativeDirPath: join133(".rovodev", ".rulesync", "modular-rules")
18955
19364
  }
18956
19365
  };
18957
19366
  }
@@ -18990,10 +19399,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18990
19399
  }) {
18991
19400
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
18992
19401
  throw new Error(
18993
- `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join132(relativeDirPath, relativeFilePath)}`
19402
+ `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join133(relativeDirPath, relativeFilePath)}`
18994
19403
  );
18995
19404
  }
18996
- const fileContent = await readFileContent(join132(baseDir, relativeDirPath, relativeFilePath));
19405
+ const fileContent = await readFileContent(join133(baseDir, relativeDirPath, relativeFilePath));
18997
19406
  return new _RovodevRule({
18998
19407
  baseDir,
18999
19408
  relativeDirPath,
@@ -19013,10 +19422,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
19013
19422
  paths
19014
19423
  }) {
19015
19424
  const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
19016
- const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join132(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join132(paths.root.relativeDirPath, paths.root.relativeFilePath);
19425
+ const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join133(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join133(paths.root.relativeDirPath, paths.root.relativeFilePath);
19017
19426
  if (relativeFilePath !== "AGENTS.md") {
19018
19427
  throw new Error(
19019
- `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join132(relativeDirPath, relativeFilePath)}`
19428
+ `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join133(relativeDirPath, relativeFilePath)}`
19020
19429
  );
19021
19430
  }
19022
19431
  const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
@@ -19024,10 +19433,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
19024
19433
  );
19025
19434
  if (!allowed) {
19026
19435
  throw new Error(
19027
- `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join132(relativeDirPath, relativeFilePath)}`
19436
+ `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join133(relativeDirPath, relativeFilePath)}`
19028
19437
  );
19029
19438
  }
19030
- const fileContent = await readFileContent(join132(baseDir, relativeDirPath, relativeFilePath));
19439
+ const fileContent = await readFileContent(join133(baseDir, relativeDirPath, relativeFilePath));
19031
19440
  return new _RovodevRule({
19032
19441
  baseDir,
19033
19442
  relativeDirPath,
@@ -19141,7 +19550,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
19141
19550
  };
19142
19551
 
19143
19552
  // src/features/rules/warp-rule.ts
19144
- import { join as join133 } from "path";
19553
+ import { join as join134 } from "path";
19145
19554
  var WarpRule = class _WarpRule extends ToolRule {
19146
19555
  constructor({ fileContent, root, ...rest }) {
19147
19556
  super({
@@ -19167,8 +19576,8 @@ var WarpRule = class _WarpRule extends ToolRule {
19167
19576
  validate = true
19168
19577
  }) {
19169
19578
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
19170
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join133(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
19171
- const fileContent = await readFileContent(join133(baseDir, relativePath));
19579
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join134(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
19580
+ const fileContent = await readFileContent(join134(baseDir, relativePath));
19172
19581
  return new _WarpRule({
19173
19582
  baseDir,
19174
19583
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -19223,7 +19632,7 @@ var WarpRule = class _WarpRule extends ToolRule {
19223
19632
  };
19224
19633
 
19225
19634
  // src/features/rules/windsurf-rule.ts
19226
- import { join as join134 } from "path";
19635
+ import { join as join135 } from "path";
19227
19636
  var WindsurfRule = class _WindsurfRule extends ToolRule {
19228
19637
  static getSettablePaths(_options = {}) {
19229
19638
  return {
@@ -19238,7 +19647,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
19238
19647
  validate = true
19239
19648
  }) {
19240
19649
  const fileContent = await readFileContent(
19241
- join134(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
19650
+ join135(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
19242
19651
  );
19243
19652
  return new _WindsurfRule({
19244
19653
  baseDir,
@@ -19336,11 +19745,11 @@ var rulesProcessorToolTargets = [
19336
19745
  "warp",
19337
19746
  "windsurf"
19338
19747
  ];
19339
- var RulesProcessorToolTargetSchema = z70.enum(rulesProcessorToolTargets);
19340
- var formatRulePaths = (rules) => rules.map((r) => join135(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19341
- var RulesFeatureOptionsSchema = z70.looseObject({
19342
- ruleDiscoveryMode: z70.optional(z70.enum(["none", "explicit"])),
19343
- includeLocalRoot: z70.optional(z70.boolean())
19748
+ var RulesProcessorToolTargetSchema = z71.enum(rulesProcessorToolTargets);
19749
+ var formatRulePaths = (rules) => rules.map((r) => join136(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19750
+ var RulesFeatureOptionsSchema = z71.looseObject({
19751
+ ruleDiscoveryMode: z71.optional(z71.enum(["none", "explicit"])),
19752
+ includeLocalRoot: z71.optional(z71.boolean())
19344
19753
  });
19345
19754
  var resolveRuleDiscoveryMode = ({
19346
19755
  defaultMode,
@@ -19361,8 +19770,8 @@ var resolveRuleDiscoveryMode = ({
19361
19770
  }
19362
19771
  return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
19363
19772
  };
19364
- var IncludeLocalRootSchema = z70.looseObject({
19365
- includeLocalRoot: z70.optional(z70.boolean())
19773
+ var IncludeLocalRootSchema = z71.looseObject({
19774
+ includeLocalRoot: z71.optional(z71.boolean())
19366
19775
  });
19367
19776
  var resolveIncludeLocalRoot = (options) => {
19368
19777
  if (!options) return true;
@@ -19805,7 +20214,7 @@ var RulesProcessor = class extends FeatureProcessor {
19805
20214
  }).relativeDirPath;
19806
20215
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
19807
20216
  const frontmatter = skill.getFrontmatter();
19808
- const relativePath = join135(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
20217
+ const relativePath = join136(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19809
20218
  return {
19810
20219
  name: frontmatter.name,
19811
20220
  description: frontmatter.description,
@@ -19934,8 +20343,8 @@ var RulesProcessor = class extends FeatureProcessor {
19934
20343
  * Load and parse rulesync rule files from .rulesync/rules/ directory
19935
20344
  */
19936
20345
  async loadRulesyncFiles() {
19937
- const rulesyncBaseDir = join135(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19938
- const files = await findFilesByGlobs(join135(rulesyncBaseDir, "**", "*.md"));
20346
+ const rulesyncBaseDir = join136(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
20347
+ const files = await findFilesByGlobs(join136(rulesyncBaseDir, "**", "*.md"));
19939
20348
  this.logger.debug(`Found ${files.length} rulesync files`);
19940
20349
  const rulesyncRules = await Promise.all(
19941
20350
  files.map((file) => {
@@ -20050,13 +20459,13 @@ var RulesProcessor = class extends FeatureProcessor {
20050
20459
  return [];
20051
20460
  }
20052
20461
  const uniqueRootFilePaths = await findFilesWithFallback(
20053
- join135(
20462
+ join136(
20054
20463
  this.baseDir,
20055
20464
  settablePaths.root.relativeDirPath ?? ".",
20056
20465
  settablePaths.root.relativeFilePath
20057
20466
  ),
20058
20467
  settablePaths.alternativeRoots,
20059
- (alt) => join135(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
20468
+ (alt) => join136(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
20060
20469
  );
20061
20470
  if (forDeletion) {
20062
20471
  return buildDeletionRulesFromPaths(uniqueRootFilePaths);
@@ -20087,7 +20496,7 @@ var RulesProcessor = class extends FeatureProcessor {
20087
20496
  return [];
20088
20497
  }
20089
20498
  const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
20090
- join135(this.baseDir, "AGENTS.local.md")
20499
+ join136(this.baseDir, "AGENTS.local.md")
20091
20500
  );
20092
20501
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
20093
20502
  }
@@ -20098,9 +20507,9 @@ var RulesProcessor = class extends FeatureProcessor {
20098
20507
  return [];
20099
20508
  }
20100
20509
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
20101
- join135(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
20510
+ join136(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
20102
20511
  settablePaths.alternativeRoots,
20103
- (alt) => join135(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
20512
+ (alt) => join136(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
20104
20513
  );
20105
20514
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
20106
20515
  })();
@@ -20111,20 +20520,20 @@ var RulesProcessor = class extends FeatureProcessor {
20111
20520
  if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
20112
20521
  return [];
20113
20522
  }
20114
- const primaryPaths = await findFilesByGlobs(join135(this.baseDir, ".rovodev", "AGENTS.md"));
20523
+ const primaryPaths = await findFilesByGlobs(join136(this.baseDir, ".rovodev", "AGENTS.md"));
20115
20524
  if (primaryPaths.length === 0) {
20116
20525
  return [];
20117
20526
  }
20118
- const mirrorPaths = await findFilesByGlobs(join135(this.baseDir, "AGENTS.md"));
20527
+ const mirrorPaths = await findFilesByGlobs(join136(this.baseDir, "AGENTS.md"));
20119
20528
  return buildDeletionRulesFromPaths(mirrorPaths);
20120
20529
  })();
20121
20530
  const nonRootToolRules = await (async () => {
20122
20531
  if (!settablePaths.nonRoot) {
20123
20532
  return [];
20124
20533
  }
20125
- const nonRootBaseDir = join135(this.baseDir, settablePaths.nonRoot.relativeDirPath);
20534
+ const nonRootBaseDir = join136(this.baseDir, settablePaths.nonRoot.relativeDirPath);
20126
20535
  const nonRootFilePaths = await findFilesByGlobs(
20127
- join135(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
20536
+ join136(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
20128
20537
  );
20129
20538
  if (forDeletion) {
20130
20539
  return buildDeletionRulesFromPaths(nonRootFilePaths, {
@@ -20138,7 +20547,7 @@ var RulesProcessor = class extends FeatureProcessor {
20138
20547
  const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
20139
20548
  if (!ok) {
20140
20549
  this.logger.warn(
20141
- `Skipping reserved Rovodev path under modular-rules (import): ${join135(modularRootRelative, relativeFilePath)}`
20550
+ `Skipping reserved Rovodev path under modular-rules (import): ${join136(modularRootRelative, relativeFilePath)}`
20142
20551
  );
20143
20552
  }
20144
20553
  return ok;
@@ -20264,14 +20673,14 @@ s/<command> [arguments]
20264
20673
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
20265
20674
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
20266
20675
 
20267
- When users call a custom slash command, you have to look for the markdown file, \`${join135(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
20676
+ When users call a custom slash command, you have to look for the markdown file, \`${join136(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
20268
20677
  const subagentsSection = subagents ? `## Simulated Subagents
20269
20678
 
20270
20679
  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.
20271
20680
 
20272
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${join135(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
20681
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${join136(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
20273
20682
 
20274
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join135(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
20683
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join136(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
20275
20684
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
20276
20685
  const result = [
20277
20686
  overview,
@@ -20371,7 +20780,7 @@ function warnUnsupportedTargets(params) {
20371
20780
  }
20372
20781
  }
20373
20782
  async function checkRulesyncDirExists(params) {
20374
- return fileExists(join136(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
20783
+ return fileExists(join137(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
20375
20784
  }
20376
20785
  async function generate(params) {
20377
20786
  const { config, logger } = params;