rulesync 7.10.0 → 7.11.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.
@@ -128,7 +128,7 @@ var Logger = class {
128
128
  var logger = new Logger();
129
129
 
130
130
  // src/lib/fetch.ts
131
- var import_node_path113 = require("path");
131
+ var import_node_path114 = require("path");
132
132
  var import_promise = require("es-toolkit/promise");
133
133
 
134
134
  // src/constants/rulesync-paths.ts
@@ -2726,7 +2726,7 @@ var CommandsProcessor = class extends FeatureProcessor {
2726
2726
  };
2727
2727
 
2728
2728
  // src/features/hooks/hooks-processor.ts
2729
- var import_mini15 = require("zod/mini");
2729
+ var import_mini16 = require("zod/mini");
2730
2730
 
2731
2731
  // src/types/hooks.ts
2732
2732
  var import_mini13 = require("zod/mini");
@@ -2745,7 +2745,9 @@ var HookDefinitionSchema = import_mini13.z.looseObject({
2745
2745
  timeout: import_mini13.z.optional(import_mini13.z.number()),
2746
2746
  matcher: import_mini13.z.optional(safeString),
2747
2747
  prompt: import_mini13.z.optional(import_mini13.z.string()),
2748
- loop_limit: import_mini13.z.optional(import_mini13.z.nullable(import_mini13.z.number()))
2748
+ loop_limit: import_mini13.z.optional(import_mini13.z.nullable(import_mini13.z.number())),
2749
+ name: import_mini13.z.optional(safeString),
2750
+ description: import_mini13.z.optional(safeString)
2749
2751
  });
2750
2752
  var CURSOR_HOOK_EVENTS = [
2751
2753
  "sessionStart",
@@ -2812,6 +2814,19 @@ var FACTORYDROID_HOOK_EVENTS = [
2812
2814
  "notification",
2813
2815
  "setup"
2814
2816
  ];
2817
+ var GEMINICLI_HOOK_EVENTS = [
2818
+ "sessionStart",
2819
+ "sessionEnd",
2820
+ "beforeSubmitPrompt",
2821
+ "stop",
2822
+ "beforeAgentResponse",
2823
+ "afterAgentResponse",
2824
+ "beforeToolSelection",
2825
+ "preToolUse",
2826
+ "postToolUse",
2827
+ "preCompact",
2828
+ "notification"
2829
+ ];
2815
2830
  var hooksRecordSchema = import_mini13.z.record(import_mini13.z.string(), import_mini13.z.array(HookDefinitionSchema));
2816
2831
  var HooksConfigSchema = import_mini13.z.looseObject({
2817
2832
  version: import_mini13.z.optional(import_mini13.z.number()),
@@ -2820,7 +2835,8 @@ var HooksConfigSchema = import_mini13.z.looseObject({
2820
2835
  claudecode: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2821
2836
  copilot: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2822
2837
  opencode: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2823
- factorydroid: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) }))
2838
+ factorydroid: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2839
+ geminicli: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) }))
2824
2840
  });
2825
2841
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
2826
2842
  sessionStart: "SessionStart",
@@ -2899,6 +2915,22 @@ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
2899
2915
  var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
2900
2916
  Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
2901
2917
  );
2918
+ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
2919
+ sessionStart: "SessionStart",
2920
+ sessionEnd: "SessionEnd",
2921
+ beforeSubmitPrompt: "BeforeAgent",
2922
+ stop: "AfterAgent",
2923
+ beforeAgentResponse: "BeforeModel",
2924
+ afterAgentResponse: "AfterModel",
2925
+ beforeToolSelection: "BeforeToolSelection",
2926
+ preToolUse: "BeforeTool",
2927
+ postToolUse: "AfterTool",
2928
+ preCompact: "PreCompress",
2929
+ notification: "Notification"
2930
+ };
2931
+ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
2932
+ Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
2933
+ );
2902
2934
 
2903
2935
  // src/features/hooks/claudecode-hooks.ts
2904
2936
  var import_node_path21 = require("path");
@@ -3185,6 +3217,7 @@ var CopilotHookEntrySchema = import_mini14.z.looseObject({
3185
3217
  timeoutSec: import_mini14.z.optional(import_mini14.z.number())
3186
3218
  });
3187
3219
  function canonicalToCopilotHooks(config) {
3220
+ const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
3188
3221
  const isWindows = process.platform === "win32";
3189
3222
  const commandField = isWindows ? "powershell" : "bash";
3190
3223
  const supported = new Set(COPILOT_HOOK_EVENTS);
@@ -3209,9 +3242,7 @@ function canonicalToCopilotHooks(config) {
3209
3242
  const command = def.command;
3210
3243
  const timeout = def.timeout;
3211
3244
  const rest = Object.fromEntries(
3212
- Object.entries(def).filter(
3213
- ([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
3214
- )
3245
+ Object.entries(def).filter(([k]) => !canonicalSchemaKeys.includes(k))
3215
3246
  );
3216
3247
  entries.push({
3217
3248
  type: hookType,
@@ -3404,7 +3435,14 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3404
3435
  const mappedHooks = {};
3405
3436
  for (const [eventName, defs] of Object.entries(mergedHooks)) {
3406
3437
  const cursorEventName = CANONICAL_TO_CURSOR_EVENT_NAMES[eventName] ?? eventName;
3407
- mappedHooks[cursorEventName] = defs;
3438
+ mappedHooks[cursorEventName] = defs.map((def) => ({
3439
+ ...def.type !== void 0 && def.type !== null && { type: def.type },
3440
+ ...def.command !== void 0 && def.command !== null && { command: def.command },
3441
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
3442
+ ...def.loop_limit !== void 0 && { loop_limit: def.loop_limit },
3443
+ ...def.matcher !== void 0 && def.matcher !== null && { matcher: def.matcher },
3444
+ ...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
3445
+ }));
3408
3446
  }
3409
3447
  const cursorConfig = {
3410
3448
  version: config.version ?? 1,
@@ -3637,8 +3675,193 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3637
3675
  }
3638
3676
  };
3639
3677
 
3640
- // src/features/hooks/opencode-hooks.ts
3678
+ // src/features/hooks/geminicli-hooks.ts
3641
3679
  var import_node_path25 = require("path");
3680
+ var import_mini15 = require("zod/mini");
3681
+ function canonicalToGeminicliHooks(config) {
3682
+ const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
3683
+ const sharedHooks = {};
3684
+ for (const [event, defs] of Object.entries(config.hooks)) {
3685
+ if (geminiSupported.has(event)) {
3686
+ sharedHooks[event] = defs;
3687
+ }
3688
+ }
3689
+ const effectiveHooks = {
3690
+ ...sharedHooks,
3691
+ ...config.geminicli?.hooks
3692
+ };
3693
+ const gemini = {};
3694
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3695
+ const geminiEventName = CANONICAL_TO_GEMINICLI_EVENT_NAMES[eventName] ?? eventName;
3696
+ const byMatcher = /* @__PURE__ */ new Map();
3697
+ for (const def of definitions) {
3698
+ const key = def.matcher ?? "";
3699
+ const list = byMatcher.get(key);
3700
+ if (list) list.push(def);
3701
+ else byMatcher.set(key, [def]);
3702
+ }
3703
+ const entries = [];
3704
+ for (const [matcherKey, defs] of byMatcher) {
3705
+ const hooks = defs.map((def) => {
3706
+ const command = def.command !== void 0 && def.command !== null && !def.command.startsWith("$") ? `$GEMINI_PROJECT_DIR/${def.command.replace(/^\.\//, "")}` : def.command;
3707
+ return {
3708
+ type: def.type ?? "command",
3709
+ ...command !== void 0 && command !== null && { command },
3710
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
3711
+ ...def.name !== void 0 && def.name !== null && { name: def.name },
3712
+ ...def.description !== void 0 && def.description !== null && { description: def.description }
3713
+ };
3714
+ });
3715
+ entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
3716
+ }
3717
+ gemini[geminiEventName] = entries;
3718
+ }
3719
+ return gemini;
3720
+ }
3721
+ var GeminiHookEntrySchema = import_mini15.z.looseObject({
3722
+ type: import_mini15.z.optional(import_mini15.z.string()),
3723
+ command: import_mini15.z.optional(import_mini15.z.string()),
3724
+ timeout: import_mini15.z.optional(import_mini15.z.number()),
3725
+ name: import_mini15.z.optional(import_mini15.z.string()),
3726
+ description: import_mini15.z.optional(import_mini15.z.string())
3727
+ });
3728
+ var GeminiMatcherEntrySchema = import_mini15.z.looseObject({
3729
+ matcher: import_mini15.z.optional(import_mini15.z.string()),
3730
+ hooks: import_mini15.z.optional(import_mini15.z.array(GeminiHookEntrySchema))
3731
+ });
3732
+ function geminiHooksToCanonical(geminiHooks) {
3733
+ if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
3734
+ return {};
3735
+ }
3736
+ const canonical = {};
3737
+ for (const [geminiEventName, matcherEntries] of Object.entries(geminiHooks)) {
3738
+ const eventName = GEMINICLI_TO_CANONICAL_EVENT_NAMES[geminiEventName] ?? geminiEventName;
3739
+ if (!Array.isArray(matcherEntries)) continue;
3740
+ const defs = [];
3741
+ for (const rawEntry of matcherEntries) {
3742
+ const parseResult = GeminiMatcherEntrySchema.safeParse(rawEntry);
3743
+ if (!parseResult.success) continue;
3744
+ const entry = parseResult.data;
3745
+ const hooks = entry.hooks ?? [];
3746
+ for (const h of hooks) {
3747
+ const cmd = h.command;
3748
+ const command = typeof cmd === "string" && cmd.startsWith("$GEMINI_PROJECT_DIR/") ? cmd.replace(/^\$GEMINI_PROJECT_DIR\/?/, "./") : cmd;
3749
+ const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
3750
+ defs.push({
3751
+ type: hookType,
3752
+ ...command !== void 0 && command !== null && { command },
3753
+ ...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
3754
+ ...h.name !== void 0 && h.name !== null && { name: h.name },
3755
+ ...h.description !== void 0 && h.description !== null && { description: h.description },
3756
+ ...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
3757
+ });
3758
+ }
3759
+ }
3760
+ if (defs.length > 0) {
3761
+ canonical[eventName] = defs;
3762
+ }
3763
+ }
3764
+ return canonical;
3765
+ }
3766
+ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
3767
+ constructor(params) {
3768
+ super({
3769
+ ...params,
3770
+ fileContent: params.fileContent ?? "{}"
3771
+ });
3772
+ }
3773
+ isDeletable() {
3774
+ return false;
3775
+ }
3776
+ static getSettablePaths(_options = {}) {
3777
+ return { relativeDirPath: ".gemini", relativeFilePath: "settings.json" };
3778
+ }
3779
+ static async fromFile({
3780
+ baseDir = process.cwd(),
3781
+ validate = true,
3782
+ global = false
3783
+ }) {
3784
+ const paths = _GeminicliHooks.getSettablePaths({ global });
3785
+ const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3786
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3787
+ return new _GeminicliHooks({
3788
+ baseDir,
3789
+ relativeDirPath: paths.relativeDirPath,
3790
+ relativeFilePath: paths.relativeFilePath,
3791
+ fileContent,
3792
+ validate
3793
+ });
3794
+ }
3795
+ static async fromRulesyncHooks({
3796
+ baseDir = process.cwd(),
3797
+ rulesyncHooks,
3798
+ validate = true,
3799
+ global = false
3800
+ }) {
3801
+ const paths = _GeminicliHooks.getSettablePaths({ global });
3802
+ const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3803
+ const existingContent = await readOrInitializeFileContent(
3804
+ filePath,
3805
+ JSON.stringify({}, null, 2)
3806
+ );
3807
+ let settings;
3808
+ try {
3809
+ settings = JSON.parse(existingContent);
3810
+ } catch (error) {
3811
+ throw new Error(
3812
+ `Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(error)}`,
3813
+ { cause: error }
3814
+ );
3815
+ }
3816
+ const config = rulesyncHooks.getJson();
3817
+ const geminiHooks = canonicalToGeminicliHooks(config);
3818
+ const merged = { ...settings, hooks: geminiHooks };
3819
+ const fileContent = JSON.stringify(merged, null, 2);
3820
+ return new _GeminicliHooks({
3821
+ baseDir,
3822
+ relativeDirPath: paths.relativeDirPath,
3823
+ relativeFilePath: paths.relativeFilePath,
3824
+ fileContent,
3825
+ validate
3826
+ });
3827
+ }
3828
+ toRulesyncHooks() {
3829
+ let settings;
3830
+ try {
3831
+ settings = JSON.parse(this.getFileContent());
3832
+ } catch (error) {
3833
+ throw new Error(
3834
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3835
+ {
3836
+ cause: error
3837
+ }
3838
+ );
3839
+ }
3840
+ const hooks = geminiHooksToCanonical(settings.hooks);
3841
+ return this.toRulesyncHooksDefault({
3842
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
3843
+ });
3844
+ }
3845
+ validate() {
3846
+ return { success: true, error: null };
3847
+ }
3848
+ static forDeletion({
3849
+ baseDir = process.cwd(),
3850
+ relativeDirPath,
3851
+ relativeFilePath
3852
+ }) {
3853
+ return new _GeminicliHooks({
3854
+ baseDir,
3855
+ relativeDirPath,
3856
+ relativeFilePath,
3857
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
3858
+ validate: false
3859
+ });
3860
+ }
3861
+ };
3862
+
3863
+ // src/features/hooks/opencode-hooks.ts
3864
+ var import_node_path26 = require("path");
3642
3865
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
3643
3866
  function escapeForTemplateLiteral(command) {
3644
3867
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -3736,7 +3959,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3736
3959
  }
3737
3960
  static getSettablePaths(options) {
3738
3961
  return {
3739
- relativeDirPath: options?.global ? (0, import_node_path25.join)(".config", "opencode", "plugins") : (0, import_node_path25.join)(".opencode", "plugins"),
3962
+ relativeDirPath: options?.global ? (0, import_node_path26.join)(".config", "opencode", "plugins") : (0, import_node_path26.join)(".opencode", "plugins"),
3740
3963
  relativeFilePath: "rulesync-hooks.js"
3741
3964
  };
3742
3965
  }
@@ -3747,7 +3970,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3747
3970
  }) {
3748
3971
  const paths = _OpencodeHooks.getSettablePaths({ global });
3749
3972
  const fileContent = await readFileContent(
3750
- (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3973
+ (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3751
3974
  );
3752
3975
  return new _OpencodeHooks({
3753
3976
  baseDir,
@@ -3801,9 +4024,10 @@ var hooksProcessorToolTargetTuple = [
3801
4024
  "claudecode",
3802
4025
  "copilot",
3803
4026
  "opencode",
3804
- "factorydroid"
4027
+ "factorydroid",
4028
+ "geminicli"
3805
4029
  ];
3806
- var HooksProcessorToolTargetSchema = import_mini15.z.enum(hooksProcessorToolTargetTuple);
4030
+ var HooksProcessorToolTargetSchema = import_mini16.z.enum(hooksProcessorToolTargetTuple);
3807
4031
  var toolHooksFactories = /* @__PURE__ */ new Map([
3808
4032
  [
3809
4033
  "cursor",
@@ -3874,6 +4098,16 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
3874
4098
  supportedHookTypes: ["command", "prompt"],
3875
4099
  supportsMatcher: true
3876
4100
  }
4101
+ ],
4102
+ [
4103
+ "geminicli",
4104
+ {
4105
+ class: GeminicliHooks,
4106
+ meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
4107
+ supportedEvents: GEMINICLI_HOOK_EVENTS,
4108
+ supportedHookTypes: ["command"],
4109
+ supportsMatcher: true
4110
+ }
3877
4111
  ]
3878
4112
  ]);
3879
4113
  var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
@@ -4028,13 +4262,13 @@ var HooksProcessor = class extends FeatureProcessor {
4028
4262
  };
4029
4263
 
4030
4264
  // src/features/ignore/ignore-processor.ts
4031
- var import_mini16 = require("zod/mini");
4265
+ var import_mini17 = require("zod/mini");
4032
4266
 
4033
4267
  // src/features/ignore/augmentcode-ignore.ts
4034
- var import_node_path27 = require("path");
4268
+ var import_node_path28 = require("path");
4035
4269
 
4036
4270
  // src/features/ignore/rulesync-ignore.ts
4037
- var import_node_path26 = require("path");
4271
+ var import_node_path27 = require("path");
4038
4272
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4039
4273
  validate() {
4040
4274
  return { success: true, error: null };
@@ -4054,12 +4288,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4054
4288
  static async fromFile() {
4055
4289
  const baseDir = process.cwd();
4056
4290
  const paths = this.getSettablePaths();
4057
- const recommendedPath = (0, import_node_path26.join)(
4291
+ const recommendedPath = (0, import_node_path27.join)(
4058
4292
  baseDir,
4059
4293
  paths.recommended.relativeDirPath,
4060
4294
  paths.recommended.relativeFilePath
4061
4295
  );
4062
- const legacyPath = (0, import_node_path26.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4296
+ const legacyPath = (0, import_node_path27.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4063
4297
  if (await fileExists(recommendedPath)) {
4064
4298
  const fileContent2 = await readFileContent(recommendedPath);
4065
4299
  return new _RulesyncIgnore({
@@ -4175,7 +4409,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4175
4409
  validate = true
4176
4410
  }) {
4177
4411
  const fileContent = await readFileContent(
4178
- (0, import_node_path27.join)(
4412
+ (0, import_node_path28.join)(
4179
4413
  baseDir,
4180
4414
  this.getSettablePaths().relativeDirPath,
4181
4415
  this.getSettablePaths().relativeFilePath
@@ -4205,7 +4439,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4205
4439
  };
4206
4440
 
4207
4441
  // src/features/ignore/claudecode-ignore.ts
4208
- var import_node_path28 = require("path");
4442
+ var import_node_path29 = require("path");
4209
4443
  var import_es_toolkit2 = require("es-toolkit");
4210
4444
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4211
4445
  constructor(params) {
@@ -4248,7 +4482,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4248
4482
  const fileContent = rulesyncIgnore.getFileContent();
4249
4483
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4250
4484
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4251
- const filePath = (0, import_node_path28.join)(
4485
+ const filePath = (0, import_node_path29.join)(
4252
4486
  baseDir,
4253
4487
  this.getSettablePaths().relativeDirPath,
4254
4488
  this.getSettablePaths().relativeFilePath
@@ -4284,7 +4518,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4284
4518
  validate = true
4285
4519
  }) {
4286
4520
  const fileContent = await readFileContent(
4287
- (0, import_node_path28.join)(
4521
+ (0, import_node_path29.join)(
4288
4522
  baseDir,
4289
4523
  this.getSettablePaths().relativeDirPath,
4290
4524
  this.getSettablePaths().relativeFilePath
@@ -4314,7 +4548,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4314
4548
  };
4315
4549
 
4316
4550
  // src/features/ignore/cline-ignore.ts
4317
- var import_node_path29 = require("path");
4551
+ var import_node_path30 = require("path");
4318
4552
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4319
4553
  static getSettablePaths() {
4320
4554
  return {
@@ -4351,7 +4585,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4351
4585
  validate = true
4352
4586
  }) {
4353
4587
  const fileContent = await readFileContent(
4354
- (0, import_node_path29.join)(
4588
+ (0, import_node_path30.join)(
4355
4589
  baseDir,
4356
4590
  this.getSettablePaths().relativeDirPath,
4357
4591
  this.getSettablePaths().relativeFilePath
@@ -4381,7 +4615,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4381
4615
  };
4382
4616
 
4383
4617
  // src/features/ignore/cursor-ignore.ts
4384
- var import_node_path30 = require("path");
4618
+ var import_node_path31 = require("path");
4385
4619
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4386
4620
  static getSettablePaths() {
4387
4621
  return {
@@ -4414,7 +4648,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4414
4648
  validate = true
4415
4649
  }) {
4416
4650
  const fileContent = await readFileContent(
4417
- (0, import_node_path30.join)(
4651
+ (0, import_node_path31.join)(
4418
4652
  baseDir,
4419
4653
  this.getSettablePaths().relativeDirPath,
4420
4654
  this.getSettablePaths().relativeFilePath
@@ -4444,7 +4678,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4444
4678
  };
4445
4679
 
4446
4680
  // src/features/ignore/geminicli-ignore.ts
4447
- var import_node_path31 = require("path");
4681
+ var import_node_path32 = require("path");
4448
4682
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4449
4683
  static getSettablePaths() {
4450
4684
  return {
@@ -4471,7 +4705,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4471
4705
  validate = true
4472
4706
  }) {
4473
4707
  const fileContent = await readFileContent(
4474
- (0, import_node_path31.join)(
4708
+ (0, import_node_path32.join)(
4475
4709
  baseDir,
4476
4710
  this.getSettablePaths().relativeDirPath,
4477
4711
  this.getSettablePaths().relativeFilePath
@@ -4501,7 +4735,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4501
4735
  };
4502
4736
 
4503
4737
  // src/features/ignore/goose-ignore.ts
4504
- var import_node_path32 = require("path");
4738
+ var import_node_path33 = require("path");
4505
4739
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4506
4740
  static getSettablePaths() {
4507
4741
  return {
@@ -4538,7 +4772,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4538
4772
  validate = true
4539
4773
  }) {
4540
4774
  const fileContent = await readFileContent(
4541
- (0, import_node_path32.join)(
4775
+ (0, import_node_path33.join)(
4542
4776
  baseDir,
4543
4777
  this.getSettablePaths().relativeDirPath,
4544
4778
  this.getSettablePaths().relativeFilePath
@@ -4568,7 +4802,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4568
4802
  };
4569
4803
 
4570
4804
  // src/features/ignore/junie-ignore.ts
4571
- var import_node_path33 = require("path");
4805
+ var import_node_path34 = require("path");
4572
4806
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4573
4807
  static getSettablePaths() {
4574
4808
  return {
@@ -4595,7 +4829,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4595
4829
  validate = true
4596
4830
  }) {
4597
4831
  const fileContent = await readFileContent(
4598
- (0, import_node_path33.join)(
4832
+ (0, import_node_path34.join)(
4599
4833
  baseDir,
4600
4834
  this.getSettablePaths().relativeDirPath,
4601
4835
  this.getSettablePaths().relativeFilePath
@@ -4625,7 +4859,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4625
4859
  };
4626
4860
 
4627
4861
  // src/features/ignore/kilo-ignore.ts
4628
- var import_node_path34 = require("path");
4862
+ var import_node_path35 = require("path");
4629
4863
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4630
4864
  static getSettablePaths() {
4631
4865
  return {
@@ -4662,7 +4896,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4662
4896
  validate = true
4663
4897
  }) {
4664
4898
  const fileContent = await readFileContent(
4665
- (0, import_node_path34.join)(
4899
+ (0, import_node_path35.join)(
4666
4900
  baseDir,
4667
4901
  this.getSettablePaths().relativeDirPath,
4668
4902
  this.getSettablePaths().relativeFilePath
@@ -4692,7 +4926,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4692
4926
  };
4693
4927
 
4694
4928
  // src/features/ignore/kiro-ignore.ts
4695
- var import_node_path35 = require("path");
4929
+ var import_node_path36 = require("path");
4696
4930
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4697
4931
  static getSettablePaths() {
4698
4932
  return {
@@ -4719,7 +4953,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4719
4953
  validate = true
4720
4954
  }) {
4721
4955
  const fileContent = await readFileContent(
4722
- (0, import_node_path35.join)(
4956
+ (0, import_node_path36.join)(
4723
4957
  baseDir,
4724
4958
  this.getSettablePaths().relativeDirPath,
4725
4959
  this.getSettablePaths().relativeFilePath
@@ -4749,7 +4983,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4749
4983
  };
4750
4984
 
4751
4985
  // src/features/ignore/qwencode-ignore.ts
4752
- var import_node_path36 = require("path");
4986
+ var import_node_path37 = require("path");
4753
4987
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4754
4988
  static getSettablePaths() {
4755
4989
  return {
@@ -4776,7 +5010,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4776
5010
  validate = true
4777
5011
  }) {
4778
5012
  const fileContent = await readFileContent(
4779
- (0, import_node_path36.join)(
5013
+ (0, import_node_path37.join)(
4780
5014
  baseDir,
4781
5015
  this.getSettablePaths().relativeDirPath,
4782
5016
  this.getSettablePaths().relativeFilePath
@@ -4806,7 +5040,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4806
5040
  };
4807
5041
 
4808
5042
  // src/features/ignore/roo-ignore.ts
4809
- var import_node_path37 = require("path");
5043
+ var import_node_path38 = require("path");
4810
5044
  var RooIgnore = class _RooIgnore extends ToolIgnore {
4811
5045
  static getSettablePaths() {
4812
5046
  return {
@@ -4833,7 +5067,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4833
5067
  validate = true
4834
5068
  }) {
4835
5069
  const fileContent = await readFileContent(
4836
- (0, import_node_path37.join)(
5070
+ (0, import_node_path38.join)(
4837
5071
  baseDir,
4838
5072
  this.getSettablePaths().relativeDirPath,
4839
5073
  this.getSettablePaths().relativeFilePath
@@ -4863,7 +5097,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4863
5097
  };
4864
5098
 
4865
5099
  // src/features/ignore/windsurf-ignore.ts
4866
- var import_node_path38 = require("path");
5100
+ var import_node_path39 = require("path");
4867
5101
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4868
5102
  static getSettablePaths() {
4869
5103
  return {
@@ -4890,7 +5124,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4890
5124
  validate = true
4891
5125
  }) {
4892
5126
  const fileContent = await readFileContent(
4893
- (0, import_node_path38.join)(
5127
+ (0, import_node_path39.join)(
4894
5128
  baseDir,
4895
5129
  this.getSettablePaths().relativeDirPath,
4896
5130
  this.getSettablePaths().relativeFilePath
@@ -4920,7 +5154,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4920
5154
  };
4921
5155
 
4922
5156
  // src/features/ignore/zed-ignore.ts
4923
- var import_node_path39 = require("path");
5157
+ var import_node_path40 = require("path");
4924
5158
  var import_es_toolkit3 = require("es-toolkit");
4925
5159
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4926
5160
  constructor(params) {
@@ -4957,7 +5191,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4957
5191
  }) {
4958
5192
  const fileContent = rulesyncIgnore.getFileContent();
4959
5193
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4960
- const filePath = (0, import_node_path39.join)(
5194
+ const filePath = (0, import_node_path40.join)(
4961
5195
  baseDir,
4962
5196
  this.getSettablePaths().relativeDirPath,
4963
5197
  this.getSettablePaths().relativeFilePath
@@ -4984,7 +5218,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4984
5218
  validate = true
4985
5219
  }) {
4986
5220
  const fileContent = await readFileContent(
4987
- (0, import_node_path39.join)(
5221
+ (0, import_node_path40.join)(
4988
5222
  baseDir,
4989
5223
  this.getSettablePaths().relativeDirPath,
4990
5224
  this.getSettablePaths().relativeFilePath
@@ -5030,7 +5264,7 @@ var ignoreProcessorToolTargets = [
5030
5264
  "windsurf",
5031
5265
  "zed"
5032
5266
  ];
5033
- var IgnoreProcessorToolTargetSchema = import_mini16.z.enum(ignoreProcessorToolTargets);
5267
+ var IgnoreProcessorToolTargetSchema = import_mini17.z.enum(ignoreProcessorToolTargets);
5034
5268
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
5035
5269
  ["augmentcode", { class: AugmentcodeIgnore }],
5036
5270
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -5168,49 +5402,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
5168
5402
  };
5169
5403
 
5170
5404
  // src/features/mcp/mcp-processor.ts
5171
- var import_mini20 = require("zod/mini");
5405
+ var import_mini21 = require("zod/mini");
5172
5406
 
5173
5407
  // src/features/mcp/claudecode-mcp.ts
5174
- var import_node_path41 = require("path");
5408
+ var import_node_path42 = require("path");
5175
5409
 
5176
5410
  // src/features/mcp/rulesync-mcp.ts
5177
- var import_node_path40 = require("path");
5411
+ var import_node_path41 = require("path");
5178
5412
  var import_object = require("es-toolkit/object");
5179
- var import_mini18 = require("zod/mini");
5413
+ var import_mini19 = require("zod/mini");
5180
5414
 
5181
5415
  // src/types/mcp.ts
5182
- var import_mini17 = require("zod/mini");
5183
- var McpServerSchema = import_mini17.z.object({
5184
- type: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5185
- command: import_mini17.z.optional(import_mini17.z.union([import_mini17.z.string(), import_mini17.z.array(import_mini17.z.string())])),
5186
- args: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5187
- url: import_mini17.z.optional(import_mini17.z.string()),
5188
- httpUrl: import_mini17.z.optional(import_mini17.z.string()),
5189
- env: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5190
- disabled: import_mini17.z.optional(import_mini17.z.boolean()),
5191
- networkTimeout: import_mini17.z.optional(import_mini17.z.number()),
5192
- timeout: import_mini17.z.optional(import_mini17.z.number()),
5193
- trust: import_mini17.z.optional(import_mini17.z.boolean()),
5194
- cwd: import_mini17.z.optional(import_mini17.z.string()),
5195
- transport: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5196
- alwaysAllow: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5197
- tools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5198
- kiroAutoApprove: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5199
- kiroAutoBlock: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5200
- headers: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5201
- enabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5202
- disabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
5416
+ var import_mini18 = require("zod/mini");
5417
+ var McpServerSchema = import_mini18.z.object({
5418
+ type: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5419
+ command: import_mini18.z.optional(import_mini18.z.union([import_mini18.z.string(), import_mini18.z.array(import_mini18.z.string())])),
5420
+ args: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5421
+ url: import_mini18.z.optional(import_mini18.z.string()),
5422
+ httpUrl: import_mini18.z.optional(import_mini18.z.string()),
5423
+ env: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5424
+ disabled: import_mini18.z.optional(import_mini18.z.boolean()),
5425
+ networkTimeout: import_mini18.z.optional(import_mini18.z.number()),
5426
+ timeout: import_mini18.z.optional(import_mini18.z.number()),
5427
+ trust: import_mini18.z.optional(import_mini18.z.boolean()),
5428
+ cwd: import_mini18.z.optional(import_mini18.z.string()),
5429
+ transport: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5430
+ alwaysAllow: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5431
+ tools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5432
+ kiroAutoApprove: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5433
+ kiroAutoBlock: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5434
+ headers: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5435
+ enabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5436
+ disabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
5203
5437
  });
5204
- var McpServersSchema = import_mini17.z.record(import_mini17.z.string(), McpServerSchema);
5438
+ var McpServersSchema = import_mini18.z.record(import_mini18.z.string(), McpServerSchema);
5205
5439
 
5206
5440
  // src/features/mcp/rulesync-mcp.ts
5207
- var RulesyncMcpServerSchema = import_mini18.z.extend(McpServerSchema, {
5208
- targets: import_mini18.z.optional(RulesyncTargetsSchema),
5209
- description: import_mini18.z.optional(import_mini18.z.string()),
5210
- exposed: import_mini18.z.optional(import_mini18.z.boolean())
5441
+ var RulesyncMcpServerSchema = import_mini19.z.extend(McpServerSchema, {
5442
+ targets: import_mini19.z.optional(RulesyncTargetsSchema),
5443
+ description: import_mini19.z.optional(import_mini19.z.string()),
5444
+ exposed: import_mini19.z.optional(import_mini19.z.boolean())
5211
5445
  });
5212
- var RulesyncMcpConfigSchema = import_mini18.z.object({
5213
- mcpServers: import_mini18.z.record(import_mini18.z.string(), RulesyncMcpServerSchema)
5446
+ var RulesyncMcpConfigSchema = import_mini19.z.object({
5447
+ mcpServers: import_mini19.z.record(import_mini19.z.string(), RulesyncMcpServerSchema)
5214
5448
  });
5215
5449
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5216
5450
  json;
@@ -5246,12 +5480,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5246
5480
  static async fromFile({ validate = true }) {
5247
5481
  const baseDir = process.cwd();
5248
5482
  const paths = this.getSettablePaths();
5249
- const recommendedPath = (0, import_node_path40.join)(
5483
+ const recommendedPath = (0, import_node_path41.join)(
5250
5484
  baseDir,
5251
5485
  paths.recommended.relativeDirPath,
5252
5486
  paths.recommended.relativeFilePath
5253
5487
  );
5254
- const legacyPath = (0, import_node_path40.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5488
+ const legacyPath = (0, import_node_path41.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5255
5489
  if (await fileExists(recommendedPath)) {
5256
5490
  const fileContent2 = await readFileContent(recommendedPath);
5257
5491
  return new _RulesyncMcp({
@@ -5396,7 +5630,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5396
5630
  global = false
5397
5631
  }) {
5398
5632
  const paths = this.getSettablePaths({ global });
5399
- const fileContent = await readFileContentOrNull((0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5633
+ const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5400
5634
  const json = JSON.parse(fileContent);
5401
5635
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5402
5636
  return new _ClaudecodeMcp({
@@ -5415,7 +5649,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5415
5649
  }) {
5416
5650
  const paths = this.getSettablePaths({ global });
5417
5651
  const fileContent = await readOrInitializeFileContent(
5418
- (0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5652
+ (0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5419
5653
  JSON.stringify({ mcpServers: {} }, null, 2)
5420
5654
  );
5421
5655
  const json = JSON.parse(fileContent);
@@ -5454,7 +5688,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5454
5688
  };
5455
5689
 
5456
5690
  // src/features/mcp/cline-mcp.ts
5457
- var import_node_path42 = require("path");
5691
+ var import_node_path43 = require("path");
5458
5692
  var ClineMcp = class _ClineMcp extends ToolMcp {
5459
5693
  json;
5460
5694
  constructor(params) {
@@ -5475,7 +5709,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5475
5709
  validate = true
5476
5710
  }) {
5477
5711
  const fileContent = await readFileContent(
5478
- (0, import_node_path42.join)(
5712
+ (0, import_node_path43.join)(
5479
5713
  baseDir,
5480
5714
  this.getSettablePaths().relativeDirPath,
5481
5715
  this.getSettablePaths().relativeFilePath
@@ -5524,7 +5758,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5524
5758
  };
5525
5759
 
5526
5760
  // src/features/mcp/codexcli-mcp.ts
5527
- var import_node_path43 = require("path");
5761
+ var import_node_path44 = require("path");
5528
5762
  var smolToml = __toESM(require("smol-toml"), 1);
5529
5763
  function convertFromCodexFormat(codexMcp) {
5530
5764
  const result = {};
@@ -5607,7 +5841,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5607
5841
  global = false
5608
5842
  }) {
5609
5843
  const paths = this.getSettablePaths({ global });
5610
- const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5844
+ const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5611
5845
  return new _CodexcliMcp({
5612
5846
  baseDir,
5613
5847
  relativeDirPath: paths.relativeDirPath,
@@ -5623,7 +5857,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5623
5857
  global = false
5624
5858
  }) {
5625
5859
  const paths = this.getSettablePaths({ global });
5626
- const configTomlFilePath = (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5860
+ const configTomlFilePath = (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5627
5861
  const configTomlFileContent = await readOrInitializeFileContent(
5628
5862
  configTomlFilePath,
5629
5863
  smolToml.stringify({})
@@ -5680,7 +5914,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5680
5914
  };
5681
5915
 
5682
5916
  // src/features/mcp/copilot-mcp.ts
5683
- var import_node_path44 = require("path");
5917
+ var import_node_path45 = require("path");
5684
5918
  function convertToCopilotFormat(mcpServers) {
5685
5919
  return { servers: mcpServers };
5686
5920
  }
@@ -5707,7 +5941,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5707
5941
  validate = true
5708
5942
  }) {
5709
5943
  const fileContent = await readFileContent(
5710
- (0, import_node_path44.join)(
5944
+ (0, import_node_path45.join)(
5711
5945
  baseDir,
5712
5946
  this.getSettablePaths().relativeDirPath,
5713
5947
  this.getSettablePaths().relativeFilePath
@@ -5760,7 +5994,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5760
5994
  };
5761
5995
 
5762
5996
  // src/features/mcp/cursor-mcp.ts
5763
- var import_node_path45 = require("path");
5997
+ var import_node_path46 = require("path");
5764
5998
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
5765
5999
  function isMcpServers(value) {
5766
6000
  return value !== void 0 && value !== null && typeof value === "object";
@@ -5821,7 +6055,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5821
6055
  validate = true
5822
6056
  }) {
5823
6057
  const fileContent = await readFileContent(
5824
- (0, import_node_path45.join)(
6058
+ (0, import_node_path46.join)(
5825
6059
  baseDir,
5826
6060
  this.getSettablePaths().relativeDirPath,
5827
6061
  this.getSettablePaths().relativeFilePath
@@ -5889,7 +6123,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5889
6123
  };
5890
6124
 
5891
6125
  // src/features/mcp/factorydroid-mcp.ts
5892
- var import_node_path46 = require("path");
6126
+ var import_node_path47 = require("path");
5893
6127
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5894
6128
  json;
5895
6129
  constructor(params) {
@@ -5910,7 +6144,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5910
6144
  validate = true
5911
6145
  }) {
5912
6146
  const fileContent = await readFileContent(
5913
- (0, import_node_path46.join)(
6147
+ (0, import_node_path47.join)(
5914
6148
  baseDir,
5915
6149
  this.getSettablePaths().relativeDirPath,
5916
6150
  this.getSettablePaths().relativeFilePath
@@ -5970,7 +6204,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5970
6204
  };
5971
6205
 
5972
6206
  // src/features/mcp/geminicli-mcp.ts
5973
- var import_node_path47 = require("path");
6207
+ var import_node_path48 = require("path");
5974
6208
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5975
6209
  json;
5976
6210
  constructor(params) {
@@ -5998,7 +6232,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5998
6232
  global = false
5999
6233
  }) {
6000
6234
  const paths = this.getSettablePaths({ global });
6001
- const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6235
+ const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6002
6236
  const json = JSON.parse(fileContent);
6003
6237
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6004
6238
  return new _GeminiCliMcp({
@@ -6017,7 +6251,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6017
6251
  }) {
6018
6252
  const paths = this.getSettablePaths({ global });
6019
6253
  const fileContent = await readOrInitializeFileContent(
6020
- (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6254
+ (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6021
6255
  JSON.stringify({ mcpServers: {} }, null, 2)
6022
6256
  );
6023
6257
  const json = JSON.parse(fileContent);
@@ -6062,7 +6296,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6062
6296
  };
6063
6297
 
6064
6298
  // src/features/mcp/junie-mcp.ts
6065
- var import_node_path48 = require("path");
6299
+ var import_node_path49 = require("path");
6066
6300
  var JunieMcp = class _JunieMcp extends ToolMcp {
6067
6301
  json;
6068
6302
  constructor(params) {
@@ -6074,7 +6308,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6074
6308
  }
6075
6309
  static getSettablePaths() {
6076
6310
  return {
6077
- relativeDirPath: (0, import_node_path48.join)(".junie", "mcp"),
6311
+ relativeDirPath: (0, import_node_path49.join)(".junie", "mcp"),
6078
6312
  relativeFilePath: "mcp.json"
6079
6313
  };
6080
6314
  }
@@ -6083,7 +6317,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6083
6317
  validate = true
6084
6318
  }) {
6085
6319
  const fileContent = await readFileContent(
6086
- (0, import_node_path48.join)(
6320
+ (0, import_node_path49.join)(
6087
6321
  baseDir,
6088
6322
  this.getSettablePaths().relativeDirPath,
6089
6323
  this.getSettablePaths().relativeFilePath
@@ -6132,7 +6366,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6132
6366
  };
6133
6367
 
6134
6368
  // src/features/mcp/kilo-mcp.ts
6135
- var import_node_path49 = require("path");
6369
+ var import_node_path50 = require("path");
6136
6370
  var KiloMcp = class _KiloMcp extends ToolMcp {
6137
6371
  json;
6138
6372
  constructor(params) {
@@ -6153,7 +6387,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6153
6387
  validate = true
6154
6388
  }) {
6155
6389
  const paths = this.getSettablePaths();
6156
- const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6390
+ const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6157
6391
  return new _KiloMcp({
6158
6392
  baseDir,
6159
6393
  relativeDirPath: paths.relativeDirPath,
@@ -6201,7 +6435,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6201
6435
  };
6202
6436
 
6203
6437
  // src/features/mcp/kiro-mcp.ts
6204
- var import_node_path50 = require("path");
6438
+ var import_node_path51 = require("path");
6205
6439
  var KiroMcp = class _KiroMcp extends ToolMcp {
6206
6440
  json;
6207
6441
  constructor(params) {
@@ -6213,7 +6447,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6213
6447
  }
6214
6448
  static getSettablePaths() {
6215
6449
  return {
6216
- relativeDirPath: (0, import_node_path50.join)(".kiro", "settings"),
6450
+ relativeDirPath: (0, import_node_path51.join)(".kiro", "settings"),
6217
6451
  relativeFilePath: "mcp.json"
6218
6452
  };
6219
6453
  }
@@ -6222,7 +6456,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6222
6456
  validate = true
6223
6457
  }) {
6224
6458
  const paths = this.getSettablePaths();
6225
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6459
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6226
6460
  return new _KiroMcp({
6227
6461
  baseDir,
6228
6462
  relativeDirPath: paths.relativeDirPath,
@@ -6270,30 +6504,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6270
6504
  };
6271
6505
 
6272
6506
  // src/features/mcp/opencode-mcp.ts
6273
- var import_node_path51 = require("path");
6507
+ var import_node_path52 = require("path");
6274
6508
  var import_jsonc_parser = require("jsonc-parser");
6275
- var import_mini19 = require("zod/mini");
6276
- var OpencodeMcpLocalServerSchema = import_mini19.z.object({
6277
- type: import_mini19.z.literal("local"),
6278
- command: import_mini19.z.array(import_mini19.z.string()),
6279
- environment: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6280
- enabled: import_mini19.z._default(import_mini19.z.boolean(), true),
6281
- cwd: import_mini19.z.optional(import_mini19.z.string())
6509
+ var import_mini20 = require("zod/mini");
6510
+ var OpencodeMcpLocalServerSchema = import_mini20.z.object({
6511
+ type: import_mini20.z.literal("local"),
6512
+ command: import_mini20.z.array(import_mini20.z.string()),
6513
+ environment: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6514
+ enabled: import_mini20.z._default(import_mini20.z.boolean(), true),
6515
+ cwd: import_mini20.z.optional(import_mini20.z.string())
6282
6516
  });
6283
- var OpencodeMcpRemoteServerSchema = import_mini19.z.object({
6284
- type: import_mini19.z.literal("remote"),
6285
- url: import_mini19.z.string(),
6286
- headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6287
- enabled: import_mini19.z._default(import_mini19.z.boolean(), true)
6517
+ var OpencodeMcpRemoteServerSchema = import_mini20.z.object({
6518
+ type: import_mini20.z.literal("remote"),
6519
+ url: import_mini20.z.string(),
6520
+ headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6521
+ enabled: import_mini20.z._default(import_mini20.z.boolean(), true)
6288
6522
  });
6289
- var OpencodeMcpServerSchema = import_mini19.z.union([
6523
+ var OpencodeMcpServerSchema = import_mini20.z.union([
6290
6524
  OpencodeMcpLocalServerSchema,
6291
6525
  OpencodeMcpRemoteServerSchema
6292
6526
  ]);
6293
- var OpencodeConfigSchema = import_mini19.z.looseObject({
6294
- $schema: import_mini19.z.optional(import_mini19.z.string()),
6295
- mcp: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), OpencodeMcpServerSchema)),
6296
- tools: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.boolean()))
6527
+ var OpencodeConfigSchema = import_mini20.z.looseObject({
6528
+ $schema: import_mini20.z.optional(import_mini20.z.string()),
6529
+ mcp: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), OpencodeMcpServerSchema)),
6530
+ tools: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.boolean()))
6297
6531
  });
6298
6532
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6299
6533
  return Object.fromEntries(
@@ -6411,7 +6645,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6411
6645
  static getSettablePaths({ global } = {}) {
6412
6646
  if (global) {
6413
6647
  return {
6414
- relativeDirPath: (0, import_node_path51.join)(".config", "opencode"),
6648
+ relativeDirPath: (0, import_node_path52.join)(".config", "opencode"),
6415
6649
  relativeFilePath: "opencode.json"
6416
6650
  };
6417
6651
  }
@@ -6426,11 +6660,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6426
6660
  global = false
6427
6661
  }) {
6428
6662
  const basePaths = this.getSettablePaths({ global });
6429
- const jsonDir = (0, import_node_path51.join)(baseDir, basePaths.relativeDirPath);
6663
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6430
6664
  let fileContent = null;
6431
6665
  let relativeFilePath = "opencode.jsonc";
6432
- const jsoncPath = (0, import_node_path51.join)(jsonDir, "opencode.jsonc");
6433
- const jsonPath = (0, import_node_path51.join)(jsonDir, "opencode.json");
6666
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6667
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6434
6668
  fileContent = await readFileContentOrNull(jsoncPath);
6435
6669
  if (!fileContent) {
6436
6670
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6456,11 +6690,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6456
6690
  global = false
6457
6691
  }) {
6458
6692
  const basePaths = this.getSettablePaths({ global });
6459
- const jsonDir = (0, import_node_path51.join)(baseDir, basePaths.relativeDirPath);
6693
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6460
6694
  let fileContent = null;
6461
6695
  let relativeFilePath = "opencode.jsonc";
6462
- const jsoncPath = (0, import_node_path51.join)(jsonDir, "opencode.jsonc");
6463
- const jsonPath = (0, import_node_path51.join)(jsonDir, "opencode.json");
6696
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6697
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6464
6698
  fileContent = await readFileContentOrNull(jsoncPath);
6465
6699
  if (!fileContent) {
6466
6700
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6521,7 +6755,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6521
6755
  };
6522
6756
 
6523
6757
  // src/features/mcp/roo-mcp.ts
6524
- var import_node_path52 = require("path");
6758
+ var import_node_path53 = require("path");
6525
6759
  function isRooMcpServers(value) {
6526
6760
  return value !== void 0 && value !== null && typeof value === "object";
6527
6761
  }
@@ -6573,7 +6807,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
6573
6807
  validate = true
6574
6808
  }) {
6575
6809
  const fileContent = await readFileContent(
6576
- (0, import_node_path52.join)(
6810
+ (0, import_node_path53.join)(
6577
6811
  baseDir,
6578
6812
  this.getSettablePaths().relativeDirPath,
6579
6813
  this.getSettablePaths().relativeFilePath
@@ -6644,7 +6878,7 @@ var mcpProcessorToolTargetTuple = [
6644
6878
  "opencode",
6645
6879
  "roo"
6646
6880
  ];
6647
- var McpProcessorToolTargetSchema = import_mini20.z.enum(mcpProcessorToolTargetTuple);
6881
+ var McpProcessorToolTargetSchema = import_mini21.z.enum(mcpProcessorToolTargetTuple);
6648
6882
  var toolMcpFactories = /* @__PURE__ */ new Map([
6649
6883
  [
6650
6884
  "claudecode",
@@ -6946,25 +7180,25 @@ var McpProcessor = class extends FeatureProcessor {
6946
7180
  };
6947
7181
 
6948
7182
  // src/features/rules/rules-processor.ts
6949
- var import_node_path112 = require("path");
7183
+ var import_node_path113 = require("path");
6950
7184
  var import_toon = require("@toon-format/toon");
6951
- var import_mini52 = require("zod/mini");
7185
+ var import_mini53 = require("zod/mini");
6952
7186
 
6953
7187
  // src/constants/general.ts
6954
7188
  var SKILL_FILE_NAME = "SKILL.md";
6955
7189
 
6956
7190
  // src/features/skills/agentsmd-skill.ts
6957
- var import_node_path56 = require("path");
7191
+ var import_node_path57 = require("path");
6958
7192
 
6959
7193
  // src/features/skills/simulated-skill.ts
6960
- var import_node_path55 = require("path");
6961
- var import_mini21 = require("zod/mini");
7194
+ var import_node_path56 = require("path");
7195
+ var import_mini22 = require("zod/mini");
6962
7196
 
6963
7197
  // src/features/skills/tool-skill.ts
6964
- var import_node_path54 = require("path");
7198
+ var import_node_path55 = require("path");
6965
7199
 
6966
7200
  // src/types/ai-dir.ts
6967
- var import_node_path53 = __toESM(require("path"), 1);
7201
+ var import_node_path54 = __toESM(require("path"), 1);
6968
7202
  var AiDir = class {
6969
7203
  /**
6970
7204
  * @example "."
@@ -6998,7 +7232,7 @@ var AiDir = class {
6998
7232
  otherFiles = [],
6999
7233
  global = false
7000
7234
  }) {
7001
- if (dirName.includes(import_node_path53.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7235
+ if (dirName.includes(import_node_path54.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7002
7236
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7003
7237
  }
7004
7238
  this.baseDir = baseDir;
@@ -7021,11 +7255,11 @@ var AiDir = class {
7021
7255
  return this.dirName;
7022
7256
  }
7023
7257
  getDirPath() {
7024
- const fullPath = import_node_path53.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7025
- const resolvedFull = (0, import_node_path53.resolve)(fullPath);
7026
- const resolvedBase = (0, import_node_path53.resolve)(this.baseDir);
7027
- const rel = (0, import_node_path53.relative)(resolvedBase, resolvedFull);
7028
- if (rel.startsWith("..") || import_node_path53.default.isAbsolute(rel)) {
7258
+ const fullPath = import_node_path54.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7259
+ const resolvedFull = (0, import_node_path54.resolve)(fullPath);
7260
+ const resolvedBase = (0, import_node_path54.resolve)(this.baseDir);
7261
+ const rel = (0, import_node_path54.relative)(resolvedBase, resolvedFull);
7262
+ if (rel.startsWith("..") || import_node_path54.default.isAbsolute(rel)) {
7029
7263
  throw new Error(
7030
7264
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7031
7265
  );
@@ -7039,7 +7273,7 @@ var AiDir = class {
7039
7273
  return this.otherFiles;
7040
7274
  }
7041
7275
  getRelativePathFromCwd() {
7042
- return import_node_path53.default.join(this.relativeDirPath, this.dirName);
7276
+ return import_node_path54.default.join(this.relativeDirPath, this.dirName);
7043
7277
  }
7044
7278
  getGlobal() {
7045
7279
  return this.global;
@@ -7058,15 +7292,15 @@ var AiDir = class {
7058
7292
  * @returns Array of files with their relative paths and buffers
7059
7293
  */
7060
7294
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7061
- const dirPath = (0, import_node_path53.join)(baseDir, relativeDirPath, dirName);
7062
- const glob = (0, import_node_path53.join)(dirPath, "**", "*");
7295
+ const dirPath = (0, import_node_path54.join)(baseDir, relativeDirPath, dirName);
7296
+ const glob = (0, import_node_path54.join)(dirPath, "**", "*");
7063
7297
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7064
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path53.basename)(filePath) !== excludeFileName);
7298
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path54.basename)(filePath) !== excludeFileName);
7065
7299
  const files = await Promise.all(
7066
7300
  filteredPaths.map(async (filePath) => {
7067
7301
  const fileBuffer = await readFileBuffer(filePath);
7068
7302
  return {
7069
- relativeFilePathToDirPath: (0, import_node_path53.relative)(dirPath, filePath),
7303
+ relativeFilePathToDirPath: (0, import_node_path54.relative)(dirPath, filePath),
7070
7304
  fileBuffer
7071
7305
  };
7072
7306
  })
@@ -7157,8 +7391,8 @@ var ToolSkill = class extends AiDir {
7157
7391
  }) {
7158
7392
  const settablePaths = getSettablePaths({ global });
7159
7393
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7160
- const skillDirPath = (0, import_node_path54.join)(baseDir, actualRelativeDirPath, dirName);
7161
- const skillFilePath = (0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME);
7394
+ const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7395
+ const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7162
7396
  if (!await fileExists(skillFilePath)) {
7163
7397
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7164
7398
  }
@@ -7182,16 +7416,16 @@ var ToolSkill = class extends AiDir {
7182
7416
  }
7183
7417
  requireMainFileFrontmatter() {
7184
7418
  if (!this.mainFile?.frontmatter) {
7185
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path54.join)(this.relativeDirPath, this.dirName)}`);
7419
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path55.join)(this.relativeDirPath, this.dirName)}`);
7186
7420
  }
7187
7421
  return this.mainFile.frontmatter;
7188
7422
  }
7189
7423
  };
7190
7424
 
7191
7425
  // src/features/skills/simulated-skill.ts
7192
- var SimulatedSkillFrontmatterSchema = import_mini21.z.looseObject({
7193
- name: import_mini21.z.string(),
7194
- description: import_mini21.z.string()
7426
+ var SimulatedSkillFrontmatterSchema = import_mini22.z.looseObject({
7427
+ name: import_mini22.z.string(),
7428
+ description: import_mini22.z.string()
7195
7429
  });
7196
7430
  var SimulatedSkill = class extends ToolSkill {
7197
7431
  frontmatter;
@@ -7222,7 +7456,7 @@ var SimulatedSkill = class extends ToolSkill {
7222
7456
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7223
7457
  if (!result.success) {
7224
7458
  throw new Error(
7225
- `Invalid frontmatter in ${(0, import_node_path55.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7459
+ `Invalid frontmatter in ${(0, import_node_path56.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7226
7460
  );
7227
7461
  }
7228
7462
  }
@@ -7280,8 +7514,8 @@ var SimulatedSkill = class extends ToolSkill {
7280
7514
  }) {
7281
7515
  const settablePaths = this.getSettablePaths();
7282
7516
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7283
- const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7284
- const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7517
+ const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
7518
+ const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
7285
7519
  if (!await fileExists(skillFilePath)) {
7286
7520
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7287
7521
  }
@@ -7358,7 +7592,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7358
7592
  throw new Error("AgentsmdSkill does not support global mode.");
7359
7593
  }
7360
7594
  return {
7361
- relativeDirPath: (0, import_node_path56.join)(".agents", "skills")
7595
+ relativeDirPath: (0, import_node_path57.join)(".agents", "skills")
7362
7596
  };
7363
7597
  }
7364
7598
  static async fromDir(params) {
@@ -7385,11 +7619,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7385
7619
  };
7386
7620
 
7387
7621
  // src/features/skills/factorydroid-skill.ts
7388
- var import_node_path57 = require("path");
7622
+ var import_node_path58 = require("path");
7389
7623
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7390
7624
  static getSettablePaths(_options) {
7391
7625
  return {
7392
- relativeDirPath: (0, import_node_path57.join)(".factory", "skills")
7626
+ relativeDirPath: (0, import_node_path58.join)(".factory", "skills")
7393
7627
  };
7394
7628
  }
7395
7629
  static async fromDir(params) {
@@ -7416,11 +7650,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7416
7650
  };
7417
7651
 
7418
7652
  // src/features/skills/skills-processor.ts
7419
- var import_node_path74 = require("path");
7420
- var import_mini36 = require("zod/mini");
7653
+ var import_node_path75 = require("path");
7654
+ var import_mini37 = require("zod/mini");
7421
7655
 
7422
7656
  // src/types/dir-feature-processor.ts
7423
- var import_node_path58 = require("path");
7657
+ var import_node_path59 = require("path");
7424
7658
  var DirFeatureProcessor = class {
7425
7659
  baseDir;
7426
7660
  dryRun;
@@ -7451,7 +7685,7 @@ var DirFeatureProcessor = class {
7451
7685
  const mainFile = aiDir.getMainFile();
7452
7686
  let mainFileContent;
7453
7687
  if (mainFile) {
7454
- const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7688
+ const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
7455
7689
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7456
7690
  mainFileContent = addTrailingNewline(content);
7457
7691
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7465,7 +7699,7 @@ var DirFeatureProcessor = class {
7465
7699
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7466
7700
  otherFileContents.push(contentWithNewline);
7467
7701
  if (!dirHasChanges) {
7468
- const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7702
+ const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
7469
7703
  const existingContent = await readFileContentOrNull(filePath);
7470
7704
  if (existingContent !== contentWithNewline) {
7471
7705
  dirHasChanges = true;
@@ -7479,22 +7713,22 @@ var DirFeatureProcessor = class {
7479
7713
  if (this.dryRun) {
7480
7714
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7481
7715
  if (mainFile) {
7482
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, mainFile.name)}`);
7483
- changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7716
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, mainFile.name)}`);
7717
+ changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
7484
7718
  }
7485
7719
  for (const file of otherFiles) {
7486
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath)}`);
7487
- changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7720
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath)}`);
7721
+ changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
7488
7722
  }
7489
7723
  } else {
7490
7724
  await ensureDir(dirPath);
7491
7725
  if (mainFile && mainFileContent) {
7492
- const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7726
+ const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
7493
7727
  await writeFileContent(mainFilePath, mainFileContent);
7494
- changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7728
+ changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
7495
7729
  }
7496
7730
  for (const [i, file] of otherFiles.entries()) {
7497
- const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7731
+ const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
7498
7732
  const content = otherFileContents[i];
7499
7733
  if (content === void 0) {
7500
7734
  throw new Error(
@@ -7502,7 +7736,7 @@ var DirFeatureProcessor = class {
7502
7736
  );
7503
7737
  }
7504
7738
  await writeFileContent(filePath, content);
7505
- changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7739
+ changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
7506
7740
  }
7507
7741
  }
7508
7742
  changedCount++;
@@ -7534,38 +7768,38 @@ var DirFeatureProcessor = class {
7534
7768
  };
7535
7769
 
7536
7770
  // src/features/skills/agentsskills-skill.ts
7537
- var import_node_path60 = require("path");
7538
- var import_mini23 = require("zod/mini");
7771
+ var import_node_path61 = require("path");
7772
+ var import_mini24 = require("zod/mini");
7539
7773
 
7540
7774
  // src/features/skills/rulesync-skill.ts
7541
- var import_node_path59 = require("path");
7542
- var import_mini22 = require("zod/mini");
7543
- var RulesyncSkillFrontmatterSchemaInternal = import_mini22.z.looseObject({
7544
- name: import_mini22.z.string(),
7545
- description: import_mini22.z.string(),
7546
- targets: import_mini22.z._default(RulesyncTargetsSchema, ["*"]),
7547
- claudecode: import_mini22.z.optional(
7548
- import_mini22.z.looseObject({
7549
- "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7775
+ var import_node_path60 = require("path");
7776
+ var import_mini23 = require("zod/mini");
7777
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini23.z.looseObject({
7778
+ name: import_mini23.z.string(),
7779
+ description: import_mini23.z.string(),
7780
+ targets: import_mini23.z._default(RulesyncTargetsSchema, ["*"]),
7781
+ claudecode: import_mini23.z.optional(
7782
+ import_mini23.z.looseObject({
7783
+ "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
7550
7784
  })
7551
7785
  ),
7552
- codexcli: import_mini22.z.optional(
7553
- import_mini22.z.looseObject({
7554
- "short-description": import_mini22.z.optional(import_mini22.z.string())
7786
+ codexcli: import_mini23.z.optional(
7787
+ import_mini23.z.looseObject({
7788
+ "short-description": import_mini23.z.optional(import_mini23.z.string())
7555
7789
  })
7556
7790
  ),
7557
- opencode: import_mini22.z.optional(
7558
- import_mini22.z.looseObject({
7559
- "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7791
+ opencode: import_mini23.z.optional(
7792
+ import_mini23.z.looseObject({
7793
+ "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
7560
7794
  })
7561
7795
  ),
7562
- copilot: import_mini22.z.optional(
7563
- import_mini22.z.looseObject({
7564
- license: import_mini22.z.optional(import_mini22.z.string())
7796
+ copilot: import_mini23.z.optional(
7797
+ import_mini23.z.looseObject({
7798
+ license: import_mini23.z.optional(import_mini23.z.string())
7565
7799
  })
7566
7800
  ),
7567
- cline: import_mini22.z.optional(import_mini22.z.looseObject({})),
7568
- roo: import_mini22.z.optional(import_mini22.z.looseObject({}))
7801
+ cline: import_mini23.z.optional(import_mini23.z.looseObject({})),
7802
+ roo: import_mini23.z.optional(import_mini23.z.looseObject({}))
7569
7803
  });
7570
7804
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
7571
7805
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -7605,7 +7839,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7605
7839
  }
7606
7840
  getFrontmatter() {
7607
7841
  if (!this.mainFile?.frontmatter) {
7608
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path59.join)(this.relativeDirPath, this.dirName)}`);
7842
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path60.join)(this.relativeDirPath, this.dirName)}`);
7609
7843
  }
7610
7844
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
7611
7845
  return result;
@@ -7631,8 +7865,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7631
7865
  dirName,
7632
7866
  global = false
7633
7867
  }) {
7634
- const skillDirPath = (0, import_node_path59.join)(baseDir, relativeDirPath, dirName);
7635
- const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
7868
+ const skillDirPath = (0, import_node_path60.join)(baseDir, relativeDirPath, dirName);
7869
+ const skillFilePath = (0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME);
7636
7870
  if (!await fileExists(skillFilePath)) {
7637
7871
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7638
7872
  }
@@ -7662,14 +7896,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7662
7896
  };
7663
7897
 
7664
7898
  // src/features/skills/agentsskills-skill.ts
7665
- var AgentsSkillsSkillFrontmatterSchema = import_mini23.z.looseObject({
7666
- name: import_mini23.z.string(),
7667
- description: import_mini23.z.string()
7899
+ var AgentsSkillsSkillFrontmatterSchema = import_mini24.z.looseObject({
7900
+ name: import_mini24.z.string(),
7901
+ description: import_mini24.z.string()
7668
7902
  });
7669
7903
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7670
7904
  constructor({
7671
7905
  baseDir = process.cwd(),
7672
- relativeDirPath = (0, import_node_path60.join)(".agents", "skills"),
7906
+ relativeDirPath = (0, import_node_path61.join)(".agents", "skills"),
7673
7907
  dirName,
7674
7908
  frontmatter,
7675
7909
  body,
@@ -7701,7 +7935,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7701
7935
  throw new Error("AgentsSkillsSkill does not support global mode.");
7702
7936
  }
7703
7937
  return {
7704
- relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
7938
+ relativeDirPath: (0, import_node_path61.join)(".agents", "skills")
7705
7939
  };
7706
7940
  }
7707
7941
  getFrontmatter() {
@@ -7780,9 +8014,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7780
8014
  });
7781
8015
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
7782
8016
  if (!result.success) {
7783
- const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8017
+ const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7784
8018
  throw new Error(
7785
- `Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8019
+ `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7786
8020
  );
7787
8021
  }
7788
8022
  return new _AgentsSkillsSkill({
@@ -7817,16 +8051,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7817
8051
  };
7818
8052
 
7819
8053
  // src/features/skills/antigravity-skill.ts
7820
- var import_node_path61 = require("path");
7821
- var import_mini24 = require("zod/mini");
7822
- var AntigravitySkillFrontmatterSchema = import_mini24.z.looseObject({
7823
- name: import_mini24.z.string(),
7824
- description: import_mini24.z.string()
8054
+ var import_node_path62 = require("path");
8055
+ var import_mini25 = require("zod/mini");
8056
+ var AntigravitySkillFrontmatterSchema = import_mini25.z.looseObject({
8057
+ name: import_mini25.z.string(),
8058
+ description: import_mini25.z.string()
7825
8059
  });
7826
8060
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7827
8061
  constructor({
7828
8062
  baseDir = process.cwd(),
7829
- relativeDirPath = (0, import_node_path61.join)(".agent", "skills"),
8063
+ relativeDirPath = (0, import_node_path62.join)(".agent", "skills"),
7830
8064
  dirName,
7831
8065
  frontmatter,
7832
8066
  body,
@@ -7858,11 +8092,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7858
8092
  } = {}) {
7859
8093
  if (global) {
7860
8094
  return {
7861
- relativeDirPath: (0, import_node_path61.join)(".gemini", "antigravity", "skills")
8095
+ relativeDirPath: (0, import_node_path62.join)(".gemini", "antigravity", "skills")
7862
8096
  };
7863
8097
  }
7864
8098
  return {
7865
- relativeDirPath: (0, import_node_path61.join)(".agent", "skills")
8099
+ relativeDirPath: (0, import_node_path62.join)(".agent", "skills")
7866
8100
  };
7867
8101
  }
7868
8102
  getFrontmatter() {
@@ -7941,9 +8175,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7941
8175
  });
7942
8176
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
7943
8177
  if (!result.success) {
7944
- const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8178
+ const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7945
8179
  throw new Error(
7946
- `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8180
+ `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7947
8181
  );
7948
8182
  }
7949
8183
  return new _AntigravitySkill({
@@ -7977,17 +8211,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7977
8211
  };
7978
8212
 
7979
8213
  // src/features/skills/claudecode-skill.ts
7980
- var import_node_path62 = require("path");
7981
- var import_mini25 = require("zod/mini");
7982
- var ClaudecodeSkillFrontmatterSchema = import_mini25.z.looseObject({
7983
- name: import_mini25.z.string(),
7984
- description: import_mini25.z.string(),
7985
- "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
8214
+ var import_node_path63 = require("path");
8215
+ var import_mini26 = require("zod/mini");
8216
+ var ClaudecodeSkillFrontmatterSchema = import_mini26.z.looseObject({
8217
+ name: import_mini26.z.string(),
8218
+ description: import_mini26.z.string(),
8219
+ "allowed-tools": import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
7986
8220
  });
7987
8221
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
7988
8222
  constructor({
7989
8223
  baseDir = process.cwd(),
7990
- relativeDirPath = (0, import_node_path62.join)(".claude", "skills"),
8224
+ relativeDirPath = (0, import_node_path63.join)(".claude", "skills"),
7991
8225
  dirName,
7992
8226
  frontmatter,
7993
8227
  body,
@@ -8018,7 +8252,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8018
8252
  global: _global = false
8019
8253
  } = {}) {
8020
8254
  return {
8021
- relativeDirPath: (0, import_node_path62.join)(".claude", "skills")
8255
+ relativeDirPath: (0, import_node_path63.join)(".claude", "skills")
8022
8256
  };
8023
8257
  }
8024
8258
  getFrontmatter() {
@@ -8103,9 +8337,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8103
8337
  });
8104
8338
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8105
8339
  if (!result.success) {
8106
- const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8340
+ const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8107
8341
  throw new Error(
8108
- `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8342
+ `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8109
8343
  );
8110
8344
  }
8111
8345
  return new _ClaudecodeSkill({
@@ -8139,16 +8373,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8139
8373
  };
8140
8374
 
8141
8375
  // src/features/skills/cline-skill.ts
8142
- var import_node_path63 = require("path");
8143
- var import_mini26 = require("zod/mini");
8144
- var ClineSkillFrontmatterSchema = import_mini26.z.looseObject({
8145
- name: import_mini26.z.string(),
8146
- description: import_mini26.z.string()
8376
+ var import_node_path64 = require("path");
8377
+ var import_mini27 = require("zod/mini");
8378
+ var ClineSkillFrontmatterSchema = import_mini27.z.looseObject({
8379
+ name: import_mini27.z.string(),
8380
+ description: import_mini27.z.string()
8147
8381
  });
8148
8382
  var ClineSkill = class _ClineSkill extends ToolSkill {
8149
8383
  constructor({
8150
8384
  baseDir = process.cwd(),
8151
- relativeDirPath = (0, import_node_path63.join)(".cline", "skills"),
8385
+ relativeDirPath = (0, import_node_path64.join)(".cline", "skills"),
8152
8386
  dirName,
8153
8387
  frontmatter,
8154
8388
  body,
@@ -8177,7 +8411,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8177
8411
  }
8178
8412
  static getSettablePaths(_options = {}) {
8179
8413
  return {
8180
- relativeDirPath: (0, import_node_path63.join)(".cline", "skills")
8414
+ relativeDirPath: (0, import_node_path64.join)(".cline", "skills")
8181
8415
  };
8182
8416
  }
8183
8417
  getFrontmatter() {
@@ -8264,13 +8498,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8264
8498
  });
8265
8499
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8266
8500
  if (!result.success) {
8267
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8501
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8268
8502
  throw new Error(
8269
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8503
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8270
8504
  );
8271
8505
  }
8272
8506
  if (result.data.name !== loaded.dirName) {
8273
- const skillFilePath = (0, import_node_path63.join)(
8507
+ const skillFilePath = (0, import_node_path64.join)(
8274
8508
  loaded.baseDir,
8275
8509
  loaded.relativeDirPath,
8276
8510
  loaded.dirName,
@@ -8311,21 +8545,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8311
8545
  };
8312
8546
 
8313
8547
  // src/features/skills/codexcli-skill.ts
8314
- var import_node_path64 = require("path");
8315
- var import_mini27 = require("zod/mini");
8316
- var CodexCliSkillFrontmatterSchema = import_mini27.z.looseObject({
8317
- name: import_mini27.z.string(),
8318
- description: import_mini27.z.string(),
8319
- metadata: import_mini27.z.optional(
8320
- import_mini27.z.looseObject({
8321
- "short-description": import_mini27.z.optional(import_mini27.z.string())
8548
+ var import_node_path65 = require("path");
8549
+ var import_mini28 = require("zod/mini");
8550
+ var CodexCliSkillFrontmatterSchema = import_mini28.z.looseObject({
8551
+ name: import_mini28.z.string(),
8552
+ description: import_mini28.z.string(),
8553
+ metadata: import_mini28.z.optional(
8554
+ import_mini28.z.looseObject({
8555
+ "short-description": import_mini28.z.optional(import_mini28.z.string())
8322
8556
  })
8323
8557
  )
8324
8558
  });
8325
8559
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8326
8560
  constructor({
8327
8561
  baseDir = process.cwd(),
8328
- relativeDirPath = (0, import_node_path64.join)(".codex", "skills"),
8562
+ relativeDirPath = (0, import_node_path65.join)(".codex", "skills"),
8329
8563
  dirName,
8330
8564
  frontmatter,
8331
8565
  body,
@@ -8356,7 +8590,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8356
8590
  global: _global = false
8357
8591
  } = {}) {
8358
8592
  return {
8359
- relativeDirPath: (0, import_node_path64.join)(".codex", "skills")
8593
+ relativeDirPath: (0, import_node_path65.join)(".codex", "skills")
8360
8594
  };
8361
8595
  }
8362
8596
  getFrontmatter() {
@@ -8445,9 +8679,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8445
8679
  });
8446
8680
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8447
8681
  if (!result.success) {
8448
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8682
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8449
8683
  throw new Error(
8450
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8684
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8451
8685
  );
8452
8686
  }
8453
8687
  return new _CodexCliSkill({
@@ -8481,17 +8715,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8481
8715
  };
8482
8716
 
8483
8717
  // src/features/skills/copilot-skill.ts
8484
- var import_node_path65 = require("path");
8485
- var import_mini28 = require("zod/mini");
8486
- var CopilotSkillFrontmatterSchema = import_mini28.z.looseObject({
8487
- name: import_mini28.z.string(),
8488
- description: import_mini28.z.string(),
8489
- license: import_mini28.z.optional(import_mini28.z.string())
8718
+ var import_node_path66 = require("path");
8719
+ var import_mini29 = require("zod/mini");
8720
+ var CopilotSkillFrontmatterSchema = import_mini29.z.looseObject({
8721
+ name: import_mini29.z.string(),
8722
+ description: import_mini29.z.string(),
8723
+ license: import_mini29.z.optional(import_mini29.z.string())
8490
8724
  });
8491
8725
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8492
8726
  constructor({
8493
8727
  baseDir = process.cwd(),
8494
- relativeDirPath = (0, import_node_path65.join)(".github", "skills"),
8728
+ relativeDirPath = (0, import_node_path66.join)(".github", "skills"),
8495
8729
  dirName,
8496
8730
  frontmatter,
8497
8731
  body,
@@ -8523,7 +8757,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8523
8757
  throw new Error("CopilotSkill does not support global mode.");
8524
8758
  }
8525
8759
  return {
8526
- relativeDirPath: (0, import_node_path65.join)(".github", "skills")
8760
+ relativeDirPath: (0, import_node_path66.join)(".github", "skills")
8527
8761
  };
8528
8762
  }
8529
8763
  getFrontmatter() {
@@ -8608,9 +8842,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8608
8842
  });
8609
8843
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8610
8844
  if (!result.success) {
8611
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8845
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8612
8846
  throw new Error(
8613
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8847
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8614
8848
  );
8615
8849
  }
8616
8850
  return new _CopilotSkill({
@@ -8645,16 +8879,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8645
8879
  };
8646
8880
 
8647
8881
  // src/features/skills/cursor-skill.ts
8648
- var import_node_path66 = require("path");
8649
- var import_mini29 = require("zod/mini");
8650
- var CursorSkillFrontmatterSchema = import_mini29.z.looseObject({
8651
- name: import_mini29.z.string(),
8652
- description: import_mini29.z.string()
8882
+ var import_node_path67 = require("path");
8883
+ var import_mini30 = require("zod/mini");
8884
+ var CursorSkillFrontmatterSchema = import_mini30.z.looseObject({
8885
+ name: import_mini30.z.string(),
8886
+ description: import_mini30.z.string()
8653
8887
  });
8654
8888
  var CursorSkill = class _CursorSkill extends ToolSkill {
8655
8889
  constructor({
8656
8890
  baseDir = process.cwd(),
8657
- relativeDirPath = (0, import_node_path66.join)(".cursor", "skills"),
8891
+ relativeDirPath = (0, import_node_path67.join)(".cursor", "skills"),
8658
8892
  dirName,
8659
8893
  frontmatter,
8660
8894
  body,
@@ -8683,7 +8917,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8683
8917
  }
8684
8918
  static getSettablePaths(_options) {
8685
8919
  return {
8686
- relativeDirPath: (0, import_node_path66.join)(".cursor", "skills")
8920
+ relativeDirPath: (0, import_node_path67.join)(".cursor", "skills")
8687
8921
  };
8688
8922
  }
8689
8923
  getFrontmatter() {
@@ -8762,9 +8996,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8762
8996
  });
8763
8997
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8764
8998
  if (!result.success) {
8765
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8999
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8766
9000
  throw new Error(
8767
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9001
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8768
9002
  );
8769
9003
  }
8770
9004
  return new _CursorSkill({
@@ -8799,11 +9033,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8799
9033
  };
8800
9034
 
8801
9035
  // src/features/skills/geminicli-skill.ts
8802
- var import_node_path67 = require("path");
8803
- var import_mini30 = require("zod/mini");
8804
- var GeminiCliSkillFrontmatterSchema = import_mini30.z.looseObject({
8805
- name: import_mini30.z.string(),
8806
- description: import_mini30.z.string()
9036
+ var import_node_path68 = require("path");
9037
+ var import_mini31 = require("zod/mini");
9038
+ var GeminiCliSkillFrontmatterSchema = import_mini31.z.looseObject({
9039
+ name: import_mini31.z.string(),
9040
+ description: import_mini31.z.string()
8807
9041
  });
8808
9042
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8809
9043
  constructor({
@@ -8839,7 +9073,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8839
9073
  global: _global = false
8840
9074
  } = {}) {
8841
9075
  return {
8842
- relativeDirPath: (0, import_node_path67.join)(".gemini", "skills")
9076
+ relativeDirPath: (0, import_node_path68.join)(".gemini", "skills")
8843
9077
  };
8844
9078
  }
8845
9079
  getFrontmatter() {
@@ -8918,9 +9152,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8918
9152
  });
8919
9153
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8920
9154
  if (!result.success) {
8921
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9155
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8922
9156
  throw new Error(
8923
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9157
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8924
9158
  );
8925
9159
  }
8926
9160
  return new _GeminiCliSkill({
@@ -8955,16 +9189,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8955
9189
  };
8956
9190
 
8957
9191
  // src/features/skills/kilo-skill.ts
8958
- var import_node_path68 = require("path");
8959
- var import_mini31 = require("zod/mini");
8960
- var KiloSkillFrontmatterSchema = import_mini31.z.looseObject({
8961
- name: import_mini31.z.string(),
8962
- description: import_mini31.z.string()
9192
+ var import_node_path69 = require("path");
9193
+ var import_mini32 = require("zod/mini");
9194
+ var KiloSkillFrontmatterSchema = import_mini32.z.looseObject({
9195
+ name: import_mini32.z.string(),
9196
+ description: import_mini32.z.string()
8963
9197
  });
8964
9198
  var KiloSkill = class _KiloSkill extends ToolSkill {
8965
9199
  constructor({
8966
9200
  baseDir = process.cwd(),
8967
- relativeDirPath = (0, import_node_path68.join)(".kilocode", "skills"),
9201
+ relativeDirPath = (0, import_node_path69.join)(".kilocode", "skills"),
8968
9202
  dirName,
8969
9203
  frontmatter,
8970
9204
  body,
@@ -8995,7 +9229,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
8995
9229
  global: _global = false
8996
9230
  } = {}) {
8997
9231
  return {
8998
- relativeDirPath: (0, import_node_path68.join)(".kilocode", "skills")
9232
+ relativeDirPath: (0, import_node_path69.join)(".kilocode", "skills")
8999
9233
  };
9000
9234
  }
9001
9235
  getFrontmatter() {
@@ -9082,13 +9316,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9082
9316
  });
9083
9317
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9084
9318
  if (!result.success) {
9085
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9319
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9086
9320
  throw new Error(
9087
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9321
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9088
9322
  );
9089
9323
  }
9090
9324
  if (result.data.name !== loaded.dirName) {
9091
- const skillFilePath = (0, import_node_path68.join)(
9325
+ const skillFilePath = (0, import_node_path69.join)(
9092
9326
  loaded.baseDir,
9093
9327
  loaded.relativeDirPath,
9094
9328
  loaded.dirName,
@@ -9129,16 +9363,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9129
9363
  };
9130
9364
 
9131
9365
  // src/features/skills/kiro-skill.ts
9132
- var import_node_path69 = require("path");
9133
- var import_mini32 = require("zod/mini");
9134
- var KiroSkillFrontmatterSchema = import_mini32.z.looseObject({
9135
- name: import_mini32.z.string(),
9136
- description: import_mini32.z.string()
9366
+ var import_node_path70 = require("path");
9367
+ var import_mini33 = require("zod/mini");
9368
+ var KiroSkillFrontmatterSchema = import_mini33.z.looseObject({
9369
+ name: import_mini33.z.string(),
9370
+ description: import_mini33.z.string()
9137
9371
  });
9138
9372
  var KiroSkill = class _KiroSkill extends ToolSkill {
9139
9373
  constructor({
9140
9374
  baseDir = process.cwd(),
9141
- relativeDirPath = (0, import_node_path69.join)(".kiro", "skills"),
9375
+ relativeDirPath = (0, import_node_path70.join)(".kiro", "skills"),
9142
9376
  dirName,
9143
9377
  frontmatter,
9144
9378
  body,
@@ -9170,7 +9404,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9170
9404
  throw new Error("KiroSkill does not support global mode.");
9171
9405
  }
9172
9406
  return {
9173
- relativeDirPath: (0, import_node_path69.join)(".kiro", "skills")
9407
+ relativeDirPath: (0, import_node_path70.join)(".kiro", "skills")
9174
9408
  };
9175
9409
  }
9176
9410
  getFrontmatter() {
@@ -9257,13 +9491,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9257
9491
  });
9258
9492
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9259
9493
  if (!result.success) {
9260
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9494
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9261
9495
  throw new Error(
9262
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9496
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9263
9497
  );
9264
9498
  }
9265
9499
  if (result.data.name !== loaded.dirName) {
9266
- const skillFilePath = (0, import_node_path69.join)(
9500
+ const skillFilePath = (0, import_node_path70.join)(
9267
9501
  loaded.baseDir,
9268
9502
  loaded.relativeDirPath,
9269
9503
  loaded.dirName,
@@ -9305,17 +9539,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9305
9539
  };
9306
9540
 
9307
9541
  // src/features/skills/opencode-skill.ts
9308
- var import_node_path70 = require("path");
9309
- var import_mini33 = require("zod/mini");
9310
- var OpenCodeSkillFrontmatterSchema = import_mini33.z.looseObject({
9311
- name: import_mini33.z.string(),
9312
- description: import_mini33.z.string(),
9313
- "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
9542
+ var import_node_path71 = require("path");
9543
+ var import_mini34 = require("zod/mini");
9544
+ var OpenCodeSkillFrontmatterSchema = import_mini34.z.looseObject({
9545
+ name: import_mini34.z.string(),
9546
+ description: import_mini34.z.string(),
9547
+ "allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
9314
9548
  });
9315
9549
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9316
9550
  constructor({
9317
9551
  baseDir = process.cwd(),
9318
- relativeDirPath = (0, import_node_path70.join)(".opencode", "skill"),
9552
+ relativeDirPath = (0, import_node_path71.join)(".opencode", "skill"),
9319
9553
  dirName,
9320
9554
  frontmatter,
9321
9555
  body,
@@ -9344,7 +9578,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9344
9578
  }
9345
9579
  static getSettablePaths({ global = false } = {}) {
9346
9580
  return {
9347
- relativeDirPath: global ? (0, import_node_path70.join)(".config", "opencode", "skill") : (0, import_node_path70.join)(".opencode", "skill")
9581
+ relativeDirPath: global ? (0, import_node_path71.join)(".config", "opencode", "skill") : (0, import_node_path71.join)(".opencode", "skill")
9348
9582
  };
9349
9583
  }
9350
9584
  getFrontmatter() {
@@ -9429,9 +9663,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9429
9663
  });
9430
9664
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9431
9665
  if (!result.success) {
9432
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9666
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9433
9667
  throw new Error(
9434
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9668
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9435
9669
  );
9436
9670
  }
9437
9671
  return new _OpenCodeSkill({
@@ -9465,16 +9699,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9465
9699
  };
9466
9700
 
9467
9701
  // src/features/skills/replit-skill.ts
9468
- var import_node_path71 = require("path");
9469
- var import_mini34 = require("zod/mini");
9470
- var ReplitSkillFrontmatterSchema = import_mini34.z.looseObject({
9471
- name: import_mini34.z.string(),
9472
- description: import_mini34.z.string()
9702
+ var import_node_path72 = require("path");
9703
+ var import_mini35 = require("zod/mini");
9704
+ var ReplitSkillFrontmatterSchema = import_mini35.z.looseObject({
9705
+ name: import_mini35.z.string(),
9706
+ description: import_mini35.z.string()
9473
9707
  });
9474
9708
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9475
9709
  constructor({
9476
9710
  baseDir = process.cwd(),
9477
- relativeDirPath = (0, import_node_path71.join)(".agents", "skills"),
9711
+ relativeDirPath = (0, import_node_path72.join)(".agents", "skills"),
9478
9712
  dirName,
9479
9713
  frontmatter,
9480
9714
  body,
@@ -9506,7 +9740,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9506
9740
  throw new Error("ReplitSkill does not support global mode.");
9507
9741
  }
9508
9742
  return {
9509
- relativeDirPath: (0, import_node_path71.join)(".agents", "skills")
9743
+ relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
9510
9744
  };
9511
9745
  }
9512
9746
  getFrontmatter() {
@@ -9585,9 +9819,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9585
9819
  });
9586
9820
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9587
9821
  if (!result.success) {
9588
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9822
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9589
9823
  throw new Error(
9590
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9824
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9591
9825
  );
9592
9826
  }
9593
9827
  return new _ReplitSkill({
@@ -9622,16 +9856,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9622
9856
  };
9623
9857
 
9624
9858
  // src/features/skills/roo-skill.ts
9625
- var import_node_path72 = require("path");
9626
- var import_mini35 = require("zod/mini");
9627
- var RooSkillFrontmatterSchema = import_mini35.z.looseObject({
9628
- name: import_mini35.z.string(),
9629
- description: import_mini35.z.string()
9859
+ var import_node_path73 = require("path");
9860
+ var import_mini36 = require("zod/mini");
9861
+ var RooSkillFrontmatterSchema = import_mini36.z.looseObject({
9862
+ name: import_mini36.z.string(),
9863
+ description: import_mini36.z.string()
9630
9864
  });
9631
9865
  var RooSkill = class _RooSkill extends ToolSkill {
9632
9866
  constructor({
9633
9867
  baseDir = process.cwd(),
9634
- relativeDirPath = (0, import_node_path72.join)(".roo", "skills"),
9868
+ relativeDirPath = (0, import_node_path73.join)(".roo", "skills"),
9635
9869
  dirName,
9636
9870
  frontmatter,
9637
9871
  body,
@@ -9662,7 +9896,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
9662
9896
  global: _global = false
9663
9897
  } = {}) {
9664
9898
  return {
9665
- relativeDirPath: (0, import_node_path72.join)(".roo", "skills")
9899
+ relativeDirPath: (0, import_node_path73.join)(".roo", "skills")
9666
9900
  };
9667
9901
  }
9668
9902
  getFrontmatter() {
@@ -9749,13 +9983,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
9749
9983
  });
9750
9984
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9751
9985
  if (!result.success) {
9752
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9986
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9753
9987
  throw new Error(
9754
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9988
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9755
9989
  );
9756
9990
  }
9757
9991
  if (result.data.name !== loaded.dirName) {
9758
- const skillFilePath = (0, import_node_path72.join)(
9992
+ const skillFilePath = (0, import_node_path73.join)(
9759
9993
  loaded.baseDir,
9760
9994
  loaded.relativeDirPath,
9761
9995
  loaded.dirName,
@@ -9796,17 +10030,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
9796
10030
  };
9797
10031
 
9798
10032
  // src/features/skills/skills-utils.ts
9799
- var import_node_path73 = require("path");
10033
+ var import_node_path74 = require("path");
9800
10034
  async function getLocalSkillDirNames(baseDir) {
9801
- const skillsDir = (0, import_node_path73.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10035
+ const skillsDir = (0, import_node_path74.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
9802
10036
  const names = /* @__PURE__ */ new Set();
9803
10037
  if (!await directoryExists(skillsDir)) {
9804
10038
  return names;
9805
10039
  }
9806
- const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDir, "*"), { type: "dir" });
10040
+ const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDir, "*"), { type: "dir" });
9807
10041
  for (const dirPath of dirPaths) {
9808
- const name = (0, import_node_path73.basename)(dirPath);
9809
- if (name === (0, import_node_path73.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10042
+ const name = (0, import_node_path74.basename)(dirPath);
10043
+ if (name === (0, import_node_path74.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
9810
10044
  names.add(name);
9811
10045
  }
9812
10046
  return names;
@@ -9831,7 +10065,7 @@ var skillsProcessorToolTargetTuple = [
9831
10065
  "replit",
9832
10066
  "roo"
9833
10067
  ];
9834
- var SkillsProcessorToolTargetSchema = import_mini36.z.enum(skillsProcessorToolTargetTuple);
10068
+ var SkillsProcessorToolTargetSchema = import_mini37.z.enum(skillsProcessorToolTargetTuple);
9835
10069
  var toolSkillFactories = /* @__PURE__ */ new Map([
9836
10070
  [
9837
10071
  "agentsmd",
@@ -10032,11 +10266,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10032
10266
  )
10033
10267
  );
10034
10268
  const localSkillNames = new Set(localDirNames);
10035
- const curatedDirPath = (0, import_node_path74.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10269
+ const curatedDirPath = (0, import_node_path75.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10036
10270
  let curatedSkills = [];
10037
10271
  if (await directoryExists(curatedDirPath)) {
10038
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path74.join)(curatedDirPath, "*"), { type: "dir" });
10039
- const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path74.basename)(path4));
10272
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path75.join)(curatedDirPath, "*"), { type: "dir" });
10273
+ const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path75.basename)(path4));
10040
10274
  const nonConflicting = curatedDirNames.filter((name) => {
10041
10275
  if (localSkillNames.has(name)) {
10042
10276
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -10069,9 +10303,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10069
10303
  async loadToolDirs() {
10070
10304
  const factory = this.getFactory(this.toolTarget);
10071
10305
  const paths = factory.class.getSettablePaths({ global: this.global });
10072
- const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10073
- const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10074
- const dirNames = dirPaths.map((path4) => (0, import_node_path74.basename)(path4));
10306
+ const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10307
+ const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10308
+ const dirNames = dirPaths.map((path4) => (0, import_node_path75.basename)(path4));
10075
10309
  const toolSkills = await Promise.all(
10076
10310
  dirNames.map(
10077
10311
  (dirName) => factory.class.fromDir({
@@ -10087,9 +10321,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10087
10321
  async loadToolDirsToDelete() {
10088
10322
  const factory = this.getFactory(this.toolTarget);
10089
10323
  const paths = factory.class.getSettablePaths({ global: this.global });
10090
- const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10091
- const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10092
- const dirNames = dirPaths.map((path4) => (0, import_node_path74.basename)(path4));
10324
+ const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10325
+ const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10326
+ const dirNames = dirPaths.map((path4) => (0, import_node_path75.basename)(path4));
10093
10327
  const toolSkills = dirNames.map(
10094
10328
  (dirName) => factory.class.forDeletion({
10095
10329
  baseDir: this.baseDir,
@@ -10150,11 +10384,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10150
10384
  };
10151
10385
 
10152
10386
  // src/features/subagents/agentsmd-subagent.ts
10153
- var import_node_path76 = require("path");
10387
+ var import_node_path77 = require("path");
10154
10388
 
10155
10389
  // src/features/subagents/simulated-subagent.ts
10156
- var import_node_path75 = require("path");
10157
- var import_mini37 = require("zod/mini");
10390
+ var import_node_path76 = require("path");
10391
+ var import_mini38 = require("zod/mini");
10158
10392
 
10159
10393
  // src/features/subagents/tool-subagent.ts
10160
10394
  var ToolSubagent = class extends ToolFile {
@@ -10206,9 +10440,9 @@ var ToolSubagent = class extends ToolFile {
10206
10440
  };
10207
10441
 
10208
10442
  // src/features/subagents/simulated-subagent.ts
10209
- var SimulatedSubagentFrontmatterSchema = import_mini37.z.object({
10210
- name: import_mini37.z.string(),
10211
- description: import_mini37.z.string()
10443
+ var SimulatedSubagentFrontmatterSchema = import_mini38.z.object({
10444
+ name: import_mini38.z.string(),
10445
+ description: import_mini38.z.string()
10212
10446
  });
10213
10447
  var SimulatedSubagent = class extends ToolSubagent {
10214
10448
  frontmatter;
@@ -10218,7 +10452,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10218
10452
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
10219
10453
  if (!result.success) {
10220
10454
  throw new Error(
10221
- `Invalid frontmatter in ${(0, import_node_path75.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10455
+ `Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10222
10456
  );
10223
10457
  }
10224
10458
  }
@@ -10269,7 +10503,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10269
10503
  return {
10270
10504
  success: false,
10271
10505
  error: new Error(
10272
- `Invalid frontmatter in ${(0, import_node_path75.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10506
+ `Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10273
10507
  )
10274
10508
  };
10275
10509
  }
@@ -10279,7 +10513,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10279
10513
  relativeFilePath,
10280
10514
  validate = true
10281
10515
  }) {
10282
- const filePath = (0, import_node_path75.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10516
+ const filePath = (0, import_node_path76.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10283
10517
  const fileContent = await readFileContent(filePath);
10284
10518
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10285
10519
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10289,7 +10523,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10289
10523
  return {
10290
10524
  baseDir,
10291
10525
  relativeDirPath: this.getSettablePaths().relativeDirPath,
10292
- relativeFilePath: (0, import_node_path75.basename)(relativeFilePath),
10526
+ relativeFilePath: (0, import_node_path76.basename)(relativeFilePath),
10293
10527
  frontmatter: result.data,
10294
10528
  body: content.trim(),
10295
10529
  validate
@@ -10315,7 +10549,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10315
10549
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10316
10550
  static getSettablePaths() {
10317
10551
  return {
10318
- relativeDirPath: (0, import_node_path76.join)(".agents", "subagents")
10552
+ relativeDirPath: (0, import_node_path77.join)(".agents", "subagents")
10319
10553
  };
10320
10554
  }
10321
10555
  static async fromFile(params) {
@@ -10338,11 +10572,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10338
10572
  };
10339
10573
 
10340
10574
  // src/features/subagents/factorydroid-subagent.ts
10341
- var import_node_path77 = require("path");
10575
+ var import_node_path78 = require("path");
10342
10576
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10343
10577
  static getSettablePaths(_options) {
10344
10578
  return {
10345
- relativeDirPath: (0, import_node_path77.join)(".factory", "droids")
10579
+ relativeDirPath: (0, import_node_path78.join)(".factory", "droids")
10346
10580
  };
10347
10581
  }
10348
10582
  static async fromFile(params) {
@@ -10365,11 +10599,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10365
10599
  };
10366
10600
 
10367
10601
  // src/features/subagents/geminicli-subagent.ts
10368
- var import_node_path78 = require("path");
10602
+ var import_node_path79 = require("path");
10369
10603
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10370
10604
  static getSettablePaths() {
10371
10605
  return {
10372
- relativeDirPath: (0, import_node_path78.join)(".gemini", "subagents")
10606
+ relativeDirPath: (0, import_node_path79.join)(".gemini", "subagents")
10373
10607
  };
10374
10608
  }
10375
10609
  static async fromFile(params) {
@@ -10392,11 +10626,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10392
10626
  };
10393
10627
 
10394
10628
  // src/features/subagents/roo-subagent.ts
10395
- var import_node_path79 = require("path");
10629
+ var import_node_path80 = require("path");
10396
10630
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10397
10631
  static getSettablePaths() {
10398
10632
  return {
10399
- relativeDirPath: (0, import_node_path79.join)(".roo", "subagents")
10633
+ relativeDirPath: (0, import_node_path80.join)(".roo", "subagents")
10400
10634
  };
10401
10635
  }
10402
10636
  static async fromFile(params) {
@@ -10419,20 +10653,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10419
10653
  };
10420
10654
 
10421
10655
  // src/features/subagents/subagents-processor.ts
10422
- var import_node_path87 = require("path");
10423
- var import_mini45 = require("zod/mini");
10656
+ var import_node_path88 = require("path");
10657
+ var import_mini46 = require("zod/mini");
10424
10658
 
10425
10659
  // src/features/subagents/claudecode-subagent.ts
10426
- var import_node_path81 = require("path");
10427
- var import_mini39 = require("zod/mini");
10660
+ var import_node_path82 = require("path");
10661
+ var import_mini40 = require("zod/mini");
10428
10662
 
10429
10663
  // src/features/subagents/rulesync-subagent.ts
10430
- var import_node_path80 = require("path");
10431
- var import_mini38 = require("zod/mini");
10432
- var RulesyncSubagentFrontmatterSchema = import_mini38.z.looseObject({
10433
- targets: import_mini38.z._default(RulesyncTargetsSchema, ["*"]),
10434
- name: import_mini38.z.string(),
10435
- description: import_mini38.z.string()
10664
+ var import_node_path81 = require("path");
10665
+ var import_mini39 = require("zod/mini");
10666
+ var RulesyncSubagentFrontmatterSchema = import_mini39.z.looseObject({
10667
+ targets: import_mini39.z._default(RulesyncTargetsSchema, ["*"]),
10668
+ name: import_mini39.z.string(),
10669
+ description: import_mini39.z.string()
10436
10670
  });
10437
10671
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10438
10672
  frontmatter;
@@ -10441,7 +10675,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10441
10675
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10442
10676
  if (!parseResult.success && rest.validate !== false) {
10443
10677
  throw new Error(
10444
- `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10678
+ `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10445
10679
  );
10446
10680
  }
10447
10681
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10474,7 +10708,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10474
10708
  return {
10475
10709
  success: false,
10476
10710
  error: new Error(
10477
- `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10711
+ `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10478
10712
  )
10479
10713
  };
10480
10714
  }
@@ -10482,14 +10716,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10482
10716
  static async fromFile({
10483
10717
  relativeFilePath
10484
10718
  }) {
10485
- const filePath = (0, import_node_path80.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10719
+ const filePath = (0, import_node_path81.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10486
10720
  const fileContent = await readFileContent(filePath);
10487
10721
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10488
10722
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10489
10723
  if (!result.success) {
10490
10724
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10491
10725
  }
10492
- const filename = (0, import_node_path80.basename)(relativeFilePath);
10726
+ const filename = (0, import_node_path81.basename)(relativeFilePath);
10493
10727
  return new _RulesyncSubagent({
10494
10728
  baseDir: process.cwd(),
10495
10729
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10501,13 +10735,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10501
10735
  };
10502
10736
 
10503
10737
  // src/features/subagents/claudecode-subagent.ts
10504
- var ClaudecodeSubagentFrontmatterSchema = import_mini39.z.looseObject({
10505
- name: import_mini39.z.string(),
10506
- description: import_mini39.z.string(),
10507
- model: import_mini39.z.optional(import_mini39.z.string()),
10508
- tools: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())])),
10509
- permissionMode: import_mini39.z.optional(import_mini39.z.string()),
10510
- skills: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())]))
10738
+ var ClaudecodeSubagentFrontmatterSchema = import_mini40.z.looseObject({
10739
+ name: import_mini40.z.string(),
10740
+ description: import_mini40.z.string(),
10741
+ model: import_mini40.z.optional(import_mini40.z.string()),
10742
+ tools: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())])),
10743
+ permissionMode: import_mini40.z.optional(import_mini40.z.string()),
10744
+ skills: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())]))
10511
10745
  });
10512
10746
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10513
10747
  frontmatter;
@@ -10517,7 +10751,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10517
10751
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10518
10752
  if (!result.success) {
10519
10753
  throw new Error(
10520
- `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10754
+ `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10521
10755
  );
10522
10756
  }
10523
10757
  }
@@ -10529,7 +10763,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10529
10763
  }
10530
10764
  static getSettablePaths(_options = {}) {
10531
10765
  return {
10532
- relativeDirPath: (0, import_node_path81.join)(".claude", "agents")
10766
+ relativeDirPath: (0, import_node_path82.join)(".claude", "agents")
10533
10767
  };
10534
10768
  }
10535
10769
  getFrontmatter() {
@@ -10605,7 +10839,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10605
10839
  return {
10606
10840
  success: false,
10607
10841
  error: new Error(
10608
- `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10842
+ `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10609
10843
  )
10610
10844
  };
10611
10845
  }
@@ -10623,7 +10857,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10623
10857
  global = false
10624
10858
  }) {
10625
10859
  const paths = this.getSettablePaths({ global });
10626
- const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10860
+ const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10627
10861
  const fileContent = await readFileContent(filePath);
10628
10862
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10629
10863
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10658,16 +10892,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10658
10892
  };
10659
10893
 
10660
10894
  // src/features/subagents/codexcli-subagent.ts
10661
- var import_node_path82 = require("path");
10895
+ var import_node_path83 = require("path");
10662
10896
  var smolToml2 = __toESM(require("smol-toml"), 1);
10663
- var import_mini40 = require("zod/mini");
10664
- var CodexCliSubagentTomlSchema = import_mini40.z.looseObject({
10665
- name: import_mini40.z.string(),
10666
- description: import_mini40.z.optional(import_mini40.z.string()),
10667
- developer_instructions: import_mini40.z.optional(import_mini40.z.string()),
10668
- model: import_mini40.z.optional(import_mini40.z.string()),
10669
- model_reasoning_effort: import_mini40.z.optional(import_mini40.z.string()),
10670
- sandbox_mode: import_mini40.z.optional(import_mini40.z.string())
10897
+ var import_mini41 = require("zod/mini");
10898
+ var CodexCliSubagentTomlSchema = import_mini41.z.looseObject({
10899
+ name: import_mini41.z.string(),
10900
+ description: import_mini41.z.optional(import_mini41.z.string()),
10901
+ developer_instructions: import_mini41.z.optional(import_mini41.z.string()),
10902
+ model: import_mini41.z.optional(import_mini41.z.string()),
10903
+ model_reasoning_effort: import_mini41.z.optional(import_mini41.z.string()),
10904
+ sandbox_mode: import_mini41.z.optional(import_mini41.z.string())
10671
10905
  });
10672
10906
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10673
10907
  body;
@@ -10678,7 +10912,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10678
10912
  CodexCliSubagentTomlSchema.parse(parsed);
10679
10913
  } catch (error) {
10680
10914
  throw new Error(
10681
- `Invalid TOML in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10915
+ `Invalid TOML in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10682
10916
  { cause: error }
10683
10917
  );
10684
10918
  }
@@ -10690,7 +10924,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10690
10924
  }
10691
10925
  static getSettablePaths(_options = {}) {
10692
10926
  return {
10693
- relativeDirPath: (0, import_node_path82.join)(".codex", "agents")
10927
+ relativeDirPath: (0, import_node_path83.join)(".codex", "agents")
10694
10928
  };
10695
10929
  }
10696
10930
  getBody() {
@@ -10702,7 +10936,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10702
10936
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10703
10937
  } catch (error) {
10704
10938
  throw new Error(
10705
- `Failed to parse TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10939
+ `Failed to parse TOML in ${(0, import_node_path83.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10706
10940
  { cause: error }
10707
10941
  );
10708
10942
  }
@@ -10783,7 +11017,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10783
11017
  global = false
10784
11018
  }) {
10785
11019
  const paths = this.getSettablePaths({ global });
10786
- const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11020
+ const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10787
11021
  const fileContent = await readFileContent(filePath);
10788
11022
  const subagent = new _CodexCliSubagent({
10789
11023
  baseDir,
@@ -10821,13 +11055,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10821
11055
  };
10822
11056
 
10823
11057
  // src/features/subagents/copilot-subagent.ts
10824
- var import_node_path83 = require("path");
10825
- var import_mini41 = require("zod/mini");
11058
+ var import_node_path84 = require("path");
11059
+ var import_mini42 = require("zod/mini");
10826
11060
  var REQUIRED_TOOL = "agent/runSubagent";
10827
- var CopilotSubagentFrontmatterSchema = import_mini41.z.looseObject({
10828
- name: import_mini41.z.string(),
10829
- description: import_mini41.z.string(),
10830
- tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
11061
+ var CopilotSubagentFrontmatterSchema = import_mini42.z.looseObject({
11062
+ name: import_mini42.z.string(),
11063
+ description: import_mini42.z.string(),
11064
+ tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
10831
11065
  });
10832
11066
  var normalizeTools = (tools) => {
10833
11067
  if (!tools) {
@@ -10847,7 +11081,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10847
11081
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
10848
11082
  if (!result.success) {
10849
11083
  throw new Error(
10850
- `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11084
+ `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10851
11085
  );
10852
11086
  }
10853
11087
  }
@@ -10859,7 +11093,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10859
11093
  }
10860
11094
  static getSettablePaths(_options = {}) {
10861
11095
  return {
10862
- relativeDirPath: (0, import_node_path83.join)(".github", "agents")
11096
+ relativeDirPath: (0, import_node_path84.join)(".github", "agents")
10863
11097
  };
10864
11098
  }
10865
11099
  getFrontmatter() {
@@ -10933,7 +11167,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10933
11167
  return {
10934
11168
  success: false,
10935
11169
  error: new Error(
10936
- `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11170
+ `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10937
11171
  )
10938
11172
  };
10939
11173
  }
@@ -10951,7 +11185,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10951
11185
  global = false
10952
11186
  }) {
10953
11187
  const paths = this.getSettablePaths({ global });
10954
- const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11188
+ const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10955
11189
  const fileContent = await readFileContent(filePath);
10956
11190
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10957
11191
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10987,11 +11221,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10987
11221
  };
10988
11222
 
10989
11223
  // src/features/subagents/cursor-subagent.ts
10990
- var import_node_path84 = require("path");
10991
- var import_mini42 = require("zod/mini");
10992
- var CursorSubagentFrontmatterSchema = import_mini42.z.looseObject({
10993
- name: import_mini42.z.string(),
10994
- description: import_mini42.z.string()
11224
+ var import_node_path85 = require("path");
11225
+ var import_mini43 = require("zod/mini");
11226
+ var CursorSubagentFrontmatterSchema = import_mini43.z.looseObject({
11227
+ name: import_mini43.z.string(),
11228
+ description: import_mini43.z.string()
10995
11229
  });
10996
11230
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10997
11231
  frontmatter;
@@ -11001,7 +11235,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11001
11235
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11002
11236
  if (!result.success) {
11003
11237
  throw new Error(
11004
- `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11238
+ `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11005
11239
  );
11006
11240
  }
11007
11241
  }
@@ -11013,7 +11247,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11013
11247
  }
11014
11248
  static getSettablePaths(_options = {}) {
11015
11249
  return {
11016
- relativeDirPath: (0, import_node_path84.join)(".cursor", "agents")
11250
+ relativeDirPath: (0, import_node_path85.join)(".cursor", "agents")
11017
11251
  };
11018
11252
  }
11019
11253
  getFrontmatter() {
@@ -11080,7 +11314,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11080
11314
  return {
11081
11315
  success: false,
11082
11316
  error: new Error(
11083
- `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11317
+ `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11084
11318
  )
11085
11319
  };
11086
11320
  }
@@ -11098,7 +11332,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11098
11332
  global = false
11099
11333
  }) {
11100
11334
  const paths = this.getSettablePaths({ global });
11101
- const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11335
+ const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11102
11336
  const fileContent = await readFileContent(filePath);
11103
11337
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11104
11338
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11134,23 +11368,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11134
11368
  };
11135
11369
 
11136
11370
  // src/features/subagents/kiro-subagent.ts
11137
- var import_node_path85 = require("path");
11138
- var import_mini43 = require("zod/mini");
11139
- var KiroCliSubagentJsonSchema = import_mini43.z.looseObject({
11140
- name: import_mini43.z.string(),
11141
- description: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11142
- prompt: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11143
- tools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11144
- toolAliases: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.string()))),
11145
- toolSettings: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11146
- toolSchema: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11147
- 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())))),
11148
- model: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11149
- mcpServers: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.unknown()))),
11150
- useLegacyMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean())),
11151
- resources: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11152
- allowedTools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11153
- includeMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean()))
11371
+ var import_node_path86 = require("path");
11372
+ var import_mini44 = require("zod/mini");
11373
+ var KiroCliSubagentJsonSchema = import_mini44.z.looseObject({
11374
+ name: import_mini44.z.string(),
11375
+ description: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11376
+ prompt: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11377
+ tools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11378
+ toolAliases: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.string()))),
11379
+ toolSettings: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11380
+ toolSchema: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11381
+ 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())))),
11382
+ model: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11383
+ mcpServers: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.unknown()))),
11384
+ useLegacyMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean())),
11385
+ resources: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11386
+ allowedTools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11387
+ includeMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean()))
11154
11388
  });
11155
11389
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11156
11390
  body;
@@ -11161,7 +11395,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11161
11395
  KiroCliSubagentJsonSchema.parse(parsed);
11162
11396
  } catch (error) {
11163
11397
  throw new Error(
11164
- `Invalid JSON in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11398
+ `Invalid JSON in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11165
11399
  { cause: error }
11166
11400
  );
11167
11401
  }
@@ -11173,7 +11407,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11173
11407
  }
11174
11408
  static getSettablePaths(_options = {}) {
11175
11409
  return {
11176
- relativeDirPath: (0, import_node_path85.join)(".kiro", "agents")
11410
+ relativeDirPath: (0, import_node_path86.join)(".kiro", "agents")
11177
11411
  };
11178
11412
  }
11179
11413
  getBody() {
@@ -11185,7 +11419,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11185
11419
  parsed = JSON.parse(this.body);
11186
11420
  } catch (error) {
11187
11421
  throw new Error(
11188
- `Failed to parse JSON in ${(0, import_node_path85.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11422
+ `Failed to parse JSON in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11189
11423
  { cause: error }
11190
11424
  );
11191
11425
  }
@@ -11266,7 +11500,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11266
11500
  global = false
11267
11501
  }) {
11268
11502
  const paths = this.getSettablePaths({ global });
11269
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11503
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11270
11504
  const fileContent = await readFileContent(filePath);
11271
11505
  const subagent = new _KiroSubagent({
11272
11506
  baseDir,
@@ -11304,12 +11538,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11304
11538
  };
11305
11539
 
11306
11540
  // src/features/subagents/opencode-subagent.ts
11307
- var import_node_path86 = require("path");
11308
- var import_mini44 = require("zod/mini");
11309
- var OpenCodeSubagentFrontmatterSchema = import_mini44.z.looseObject({
11310
- description: import_mini44.z.string(),
11311
- mode: import_mini44.z._default(import_mini44.z.string(), "subagent"),
11312
- name: import_mini44.z.optional(import_mini44.z.string())
11541
+ var import_node_path87 = require("path");
11542
+ var import_mini45 = require("zod/mini");
11543
+ var OpenCodeSubagentFrontmatterSchema = import_mini45.z.looseObject({
11544
+ description: import_mini45.z.string(),
11545
+ mode: import_mini45.z._default(import_mini45.z.string(), "subagent"),
11546
+ name: import_mini45.z.optional(import_mini45.z.string())
11313
11547
  });
11314
11548
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11315
11549
  frontmatter;
@@ -11319,7 +11553,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11319
11553
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11320
11554
  if (!result.success) {
11321
11555
  throw new Error(
11322
- `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11556
+ `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11323
11557
  );
11324
11558
  }
11325
11559
  }
@@ -11333,7 +11567,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11333
11567
  global = false
11334
11568
  } = {}) {
11335
11569
  return {
11336
- relativeDirPath: global ? (0, import_node_path86.join)(".config", "opencode", "agent") : (0, import_node_path86.join)(".opencode", "agent")
11570
+ relativeDirPath: global ? (0, import_node_path87.join)(".config", "opencode", "agent") : (0, import_node_path87.join)(".opencode", "agent")
11337
11571
  };
11338
11572
  }
11339
11573
  getFrontmatter() {
@@ -11346,7 +11580,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11346
11580
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
11347
11581
  const rulesyncFrontmatter = {
11348
11582
  targets: ["*"],
11349
- name: name ?? (0, import_node_path86.basename)(this.getRelativeFilePath(), ".md"),
11583
+ name: name ?? (0, import_node_path87.basename)(this.getRelativeFilePath(), ".md"),
11350
11584
  description,
11351
11585
  opencode: { mode, ...opencodeSection }
11352
11586
  };
@@ -11371,7 +11605,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11371
11605
  const opencodeFrontmatter = {
11372
11606
  ...opencodeSection,
11373
11607
  description: rulesyncFrontmatter.description,
11374
- mode: "subagent",
11608
+ mode: typeof opencodeSection.mode === "string" ? opencodeSection.mode : "subagent",
11375
11609
  ...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
11376
11610
  };
11377
11611
  const body = rulesyncSubagent.getBody();
@@ -11399,7 +11633,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11399
11633
  return {
11400
11634
  success: false,
11401
11635
  error: new Error(
11402
- `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11636
+ `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11403
11637
  )
11404
11638
  };
11405
11639
  }
@@ -11416,7 +11650,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11416
11650
  global = false
11417
11651
  }) {
11418
11652
  const paths = this.getSettablePaths({ global });
11419
- const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11653
+ const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11420
11654
  const fileContent = await readFileContent(filePath);
11421
11655
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11422
11656
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11465,7 +11699,7 @@ var subagentsProcessorToolTargetTuple = [
11465
11699
  "opencode",
11466
11700
  "roo"
11467
11701
  ];
11468
- var SubagentsProcessorToolTargetSchema = import_mini45.z.enum(subagentsProcessorToolTargetTuple);
11702
+ var SubagentsProcessorToolTargetSchema = import_mini46.z.enum(subagentsProcessorToolTargetTuple);
11469
11703
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11470
11704
  [
11471
11705
  "agentsmd",
@@ -11627,7 +11861,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11627
11861
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11628
11862
  */
11629
11863
  async loadRulesyncFiles() {
11630
- const subagentsDir = (0, import_node_path87.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11864
+ const subagentsDir = (0, import_node_path88.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11631
11865
  const dirExists = await directoryExists(subagentsDir);
11632
11866
  if (!dirExists) {
11633
11867
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11642,7 +11876,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11642
11876
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
11643
11877
  const rulesyncSubagents = [];
11644
11878
  for (const mdFile of mdFiles) {
11645
- const filepath = (0, import_node_path87.join)(subagentsDir, mdFile);
11879
+ const filepath = (0, import_node_path88.join)(subagentsDir, mdFile);
11646
11880
  try {
11647
11881
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
11648
11882
  relativeFilePath: mdFile,
@@ -11672,14 +11906,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
11672
11906
  const factory = this.getFactory(this.toolTarget);
11673
11907
  const paths = factory.class.getSettablePaths({ global: this.global });
11674
11908
  const subagentFilePaths = await findFilesByGlobs(
11675
- (0, import_node_path87.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11909
+ (0, import_node_path88.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11676
11910
  );
11677
11911
  if (forDeletion) {
11678
11912
  const toolSubagents2 = subagentFilePaths.map(
11679
11913
  (path4) => factory.class.forDeletion({
11680
11914
  baseDir: this.baseDir,
11681
11915
  relativeDirPath: paths.relativeDirPath,
11682
- relativeFilePath: (0, import_node_path87.basename)(path4),
11916
+ relativeFilePath: (0, import_node_path88.basename)(path4),
11683
11917
  global: this.global
11684
11918
  })
11685
11919
  ).filter((subagent) => subagent.isDeletable());
@@ -11692,7 +11926,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11692
11926
  subagentFilePaths.map(
11693
11927
  (path4) => factory.class.fromFile({
11694
11928
  baseDir: this.baseDir,
11695
- relativeFilePath: (0, import_node_path87.basename)(path4),
11929
+ relativeFilePath: (0, import_node_path88.basename)(path4),
11696
11930
  global: this.global
11697
11931
  })
11698
11932
  )
@@ -11737,49 +11971,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
11737
11971
  };
11738
11972
 
11739
11973
  // src/features/rules/agentsmd-rule.ts
11740
- var import_node_path90 = require("path");
11974
+ var import_node_path91 = require("path");
11741
11975
 
11742
11976
  // src/features/rules/tool-rule.ts
11743
- var import_node_path89 = require("path");
11977
+ var import_node_path90 = require("path");
11744
11978
 
11745
11979
  // src/features/rules/rulesync-rule.ts
11746
- var import_node_path88 = require("path");
11747
- var import_mini46 = require("zod/mini");
11748
- var RulesyncRuleFrontmatterSchema = import_mini46.z.object({
11749
- root: import_mini46.z.optional(import_mini46.z.boolean()),
11750
- localRoot: import_mini46.z.optional(import_mini46.z.boolean()),
11751
- targets: import_mini46.z._default(RulesyncTargetsSchema, ["*"]),
11752
- description: import_mini46.z.optional(import_mini46.z.string()),
11753
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string())),
11754
- agentsmd: import_mini46.z.optional(
11755
- import_mini46.z.object({
11980
+ var import_node_path89 = require("path");
11981
+ var import_mini47 = require("zod/mini");
11982
+ var RulesyncRuleFrontmatterSchema = import_mini47.z.object({
11983
+ root: import_mini47.z.optional(import_mini47.z.boolean()),
11984
+ localRoot: import_mini47.z.optional(import_mini47.z.boolean()),
11985
+ targets: import_mini47.z._default(RulesyncTargetsSchema, ["*"]),
11986
+ description: import_mini47.z.optional(import_mini47.z.string()),
11987
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string())),
11988
+ agentsmd: import_mini47.z.optional(
11989
+ import_mini47.z.object({
11756
11990
  // @example "path/to/subproject"
11757
- subprojectPath: import_mini46.z.optional(import_mini46.z.string())
11991
+ subprojectPath: import_mini47.z.optional(import_mini47.z.string())
11758
11992
  })
11759
11993
  ),
11760
- claudecode: import_mini46.z.optional(
11761
- import_mini46.z.object({
11994
+ claudecode: import_mini47.z.optional(
11995
+ import_mini47.z.object({
11762
11996
  // Glob patterns for conditional rules (takes precedence over globs)
11763
11997
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
11764
- paths: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
11998
+ paths: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11765
11999
  })
11766
12000
  ),
11767
- cursor: import_mini46.z.optional(
11768
- import_mini46.z.object({
11769
- alwaysApply: import_mini46.z.optional(import_mini46.z.boolean()),
11770
- description: import_mini46.z.optional(import_mini46.z.string()),
11771
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12001
+ cursor: import_mini47.z.optional(
12002
+ import_mini47.z.object({
12003
+ alwaysApply: import_mini47.z.optional(import_mini47.z.boolean()),
12004
+ description: import_mini47.z.optional(import_mini47.z.string()),
12005
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11772
12006
  })
11773
12007
  ),
11774
- copilot: import_mini46.z.optional(
11775
- import_mini46.z.object({
11776
- excludeAgent: import_mini46.z.optional(import_mini46.z.union([import_mini46.z.literal("code-review"), import_mini46.z.literal("coding-agent")]))
12008
+ copilot: import_mini47.z.optional(
12009
+ import_mini47.z.object({
12010
+ excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
11777
12011
  })
11778
12012
  ),
11779
- antigravity: import_mini46.z.optional(
11780
- import_mini46.z.looseObject({
11781
- trigger: import_mini46.z.optional(import_mini46.z.string()),
11782
- globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12013
+ antigravity: import_mini47.z.optional(
12014
+ import_mini47.z.looseObject({
12015
+ trigger: import_mini47.z.optional(import_mini47.z.string()),
12016
+ globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
11783
12017
  })
11784
12018
  )
11785
12019
  });
@@ -11790,7 +12024,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11790
12024
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
11791
12025
  if (!parseResult.success && rest.validate !== false) {
11792
12026
  throw new Error(
11793
- `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12027
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11794
12028
  );
11795
12029
  }
11796
12030
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -11825,7 +12059,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11825
12059
  return {
11826
12060
  success: false,
11827
12061
  error: new Error(
11828
- `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12062
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11829
12063
  )
11830
12064
  };
11831
12065
  }
@@ -11834,7 +12068,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11834
12068
  relativeFilePath,
11835
12069
  validate = true
11836
12070
  }) {
11837
- const filePath = (0, import_node_path88.join)(
12071
+ const filePath = (0, import_node_path89.join)(
11838
12072
  process.cwd(),
11839
12073
  this.getSettablePaths().recommended.relativeDirPath,
11840
12074
  relativeFilePath
@@ -11936,7 +12170,7 @@ var ToolRule = class extends ToolFile {
11936
12170
  rulesyncRule,
11937
12171
  validate = true,
11938
12172
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
11939
- nonRootPath = { relativeDirPath: (0, import_node_path89.join)(".agents", "memories") }
12173
+ nonRootPath = { relativeDirPath: (0, import_node_path90.join)(".agents", "memories") }
11940
12174
  }) {
11941
12175
  const params = this.buildToolRuleParamsDefault({
11942
12176
  baseDir,
@@ -11947,7 +12181,7 @@ var ToolRule = class extends ToolFile {
11947
12181
  });
11948
12182
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
11949
12183
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
11950
- params.relativeDirPath = (0, import_node_path89.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12184
+ params.relativeDirPath = (0, import_node_path90.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
11951
12185
  params.relativeFilePath = "AGENTS.md";
11952
12186
  }
11953
12187
  return params;
@@ -11996,7 +12230,7 @@ var ToolRule = class extends ToolFile {
11996
12230
  }
11997
12231
  };
11998
12232
  function buildToolPath(toolDir, subDir, excludeToolDir) {
11999
- return excludeToolDir ? subDir : (0, import_node_path89.join)(toolDir, subDir);
12233
+ return excludeToolDir ? subDir : (0, import_node_path90.join)(toolDir, subDir);
12000
12234
  }
12001
12235
 
12002
12236
  // src/features/rules/agentsmd-rule.ts
@@ -12025,8 +12259,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12025
12259
  validate = true
12026
12260
  }) {
12027
12261
  const isRoot = relativeFilePath === "AGENTS.md";
12028
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path90.join)(".agents", "memories", relativeFilePath);
12029
- const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
12262
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path91.join)(".agents", "memories", relativeFilePath);
12263
+ const fileContent = await readFileContent((0, import_node_path91.join)(baseDir, relativePath));
12030
12264
  return new _AgentsMdRule({
12031
12265
  baseDir,
12032
12266
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -12081,21 +12315,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12081
12315
  };
12082
12316
 
12083
12317
  // src/features/rules/antigravity-rule.ts
12084
- var import_node_path91 = require("path");
12085
- var import_mini47 = require("zod/mini");
12086
- var AntigravityRuleFrontmatterSchema = import_mini47.z.looseObject({
12087
- trigger: import_mini47.z.optional(
12088
- import_mini47.z.union([
12089
- import_mini47.z.literal("always_on"),
12090
- import_mini47.z.literal("glob"),
12091
- import_mini47.z.literal("manual"),
12092
- import_mini47.z.literal("model_decision"),
12093
- import_mini47.z.string()
12318
+ var import_node_path92 = require("path");
12319
+ var import_mini48 = require("zod/mini");
12320
+ var AntigravityRuleFrontmatterSchema = import_mini48.z.looseObject({
12321
+ trigger: import_mini48.z.optional(
12322
+ import_mini48.z.union([
12323
+ import_mini48.z.literal("always_on"),
12324
+ import_mini48.z.literal("glob"),
12325
+ import_mini48.z.literal("manual"),
12326
+ import_mini48.z.literal("model_decision"),
12327
+ import_mini48.z.string()
12094
12328
  // accepts any string for forward compatibility
12095
12329
  ])
12096
12330
  ),
12097
- globs: import_mini47.z.optional(import_mini47.z.string()),
12098
- description: import_mini47.z.optional(import_mini47.z.string())
12331
+ globs: import_mini48.z.optional(import_mini48.z.string()),
12332
+ description: import_mini48.z.optional(import_mini48.z.string())
12099
12333
  });
12100
12334
  function parseGlobsString(globs) {
12101
12335
  if (!globs) {
@@ -12240,7 +12474,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12240
12474
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
12241
12475
  if (!result.success) {
12242
12476
  throw new Error(
12243
- `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12477
+ `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12244
12478
  );
12245
12479
  }
12246
12480
  }
@@ -12264,7 +12498,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12264
12498
  relativeFilePath,
12265
12499
  validate = true
12266
12500
  }) {
12267
- const filePath = (0, import_node_path91.join)(
12501
+ const filePath = (0, import_node_path92.join)(
12268
12502
  baseDir,
12269
12503
  this.getSettablePaths().nonRoot.relativeDirPath,
12270
12504
  relativeFilePath
@@ -12405,7 +12639,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12405
12639
  };
12406
12640
 
12407
12641
  // src/features/rules/augmentcode-legacy-rule.ts
12408
- var import_node_path92 = require("path");
12642
+ var import_node_path93 = require("path");
12409
12643
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12410
12644
  toRulesyncRule() {
12411
12645
  const rulesyncFrontmatter = {
@@ -12466,8 +12700,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12466
12700
  }) {
12467
12701
  const settablePaths = this.getSettablePaths();
12468
12702
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12469
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path92.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12470
- const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
12703
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path93.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12704
+ const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
12471
12705
  return new _AugmentcodeLegacyRule({
12472
12706
  baseDir,
12473
12707
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12496,7 +12730,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12496
12730
  };
12497
12731
 
12498
12732
  // src/features/rules/augmentcode-rule.ts
12499
- var import_node_path93 = require("path");
12733
+ var import_node_path94 = require("path");
12500
12734
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12501
12735
  toRulesyncRule() {
12502
12736
  return this.toRulesyncRuleDefault();
@@ -12527,7 +12761,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12527
12761
  relativeFilePath,
12528
12762
  validate = true
12529
12763
  }) {
12530
- const filePath = (0, import_node_path93.join)(
12764
+ const filePath = (0, import_node_path94.join)(
12531
12765
  baseDir,
12532
12766
  this.getSettablePaths().nonRoot.relativeDirPath,
12533
12767
  relativeFilePath
@@ -12567,7 +12801,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12567
12801
  };
12568
12802
 
12569
12803
  // src/features/rules/claudecode-legacy-rule.ts
12570
- var import_node_path94 = require("path");
12804
+ var import_node_path95 = require("path");
12571
12805
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12572
12806
  static getSettablePaths({
12573
12807
  global,
@@ -12602,7 +12836,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12602
12836
  if (isRoot) {
12603
12837
  const relativePath2 = paths.root.relativeFilePath;
12604
12838
  const fileContent2 = await readFileContent(
12605
- (0, import_node_path94.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12839
+ (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12606
12840
  );
12607
12841
  return new _ClaudecodeLegacyRule({
12608
12842
  baseDir,
@@ -12616,8 +12850,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12616
12850
  if (!paths.nonRoot) {
12617
12851
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12618
12852
  }
12619
- const relativePath = (0, import_node_path94.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12620
- const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
12853
+ const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12854
+ const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
12621
12855
  return new _ClaudecodeLegacyRule({
12622
12856
  baseDir,
12623
12857
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12676,10 +12910,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12676
12910
  };
12677
12911
 
12678
12912
  // src/features/rules/claudecode-rule.ts
12679
- var import_node_path95 = require("path");
12680
- var import_mini48 = require("zod/mini");
12681
- var ClaudecodeRuleFrontmatterSchema = import_mini48.z.object({
12682
- paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12913
+ var import_node_path96 = require("path");
12914
+ var import_mini49 = require("zod/mini");
12915
+ var ClaudecodeRuleFrontmatterSchema = import_mini49.z.object({
12916
+ paths: import_mini49.z.optional(import_mini49.z.array(import_mini49.z.string()))
12683
12917
  });
12684
12918
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12685
12919
  frontmatter;
@@ -12711,7 +12945,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12711
12945
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12712
12946
  if (!result.success) {
12713
12947
  throw new Error(
12714
- `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12948
+ `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12715
12949
  );
12716
12950
  }
12717
12951
  }
@@ -12739,7 +12973,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12739
12973
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
12740
12974
  if (isRoot) {
12741
12975
  const fileContent2 = await readFileContent(
12742
- (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
12976
+ (0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
12743
12977
  );
12744
12978
  return new _ClaudecodeRule({
12745
12979
  baseDir,
@@ -12754,16 +12988,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12754
12988
  if (!paths.nonRoot) {
12755
12989
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12756
12990
  }
12757
- const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12758
- const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
12991
+ const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12992
+ const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
12759
12993
  const { frontmatter, body: content } = parseFrontmatter(
12760
12994
  fileContent,
12761
- (0, import_node_path95.join)(baseDir, relativePath)
12995
+ (0, import_node_path96.join)(baseDir, relativePath)
12762
12996
  );
12763
12997
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12764
12998
  if (!result.success) {
12765
12999
  throw new Error(
12766
- `Invalid frontmatter in ${(0, import_node_path95.join)(baseDir, relativePath)}: ${formatError(result.error)}`
13000
+ `Invalid frontmatter in ${(0, import_node_path96.join)(baseDir, relativePath)}: ${formatError(result.error)}`
12767
13001
  );
12768
13002
  }
12769
13003
  return new _ClaudecodeRule({
@@ -12870,7 +13104,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12870
13104
  return {
12871
13105
  success: false,
12872
13106
  error: new Error(
12873
- `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13107
+ `Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12874
13108
  )
12875
13109
  };
12876
13110
  }
@@ -12890,10 +13124,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12890
13124
  };
12891
13125
 
12892
13126
  // src/features/rules/cline-rule.ts
12893
- var import_node_path96 = require("path");
12894
- var import_mini49 = require("zod/mini");
12895
- var ClineRuleFrontmatterSchema = import_mini49.z.object({
12896
- description: import_mini49.z.string()
13127
+ var import_node_path97 = require("path");
13128
+ var import_mini50 = require("zod/mini");
13129
+ var ClineRuleFrontmatterSchema = import_mini50.z.object({
13130
+ description: import_mini50.z.string()
12897
13131
  });
12898
13132
  var ClineRule = class _ClineRule extends ToolRule {
12899
13133
  static getSettablePaths(_options = {}) {
@@ -12936,7 +13170,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12936
13170
  validate = true
12937
13171
  }) {
12938
13172
  const fileContent = await readFileContent(
12939
- (0, import_node_path96.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13173
+ (0, import_node_path97.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
12940
13174
  );
12941
13175
  return new _ClineRule({
12942
13176
  baseDir,
@@ -12962,7 +13196,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12962
13196
  };
12963
13197
 
12964
13198
  // src/features/rules/codexcli-rule.ts
12965
- var import_node_path97 = require("path");
13199
+ var import_node_path98 = require("path");
12966
13200
  var CodexcliRule = class _CodexcliRule extends ToolRule {
12967
13201
  static getSettablePaths({
12968
13202
  global,
@@ -12997,7 +13231,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12997
13231
  if (isRoot) {
12998
13232
  const relativePath2 = paths.root.relativeFilePath;
12999
13233
  const fileContent2 = await readFileContent(
13000
- (0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13234
+ (0, import_node_path98.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13001
13235
  );
13002
13236
  return new _CodexcliRule({
13003
13237
  baseDir,
@@ -13011,8 +13245,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13011
13245
  if (!paths.nonRoot) {
13012
13246
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13013
13247
  }
13014
- const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13015
- const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
13248
+ const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13249
+ const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13016
13250
  return new _CodexcliRule({
13017
13251
  baseDir,
13018
13252
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13071,12 +13305,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13071
13305
  };
13072
13306
 
13073
13307
  // src/features/rules/copilot-rule.ts
13074
- var import_node_path98 = require("path");
13075
- var import_mini50 = require("zod/mini");
13076
- var CopilotRuleFrontmatterSchema = import_mini50.z.object({
13077
- description: import_mini50.z.optional(import_mini50.z.string()),
13078
- applyTo: import_mini50.z.optional(import_mini50.z.string()),
13079
- excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
13308
+ var import_node_path99 = require("path");
13309
+ var import_mini51 = require("zod/mini");
13310
+ var CopilotRuleFrontmatterSchema = import_mini51.z.object({
13311
+ description: import_mini51.z.optional(import_mini51.z.string()),
13312
+ applyTo: import_mini51.z.optional(import_mini51.z.string()),
13313
+ excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
13080
13314
  });
13081
13315
  var CopilotRule = class _CopilotRule extends ToolRule {
13082
13316
  frontmatter;
@@ -13105,7 +13339,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13105
13339
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13106
13340
  if (!result.success) {
13107
13341
  throw new Error(
13108
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13342
+ `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13109
13343
  );
13110
13344
  }
13111
13345
  }
@@ -13195,8 +13429,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13195
13429
  const paths = this.getSettablePaths({ global });
13196
13430
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13197
13431
  if (isRoot) {
13198
- const relativePath2 = (0, import_node_path98.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13199
- const fileContent2 = await readFileContent((0, import_node_path98.join)(baseDir, relativePath2));
13432
+ const relativePath2 = (0, import_node_path99.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13433
+ const fileContent2 = await readFileContent((0, import_node_path99.join)(baseDir, relativePath2));
13200
13434
  return new _CopilotRule({
13201
13435
  baseDir,
13202
13436
  relativeDirPath: paths.root.relativeDirPath,
@@ -13210,16 +13444,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13210
13444
  if (!paths.nonRoot) {
13211
13445
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13212
13446
  }
13213
- const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13214
- const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13447
+ const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13448
+ const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13215
13449
  const { frontmatter, body: content } = parseFrontmatter(
13216
13450
  fileContent,
13217
- (0, import_node_path98.join)(baseDir, relativePath)
13451
+ (0, import_node_path99.join)(baseDir, relativePath)
13218
13452
  );
13219
13453
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13220
13454
  if (!result.success) {
13221
13455
  throw new Error(
13222
- `Invalid frontmatter in ${(0, import_node_path98.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13456
+ `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13223
13457
  );
13224
13458
  }
13225
13459
  return new _CopilotRule({
@@ -13261,7 +13495,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13261
13495
  return {
13262
13496
  success: false,
13263
13497
  error: new Error(
13264
- `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13498
+ `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13265
13499
  )
13266
13500
  };
13267
13501
  }
@@ -13281,12 +13515,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13281
13515
  };
13282
13516
 
13283
13517
  // src/features/rules/cursor-rule.ts
13284
- var import_node_path99 = require("path");
13285
- var import_mini51 = require("zod/mini");
13286
- var CursorRuleFrontmatterSchema = import_mini51.z.object({
13287
- description: import_mini51.z.optional(import_mini51.z.string()),
13288
- globs: import_mini51.z.optional(import_mini51.z.string()),
13289
- alwaysApply: import_mini51.z.optional(import_mini51.z.boolean())
13518
+ var import_node_path100 = require("path");
13519
+ var import_mini52 = require("zod/mini");
13520
+ var CursorRuleFrontmatterSchema = import_mini52.z.object({
13521
+ description: import_mini52.z.optional(import_mini52.z.string()),
13522
+ globs: import_mini52.z.optional(import_mini52.z.string()),
13523
+ alwaysApply: import_mini52.z.optional(import_mini52.z.boolean())
13290
13524
  });
13291
13525
  var CursorRule = class _CursorRule extends ToolRule {
13292
13526
  frontmatter;
@@ -13303,7 +13537,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13303
13537
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13304
13538
  if (!result.success) {
13305
13539
  throw new Error(
13306
- `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13540
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13307
13541
  );
13308
13542
  }
13309
13543
  }
@@ -13419,7 +13653,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13419
13653
  relativeFilePath,
13420
13654
  validate = true
13421
13655
  }) {
13422
- const filePath = (0, import_node_path99.join)(
13656
+ const filePath = (0, import_node_path100.join)(
13423
13657
  baseDir,
13424
13658
  this.getSettablePaths().nonRoot.relativeDirPath,
13425
13659
  relativeFilePath
@@ -13429,7 +13663,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13429
13663
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13430
13664
  if (!result.success) {
13431
13665
  throw new Error(
13432
- `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13666
+ `Invalid frontmatter in ${(0, import_node_path100.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13433
13667
  );
13434
13668
  }
13435
13669
  return new _CursorRule({
@@ -13466,7 +13700,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13466
13700
  return {
13467
13701
  success: false,
13468
13702
  error: new Error(
13469
- `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13703
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13470
13704
  )
13471
13705
  };
13472
13706
  }
@@ -13486,7 +13720,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13486
13720
  };
13487
13721
 
13488
13722
  // src/features/rules/factorydroid-rule.ts
13489
- var import_node_path100 = require("path");
13723
+ var import_node_path101 = require("path");
13490
13724
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13491
13725
  constructor({ fileContent, root, ...rest }) {
13492
13726
  super({
@@ -13526,8 +13760,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13526
13760
  const paths = this.getSettablePaths({ global });
13527
13761
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13528
13762
  if (isRoot) {
13529
- const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13530
- const fileContent2 = await readFileContent((0, import_node_path100.join)(baseDir, relativePath2));
13763
+ const relativePath2 = (0, import_node_path101.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13764
+ const fileContent2 = await readFileContent((0, import_node_path101.join)(baseDir, relativePath2));
13531
13765
  return new _FactorydroidRule({
13532
13766
  baseDir,
13533
13767
  relativeDirPath: paths.root.relativeDirPath,
@@ -13540,8 +13774,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13540
13774
  if (!paths.nonRoot) {
13541
13775
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13542
13776
  }
13543
- const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13544
- const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13777
+ const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13778
+ const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13545
13779
  return new _FactorydroidRule({
13546
13780
  baseDir,
13547
13781
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13600,7 +13834,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13600
13834
  };
13601
13835
 
13602
13836
  // src/features/rules/geminicli-rule.ts
13603
- var import_node_path101 = require("path");
13837
+ var import_node_path102 = require("path");
13604
13838
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13605
13839
  static getSettablePaths({
13606
13840
  global,
@@ -13635,7 +13869,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13635
13869
  if (isRoot) {
13636
13870
  const relativePath2 = paths.root.relativeFilePath;
13637
13871
  const fileContent2 = await readFileContent(
13638
- (0, import_node_path101.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13872
+ (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13639
13873
  );
13640
13874
  return new _GeminiCliRule({
13641
13875
  baseDir,
@@ -13649,8 +13883,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13649
13883
  if (!paths.nonRoot) {
13650
13884
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13651
13885
  }
13652
- const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13653
- const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13886
+ const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13887
+ const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13654
13888
  return new _GeminiCliRule({
13655
13889
  baseDir,
13656
13890
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13709,7 +13943,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13709
13943
  };
13710
13944
 
13711
13945
  // src/features/rules/goose-rule.ts
13712
- var import_node_path102 = require("path");
13946
+ var import_node_path103 = require("path");
13713
13947
  var GooseRule = class _GooseRule extends ToolRule {
13714
13948
  static getSettablePaths({
13715
13949
  global,
@@ -13744,7 +13978,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13744
13978
  if (isRoot) {
13745
13979
  const relativePath2 = paths.root.relativeFilePath;
13746
13980
  const fileContent2 = await readFileContent(
13747
- (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13981
+ (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13748
13982
  );
13749
13983
  return new _GooseRule({
13750
13984
  baseDir,
@@ -13758,8 +13992,8 @@ var GooseRule = class _GooseRule extends ToolRule {
13758
13992
  if (!paths.nonRoot) {
13759
13993
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13760
13994
  }
13761
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13762
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13995
+ const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13996
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13763
13997
  return new _GooseRule({
13764
13998
  baseDir,
13765
13999
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13818,7 +14052,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13818
14052
  };
13819
14053
 
13820
14054
  // src/features/rules/junie-rule.ts
13821
- var import_node_path103 = require("path");
14055
+ var import_node_path104 = require("path");
13822
14056
  var JunieRule = class _JunieRule extends ToolRule {
13823
14057
  static getSettablePaths(_options = {}) {
13824
14058
  return {
@@ -13837,8 +14071,8 @@ var JunieRule = class _JunieRule extends ToolRule {
13837
14071
  validate = true
13838
14072
  }) {
13839
14073
  const isRoot = relativeFilePath === "guidelines.md";
13840
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path103.join)(".junie", "memories", relativeFilePath);
13841
- const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
14074
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path104.join)(".junie", "memories", relativeFilePath);
14075
+ const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
13842
14076
  return new _JunieRule({
13843
14077
  baseDir,
13844
14078
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13893,7 +14127,7 @@ var JunieRule = class _JunieRule extends ToolRule {
13893
14127
  };
13894
14128
 
13895
14129
  // src/features/rules/kilo-rule.ts
13896
- var import_node_path104 = require("path");
14130
+ var import_node_path105 = require("path");
13897
14131
  var KiloRule = class _KiloRule extends ToolRule {
13898
14132
  static getSettablePaths(_options = {}) {
13899
14133
  return {
@@ -13908,7 +14142,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13908
14142
  validate = true
13909
14143
  }) {
13910
14144
  const fileContent = await readFileContent(
13911
- (0, import_node_path104.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14145
+ (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13912
14146
  );
13913
14147
  return new _KiloRule({
13914
14148
  baseDir,
@@ -13960,7 +14194,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13960
14194
  };
13961
14195
 
13962
14196
  // src/features/rules/kiro-rule.ts
13963
- var import_node_path105 = require("path");
14197
+ var import_node_path106 = require("path");
13964
14198
  var KiroRule = class _KiroRule extends ToolRule {
13965
14199
  static getSettablePaths(_options = {}) {
13966
14200
  return {
@@ -13975,7 +14209,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13975
14209
  validate = true
13976
14210
  }) {
13977
14211
  const fileContent = await readFileContent(
13978
- (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14212
+ (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13979
14213
  );
13980
14214
  return new _KiroRule({
13981
14215
  baseDir,
@@ -14029,7 +14263,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14029
14263
  };
14030
14264
 
14031
14265
  // src/features/rules/opencode-rule.ts
14032
- var import_node_path106 = require("path");
14266
+ var import_node_path107 = require("path");
14033
14267
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14034
14268
  static getSettablePaths({
14035
14269
  global,
@@ -14064,7 +14298,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14064
14298
  if (isRoot) {
14065
14299
  const relativePath2 = paths.root.relativeFilePath;
14066
14300
  const fileContent2 = await readFileContent(
14067
- (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14301
+ (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14068
14302
  );
14069
14303
  return new _OpenCodeRule({
14070
14304
  baseDir,
@@ -14078,8 +14312,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14078
14312
  if (!paths.nonRoot) {
14079
14313
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14080
14314
  }
14081
- const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14082
- const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14315
+ const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14316
+ const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14083
14317
  return new _OpenCodeRule({
14084
14318
  baseDir,
14085
14319
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14138,7 +14372,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14138
14372
  };
14139
14373
 
14140
14374
  // src/features/rules/qwencode-rule.ts
14141
- var import_node_path107 = require("path");
14375
+ var import_node_path108 = require("path");
14142
14376
  var QwencodeRule = class _QwencodeRule extends ToolRule {
14143
14377
  static getSettablePaths(_options = {}) {
14144
14378
  return {
@@ -14157,8 +14391,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14157
14391
  validate = true
14158
14392
  }) {
14159
14393
  const isRoot = relativeFilePath === "QWEN.md";
14160
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path107.join)(".qwen", "memories", relativeFilePath);
14161
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14394
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path108.join)(".qwen", "memories", relativeFilePath);
14395
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14162
14396
  return new _QwencodeRule({
14163
14397
  baseDir,
14164
14398
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14210,7 +14444,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14210
14444
  };
14211
14445
 
14212
14446
  // src/features/rules/replit-rule.ts
14213
- var import_node_path108 = require("path");
14447
+ var import_node_path109 = require("path");
14214
14448
  var ReplitRule = class _ReplitRule extends ToolRule {
14215
14449
  static getSettablePaths(_options = {}) {
14216
14450
  return {
@@ -14232,7 +14466,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14232
14466
  }
14233
14467
  const relativePath = paths.root.relativeFilePath;
14234
14468
  const fileContent = await readFileContent(
14235
- (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath)
14469
+ (0, import_node_path109.join)(baseDir, paths.root.relativeDirPath, relativePath)
14236
14470
  );
14237
14471
  return new _ReplitRule({
14238
14472
  baseDir,
@@ -14298,7 +14532,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14298
14532
  };
14299
14533
 
14300
14534
  // src/features/rules/roo-rule.ts
14301
- var import_node_path109 = require("path");
14535
+ var import_node_path110 = require("path");
14302
14536
  var RooRule = class _RooRule extends ToolRule {
14303
14537
  static getSettablePaths(_options = {}) {
14304
14538
  return {
@@ -14313,7 +14547,7 @@ var RooRule = class _RooRule extends ToolRule {
14313
14547
  validate = true
14314
14548
  }) {
14315
14549
  const fileContent = await readFileContent(
14316
- (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14550
+ (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14317
14551
  );
14318
14552
  return new _RooRule({
14319
14553
  baseDir,
@@ -14382,7 +14616,7 @@ var RooRule = class _RooRule extends ToolRule {
14382
14616
  };
14383
14617
 
14384
14618
  // src/features/rules/warp-rule.ts
14385
- var import_node_path110 = require("path");
14619
+ var import_node_path111 = require("path");
14386
14620
  var WarpRule = class _WarpRule extends ToolRule {
14387
14621
  constructor({ fileContent, root, ...rest }) {
14388
14622
  super({
@@ -14408,8 +14642,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14408
14642
  validate = true
14409
14643
  }) {
14410
14644
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14411
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path110.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14412
- const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
14645
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path111.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14646
+ const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
14413
14647
  return new _WarpRule({
14414
14648
  baseDir,
14415
14649
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14464,7 +14698,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14464
14698
  };
14465
14699
 
14466
14700
  // src/features/rules/windsurf-rule.ts
14467
- var import_node_path111 = require("path");
14701
+ var import_node_path112 = require("path");
14468
14702
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14469
14703
  static getSettablePaths(_options = {}) {
14470
14704
  return {
@@ -14479,7 +14713,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14479
14713
  validate = true
14480
14714
  }) {
14481
14715
  const fileContent = await readFileContent(
14482
- (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14716
+ (0, import_node_path112.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14483
14717
  );
14484
14718
  return new _WindsurfRule({
14485
14719
  baseDir,
@@ -14555,8 +14789,8 @@ var rulesProcessorToolTargets = [
14555
14789
  "warp",
14556
14790
  "windsurf"
14557
14791
  ];
14558
- var RulesProcessorToolTargetSchema = import_mini52.z.enum(rulesProcessorToolTargets);
14559
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path112.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14792
+ var RulesProcessorToolTargetSchema = import_mini53.z.enum(rulesProcessorToolTargets);
14793
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path113.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14560
14794
  var toolRuleFactories = /* @__PURE__ */ new Map([
14561
14795
  [
14562
14796
  "agentsmd",
@@ -14931,7 +15165,7 @@ var RulesProcessor = class extends FeatureProcessor {
14931
15165
  }).relativeDirPath;
14932
15166
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
14933
15167
  const frontmatter = skill.getFrontmatter();
14934
- const relativePath = (0, import_node_path112.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15168
+ const relativePath = (0, import_node_path113.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14935
15169
  return {
14936
15170
  name: frontmatter.name,
14937
15171
  description: frontmatter.description,
@@ -15044,12 +15278,12 @@ var RulesProcessor = class extends FeatureProcessor {
15044
15278
  * Load and parse rulesync rule files from .rulesync/rules/ directory
15045
15279
  */
15046
15280
  async loadRulesyncFiles() {
15047
- const rulesyncBaseDir = (0, import_node_path112.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15048
- const files = await findFilesByGlobs((0, import_node_path112.join)(rulesyncBaseDir, "**", "*.md"));
15281
+ const rulesyncBaseDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15282
+ const files = await findFilesByGlobs((0, import_node_path113.join)(rulesyncBaseDir, "**", "*.md"));
15049
15283
  logger.debug(`Found ${files.length} rulesync files`);
15050
15284
  const rulesyncRules = await Promise.all(
15051
15285
  files.map((file) => {
15052
- const relativeFilePath = (0, import_node_path112.relative)(rulesyncBaseDir, file);
15286
+ const relativeFilePath = (0, import_node_path113.relative)(rulesyncBaseDir, file);
15053
15287
  checkPathTraversal({
15054
15288
  relativePath: relativeFilePath,
15055
15289
  intendedRootDir: rulesyncBaseDir
@@ -15112,7 +15346,7 @@ var RulesProcessor = class extends FeatureProcessor {
15112
15346
  return [];
15113
15347
  }
15114
15348
  const rootFilePaths = await findFilesByGlobs(
15115
- (0, import_node_path112.join)(
15349
+ (0, import_node_path113.join)(
15116
15350
  this.baseDir,
15117
15351
  settablePaths.root.relativeDirPath ?? ".",
15118
15352
  settablePaths.root.relativeFilePath
@@ -15123,7 +15357,7 @@ var RulesProcessor = class extends FeatureProcessor {
15123
15357
  (filePath) => factory.class.forDeletion({
15124
15358
  baseDir: this.baseDir,
15125
15359
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15126
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15360
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15127
15361
  global: this.global
15128
15362
  })
15129
15363
  ).filter((rule) => rule.isDeletable());
@@ -15132,7 +15366,7 @@ var RulesProcessor = class extends FeatureProcessor {
15132
15366
  rootFilePaths.map(
15133
15367
  (filePath) => factory.class.fromFile({
15134
15368
  baseDir: this.baseDir,
15135
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15369
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15136
15370
  global: this.global
15137
15371
  })
15138
15372
  )
@@ -15150,13 +15384,13 @@ var RulesProcessor = class extends FeatureProcessor {
15150
15384
  return [];
15151
15385
  }
15152
15386
  const localRootFilePaths = await findFilesByGlobs(
15153
- (0, import_node_path112.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15387
+ (0, import_node_path113.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15154
15388
  );
15155
15389
  return localRootFilePaths.map(
15156
15390
  (filePath) => factory.class.forDeletion({
15157
15391
  baseDir: this.baseDir,
15158
15392
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15159
- relativeFilePath: (0, import_node_path112.basename)(filePath),
15393
+ relativeFilePath: (0, import_node_path113.basename)(filePath),
15160
15394
  global: this.global
15161
15395
  })
15162
15396
  ).filter((rule) => rule.isDeletable());
@@ -15166,13 +15400,13 @@ var RulesProcessor = class extends FeatureProcessor {
15166
15400
  if (!settablePaths.nonRoot) {
15167
15401
  return [];
15168
15402
  }
15169
- const nonRootBaseDir = (0, import_node_path112.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15403
+ const nonRootBaseDir = (0, import_node_path113.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15170
15404
  const nonRootFilePaths = await findFilesByGlobs(
15171
- (0, import_node_path112.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15405
+ (0, import_node_path113.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15172
15406
  );
15173
15407
  if (forDeletion) {
15174
15408
  return nonRootFilePaths.map((filePath) => {
15175
- const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
15409
+ const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15176
15410
  checkPathTraversal({
15177
15411
  relativePath: relativeFilePath,
15178
15412
  intendedRootDir: nonRootBaseDir
@@ -15187,7 +15421,7 @@ var RulesProcessor = class extends FeatureProcessor {
15187
15421
  }
15188
15422
  return await Promise.all(
15189
15423
  nonRootFilePaths.map((filePath) => {
15190
- const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
15424
+ const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15191
15425
  checkPathTraversal({
15192
15426
  relativePath: relativeFilePath,
15193
15427
  intendedRootDir: nonRootBaseDir
@@ -15300,14 +15534,14 @@ s/<command> [arguments]
15300
15534
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15301
15535
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15302
15536
 
15303
- 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.` : "";
15537
+ 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.` : "";
15304
15538
  const subagentsSection = subagents ? `## Simulated Subagents
15305
15539
 
15306
15540
  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.
15307
15541
 
15308
- 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.
15542
+ 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.
15309
15543
 
15310
- 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.` : "";
15544
+ 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.` : "";
15311
15545
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15312
15546
  const result = [
15313
15547
  overview,
@@ -15339,51 +15573,51 @@ var import_request_error = require("@octokit/request-error");
15339
15573
  var import_rest = require("@octokit/rest");
15340
15574
 
15341
15575
  // src/types/fetch.ts
15342
- var import_mini54 = require("zod/mini");
15576
+ var import_mini55 = require("zod/mini");
15343
15577
 
15344
15578
  // src/types/fetch-targets.ts
15345
- var import_mini53 = require("zod/mini");
15579
+ var import_mini54 = require("zod/mini");
15346
15580
  var ALL_FETCH_TARGETS = ["rulesync", ...ALL_TOOL_TARGETS];
15347
- var FetchTargetSchema = import_mini53.z.enum(ALL_FETCH_TARGETS);
15581
+ var FetchTargetSchema = import_mini54.z.enum(ALL_FETCH_TARGETS);
15348
15582
 
15349
15583
  // src/types/fetch.ts
15350
- var ConflictStrategySchema = import_mini54.z.enum(["skip", "overwrite"]);
15351
- var GitHubFileTypeSchema = import_mini54.z.enum(["file", "dir", "symlink", "submodule"]);
15352
- var GitHubFileEntrySchema = import_mini54.z.looseObject({
15353
- name: import_mini54.z.string(),
15354
- path: import_mini54.z.string(),
15355
- sha: import_mini54.z.string(),
15356
- size: import_mini54.z.number(),
15584
+ var ConflictStrategySchema = import_mini55.z.enum(["skip", "overwrite"]);
15585
+ var GitHubFileTypeSchema = import_mini55.z.enum(["file", "dir", "symlink", "submodule"]);
15586
+ var GitHubFileEntrySchema = import_mini55.z.looseObject({
15587
+ name: import_mini55.z.string(),
15588
+ path: import_mini55.z.string(),
15589
+ sha: import_mini55.z.string(),
15590
+ size: import_mini55.z.number(),
15357
15591
  type: GitHubFileTypeSchema,
15358
- download_url: import_mini54.z.nullable(import_mini54.z.string())
15592
+ download_url: import_mini55.z.nullable(import_mini55.z.string())
15359
15593
  });
15360
- var FetchOptionsSchema = import_mini54.z.looseObject({
15361
- target: import_mini54.z.optional(FetchTargetSchema),
15362
- features: import_mini54.z.optional(import_mini54.z.array(import_mini54.z.enum(ALL_FEATURES_WITH_WILDCARD))),
15363
- ref: import_mini54.z.optional(import_mini54.z.string()),
15364
- path: import_mini54.z.optional(import_mini54.z.string()),
15365
- output: import_mini54.z.optional(import_mini54.z.string()),
15366
- conflict: import_mini54.z.optional(ConflictStrategySchema),
15367
- token: import_mini54.z.optional(import_mini54.z.string()),
15368
- verbose: import_mini54.z.optional(import_mini54.z.boolean()),
15369
- silent: import_mini54.z.optional(import_mini54.z.boolean())
15594
+ var FetchOptionsSchema = import_mini55.z.looseObject({
15595
+ target: import_mini55.z.optional(FetchTargetSchema),
15596
+ features: import_mini55.z.optional(import_mini55.z.array(import_mini55.z.enum(ALL_FEATURES_WITH_WILDCARD))),
15597
+ ref: import_mini55.z.optional(import_mini55.z.string()),
15598
+ path: import_mini55.z.optional(import_mini55.z.string()),
15599
+ output: import_mini55.z.optional(import_mini55.z.string()),
15600
+ conflict: import_mini55.z.optional(ConflictStrategySchema),
15601
+ token: import_mini55.z.optional(import_mini55.z.string()),
15602
+ verbose: import_mini55.z.optional(import_mini55.z.boolean()),
15603
+ silent: import_mini55.z.optional(import_mini55.z.boolean())
15370
15604
  });
15371
- var FetchFileStatusSchema = import_mini54.z.enum(["created", "overwritten", "skipped"]);
15372
- var GitHubRepoInfoSchema = import_mini54.z.looseObject({
15373
- default_branch: import_mini54.z.string(),
15374
- private: import_mini54.z.boolean()
15605
+ var FetchFileStatusSchema = import_mini55.z.enum(["created", "overwritten", "skipped"]);
15606
+ var GitHubRepoInfoSchema = import_mini55.z.looseObject({
15607
+ default_branch: import_mini55.z.string(),
15608
+ private: import_mini55.z.boolean()
15375
15609
  });
15376
- var GitHubReleaseAssetSchema = import_mini54.z.looseObject({
15377
- name: import_mini54.z.string(),
15378
- browser_download_url: import_mini54.z.string(),
15379
- size: import_mini54.z.number()
15610
+ var GitHubReleaseAssetSchema = import_mini55.z.looseObject({
15611
+ name: import_mini55.z.string(),
15612
+ browser_download_url: import_mini55.z.string(),
15613
+ size: import_mini55.z.number()
15380
15614
  });
15381
- var GitHubReleaseSchema = import_mini54.z.looseObject({
15382
- tag_name: import_mini54.z.string(),
15383
- name: import_mini54.z.nullable(import_mini54.z.string()),
15384
- prerelease: import_mini54.z.boolean(),
15385
- draft: import_mini54.z.boolean(),
15386
- assets: import_mini54.z.array(GitHubReleaseAssetSchema)
15615
+ var GitHubReleaseSchema = import_mini55.z.looseObject({
15616
+ tag_name: import_mini55.z.string(),
15617
+ name: import_mini55.z.nullable(import_mini55.z.string()),
15618
+ prerelease: import_mini55.z.boolean(),
15619
+ draft: import_mini55.z.boolean(),
15620
+ assets: import_mini55.z.array(GitHubReleaseAssetSchema)
15387
15621
  });
15388
15622
 
15389
15623
  // src/lib/github-client.ts
@@ -15683,9 +15917,9 @@ async function listDirectoryRecursive(params) {
15683
15917
  }
15684
15918
 
15685
15919
  // src/types/git-provider.ts
15686
- var import_mini55 = require("zod/mini");
15920
+ var import_mini56 = require("zod/mini");
15687
15921
  var ALL_GIT_PROVIDERS = ["github", "gitlab"];
15688
- var GitProviderSchema = import_mini55.z.enum(ALL_GIT_PROVIDERS);
15922
+ var GitProviderSchema = import_mini56.z.enum(ALL_GIT_PROVIDERS);
15689
15923
 
15690
15924
  // src/lib/source-parser.ts
15691
15925
  var GITHUB_HOSTS = /* @__PURE__ */ new Set(["github.com", "www.github.com"]);
@@ -15810,8 +16044,8 @@ async function processFeatureConversion(params) {
15810
16044
  }
15811
16045
  const rulesyncFiles = await processor.convertToolFilesToRulesyncFiles(toolFiles);
15812
16046
  for (const file of rulesyncFiles) {
15813
- const relativePath = (0, import_node_path113.join)(file.getRelativeDirPath(), file.getRelativeFilePath());
15814
- const outputPath = (0, import_node_path113.join)(outputDir, relativePath);
16047
+ const relativePath = (0, import_node_path114.join)(file.getRelativeDirPath(), file.getRelativeFilePath());
16048
+ const outputPath = (0, import_node_path114.join)(outputDir, relativePath);
15815
16049
  await writeFileContent(outputPath, file.getFileContent());
15816
16050
  paths.push(relativePath);
15817
16051
  }
@@ -15957,7 +16191,7 @@ async function fetchFiles(params) {
15957
16191
  skipped: 0
15958
16192
  };
15959
16193
  }
15960
- const outputBasePath = (0, import_node_path113.join)(baseDir, outputDir);
16194
+ const outputBasePath = (0, import_node_path114.join)(baseDir, outputDir);
15961
16195
  for (const { relativePath, size } of filesToFetch) {
15962
16196
  checkPathTraversal({
15963
16197
  relativePath,
@@ -15967,7 +16201,7 @@ async function fetchFiles(params) {
15967
16201
  }
15968
16202
  const results = await Promise.all(
15969
16203
  filesToFetch.map(async ({ remotePath, relativePath }) => {
15970
- const localPath = (0, import_node_path113.join)(outputBasePath, relativePath);
16204
+ const localPath = (0, import_node_path114.join)(outputBasePath, relativePath);
15971
16205
  const exists = await fileExists(localPath);
15972
16206
  if (exists && conflictStrategy === "skip") {
15973
16207
  logger.debug(`Skipping existing file: ${relativePath}`);
@@ -16009,7 +16243,7 @@ async function collectFeatureFiles(params) {
16009
16243
  );
16010
16244
  const results = await Promise.all(
16011
16245
  tasks.map(async ({ featurePath }) => {
16012
- const fullPath = basePath === "." || basePath === "" ? featurePath : (0, import_node_path113.join)(basePath, featurePath);
16246
+ const fullPath = basePath === "." || basePath === "" ? featurePath : (0, import_node_path114.join)(basePath, featurePath);
16013
16247
  const collected = [];
16014
16248
  try {
16015
16249
  if (featurePath.includes(".")) {
@@ -16109,7 +16343,7 @@ async function fetchAndConvertToolFiles(params) {
16109
16343
  relativePath: toolRelativePath,
16110
16344
  intendedRootDir: tempDir
16111
16345
  });
16112
- const localPath = (0, import_node_path113.join)(tempDir, toolRelativePath);
16346
+ const localPath = (0, import_node_path114.join)(tempDir, toolRelativePath);
16113
16347
  const content = await withSemaphore(
16114
16348
  semaphore,
16115
16349
  () => client.getFileContent(parsed.owner, parsed.repo, remotePath, ref)
@@ -16118,7 +16352,7 @@ async function fetchAndConvertToolFiles(params) {
16118
16352
  logger.debug(`Fetched to temp: ${toolRelativePath}`);
16119
16353
  })
16120
16354
  );
16121
- const outputBasePath = (0, import_node_path113.join)(baseDir, outputDir);
16355
+ const outputBasePath = (0, import_node_path114.join)(baseDir, outputDir);
16122
16356
  const { converted, convertedPaths } = await convertFetchedFilesToRulesync({
16123
16357
  tempDir,
16124
16358
  outputDir: outputBasePath,
@@ -16191,7 +16425,7 @@ function mapToToolPath(relativePath, toolPaths) {
16191
16425
  if (relativePath.startsWith("rules/")) {
16192
16426
  const restPath = relativePath.substring("rules/".length);
16193
16427
  if (toolPaths.rules?.nonRoot) {
16194
- return (0, import_node_path113.join)(toolPaths.rules.nonRoot, restPath);
16428
+ return (0, import_node_path114.join)(toolPaths.rules.nonRoot, restPath);
16195
16429
  }
16196
16430
  }
16197
16431
  if (toolPaths.rules?.root && relativePath === toolPaths.rules.root) {
@@ -16200,19 +16434,19 @@ function mapToToolPath(relativePath, toolPaths) {
16200
16434
  if (relativePath.startsWith("commands/")) {
16201
16435
  const restPath = relativePath.substring("commands/".length);
16202
16436
  if (toolPaths.commands) {
16203
- return (0, import_node_path113.join)(toolPaths.commands, restPath);
16437
+ return (0, import_node_path114.join)(toolPaths.commands, restPath);
16204
16438
  }
16205
16439
  }
16206
16440
  if (relativePath.startsWith("subagents/")) {
16207
16441
  const restPath = relativePath.substring("subagents/".length);
16208
16442
  if (toolPaths.subagents) {
16209
- return (0, import_node_path113.join)(toolPaths.subagents, restPath);
16443
+ return (0, import_node_path114.join)(toolPaths.subagents, restPath);
16210
16444
  }
16211
16445
  }
16212
16446
  if (relativePath.startsWith("skills/")) {
16213
16447
  const restPath = relativePath.substring("skills/".length);
16214
16448
  if (toolPaths.skills) {
16215
- return (0, import_node_path113.join)(toolPaths.skills, restPath);
16449
+ return (0, import_node_path114.join)(toolPaths.skills, restPath);
16216
16450
  }
16217
16451
  }
16218
16452
  return relativePath;
@@ -16264,38 +16498,38 @@ async function fetchCommand(options) {
16264
16498
  }
16265
16499
 
16266
16500
  // src/config/config-resolver.ts
16267
- var import_node_path114 = require("path");
16501
+ var import_node_path115 = require("path");
16268
16502
  var import_jsonc_parser2 = require("jsonc-parser");
16269
16503
 
16270
16504
  // src/config/config.ts
16271
- var import_mini56 = require("zod/mini");
16272
- var SourceEntrySchema = import_mini56.z.object({
16273
- source: import_mini56.z.string().check((0, import_mini56.minLength)(1, "source must be a non-empty string")),
16274
- skills: (0, import_mini56.optional)(import_mini56.z.array(import_mini56.z.string()))
16505
+ var import_mini57 = require("zod/mini");
16506
+ var SourceEntrySchema = import_mini57.z.object({
16507
+ source: import_mini57.z.string().check((0, import_mini57.minLength)(1, "source must be a non-empty string")),
16508
+ skills: (0, import_mini57.optional)(import_mini57.z.array(import_mini57.z.string()))
16275
16509
  });
16276
- var ConfigParamsSchema = import_mini56.z.object({
16277
- baseDirs: import_mini56.z.array(import_mini56.z.string()),
16510
+ var ConfigParamsSchema = import_mini57.z.object({
16511
+ baseDirs: import_mini57.z.array(import_mini57.z.string()),
16278
16512
  targets: RulesyncTargetsSchema,
16279
16513
  features: RulesyncFeaturesSchema,
16280
- verbose: import_mini56.z.boolean(),
16281
- delete: import_mini56.z.boolean(),
16514
+ verbose: import_mini57.z.boolean(),
16515
+ delete: import_mini57.z.boolean(),
16282
16516
  // New non-experimental options
16283
- global: (0, import_mini56.optional)(import_mini56.z.boolean()),
16284
- silent: (0, import_mini56.optional)(import_mini56.z.boolean()),
16285
- simulateCommands: (0, import_mini56.optional)(import_mini56.z.boolean()),
16286
- simulateSubagents: (0, import_mini56.optional)(import_mini56.z.boolean()),
16287
- simulateSkills: (0, import_mini56.optional)(import_mini56.z.boolean()),
16288
- dryRun: (0, import_mini56.optional)(import_mini56.z.boolean()),
16289
- check: (0, import_mini56.optional)(import_mini56.z.boolean()),
16517
+ global: (0, import_mini57.optional)(import_mini57.z.boolean()),
16518
+ silent: (0, import_mini57.optional)(import_mini57.z.boolean()),
16519
+ simulateCommands: (0, import_mini57.optional)(import_mini57.z.boolean()),
16520
+ simulateSubagents: (0, import_mini57.optional)(import_mini57.z.boolean()),
16521
+ simulateSkills: (0, import_mini57.optional)(import_mini57.z.boolean()),
16522
+ dryRun: (0, import_mini57.optional)(import_mini57.z.boolean()),
16523
+ check: (0, import_mini57.optional)(import_mini57.z.boolean()),
16290
16524
  // Declarative skill sources
16291
- sources: (0, import_mini56.optional)(import_mini56.z.array(SourceEntrySchema))
16525
+ sources: (0, import_mini57.optional)(import_mini57.z.array(SourceEntrySchema))
16292
16526
  });
16293
- var PartialConfigParamsSchema = import_mini56.z.partial(ConfigParamsSchema);
16294
- var ConfigFileSchema = import_mini56.z.object({
16295
- $schema: (0, import_mini56.optional)(import_mini56.z.string()),
16296
- ...import_mini56.z.partial(ConfigParamsSchema).shape
16527
+ var PartialConfigParamsSchema = import_mini57.z.partial(ConfigParamsSchema);
16528
+ var ConfigFileSchema = import_mini57.z.object({
16529
+ $schema: (0, import_mini57.optional)(import_mini57.z.string()),
16530
+ ...import_mini57.z.partial(ConfigParamsSchema).shape
16297
16531
  });
16298
- var RequiredConfigParamsSchema = import_mini56.z.required(ConfigParamsSchema);
16532
+ var RequiredConfigParamsSchema = import_mini57.z.required(ConfigParamsSchema);
16299
16533
  var CONFLICTING_TARGET_PAIRS = [
16300
16534
  ["augmentcode", "augmentcode-legacy"],
16301
16535
  ["claudecode", "claudecode-legacy"]
@@ -16516,8 +16750,8 @@ var ConfigResolver = class {
16516
16750
  }) {
16517
16751
  const validatedConfigPath = resolvePath(configPath, process.cwd());
16518
16752
  const baseConfig = await loadConfigFromFile(validatedConfigPath);
16519
- const configDir = (0, import_node_path114.dirname)(validatedConfigPath);
16520
- const localConfigPath = (0, import_node_path114.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
16753
+ const configDir = (0, import_node_path115.dirname)(validatedConfigPath);
16754
+ const localConfigPath = (0, import_node_path115.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
16521
16755
  const localConfig = await loadConfigFromFile(localConfigPath);
16522
16756
  const configByFile = mergeConfigs(baseConfig, localConfig);
16523
16757
  const resolvedGlobal = global ?? configByFile.global ?? getDefaults().global;
@@ -16552,7 +16786,7 @@ function getBaseDirsInLightOfGlobal({
16552
16786
  if (global) {
16553
16787
  return [getHomeDirectory()];
16554
16788
  }
16555
- const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path114.resolve)(baseDir));
16789
+ const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path115.resolve)(baseDir));
16556
16790
  resolvedBaseDirs.forEach((baseDir) => {
16557
16791
  validateBaseDir(baseDir);
16558
16792
  });
@@ -16560,7 +16794,7 @@ function getBaseDirsInLightOfGlobal({
16560
16794
  }
16561
16795
 
16562
16796
  // src/lib/generate.ts
16563
- var import_node_path115 = require("path");
16797
+ var import_node_path116 = require("path");
16564
16798
  var import_es_toolkit4 = require("es-toolkit");
16565
16799
  async function processFeatureGeneration(params) {
16566
16800
  const { config, processor, toolFiles } = params;
@@ -16606,7 +16840,7 @@ async function processEmptyFeatureGeneration(params) {
16606
16840
  return { count: totalCount, paths: [], hasDiff };
16607
16841
  }
16608
16842
  async function checkRulesyncDirExists(params) {
16609
- return fileExists((0, import_node_path115.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16843
+ return fileExists((0, import_node_path116.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16610
16844
  }
16611
16845
  async function generate(params) {
16612
16846
  const { config } = params;
@@ -17052,7 +17286,7 @@ async function generateCommand(options) {
17052
17286
  }
17053
17287
 
17054
17288
  // src/cli/commands/gitignore.ts
17055
- var import_node_path116 = require("path");
17289
+ var import_node_path117 = require("path");
17056
17290
  var RULESYNC_HEADER = "# Generated by Rulesync";
17057
17291
  var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
17058
17292
  var RULESYNC_IGNORE_ENTRIES = [
@@ -17115,6 +17349,7 @@ var RULESYNC_IGNORE_ENTRIES = [
17115
17349
  "**/.github/prompts/",
17116
17350
  "**/.github/agents/",
17117
17351
  "**/.github/skills/",
17352
+ "**/.github/hooks/",
17118
17353
  "**/.vscode/mcp.json",
17119
17354
  // Junie
17120
17355
  "**/.junie/guidelines.md",
@@ -17207,7 +17442,7 @@ var removeExistingRulesyncEntries = (content) => {
17207
17442
  return result;
17208
17443
  };
17209
17444
  var gitignoreCommand = async () => {
17210
- const gitignorePath = (0, import_node_path116.join)(process.cwd(), ".gitignore");
17445
+ const gitignorePath = (0, import_node_path117.join)(process.cwd(), ".gitignore");
17211
17446
  let gitignoreContent = "";
17212
17447
  if (await fileExists(gitignorePath)) {
17213
17448
  gitignoreContent = await readFileContent(gitignorePath);
@@ -17487,7 +17722,7 @@ async function importCommand(options) {
17487
17722
  }
17488
17723
 
17489
17724
  // src/lib/init.ts
17490
- var import_node_path117 = require("path");
17725
+ var import_node_path118 = require("path");
17491
17726
  async function init() {
17492
17727
  const sampleFiles = await createSampleFiles();
17493
17728
  const configFile = await createConfigFile();
@@ -17677,27 +17912,27 @@ Keep the summary concise and ready to reuse in future tasks.`
17677
17912
  await ensureDir(subagentPaths.relativeDirPath);
17678
17913
  await ensureDir(skillPaths.relativeDirPath);
17679
17914
  await ensureDir(ignorePaths.recommended.relativeDirPath);
17680
- const ruleFilepath = (0, import_node_path117.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
17915
+ const ruleFilepath = (0, import_node_path118.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
17681
17916
  results.push(await writeIfNotExists(ruleFilepath, sampleRuleFile.content));
17682
- const mcpFilepath = (0, import_node_path117.join)(
17917
+ const mcpFilepath = (0, import_node_path118.join)(
17683
17918
  mcpPaths.recommended.relativeDirPath,
17684
17919
  mcpPaths.recommended.relativeFilePath
17685
17920
  );
17686
17921
  results.push(await writeIfNotExists(mcpFilepath, sampleMcpFile.content));
17687
- const commandFilepath = (0, import_node_path117.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
17922
+ const commandFilepath = (0, import_node_path118.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
17688
17923
  results.push(await writeIfNotExists(commandFilepath, sampleCommandFile.content));
17689
- const subagentFilepath = (0, import_node_path117.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
17924
+ const subagentFilepath = (0, import_node_path118.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
17690
17925
  results.push(await writeIfNotExists(subagentFilepath, sampleSubagentFile.content));
17691
- const skillDirPath = (0, import_node_path117.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
17926
+ const skillDirPath = (0, import_node_path118.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
17692
17927
  await ensureDir(skillDirPath);
17693
- const skillFilepath = (0, import_node_path117.join)(skillDirPath, SKILL_FILE_NAME);
17928
+ const skillFilepath = (0, import_node_path118.join)(skillDirPath, SKILL_FILE_NAME);
17694
17929
  results.push(await writeIfNotExists(skillFilepath, sampleSkillFile.content));
17695
- const ignoreFilepath = (0, import_node_path117.join)(
17930
+ const ignoreFilepath = (0, import_node_path118.join)(
17696
17931
  ignorePaths.recommended.relativeDirPath,
17697
17932
  ignorePaths.recommended.relativeFilePath
17698
17933
  );
17699
17934
  results.push(await writeIfNotExists(ignoreFilepath, sampleIgnoreFile.content));
17700
- const hooksFilepath = (0, import_node_path117.join)(hooksPaths.relativeDirPath, hooksPaths.relativeFilePath);
17935
+ const hooksFilepath = (0, import_node_path118.join)(hooksPaths.relativeDirPath, hooksPaths.relativeFilePath);
17701
17936
  results.push(await writeIfNotExists(hooksFilepath, sampleHooksFile.content));
17702
17937
  return results;
17703
17938
  }
@@ -17735,33 +17970,33 @@ async function initCommand() {
17735
17970
  }
17736
17971
 
17737
17972
  // src/lib/sources.ts
17738
- var import_node_path119 = require("path");
17973
+ var import_node_path120 = require("path");
17739
17974
  var import_promise2 = require("es-toolkit/promise");
17740
17975
 
17741
17976
  // src/lib/sources-lock.ts
17742
17977
  var import_node_crypto = require("crypto");
17743
- var import_node_path118 = require("path");
17744
- var import_mini57 = require("zod/mini");
17978
+ var import_node_path119 = require("path");
17979
+ var import_mini58 = require("zod/mini");
17745
17980
  var LOCKFILE_VERSION = 1;
17746
- var LockedSkillSchema = import_mini57.z.object({
17747
- integrity: import_mini57.z.string()
17981
+ var LockedSkillSchema = import_mini58.z.object({
17982
+ integrity: import_mini58.z.string()
17748
17983
  });
17749
- var LockedSourceSchema = import_mini57.z.object({
17750
- requestedRef: (0, import_mini57.optional)(import_mini57.z.string()),
17751
- resolvedRef: import_mini57.z.string(),
17752
- resolvedAt: (0, import_mini57.optional)(import_mini57.z.string()),
17753
- skills: import_mini57.z.record(import_mini57.z.string(), LockedSkillSchema)
17984
+ var LockedSourceSchema = import_mini58.z.object({
17985
+ requestedRef: (0, import_mini58.optional)(import_mini58.z.string()),
17986
+ resolvedRef: import_mini58.z.string(),
17987
+ resolvedAt: (0, import_mini58.optional)(import_mini58.z.string()),
17988
+ skills: import_mini58.z.record(import_mini58.z.string(), LockedSkillSchema)
17754
17989
  });
17755
- var SourcesLockSchema = import_mini57.z.object({
17756
- lockfileVersion: import_mini57.z.number(),
17757
- sources: import_mini57.z.record(import_mini57.z.string(), LockedSourceSchema)
17990
+ var SourcesLockSchema = import_mini58.z.object({
17991
+ lockfileVersion: import_mini58.z.number(),
17992
+ sources: import_mini58.z.record(import_mini58.z.string(), LockedSourceSchema)
17758
17993
  });
17759
- var LegacyLockedSourceSchema = import_mini57.z.object({
17760
- resolvedRef: import_mini57.z.string(),
17761
- skills: import_mini57.z.array(import_mini57.z.string())
17994
+ var LegacyLockedSourceSchema = import_mini58.z.object({
17995
+ resolvedRef: import_mini58.z.string(),
17996
+ skills: import_mini58.z.array(import_mini58.z.string())
17762
17997
  });
17763
- var LegacySourcesLockSchema = import_mini57.z.object({
17764
- sources: import_mini57.z.record(import_mini57.z.string(), LegacyLockedSourceSchema)
17998
+ var LegacySourcesLockSchema = import_mini58.z.object({
17999
+ sources: import_mini58.z.record(import_mini58.z.string(), LegacyLockedSourceSchema)
17765
18000
  });
17766
18001
  function migrateLegacyLock(legacy) {
17767
18002
  const sources = {};
@@ -17784,7 +18019,7 @@ function createEmptyLock() {
17784
18019
  return { lockfileVersion: LOCKFILE_VERSION, sources: {} };
17785
18020
  }
17786
18021
  async function readLockFile(params) {
17787
- const lockPath = (0, import_node_path118.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
18022
+ const lockPath = (0, import_node_path119.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17788
18023
  if (!await fileExists(lockPath)) {
17789
18024
  logger.debug("No sources lockfile found, starting fresh.");
17790
18025
  return createEmptyLock();
@@ -17812,7 +18047,7 @@ async function readLockFile(params) {
17812
18047
  }
17813
18048
  }
17814
18049
  async function writeLockFile(params) {
17815
- const lockPath = (0, import_node_path118.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
18050
+ const lockPath = (0, import_node_path119.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17816
18051
  const content = JSON.stringify(params.lock, null, 2) + "\n";
17817
18052
  await writeFileContent(lockPath, content);
17818
18053
  logger.debug(`Wrote sources lockfile to ${lockPath}`);
@@ -17953,7 +18188,7 @@ async function resolveAndFetchSources(params) {
17953
18188
  async function checkLockedSkillsExist(curatedDir, skillNames) {
17954
18189
  if (skillNames.length === 0) return true;
17955
18190
  for (const name of skillNames) {
17956
- if (!await directoryExists((0, import_node_path119.join)(curatedDir, name))) {
18191
+ if (!await directoryExists((0, import_node_path120.join)(curatedDir, name))) {
17957
18192
  return false;
17958
18193
  }
17959
18194
  }
@@ -17983,7 +18218,7 @@ async function fetchSource(params) {
17983
18218
  ref = resolvedSha;
17984
18219
  logger.debug(`Resolved ${sourceKey} ref "${requestedRef}" to SHA: ${resolvedSha}`);
17985
18220
  }
17986
- const curatedDir = (0, import_node_path119.join)(baseDir, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
18221
+ const curatedDir = (0, import_node_path120.join)(baseDir, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
17987
18222
  if (locked && resolvedSha === locked.resolvedRef && !updateSources) {
17988
18223
  const allExist = await checkLockedSkillsExist(curatedDir, lockedSkillNames);
17989
18224
  if (allExist) {
@@ -18013,10 +18248,10 @@ async function fetchSource(params) {
18013
18248
  const semaphore = new import_promise2.Semaphore(FETCH_CONCURRENCY_LIMIT);
18014
18249
  const fetchedSkills = {};
18015
18250
  if (locked) {
18016
- const resolvedCuratedDir = (0, import_node_path119.resolve)(curatedDir);
18251
+ const resolvedCuratedDir = (0, import_node_path120.resolve)(curatedDir);
18017
18252
  for (const prevSkill of lockedSkillNames) {
18018
- const prevDir = (0, import_node_path119.join)(curatedDir, prevSkill);
18019
- if (!(0, import_node_path119.resolve)(prevDir).startsWith(resolvedCuratedDir + import_node_path119.sep)) {
18253
+ const prevDir = (0, import_node_path120.join)(curatedDir, prevSkill);
18254
+ if (!(0, import_node_path120.resolve)(prevDir).startsWith(resolvedCuratedDir + import_node_path120.sep)) {
18020
18255
  logger.warn(
18021
18256
  `Skipping removal of "${prevSkill}": resolved path is outside the curated directory.`
18022
18257
  );
@@ -18066,10 +18301,10 @@ async function fetchSource(params) {
18066
18301
  const skillFiles = [];
18067
18302
  for (const file of files) {
18068
18303
  const relativeToSkill = file.path.substring(skillDir.path.length + 1);
18069
- const localFilePath = (0, import_node_path119.join)(curatedDir, skillDir.name, relativeToSkill);
18304
+ const localFilePath = (0, import_node_path120.join)(curatedDir, skillDir.name, relativeToSkill);
18070
18305
  checkPathTraversal({
18071
18306
  relativePath: relativeToSkill,
18072
- intendedRootDir: (0, import_node_path119.join)(curatedDir, skillDir.name)
18307
+ intendedRootDir: (0, import_node_path120.join)(curatedDir, skillDir.name)
18073
18308
  });
18074
18309
  const content = await withSemaphore(
18075
18310
  semaphore,
@@ -18152,15 +18387,15 @@ async function installCommand(options) {
18152
18387
  var import_fastmcp = require("fastmcp");
18153
18388
 
18154
18389
  // src/mcp/tools.ts
18155
- var import_mini66 = require("zod/mini");
18390
+ var import_mini67 = require("zod/mini");
18156
18391
 
18157
18392
  // src/mcp/commands.ts
18158
- var import_node_path120 = require("path");
18159
- var import_mini58 = require("zod/mini");
18393
+ var import_node_path121 = require("path");
18394
+ var import_mini59 = require("zod/mini");
18160
18395
  var maxCommandSizeBytes = 1024 * 1024;
18161
18396
  var maxCommandsCount = 1e3;
18162
18397
  async function listCommands() {
18163
- const commandsDir = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18398
+ const commandsDir = (0, import_node_path121.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18164
18399
  try {
18165
18400
  const files = await listDirectoryFiles(commandsDir);
18166
18401
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -18176,7 +18411,7 @@ async function listCommands() {
18176
18411
  });
18177
18412
  const frontmatter = command.getFrontmatter();
18178
18413
  return {
18179
- relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
18414
+ relativePathFromCwd: (0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
18180
18415
  frontmatter
18181
18416
  };
18182
18417
  } catch (error) {
@@ -18198,13 +18433,13 @@ async function getCommand({ relativePathFromCwd }) {
18198
18433
  relativePath: relativePathFromCwd,
18199
18434
  intendedRootDir: process.cwd()
18200
18435
  });
18201
- const filename = (0, import_node_path120.basename)(relativePathFromCwd);
18436
+ const filename = (0, import_node_path121.basename)(relativePathFromCwd);
18202
18437
  try {
18203
18438
  const command = await RulesyncCommand.fromFile({
18204
18439
  relativeFilePath: filename
18205
18440
  });
18206
18441
  return {
18207
- relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18442
+ relativePathFromCwd: (0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18208
18443
  frontmatter: command.getFrontmatter(),
18209
18444
  body: command.getBody()
18210
18445
  };
@@ -18223,7 +18458,7 @@ async function putCommand({
18223
18458
  relativePath: relativePathFromCwd,
18224
18459
  intendedRootDir: process.cwd()
18225
18460
  });
18226
- const filename = (0, import_node_path120.basename)(relativePathFromCwd);
18461
+ const filename = (0, import_node_path121.basename)(relativePathFromCwd);
18227
18462
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
18228
18463
  if (estimatedSize > maxCommandSizeBytes) {
18229
18464
  throw new Error(
@@ -18233,7 +18468,7 @@ async function putCommand({
18233
18468
  try {
18234
18469
  const existingCommands = await listCommands();
18235
18470
  const isUpdate = existingCommands.some(
18236
- (command2) => command2.relativePathFromCwd === (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18471
+ (command2) => command2.relativePathFromCwd === (0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18237
18472
  );
18238
18473
  if (!isUpdate && existingCommands.length >= maxCommandsCount) {
18239
18474
  throw new Error(
@@ -18250,11 +18485,11 @@ async function putCommand({
18250
18485
  fileContent,
18251
18486
  validate: true
18252
18487
  });
18253
- const commandsDir = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18488
+ const commandsDir = (0, import_node_path121.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18254
18489
  await ensureDir(commandsDir);
18255
18490
  await writeFileContent(command.getFilePath(), command.getFileContent());
18256
18491
  return {
18257
- relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18492
+ relativePathFromCwd: (0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18258
18493
  frontmatter: command.getFrontmatter(),
18259
18494
  body: command.getBody()
18260
18495
  };
@@ -18269,12 +18504,12 @@ async function deleteCommand({ relativePathFromCwd }) {
18269
18504
  relativePath: relativePathFromCwd,
18270
18505
  intendedRootDir: process.cwd()
18271
18506
  });
18272
- const filename = (0, import_node_path120.basename)(relativePathFromCwd);
18273
- const fullPath = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
18507
+ const filename = (0, import_node_path121.basename)(relativePathFromCwd);
18508
+ const fullPath = (0, import_node_path121.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
18274
18509
  try {
18275
18510
  await removeFile(fullPath);
18276
18511
  return {
18277
- relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18512
+ relativePathFromCwd: (0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18278
18513
  };
18279
18514
  } catch (error) {
18280
18515
  throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
@@ -18283,23 +18518,23 @@ async function deleteCommand({ relativePathFromCwd }) {
18283
18518
  }
18284
18519
  }
18285
18520
  var commandToolSchemas = {
18286
- listCommands: import_mini58.z.object({}),
18287
- getCommand: import_mini58.z.object({
18288
- relativePathFromCwd: import_mini58.z.string()
18521
+ listCommands: import_mini59.z.object({}),
18522
+ getCommand: import_mini59.z.object({
18523
+ relativePathFromCwd: import_mini59.z.string()
18289
18524
  }),
18290
- putCommand: import_mini58.z.object({
18291
- relativePathFromCwd: import_mini58.z.string(),
18525
+ putCommand: import_mini59.z.object({
18526
+ relativePathFromCwd: import_mini59.z.string(),
18292
18527
  frontmatter: RulesyncCommandFrontmatterSchema,
18293
- body: import_mini58.z.string()
18528
+ body: import_mini59.z.string()
18294
18529
  }),
18295
- deleteCommand: import_mini58.z.object({
18296
- relativePathFromCwd: import_mini58.z.string()
18530
+ deleteCommand: import_mini59.z.object({
18531
+ relativePathFromCwd: import_mini59.z.string()
18297
18532
  })
18298
18533
  };
18299
18534
  var commandTools = {
18300
18535
  listCommands: {
18301
18536
  name: "listCommands",
18302
- description: `List all commands from ${(0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18537
+ description: `List all commands from ${(0, import_node_path121.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18303
18538
  parameters: commandToolSchemas.listCommands,
18304
18539
  execute: async () => {
18305
18540
  const commands = await listCommands();
@@ -18341,15 +18576,15 @@ var commandTools = {
18341
18576
  };
18342
18577
 
18343
18578
  // src/mcp/generate.ts
18344
- var import_mini59 = require("zod/mini");
18345
- var generateOptionsSchema = import_mini59.z.object({
18346
- targets: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string())),
18347
- features: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string())),
18348
- delete: import_mini59.z.optional(import_mini59.z.boolean()),
18349
- global: import_mini59.z.optional(import_mini59.z.boolean()),
18350
- simulateCommands: import_mini59.z.optional(import_mini59.z.boolean()),
18351
- simulateSubagents: import_mini59.z.optional(import_mini59.z.boolean()),
18352
- simulateSkills: import_mini59.z.optional(import_mini59.z.boolean())
18579
+ var import_mini60 = require("zod/mini");
18580
+ var generateOptionsSchema = import_mini60.z.object({
18581
+ targets: import_mini60.z.optional(import_mini60.z.array(import_mini60.z.string())),
18582
+ features: import_mini60.z.optional(import_mini60.z.array(import_mini60.z.string())),
18583
+ delete: import_mini60.z.optional(import_mini60.z.boolean()),
18584
+ global: import_mini60.z.optional(import_mini60.z.boolean()),
18585
+ simulateCommands: import_mini60.z.optional(import_mini60.z.boolean()),
18586
+ simulateSubagents: import_mini60.z.optional(import_mini60.z.boolean()),
18587
+ simulateSkills: import_mini60.z.optional(import_mini60.z.boolean())
18353
18588
  });
18354
18589
  async function executeGenerate(options = {}) {
18355
18590
  try {
@@ -18426,11 +18661,11 @@ var generateTools = {
18426
18661
  };
18427
18662
 
18428
18663
  // src/mcp/ignore.ts
18429
- var import_node_path121 = require("path");
18430
- var import_mini60 = require("zod/mini");
18664
+ var import_node_path122 = require("path");
18665
+ var import_mini61 = require("zod/mini");
18431
18666
  var maxIgnoreFileSizeBytes = 100 * 1024;
18432
18667
  async function getIgnoreFile() {
18433
- const ignoreFilePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18668
+ const ignoreFilePath = (0, import_node_path122.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18434
18669
  try {
18435
18670
  const content = await readFileContent(ignoreFilePath);
18436
18671
  return {
@@ -18447,7 +18682,7 @@ async function getIgnoreFile() {
18447
18682
  }
18448
18683
  }
18449
18684
  async function putIgnoreFile({ content }) {
18450
- const ignoreFilePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18685
+ const ignoreFilePath = (0, import_node_path122.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18451
18686
  const contentSizeBytes = Buffer.byteLength(content, "utf8");
18452
18687
  if (contentSizeBytes > maxIgnoreFileSizeBytes) {
18453
18688
  throw new Error(
@@ -18471,8 +18706,8 @@ async function putIgnoreFile({ content }) {
18471
18706
  }
18472
18707
  }
18473
18708
  async function deleteIgnoreFile() {
18474
- const aiignorePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18475
- const legacyIgnorePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
18709
+ const aiignorePath = (0, import_node_path122.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18710
+ const legacyIgnorePath = (0, import_node_path122.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
18476
18711
  try {
18477
18712
  await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
18478
18713
  return {
@@ -18490,11 +18725,11 @@ async function deleteIgnoreFile() {
18490
18725
  }
18491
18726
  }
18492
18727
  var ignoreToolSchemas = {
18493
- getIgnoreFile: import_mini60.z.object({}),
18494
- putIgnoreFile: import_mini60.z.object({
18495
- content: import_mini60.z.string()
18728
+ getIgnoreFile: import_mini61.z.object({}),
18729
+ putIgnoreFile: import_mini61.z.object({
18730
+ content: import_mini61.z.string()
18496
18731
  }),
18497
- deleteIgnoreFile: import_mini60.z.object({})
18732
+ deleteIgnoreFile: import_mini61.z.object({})
18498
18733
  };
18499
18734
  var ignoreTools = {
18500
18735
  getIgnoreFile: {
@@ -18527,11 +18762,11 @@ var ignoreTools = {
18527
18762
  };
18528
18763
 
18529
18764
  // src/mcp/import.ts
18530
- var import_mini61 = require("zod/mini");
18531
- var importOptionsSchema = import_mini61.z.object({
18532
- target: import_mini61.z.string(),
18533
- features: import_mini61.z.optional(import_mini61.z.array(import_mini61.z.string())),
18534
- global: import_mini61.z.optional(import_mini61.z.boolean())
18765
+ var import_mini62 = require("zod/mini");
18766
+ var importOptionsSchema = import_mini62.z.object({
18767
+ target: import_mini62.z.string(),
18768
+ features: import_mini62.z.optional(import_mini62.z.array(import_mini62.z.string())),
18769
+ global: import_mini62.z.optional(import_mini62.z.boolean())
18535
18770
  });
18536
18771
  async function executeImport(options) {
18537
18772
  try {
@@ -18600,15 +18835,15 @@ var importTools = {
18600
18835
  };
18601
18836
 
18602
18837
  // src/mcp/mcp.ts
18603
- var import_node_path122 = require("path");
18604
- var import_mini62 = require("zod/mini");
18838
+ var import_node_path123 = require("path");
18839
+ var import_mini63 = require("zod/mini");
18605
18840
  var maxMcpSizeBytes = 1024 * 1024;
18606
18841
  async function getMcpFile() {
18607
18842
  try {
18608
18843
  const rulesyncMcp = await RulesyncMcp.fromFile({
18609
18844
  validate: true
18610
18845
  });
18611
- const relativePathFromCwd = (0, import_node_path122.join)(
18846
+ const relativePathFromCwd = (0, import_node_path123.join)(
18612
18847
  rulesyncMcp.getRelativeDirPath(),
18613
18848
  rulesyncMcp.getRelativeFilePath()
18614
18849
  );
@@ -18646,7 +18881,7 @@ async function putMcpFile({ content }) {
18646
18881
  const paths = RulesyncMcp.getSettablePaths();
18647
18882
  const relativeDirPath = paths.recommended.relativeDirPath;
18648
18883
  const relativeFilePath = paths.recommended.relativeFilePath;
18649
- const fullPath = (0, import_node_path122.join)(baseDir, relativeDirPath, relativeFilePath);
18884
+ const fullPath = (0, import_node_path123.join)(baseDir, relativeDirPath, relativeFilePath);
18650
18885
  const rulesyncMcp = new RulesyncMcp({
18651
18886
  baseDir,
18652
18887
  relativeDirPath,
@@ -18654,9 +18889,9 @@ async function putMcpFile({ content }) {
18654
18889
  fileContent: content,
18655
18890
  validate: true
18656
18891
  });
18657
- await ensureDir((0, import_node_path122.join)(baseDir, relativeDirPath));
18892
+ await ensureDir((0, import_node_path123.join)(baseDir, relativeDirPath));
18658
18893
  await writeFileContent(fullPath, content);
18659
- const relativePathFromCwd = (0, import_node_path122.join)(relativeDirPath, relativeFilePath);
18894
+ const relativePathFromCwd = (0, import_node_path123.join)(relativeDirPath, relativeFilePath);
18660
18895
  return {
18661
18896
  relativePathFromCwd,
18662
18897
  content: rulesyncMcp.getFileContent()
@@ -18674,15 +18909,15 @@ async function deleteMcpFile() {
18674
18909
  try {
18675
18910
  const baseDir = process.cwd();
18676
18911
  const paths = RulesyncMcp.getSettablePaths();
18677
- const recommendedPath = (0, import_node_path122.join)(
18912
+ const recommendedPath = (0, import_node_path123.join)(
18678
18913
  baseDir,
18679
18914
  paths.recommended.relativeDirPath,
18680
18915
  paths.recommended.relativeFilePath
18681
18916
  );
18682
- const legacyPath = (0, import_node_path122.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
18917
+ const legacyPath = (0, import_node_path123.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
18683
18918
  await removeFile(recommendedPath);
18684
18919
  await removeFile(legacyPath);
18685
- const relativePathFromCwd = (0, import_node_path122.join)(
18920
+ const relativePathFromCwd = (0, import_node_path123.join)(
18686
18921
  paths.recommended.relativeDirPath,
18687
18922
  paths.recommended.relativeFilePath
18688
18923
  );
@@ -18699,11 +18934,11 @@ async function deleteMcpFile() {
18699
18934
  }
18700
18935
  }
18701
18936
  var mcpToolSchemas = {
18702
- getMcpFile: import_mini62.z.object({}),
18703
- putMcpFile: import_mini62.z.object({
18704
- content: import_mini62.z.string()
18937
+ getMcpFile: import_mini63.z.object({}),
18938
+ putMcpFile: import_mini63.z.object({
18939
+ content: import_mini63.z.string()
18705
18940
  }),
18706
- deleteMcpFile: import_mini62.z.object({})
18941
+ deleteMcpFile: import_mini63.z.object({})
18707
18942
  };
18708
18943
  var mcpTools = {
18709
18944
  getMcpFile: {
@@ -18736,12 +18971,12 @@ var mcpTools = {
18736
18971
  };
18737
18972
 
18738
18973
  // src/mcp/rules.ts
18739
- var import_node_path123 = require("path");
18740
- var import_mini63 = require("zod/mini");
18974
+ var import_node_path124 = require("path");
18975
+ var import_mini64 = require("zod/mini");
18741
18976
  var maxRuleSizeBytes = 1024 * 1024;
18742
18977
  var maxRulesCount = 1e3;
18743
18978
  async function listRules() {
18744
- const rulesDir = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18979
+ const rulesDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18745
18980
  try {
18746
18981
  const files = await listDirectoryFiles(rulesDir);
18747
18982
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -18754,7 +18989,7 @@ async function listRules() {
18754
18989
  });
18755
18990
  const frontmatter = rule.getFrontmatter();
18756
18991
  return {
18757
- relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
18992
+ relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
18758
18993
  frontmatter
18759
18994
  };
18760
18995
  } catch (error) {
@@ -18776,14 +19011,14 @@ async function getRule({ relativePathFromCwd }) {
18776
19011
  relativePath: relativePathFromCwd,
18777
19012
  intendedRootDir: process.cwd()
18778
19013
  });
18779
- const filename = (0, import_node_path123.basename)(relativePathFromCwd);
19014
+ const filename = (0, import_node_path124.basename)(relativePathFromCwd);
18780
19015
  try {
18781
19016
  const rule = await RulesyncRule.fromFile({
18782
19017
  relativeFilePath: filename,
18783
19018
  validate: true
18784
19019
  });
18785
19020
  return {
18786
- relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
19021
+ relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18787
19022
  frontmatter: rule.getFrontmatter(),
18788
19023
  body: rule.getBody()
18789
19024
  };
@@ -18802,7 +19037,7 @@ async function putRule({
18802
19037
  relativePath: relativePathFromCwd,
18803
19038
  intendedRootDir: process.cwd()
18804
19039
  });
18805
- const filename = (0, import_node_path123.basename)(relativePathFromCwd);
19040
+ const filename = (0, import_node_path124.basename)(relativePathFromCwd);
18806
19041
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
18807
19042
  if (estimatedSize > maxRuleSizeBytes) {
18808
19043
  throw new Error(
@@ -18812,7 +19047,7 @@ async function putRule({
18812
19047
  try {
18813
19048
  const existingRules = await listRules();
18814
19049
  const isUpdate = existingRules.some(
18815
- (rule2) => rule2.relativePathFromCwd === (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
19050
+ (rule2) => rule2.relativePathFromCwd === (0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18816
19051
  );
18817
19052
  if (!isUpdate && existingRules.length >= maxRulesCount) {
18818
19053
  throw new Error(
@@ -18827,11 +19062,11 @@ async function putRule({
18827
19062
  body,
18828
19063
  validate: true
18829
19064
  });
18830
- const rulesDir = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19065
+ const rulesDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18831
19066
  await ensureDir(rulesDir);
18832
19067
  await writeFileContent(rule.getFilePath(), rule.getFileContent());
18833
19068
  return {
18834
- relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
19069
+ relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18835
19070
  frontmatter: rule.getFrontmatter(),
18836
19071
  body: rule.getBody()
18837
19072
  };
@@ -18846,12 +19081,12 @@ async function deleteRule({ relativePathFromCwd }) {
18846
19081
  relativePath: relativePathFromCwd,
18847
19082
  intendedRootDir: process.cwd()
18848
19083
  });
18849
- const filename = (0, import_node_path123.basename)(relativePathFromCwd);
18850
- const fullPath = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
19084
+ const filename = (0, import_node_path124.basename)(relativePathFromCwd);
19085
+ const fullPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
18851
19086
  try {
18852
19087
  await removeFile(fullPath);
18853
19088
  return {
18854
- relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
19089
+ relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18855
19090
  };
18856
19091
  } catch (error) {
18857
19092
  throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
@@ -18860,23 +19095,23 @@ async function deleteRule({ relativePathFromCwd }) {
18860
19095
  }
18861
19096
  }
18862
19097
  var ruleToolSchemas = {
18863
- listRules: import_mini63.z.object({}),
18864
- getRule: import_mini63.z.object({
18865
- relativePathFromCwd: import_mini63.z.string()
19098
+ listRules: import_mini64.z.object({}),
19099
+ getRule: import_mini64.z.object({
19100
+ relativePathFromCwd: import_mini64.z.string()
18866
19101
  }),
18867
- putRule: import_mini63.z.object({
18868
- relativePathFromCwd: import_mini63.z.string(),
19102
+ putRule: import_mini64.z.object({
19103
+ relativePathFromCwd: import_mini64.z.string(),
18869
19104
  frontmatter: RulesyncRuleFrontmatterSchema,
18870
- body: import_mini63.z.string()
19105
+ body: import_mini64.z.string()
18871
19106
  }),
18872
- deleteRule: import_mini63.z.object({
18873
- relativePathFromCwd: import_mini63.z.string()
19107
+ deleteRule: import_mini64.z.object({
19108
+ relativePathFromCwd: import_mini64.z.string()
18874
19109
  })
18875
19110
  };
18876
19111
  var ruleTools = {
18877
19112
  listRules: {
18878
19113
  name: "listRules",
18879
- description: `List all rules from ${(0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
19114
+ description: `List all rules from ${(0, import_node_path124.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18880
19115
  parameters: ruleToolSchemas.listRules,
18881
19116
  execute: async () => {
18882
19117
  const rules = await listRules();
@@ -18918,8 +19153,8 @@ var ruleTools = {
18918
19153
  };
18919
19154
 
18920
19155
  // src/mcp/skills.ts
18921
- var import_node_path124 = require("path");
18922
- var import_mini64 = require("zod/mini");
19156
+ var import_node_path125 = require("path");
19157
+ var import_mini65 = require("zod/mini");
18923
19158
  var maxSkillSizeBytes = 1024 * 1024;
18924
19159
  var maxSkillsCount = 1e3;
18925
19160
  function aiDirFileToMcpSkillFile(file) {
@@ -18935,19 +19170,19 @@ function mcpSkillFileToAiDirFile(file) {
18935
19170
  };
18936
19171
  }
18937
19172
  function extractDirName(relativeDirPathFromCwd) {
18938
- const dirName = (0, import_node_path124.basename)(relativeDirPathFromCwd);
19173
+ const dirName = (0, import_node_path125.basename)(relativeDirPathFromCwd);
18939
19174
  if (!dirName) {
18940
19175
  throw new Error(`Invalid path: ${relativeDirPathFromCwd}`);
18941
19176
  }
18942
19177
  return dirName;
18943
19178
  }
18944
19179
  async function listSkills() {
18945
- const skillsDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
19180
+ const skillsDir = (0, import_node_path125.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
18946
19181
  try {
18947
- const skillDirPaths = await findFilesByGlobs((0, import_node_path124.join)(skillsDir, "*"), { type: "dir" });
19182
+ const skillDirPaths = await findFilesByGlobs((0, import_node_path125.join)(skillsDir, "*"), { type: "dir" });
18948
19183
  const skills = await Promise.all(
18949
19184
  skillDirPaths.map(async (dirPath) => {
18950
- const dirName = (0, import_node_path124.basename)(dirPath);
19185
+ const dirName = (0, import_node_path125.basename)(dirPath);
18951
19186
  if (!dirName) return null;
18952
19187
  try {
18953
19188
  const skill = await RulesyncSkill.fromDir({
@@ -18955,7 +19190,7 @@ async function listSkills() {
18955
19190
  });
18956
19191
  const frontmatter = skill.getFrontmatter();
18957
19192
  return {
18958
- relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
19193
+ relativeDirPathFromCwd: (0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18959
19194
  frontmatter
18960
19195
  };
18961
19196
  } catch (error) {
@@ -18983,7 +19218,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
18983
19218
  dirName
18984
19219
  });
18985
19220
  return {
18986
- relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
19221
+ relativeDirPathFromCwd: (0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18987
19222
  frontmatter: skill.getFrontmatter(),
18988
19223
  body: skill.getBody(),
18989
19224
  otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
@@ -19017,7 +19252,7 @@ async function putSkill({
19017
19252
  try {
19018
19253
  const existingSkills = await listSkills();
19019
19254
  const isUpdate = existingSkills.some(
19020
- (skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
19255
+ (skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
19021
19256
  );
19022
19257
  if (!isUpdate && existingSkills.length >= maxSkillsCount) {
19023
19258
  throw new Error(
@@ -19034,9 +19269,9 @@ async function putSkill({
19034
19269
  otherFiles: aiDirFiles,
19035
19270
  validate: true
19036
19271
  });
19037
- const skillDirPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19272
+ const skillDirPath = (0, import_node_path125.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19038
19273
  await ensureDir(skillDirPath);
19039
- const skillFilePath = (0, import_node_path124.join)(skillDirPath, SKILL_FILE_NAME);
19274
+ const skillFilePath = (0, import_node_path125.join)(skillDirPath, SKILL_FILE_NAME);
19040
19275
  const skillFileContent = stringifyFrontmatter(body, frontmatter);
19041
19276
  await writeFileContent(skillFilePath, skillFileContent);
19042
19277
  for (const file of otherFiles) {
@@ -19044,15 +19279,15 @@ async function putSkill({
19044
19279
  relativePath: file.name,
19045
19280
  intendedRootDir: skillDirPath
19046
19281
  });
19047
- const filePath = (0, import_node_path124.join)(skillDirPath, file.name);
19048
- const fileDir = (0, import_node_path124.join)(skillDirPath, (0, import_node_path124.dirname)(file.name));
19282
+ const filePath = (0, import_node_path125.join)(skillDirPath, file.name);
19283
+ const fileDir = (0, import_node_path125.join)(skillDirPath, (0, import_node_path125.dirname)(file.name));
19049
19284
  if (fileDir !== skillDirPath) {
19050
19285
  await ensureDir(fileDir);
19051
19286
  }
19052
19287
  await writeFileContent(filePath, file.body);
19053
19288
  }
19054
19289
  return {
19055
- relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
19290
+ relativeDirPathFromCwd: (0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
19056
19291
  frontmatter: skill.getFrontmatter(),
19057
19292
  body: skill.getBody(),
19058
19293
  otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
@@ -19074,13 +19309,13 @@ async function deleteSkill({
19074
19309
  intendedRootDir: process.cwd()
19075
19310
  });
19076
19311
  const dirName = extractDirName(relativeDirPathFromCwd);
19077
- const skillDirPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19312
+ const skillDirPath = (0, import_node_path125.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19078
19313
  try {
19079
19314
  if (await directoryExists(skillDirPath)) {
19080
19315
  await removeDirectory(skillDirPath);
19081
19316
  }
19082
19317
  return {
19083
- relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
19318
+ relativeDirPathFromCwd: (0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
19084
19319
  };
19085
19320
  } catch (error) {
19086
19321
  throw new Error(
@@ -19091,29 +19326,29 @@ async function deleteSkill({
19091
19326
  );
19092
19327
  }
19093
19328
  }
19094
- var McpSkillFileSchema = import_mini64.z.object({
19095
- name: import_mini64.z.string(),
19096
- body: import_mini64.z.string()
19329
+ var McpSkillFileSchema = import_mini65.z.object({
19330
+ name: import_mini65.z.string(),
19331
+ body: import_mini65.z.string()
19097
19332
  });
19098
19333
  var skillToolSchemas = {
19099
- listSkills: import_mini64.z.object({}),
19100
- getSkill: import_mini64.z.object({
19101
- relativeDirPathFromCwd: import_mini64.z.string()
19334
+ listSkills: import_mini65.z.object({}),
19335
+ getSkill: import_mini65.z.object({
19336
+ relativeDirPathFromCwd: import_mini65.z.string()
19102
19337
  }),
19103
- putSkill: import_mini64.z.object({
19104
- relativeDirPathFromCwd: import_mini64.z.string(),
19338
+ putSkill: import_mini65.z.object({
19339
+ relativeDirPathFromCwd: import_mini65.z.string(),
19105
19340
  frontmatter: RulesyncSkillFrontmatterSchema,
19106
- body: import_mini64.z.string(),
19107
- otherFiles: import_mini64.z.optional(import_mini64.z.array(McpSkillFileSchema))
19341
+ body: import_mini65.z.string(),
19342
+ otherFiles: import_mini65.z.optional(import_mini65.z.array(McpSkillFileSchema))
19108
19343
  }),
19109
- deleteSkill: import_mini64.z.object({
19110
- relativeDirPathFromCwd: import_mini64.z.string()
19344
+ deleteSkill: import_mini65.z.object({
19345
+ relativeDirPathFromCwd: import_mini65.z.string()
19111
19346
  })
19112
19347
  };
19113
19348
  var skillTools = {
19114
19349
  listSkills: {
19115
19350
  name: "listSkills",
19116
- description: `List all skills from ${(0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
19351
+ description: `List all skills from ${(0, import_node_path125.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
19117
19352
  parameters: skillToolSchemas.listSkills,
19118
19353
  execute: async () => {
19119
19354
  const skills = await listSkills();
@@ -19156,12 +19391,12 @@ var skillTools = {
19156
19391
  };
19157
19392
 
19158
19393
  // src/mcp/subagents.ts
19159
- var import_node_path125 = require("path");
19160
- var import_mini65 = require("zod/mini");
19394
+ var import_node_path126 = require("path");
19395
+ var import_mini66 = require("zod/mini");
19161
19396
  var maxSubagentSizeBytes = 1024 * 1024;
19162
19397
  var maxSubagentsCount = 1e3;
19163
19398
  async function listSubagents() {
19164
- const subagentsDir = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19399
+ const subagentsDir = (0, import_node_path126.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19165
19400
  try {
19166
19401
  const files = await listDirectoryFiles(subagentsDir);
19167
19402
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -19174,7 +19409,7 @@ async function listSubagents() {
19174
19409
  });
19175
19410
  const frontmatter = subagent.getFrontmatter();
19176
19411
  return {
19177
- relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
19412
+ relativePathFromCwd: (0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
19178
19413
  frontmatter
19179
19414
  };
19180
19415
  } catch (error) {
@@ -19198,14 +19433,14 @@ async function getSubagent({ relativePathFromCwd }) {
19198
19433
  relativePath: relativePathFromCwd,
19199
19434
  intendedRootDir: process.cwd()
19200
19435
  });
19201
- const filename = (0, import_node_path125.basename)(relativePathFromCwd);
19436
+ const filename = (0, import_node_path126.basename)(relativePathFromCwd);
19202
19437
  try {
19203
19438
  const subagent = await RulesyncSubagent.fromFile({
19204
19439
  relativeFilePath: filename,
19205
19440
  validate: true
19206
19441
  });
19207
19442
  return {
19208
- relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19443
+ relativePathFromCwd: (0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19209
19444
  frontmatter: subagent.getFrontmatter(),
19210
19445
  body: subagent.getBody()
19211
19446
  };
@@ -19224,7 +19459,7 @@ async function putSubagent({
19224
19459
  relativePath: relativePathFromCwd,
19225
19460
  intendedRootDir: process.cwd()
19226
19461
  });
19227
- const filename = (0, import_node_path125.basename)(relativePathFromCwd);
19462
+ const filename = (0, import_node_path126.basename)(relativePathFromCwd);
19228
19463
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
19229
19464
  if (estimatedSize > maxSubagentSizeBytes) {
19230
19465
  throw new Error(
@@ -19234,7 +19469,7 @@ async function putSubagent({
19234
19469
  try {
19235
19470
  const existingSubagents = await listSubagents();
19236
19471
  const isUpdate = existingSubagents.some(
19237
- (subagent2) => subagent2.relativePathFromCwd === (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19472
+ (subagent2) => subagent2.relativePathFromCwd === (0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19238
19473
  );
19239
19474
  if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
19240
19475
  throw new Error(
@@ -19249,11 +19484,11 @@ async function putSubagent({
19249
19484
  body,
19250
19485
  validate: true
19251
19486
  });
19252
- const subagentsDir = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19487
+ const subagentsDir = (0, import_node_path126.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19253
19488
  await ensureDir(subagentsDir);
19254
19489
  await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
19255
19490
  return {
19256
- relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19491
+ relativePathFromCwd: (0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19257
19492
  frontmatter: subagent.getFrontmatter(),
19258
19493
  body: subagent.getBody()
19259
19494
  };
@@ -19268,12 +19503,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
19268
19503
  relativePath: relativePathFromCwd,
19269
19504
  intendedRootDir: process.cwd()
19270
19505
  });
19271
- const filename = (0, import_node_path125.basename)(relativePathFromCwd);
19272
- const fullPath = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
19506
+ const filename = (0, import_node_path126.basename)(relativePathFromCwd);
19507
+ const fullPath = (0, import_node_path126.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
19273
19508
  try {
19274
19509
  await removeFile(fullPath);
19275
19510
  return {
19276
- relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19511
+ relativePathFromCwd: (0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19277
19512
  };
19278
19513
  } catch (error) {
19279
19514
  throw new Error(
@@ -19285,23 +19520,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
19285
19520
  }
19286
19521
  }
19287
19522
  var subagentToolSchemas = {
19288
- listSubagents: import_mini65.z.object({}),
19289
- getSubagent: import_mini65.z.object({
19290
- relativePathFromCwd: import_mini65.z.string()
19523
+ listSubagents: import_mini66.z.object({}),
19524
+ getSubagent: import_mini66.z.object({
19525
+ relativePathFromCwd: import_mini66.z.string()
19291
19526
  }),
19292
- putSubagent: import_mini65.z.object({
19293
- relativePathFromCwd: import_mini65.z.string(),
19527
+ putSubagent: import_mini66.z.object({
19528
+ relativePathFromCwd: import_mini66.z.string(),
19294
19529
  frontmatter: RulesyncSubagentFrontmatterSchema,
19295
- body: import_mini65.z.string()
19530
+ body: import_mini66.z.string()
19296
19531
  }),
19297
- deleteSubagent: import_mini65.z.object({
19298
- relativePathFromCwd: import_mini65.z.string()
19532
+ deleteSubagent: import_mini66.z.object({
19533
+ relativePathFromCwd: import_mini66.z.string()
19299
19534
  })
19300
19535
  };
19301
19536
  var subagentTools = {
19302
19537
  listSubagents: {
19303
19538
  name: "listSubagents",
19304
- description: `List all subagents from ${(0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
19539
+ description: `List all subagents from ${(0, import_node_path126.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
19305
19540
  parameters: subagentToolSchemas.listSubagents,
19306
19541
  execute: async () => {
19307
19542
  const subagents = await listSubagents();
@@ -19343,7 +19578,7 @@ var subagentTools = {
19343
19578
  };
19344
19579
 
19345
19580
  // src/mcp/tools.ts
19346
- var rulesyncFeatureSchema = import_mini66.z.enum([
19581
+ var rulesyncFeatureSchema = import_mini67.z.enum([
19347
19582
  "rule",
19348
19583
  "command",
19349
19584
  "subagent",
@@ -19353,21 +19588,21 @@ var rulesyncFeatureSchema = import_mini66.z.enum([
19353
19588
  "generate",
19354
19589
  "import"
19355
19590
  ]);
19356
- var rulesyncOperationSchema = import_mini66.z.enum(["list", "get", "put", "delete", "run"]);
19357
- var skillFileSchema = import_mini66.z.object({
19358
- name: import_mini66.z.string(),
19359
- body: import_mini66.z.string()
19591
+ var rulesyncOperationSchema = import_mini67.z.enum(["list", "get", "put", "delete", "run"]);
19592
+ var skillFileSchema = import_mini67.z.object({
19593
+ name: import_mini67.z.string(),
19594
+ body: import_mini67.z.string()
19360
19595
  });
19361
- var rulesyncToolSchema = import_mini66.z.object({
19596
+ var rulesyncToolSchema = import_mini67.z.object({
19362
19597
  feature: rulesyncFeatureSchema,
19363
19598
  operation: rulesyncOperationSchema,
19364
- targetPathFromCwd: import_mini66.z.optional(import_mini66.z.string()),
19365
- frontmatter: import_mini66.z.optional(import_mini66.z.unknown()),
19366
- body: import_mini66.z.optional(import_mini66.z.string()),
19367
- otherFiles: import_mini66.z.optional(import_mini66.z.array(skillFileSchema)),
19368
- content: import_mini66.z.optional(import_mini66.z.string()),
19369
- generateOptions: import_mini66.z.optional(generateOptionsSchema),
19370
- importOptions: import_mini66.z.optional(importOptionsSchema)
19599
+ targetPathFromCwd: import_mini67.z.optional(import_mini67.z.string()),
19600
+ frontmatter: import_mini67.z.optional(import_mini67.z.unknown()),
19601
+ body: import_mini67.z.optional(import_mini67.z.string()),
19602
+ otherFiles: import_mini67.z.optional(import_mini67.z.array(skillFileSchema)),
19603
+ content: import_mini67.z.optional(import_mini67.z.string()),
19604
+ generateOptions: import_mini67.z.optional(generateOptionsSchema),
19605
+ importOptions: import_mini67.z.optional(importOptionsSchema)
19371
19606
  });
19372
19607
  var supportedOperationsByFeature = {
19373
19608
  rule: ["list", "get", "put", "delete"],
@@ -19926,7 +20161,7 @@ async function updateCommand(currentVersion, options) {
19926
20161
  }
19927
20162
 
19928
20163
  // src/cli/index.ts
19929
- var getVersion = () => "7.10.0";
20164
+ var getVersion = () => "7.11.0";
19930
20165
  var main = async () => {
19931
20166
  const program = new import_commander.Command();
19932
20167
  const version = getVersion();