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.
@@ -606,7 +606,7 @@ function getBaseDirsInLightOfGlobal({
606
606
  }
607
607
 
608
608
  // src/lib/generate.ts
609
- import { join as join113 } from "path";
609
+ import { join as join114 } from "path";
610
610
  import { intersection } from "es-toolkit";
611
611
 
612
612
  // src/features/commands/commands-processor.ts
@@ -731,10 +731,9 @@ function parseFrontmatter(content, filePath) {
731
731
  body = result.content;
732
732
  } catch (error) {
733
733
  if (filePath) {
734
- throw new Error(
735
- `Failed to parse frontmatter in ${filePath}: ${error instanceof Error ? error.message : String(error)}`,
736
- { cause: error }
737
- );
734
+ throw new Error(`Failed to parse frontmatter in ${filePath}: ${formatError(error)}`, {
735
+ cause: error
736
+ });
738
737
  }
739
738
  throw error;
740
739
  }
@@ -2991,7 +2990,7 @@ var CommandsProcessor = class extends FeatureProcessor {
2991
2990
  };
2992
2991
 
2993
2992
  // src/features/hooks/hooks-processor.ts
2994
- import { z as z16 } from "zod/mini";
2993
+ import { z as z17 } from "zod/mini";
2995
2994
 
2996
2995
  // src/types/hooks.ts
2997
2996
  import { z as z14 } from "zod/mini";
@@ -3010,7 +3009,9 @@ var HookDefinitionSchema = z14.looseObject({
3010
3009
  timeout: z14.optional(z14.number()),
3011
3010
  matcher: z14.optional(safeString),
3012
3011
  prompt: z14.optional(z14.string()),
3013
- loop_limit: z14.optional(z14.nullable(z14.number()))
3012
+ loop_limit: z14.optional(z14.nullable(z14.number())),
3013
+ name: z14.optional(safeString),
3014
+ description: z14.optional(safeString)
3014
3015
  });
3015
3016
  var CURSOR_HOOK_EVENTS = [
3016
3017
  "sessionStart",
@@ -3077,6 +3078,19 @@ var FACTORYDROID_HOOK_EVENTS = [
3077
3078
  "notification",
3078
3079
  "setup"
3079
3080
  ];
3081
+ var GEMINICLI_HOOK_EVENTS = [
3082
+ "sessionStart",
3083
+ "sessionEnd",
3084
+ "beforeSubmitPrompt",
3085
+ "stop",
3086
+ "beforeAgentResponse",
3087
+ "afterAgentResponse",
3088
+ "beforeToolSelection",
3089
+ "preToolUse",
3090
+ "postToolUse",
3091
+ "preCompact",
3092
+ "notification"
3093
+ ];
3080
3094
  var hooksRecordSchema = z14.record(z14.string(), z14.array(HookDefinitionSchema));
3081
3095
  var HooksConfigSchema = z14.looseObject({
3082
3096
  version: z14.optional(z14.number()),
@@ -3085,7 +3099,8 @@ var HooksConfigSchema = z14.looseObject({
3085
3099
  claudecode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
3086
3100
  copilot: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
3087
3101
  opencode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
3088
- factorydroid: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) }))
3102
+ factorydroid: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
3103
+ geminicli: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) }))
3089
3104
  });
3090
3105
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
3091
3106
  sessionStart: "SessionStart",
@@ -3164,6 +3179,22 @@ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
3164
3179
  var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3165
3180
  Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
3166
3181
  );
3182
+ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
3183
+ sessionStart: "SessionStart",
3184
+ sessionEnd: "SessionEnd",
3185
+ beforeSubmitPrompt: "BeforeAgent",
3186
+ stop: "AfterAgent",
3187
+ beforeAgentResponse: "BeforeModel",
3188
+ afterAgentResponse: "AfterModel",
3189
+ beforeToolSelection: "BeforeToolSelection",
3190
+ preToolUse: "BeforeTool",
3191
+ postToolUse: "AfterTool",
3192
+ preCompact: "PreCompress",
3193
+ notification: "Notification"
3194
+ };
3195
+ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3196
+ Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
3197
+ );
3167
3198
 
3168
3199
  // src/features/hooks/claudecode-hooks.ts
3169
3200
  import { join as join21 } from "path";
@@ -3450,6 +3481,7 @@ var CopilotHookEntrySchema = z15.looseObject({
3450
3481
  timeoutSec: z15.optional(z15.number())
3451
3482
  });
3452
3483
  function canonicalToCopilotHooks(config) {
3484
+ const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
3453
3485
  const isWindows = process.platform === "win32";
3454
3486
  const commandField = isWindows ? "powershell" : "bash";
3455
3487
  const supported = new Set(COPILOT_HOOK_EVENTS);
@@ -3474,9 +3506,7 @@ function canonicalToCopilotHooks(config) {
3474
3506
  const command = def.command;
3475
3507
  const timeout = def.timeout;
3476
3508
  const rest = Object.fromEntries(
3477
- Object.entries(def).filter(
3478
- ([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
3479
- )
3509
+ Object.entries(def).filter(([k]) => !canonicalSchemaKeys.includes(k))
3480
3510
  );
3481
3511
  entries.push({
3482
3512
  type: hookType,
@@ -3669,7 +3699,14 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3669
3699
  const mappedHooks = {};
3670
3700
  for (const [eventName, defs] of Object.entries(mergedHooks)) {
3671
3701
  const cursorEventName = CANONICAL_TO_CURSOR_EVENT_NAMES[eventName] ?? eventName;
3672
- mappedHooks[cursorEventName] = defs;
3702
+ mappedHooks[cursorEventName] = defs.map((def) => ({
3703
+ ...def.type !== void 0 && def.type !== null && { type: def.type },
3704
+ ...def.command !== void 0 && def.command !== null && { command: def.command },
3705
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
3706
+ ...def.loop_limit !== void 0 && { loop_limit: def.loop_limit },
3707
+ ...def.matcher !== void 0 && def.matcher !== null && { matcher: def.matcher },
3708
+ ...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
3709
+ }));
3673
3710
  }
3674
3711
  const cursorConfig = {
3675
3712
  version: config.version ?? 1,
@@ -3902,8 +3939,193 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3902
3939
  }
3903
3940
  };
3904
3941
 
3905
- // src/features/hooks/opencode-hooks.ts
3942
+ // src/features/hooks/geminicli-hooks.ts
3906
3943
  import { join as join25 } from "path";
3944
+ import { z as z16 } from "zod/mini";
3945
+ function canonicalToGeminicliHooks(config) {
3946
+ const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
3947
+ const sharedHooks = {};
3948
+ for (const [event, defs] of Object.entries(config.hooks)) {
3949
+ if (geminiSupported.has(event)) {
3950
+ sharedHooks[event] = defs;
3951
+ }
3952
+ }
3953
+ const effectiveHooks = {
3954
+ ...sharedHooks,
3955
+ ...config.geminicli?.hooks
3956
+ };
3957
+ const gemini = {};
3958
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3959
+ const geminiEventName = CANONICAL_TO_GEMINICLI_EVENT_NAMES[eventName] ?? eventName;
3960
+ const byMatcher = /* @__PURE__ */ new Map();
3961
+ for (const def of definitions) {
3962
+ const key = def.matcher ?? "";
3963
+ const list = byMatcher.get(key);
3964
+ if (list) list.push(def);
3965
+ else byMatcher.set(key, [def]);
3966
+ }
3967
+ const entries = [];
3968
+ for (const [matcherKey, defs] of byMatcher) {
3969
+ const hooks = defs.map((def) => {
3970
+ const command = def.command !== void 0 && def.command !== null && !def.command.startsWith("$") ? `$GEMINI_PROJECT_DIR/${def.command.replace(/^\.\//, "")}` : def.command;
3971
+ return {
3972
+ type: def.type ?? "command",
3973
+ ...command !== void 0 && command !== null && { command },
3974
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
3975
+ ...def.name !== void 0 && def.name !== null && { name: def.name },
3976
+ ...def.description !== void 0 && def.description !== null && { description: def.description }
3977
+ };
3978
+ });
3979
+ entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
3980
+ }
3981
+ gemini[geminiEventName] = entries;
3982
+ }
3983
+ return gemini;
3984
+ }
3985
+ var GeminiHookEntrySchema = z16.looseObject({
3986
+ type: z16.optional(z16.string()),
3987
+ command: z16.optional(z16.string()),
3988
+ timeout: z16.optional(z16.number()),
3989
+ name: z16.optional(z16.string()),
3990
+ description: z16.optional(z16.string())
3991
+ });
3992
+ var GeminiMatcherEntrySchema = z16.looseObject({
3993
+ matcher: z16.optional(z16.string()),
3994
+ hooks: z16.optional(z16.array(GeminiHookEntrySchema))
3995
+ });
3996
+ function geminiHooksToCanonical(geminiHooks) {
3997
+ if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
3998
+ return {};
3999
+ }
4000
+ const canonical = {};
4001
+ for (const [geminiEventName, matcherEntries] of Object.entries(geminiHooks)) {
4002
+ const eventName = GEMINICLI_TO_CANONICAL_EVENT_NAMES[geminiEventName] ?? geminiEventName;
4003
+ if (!Array.isArray(matcherEntries)) continue;
4004
+ const defs = [];
4005
+ for (const rawEntry of matcherEntries) {
4006
+ const parseResult = GeminiMatcherEntrySchema.safeParse(rawEntry);
4007
+ if (!parseResult.success) continue;
4008
+ const entry = parseResult.data;
4009
+ const hooks = entry.hooks ?? [];
4010
+ for (const h of hooks) {
4011
+ const cmd = h.command;
4012
+ const command = typeof cmd === "string" && cmd.startsWith("$GEMINI_PROJECT_DIR/") ? cmd.replace(/^\$GEMINI_PROJECT_DIR\/?/, "./") : cmd;
4013
+ const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
4014
+ defs.push({
4015
+ type: hookType,
4016
+ ...command !== void 0 && command !== null && { command },
4017
+ ...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
4018
+ ...h.name !== void 0 && h.name !== null && { name: h.name },
4019
+ ...h.description !== void 0 && h.description !== null && { description: h.description },
4020
+ ...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
4021
+ });
4022
+ }
4023
+ }
4024
+ if (defs.length > 0) {
4025
+ canonical[eventName] = defs;
4026
+ }
4027
+ }
4028
+ return canonical;
4029
+ }
4030
+ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4031
+ constructor(params) {
4032
+ super({
4033
+ ...params,
4034
+ fileContent: params.fileContent ?? "{}"
4035
+ });
4036
+ }
4037
+ isDeletable() {
4038
+ return false;
4039
+ }
4040
+ static getSettablePaths(_options = {}) {
4041
+ return { relativeDirPath: ".gemini", relativeFilePath: "settings.json" };
4042
+ }
4043
+ static async fromFile({
4044
+ baseDir = process.cwd(),
4045
+ validate = true,
4046
+ global = false
4047
+ }) {
4048
+ const paths = _GeminicliHooks.getSettablePaths({ global });
4049
+ const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4050
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4051
+ return new _GeminicliHooks({
4052
+ baseDir,
4053
+ relativeDirPath: paths.relativeDirPath,
4054
+ relativeFilePath: paths.relativeFilePath,
4055
+ fileContent,
4056
+ validate
4057
+ });
4058
+ }
4059
+ static async fromRulesyncHooks({
4060
+ baseDir = process.cwd(),
4061
+ rulesyncHooks,
4062
+ validate = true,
4063
+ global = false
4064
+ }) {
4065
+ const paths = _GeminicliHooks.getSettablePaths({ global });
4066
+ const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4067
+ const existingContent = await readOrInitializeFileContent(
4068
+ filePath,
4069
+ JSON.stringify({}, null, 2)
4070
+ );
4071
+ let settings;
4072
+ try {
4073
+ settings = JSON.parse(existingContent);
4074
+ } catch (error) {
4075
+ throw new Error(
4076
+ `Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(error)}`,
4077
+ { cause: error }
4078
+ );
4079
+ }
4080
+ const config = rulesyncHooks.getJson();
4081
+ const geminiHooks = canonicalToGeminicliHooks(config);
4082
+ const merged = { ...settings, hooks: geminiHooks };
4083
+ const fileContent = JSON.stringify(merged, null, 2);
4084
+ return new _GeminicliHooks({
4085
+ baseDir,
4086
+ relativeDirPath: paths.relativeDirPath,
4087
+ relativeFilePath: paths.relativeFilePath,
4088
+ fileContent,
4089
+ validate
4090
+ });
4091
+ }
4092
+ toRulesyncHooks() {
4093
+ let settings;
4094
+ try {
4095
+ settings = JSON.parse(this.getFileContent());
4096
+ } catch (error) {
4097
+ throw new Error(
4098
+ `Failed to parse Gemini CLI hooks content in ${join25(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4099
+ {
4100
+ cause: error
4101
+ }
4102
+ );
4103
+ }
4104
+ const hooks = geminiHooksToCanonical(settings.hooks);
4105
+ return this.toRulesyncHooksDefault({
4106
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
4107
+ });
4108
+ }
4109
+ validate() {
4110
+ return { success: true, error: null };
4111
+ }
4112
+ static forDeletion({
4113
+ baseDir = process.cwd(),
4114
+ relativeDirPath,
4115
+ relativeFilePath
4116
+ }) {
4117
+ return new _GeminicliHooks({
4118
+ baseDir,
4119
+ relativeDirPath,
4120
+ relativeFilePath,
4121
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
4122
+ validate: false
4123
+ });
4124
+ }
4125
+ };
4126
+
4127
+ // src/features/hooks/opencode-hooks.ts
4128
+ import { join as join26 } from "path";
3907
4129
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
3908
4130
  function escapeForTemplateLiteral(command) {
3909
4131
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -4001,7 +4223,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4001
4223
  }
4002
4224
  static getSettablePaths(options) {
4003
4225
  return {
4004
- relativeDirPath: options?.global ? join25(".config", "opencode", "plugins") : join25(".opencode", "plugins"),
4226
+ relativeDirPath: options?.global ? join26(".config", "opencode", "plugins") : join26(".opencode", "plugins"),
4005
4227
  relativeFilePath: "rulesync-hooks.js"
4006
4228
  };
4007
4229
  }
@@ -4012,7 +4234,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4012
4234
  }) {
4013
4235
  const paths = _OpencodeHooks.getSettablePaths({ global });
4014
4236
  const fileContent = await readFileContent(
4015
- join25(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4237
+ join26(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4016
4238
  );
4017
4239
  return new _OpencodeHooks({
4018
4240
  baseDir,
@@ -4066,9 +4288,10 @@ var hooksProcessorToolTargetTuple = [
4066
4288
  "claudecode",
4067
4289
  "copilot",
4068
4290
  "opencode",
4069
- "factorydroid"
4291
+ "factorydroid",
4292
+ "geminicli"
4070
4293
  ];
4071
- var HooksProcessorToolTargetSchema = z16.enum(hooksProcessorToolTargetTuple);
4294
+ var HooksProcessorToolTargetSchema = z17.enum(hooksProcessorToolTargetTuple);
4072
4295
  var toolHooksFactories = /* @__PURE__ */ new Map([
4073
4296
  [
4074
4297
  "cursor",
@@ -4139,6 +4362,16 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
4139
4362
  supportedHookTypes: ["command", "prompt"],
4140
4363
  supportsMatcher: true
4141
4364
  }
4365
+ ],
4366
+ [
4367
+ "geminicli",
4368
+ {
4369
+ class: GeminicliHooks,
4370
+ meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
4371
+ supportedEvents: GEMINICLI_HOOK_EVENTS,
4372
+ supportedHookTypes: ["command"],
4373
+ supportsMatcher: true
4374
+ }
4142
4375
  ]
4143
4376
  ]);
4144
4377
  var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
@@ -4293,13 +4526,13 @@ var HooksProcessor = class extends FeatureProcessor {
4293
4526
  };
4294
4527
 
4295
4528
  // src/features/ignore/ignore-processor.ts
4296
- import { z as z17 } from "zod/mini";
4529
+ import { z as z18 } from "zod/mini";
4297
4530
 
4298
4531
  // src/features/ignore/augmentcode-ignore.ts
4299
- import { join as join27 } from "path";
4532
+ import { join as join28 } from "path";
4300
4533
 
4301
4534
  // src/features/ignore/rulesync-ignore.ts
4302
- import { join as join26 } from "path";
4535
+ import { join as join27 } from "path";
4303
4536
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4304
4537
  validate() {
4305
4538
  return { success: true, error: null };
@@ -4319,12 +4552,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4319
4552
  static async fromFile() {
4320
4553
  const baseDir = process.cwd();
4321
4554
  const paths = this.getSettablePaths();
4322
- const recommendedPath = join26(
4555
+ const recommendedPath = join27(
4323
4556
  baseDir,
4324
4557
  paths.recommended.relativeDirPath,
4325
4558
  paths.recommended.relativeFilePath
4326
4559
  );
4327
- const legacyPath = join26(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4560
+ const legacyPath = join27(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4328
4561
  if (await fileExists(recommendedPath)) {
4329
4562
  const fileContent2 = await readFileContent(recommendedPath);
4330
4563
  return new _RulesyncIgnore({
@@ -4440,7 +4673,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4440
4673
  validate = true
4441
4674
  }) {
4442
4675
  const fileContent = await readFileContent(
4443
- join27(
4676
+ join28(
4444
4677
  baseDir,
4445
4678
  this.getSettablePaths().relativeDirPath,
4446
4679
  this.getSettablePaths().relativeFilePath
@@ -4470,7 +4703,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4470
4703
  };
4471
4704
 
4472
4705
  // src/features/ignore/claudecode-ignore.ts
4473
- import { join as join28 } from "path";
4706
+ import { join as join29 } from "path";
4474
4707
  import { uniq } from "es-toolkit";
4475
4708
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4476
4709
  constructor(params) {
@@ -4513,7 +4746,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4513
4746
  const fileContent = rulesyncIgnore.getFileContent();
4514
4747
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4515
4748
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4516
- const filePath = join28(
4749
+ const filePath = join29(
4517
4750
  baseDir,
4518
4751
  this.getSettablePaths().relativeDirPath,
4519
4752
  this.getSettablePaths().relativeFilePath
@@ -4549,7 +4782,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4549
4782
  validate = true
4550
4783
  }) {
4551
4784
  const fileContent = await readFileContent(
4552
- join28(
4785
+ join29(
4553
4786
  baseDir,
4554
4787
  this.getSettablePaths().relativeDirPath,
4555
4788
  this.getSettablePaths().relativeFilePath
@@ -4579,7 +4812,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4579
4812
  };
4580
4813
 
4581
4814
  // src/features/ignore/cline-ignore.ts
4582
- import { join as join29 } from "path";
4815
+ import { join as join30 } from "path";
4583
4816
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4584
4817
  static getSettablePaths() {
4585
4818
  return {
@@ -4616,7 +4849,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4616
4849
  validate = true
4617
4850
  }) {
4618
4851
  const fileContent = await readFileContent(
4619
- join29(
4852
+ join30(
4620
4853
  baseDir,
4621
4854
  this.getSettablePaths().relativeDirPath,
4622
4855
  this.getSettablePaths().relativeFilePath
@@ -4646,7 +4879,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4646
4879
  };
4647
4880
 
4648
4881
  // src/features/ignore/cursor-ignore.ts
4649
- import { join as join30 } from "path";
4882
+ import { join as join31 } from "path";
4650
4883
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4651
4884
  static getSettablePaths() {
4652
4885
  return {
@@ -4679,7 +4912,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4679
4912
  validate = true
4680
4913
  }) {
4681
4914
  const fileContent = await readFileContent(
4682
- join30(
4915
+ join31(
4683
4916
  baseDir,
4684
4917
  this.getSettablePaths().relativeDirPath,
4685
4918
  this.getSettablePaths().relativeFilePath
@@ -4709,7 +4942,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4709
4942
  };
4710
4943
 
4711
4944
  // src/features/ignore/geminicli-ignore.ts
4712
- import { join as join31 } from "path";
4945
+ import { join as join32 } from "path";
4713
4946
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4714
4947
  static getSettablePaths() {
4715
4948
  return {
@@ -4736,7 +4969,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4736
4969
  validate = true
4737
4970
  }) {
4738
4971
  const fileContent = await readFileContent(
4739
- join31(
4972
+ join32(
4740
4973
  baseDir,
4741
4974
  this.getSettablePaths().relativeDirPath,
4742
4975
  this.getSettablePaths().relativeFilePath
@@ -4766,7 +4999,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4766
4999
  };
4767
5000
 
4768
5001
  // src/features/ignore/goose-ignore.ts
4769
- import { join as join32 } from "path";
5002
+ import { join as join33 } from "path";
4770
5003
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4771
5004
  static getSettablePaths() {
4772
5005
  return {
@@ -4803,7 +5036,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4803
5036
  validate = true
4804
5037
  }) {
4805
5038
  const fileContent = await readFileContent(
4806
- join32(
5039
+ join33(
4807
5040
  baseDir,
4808
5041
  this.getSettablePaths().relativeDirPath,
4809
5042
  this.getSettablePaths().relativeFilePath
@@ -4833,7 +5066,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4833
5066
  };
4834
5067
 
4835
5068
  // src/features/ignore/junie-ignore.ts
4836
- import { join as join33 } from "path";
5069
+ import { join as join34 } from "path";
4837
5070
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4838
5071
  static getSettablePaths() {
4839
5072
  return {
@@ -4860,7 +5093,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4860
5093
  validate = true
4861
5094
  }) {
4862
5095
  const fileContent = await readFileContent(
4863
- join33(
5096
+ join34(
4864
5097
  baseDir,
4865
5098
  this.getSettablePaths().relativeDirPath,
4866
5099
  this.getSettablePaths().relativeFilePath
@@ -4890,7 +5123,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4890
5123
  };
4891
5124
 
4892
5125
  // src/features/ignore/kilo-ignore.ts
4893
- import { join as join34 } from "path";
5126
+ import { join as join35 } from "path";
4894
5127
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4895
5128
  static getSettablePaths() {
4896
5129
  return {
@@ -4927,7 +5160,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4927
5160
  validate = true
4928
5161
  }) {
4929
5162
  const fileContent = await readFileContent(
4930
- join34(
5163
+ join35(
4931
5164
  baseDir,
4932
5165
  this.getSettablePaths().relativeDirPath,
4933
5166
  this.getSettablePaths().relativeFilePath
@@ -4957,7 +5190,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4957
5190
  };
4958
5191
 
4959
5192
  // src/features/ignore/kiro-ignore.ts
4960
- import { join as join35 } from "path";
5193
+ import { join as join36 } from "path";
4961
5194
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4962
5195
  static getSettablePaths() {
4963
5196
  return {
@@ -4984,7 +5217,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4984
5217
  validate = true
4985
5218
  }) {
4986
5219
  const fileContent = await readFileContent(
4987
- join35(
5220
+ join36(
4988
5221
  baseDir,
4989
5222
  this.getSettablePaths().relativeDirPath,
4990
5223
  this.getSettablePaths().relativeFilePath
@@ -5014,7 +5247,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5014
5247
  };
5015
5248
 
5016
5249
  // src/features/ignore/qwencode-ignore.ts
5017
- import { join as join36 } from "path";
5250
+ import { join as join37 } from "path";
5018
5251
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5019
5252
  static getSettablePaths() {
5020
5253
  return {
@@ -5041,7 +5274,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5041
5274
  validate = true
5042
5275
  }) {
5043
5276
  const fileContent = await readFileContent(
5044
- join36(
5277
+ join37(
5045
5278
  baseDir,
5046
5279
  this.getSettablePaths().relativeDirPath,
5047
5280
  this.getSettablePaths().relativeFilePath
@@ -5071,7 +5304,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5071
5304
  };
5072
5305
 
5073
5306
  // src/features/ignore/roo-ignore.ts
5074
- import { join as join37 } from "path";
5307
+ import { join as join38 } from "path";
5075
5308
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5076
5309
  static getSettablePaths() {
5077
5310
  return {
@@ -5098,7 +5331,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5098
5331
  validate = true
5099
5332
  }) {
5100
5333
  const fileContent = await readFileContent(
5101
- join37(
5334
+ join38(
5102
5335
  baseDir,
5103
5336
  this.getSettablePaths().relativeDirPath,
5104
5337
  this.getSettablePaths().relativeFilePath
@@ -5128,7 +5361,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5128
5361
  };
5129
5362
 
5130
5363
  // src/features/ignore/windsurf-ignore.ts
5131
- import { join as join38 } from "path";
5364
+ import { join as join39 } from "path";
5132
5365
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5133
5366
  static getSettablePaths() {
5134
5367
  return {
@@ -5155,7 +5388,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5155
5388
  validate = true
5156
5389
  }) {
5157
5390
  const fileContent = await readFileContent(
5158
- join38(
5391
+ join39(
5159
5392
  baseDir,
5160
5393
  this.getSettablePaths().relativeDirPath,
5161
5394
  this.getSettablePaths().relativeFilePath
@@ -5185,7 +5418,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5185
5418
  };
5186
5419
 
5187
5420
  // src/features/ignore/zed-ignore.ts
5188
- import { join as join39 } from "path";
5421
+ import { join as join40 } from "path";
5189
5422
  import { uniq as uniq2 } from "es-toolkit";
5190
5423
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5191
5424
  constructor(params) {
@@ -5222,7 +5455,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5222
5455
  }) {
5223
5456
  const fileContent = rulesyncIgnore.getFileContent();
5224
5457
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5225
- const filePath = join39(
5458
+ const filePath = join40(
5226
5459
  baseDir,
5227
5460
  this.getSettablePaths().relativeDirPath,
5228
5461
  this.getSettablePaths().relativeFilePath
@@ -5249,7 +5482,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5249
5482
  validate = true
5250
5483
  }) {
5251
5484
  const fileContent = await readFileContent(
5252
- join39(
5485
+ join40(
5253
5486
  baseDir,
5254
5487
  this.getSettablePaths().relativeDirPath,
5255
5488
  this.getSettablePaths().relativeFilePath
@@ -5295,7 +5528,7 @@ var ignoreProcessorToolTargets = [
5295
5528
  "windsurf",
5296
5529
  "zed"
5297
5530
  ];
5298
- var IgnoreProcessorToolTargetSchema = z17.enum(ignoreProcessorToolTargets);
5531
+ var IgnoreProcessorToolTargetSchema = z18.enum(ignoreProcessorToolTargets);
5299
5532
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
5300
5533
  ["augmentcode", { class: AugmentcodeIgnore }],
5301
5534
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -5433,49 +5666,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
5433
5666
  };
5434
5667
 
5435
5668
  // src/features/mcp/mcp-processor.ts
5436
- import { z as z21 } from "zod/mini";
5669
+ import { z as z22 } from "zod/mini";
5437
5670
 
5438
5671
  // src/features/mcp/claudecode-mcp.ts
5439
- import { join as join41 } from "path";
5672
+ import { join as join42 } from "path";
5440
5673
 
5441
5674
  // src/features/mcp/rulesync-mcp.ts
5442
- import { join as join40 } from "path";
5675
+ import { join as join41 } from "path";
5443
5676
  import { omit } from "es-toolkit/object";
5444
- import { z as z19 } from "zod/mini";
5677
+ import { z as z20 } from "zod/mini";
5445
5678
 
5446
5679
  // src/types/mcp.ts
5447
- import { z as z18 } from "zod/mini";
5448
- var McpServerSchema = z18.object({
5449
- type: z18.optional(z18.enum(["stdio", "sse", "http"])),
5450
- command: z18.optional(z18.union([z18.string(), z18.array(z18.string())])),
5451
- args: z18.optional(z18.array(z18.string())),
5452
- url: z18.optional(z18.string()),
5453
- httpUrl: z18.optional(z18.string()),
5454
- env: z18.optional(z18.record(z18.string(), z18.string())),
5455
- disabled: z18.optional(z18.boolean()),
5456
- networkTimeout: z18.optional(z18.number()),
5457
- timeout: z18.optional(z18.number()),
5458
- trust: z18.optional(z18.boolean()),
5459
- cwd: z18.optional(z18.string()),
5460
- transport: z18.optional(z18.enum(["stdio", "sse", "http"])),
5461
- alwaysAllow: z18.optional(z18.array(z18.string())),
5462
- tools: z18.optional(z18.array(z18.string())),
5463
- kiroAutoApprove: z18.optional(z18.array(z18.string())),
5464
- kiroAutoBlock: z18.optional(z18.array(z18.string())),
5465
- headers: z18.optional(z18.record(z18.string(), z18.string())),
5466
- enabledTools: z18.optional(z18.array(z18.string())),
5467
- disabledTools: z18.optional(z18.array(z18.string()))
5680
+ import { z as z19 } from "zod/mini";
5681
+ var McpServerSchema = z19.object({
5682
+ type: z19.optional(z19.enum(["stdio", "sse", "http"])),
5683
+ command: z19.optional(z19.union([z19.string(), z19.array(z19.string())])),
5684
+ args: z19.optional(z19.array(z19.string())),
5685
+ url: z19.optional(z19.string()),
5686
+ httpUrl: z19.optional(z19.string()),
5687
+ env: z19.optional(z19.record(z19.string(), z19.string())),
5688
+ disabled: z19.optional(z19.boolean()),
5689
+ networkTimeout: z19.optional(z19.number()),
5690
+ timeout: z19.optional(z19.number()),
5691
+ trust: z19.optional(z19.boolean()),
5692
+ cwd: z19.optional(z19.string()),
5693
+ transport: z19.optional(z19.enum(["stdio", "sse", "http"])),
5694
+ alwaysAllow: z19.optional(z19.array(z19.string())),
5695
+ tools: z19.optional(z19.array(z19.string())),
5696
+ kiroAutoApprove: z19.optional(z19.array(z19.string())),
5697
+ kiroAutoBlock: z19.optional(z19.array(z19.string())),
5698
+ headers: z19.optional(z19.record(z19.string(), z19.string())),
5699
+ enabledTools: z19.optional(z19.array(z19.string())),
5700
+ disabledTools: z19.optional(z19.array(z19.string()))
5468
5701
  });
5469
- var McpServersSchema = z18.record(z18.string(), McpServerSchema);
5702
+ var McpServersSchema = z19.record(z19.string(), McpServerSchema);
5470
5703
 
5471
5704
  // src/features/mcp/rulesync-mcp.ts
5472
- var RulesyncMcpServerSchema = z19.extend(McpServerSchema, {
5473
- targets: z19.optional(RulesyncTargetsSchema),
5474
- description: z19.optional(z19.string()),
5475
- exposed: z19.optional(z19.boolean())
5705
+ var RulesyncMcpServerSchema = z20.extend(McpServerSchema, {
5706
+ targets: z20.optional(RulesyncTargetsSchema),
5707
+ description: z20.optional(z20.string()),
5708
+ exposed: z20.optional(z20.boolean())
5476
5709
  });
5477
- var RulesyncMcpConfigSchema = z19.object({
5478
- mcpServers: z19.record(z19.string(), RulesyncMcpServerSchema)
5710
+ var RulesyncMcpConfigSchema = z20.object({
5711
+ mcpServers: z20.record(z20.string(), RulesyncMcpServerSchema)
5479
5712
  });
5480
5713
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5481
5714
  json;
@@ -5511,12 +5744,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5511
5744
  static async fromFile({ validate = true }) {
5512
5745
  const baseDir = process.cwd();
5513
5746
  const paths = this.getSettablePaths();
5514
- const recommendedPath = join40(
5747
+ const recommendedPath = join41(
5515
5748
  baseDir,
5516
5749
  paths.recommended.relativeDirPath,
5517
5750
  paths.recommended.relativeFilePath
5518
5751
  );
5519
- const legacyPath = join40(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5752
+ const legacyPath = join41(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5520
5753
  if (await fileExists(recommendedPath)) {
5521
5754
  const fileContent2 = await readFileContent(recommendedPath);
5522
5755
  return new _RulesyncMcp({
@@ -5661,7 +5894,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5661
5894
  global = false
5662
5895
  }) {
5663
5896
  const paths = this.getSettablePaths({ global });
5664
- const fileContent = await readFileContentOrNull(join41(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5897
+ const fileContent = await readFileContentOrNull(join42(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5665
5898
  const json = JSON.parse(fileContent);
5666
5899
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5667
5900
  return new _ClaudecodeMcp({
@@ -5680,7 +5913,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5680
5913
  }) {
5681
5914
  const paths = this.getSettablePaths({ global });
5682
5915
  const fileContent = await readOrInitializeFileContent(
5683
- join41(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5916
+ join42(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5684
5917
  JSON.stringify({ mcpServers: {} }, null, 2)
5685
5918
  );
5686
5919
  const json = JSON.parse(fileContent);
@@ -5719,7 +5952,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5719
5952
  };
5720
5953
 
5721
5954
  // src/features/mcp/cline-mcp.ts
5722
- import { join as join42 } from "path";
5955
+ import { join as join43 } from "path";
5723
5956
  var ClineMcp = class _ClineMcp extends ToolMcp {
5724
5957
  json;
5725
5958
  constructor(params) {
@@ -5740,7 +5973,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5740
5973
  validate = true
5741
5974
  }) {
5742
5975
  const fileContent = await readFileContent(
5743
- join42(
5976
+ join43(
5744
5977
  baseDir,
5745
5978
  this.getSettablePaths().relativeDirPath,
5746
5979
  this.getSettablePaths().relativeFilePath
@@ -5789,7 +6022,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5789
6022
  };
5790
6023
 
5791
6024
  // src/features/mcp/codexcli-mcp.ts
5792
- import { join as join43 } from "path";
6025
+ import { join as join44 } from "path";
5793
6026
  import * as smolToml from "smol-toml";
5794
6027
  function convertFromCodexFormat(codexMcp) {
5795
6028
  const result = {};
@@ -5872,7 +6105,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5872
6105
  global = false
5873
6106
  }) {
5874
6107
  const paths = this.getSettablePaths({ global });
5875
- const fileContent = await readFileContentOrNull(join43(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6108
+ const fileContent = await readFileContentOrNull(join44(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5876
6109
  return new _CodexcliMcp({
5877
6110
  baseDir,
5878
6111
  relativeDirPath: paths.relativeDirPath,
@@ -5888,7 +6121,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5888
6121
  global = false
5889
6122
  }) {
5890
6123
  const paths = this.getSettablePaths({ global });
5891
- const configTomlFilePath = join43(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6124
+ const configTomlFilePath = join44(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5892
6125
  const configTomlFileContent = await readOrInitializeFileContent(
5893
6126
  configTomlFilePath,
5894
6127
  smolToml.stringify({})
@@ -5945,7 +6178,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5945
6178
  };
5946
6179
 
5947
6180
  // src/features/mcp/copilot-mcp.ts
5948
- import { join as join44 } from "path";
6181
+ import { join as join45 } from "path";
5949
6182
  function convertToCopilotFormat(mcpServers) {
5950
6183
  return { servers: mcpServers };
5951
6184
  }
@@ -5972,7 +6205,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5972
6205
  validate = true
5973
6206
  }) {
5974
6207
  const fileContent = await readFileContent(
5975
- join44(
6208
+ join45(
5976
6209
  baseDir,
5977
6210
  this.getSettablePaths().relativeDirPath,
5978
6211
  this.getSettablePaths().relativeFilePath
@@ -6025,7 +6258,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6025
6258
  };
6026
6259
 
6027
6260
  // src/features/mcp/cursor-mcp.ts
6028
- import { join as join45 } from "path";
6261
+ import { join as join46 } from "path";
6029
6262
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
6030
6263
  function isMcpServers(value) {
6031
6264
  return value !== void 0 && value !== null && typeof value === "object";
@@ -6086,7 +6319,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6086
6319
  validate = true
6087
6320
  }) {
6088
6321
  const fileContent = await readFileContent(
6089
- join45(
6322
+ join46(
6090
6323
  baseDir,
6091
6324
  this.getSettablePaths().relativeDirPath,
6092
6325
  this.getSettablePaths().relativeFilePath
@@ -6154,7 +6387,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6154
6387
  };
6155
6388
 
6156
6389
  // src/features/mcp/factorydroid-mcp.ts
6157
- import { join as join46 } from "path";
6390
+ import { join as join47 } from "path";
6158
6391
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6159
6392
  json;
6160
6393
  constructor(params) {
@@ -6175,7 +6408,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6175
6408
  validate = true
6176
6409
  }) {
6177
6410
  const fileContent = await readFileContent(
6178
- join46(
6411
+ join47(
6179
6412
  baseDir,
6180
6413
  this.getSettablePaths().relativeDirPath,
6181
6414
  this.getSettablePaths().relativeFilePath
@@ -6235,7 +6468,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6235
6468
  };
6236
6469
 
6237
6470
  // src/features/mcp/geminicli-mcp.ts
6238
- import { join as join47 } from "path";
6471
+ import { join as join48 } from "path";
6239
6472
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6240
6473
  json;
6241
6474
  constructor(params) {
@@ -6263,7 +6496,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6263
6496
  global = false
6264
6497
  }) {
6265
6498
  const paths = this.getSettablePaths({ global });
6266
- const fileContent = await readFileContentOrNull(join47(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6499
+ const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6267
6500
  const json = JSON.parse(fileContent);
6268
6501
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6269
6502
  return new _GeminiCliMcp({
@@ -6282,7 +6515,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6282
6515
  }) {
6283
6516
  const paths = this.getSettablePaths({ global });
6284
6517
  const fileContent = await readOrInitializeFileContent(
6285
- join47(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6518
+ join48(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6286
6519
  JSON.stringify({ mcpServers: {} }, null, 2)
6287
6520
  );
6288
6521
  const json = JSON.parse(fileContent);
@@ -6327,7 +6560,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6327
6560
  };
6328
6561
 
6329
6562
  // src/features/mcp/junie-mcp.ts
6330
- import { join as join48 } from "path";
6563
+ import { join as join49 } from "path";
6331
6564
  var JunieMcp = class _JunieMcp extends ToolMcp {
6332
6565
  json;
6333
6566
  constructor(params) {
@@ -6339,7 +6572,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6339
6572
  }
6340
6573
  static getSettablePaths() {
6341
6574
  return {
6342
- relativeDirPath: join48(".junie", "mcp"),
6575
+ relativeDirPath: join49(".junie", "mcp"),
6343
6576
  relativeFilePath: "mcp.json"
6344
6577
  };
6345
6578
  }
@@ -6348,7 +6581,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6348
6581
  validate = true
6349
6582
  }) {
6350
6583
  const fileContent = await readFileContent(
6351
- join48(
6584
+ join49(
6352
6585
  baseDir,
6353
6586
  this.getSettablePaths().relativeDirPath,
6354
6587
  this.getSettablePaths().relativeFilePath
@@ -6397,7 +6630,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6397
6630
  };
6398
6631
 
6399
6632
  // src/features/mcp/kilo-mcp.ts
6400
- import { join as join49 } from "path";
6633
+ import { join as join50 } from "path";
6401
6634
  var KiloMcp = class _KiloMcp extends ToolMcp {
6402
6635
  json;
6403
6636
  constructor(params) {
@@ -6418,7 +6651,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6418
6651
  validate = true
6419
6652
  }) {
6420
6653
  const paths = this.getSettablePaths();
6421
- const fileContent = await readFileContentOrNull(join49(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6654
+ const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6422
6655
  return new _KiloMcp({
6423
6656
  baseDir,
6424
6657
  relativeDirPath: paths.relativeDirPath,
@@ -6466,7 +6699,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6466
6699
  };
6467
6700
 
6468
6701
  // src/features/mcp/kiro-mcp.ts
6469
- import { join as join50 } from "path";
6702
+ import { join as join51 } from "path";
6470
6703
  var KiroMcp = class _KiroMcp extends ToolMcp {
6471
6704
  json;
6472
6705
  constructor(params) {
@@ -6478,7 +6711,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6478
6711
  }
6479
6712
  static getSettablePaths() {
6480
6713
  return {
6481
- relativeDirPath: join50(".kiro", "settings"),
6714
+ relativeDirPath: join51(".kiro", "settings"),
6482
6715
  relativeFilePath: "mcp.json"
6483
6716
  };
6484
6717
  }
@@ -6487,7 +6720,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6487
6720
  validate = true
6488
6721
  }) {
6489
6722
  const paths = this.getSettablePaths();
6490
- const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6723
+ const fileContent = await readFileContentOrNull(join51(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6491
6724
  return new _KiroMcp({
6492
6725
  baseDir,
6493
6726
  relativeDirPath: paths.relativeDirPath,
@@ -6535,30 +6768,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6535
6768
  };
6536
6769
 
6537
6770
  // src/features/mcp/opencode-mcp.ts
6538
- import { join as join51 } from "path";
6771
+ import { join as join52 } from "path";
6539
6772
  import { parse as parseJsonc2 } from "jsonc-parser";
6540
- import { z as z20 } from "zod/mini";
6541
- var OpencodeMcpLocalServerSchema = z20.object({
6542
- type: z20.literal("local"),
6543
- command: z20.array(z20.string()),
6544
- environment: z20.optional(z20.record(z20.string(), z20.string())),
6545
- enabled: z20._default(z20.boolean(), true),
6546
- cwd: z20.optional(z20.string())
6773
+ import { z as z21 } from "zod/mini";
6774
+ var OpencodeMcpLocalServerSchema = z21.object({
6775
+ type: z21.literal("local"),
6776
+ command: z21.array(z21.string()),
6777
+ environment: z21.optional(z21.record(z21.string(), z21.string())),
6778
+ enabled: z21._default(z21.boolean(), true),
6779
+ cwd: z21.optional(z21.string())
6547
6780
  });
6548
- var OpencodeMcpRemoteServerSchema = z20.object({
6549
- type: z20.literal("remote"),
6550
- url: z20.string(),
6551
- headers: z20.optional(z20.record(z20.string(), z20.string())),
6552
- enabled: z20._default(z20.boolean(), true)
6781
+ var OpencodeMcpRemoteServerSchema = z21.object({
6782
+ type: z21.literal("remote"),
6783
+ url: z21.string(),
6784
+ headers: z21.optional(z21.record(z21.string(), z21.string())),
6785
+ enabled: z21._default(z21.boolean(), true)
6553
6786
  });
6554
- var OpencodeMcpServerSchema = z20.union([
6787
+ var OpencodeMcpServerSchema = z21.union([
6555
6788
  OpencodeMcpLocalServerSchema,
6556
6789
  OpencodeMcpRemoteServerSchema
6557
6790
  ]);
6558
- var OpencodeConfigSchema = z20.looseObject({
6559
- $schema: z20.optional(z20.string()),
6560
- mcp: z20.optional(z20.record(z20.string(), OpencodeMcpServerSchema)),
6561
- tools: z20.optional(z20.record(z20.string(), z20.boolean()))
6791
+ var OpencodeConfigSchema = z21.looseObject({
6792
+ $schema: z21.optional(z21.string()),
6793
+ mcp: z21.optional(z21.record(z21.string(), OpencodeMcpServerSchema)),
6794
+ tools: z21.optional(z21.record(z21.string(), z21.boolean()))
6562
6795
  });
6563
6796
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6564
6797
  return Object.fromEntries(
@@ -6676,7 +6909,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6676
6909
  static getSettablePaths({ global } = {}) {
6677
6910
  if (global) {
6678
6911
  return {
6679
- relativeDirPath: join51(".config", "opencode"),
6912
+ relativeDirPath: join52(".config", "opencode"),
6680
6913
  relativeFilePath: "opencode.json"
6681
6914
  };
6682
6915
  }
@@ -6691,11 +6924,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6691
6924
  global = false
6692
6925
  }) {
6693
6926
  const basePaths = this.getSettablePaths({ global });
6694
- const jsonDir = join51(baseDir, basePaths.relativeDirPath);
6927
+ const jsonDir = join52(baseDir, basePaths.relativeDirPath);
6695
6928
  let fileContent = null;
6696
6929
  let relativeFilePath = "opencode.jsonc";
6697
- const jsoncPath = join51(jsonDir, "opencode.jsonc");
6698
- const jsonPath = join51(jsonDir, "opencode.json");
6930
+ const jsoncPath = join52(jsonDir, "opencode.jsonc");
6931
+ const jsonPath = join52(jsonDir, "opencode.json");
6699
6932
  fileContent = await readFileContentOrNull(jsoncPath);
6700
6933
  if (!fileContent) {
6701
6934
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6721,11 +6954,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6721
6954
  global = false
6722
6955
  }) {
6723
6956
  const basePaths = this.getSettablePaths({ global });
6724
- const jsonDir = join51(baseDir, basePaths.relativeDirPath);
6957
+ const jsonDir = join52(baseDir, basePaths.relativeDirPath);
6725
6958
  let fileContent = null;
6726
6959
  let relativeFilePath = "opencode.jsonc";
6727
- const jsoncPath = join51(jsonDir, "opencode.jsonc");
6728
- const jsonPath = join51(jsonDir, "opencode.json");
6960
+ const jsoncPath = join52(jsonDir, "opencode.jsonc");
6961
+ const jsonPath = join52(jsonDir, "opencode.json");
6729
6962
  fileContent = await readFileContentOrNull(jsoncPath);
6730
6963
  if (!fileContent) {
6731
6964
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6786,7 +7019,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6786
7019
  };
6787
7020
 
6788
7021
  // src/features/mcp/roo-mcp.ts
6789
- import { join as join52 } from "path";
7022
+ import { join as join53 } from "path";
6790
7023
  function isRooMcpServers(value) {
6791
7024
  return value !== void 0 && value !== null && typeof value === "object";
6792
7025
  }
@@ -6838,7 +7071,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
6838
7071
  validate = true
6839
7072
  }) {
6840
7073
  const fileContent = await readFileContent(
6841
- join52(
7074
+ join53(
6842
7075
  baseDir,
6843
7076
  this.getSettablePaths().relativeDirPath,
6844
7077
  this.getSettablePaths().relativeFilePath
@@ -6909,7 +7142,7 @@ var mcpProcessorToolTargetTuple = [
6909
7142
  "opencode",
6910
7143
  "roo"
6911
7144
  ];
6912
- var McpProcessorToolTargetSchema = z21.enum(mcpProcessorToolTargetTuple);
7145
+ var McpProcessorToolTargetSchema = z22.enum(mcpProcessorToolTargetTuple);
6913
7146
  var toolMcpFactories = /* @__PURE__ */ new Map([
6914
7147
  [
6915
7148
  "claudecode",
@@ -7211,25 +7444,25 @@ var McpProcessor = class extends FeatureProcessor {
7211
7444
  };
7212
7445
 
7213
7446
  // src/features/rules/rules-processor.ts
7214
- import { basename as basename10, join as join112, relative as relative5 } from "path";
7447
+ import { basename as basename10, join as join113, relative as relative5 } from "path";
7215
7448
  import { encode } from "@toon-format/toon";
7216
- import { z as z53 } from "zod/mini";
7449
+ import { z as z54 } from "zod/mini";
7217
7450
 
7218
7451
  // src/constants/general.ts
7219
7452
  var SKILL_FILE_NAME = "SKILL.md";
7220
7453
 
7221
7454
  // src/features/skills/agentsmd-skill.ts
7222
- import { join as join56 } from "path";
7455
+ import { join as join57 } from "path";
7223
7456
 
7224
7457
  // src/features/skills/simulated-skill.ts
7225
- import { join as join55 } from "path";
7226
- import { z as z22 } from "zod/mini";
7458
+ import { join as join56 } from "path";
7459
+ import { z as z23 } from "zod/mini";
7227
7460
 
7228
7461
  // src/features/skills/tool-skill.ts
7229
- import { join as join54 } from "path";
7462
+ import { join as join55 } from "path";
7230
7463
 
7231
7464
  // src/types/ai-dir.ts
7232
- import path2, { basename as basename3, join as join53, relative as relative4, resolve as resolve4 } from "path";
7465
+ import path2, { basename as basename3, join as join54, relative as relative4, resolve as resolve4 } from "path";
7233
7466
  var AiDir = class {
7234
7467
  /**
7235
7468
  * @example "."
@@ -7323,8 +7556,8 @@ var AiDir = class {
7323
7556
  * @returns Array of files with their relative paths and buffers
7324
7557
  */
7325
7558
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7326
- const dirPath = join53(baseDir, relativeDirPath, dirName);
7327
- const glob = join53(dirPath, "**", "*");
7559
+ const dirPath = join54(baseDir, relativeDirPath, dirName);
7560
+ const glob = join54(dirPath, "**", "*");
7328
7561
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7329
7562
  const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
7330
7563
  const files = await Promise.all(
@@ -7422,8 +7655,8 @@ var ToolSkill = class extends AiDir {
7422
7655
  }) {
7423
7656
  const settablePaths = getSettablePaths({ global });
7424
7657
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7425
- const skillDirPath = join54(baseDir, actualRelativeDirPath, dirName);
7426
- const skillFilePath = join54(skillDirPath, SKILL_FILE_NAME);
7658
+ const skillDirPath = join55(baseDir, actualRelativeDirPath, dirName);
7659
+ const skillFilePath = join55(skillDirPath, SKILL_FILE_NAME);
7427
7660
  if (!await fileExists(skillFilePath)) {
7428
7661
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7429
7662
  }
@@ -7447,16 +7680,16 @@ var ToolSkill = class extends AiDir {
7447
7680
  }
7448
7681
  requireMainFileFrontmatter() {
7449
7682
  if (!this.mainFile?.frontmatter) {
7450
- throw new Error(`Frontmatter is not defined in ${join54(this.relativeDirPath, this.dirName)}`);
7683
+ throw new Error(`Frontmatter is not defined in ${join55(this.relativeDirPath, this.dirName)}`);
7451
7684
  }
7452
7685
  return this.mainFile.frontmatter;
7453
7686
  }
7454
7687
  };
7455
7688
 
7456
7689
  // src/features/skills/simulated-skill.ts
7457
- var SimulatedSkillFrontmatterSchema = z22.looseObject({
7458
- name: z22.string(),
7459
- description: z22.string()
7690
+ var SimulatedSkillFrontmatterSchema = z23.looseObject({
7691
+ name: z23.string(),
7692
+ description: z23.string()
7460
7693
  });
7461
7694
  var SimulatedSkill = class extends ToolSkill {
7462
7695
  frontmatter;
@@ -7487,7 +7720,7 @@ var SimulatedSkill = class extends ToolSkill {
7487
7720
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7488
7721
  if (!result.success) {
7489
7722
  throw new Error(
7490
- `Invalid frontmatter in ${join55(relativeDirPath, dirName)}: ${formatError(result.error)}`
7723
+ `Invalid frontmatter in ${join56(relativeDirPath, dirName)}: ${formatError(result.error)}`
7491
7724
  );
7492
7725
  }
7493
7726
  }
@@ -7545,8 +7778,8 @@ var SimulatedSkill = class extends ToolSkill {
7545
7778
  }) {
7546
7779
  const settablePaths = this.getSettablePaths();
7547
7780
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7548
- const skillDirPath = join55(baseDir, actualRelativeDirPath, dirName);
7549
- const skillFilePath = join55(skillDirPath, SKILL_FILE_NAME);
7781
+ const skillDirPath = join56(baseDir, actualRelativeDirPath, dirName);
7782
+ const skillFilePath = join56(skillDirPath, SKILL_FILE_NAME);
7550
7783
  if (!await fileExists(skillFilePath)) {
7551
7784
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7552
7785
  }
@@ -7623,7 +7856,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7623
7856
  throw new Error("AgentsmdSkill does not support global mode.");
7624
7857
  }
7625
7858
  return {
7626
- relativeDirPath: join56(".agents", "skills")
7859
+ relativeDirPath: join57(".agents", "skills")
7627
7860
  };
7628
7861
  }
7629
7862
  static async fromDir(params) {
@@ -7650,11 +7883,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7650
7883
  };
7651
7884
 
7652
7885
  // src/features/skills/factorydroid-skill.ts
7653
- import { join as join57 } from "path";
7886
+ import { join as join58 } from "path";
7654
7887
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7655
7888
  static getSettablePaths(_options) {
7656
7889
  return {
7657
- relativeDirPath: join57(".factory", "skills")
7890
+ relativeDirPath: join58(".factory", "skills")
7658
7891
  };
7659
7892
  }
7660
7893
  static async fromDir(params) {
@@ -7681,11 +7914,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7681
7914
  };
7682
7915
 
7683
7916
  // src/features/skills/skills-processor.ts
7684
- import { basename as basename5, join as join74 } from "path";
7685
- import { z as z37 } from "zod/mini";
7917
+ import { basename as basename5, join as join75 } from "path";
7918
+ import { z as z38 } from "zod/mini";
7686
7919
 
7687
7920
  // src/types/dir-feature-processor.ts
7688
- import { join as join58 } from "path";
7921
+ import { join as join59 } from "path";
7689
7922
  var DirFeatureProcessor = class {
7690
7923
  baseDir;
7691
7924
  dryRun;
@@ -7716,7 +7949,7 @@ var DirFeatureProcessor = class {
7716
7949
  const mainFile = aiDir.getMainFile();
7717
7950
  let mainFileContent;
7718
7951
  if (mainFile) {
7719
- const mainFilePath = join58(dirPath, mainFile.name);
7952
+ const mainFilePath = join59(dirPath, mainFile.name);
7720
7953
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7721
7954
  mainFileContent = addTrailingNewline(content);
7722
7955
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7730,7 +7963,7 @@ var DirFeatureProcessor = class {
7730
7963
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7731
7964
  otherFileContents.push(contentWithNewline);
7732
7965
  if (!dirHasChanges) {
7733
- const filePath = join58(dirPath, file.relativeFilePathToDirPath);
7966
+ const filePath = join59(dirPath, file.relativeFilePathToDirPath);
7734
7967
  const existingContent = await readFileContentOrNull(filePath);
7735
7968
  if (existingContent !== contentWithNewline) {
7736
7969
  dirHasChanges = true;
@@ -7744,22 +7977,22 @@ var DirFeatureProcessor = class {
7744
7977
  if (this.dryRun) {
7745
7978
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7746
7979
  if (mainFile) {
7747
- logger.info(`[DRY RUN] Would write: ${join58(dirPath, mainFile.name)}`);
7748
- changedPaths.push(join58(relativeDir, mainFile.name));
7980
+ logger.info(`[DRY RUN] Would write: ${join59(dirPath, mainFile.name)}`);
7981
+ changedPaths.push(join59(relativeDir, mainFile.name));
7749
7982
  }
7750
7983
  for (const file of otherFiles) {
7751
- logger.info(`[DRY RUN] Would write: ${join58(dirPath, file.relativeFilePathToDirPath)}`);
7752
- changedPaths.push(join58(relativeDir, file.relativeFilePathToDirPath));
7984
+ logger.info(`[DRY RUN] Would write: ${join59(dirPath, file.relativeFilePathToDirPath)}`);
7985
+ changedPaths.push(join59(relativeDir, file.relativeFilePathToDirPath));
7753
7986
  }
7754
7987
  } else {
7755
7988
  await ensureDir(dirPath);
7756
7989
  if (mainFile && mainFileContent) {
7757
- const mainFilePath = join58(dirPath, mainFile.name);
7990
+ const mainFilePath = join59(dirPath, mainFile.name);
7758
7991
  await writeFileContent(mainFilePath, mainFileContent);
7759
- changedPaths.push(join58(relativeDir, mainFile.name));
7992
+ changedPaths.push(join59(relativeDir, mainFile.name));
7760
7993
  }
7761
7994
  for (const [i, file] of otherFiles.entries()) {
7762
- const filePath = join58(dirPath, file.relativeFilePathToDirPath);
7995
+ const filePath = join59(dirPath, file.relativeFilePathToDirPath);
7763
7996
  const content = otherFileContents[i];
7764
7997
  if (content === void 0) {
7765
7998
  throw new Error(
@@ -7767,7 +8000,7 @@ var DirFeatureProcessor = class {
7767
8000
  );
7768
8001
  }
7769
8002
  await writeFileContent(filePath, content);
7770
- changedPaths.push(join58(relativeDir, file.relativeFilePathToDirPath));
8003
+ changedPaths.push(join59(relativeDir, file.relativeFilePathToDirPath));
7771
8004
  }
7772
8005
  }
7773
8006
  changedCount++;
@@ -7799,38 +8032,39 @@ var DirFeatureProcessor = class {
7799
8032
  };
7800
8033
 
7801
8034
  // src/features/skills/agentsskills-skill.ts
7802
- import { join as join60 } from "path";
7803
- import { z as z24 } from "zod/mini";
8035
+ import { join as join61 } from "path";
8036
+ import { z as z25 } from "zod/mini";
7804
8037
 
7805
8038
  // src/features/skills/rulesync-skill.ts
7806
- import { join as join59 } from "path";
7807
- import { z as z23 } from "zod/mini";
7808
- var RulesyncSkillFrontmatterSchemaInternal = z23.looseObject({
7809
- name: z23.string(),
7810
- description: z23.string(),
7811
- targets: z23._default(RulesyncTargetsSchema, ["*"]),
7812
- claudecode: z23.optional(
7813
- z23.looseObject({
7814
- "allowed-tools": z23.optional(z23.array(z23.string()))
8039
+ import { join as join60 } from "path";
8040
+ import { z as z24 } from "zod/mini";
8041
+ var RulesyncSkillFrontmatterSchemaInternal = z24.looseObject({
8042
+ name: z24.string(),
8043
+ description: z24.string(),
8044
+ targets: z24._default(RulesyncTargetsSchema, ["*"]),
8045
+ claudecode: z24.optional(
8046
+ z24.looseObject({
8047
+ "allowed-tools": z24.optional(z24.array(z24.string())),
8048
+ model: z24.optional(z24.string())
7815
8049
  })
7816
8050
  ),
7817
- codexcli: z23.optional(
7818
- z23.looseObject({
7819
- "short-description": z23.optional(z23.string())
8051
+ codexcli: z24.optional(
8052
+ z24.looseObject({
8053
+ "short-description": z24.optional(z24.string())
7820
8054
  })
7821
8055
  ),
7822
- opencode: z23.optional(
7823
- z23.looseObject({
7824
- "allowed-tools": z23.optional(z23.array(z23.string()))
8056
+ opencode: z24.optional(
8057
+ z24.looseObject({
8058
+ "allowed-tools": z24.optional(z24.array(z24.string()))
7825
8059
  })
7826
8060
  ),
7827
- copilot: z23.optional(
7828
- z23.looseObject({
7829
- license: z23.optional(z23.string())
8061
+ copilot: z24.optional(
8062
+ z24.looseObject({
8063
+ license: z24.optional(z24.string())
7830
8064
  })
7831
8065
  ),
7832
- cline: z23.optional(z23.looseObject({})),
7833
- roo: z23.optional(z23.looseObject({}))
8066
+ cline: z24.optional(z24.looseObject({})),
8067
+ roo: z24.optional(z24.looseObject({}))
7834
8068
  });
7835
8069
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
7836
8070
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -7870,7 +8104,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7870
8104
  }
7871
8105
  getFrontmatter() {
7872
8106
  if (!this.mainFile?.frontmatter) {
7873
- throw new Error(`Frontmatter is not defined in ${join59(this.relativeDirPath, this.dirName)}`);
8107
+ throw new Error(`Frontmatter is not defined in ${join60(this.relativeDirPath, this.dirName)}`);
7874
8108
  }
7875
8109
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
7876
8110
  return result;
@@ -7896,8 +8130,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7896
8130
  dirName,
7897
8131
  global = false
7898
8132
  }) {
7899
- const skillDirPath = join59(baseDir, relativeDirPath, dirName);
7900
- const skillFilePath = join59(skillDirPath, SKILL_FILE_NAME);
8133
+ const skillDirPath = join60(baseDir, relativeDirPath, dirName);
8134
+ const skillFilePath = join60(skillDirPath, SKILL_FILE_NAME);
7901
8135
  if (!await fileExists(skillFilePath)) {
7902
8136
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7903
8137
  }
@@ -7927,14 +8161,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7927
8161
  };
7928
8162
 
7929
8163
  // src/features/skills/agentsskills-skill.ts
7930
- var AgentsSkillsSkillFrontmatterSchema = z24.looseObject({
7931
- name: z24.string(),
7932
- description: z24.string()
8164
+ var AgentsSkillsSkillFrontmatterSchema = z25.looseObject({
8165
+ name: z25.string(),
8166
+ description: z25.string()
7933
8167
  });
7934
8168
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7935
8169
  constructor({
7936
8170
  baseDir = process.cwd(),
7937
- relativeDirPath = join60(".agents", "skills"),
8171
+ relativeDirPath = join61(".agents", "skills"),
7938
8172
  dirName,
7939
8173
  frontmatter,
7940
8174
  body,
@@ -7966,7 +8200,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7966
8200
  throw new Error("AgentsSkillsSkill does not support global mode.");
7967
8201
  }
7968
8202
  return {
7969
- relativeDirPath: join60(".agents", "skills")
8203
+ relativeDirPath: join61(".agents", "skills")
7970
8204
  };
7971
8205
  }
7972
8206
  getFrontmatter() {
@@ -8045,9 +8279,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8045
8279
  });
8046
8280
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8047
8281
  if (!result.success) {
8048
- const skillDirPath = join60(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8282
+ const skillDirPath = join61(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8049
8283
  throw new Error(
8050
- `Invalid frontmatter in ${join60(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8284
+ `Invalid frontmatter in ${join61(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8051
8285
  );
8052
8286
  }
8053
8287
  return new _AgentsSkillsSkill({
@@ -8082,16 +8316,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8082
8316
  };
8083
8317
 
8084
8318
  // src/features/skills/antigravity-skill.ts
8085
- import { join as join61 } from "path";
8086
- import { z as z25 } from "zod/mini";
8087
- var AntigravitySkillFrontmatterSchema = z25.looseObject({
8088
- name: z25.string(),
8089
- description: z25.string()
8319
+ import { join as join62 } from "path";
8320
+ import { z as z26 } from "zod/mini";
8321
+ var AntigravitySkillFrontmatterSchema = z26.looseObject({
8322
+ name: z26.string(),
8323
+ description: z26.string()
8090
8324
  });
8091
8325
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8092
8326
  constructor({
8093
8327
  baseDir = process.cwd(),
8094
- relativeDirPath = join61(".agent", "skills"),
8328
+ relativeDirPath = join62(".agent", "skills"),
8095
8329
  dirName,
8096
8330
  frontmatter,
8097
8331
  body,
@@ -8123,11 +8357,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8123
8357
  } = {}) {
8124
8358
  if (global) {
8125
8359
  return {
8126
- relativeDirPath: join61(".gemini", "antigravity", "skills")
8360
+ relativeDirPath: join62(".gemini", "antigravity", "skills")
8127
8361
  };
8128
8362
  }
8129
8363
  return {
8130
- relativeDirPath: join61(".agent", "skills")
8364
+ relativeDirPath: join62(".agent", "skills")
8131
8365
  };
8132
8366
  }
8133
8367
  getFrontmatter() {
@@ -8206,9 +8440,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8206
8440
  });
8207
8441
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
8208
8442
  if (!result.success) {
8209
- const skillDirPath = join61(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8443
+ const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8210
8444
  throw new Error(
8211
- `Invalid frontmatter in ${join61(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8445
+ `Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8212
8446
  );
8213
8447
  }
8214
8448
  return new _AntigravitySkill({
@@ -8242,17 +8476,18 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8242
8476
  };
8243
8477
 
8244
8478
  // src/features/skills/claudecode-skill.ts
8245
- import { join as join62 } from "path";
8246
- import { z as z26 } from "zod/mini";
8247
- var ClaudecodeSkillFrontmatterSchema = z26.looseObject({
8248
- name: z26.string(),
8249
- description: z26.string(),
8250
- "allowed-tools": z26.optional(z26.array(z26.string()))
8479
+ import { join as join63 } from "path";
8480
+ import { z as z27 } from "zod/mini";
8481
+ var ClaudecodeSkillFrontmatterSchema = z27.looseObject({
8482
+ name: z27.string(),
8483
+ description: z27.string(),
8484
+ "allowed-tools": z27.optional(z27.array(z27.string())),
8485
+ model: z27.optional(z27.string())
8251
8486
  });
8252
8487
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8253
8488
  constructor({
8254
8489
  baseDir = process.cwd(),
8255
- relativeDirPath = join62(".claude", "skills"),
8490
+ relativeDirPath = join63(".claude", "skills"),
8256
8491
  dirName,
8257
8492
  frontmatter,
8258
8493
  body,
@@ -8283,7 +8518,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8283
8518
  global: _global = false
8284
8519
  } = {}) {
8285
8520
  return {
8286
- relativeDirPath: join62(".claude", "skills")
8521
+ relativeDirPath: join63(".claude", "skills")
8287
8522
  };
8288
8523
  }
8289
8524
  getFrontmatter() {
@@ -8313,15 +8548,15 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8313
8548
  }
8314
8549
  toRulesyncSkill() {
8315
8550
  const frontmatter = this.getFrontmatter();
8551
+ const claudecodeSection = {
8552
+ ...frontmatter["allowed-tools"] && { "allowed-tools": frontmatter["allowed-tools"] },
8553
+ ...frontmatter.model && { model: frontmatter.model }
8554
+ };
8316
8555
  const rulesyncFrontmatter = {
8317
8556
  name: frontmatter.name,
8318
8557
  description: frontmatter.description,
8319
8558
  targets: ["*"],
8320
- ...frontmatter["allowed-tools"] && {
8321
- claudecode: {
8322
- "allowed-tools": frontmatter["allowed-tools"]
8323
- }
8324
- }
8559
+ ...Object.keys(claudecodeSection).length > 0 && { claudecode: claudecodeSection }
8325
8560
  };
8326
8561
  return new RulesyncSkill({
8327
8562
  baseDir: this.baseDir,
@@ -8343,7 +8578,12 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8343
8578
  const claudecodeFrontmatter = {
8344
8579
  name: rulesyncFrontmatter.name,
8345
8580
  description: rulesyncFrontmatter.description,
8346
- "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
8581
+ ...rulesyncFrontmatter.claudecode?.["allowed-tools"] && {
8582
+ "allowed-tools": rulesyncFrontmatter.claudecode["allowed-tools"]
8583
+ },
8584
+ ...rulesyncFrontmatter.claudecode?.model && {
8585
+ model: rulesyncFrontmatter.claudecode.model
8586
+ }
8347
8587
  };
8348
8588
  const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
8349
8589
  return new _ClaudecodeSkill({
@@ -8368,9 +8608,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8368
8608
  });
8369
8609
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8370
8610
  if (!result.success) {
8371
- const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8611
+ const skillDirPath = join63(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8372
8612
  throw new Error(
8373
- `Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8613
+ `Invalid frontmatter in ${join63(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8374
8614
  );
8375
8615
  }
8376
8616
  return new _ClaudecodeSkill({
@@ -8404,16 +8644,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8404
8644
  };
8405
8645
 
8406
8646
  // src/features/skills/cline-skill.ts
8407
- import { join as join63 } from "path";
8408
- import { z as z27 } from "zod/mini";
8409
- var ClineSkillFrontmatterSchema = z27.looseObject({
8410
- name: z27.string(),
8411
- description: z27.string()
8647
+ import { join as join64 } from "path";
8648
+ import { z as z28 } from "zod/mini";
8649
+ var ClineSkillFrontmatterSchema = z28.looseObject({
8650
+ name: z28.string(),
8651
+ description: z28.string()
8412
8652
  });
8413
8653
  var ClineSkill = class _ClineSkill extends ToolSkill {
8414
8654
  constructor({
8415
8655
  baseDir = process.cwd(),
8416
- relativeDirPath = join63(".cline", "skills"),
8656
+ relativeDirPath = join64(".cline", "skills"),
8417
8657
  dirName,
8418
8658
  frontmatter,
8419
8659
  body,
@@ -8442,7 +8682,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8442
8682
  }
8443
8683
  static getSettablePaths(_options = {}) {
8444
8684
  return {
8445
- relativeDirPath: join63(".cline", "skills")
8685
+ relativeDirPath: join64(".cline", "skills")
8446
8686
  };
8447
8687
  }
8448
8688
  getFrontmatter() {
@@ -8529,13 +8769,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8529
8769
  });
8530
8770
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8531
8771
  if (!result.success) {
8532
- const skillDirPath = join63(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8772
+ const skillDirPath = join64(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8533
8773
  throw new Error(
8534
- `Invalid frontmatter in ${join63(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8774
+ `Invalid frontmatter in ${join64(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8535
8775
  );
8536
8776
  }
8537
8777
  if (result.data.name !== loaded.dirName) {
8538
- const skillFilePath = join63(
8778
+ const skillFilePath = join64(
8539
8779
  loaded.baseDir,
8540
8780
  loaded.relativeDirPath,
8541
8781
  loaded.dirName,
@@ -8576,21 +8816,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8576
8816
  };
8577
8817
 
8578
8818
  // src/features/skills/codexcli-skill.ts
8579
- import { join as join64 } from "path";
8580
- import { z as z28 } from "zod/mini";
8581
- var CodexCliSkillFrontmatterSchema = z28.looseObject({
8582
- name: z28.string(),
8583
- description: z28.string(),
8584
- metadata: z28.optional(
8585
- z28.looseObject({
8586
- "short-description": z28.optional(z28.string())
8819
+ import { join as join65 } from "path";
8820
+ import { z as z29 } from "zod/mini";
8821
+ var CodexCliSkillFrontmatterSchema = z29.looseObject({
8822
+ name: z29.string(),
8823
+ description: z29.string(),
8824
+ metadata: z29.optional(
8825
+ z29.looseObject({
8826
+ "short-description": z29.optional(z29.string())
8587
8827
  })
8588
8828
  )
8589
8829
  });
8590
8830
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8591
8831
  constructor({
8592
8832
  baseDir = process.cwd(),
8593
- relativeDirPath = join64(".codex", "skills"),
8833
+ relativeDirPath = join65(".codex", "skills"),
8594
8834
  dirName,
8595
8835
  frontmatter,
8596
8836
  body,
@@ -8621,7 +8861,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8621
8861
  global: _global = false
8622
8862
  } = {}) {
8623
8863
  return {
8624
- relativeDirPath: join64(".codex", "skills")
8864
+ relativeDirPath: join65(".codex", "skills")
8625
8865
  };
8626
8866
  }
8627
8867
  getFrontmatter() {
@@ -8710,9 +8950,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8710
8950
  });
8711
8951
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8712
8952
  if (!result.success) {
8713
- const skillDirPath = join64(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8953
+ const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8714
8954
  throw new Error(
8715
- `Invalid frontmatter in ${join64(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8955
+ `Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8716
8956
  );
8717
8957
  }
8718
8958
  return new _CodexCliSkill({
@@ -8746,17 +8986,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8746
8986
  };
8747
8987
 
8748
8988
  // src/features/skills/copilot-skill.ts
8749
- import { join as join65 } from "path";
8750
- import { z as z29 } from "zod/mini";
8751
- var CopilotSkillFrontmatterSchema = z29.looseObject({
8752
- name: z29.string(),
8753
- description: z29.string(),
8754
- license: z29.optional(z29.string())
8989
+ import { join as join66 } from "path";
8990
+ import { z as z30 } from "zod/mini";
8991
+ var CopilotSkillFrontmatterSchema = z30.looseObject({
8992
+ name: z30.string(),
8993
+ description: z30.string(),
8994
+ license: z30.optional(z30.string())
8755
8995
  });
8756
8996
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8757
8997
  constructor({
8758
8998
  baseDir = process.cwd(),
8759
- relativeDirPath = join65(".github", "skills"),
8999
+ relativeDirPath = join66(".github", "skills"),
8760
9000
  dirName,
8761
9001
  frontmatter,
8762
9002
  body,
@@ -8788,7 +9028,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8788
9028
  throw new Error("CopilotSkill does not support global mode.");
8789
9029
  }
8790
9030
  return {
8791
- relativeDirPath: join65(".github", "skills")
9031
+ relativeDirPath: join66(".github", "skills")
8792
9032
  };
8793
9033
  }
8794
9034
  getFrontmatter() {
@@ -8873,9 +9113,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8873
9113
  });
8874
9114
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8875
9115
  if (!result.success) {
8876
- const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9116
+ const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8877
9117
  throw new Error(
8878
- `Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9118
+ `Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8879
9119
  );
8880
9120
  }
8881
9121
  return new _CopilotSkill({
@@ -8910,16 +9150,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8910
9150
  };
8911
9151
 
8912
9152
  // src/features/skills/cursor-skill.ts
8913
- import { join as join66 } from "path";
8914
- import { z as z30 } from "zod/mini";
8915
- var CursorSkillFrontmatterSchema = z30.looseObject({
8916
- name: z30.string(),
8917
- description: z30.string()
9153
+ import { join as join67 } from "path";
9154
+ import { z as z31 } from "zod/mini";
9155
+ var CursorSkillFrontmatterSchema = z31.looseObject({
9156
+ name: z31.string(),
9157
+ description: z31.string()
8918
9158
  });
8919
9159
  var CursorSkill = class _CursorSkill extends ToolSkill {
8920
9160
  constructor({
8921
9161
  baseDir = process.cwd(),
8922
- relativeDirPath = join66(".cursor", "skills"),
9162
+ relativeDirPath = join67(".cursor", "skills"),
8923
9163
  dirName,
8924
9164
  frontmatter,
8925
9165
  body,
@@ -8948,7 +9188,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8948
9188
  }
8949
9189
  static getSettablePaths(_options) {
8950
9190
  return {
8951
- relativeDirPath: join66(".cursor", "skills")
9191
+ relativeDirPath: join67(".cursor", "skills")
8952
9192
  };
8953
9193
  }
8954
9194
  getFrontmatter() {
@@ -9027,9 +9267,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9027
9267
  });
9028
9268
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9029
9269
  if (!result.success) {
9030
- const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9270
+ const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9031
9271
  throw new Error(
9032
- `Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9272
+ `Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9033
9273
  );
9034
9274
  }
9035
9275
  return new _CursorSkill({
@@ -9064,11 +9304,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9064
9304
  };
9065
9305
 
9066
9306
  // src/features/skills/geminicli-skill.ts
9067
- import { join as join67 } from "path";
9068
- import { z as z31 } from "zod/mini";
9069
- var GeminiCliSkillFrontmatterSchema = z31.looseObject({
9070
- name: z31.string(),
9071
- description: z31.string()
9307
+ import { join as join68 } from "path";
9308
+ import { z as z32 } from "zod/mini";
9309
+ var GeminiCliSkillFrontmatterSchema = z32.looseObject({
9310
+ name: z32.string(),
9311
+ description: z32.string()
9072
9312
  });
9073
9313
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9074
9314
  constructor({
@@ -9104,7 +9344,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9104
9344
  global: _global = false
9105
9345
  } = {}) {
9106
9346
  return {
9107
- relativeDirPath: join67(".gemini", "skills")
9347
+ relativeDirPath: join68(".gemini", "skills")
9108
9348
  };
9109
9349
  }
9110
9350
  getFrontmatter() {
@@ -9183,9 +9423,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9183
9423
  });
9184
9424
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9185
9425
  if (!result.success) {
9186
- const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9426
+ const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9187
9427
  throw new Error(
9188
- `Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9428
+ `Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9189
9429
  );
9190
9430
  }
9191
9431
  return new _GeminiCliSkill({
@@ -9220,16 +9460,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9220
9460
  };
9221
9461
 
9222
9462
  // src/features/skills/kilo-skill.ts
9223
- import { join as join68 } from "path";
9224
- import { z as z32 } from "zod/mini";
9225
- var KiloSkillFrontmatterSchema = z32.looseObject({
9226
- name: z32.string(),
9227
- description: z32.string()
9463
+ import { join as join69 } from "path";
9464
+ import { z as z33 } from "zod/mini";
9465
+ var KiloSkillFrontmatterSchema = z33.looseObject({
9466
+ name: z33.string(),
9467
+ description: z33.string()
9228
9468
  });
9229
9469
  var KiloSkill = class _KiloSkill extends ToolSkill {
9230
9470
  constructor({
9231
9471
  baseDir = process.cwd(),
9232
- relativeDirPath = join68(".kilocode", "skills"),
9472
+ relativeDirPath = join69(".kilocode", "skills"),
9233
9473
  dirName,
9234
9474
  frontmatter,
9235
9475
  body,
@@ -9260,7 +9500,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9260
9500
  global: _global = false
9261
9501
  } = {}) {
9262
9502
  return {
9263
- relativeDirPath: join68(".kilocode", "skills")
9503
+ relativeDirPath: join69(".kilocode", "skills")
9264
9504
  };
9265
9505
  }
9266
9506
  getFrontmatter() {
@@ -9347,13 +9587,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9347
9587
  });
9348
9588
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9349
9589
  if (!result.success) {
9350
- const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9590
+ const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9351
9591
  throw new Error(
9352
- `Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9592
+ `Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9353
9593
  );
9354
9594
  }
9355
9595
  if (result.data.name !== loaded.dirName) {
9356
- const skillFilePath = join68(
9596
+ const skillFilePath = join69(
9357
9597
  loaded.baseDir,
9358
9598
  loaded.relativeDirPath,
9359
9599
  loaded.dirName,
@@ -9394,16 +9634,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9394
9634
  };
9395
9635
 
9396
9636
  // src/features/skills/kiro-skill.ts
9397
- import { join as join69 } from "path";
9398
- import { z as z33 } from "zod/mini";
9399
- var KiroSkillFrontmatterSchema = z33.looseObject({
9400
- name: z33.string(),
9401
- description: z33.string()
9637
+ import { join as join70 } from "path";
9638
+ import { z as z34 } from "zod/mini";
9639
+ var KiroSkillFrontmatterSchema = z34.looseObject({
9640
+ name: z34.string(),
9641
+ description: z34.string()
9402
9642
  });
9403
9643
  var KiroSkill = class _KiroSkill extends ToolSkill {
9404
9644
  constructor({
9405
9645
  baseDir = process.cwd(),
9406
- relativeDirPath = join69(".kiro", "skills"),
9646
+ relativeDirPath = join70(".kiro", "skills"),
9407
9647
  dirName,
9408
9648
  frontmatter,
9409
9649
  body,
@@ -9435,7 +9675,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9435
9675
  throw new Error("KiroSkill does not support global mode.");
9436
9676
  }
9437
9677
  return {
9438
- relativeDirPath: join69(".kiro", "skills")
9678
+ relativeDirPath: join70(".kiro", "skills")
9439
9679
  };
9440
9680
  }
9441
9681
  getFrontmatter() {
@@ -9522,13 +9762,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9522
9762
  });
9523
9763
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9524
9764
  if (!result.success) {
9525
- const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9765
+ const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9526
9766
  throw new Error(
9527
- `Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9767
+ `Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9528
9768
  );
9529
9769
  }
9530
9770
  if (result.data.name !== loaded.dirName) {
9531
- const skillFilePath = join69(
9771
+ const skillFilePath = join70(
9532
9772
  loaded.baseDir,
9533
9773
  loaded.relativeDirPath,
9534
9774
  loaded.dirName,
@@ -9570,17 +9810,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9570
9810
  };
9571
9811
 
9572
9812
  // src/features/skills/opencode-skill.ts
9573
- import { join as join70 } from "path";
9574
- import { z as z34 } from "zod/mini";
9575
- var OpenCodeSkillFrontmatterSchema = z34.looseObject({
9576
- name: z34.string(),
9577
- description: z34.string(),
9578
- "allowed-tools": z34.optional(z34.array(z34.string()))
9813
+ import { join as join71 } from "path";
9814
+ import { z as z35 } from "zod/mini";
9815
+ var OpenCodeSkillFrontmatterSchema = z35.looseObject({
9816
+ name: z35.string(),
9817
+ description: z35.string(),
9818
+ "allowed-tools": z35.optional(z35.array(z35.string()))
9579
9819
  });
9580
9820
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9581
9821
  constructor({
9582
9822
  baseDir = process.cwd(),
9583
- relativeDirPath = join70(".opencode", "skill"),
9823
+ relativeDirPath = join71(".opencode", "skill"),
9584
9824
  dirName,
9585
9825
  frontmatter,
9586
9826
  body,
@@ -9609,7 +9849,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9609
9849
  }
9610
9850
  static getSettablePaths({ global = false } = {}) {
9611
9851
  return {
9612
- relativeDirPath: global ? join70(".config", "opencode", "skill") : join70(".opencode", "skill")
9852
+ relativeDirPath: global ? join71(".config", "opencode", "skill") : join71(".opencode", "skill")
9613
9853
  };
9614
9854
  }
9615
9855
  getFrontmatter() {
@@ -9694,9 +9934,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9694
9934
  });
9695
9935
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9696
9936
  if (!result.success) {
9697
- const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9937
+ const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9698
9938
  throw new Error(
9699
- `Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9939
+ `Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9700
9940
  );
9701
9941
  }
9702
9942
  return new _OpenCodeSkill({
@@ -9730,16 +9970,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9730
9970
  };
9731
9971
 
9732
9972
  // src/features/skills/replit-skill.ts
9733
- import { join as join71 } from "path";
9734
- import { z as z35 } from "zod/mini";
9735
- var ReplitSkillFrontmatterSchema = z35.looseObject({
9736
- name: z35.string(),
9737
- description: z35.string()
9973
+ import { join as join72 } from "path";
9974
+ import { z as z36 } from "zod/mini";
9975
+ var ReplitSkillFrontmatterSchema = z36.looseObject({
9976
+ name: z36.string(),
9977
+ description: z36.string()
9738
9978
  });
9739
9979
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9740
9980
  constructor({
9741
9981
  baseDir = process.cwd(),
9742
- relativeDirPath = join71(".agents", "skills"),
9982
+ relativeDirPath = join72(".agents", "skills"),
9743
9983
  dirName,
9744
9984
  frontmatter,
9745
9985
  body,
@@ -9771,7 +10011,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9771
10011
  throw new Error("ReplitSkill does not support global mode.");
9772
10012
  }
9773
10013
  return {
9774
- relativeDirPath: join71(".agents", "skills")
10014
+ relativeDirPath: join72(".agents", "skills")
9775
10015
  };
9776
10016
  }
9777
10017
  getFrontmatter() {
@@ -9850,9 +10090,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9850
10090
  });
9851
10091
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9852
10092
  if (!result.success) {
9853
- const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10093
+ const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9854
10094
  throw new Error(
9855
- `Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10095
+ `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9856
10096
  );
9857
10097
  }
9858
10098
  return new _ReplitSkill({
@@ -9887,16 +10127,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9887
10127
  };
9888
10128
 
9889
10129
  // src/features/skills/roo-skill.ts
9890
- import { join as join72 } from "path";
9891
- import { z as z36 } from "zod/mini";
9892
- var RooSkillFrontmatterSchema = z36.looseObject({
9893
- name: z36.string(),
9894
- description: z36.string()
10130
+ import { join as join73 } from "path";
10131
+ import { z as z37 } from "zod/mini";
10132
+ var RooSkillFrontmatterSchema = z37.looseObject({
10133
+ name: z37.string(),
10134
+ description: z37.string()
9895
10135
  });
9896
10136
  var RooSkill = class _RooSkill extends ToolSkill {
9897
10137
  constructor({
9898
10138
  baseDir = process.cwd(),
9899
- relativeDirPath = join72(".roo", "skills"),
10139
+ relativeDirPath = join73(".roo", "skills"),
9900
10140
  dirName,
9901
10141
  frontmatter,
9902
10142
  body,
@@ -9927,7 +10167,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
9927
10167
  global: _global = false
9928
10168
  } = {}) {
9929
10169
  return {
9930
- relativeDirPath: join72(".roo", "skills")
10170
+ relativeDirPath: join73(".roo", "skills")
9931
10171
  };
9932
10172
  }
9933
10173
  getFrontmatter() {
@@ -10014,13 +10254,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
10014
10254
  });
10015
10255
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10016
10256
  if (!result.success) {
10017
- const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10257
+ const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10018
10258
  throw new Error(
10019
- `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10259
+ `Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10020
10260
  );
10021
10261
  }
10022
10262
  if (result.data.name !== loaded.dirName) {
10023
- const skillFilePath = join72(
10263
+ const skillFilePath = join73(
10024
10264
  loaded.baseDir,
10025
10265
  loaded.relativeDirPath,
10026
10266
  loaded.dirName,
@@ -10061,14 +10301,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
10061
10301
  };
10062
10302
 
10063
10303
  // src/features/skills/skills-utils.ts
10064
- import { basename as basename4, join as join73 } from "path";
10304
+ import { basename as basename4, join as join74 } from "path";
10065
10305
  async function getLocalSkillDirNames(baseDir) {
10066
- const skillsDir = join73(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10306
+ const skillsDir = join74(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10067
10307
  const names = /* @__PURE__ */ new Set();
10068
10308
  if (!await directoryExists(skillsDir)) {
10069
10309
  return names;
10070
10310
  }
10071
- const dirPaths = await findFilesByGlobs(join73(skillsDir, "*"), { type: "dir" });
10311
+ const dirPaths = await findFilesByGlobs(join74(skillsDir, "*"), { type: "dir" });
10072
10312
  for (const dirPath of dirPaths) {
10073
10313
  const name = basename4(dirPath);
10074
10314
  if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
@@ -10096,7 +10336,7 @@ var skillsProcessorToolTargetTuple = [
10096
10336
  "replit",
10097
10337
  "roo"
10098
10338
  ];
10099
- var SkillsProcessorToolTargetSchema = z37.enum(skillsProcessorToolTargetTuple);
10339
+ var SkillsProcessorToolTargetSchema = z38.enum(skillsProcessorToolTargetTuple);
10100
10340
  var toolSkillFactories = /* @__PURE__ */ new Map([
10101
10341
  [
10102
10342
  "agentsmd",
@@ -10297,10 +10537,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10297
10537
  )
10298
10538
  );
10299
10539
  const localSkillNames = new Set(localDirNames);
10300
- const curatedDirPath = join74(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10540
+ const curatedDirPath = join75(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10301
10541
  let curatedSkills = [];
10302
10542
  if (await directoryExists(curatedDirPath)) {
10303
- const curatedDirPaths = await findFilesByGlobs(join74(curatedDirPath, "*"), { type: "dir" });
10543
+ const curatedDirPaths = await findFilesByGlobs(join75(curatedDirPath, "*"), { type: "dir" });
10304
10544
  const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
10305
10545
  const nonConflicting = curatedDirNames.filter((name) => {
10306
10546
  if (localSkillNames.has(name)) {
@@ -10334,8 +10574,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10334
10574
  async loadToolDirs() {
10335
10575
  const factory = this.getFactory(this.toolTarget);
10336
10576
  const paths = factory.class.getSettablePaths({ global: this.global });
10337
- const skillsDirPath = join74(this.baseDir, paths.relativeDirPath);
10338
- const dirPaths = await findFilesByGlobs(join74(skillsDirPath, "*"), { type: "dir" });
10577
+ const skillsDirPath = join75(this.baseDir, paths.relativeDirPath);
10578
+ const dirPaths = await findFilesByGlobs(join75(skillsDirPath, "*"), { type: "dir" });
10339
10579
  const dirNames = dirPaths.map((path3) => basename5(path3));
10340
10580
  const toolSkills = await Promise.all(
10341
10581
  dirNames.map(
@@ -10352,8 +10592,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10352
10592
  async loadToolDirsToDelete() {
10353
10593
  const factory = this.getFactory(this.toolTarget);
10354
10594
  const paths = factory.class.getSettablePaths({ global: this.global });
10355
- const skillsDirPath = join74(this.baseDir, paths.relativeDirPath);
10356
- const dirPaths = await findFilesByGlobs(join74(skillsDirPath, "*"), { type: "dir" });
10595
+ const skillsDirPath = join75(this.baseDir, paths.relativeDirPath);
10596
+ const dirPaths = await findFilesByGlobs(join75(skillsDirPath, "*"), { type: "dir" });
10357
10597
  const dirNames = dirPaths.map((path3) => basename5(path3));
10358
10598
  const toolSkills = dirNames.map(
10359
10599
  (dirName) => factory.class.forDeletion({
@@ -10415,11 +10655,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10415
10655
  };
10416
10656
 
10417
10657
  // src/features/subagents/agentsmd-subagent.ts
10418
- import { join as join76 } from "path";
10658
+ import { join as join77 } from "path";
10419
10659
 
10420
10660
  // src/features/subagents/simulated-subagent.ts
10421
- import { basename as basename6, join as join75 } from "path";
10422
- import { z as z38 } from "zod/mini";
10661
+ import { basename as basename6, join as join76 } from "path";
10662
+ import { z as z39 } from "zod/mini";
10423
10663
 
10424
10664
  // src/features/subagents/tool-subagent.ts
10425
10665
  var ToolSubagent = class extends ToolFile {
@@ -10471,9 +10711,9 @@ var ToolSubagent = class extends ToolFile {
10471
10711
  };
10472
10712
 
10473
10713
  // src/features/subagents/simulated-subagent.ts
10474
- var SimulatedSubagentFrontmatterSchema = z38.object({
10475
- name: z38.string(),
10476
- description: z38.string()
10714
+ var SimulatedSubagentFrontmatterSchema = z39.object({
10715
+ name: z39.string(),
10716
+ description: z39.string()
10477
10717
  });
10478
10718
  var SimulatedSubagent = class extends ToolSubagent {
10479
10719
  frontmatter;
@@ -10483,7 +10723,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10483
10723
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
10484
10724
  if (!result.success) {
10485
10725
  throw new Error(
10486
- `Invalid frontmatter in ${join75(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10726
+ `Invalid frontmatter in ${join76(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10487
10727
  );
10488
10728
  }
10489
10729
  }
@@ -10534,7 +10774,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10534
10774
  return {
10535
10775
  success: false,
10536
10776
  error: new Error(
10537
- `Invalid frontmatter in ${join75(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10777
+ `Invalid frontmatter in ${join76(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10538
10778
  )
10539
10779
  };
10540
10780
  }
@@ -10544,7 +10784,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10544
10784
  relativeFilePath,
10545
10785
  validate = true
10546
10786
  }) {
10547
- const filePath = join75(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10787
+ const filePath = join76(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10548
10788
  const fileContent = await readFileContent(filePath);
10549
10789
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10550
10790
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10580,7 +10820,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10580
10820
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10581
10821
  static getSettablePaths() {
10582
10822
  return {
10583
- relativeDirPath: join76(".agents", "subagents")
10823
+ relativeDirPath: join77(".agents", "subagents")
10584
10824
  };
10585
10825
  }
10586
10826
  static async fromFile(params) {
@@ -10603,11 +10843,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10603
10843
  };
10604
10844
 
10605
10845
  // src/features/subagents/factorydroid-subagent.ts
10606
- import { join as join77 } from "path";
10846
+ import { join as join78 } from "path";
10607
10847
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10608
10848
  static getSettablePaths(_options) {
10609
10849
  return {
10610
- relativeDirPath: join77(".factory", "droids")
10850
+ relativeDirPath: join78(".factory", "droids")
10611
10851
  };
10612
10852
  }
10613
10853
  static async fromFile(params) {
@@ -10630,11 +10870,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10630
10870
  };
10631
10871
 
10632
10872
  // src/features/subagents/geminicli-subagent.ts
10633
- import { join as join78 } from "path";
10873
+ import { join as join79 } from "path";
10634
10874
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10635
10875
  static getSettablePaths() {
10636
10876
  return {
10637
- relativeDirPath: join78(".gemini", "subagents")
10877
+ relativeDirPath: join79(".gemini", "subagents")
10638
10878
  };
10639
10879
  }
10640
10880
  static async fromFile(params) {
@@ -10657,11 +10897,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10657
10897
  };
10658
10898
 
10659
10899
  // src/features/subagents/roo-subagent.ts
10660
- import { join as join79 } from "path";
10900
+ import { join as join80 } from "path";
10661
10901
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10662
10902
  static getSettablePaths() {
10663
10903
  return {
10664
- relativeDirPath: join79(".roo", "subagents")
10904
+ relativeDirPath: join80(".roo", "subagents")
10665
10905
  };
10666
10906
  }
10667
10907
  static async fromFile(params) {
@@ -10684,20 +10924,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10684
10924
  };
10685
10925
 
10686
10926
  // src/features/subagents/subagents-processor.ts
10687
- import { basename as basename9, join as join87 } from "path";
10688
- import { z as z46 } from "zod/mini";
10927
+ import { basename as basename9, join as join88 } from "path";
10928
+ import { z as z47 } from "zod/mini";
10689
10929
 
10690
10930
  // src/features/subagents/claudecode-subagent.ts
10691
- import { join as join81 } from "path";
10692
- import { z as z40 } from "zod/mini";
10931
+ import { join as join82 } from "path";
10932
+ import { z as z41 } from "zod/mini";
10693
10933
 
10694
10934
  // src/features/subagents/rulesync-subagent.ts
10695
- import { basename as basename7, join as join80 } from "path";
10696
- import { z as z39 } from "zod/mini";
10697
- var RulesyncSubagentFrontmatterSchema = z39.looseObject({
10698
- targets: z39._default(RulesyncTargetsSchema, ["*"]),
10699
- name: z39.string(),
10700
- description: z39.string()
10935
+ import { basename as basename7, join as join81 } from "path";
10936
+ import { z as z40 } from "zod/mini";
10937
+ var RulesyncSubagentFrontmatterSchema = z40.looseObject({
10938
+ targets: z40._default(RulesyncTargetsSchema, ["*"]),
10939
+ name: z40.string(),
10940
+ description: z40.string()
10701
10941
  });
10702
10942
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10703
10943
  frontmatter;
@@ -10706,7 +10946,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10706
10946
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10707
10947
  if (!parseResult.success && rest.validate !== false) {
10708
10948
  throw new Error(
10709
- `Invalid frontmatter in ${join80(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10949
+ `Invalid frontmatter in ${join81(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10710
10950
  );
10711
10951
  }
10712
10952
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10739,7 +10979,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10739
10979
  return {
10740
10980
  success: false,
10741
10981
  error: new Error(
10742
- `Invalid frontmatter in ${join80(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10982
+ `Invalid frontmatter in ${join81(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10743
10983
  )
10744
10984
  };
10745
10985
  }
@@ -10747,7 +10987,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10747
10987
  static async fromFile({
10748
10988
  relativeFilePath
10749
10989
  }) {
10750
- const filePath = join80(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10990
+ const filePath = join81(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10751
10991
  const fileContent = await readFileContent(filePath);
10752
10992
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10753
10993
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10766,13 +11006,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10766
11006
  };
10767
11007
 
10768
11008
  // src/features/subagents/claudecode-subagent.ts
10769
- var ClaudecodeSubagentFrontmatterSchema = z40.looseObject({
10770
- name: z40.string(),
10771
- description: z40.string(),
10772
- model: z40.optional(z40.string()),
10773
- tools: z40.optional(z40.union([z40.string(), z40.array(z40.string())])),
10774
- permissionMode: z40.optional(z40.string()),
10775
- skills: z40.optional(z40.union([z40.string(), z40.array(z40.string())]))
11009
+ var ClaudecodeSubagentFrontmatterSchema = z41.looseObject({
11010
+ name: z41.string(),
11011
+ description: z41.string(),
11012
+ model: z41.optional(z41.string()),
11013
+ tools: z41.optional(z41.union([z41.string(), z41.array(z41.string())])),
11014
+ permissionMode: z41.optional(z41.string()),
11015
+ skills: z41.optional(z41.union([z41.string(), z41.array(z41.string())]))
10776
11016
  });
10777
11017
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10778
11018
  frontmatter;
@@ -10782,7 +11022,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10782
11022
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10783
11023
  if (!result.success) {
10784
11024
  throw new Error(
10785
- `Invalid frontmatter in ${join81(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11025
+ `Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10786
11026
  );
10787
11027
  }
10788
11028
  }
@@ -10794,7 +11034,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10794
11034
  }
10795
11035
  static getSettablePaths(_options = {}) {
10796
11036
  return {
10797
- relativeDirPath: join81(".claude", "agents")
11037
+ relativeDirPath: join82(".claude", "agents")
10798
11038
  };
10799
11039
  }
10800
11040
  getFrontmatter() {
@@ -10870,7 +11110,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10870
11110
  return {
10871
11111
  success: false,
10872
11112
  error: new Error(
10873
- `Invalid frontmatter in ${join81(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11113
+ `Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10874
11114
  )
10875
11115
  };
10876
11116
  }
@@ -10888,7 +11128,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10888
11128
  global = false
10889
11129
  }) {
10890
11130
  const paths = this.getSettablePaths({ global });
10891
- const filePath = join81(baseDir, paths.relativeDirPath, relativeFilePath);
11131
+ const filePath = join82(baseDir, paths.relativeDirPath, relativeFilePath);
10892
11132
  const fileContent = await readFileContent(filePath);
10893
11133
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10894
11134
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10923,16 +11163,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10923
11163
  };
10924
11164
 
10925
11165
  // src/features/subagents/codexcli-subagent.ts
10926
- import { join as join82 } from "path";
11166
+ import { join as join83 } from "path";
10927
11167
  import * as smolToml2 from "smol-toml";
10928
- import { z as z41 } from "zod/mini";
10929
- var CodexCliSubagentTomlSchema = z41.looseObject({
10930
- name: z41.string(),
10931
- description: z41.optional(z41.string()),
10932
- developer_instructions: z41.optional(z41.string()),
10933
- model: z41.optional(z41.string()),
10934
- model_reasoning_effort: z41.optional(z41.string()),
10935
- sandbox_mode: z41.optional(z41.string())
11168
+ import { z as z42 } from "zod/mini";
11169
+ var CodexCliSubagentTomlSchema = z42.looseObject({
11170
+ name: z42.string(),
11171
+ description: z42.optional(z42.string()),
11172
+ developer_instructions: z42.optional(z42.string()),
11173
+ model: z42.optional(z42.string()),
11174
+ model_reasoning_effort: z42.optional(z42.string()),
11175
+ sandbox_mode: z42.optional(z42.string())
10936
11176
  });
10937
11177
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10938
11178
  body;
@@ -10943,7 +11183,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10943
11183
  CodexCliSubagentTomlSchema.parse(parsed);
10944
11184
  } catch (error) {
10945
11185
  throw new Error(
10946
- `Invalid TOML in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11186
+ `Invalid TOML in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10947
11187
  { cause: error }
10948
11188
  );
10949
11189
  }
@@ -10955,7 +11195,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10955
11195
  }
10956
11196
  static getSettablePaths(_options = {}) {
10957
11197
  return {
10958
- relativeDirPath: join82(".codex", "agents")
11198
+ relativeDirPath: join83(".codex", "agents")
10959
11199
  };
10960
11200
  }
10961
11201
  getBody() {
@@ -10967,7 +11207,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10967
11207
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10968
11208
  } catch (error) {
10969
11209
  throw new Error(
10970
- `Failed to parse TOML in ${join82(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11210
+ `Failed to parse TOML in ${join83(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10971
11211
  { cause: error }
10972
11212
  );
10973
11213
  }
@@ -11048,7 +11288,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11048
11288
  global = false
11049
11289
  }) {
11050
11290
  const paths = this.getSettablePaths({ global });
11051
- const filePath = join82(baseDir, paths.relativeDirPath, relativeFilePath);
11291
+ const filePath = join83(baseDir, paths.relativeDirPath, relativeFilePath);
11052
11292
  const fileContent = await readFileContent(filePath);
11053
11293
  const subagent = new _CodexCliSubagent({
11054
11294
  baseDir,
@@ -11086,13 +11326,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11086
11326
  };
11087
11327
 
11088
11328
  // src/features/subagents/copilot-subagent.ts
11089
- import { join as join83 } from "path";
11090
- import { z as z42 } from "zod/mini";
11329
+ import { join as join84 } from "path";
11330
+ import { z as z43 } from "zod/mini";
11091
11331
  var REQUIRED_TOOL = "agent/runSubagent";
11092
- var CopilotSubagentFrontmatterSchema = z42.looseObject({
11093
- name: z42.string(),
11094
- description: z42.string(),
11095
- tools: z42.optional(z42.union([z42.string(), z42.array(z42.string())]))
11332
+ var CopilotSubagentFrontmatterSchema = z43.looseObject({
11333
+ name: z43.string(),
11334
+ description: z43.string(),
11335
+ tools: z43.optional(z43.union([z43.string(), z43.array(z43.string())]))
11096
11336
  });
11097
11337
  var normalizeTools = (tools) => {
11098
11338
  if (!tools) {
@@ -11112,7 +11352,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11112
11352
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
11113
11353
  if (!result.success) {
11114
11354
  throw new Error(
11115
- `Invalid frontmatter in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11355
+ `Invalid frontmatter in ${join84(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11116
11356
  );
11117
11357
  }
11118
11358
  }
@@ -11124,7 +11364,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11124
11364
  }
11125
11365
  static getSettablePaths(_options = {}) {
11126
11366
  return {
11127
- relativeDirPath: join83(".github", "agents")
11367
+ relativeDirPath: join84(".github", "agents")
11128
11368
  };
11129
11369
  }
11130
11370
  getFrontmatter() {
@@ -11198,7 +11438,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11198
11438
  return {
11199
11439
  success: false,
11200
11440
  error: new Error(
11201
- `Invalid frontmatter in ${join83(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11441
+ `Invalid frontmatter in ${join84(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11202
11442
  )
11203
11443
  };
11204
11444
  }
@@ -11216,7 +11456,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11216
11456
  global = false
11217
11457
  }) {
11218
11458
  const paths = this.getSettablePaths({ global });
11219
- const filePath = join83(baseDir, paths.relativeDirPath, relativeFilePath);
11459
+ const filePath = join84(baseDir, paths.relativeDirPath, relativeFilePath);
11220
11460
  const fileContent = await readFileContent(filePath);
11221
11461
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11222
11462
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11252,11 +11492,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11252
11492
  };
11253
11493
 
11254
11494
  // src/features/subagents/cursor-subagent.ts
11255
- import { join as join84 } from "path";
11256
- import { z as z43 } from "zod/mini";
11257
- var CursorSubagentFrontmatterSchema = z43.looseObject({
11258
- name: z43.string(),
11259
- description: z43.string()
11495
+ import { join as join85 } from "path";
11496
+ import { z as z44 } from "zod/mini";
11497
+ var CursorSubagentFrontmatterSchema = z44.looseObject({
11498
+ name: z44.string(),
11499
+ description: z44.string()
11260
11500
  });
11261
11501
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11262
11502
  frontmatter;
@@ -11266,7 +11506,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11266
11506
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11267
11507
  if (!result.success) {
11268
11508
  throw new Error(
11269
- `Invalid frontmatter in ${join84(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11509
+ `Invalid frontmatter in ${join85(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11270
11510
  );
11271
11511
  }
11272
11512
  }
@@ -11278,7 +11518,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11278
11518
  }
11279
11519
  static getSettablePaths(_options = {}) {
11280
11520
  return {
11281
- relativeDirPath: join84(".cursor", "agents")
11521
+ relativeDirPath: join85(".cursor", "agents")
11282
11522
  };
11283
11523
  }
11284
11524
  getFrontmatter() {
@@ -11345,7 +11585,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11345
11585
  return {
11346
11586
  success: false,
11347
11587
  error: new Error(
11348
- `Invalid frontmatter in ${join84(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11588
+ `Invalid frontmatter in ${join85(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11349
11589
  )
11350
11590
  };
11351
11591
  }
@@ -11363,7 +11603,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11363
11603
  global = false
11364
11604
  }) {
11365
11605
  const paths = this.getSettablePaths({ global });
11366
- const filePath = join84(baseDir, paths.relativeDirPath, relativeFilePath);
11606
+ const filePath = join85(baseDir, paths.relativeDirPath, relativeFilePath);
11367
11607
  const fileContent = await readFileContent(filePath);
11368
11608
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11369
11609
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11399,23 +11639,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11399
11639
  };
11400
11640
 
11401
11641
  // src/features/subagents/kiro-subagent.ts
11402
- import { join as join85 } from "path";
11403
- import { z as z44 } from "zod/mini";
11404
- var KiroCliSubagentJsonSchema = z44.looseObject({
11405
- name: z44.string(),
11406
- description: z44.optional(z44.nullable(z44.string())),
11407
- prompt: z44.optional(z44.nullable(z44.string())),
11408
- tools: z44.optional(z44.nullable(z44.array(z44.string()))),
11409
- toolAliases: z44.optional(z44.nullable(z44.record(z44.string(), z44.string()))),
11410
- toolSettings: z44.optional(z44.nullable(z44.unknown())),
11411
- toolSchema: z44.optional(z44.nullable(z44.unknown())),
11412
- hooks: z44.optional(z44.nullable(z44.record(z44.string(), z44.array(z44.unknown())))),
11413
- model: z44.optional(z44.nullable(z44.string())),
11414
- mcpServers: z44.optional(z44.nullable(z44.record(z44.string(), z44.unknown()))),
11415
- useLegacyMcpJson: z44.optional(z44.nullable(z44.boolean())),
11416
- resources: z44.optional(z44.nullable(z44.array(z44.string()))),
11417
- allowedTools: z44.optional(z44.nullable(z44.array(z44.string()))),
11418
- includeMcpJson: z44.optional(z44.nullable(z44.boolean()))
11642
+ import { join as join86 } from "path";
11643
+ import { z as z45 } from "zod/mini";
11644
+ var KiroCliSubagentJsonSchema = z45.looseObject({
11645
+ name: z45.string(),
11646
+ description: z45.optional(z45.nullable(z45.string())),
11647
+ prompt: z45.optional(z45.nullable(z45.string())),
11648
+ tools: z45.optional(z45.nullable(z45.array(z45.string()))),
11649
+ toolAliases: z45.optional(z45.nullable(z45.record(z45.string(), z45.string()))),
11650
+ toolSettings: z45.optional(z45.nullable(z45.unknown())),
11651
+ toolSchema: z45.optional(z45.nullable(z45.unknown())),
11652
+ hooks: z45.optional(z45.nullable(z45.record(z45.string(), z45.array(z45.unknown())))),
11653
+ model: z45.optional(z45.nullable(z45.string())),
11654
+ mcpServers: z45.optional(z45.nullable(z45.record(z45.string(), z45.unknown()))),
11655
+ useLegacyMcpJson: z45.optional(z45.nullable(z45.boolean())),
11656
+ resources: z45.optional(z45.nullable(z45.array(z45.string()))),
11657
+ allowedTools: z45.optional(z45.nullable(z45.array(z45.string()))),
11658
+ includeMcpJson: z45.optional(z45.nullable(z45.boolean()))
11419
11659
  });
11420
11660
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11421
11661
  body;
@@ -11426,7 +11666,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11426
11666
  KiroCliSubagentJsonSchema.parse(parsed);
11427
11667
  } catch (error) {
11428
11668
  throw new Error(
11429
- `Invalid JSON in ${join85(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11669
+ `Invalid JSON in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11430
11670
  { cause: error }
11431
11671
  );
11432
11672
  }
@@ -11438,7 +11678,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11438
11678
  }
11439
11679
  static getSettablePaths(_options = {}) {
11440
11680
  return {
11441
- relativeDirPath: join85(".kiro", "agents")
11681
+ relativeDirPath: join86(".kiro", "agents")
11442
11682
  };
11443
11683
  }
11444
11684
  getBody() {
@@ -11450,7 +11690,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11450
11690
  parsed = JSON.parse(this.body);
11451
11691
  } catch (error) {
11452
11692
  throw new Error(
11453
- `Failed to parse JSON in ${join85(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11693
+ `Failed to parse JSON in ${join86(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11454
11694
  { cause: error }
11455
11695
  );
11456
11696
  }
@@ -11531,7 +11771,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11531
11771
  global = false
11532
11772
  }) {
11533
11773
  const paths = this.getSettablePaths({ global });
11534
- const filePath = join85(baseDir, paths.relativeDirPath, relativeFilePath);
11774
+ const filePath = join86(baseDir, paths.relativeDirPath, relativeFilePath);
11535
11775
  const fileContent = await readFileContent(filePath);
11536
11776
  const subagent = new _KiroSubagent({
11537
11777
  baseDir,
@@ -11569,12 +11809,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11569
11809
  };
11570
11810
 
11571
11811
  // src/features/subagents/opencode-subagent.ts
11572
- import { basename as basename8, join as join86 } from "path";
11573
- import { z as z45 } from "zod/mini";
11574
- var OpenCodeSubagentFrontmatterSchema = z45.looseObject({
11575
- description: z45.string(),
11576
- mode: z45._default(z45.string(), "subagent"),
11577
- name: z45.optional(z45.string())
11812
+ import { basename as basename8, join as join87 } from "path";
11813
+ import { z as z46 } from "zod/mini";
11814
+ var OpenCodeSubagentFrontmatterSchema = z46.looseObject({
11815
+ description: z46.string(),
11816
+ mode: z46._default(z46.string(), "subagent"),
11817
+ name: z46.optional(z46.string())
11578
11818
  });
11579
11819
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11580
11820
  frontmatter;
@@ -11584,7 +11824,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11584
11824
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11585
11825
  if (!result.success) {
11586
11826
  throw new Error(
11587
- `Invalid frontmatter in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11827
+ `Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11588
11828
  );
11589
11829
  }
11590
11830
  }
@@ -11598,7 +11838,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11598
11838
  global = false
11599
11839
  } = {}) {
11600
11840
  return {
11601
- relativeDirPath: global ? join86(".config", "opencode", "agent") : join86(".opencode", "agent")
11841
+ relativeDirPath: global ? join87(".config", "opencode", "agent") : join87(".opencode", "agent")
11602
11842
  };
11603
11843
  }
11604
11844
  getFrontmatter() {
@@ -11636,7 +11876,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11636
11876
  const opencodeFrontmatter = {
11637
11877
  ...opencodeSection,
11638
11878
  description: rulesyncFrontmatter.description,
11639
- mode: "subagent",
11879
+ mode: typeof opencodeSection.mode === "string" ? opencodeSection.mode : "subagent",
11640
11880
  ...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
11641
11881
  };
11642
11882
  const body = rulesyncSubagent.getBody();
@@ -11664,7 +11904,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11664
11904
  return {
11665
11905
  success: false,
11666
11906
  error: new Error(
11667
- `Invalid frontmatter in ${join86(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11907
+ `Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11668
11908
  )
11669
11909
  };
11670
11910
  }
@@ -11681,7 +11921,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11681
11921
  global = false
11682
11922
  }) {
11683
11923
  const paths = this.getSettablePaths({ global });
11684
- const filePath = join86(baseDir, paths.relativeDirPath, relativeFilePath);
11924
+ const filePath = join87(baseDir, paths.relativeDirPath, relativeFilePath);
11685
11925
  const fileContent = await readFileContent(filePath);
11686
11926
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11687
11927
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11730,7 +11970,7 @@ var subagentsProcessorToolTargetTuple = [
11730
11970
  "opencode",
11731
11971
  "roo"
11732
11972
  ];
11733
- var SubagentsProcessorToolTargetSchema = z46.enum(subagentsProcessorToolTargetTuple);
11973
+ var SubagentsProcessorToolTargetSchema = z47.enum(subagentsProcessorToolTargetTuple);
11734
11974
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11735
11975
  [
11736
11976
  "agentsmd",
@@ -11892,7 +12132,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11892
12132
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11893
12133
  */
11894
12134
  async loadRulesyncFiles() {
11895
- const subagentsDir = join87(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12135
+ const subagentsDir = join88(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11896
12136
  const dirExists = await directoryExists(subagentsDir);
11897
12137
  if (!dirExists) {
11898
12138
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11907,7 +12147,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11907
12147
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
11908
12148
  const rulesyncSubagents = [];
11909
12149
  for (const mdFile of mdFiles) {
11910
- const filepath = join87(subagentsDir, mdFile);
12150
+ const filepath = join88(subagentsDir, mdFile);
11911
12151
  try {
11912
12152
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
11913
12153
  relativeFilePath: mdFile,
@@ -11937,7 +12177,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11937
12177
  const factory = this.getFactory(this.toolTarget);
11938
12178
  const paths = factory.class.getSettablePaths({ global: this.global });
11939
12179
  const subagentFilePaths = await findFilesByGlobs(
11940
- join87(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12180
+ join88(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11941
12181
  );
11942
12182
  if (forDeletion) {
11943
12183
  const toolSubagents2 = subagentFilePaths.map(
@@ -12002,49 +12242,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
12002
12242
  };
12003
12243
 
12004
12244
  // src/features/rules/agentsmd-rule.ts
12005
- import { join as join90 } from "path";
12245
+ import { join as join91 } from "path";
12006
12246
 
12007
12247
  // src/features/rules/tool-rule.ts
12008
- import { join as join89 } from "path";
12248
+ import { join as join90 } from "path";
12009
12249
 
12010
12250
  // src/features/rules/rulesync-rule.ts
12011
- import { join as join88 } from "path";
12012
- import { z as z47 } from "zod/mini";
12013
- var RulesyncRuleFrontmatterSchema = z47.object({
12014
- root: z47.optional(z47.boolean()),
12015
- localRoot: z47.optional(z47.boolean()),
12016
- targets: z47._default(RulesyncTargetsSchema, ["*"]),
12017
- description: z47.optional(z47.string()),
12018
- globs: z47.optional(z47.array(z47.string())),
12019
- agentsmd: z47.optional(
12020
- z47.object({
12251
+ import { join as join89 } from "path";
12252
+ import { z as z48 } from "zod/mini";
12253
+ var RulesyncRuleFrontmatterSchema = z48.object({
12254
+ root: z48.optional(z48.boolean()),
12255
+ localRoot: z48.optional(z48.boolean()),
12256
+ targets: z48._default(RulesyncTargetsSchema, ["*"]),
12257
+ description: z48.optional(z48.string()),
12258
+ globs: z48.optional(z48.array(z48.string())),
12259
+ agentsmd: z48.optional(
12260
+ z48.object({
12021
12261
  // @example "path/to/subproject"
12022
- subprojectPath: z47.optional(z47.string())
12262
+ subprojectPath: z48.optional(z48.string())
12023
12263
  })
12024
12264
  ),
12025
- claudecode: z47.optional(
12026
- z47.object({
12265
+ claudecode: z48.optional(
12266
+ z48.object({
12027
12267
  // Glob patterns for conditional rules (takes precedence over globs)
12028
12268
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
12029
- paths: z47.optional(z47.array(z47.string()))
12269
+ paths: z48.optional(z48.array(z48.string()))
12030
12270
  })
12031
12271
  ),
12032
- cursor: z47.optional(
12033
- z47.object({
12034
- alwaysApply: z47.optional(z47.boolean()),
12035
- description: z47.optional(z47.string()),
12036
- globs: z47.optional(z47.array(z47.string()))
12272
+ cursor: z48.optional(
12273
+ z48.object({
12274
+ alwaysApply: z48.optional(z48.boolean()),
12275
+ description: z48.optional(z48.string()),
12276
+ globs: z48.optional(z48.array(z48.string()))
12037
12277
  })
12038
12278
  ),
12039
- copilot: z47.optional(
12040
- z47.object({
12041
- excludeAgent: z47.optional(z47.union([z47.literal("code-review"), z47.literal("coding-agent")]))
12279
+ copilot: z48.optional(
12280
+ z48.object({
12281
+ excludeAgent: z48.optional(z48.union([z48.literal("code-review"), z48.literal("coding-agent")]))
12042
12282
  })
12043
12283
  ),
12044
- antigravity: z47.optional(
12045
- z47.looseObject({
12046
- trigger: z47.optional(z47.string()),
12047
- globs: z47.optional(z47.array(z47.string()))
12284
+ antigravity: z48.optional(
12285
+ z48.looseObject({
12286
+ trigger: z48.optional(z48.string()),
12287
+ globs: z48.optional(z48.array(z48.string()))
12048
12288
  })
12049
12289
  )
12050
12290
  });
@@ -12055,7 +12295,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12055
12295
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
12056
12296
  if (!parseResult.success && rest.validate !== false) {
12057
12297
  throw new Error(
12058
- `Invalid frontmatter in ${join88(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12298
+ `Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12059
12299
  );
12060
12300
  }
12061
12301
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -12090,7 +12330,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12090
12330
  return {
12091
12331
  success: false,
12092
12332
  error: new Error(
12093
- `Invalid frontmatter in ${join88(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12333
+ `Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12094
12334
  )
12095
12335
  };
12096
12336
  }
@@ -12099,7 +12339,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12099
12339
  relativeFilePath,
12100
12340
  validate = true
12101
12341
  }) {
12102
- const filePath = join88(
12342
+ const filePath = join89(
12103
12343
  process.cwd(),
12104
12344
  this.getSettablePaths().recommended.relativeDirPath,
12105
12345
  relativeFilePath
@@ -12201,7 +12441,7 @@ var ToolRule = class extends ToolFile {
12201
12441
  rulesyncRule,
12202
12442
  validate = true,
12203
12443
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
12204
- nonRootPath = { relativeDirPath: join89(".agents", "memories") }
12444
+ nonRootPath = { relativeDirPath: join90(".agents", "memories") }
12205
12445
  }) {
12206
12446
  const params = this.buildToolRuleParamsDefault({
12207
12447
  baseDir,
@@ -12212,7 +12452,7 @@ var ToolRule = class extends ToolFile {
12212
12452
  });
12213
12453
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
12214
12454
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
12215
- params.relativeDirPath = join89(rulesyncFrontmatter.agentsmd.subprojectPath);
12455
+ params.relativeDirPath = join90(rulesyncFrontmatter.agentsmd.subprojectPath);
12216
12456
  params.relativeFilePath = "AGENTS.md";
12217
12457
  }
12218
12458
  return params;
@@ -12261,7 +12501,7 @@ var ToolRule = class extends ToolFile {
12261
12501
  }
12262
12502
  };
12263
12503
  function buildToolPath(toolDir, subDir, excludeToolDir) {
12264
- return excludeToolDir ? subDir : join89(toolDir, subDir);
12504
+ return excludeToolDir ? subDir : join90(toolDir, subDir);
12265
12505
  }
12266
12506
 
12267
12507
  // src/features/rules/agentsmd-rule.ts
@@ -12290,8 +12530,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12290
12530
  validate = true
12291
12531
  }) {
12292
12532
  const isRoot = relativeFilePath === "AGENTS.md";
12293
- const relativePath = isRoot ? "AGENTS.md" : join90(".agents", "memories", relativeFilePath);
12294
- const fileContent = await readFileContent(join90(baseDir, relativePath));
12533
+ const relativePath = isRoot ? "AGENTS.md" : join91(".agents", "memories", relativeFilePath);
12534
+ const fileContent = await readFileContent(join91(baseDir, relativePath));
12295
12535
  return new _AgentsMdRule({
12296
12536
  baseDir,
12297
12537
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -12346,21 +12586,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12346
12586
  };
12347
12587
 
12348
12588
  // src/features/rules/antigravity-rule.ts
12349
- import { join as join91 } from "path";
12350
- import { z as z48 } from "zod/mini";
12351
- var AntigravityRuleFrontmatterSchema = z48.looseObject({
12352
- trigger: z48.optional(
12353
- z48.union([
12354
- z48.literal("always_on"),
12355
- z48.literal("glob"),
12356
- z48.literal("manual"),
12357
- z48.literal("model_decision"),
12358
- z48.string()
12589
+ import { join as join92 } from "path";
12590
+ import { z as z49 } from "zod/mini";
12591
+ var AntigravityRuleFrontmatterSchema = z49.looseObject({
12592
+ trigger: z49.optional(
12593
+ z49.union([
12594
+ z49.literal("always_on"),
12595
+ z49.literal("glob"),
12596
+ z49.literal("manual"),
12597
+ z49.literal("model_decision"),
12598
+ z49.string()
12359
12599
  // accepts any string for forward compatibility
12360
12600
  ])
12361
12601
  ),
12362
- globs: z48.optional(z48.string()),
12363
- description: z48.optional(z48.string())
12602
+ globs: z49.optional(z49.string()),
12603
+ description: z49.optional(z49.string())
12364
12604
  });
12365
12605
  function parseGlobsString(globs) {
12366
12606
  if (!globs) {
@@ -12505,7 +12745,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12505
12745
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
12506
12746
  if (!result.success) {
12507
12747
  throw new Error(
12508
- `Invalid frontmatter in ${join91(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12748
+ `Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12509
12749
  );
12510
12750
  }
12511
12751
  }
@@ -12529,7 +12769,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12529
12769
  relativeFilePath,
12530
12770
  validate = true
12531
12771
  }) {
12532
- const filePath = join91(
12772
+ const filePath = join92(
12533
12773
  baseDir,
12534
12774
  this.getSettablePaths().nonRoot.relativeDirPath,
12535
12775
  relativeFilePath
@@ -12670,7 +12910,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12670
12910
  };
12671
12911
 
12672
12912
  // src/features/rules/augmentcode-legacy-rule.ts
12673
- import { join as join92 } from "path";
12913
+ import { join as join93 } from "path";
12674
12914
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12675
12915
  toRulesyncRule() {
12676
12916
  const rulesyncFrontmatter = {
@@ -12731,8 +12971,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12731
12971
  }) {
12732
12972
  const settablePaths = this.getSettablePaths();
12733
12973
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12734
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : join92(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12735
- const fileContent = await readFileContent(join92(baseDir, relativePath));
12974
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : join93(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12975
+ const fileContent = await readFileContent(join93(baseDir, relativePath));
12736
12976
  return new _AugmentcodeLegacyRule({
12737
12977
  baseDir,
12738
12978
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12761,7 +13001,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12761
13001
  };
12762
13002
 
12763
13003
  // src/features/rules/augmentcode-rule.ts
12764
- import { join as join93 } from "path";
13004
+ import { join as join94 } from "path";
12765
13005
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12766
13006
  toRulesyncRule() {
12767
13007
  return this.toRulesyncRuleDefault();
@@ -12792,7 +13032,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12792
13032
  relativeFilePath,
12793
13033
  validate = true
12794
13034
  }) {
12795
- const filePath = join93(
13035
+ const filePath = join94(
12796
13036
  baseDir,
12797
13037
  this.getSettablePaths().nonRoot.relativeDirPath,
12798
13038
  relativeFilePath
@@ -12832,7 +13072,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12832
13072
  };
12833
13073
 
12834
13074
  // src/features/rules/claudecode-legacy-rule.ts
12835
- import { join as join94 } from "path";
13075
+ import { join as join95 } from "path";
12836
13076
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12837
13077
  static getSettablePaths({
12838
13078
  global,
@@ -12867,7 +13107,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12867
13107
  if (isRoot) {
12868
13108
  const relativePath2 = paths.root.relativeFilePath;
12869
13109
  const fileContent2 = await readFileContent(
12870
- join94(baseDir, paths.root.relativeDirPath, relativePath2)
13110
+ join95(baseDir, paths.root.relativeDirPath, relativePath2)
12871
13111
  );
12872
13112
  return new _ClaudecodeLegacyRule({
12873
13113
  baseDir,
@@ -12881,8 +13121,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12881
13121
  if (!paths.nonRoot) {
12882
13122
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12883
13123
  }
12884
- const relativePath = join94(paths.nonRoot.relativeDirPath, relativeFilePath);
12885
- const fileContent = await readFileContent(join94(baseDir, relativePath));
13124
+ const relativePath = join95(paths.nonRoot.relativeDirPath, relativeFilePath);
13125
+ const fileContent = await readFileContent(join95(baseDir, relativePath));
12886
13126
  return new _ClaudecodeLegacyRule({
12887
13127
  baseDir,
12888
13128
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12941,10 +13181,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12941
13181
  };
12942
13182
 
12943
13183
  // src/features/rules/claudecode-rule.ts
12944
- import { join as join95 } from "path";
12945
- import { z as z49 } from "zod/mini";
12946
- var ClaudecodeRuleFrontmatterSchema = z49.object({
12947
- paths: z49.optional(z49.array(z49.string()))
13184
+ import { join as join96 } from "path";
13185
+ import { z as z50 } from "zod/mini";
13186
+ var ClaudecodeRuleFrontmatterSchema = z50.object({
13187
+ paths: z50.optional(z50.array(z50.string()))
12948
13188
  });
12949
13189
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12950
13190
  frontmatter;
@@ -12976,7 +13216,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12976
13216
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12977
13217
  if (!result.success) {
12978
13218
  throw new Error(
12979
- `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13219
+ `Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12980
13220
  );
12981
13221
  }
12982
13222
  }
@@ -13004,7 +13244,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13004
13244
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13005
13245
  if (isRoot) {
13006
13246
  const fileContent2 = await readFileContent(
13007
- join95(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
13247
+ join96(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
13008
13248
  );
13009
13249
  return new _ClaudecodeRule({
13010
13250
  baseDir,
@@ -13019,17 +13259,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13019
13259
  if (!paths.nonRoot) {
13020
13260
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13021
13261
  }
13022
- const relativePath = join95(paths.nonRoot.relativeDirPath, relativeFilePath);
13023
- const fileContent = await readFileContent(join95(baseDir, relativePath));
13024
- const { frontmatter, body: content } = parseFrontmatter(
13025
- fileContent,
13026
- join95(baseDir, relativePath)
13027
- );
13262
+ const relativePath = join96(paths.nonRoot.relativeDirPath, relativeFilePath);
13263
+ const filePath = join96(baseDir, relativePath);
13264
+ const fileContent = await readFileContent(filePath);
13265
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13028
13266
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
13029
13267
  if (!result.success) {
13030
- throw new Error(
13031
- `Invalid frontmatter in ${join95(baseDir, relativePath)}: ${formatError(result.error)}`
13032
- );
13268
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
13033
13269
  }
13034
13270
  return new _ClaudecodeRule({
13035
13271
  baseDir,
@@ -13135,7 +13371,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13135
13371
  return {
13136
13372
  success: false,
13137
13373
  error: new Error(
13138
- `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13374
+ `Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13139
13375
  )
13140
13376
  };
13141
13377
  }
@@ -13155,10 +13391,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13155
13391
  };
13156
13392
 
13157
13393
  // src/features/rules/cline-rule.ts
13158
- import { join as join96 } from "path";
13159
- import { z as z50 } from "zod/mini";
13160
- var ClineRuleFrontmatterSchema = z50.object({
13161
- description: z50.string()
13394
+ import { join as join97 } from "path";
13395
+ import { z as z51 } from "zod/mini";
13396
+ var ClineRuleFrontmatterSchema = z51.object({
13397
+ description: z51.string()
13162
13398
  });
13163
13399
  var ClineRule = class _ClineRule extends ToolRule {
13164
13400
  static getSettablePaths(_options = {}) {
@@ -13201,7 +13437,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13201
13437
  validate = true
13202
13438
  }) {
13203
13439
  const fileContent = await readFileContent(
13204
- join96(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13440
+ join97(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13205
13441
  );
13206
13442
  return new _ClineRule({
13207
13443
  baseDir,
@@ -13227,7 +13463,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13227
13463
  };
13228
13464
 
13229
13465
  // src/features/rules/codexcli-rule.ts
13230
- import { join as join97 } from "path";
13466
+ import { join as join98 } from "path";
13231
13467
  var CodexcliRule = class _CodexcliRule extends ToolRule {
13232
13468
  static getSettablePaths({
13233
13469
  global,
@@ -13262,7 +13498,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13262
13498
  if (isRoot) {
13263
13499
  const relativePath2 = paths.root.relativeFilePath;
13264
13500
  const fileContent2 = await readFileContent(
13265
- join97(baseDir, paths.root.relativeDirPath, relativePath2)
13501
+ join98(baseDir, paths.root.relativeDirPath, relativePath2)
13266
13502
  );
13267
13503
  return new _CodexcliRule({
13268
13504
  baseDir,
@@ -13276,8 +13512,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13276
13512
  if (!paths.nonRoot) {
13277
13513
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13278
13514
  }
13279
- const relativePath = join97(paths.nonRoot.relativeDirPath, relativeFilePath);
13280
- const fileContent = await readFileContent(join97(baseDir, relativePath));
13515
+ const relativePath = join98(paths.nonRoot.relativeDirPath, relativeFilePath);
13516
+ const fileContent = await readFileContent(join98(baseDir, relativePath));
13281
13517
  return new _CodexcliRule({
13282
13518
  baseDir,
13283
13519
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13336,12 +13572,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13336
13572
  };
13337
13573
 
13338
13574
  // src/features/rules/copilot-rule.ts
13339
- import { join as join98 } from "path";
13340
- import { z as z51 } from "zod/mini";
13341
- var CopilotRuleFrontmatterSchema = z51.object({
13342
- description: z51.optional(z51.string()),
13343
- applyTo: z51.optional(z51.string()),
13344
- excludeAgent: z51.optional(z51.union([z51.literal("code-review"), z51.literal("coding-agent")]))
13575
+ import { join as join99 } from "path";
13576
+ import { z as z52 } from "zod/mini";
13577
+ var CopilotRuleFrontmatterSchema = z52.object({
13578
+ description: z52.optional(z52.string()),
13579
+ applyTo: z52.optional(z52.string()),
13580
+ excludeAgent: z52.optional(z52.union([z52.literal("code-review"), z52.literal("coding-agent")]))
13345
13581
  });
13346
13582
  var CopilotRule = class _CopilotRule extends ToolRule {
13347
13583
  frontmatter;
@@ -13370,7 +13606,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13370
13606
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13371
13607
  if (!result.success) {
13372
13608
  throw new Error(
13373
- `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13609
+ `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13374
13610
  );
13375
13611
  }
13376
13612
  }
@@ -13460,8 +13696,9 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13460
13696
  const paths = this.getSettablePaths({ global });
13461
13697
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13462
13698
  if (isRoot) {
13463
- const relativePath2 = join98(paths.root.relativeDirPath, paths.root.relativeFilePath);
13464
- const fileContent2 = await readFileContent(join98(baseDir, relativePath2));
13699
+ const relativePath2 = join99(paths.root.relativeDirPath, paths.root.relativeFilePath);
13700
+ const filePath2 = join99(baseDir, relativePath2);
13701
+ const fileContent2 = await readFileContent(filePath2);
13465
13702
  return new _CopilotRule({
13466
13703
  baseDir,
13467
13704
  relativeDirPath: paths.root.relativeDirPath,
@@ -13475,17 +13712,13 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13475
13712
  if (!paths.nonRoot) {
13476
13713
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13477
13714
  }
13478
- const relativePath = join98(paths.nonRoot.relativeDirPath, relativeFilePath);
13479
- const fileContent = await readFileContent(join98(baseDir, relativePath));
13480
- const { frontmatter, body: content } = parseFrontmatter(
13481
- fileContent,
13482
- join98(baseDir, relativePath)
13483
- );
13715
+ const relativePath = join99(paths.nonRoot.relativeDirPath, relativeFilePath);
13716
+ const filePath = join99(baseDir, relativePath);
13717
+ const fileContent = await readFileContent(filePath);
13718
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13484
13719
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13485
13720
  if (!result.success) {
13486
- throw new Error(
13487
- `Invalid frontmatter in ${join98(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13488
- );
13721
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
13489
13722
  }
13490
13723
  return new _CopilotRule({
13491
13724
  baseDir,
@@ -13526,7 +13759,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13526
13759
  return {
13527
13760
  success: false,
13528
13761
  error: new Error(
13529
- `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13762
+ `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13530
13763
  )
13531
13764
  };
13532
13765
  }
@@ -13546,12 +13779,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13546
13779
  };
13547
13780
 
13548
13781
  // src/features/rules/cursor-rule.ts
13549
- import { join as join99 } from "path";
13550
- import { z as z52 } from "zod/mini";
13551
- var CursorRuleFrontmatterSchema = z52.object({
13552
- description: z52.optional(z52.string()),
13553
- globs: z52.optional(z52.string()),
13554
- alwaysApply: z52.optional(z52.boolean())
13782
+ import { join as join100 } from "path";
13783
+ import { z as z53 } from "zod/mini";
13784
+ var CursorRuleFrontmatterSchema = z53.object({
13785
+ description: z53.optional(z53.string()),
13786
+ globs: z53.optional(z53.string()),
13787
+ alwaysApply: z53.optional(z53.boolean())
13555
13788
  });
13556
13789
  var CursorRule = class _CursorRule extends ToolRule {
13557
13790
  frontmatter;
@@ -13568,7 +13801,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13568
13801
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13569
13802
  if (!result.success) {
13570
13803
  throw new Error(
13571
- `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13804
+ `Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13572
13805
  );
13573
13806
  }
13574
13807
  }
@@ -13684,7 +13917,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13684
13917
  relativeFilePath,
13685
13918
  validate = true
13686
13919
  }) {
13687
- const filePath = join99(
13920
+ const filePath = join100(
13688
13921
  baseDir,
13689
13922
  this.getSettablePaths().nonRoot.relativeDirPath,
13690
13923
  relativeFilePath
@@ -13694,7 +13927,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13694
13927
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13695
13928
  if (!result.success) {
13696
13929
  throw new Error(
13697
- `Invalid frontmatter in ${join99(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13930
+ `Invalid frontmatter in ${join100(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13698
13931
  );
13699
13932
  }
13700
13933
  return new _CursorRule({
@@ -13731,7 +13964,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13731
13964
  return {
13732
13965
  success: false,
13733
13966
  error: new Error(
13734
- `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13967
+ `Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13735
13968
  )
13736
13969
  };
13737
13970
  }
@@ -13751,7 +13984,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13751
13984
  };
13752
13985
 
13753
13986
  // src/features/rules/factorydroid-rule.ts
13754
- import { join as join100 } from "path";
13987
+ import { join as join101 } from "path";
13755
13988
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13756
13989
  constructor({ fileContent, root, ...rest }) {
13757
13990
  super({
@@ -13791,8 +14024,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13791
14024
  const paths = this.getSettablePaths({ global });
13792
14025
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13793
14026
  if (isRoot) {
13794
- const relativePath2 = join100(paths.root.relativeDirPath, paths.root.relativeFilePath);
13795
- const fileContent2 = await readFileContent(join100(baseDir, relativePath2));
14027
+ const relativePath2 = join101(paths.root.relativeDirPath, paths.root.relativeFilePath);
14028
+ const fileContent2 = await readFileContent(join101(baseDir, relativePath2));
13796
14029
  return new _FactorydroidRule({
13797
14030
  baseDir,
13798
14031
  relativeDirPath: paths.root.relativeDirPath,
@@ -13805,8 +14038,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13805
14038
  if (!paths.nonRoot) {
13806
14039
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13807
14040
  }
13808
- const relativePath = join100(paths.nonRoot.relativeDirPath, relativeFilePath);
13809
- const fileContent = await readFileContent(join100(baseDir, relativePath));
14041
+ const relativePath = join101(paths.nonRoot.relativeDirPath, relativeFilePath);
14042
+ const fileContent = await readFileContent(join101(baseDir, relativePath));
13810
14043
  return new _FactorydroidRule({
13811
14044
  baseDir,
13812
14045
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13865,7 +14098,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13865
14098
  };
13866
14099
 
13867
14100
  // src/features/rules/geminicli-rule.ts
13868
- import { join as join101 } from "path";
14101
+ import { join as join102 } from "path";
13869
14102
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13870
14103
  static getSettablePaths({
13871
14104
  global,
@@ -13900,7 +14133,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13900
14133
  if (isRoot) {
13901
14134
  const relativePath2 = paths.root.relativeFilePath;
13902
14135
  const fileContent2 = await readFileContent(
13903
- join101(baseDir, paths.root.relativeDirPath, relativePath2)
14136
+ join102(baseDir, paths.root.relativeDirPath, relativePath2)
13904
14137
  );
13905
14138
  return new _GeminiCliRule({
13906
14139
  baseDir,
@@ -13914,8 +14147,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13914
14147
  if (!paths.nonRoot) {
13915
14148
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13916
14149
  }
13917
- const relativePath = join101(paths.nonRoot.relativeDirPath, relativeFilePath);
13918
- const fileContent = await readFileContent(join101(baseDir, relativePath));
14150
+ const relativePath = join102(paths.nonRoot.relativeDirPath, relativeFilePath);
14151
+ const fileContent = await readFileContent(join102(baseDir, relativePath));
13919
14152
  return new _GeminiCliRule({
13920
14153
  baseDir,
13921
14154
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13974,7 +14207,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13974
14207
  };
13975
14208
 
13976
14209
  // src/features/rules/goose-rule.ts
13977
- import { join as join102 } from "path";
14210
+ import { join as join103 } from "path";
13978
14211
  var GooseRule = class _GooseRule extends ToolRule {
13979
14212
  static getSettablePaths({
13980
14213
  global,
@@ -14009,7 +14242,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14009
14242
  if (isRoot) {
14010
14243
  const relativePath2 = paths.root.relativeFilePath;
14011
14244
  const fileContent2 = await readFileContent(
14012
- join102(baseDir, paths.root.relativeDirPath, relativePath2)
14245
+ join103(baseDir, paths.root.relativeDirPath, relativePath2)
14013
14246
  );
14014
14247
  return new _GooseRule({
14015
14248
  baseDir,
@@ -14023,8 +14256,8 @@ var GooseRule = class _GooseRule extends ToolRule {
14023
14256
  if (!paths.nonRoot) {
14024
14257
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14025
14258
  }
14026
- const relativePath = join102(paths.nonRoot.relativeDirPath, relativeFilePath);
14027
- const fileContent = await readFileContent(join102(baseDir, relativePath));
14259
+ const relativePath = join103(paths.nonRoot.relativeDirPath, relativeFilePath);
14260
+ const fileContent = await readFileContent(join103(baseDir, relativePath));
14028
14261
  return new _GooseRule({
14029
14262
  baseDir,
14030
14263
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14083,7 +14316,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14083
14316
  };
14084
14317
 
14085
14318
  // src/features/rules/junie-rule.ts
14086
- import { join as join103 } from "path";
14319
+ import { join as join104 } from "path";
14087
14320
  var JunieRule = class _JunieRule extends ToolRule {
14088
14321
  static getSettablePaths(_options = {}) {
14089
14322
  return {
@@ -14102,8 +14335,8 @@ var JunieRule = class _JunieRule extends ToolRule {
14102
14335
  validate = true
14103
14336
  }) {
14104
14337
  const isRoot = relativeFilePath === "guidelines.md";
14105
- const relativePath = isRoot ? "guidelines.md" : join103(".junie", "memories", relativeFilePath);
14106
- const fileContent = await readFileContent(join103(baseDir, relativePath));
14338
+ const relativePath = isRoot ? "guidelines.md" : join104(".junie", "memories", relativeFilePath);
14339
+ const fileContent = await readFileContent(join104(baseDir, relativePath));
14107
14340
  return new _JunieRule({
14108
14341
  baseDir,
14109
14342
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14158,7 +14391,7 @@ var JunieRule = class _JunieRule extends ToolRule {
14158
14391
  };
14159
14392
 
14160
14393
  // src/features/rules/kilo-rule.ts
14161
- import { join as join104 } from "path";
14394
+ import { join as join105 } from "path";
14162
14395
  var KiloRule = class _KiloRule extends ToolRule {
14163
14396
  static getSettablePaths(_options = {}) {
14164
14397
  return {
@@ -14173,7 +14406,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14173
14406
  validate = true
14174
14407
  }) {
14175
14408
  const fileContent = await readFileContent(
14176
- join104(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14409
+ join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14177
14410
  );
14178
14411
  return new _KiloRule({
14179
14412
  baseDir,
@@ -14225,7 +14458,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14225
14458
  };
14226
14459
 
14227
14460
  // src/features/rules/kiro-rule.ts
14228
- import { join as join105 } from "path";
14461
+ import { join as join106 } from "path";
14229
14462
  var KiroRule = class _KiroRule extends ToolRule {
14230
14463
  static getSettablePaths(_options = {}) {
14231
14464
  return {
@@ -14240,7 +14473,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14240
14473
  validate = true
14241
14474
  }) {
14242
14475
  const fileContent = await readFileContent(
14243
- join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14476
+ join106(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14244
14477
  );
14245
14478
  return new _KiroRule({
14246
14479
  baseDir,
@@ -14294,7 +14527,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14294
14527
  };
14295
14528
 
14296
14529
  // src/features/rules/opencode-rule.ts
14297
- import { join as join106 } from "path";
14530
+ import { join as join107 } from "path";
14298
14531
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14299
14532
  static getSettablePaths({
14300
14533
  global,
@@ -14329,7 +14562,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14329
14562
  if (isRoot) {
14330
14563
  const relativePath2 = paths.root.relativeFilePath;
14331
14564
  const fileContent2 = await readFileContent(
14332
- join106(baseDir, paths.root.relativeDirPath, relativePath2)
14565
+ join107(baseDir, paths.root.relativeDirPath, relativePath2)
14333
14566
  );
14334
14567
  return new _OpenCodeRule({
14335
14568
  baseDir,
@@ -14343,8 +14576,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14343
14576
  if (!paths.nonRoot) {
14344
14577
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14345
14578
  }
14346
- const relativePath = join106(paths.nonRoot.relativeDirPath, relativeFilePath);
14347
- const fileContent = await readFileContent(join106(baseDir, relativePath));
14579
+ const relativePath = join107(paths.nonRoot.relativeDirPath, relativeFilePath);
14580
+ const fileContent = await readFileContent(join107(baseDir, relativePath));
14348
14581
  return new _OpenCodeRule({
14349
14582
  baseDir,
14350
14583
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14403,7 +14636,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14403
14636
  };
14404
14637
 
14405
14638
  // src/features/rules/qwencode-rule.ts
14406
- import { join as join107 } from "path";
14639
+ import { join as join108 } from "path";
14407
14640
  var QwencodeRule = class _QwencodeRule extends ToolRule {
14408
14641
  static getSettablePaths(_options = {}) {
14409
14642
  return {
@@ -14422,8 +14655,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14422
14655
  validate = true
14423
14656
  }) {
14424
14657
  const isRoot = relativeFilePath === "QWEN.md";
14425
- const relativePath = isRoot ? "QWEN.md" : join107(".qwen", "memories", relativeFilePath);
14426
- const fileContent = await readFileContent(join107(baseDir, relativePath));
14658
+ const relativePath = isRoot ? "QWEN.md" : join108(".qwen", "memories", relativeFilePath);
14659
+ const fileContent = await readFileContent(join108(baseDir, relativePath));
14427
14660
  return new _QwencodeRule({
14428
14661
  baseDir,
14429
14662
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14475,7 +14708,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14475
14708
  };
14476
14709
 
14477
14710
  // src/features/rules/replit-rule.ts
14478
- import { join as join108 } from "path";
14711
+ import { join as join109 } from "path";
14479
14712
  var ReplitRule = class _ReplitRule extends ToolRule {
14480
14713
  static getSettablePaths(_options = {}) {
14481
14714
  return {
@@ -14497,7 +14730,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14497
14730
  }
14498
14731
  const relativePath = paths.root.relativeFilePath;
14499
14732
  const fileContent = await readFileContent(
14500
- join108(baseDir, paths.root.relativeDirPath, relativePath)
14733
+ join109(baseDir, paths.root.relativeDirPath, relativePath)
14501
14734
  );
14502
14735
  return new _ReplitRule({
14503
14736
  baseDir,
@@ -14563,7 +14796,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14563
14796
  };
14564
14797
 
14565
14798
  // src/features/rules/roo-rule.ts
14566
- import { join as join109 } from "path";
14799
+ import { join as join110 } from "path";
14567
14800
  var RooRule = class _RooRule extends ToolRule {
14568
14801
  static getSettablePaths(_options = {}) {
14569
14802
  return {
@@ -14578,7 +14811,7 @@ var RooRule = class _RooRule extends ToolRule {
14578
14811
  validate = true
14579
14812
  }) {
14580
14813
  const fileContent = await readFileContent(
14581
- join109(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14814
+ join110(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14582
14815
  );
14583
14816
  return new _RooRule({
14584
14817
  baseDir,
@@ -14647,7 +14880,7 @@ var RooRule = class _RooRule extends ToolRule {
14647
14880
  };
14648
14881
 
14649
14882
  // src/features/rules/warp-rule.ts
14650
- import { join as join110 } from "path";
14883
+ import { join as join111 } from "path";
14651
14884
  var WarpRule = class _WarpRule extends ToolRule {
14652
14885
  constructor({ fileContent, root, ...rest }) {
14653
14886
  super({
@@ -14673,8 +14906,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14673
14906
  validate = true
14674
14907
  }) {
14675
14908
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14676
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join110(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14677
- const fileContent = await readFileContent(join110(baseDir, relativePath));
14909
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join111(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14910
+ const fileContent = await readFileContent(join111(baseDir, relativePath));
14678
14911
  return new _WarpRule({
14679
14912
  baseDir,
14680
14913
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14729,7 +14962,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14729
14962
  };
14730
14963
 
14731
14964
  // src/features/rules/windsurf-rule.ts
14732
- import { join as join111 } from "path";
14965
+ import { join as join112 } from "path";
14733
14966
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14734
14967
  static getSettablePaths(_options = {}) {
14735
14968
  return {
@@ -14744,7 +14977,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14744
14977
  validate = true
14745
14978
  }) {
14746
14979
  const fileContent = await readFileContent(
14747
- join111(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14980
+ join112(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14748
14981
  );
14749
14982
  return new _WindsurfRule({
14750
14983
  baseDir,
@@ -14820,8 +15053,8 @@ var rulesProcessorToolTargets = [
14820
15053
  "warp",
14821
15054
  "windsurf"
14822
15055
  ];
14823
- var RulesProcessorToolTargetSchema = z53.enum(rulesProcessorToolTargets);
14824
- var formatRulePaths = (rules) => rules.map((r) => join112(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15056
+ var RulesProcessorToolTargetSchema = z54.enum(rulesProcessorToolTargets);
15057
+ var formatRulePaths = (rules) => rules.map((r) => join113(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14825
15058
  var toolRuleFactories = /* @__PURE__ */ new Map([
14826
15059
  [
14827
15060
  "agentsmd",
@@ -15196,7 +15429,7 @@ var RulesProcessor = class extends FeatureProcessor {
15196
15429
  }).relativeDirPath;
15197
15430
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
15198
15431
  const frontmatter = skill.getFrontmatter();
15199
- const relativePath = join112(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15432
+ const relativePath = join113(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15200
15433
  return {
15201
15434
  name: frontmatter.name,
15202
15435
  description: frontmatter.description,
@@ -15309,8 +15542,8 @@ var RulesProcessor = class extends FeatureProcessor {
15309
15542
  * Load and parse rulesync rule files from .rulesync/rules/ directory
15310
15543
  */
15311
15544
  async loadRulesyncFiles() {
15312
- const rulesyncBaseDir = join112(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15313
- const files = await findFilesByGlobs(join112(rulesyncBaseDir, "**", "*.md"));
15545
+ const rulesyncBaseDir = join113(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15546
+ const files = await findFilesByGlobs(join113(rulesyncBaseDir, "**", "*.md"));
15314
15547
  logger.debug(`Found ${files.length} rulesync files`);
15315
15548
  const rulesyncRules = await Promise.all(
15316
15549
  files.map((file) => {
@@ -15377,7 +15610,7 @@ var RulesProcessor = class extends FeatureProcessor {
15377
15610
  return [];
15378
15611
  }
15379
15612
  const rootFilePaths = await findFilesByGlobs(
15380
- join112(
15613
+ join113(
15381
15614
  this.baseDir,
15382
15615
  settablePaths.root.relativeDirPath ?? ".",
15383
15616
  settablePaths.root.relativeFilePath
@@ -15415,7 +15648,7 @@ var RulesProcessor = class extends FeatureProcessor {
15415
15648
  return [];
15416
15649
  }
15417
15650
  const localRootFilePaths = await findFilesByGlobs(
15418
- join112(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15651
+ join113(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15419
15652
  );
15420
15653
  return localRootFilePaths.map(
15421
15654
  (filePath) => factory.class.forDeletion({
@@ -15431,9 +15664,9 @@ var RulesProcessor = class extends FeatureProcessor {
15431
15664
  if (!settablePaths.nonRoot) {
15432
15665
  return [];
15433
15666
  }
15434
- const nonRootBaseDir = join112(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15667
+ const nonRootBaseDir = join113(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15435
15668
  const nonRootFilePaths = await findFilesByGlobs(
15436
- join112(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15669
+ join113(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15437
15670
  );
15438
15671
  if (forDeletion) {
15439
15672
  return nonRootFilePaths.map((filePath) => {
@@ -15565,14 +15798,14 @@ s/<command> [arguments]
15565
15798
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15566
15799
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15567
15800
 
15568
- When users call a custom slash command, you have to look for the markdown file, \`${join112(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15801
+ When users call a custom slash command, you have to look for the markdown file, \`${join113(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15569
15802
  const subagentsSection = subagents ? `## Simulated Subagents
15570
15803
 
15571
15804
  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.
15572
15805
 
15573
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${join112(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15806
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${join113(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15574
15807
 
15575
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join112(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15808
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join113(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15576
15809
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15577
15810
  const result = [
15578
15811
  overview,
@@ -15643,8 +15876,16 @@ async function processEmptyFeatureGeneration(params) {
15643
15876
  }
15644
15877
  return { count: totalCount, paths: [], hasDiff };
15645
15878
  }
15879
+ function warnUnsupportedTargets(params) {
15880
+ const { config, supportedTargets, featureName } = params;
15881
+ for (const target of config.getTargets()) {
15882
+ if (!supportedTargets.includes(target) && config.getFeatures(target).includes(featureName)) {
15883
+ logger.warn(`Target '${target}' does not support the feature '${featureName}'. Skipping.`);
15884
+ }
15885
+ }
15886
+ }
15646
15887
  async function checkRulesyncDirExists(params) {
15647
- return fileExists(join113(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15888
+ return fileExists(join114(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15648
15889
  }
15649
15890
  async function generate(params) {
15650
15891
  const { config } = params;
@@ -15680,10 +15921,9 @@ async function generateRulesCore(params) {
15680
15921
  let totalCount = 0;
15681
15922
  const allPaths = [];
15682
15923
  let hasDiff = false;
15683
- const toolTargets = intersection(
15684
- config.getTargets(),
15685
- RulesProcessor.getToolTargets({ global: config.getGlobal() })
15686
- );
15924
+ const supportedTargets = RulesProcessor.getToolTargets({ global: config.getGlobal() });
15925
+ const toolTargets = intersection(config.getTargets(), supportedTargets);
15926
+ warnUnsupportedTargets({ config, supportedTargets, featureName: "rules" });
15687
15927
  for (const baseDir of config.getBaseDirs()) {
15688
15928
  for (const toolTarget of toolTargets) {
15689
15929
  if (!config.getFeatures(toolTarget).includes("rules")) {
@@ -15715,13 +15955,19 @@ async function generateRulesCore(params) {
15715
15955
  }
15716
15956
  async function generateIgnoreCore(params) {
15717
15957
  const { config } = params;
15958
+ const supportedIgnoreTargets = IgnoreProcessor.getToolTargets();
15959
+ warnUnsupportedTargets({
15960
+ config,
15961
+ supportedTargets: supportedIgnoreTargets,
15962
+ featureName: "ignore"
15963
+ });
15718
15964
  if (config.getGlobal()) {
15719
15965
  return { count: 0, paths: [], hasDiff: false };
15720
15966
  }
15721
15967
  let totalCount = 0;
15722
15968
  const allPaths = [];
15723
15969
  let hasDiff = false;
15724
- for (const toolTarget of intersection(config.getTargets(), IgnoreProcessor.getToolTargets())) {
15970
+ for (const toolTarget of intersection(config.getTargets(), supportedIgnoreTargets)) {
15725
15971
  if (!config.getFeatures(toolTarget).includes("ignore")) {
15726
15972
  continue;
15727
15973
  }
@@ -15765,10 +16011,9 @@ async function generateMcpCore(params) {
15765
16011
  let totalCount = 0;
15766
16012
  const allPaths = [];
15767
16013
  let hasDiff = false;
15768
- const toolTargets = intersection(
15769
- config.getTargets(),
15770
- McpProcessor.getToolTargets({ global: config.getGlobal() })
15771
- );
16014
+ const supportedMcpTargets = McpProcessor.getToolTargets({ global: config.getGlobal() });
16015
+ const toolTargets = intersection(config.getTargets(), supportedMcpTargets);
16016
+ warnUnsupportedTargets({ config, supportedTargets: supportedMcpTargets, featureName: "mcp" });
15772
16017
  for (const baseDir of config.getBaseDirs()) {
15773
16018
  for (const toolTarget of toolTargets) {
15774
16019
  if (!config.getFeatures(toolTarget).includes("mcp")) {
@@ -15799,13 +16044,16 @@ async function generateCommandsCore(params) {
15799
16044
  let totalCount = 0;
15800
16045
  const allPaths = [];
15801
16046
  let hasDiff = false;
15802
- const toolTargets = intersection(
15803
- config.getTargets(),
15804
- CommandsProcessor.getToolTargets({
15805
- global: config.getGlobal(),
15806
- includeSimulated: config.getSimulateCommands()
15807
- })
15808
- );
16047
+ const supportedCommandsTargets = CommandsProcessor.getToolTargets({
16048
+ global: config.getGlobal(),
16049
+ includeSimulated: config.getSimulateCommands()
16050
+ });
16051
+ const toolTargets = intersection(config.getTargets(), supportedCommandsTargets);
16052
+ warnUnsupportedTargets({
16053
+ config,
16054
+ supportedTargets: supportedCommandsTargets,
16055
+ featureName: "commands"
16056
+ });
15809
16057
  for (const baseDir of config.getBaseDirs()) {
15810
16058
  for (const toolTarget of toolTargets) {
15811
16059
  if (!config.getFeatures(toolTarget).includes("commands")) {
@@ -15836,13 +16084,16 @@ async function generateSubagentsCore(params) {
15836
16084
  let totalCount = 0;
15837
16085
  const allPaths = [];
15838
16086
  let hasDiff = false;
15839
- const toolTargets = intersection(
15840
- config.getTargets(),
15841
- SubagentsProcessor.getToolTargets({
15842
- global: config.getGlobal(),
15843
- includeSimulated: config.getSimulateSubagents()
15844
- })
15845
- );
16087
+ const supportedSubagentsTargets = SubagentsProcessor.getToolTargets({
16088
+ global: config.getGlobal(),
16089
+ includeSimulated: config.getSimulateSubagents()
16090
+ });
16091
+ const toolTargets = intersection(config.getTargets(), supportedSubagentsTargets);
16092
+ warnUnsupportedTargets({
16093
+ config,
16094
+ supportedTargets: supportedSubagentsTargets,
16095
+ featureName: "subagents"
16096
+ });
15846
16097
  for (const baseDir of config.getBaseDirs()) {
15847
16098
  for (const toolTarget of toolTargets) {
15848
16099
  if (!config.getFeatures(toolTarget).includes("subagents")) {
@@ -15874,13 +16125,16 @@ async function generateSkillsCore(params) {
15874
16125
  const allPaths = [];
15875
16126
  let hasDiff = false;
15876
16127
  const allSkills = [];
15877
- const toolTargets = intersection(
15878
- config.getTargets(),
15879
- SkillsProcessor.getToolTargets({
15880
- global: config.getGlobal(),
15881
- includeSimulated: config.getSimulateSkills()
15882
- })
15883
- );
16128
+ const supportedSkillsTargets = SkillsProcessor.getToolTargets({
16129
+ global: config.getGlobal(),
16130
+ includeSimulated: config.getSimulateSkills()
16131
+ });
16132
+ const toolTargets = intersection(config.getTargets(), supportedSkillsTargets);
16133
+ warnUnsupportedTargets({
16134
+ config,
16135
+ supportedTargets: supportedSkillsTargets,
16136
+ featureName: "skills"
16137
+ });
15884
16138
  for (const baseDir of config.getBaseDirs()) {
15885
16139
  for (const toolTarget of toolTargets) {
15886
16140
  if (!config.getFeatures(toolTarget).includes("skills")) {
@@ -15916,10 +16170,9 @@ async function generateHooksCore(params) {
15916
16170
  let totalCount = 0;
15917
16171
  const allPaths = [];
15918
16172
  let hasDiff = false;
15919
- const toolTargets = intersection(
15920
- config.getTargets(),
15921
- HooksProcessor.getToolTargets({ global: config.getGlobal() })
15922
- );
16173
+ const supportedHooksTargets = HooksProcessor.getToolTargets({ global: config.getGlobal() });
16174
+ const toolTargets = intersection(config.getTargets(), supportedHooksTargets);
16175
+ warnUnsupportedTargets({ config, supportedTargets: supportedHooksTargets, featureName: "hooks" });
15923
16176
  for (const baseDir of config.getBaseDirs()) {
15924
16177
  for (const toolTarget of toolTargets) {
15925
16178
  if (!config.getFeatures(toolTarget).includes("hooks")) {
@@ -15991,6 +16244,7 @@ async function importRulesCore(params) {
15991
16244
  });
15992
16245
  const toolFiles = await rulesProcessor.loadToolFiles();
15993
16246
  if (toolFiles.length === 0) {
16247
+ logger.warn(`No rule files found for ${tool}. Skipping import.`);
15994
16248
  return 0;
15995
16249
  }
15996
16250
  const rulesyncFiles = await rulesProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16018,6 +16272,7 @@ async function importIgnoreCore(params) {
16018
16272
  });
16019
16273
  const toolFiles = await ignoreProcessor.loadToolFiles();
16020
16274
  if (toolFiles.length === 0) {
16275
+ logger.warn(`No ignore files found for ${tool}. Skipping import.`);
16021
16276
  return 0;
16022
16277
  }
16023
16278
  const rulesyncFiles = await ignoreProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16047,6 +16302,7 @@ async function importMcpCore(params) {
16047
16302
  });
16048
16303
  const toolFiles = await mcpProcessor.loadToolFiles();
16049
16304
  if (toolFiles.length === 0) {
16305
+ logger.warn(`No MCP files found for ${tool}. Skipping import.`);
16050
16306
  return 0;
16051
16307
  }
16052
16308
  const rulesyncFiles = await mcpProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16073,6 +16329,7 @@ async function importCommandsCore(params) {
16073
16329
  });
16074
16330
  const toolFiles = await commandsProcessor.loadToolFiles();
16075
16331
  if (toolFiles.length === 0) {
16332
+ logger.warn(`No command files found for ${tool}. Skipping import.`);
16076
16333
  return 0;
16077
16334
  }
16078
16335
  const rulesyncFiles = await commandsProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16099,6 +16356,7 @@ async function importSubagentsCore(params) {
16099
16356
  });
16100
16357
  const toolFiles = await subagentsProcessor.loadToolFiles();
16101
16358
  if (toolFiles.length === 0) {
16359
+ logger.warn(`No subagent files found for ${tool}. Skipping import.`);
16102
16360
  return 0;
16103
16361
  }
16104
16362
  const rulesyncFiles = await subagentsProcessor.convertToolFilesToRulesyncFiles(toolFiles);
@@ -16125,6 +16383,7 @@ async function importSkillsCore(params) {
16125
16383
  });
16126
16384
  const toolDirs = await skillsProcessor.loadToolDirs();
16127
16385
  if (toolDirs.length === 0) {
16386
+ logger.warn(`No skill directories found for ${tool}. Skipping import.`);
16128
16387
  return 0;
16129
16388
  }
16130
16389
  const rulesyncDirs = await skillsProcessor.convertToolDirsToRulesyncDirs(toolDirs);
@@ -16156,6 +16415,7 @@ async function importHooksCore(params) {
16156
16415
  });
16157
16416
  const toolFiles = await hooksProcessor.loadToolFiles();
16158
16417
  if (toolFiles.length === 0) {
16418
+ logger.warn(`No hooks files found for ${tool}. Skipping import.`);
16159
16419
  return 0;
16160
16420
  }
16161
16421
  const rulesyncFiles = await hooksProcessor.convertToolFilesToRulesyncFiles(toolFiles);