rulesync 7.8.1 → 7.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -634,7 +634,7 @@ function getBaseDirsInLightOfGlobal({
634
634
  }
635
635
 
636
636
  // src/lib/generate.ts
637
- var import_node_path113 = require("path");
637
+ var import_node_path114 = require("path");
638
638
  var import_es_toolkit4 = require("es-toolkit");
639
639
 
640
640
  // src/features/commands/commands-processor.ts
@@ -3019,7 +3019,7 @@ var CommandsProcessor = class extends FeatureProcessor {
3019
3019
  };
3020
3020
 
3021
3021
  // src/features/hooks/hooks-processor.ts
3022
- var import_mini15 = require("zod/mini");
3022
+ var import_mini16 = require("zod/mini");
3023
3023
 
3024
3024
  // src/types/hooks.ts
3025
3025
  var import_mini14 = require("zod/mini");
@@ -3084,6 +3084,14 @@ var OPENCODE_HOOK_EVENTS = [
3084
3084
  "afterShellExecution",
3085
3085
  "permissionRequest"
3086
3086
  ];
3087
+ var COPILOT_HOOK_EVENTS = [
3088
+ "sessionStart",
3089
+ "sessionEnd",
3090
+ "afterSubmitPrompt",
3091
+ "preToolUse",
3092
+ "postToolUse",
3093
+ "afterError"
3094
+ ];
3087
3095
  var FACTORYDROID_HOOK_EVENTS = [
3088
3096
  "sessionStart",
3089
3097
  "sessionEnd",
@@ -3103,6 +3111,7 @@ var HooksConfigSchema = import_mini14.z.looseObject({
3103
3111
  hooks: hooksRecordSchema,
3104
3112
  cursor: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3105
3113
  claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3114
+ copilot: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3106
3115
  opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3107
3116
  factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
3108
3117
  });
@@ -3172,6 +3181,17 @@ var CANONICAL_TO_OPENCODE_EVENT_NAMES = {
3172
3181
  afterShellExecution: "command.executed",
3173
3182
  permissionRequest: "permission.asked"
3174
3183
  };
3184
+ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
3185
+ sessionStart: "sessionStart",
3186
+ sessionEnd: "sessionEnd",
3187
+ afterSubmitPrompt: "userPromptSubmitted",
3188
+ preToolUse: "preToolUse",
3189
+ postToolUse: "postToolUse",
3190
+ afterError: "errorOccurred"
3191
+ };
3192
+ var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3193
+ Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
3194
+ );
3175
3195
 
3176
3196
  // src/features/hooks/claudecode-hooks.ts
3177
3197
  var import_node_path22 = require("path");
@@ -3448,8 +3468,185 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3448
3468
  }
3449
3469
  };
3450
3470
 
3451
- // src/features/hooks/cursor-hooks.ts
3471
+ // src/features/hooks/copilot-hooks.ts
3452
3472
  var import_node_path23 = require("path");
3473
+ var import_mini15 = require("zod/mini");
3474
+ var CopilotHookEntrySchema = import_mini15.z.looseObject({
3475
+ type: import_mini15.z.string(),
3476
+ bash: import_mini15.z.optional(import_mini15.z.string()),
3477
+ powershell: import_mini15.z.optional(import_mini15.z.string()),
3478
+ timeoutSec: import_mini15.z.optional(import_mini15.z.number())
3479
+ });
3480
+ function canonicalToCopilotHooks(config) {
3481
+ const isWindows = process.platform === "win32";
3482
+ const commandField = isWindows ? "powershell" : "bash";
3483
+ const supported = new Set(COPILOT_HOOK_EVENTS);
3484
+ const sharedConfigHooks = {};
3485
+ for (const [event, defs] of Object.entries(config.hooks)) {
3486
+ if (supported.has(event)) {
3487
+ sharedConfigHooks[event] = defs;
3488
+ }
3489
+ }
3490
+ const effectiveHooks = {
3491
+ ...sharedConfigHooks,
3492
+ ...config.copilot?.hooks
3493
+ };
3494
+ const copilot = {};
3495
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3496
+ const copilotEventName = CANONICAL_TO_COPILOT_EVENT_NAMES[eventName] ?? eventName;
3497
+ const entries = [];
3498
+ for (const def of definitions) {
3499
+ const hookType = def.type ?? "command";
3500
+ if (def.matcher) continue;
3501
+ if (hookType !== "command") continue;
3502
+ const command = def.command;
3503
+ const timeout = def.timeout;
3504
+ const rest = Object.fromEntries(
3505
+ Object.entries(def).filter(
3506
+ ([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
3507
+ )
3508
+ );
3509
+ entries.push({
3510
+ type: hookType,
3511
+ ...command !== void 0 && command !== null && { [commandField]: command },
3512
+ ...timeout !== void 0 && timeout !== null && { timeoutSec: timeout },
3513
+ ...rest
3514
+ });
3515
+ }
3516
+ if (entries.length > 0) {
3517
+ copilot[copilotEventName] = entries;
3518
+ }
3519
+ }
3520
+ return copilot;
3521
+ }
3522
+ function resolveImportCommand(entry) {
3523
+ const hasBash = typeof entry.bash === "string";
3524
+ const hasPowershell = typeof entry.powershell === "string";
3525
+ if (hasBash && hasPowershell) {
3526
+ const isWindows = process.platform === "win32";
3527
+ const chosen = isWindows ? "powershell" : "bash";
3528
+ const ignored = isWindows ? "bash" : "powershell";
3529
+ logger.warn(
3530
+ `Copilot hook has both bash and powershell commands; using ${chosen} and ignoring ${ignored} on this platform.`
3531
+ );
3532
+ return isWindows ? entry.powershell : entry.bash;
3533
+ } else if (hasBash) {
3534
+ return entry.bash;
3535
+ } else if (hasPowershell) {
3536
+ return entry.powershell;
3537
+ }
3538
+ return void 0;
3539
+ }
3540
+ function copilotHooksToCanonical(copilotHooks) {
3541
+ if (copilotHooks === null || copilotHooks === void 0 || typeof copilotHooks !== "object") {
3542
+ return {};
3543
+ }
3544
+ const canonical = {};
3545
+ for (const [copilotEventName, hookEntries] of Object.entries(copilotHooks)) {
3546
+ const eventName = COPILOT_TO_CANONICAL_EVENT_NAMES[copilotEventName] ?? copilotEventName;
3547
+ if (!Array.isArray(hookEntries)) continue;
3548
+ const defs = [];
3549
+ for (const rawEntry of hookEntries) {
3550
+ const parseResult = CopilotHookEntrySchema.safeParse(rawEntry);
3551
+ if (!parseResult.success) continue;
3552
+ const entry = parseResult.data;
3553
+ const command = resolveImportCommand(entry);
3554
+ const timeout = entry.timeoutSec;
3555
+ defs.push({
3556
+ type: "command",
3557
+ ...command !== void 0 && { command },
3558
+ ...timeout !== void 0 && { timeout }
3559
+ });
3560
+ }
3561
+ if (defs.length > 0) {
3562
+ canonical[eventName] = defs;
3563
+ }
3564
+ }
3565
+ return canonical;
3566
+ }
3567
+ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3568
+ constructor(params) {
3569
+ super({
3570
+ ...params,
3571
+ fileContent: params.fileContent ?? "{}"
3572
+ });
3573
+ }
3574
+ static getSettablePaths(_options = {}) {
3575
+ return {
3576
+ relativeDirPath: (0, import_node_path23.join)(".github", "hooks"),
3577
+ relativeFilePath: "copilot-hooks.json"
3578
+ };
3579
+ }
3580
+ static async fromFile({
3581
+ baseDir = process.cwd(),
3582
+ validate = true,
3583
+ global = false
3584
+ }) {
3585
+ const paths = _CopilotHooks.getSettablePaths({ global });
3586
+ const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3587
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3588
+ return new _CopilotHooks({
3589
+ baseDir,
3590
+ relativeDirPath: paths.relativeDirPath,
3591
+ relativeFilePath: paths.relativeFilePath,
3592
+ fileContent,
3593
+ validate
3594
+ });
3595
+ }
3596
+ static async fromRulesyncHooks({
3597
+ baseDir = process.cwd(),
3598
+ rulesyncHooks,
3599
+ validate = true
3600
+ }) {
3601
+ const paths = _CopilotHooks.getSettablePaths();
3602
+ const config = rulesyncHooks.getJson();
3603
+ const copilotHooks = canonicalToCopilotHooks(config);
3604
+ const fileContent = JSON.stringify({ version: 1, hooks: copilotHooks }, null, 2);
3605
+ return new _CopilotHooks({
3606
+ baseDir,
3607
+ relativeDirPath: paths.relativeDirPath,
3608
+ relativeFilePath: paths.relativeFilePath,
3609
+ fileContent,
3610
+ validate
3611
+ });
3612
+ }
3613
+ toRulesyncHooks() {
3614
+ let parsed;
3615
+ try {
3616
+ parsed = JSON.parse(this.getFileContent());
3617
+ } catch (error) {
3618
+ throw new Error(
3619
+ `Failed to parse Copilot hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3620
+ {
3621
+ cause: error
3622
+ }
3623
+ );
3624
+ }
3625
+ const hooks = copilotHooksToCanonical(parsed.hooks);
3626
+ return this.toRulesyncHooksDefault({
3627
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
3628
+ });
3629
+ }
3630
+ validate() {
3631
+ return { success: true, error: null };
3632
+ }
3633
+ static forDeletion({
3634
+ baseDir = process.cwd(),
3635
+ relativeDirPath,
3636
+ relativeFilePath
3637
+ }) {
3638
+ return new _CopilotHooks({
3639
+ baseDir,
3640
+ relativeDirPath,
3641
+ relativeFilePath,
3642
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
3643
+ validate: false
3644
+ });
3645
+ }
3646
+ };
3647
+
3648
+ // src/features/hooks/cursor-hooks.ts
3649
+ var import_node_path24 = require("path");
3453
3650
  var CursorHooks = class _CursorHooks extends ToolHooks {
3454
3651
  constructor(params) {
3455
3652
  const { rulesyncHooks: _r, ...rest } = params;
@@ -3470,7 +3667,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3470
3667
  }) {
3471
3668
  const paths = _CursorHooks.getSettablePaths();
3472
3669
  const fileContent = await readFileContent(
3473
- (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3670
+ (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3474
3671
  );
3475
3672
  return new _CursorHooks({
3476
3673
  baseDir,
@@ -3550,7 +3747,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3550
3747
  };
3551
3748
 
3552
3749
  // src/features/hooks/factorydroid-hooks.ts
3553
- var import_node_path24 = require("path");
3750
+ var import_node_path25 = require("path");
3554
3751
  function canonicalToFactorydroidHooks(config) {
3555
3752
  const supported = new Set(FACTORYDROID_HOOK_EVENTS);
3556
3753
  const sharedHooks = {};
@@ -3655,7 +3852,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3655
3852
  global = false
3656
3853
  }) {
3657
3854
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3658
- const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3855
+ const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3659
3856
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3660
3857
  return new _FactorydroidHooks({
3661
3858
  baseDir,
@@ -3672,7 +3869,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3672
3869
  global = false
3673
3870
  }) {
3674
3871
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3675
- const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3872
+ const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3676
3873
  const existingContent = await readOrInitializeFileContent(
3677
3874
  filePath,
3678
3875
  JSON.stringify({}, null, 2)
@@ -3704,7 +3901,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3704
3901
  settings = JSON.parse(this.getFileContent());
3705
3902
  } catch (error) {
3706
3903
  throw new Error(
3707
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3904
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3708
3905
  {
3709
3906
  cause: error
3710
3907
  }
@@ -3734,7 +3931,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3734
3931
  };
3735
3932
 
3736
3933
  // src/features/hooks/opencode-hooks.ts
3737
- var import_node_path25 = require("path");
3934
+ var import_node_path26 = require("path");
3738
3935
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
3739
3936
  function escapeForTemplateLiteral(command) {
3740
3937
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -3832,7 +4029,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3832
4029
  }
3833
4030
  static getSettablePaths(options) {
3834
4031
  return {
3835
- relativeDirPath: options?.global ? (0, import_node_path25.join)(".config", "opencode", "plugins") : (0, import_node_path25.join)(".opencode", "plugins"),
4032
+ relativeDirPath: options?.global ? (0, import_node_path26.join)(".config", "opencode", "plugins") : (0, import_node_path26.join)(".opencode", "plugins"),
3836
4033
  relativeFilePath: "rulesync-hooks.js"
3837
4034
  };
3838
4035
  }
@@ -3843,7 +4040,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3843
4040
  }) {
3844
4041
  const paths = _OpencodeHooks.getSettablePaths({ global });
3845
4042
  const fileContent = await readFileContent(
3846
- (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4043
+ (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3847
4044
  );
3848
4045
  return new _OpencodeHooks({
3849
4046
  baseDir,
@@ -3892,43 +4089,83 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3892
4089
  };
3893
4090
 
3894
4091
  // src/features/hooks/hooks-processor.ts
3895
- var hooksProcessorToolTargetTuple = ["cursor", "claudecode", "opencode", "factorydroid"];
3896
- var HooksProcessorToolTargetSchema = import_mini15.z.enum(hooksProcessorToolTargetTuple);
4092
+ var hooksProcessorToolTargetTuple = [
4093
+ "cursor",
4094
+ "claudecode",
4095
+ "copilot",
4096
+ "opencode",
4097
+ "factorydroid"
4098
+ ];
4099
+ var HooksProcessorToolTargetSchema = import_mini16.z.enum(hooksProcessorToolTargetTuple);
3897
4100
  var toolHooksFactories = /* @__PURE__ */ new Map([
3898
4101
  [
3899
4102
  "cursor",
3900
4103
  {
3901
4104
  class: CursorHooks,
3902
- meta: { supportsProject: true, supportsGlobal: false, supportsImport: true },
4105
+ meta: {
4106
+ supportsProject: true,
4107
+ supportsGlobal: false,
4108
+ supportsImport: true
4109
+ },
3903
4110
  supportedEvents: CURSOR_HOOK_EVENTS,
3904
- supportedHookTypes: ["command", "prompt"]
4111
+ supportedHookTypes: ["command", "prompt"],
4112
+ supportsMatcher: true
3905
4113
  }
3906
4114
  ],
3907
4115
  [
3908
4116
  "claudecode",
3909
4117
  {
3910
4118
  class: ClaudecodeHooks,
3911
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
4119
+ meta: {
4120
+ supportsProject: true,
4121
+ supportsGlobal: true,
4122
+ supportsImport: true
4123
+ },
3912
4124
  supportedEvents: CLAUDE_HOOK_EVENTS,
3913
- supportedHookTypes: ["command", "prompt"]
4125
+ supportedHookTypes: ["command", "prompt"],
4126
+ supportsMatcher: true
4127
+ }
4128
+ ],
4129
+ [
4130
+ "copilot",
4131
+ {
4132
+ class: CopilotHooks,
4133
+ meta: {
4134
+ supportsProject: true,
4135
+ supportsGlobal: false,
4136
+ supportsImport: true
4137
+ },
4138
+ supportedEvents: COPILOT_HOOK_EVENTS,
4139
+ supportedHookTypes: ["command"],
4140
+ supportsMatcher: false
3914
4141
  }
3915
4142
  ],
3916
4143
  [
3917
4144
  "opencode",
3918
4145
  {
3919
4146
  class: OpencodeHooks,
3920
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: false },
4147
+ meta: {
4148
+ supportsProject: true,
4149
+ supportsGlobal: true,
4150
+ supportsImport: false
4151
+ },
3921
4152
  supportedEvents: OPENCODE_HOOK_EVENTS,
3922
- supportedHookTypes: ["command"]
4153
+ supportedHookTypes: ["command"],
4154
+ supportsMatcher: true
3923
4155
  }
3924
4156
  ],
3925
4157
  [
3926
4158
  "factorydroid",
3927
4159
  {
3928
4160
  class: FactorydroidHooks,
3929
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
4161
+ meta: {
4162
+ supportsProject: true,
4163
+ supportsGlobal: true,
4164
+ supportsImport: true
4165
+ },
3930
4166
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
3931
- supportedHookTypes: ["command", "prompt"]
4167
+ supportedHookTypes: ["command", "prompt"],
4168
+ supportsMatcher: true
3932
4169
  }
3933
4170
  ]
3934
4171
  ]);
@@ -4045,6 +4282,21 @@ var HooksProcessor = class extends FeatureProcessor {
4045
4282
  );
4046
4283
  }
4047
4284
  }
4285
+ if (!factory.supportsMatcher) {
4286
+ const eventsWithMatcher = /* @__PURE__ */ new Set();
4287
+ for (const [event, defs] of Object.entries(effectiveHooks)) {
4288
+ for (const def of defs) {
4289
+ if (def.matcher) {
4290
+ eventsWithMatcher.add(event);
4291
+ }
4292
+ }
4293
+ }
4294
+ if (eventsWithMatcher.size > 0) {
4295
+ logger.warn(
4296
+ `Skipped matcher hook(s) for ${this.toolTarget} (not supported): ${Array.from(eventsWithMatcher).join(", ")}`
4297
+ );
4298
+ }
4299
+ }
4048
4300
  const toolHooks = await factory.class.fromRulesyncHooks({
4049
4301
  baseDir: this.baseDir,
4050
4302
  rulesyncHooks,
@@ -4069,13 +4321,13 @@ var HooksProcessor = class extends FeatureProcessor {
4069
4321
  };
4070
4322
 
4071
4323
  // src/features/ignore/ignore-processor.ts
4072
- var import_mini16 = require("zod/mini");
4324
+ var import_mini17 = require("zod/mini");
4073
4325
 
4074
4326
  // src/features/ignore/augmentcode-ignore.ts
4075
- var import_node_path27 = require("path");
4327
+ var import_node_path28 = require("path");
4076
4328
 
4077
4329
  // src/features/ignore/rulesync-ignore.ts
4078
- var import_node_path26 = require("path");
4330
+ var import_node_path27 = require("path");
4079
4331
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4080
4332
  validate() {
4081
4333
  return { success: true, error: null };
@@ -4095,12 +4347,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4095
4347
  static async fromFile() {
4096
4348
  const baseDir = process.cwd();
4097
4349
  const paths = this.getSettablePaths();
4098
- const recommendedPath = (0, import_node_path26.join)(
4350
+ const recommendedPath = (0, import_node_path27.join)(
4099
4351
  baseDir,
4100
4352
  paths.recommended.relativeDirPath,
4101
4353
  paths.recommended.relativeFilePath
4102
4354
  );
4103
- const legacyPath = (0, import_node_path26.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4355
+ const legacyPath = (0, import_node_path27.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4104
4356
  if (await fileExists(recommendedPath)) {
4105
4357
  const fileContent2 = await readFileContent(recommendedPath);
4106
4358
  return new _RulesyncIgnore({
@@ -4216,7 +4468,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4216
4468
  validate = true
4217
4469
  }) {
4218
4470
  const fileContent = await readFileContent(
4219
- (0, import_node_path27.join)(
4471
+ (0, import_node_path28.join)(
4220
4472
  baseDir,
4221
4473
  this.getSettablePaths().relativeDirPath,
4222
4474
  this.getSettablePaths().relativeFilePath
@@ -4246,7 +4498,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4246
4498
  };
4247
4499
 
4248
4500
  // src/features/ignore/claudecode-ignore.ts
4249
- var import_node_path28 = require("path");
4501
+ var import_node_path29 = require("path");
4250
4502
  var import_es_toolkit2 = require("es-toolkit");
4251
4503
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4252
4504
  constructor(params) {
@@ -4289,7 +4541,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4289
4541
  const fileContent = rulesyncIgnore.getFileContent();
4290
4542
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4291
4543
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4292
- const filePath = (0, import_node_path28.join)(
4544
+ const filePath = (0, import_node_path29.join)(
4293
4545
  baseDir,
4294
4546
  this.getSettablePaths().relativeDirPath,
4295
4547
  this.getSettablePaths().relativeFilePath
@@ -4325,7 +4577,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4325
4577
  validate = true
4326
4578
  }) {
4327
4579
  const fileContent = await readFileContent(
4328
- (0, import_node_path28.join)(
4580
+ (0, import_node_path29.join)(
4329
4581
  baseDir,
4330
4582
  this.getSettablePaths().relativeDirPath,
4331
4583
  this.getSettablePaths().relativeFilePath
@@ -4355,7 +4607,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4355
4607
  };
4356
4608
 
4357
4609
  // src/features/ignore/cline-ignore.ts
4358
- var import_node_path29 = require("path");
4610
+ var import_node_path30 = require("path");
4359
4611
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4360
4612
  static getSettablePaths() {
4361
4613
  return {
@@ -4392,7 +4644,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4392
4644
  validate = true
4393
4645
  }) {
4394
4646
  const fileContent = await readFileContent(
4395
- (0, import_node_path29.join)(
4647
+ (0, import_node_path30.join)(
4396
4648
  baseDir,
4397
4649
  this.getSettablePaths().relativeDirPath,
4398
4650
  this.getSettablePaths().relativeFilePath
@@ -4422,7 +4674,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4422
4674
  };
4423
4675
 
4424
4676
  // src/features/ignore/cursor-ignore.ts
4425
- var import_node_path30 = require("path");
4677
+ var import_node_path31 = require("path");
4426
4678
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4427
4679
  static getSettablePaths() {
4428
4680
  return {
@@ -4455,7 +4707,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4455
4707
  validate = true
4456
4708
  }) {
4457
4709
  const fileContent = await readFileContent(
4458
- (0, import_node_path30.join)(
4710
+ (0, import_node_path31.join)(
4459
4711
  baseDir,
4460
4712
  this.getSettablePaths().relativeDirPath,
4461
4713
  this.getSettablePaths().relativeFilePath
@@ -4485,7 +4737,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4485
4737
  };
4486
4738
 
4487
4739
  // src/features/ignore/geminicli-ignore.ts
4488
- var import_node_path31 = require("path");
4740
+ var import_node_path32 = require("path");
4489
4741
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4490
4742
  static getSettablePaths() {
4491
4743
  return {
@@ -4512,7 +4764,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4512
4764
  validate = true
4513
4765
  }) {
4514
4766
  const fileContent = await readFileContent(
4515
- (0, import_node_path31.join)(
4767
+ (0, import_node_path32.join)(
4516
4768
  baseDir,
4517
4769
  this.getSettablePaths().relativeDirPath,
4518
4770
  this.getSettablePaths().relativeFilePath
@@ -4542,7 +4794,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4542
4794
  };
4543
4795
 
4544
4796
  // src/features/ignore/goose-ignore.ts
4545
- var import_node_path32 = require("path");
4797
+ var import_node_path33 = require("path");
4546
4798
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4547
4799
  static getSettablePaths() {
4548
4800
  return {
@@ -4579,7 +4831,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4579
4831
  validate = true
4580
4832
  }) {
4581
4833
  const fileContent = await readFileContent(
4582
- (0, import_node_path32.join)(
4834
+ (0, import_node_path33.join)(
4583
4835
  baseDir,
4584
4836
  this.getSettablePaths().relativeDirPath,
4585
4837
  this.getSettablePaths().relativeFilePath
@@ -4609,7 +4861,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4609
4861
  };
4610
4862
 
4611
4863
  // src/features/ignore/junie-ignore.ts
4612
- var import_node_path33 = require("path");
4864
+ var import_node_path34 = require("path");
4613
4865
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4614
4866
  static getSettablePaths() {
4615
4867
  return {
@@ -4636,7 +4888,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4636
4888
  validate = true
4637
4889
  }) {
4638
4890
  const fileContent = await readFileContent(
4639
- (0, import_node_path33.join)(
4891
+ (0, import_node_path34.join)(
4640
4892
  baseDir,
4641
4893
  this.getSettablePaths().relativeDirPath,
4642
4894
  this.getSettablePaths().relativeFilePath
@@ -4666,7 +4918,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4666
4918
  };
4667
4919
 
4668
4920
  // src/features/ignore/kilo-ignore.ts
4669
- var import_node_path34 = require("path");
4921
+ var import_node_path35 = require("path");
4670
4922
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4671
4923
  static getSettablePaths() {
4672
4924
  return {
@@ -4703,7 +4955,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4703
4955
  validate = true
4704
4956
  }) {
4705
4957
  const fileContent = await readFileContent(
4706
- (0, import_node_path34.join)(
4958
+ (0, import_node_path35.join)(
4707
4959
  baseDir,
4708
4960
  this.getSettablePaths().relativeDirPath,
4709
4961
  this.getSettablePaths().relativeFilePath
@@ -4733,7 +4985,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4733
4985
  };
4734
4986
 
4735
4987
  // src/features/ignore/kiro-ignore.ts
4736
- var import_node_path35 = require("path");
4988
+ var import_node_path36 = require("path");
4737
4989
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4738
4990
  static getSettablePaths() {
4739
4991
  return {
@@ -4760,7 +5012,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4760
5012
  validate = true
4761
5013
  }) {
4762
5014
  const fileContent = await readFileContent(
4763
- (0, import_node_path35.join)(
5015
+ (0, import_node_path36.join)(
4764
5016
  baseDir,
4765
5017
  this.getSettablePaths().relativeDirPath,
4766
5018
  this.getSettablePaths().relativeFilePath
@@ -4790,7 +5042,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4790
5042
  };
4791
5043
 
4792
5044
  // src/features/ignore/qwencode-ignore.ts
4793
- var import_node_path36 = require("path");
5045
+ var import_node_path37 = require("path");
4794
5046
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4795
5047
  static getSettablePaths() {
4796
5048
  return {
@@ -4817,7 +5069,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4817
5069
  validate = true
4818
5070
  }) {
4819
5071
  const fileContent = await readFileContent(
4820
- (0, import_node_path36.join)(
5072
+ (0, import_node_path37.join)(
4821
5073
  baseDir,
4822
5074
  this.getSettablePaths().relativeDirPath,
4823
5075
  this.getSettablePaths().relativeFilePath
@@ -4847,7 +5099,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4847
5099
  };
4848
5100
 
4849
5101
  // src/features/ignore/roo-ignore.ts
4850
- var import_node_path37 = require("path");
5102
+ var import_node_path38 = require("path");
4851
5103
  var RooIgnore = class _RooIgnore extends ToolIgnore {
4852
5104
  static getSettablePaths() {
4853
5105
  return {
@@ -4874,7 +5126,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4874
5126
  validate = true
4875
5127
  }) {
4876
5128
  const fileContent = await readFileContent(
4877
- (0, import_node_path37.join)(
5129
+ (0, import_node_path38.join)(
4878
5130
  baseDir,
4879
5131
  this.getSettablePaths().relativeDirPath,
4880
5132
  this.getSettablePaths().relativeFilePath
@@ -4904,7 +5156,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4904
5156
  };
4905
5157
 
4906
5158
  // src/features/ignore/windsurf-ignore.ts
4907
- var import_node_path38 = require("path");
5159
+ var import_node_path39 = require("path");
4908
5160
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4909
5161
  static getSettablePaths() {
4910
5162
  return {
@@ -4931,7 +5183,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4931
5183
  validate = true
4932
5184
  }) {
4933
5185
  const fileContent = await readFileContent(
4934
- (0, import_node_path38.join)(
5186
+ (0, import_node_path39.join)(
4935
5187
  baseDir,
4936
5188
  this.getSettablePaths().relativeDirPath,
4937
5189
  this.getSettablePaths().relativeFilePath
@@ -4961,7 +5213,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4961
5213
  };
4962
5214
 
4963
5215
  // src/features/ignore/zed-ignore.ts
4964
- var import_node_path39 = require("path");
5216
+ var import_node_path40 = require("path");
4965
5217
  var import_es_toolkit3 = require("es-toolkit");
4966
5218
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4967
5219
  constructor(params) {
@@ -4998,7 +5250,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4998
5250
  }) {
4999
5251
  const fileContent = rulesyncIgnore.getFileContent();
5000
5252
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5001
- const filePath = (0, import_node_path39.join)(
5253
+ const filePath = (0, import_node_path40.join)(
5002
5254
  baseDir,
5003
5255
  this.getSettablePaths().relativeDirPath,
5004
5256
  this.getSettablePaths().relativeFilePath
@@ -5025,7 +5277,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5025
5277
  validate = true
5026
5278
  }) {
5027
5279
  const fileContent = await readFileContent(
5028
- (0, import_node_path39.join)(
5280
+ (0, import_node_path40.join)(
5029
5281
  baseDir,
5030
5282
  this.getSettablePaths().relativeDirPath,
5031
5283
  this.getSettablePaths().relativeFilePath
@@ -5071,7 +5323,7 @@ var ignoreProcessorToolTargets = [
5071
5323
  "windsurf",
5072
5324
  "zed"
5073
5325
  ];
5074
- var IgnoreProcessorToolTargetSchema = import_mini16.z.enum(ignoreProcessorToolTargets);
5326
+ var IgnoreProcessorToolTargetSchema = import_mini17.z.enum(ignoreProcessorToolTargets);
5075
5327
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
5076
5328
  ["augmentcode", { class: AugmentcodeIgnore }],
5077
5329
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -5209,49 +5461,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
5209
5461
  };
5210
5462
 
5211
5463
  // src/features/mcp/mcp-processor.ts
5212
- var import_mini20 = require("zod/mini");
5464
+ var import_mini21 = require("zod/mini");
5213
5465
 
5214
5466
  // src/features/mcp/claudecode-mcp.ts
5215
- var import_node_path41 = require("path");
5467
+ var import_node_path42 = require("path");
5216
5468
 
5217
5469
  // src/features/mcp/rulesync-mcp.ts
5218
- var import_node_path40 = require("path");
5470
+ var import_node_path41 = require("path");
5219
5471
  var import_object = require("es-toolkit/object");
5220
- var import_mini18 = require("zod/mini");
5472
+ var import_mini19 = require("zod/mini");
5221
5473
 
5222
5474
  // src/types/mcp.ts
5223
- var import_mini17 = require("zod/mini");
5224
- var McpServerSchema = import_mini17.z.object({
5225
- type: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5226
- command: import_mini17.z.optional(import_mini17.z.union([import_mini17.z.string(), import_mini17.z.array(import_mini17.z.string())])),
5227
- args: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5228
- url: import_mini17.z.optional(import_mini17.z.string()),
5229
- httpUrl: import_mini17.z.optional(import_mini17.z.string()),
5230
- env: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5231
- disabled: import_mini17.z.optional(import_mini17.z.boolean()),
5232
- networkTimeout: import_mini17.z.optional(import_mini17.z.number()),
5233
- timeout: import_mini17.z.optional(import_mini17.z.number()),
5234
- trust: import_mini17.z.optional(import_mini17.z.boolean()),
5235
- cwd: import_mini17.z.optional(import_mini17.z.string()),
5236
- transport: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5237
- alwaysAllow: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5238
- tools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5239
- kiroAutoApprove: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5240
- kiroAutoBlock: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5241
- headers: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5242
- enabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5243
- disabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
5475
+ var import_mini18 = require("zod/mini");
5476
+ var McpServerSchema = import_mini18.z.object({
5477
+ type: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5478
+ command: import_mini18.z.optional(import_mini18.z.union([import_mini18.z.string(), import_mini18.z.array(import_mini18.z.string())])),
5479
+ args: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5480
+ url: import_mini18.z.optional(import_mini18.z.string()),
5481
+ httpUrl: import_mini18.z.optional(import_mini18.z.string()),
5482
+ env: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5483
+ disabled: import_mini18.z.optional(import_mini18.z.boolean()),
5484
+ networkTimeout: import_mini18.z.optional(import_mini18.z.number()),
5485
+ timeout: import_mini18.z.optional(import_mini18.z.number()),
5486
+ trust: import_mini18.z.optional(import_mini18.z.boolean()),
5487
+ cwd: import_mini18.z.optional(import_mini18.z.string()),
5488
+ transport: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5489
+ alwaysAllow: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5490
+ tools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5491
+ kiroAutoApprove: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5492
+ kiroAutoBlock: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5493
+ headers: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5494
+ enabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5495
+ disabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
5244
5496
  });
5245
- var McpServersSchema = import_mini17.z.record(import_mini17.z.string(), McpServerSchema);
5497
+ var McpServersSchema = import_mini18.z.record(import_mini18.z.string(), McpServerSchema);
5246
5498
 
5247
5499
  // src/features/mcp/rulesync-mcp.ts
5248
- var RulesyncMcpServerSchema = import_mini18.z.extend(McpServerSchema, {
5249
- targets: import_mini18.z.optional(RulesyncTargetsSchema),
5250
- description: import_mini18.z.optional(import_mini18.z.string()),
5251
- exposed: import_mini18.z.optional(import_mini18.z.boolean())
5500
+ var RulesyncMcpServerSchema = import_mini19.z.extend(McpServerSchema, {
5501
+ targets: import_mini19.z.optional(RulesyncTargetsSchema),
5502
+ description: import_mini19.z.optional(import_mini19.z.string()),
5503
+ exposed: import_mini19.z.optional(import_mini19.z.boolean())
5252
5504
  });
5253
- var RulesyncMcpConfigSchema = import_mini18.z.object({
5254
- mcpServers: import_mini18.z.record(import_mini18.z.string(), RulesyncMcpServerSchema)
5505
+ var RulesyncMcpConfigSchema = import_mini19.z.object({
5506
+ mcpServers: import_mini19.z.record(import_mini19.z.string(), RulesyncMcpServerSchema)
5255
5507
  });
5256
5508
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5257
5509
  json;
@@ -5287,12 +5539,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5287
5539
  static async fromFile({ validate = true }) {
5288
5540
  const baseDir = process.cwd();
5289
5541
  const paths = this.getSettablePaths();
5290
- const recommendedPath = (0, import_node_path40.join)(
5542
+ const recommendedPath = (0, import_node_path41.join)(
5291
5543
  baseDir,
5292
5544
  paths.recommended.relativeDirPath,
5293
5545
  paths.recommended.relativeFilePath
5294
5546
  );
5295
- const legacyPath = (0, import_node_path40.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5547
+ const legacyPath = (0, import_node_path41.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5296
5548
  if (await fileExists(recommendedPath)) {
5297
5549
  const fileContent2 = await readFileContent(recommendedPath);
5298
5550
  return new _RulesyncMcp({
@@ -5437,7 +5689,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5437
5689
  global = false
5438
5690
  }) {
5439
5691
  const paths = this.getSettablePaths({ global });
5440
- const fileContent = await readFileContentOrNull((0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5692
+ const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5441
5693
  const json = JSON.parse(fileContent);
5442
5694
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5443
5695
  return new _ClaudecodeMcp({
@@ -5456,7 +5708,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5456
5708
  }) {
5457
5709
  const paths = this.getSettablePaths({ global });
5458
5710
  const fileContent = await readOrInitializeFileContent(
5459
- (0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5711
+ (0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5460
5712
  JSON.stringify({ mcpServers: {} }, null, 2)
5461
5713
  );
5462
5714
  const json = JSON.parse(fileContent);
@@ -5495,7 +5747,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5495
5747
  };
5496
5748
 
5497
5749
  // src/features/mcp/cline-mcp.ts
5498
- var import_node_path42 = require("path");
5750
+ var import_node_path43 = require("path");
5499
5751
  var ClineMcp = class _ClineMcp extends ToolMcp {
5500
5752
  json;
5501
5753
  constructor(params) {
@@ -5516,7 +5768,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5516
5768
  validate = true
5517
5769
  }) {
5518
5770
  const fileContent = await readFileContent(
5519
- (0, import_node_path42.join)(
5771
+ (0, import_node_path43.join)(
5520
5772
  baseDir,
5521
5773
  this.getSettablePaths().relativeDirPath,
5522
5774
  this.getSettablePaths().relativeFilePath
@@ -5565,7 +5817,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5565
5817
  };
5566
5818
 
5567
5819
  // src/features/mcp/codexcli-mcp.ts
5568
- var import_node_path43 = require("path");
5820
+ var import_node_path44 = require("path");
5569
5821
  var smolToml = __toESM(require("smol-toml"), 1);
5570
5822
  function convertFromCodexFormat(codexMcp) {
5571
5823
  const result = {};
@@ -5648,7 +5900,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5648
5900
  global = false
5649
5901
  }) {
5650
5902
  const paths = this.getSettablePaths({ global });
5651
- const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5903
+ const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5652
5904
  return new _CodexcliMcp({
5653
5905
  baseDir,
5654
5906
  relativeDirPath: paths.relativeDirPath,
@@ -5664,7 +5916,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5664
5916
  global = false
5665
5917
  }) {
5666
5918
  const paths = this.getSettablePaths({ global });
5667
- const configTomlFilePath = (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5919
+ const configTomlFilePath = (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5668
5920
  const configTomlFileContent = await readOrInitializeFileContent(
5669
5921
  configTomlFilePath,
5670
5922
  smolToml.stringify({})
@@ -5721,7 +5973,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5721
5973
  };
5722
5974
 
5723
5975
  // src/features/mcp/copilot-mcp.ts
5724
- var import_node_path44 = require("path");
5976
+ var import_node_path45 = require("path");
5725
5977
  function convertToCopilotFormat(mcpServers) {
5726
5978
  return { servers: mcpServers };
5727
5979
  }
@@ -5748,7 +6000,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5748
6000
  validate = true
5749
6001
  }) {
5750
6002
  const fileContent = await readFileContent(
5751
- (0, import_node_path44.join)(
6003
+ (0, import_node_path45.join)(
5752
6004
  baseDir,
5753
6005
  this.getSettablePaths().relativeDirPath,
5754
6006
  this.getSettablePaths().relativeFilePath
@@ -5801,7 +6053,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5801
6053
  };
5802
6054
 
5803
6055
  // src/features/mcp/cursor-mcp.ts
5804
- var import_node_path45 = require("path");
6056
+ var import_node_path46 = require("path");
5805
6057
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
5806
6058
  function isMcpServers(value) {
5807
6059
  return value !== void 0 && value !== null && typeof value === "object";
@@ -5862,7 +6114,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5862
6114
  validate = true
5863
6115
  }) {
5864
6116
  const fileContent = await readFileContent(
5865
- (0, import_node_path45.join)(
6117
+ (0, import_node_path46.join)(
5866
6118
  baseDir,
5867
6119
  this.getSettablePaths().relativeDirPath,
5868
6120
  this.getSettablePaths().relativeFilePath
@@ -5930,7 +6182,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5930
6182
  };
5931
6183
 
5932
6184
  // src/features/mcp/factorydroid-mcp.ts
5933
- var import_node_path46 = require("path");
6185
+ var import_node_path47 = require("path");
5934
6186
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5935
6187
  json;
5936
6188
  constructor(params) {
@@ -5951,7 +6203,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5951
6203
  validate = true
5952
6204
  }) {
5953
6205
  const fileContent = await readFileContent(
5954
- (0, import_node_path46.join)(
6206
+ (0, import_node_path47.join)(
5955
6207
  baseDir,
5956
6208
  this.getSettablePaths().relativeDirPath,
5957
6209
  this.getSettablePaths().relativeFilePath
@@ -6011,7 +6263,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6011
6263
  };
6012
6264
 
6013
6265
  // src/features/mcp/geminicli-mcp.ts
6014
- var import_node_path47 = require("path");
6266
+ var import_node_path48 = require("path");
6015
6267
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6016
6268
  json;
6017
6269
  constructor(params) {
@@ -6039,7 +6291,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6039
6291
  global = false
6040
6292
  }) {
6041
6293
  const paths = this.getSettablePaths({ global });
6042
- const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6294
+ const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6043
6295
  const json = JSON.parse(fileContent);
6044
6296
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6045
6297
  return new _GeminiCliMcp({
@@ -6058,7 +6310,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6058
6310
  }) {
6059
6311
  const paths = this.getSettablePaths({ global });
6060
6312
  const fileContent = await readOrInitializeFileContent(
6061
- (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6313
+ (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6062
6314
  JSON.stringify({ mcpServers: {} }, null, 2)
6063
6315
  );
6064
6316
  const json = JSON.parse(fileContent);
@@ -6103,7 +6355,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6103
6355
  };
6104
6356
 
6105
6357
  // src/features/mcp/junie-mcp.ts
6106
- var import_node_path48 = require("path");
6358
+ var import_node_path49 = require("path");
6107
6359
  var JunieMcp = class _JunieMcp extends ToolMcp {
6108
6360
  json;
6109
6361
  constructor(params) {
@@ -6115,7 +6367,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6115
6367
  }
6116
6368
  static getSettablePaths() {
6117
6369
  return {
6118
- relativeDirPath: (0, import_node_path48.join)(".junie", "mcp"),
6370
+ relativeDirPath: (0, import_node_path49.join)(".junie", "mcp"),
6119
6371
  relativeFilePath: "mcp.json"
6120
6372
  };
6121
6373
  }
@@ -6124,7 +6376,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6124
6376
  validate = true
6125
6377
  }) {
6126
6378
  const fileContent = await readFileContent(
6127
- (0, import_node_path48.join)(
6379
+ (0, import_node_path49.join)(
6128
6380
  baseDir,
6129
6381
  this.getSettablePaths().relativeDirPath,
6130
6382
  this.getSettablePaths().relativeFilePath
@@ -6173,7 +6425,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6173
6425
  };
6174
6426
 
6175
6427
  // src/features/mcp/kilo-mcp.ts
6176
- var import_node_path49 = require("path");
6428
+ var import_node_path50 = require("path");
6177
6429
  var KiloMcp = class _KiloMcp extends ToolMcp {
6178
6430
  json;
6179
6431
  constructor(params) {
@@ -6194,7 +6446,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6194
6446
  validate = true
6195
6447
  }) {
6196
6448
  const paths = this.getSettablePaths();
6197
- const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6449
+ const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6198
6450
  return new _KiloMcp({
6199
6451
  baseDir,
6200
6452
  relativeDirPath: paths.relativeDirPath,
@@ -6242,7 +6494,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6242
6494
  };
6243
6495
 
6244
6496
  // src/features/mcp/kiro-mcp.ts
6245
- var import_node_path50 = require("path");
6497
+ var import_node_path51 = require("path");
6246
6498
  var KiroMcp = class _KiroMcp extends ToolMcp {
6247
6499
  json;
6248
6500
  constructor(params) {
@@ -6254,7 +6506,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6254
6506
  }
6255
6507
  static getSettablePaths() {
6256
6508
  return {
6257
- relativeDirPath: (0, import_node_path50.join)(".kiro", "settings"),
6509
+ relativeDirPath: (0, import_node_path51.join)(".kiro", "settings"),
6258
6510
  relativeFilePath: "mcp.json"
6259
6511
  };
6260
6512
  }
@@ -6263,7 +6515,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6263
6515
  validate = true
6264
6516
  }) {
6265
6517
  const paths = this.getSettablePaths();
6266
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6518
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6267
6519
  return new _KiroMcp({
6268
6520
  baseDir,
6269
6521
  relativeDirPath: paths.relativeDirPath,
@@ -6311,29 +6563,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6311
6563
  };
6312
6564
 
6313
6565
  // src/features/mcp/opencode-mcp.ts
6314
- var import_node_path51 = require("path");
6315
- var import_mini19 = require("zod/mini");
6316
- var OpencodeMcpLocalServerSchema = import_mini19.z.object({
6317
- type: import_mini19.z.literal("local"),
6318
- command: import_mini19.z.array(import_mini19.z.string()),
6319
- environment: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6320
- enabled: import_mini19.z._default(import_mini19.z.boolean(), true),
6321
- cwd: import_mini19.z.optional(import_mini19.z.string())
6566
+ var import_node_path52 = require("path");
6567
+ var import_jsonc_parser2 = require("jsonc-parser");
6568
+ var import_mini20 = require("zod/mini");
6569
+ var OpencodeMcpLocalServerSchema = import_mini20.z.object({
6570
+ type: import_mini20.z.literal("local"),
6571
+ command: import_mini20.z.array(import_mini20.z.string()),
6572
+ environment: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6573
+ enabled: import_mini20.z._default(import_mini20.z.boolean(), true),
6574
+ cwd: import_mini20.z.optional(import_mini20.z.string())
6322
6575
  });
6323
- var OpencodeMcpRemoteServerSchema = import_mini19.z.object({
6324
- type: import_mini19.z.literal("remote"),
6325
- url: import_mini19.z.string(),
6326
- headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6327
- enabled: import_mini19.z._default(import_mini19.z.boolean(), true)
6576
+ var OpencodeMcpRemoteServerSchema = import_mini20.z.object({
6577
+ type: import_mini20.z.literal("remote"),
6578
+ url: import_mini20.z.string(),
6579
+ headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6580
+ enabled: import_mini20.z._default(import_mini20.z.boolean(), true)
6328
6581
  });
6329
- var OpencodeMcpServerSchema = import_mini19.z.union([
6582
+ var OpencodeMcpServerSchema = import_mini20.z.union([
6330
6583
  OpencodeMcpLocalServerSchema,
6331
6584
  OpencodeMcpRemoteServerSchema
6332
6585
  ]);
6333
- var OpencodeConfigSchema = import_mini19.z.looseObject({
6334
- $schema: import_mini19.z.optional(import_mini19.z.string()),
6335
- mcp: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), OpencodeMcpServerSchema)),
6336
- tools: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.boolean()))
6586
+ var OpencodeConfigSchema = import_mini20.z.looseObject({
6587
+ $schema: import_mini20.z.optional(import_mini20.z.string()),
6588
+ mcp: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), OpencodeMcpServerSchema)),
6589
+ tools: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.boolean()))
6337
6590
  });
6338
6591
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6339
6592
  return Object.fromEntries(
@@ -6437,7 +6690,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6437
6690
  json;
6438
6691
  constructor(params) {
6439
6692
  super(params);
6440
- this.json = OpencodeConfigSchema.parse(JSON.parse(this.fileContent || "{}"));
6693
+ this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser2.parse)(this.fileContent || "{}"));
6441
6694
  }
6442
6695
  getJson() {
6443
6696
  return this.json;
@@ -6451,7 +6704,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6451
6704
  static getSettablePaths({ global } = {}) {
6452
6705
  if (global) {
6453
6706
  return {
6454
- relativeDirPath: (0, import_node_path51.join)(".config", "opencode"),
6707
+ relativeDirPath: (0, import_node_path52.join)(".config", "opencode"),
6455
6708
  relativeFilePath: "opencode.json"
6456
6709
  };
6457
6710
  }
@@ -6465,14 +6718,26 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6465
6718
  validate = true,
6466
6719
  global = false
6467
6720
  }) {
6468
- const paths = this.getSettablePaths({ global });
6469
- const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6470
- const json = JSON.parse(fileContent);
6721
+ const basePaths = this.getSettablePaths({ global });
6722
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6723
+ let fileContent = null;
6724
+ let relativeFilePath = "opencode.jsonc";
6725
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6726
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6727
+ fileContent = await readFileContentOrNull(jsoncPath);
6728
+ if (!fileContent) {
6729
+ fileContent = await readFileContentOrNull(jsonPath);
6730
+ if (fileContent) {
6731
+ relativeFilePath = "opencode.json";
6732
+ }
6733
+ }
6734
+ const fileContentToUse = fileContent ?? '{"mcp":{}}';
6735
+ const json = (0, import_jsonc_parser2.parse)(fileContentToUse);
6471
6736
  const newJson = { ...json, mcp: json.mcp ?? {} };
6472
6737
  return new _OpencodeMcp({
6473
6738
  baseDir,
6474
- relativeDirPath: paths.relativeDirPath,
6475
- relativeFilePath: paths.relativeFilePath,
6739
+ relativeDirPath: basePaths.relativeDirPath,
6740
+ relativeFilePath,
6476
6741
  fileContent: JSON.stringify(newJson, null, 2),
6477
6742
  validate
6478
6743
  });
@@ -6483,12 +6748,23 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6483
6748
  validate = true,
6484
6749
  global = false
6485
6750
  }) {
6486
- const paths = this.getSettablePaths({ global });
6487
- const fileContent = await readOrInitializeFileContent(
6488
- (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6489
- JSON.stringify({ mcp: {} }, null, 2)
6490
- );
6491
- const json = JSON.parse(fileContent);
6751
+ const basePaths = this.getSettablePaths({ global });
6752
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6753
+ let fileContent = null;
6754
+ let relativeFilePath = "opencode.jsonc";
6755
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6756
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6757
+ fileContent = await readFileContentOrNull(jsoncPath);
6758
+ if (!fileContent) {
6759
+ fileContent = await readFileContentOrNull(jsonPath);
6760
+ if (fileContent) {
6761
+ relativeFilePath = "opencode.json";
6762
+ }
6763
+ }
6764
+ if (!fileContent) {
6765
+ fileContent = JSON.stringify({ mcp: {} }, null, 2);
6766
+ }
6767
+ const json = (0, import_jsonc_parser2.parse)(fileContent);
6492
6768
  const { mcp: convertedMcp, tools: mcpTools } = convertToOpencodeFormat(
6493
6769
  rulesyncMcp.getMcpServers()
6494
6770
  );
@@ -6500,8 +6776,8 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6500
6776
  };
6501
6777
  return new _OpencodeMcp({
6502
6778
  baseDir,
6503
- relativeDirPath: paths.relativeDirPath,
6504
- relativeFilePath: paths.relativeFilePath,
6779
+ relativeDirPath: basePaths.relativeDirPath,
6780
+ relativeFilePath,
6505
6781
  fileContent: JSON.stringify(newJson, null, 2),
6506
6782
  validate
6507
6783
  });
@@ -6538,7 +6814,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6538
6814
  };
6539
6815
 
6540
6816
  // src/features/mcp/roo-mcp.ts
6541
- var import_node_path52 = require("path");
6817
+ var import_node_path53 = require("path");
6542
6818
  function isRooMcpServers(value) {
6543
6819
  return value !== void 0 && value !== null && typeof value === "object";
6544
6820
  }
@@ -6590,7 +6866,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
6590
6866
  validate = true
6591
6867
  }) {
6592
6868
  const fileContent = await readFileContent(
6593
- (0, import_node_path52.join)(
6869
+ (0, import_node_path53.join)(
6594
6870
  baseDir,
6595
6871
  this.getSettablePaths().relativeDirPath,
6596
6872
  this.getSettablePaths().relativeFilePath
@@ -6661,7 +6937,7 @@ var mcpProcessorToolTargetTuple = [
6661
6937
  "opencode",
6662
6938
  "roo"
6663
6939
  ];
6664
- var McpProcessorToolTargetSchema = import_mini20.z.enum(mcpProcessorToolTargetTuple);
6940
+ var McpProcessorToolTargetSchema = import_mini21.z.enum(mcpProcessorToolTargetTuple);
6665
6941
  var toolMcpFactories = /* @__PURE__ */ new Map([
6666
6942
  [
6667
6943
  "claudecode",
@@ -6963,25 +7239,25 @@ var McpProcessor = class extends FeatureProcessor {
6963
7239
  };
6964
7240
 
6965
7241
  // src/features/rules/rules-processor.ts
6966
- var import_node_path112 = require("path");
7242
+ var import_node_path113 = require("path");
6967
7243
  var import_toon = require("@toon-format/toon");
6968
- var import_mini52 = require("zod/mini");
7244
+ var import_mini53 = require("zod/mini");
6969
7245
 
6970
7246
  // src/constants/general.ts
6971
7247
  var SKILL_FILE_NAME = "SKILL.md";
6972
7248
 
6973
7249
  // src/features/skills/agentsmd-skill.ts
6974
- var import_node_path56 = require("path");
7250
+ var import_node_path57 = require("path");
6975
7251
 
6976
7252
  // src/features/skills/simulated-skill.ts
6977
- var import_node_path55 = require("path");
6978
- var import_mini21 = require("zod/mini");
7253
+ var import_node_path56 = require("path");
7254
+ var import_mini22 = require("zod/mini");
6979
7255
 
6980
7256
  // src/features/skills/tool-skill.ts
6981
- var import_node_path54 = require("path");
7257
+ var import_node_path55 = require("path");
6982
7258
 
6983
7259
  // src/types/ai-dir.ts
6984
- var import_node_path53 = __toESM(require("path"), 1);
7260
+ var import_node_path54 = __toESM(require("path"), 1);
6985
7261
  var AiDir = class {
6986
7262
  /**
6987
7263
  * @example "."
@@ -7015,7 +7291,7 @@ var AiDir = class {
7015
7291
  otherFiles = [],
7016
7292
  global = false
7017
7293
  }) {
7018
- if (dirName.includes(import_node_path53.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7294
+ if (dirName.includes(import_node_path54.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7019
7295
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7020
7296
  }
7021
7297
  this.baseDir = baseDir;
@@ -7038,11 +7314,11 @@ var AiDir = class {
7038
7314
  return this.dirName;
7039
7315
  }
7040
7316
  getDirPath() {
7041
- const fullPath = import_node_path53.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7042
- const resolvedFull = (0, import_node_path53.resolve)(fullPath);
7043
- const resolvedBase = (0, import_node_path53.resolve)(this.baseDir);
7044
- const rel = (0, import_node_path53.relative)(resolvedBase, resolvedFull);
7045
- if (rel.startsWith("..") || import_node_path53.default.isAbsolute(rel)) {
7317
+ const fullPath = import_node_path54.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7318
+ const resolvedFull = (0, import_node_path54.resolve)(fullPath);
7319
+ const resolvedBase = (0, import_node_path54.resolve)(this.baseDir);
7320
+ const rel = (0, import_node_path54.relative)(resolvedBase, resolvedFull);
7321
+ if (rel.startsWith("..") || import_node_path54.default.isAbsolute(rel)) {
7046
7322
  throw new Error(
7047
7323
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7048
7324
  );
@@ -7056,7 +7332,7 @@ var AiDir = class {
7056
7332
  return this.otherFiles;
7057
7333
  }
7058
7334
  getRelativePathFromCwd() {
7059
- return import_node_path53.default.join(this.relativeDirPath, this.dirName);
7335
+ return import_node_path54.default.join(this.relativeDirPath, this.dirName);
7060
7336
  }
7061
7337
  getGlobal() {
7062
7338
  return this.global;
@@ -7075,15 +7351,15 @@ var AiDir = class {
7075
7351
  * @returns Array of files with their relative paths and buffers
7076
7352
  */
7077
7353
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7078
- const dirPath = (0, import_node_path53.join)(baseDir, relativeDirPath, dirName);
7079
- const glob = (0, import_node_path53.join)(dirPath, "**", "*");
7354
+ const dirPath = (0, import_node_path54.join)(baseDir, relativeDirPath, dirName);
7355
+ const glob = (0, import_node_path54.join)(dirPath, "**", "*");
7080
7356
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7081
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path53.basename)(filePath) !== excludeFileName);
7357
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path54.basename)(filePath) !== excludeFileName);
7082
7358
  const files = await Promise.all(
7083
7359
  filteredPaths.map(async (filePath) => {
7084
7360
  const fileBuffer = await readFileBuffer(filePath);
7085
7361
  return {
7086
- relativeFilePathToDirPath: (0, import_node_path53.relative)(dirPath, filePath),
7362
+ relativeFilePathToDirPath: (0, import_node_path54.relative)(dirPath, filePath),
7087
7363
  fileBuffer
7088
7364
  };
7089
7365
  })
@@ -7174,8 +7450,8 @@ var ToolSkill = class extends AiDir {
7174
7450
  }) {
7175
7451
  const settablePaths = getSettablePaths({ global });
7176
7452
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7177
- const skillDirPath = (0, import_node_path54.join)(baseDir, actualRelativeDirPath, dirName);
7178
- const skillFilePath = (0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME);
7453
+ const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7454
+ const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7179
7455
  if (!await fileExists(skillFilePath)) {
7180
7456
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7181
7457
  }
@@ -7199,16 +7475,16 @@ var ToolSkill = class extends AiDir {
7199
7475
  }
7200
7476
  requireMainFileFrontmatter() {
7201
7477
  if (!this.mainFile?.frontmatter) {
7202
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path54.join)(this.relativeDirPath, this.dirName)}`);
7478
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path55.join)(this.relativeDirPath, this.dirName)}`);
7203
7479
  }
7204
7480
  return this.mainFile.frontmatter;
7205
7481
  }
7206
7482
  };
7207
7483
 
7208
7484
  // src/features/skills/simulated-skill.ts
7209
- var SimulatedSkillFrontmatterSchema = import_mini21.z.looseObject({
7210
- name: import_mini21.z.string(),
7211
- description: import_mini21.z.string()
7485
+ var SimulatedSkillFrontmatterSchema = import_mini22.z.looseObject({
7486
+ name: import_mini22.z.string(),
7487
+ description: import_mini22.z.string()
7212
7488
  });
7213
7489
  var SimulatedSkill = class extends ToolSkill {
7214
7490
  frontmatter;
@@ -7239,7 +7515,7 @@ var SimulatedSkill = class extends ToolSkill {
7239
7515
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7240
7516
  if (!result.success) {
7241
7517
  throw new Error(
7242
- `Invalid frontmatter in ${(0, import_node_path55.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7518
+ `Invalid frontmatter in ${(0, import_node_path56.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7243
7519
  );
7244
7520
  }
7245
7521
  }
@@ -7297,8 +7573,8 @@ var SimulatedSkill = class extends ToolSkill {
7297
7573
  }) {
7298
7574
  const settablePaths = this.getSettablePaths();
7299
7575
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7300
- const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7301
- const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7576
+ const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
7577
+ const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
7302
7578
  if (!await fileExists(skillFilePath)) {
7303
7579
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7304
7580
  }
@@ -7375,7 +7651,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7375
7651
  throw new Error("AgentsmdSkill does not support global mode.");
7376
7652
  }
7377
7653
  return {
7378
- relativeDirPath: (0, import_node_path56.join)(".agents", "skills")
7654
+ relativeDirPath: (0, import_node_path57.join)(".agents", "skills")
7379
7655
  };
7380
7656
  }
7381
7657
  static async fromDir(params) {
@@ -7402,11 +7678,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7402
7678
  };
7403
7679
 
7404
7680
  // src/features/skills/factorydroid-skill.ts
7405
- var import_node_path57 = require("path");
7681
+ var import_node_path58 = require("path");
7406
7682
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7407
7683
  static getSettablePaths(_options) {
7408
7684
  return {
7409
- relativeDirPath: (0, import_node_path57.join)(".factory", "skills")
7685
+ relativeDirPath: (0, import_node_path58.join)(".factory", "skills")
7410
7686
  };
7411
7687
  }
7412
7688
  static async fromDir(params) {
@@ -7433,11 +7709,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7433
7709
  };
7434
7710
 
7435
7711
  // src/features/skills/skills-processor.ts
7436
- var import_node_path74 = require("path");
7437
- var import_mini36 = require("zod/mini");
7712
+ var import_node_path75 = require("path");
7713
+ var import_mini37 = require("zod/mini");
7438
7714
 
7439
7715
  // src/types/dir-feature-processor.ts
7440
- var import_node_path58 = require("path");
7716
+ var import_node_path59 = require("path");
7441
7717
  var DirFeatureProcessor = class {
7442
7718
  baseDir;
7443
7719
  dryRun;
@@ -7468,7 +7744,7 @@ var DirFeatureProcessor = class {
7468
7744
  const mainFile = aiDir.getMainFile();
7469
7745
  let mainFileContent;
7470
7746
  if (mainFile) {
7471
- const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7747
+ const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
7472
7748
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7473
7749
  mainFileContent = addTrailingNewline(content);
7474
7750
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7482,7 +7758,7 @@ var DirFeatureProcessor = class {
7482
7758
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7483
7759
  otherFileContents.push(contentWithNewline);
7484
7760
  if (!dirHasChanges) {
7485
- const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7761
+ const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
7486
7762
  const existingContent = await readFileContentOrNull(filePath);
7487
7763
  if (existingContent !== contentWithNewline) {
7488
7764
  dirHasChanges = true;
@@ -7496,22 +7772,22 @@ var DirFeatureProcessor = class {
7496
7772
  if (this.dryRun) {
7497
7773
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7498
7774
  if (mainFile) {
7499
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, mainFile.name)}`);
7500
- changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7775
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, mainFile.name)}`);
7776
+ changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
7501
7777
  }
7502
7778
  for (const file of otherFiles) {
7503
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath)}`);
7504
- changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7779
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath)}`);
7780
+ changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
7505
7781
  }
7506
7782
  } else {
7507
7783
  await ensureDir(dirPath);
7508
7784
  if (mainFile && mainFileContent) {
7509
- const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7785
+ const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
7510
7786
  await writeFileContent(mainFilePath, mainFileContent);
7511
- changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7787
+ changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
7512
7788
  }
7513
7789
  for (const [i, file] of otherFiles.entries()) {
7514
- const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7790
+ const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
7515
7791
  const content = otherFileContents[i];
7516
7792
  if (content === void 0) {
7517
7793
  throw new Error(
@@ -7519,7 +7795,7 @@ var DirFeatureProcessor = class {
7519
7795
  );
7520
7796
  }
7521
7797
  await writeFileContent(filePath, content);
7522
- changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7798
+ changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
7523
7799
  }
7524
7800
  }
7525
7801
  changedCount++;
@@ -7551,38 +7827,38 @@ var DirFeatureProcessor = class {
7551
7827
  };
7552
7828
 
7553
7829
  // src/features/skills/agentsskills-skill.ts
7554
- var import_node_path60 = require("path");
7555
- var import_mini23 = require("zod/mini");
7830
+ var import_node_path61 = require("path");
7831
+ var import_mini24 = require("zod/mini");
7556
7832
 
7557
7833
  // src/features/skills/rulesync-skill.ts
7558
- var import_node_path59 = require("path");
7559
- var import_mini22 = require("zod/mini");
7560
- var RulesyncSkillFrontmatterSchemaInternal = import_mini22.z.looseObject({
7561
- name: import_mini22.z.string(),
7562
- description: import_mini22.z.string(),
7563
- targets: import_mini22.z._default(RulesyncTargetsSchema, ["*"]),
7564
- claudecode: import_mini22.z.optional(
7565
- import_mini22.z.looseObject({
7566
- "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7834
+ var import_node_path60 = require("path");
7835
+ var import_mini23 = require("zod/mini");
7836
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini23.z.looseObject({
7837
+ name: import_mini23.z.string(),
7838
+ description: import_mini23.z.string(),
7839
+ targets: import_mini23.z._default(RulesyncTargetsSchema, ["*"]),
7840
+ claudecode: import_mini23.z.optional(
7841
+ import_mini23.z.looseObject({
7842
+ "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
7567
7843
  })
7568
7844
  ),
7569
- codexcli: import_mini22.z.optional(
7570
- import_mini22.z.looseObject({
7571
- "short-description": import_mini22.z.optional(import_mini22.z.string())
7845
+ codexcli: import_mini23.z.optional(
7846
+ import_mini23.z.looseObject({
7847
+ "short-description": import_mini23.z.optional(import_mini23.z.string())
7572
7848
  })
7573
7849
  ),
7574
- opencode: import_mini22.z.optional(
7575
- import_mini22.z.looseObject({
7576
- "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7850
+ opencode: import_mini23.z.optional(
7851
+ import_mini23.z.looseObject({
7852
+ "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
7577
7853
  })
7578
7854
  ),
7579
- copilot: import_mini22.z.optional(
7580
- import_mini22.z.looseObject({
7581
- license: import_mini22.z.optional(import_mini22.z.string())
7855
+ copilot: import_mini23.z.optional(
7856
+ import_mini23.z.looseObject({
7857
+ license: import_mini23.z.optional(import_mini23.z.string())
7582
7858
  })
7583
7859
  ),
7584
- cline: import_mini22.z.optional(import_mini22.z.looseObject({})),
7585
- roo: import_mini22.z.optional(import_mini22.z.looseObject({}))
7860
+ cline: import_mini23.z.optional(import_mini23.z.looseObject({})),
7861
+ roo: import_mini23.z.optional(import_mini23.z.looseObject({}))
7586
7862
  });
7587
7863
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
7588
7864
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -7622,7 +7898,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7622
7898
  }
7623
7899
  getFrontmatter() {
7624
7900
  if (!this.mainFile?.frontmatter) {
7625
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path59.join)(this.relativeDirPath, this.dirName)}`);
7901
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path60.join)(this.relativeDirPath, this.dirName)}`);
7626
7902
  }
7627
7903
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
7628
7904
  return result;
@@ -7648,8 +7924,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7648
7924
  dirName,
7649
7925
  global = false
7650
7926
  }) {
7651
- const skillDirPath = (0, import_node_path59.join)(baseDir, relativeDirPath, dirName);
7652
- const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
7927
+ const skillDirPath = (0, import_node_path60.join)(baseDir, relativeDirPath, dirName);
7928
+ const skillFilePath = (0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME);
7653
7929
  if (!await fileExists(skillFilePath)) {
7654
7930
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7655
7931
  }
@@ -7679,14 +7955,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7679
7955
  };
7680
7956
 
7681
7957
  // src/features/skills/agentsskills-skill.ts
7682
- var AgentsSkillsSkillFrontmatterSchema = import_mini23.z.looseObject({
7683
- name: import_mini23.z.string(),
7684
- description: import_mini23.z.string()
7958
+ var AgentsSkillsSkillFrontmatterSchema = import_mini24.z.looseObject({
7959
+ name: import_mini24.z.string(),
7960
+ description: import_mini24.z.string()
7685
7961
  });
7686
7962
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7687
7963
  constructor({
7688
7964
  baseDir = process.cwd(),
7689
- relativeDirPath = (0, import_node_path60.join)(".agents", "skills"),
7965
+ relativeDirPath = (0, import_node_path61.join)(".agents", "skills"),
7690
7966
  dirName,
7691
7967
  frontmatter,
7692
7968
  body,
@@ -7718,7 +7994,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7718
7994
  throw new Error("AgentsSkillsSkill does not support global mode.");
7719
7995
  }
7720
7996
  return {
7721
- relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
7997
+ relativeDirPath: (0, import_node_path61.join)(".agents", "skills")
7722
7998
  };
7723
7999
  }
7724
8000
  getFrontmatter() {
@@ -7797,9 +8073,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7797
8073
  });
7798
8074
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
7799
8075
  if (!result.success) {
7800
- const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8076
+ const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7801
8077
  throw new Error(
7802
- `Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8078
+ `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7803
8079
  );
7804
8080
  }
7805
8081
  return new _AgentsSkillsSkill({
@@ -7834,16 +8110,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7834
8110
  };
7835
8111
 
7836
8112
  // src/features/skills/antigravity-skill.ts
7837
- var import_node_path61 = require("path");
7838
- var import_mini24 = require("zod/mini");
7839
- var AntigravitySkillFrontmatterSchema = import_mini24.z.looseObject({
7840
- name: import_mini24.z.string(),
7841
- description: import_mini24.z.string()
8113
+ var import_node_path62 = require("path");
8114
+ var import_mini25 = require("zod/mini");
8115
+ var AntigravitySkillFrontmatterSchema = import_mini25.z.looseObject({
8116
+ name: import_mini25.z.string(),
8117
+ description: import_mini25.z.string()
7842
8118
  });
7843
8119
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7844
8120
  constructor({
7845
8121
  baseDir = process.cwd(),
7846
- relativeDirPath = (0, import_node_path61.join)(".agent", "skills"),
8122
+ relativeDirPath = (0, import_node_path62.join)(".agent", "skills"),
7847
8123
  dirName,
7848
8124
  frontmatter,
7849
8125
  body,
@@ -7875,11 +8151,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7875
8151
  } = {}) {
7876
8152
  if (global) {
7877
8153
  return {
7878
- relativeDirPath: (0, import_node_path61.join)(".gemini", "antigravity", "skills")
8154
+ relativeDirPath: (0, import_node_path62.join)(".gemini", "antigravity", "skills")
7879
8155
  };
7880
8156
  }
7881
8157
  return {
7882
- relativeDirPath: (0, import_node_path61.join)(".agent", "skills")
8158
+ relativeDirPath: (0, import_node_path62.join)(".agent", "skills")
7883
8159
  };
7884
8160
  }
7885
8161
  getFrontmatter() {
@@ -7958,9 +8234,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7958
8234
  });
7959
8235
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
7960
8236
  if (!result.success) {
7961
- const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8237
+ const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7962
8238
  throw new Error(
7963
- `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8239
+ `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7964
8240
  );
7965
8241
  }
7966
8242
  return new _AntigravitySkill({
@@ -7994,17 +8270,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7994
8270
  };
7995
8271
 
7996
8272
  // src/features/skills/claudecode-skill.ts
7997
- var import_node_path62 = require("path");
7998
- var import_mini25 = require("zod/mini");
7999
- var ClaudecodeSkillFrontmatterSchema = import_mini25.z.looseObject({
8000
- name: import_mini25.z.string(),
8001
- description: import_mini25.z.string(),
8002
- "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
8273
+ var import_node_path63 = require("path");
8274
+ var import_mini26 = require("zod/mini");
8275
+ var ClaudecodeSkillFrontmatterSchema = import_mini26.z.looseObject({
8276
+ name: import_mini26.z.string(),
8277
+ description: import_mini26.z.string(),
8278
+ "allowed-tools": import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
8003
8279
  });
8004
8280
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8005
8281
  constructor({
8006
8282
  baseDir = process.cwd(),
8007
- relativeDirPath = (0, import_node_path62.join)(".claude", "skills"),
8283
+ relativeDirPath = (0, import_node_path63.join)(".claude", "skills"),
8008
8284
  dirName,
8009
8285
  frontmatter,
8010
8286
  body,
@@ -8035,7 +8311,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8035
8311
  global: _global = false
8036
8312
  } = {}) {
8037
8313
  return {
8038
- relativeDirPath: (0, import_node_path62.join)(".claude", "skills")
8314
+ relativeDirPath: (0, import_node_path63.join)(".claude", "skills")
8039
8315
  };
8040
8316
  }
8041
8317
  getFrontmatter() {
@@ -8120,9 +8396,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8120
8396
  });
8121
8397
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8122
8398
  if (!result.success) {
8123
- const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8399
+ const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8124
8400
  throw new Error(
8125
- `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8401
+ `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8126
8402
  );
8127
8403
  }
8128
8404
  return new _ClaudecodeSkill({
@@ -8156,16 +8432,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8156
8432
  };
8157
8433
 
8158
8434
  // src/features/skills/cline-skill.ts
8159
- var import_node_path63 = require("path");
8160
- var import_mini26 = require("zod/mini");
8161
- var ClineSkillFrontmatterSchema = import_mini26.z.looseObject({
8162
- name: import_mini26.z.string(),
8163
- description: import_mini26.z.string()
8435
+ var import_node_path64 = require("path");
8436
+ var import_mini27 = require("zod/mini");
8437
+ var ClineSkillFrontmatterSchema = import_mini27.z.looseObject({
8438
+ name: import_mini27.z.string(),
8439
+ description: import_mini27.z.string()
8164
8440
  });
8165
8441
  var ClineSkill = class _ClineSkill extends ToolSkill {
8166
8442
  constructor({
8167
8443
  baseDir = process.cwd(),
8168
- relativeDirPath = (0, import_node_path63.join)(".cline", "skills"),
8444
+ relativeDirPath = (0, import_node_path64.join)(".cline", "skills"),
8169
8445
  dirName,
8170
8446
  frontmatter,
8171
8447
  body,
@@ -8194,7 +8470,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8194
8470
  }
8195
8471
  static getSettablePaths(_options = {}) {
8196
8472
  return {
8197
- relativeDirPath: (0, import_node_path63.join)(".cline", "skills")
8473
+ relativeDirPath: (0, import_node_path64.join)(".cline", "skills")
8198
8474
  };
8199
8475
  }
8200
8476
  getFrontmatter() {
@@ -8281,13 +8557,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8281
8557
  });
8282
8558
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8283
8559
  if (!result.success) {
8284
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8560
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8285
8561
  throw new Error(
8286
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8562
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8287
8563
  );
8288
8564
  }
8289
8565
  if (result.data.name !== loaded.dirName) {
8290
- const skillFilePath = (0, import_node_path63.join)(
8566
+ const skillFilePath = (0, import_node_path64.join)(
8291
8567
  loaded.baseDir,
8292
8568
  loaded.relativeDirPath,
8293
8569
  loaded.dirName,
@@ -8328,21 +8604,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8328
8604
  };
8329
8605
 
8330
8606
  // src/features/skills/codexcli-skill.ts
8331
- var import_node_path64 = require("path");
8332
- var import_mini27 = require("zod/mini");
8333
- var CodexCliSkillFrontmatterSchema = import_mini27.z.looseObject({
8334
- name: import_mini27.z.string(),
8335
- description: import_mini27.z.string(),
8336
- metadata: import_mini27.z.optional(
8337
- import_mini27.z.looseObject({
8338
- "short-description": import_mini27.z.optional(import_mini27.z.string())
8607
+ var import_node_path65 = require("path");
8608
+ var import_mini28 = require("zod/mini");
8609
+ var CodexCliSkillFrontmatterSchema = import_mini28.z.looseObject({
8610
+ name: import_mini28.z.string(),
8611
+ description: import_mini28.z.string(),
8612
+ metadata: import_mini28.z.optional(
8613
+ import_mini28.z.looseObject({
8614
+ "short-description": import_mini28.z.optional(import_mini28.z.string())
8339
8615
  })
8340
8616
  )
8341
8617
  });
8342
8618
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8343
8619
  constructor({
8344
8620
  baseDir = process.cwd(),
8345
- relativeDirPath = (0, import_node_path64.join)(".codex", "skills"),
8621
+ relativeDirPath = (0, import_node_path65.join)(".codex", "skills"),
8346
8622
  dirName,
8347
8623
  frontmatter,
8348
8624
  body,
@@ -8373,7 +8649,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8373
8649
  global: _global = false
8374
8650
  } = {}) {
8375
8651
  return {
8376
- relativeDirPath: (0, import_node_path64.join)(".codex", "skills")
8652
+ relativeDirPath: (0, import_node_path65.join)(".codex", "skills")
8377
8653
  };
8378
8654
  }
8379
8655
  getFrontmatter() {
@@ -8462,9 +8738,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8462
8738
  });
8463
8739
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8464
8740
  if (!result.success) {
8465
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8741
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8466
8742
  throw new Error(
8467
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8743
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8468
8744
  );
8469
8745
  }
8470
8746
  return new _CodexCliSkill({
@@ -8498,17 +8774,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8498
8774
  };
8499
8775
 
8500
8776
  // src/features/skills/copilot-skill.ts
8501
- var import_node_path65 = require("path");
8502
- var import_mini28 = require("zod/mini");
8503
- var CopilotSkillFrontmatterSchema = import_mini28.z.looseObject({
8504
- name: import_mini28.z.string(),
8505
- description: import_mini28.z.string(),
8506
- license: import_mini28.z.optional(import_mini28.z.string())
8777
+ var import_node_path66 = require("path");
8778
+ var import_mini29 = require("zod/mini");
8779
+ var CopilotSkillFrontmatterSchema = import_mini29.z.looseObject({
8780
+ name: import_mini29.z.string(),
8781
+ description: import_mini29.z.string(),
8782
+ license: import_mini29.z.optional(import_mini29.z.string())
8507
8783
  });
8508
8784
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8509
8785
  constructor({
8510
8786
  baseDir = process.cwd(),
8511
- relativeDirPath = (0, import_node_path65.join)(".github", "skills"),
8787
+ relativeDirPath = (0, import_node_path66.join)(".github", "skills"),
8512
8788
  dirName,
8513
8789
  frontmatter,
8514
8790
  body,
@@ -8540,7 +8816,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8540
8816
  throw new Error("CopilotSkill does not support global mode.");
8541
8817
  }
8542
8818
  return {
8543
- relativeDirPath: (0, import_node_path65.join)(".github", "skills")
8819
+ relativeDirPath: (0, import_node_path66.join)(".github", "skills")
8544
8820
  };
8545
8821
  }
8546
8822
  getFrontmatter() {
@@ -8625,9 +8901,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8625
8901
  });
8626
8902
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8627
8903
  if (!result.success) {
8628
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8904
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8629
8905
  throw new Error(
8630
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8906
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8631
8907
  );
8632
8908
  }
8633
8909
  return new _CopilotSkill({
@@ -8662,16 +8938,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8662
8938
  };
8663
8939
 
8664
8940
  // src/features/skills/cursor-skill.ts
8665
- var import_node_path66 = require("path");
8666
- var import_mini29 = require("zod/mini");
8667
- var CursorSkillFrontmatterSchema = import_mini29.z.looseObject({
8668
- name: import_mini29.z.string(),
8669
- description: import_mini29.z.string()
8941
+ var import_node_path67 = require("path");
8942
+ var import_mini30 = require("zod/mini");
8943
+ var CursorSkillFrontmatterSchema = import_mini30.z.looseObject({
8944
+ name: import_mini30.z.string(),
8945
+ description: import_mini30.z.string()
8670
8946
  });
8671
8947
  var CursorSkill = class _CursorSkill extends ToolSkill {
8672
8948
  constructor({
8673
8949
  baseDir = process.cwd(),
8674
- relativeDirPath = (0, import_node_path66.join)(".cursor", "skills"),
8950
+ relativeDirPath = (0, import_node_path67.join)(".cursor", "skills"),
8675
8951
  dirName,
8676
8952
  frontmatter,
8677
8953
  body,
@@ -8700,7 +8976,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8700
8976
  }
8701
8977
  static getSettablePaths(_options) {
8702
8978
  return {
8703
- relativeDirPath: (0, import_node_path66.join)(".cursor", "skills")
8979
+ relativeDirPath: (0, import_node_path67.join)(".cursor", "skills")
8704
8980
  };
8705
8981
  }
8706
8982
  getFrontmatter() {
@@ -8779,9 +9055,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8779
9055
  });
8780
9056
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8781
9057
  if (!result.success) {
8782
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9058
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8783
9059
  throw new Error(
8784
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9060
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8785
9061
  );
8786
9062
  }
8787
9063
  return new _CursorSkill({
@@ -8816,11 +9092,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8816
9092
  };
8817
9093
 
8818
9094
  // src/features/skills/geminicli-skill.ts
8819
- var import_node_path67 = require("path");
8820
- var import_mini30 = require("zod/mini");
8821
- var GeminiCliSkillFrontmatterSchema = import_mini30.z.looseObject({
8822
- name: import_mini30.z.string(),
8823
- description: import_mini30.z.string()
9095
+ var import_node_path68 = require("path");
9096
+ var import_mini31 = require("zod/mini");
9097
+ var GeminiCliSkillFrontmatterSchema = import_mini31.z.looseObject({
9098
+ name: import_mini31.z.string(),
9099
+ description: import_mini31.z.string()
8824
9100
  });
8825
9101
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8826
9102
  constructor({
@@ -8856,7 +9132,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8856
9132
  global: _global = false
8857
9133
  } = {}) {
8858
9134
  return {
8859
- relativeDirPath: (0, import_node_path67.join)(".gemini", "skills")
9135
+ relativeDirPath: (0, import_node_path68.join)(".gemini", "skills")
8860
9136
  };
8861
9137
  }
8862
9138
  getFrontmatter() {
@@ -8935,9 +9211,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8935
9211
  });
8936
9212
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8937
9213
  if (!result.success) {
8938
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9214
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8939
9215
  throw new Error(
8940
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9216
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8941
9217
  );
8942
9218
  }
8943
9219
  return new _GeminiCliSkill({
@@ -8972,16 +9248,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8972
9248
  };
8973
9249
 
8974
9250
  // src/features/skills/kilo-skill.ts
8975
- var import_node_path68 = require("path");
8976
- var import_mini31 = require("zod/mini");
8977
- var KiloSkillFrontmatterSchema = import_mini31.z.looseObject({
8978
- name: import_mini31.z.string(),
8979
- description: import_mini31.z.string()
9251
+ var import_node_path69 = require("path");
9252
+ var import_mini32 = require("zod/mini");
9253
+ var KiloSkillFrontmatterSchema = import_mini32.z.looseObject({
9254
+ name: import_mini32.z.string(),
9255
+ description: import_mini32.z.string()
8980
9256
  });
8981
9257
  var KiloSkill = class _KiloSkill extends ToolSkill {
8982
9258
  constructor({
8983
9259
  baseDir = process.cwd(),
8984
- relativeDirPath = (0, import_node_path68.join)(".kilocode", "skills"),
9260
+ relativeDirPath = (0, import_node_path69.join)(".kilocode", "skills"),
8985
9261
  dirName,
8986
9262
  frontmatter,
8987
9263
  body,
@@ -9012,7 +9288,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9012
9288
  global: _global = false
9013
9289
  } = {}) {
9014
9290
  return {
9015
- relativeDirPath: (0, import_node_path68.join)(".kilocode", "skills")
9291
+ relativeDirPath: (0, import_node_path69.join)(".kilocode", "skills")
9016
9292
  };
9017
9293
  }
9018
9294
  getFrontmatter() {
@@ -9099,13 +9375,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9099
9375
  });
9100
9376
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9101
9377
  if (!result.success) {
9102
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9378
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9103
9379
  throw new Error(
9104
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9380
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9105
9381
  );
9106
9382
  }
9107
9383
  if (result.data.name !== loaded.dirName) {
9108
- const skillFilePath = (0, import_node_path68.join)(
9384
+ const skillFilePath = (0, import_node_path69.join)(
9109
9385
  loaded.baseDir,
9110
9386
  loaded.relativeDirPath,
9111
9387
  loaded.dirName,
@@ -9146,16 +9422,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9146
9422
  };
9147
9423
 
9148
9424
  // src/features/skills/kiro-skill.ts
9149
- var import_node_path69 = require("path");
9150
- var import_mini32 = require("zod/mini");
9151
- var KiroSkillFrontmatterSchema = import_mini32.z.looseObject({
9152
- name: import_mini32.z.string(),
9153
- description: import_mini32.z.string()
9425
+ var import_node_path70 = require("path");
9426
+ var import_mini33 = require("zod/mini");
9427
+ var KiroSkillFrontmatterSchema = import_mini33.z.looseObject({
9428
+ name: import_mini33.z.string(),
9429
+ description: import_mini33.z.string()
9154
9430
  });
9155
9431
  var KiroSkill = class _KiroSkill extends ToolSkill {
9156
9432
  constructor({
9157
9433
  baseDir = process.cwd(),
9158
- relativeDirPath = (0, import_node_path69.join)(".kiro", "skills"),
9434
+ relativeDirPath = (0, import_node_path70.join)(".kiro", "skills"),
9159
9435
  dirName,
9160
9436
  frontmatter,
9161
9437
  body,
@@ -9187,7 +9463,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9187
9463
  throw new Error("KiroSkill does not support global mode.");
9188
9464
  }
9189
9465
  return {
9190
- relativeDirPath: (0, import_node_path69.join)(".kiro", "skills")
9466
+ relativeDirPath: (0, import_node_path70.join)(".kiro", "skills")
9191
9467
  };
9192
9468
  }
9193
9469
  getFrontmatter() {
@@ -9274,13 +9550,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9274
9550
  });
9275
9551
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9276
9552
  if (!result.success) {
9277
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9553
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9278
9554
  throw new Error(
9279
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9555
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9280
9556
  );
9281
9557
  }
9282
9558
  if (result.data.name !== loaded.dirName) {
9283
- const skillFilePath = (0, import_node_path69.join)(
9559
+ const skillFilePath = (0, import_node_path70.join)(
9284
9560
  loaded.baseDir,
9285
9561
  loaded.relativeDirPath,
9286
9562
  loaded.dirName,
@@ -9322,17 +9598,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9322
9598
  };
9323
9599
 
9324
9600
  // src/features/skills/opencode-skill.ts
9325
- var import_node_path70 = require("path");
9326
- var import_mini33 = require("zod/mini");
9327
- var OpenCodeSkillFrontmatterSchema = import_mini33.z.looseObject({
9328
- name: import_mini33.z.string(),
9329
- description: import_mini33.z.string(),
9330
- "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
9601
+ var import_node_path71 = require("path");
9602
+ var import_mini34 = require("zod/mini");
9603
+ var OpenCodeSkillFrontmatterSchema = import_mini34.z.looseObject({
9604
+ name: import_mini34.z.string(),
9605
+ description: import_mini34.z.string(),
9606
+ "allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
9331
9607
  });
9332
9608
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9333
9609
  constructor({
9334
9610
  baseDir = process.cwd(),
9335
- relativeDirPath = (0, import_node_path70.join)(".opencode", "skill"),
9611
+ relativeDirPath = (0, import_node_path71.join)(".opencode", "skill"),
9336
9612
  dirName,
9337
9613
  frontmatter,
9338
9614
  body,
@@ -9361,7 +9637,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9361
9637
  }
9362
9638
  static getSettablePaths({ global = false } = {}) {
9363
9639
  return {
9364
- relativeDirPath: global ? (0, import_node_path70.join)(".config", "opencode", "skill") : (0, import_node_path70.join)(".opencode", "skill")
9640
+ relativeDirPath: global ? (0, import_node_path71.join)(".config", "opencode", "skill") : (0, import_node_path71.join)(".opencode", "skill")
9365
9641
  };
9366
9642
  }
9367
9643
  getFrontmatter() {
@@ -9446,9 +9722,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9446
9722
  });
9447
9723
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9448
9724
  if (!result.success) {
9449
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9725
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9450
9726
  throw new Error(
9451
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9727
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9452
9728
  );
9453
9729
  }
9454
9730
  return new _OpenCodeSkill({
@@ -9482,16 +9758,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9482
9758
  };
9483
9759
 
9484
9760
  // src/features/skills/replit-skill.ts
9485
- var import_node_path71 = require("path");
9486
- var import_mini34 = require("zod/mini");
9487
- var ReplitSkillFrontmatterSchema = import_mini34.z.looseObject({
9488
- name: import_mini34.z.string(),
9489
- description: import_mini34.z.string()
9761
+ var import_node_path72 = require("path");
9762
+ var import_mini35 = require("zod/mini");
9763
+ var ReplitSkillFrontmatterSchema = import_mini35.z.looseObject({
9764
+ name: import_mini35.z.string(),
9765
+ description: import_mini35.z.string()
9490
9766
  });
9491
9767
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9492
9768
  constructor({
9493
9769
  baseDir = process.cwd(),
9494
- relativeDirPath = (0, import_node_path71.join)(".agents", "skills"),
9770
+ relativeDirPath = (0, import_node_path72.join)(".agents", "skills"),
9495
9771
  dirName,
9496
9772
  frontmatter,
9497
9773
  body,
@@ -9523,7 +9799,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9523
9799
  throw new Error("ReplitSkill does not support global mode.");
9524
9800
  }
9525
9801
  return {
9526
- relativeDirPath: (0, import_node_path71.join)(".agents", "skills")
9802
+ relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
9527
9803
  };
9528
9804
  }
9529
9805
  getFrontmatter() {
@@ -9602,9 +9878,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9602
9878
  });
9603
9879
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9604
9880
  if (!result.success) {
9605
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9881
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9606
9882
  throw new Error(
9607
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9883
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9608
9884
  );
9609
9885
  }
9610
9886
  return new _ReplitSkill({
@@ -9639,16 +9915,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9639
9915
  };
9640
9916
 
9641
9917
  // src/features/skills/roo-skill.ts
9642
- var import_node_path72 = require("path");
9643
- var import_mini35 = require("zod/mini");
9644
- var RooSkillFrontmatterSchema = import_mini35.z.looseObject({
9645
- name: import_mini35.z.string(),
9646
- description: import_mini35.z.string()
9918
+ var import_node_path73 = require("path");
9919
+ var import_mini36 = require("zod/mini");
9920
+ var RooSkillFrontmatterSchema = import_mini36.z.looseObject({
9921
+ name: import_mini36.z.string(),
9922
+ description: import_mini36.z.string()
9647
9923
  });
9648
9924
  var RooSkill = class _RooSkill extends ToolSkill {
9649
9925
  constructor({
9650
9926
  baseDir = process.cwd(),
9651
- relativeDirPath = (0, import_node_path72.join)(".roo", "skills"),
9927
+ relativeDirPath = (0, import_node_path73.join)(".roo", "skills"),
9652
9928
  dirName,
9653
9929
  frontmatter,
9654
9930
  body,
@@ -9679,7 +9955,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
9679
9955
  global: _global = false
9680
9956
  } = {}) {
9681
9957
  return {
9682
- relativeDirPath: (0, import_node_path72.join)(".roo", "skills")
9958
+ relativeDirPath: (0, import_node_path73.join)(".roo", "skills")
9683
9959
  };
9684
9960
  }
9685
9961
  getFrontmatter() {
@@ -9766,13 +10042,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
9766
10042
  });
9767
10043
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9768
10044
  if (!result.success) {
9769
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10045
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9770
10046
  throw new Error(
9771
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10047
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9772
10048
  );
9773
10049
  }
9774
10050
  if (result.data.name !== loaded.dirName) {
9775
- const skillFilePath = (0, import_node_path72.join)(
10051
+ const skillFilePath = (0, import_node_path73.join)(
9776
10052
  loaded.baseDir,
9777
10053
  loaded.relativeDirPath,
9778
10054
  loaded.dirName,
@@ -9813,17 +10089,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
9813
10089
  };
9814
10090
 
9815
10091
  // src/features/skills/skills-utils.ts
9816
- var import_node_path73 = require("path");
10092
+ var import_node_path74 = require("path");
9817
10093
  async function getLocalSkillDirNames(baseDir) {
9818
- const skillsDir = (0, import_node_path73.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10094
+ const skillsDir = (0, import_node_path74.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
9819
10095
  const names = /* @__PURE__ */ new Set();
9820
10096
  if (!await directoryExists(skillsDir)) {
9821
10097
  return names;
9822
10098
  }
9823
- const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDir, "*"), { type: "dir" });
10099
+ const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDir, "*"), { type: "dir" });
9824
10100
  for (const dirPath of dirPaths) {
9825
- const name = (0, import_node_path73.basename)(dirPath);
9826
- if (name === (0, import_node_path73.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10101
+ const name = (0, import_node_path74.basename)(dirPath);
10102
+ if (name === (0, import_node_path74.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
9827
10103
  names.add(name);
9828
10104
  }
9829
10105
  return names;
@@ -9848,7 +10124,7 @@ var skillsProcessorToolTargetTuple = [
9848
10124
  "replit",
9849
10125
  "roo"
9850
10126
  ];
9851
- var SkillsProcessorToolTargetSchema = import_mini36.z.enum(skillsProcessorToolTargetTuple);
10127
+ var SkillsProcessorToolTargetSchema = import_mini37.z.enum(skillsProcessorToolTargetTuple);
9852
10128
  var toolSkillFactories = /* @__PURE__ */ new Map([
9853
10129
  [
9854
10130
  "agentsmd",
@@ -10049,11 +10325,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10049
10325
  )
10050
10326
  );
10051
10327
  const localSkillNames = new Set(localDirNames);
10052
- const curatedDirPath = (0, import_node_path74.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10328
+ const curatedDirPath = (0, import_node_path75.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10053
10329
  let curatedSkills = [];
10054
10330
  if (await directoryExists(curatedDirPath)) {
10055
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path74.join)(curatedDirPath, "*"), { type: "dir" });
10056
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path74.basename)(path3));
10331
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path75.join)(curatedDirPath, "*"), { type: "dir" });
10332
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10057
10333
  const nonConflicting = curatedDirNames.filter((name) => {
10058
10334
  if (localSkillNames.has(name)) {
10059
10335
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -10086,9 +10362,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10086
10362
  async loadToolDirs() {
10087
10363
  const factory = this.getFactory(this.toolTarget);
10088
10364
  const paths = factory.class.getSettablePaths({ global: this.global });
10089
- const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10090
- const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10091
- const dirNames = dirPaths.map((path3) => (0, import_node_path74.basename)(path3));
10365
+ const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10366
+ const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10367
+ const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10092
10368
  const toolSkills = await Promise.all(
10093
10369
  dirNames.map(
10094
10370
  (dirName) => factory.class.fromDir({
@@ -10104,9 +10380,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10104
10380
  async loadToolDirsToDelete() {
10105
10381
  const factory = this.getFactory(this.toolTarget);
10106
10382
  const paths = factory.class.getSettablePaths({ global: this.global });
10107
- const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10108
- const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10109
- const dirNames = dirPaths.map((path3) => (0, import_node_path74.basename)(path3));
10383
+ const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10384
+ const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10385
+ const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10110
10386
  const toolSkills = dirNames.map(
10111
10387
  (dirName) => factory.class.forDeletion({
10112
10388
  baseDir: this.baseDir,
@@ -10167,11 +10443,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10167
10443
  };
10168
10444
 
10169
10445
  // src/features/subagents/agentsmd-subagent.ts
10170
- var import_node_path76 = require("path");
10446
+ var import_node_path77 = require("path");
10171
10447
 
10172
10448
  // src/features/subagents/simulated-subagent.ts
10173
- var import_node_path75 = require("path");
10174
- var import_mini37 = require("zod/mini");
10449
+ var import_node_path76 = require("path");
10450
+ var import_mini38 = require("zod/mini");
10175
10451
 
10176
10452
  // src/features/subagents/tool-subagent.ts
10177
10453
  var ToolSubagent = class extends ToolFile {
@@ -10223,9 +10499,9 @@ var ToolSubagent = class extends ToolFile {
10223
10499
  };
10224
10500
 
10225
10501
  // src/features/subagents/simulated-subagent.ts
10226
- var SimulatedSubagentFrontmatterSchema = import_mini37.z.object({
10227
- name: import_mini37.z.string(),
10228
- description: import_mini37.z.string()
10502
+ var SimulatedSubagentFrontmatterSchema = import_mini38.z.object({
10503
+ name: import_mini38.z.string(),
10504
+ description: import_mini38.z.string()
10229
10505
  });
10230
10506
  var SimulatedSubagent = class extends ToolSubagent {
10231
10507
  frontmatter;
@@ -10235,7 +10511,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10235
10511
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
10236
10512
  if (!result.success) {
10237
10513
  throw new Error(
10238
- `Invalid frontmatter in ${(0, import_node_path75.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10514
+ `Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10239
10515
  );
10240
10516
  }
10241
10517
  }
@@ -10286,7 +10562,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10286
10562
  return {
10287
10563
  success: false,
10288
10564
  error: new Error(
10289
- `Invalid frontmatter in ${(0, import_node_path75.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10565
+ `Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10290
10566
  )
10291
10567
  };
10292
10568
  }
@@ -10296,7 +10572,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10296
10572
  relativeFilePath,
10297
10573
  validate = true
10298
10574
  }) {
10299
- const filePath = (0, import_node_path75.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10575
+ const filePath = (0, import_node_path76.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10300
10576
  const fileContent = await readFileContent(filePath);
10301
10577
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10302
10578
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10306,7 +10582,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10306
10582
  return {
10307
10583
  baseDir,
10308
10584
  relativeDirPath: this.getSettablePaths().relativeDirPath,
10309
- relativeFilePath: (0, import_node_path75.basename)(relativeFilePath),
10585
+ relativeFilePath: (0, import_node_path76.basename)(relativeFilePath),
10310
10586
  frontmatter: result.data,
10311
10587
  body: content.trim(),
10312
10588
  validate
@@ -10332,7 +10608,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10332
10608
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10333
10609
  static getSettablePaths() {
10334
10610
  return {
10335
- relativeDirPath: (0, import_node_path76.join)(".agents", "subagents")
10611
+ relativeDirPath: (0, import_node_path77.join)(".agents", "subagents")
10336
10612
  };
10337
10613
  }
10338
10614
  static async fromFile(params) {
@@ -10355,11 +10631,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10355
10631
  };
10356
10632
 
10357
10633
  // src/features/subagents/factorydroid-subagent.ts
10358
- var import_node_path77 = require("path");
10634
+ var import_node_path78 = require("path");
10359
10635
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10360
10636
  static getSettablePaths(_options) {
10361
10637
  return {
10362
- relativeDirPath: (0, import_node_path77.join)(".factory", "droids")
10638
+ relativeDirPath: (0, import_node_path78.join)(".factory", "droids")
10363
10639
  };
10364
10640
  }
10365
10641
  static async fromFile(params) {
@@ -10382,11 +10658,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10382
10658
  };
10383
10659
 
10384
10660
  // src/features/subagents/geminicli-subagent.ts
10385
- var import_node_path78 = require("path");
10661
+ var import_node_path79 = require("path");
10386
10662
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10387
10663
  static getSettablePaths() {
10388
10664
  return {
10389
- relativeDirPath: (0, import_node_path78.join)(".gemini", "subagents")
10665
+ relativeDirPath: (0, import_node_path79.join)(".gemini", "subagents")
10390
10666
  };
10391
10667
  }
10392
10668
  static async fromFile(params) {
@@ -10409,11 +10685,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10409
10685
  };
10410
10686
 
10411
10687
  // src/features/subagents/roo-subagent.ts
10412
- var import_node_path79 = require("path");
10688
+ var import_node_path80 = require("path");
10413
10689
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10414
10690
  static getSettablePaths() {
10415
10691
  return {
10416
- relativeDirPath: (0, import_node_path79.join)(".roo", "subagents")
10692
+ relativeDirPath: (0, import_node_path80.join)(".roo", "subagents")
10417
10693
  };
10418
10694
  }
10419
10695
  static async fromFile(params) {
@@ -10436,20 +10712,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10436
10712
  };
10437
10713
 
10438
10714
  // src/features/subagents/subagents-processor.ts
10439
- var import_node_path87 = require("path");
10440
- var import_mini45 = require("zod/mini");
10715
+ var import_node_path88 = require("path");
10716
+ var import_mini46 = require("zod/mini");
10441
10717
 
10442
10718
  // src/features/subagents/claudecode-subagent.ts
10443
- var import_node_path81 = require("path");
10444
- var import_mini39 = require("zod/mini");
10719
+ var import_node_path82 = require("path");
10720
+ var import_mini40 = require("zod/mini");
10445
10721
 
10446
10722
  // src/features/subagents/rulesync-subagent.ts
10447
- var import_node_path80 = require("path");
10448
- var import_mini38 = require("zod/mini");
10449
- var RulesyncSubagentFrontmatterSchema = import_mini38.z.looseObject({
10450
- targets: import_mini38.z._default(RulesyncTargetsSchema, ["*"]),
10451
- name: import_mini38.z.string(),
10452
- description: import_mini38.z.string()
10723
+ var import_node_path81 = require("path");
10724
+ var import_mini39 = require("zod/mini");
10725
+ var RulesyncSubagentFrontmatterSchema = import_mini39.z.looseObject({
10726
+ targets: import_mini39.z._default(RulesyncTargetsSchema, ["*"]),
10727
+ name: import_mini39.z.string(),
10728
+ description: import_mini39.z.string()
10453
10729
  });
10454
10730
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10455
10731
  frontmatter;
@@ -10458,7 +10734,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10458
10734
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10459
10735
  if (!parseResult.success && rest.validate !== false) {
10460
10736
  throw new Error(
10461
- `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10737
+ `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10462
10738
  );
10463
10739
  }
10464
10740
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10491,7 +10767,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10491
10767
  return {
10492
10768
  success: false,
10493
10769
  error: new Error(
10494
- `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10770
+ `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10495
10771
  )
10496
10772
  };
10497
10773
  }
@@ -10499,14 +10775,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10499
10775
  static async fromFile({
10500
10776
  relativeFilePath
10501
10777
  }) {
10502
- const filePath = (0, import_node_path80.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10778
+ const filePath = (0, import_node_path81.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10503
10779
  const fileContent = await readFileContent(filePath);
10504
10780
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10505
10781
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10506
10782
  if (!result.success) {
10507
10783
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10508
10784
  }
10509
- const filename = (0, import_node_path80.basename)(relativeFilePath);
10785
+ const filename = (0, import_node_path81.basename)(relativeFilePath);
10510
10786
  return new _RulesyncSubagent({
10511
10787
  baseDir: process.cwd(),
10512
10788
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10518,13 +10794,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10518
10794
  };
10519
10795
 
10520
10796
  // src/features/subagents/claudecode-subagent.ts
10521
- var ClaudecodeSubagentFrontmatterSchema = import_mini39.z.looseObject({
10522
- name: import_mini39.z.string(),
10523
- description: import_mini39.z.string(),
10524
- model: import_mini39.z.optional(import_mini39.z.string()),
10525
- tools: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())])),
10526
- permissionMode: import_mini39.z.optional(import_mini39.z.string()),
10527
- skills: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())]))
10797
+ var ClaudecodeSubagentFrontmatterSchema = import_mini40.z.looseObject({
10798
+ name: import_mini40.z.string(),
10799
+ description: import_mini40.z.string(),
10800
+ model: import_mini40.z.optional(import_mini40.z.string()),
10801
+ tools: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())])),
10802
+ permissionMode: import_mini40.z.optional(import_mini40.z.string()),
10803
+ skills: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())]))
10528
10804
  });
10529
10805
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10530
10806
  frontmatter;
@@ -10534,7 +10810,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10534
10810
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10535
10811
  if (!result.success) {
10536
10812
  throw new Error(
10537
- `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10813
+ `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10538
10814
  );
10539
10815
  }
10540
10816
  }
@@ -10546,7 +10822,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10546
10822
  }
10547
10823
  static getSettablePaths(_options = {}) {
10548
10824
  return {
10549
- relativeDirPath: (0, import_node_path81.join)(".claude", "agents")
10825
+ relativeDirPath: (0, import_node_path82.join)(".claude", "agents")
10550
10826
  };
10551
10827
  }
10552
10828
  getFrontmatter() {
@@ -10622,7 +10898,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10622
10898
  return {
10623
10899
  success: false,
10624
10900
  error: new Error(
10625
- `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10901
+ `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10626
10902
  )
10627
10903
  };
10628
10904
  }
@@ -10640,7 +10916,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10640
10916
  global = false
10641
10917
  }) {
10642
10918
  const paths = this.getSettablePaths({ global });
10643
- const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10919
+ const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10644
10920
  const fileContent = await readFileContent(filePath);
10645
10921
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10646
10922
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10675,16 +10951,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10675
10951
  };
10676
10952
 
10677
10953
  // src/features/subagents/codexcli-subagent.ts
10678
- var import_node_path82 = require("path");
10954
+ var import_node_path83 = require("path");
10679
10955
  var smolToml2 = __toESM(require("smol-toml"), 1);
10680
- var import_mini40 = require("zod/mini");
10681
- var CodexCliSubagentTomlSchema = import_mini40.z.looseObject({
10682
- name: import_mini40.z.string(),
10683
- description: import_mini40.z.optional(import_mini40.z.string()),
10684
- developer_instructions: import_mini40.z.optional(import_mini40.z.string()),
10685
- model: import_mini40.z.optional(import_mini40.z.string()),
10686
- model_reasoning_effort: import_mini40.z.optional(import_mini40.z.string()),
10687
- sandbox_mode: import_mini40.z.optional(import_mini40.z.string())
10956
+ var import_mini41 = require("zod/mini");
10957
+ var CodexCliSubagentTomlSchema = import_mini41.z.looseObject({
10958
+ name: import_mini41.z.string(),
10959
+ description: import_mini41.z.optional(import_mini41.z.string()),
10960
+ developer_instructions: import_mini41.z.optional(import_mini41.z.string()),
10961
+ model: import_mini41.z.optional(import_mini41.z.string()),
10962
+ model_reasoning_effort: import_mini41.z.optional(import_mini41.z.string()),
10963
+ sandbox_mode: import_mini41.z.optional(import_mini41.z.string())
10688
10964
  });
10689
10965
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10690
10966
  body;
@@ -10695,7 +10971,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10695
10971
  CodexCliSubagentTomlSchema.parse(parsed);
10696
10972
  } catch (error) {
10697
10973
  throw new Error(
10698
- `Invalid TOML in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10974
+ `Invalid TOML in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10699
10975
  { cause: error }
10700
10976
  );
10701
10977
  }
@@ -10707,7 +10983,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10707
10983
  }
10708
10984
  static getSettablePaths(_options = {}) {
10709
10985
  return {
10710
- relativeDirPath: (0, import_node_path82.join)(".codex", "agents")
10986
+ relativeDirPath: (0, import_node_path83.join)(".codex", "agents")
10711
10987
  };
10712
10988
  }
10713
10989
  getBody() {
@@ -10719,7 +10995,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10719
10995
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10720
10996
  } catch (error) {
10721
10997
  throw new Error(
10722
- `Failed to parse TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10998
+ `Failed to parse TOML in ${(0, import_node_path83.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10723
10999
  { cause: error }
10724
11000
  );
10725
11001
  }
@@ -10800,7 +11076,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10800
11076
  global = false
10801
11077
  }) {
10802
11078
  const paths = this.getSettablePaths({ global });
10803
- const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11079
+ const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10804
11080
  const fileContent = await readFileContent(filePath);
10805
11081
  const subagent = new _CodexCliSubagent({
10806
11082
  baseDir,
@@ -10838,13 +11114,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10838
11114
  };
10839
11115
 
10840
11116
  // src/features/subagents/copilot-subagent.ts
10841
- var import_node_path83 = require("path");
10842
- var import_mini41 = require("zod/mini");
11117
+ var import_node_path84 = require("path");
11118
+ var import_mini42 = require("zod/mini");
10843
11119
  var REQUIRED_TOOL = "agent/runSubagent";
10844
- var CopilotSubagentFrontmatterSchema = import_mini41.z.looseObject({
10845
- name: import_mini41.z.string(),
10846
- description: import_mini41.z.string(),
10847
- tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
11120
+ var CopilotSubagentFrontmatterSchema = import_mini42.z.looseObject({
11121
+ name: import_mini42.z.string(),
11122
+ description: import_mini42.z.string(),
11123
+ tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
10848
11124
  });
10849
11125
  var normalizeTools = (tools) => {
10850
11126
  if (!tools) {
@@ -10864,7 +11140,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10864
11140
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
10865
11141
  if (!result.success) {
10866
11142
  throw new Error(
10867
- `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11143
+ `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10868
11144
  );
10869
11145
  }
10870
11146
  }
@@ -10876,7 +11152,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10876
11152
  }
10877
11153
  static getSettablePaths(_options = {}) {
10878
11154
  return {
10879
- relativeDirPath: (0, import_node_path83.join)(".github", "agents")
11155
+ relativeDirPath: (0, import_node_path84.join)(".github", "agents")
10880
11156
  };
10881
11157
  }
10882
11158
  getFrontmatter() {
@@ -10950,7 +11226,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10950
11226
  return {
10951
11227
  success: false,
10952
11228
  error: new Error(
10953
- `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11229
+ `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10954
11230
  )
10955
11231
  };
10956
11232
  }
@@ -10968,7 +11244,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10968
11244
  global = false
10969
11245
  }) {
10970
11246
  const paths = this.getSettablePaths({ global });
10971
- const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11247
+ const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10972
11248
  const fileContent = await readFileContent(filePath);
10973
11249
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10974
11250
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11004,11 +11280,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11004
11280
  };
11005
11281
 
11006
11282
  // src/features/subagents/cursor-subagent.ts
11007
- var import_node_path84 = require("path");
11008
- var import_mini42 = require("zod/mini");
11009
- var CursorSubagentFrontmatterSchema = import_mini42.z.looseObject({
11010
- name: import_mini42.z.string(),
11011
- description: import_mini42.z.string()
11283
+ var import_node_path85 = require("path");
11284
+ var import_mini43 = require("zod/mini");
11285
+ var CursorSubagentFrontmatterSchema = import_mini43.z.looseObject({
11286
+ name: import_mini43.z.string(),
11287
+ description: import_mini43.z.string()
11012
11288
  });
11013
11289
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11014
11290
  frontmatter;
@@ -11018,7 +11294,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11018
11294
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11019
11295
  if (!result.success) {
11020
11296
  throw new Error(
11021
- `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11297
+ `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11022
11298
  );
11023
11299
  }
11024
11300
  }
@@ -11030,7 +11306,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11030
11306
  }
11031
11307
  static getSettablePaths(_options = {}) {
11032
11308
  return {
11033
- relativeDirPath: (0, import_node_path84.join)(".cursor", "agents")
11309
+ relativeDirPath: (0, import_node_path85.join)(".cursor", "agents")
11034
11310
  };
11035
11311
  }
11036
11312
  getFrontmatter() {
@@ -11097,7 +11373,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11097
11373
  return {
11098
11374
  success: false,
11099
11375
  error: new Error(
11100
- `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11376
+ `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11101
11377
  )
11102
11378
  };
11103
11379
  }
@@ -11115,7 +11391,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11115
11391
  global = false
11116
11392
  }) {
11117
11393
  const paths = this.getSettablePaths({ global });
11118
- const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11394
+ const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11119
11395
  const fileContent = await readFileContent(filePath);
11120
11396
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11121
11397
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11151,23 +11427,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11151
11427
  };
11152
11428
 
11153
11429
  // src/features/subagents/kiro-subagent.ts
11154
- var import_node_path85 = require("path");
11155
- var import_mini43 = require("zod/mini");
11156
- var KiroCliSubagentJsonSchema = import_mini43.z.looseObject({
11157
- name: import_mini43.z.string(),
11158
- description: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11159
- prompt: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11160
- tools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11161
- toolAliases: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.string()))),
11162
- toolSettings: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11163
- toolSchema: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11164
- hooks: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.array(import_mini43.z.unknown())))),
11165
- model: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11166
- mcpServers: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.unknown()))),
11167
- useLegacyMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean())),
11168
- resources: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11169
- allowedTools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11170
- includeMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean()))
11430
+ var import_node_path86 = require("path");
11431
+ var import_mini44 = require("zod/mini");
11432
+ var KiroCliSubagentJsonSchema = import_mini44.z.looseObject({
11433
+ name: import_mini44.z.string(),
11434
+ description: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11435
+ prompt: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11436
+ tools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11437
+ toolAliases: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.string()))),
11438
+ toolSettings: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11439
+ toolSchema: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11440
+ hooks: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.array(import_mini44.z.unknown())))),
11441
+ model: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11442
+ mcpServers: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.unknown()))),
11443
+ useLegacyMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean())),
11444
+ resources: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11445
+ allowedTools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11446
+ includeMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean()))
11171
11447
  });
11172
11448
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11173
11449
  body;
@@ -11178,7 +11454,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11178
11454
  KiroCliSubagentJsonSchema.parse(parsed);
11179
11455
  } catch (error) {
11180
11456
  throw new Error(
11181
- `Invalid JSON in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11457
+ `Invalid JSON in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11182
11458
  { cause: error }
11183
11459
  );
11184
11460
  }
@@ -11190,7 +11466,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11190
11466
  }
11191
11467
  static getSettablePaths(_options = {}) {
11192
11468
  return {
11193
- relativeDirPath: (0, import_node_path85.join)(".kiro", "agents")
11469
+ relativeDirPath: (0, import_node_path86.join)(".kiro", "agents")
11194
11470
  };
11195
11471
  }
11196
11472
  getBody() {
@@ -11202,7 +11478,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11202
11478
  parsed = JSON.parse(this.body);
11203
11479
  } catch (error) {
11204
11480
  throw new Error(
11205
- `Failed to parse JSON in ${(0, import_node_path85.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11481
+ `Failed to parse JSON in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11206
11482
  { cause: error }
11207
11483
  );
11208
11484
  }
@@ -11283,7 +11559,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11283
11559
  global = false
11284
11560
  }) {
11285
11561
  const paths = this.getSettablePaths({ global });
11286
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11562
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11287
11563
  const fileContent = await readFileContent(filePath);
11288
11564
  const subagent = new _KiroSubagent({
11289
11565
  baseDir,
@@ -11321,12 +11597,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11321
11597
  };
11322
11598
 
11323
11599
  // src/features/subagents/opencode-subagent.ts
11324
- var import_node_path86 = require("path");
11325
- var import_mini44 = require("zod/mini");
11326
- var OpenCodeSubagentFrontmatterSchema = import_mini44.z.looseObject({
11327
- description: import_mini44.z.string(),
11328
- mode: import_mini44.z._default(import_mini44.z.string(), "subagent"),
11329
- name: import_mini44.z.optional(import_mini44.z.string())
11600
+ var import_node_path87 = require("path");
11601
+ var import_mini45 = require("zod/mini");
11602
+ var OpenCodeSubagentFrontmatterSchema = import_mini45.z.looseObject({
11603
+ description: import_mini45.z.string(),
11604
+ mode: import_mini45.z._default(import_mini45.z.string(), "subagent"),
11605
+ name: import_mini45.z.optional(import_mini45.z.string())
11330
11606
  });
11331
11607
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11332
11608
  frontmatter;
@@ -11336,7 +11612,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11336
11612
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11337
11613
  if (!result.success) {
11338
11614
  throw new Error(
11339
- `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11615
+ `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11340
11616
  );
11341
11617
  }
11342
11618
  }
@@ -11350,7 +11626,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11350
11626
  global = false
11351
11627
  } = {}) {
11352
11628
  return {
11353
- relativeDirPath: global ? (0, import_node_path86.join)(".config", "opencode", "agent") : (0, import_node_path86.join)(".opencode", "agent")
11629
+ relativeDirPath: global ? (0, import_node_path87.join)(".config", "opencode", "agent") : (0, import_node_path87.join)(".opencode", "agent")
11354
11630
  };
11355
11631
  }
11356
11632
  getFrontmatter() {
@@ -11363,7 +11639,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11363
11639
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
11364
11640
  const rulesyncFrontmatter = {
11365
11641
  targets: ["*"],
11366
- name: name ?? (0, import_node_path86.basename)(this.getRelativeFilePath(), ".md"),
11642
+ name: name ?? (0, import_node_path87.basename)(this.getRelativeFilePath(), ".md"),
11367
11643
  description,
11368
11644
  opencode: { mode, ...opencodeSection }
11369
11645
  };
@@ -11416,7 +11692,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11416
11692
  return {
11417
11693
  success: false,
11418
11694
  error: new Error(
11419
- `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11695
+ `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11420
11696
  )
11421
11697
  };
11422
11698
  }
@@ -11433,7 +11709,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11433
11709
  global = false
11434
11710
  }) {
11435
11711
  const paths = this.getSettablePaths({ global });
11436
- const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11712
+ const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11437
11713
  const fileContent = await readFileContent(filePath);
11438
11714
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11439
11715
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11482,7 +11758,7 @@ var subagentsProcessorToolTargetTuple = [
11482
11758
  "opencode",
11483
11759
  "roo"
11484
11760
  ];
11485
- var SubagentsProcessorToolTargetSchema = import_mini45.z.enum(subagentsProcessorToolTargetTuple);
11761
+ var SubagentsProcessorToolTargetSchema = import_mini46.z.enum(subagentsProcessorToolTargetTuple);
11486
11762
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11487
11763
  [
11488
11764
  "agentsmd",
@@ -11644,7 +11920,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11644
11920
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11645
11921
  */
11646
11922
  async loadRulesyncFiles() {
11647
- const subagentsDir = (0, import_node_path87.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11923
+ const subagentsDir = (0, import_node_path88.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11648
11924
  const dirExists = await directoryExists(subagentsDir);
11649
11925
  if (!dirExists) {
11650
11926
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11659,7 +11935,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11659
11935
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
11660
11936
  const rulesyncSubagents = [];
11661
11937
  for (const mdFile of mdFiles) {
11662
- const filepath = (0, import_node_path87.join)(subagentsDir, mdFile);
11938
+ const filepath = (0, import_node_path88.join)(subagentsDir, mdFile);
11663
11939
  try {
11664
11940
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
11665
11941
  relativeFilePath: mdFile,
@@ -11689,14 +11965,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
11689
11965
  const factory = this.getFactory(this.toolTarget);
11690
11966
  const paths = factory.class.getSettablePaths({ global: this.global });
11691
11967
  const subagentFilePaths = await findFilesByGlobs(
11692
- (0, import_node_path87.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11968
+ (0, import_node_path88.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11693
11969
  );
11694
11970
  if (forDeletion) {
11695
11971
  const toolSubagents2 = subagentFilePaths.map(
11696
11972
  (path3) => factory.class.forDeletion({
11697
11973
  baseDir: this.baseDir,
11698
11974
  relativeDirPath: paths.relativeDirPath,
11699
- relativeFilePath: (0, import_node_path87.basename)(path3),
11975
+ relativeFilePath: (0, import_node_path88.basename)(path3),
11700
11976
  global: this.global
11701
11977
  })
11702
11978
  ).filter((subagent) => subagent.isDeletable());
@@ -11709,7 +11985,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11709
11985
  subagentFilePaths.map(
11710
11986
  (path3) => factory.class.fromFile({
11711
11987
  baseDir: this.baseDir,
11712
- relativeFilePath: (0, import_node_path87.basename)(path3),
11988
+ relativeFilePath: (0, import_node_path88.basename)(path3),
11713
11989
  global: this.global
11714
11990
  })
11715
11991
  )
@@ -11754,49 +12030,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
11754
12030
  };
11755
12031
 
11756
12032
  // src/features/rules/agentsmd-rule.ts
11757
- var import_node_path90 = require("path");
12033
+ var import_node_path91 = require("path");
11758
12034
 
11759
12035
  // src/features/rules/tool-rule.ts
11760
- var import_node_path89 = require("path");
12036
+ var import_node_path90 = require("path");
11761
12037
 
11762
12038
  // src/features/rules/rulesync-rule.ts
11763
- var import_node_path88 = require("path");
11764
- var import_mini46 = require("zod/mini");
11765
- var RulesyncRuleFrontmatterSchema = import_mini46.z.object({
11766
- root: import_mini46.z.optional(import_mini46.z.boolean()),
11767
- localRoot: import_mini46.z.optional(import_mini46.z.boolean()),
11768
- targets: import_mini46.z._default(RulesyncTargetsSchema, ["*"]),
11769
- description: import_mini46.z.optional(import_mini46.z.string()),
11770
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string())),
11771
- agentsmd: import_mini46.z.optional(
11772
- import_mini46.z.object({
12039
+ var import_node_path89 = require("path");
12040
+ var import_mini47 = require("zod/mini");
12041
+ var RulesyncRuleFrontmatterSchema = import_mini47.z.object({
12042
+ root: import_mini47.z.optional(import_mini47.z.boolean()),
12043
+ localRoot: import_mini47.z.optional(import_mini47.z.boolean()),
12044
+ targets: import_mini47.z._default(RulesyncTargetsSchema, ["*"]),
12045
+ description: import_mini47.z.optional(import_mini47.z.string()),
12046
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string())),
12047
+ agentsmd: import_mini47.z.optional(
12048
+ import_mini47.z.object({
11773
12049
  // @example "path/to/subproject"
11774
- subprojectPath: import_mini46.z.optional(import_mini46.z.string())
12050
+ subprojectPath: import_mini47.z.optional(import_mini47.z.string())
11775
12051
  })
11776
12052
  ),
11777
- claudecode: import_mini46.z.optional(
11778
- import_mini46.z.object({
12053
+ claudecode: import_mini47.z.optional(
12054
+ import_mini47.z.object({
11779
12055
  // Glob patterns for conditional rules (takes precedence over globs)
11780
12056
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
11781
- paths: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12057
+ paths: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11782
12058
  })
11783
12059
  ),
11784
- cursor: import_mini46.z.optional(
11785
- import_mini46.z.object({
11786
- alwaysApply: import_mini46.z.optional(import_mini46.z.boolean()),
11787
- description: import_mini46.z.optional(import_mini46.z.string()),
11788
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12060
+ cursor: import_mini47.z.optional(
12061
+ import_mini47.z.object({
12062
+ alwaysApply: import_mini47.z.optional(import_mini47.z.boolean()),
12063
+ description: import_mini47.z.optional(import_mini47.z.string()),
12064
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11789
12065
  })
11790
12066
  ),
11791
- copilot: import_mini46.z.optional(
11792
- import_mini46.z.object({
11793
- excludeAgent: import_mini46.z.optional(import_mini46.z.union([import_mini46.z.literal("code-review"), import_mini46.z.literal("coding-agent")]))
12067
+ copilot: import_mini47.z.optional(
12068
+ import_mini47.z.object({
12069
+ excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
11794
12070
  })
11795
12071
  ),
11796
- antigravity: import_mini46.z.optional(
11797
- import_mini46.z.looseObject({
11798
- trigger: import_mini46.z.optional(import_mini46.z.string()),
11799
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12072
+ antigravity: import_mini47.z.optional(
12073
+ import_mini47.z.looseObject({
12074
+ trigger: import_mini47.z.optional(import_mini47.z.string()),
12075
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11800
12076
  })
11801
12077
  )
11802
12078
  });
@@ -11807,7 +12083,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11807
12083
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
11808
12084
  if (!parseResult.success && rest.validate !== false) {
11809
12085
  throw new Error(
11810
- `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12086
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11811
12087
  );
11812
12088
  }
11813
12089
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -11842,7 +12118,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11842
12118
  return {
11843
12119
  success: false,
11844
12120
  error: new Error(
11845
- `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12121
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11846
12122
  )
11847
12123
  };
11848
12124
  }
@@ -11851,7 +12127,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11851
12127
  relativeFilePath,
11852
12128
  validate = true
11853
12129
  }) {
11854
- const filePath = (0, import_node_path88.join)(
12130
+ const filePath = (0, import_node_path89.join)(
11855
12131
  process.cwd(),
11856
12132
  this.getSettablePaths().recommended.relativeDirPath,
11857
12133
  relativeFilePath
@@ -11953,7 +12229,7 @@ var ToolRule = class extends ToolFile {
11953
12229
  rulesyncRule,
11954
12230
  validate = true,
11955
12231
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
11956
- nonRootPath = { relativeDirPath: (0, import_node_path89.join)(".agents", "memories") }
12232
+ nonRootPath = { relativeDirPath: (0, import_node_path90.join)(".agents", "memories") }
11957
12233
  }) {
11958
12234
  const params = this.buildToolRuleParamsDefault({
11959
12235
  baseDir,
@@ -11964,7 +12240,7 @@ var ToolRule = class extends ToolFile {
11964
12240
  });
11965
12241
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
11966
12242
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
11967
- params.relativeDirPath = (0, import_node_path89.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12243
+ params.relativeDirPath = (0, import_node_path90.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
11968
12244
  params.relativeFilePath = "AGENTS.md";
11969
12245
  }
11970
12246
  return params;
@@ -12013,7 +12289,7 @@ var ToolRule = class extends ToolFile {
12013
12289
  }
12014
12290
  };
12015
12291
  function buildToolPath(toolDir, subDir, excludeToolDir) {
12016
- return excludeToolDir ? subDir : (0, import_node_path89.join)(toolDir, subDir);
12292
+ return excludeToolDir ? subDir : (0, import_node_path90.join)(toolDir, subDir);
12017
12293
  }
12018
12294
 
12019
12295
  // src/features/rules/agentsmd-rule.ts
@@ -12042,8 +12318,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12042
12318
  validate = true
12043
12319
  }) {
12044
12320
  const isRoot = relativeFilePath === "AGENTS.md";
12045
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path90.join)(".agents", "memories", relativeFilePath);
12046
- const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
12321
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path91.join)(".agents", "memories", relativeFilePath);
12322
+ const fileContent = await readFileContent((0, import_node_path91.join)(baseDir, relativePath));
12047
12323
  return new _AgentsMdRule({
12048
12324
  baseDir,
12049
12325
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -12098,21 +12374,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12098
12374
  };
12099
12375
 
12100
12376
  // src/features/rules/antigravity-rule.ts
12101
- var import_node_path91 = require("path");
12102
- var import_mini47 = require("zod/mini");
12103
- var AntigravityRuleFrontmatterSchema = import_mini47.z.looseObject({
12104
- trigger: import_mini47.z.optional(
12105
- import_mini47.z.union([
12106
- import_mini47.z.literal("always_on"),
12107
- import_mini47.z.literal("glob"),
12108
- import_mini47.z.literal("manual"),
12109
- import_mini47.z.literal("model_decision"),
12110
- import_mini47.z.string()
12377
+ var import_node_path92 = require("path");
12378
+ var import_mini48 = require("zod/mini");
12379
+ var AntigravityRuleFrontmatterSchema = import_mini48.z.looseObject({
12380
+ trigger: import_mini48.z.optional(
12381
+ import_mini48.z.union([
12382
+ import_mini48.z.literal("always_on"),
12383
+ import_mini48.z.literal("glob"),
12384
+ import_mini48.z.literal("manual"),
12385
+ import_mini48.z.literal("model_decision"),
12386
+ import_mini48.z.string()
12111
12387
  // accepts any string for forward compatibility
12112
12388
  ])
12113
12389
  ),
12114
- globs: import_mini47.z.optional(import_mini47.z.string()),
12115
- description: import_mini47.z.optional(import_mini47.z.string())
12390
+ globs: import_mini48.z.optional(import_mini48.z.string()),
12391
+ description: import_mini48.z.optional(import_mini48.z.string())
12116
12392
  });
12117
12393
  function parseGlobsString(globs) {
12118
12394
  if (!globs) {
@@ -12257,7 +12533,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12257
12533
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
12258
12534
  if (!result.success) {
12259
12535
  throw new Error(
12260
- `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12536
+ `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12261
12537
  );
12262
12538
  }
12263
12539
  }
@@ -12281,7 +12557,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12281
12557
  relativeFilePath,
12282
12558
  validate = true
12283
12559
  }) {
12284
- const filePath = (0, import_node_path91.join)(
12560
+ const filePath = (0, import_node_path92.join)(
12285
12561
  baseDir,
12286
12562
  this.getSettablePaths().nonRoot.relativeDirPath,
12287
12563
  relativeFilePath
@@ -12422,7 +12698,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12422
12698
  };
12423
12699
 
12424
12700
  // src/features/rules/augmentcode-legacy-rule.ts
12425
- var import_node_path92 = require("path");
12701
+ var import_node_path93 = require("path");
12426
12702
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12427
12703
  toRulesyncRule() {
12428
12704
  const rulesyncFrontmatter = {
@@ -12483,8 +12759,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12483
12759
  }) {
12484
12760
  const settablePaths = this.getSettablePaths();
12485
12761
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12486
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path92.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12487
- const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
12762
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path93.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12763
+ const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
12488
12764
  return new _AugmentcodeLegacyRule({
12489
12765
  baseDir,
12490
12766
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12513,7 +12789,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12513
12789
  };
12514
12790
 
12515
12791
  // src/features/rules/augmentcode-rule.ts
12516
- var import_node_path93 = require("path");
12792
+ var import_node_path94 = require("path");
12517
12793
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12518
12794
  toRulesyncRule() {
12519
12795
  return this.toRulesyncRuleDefault();
@@ -12544,7 +12820,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12544
12820
  relativeFilePath,
12545
12821
  validate = true
12546
12822
  }) {
12547
- const filePath = (0, import_node_path93.join)(
12823
+ const filePath = (0, import_node_path94.join)(
12548
12824
  baseDir,
12549
12825
  this.getSettablePaths().nonRoot.relativeDirPath,
12550
12826
  relativeFilePath
@@ -12584,7 +12860,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12584
12860
  };
12585
12861
 
12586
12862
  // src/features/rules/claudecode-legacy-rule.ts
12587
- var import_node_path94 = require("path");
12863
+ var import_node_path95 = require("path");
12588
12864
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12589
12865
  static getSettablePaths({
12590
12866
  global,
@@ -12619,7 +12895,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12619
12895
  if (isRoot) {
12620
12896
  const relativePath2 = paths.root.relativeFilePath;
12621
12897
  const fileContent2 = await readFileContent(
12622
- (0, import_node_path94.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12898
+ (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12623
12899
  );
12624
12900
  return new _ClaudecodeLegacyRule({
12625
12901
  baseDir,
@@ -12633,8 +12909,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12633
12909
  if (!paths.nonRoot) {
12634
12910
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12635
12911
  }
12636
- const relativePath = (0, import_node_path94.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12637
- const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
12912
+ const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12913
+ const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
12638
12914
  return new _ClaudecodeLegacyRule({
12639
12915
  baseDir,
12640
12916
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12693,10 +12969,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12693
12969
  };
12694
12970
 
12695
12971
  // src/features/rules/claudecode-rule.ts
12696
- var import_node_path95 = require("path");
12697
- var import_mini48 = require("zod/mini");
12698
- var ClaudecodeRuleFrontmatterSchema = import_mini48.z.object({
12699
- paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12972
+ var import_node_path96 = require("path");
12973
+ var import_mini49 = require("zod/mini");
12974
+ var ClaudecodeRuleFrontmatterSchema = import_mini49.z.object({
12975
+ paths: import_mini49.z.optional(import_mini49.z.array(import_mini49.z.string()))
12700
12976
  });
12701
12977
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12702
12978
  frontmatter;
@@ -12728,7 +13004,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12728
13004
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12729
13005
  if (!result.success) {
12730
13006
  throw new Error(
12731
- `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13007
+ `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12732
13008
  );
12733
13009
  }
12734
13010
  }
@@ -12756,7 +13032,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12756
13032
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
12757
13033
  if (isRoot) {
12758
13034
  const fileContent2 = await readFileContent(
12759
- (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
13035
+ (0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
12760
13036
  );
12761
13037
  return new _ClaudecodeRule({
12762
13038
  baseDir,
@@ -12771,16 +13047,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12771
13047
  if (!paths.nonRoot) {
12772
13048
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12773
13049
  }
12774
- const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12775
- const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
13050
+ const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13051
+ const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
12776
13052
  const { frontmatter, body: content } = parseFrontmatter(
12777
13053
  fileContent,
12778
- (0, import_node_path95.join)(baseDir, relativePath)
13054
+ (0, import_node_path96.join)(baseDir, relativePath)
12779
13055
  );
12780
13056
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12781
13057
  if (!result.success) {
12782
13058
  throw new Error(
12783
- `Invalid frontmatter in ${(0, import_node_path95.join)(baseDir, relativePath)}: ${formatError(result.error)}`
13059
+ `Invalid frontmatter in ${(0, import_node_path96.join)(baseDir, relativePath)}: ${formatError(result.error)}`
12784
13060
  );
12785
13061
  }
12786
13062
  return new _ClaudecodeRule({
@@ -12887,7 +13163,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12887
13163
  return {
12888
13164
  success: false,
12889
13165
  error: new Error(
12890
- `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13166
+ `Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12891
13167
  )
12892
13168
  };
12893
13169
  }
@@ -12907,10 +13183,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12907
13183
  };
12908
13184
 
12909
13185
  // src/features/rules/cline-rule.ts
12910
- var import_node_path96 = require("path");
12911
- var import_mini49 = require("zod/mini");
12912
- var ClineRuleFrontmatterSchema = import_mini49.z.object({
12913
- description: import_mini49.z.string()
13186
+ var import_node_path97 = require("path");
13187
+ var import_mini50 = require("zod/mini");
13188
+ var ClineRuleFrontmatterSchema = import_mini50.z.object({
13189
+ description: import_mini50.z.string()
12914
13190
  });
12915
13191
  var ClineRule = class _ClineRule extends ToolRule {
12916
13192
  static getSettablePaths(_options = {}) {
@@ -12953,7 +13229,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12953
13229
  validate = true
12954
13230
  }) {
12955
13231
  const fileContent = await readFileContent(
12956
- (0, import_node_path96.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13232
+ (0, import_node_path97.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
12957
13233
  );
12958
13234
  return new _ClineRule({
12959
13235
  baseDir,
@@ -12979,7 +13255,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12979
13255
  };
12980
13256
 
12981
13257
  // src/features/rules/codexcli-rule.ts
12982
- var import_node_path97 = require("path");
13258
+ var import_node_path98 = require("path");
12983
13259
  var CodexcliRule = class _CodexcliRule extends ToolRule {
12984
13260
  static getSettablePaths({
12985
13261
  global,
@@ -13014,7 +13290,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13014
13290
  if (isRoot) {
13015
13291
  const relativePath2 = paths.root.relativeFilePath;
13016
13292
  const fileContent2 = await readFileContent(
13017
- (0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13293
+ (0, import_node_path98.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13018
13294
  );
13019
13295
  return new _CodexcliRule({
13020
13296
  baseDir,
@@ -13028,8 +13304,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13028
13304
  if (!paths.nonRoot) {
13029
13305
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13030
13306
  }
13031
- const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13032
- const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
13307
+ const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13308
+ const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13033
13309
  return new _CodexcliRule({
13034
13310
  baseDir,
13035
13311
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13088,12 +13364,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13088
13364
  };
13089
13365
 
13090
13366
  // src/features/rules/copilot-rule.ts
13091
- var import_node_path98 = require("path");
13092
- var import_mini50 = require("zod/mini");
13093
- var CopilotRuleFrontmatterSchema = import_mini50.z.object({
13094
- description: import_mini50.z.optional(import_mini50.z.string()),
13095
- applyTo: import_mini50.z.optional(import_mini50.z.string()),
13096
- excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
13367
+ var import_node_path99 = require("path");
13368
+ var import_mini51 = require("zod/mini");
13369
+ var CopilotRuleFrontmatterSchema = import_mini51.z.object({
13370
+ description: import_mini51.z.optional(import_mini51.z.string()),
13371
+ applyTo: import_mini51.z.optional(import_mini51.z.string()),
13372
+ excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
13097
13373
  });
13098
13374
  var CopilotRule = class _CopilotRule extends ToolRule {
13099
13375
  frontmatter;
@@ -13122,7 +13398,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13122
13398
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13123
13399
  if (!result.success) {
13124
13400
  throw new Error(
13125
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13401
+ `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13126
13402
  );
13127
13403
  }
13128
13404
  }
@@ -13212,8 +13488,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13212
13488
  const paths = this.getSettablePaths({ global });
13213
13489
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13214
13490
  if (isRoot) {
13215
- const relativePath2 = (0, import_node_path98.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13216
- const fileContent2 = await readFileContent((0, import_node_path98.join)(baseDir, relativePath2));
13491
+ const relativePath2 = (0, import_node_path99.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13492
+ const fileContent2 = await readFileContent((0, import_node_path99.join)(baseDir, relativePath2));
13217
13493
  return new _CopilotRule({
13218
13494
  baseDir,
13219
13495
  relativeDirPath: paths.root.relativeDirPath,
@@ -13227,16 +13503,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13227
13503
  if (!paths.nonRoot) {
13228
13504
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13229
13505
  }
13230
- const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13231
- const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13506
+ const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13507
+ const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13232
13508
  const { frontmatter, body: content } = parseFrontmatter(
13233
13509
  fileContent,
13234
- (0, import_node_path98.join)(baseDir, relativePath)
13510
+ (0, import_node_path99.join)(baseDir, relativePath)
13235
13511
  );
13236
13512
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13237
13513
  if (!result.success) {
13238
13514
  throw new Error(
13239
- `Invalid frontmatter in ${(0, import_node_path98.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13515
+ `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13240
13516
  );
13241
13517
  }
13242
13518
  return new _CopilotRule({
@@ -13278,7 +13554,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13278
13554
  return {
13279
13555
  success: false,
13280
13556
  error: new Error(
13281
- `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13557
+ `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13282
13558
  )
13283
13559
  };
13284
13560
  }
@@ -13298,12 +13574,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13298
13574
  };
13299
13575
 
13300
13576
  // src/features/rules/cursor-rule.ts
13301
- var import_node_path99 = require("path");
13302
- var import_mini51 = require("zod/mini");
13303
- var CursorRuleFrontmatterSchema = import_mini51.z.object({
13304
- description: import_mini51.z.optional(import_mini51.z.string()),
13305
- globs: import_mini51.z.optional(import_mini51.z.string()),
13306
- alwaysApply: import_mini51.z.optional(import_mini51.z.boolean())
13577
+ var import_node_path100 = require("path");
13578
+ var import_mini52 = require("zod/mini");
13579
+ var CursorRuleFrontmatterSchema = import_mini52.z.object({
13580
+ description: import_mini52.z.optional(import_mini52.z.string()),
13581
+ globs: import_mini52.z.optional(import_mini52.z.string()),
13582
+ alwaysApply: import_mini52.z.optional(import_mini52.z.boolean())
13307
13583
  });
13308
13584
  var CursorRule = class _CursorRule extends ToolRule {
13309
13585
  frontmatter;
@@ -13320,7 +13596,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13320
13596
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13321
13597
  if (!result.success) {
13322
13598
  throw new Error(
13323
- `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13599
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13324
13600
  );
13325
13601
  }
13326
13602
  }
@@ -13436,7 +13712,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13436
13712
  relativeFilePath,
13437
13713
  validate = true
13438
13714
  }) {
13439
- const filePath = (0, import_node_path99.join)(
13715
+ const filePath = (0, import_node_path100.join)(
13440
13716
  baseDir,
13441
13717
  this.getSettablePaths().nonRoot.relativeDirPath,
13442
13718
  relativeFilePath
@@ -13446,7 +13722,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13446
13722
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13447
13723
  if (!result.success) {
13448
13724
  throw new Error(
13449
- `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13725
+ `Invalid frontmatter in ${(0, import_node_path100.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13450
13726
  );
13451
13727
  }
13452
13728
  return new _CursorRule({
@@ -13483,7 +13759,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13483
13759
  return {
13484
13760
  success: false,
13485
13761
  error: new Error(
13486
- `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13762
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13487
13763
  )
13488
13764
  };
13489
13765
  }
@@ -13503,7 +13779,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13503
13779
  };
13504
13780
 
13505
13781
  // src/features/rules/factorydroid-rule.ts
13506
- var import_node_path100 = require("path");
13782
+ var import_node_path101 = require("path");
13507
13783
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13508
13784
  constructor({ fileContent, root, ...rest }) {
13509
13785
  super({
@@ -13543,8 +13819,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13543
13819
  const paths = this.getSettablePaths({ global });
13544
13820
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13545
13821
  if (isRoot) {
13546
- const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13547
- const fileContent2 = await readFileContent((0, import_node_path100.join)(baseDir, relativePath2));
13822
+ const relativePath2 = (0, import_node_path101.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13823
+ const fileContent2 = await readFileContent((0, import_node_path101.join)(baseDir, relativePath2));
13548
13824
  return new _FactorydroidRule({
13549
13825
  baseDir,
13550
13826
  relativeDirPath: paths.root.relativeDirPath,
@@ -13557,8 +13833,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13557
13833
  if (!paths.nonRoot) {
13558
13834
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13559
13835
  }
13560
- const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13561
- const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13836
+ const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13837
+ const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13562
13838
  return new _FactorydroidRule({
13563
13839
  baseDir,
13564
13840
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13617,7 +13893,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13617
13893
  };
13618
13894
 
13619
13895
  // src/features/rules/geminicli-rule.ts
13620
- var import_node_path101 = require("path");
13896
+ var import_node_path102 = require("path");
13621
13897
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13622
13898
  static getSettablePaths({
13623
13899
  global,
@@ -13652,7 +13928,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13652
13928
  if (isRoot) {
13653
13929
  const relativePath2 = paths.root.relativeFilePath;
13654
13930
  const fileContent2 = await readFileContent(
13655
- (0, import_node_path101.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13931
+ (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13656
13932
  );
13657
13933
  return new _GeminiCliRule({
13658
13934
  baseDir,
@@ -13666,8 +13942,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13666
13942
  if (!paths.nonRoot) {
13667
13943
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13668
13944
  }
13669
- const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13670
- const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13945
+ const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13946
+ const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13671
13947
  return new _GeminiCliRule({
13672
13948
  baseDir,
13673
13949
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13726,7 +14002,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13726
14002
  };
13727
14003
 
13728
14004
  // src/features/rules/goose-rule.ts
13729
- var import_node_path102 = require("path");
14005
+ var import_node_path103 = require("path");
13730
14006
  var GooseRule = class _GooseRule extends ToolRule {
13731
14007
  static getSettablePaths({
13732
14008
  global,
@@ -13761,7 +14037,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13761
14037
  if (isRoot) {
13762
14038
  const relativePath2 = paths.root.relativeFilePath;
13763
14039
  const fileContent2 = await readFileContent(
13764
- (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14040
+ (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13765
14041
  );
13766
14042
  return new _GooseRule({
13767
14043
  baseDir,
@@ -13775,8 +14051,8 @@ var GooseRule = class _GooseRule extends ToolRule {
13775
14051
  if (!paths.nonRoot) {
13776
14052
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13777
14053
  }
13778
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13779
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
14054
+ const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14055
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13780
14056
  return new _GooseRule({
13781
14057
  baseDir,
13782
14058
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13835,7 +14111,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13835
14111
  };
13836
14112
 
13837
14113
  // src/features/rules/junie-rule.ts
13838
- var import_node_path103 = require("path");
14114
+ var import_node_path104 = require("path");
13839
14115
  var JunieRule = class _JunieRule extends ToolRule {
13840
14116
  static getSettablePaths(_options = {}) {
13841
14117
  return {
@@ -13854,8 +14130,8 @@ var JunieRule = class _JunieRule extends ToolRule {
13854
14130
  validate = true
13855
14131
  }) {
13856
14132
  const isRoot = relativeFilePath === "guidelines.md";
13857
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path103.join)(".junie", "memories", relativeFilePath);
13858
- const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
14133
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path104.join)(".junie", "memories", relativeFilePath);
14134
+ const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
13859
14135
  return new _JunieRule({
13860
14136
  baseDir,
13861
14137
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13910,7 +14186,7 @@ var JunieRule = class _JunieRule extends ToolRule {
13910
14186
  };
13911
14187
 
13912
14188
  // src/features/rules/kilo-rule.ts
13913
- var import_node_path104 = require("path");
14189
+ var import_node_path105 = require("path");
13914
14190
  var KiloRule = class _KiloRule extends ToolRule {
13915
14191
  static getSettablePaths(_options = {}) {
13916
14192
  return {
@@ -13925,7 +14201,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13925
14201
  validate = true
13926
14202
  }) {
13927
14203
  const fileContent = await readFileContent(
13928
- (0, import_node_path104.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14204
+ (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13929
14205
  );
13930
14206
  return new _KiloRule({
13931
14207
  baseDir,
@@ -13977,7 +14253,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13977
14253
  };
13978
14254
 
13979
14255
  // src/features/rules/kiro-rule.ts
13980
- var import_node_path105 = require("path");
14256
+ var import_node_path106 = require("path");
13981
14257
  var KiroRule = class _KiroRule extends ToolRule {
13982
14258
  static getSettablePaths(_options = {}) {
13983
14259
  return {
@@ -13992,7 +14268,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13992
14268
  validate = true
13993
14269
  }) {
13994
14270
  const fileContent = await readFileContent(
13995
- (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14271
+ (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13996
14272
  );
13997
14273
  return new _KiroRule({
13998
14274
  baseDir,
@@ -14046,7 +14322,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14046
14322
  };
14047
14323
 
14048
14324
  // src/features/rules/opencode-rule.ts
14049
- var import_node_path106 = require("path");
14325
+ var import_node_path107 = require("path");
14050
14326
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14051
14327
  static getSettablePaths({
14052
14328
  global,
@@ -14081,7 +14357,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14081
14357
  if (isRoot) {
14082
14358
  const relativePath2 = paths.root.relativeFilePath;
14083
14359
  const fileContent2 = await readFileContent(
14084
- (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14360
+ (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14085
14361
  );
14086
14362
  return new _OpenCodeRule({
14087
14363
  baseDir,
@@ -14095,8 +14371,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14095
14371
  if (!paths.nonRoot) {
14096
14372
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14097
14373
  }
14098
- const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14099
- const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14374
+ const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14375
+ const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14100
14376
  return new _OpenCodeRule({
14101
14377
  baseDir,
14102
14378
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14155,7 +14431,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14155
14431
  };
14156
14432
 
14157
14433
  // src/features/rules/qwencode-rule.ts
14158
- var import_node_path107 = require("path");
14434
+ var import_node_path108 = require("path");
14159
14435
  var QwencodeRule = class _QwencodeRule extends ToolRule {
14160
14436
  static getSettablePaths(_options = {}) {
14161
14437
  return {
@@ -14174,8 +14450,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14174
14450
  validate = true
14175
14451
  }) {
14176
14452
  const isRoot = relativeFilePath === "QWEN.md";
14177
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path107.join)(".qwen", "memories", relativeFilePath);
14178
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14453
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path108.join)(".qwen", "memories", relativeFilePath);
14454
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14179
14455
  return new _QwencodeRule({
14180
14456
  baseDir,
14181
14457
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14227,7 +14503,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14227
14503
  };
14228
14504
 
14229
14505
  // src/features/rules/replit-rule.ts
14230
- var import_node_path108 = require("path");
14506
+ var import_node_path109 = require("path");
14231
14507
  var ReplitRule = class _ReplitRule extends ToolRule {
14232
14508
  static getSettablePaths(_options = {}) {
14233
14509
  return {
@@ -14249,7 +14525,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14249
14525
  }
14250
14526
  const relativePath = paths.root.relativeFilePath;
14251
14527
  const fileContent = await readFileContent(
14252
- (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath)
14528
+ (0, import_node_path109.join)(baseDir, paths.root.relativeDirPath, relativePath)
14253
14529
  );
14254
14530
  return new _ReplitRule({
14255
14531
  baseDir,
@@ -14315,7 +14591,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14315
14591
  };
14316
14592
 
14317
14593
  // src/features/rules/roo-rule.ts
14318
- var import_node_path109 = require("path");
14594
+ var import_node_path110 = require("path");
14319
14595
  var RooRule = class _RooRule extends ToolRule {
14320
14596
  static getSettablePaths(_options = {}) {
14321
14597
  return {
@@ -14330,7 +14606,7 @@ var RooRule = class _RooRule extends ToolRule {
14330
14606
  validate = true
14331
14607
  }) {
14332
14608
  const fileContent = await readFileContent(
14333
- (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14609
+ (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14334
14610
  );
14335
14611
  return new _RooRule({
14336
14612
  baseDir,
@@ -14399,7 +14675,7 @@ var RooRule = class _RooRule extends ToolRule {
14399
14675
  };
14400
14676
 
14401
14677
  // src/features/rules/warp-rule.ts
14402
- var import_node_path110 = require("path");
14678
+ var import_node_path111 = require("path");
14403
14679
  var WarpRule = class _WarpRule extends ToolRule {
14404
14680
  constructor({ fileContent, root, ...rest }) {
14405
14681
  super({
@@ -14425,8 +14701,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14425
14701
  validate = true
14426
14702
  }) {
14427
14703
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14428
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path110.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14429
- const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
14704
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path111.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14705
+ const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
14430
14706
  return new _WarpRule({
14431
14707
  baseDir,
14432
14708
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14481,7 +14757,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14481
14757
  };
14482
14758
 
14483
14759
  // src/features/rules/windsurf-rule.ts
14484
- var import_node_path111 = require("path");
14760
+ var import_node_path112 = require("path");
14485
14761
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14486
14762
  static getSettablePaths(_options = {}) {
14487
14763
  return {
@@ -14496,7 +14772,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14496
14772
  validate = true
14497
14773
  }) {
14498
14774
  const fileContent = await readFileContent(
14499
- (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14775
+ (0, import_node_path112.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14500
14776
  );
14501
14777
  return new _WindsurfRule({
14502
14778
  baseDir,
@@ -14572,8 +14848,8 @@ var rulesProcessorToolTargets = [
14572
14848
  "warp",
14573
14849
  "windsurf"
14574
14850
  ];
14575
- var RulesProcessorToolTargetSchema = import_mini52.z.enum(rulesProcessorToolTargets);
14576
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path112.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14851
+ var RulesProcessorToolTargetSchema = import_mini53.z.enum(rulesProcessorToolTargets);
14852
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path113.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14577
14853
  var toolRuleFactories = /* @__PURE__ */ new Map([
14578
14854
  [
14579
14855
  "agentsmd",
@@ -14948,7 +15224,7 @@ var RulesProcessor = class extends FeatureProcessor {
14948
15224
  }).relativeDirPath;
14949
15225
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
14950
15226
  const frontmatter = skill.getFrontmatter();
14951
- const relativePath = (0, import_node_path112.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15227
+ const relativePath = (0, import_node_path113.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14952
15228
  return {
14953
15229
  name: frontmatter.name,
14954
15230
  description: frontmatter.description,
@@ -15061,12 +15337,12 @@ var RulesProcessor = class extends FeatureProcessor {
15061
15337
  * Load and parse rulesync rule files from .rulesync/rules/ directory
15062
15338
  */
15063
15339
  async loadRulesyncFiles() {
15064
- const rulesyncBaseDir = (0, import_node_path112.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15065
- const files = await findFilesByGlobs((0, import_node_path112.join)(rulesyncBaseDir, "**", "*.md"));
15340
+ const rulesyncBaseDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15341
+ const files = await findFilesByGlobs((0, import_node_path113.join)(rulesyncBaseDir, "**", "*.md"));
15066
15342
  logger.debug(`Found ${files.length} rulesync files`);
15067
15343
  const rulesyncRules = await Promise.all(
15068
15344
  files.map((file) => {
15069
- const relativeFilePath = (0, import_node_path112.relative)(rulesyncBaseDir, file);
15345
+ const relativeFilePath = (0, import_node_path113.relative)(rulesyncBaseDir, file);
15070
15346
  checkPathTraversal({
15071
15347
  relativePath: relativeFilePath,
15072
15348
  intendedRootDir: rulesyncBaseDir
@@ -15129,7 +15405,7 @@ var RulesProcessor = class extends FeatureProcessor {
15129
15405
  return [];
15130
15406
  }
15131
15407
  const rootFilePaths = await findFilesByGlobs(
15132
- (0, import_node_path112.join)(
15408
+ (0, import_node_path113.join)(
15133
15409
  this.baseDir,
15134
15410
  settablePaths.root.relativeDirPath ?? ".",
15135
15411
  settablePaths.root.relativeFilePath
@@ -15140,7 +15416,7 @@ var RulesProcessor = class extends FeatureProcessor {
15140
15416
  (filePath) => factory.class.forDeletion({
15141
15417
  baseDir: this.baseDir,
15142
15418
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15143
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15419
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15144
15420
  global: this.global
15145
15421
  })
15146
15422
  ).filter((rule) => rule.isDeletable());
@@ -15149,7 +15425,7 @@ var RulesProcessor = class extends FeatureProcessor {
15149
15425
  rootFilePaths.map(
15150
15426
  (filePath) => factory.class.fromFile({
15151
15427
  baseDir: this.baseDir,
15152
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15428
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15153
15429
  global: this.global
15154
15430
  })
15155
15431
  )
@@ -15167,13 +15443,13 @@ var RulesProcessor = class extends FeatureProcessor {
15167
15443
  return [];
15168
15444
  }
15169
15445
  const localRootFilePaths = await findFilesByGlobs(
15170
- (0, import_node_path112.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15446
+ (0, import_node_path113.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15171
15447
  );
15172
15448
  return localRootFilePaths.map(
15173
15449
  (filePath) => factory.class.forDeletion({
15174
15450
  baseDir: this.baseDir,
15175
15451
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15176
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15452
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15177
15453
  global: this.global
15178
15454
  })
15179
15455
  ).filter((rule) => rule.isDeletable());
@@ -15183,13 +15459,13 @@ var RulesProcessor = class extends FeatureProcessor {
15183
15459
  if (!settablePaths.nonRoot) {
15184
15460
  return [];
15185
15461
  }
15186
- const nonRootBaseDir = (0, import_node_path112.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15462
+ const nonRootBaseDir = (0, import_node_path113.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15187
15463
  const nonRootFilePaths = await findFilesByGlobs(
15188
- (0, import_node_path112.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15464
+ (0, import_node_path113.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15189
15465
  );
15190
15466
  if (forDeletion) {
15191
15467
  return nonRootFilePaths.map((filePath) => {
15192
- const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
15468
+ const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15193
15469
  checkPathTraversal({
15194
15470
  relativePath: relativeFilePath,
15195
15471
  intendedRootDir: nonRootBaseDir
@@ -15204,7 +15480,7 @@ var RulesProcessor = class extends FeatureProcessor {
15204
15480
  }
15205
15481
  return await Promise.all(
15206
15482
  nonRootFilePaths.map((filePath) => {
15207
- const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
15483
+ const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15208
15484
  checkPathTraversal({
15209
15485
  relativePath: relativeFilePath,
15210
15486
  intendedRootDir: nonRootBaseDir
@@ -15317,14 +15593,14 @@ s/<command> [arguments]
15317
15593
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15318
15594
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15319
15595
 
15320
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15596
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15321
15597
  const subagentsSection = subagents ? `## Simulated Subagents
15322
15598
 
15323
15599
  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.
15324
15600
 
15325
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15601
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15326
15602
 
15327
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15603
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15328
15604
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15329
15605
  const result = [
15330
15606
  overview,
@@ -15396,7 +15672,7 @@ async function processEmptyFeatureGeneration(params) {
15396
15672
  return { count: totalCount, paths: [], hasDiff };
15397
15673
  }
15398
15674
  async function checkRulesyncDirExists(params) {
15399
- return fileExists((0, import_node_path113.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15675
+ return fileExists((0, import_node_path114.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15400
15676
  }
15401
15677
  async function generate(params) {
15402
15678
  const { config } = params;