rulesync 7.10.0 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -634,7 +634,7 @@ function getBaseDirsInLightOfGlobal({
634
634
  }
635
635
 
636
636
  // src/lib/generate.ts
637
- var import_node_path114 = require("path");
637
+ var import_node_path115 = require("path");
638
638
  var import_es_toolkit4 = require("es-toolkit");
639
639
 
640
640
  // src/features/commands/commands-processor.ts
@@ -759,10 +759,9 @@ function parseFrontmatter(content, filePath) {
759
759
  body = result.content;
760
760
  } catch (error) {
761
761
  if (filePath) {
762
- throw new Error(
763
- `Failed to parse frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,
764
- { cause: error }
765
- );
762
+ throw new Error(`Failed to parse frontmatter in ${filePath}: ${formatError(error)}`, {
763
+ cause: error
764
+ });
766
765
  }
767
766
  throw error;
768
767
  }
@@ -3019,7 +3018,7 @@ var CommandsProcessor = class extends FeatureProcessor {
3019
3018
  };
3020
3019
 
3021
3020
  // src/features/hooks/hooks-processor.ts
3022
- var import_mini16 = require("zod/mini");
3021
+ var import_mini17 = require("zod/mini");
3023
3022
 
3024
3023
  // src/types/hooks.ts
3025
3024
  var import_mini14 = require("zod/mini");
@@ -3038,7 +3037,9 @@ var HookDefinitionSchema = import_mini14.z.looseObject({
3038
3037
  timeout: import_mini14.z.optional(import_mini14.z.number()),
3039
3038
  matcher: import_mini14.z.optional(safeString),
3040
3039
  prompt: import_mini14.z.optional(import_mini14.z.string()),
3041
- loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number()))
3040
+ loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number())),
3041
+ name: import_mini14.z.optional(safeString),
3042
+ description: import_mini14.z.optional(safeString)
3042
3043
  });
3043
3044
  var CURSOR_HOOK_EVENTS = [
3044
3045
  "sessionStart",
@@ -3105,6 +3106,19 @@ var FACTORYDROID_HOOK_EVENTS = [
3105
3106
  "notification",
3106
3107
  "setup"
3107
3108
  ];
3109
+ var GEMINICLI_HOOK_EVENTS = [
3110
+ "sessionStart",
3111
+ "sessionEnd",
3112
+ "beforeSubmitPrompt",
3113
+ "stop",
3114
+ "beforeAgentResponse",
3115
+ "afterAgentResponse",
3116
+ "beforeToolSelection",
3117
+ "preToolUse",
3118
+ "postToolUse",
3119
+ "preCompact",
3120
+ "notification"
3121
+ ];
3108
3122
  var hooksRecordSchema = import_mini14.z.record(import_mini14.z.string(), import_mini14.z.array(HookDefinitionSchema));
3109
3123
  var HooksConfigSchema = import_mini14.z.looseObject({
3110
3124
  version: import_mini14.z.optional(import_mini14.z.number()),
@@ -3113,7 +3127,8 @@ var HooksConfigSchema = import_mini14.z.looseObject({
3113
3127
  claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3114
3128
  copilot: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3115
3129
  opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3116
- factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
3130
+ factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3131
+ geminicli: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
3117
3132
  });
3118
3133
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
3119
3134
  sessionStart: "SessionStart",
@@ -3192,6 +3207,22 @@ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
3192
3207
  var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3193
3208
  Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
3194
3209
  );
3210
+ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
3211
+ sessionStart: "SessionStart",
3212
+ sessionEnd: "SessionEnd",
3213
+ beforeSubmitPrompt: "BeforeAgent",
3214
+ stop: "AfterAgent",
3215
+ beforeAgentResponse: "BeforeModel",
3216
+ afterAgentResponse: "AfterModel",
3217
+ beforeToolSelection: "BeforeToolSelection",
3218
+ preToolUse: "BeforeTool",
3219
+ postToolUse: "AfterTool",
3220
+ preCompact: "PreCompress",
3221
+ notification: "Notification"
3222
+ };
3223
+ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3224
+ Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
3225
+ );
3195
3226
 
3196
3227
  // src/features/hooks/claudecode-hooks.ts
3197
3228
  var import_node_path22 = require("path");
@@ -3478,6 +3509,7 @@ var CopilotHookEntrySchema = import_mini15.z.looseObject({
3478
3509
  timeoutSec: import_mini15.z.optional(import_mini15.z.number())
3479
3510
  });
3480
3511
  function canonicalToCopilotHooks(config) {
3512
+ const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
3481
3513
  const isWindows = process.platform === "win32";
3482
3514
  const commandField = isWindows ? "powershell" : "bash";
3483
3515
  const supported = new Set(COPILOT_HOOK_EVENTS);
@@ -3502,9 +3534,7 @@ function canonicalToCopilotHooks(config) {
3502
3534
  const command = def.command;
3503
3535
  const timeout = def.timeout;
3504
3536
  const rest = Object.fromEntries(
3505
- Object.entries(def).filter(
3506
- ([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
3507
- )
3537
+ Object.entries(def).filter(([k]) => !canonicalSchemaKeys.includes(k))
3508
3538
  );
3509
3539
  entries.push({
3510
3540
  type: hookType,
@@ -3697,7 +3727,14 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3697
3727
  const mappedHooks = {};
3698
3728
  for (const [eventName, defs] of Object.entries(mergedHooks)) {
3699
3729
  const cursorEventName = CANONICAL_TO_CURSOR_EVENT_NAMES[eventName] ?? eventName;
3700
- mappedHooks[cursorEventName] = defs;
3730
+ mappedHooks[cursorEventName] = defs.map((def) => ({
3731
+ ...def.type !== void 0 && def.type !== null && { type: def.type },
3732
+ ...def.command !== void 0 && def.command !== null && { command: def.command },
3733
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
3734
+ ...def.loop_limit !== void 0 && { loop_limit: def.loop_limit },
3735
+ ...def.matcher !== void 0 && def.matcher !== null && { matcher: def.matcher },
3736
+ ...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
3737
+ }));
3701
3738
  }
3702
3739
  const cursorConfig = {
3703
3740
  version: config.version ?? 1,
@@ -3930,8 +3967,193 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3930
3967
  }
3931
3968
  };
3932
3969
 
3933
- // src/features/hooks/opencode-hooks.ts
3970
+ // src/features/hooks/geminicli-hooks.ts
3934
3971
  var import_node_path26 = require("path");
3972
+ var import_mini16 = require("zod/mini");
3973
+ function canonicalToGeminicliHooks(config) {
3974
+ const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
3975
+ const sharedHooks = {};
3976
+ for (const [event, defs] of Object.entries(config.hooks)) {
3977
+ if (geminiSupported.has(event)) {
3978
+ sharedHooks[event] = defs;
3979
+ }
3980
+ }
3981
+ const effectiveHooks = {
3982
+ ...sharedHooks,
3983
+ ...config.geminicli?.hooks
3984
+ };
3985
+ const gemini = {};
3986
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3987
+ const geminiEventName = CANONICAL_TO_GEMINICLI_EVENT_NAMES[eventName] ?? eventName;
3988
+ const byMatcher = /* @__PURE__ */ new Map();
3989
+ for (const def of definitions) {
3990
+ const key = def.matcher ?? "";
3991
+ const list = byMatcher.get(key);
3992
+ if (list) list.push(def);
3993
+ else byMatcher.set(key, [def]);
3994
+ }
3995
+ const entries = [];
3996
+ for (const [matcherKey, defs] of byMatcher) {
3997
+ const hooks = defs.map((def) => {
3998
+ const command = def.command !== void 0 && def.command !== null && !def.command.startsWith("$") ? `$GEMINI_PROJECT_DIR/${def.command.replace(/^\.\//, "")}` : def.command;
3999
+ return {
4000
+ type: def.type ?? "command",
4001
+ ...command !== void 0 && command !== null && { command },
4002
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
4003
+ ...def.name !== void 0 && def.name !== null && { name: def.name },
4004
+ ...def.description !== void 0 && def.description !== null && { description: def.description }
4005
+ };
4006
+ });
4007
+ entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
4008
+ }
4009
+ gemini[geminiEventName] = entries;
4010
+ }
4011
+ return gemini;
4012
+ }
4013
+ var GeminiHookEntrySchema = import_mini16.z.looseObject({
4014
+ type: import_mini16.z.optional(import_mini16.z.string()),
4015
+ command: import_mini16.z.optional(import_mini16.z.string()),
4016
+ timeout: import_mini16.z.optional(import_mini16.z.number()),
4017
+ name: import_mini16.z.optional(import_mini16.z.string()),
4018
+ description: import_mini16.z.optional(import_mini16.z.string())
4019
+ });
4020
+ var GeminiMatcherEntrySchema = import_mini16.z.looseObject({
4021
+ matcher: import_mini16.z.optional(import_mini16.z.string()),
4022
+ hooks: import_mini16.z.optional(import_mini16.z.array(GeminiHookEntrySchema))
4023
+ });
4024
+ function geminiHooksToCanonical(geminiHooks) {
4025
+ if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
4026
+ return {};
4027
+ }
4028
+ const canonical = {};
4029
+ for (const [geminiEventName, matcherEntries] of Object.entries(geminiHooks)) {
4030
+ const eventName = GEMINICLI_TO_CANONICAL_EVENT_NAMES[geminiEventName] ?? geminiEventName;
4031
+ if (!Array.isArray(matcherEntries)) continue;
4032
+ const defs = [];
4033
+ for (const rawEntry of matcherEntries) {
4034
+ const parseResult = GeminiMatcherEntrySchema.safeParse(rawEntry);
4035
+ if (!parseResult.success) continue;
4036
+ const entry = parseResult.data;
4037
+ const hooks = entry.hooks ?? [];
4038
+ for (const h of hooks) {
4039
+ const cmd = h.command;
4040
+ const command = typeof cmd === "string" && cmd.startsWith("$GEMINI_PROJECT_DIR/") ? cmd.replace(/^\$GEMINI_PROJECT_DIR\/?/, "./") : cmd;
4041
+ const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
4042
+ defs.push({
4043
+ type: hookType,
4044
+ ...command !== void 0 && command !== null && { command },
4045
+ ...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
4046
+ ...h.name !== void 0 && h.name !== null && { name: h.name },
4047
+ ...h.description !== void 0 && h.description !== null && { description: h.description },
4048
+ ...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
4049
+ });
4050
+ }
4051
+ }
4052
+ if (defs.length > 0) {
4053
+ canonical[eventName] = defs;
4054
+ }
4055
+ }
4056
+ return canonical;
4057
+ }
4058
+ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4059
+ constructor(params) {
4060
+ super({
4061
+ ...params,
4062
+ fileContent: params.fileContent ?? "{}"
4063
+ });
4064
+ }
4065
+ isDeletable() {
4066
+ return false;
4067
+ }
4068
+ static getSettablePaths(_options = {}) {
4069
+ return { relativeDirPath: ".gemini", relativeFilePath: "settings.json" };
4070
+ }
4071
+ static async fromFile({
4072
+ baseDir = process.cwd(),
4073
+ validate = true,
4074
+ global = false
4075
+ }) {
4076
+ const paths = _GeminicliHooks.getSettablePaths({ global });
4077
+ const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4078
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4079
+ return new _GeminicliHooks({
4080
+ baseDir,
4081
+ relativeDirPath: paths.relativeDirPath,
4082
+ relativeFilePath: paths.relativeFilePath,
4083
+ fileContent,
4084
+ validate
4085
+ });
4086
+ }
4087
+ static async fromRulesyncHooks({
4088
+ baseDir = process.cwd(),
4089
+ rulesyncHooks,
4090
+ validate = true,
4091
+ global = false
4092
+ }) {
4093
+ const paths = _GeminicliHooks.getSettablePaths({ global });
4094
+ const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4095
+ const existingContent = await readOrInitializeFileContent(
4096
+ filePath,
4097
+ JSON.stringify({}, null, 2)
4098
+ );
4099
+ let settings;
4100
+ try {
4101
+ settings = JSON.parse(existingContent);
4102
+ } catch (error) {
4103
+ throw new Error(
4104
+ `Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(error)}`,
4105
+ { cause: error }
4106
+ );
4107
+ }
4108
+ const config = rulesyncHooks.getJson();
4109
+ const geminiHooks = canonicalToGeminicliHooks(config);
4110
+ const merged = { ...settings, hooks: geminiHooks };
4111
+ const fileContent = JSON.stringify(merged, null, 2);
4112
+ return new _GeminicliHooks({
4113
+ baseDir,
4114
+ relativeDirPath: paths.relativeDirPath,
4115
+ relativeFilePath: paths.relativeFilePath,
4116
+ fileContent,
4117
+ validate
4118
+ });
4119
+ }
4120
+ toRulesyncHooks() {
4121
+ let settings;
4122
+ try {
4123
+ settings = JSON.parse(this.getFileContent());
4124
+ } catch (error) {
4125
+ throw new Error(
4126
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4127
+ {
4128
+ cause: error
4129
+ }
4130
+ );
4131
+ }
4132
+ const hooks = geminiHooksToCanonical(settings.hooks);
4133
+ return this.toRulesyncHooksDefault({
4134
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
4135
+ });
4136
+ }
4137
+ validate() {
4138
+ return { success: true, error: null };
4139
+ }
4140
+ static forDeletion({
4141
+ baseDir = process.cwd(),
4142
+ relativeDirPath,
4143
+ relativeFilePath
4144
+ }) {
4145
+ return new _GeminicliHooks({
4146
+ baseDir,
4147
+ relativeDirPath,
4148
+ relativeFilePath,
4149
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
4150
+ validate: false
4151
+ });
4152
+ }
4153
+ };
4154
+
4155
+ // src/features/hooks/opencode-hooks.ts
4156
+ var import_node_path27 = require("path");
3935
4157
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
3936
4158
  function escapeForTemplateLiteral(command) {
3937
4159
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -4029,7 +4251,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4029
4251
  }
4030
4252
  static getSettablePaths(options) {
4031
4253
  return {
4032
- relativeDirPath: options?.global ? (0, import_node_path26.join)(".config", "opencode", "plugins") : (0, import_node_path26.join)(".opencode", "plugins"),
4254
+ relativeDirPath: options?.global ? (0, import_node_path27.join)(".config", "opencode", "plugins") : (0, import_node_path27.join)(".opencode", "plugins"),
4033
4255
  relativeFilePath: "rulesync-hooks.js"
4034
4256
  };
4035
4257
  }
@@ -4040,7 +4262,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4040
4262
  }) {
4041
4263
  const paths = _OpencodeHooks.getSettablePaths({ global });
4042
4264
  const fileContent = await readFileContent(
4043
- (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4265
+ (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4044
4266
  );
4045
4267
  return new _OpencodeHooks({
4046
4268
  baseDir,
@@ -4094,9 +4316,10 @@ var hooksProcessorToolTargetTuple = [
4094
4316
  "claudecode",
4095
4317
  "copilot",
4096
4318
  "opencode",
4097
- "factorydroid"
4319
+ "factorydroid",
4320
+ "geminicli"
4098
4321
  ];
4099
- var HooksProcessorToolTargetSchema = import_mini16.z.enum(hooksProcessorToolTargetTuple);
4322
+ var HooksProcessorToolTargetSchema = import_mini17.z.enum(hooksProcessorToolTargetTuple);
4100
4323
  var toolHooksFactories = /* @__PURE__ */ new Map([
4101
4324
  [
4102
4325
  "cursor",
@@ -4167,6 +4390,16 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
4167
4390
  supportedHookTypes: ["command", "prompt"],
4168
4391
  supportsMatcher: true
4169
4392
  }
4393
+ ],
4394
+ [
4395
+ "geminicli",
4396
+ {
4397
+ class: GeminicliHooks,
4398
+ meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
4399
+ supportedEvents: GEMINICLI_HOOK_EVENTS,
4400
+ supportedHookTypes: ["command"],
4401
+ supportsMatcher: true
4402
+ }
4170
4403
  ]
4171
4404
  ]);
4172
4405
  var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
@@ -4321,13 +4554,13 @@ var HooksProcessor = class extends FeatureProcessor {
4321
4554
  };
4322
4555
 
4323
4556
  // src/features/ignore/ignore-processor.ts
4324
- var import_mini17 = require("zod/mini");
4557
+ var import_mini18 = require("zod/mini");
4325
4558
 
4326
4559
  // src/features/ignore/augmentcode-ignore.ts
4327
- var import_node_path28 = require("path");
4560
+ var import_node_path29 = require("path");
4328
4561
 
4329
4562
  // src/features/ignore/rulesync-ignore.ts
4330
- var import_node_path27 = require("path");
4563
+ var import_node_path28 = require("path");
4331
4564
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4332
4565
  validate() {
4333
4566
  return { success: true, error: null };
@@ -4347,12 +4580,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4347
4580
  static async fromFile() {
4348
4581
  const baseDir = process.cwd();
4349
4582
  const paths = this.getSettablePaths();
4350
- const recommendedPath = (0, import_node_path27.join)(
4583
+ const recommendedPath = (0, import_node_path28.join)(
4351
4584
  baseDir,
4352
4585
  paths.recommended.relativeDirPath,
4353
4586
  paths.recommended.relativeFilePath
4354
4587
  );
4355
- const legacyPath = (0, import_node_path27.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4588
+ const legacyPath = (0, import_node_path28.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4356
4589
  if (await fileExists(recommendedPath)) {
4357
4590
  const fileContent2 = await readFileContent(recommendedPath);
4358
4591
  return new _RulesyncIgnore({
@@ -4468,7 +4701,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4468
4701
  validate = true
4469
4702
  }) {
4470
4703
  const fileContent = await readFileContent(
4471
- (0, import_node_path28.join)(
4704
+ (0, import_node_path29.join)(
4472
4705
  baseDir,
4473
4706
  this.getSettablePaths().relativeDirPath,
4474
4707
  this.getSettablePaths().relativeFilePath
@@ -4498,7 +4731,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4498
4731
  };
4499
4732
 
4500
4733
  // src/features/ignore/claudecode-ignore.ts
4501
- var import_node_path29 = require("path");
4734
+ var import_node_path30 = require("path");
4502
4735
  var import_es_toolkit2 = require("es-toolkit");
4503
4736
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4504
4737
  constructor(params) {
@@ -4541,7 +4774,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4541
4774
  const fileContent = rulesyncIgnore.getFileContent();
4542
4775
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4543
4776
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4544
- const filePath = (0, import_node_path29.join)(
4777
+ const filePath = (0, import_node_path30.join)(
4545
4778
  baseDir,
4546
4779
  this.getSettablePaths().relativeDirPath,
4547
4780
  this.getSettablePaths().relativeFilePath
@@ -4577,7 +4810,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4577
4810
  validate = true
4578
4811
  }) {
4579
4812
  const fileContent = await readFileContent(
4580
- (0, import_node_path29.join)(
4813
+ (0, import_node_path30.join)(
4581
4814
  baseDir,
4582
4815
  this.getSettablePaths().relativeDirPath,
4583
4816
  this.getSettablePaths().relativeFilePath
@@ -4607,7 +4840,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4607
4840
  };
4608
4841
 
4609
4842
  // src/features/ignore/cline-ignore.ts
4610
- var import_node_path30 = require("path");
4843
+ var import_node_path31 = require("path");
4611
4844
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4612
4845
  static getSettablePaths() {
4613
4846
  return {
@@ -4644,7 +4877,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4644
4877
  validate = true
4645
4878
  }) {
4646
4879
  const fileContent = await readFileContent(
4647
- (0, import_node_path30.join)(
4880
+ (0, import_node_path31.join)(
4648
4881
  baseDir,
4649
4882
  this.getSettablePaths().relativeDirPath,
4650
4883
  this.getSettablePaths().relativeFilePath
@@ -4674,7 +4907,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4674
4907
  };
4675
4908
 
4676
4909
  // src/features/ignore/cursor-ignore.ts
4677
- var import_node_path31 = require("path");
4910
+ var import_node_path32 = require("path");
4678
4911
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4679
4912
  static getSettablePaths() {
4680
4913
  return {
@@ -4707,7 +4940,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4707
4940
  validate = true
4708
4941
  }) {
4709
4942
  const fileContent = await readFileContent(
4710
- (0, import_node_path31.join)(
4943
+ (0, import_node_path32.join)(
4711
4944
  baseDir,
4712
4945
  this.getSettablePaths().relativeDirPath,
4713
4946
  this.getSettablePaths().relativeFilePath
@@ -4737,7 +4970,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4737
4970
  };
4738
4971
 
4739
4972
  // src/features/ignore/geminicli-ignore.ts
4740
- var import_node_path32 = require("path");
4973
+ var import_node_path33 = require("path");
4741
4974
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4742
4975
  static getSettablePaths() {
4743
4976
  return {
@@ -4764,7 +4997,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4764
4997
  validate = true
4765
4998
  }) {
4766
4999
  const fileContent = await readFileContent(
4767
- (0, import_node_path32.join)(
5000
+ (0, import_node_path33.join)(
4768
5001
  baseDir,
4769
5002
  this.getSettablePaths().relativeDirPath,
4770
5003
  this.getSettablePaths().relativeFilePath
@@ -4794,7 +5027,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4794
5027
  };
4795
5028
 
4796
5029
  // src/features/ignore/goose-ignore.ts
4797
- var import_node_path33 = require("path");
5030
+ var import_node_path34 = require("path");
4798
5031
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4799
5032
  static getSettablePaths() {
4800
5033
  return {
@@ -4831,7 +5064,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4831
5064
  validate = true
4832
5065
  }) {
4833
5066
  const fileContent = await readFileContent(
4834
- (0, import_node_path33.join)(
5067
+ (0, import_node_path34.join)(
4835
5068
  baseDir,
4836
5069
  this.getSettablePaths().relativeDirPath,
4837
5070
  this.getSettablePaths().relativeFilePath
@@ -4861,7 +5094,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4861
5094
  };
4862
5095
 
4863
5096
  // src/features/ignore/junie-ignore.ts
4864
- var import_node_path34 = require("path");
5097
+ var import_node_path35 = require("path");
4865
5098
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4866
5099
  static getSettablePaths() {
4867
5100
  return {
@@ -4888,7 +5121,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4888
5121
  validate = true
4889
5122
  }) {
4890
5123
  const fileContent = await readFileContent(
4891
- (0, import_node_path34.join)(
5124
+ (0, import_node_path35.join)(
4892
5125
  baseDir,
4893
5126
  this.getSettablePaths().relativeDirPath,
4894
5127
  this.getSettablePaths().relativeFilePath
@@ -4918,7 +5151,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4918
5151
  };
4919
5152
 
4920
5153
  // src/features/ignore/kilo-ignore.ts
4921
- var import_node_path35 = require("path");
5154
+ var import_node_path36 = require("path");
4922
5155
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4923
5156
  static getSettablePaths() {
4924
5157
  return {
@@ -4955,7 +5188,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4955
5188
  validate = true
4956
5189
  }) {
4957
5190
  const fileContent = await readFileContent(
4958
- (0, import_node_path35.join)(
5191
+ (0, import_node_path36.join)(
4959
5192
  baseDir,
4960
5193
  this.getSettablePaths().relativeDirPath,
4961
5194
  this.getSettablePaths().relativeFilePath
@@ -4985,7 +5218,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4985
5218
  };
4986
5219
 
4987
5220
  // src/features/ignore/kiro-ignore.ts
4988
- var import_node_path36 = require("path");
5221
+ var import_node_path37 = require("path");
4989
5222
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4990
5223
  static getSettablePaths() {
4991
5224
  return {
@@ -5012,7 +5245,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5012
5245
  validate = true
5013
5246
  }) {
5014
5247
  const fileContent = await readFileContent(
5015
- (0, import_node_path36.join)(
5248
+ (0, import_node_path37.join)(
5016
5249
  baseDir,
5017
5250
  this.getSettablePaths().relativeDirPath,
5018
5251
  this.getSettablePaths().relativeFilePath
@@ -5042,7 +5275,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5042
5275
  };
5043
5276
 
5044
5277
  // src/features/ignore/qwencode-ignore.ts
5045
- var import_node_path37 = require("path");
5278
+ var import_node_path38 = require("path");
5046
5279
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5047
5280
  static getSettablePaths() {
5048
5281
  return {
@@ -5069,7 +5302,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5069
5302
  validate = true
5070
5303
  }) {
5071
5304
  const fileContent = await readFileContent(
5072
- (0, import_node_path37.join)(
5305
+ (0, import_node_path38.join)(
5073
5306
  baseDir,
5074
5307
  this.getSettablePaths().relativeDirPath,
5075
5308
  this.getSettablePaths().relativeFilePath
@@ -5099,7 +5332,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5099
5332
  };
5100
5333
 
5101
5334
  // src/features/ignore/roo-ignore.ts
5102
- var import_node_path38 = require("path");
5335
+ var import_node_path39 = require("path");
5103
5336
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5104
5337
  static getSettablePaths() {
5105
5338
  return {
@@ -5126,7 +5359,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5126
5359
  validate = true
5127
5360
  }) {
5128
5361
  const fileContent = await readFileContent(
5129
- (0, import_node_path38.join)(
5362
+ (0, import_node_path39.join)(
5130
5363
  baseDir,
5131
5364
  this.getSettablePaths().relativeDirPath,
5132
5365
  this.getSettablePaths().relativeFilePath
@@ -5156,7 +5389,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5156
5389
  };
5157
5390
 
5158
5391
  // src/features/ignore/windsurf-ignore.ts
5159
- var import_node_path39 = require("path");
5392
+ var import_node_path40 = require("path");
5160
5393
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5161
5394
  static getSettablePaths() {
5162
5395
  return {
@@ -5183,7 +5416,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5183
5416
  validate = true
5184
5417
  }) {
5185
5418
  const fileContent = await readFileContent(
5186
- (0, import_node_path39.join)(
5419
+ (0, import_node_path40.join)(
5187
5420
  baseDir,
5188
5421
  this.getSettablePaths().relativeDirPath,
5189
5422
  this.getSettablePaths().relativeFilePath
@@ -5213,7 +5446,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5213
5446
  };
5214
5447
 
5215
5448
  // src/features/ignore/zed-ignore.ts
5216
- var import_node_path40 = require("path");
5449
+ var import_node_path41 = require("path");
5217
5450
  var import_es_toolkit3 = require("es-toolkit");
5218
5451
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5219
5452
  constructor(params) {
@@ -5250,7 +5483,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5250
5483
  }) {
5251
5484
  const fileContent = rulesyncIgnore.getFileContent();
5252
5485
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5253
- const filePath = (0, import_node_path40.join)(
5486
+ const filePath = (0, import_node_path41.join)(
5254
5487
  baseDir,
5255
5488
  this.getSettablePaths().relativeDirPath,
5256
5489
  this.getSettablePaths().relativeFilePath
@@ -5277,7 +5510,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5277
5510
  validate = true
5278
5511
  }) {
5279
5512
  const fileContent = await readFileContent(
5280
- (0, import_node_path40.join)(
5513
+ (0, import_node_path41.join)(
5281
5514
  baseDir,
5282
5515
  this.getSettablePaths().relativeDirPath,
5283
5516
  this.getSettablePaths().relativeFilePath
@@ -5323,7 +5556,7 @@ var ignoreProcessorToolTargets = [
5323
5556
  "windsurf",
5324
5557
  "zed"
5325
5558
  ];
5326
- var IgnoreProcessorToolTargetSchema = import_mini17.z.enum(ignoreProcessorToolTargets);
5559
+ var IgnoreProcessorToolTargetSchema = import_mini18.z.enum(ignoreProcessorToolTargets);
5327
5560
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
5328
5561
  ["augmentcode", { class: AugmentcodeIgnore }],
5329
5562
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -5461,49 +5694,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
5461
5694
  };
5462
5695
 
5463
5696
  // src/features/mcp/mcp-processor.ts
5464
- var import_mini21 = require("zod/mini");
5697
+ var import_mini22 = require("zod/mini");
5465
5698
 
5466
5699
  // src/features/mcp/claudecode-mcp.ts
5467
- var import_node_path42 = require("path");
5700
+ var import_node_path43 = require("path");
5468
5701
 
5469
5702
  // src/features/mcp/rulesync-mcp.ts
5470
- var import_node_path41 = require("path");
5703
+ var import_node_path42 = require("path");
5471
5704
  var import_object = require("es-toolkit/object");
5472
- var import_mini19 = require("zod/mini");
5705
+ var import_mini20 = require("zod/mini");
5473
5706
 
5474
5707
  // src/types/mcp.ts
5475
- var import_mini18 = require("zod/mini");
5476
- var McpServerSchema = import_mini18.z.object({
5477
- type: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5478
- command: import_mini18.z.optional(import_mini18.z.union([import_mini18.z.string(), import_mini18.z.array(import_mini18.z.string())])),
5479
- args: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5480
- url: import_mini18.z.optional(import_mini18.z.string()),
5481
- httpUrl: import_mini18.z.optional(import_mini18.z.string()),
5482
- env: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5483
- disabled: import_mini18.z.optional(import_mini18.z.boolean()),
5484
- networkTimeout: import_mini18.z.optional(import_mini18.z.number()),
5485
- timeout: import_mini18.z.optional(import_mini18.z.number()),
5486
- trust: import_mini18.z.optional(import_mini18.z.boolean()),
5487
- cwd: import_mini18.z.optional(import_mini18.z.string()),
5488
- transport: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5489
- alwaysAllow: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5490
- tools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5491
- kiroAutoApprove: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5492
- kiroAutoBlock: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5493
- headers: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
5494
- enabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
5495
- disabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
5708
+ var import_mini19 = require("zod/mini");
5709
+ var McpServerSchema = import_mini19.z.object({
5710
+ type: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
5711
+ command: import_mini19.z.optional(import_mini19.z.union([import_mini19.z.string(), import_mini19.z.array(import_mini19.z.string())])),
5712
+ args: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5713
+ url: import_mini19.z.optional(import_mini19.z.string()),
5714
+ httpUrl: import_mini19.z.optional(import_mini19.z.string()),
5715
+ env: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
5716
+ disabled: import_mini19.z.optional(import_mini19.z.boolean()),
5717
+ networkTimeout: import_mini19.z.optional(import_mini19.z.number()),
5718
+ timeout: import_mini19.z.optional(import_mini19.z.number()),
5719
+ trust: import_mini19.z.optional(import_mini19.z.boolean()),
5720
+ cwd: import_mini19.z.optional(import_mini19.z.string()),
5721
+ transport: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
5722
+ alwaysAllow: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5723
+ tools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5724
+ kiroAutoApprove: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5725
+ kiroAutoBlock: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5726
+ headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
5727
+ enabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5728
+ disabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string()))
5496
5729
  });
5497
- var McpServersSchema = import_mini18.z.record(import_mini18.z.string(), McpServerSchema);
5730
+ var McpServersSchema = import_mini19.z.record(import_mini19.z.string(), McpServerSchema);
5498
5731
 
5499
5732
  // src/features/mcp/rulesync-mcp.ts
5500
- var RulesyncMcpServerSchema = import_mini19.z.extend(McpServerSchema, {
5501
- targets: import_mini19.z.optional(RulesyncTargetsSchema),
5502
- description: import_mini19.z.optional(import_mini19.z.string()),
5503
- exposed: import_mini19.z.optional(import_mini19.z.boolean())
5733
+ var RulesyncMcpServerSchema = import_mini20.z.extend(McpServerSchema, {
5734
+ targets: import_mini20.z.optional(RulesyncTargetsSchema),
5735
+ description: import_mini20.z.optional(import_mini20.z.string()),
5736
+ exposed: import_mini20.z.optional(import_mini20.z.boolean())
5504
5737
  });
5505
- var RulesyncMcpConfigSchema = import_mini19.z.object({
5506
- mcpServers: import_mini19.z.record(import_mini19.z.string(), RulesyncMcpServerSchema)
5738
+ var RulesyncMcpConfigSchema = import_mini20.z.object({
5739
+ mcpServers: import_mini20.z.record(import_mini20.z.string(), RulesyncMcpServerSchema)
5507
5740
  });
5508
5741
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5509
5742
  json;
@@ -5539,12 +5772,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5539
5772
  static async fromFile({ validate = true }) {
5540
5773
  const baseDir = process.cwd();
5541
5774
  const paths = this.getSettablePaths();
5542
- const recommendedPath = (0, import_node_path41.join)(
5775
+ const recommendedPath = (0, import_node_path42.join)(
5543
5776
  baseDir,
5544
5777
  paths.recommended.relativeDirPath,
5545
5778
  paths.recommended.relativeFilePath
5546
5779
  );
5547
- const legacyPath = (0, import_node_path41.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5780
+ const legacyPath = (0, import_node_path42.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5548
5781
  if (await fileExists(recommendedPath)) {
5549
5782
  const fileContent2 = await readFileContent(recommendedPath);
5550
5783
  return new _RulesyncMcp({
@@ -5689,7 +5922,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5689
5922
  global = false
5690
5923
  }) {
5691
5924
  const paths = this.getSettablePaths({ global });
5692
- const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5925
+ const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5693
5926
  const json = JSON.parse(fileContent);
5694
5927
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5695
5928
  return new _ClaudecodeMcp({
@@ -5708,7 +5941,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5708
5941
  }) {
5709
5942
  const paths = this.getSettablePaths({ global });
5710
5943
  const fileContent = await readOrInitializeFileContent(
5711
- (0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5944
+ (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5712
5945
  JSON.stringify({ mcpServers: {} }, null, 2)
5713
5946
  );
5714
5947
  const json = JSON.parse(fileContent);
@@ -5747,7 +5980,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5747
5980
  };
5748
5981
 
5749
5982
  // src/features/mcp/cline-mcp.ts
5750
- var import_node_path43 = require("path");
5983
+ var import_node_path44 = require("path");
5751
5984
  var ClineMcp = class _ClineMcp extends ToolMcp {
5752
5985
  json;
5753
5986
  constructor(params) {
@@ -5768,7 +6001,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5768
6001
  validate = true
5769
6002
  }) {
5770
6003
  const fileContent = await readFileContent(
5771
- (0, import_node_path43.join)(
6004
+ (0, import_node_path44.join)(
5772
6005
  baseDir,
5773
6006
  this.getSettablePaths().relativeDirPath,
5774
6007
  this.getSettablePaths().relativeFilePath
@@ -5817,7 +6050,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5817
6050
  };
5818
6051
 
5819
6052
  // src/features/mcp/codexcli-mcp.ts
5820
- var import_node_path44 = require("path");
6053
+ var import_node_path45 = require("path");
5821
6054
  var smolToml = __toESM(require("smol-toml"), 1);
5822
6055
  function convertFromCodexFormat(codexMcp) {
5823
6056
  const result = {};
@@ -5900,7 +6133,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5900
6133
  global = false
5901
6134
  }) {
5902
6135
  const paths = this.getSettablePaths({ global });
5903
- const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6136
+ const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5904
6137
  return new _CodexcliMcp({
5905
6138
  baseDir,
5906
6139
  relativeDirPath: paths.relativeDirPath,
@@ -5916,7 +6149,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5916
6149
  global = false
5917
6150
  }) {
5918
6151
  const paths = this.getSettablePaths({ global });
5919
- const configTomlFilePath = (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6152
+ const configTomlFilePath = (0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5920
6153
  const configTomlFileContent = await readOrInitializeFileContent(
5921
6154
  configTomlFilePath,
5922
6155
  smolToml.stringify({})
@@ -5973,7 +6206,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5973
6206
  };
5974
6207
 
5975
6208
  // src/features/mcp/copilot-mcp.ts
5976
- var import_node_path45 = require("path");
6209
+ var import_node_path46 = require("path");
5977
6210
  function convertToCopilotFormat(mcpServers) {
5978
6211
  return { servers: mcpServers };
5979
6212
  }
@@ -6000,7 +6233,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6000
6233
  validate = true
6001
6234
  }) {
6002
6235
  const fileContent = await readFileContent(
6003
- (0, import_node_path45.join)(
6236
+ (0, import_node_path46.join)(
6004
6237
  baseDir,
6005
6238
  this.getSettablePaths().relativeDirPath,
6006
6239
  this.getSettablePaths().relativeFilePath
@@ -6053,7 +6286,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6053
6286
  };
6054
6287
 
6055
6288
  // src/features/mcp/cursor-mcp.ts
6056
- var import_node_path46 = require("path");
6289
+ var import_node_path47 = require("path");
6057
6290
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
6058
6291
  function isMcpServers(value) {
6059
6292
  return value !== void 0 && value !== null && typeof value === "object";
@@ -6114,7 +6347,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6114
6347
  validate = true
6115
6348
  }) {
6116
6349
  const fileContent = await readFileContent(
6117
- (0, import_node_path46.join)(
6350
+ (0, import_node_path47.join)(
6118
6351
  baseDir,
6119
6352
  this.getSettablePaths().relativeDirPath,
6120
6353
  this.getSettablePaths().relativeFilePath
@@ -6182,7 +6415,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6182
6415
  };
6183
6416
 
6184
6417
  // src/features/mcp/factorydroid-mcp.ts
6185
- var import_node_path47 = require("path");
6418
+ var import_node_path48 = require("path");
6186
6419
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6187
6420
  json;
6188
6421
  constructor(params) {
@@ -6203,7 +6436,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6203
6436
  validate = true
6204
6437
  }) {
6205
6438
  const fileContent = await readFileContent(
6206
- (0, import_node_path47.join)(
6439
+ (0, import_node_path48.join)(
6207
6440
  baseDir,
6208
6441
  this.getSettablePaths().relativeDirPath,
6209
6442
  this.getSettablePaths().relativeFilePath
@@ -6263,7 +6496,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6263
6496
  };
6264
6497
 
6265
6498
  // src/features/mcp/geminicli-mcp.ts
6266
- var import_node_path48 = require("path");
6499
+ var import_node_path49 = require("path");
6267
6500
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6268
6501
  json;
6269
6502
  constructor(params) {
@@ -6291,7 +6524,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6291
6524
  global = false
6292
6525
  }) {
6293
6526
  const paths = this.getSettablePaths({ global });
6294
- const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6527
+ const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6295
6528
  const json = JSON.parse(fileContent);
6296
6529
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6297
6530
  return new _GeminiCliMcp({
@@ -6310,7 +6543,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6310
6543
  }) {
6311
6544
  const paths = this.getSettablePaths({ global });
6312
6545
  const fileContent = await readOrInitializeFileContent(
6313
- (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6546
+ (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6314
6547
  JSON.stringify({ mcpServers: {} }, null, 2)
6315
6548
  );
6316
6549
  const json = JSON.parse(fileContent);
@@ -6355,7 +6588,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6355
6588
  };
6356
6589
 
6357
6590
  // src/features/mcp/junie-mcp.ts
6358
- var import_node_path49 = require("path");
6591
+ var import_node_path50 = require("path");
6359
6592
  var JunieMcp = class _JunieMcp extends ToolMcp {
6360
6593
  json;
6361
6594
  constructor(params) {
@@ -6367,7 +6600,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6367
6600
  }
6368
6601
  static getSettablePaths() {
6369
6602
  return {
6370
- relativeDirPath: (0, import_node_path49.join)(".junie", "mcp"),
6603
+ relativeDirPath: (0, import_node_path50.join)(".junie", "mcp"),
6371
6604
  relativeFilePath: "mcp.json"
6372
6605
  };
6373
6606
  }
@@ -6376,7 +6609,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6376
6609
  validate = true
6377
6610
  }) {
6378
6611
  const fileContent = await readFileContent(
6379
- (0, import_node_path49.join)(
6612
+ (0, import_node_path50.join)(
6380
6613
  baseDir,
6381
6614
  this.getSettablePaths().relativeDirPath,
6382
6615
  this.getSettablePaths().relativeFilePath
@@ -6425,7 +6658,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6425
6658
  };
6426
6659
 
6427
6660
  // src/features/mcp/kilo-mcp.ts
6428
- var import_node_path50 = require("path");
6661
+ var import_node_path51 = require("path");
6429
6662
  var KiloMcp = class _KiloMcp extends ToolMcp {
6430
6663
  json;
6431
6664
  constructor(params) {
@@ -6446,7 +6679,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6446
6679
  validate = true
6447
6680
  }) {
6448
6681
  const paths = this.getSettablePaths();
6449
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6682
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6450
6683
  return new _KiloMcp({
6451
6684
  baseDir,
6452
6685
  relativeDirPath: paths.relativeDirPath,
@@ -6494,7 +6727,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6494
6727
  };
6495
6728
 
6496
6729
  // src/features/mcp/kiro-mcp.ts
6497
- var import_node_path51 = require("path");
6730
+ var import_node_path52 = require("path");
6498
6731
  var KiroMcp = class _KiroMcp extends ToolMcp {
6499
6732
  json;
6500
6733
  constructor(params) {
@@ -6506,7 +6739,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6506
6739
  }
6507
6740
  static getSettablePaths() {
6508
6741
  return {
6509
- relativeDirPath: (0, import_node_path51.join)(".kiro", "settings"),
6742
+ relativeDirPath: (0, import_node_path52.join)(".kiro", "settings"),
6510
6743
  relativeFilePath: "mcp.json"
6511
6744
  };
6512
6745
  }
@@ -6515,7 +6748,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6515
6748
  validate = true
6516
6749
  }) {
6517
6750
  const paths = this.getSettablePaths();
6518
- const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6751
+ const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6519
6752
  return new _KiroMcp({
6520
6753
  baseDir,
6521
6754
  relativeDirPath: paths.relativeDirPath,
@@ -6563,30 +6796,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6563
6796
  };
6564
6797
 
6565
6798
  // src/features/mcp/opencode-mcp.ts
6566
- var import_node_path52 = require("path");
6799
+ var import_node_path53 = require("path");
6567
6800
  var import_jsonc_parser2 = require("jsonc-parser");
6568
- var import_mini20 = require("zod/mini");
6569
- var OpencodeMcpLocalServerSchema = import_mini20.z.object({
6570
- type: import_mini20.z.literal("local"),
6571
- command: import_mini20.z.array(import_mini20.z.string()),
6572
- environment: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6573
- enabled: import_mini20.z._default(import_mini20.z.boolean(), true),
6574
- cwd: import_mini20.z.optional(import_mini20.z.string())
6801
+ var import_mini21 = require("zod/mini");
6802
+ var OpencodeMcpLocalServerSchema = import_mini21.z.object({
6803
+ type: import_mini21.z.literal("local"),
6804
+ command: import_mini21.z.array(import_mini21.z.string()),
6805
+ environment: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6806
+ enabled: import_mini21.z._default(import_mini21.z.boolean(), true),
6807
+ cwd: import_mini21.z.optional(import_mini21.z.string())
6575
6808
  });
6576
- var OpencodeMcpRemoteServerSchema = import_mini20.z.object({
6577
- type: import_mini20.z.literal("remote"),
6578
- url: import_mini20.z.string(),
6579
- headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
6580
- enabled: import_mini20.z._default(import_mini20.z.boolean(), true)
6809
+ var OpencodeMcpRemoteServerSchema = import_mini21.z.object({
6810
+ type: import_mini21.z.literal("remote"),
6811
+ url: import_mini21.z.string(),
6812
+ headers: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6813
+ enabled: import_mini21.z._default(import_mini21.z.boolean(), true)
6581
6814
  });
6582
- var OpencodeMcpServerSchema = import_mini20.z.union([
6815
+ var OpencodeMcpServerSchema = import_mini21.z.union([
6583
6816
  OpencodeMcpLocalServerSchema,
6584
6817
  OpencodeMcpRemoteServerSchema
6585
6818
  ]);
6586
- var OpencodeConfigSchema = import_mini20.z.looseObject({
6587
- $schema: import_mini20.z.optional(import_mini20.z.string()),
6588
- mcp: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), OpencodeMcpServerSchema)),
6589
- tools: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.boolean()))
6819
+ var OpencodeConfigSchema = import_mini21.z.looseObject({
6820
+ $schema: import_mini21.z.optional(import_mini21.z.string()),
6821
+ mcp: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), OpencodeMcpServerSchema)),
6822
+ tools: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.boolean()))
6590
6823
  });
6591
6824
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6592
6825
  return Object.fromEntries(
@@ -6704,7 +6937,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6704
6937
  static getSettablePaths({ global } = {}) {
6705
6938
  if (global) {
6706
6939
  return {
6707
- relativeDirPath: (0, import_node_path52.join)(".config", "opencode"),
6940
+ relativeDirPath: (0, import_node_path53.join)(".config", "opencode"),
6708
6941
  relativeFilePath: "opencode.json"
6709
6942
  };
6710
6943
  }
@@ -6719,11 +6952,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6719
6952
  global = false
6720
6953
  }) {
6721
6954
  const basePaths = this.getSettablePaths({ global });
6722
- const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6955
+ const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
6723
6956
  let fileContent = null;
6724
6957
  let relativeFilePath = "opencode.jsonc";
6725
- const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6726
- const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6958
+ const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
6959
+ const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
6727
6960
  fileContent = await readFileContentOrNull(jsoncPath);
6728
6961
  if (!fileContent) {
6729
6962
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6749,11 +6982,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6749
6982
  global = false
6750
6983
  }) {
6751
6984
  const basePaths = this.getSettablePaths({ global });
6752
- const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6985
+ const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
6753
6986
  let fileContent = null;
6754
6987
  let relativeFilePath = "opencode.jsonc";
6755
- const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6756
- const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6988
+ const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
6989
+ const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
6757
6990
  fileContent = await readFileContentOrNull(jsoncPath);
6758
6991
  if (!fileContent) {
6759
6992
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6814,7 +7047,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6814
7047
  };
6815
7048
 
6816
7049
  // src/features/mcp/roo-mcp.ts
6817
- var import_node_path53 = require("path");
7050
+ var import_node_path54 = require("path");
6818
7051
  function isRooMcpServers(value) {
6819
7052
  return value !== void 0 && value !== null && typeof value === "object";
6820
7053
  }
@@ -6866,7 +7099,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
6866
7099
  validate = true
6867
7100
  }) {
6868
7101
  const fileContent = await readFileContent(
6869
- (0, import_node_path53.join)(
7102
+ (0, import_node_path54.join)(
6870
7103
  baseDir,
6871
7104
  this.getSettablePaths().relativeDirPath,
6872
7105
  this.getSettablePaths().relativeFilePath
@@ -6937,7 +7170,7 @@ var mcpProcessorToolTargetTuple = [
6937
7170
  "opencode",
6938
7171
  "roo"
6939
7172
  ];
6940
- var McpProcessorToolTargetSchema = import_mini21.z.enum(mcpProcessorToolTargetTuple);
7173
+ var McpProcessorToolTargetSchema = import_mini22.z.enum(mcpProcessorToolTargetTuple);
6941
7174
  var toolMcpFactories = /* @__PURE__ */ new Map([
6942
7175
  [
6943
7176
  "claudecode",
@@ -7239,25 +7472,25 @@ var McpProcessor = class extends FeatureProcessor {
7239
7472
  };
7240
7473
 
7241
7474
  // src/features/rules/rules-processor.ts
7242
- var import_node_path113 = require("path");
7475
+ var import_node_path114 = require("path");
7243
7476
  var import_toon = require("@toon-format/toon");
7244
- var import_mini53 = require("zod/mini");
7477
+ var import_mini54 = require("zod/mini");
7245
7478
 
7246
7479
  // src/constants/general.ts
7247
7480
  var SKILL_FILE_NAME = "SKILL.md";
7248
7481
 
7249
7482
  // src/features/skills/agentsmd-skill.ts
7250
- var import_node_path57 = require("path");
7483
+ var import_node_path58 = require("path");
7251
7484
 
7252
7485
  // src/features/skills/simulated-skill.ts
7253
- var import_node_path56 = require("path");
7254
- var import_mini22 = require("zod/mini");
7486
+ var import_node_path57 = require("path");
7487
+ var import_mini23 = require("zod/mini");
7255
7488
 
7256
7489
  // src/features/skills/tool-skill.ts
7257
- var import_node_path55 = require("path");
7490
+ var import_node_path56 = require("path");
7258
7491
 
7259
7492
  // src/types/ai-dir.ts
7260
- var import_node_path54 = __toESM(require("path"), 1);
7493
+ var import_node_path55 = __toESM(require("path"), 1);
7261
7494
  var AiDir = class {
7262
7495
  /**
7263
7496
  * @example "."
@@ -7291,7 +7524,7 @@ var AiDir = class {
7291
7524
  otherFiles = [],
7292
7525
  global = false
7293
7526
  }) {
7294
- if (dirName.includes(import_node_path54.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7527
+ if (dirName.includes(import_node_path55.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7295
7528
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7296
7529
  }
7297
7530
  this.baseDir = baseDir;
@@ -7314,11 +7547,11 @@ var AiDir = class {
7314
7547
  return this.dirName;
7315
7548
  }
7316
7549
  getDirPath() {
7317
- const fullPath = import_node_path54.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7318
- const resolvedFull = (0, import_node_path54.resolve)(fullPath);
7319
- const resolvedBase = (0, import_node_path54.resolve)(this.baseDir);
7320
- const rel = (0, import_node_path54.relative)(resolvedBase, resolvedFull);
7321
- if (rel.startsWith("..") || import_node_path54.default.isAbsolute(rel)) {
7550
+ const fullPath = import_node_path55.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7551
+ const resolvedFull = (0, import_node_path55.resolve)(fullPath);
7552
+ const resolvedBase = (0, import_node_path55.resolve)(this.baseDir);
7553
+ const rel = (0, import_node_path55.relative)(resolvedBase, resolvedFull);
7554
+ if (rel.startsWith("..") || import_node_path55.default.isAbsolute(rel)) {
7322
7555
  throw new Error(
7323
7556
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7324
7557
  );
@@ -7332,7 +7565,7 @@ var AiDir = class {
7332
7565
  return this.otherFiles;
7333
7566
  }
7334
7567
  getRelativePathFromCwd() {
7335
- return import_node_path54.default.join(this.relativeDirPath, this.dirName);
7568
+ return import_node_path55.default.join(this.relativeDirPath, this.dirName);
7336
7569
  }
7337
7570
  getGlobal() {
7338
7571
  return this.global;
@@ -7351,15 +7584,15 @@ var AiDir = class {
7351
7584
  * @returns Array of files with their relative paths and buffers
7352
7585
  */
7353
7586
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7354
- const dirPath = (0, import_node_path54.join)(baseDir, relativeDirPath, dirName);
7355
- const glob = (0, import_node_path54.join)(dirPath, "**", "*");
7587
+ const dirPath = (0, import_node_path55.join)(baseDir, relativeDirPath, dirName);
7588
+ const glob = (0, import_node_path55.join)(dirPath, "**", "*");
7356
7589
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7357
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path54.basename)(filePath) !== excludeFileName);
7590
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path55.basename)(filePath) !== excludeFileName);
7358
7591
  const files = await Promise.all(
7359
7592
  filteredPaths.map(async (filePath) => {
7360
7593
  const fileBuffer = await readFileBuffer(filePath);
7361
7594
  return {
7362
- relativeFilePathToDirPath: (0, import_node_path54.relative)(dirPath, filePath),
7595
+ relativeFilePathToDirPath: (0, import_node_path55.relative)(dirPath, filePath),
7363
7596
  fileBuffer
7364
7597
  };
7365
7598
  })
@@ -7450,8 +7683,8 @@ var ToolSkill = class extends AiDir {
7450
7683
  }) {
7451
7684
  const settablePaths = getSettablePaths({ global });
7452
7685
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7453
- const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7454
- const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7686
+ const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
7687
+ const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
7455
7688
  if (!await fileExists(skillFilePath)) {
7456
7689
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7457
7690
  }
@@ -7475,16 +7708,16 @@ var ToolSkill = class extends AiDir {
7475
7708
  }
7476
7709
  requireMainFileFrontmatter() {
7477
7710
  if (!this.mainFile?.frontmatter) {
7478
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path55.join)(this.relativeDirPath, this.dirName)}`);
7711
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path56.join)(this.relativeDirPath, this.dirName)}`);
7479
7712
  }
7480
7713
  return this.mainFile.frontmatter;
7481
7714
  }
7482
7715
  };
7483
7716
 
7484
7717
  // src/features/skills/simulated-skill.ts
7485
- var SimulatedSkillFrontmatterSchema = import_mini22.z.looseObject({
7486
- name: import_mini22.z.string(),
7487
- description: import_mini22.z.string()
7718
+ var SimulatedSkillFrontmatterSchema = import_mini23.z.looseObject({
7719
+ name: import_mini23.z.string(),
7720
+ description: import_mini23.z.string()
7488
7721
  });
7489
7722
  var SimulatedSkill = class extends ToolSkill {
7490
7723
  frontmatter;
@@ -7515,7 +7748,7 @@ var SimulatedSkill = class extends ToolSkill {
7515
7748
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7516
7749
  if (!result.success) {
7517
7750
  throw new Error(
7518
- `Invalid frontmatter in ${(0, import_node_path56.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7751
+ `Invalid frontmatter in ${(0, import_node_path57.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7519
7752
  );
7520
7753
  }
7521
7754
  }
@@ -7573,8 +7806,8 @@ var SimulatedSkill = class extends ToolSkill {
7573
7806
  }) {
7574
7807
  const settablePaths = this.getSettablePaths();
7575
7808
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7576
- const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
7577
- const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
7809
+ const skillDirPath = (0, import_node_path57.join)(baseDir, actualRelativeDirPath, dirName);
7810
+ const skillFilePath = (0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME);
7578
7811
  if (!await fileExists(skillFilePath)) {
7579
7812
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7580
7813
  }
@@ -7651,7 +7884,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7651
7884
  throw new Error("AgentsmdSkill does not support global mode.");
7652
7885
  }
7653
7886
  return {
7654
- relativeDirPath: (0, import_node_path57.join)(".agents", "skills")
7887
+ relativeDirPath: (0, import_node_path58.join)(".agents", "skills")
7655
7888
  };
7656
7889
  }
7657
7890
  static async fromDir(params) {
@@ -7678,11 +7911,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7678
7911
  };
7679
7912
 
7680
7913
  // src/features/skills/factorydroid-skill.ts
7681
- var import_node_path58 = require("path");
7914
+ var import_node_path59 = require("path");
7682
7915
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7683
7916
  static getSettablePaths(_options) {
7684
7917
  return {
7685
- relativeDirPath: (0, import_node_path58.join)(".factory", "skills")
7918
+ relativeDirPath: (0, import_node_path59.join)(".factory", "skills")
7686
7919
  };
7687
7920
  }
7688
7921
  static async fromDir(params) {
@@ -7709,11 +7942,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7709
7942
  };
7710
7943
 
7711
7944
  // src/features/skills/skills-processor.ts
7712
- var import_node_path75 = require("path");
7713
- var import_mini37 = require("zod/mini");
7945
+ var import_node_path76 = require("path");
7946
+ var import_mini38 = require("zod/mini");
7714
7947
 
7715
7948
  // src/types/dir-feature-processor.ts
7716
- var import_node_path59 = require("path");
7949
+ var import_node_path60 = require("path");
7717
7950
  var DirFeatureProcessor = class {
7718
7951
  baseDir;
7719
7952
  dryRun;
@@ -7744,7 +7977,7 @@ var DirFeatureProcessor = class {
7744
7977
  const mainFile = aiDir.getMainFile();
7745
7978
  let mainFileContent;
7746
7979
  if (mainFile) {
7747
- const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
7980
+ const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
7748
7981
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7749
7982
  mainFileContent = addTrailingNewline(content);
7750
7983
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7758,7 +7991,7 @@ var DirFeatureProcessor = class {
7758
7991
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7759
7992
  otherFileContents.push(contentWithNewline);
7760
7993
  if (!dirHasChanges) {
7761
- const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
7994
+ const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
7762
7995
  const existingContent = await readFileContentOrNull(filePath);
7763
7996
  if (existingContent !== contentWithNewline) {
7764
7997
  dirHasChanges = true;
@@ -7772,22 +8005,22 @@ var DirFeatureProcessor = class {
7772
8005
  if (this.dryRun) {
7773
8006
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7774
8007
  if (mainFile) {
7775
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, mainFile.name)}`);
7776
- changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
8008
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, mainFile.name)}`);
8009
+ changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
7777
8010
  }
7778
8011
  for (const file of otherFiles) {
7779
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath)}`);
7780
- changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
8012
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath)}`);
8013
+ changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
7781
8014
  }
7782
8015
  } else {
7783
8016
  await ensureDir(dirPath);
7784
8017
  if (mainFile && mainFileContent) {
7785
- const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
8018
+ const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
7786
8019
  await writeFileContent(mainFilePath, mainFileContent);
7787
- changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
8020
+ changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
7788
8021
  }
7789
8022
  for (const [i, file] of otherFiles.entries()) {
7790
- const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
8023
+ const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
7791
8024
  const content = otherFileContents[i];
7792
8025
  if (content === void 0) {
7793
8026
  throw new Error(
@@ -7795,7 +8028,7 @@ var DirFeatureProcessor = class {
7795
8028
  );
7796
8029
  }
7797
8030
  await writeFileContent(filePath, content);
7798
- changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
8031
+ changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
7799
8032
  }
7800
8033
  }
7801
8034
  changedCount++;
@@ -7827,38 +8060,39 @@ var DirFeatureProcessor = class {
7827
8060
  };
7828
8061
 
7829
8062
  // src/features/skills/agentsskills-skill.ts
7830
- var import_node_path61 = require("path");
7831
- var import_mini24 = require("zod/mini");
8063
+ var import_node_path62 = require("path");
8064
+ var import_mini25 = require("zod/mini");
7832
8065
 
7833
8066
  // src/features/skills/rulesync-skill.ts
7834
- var import_node_path60 = require("path");
7835
- var import_mini23 = require("zod/mini");
7836
- var RulesyncSkillFrontmatterSchemaInternal = import_mini23.z.looseObject({
7837
- name: import_mini23.z.string(),
7838
- description: import_mini23.z.string(),
7839
- targets: import_mini23.z._default(RulesyncTargetsSchema, ["*"]),
7840
- claudecode: import_mini23.z.optional(
7841
- import_mini23.z.looseObject({
7842
- "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
8067
+ var import_node_path61 = require("path");
8068
+ var import_mini24 = require("zod/mini");
8069
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini24.z.looseObject({
8070
+ name: import_mini24.z.string(),
8071
+ description: import_mini24.z.string(),
8072
+ targets: import_mini24.z._default(RulesyncTargetsSchema, ["*"]),
8073
+ claudecode: import_mini24.z.optional(
8074
+ import_mini24.z.looseObject({
8075
+ "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string())),
8076
+ model: import_mini24.z.optional(import_mini24.z.string())
7843
8077
  })
7844
8078
  ),
7845
- codexcli: import_mini23.z.optional(
7846
- import_mini23.z.looseObject({
7847
- "short-description": import_mini23.z.optional(import_mini23.z.string())
8079
+ codexcli: import_mini24.z.optional(
8080
+ import_mini24.z.looseObject({
8081
+ "short-description": import_mini24.z.optional(import_mini24.z.string())
7848
8082
  })
7849
8083
  ),
7850
- opencode: import_mini23.z.optional(
7851
- import_mini23.z.looseObject({
7852
- "allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
8084
+ opencode: import_mini24.z.optional(
8085
+ import_mini24.z.looseObject({
8086
+ "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string()))
7853
8087
  })
7854
8088
  ),
7855
- copilot: import_mini23.z.optional(
7856
- import_mini23.z.looseObject({
7857
- license: import_mini23.z.optional(import_mini23.z.string())
8089
+ copilot: import_mini24.z.optional(
8090
+ import_mini24.z.looseObject({
8091
+ license: import_mini24.z.optional(import_mini24.z.string())
7858
8092
  })
7859
8093
  ),
7860
- cline: import_mini23.z.optional(import_mini23.z.looseObject({})),
7861
- roo: import_mini23.z.optional(import_mini23.z.looseObject({}))
8094
+ cline: import_mini24.z.optional(import_mini24.z.looseObject({})),
8095
+ roo: import_mini24.z.optional(import_mini24.z.looseObject({}))
7862
8096
  });
7863
8097
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
7864
8098
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -7898,7 +8132,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7898
8132
  }
7899
8133
  getFrontmatter() {
7900
8134
  if (!this.mainFile?.frontmatter) {
7901
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path60.join)(this.relativeDirPath, this.dirName)}`);
8135
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path61.join)(this.relativeDirPath, this.dirName)}`);
7902
8136
  }
7903
8137
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
7904
8138
  return result;
@@ -7924,8 +8158,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7924
8158
  dirName,
7925
8159
  global = false
7926
8160
  }) {
7927
- const skillDirPath = (0, import_node_path60.join)(baseDir, relativeDirPath, dirName);
7928
- const skillFilePath = (0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME);
8161
+ const skillDirPath = (0, import_node_path61.join)(baseDir, relativeDirPath, dirName);
8162
+ const skillFilePath = (0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME);
7929
8163
  if (!await fileExists(skillFilePath)) {
7930
8164
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7931
8165
  }
@@ -7955,14 +8189,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7955
8189
  };
7956
8190
 
7957
8191
  // src/features/skills/agentsskills-skill.ts
7958
- var AgentsSkillsSkillFrontmatterSchema = import_mini24.z.looseObject({
7959
- name: import_mini24.z.string(),
7960
- description: import_mini24.z.string()
8192
+ var AgentsSkillsSkillFrontmatterSchema = import_mini25.z.looseObject({
8193
+ name: import_mini25.z.string(),
8194
+ description: import_mini25.z.string()
7961
8195
  });
7962
8196
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7963
8197
  constructor({
7964
8198
  baseDir = process.cwd(),
7965
- relativeDirPath = (0, import_node_path61.join)(".agents", "skills"),
8199
+ relativeDirPath = (0, import_node_path62.join)(".agents", "skills"),
7966
8200
  dirName,
7967
8201
  frontmatter,
7968
8202
  body,
@@ -7994,7 +8228,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7994
8228
  throw new Error("AgentsSkillsSkill does not support global mode.");
7995
8229
  }
7996
8230
  return {
7997
- relativeDirPath: (0, import_node_path61.join)(".agents", "skills")
8231
+ relativeDirPath: (0, import_node_path62.join)(".agents", "skills")
7998
8232
  };
7999
8233
  }
8000
8234
  getFrontmatter() {
@@ -8073,9 +8307,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8073
8307
  });
8074
8308
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8075
8309
  if (!result.success) {
8076
- const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8310
+ const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8077
8311
  throw new Error(
8078
- `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8312
+ `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8079
8313
  );
8080
8314
  }
8081
8315
  return new _AgentsSkillsSkill({
@@ -8110,16 +8344,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8110
8344
  };
8111
8345
 
8112
8346
  // src/features/skills/antigravity-skill.ts
8113
- var import_node_path62 = require("path");
8114
- var import_mini25 = require("zod/mini");
8115
- var AntigravitySkillFrontmatterSchema = import_mini25.z.looseObject({
8116
- name: import_mini25.z.string(),
8117
- description: import_mini25.z.string()
8347
+ var import_node_path63 = require("path");
8348
+ var import_mini26 = require("zod/mini");
8349
+ var AntigravitySkillFrontmatterSchema = import_mini26.z.looseObject({
8350
+ name: import_mini26.z.string(),
8351
+ description: import_mini26.z.string()
8118
8352
  });
8119
8353
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8120
8354
  constructor({
8121
8355
  baseDir = process.cwd(),
8122
- relativeDirPath = (0, import_node_path62.join)(".agent", "skills"),
8356
+ relativeDirPath = (0, import_node_path63.join)(".agent", "skills"),
8123
8357
  dirName,
8124
8358
  frontmatter,
8125
8359
  body,
@@ -8151,11 +8385,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8151
8385
  } = {}) {
8152
8386
  if (global) {
8153
8387
  return {
8154
- relativeDirPath: (0, import_node_path62.join)(".gemini", "antigravity", "skills")
8388
+ relativeDirPath: (0, import_node_path63.join)(".gemini", "antigravity", "skills")
8155
8389
  };
8156
8390
  }
8157
8391
  return {
8158
- relativeDirPath: (0, import_node_path62.join)(".agent", "skills")
8392
+ relativeDirPath: (0, import_node_path63.join)(".agent", "skills")
8159
8393
  };
8160
8394
  }
8161
8395
  getFrontmatter() {
@@ -8234,9 +8468,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8234
8468
  });
8235
8469
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
8236
8470
  if (!result.success) {
8237
- const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8471
+ const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8238
8472
  throw new Error(
8239
- `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8473
+ `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8240
8474
  );
8241
8475
  }
8242
8476
  return new _AntigravitySkill({
@@ -8270,17 +8504,18 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8270
8504
  };
8271
8505
 
8272
8506
  // src/features/skills/claudecode-skill.ts
8273
- var import_node_path63 = require("path");
8274
- var import_mini26 = require("zod/mini");
8275
- var ClaudecodeSkillFrontmatterSchema = import_mini26.z.looseObject({
8276
- name: import_mini26.z.string(),
8277
- description: import_mini26.z.string(),
8278
- "allowed-tools": import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
8507
+ var import_node_path64 = require("path");
8508
+ var import_mini27 = require("zod/mini");
8509
+ var ClaudecodeSkillFrontmatterSchema = import_mini27.z.looseObject({
8510
+ name: import_mini27.z.string(),
8511
+ description: import_mini27.z.string(),
8512
+ "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string())),
8513
+ model: import_mini27.z.optional(import_mini27.z.string())
8279
8514
  });
8280
8515
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8281
8516
  constructor({
8282
8517
  baseDir = process.cwd(),
8283
- relativeDirPath = (0, import_node_path63.join)(".claude", "skills"),
8518
+ relativeDirPath = (0, import_node_path64.join)(".claude", "skills"),
8284
8519
  dirName,
8285
8520
  frontmatter,
8286
8521
  body,
@@ -8311,7 +8546,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8311
8546
  global: _global = false
8312
8547
  } = {}) {
8313
8548
  return {
8314
- relativeDirPath: (0, import_node_path63.join)(".claude", "skills")
8549
+ relativeDirPath: (0, import_node_path64.join)(".claude", "skills")
8315
8550
  };
8316
8551
  }
8317
8552
  getFrontmatter() {
@@ -8341,15 +8576,15 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8341
8576
  }
8342
8577
  toRulesyncSkill() {
8343
8578
  const frontmatter = this.getFrontmatter();
8579
+ const claudecodeSection = {
8580
+ ...frontmatter["allowed-tools"] && { "allowed-tools": frontmatter["allowed-tools"] },
8581
+ ...frontmatter.model && { model: frontmatter.model }
8582
+ };
8344
8583
  const rulesyncFrontmatter = {
8345
8584
  name: frontmatter.name,
8346
8585
  description: frontmatter.description,
8347
8586
  targets: ["*"],
8348
- ...frontmatter["allowed-tools"] && {
8349
- claudecode: {
8350
- "allowed-tools": frontmatter["allowed-tools"]
8351
- }
8352
- }
8587
+ ...Object.keys(claudecodeSection).length > 0 && { claudecode: claudecodeSection }
8353
8588
  };
8354
8589
  return new RulesyncSkill({
8355
8590
  baseDir: this.baseDir,
@@ -8371,7 +8606,12 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8371
8606
  const claudecodeFrontmatter = {
8372
8607
  name: rulesyncFrontmatter.name,
8373
8608
  description: rulesyncFrontmatter.description,
8374
- "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
8609
+ ...rulesyncFrontmatter.claudecode?.["allowed-tools"] && {
8610
+ "allowed-tools": rulesyncFrontmatter.claudecode["allowed-tools"]
8611
+ },
8612
+ ...rulesyncFrontmatter.claudecode?.model && {
8613
+ model: rulesyncFrontmatter.claudecode.model
8614
+ }
8375
8615
  };
8376
8616
  const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
8377
8617
  return new _ClaudecodeSkill({
@@ -8396,9 +8636,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8396
8636
  });
8397
8637
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8398
8638
  if (!result.success) {
8399
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8639
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8400
8640
  throw new Error(
8401
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8641
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8402
8642
  );
8403
8643
  }
8404
8644
  return new _ClaudecodeSkill({
@@ -8432,16 +8672,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8432
8672
  };
8433
8673
 
8434
8674
  // src/features/skills/cline-skill.ts
8435
- var import_node_path64 = require("path");
8436
- var import_mini27 = require("zod/mini");
8437
- var ClineSkillFrontmatterSchema = import_mini27.z.looseObject({
8438
- name: import_mini27.z.string(),
8439
- description: import_mini27.z.string()
8675
+ var import_node_path65 = require("path");
8676
+ var import_mini28 = require("zod/mini");
8677
+ var ClineSkillFrontmatterSchema = import_mini28.z.looseObject({
8678
+ name: import_mini28.z.string(),
8679
+ description: import_mini28.z.string()
8440
8680
  });
8441
8681
  var ClineSkill = class _ClineSkill extends ToolSkill {
8442
8682
  constructor({
8443
8683
  baseDir = process.cwd(),
8444
- relativeDirPath = (0, import_node_path64.join)(".cline", "skills"),
8684
+ relativeDirPath = (0, import_node_path65.join)(".cline", "skills"),
8445
8685
  dirName,
8446
8686
  frontmatter,
8447
8687
  body,
@@ -8470,7 +8710,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8470
8710
  }
8471
8711
  static getSettablePaths(_options = {}) {
8472
8712
  return {
8473
- relativeDirPath: (0, import_node_path64.join)(".cline", "skills")
8713
+ relativeDirPath: (0, import_node_path65.join)(".cline", "skills")
8474
8714
  };
8475
8715
  }
8476
8716
  getFrontmatter() {
@@ -8557,13 +8797,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8557
8797
  });
8558
8798
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8559
8799
  if (!result.success) {
8560
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8800
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8561
8801
  throw new Error(
8562
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8802
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8563
8803
  );
8564
8804
  }
8565
8805
  if (result.data.name !== loaded.dirName) {
8566
- const skillFilePath = (0, import_node_path64.join)(
8806
+ const skillFilePath = (0, import_node_path65.join)(
8567
8807
  loaded.baseDir,
8568
8808
  loaded.relativeDirPath,
8569
8809
  loaded.dirName,
@@ -8604,21 +8844,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8604
8844
  };
8605
8845
 
8606
8846
  // src/features/skills/codexcli-skill.ts
8607
- var import_node_path65 = require("path");
8608
- var import_mini28 = require("zod/mini");
8609
- var CodexCliSkillFrontmatterSchema = import_mini28.z.looseObject({
8610
- name: import_mini28.z.string(),
8611
- description: import_mini28.z.string(),
8612
- metadata: import_mini28.z.optional(
8613
- import_mini28.z.looseObject({
8614
- "short-description": import_mini28.z.optional(import_mini28.z.string())
8847
+ var import_node_path66 = require("path");
8848
+ var import_mini29 = require("zod/mini");
8849
+ var CodexCliSkillFrontmatterSchema = import_mini29.z.looseObject({
8850
+ name: import_mini29.z.string(),
8851
+ description: import_mini29.z.string(),
8852
+ metadata: import_mini29.z.optional(
8853
+ import_mini29.z.looseObject({
8854
+ "short-description": import_mini29.z.optional(import_mini29.z.string())
8615
8855
  })
8616
8856
  )
8617
8857
  });
8618
8858
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8619
8859
  constructor({
8620
8860
  baseDir = process.cwd(),
8621
- relativeDirPath = (0, import_node_path65.join)(".codex", "skills"),
8861
+ relativeDirPath = (0, import_node_path66.join)(".codex", "skills"),
8622
8862
  dirName,
8623
8863
  frontmatter,
8624
8864
  body,
@@ -8649,7 +8889,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8649
8889
  global: _global = false
8650
8890
  } = {}) {
8651
8891
  return {
8652
- relativeDirPath: (0, import_node_path65.join)(".codex", "skills")
8892
+ relativeDirPath: (0, import_node_path66.join)(".codex", "skills")
8653
8893
  };
8654
8894
  }
8655
8895
  getFrontmatter() {
@@ -8738,9 +8978,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8738
8978
  });
8739
8979
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8740
8980
  if (!result.success) {
8741
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8981
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8742
8982
  throw new Error(
8743
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8983
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8744
8984
  );
8745
8985
  }
8746
8986
  return new _CodexCliSkill({
@@ -8774,17 +9014,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8774
9014
  };
8775
9015
 
8776
9016
  // src/features/skills/copilot-skill.ts
8777
- var import_node_path66 = require("path");
8778
- var import_mini29 = require("zod/mini");
8779
- var CopilotSkillFrontmatterSchema = import_mini29.z.looseObject({
8780
- name: import_mini29.z.string(),
8781
- description: import_mini29.z.string(),
8782
- license: import_mini29.z.optional(import_mini29.z.string())
9017
+ var import_node_path67 = require("path");
9018
+ var import_mini30 = require("zod/mini");
9019
+ var CopilotSkillFrontmatterSchema = import_mini30.z.looseObject({
9020
+ name: import_mini30.z.string(),
9021
+ description: import_mini30.z.string(),
9022
+ license: import_mini30.z.optional(import_mini30.z.string())
8783
9023
  });
8784
9024
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8785
9025
  constructor({
8786
9026
  baseDir = process.cwd(),
8787
- relativeDirPath = (0, import_node_path66.join)(".github", "skills"),
9027
+ relativeDirPath = (0, import_node_path67.join)(".github", "skills"),
8788
9028
  dirName,
8789
9029
  frontmatter,
8790
9030
  body,
@@ -8816,7 +9056,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8816
9056
  throw new Error("CopilotSkill does not support global mode.");
8817
9057
  }
8818
9058
  return {
8819
- relativeDirPath: (0, import_node_path66.join)(".github", "skills")
9059
+ relativeDirPath: (0, import_node_path67.join)(".github", "skills")
8820
9060
  };
8821
9061
  }
8822
9062
  getFrontmatter() {
@@ -8901,9 +9141,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8901
9141
  });
8902
9142
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8903
9143
  if (!result.success) {
8904
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9144
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8905
9145
  throw new Error(
8906
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9146
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8907
9147
  );
8908
9148
  }
8909
9149
  return new _CopilotSkill({
@@ -8938,16 +9178,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8938
9178
  };
8939
9179
 
8940
9180
  // src/features/skills/cursor-skill.ts
8941
- var import_node_path67 = require("path");
8942
- var import_mini30 = require("zod/mini");
8943
- var CursorSkillFrontmatterSchema = import_mini30.z.looseObject({
8944
- name: import_mini30.z.string(),
8945
- description: import_mini30.z.string()
9181
+ var import_node_path68 = require("path");
9182
+ var import_mini31 = require("zod/mini");
9183
+ var CursorSkillFrontmatterSchema = import_mini31.z.looseObject({
9184
+ name: import_mini31.z.string(),
9185
+ description: import_mini31.z.string()
8946
9186
  });
8947
9187
  var CursorSkill = class _CursorSkill extends ToolSkill {
8948
9188
  constructor({
8949
9189
  baseDir = process.cwd(),
8950
- relativeDirPath = (0, import_node_path67.join)(".cursor", "skills"),
9190
+ relativeDirPath = (0, import_node_path68.join)(".cursor", "skills"),
8951
9191
  dirName,
8952
9192
  frontmatter,
8953
9193
  body,
@@ -8976,7 +9216,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8976
9216
  }
8977
9217
  static getSettablePaths(_options) {
8978
9218
  return {
8979
- relativeDirPath: (0, import_node_path67.join)(".cursor", "skills")
9219
+ relativeDirPath: (0, import_node_path68.join)(".cursor", "skills")
8980
9220
  };
8981
9221
  }
8982
9222
  getFrontmatter() {
@@ -9055,9 +9295,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9055
9295
  });
9056
9296
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9057
9297
  if (!result.success) {
9058
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9298
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9059
9299
  throw new Error(
9060
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9300
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9061
9301
  );
9062
9302
  }
9063
9303
  return new _CursorSkill({
@@ -9092,11 +9332,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9092
9332
  };
9093
9333
 
9094
9334
  // src/features/skills/geminicli-skill.ts
9095
- var import_node_path68 = require("path");
9096
- var import_mini31 = require("zod/mini");
9097
- var GeminiCliSkillFrontmatterSchema = import_mini31.z.looseObject({
9098
- name: import_mini31.z.string(),
9099
- description: import_mini31.z.string()
9335
+ var import_node_path69 = require("path");
9336
+ var import_mini32 = require("zod/mini");
9337
+ var GeminiCliSkillFrontmatterSchema = import_mini32.z.looseObject({
9338
+ name: import_mini32.z.string(),
9339
+ description: import_mini32.z.string()
9100
9340
  });
9101
9341
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9102
9342
  constructor({
@@ -9132,7 +9372,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9132
9372
  global: _global = false
9133
9373
  } = {}) {
9134
9374
  return {
9135
- relativeDirPath: (0, import_node_path68.join)(".gemini", "skills")
9375
+ relativeDirPath: (0, import_node_path69.join)(".gemini", "skills")
9136
9376
  };
9137
9377
  }
9138
9378
  getFrontmatter() {
@@ -9211,9 +9451,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9211
9451
  });
9212
9452
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9213
9453
  if (!result.success) {
9214
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9454
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9215
9455
  throw new Error(
9216
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9456
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9217
9457
  );
9218
9458
  }
9219
9459
  return new _GeminiCliSkill({
@@ -9248,16 +9488,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9248
9488
  };
9249
9489
 
9250
9490
  // src/features/skills/kilo-skill.ts
9251
- var import_node_path69 = require("path");
9252
- var import_mini32 = require("zod/mini");
9253
- var KiloSkillFrontmatterSchema = import_mini32.z.looseObject({
9254
- name: import_mini32.z.string(),
9255
- description: import_mini32.z.string()
9491
+ var import_node_path70 = require("path");
9492
+ var import_mini33 = require("zod/mini");
9493
+ var KiloSkillFrontmatterSchema = import_mini33.z.looseObject({
9494
+ name: import_mini33.z.string(),
9495
+ description: import_mini33.z.string()
9256
9496
  });
9257
9497
  var KiloSkill = class _KiloSkill extends ToolSkill {
9258
9498
  constructor({
9259
9499
  baseDir = process.cwd(),
9260
- relativeDirPath = (0, import_node_path69.join)(".kilocode", "skills"),
9500
+ relativeDirPath = (0, import_node_path70.join)(".kilocode", "skills"),
9261
9501
  dirName,
9262
9502
  frontmatter,
9263
9503
  body,
@@ -9288,7 +9528,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9288
9528
  global: _global = false
9289
9529
  } = {}) {
9290
9530
  return {
9291
- relativeDirPath: (0, import_node_path69.join)(".kilocode", "skills")
9531
+ relativeDirPath: (0, import_node_path70.join)(".kilocode", "skills")
9292
9532
  };
9293
9533
  }
9294
9534
  getFrontmatter() {
@@ -9375,13 +9615,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9375
9615
  });
9376
9616
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9377
9617
  if (!result.success) {
9378
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9618
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9379
9619
  throw new Error(
9380
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9620
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9381
9621
  );
9382
9622
  }
9383
9623
  if (result.data.name !== loaded.dirName) {
9384
- const skillFilePath = (0, import_node_path69.join)(
9624
+ const skillFilePath = (0, import_node_path70.join)(
9385
9625
  loaded.baseDir,
9386
9626
  loaded.relativeDirPath,
9387
9627
  loaded.dirName,
@@ -9422,16 +9662,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9422
9662
  };
9423
9663
 
9424
9664
  // src/features/skills/kiro-skill.ts
9425
- var import_node_path70 = require("path");
9426
- var import_mini33 = require("zod/mini");
9427
- var KiroSkillFrontmatterSchema = import_mini33.z.looseObject({
9428
- name: import_mini33.z.string(),
9429
- description: import_mini33.z.string()
9665
+ var import_node_path71 = require("path");
9666
+ var import_mini34 = require("zod/mini");
9667
+ var KiroSkillFrontmatterSchema = import_mini34.z.looseObject({
9668
+ name: import_mini34.z.string(),
9669
+ description: import_mini34.z.string()
9430
9670
  });
9431
9671
  var KiroSkill = class _KiroSkill extends ToolSkill {
9432
9672
  constructor({
9433
9673
  baseDir = process.cwd(),
9434
- relativeDirPath = (0, import_node_path70.join)(".kiro", "skills"),
9674
+ relativeDirPath = (0, import_node_path71.join)(".kiro", "skills"),
9435
9675
  dirName,
9436
9676
  frontmatter,
9437
9677
  body,
@@ -9463,7 +9703,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9463
9703
  throw new Error("KiroSkill does not support global mode.");
9464
9704
  }
9465
9705
  return {
9466
- relativeDirPath: (0, import_node_path70.join)(".kiro", "skills")
9706
+ relativeDirPath: (0, import_node_path71.join)(".kiro", "skills")
9467
9707
  };
9468
9708
  }
9469
9709
  getFrontmatter() {
@@ -9550,13 +9790,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9550
9790
  });
9551
9791
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9552
9792
  if (!result.success) {
9553
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9793
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9554
9794
  throw new Error(
9555
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9795
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9556
9796
  );
9557
9797
  }
9558
9798
  if (result.data.name !== loaded.dirName) {
9559
- const skillFilePath = (0, import_node_path70.join)(
9799
+ const skillFilePath = (0, import_node_path71.join)(
9560
9800
  loaded.baseDir,
9561
9801
  loaded.relativeDirPath,
9562
9802
  loaded.dirName,
@@ -9598,17 +9838,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9598
9838
  };
9599
9839
 
9600
9840
  // src/features/skills/opencode-skill.ts
9601
- var import_node_path71 = require("path");
9602
- var import_mini34 = require("zod/mini");
9603
- var OpenCodeSkillFrontmatterSchema = import_mini34.z.looseObject({
9604
- name: import_mini34.z.string(),
9605
- description: import_mini34.z.string(),
9606
- "allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
9841
+ var import_node_path72 = require("path");
9842
+ var import_mini35 = require("zod/mini");
9843
+ var OpenCodeSkillFrontmatterSchema = import_mini35.z.looseObject({
9844
+ name: import_mini35.z.string(),
9845
+ description: import_mini35.z.string(),
9846
+ "allowed-tools": import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string()))
9607
9847
  });
9608
9848
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9609
9849
  constructor({
9610
9850
  baseDir = process.cwd(),
9611
- relativeDirPath = (0, import_node_path71.join)(".opencode", "skill"),
9851
+ relativeDirPath = (0, import_node_path72.join)(".opencode", "skill"),
9612
9852
  dirName,
9613
9853
  frontmatter,
9614
9854
  body,
@@ -9637,7 +9877,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9637
9877
  }
9638
9878
  static getSettablePaths({ global = false } = {}) {
9639
9879
  return {
9640
- relativeDirPath: global ? (0, import_node_path71.join)(".config", "opencode", "skill") : (0, import_node_path71.join)(".opencode", "skill")
9880
+ relativeDirPath: global ? (0, import_node_path72.join)(".config", "opencode", "skill") : (0, import_node_path72.join)(".opencode", "skill")
9641
9881
  };
9642
9882
  }
9643
9883
  getFrontmatter() {
@@ -9722,9 +9962,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9722
9962
  });
9723
9963
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9724
9964
  if (!result.success) {
9725
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9965
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9726
9966
  throw new Error(
9727
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9967
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9728
9968
  );
9729
9969
  }
9730
9970
  return new _OpenCodeSkill({
@@ -9758,16 +9998,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9758
9998
  };
9759
9999
 
9760
10000
  // src/features/skills/replit-skill.ts
9761
- var import_node_path72 = require("path");
9762
- var import_mini35 = require("zod/mini");
9763
- var ReplitSkillFrontmatterSchema = import_mini35.z.looseObject({
9764
- name: import_mini35.z.string(),
9765
- description: import_mini35.z.string()
10001
+ var import_node_path73 = require("path");
10002
+ var import_mini36 = require("zod/mini");
10003
+ var ReplitSkillFrontmatterSchema = import_mini36.z.looseObject({
10004
+ name: import_mini36.z.string(),
10005
+ description: import_mini36.z.string()
9766
10006
  });
9767
10007
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9768
10008
  constructor({
9769
10009
  baseDir = process.cwd(),
9770
- relativeDirPath = (0, import_node_path72.join)(".agents", "skills"),
10010
+ relativeDirPath = (0, import_node_path73.join)(".agents", "skills"),
9771
10011
  dirName,
9772
10012
  frontmatter,
9773
10013
  body,
@@ -9799,7 +10039,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9799
10039
  throw new Error("ReplitSkill does not support global mode.");
9800
10040
  }
9801
10041
  return {
9802
- relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
10042
+ relativeDirPath: (0, import_node_path73.join)(".agents", "skills")
9803
10043
  };
9804
10044
  }
9805
10045
  getFrontmatter() {
@@ -9878,9 +10118,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9878
10118
  });
9879
10119
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9880
10120
  if (!result.success) {
9881
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10121
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9882
10122
  throw new Error(
9883
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10123
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9884
10124
  );
9885
10125
  }
9886
10126
  return new _ReplitSkill({
@@ -9915,16 +10155,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9915
10155
  };
9916
10156
 
9917
10157
  // src/features/skills/roo-skill.ts
9918
- var import_node_path73 = require("path");
9919
- var import_mini36 = require("zod/mini");
9920
- var RooSkillFrontmatterSchema = import_mini36.z.looseObject({
9921
- name: import_mini36.z.string(),
9922
- description: import_mini36.z.string()
10158
+ var import_node_path74 = require("path");
10159
+ var import_mini37 = require("zod/mini");
10160
+ var RooSkillFrontmatterSchema = import_mini37.z.looseObject({
10161
+ name: import_mini37.z.string(),
10162
+ description: import_mini37.z.string()
9923
10163
  });
9924
10164
  var RooSkill = class _RooSkill extends ToolSkill {
9925
10165
  constructor({
9926
10166
  baseDir = process.cwd(),
9927
- relativeDirPath = (0, import_node_path73.join)(".roo", "skills"),
10167
+ relativeDirPath = (0, import_node_path74.join)(".roo", "skills"),
9928
10168
  dirName,
9929
10169
  frontmatter,
9930
10170
  body,
@@ -9955,7 +10195,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
9955
10195
  global: _global = false
9956
10196
  } = {}) {
9957
10197
  return {
9958
- relativeDirPath: (0, import_node_path73.join)(".roo", "skills")
10198
+ relativeDirPath: (0, import_node_path74.join)(".roo", "skills")
9959
10199
  };
9960
10200
  }
9961
10201
  getFrontmatter() {
@@ -10042,13 +10282,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
10042
10282
  });
10043
10283
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10044
10284
  if (!result.success) {
10045
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10285
+ const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10046
10286
  throw new Error(
10047
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10287
+ `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10048
10288
  );
10049
10289
  }
10050
10290
  if (result.data.name !== loaded.dirName) {
10051
- const skillFilePath = (0, import_node_path73.join)(
10291
+ const skillFilePath = (0, import_node_path74.join)(
10052
10292
  loaded.baseDir,
10053
10293
  loaded.relativeDirPath,
10054
10294
  loaded.dirName,
@@ -10089,17 +10329,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
10089
10329
  };
10090
10330
 
10091
10331
  // src/features/skills/skills-utils.ts
10092
- var import_node_path74 = require("path");
10332
+ var import_node_path75 = require("path");
10093
10333
  async function getLocalSkillDirNames(baseDir) {
10094
- const skillsDir = (0, import_node_path74.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10334
+ const skillsDir = (0, import_node_path75.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10095
10335
  const names = /* @__PURE__ */ new Set();
10096
10336
  if (!await directoryExists(skillsDir)) {
10097
10337
  return names;
10098
10338
  }
10099
- const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDir, "*"), { type: "dir" });
10339
+ const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDir, "*"), { type: "dir" });
10100
10340
  for (const dirPath of dirPaths) {
10101
- const name = (0, import_node_path74.basename)(dirPath);
10102
- if (name === (0, import_node_path74.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10341
+ const name = (0, import_node_path75.basename)(dirPath);
10342
+ if (name === (0, import_node_path75.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10103
10343
  names.add(name);
10104
10344
  }
10105
10345
  return names;
@@ -10124,7 +10364,7 @@ var skillsProcessorToolTargetTuple = [
10124
10364
  "replit",
10125
10365
  "roo"
10126
10366
  ];
10127
- var SkillsProcessorToolTargetSchema = import_mini37.z.enum(skillsProcessorToolTargetTuple);
10367
+ var SkillsProcessorToolTargetSchema = import_mini38.z.enum(skillsProcessorToolTargetTuple);
10128
10368
  var toolSkillFactories = /* @__PURE__ */ new Map([
10129
10369
  [
10130
10370
  "agentsmd",
@@ -10325,11 +10565,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10325
10565
  )
10326
10566
  );
10327
10567
  const localSkillNames = new Set(localDirNames);
10328
- const curatedDirPath = (0, import_node_path75.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10568
+ const curatedDirPath = (0, import_node_path76.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10329
10569
  let curatedSkills = [];
10330
10570
  if (await directoryExists(curatedDirPath)) {
10331
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path75.join)(curatedDirPath, "*"), { type: "dir" });
10332
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10571
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path76.join)(curatedDirPath, "*"), { type: "dir" });
10572
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10333
10573
  const nonConflicting = curatedDirNames.filter((name) => {
10334
10574
  if (localSkillNames.has(name)) {
10335
10575
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -10362,9 +10602,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10362
10602
  async loadToolDirs() {
10363
10603
  const factory = this.getFactory(this.toolTarget);
10364
10604
  const paths = factory.class.getSettablePaths({ global: this.global });
10365
- const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10366
- const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10367
- const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10605
+ const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
10606
+ const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
10607
+ const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10368
10608
  const toolSkills = await Promise.all(
10369
10609
  dirNames.map(
10370
10610
  (dirName) => factory.class.fromDir({
@@ -10380,9 +10620,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10380
10620
  async loadToolDirsToDelete() {
10381
10621
  const factory = this.getFactory(this.toolTarget);
10382
10622
  const paths = factory.class.getSettablePaths({ global: this.global });
10383
- const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
10384
- const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
10385
- const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
10623
+ const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
10624
+ const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
10625
+ const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10386
10626
  const toolSkills = dirNames.map(
10387
10627
  (dirName) => factory.class.forDeletion({
10388
10628
  baseDir: this.baseDir,
@@ -10443,11 +10683,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10443
10683
  };
10444
10684
 
10445
10685
  // src/features/subagents/agentsmd-subagent.ts
10446
- var import_node_path77 = require("path");
10686
+ var import_node_path78 = require("path");
10447
10687
 
10448
10688
  // src/features/subagents/simulated-subagent.ts
10449
- var import_node_path76 = require("path");
10450
- var import_mini38 = require("zod/mini");
10689
+ var import_node_path77 = require("path");
10690
+ var import_mini39 = require("zod/mini");
10451
10691
 
10452
10692
  // src/features/subagents/tool-subagent.ts
10453
10693
  var ToolSubagent = class extends ToolFile {
@@ -10499,9 +10739,9 @@ var ToolSubagent = class extends ToolFile {
10499
10739
  };
10500
10740
 
10501
10741
  // src/features/subagents/simulated-subagent.ts
10502
- var SimulatedSubagentFrontmatterSchema = import_mini38.z.object({
10503
- name: import_mini38.z.string(),
10504
- description: import_mini38.z.string()
10742
+ var SimulatedSubagentFrontmatterSchema = import_mini39.z.object({
10743
+ name: import_mini39.z.string(),
10744
+ description: import_mini39.z.string()
10505
10745
  });
10506
10746
  var SimulatedSubagent = class extends ToolSubagent {
10507
10747
  frontmatter;
@@ -10511,7 +10751,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10511
10751
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
10512
10752
  if (!result.success) {
10513
10753
  throw new Error(
10514
- `Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10754
+ `Invalid frontmatter in ${(0, import_node_path77.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10515
10755
  );
10516
10756
  }
10517
10757
  }
@@ -10562,7 +10802,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10562
10802
  return {
10563
10803
  success: false,
10564
10804
  error: new Error(
10565
- `Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10805
+ `Invalid frontmatter in ${(0, import_node_path77.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10566
10806
  )
10567
10807
  };
10568
10808
  }
@@ -10572,7 +10812,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10572
10812
  relativeFilePath,
10573
10813
  validate = true
10574
10814
  }) {
10575
- const filePath = (0, import_node_path76.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10815
+ const filePath = (0, import_node_path77.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10576
10816
  const fileContent = await readFileContent(filePath);
10577
10817
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10578
10818
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10582,7 +10822,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10582
10822
  return {
10583
10823
  baseDir,
10584
10824
  relativeDirPath: this.getSettablePaths().relativeDirPath,
10585
- relativeFilePath: (0, import_node_path76.basename)(relativeFilePath),
10825
+ relativeFilePath: (0, import_node_path77.basename)(relativeFilePath),
10586
10826
  frontmatter: result.data,
10587
10827
  body: content.trim(),
10588
10828
  validate
@@ -10608,7 +10848,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10608
10848
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10609
10849
  static getSettablePaths() {
10610
10850
  return {
10611
- relativeDirPath: (0, import_node_path77.join)(".agents", "subagents")
10851
+ relativeDirPath: (0, import_node_path78.join)(".agents", "subagents")
10612
10852
  };
10613
10853
  }
10614
10854
  static async fromFile(params) {
@@ -10631,11 +10871,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10631
10871
  };
10632
10872
 
10633
10873
  // src/features/subagents/factorydroid-subagent.ts
10634
- var import_node_path78 = require("path");
10874
+ var import_node_path79 = require("path");
10635
10875
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10636
10876
  static getSettablePaths(_options) {
10637
10877
  return {
10638
- relativeDirPath: (0, import_node_path78.join)(".factory", "droids")
10878
+ relativeDirPath: (0, import_node_path79.join)(".factory", "droids")
10639
10879
  };
10640
10880
  }
10641
10881
  static async fromFile(params) {
@@ -10658,11 +10898,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10658
10898
  };
10659
10899
 
10660
10900
  // src/features/subagents/geminicli-subagent.ts
10661
- var import_node_path79 = require("path");
10901
+ var import_node_path80 = require("path");
10662
10902
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10663
10903
  static getSettablePaths() {
10664
10904
  return {
10665
- relativeDirPath: (0, import_node_path79.join)(".gemini", "subagents")
10905
+ relativeDirPath: (0, import_node_path80.join)(".gemini", "subagents")
10666
10906
  };
10667
10907
  }
10668
10908
  static async fromFile(params) {
@@ -10685,11 +10925,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10685
10925
  };
10686
10926
 
10687
10927
  // src/features/subagents/roo-subagent.ts
10688
- var import_node_path80 = require("path");
10928
+ var import_node_path81 = require("path");
10689
10929
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10690
10930
  static getSettablePaths() {
10691
10931
  return {
10692
- relativeDirPath: (0, import_node_path80.join)(".roo", "subagents")
10932
+ relativeDirPath: (0, import_node_path81.join)(".roo", "subagents")
10693
10933
  };
10694
10934
  }
10695
10935
  static async fromFile(params) {
@@ -10712,20 +10952,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10712
10952
  };
10713
10953
 
10714
10954
  // src/features/subagents/subagents-processor.ts
10715
- var import_node_path88 = require("path");
10716
- var import_mini46 = require("zod/mini");
10955
+ var import_node_path89 = require("path");
10956
+ var import_mini47 = require("zod/mini");
10717
10957
 
10718
10958
  // src/features/subagents/claudecode-subagent.ts
10719
- var import_node_path82 = require("path");
10720
- var import_mini40 = require("zod/mini");
10959
+ var import_node_path83 = require("path");
10960
+ var import_mini41 = require("zod/mini");
10721
10961
 
10722
10962
  // src/features/subagents/rulesync-subagent.ts
10723
- var import_node_path81 = require("path");
10724
- var import_mini39 = require("zod/mini");
10725
- var RulesyncSubagentFrontmatterSchema = import_mini39.z.looseObject({
10726
- targets: import_mini39.z._default(RulesyncTargetsSchema, ["*"]),
10727
- name: import_mini39.z.string(),
10728
- description: import_mini39.z.string()
10963
+ var import_node_path82 = require("path");
10964
+ var import_mini40 = require("zod/mini");
10965
+ var RulesyncSubagentFrontmatterSchema = import_mini40.z.looseObject({
10966
+ targets: import_mini40.z._default(RulesyncTargetsSchema, ["*"]),
10967
+ name: import_mini40.z.string(),
10968
+ description: import_mini40.z.string()
10729
10969
  });
10730
10970
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10731
10971
  frontmatter;
@@ -10734,7 +10974,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10734
10974
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10735
10975
  if (!parseResult.success && rest.validate !== false) {
10736
10976
  throw new Error(
10737
- `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10977
+ `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10738
10978
  );
10739
10979
  }
10740
10980
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10767,7 +11007,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10767
11007
  return {
10768
11008
  success: false,
10769
11009
  error: new Error(
10770
- `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11010
+ `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10771
11011
  )
10772
11012
  };
10773
11013
  }
@@ -10775,14 +11015,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10775
11015
  static async fromFile({
10776
11016
  relativeFilePath
10777
11017
  }) {
10778
- const filePath = (0, import_node_path81.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
11018
+ const filePath = (0, import_node_path82.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10779
11019
  const fileContent = await readFileContent(filePath);
10780
11020
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10781
11021
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10782
11022
  if (!result.success) {
10783
11023
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10784
11024
  }
10785
- const filename = (0, import_node_path81.basename)(relativeFilePath);
11025
+ const filename = (0, import_node_path82.basename)(relativeFilePath);
10786
11026
  return new _RulesyncSubagent({
10787
11027
  baseDir: process.cwd(),
10788
11028
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10794,13 +11034,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10794
11034
  };
10795
11035
 
10796
11036
  // src/features/subagents/claudecode-subagent.ts
10797
- var ClaudecodeSubagentFrontmatterSchema = import_mini40.z.looseObject({
10798
- name: import_mini40.z.string(),
10799
- description: import_mini40.z.string(),
10800
- model: import_mini40.z.optional(import_mini40.z.string()),
10801
- tools: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())])),
10802
- permissionMode: import_mini40.z.optional(import_mini40.z.string()),
10803
- skills: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())]))
11037
+ var ClaudecodeSubagentFrontmatterSchema = import_mini41.z.looseObject({
11038
+ name: import_mini41.z.string(),
11039
+ description: import_mini41.z.string(),
11040
+ model: import_mini41.z.optional(import_mini41.z.string()),
11041
+ tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())])),
11042
+ permissionMode: import_mini41.z.optional(import_mini41.z.string()),
11043
+ skills: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
10804
11044
  });
10805
11045
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10806
11046
  frontmatter;
@@ -10810,7 +11050,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10810
11050
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10811
11051
  if (!result.success) {
10812
11052
  throw new Error(
10813
- `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11053
+ `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10814
11054
  );
10815
11055
  }
10816
11056
  }
@@ -10822,7 +11062,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10822
11062
  }
10823
11063
  static getSettablePaths(_options = {}) {
10824
11064
  return {
10825
- relativeDirPath: (0, import_node_path82.join)(".claude", "agents")
11065
+ relativeDirPath: (0, import_node_path83.join)(".claude", "agents")
10826
11066
  };
10827
11067
  }
10828
11068
  getFrontmatter() {
@@ -10898,7 +11138,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10898
11138
  return {
10899
11139
  success: false,
10900
11140
  error: new Error(
10901
- `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11141
+ `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10902
11142
  )
10903
11143
  };
10904
11144
  }
@@ -10916,7 +11156,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10916
11156
  global = false
10917
11157
  }) {
10918
11158
  const paths = this.getSettablePaths({ global });
10919
- const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11159
+ const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10920
11160
  const fileContent = await readFileContent(filePath);
10921
11161
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10922
11162
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10951,16 +11191,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10951
11191
  };
10952
11192
 
10953
11193
  // src/features/subagents/codexcli-subagent.ts
10954
- var import_node_path83 = require("path");
11194
+ var import_node_path84 = require("path");
10955
11195
  var smolToml2 = __toESM(require("smol-toml"), 1);
10956
- var import_mini41 = require("zod/mini");
10957
- var CodexCliSubagentTomlSchema = import_mini41.z.looseObject({
10958
- name: import_mini41.z.string(),
10959
- description: import_mini41.z.optional(import_mini41.z.string()),
10960
- developer_instructions: import_mini41.z.optional(import_mini41.z.string()),
10961
- model: import_mini41.z.optional(import_mini41.z.string()),
10962
- model_reasoning_effort: import_mini41.z.optional(import_mini41.z.string()),
10963
- sandbox_mode: import_mini41.z.optional(import_mini41.z.string())
11196
+ var import_mini42 = require("zod/mini");
11197
+ var CodexCliSubagentTomlSchema = import_mini42.z.looseObject({
11198
+ name: import_mini42.z.string(),
11199
+ description: import_mini42.z.optional(import_mini42.z.string()),
11200
+ developer_instructions: import_mini42.z.optional(import_mini42.z.string()),
11201
+ model: import_mini42.z.optional(import_mini42.z.string()),
11202
+ model_reasoning_effort: import_mini42.z.optional(import_mini42.z.string()),
11203
+ sandbox_mode: import_mini42.z.optional(import_mini42.z.string())
10964
11204
  });
10965
11205
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10966
11206
  body;
@@ -10971,7 +11211,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10971
11211
  CodexCliSubagentTomlSchema.parse(parsed);
10972
11212
  } catch (error) {
10973
11213
  throw new Error(
10974
- `Invalid TOML in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11214
+ `Invalid TOML in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10975
11215
  { cause: error }
10976
11216
  );
10977
11217
  }
@@ -10983,7 +11223,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10983
11223
  }
10984
11224
  static getSettablePaths(_options = {}) {
10985
11225
  return {
10986
- relativeDirPath: (0, import_node_path83.join)(".codex", "agents")
11226
+ relativeDirPath: (0, import_node_path84.join)(".codex", "agents")
10987
11227
  };
10988
11228
  }
10989
11229
  getBody() {
@@ -10995,7 +11235,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10995
11235
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10996
11236
  } catch (error) {
10997
11237
  throw new Error(
10998
- `Failed to parse TOML in ${(0, import_node_path83.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11238
+ `Failed to parse TOML in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10999
11239
  { cause: error }
11000
11240
  );
11001
11241
  }
@@ -11076,7 +11316,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11076
11316
  global = false
11077
11317
  }) {
11078
11318
  const paths = this.getSettablePaths({ global });
11079
- const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11319
+ const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11080
11320
  const fileContent = await readFileContent(filePath);
11081
11321
  const subagent = new _CodexCliSubagent({
11082
11322
  baseDir,
@@ -11114,13 +11354,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11114
11354
  };
11115
11355
 
11116
11356
  // src/features/subagents/copilot-subagent.ts
11117
- var import_node_path84 = require("path");
11118
- var import_mini42 = require("zod/mini");
11357
+ var import_node_path85 = require("path");
11358
+ var import_mini43 = require("zod/mini");
11119
11359
  var REQUIRED_TOOL = "agent/runSubagent";
11120
- var CopilotSubagentFrontmatterSchema = import_mini42.z.looseObject({
11121
- name: import_mini42.z.string(),
11122
- description: import_mini42.z.string(),
11123
- tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
11360
+ var CopilotSubagentFrontmatterSchema = import_mini43.z.looseObject({
11361
+ name: import_mini43.z.string(),
11362
+ description: import_mini43.z.string(),
11363
+ tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
11124
11364
  });
11125
11365
  var normalizeTools = (tools) => {
11126
11366
  if (!tools) {
@@ -11140,7 +11380,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11140
11380
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
11141
11381
  if (!result.success) {
11142
11382
  throw new Error(
11143
- `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11383
+ `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11144
11384
  );
11145
11385
  }
11146
11386
  }
@@ -11152,7 +11392,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11152
11392
  }
11153
11393
  static getSettablePaths(_options = {}) {
11154
11394
  return {
11155
- relativeDirPath: (0, import_node_path84.join)(".github", "agents")
11395
+ relativeDirPath: (0, import_node_path85.join)(".github", "agents")
11156
11396
  };
11157
11397
  }
11158
11398
  getFrontmatter() {
@@ -11226,7 +11466,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11226
11466
  return {
11227
11467
  success: false,
11228
11468
  error: new Error(
11229
- `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11469
+ `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11230
11470
  )
11231
11471
  };
11232
11472
  }
@@ -11244,7 +11484,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11244
11484
  global = false
11245
11485
  }) {
11246
11486
  const paths = this.getSettablePaths({ global });
11247
- const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11487
+ const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11248
11488
  const fileContent = await readFileContent(filePath);
11249
11489
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11250
11490
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11280,11 +11520,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11280
11520
  };
11281
11521
 
11282
11522
  // src/features/subagents/cursor-subagent.ts
11283
- var import_node_path85 = require("path");
11284
- var import_mini43 = require("zod/mini");
11285
- var CursorSubagentFrontmatterSchema = import_mini43.z.looseObject({
11286
- name: import_mini43.z.string(),
11287
- description: import_mini43.z.string()
11523
+ var import_node_path86 = require("path");
11524
+ var import_mini44 = require("zod/mini");
11525
+ var CursorSubagentFrontmatterSchema = import_mini44.z.looseObject({
11526
+ name: import_mini44.z.string(),
11527
+ description: import_mini44.z.string()
11288
11528
  });
11289
11529
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11290
11530
  frontmatter;
@@ -11294,7 +11534,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11294
11534
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11295
11535
  if (!result.success) {
11296
11536
  throw new Error(
11297
- `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11537
+ `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11298
11538
  );
11299
11539
  }
11300
11540
  }
@@ -11306,7 +11546,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11306
11546
  }
11307
11547
  static getSettablePaths(_options = {}) {
11308
11548
  return {
11309
- relativeDirPath: (0, import_node_path85.join)(".cursor", "agents")
11549
+ relativeDirPath: (0, import_node_path86.join)(".cursor", "agents")
11310
11550
  };
11311
11551
  }
11312
11552
  getFrontmatter() {
@@ -11373,7 +11613,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11373
11613
  return {
11374
11614
  success: false,
11375
11615
  error: new Error(
11376
- `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11616
+ `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11377
11617
  )
11378
11618
  };
11379
11619
  }
@@ -11391,7 +11631,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11391
11631
  global = false
11392
11632
  }) {
11393
11633
  const paths = this.getSettablePaths({ global });
11394
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11634
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11395
11635
  const fileContent = await readFileContent(filePath);
11396
11636
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11397
11637
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11427,23 +11667,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11427
11667
  };
11428
11668
 
11429
11669
  // src/features/subagents/kiro-subagent.ts
11430
- var import_node_path86 = require("path");
11431
- var import_mini44 = require("zod/mini");
11432
- var KiroCliSubagentJsonSchema = import_mini44.z.looseObject({
11433
- name: import_mini44.z.string(),
11434
- description: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11435
- prompt: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11436
- tools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11437
- toolAliases: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.string()))),
11438
- toolSettings: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11439
- toolSchema: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
11440
- hooks: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.array(import_mini44.z.unknown())))),
11441
- model: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
11442
- mcpServers: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.unknown()))),
11443
- useLegacyMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean())),
11444
- resources: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11445
- allowedTools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
11446
- includeMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean()))
11670
+ var import_node_path87 = require("path");
11671
+ var import_mini45 = require("zod/mini");
11672
+ var KiroCliSubagentJsonSchema = import_mini45.z.looseObject({
11673
+ name: import_mini45.z.string(),
11674
+ description: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11675
+ prompt: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11676
+ tools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11677
+ toolAliases: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.string()))),
11678
+ toolSettings: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
11679
+ toolSchema: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
11680
+ hooks: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.array(import_mini45.z.unknown())))),
11681
+ model: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11682
+ mcpServers: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.unknown()))),
11683
+ useLegacyMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean())),
11684
+ resources: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11685
+ allowedTools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11686
+ includeMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean()))
11447
11687
  });
11448
11688
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11449
11689
  body;
@@ -11454,7 +11694,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11454
11694
  KiroCliSubagentJsonSchema.parse(parsed);
11455
11695
  } catch (error) {
11456
11696
  throw new Error(
11457
- `Invalid JSON in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11697
+ `Invalid JSON in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11458
11698
  { cause: error }
11459
11699
  );
11460
11700
  }
@@ -11466,7 +11706,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11466
11706
  }
11467
11707
  static getSettablePaths(_options = {}) {
11468
11708
  return {
11469
- relativeDirPath: (0, import_node_path86.join)(".kiro", "agents")
11709
+ relativeDirPath: (0, import_node_path87.join)(".kiro", "agents")
11470
11710
  };
11471
11711
  }
11472
11712
  getBody() {
@@ -11478,7 +11718,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11478
11718
  parsed = JSON.parse(this.body);
11479
11719
  } catch (error) {
11480
11720
  throw new Error(
11481
- `Failed to parse JSON in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11721
+ `Failed to parse JSON in ${(0, import_node_path87.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11482
11722
  { cause: error }
11483
11723
  );
11484
11724
  }
@@ -11559,7 +11799,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11559
11799
  global = false
11560
11800
  }) {
11561
11801
  const paths = this.getSettablePaths({ global });
11562
- const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11802
+ const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11563
11803
  const fileContent = await readFileContent(filePath);
11564
11804
  const subagent = new _KiroSubagent({
11565
11805
  baseDir,
@@ -11597,12 +11837,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11597
11837
  };
11598
11838
 
11599
11839
  // src/features/subagents/opencode-subagent.ts
11600
- var import_node_path87 = require("path");
11601
- var import_mini45 = require("zod/mini");
11602
- var OpenCodeSubagentFrontmatterSchema = import_mini45.z.looseObject({
11603
- description: import_mini45.z.string(),
11604
- mode: import_mini45.z._default(import_mini45.z.string(), "subagent"),
11605
- name: import_mini45.z.optional(import_mini45.z.string())
11840
+ var import_node_path88 = require("path");
11841
+ var import_mini46 = require("zod/mini");
11842
+ var OpenCodeSubagentFrontmatterSchema = import_mini46.z.looseObject({
11843
+ description: import_mini46.z.string(),
11844
+ mode: import_mini46.z._default(import_mini46.z.string(), "subagent"),
11845
+ name: import_mini46.z.optional(import_mini46.z.string())
11606
11846
  });
11607
11847
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11608
11848
  frontmatter;
@@ -11612,7 +11852,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11612
11852
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11613
11853
  if (!result.success) {
11614
11854
  throw new Error(
11615
- `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11855
+ `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11616
11856
  );
11617
11857
  }
11618
11858
  }
@@ -11626,7 +11866,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11626
11866
  global = false
11627
11867
  } = {}) {
11628
11868
  return {
11629
- relativeDirPath: global ? (0, import_node_path87.join)(".config", "opencode", "agent") : (0, import_node_path87.join)(".opencode", "agent")
11869
+ relativeDirPath: global ? (0, import_node_path88.join)(".config", "opencode", "agent") : (0, import_node_path88.join)(".opencode", "agent")
11630
11870
  };
11631
11871
  }
11632
11872
  getFrontmatter() {
@@ -11639,7 +11879,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11639
11879
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
11640
11880
  const rulesyncFrontmatter = {
11641
11881
  targets: ["*"],
11642
- name: name ?? (0, import_node_path87.basename)(this.getRelativeFilePath(), ".md"),
11882
+ name: name ?? (0, import_node_path88.basename)(this.getRelativeFilePath(), ".md"),
11643
11883
  description,
11644
11884
  opencode: { mode, ...opencodeSection }
11645
11885
  };
@@ -11664,7 +11904,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11664
11904
  const opencodeFrontmatter = {
11665
11905
  ...opencodeSection,
11666
11906
  description: rulesyncFrontmatter.description,
11667
- mode: "subagent",
11907
+ mode: typeof opencodeSection.mode === "string" ? opencodeSection.mode : "subagent",
11668
11908
  ...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
11669
11909
  };
11670
11910
  const body = rulesyncSubagent.getBody();
@@ -11692,7 +11932,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11692
11932
  return {
11693
11933
  success: false,
11694
11934
  error: new Error(
11695
- `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11935
+ `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11696
11936
  )
11697
11937
  };
11698
11938
  }
@@ -11709,7 +11949,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11709
11949
  global = false
11710
11950
  }) {
11711
11951
  const paths = this.getSettablePaths({ global });
11712
- const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11952
+ const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11713
11953
  const fileContent = await readFileContent(filePath);
11714
11954
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11715
11955
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11758,7 +11998,7 @@ var subagentsProcessorToolTargetTuple = [
11758
11998
  "opencode",
11759
11999
  "roo"
11760
12000
  ];
11761
- var SubagentsProcessorToolTargetSchema = import_mini46.z.enum(subagentsProcessorToolTargetTuple);
12001
+ var SubagentsProcessorToolTargetSchema = import_mini47.z.enum(subagentsProcessorToolTargetTuple);
11762
12002
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11763
12003
  [
11764
12004
  "agentsmd",
@@ -11920,7 +12160,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11920
12160
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11921
12161
  */
11922
12162
  async loadRulesyncFiles() {
11923
- const subagentsDir = (0, import_node_path88.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12163
+ const subagentsDir = (0, import_node_path89.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11924
12164
  const dirExists = await directoryExists(subagentsDir);
11925
12165
  if (!dirExists) {
11926
12166
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11935,7 +12175,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11935
12175
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
11936
12176
  const rulesyncSubagents = [];
11937
12177
  for (const mdFile of mdFiles) {
11938
- const filepath = (0, import_node_path88.join)(subagentsDir, mdFile);
12178
+ const filepath = (0, import_node_path89.join)(subagentsDir, mdFile);
11939
12179
  try {
11940
12180
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
11941
12181
  relativeFilePath: mdFile,
@@ -11965,14 +12205,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
11965
12205
  const factory = this.getFactory(this.toolTarget);
11966
12206
  const paths = factory.class.getSettablePaths({ global: this.global });
11967
12207
  const subagentFilePaths = await findFilesByGlobs(
11968
- (0, import_node_path88.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12208
+ (0, import_node_path89.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11969
12209
  );
11970
12210
  if (forDeletion) {
11971
12211
  const toolSubagents2 = subagentFilePaths.map(
11972
12212
  (path3) => factory.class.forDeletion({
11973
12213
  baseDir: this.baseDir,
11974
12214
  relativeDirPath: paths.relativeDirPath,
11975
- relativeFilePath: (0, import_node_path88.basename)(path3),
12215
+ relativeFilePath: (0, import_node_path89.basename)(path3),
11976
12216
  global: this.global
11977
12217
  })
11978
12218
  ).filter((subagent) => subagent.isDeletable());
@@ -11985,7 +12225,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11985
12225
  subagentFilePaths.map(
11986
12226
  (path3) => factory.class.fromFile({
11987
12227
  baseDir: this.baseDir,
11988
- relativeFilePath: (0, import_node_path88.basename)(path3),
12228
+ relativeFilePath: (0, import_node_path89.basename)(path3),
11989
12229
  global: this.global
11990
12230
  })
11991
12231
  )
@@ -12030,49 +12270,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
12030
12270
  };
12031
12271
 
12032
12272
  // src/features/rules/agentsmd-rule.ts
12033
- var import_node_path91 = require("path");
12273
+ var import_node_path92 = require("path");
12034
12274
 
12035
12275
  // src/features/rules/tool-rule.ts
12036
- var import_node_path90 = require("path");
12276
+ var import_node_path91 = require("path");
12037
12277
 
12038
12278
  // src/features/rules/rulesync-rule.ts
12039
- var import_node_path89 = require("path");
12040
- var import_mini47 = require("zod/mini");
12041
- var RulesyncRuleFrontmatterSchema = import_mini47.z.object({
12042
- root: import_mini47.z.optional(import_mini47.z.boolean()),
12043
- localRoot: import_mini47.z.optional(import_mini47.z.boolean()),
12044
- targets: import_mini47.z._default(RulesyncTargetsSchema, ["*"]),
12045
- description: import_mini47.z.optional(import_mini47.z.string()),
12046
- globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string())),
12047
- agentsmd: import_mini47.z.optional(
12048
- import_mini47.z.object({
12279
+ var import_node_path90 = require("path");
12280
+ var import_mini48 = require("zod/mini");
12281
+ var RulesyncRuleFrontmatterSchema = import_mini48.z.object({
12282
+ root: import_mini48.z.optional(import_mini48.z.boolean()),
12283
+ localRoot: import_mini48.z.optional(import_mini48.z.boolean()),
12284
+ targets: import_mini48.z._default(RulesyncTargetsSchema, ["*"]),
12285
+ description: import_mini48.z.optional(import_mini48.z.string()),
12286
+ globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string())),
12287
+ agentsmd: import_mini48.z.optional(
12288
+ import_mini48.z.object({
12049
12289
  // @example "path/to/subproject"
12050
- subprojectPath: import_mini47.z.optional(import_mini47.z.string())
12290
+ subprojectPath: import_mini48.z.optional(import_mini48.z.string())
12051
12291
  })
12052
12292
  ),
12053
- claudecode: import_mini47.z.optional(
12054
- import_mini47.z.object({
12293
+ claudecode: import_mini48.z.optional(
12294
+ import_mini48.z.object({
12055
12295
  // Glob patterns for conditional rules (takes precedence over globs)
12056
12296
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
12057
- paths: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
12297
+ paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12058
12298
  })
12059
12299
  ),
12060
- cursor: import_mini47.z.optional(
12061
- import_mini47.z.object({
12062
- alwaysApply: import_mini47.z.optional(import_mini47.z.boolean()),
12063
- description: import_mini47.z.optional(import_mini47.z.string()),
12064
- globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
12300
+ cursor: import_mini48.z.optional(
12301
+ import_mini48.z.object({
12302
+ alwaysApply: import_mini48.z.optional(import_mini48.z.boolean()),
12303
+ description: import_mini48.z.optional(import_mini48.z.string()),
12304
+ globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12065
12305
  })
12066
12306
  ),
12067
- copilot: import_mini47.z.optional(
12068
- import_mini47.z.object({
12069
- excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
12307
+ copilot: import_mini48.z.optional(
12308
+ import_mini48.z.object({
12309
+ excludeAgent: import_mini48.z.optional(import_mini48.z.union([import_mini48.z.literal("code-review"), import_mini48.z.literal("coding-agent")]))
12070
12310
  })
12071
12311
  ),
12072
- antigravity: import_mini47.z.optional(
12073
- import_mini47.z.looseObject({
12074
- trigger: import_mini47.z.optional(import_mini47.z.string()),
12075
- globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
12312
+ antigravity: import_mini48.z.optional(
12313
+ import_mini48.z.looseObject({
12314
+ trigger: import_mini48.z.optional(import_mini48.z.string()),
12315
+ globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12076
12316
  })
12077
12317
  )
12078
12318
  });
@@ -12083,7 +12323,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12083
12323
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
12084
12324
  if (!parseResult.success && rest.validate !== false) {
12085
12325
  throw new Error(
12086
- `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12326
+ `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12087
12327
  );
12088
12328
  }
12089
12329
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -12118,7 +12358,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12118
12358
  return {
12119
12359
  success: false,
12120
12360
  error: new Error(
12121
- `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12361
+ `Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12122
12362
  )
12123
12363
  };
12124
12364
  }
@@ -12127,7 +12367,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12127
12367
  relativeFilePath,
12128
12368
  validate = true
12129
12369
  }) {
12130
- const filePath = (0, import_node_path89.join)(
12370
+ const filePath = (0, import_node_path90.join)(
12131
12371
  process.cwd(),
12132
12372
  this.getSettablePaths().recommended.relativeDirPath,
12133
12373
  relativeFilePath
@@ -12229,7 +12469,7 @@ var ToolRule = class extends ToolFile {
12229
12469
  rulesyncRule,
12230
12470
  validate = true,
12231
12471
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
12232
- nonRootPath = { relativeDirPath: (0, import_node_path90.join)(".agents", "memories") }
12472
+ nonRootPath = { relativeDirPath: (0, import_node_path91.join)(".agents", "memories") }
12233
12473
  }) {
12234
12474
  const params = this.buildToolRuleParamsDefault({
12235
12475
  baseDir,
@@ -12240,7 +12480,7 @@ var ToolRule = class extends ToolFile {
12240
12480
  });
12241
12481
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
12242
12482
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
12243
- params.relativeDirPath = (0, import_node_path90.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12483
+ params.relativeDirPath = (0, import_node_path91.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12244
12484
  params.relativeFilePath = "AGENTS.md";
12245
12485
  }
12246
12486
  return params;
@@ -12289,7 +12529,7 @@ var ToolRule = class extends ToolFile {
12289
12529
  }
12290
12530
  };
12291
12531
  function buildToolPath(toolDir, subDir, excludeToolDir) {
12292
- return excludeToolDir ? subDir : (0, import_node_path90.join)(toolDir, subDir);
12532
+ return excludeToolDir ? subDir : (0, import_node_path91.join)(toolDir, subDir);
12293
12533
  }
12294
12534
 
12295
12535
  // src/features/rules/agentsmd-rule.ts
@@ -12318,8 +12558,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12318
12558
  validate = true
12319
12559
  }) {
12320
12560
  const isRoot = relativeFilePath === "AGENTS.md";
12321
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path91.join)(".agents", "memories", relativeFilePath);
12322
- const fileContent = await readFileContent((0, import_node_path91.join)(baseDir, relativePath));
12561
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path92.join)(".agents", "memories", relativeFilePath);
12562
+ const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
12323
12563
  return new _AgentsMdRule({
12324
12564
  baseDir,
12325
12565
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -12374,21 +12614,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12374
12614
  };
12375
12615
 
12376
12616
  // src/features/rules/antigravity-rule.ts
12377
- var import_node_path92 = require("path");
12378
- var import_mini48 = require("zod/mini");
12379
- var AntigravityRuleFrontmatterSchema = import_mini48.z.looseObject({
12380
- trigger: import_mini48.z.optional(
12381
- import_mini48.z.union([
12382
- import_mini48.z.literal("always_on"),
12383
- import_mini48.z.literal("glob"),
12384
- import_mini48.z.literal("manual"),
12385
- import_mini48.z.literal("model_decision"),
12386
- import_mini48.z.string()
12617
+ var import_node_path93 = require("path");
12618
+ var import_mini49 = require("zod/mini");
12619
+ var AntigravityRuleFrontmatterSchema = import_mini49.z.looseObject({
12620
+ trigger: import_mini49.z.optional(
12621
+ import_mini49.z.union([
12622
+ import_mini49.z.literal("always_on"),
12623
+ import_mini49.z.literal("glob"),
12624
+ import_mini49.z.literal("manual"),
12625
+ import_mini49.z.literal("model_decision"),
12626
+ import_mini49.z.string()
12387
12627
  // accepts any string for forward compatibility
12388
12628
  ])
12389
12629
  ),
12390
- globs: import_mini48.z.optional(import_mini48.z.string()),
12391
- description: import_mini48.z.optional(import_mini48.z.string())
12630
+ globs: import_mini49.z.optional(import_mini49.z.string()),
12631
+ description: import_mini49.z.optional(import_mini49.z.string())
12392
12632
  });
12393
12633
  function parseGlobsString(globs) {
12394
12634
  if (!globs) {
@@ -12533,7 +12773,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12533
12773
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
12534
12774
  if (!result.success) {
12535
12775
  throw new Error(
12536
- `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12776
+ `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12537
12777
  );
12538
12778
  }
12539
12779
  }
@@ -12557,7 +12797,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12557
12797
  relativeFilePath,
12558
12798
  validate = true
12559
12799
  }) {
12560
- const filePath = (0, import_node_path92.join)(
12800
+ const filePath = (0, import_node_path93.join)(
12561
12801
  baseDir,
12562
12802
  this.getSettablePaths().nonRoot.relativeDirPath,
12563
12803
  relativeFilePath
@@ -12698,7 +12938,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12698
12938
  };
12699
12939
 
12700
12940
  // src/features/rules/augmentcode-legacy-rule.ts
12701
- var import_node_path93 = require("path");
12941
+ var import_node_path94 = require("path");
12702
12942
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12703
12943
  toRulesyncRule() {
12704
12944
  const rulesyncFrontmatter = {
@@ -12759,8 +12999,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12759
12999
  }) {
12760
13000
  const settablePaths = this.getSettablePaths();
12761
13001
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12762
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path93.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12763
- const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
13002
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path94.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
13003
+ const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
12764
13004
  return new _AugmentcodeLegacyRule({
12765
13005
  baseDir,
12766
13006
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12789,7 +13029,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12789
13029
  };
12790
13030
 
12791
13031
  // src/features/rules/augmentcode-rule.ts
12792
- var import_node_path94 = require("path");
13032
+ var import_node_path95 = require("path");
12793
13033
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12794
13034
  toRulesyncRule() {
12795
13035
  return this.toRulesyncRuleDefault();
@@ -12820,7 +13060,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12820
13060
  relativeFilePath,
12821
13061
  validate = true
12822
13062
  }) {
12823
- const filePath = (0, import_node_path94.join)(
13063
+ const filePath = (0, import_node_path95.join)(
12824
13064
  baseDir,
12825
13065
  this.getSettablePaths().nonRoot.relativeDirPath,
12826
13066
  relativeFilePath
@@ -12860,7 +13100,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12860
13100
  };
12861
13101
 
12862
13102
  // src/features/rules/claudecode-legacy-rule.ts
12863
- var import_node_path95 = require("path");
13103
+ var import_node_path96 = require("path");
12864
13104
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12865
13105
  static getSettablePaths({
12866
13106
  global,
@@ -12895,7 +13135,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12895
13135
  if (isRoot) {
12896
13136
  const relativePath2 = paths.root.relativeFilePath;
12897
13137
  const fileContent2 = await readFileContent(
12898
- (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13138
+ (0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12899
13139
  );
12900
13140
  return new _ClaudecodeLegacyRule({
12901
13141
  baseDir,
@@ -12909,8 +13149,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12909
13149
  if (!paths.nonRoot) {
12910
13150
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12911
13151
  }
12912
- const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12913
- const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
13152
+ const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13153
+ const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
12914
13154
  return new _ClaudecodeLegacyRule({
12915
13155
  baseDir,
12916
13156
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12969,10 +13209,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12969
13209
  };
12970
13210
 
12971
13211
  // src/features/rules/claudecode-rule.ts
12972
- var import_node_path96 = require("path");
12973
- var import_mini49 = require("zod/mini");
12974
- var ClaudecodeRuleFrontmatterSchema = import_mini49.z.object({
12975
- paths: import_mini49.z.optional(import_mini49.z.array(import_mini49.z.string()))
13212
+ var import_node_path97 = require("path");
13213
+ var import_mini50 = require("zod/mini");
13214
+ var ClaudecodeRuleFrontmatterSchema = import_mini50.z.object({
13215
+ paths: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12976
13216
  });
12977
13217
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12978
13218
  frontmatter;
@@ -13004,7 +13244,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13004
13244
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
13005
13245
  if (!result.success) {
13006
13246
  throw new Error(
13007
- `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13247
+ `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13008
13248
  );
13009
13249
  }
13010
13250
  }
@@ -13032,7 +13272,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13032
13272
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13033
13273
  if (isRoot) {
13034
13274
  const fileContent2 = await readFileContent(
13035
- (0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
13275
+ (0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
13036
13276
  );
13037
13277
  return new _ClaudecodeRule({
13038
13278
  baseDir,
@@ -13047,17 +13287,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13047
13287
  if (!paths.nonRoot) {
13048
13288
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13049
13289
  }
13050
- const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13051
- const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
13052
- const { frontmatter, body: content } = parseFrontmatter(
13053
- fileContent,
13054
- (0, import_node_path96.join)(baseDir, relativePath)
13055
- );
13290
+ const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13291
+ const filePath = (0, import_node_path97.join)(baseDir, relativePath);
13292
+ const fileContent = await readFileContent(filePath);
13293
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13056
13294
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
13057
13295
  if (!result.success) {
13058
- throw new Error(
13059
- `Invalid frontmatter in ${(0, import_node_path96.join)(baseDir, relativePath)}: ${formatError(result.error)}`
13060
- );
13296
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
13061
13297
  }
13062
13298
  return new _ClaudecodeRule({
13063
13299
  baseDir,
@@ -13163,7 +13399,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13163
13399
  return {
13164
13400
  success: false,
13165
13401
  error: new Error(
13166
- `Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13402
+ `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13167
13403
  )
13168
13404
  };
13169
13405
  }
@@ -13183,10 +13419,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13183
13419
  };
13184
13420
 
13185
13421
  // src/features/rules/cline-rule.ts
13186
- var import_node_path97 = require("path");
13187
- var import_mini50 = require("zod/mini");
13188
- var ClineRuleFrontmatterSchema = import_mini50.z.object({
13189
- description: import_mini50.z.string()
13422
+ var import_node_path98 = require("path");
13423
+ var import_mini51 = require("zod/mini");
13424
+ var ClineRuleFrontmatterSchema = import_mini51.z.object({
13425
+ description: import_mini51.z.string()
13190
13426
  });
13191
13427
  var ClineRule = class _ClineRule extends ToolRule {
13192
13428
  static getSettablePaths(_options = {}) {
@@ -13229,7 +13465,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13229
13465
  validate = true
13230
13466
  }) {
13231
13467
  const fileContent = await readFileContent(
13232
- (0, import_node_path97.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13468
+ (0, import_node_path98.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13233
13469
  );
13234
13470
  return new _ClineRule({
13235
13471
  baseDir,
@@ -13255,7 +13491,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13255
13491
  };
13256
13492
 
13257
13493
  // src/features/rules/codexcli-rule.ts
13258
- var import_node_path98 = require("path");
13494
+ var import_node_path99 = require("path");
13259
13495
  var CodexcliRule = class _CodexcliRule extends ToolRule {
13260
13496
  static getSettablePaths({
13261
13497
  global,
@@ -13290,7 +13526,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13290
13526
  if (isRoot) {
13291
13527
  const relativePath2 = paths.root.relativeFilePath;
13292
13528
  const fileContent2 = await readFileContent(
13293
- (0, import_node_path98.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13529
+ (0, import_node_path99.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13294
13530
  );
13295
13531
  return new _CodexcliRule({
13296
13532
  baseDir,
@@ -13304,8 +13540,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13304
13540
  if (!paths.nonRoot) {
13305
13541
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13306
13542
  }
13307
- const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13308
- const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13543
+ const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13544
+ const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13309
13545
  return new _CodexcliRule({
13310
13546
  baseDir,
13311
13547
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13364,12 +13600,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13364
13600
  };
13365
13601
 
13366
13602
  // src/features/rules/copilot-rule.ts
13367
- var import_node_path99 = require("path");
13368
- var import_mini51 = require("zod/mini");
13369
- var CopilotRuleFrontmatterSchema = import_mini51.z.object({
13370
- description: import_mini51.z.optional(import_mini51.z.string()),
13371
- applyTo: import_mini51.z.optional(import_mini51.z.string()),
13372
- excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
13603
+ var import_node_path100 = require("path");
13604
+ var import_mini52 = require("zod/mini");
13605
+ var CopilotRuleFrontmatterSchema = import_mini52.z.object({
13606
+ description: import_mini52.z.optional(import_mini52.z.string()),
13607
+ applyTo: import_mini52.z.optional(import_mini52.z.string()),
13608
+ excludeAgent: import_mini52.z.optional(import_mini52.z.union([import_mini52.z.literal("code-review"), import_mini52.z.literal("coding-agent")]))
13373
13609
  });
13374
13610
  var CopilotRule = class _CopilotRule extends ToolRule {
13375
13611
  frontmatter;
@@ -13398,7 +13634,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13398
13634
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13399
13635
  if (!result.success) {
13400
13636
  throw new Error(
13401
- `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13637
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13402
13638
  );
13403
13639
  }
13404
13640
  }
@@ -13488,8 +13724,9 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13488
13724
  const paths = this.getSettablePaths({ global });
13489
13725
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13490
13726
  if (isRoot) {
13491
- const relativePath2 = (0, import_node_path99.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13492
- const fileContent2 = await readFileContent((0, import_node_path99.join)(baseDir, relativePath2));
13727
+ const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13728
+ const filePath2 = (0, import_node_path100.join)(baseDir, relativePath2);
13729
+ const fileContent2 = await readFileContent(filePath2);
13493
13730
  return new _CopilotRule({
13494
13731
  baseDir,
13495
13732
  relativeDirPath: paths.root.relativeDirPath,
@@ -13503,17 +13740,13 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13503
13740
  if (!paths.nonRoot) {
13504
13741
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13505
13742
  }
13506
- const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13507
- const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13508
- const { frontmatter, body: content } = parseFrontmatter(
13509
- fileContent,
13510
- (0, import_node_path99.join)(baseDir, relativePath)
13511
- );
13743
+ const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13744
+ const filePath = (0, import_node_path100.join)(baseDir, relativePath);
13745
+ const fileContent = await readFileContent(filePath);
13746
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13512
13747
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13513
13748
  if (!result.success) {
13514
- throw new Error(
13515
- `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13516
- );
13749
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
13517
13750
  }
13518
13751
  return new _CopilotRule({
13519
13752
  baseDir,
@@ -13554,7 +13787,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13554
13787
  return {
13555
13788
  success: false,
13556
13789
  error: new Error(
13557
- `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13790
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13558
13791
  )
13559
13792
  };
13560
13793
  }
@@ -13574,12 +13807,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13574
13807
  };
13575
13808
 
13576
13809
  // src/features/rules/cursor-rule.ts
13577
- var import_node_path100 = require("path");
13578
- var import_mini52 = require("zod/mini");
13579
- var CursorRuleFrontmatterSchema = import_mini52.z.object({
13580
- description: import_mini52.z.optional(import_mini52.z.string()),
13581
- globs: import_mini52.z.optional(import_mini52.z.string()),
13582
- alwaysApply: import_mini52.z.optional(import_mini52.z.boolean())
13810
+ var import_node_path101 = require("path");
13811
+ var import_mini53 = require("zod/mini");
13812
+ var CursorRuleFrontmatterSchema = import_mini53.z.object({
13813
+ description: import_mini53.z.optional(import_mini53.z.string()),
13814
+ globs: import_mini53.z.optional(import_mini53.z.string()),
13815
+ alwaysApply: import_mini53.z.optional(import_mini53.z.boolean())
13583
13816
  });
13584
13817
  var CursorRule = class _CursorRule extends ToolRule {
13585
13818
  frontmatter;
@@ -13596,7 +13829,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13596
13829
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13597
13830
  if (!result.success) {
13598
13831
  throw new Error(
13599
- `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13832
+ `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13600
13833
  );
13601
13834
  }
13602
13835
  }
@@ -13712,7 +13945,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13712
13945
  relativeFilePath,
13713
13946
  validate = true
13714
13947
  }) {
13715
- const filePath = (0, import_node_path100.join)(
13948
+ const filePath = (0, import_node_path101.join)(
13716
13949
  baseDir,
13717
13950
  this.getSettablePaths().nonRoot.relativeDirPath,
13718
13951
  relativeFilePath
@@ -13722,7 +13955,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13722
13955
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13723
13956
  if (!result.success) {
13724
13957
  throw new Error(
13725
- `Invalid frontmatter in ${(0, import_node_path100.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13958
+ `Invalid frontmatter in ${(0, import_node_path101.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13726
13959
  );
13727
13960
  }
13728
13961
  return new _CursorRule({
@@ -13759,7 +13992,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13759
13992
  return {
13760
13993
  success: false,
13761
13994
  error: new Error(
13762
- `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13995
+ `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13763
13996
  )
13764
13997
  };
13765
13998
  }
@@ -13779,7 +14012,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13779
14012
  };
13780
14013
 
13781
14014
  // src/features/rules/factorydroid-rule.ts
13782
- var import_node_path101 = require("path");
14015
+ var import_node_path102 = require("path");
13783
14016
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13784
14017
  constructor({ fileContent, root, ...rest }) {
13785
14018
  super({
@@ -13819,8 +14052,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13819
14052
  const paths = this.getSettablePaths({ global });
13820
14053
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13821
14054
  if (isRoot) {
13822
- const relativePath2 = (0, import_node_path101.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13823
- const fileContent2 = await readFileContent((0, import_node_path101.join)(baseDir, relativePath2));
14055
+ const relativePath2 = (0, import_node_path102.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14056
+ const fileContent2 = await readFileContent((0, import_node_path102.join)(baseDir, relativePath2));
13824
14057
  return new _FactorydroidRule({
13825
14058
  baseDir,
13826
14059
  relativeDirPath: paths.root.relativeDirPath,
@@ -13833,8 +14066,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13833
14066
  if (!paths.nonRoot) {
13834
14067
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13835
14068
  }
13836
- const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13837
- const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
14069
+ const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14070
+ const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13838
14071
  return new _FactorydroidRule({
13839
14072
  baseDir,
13840
14073
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13893,7 +14126,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13893
14126
  };
13894
14127
 
13895
14128
  // src/features/rules/geminicli-rule.ts
13896
- var import_node_path102 = require("path");
14129
+ var import_node_path103 = require("path");
13897
14130
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13898
14131
  static getSettablePaths({
13899
14132
  global,
@@ -13928,7 +14161,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13928
14161
  if (isRoot) {
13929
14162
  const relativePath2 = paths.root.relativeFilePath;
13930
14163
  const fileContent2 = await readFileContent(
13931
- (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14164
+ (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13932
14165
  );
13933
14166
  return new _GeminiCliRule({
13934
14167
  baseDir,
@@ -13942,8 +14175,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13942
14175
  if (!paths.nonRoot) {
13943
14176
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13944
14177
  }
13945
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13946
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
14178
+ const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14179
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13947
14180
  return new _GeminiCliRule({
13948
14181
  baseDir,
13949
14182
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14002,7 +14235,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14002
14235
  };
14003
14236
 
14004
14237
  // src/features/rules/goose-rule.ts
14005
- var import_node_path103 = require("path");
14238
+ var import_node_path104 = require("path");
14006
14239
  var GooseRule = class _GooseRule extends ToolRule {
14007
14240
  static getSettablePaths({
14008
14241
  global,
@@ -14037,7 +14270,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14037
14270
  if (isRoot) {
14038
14271
  const relativePath2 = paths.root.relativeFilePath;
14039
14272
  const fileContent2 = await readFileContent(
14040
- (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14273
+ (0, import_node_path104.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14041
14274
  );
14042
14275
  return new _GooseRule({
14043
14276
  baseDir,
@@ -14051,8 +14284,8 @@ var GooseRule = class _GooseRule extends ToolRule {
14051
14284
  if (!paths.nonRoot) {
14052
14285
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14053
14286
  }
14054
- const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14055
- const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
14287
+ const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14288
+ const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
14056
14289
  return new _GooseRule({
14057
14290
  baseDir,
14058
14291
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14111,7 +14344,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14111
14344
  };
14112
14345
 
14113
14346
  // src/features/rules/junie-rule.ts
14114
- var import_node_path104 = require("path");
14347
+ var import_node_path105 = require("path");
14115
14348
  var JunieRule = class _JunieRule extends ToolRule {
14116
14349
  static getSettablePaths(_options = {}) {
14117
14350
  return {
@@ -14130,8 +14363,8 @@ var JunieRule = class _JunieRule extends ToolRule {
14130
14363
  validate = true
14131
14364
  }) {
14132
14365
  const isRoot = relativeFilePath === "guidelines.md";
14133
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path104.join)(".junie", "memories", relativeFilePath);
14134
- const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
14366
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path105.join)(".junie", "memories", relativeFilePath);
14367
+ const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
14135
14368
  return new _JunieRule({
14136
14369
  baseDir,
14137
14370
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14186,7 +14419,7 @@ var JunieRule = class _JunieRule extends ToolRule {
14186
14419
  };
14187
14420
 
14188
14421
  // src/features/rules/kilo-rule.ts
14189
- var import_node_path105 = require("path");
14422
+ var import_node_path106 = require("path");
14190
14423
  var KiloRule = class _KiloRule extends ToolRule {
14191
14424
  static getSettablePaths(_options = {}) {
14192
14425
  return {
@@ -14201,7 +14434,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14201
14434
  validate = true
14202
14435
  }) {
14203
14436
  const fileContent = await readFileContent(
14204
- (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14437
+ (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14205
14438
  );
14206
14439
  return new _KiloRule({
14207
14440
  baseDir,
@@ -14253,7 +14486,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14253
14486
  };
14254
14487
 
14255
14488
  // src/features/rules/kiro-rule.ts
14256
- var import_node_path106 = require("path");
14489
+ var import_node_path107 = require("path");
14257
14490
  var KiroRule = class _KiroRule extends ToolRule {
14258
14491
  static getSettablePaths(_options = {}) {
14259
14492
  return {
@@ -14268,7 +14501,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14268
14501
  validate = true
14269
14502
  }) {
14270
14503
  const fileContent = await readFileContent(
14271
- (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14504
+ (0, import_node_path107.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14272
14505
  );
14273
14506
  return new _KiroRule({
14274
14507
  baseDir,
@@ -14322,7 +14555,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14322
14555
  };
14323
14556
 
14324
14557
  // src/features/rules/opencode-rule.ts
14325
- var import_node_path107 = require("path");
14558
+ var import_node_path108 = require("path");
14326
14559
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14327
14560
  static getSettablePaths({
14328
14561
  global,
@@ -14357,7 +14590,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14357
14590
  if (isRoot) {
14358
14591
  const relativePath2 = paths.root.relativeFilePath;
14359
14592
  const fileContent2 = await readFileContent(
14360
- (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14593
+ (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14361
14594
  );
14362
14595
  return new _OpenCodeRule({
14363
14596
  baseDir,
@@ -14371,8 +14604,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14371
14604
  if (!paths.nonRoot) {
14372
14605
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14373
14606
  }
14374
- const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14375
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14607
+ const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14608
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14376
14609
  return new _OpenCodeRule({
14377
14610
  baseDir,
14378
14611
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14431,7 +14664,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14431
14664
  };
14432
14665
 
14433
14666
  // src/features/rules/qwencode-rule.ts
14434
- var import_node_path108 = require("path");
14667
+ var import_node_path109 = require("path");
14435
14668
  var QwencodeRule = class _QwencodeRule extends ToolRule {
14436
14669
  static getSettablePaths(_options = {}) {
14437
14670
  return {
@@ -14450,8 +14683,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14450
14683
  validate = true
14451
14684
  }) {
14452
14685
  const isRoot = relativeFilePath === "QWEN.md";
14453
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path108.join)(".qwen", "memories", relativeFilePath);
14454
- const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14686
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path109.join)(".qwen", "memories", relativeFilePath);
14687
+ const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
14455
14688
  return new _QwencodeRule({
14456
14689
  baseDir,
14457
14690
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14503,7 +14736,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14503
14736
  };
14504
14737
 
14505
14738
  // src/features/rules/replit-rule.ts
14506
- var import_node_path109 = require("path");
14739
+ var import_node_path110 = require("path");
14507
14740
  var ReplitRule = class _ReplitRule extends ToolRule {
14508
14741
  static getSettablePaths(_options = {}) {
14509
14742
  return {
@@ -14525,7 +14758,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14525
14758
  }
14526
14759
  const relativePath = paths.root.relativeFilePath;
14527
14760
  const fileContent = await readFileContent(
14528
- (0, import_node_path109.join)(baseDir, paths.root.relativeDirPath, relativePath)
14761
+ (0, import_node_path110.join)(baseDir, paths.root.relativeDirPath, relativePath)
14529
14762
  );
14530
14763
  return new _ReplitRule({
14531
14764
  baseDir,
@@ -14591,7 +14824,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14591
14824
  };
14592
14825
 
14593
14826
  // src/features/rules/roo-rule.ts
14594
- var import_node_path110 = require("path");
14827
+ var import_node_path111 = require("path");
14595
14828
  var RooRule = class _RooRule extends ToolRule {
14596
14829
  static getSettablePaths(_options = {}) {
14597
14830
  return {
@@ -14606,7 +14839,7 @@ var RooRule = class _RooRule extends ToolRule {
14606
14839
  validate = true
14607
14840
  }) {
14608
14841
  const fileContent = await readFileContent(
14609
- (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14842
+ (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14610
14843
  );
14611
14844
  return new _RooRule({
14612
14845
  baseDir,
@@ -14675,7 +14908,7 @@ var RooRule = class _RooRule extends ToolRule {
14675
14908
  };
14676
14909
 
14677
14910
  // src/features/rules/warp-rule.ts
14678
- var import_node_path111 = require("path");
14911
+ var import_node_path112 = require("path");
14679
14912
  var WarpRule = class _WarpRule extends ToolRule {
14680
14913
  constructor({ fileContent, root, ...rest }) {
14681
14914
  super({
@@ -14701,8 +14934,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14701
14934
  validate = true
14702
14935
  }) {
14703
14936
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14704
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path111.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14705
- const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
14937
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path112.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14938
+ const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
14706
14939
  return new _WarpRule({
14707
14940
  baseDir,
14708
14941
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14757,7 +14990,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14757
14990
  };
14758
14991
 
14759
14992
  // src/features/rules/windsurf-rule.ts
14760
- var import_node_path112 = require("path");
14993
+ var import_node_path113 = require("path");
14761
14994
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14762
14995
  static getSettablePaths(_options = {}) {
14763
14996
  return {
@@ -14772,7 +15005,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14772
15005
  validate = true
14773
15006
  }) {
14774
15007
  const fileContent = await readFileContent(
14775
- (0, import_node_path112.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15008
+ (0, import_node_path113.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14776
15009
  );
14777
15010
  return new _WindsurfRule({
14778
15011
  baseDir,
@@ -14848,8 +15081,8 @@ var rulesProcessorToolTargets = [
14848
15081
  "warp",
14849
15082
  "windsurf"
14850
15083
  ];
14851
- var RulesProcessorToolTargetSchema = import_mini53.z.enum(rulesProcessorToolTargets);
14852
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path113.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15084
+ var RulesProcessorToolTargetSchema = import_mini54.z.enum(rulesProcessorToolTargets);
15085
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path114.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14853
15086
  var toolRuleFactories = /* @__PURE__ */ new Map([
14854
15087
  [
14855
15088
  "agentsmd",
@@ -15224,7 +15457,7 @@ var RulesProcessor = class extends FeatureProcessor {
15224
15457
  }).relativeDirPath;
15225
15458
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
15226
15459
  const frontmatter = skill.getFrontmatter();
15227
- const relativePath = (0, import_node_path113.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15460
+ const relativePath = (0, import_node_path114.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15228
15461
  return {
15229
15462
  name: frontmatter.name,
15230
15463
  description: frontmatter.description,
@@ -15337,12 +15570,12 @@ var RulesProcessor = class extends FeatureProcessor {
15337
15570
  * Load and parse rulesync rule files from .rulesync/rules/ directory
15338
15571
  */
15339
15572
  async loadRulesyncFiles() {
15340
- const rulesyncBaseDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15341
- const files = await findFilesByGlobs((0, import_node_path113.join)(rulesyncBaseDir, "**", "*.md"));
15573
+ const rulesyncBaseDir = (0, import_node_path114.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15574
+ const files = await findFilesByGlobs((0, import_node_path114.join)(rulesyncBaseDir, "**", "*.md"));
15342
15575
  logger.debug(`Found ${files.length} rulesync files`);
15343
15576
  const rulesyncRules = await Promise.all(
15344
15577
  files.map((file) => {
15345
- const relativeFilePath = (0, import_node_path113.relative)(rulesyncBaseDir, file);
15578
+ const relativeFilePath = (0, import_node_path114.relative)(rulesyncBaseDir, file);
15346
15579
  checkPathTraversal({
15347
15580
  relativePath: relativeFilePath,
15348
15581
  intendedRootDir: rulesyncBaseDir
@@ -15405,7 +15638,7 @@ var RulesProcessor = class extends FeatureProcessor {
15405
15638
  return [];
15406
15639
  }
15407
15640
  const rootFilePaths = await findFilesByGlobs(
15408
- (0, import_node_path113.join)(
15641
+ (0, import_node_path114.join)(
15409
15642
  this.baseDir,
15410
15643
  settablePaths.root.relativeDirPath ?? ".",
15411
15644
  settablePaths.root.relativeFilePath
@@ -15416,7 +15649,7 @@ var RulesProcessor = class extends FeatureProcessor {
15416
15649
  (filePath) => factory.class.forDeletion({
15417
15650
  baseDir: this.baseDir,
15418
15651
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15419
- relativeFilePath: (0, import_node_path113.basename)(filePath),
15652
+ relativeFilePath: (0, import_node_path114.basename)(filePath),
15420
15653
  global: this.global
15421
15654
  })
15422
15655
  ).filter((rule) => rule.isDeletable());
@@ -15425,7 +15658,7 @@ var RulesProcessor = class extends FeatureProcessor {
15425
15658
  rootFilePaths.map(
15426
15659
  (filePath) => factory.class.fromFile({
15427
15660
  baseDir: this.baseDir,
15428
- relativeFilePath: (0, import_node_path113.basename)(filePath),
15661
+ relativeFilePath: (0, import_node_path114.basename)(filePath),
15429
15662
  global: this.global
15430
15663
  })
15431
15664
  )
@@ -15443,13 +15676,13 @@ var RulesProcessor = class extends FeatureProcessor {
15443
15676
  return [];
15444
15677
  }
15445
15678
  const localRootFilePaths = await findFilesByGlobs(
15446
- (0, import_node_path113.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15679
+ (0, import_node_path114.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15447
15680
  );
15448
15681
  return localRootFilePaths.map(
15449
15682
  (filePath) => factory.class.forDeletion({
15450
15683
  baseDir: this.baseDir,
15451
15684
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
15452
- relativeFilePath: (0, import_node_path113.basename)(filePath),
15685
+ relativeFilePath: (0, import_node_path114.basename)(filePath),
15453
15686
  global: this.global
15454
15687
  })
15455
15688
  ).filter((rule) => rule.isDeletable());
@@ -15459,13 +15692,13 @@ var RulesProcessor = class extends FeatureProcessor {
15459
15692
  if (!settablePaths.nonRoot) {
15460
15693
  return [];
15461
15694
  }
15462
- const nonRootBaseDir = (0, import_node_path113.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15695
+ const nonRootBaseDir = (0, import_node_path114.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15463
15696
  const nonRootFilePaths = await findFilesByGlobs(
15464
- (0, import_node_path113.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15697
+ (0, import_node_path114.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15465
15698
  );
15466
15699
  if (forDeletion) {
15467
15700
  return nonRootFilePaths.map((filePath) => {
15468
- const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15701
+ const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
15469
15702
  checkPathTraversal({
15470
15703
  relativePath: relativeFilePath,
15471
15704
  intendedRootDir: nonRootBaseDir
@@ -15480,7 +15713,7 @@ var RulesProcessor = class extends FeatureProcessor {
15480
15713
  }
15481
15714
  return await Promise.all(
15482
15715
  nonRootFilePaths.map((filePath) => {
15483
- const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
15716
+ const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
15484
15717
  checkPathTraversal({
15485
15718
  relativePath: relativeFilePath,
15486
15719
  intendedRootDir: nonRootBaseDir
@@ -15593,14 +15826,14 @@ s/<command> [arguments]
15593
15826
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15594
15827
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15595
15828
 
15596
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15829
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15597
15830
  const subagentsSection = subagents ? `## Simulated Subagents
15598
15831
 
15599
15832
  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.
15600
15833
 
15601
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15834
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15602
15835
 
15603
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15836
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15604
15837
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15605
15838
  const result = [
15606
15839
  overview,
@@ -15671,8 +15904,16 @@ async function processEmptyFeatureGeneration(params) {
15671
15904
  }
15672
15905
  return { count: totalCount, paths: [], hasDiff };
15673
15906
  }
15907
+ function warnUnsupportedTargets(params) {
15908
+ const { config, supportedTargets, featureName } = params;
15909
+ for (const target of config.getTargets()) {
15910
+ if (!supportedTargets.includes(target) && config.getFeatures(target).includes(featureName)) {
15911
+ logger.warn(`Target '${target}' does not support the feature '${featureName}'. Skipping.`);
15912
+ }
15913
+ }
15914
+ }
15674
15915
  async function checkRulesyncDirExists(params) {
15675
- return fileExists((0, import_node_path114.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15916
+ return fileExists((0, import_node_path115.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15676
15917
  }
15677
15918
  async function generate(params) {
15678
15919
  const { config } = params;
@@ -15708,10 +15949,9 @@ async function generateRulesCore(params) {
15708
15949
  let totalCount = 0;
15709
15950
  const allPaths = [];
15710
15951
  let hasDiff = false;
15711
- const toolTargets = (0, import_es_toolkit4.intersection)(
15712
- config.getTargets(),
15713
- RulesProcessor.getToolTargets({ global: config.getGlobal() })
15714
- );
15952
+ const supportedTargets = RulesProcessor.getToolTargets({ global: config.getGlobal() });
15953
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedTargets);
15954
+ warnUnsupportedTargets({ config, supportedTargets, featureName: "rules" });
15715
15955
  for (const baseDir of config.getBaseDirs()) {
15716
15956
  for (const toolTarget of toolTargets) {
15717
15957
  if (!config.getFeatures(toolTarget).includes("rules")) {
@@ -15743,13 +15983,19 @@ async function generateRulesCore(params) {
15743
15983
  }
15744
15984
  async function generateIgnoreCore(params) {
15745
15985
  const { config } = params;
15986
+ const supportedIgnoreTargets = IgnoreProcessor.getToolTargets();
15987
+ warnUnsupportedTargets({
15988
+ config,
15989
+ supportedTargets: supportedIgnoreTargets,
15990
+ featureName: "ignore"
15991
+ });
15746
15992
  if (config.getGlobal()) {
15747
15993
  return { count: 0, paths: [], hasDiff: false };
15748
15994
  }
15749
15995
  let totalCount = 0;
15750
15996
  const allPaths = [];
15751
15997
  let hasDiff = false;
15752
- for (const toolTarget of (0, import_es_toolkit4.intersection)(config.getTargets(), IgnoreProcessor.getToolTargets())) {
15998
+ for (const toolTarget of (0, import_es_toolkit4.intersection)(config.getTargets(), supportedIgnoreTargets)) {
15753
15999
  if (!config.getFeatures(toolTarget).includes("ignore")) {
15754
16000
  continue;
15755
16001
  }
@@ -15793,10 +16039,9 @@ async function generateMcpCore(params) {
15793
16039
  let totalCount = 0;
15794
16040
  const allPaths = [];
15795
16041
  let hasDiff = false;
15796
- const toolTargets = (0, import_es_toolkit4.intersection)(
15797
- config.getTargets(),
15798
- McpProcessor.getToolTargets({ global: config.getGlobal() })
15799
- );
16042
+ const supportedMcpTargets = McpProcessor.getToolTargets({ global: config.getGlobal() });
16043
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedMcpTargets);
16044
+ warnUnsupportedTargets({ config, supportedTargets: supportedMcpTargets, featureName: "mcp" });
15800
16045
  for (const baseDir of config.getBaseDirs()) {
15801
16046
  for (const toolTarget of toolTargets) {
15802
16047
  if (!config.getFeatures(toolTarget).includes("mcp")) {
@@ -15827,13 +16072,16 @@ async function generateCommandsCore(params) {
15827
16072
  let totalCount = 0;
15828
16073
  const allPaths = [];
15829
16074
  let hasDiff = false;
15830
- const toolTargets = (0, import_es_toolkit4.intersection)(
15831
- config.getTargets(),
15832
- CommandsProcessor.getToolTargets({
15833
- global: config.getGlobal(),
15834
- includeSimulated: config.getSimulateCommands()
15835
- })
15836
- );
16075
+ const supportedCommandsTargets = CommandsProcessor.getToolTargets({
16076
+ global: config.getGlobal(),
16077
+ includeSimulated: config.getSimulateCommands()
16078
+ });
16079
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedCommandsTargets);
16080
+ warnUnsupportedTargets({
16081
+ config,
16082
+ supportedTargets: supportedCommandsTargets,
16083
+ featureName: "commands"
16084
+ });
15837
16085
  for (const baseDir of config.getBaseDirs()) {
15838
16086
  for (const toolTarget of toolTargets) {
15839
16087
  if (!config.getFeatures(toolTarget).includes("commands")) {
@@ -15864,13 +16112,16 @@ async function generateSubagentsCore(params) {
15864
16112
  let totalCount = 0;
15865
16113
  const allPaths = [];
15866
16114
  let hasDiff = false;
15867
- const toolTargets = (0, import_es_toolkit4.intersection)(
15868
- config.getTargets(),
15869
- SubagentsProcessor.getToolTargets({
15870
- global: config.getGlobal(),
15871
- includeSimulated: config.getSimulateSubagents()
15872
- })
15873
- );
16115
+ const supportedSubagentsTargets = SubagentsProcessor.getToolTargets({
16116
+ global: config.getGlobal(),
16117
+ includeSimulated: config.getSimulateSubagents()
16118
+ });
16119
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedSubagentsTargets);
16120
+ warnUnsupportedTargets({
16121
+ config,
16122
+ supportedTargets: supportedSubagentsTargets,
16123
+ featureName: "subagents"
16124
+ });
15874
16125
  for (const baseDir of config.getBaseDirs()) {
15875
16126
  for (const toolTarget of toolTargets) {
15876
16127
  if (!config.getFeatures(toolTarget).includes("subagents")) {
@@ -15902,13 +16153,16 @@ async function generateSkillsCore(params) {
15902
16153
  const allPaths = [];
15903
16154
  let hasDiff = false;
15904
16155
  const allSkills = [];
15905
- const toolTargets = (0, import_es_toolkit4.intersection)(
15906
- config.getTargets(),
15907
- SkillsProcessor.getToolTargets({
15908
- global: config.getGlobal(),
15909
- includeSimulated: config.getSimulateSkills()
15910
- })
15911
- );
16156
+ const supportedSkillsTargets = SkillsProcessor.getToolTargets({
16157
+ global: config.getGlobal(),
16158
+ includeSimulated: config.getSimulateSkills()
16159
+ });
16160
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedSkillsTargets);
16161
+ warnUnsupportedTargets({
16162
+ config,
16163
+ supportedTargets: supportedSkillsTargets,
16164
+ featureName: "skills"
16165
+ });
15912
16166
  for (const baseDir of config.getBaseDirs()) {
15913
16167
  for (const toolTarget of toolTargets) {
15914
16168
  if (!config.getFeatures(toolTarget).includes("skills")) {
@@ -15944,10 +16198,9 @@ async function generateHooksCore(params) {
15944
16198
  let totalCount = 0;
15945
16199
  const allPaths = [];
15946
16200
  let hasDiff = false;
15947
- const toolTargets = (0, import_es_toolkit4.intersection)(
15948
- config.getTargets(),
15949
- HooksProcessor.getToolTargets({ global: config.getGlobal() })
15950
- );
16201
+ const supportedHooksTargets = HooksProcessor.getToolTargets({ global: config.getGlobal() });
16202
+ const toolTargets = (0, import_es_toolkit4.intersection)(config.getTargets(), supportedHooksTargets);
16203
+ warnUnsupportedTargets({ config, supportedTargets: supportedHooksTargets, featureName: "hooks" });
15951
16204
  for (const baseDir of config.getBaseDirs()) {
15952
16205
  for (const toolTarget of toolTargets) {
15953
16206
  if (!config.getFeatures(toolTarget).includes("hooks")) {
@@ -16019,6 +16272,7 @@ async function importRulesCore(params) {
16019
16272
  });
16020
16273
  const toolFiles = await rulesProcessor.loadToolFiles();
16021
16274
  if (toolFiles.length === 0) {
16275
+ logger.warn(`No rule files found for ${tool}. Skipping import.`);
16022
16276
  return 0;
16023
16277
  }
16024
16278
  const rulesyncFiles = await rulesProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16046,6 +16300,7 @@ async function importIgnoreCore(params) {
16046
16300
  });
16047
16301
  const toolFiles = await ignoreProcessor.loadToolFiles();
16048
16302
  if (toolFiles.length === 0) {
16303
+ logger.warn(`No ignore files found for ${tool}. Skipping import.`);
16049
16304
  return 0;
16050
16305
  }
16051
16306
  const rulesyncFiles = await ignoreProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16075,6 +16330,7 @@ async function importMcpCore(params) {
16075
16330
  });
16076
16331
  const toolFiles = await mcpProcessor.loadToolFiles();
16077
16332
  if (toolFiles.length === 0) {
16333
+ logger.warn(`No MCP files found for ${tool}. Skipping import.`);
16078
16334
  return 0;
16079
16335
  }
16080
16336
  const rulesyncFiles = await mcpProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16101,6 +16357,7 @@ async function importCommandsCore(params) {
16101
16357
  });
16102
16358
  const toolFiles = await commandsProcessor.loadToolFiles();
16103
16359
  if (toolFiles.length === 0) {
16360
+ logger.warn(`No command files found for ${tool}. Skipping import.`);
16104
16361
  return 0;
16105
16362
  }
16106
16363
  const rulesyncFiles = await commandsProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16127,6 +16384,7 @@ async function importSubagentsCore(params) {
16127
16384
  });
16128
16385
  const toolFiles = await subagentsProcessor.loadToolFiles();
16129
16386
  if (toolFiles.length === 0) {
16387
+ logger.warn(`No subagent files found for ${tool}. Skipping import.`);
16130
16388
  return 0;
16131
16389
  }
16132
16390
  const rulesyncFiles = await subagentsProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16153,6 +16411,7 @@ async function importSkillsCore(params) {
16153
16411
  });
16154
16412
  const toolDirs = await skillsProcessor.loadToolDirs();
16155
16413
  if (toolDirs.length === 0) {
16414
+ logger.warn(`No skill directories found for ${tool}. Skipping import.`);
16156
16415
  return 0;
16157
16416
  }
16158
16417
  const rulesyncDirs = await skillsProcessor.convertToolDirsToRulesyncDirs(toolDirs);
@@ -16184,6 +16443,7 @@ async function importHooksCore(params) {
16184
16443
  });
16185
16444
  const toolFiles = await hooksProcessor.loadToolFiles();
16186
16445
  if (toolFiles.length === 0) {
16446
+ logger.warn(`No hooks files found for ${tool}. Skipping import.`);
16187
16447
  return 0;
16188
16448
  }
16189
16449
  const rulesyncFiles = await hooksProcessor.convertToolFilesToRulesyncFiles(toolFiles);