rulesync 7.27.0 → 7.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -614,7 +614,7 @@ function getBaseDirsInLightOfGlobal({
614
614
  }
615
615
 
616
616
  // src/lib/generate.ts
617
- var import_node_path133 = require("path");
617
+ var import_node_path134 = require("path");
618
618
  var import_es_toolkit4 = require("es-toolkit");
619
619
 
620
620
  // src/features/commands/commands-processor.ts
@@ -3352,7 +3352,7 @@ var CommandsProcessor = class extends FeatureProcessor {
3352
3352
  };
3353
3353
 
3354
3354
  // src/features/hooks/hooks-processor.ts
3355
- var import_mini19 = require("zod/mini");
3355
+ var import_mini20 = require("zod/mini");
3356
3356
 
3357
3357
  // src/types/hooks.ts
3358
3358
  var import_mini16 = require("zod/mini");
@@ -3465,6 +3465,13 @@ var GEMINICLI_HOOK_EVENTS = [
3465
3465
  "preCompact",
3466
3466
  "notification"
3467
3467
  ];
3468
+ var CODEXCLI_HOOK_EVENTS = [
3469
+ "sessionStart",
3470
+ "preToolUse",
3471
+ "postToolUse",
3472
+ "beforeSubmitPrompt",
3473
+ "stop"
3474
+ ];
3468
3475
  var hooksRecordSchema = import_mini16.z.record(import_mini16.z.string(), import_mini16.z.array(HookDefinitionSchema));
3469
3476
  var HooksConfigSchema = import_mini16.z.looseObject({
3470
3477
  version: import_mini16.z.optional(import_mini16.z.number()),
@@ -3476,6 +3483,7 @@ var HooksConfigSchema = import_mini16.z.looseObject({
3476
3483
  kilo: import_mini16.z.optional(import_mini16.z.looseObject({ hooks: import_mini16.z.optional(hooksRecordSchema) })),
3477
3484
  factorydroid: import_mini16.z.optional(import_mini16.z.looseObject({ hooks: import_mini16.z.optional(hooksRecordSchema) })),
3478
3485
  geminicli: import_mini16.z.optional(import_mini16.z.looseObject({ hooks: import_mini16.z.optional(hooksRecordSchema) })),
3486
+ codexcli: import_mini16.z.optional(import_mini16.z.looseObject({ hooks: import_mini16.z.optional(hooksRecordSchema) })),
3479
3487
  deepagents: import_mini16.z.optional(import_mini16.z.looseObject({ hooks: import_mini16.z.optional(hooksRecordSchema) }))
3480
3488
  });
3481
3489
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
@@ -3574,6 +3582,16 @@ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
3574
3582
  var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3575
3583
  Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
3576
3584
  );
3585
+ var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
3586
+ sessionStart: "SessionStart",
3587
+ preToolUse: "PreToolUse",
3588
+ postToolUse: "PostToolUse",
3589
+ beforeSubmitPrompt: "UserPromptSubmit",
3590
+ stop: "Stop"
3591
+ };
3592
+ var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3593
+ Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
3594
+ );
3577
3595
  var CANONICAL_TO_DEEPAGENTS_EVENT_NAMES = {
3578
3596
  sessionStart: "session.start",
3579
3597
  sessionEnd: "session.end",
@@ -3904,14 +3922,199 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3904
3922
  }
3905
3923
  };
3906
3924
 
3907
- // src/features/hooks/copilot-hooks.ts
3925
+ // src/features/hooks/codexcli-hooks.ts
3908
3926
  var import_node_path26 = require("path");
3927
+ var smolToml2 = __toESM(require("smol-toml"), 1);
3909
3928
  var import_mini17 = require("zod/mini");
3910
- var CopilotHookEntrySchema = import_mini17.z.looseObject({
3911
- type: import_mini17.z.string(),
3912
- bash: import_mini17.z.optional(import_mini17.z.string()),
3913
- powershell: import_mini17.z.optional(import_mini17.z.string()),
3914
- timeoutSec: import_mini17.z.optional(import_mini17.z.number())
3929
+ function canonicalToCodexcliHooks(config) {
3930
+ const codexSupported = new Set(CODEXCLI_HOOK_EVENTS);
3931
+ const sharedHooks = {};
3932
+ for (const [event, defs] of Object.entries(config.hooks)) {
3933
+ if (codexSupported.has(event)) {
3934
+ sharedHooks[event] = defs;
3935
+ }
3936
+ }
3937
+ const effectiveHooks = {
3938
+ ...sharedHooks,
3939
+ ...config.codexcli?.hooks
3940
+ };
3941
+ const codex = {};
3942
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3943
+ const codexEventName = CANONICAL_TO_CODEXCLI_EVENT_NAMES[eventName] ?? eventName;
3944
+ const byMatcher = /* @__PURE__ */ new Map();
3945
+ for (const def of definitions) {
3946
+ const key = def.matcher ?? "";
3947
+ const list = byMatcher.get(key);
3948
+ if (list) list.push(def);
3949
+ else byMatcher.set(key, [def]);
3950
+ }
3951
+ const entries = [];
3952
+ for (const [matcherKey, defs] of byMatcher) {
3953
+ const commandDefs = defs.filter((def) => !def.type || def.type === "command");
3954
+ if (commandDefs.length === 0) continue;
3955
+ const hooks = commandDefs.map((def) => ({
3956
+ type: "command",
3957
+ ...def.command !== void 0 && def.command !== null && { command: def.command },
3958
+ ...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout }
3959
+ }));
3960
+ entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
3961
+ }
3962
+ if (entries.length > 0) {
3963
+ codex[codexEventName] = entries;
3964
+ }
3965
+ }
3966
+ return codex;
3967
+ }
3968
+ var CodexHookEntrySchema = import_mini17.z.looseObject({
3969
+ type: import_mini17.z.optional(import_mini17.z.string()),
3970
+ command: import_mini17.z.optional(import_mini17.z.string()),
3971
+ timeout: import_mini17.z.optional(import_mini17.z.number())
3972
+ });
3973
+ var CodexMatcherEntrySchema = import_mini17.z.looseObject({
3974
+ matcher: import_mini17.z.optional(import_mini17.z.string()),
3975
+ hooks: import_mini17.z.optional(import_mini17.z.array(CodexHookEntrySchema))
3976
+ });
3977
+ function codexcliHooksToCanonical(codexHooks) {
3978
+ if (codexHooks === null || codexHooks === void 0 || typeof codexHooks !== "object") {
3979
+ return {};
3980
+ }
3981
+ const canonical = {};
3982
+ for (const [codexEventName, matcherEntries] of Object.entries(codexHooks)) {
3983
+ const eventName = CODEXCLI_TO_CANONICAL_EVENT_NAMES[codexEventName] ?? codexEventName;
3984
+ if (!Array.isArray(matcherEntries)) continue;
3985
+ const defs = [];
3986
+ for (const rawEntry of matcherEntries) {
3987
+ const parseResult = CodexMatcherEntrySchema.safeParse(rawEntry);
3988
+ if (!parseResult.success) continue;
3989
+ const entry = parseResult.data;
3990
+ const hooks = entry.hooks ?? [];
3991
+ for (const h of hooks) {
3992
+ const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
3993
+ defs.push({
3994
+ type: hookType,
3995
+ ...h.command !== void 0 && h.command !== null && { command: h.command },
3996
+ ...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
3997
+ ...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
3998
+ });
3999
+ }
4000
+ }
4001
+ if (defs.length > 0) {
4002
+ canonical[eventName] = defs;
4003
+ }
4004
+ }
4005
+ return canonical;
4006
+ }
4007
+ async function buildCodexConfigTomlContent({ baseDir }) {
4008
+ const configPath = (0, import_node_path26.join)(baseDir, ".codex", "config.toml");
4009
+ const existingContent = await readFileContentOrNull(configPath) ?? smolToml2.stringify({});
4010
+ const configToml = smolToml2.parse(existingContent);
4011
+ if (typeof configToml.features !== "object" || configToml.features === null) {
4012
+ configToml.features = {};
4013
+ }
4014
+ configToml.features.codex_hooks = true;
4015
+ return smolToml2.stringify(configToml);
4016
+ }
4017
+ var CodexcliConfigToml = class _CodexcliConfigToml extends ToolFile {
4018
+ validate() {
4019
+ return { success: true, error: null };
4020
+ }
4021
+ static async fromBaseDir({ baseDir }) {
4022
+ const fileContent = await buildCodexConfigTomlContent({ baseDir });
4023
+ return new _CodexcliConfigToml({
4024
+ baseDir,
4025
+ relativeDirPath: ".codex",
4026
+ relativeFilePath: "config.toml",
4027
+ fileContent
4028
+ });
4029
+ }
4030
+ };
4031
+ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
4032
+ constructor(params) {
4033
+ super({
4034
+ ...params,
4035
+ fileContent: params.fileContent ?? "{}"
4036
+ });
4037
+ }
4038
+ static getSettablePaths(_options = {}) {
4039
+ return { relativeDirPath: ".codex", relativeFilePath: "hooks.json" };
4040
+ }
4041
+ static async fromFile({
4042
+ baseDir = process.cwd(),
4043
+ validate = true,
4044
+ global = false
4045
+ }) {
4046
+ const paths = _CodexcliHooks.getSettablePaths({ global });
4047
+ const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4048
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4049
+ return new _CodexcliHooks({
4050
+ baseDir,
4051
+ relativeDirPath: paths.relativeDirPath,
4052
+ relativeFilePath: paths.relativeFilePath,
4053
+ fileContent,
4054
+ validate
4055
+ });
4056
+ }
4057
+ static async fromRulesyncHooks({
4058
+ baseDir = process.cwd(),
4059
+ rulesyncHooks,
4060
+ validate = true,
4061
+ global = false
4062
+ }) {
4063
+ const paths = _CodexcliHooks.getSettablePaths({ global });
4064
+ const config = rulesyncHooks.getJson();
4065
+ const codexHooks = canonicalToCodexcliHooks(config);
4066
+ const fileContent = JSON.stringify({ hooks: codexHooks }, null, 2);
4067
+ return new _CodexcliHooks({
4068
+ baseDir,
4069
+ relativeDirPath: paths.relativeDirPath,
4070
+ relativeFilePath: paths.relativeFilePath,
4071
+ fileContent,
4072
+ validate
4073
+ });
4074
+ }
4075
+ toRulesyncHooks() {
4076
+ let parsed;
4077
+ try {
4078
+ parsed = JSON.parse(this.getFileContent());
4079
+ } catch (error) {
4080
+ throw new Error(
4081
+ `Failed to parse Codex CLI hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4082
+ {
4083
+ cause: error
4084
+ }
4085
+ );
4086
+ }
4087
+ const hooks = codexcliHooksToCanonical(parsed.hooks);
4088
+ return this.toRulesyncHooksDefault({
4089
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
4090
+ });
4091
+ }
4092
+ validate() {
4093
+ return { success: true, error: null };
4094
+ }
4095
+ static forDeletion({
4096
+ baseDir = process.cwd(),
4097
+ relativeDirPath,
4098
+ relativeFilePath
4099
+ }) {
4100
+ return new _CodexcliHooks({
4101
+ baseDir,
4102
+ relativeDirPath,
4103
+ relativeFilePath,
4104
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
4105
+ validate: false
4106
+ });
4107
+ }
4108
+ };
4109
+
4110
+ // src/features/hooks/copilot-hooks.ts
4111
+ var import_node_path27 = require("path");
4112
+ var import_mini18 = require("zod/mini");
4113
+ var CopilotHookEntrySchema = import_mini18.z.looseObject({
4114
+ type: import_mini18.z.string(),
4115
+ bash: import_mini18.z.optional(import_mini18.z.string()),
4116
+ powershell: import_mini18.z.optional(import_mini18.z.string()),
4117
+ timeoutSec: import_mini18.z.optional(import_mini18.z.number())
3915
4118
  });
3916
4119
  function canonicalToCopilotHooks(config) {
3917
4120
  const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
@@ -4008,7 +4211,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
4008
4211
  }
4009
4212
  static getSettablePaths(_options = {}) {
4010
4213
  return {
4011
- relativeDirPath: (0, import_node_path26.join)(".github", "hooks"),
4214
+ relativeDirPath: (0, import_node_path27.join)(".github", "hooks"),
4012
4215
  relativeFilePath: "copilot-hooks.json"
4013
4216
  };
4014
4217
  }
@@ -4018,7 +4221,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
4018
4221
  global = false
4019
4222
  }) {
4020
4223
  const paths = _CopilotHooks.getSettablePaths({ global });
4021
- const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4224
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4022
4225
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4023
4226
  return new _CopilotHooks({
4024
4227
  baseDir,
@@ -4051,7 +4254,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
4051
4254
  parsed = JSON.parse(this.getFileContent());
4052
4255
  } catch (error) {
4053
4256
  throw new Error(
4054
- `Failed to parse Copilot hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4257
+ `Failed to parse Copilot hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4055
4258
  {
4056
4259
  cause: error
4057
4260
  }
@@ -4081,7 +4284,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
4081
4284
  };
4082
4285
 
4083
4286
  // src/features/hooks/cursor-hooks.ts
4084
- var import_node_path27 = require("path");
4287
+ var import_node_path28 = require("path");
4085
4288
  var CursorHooks = class _CursorHooks extends ToolHooks {
4086
4289
  constructor(params) {
4087
4290
  const { rulesyncHooks: _r, ...rest } = params;
@@ -4102,7 +4305,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
4102
4305
  }) {
4103
4306
  const paths = _CursorHooks.getSettablePaths();
4104
4307
  const fileContent = await readFileContent(
4105
- (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4308
+ (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4106
4309
  );
4107
4310
  return new _CursorHooks({
4108
4311
  baseDir,
@@ -4189,7 +4392,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
4189
4392
  };
4190
4393
 
4191
4394
  // src/features/hooks/deepagents-hooks.ts
4192
- var import_node_path28 = require("path");
4395
+ var import_node_path29 = require("path");
4193
4396
  function isDeepagentsHooksFile(val) {
4194
4397
  if (typeof val !== "object" || val === null || !("hooks" in val)) return false;
4195
4398
  return Array.isArray(val.hooks);
@@ -4220,6 +4423,7 @@ function canonicalToDeepagentsHooks(config) {
4220
4423
  function deepagentsToCanonicalHooks(hooksEntries) {
4221
4424
  const canonical = {};
4222
4425
  for (const entry of hooksEntries) {
4426
+ if (typeof entry !== "object" || entry === null) continue;
4223
4427
  if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
4224
4428
  let command;
4225
4429
  if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
@@ -4263,7 +4467,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
4263
4467
  global = false
4264
4468
  }) {
4265
4469
  const paths = _DeepagentsHooks.getSettablePaths({ global });
4266
- const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4470
+ const filePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4267
4471
  const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({ hooks: [] }, null, 2);
4268
4472
  return new _DeepagentsHooks({
4269
4473
  baseDir,
@@ -4297,7 +4501,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
4297
4501
  parsed = JSON.parse(this.getFileContent());
4298
4502
  } catch (error) {
4299
4503
  throw new Error(
4300
- `Failed to parse deepagents hooks content in ${(0, import_node_path28.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4504
+ `Failed to parse deepagents hooks content in ${(0, import_node_path29.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4301
4505
  { cause: error }
4302
4506
  );
4303
4507
  }
@@ -4326,7 +4530,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
4326
4530
  };
4327
4531
 
4328
4532
  // src/features/hooks/factorydroid-hooks.ts
4329
- var import_node_path29 = require("path");
4533
+ var import_node_path30 = require("path");
4330
4534
  var FACTORYDROID_CONVERTER_CONFIG = {
4331
4535
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
4332
4536
  canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
@@ -4352,7 +4556,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4352
4556
  global = false
4353
4557
  }) {
4354
4558
  const paths = _FactorydroidHooks.getSettablePaths({ global });
4355
- const filePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4559
+ const filePath = (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4356
4560
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4357
4561
  return new _FactorydroidHooks({
4358
4562
  baseDir,
@@ -4370,7 +4574,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4370
4574
  logger
4371
4575
  }) {
4372
4576
  const paths = _FactorydroidHooks.getSettablePaths({ global });
4373
- const filePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4577
+ const filePath = (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4374
4578
  const existingContent = await readOrInitializeFileContent(
4375
4579
  filePath,
4376
4580
  JSON.stringify({}, null, 2)
@@ -4407,7 +4611,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4407
4611
  settings = JSON.parse(this.getFileContent());
4408
4612
  } catch (error) {
4409
4613
  throw new Error(
4410
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path29.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4614
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path30.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4411
4615
  {
4412
4616
  cause: error
4413
4617
  }
@@ -4440,8 +4644,8 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4440
4644
  };
4441
4645
 
4442
4646
  // src/features/hooks/geminicli-hooks.ts
4443
- var import_node_path30 = require("path");
4444
- var import_mini18 = require("zod/mini");
4647
+ var import_node_path31 = require("path");
4648
+ var import_mini19 = require("zod/mini");
4445
4649
  function canonicalToGeminicliHooks(config) {
4446
4650
  const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
4447
4651
  const sharedHooks = {};
@@ -4485,16 +4689,16 @@ function canonicalToGeminicliHooks(config) {
4485
4689
  }
4486
4690
  return gemini;
4487
4691
  }
4488
- var GeminiHookEntrySchema = import_mini18.z.looseObject({
4489
- type: import_mini18.z.optional(import_mini18.z.string()),
4490
- command: import_mini18.z.optional(import_mini18.z.string()),
4491
- timeout: import_mini18.z.optional(import_mini18.z.number()),
4492
- name: import_mini18.z.optional(import_mini18.z.string()),
4493
- description: import_mini18.z.optional(import_mini18.z.string())
4692
+ var GeminiHookEntrySchema = import_mini19.z.looseObject({
4693
+ type: import_mini19.z.optional(import_mini19.z.string()),
4694
+ command: import_mini19.z.optional(import_mini19.z.string()),
4695
+ timeout: import_mini19.z.optional(import_mini19.z.number()),
4696
+ name: import_mini19.z.optional(import_mini19.z.string()),
4697
+ description: import_mini19.z.optional(import_mini19.z.string())
4494
4698
  });
4495
- var GeminiMatcherEntrySchema = import_mini18.z.looseObject({
4496
- matcher: import_mini18.z.optional(import_mini18.z.string()),
4497
- hooks: import_mini18.z.optional(import_mini18.z.array(GeminiHookEntrySchema))
4699
+ var GeminiMatcherEntrySchema = import_mini19.z.looseObject({
4700
+ matcher: import_mini19.z.optional(import_mini19.z.string()),
4701
+ hooks: import_mini19.z.optional(import_mini19.z.array(GeminiHookEntrySchema))
4498
4702
  });
4499
4703
  function geminiHooksToCanonical(geminiHooks) {
4500
4704
  if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
@@ -4549,7 +4753,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4549
4753
  global = false
4550
4754
  }) {
4551
4755
  const paths = _GeminicliHooks.getSettablePaths({ global });
4552
- const filePath = (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4756
+ const filePath = (0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4553
4757
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4554
4758
  return new _GeminicliHooks({
4555
4759
  baseDir,
@@ -4566,7 +4770,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4566
4770
  global = false
4567
4771
  }) {
4568
4772
  const paths = _GeminicliHooks.getSettablePaths({ global });
4569
- const filePath = (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4773
+ const filePath = (0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4570
4774
  const existingContent = await readOrInitializeFileContent(
4571
4775
  filePath,
4572
4776
  JSON.stringify({}, null, 2)
@@ -4598,7 +4802,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4598
4802
  settings = JSON.parse(this.getFileContent());
4599
4803
  } catch (error) {
4600
4804
  throw new Error(
4601
- `Failed to parse Gemini CLI hooks content in ${(0, import_node_path30.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4805
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path31.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4602
4806
  {
4603
4807
  cause: error
4604
4808
  }
@@ -4628,7 +4832,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4628
4832
  };
4629
4833
 
4630
4834
  // src/features/hooks/kilo-hooks.ts
4631
- var import_node_path31 = require("path");
4835
+ var import_node_path32 = require("path");
4632
4836
 
4633
4837
  // src/features/hooks/opencode-style-generator.ts
4634
4838
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
@@ -4727,7 +4931,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
4727
4931
  }
4728
4932
  static getSettablePaths(options) {
4729
4933
  return {
4730
- relativeDirPath: options?.global ? (0, import_node_path31.join)(".config", "kilo", "plugins") : (0, import_node_path31.join)(".kilo", "plugins"),
4934
+ relativeDirPath: options?.global ? (0, import_node_path32.join)(".config", "kilo", "plugins") : (0, import_node_path32.join)(".kilo", "plugins"),
4731
4935
  relativeFilePath: "rulesync-hooks.js"
4732
4936
  };
4733
4937
  }
@@ -4738,7 +4942,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
4738
4942
  }) {
4739
4943
  const paths = _KiloHooks.getSettablePaths({ global });
4740
4944
  const fileContent = await readFileContent(
4741
- (0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4945
+ (0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4742
4946
  );
4743
4947
  return new _KiloHooks({
4744
4948
  baseDir,
@@ -4792,7 +4996,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
4792
4996
  };
4793
4997
 
4794
4998
  // src/features/hooks/opencode-hooks.ts
4795
- var import_node_path32 = require("path");
4999
+ var import_node_path33 = require("path");
4796
5000
  var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4797
5001
  constructor(params) {
4798
5002
  super({
@@ -4802,7 +5006,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4802
5006
  }
4803
5007
  static getSettablePaths(options) {
4804
5008
  return {
4805
- relativeDirPath: options?.global ? (0, import_node_path32.join)(".config", "opencode", "plugins") : (0, import_node_path32.join)(".opencode", "plugins"),
5009
+ relativeDirPath: options?.global ? (0, import_node_path33.join)(".config", "opencode", "plugins") : (0, import_node_path33.join)(".opencode", "plugins"),
4806
5010
  relativeFilePath: "rulesync-hooks.js"
4807
5011
  };
4808
5012
  }
@@ -4813,7 +5017,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4813
5017
  }) {
4814
5018
  const paths = _OpencodeHooks.getSettablePaths({ global });
4815
5019
  const fileContent = await readFileContent(
4816
- (0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
5020
+ (0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4817
5021
  );
4818
5022
  return new _OpencodeHooks({
4819
5023
  baseDir,
@@ -4871,13 +5075,14 @@ var hooksProcessorToolTargetTuple = [
4871
5075
  "kilo",
4872
5076
  "cursor",
4873
5077
  "claudecode",
5078
+ "codexcli",
4874
5079
  "copilot",
4875
5080
  "opencode",
4876
5081
  "factorydroid",
4877
5082
  "geminicli",
4878
5083
  "deepagents"
4879
5084
  ];
4880
- var HooksProcessorToolTargetSchema = import_mini19.z.enum(hooksProcessorToolTargetTuple);
5085
+ var HooksProcessorToolTargetSchema = import_mini20.z.enum(hooksProcessorToolTargetTuple);
4881
5086
  var toolHooksFactories = /* @__PURE__ */ new Map([
4882
5087
  [
4883
5088
  "cursor",
@@ -4907,6 +5112,20 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
4907
5112
  supportsMatcher: true
4908
5113
  }
4909
5114
  ],
5115
+ [
5116
+ "codexcli",
5117
+ {
5118
+ class: CodexcliHooks,
5119
+ meta: {
5120
+ supportsProject: true,
5121
+ supportsGlobal: true,
5122
+ supportsImport: true
5123
+ },
5124
+ supportedEvents: CODEXCLI_HOOK_EVENTS,
5125
+ supportedHookTypes: ["command"],
5126
+ supportsMatcher: true
5127
+ }
5128
+ ],
4910
5129
  [
4911
5130
  "copilot",
4912
5131
  {
@@ -5023,7 +5242,9 @@ var HooksProcessor = class extends FeatureProcessor {
5023
5242
  return [];
5024
5243
  }
5025
5244
  }
5026
- async loadToolFiles({ forDeletion = false } = {}) {
5245
+ async loadToolFiles({
5246
+ forDeletion = false
5247
+ } = {}) {
5027
5248
  try {
5028
5249
  const factory = toolHooksFactories.get(this.toolTarget);
5029
5250
  if (!factory) throw new Error(`Unsupported tool target: ${this.toolTarget}`);
@@ -5119,7 +5340,11 @@ var HooksProcessor = class extends FeatureProcessor {
5119
5340
  validate: true,
5120
5341
  global: this.global
5121
5342
  });
5122
- return [toolHooks];
5343
+ const result = [toolHooks];
5344
+ if (this.toolTarget === "codexcli") {
5345
+ result.push(await CodexcliConfigToml.fromBaseDir({ baseDir: this.baseDir }));
5346
+ }
5347
+ return result;
5123
5348
  }
5124
5349
  async convertToolFilesToRulesyncFiles(toolFiles) {
5125
5350
  const hooks = toolFiles.filter((f) => f instanceof ToolHooks);
@@ -5137,13 +5362,13 @@ var HooksProcessor = class extends FeatureProcessor {
5137
5362
  };
5138
5363
 
5139
5364
  // src/features/ignore/ignore-processor.ts
5140
- var import_mini20 = require("zod/mini");
5365
+ var import_mini21 = require("zod/mini");
5141
5366
 
5142
5367
  // src/features/ignore/augmentcode-ignore.ts
5143
- var import_node_path34 = require("path");
5368
+ var import_node_path35 = require("path");
5144
5369
 
5145
5370
  // src/features/ignore/rulesync-ignore.ts
5146
- var import_node_path33 = require("path");
5371
+ var import_node_path34 = require("path");
5147
5372
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
5148
5373
  validate() {
5149
5374
  return { success: true, error: null };
@@ -5163,12 +5388,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
5163
5388
  static async fromFile() {
5164
5389
  const baseDir = process.cwd();
5165
5390
  const paths = this.getSettablePaths();
5166
- const recommendedPath = (0, import_node_path33.join)(
5391
+ const recommendedPath = (0, import_node_path34.join)(
5167
5392
  baseDir,
5168
5393
  paths.recommended.relativeDirPath,
5169
5394
  paths.recommended.relativeFilePath
5170
5395
  );
5171
- const legacyPath = (0, import_node_path33.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5396
+ const legacyPath = (0, import_node_path34.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5172
5397
  if (await fileExists(recommendedPath)) {
5173
5398
  const fileContent2 = await readFileContent(recommendedPath);
5174
5399
  return new _RulesyncIgnore({
@@ -5284,7 +5509,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
5284
5509
  validate = true
5285
5510
  }) {
5286
5511
  const fileContent = await readFileContent(
5287
- (0, import_node_path34.join)(
5512
+ (0, import_node_path35.join)(
5288
5513
  baseDir,
5289
5514
  this.getSettablePaths().relativeDirPath,
5290
5515
  this.getSettablePaths().relativeFilePath
@@ -5314,7 +5539,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
5314
5539
  };
5315
5540
 
5316
5541
  // src/features/ignore/claudecode-ignore.ts
5317
- var import_node_path35 = require("path");
5542
+ var import_node_path36 = require("path");
5318
5543
  var import_es_toolkit2 = require("es-toolkit");
5319
5544
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5320
5545
  constructor(params) {
@@ -5357,7 +5582,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5357
5582
  const fileContent = rulesyncIgnore.getFileContent();
5358
5583
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5359
5584
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
5360
- const filePath = (0, import_node_path35.join)(
5585
+ const filePath = (0, import_node_path36.join)(
5361
5586
  baseDir,
5362
5587
  this.getSettablePaths().relativeDirPath,
5363
5588
  this.getSettablePaths().relativeFilePath
@@ -5393,7 +5618,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5393
5618
  validate = true
5394
5619
  }) {
5395
5620
  const fileContent = await readFileContent(
5396
- (0, import_node_path35.join)(
5621
+ (0, import_node_path36.join)(
5397
5622
  baseDir,
5398
5623
  this.getSettablePaths().relativeDirPath,
5399
5624
  this.getSettablePaths().relativeFilePath
@@ -5423,7 +5648,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5423
5648
  };
5424
5649
 
5425
5650
  // src/features/ignore/cline-ignore.ts
5426
- var import_node_path36 = require("path");
5651
+ var import_node_path37 = require("path");
5427
5652
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5428
5653
  static getSettablePaths() {
5429
5654
  return {
@@ -5460,7 +5685,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5460
5685
  validate = true
5461
5686
  }) {
5462
5687
  const fileContent = await readFileContent(
5463
- (0, import_node_path36.join)(
5688
+ (0, import_node_path37.join)(
5464
5689
  baseDir,
5465
5690
  this.getSettablePaths().relativeDirPath,
5466
5691
  this.getSettablePaths().relativeFilePath
@@ -5490,7 +5715,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5490
5715
  };
5491
5716
 
5492
5717
  // src/features/ignore/cursor-ignore.ts
5493
- var import_node_path37 = require("path");
5718
+ var import_node_path38 = require("path");
5494
5719
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5495
5720
  static getSettablePaths() {
5496
5721
  return {
@@ -5523,7 +5748,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5523
5748
  validate = true
5524
5749
  }) {
5525
5750
  const fileContent = await readFileContent(
5526
- (0, import_node_path37.join)(
5751
+ (0, import_node_path38.join)(
5527
5752
  baseDir,
5528
5753
  this.getSettablePaths().relativeDirPath,
5529
5754
  this.getSettablePaths().relativeFilePath
@@ -5553,7 +5778,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5553
5778
  };
5554
5779
 
5555
5780
  // src/features/ignore/geminicli-ignore.ts
5556
- var import_node_path38 = require("path");
5781
+ var import_node_path39 = require("path");
5557
5782
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5558
5783
  static getSettablePaths() {
5559
5784
  return {
@@ -5580,7 +5805,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5580
5805
  validate = true
5581
5806
  }) {
5582
5807
  const fileContent = await readFileContent(
5583
- (0, import_node_path38.join)(
5808
+ (0, import_node_path39.join)(
5584
5809
  baseDir,
5585
5810
  this.getSettablePaths().relativeDirPath,
5586
5811
  this.getSettablePaths().relativeFilePath
@@ -5610,7 +5835,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5610
5835
  };
5611
5836
 
5612
5837
  // src/features/ignore/goose-ignore.ts
5613
- var import_node_path39 = require("path");
5838
+ var import_node_path40 = require("path");
5614
5839
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5615
5840
  static getSettablePaths() {
5616
5841
  return {
@@ -5647,7 +5872,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5647
5872
  validate = true
5648
5873
  }) {
5649
5874
  const fileContent = await readFileContent(
5650
- (0, import_node_path39.join)(
5875
+ (0, import_node_path40.join)(
5651
5876
  baseDir,
5652
5877
  this.getSettablePaths().relativeDirPath,
5653
5878
  this.getSettablePaths().relativeFilePath
@@ -5677,7 +5902,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5677
5902
  };
5678
5903
 
5679
5904
  // src/features/ignore/junie-ignore.ts
5680
- var import_node_path40 = require("path");
5905
+ var import_node_path41 = require("path");
5681
5906
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5682
5907
  static getSettablePaths() {
5683
5908
  return {
@@ -5704,7 +5929,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5704
5929
  validate = true
5705
5930
  }) {
5706
5931
  const fileContent = await readFileContent(
5707
- (0, import_node_path40.join)(
5932
+ (0, import_node_path41.join)(
5708
5933
  baseDir,
5709
5934
  this.getSettablePaths().relativeDirPath,
5710
5935
  this.getSettablePaths().relativeFilePath
@@ -5734,7 +5959,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5734
5959
  };
5735
5960
 
5736
5961
  // src/features/ignore/kilo-ignore.ts
5737
- var import_node_path41 = require("path");
5962
+ var import_node_path42 = require("path");
5738
5963
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5739
5964
  static getSettablePaths() {
5740
5965
  return {
@@ -5771,7 +5996,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5771
5996
  validate = true
5772
5997
  }) {
5773
5998
  const fileContent = await readFileContent(
5774
- (0, import_node_path41.join)(
5999
+ (0, import_node_path42.join)(
5775
6000
  baseDir,
5776
6001
  this.getSettablePaths().relativeDirPath,
5777
6002
  this.getSettablePaths().relativeFilePath
@@ -5801,7 +6026,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5801
6026
  };
5802
6027
 
5803
6028
  // src/features/ignore/kiro-ignore.ts
5804
- var import_node_path42 = require("path");
6029
+ var import_node_path43 = require("path");
5805
6030
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5806
6031
  static getSettablePaths() {
5807
6032
  return {
@@ -5828,7 +6053,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5828
6053
  validate = true
5829
6054
  }) {
5830
6055
  const fileContent = await readFileContent(
5831
- (0, import_node_path42.join)(
6056
+ (0, import_node_path43.join)(
5832
6057
  baseDir,
5833
6058
  this.getSettablePaths().relativeDirPath,
5834
6059
  this.getSettablePaths().relativeFilePath
@@ -5858,7 +6083,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5858
6083
  };
5859
6084
 
5860
6085
  // src/features/ignore/qwencode-ignore.ts
5861
- var import_node_path43 = require("path");
6086
+ var import_node_path44 = require("path");
5862
6087
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5863
6088
  static getSettablePaths() {
5864
6089
  return {
@@ -5885,7 +6110,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5885
6110
  validate = true
5886
6111
  }) {
5887
6112
  const fileContent = await readFileContent(
5888
- (0, import_node_path43.join)(
6113
+ (0, import_node_path44.join)(
5889
6114
  baseDir,
5890
6115
  this.getSettablePaths().relativeDirPath,
5891
6116
  this.getSettablePaths().relativeFilePath
@@ -5915,7 +6140,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5915
6140
  };
5916
6141
 
5917
6142
  // src/features/ignore/roo-ignore.ts
5918
- var import_node_path44 = require("path");
6143
+ var import_node_path45 = require("path");
5919
6144
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5920
6145
  static getSettablePaths() {
5921
6146
  return {
@@ -5942,7 +6167,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5942
6167
  validate = true
5943
6168
  }) {
5944
6169
  const fileContent = await readFileContent(
5945
- (0, import_node_path44.join)(
6170
+ (0, import_node_path45.join)(
5946
6171
  baseDir,
5947
6172
  this.getSettablePaths().relativeDirPath,
5948
6173
  this.getSettablePaths().relativeFilePath
@@ -5972,7 +6197,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5972
6197
  };
5973
6198
 
5974
6199
  // src/features/ignore/windsurf-ignore.ts
5975
- var import_node_path45 = require("path");
6200
+ var import_node_path46 = require("path");
5976
6201
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5977
6202
  static getSettablePaths() {
5978
6203
  return {
@@ -5999,7 +6224,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5999
6224
  validate = true
6000
6225
  }) {
6001
6226
  const fileContent = await readFileContent(
6002
- (0, import_node_path45.join)(
6227
+ (0, import_node_path46.join)(
6003
6228
  baseDir,
6004
6229
  this.getSettablePaths().relativeDirPath,
6005
6230
  this.getSettablePaths().relativeFilePath
@@ -6029,7 +6254,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
6029
6254
  };
6030
6255
 
6031
6256
  // src/features/ignore/zed-ignore.ts
6032
- var import_node_path46 = require("path");
6257
+ var import_node_path47 = require("path");
6033
6258
  var import_es_toolkit3 = require("es-toolkit");
6034
6259
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
6035
6260
  constructor(params) {
@@ -6066,7 +6291,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
6066
6291
  }) {
6067
6292
  const fileContent = rulesyncIgnore.getFileContent();
6068
6293
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
6069
- const filePath = (0, import_node_path46.join)(
6294
+ const filePath = (0, import_node_path47.join)(
6070
6295
  baseDir,
6071
6296
  this.getSettablePaths().relativeDirPath,
6072
6297
  this.getSettablePaths().relativeFilePath
@@ -6093,7 +6318,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
6093
6318
  validate = true
6094
6319
  }) {
6095
6320
  const fileContent = await readFileContent(
6096
- (0, import_node_path46.join)(
6321
+ (0, import_node_path47.join)(
6097
6322
  baseDir,
6098
6323
  this.getSettablePaths().relativeDirPath,
6099
6324
  this.getSettablePaths().relativeFilePath
@@ -6139,7 +6364,7 @@ var ignoreProcessorToolTargets = [
6139
6364
  "windsurf",
6140
6365
  "zed"
6141
6366
  ];
6142
- var IgnoreProcessorToolTargetSchema = import_mini20.z.enum(ignoreProcessorToolTargets);
6367
+ var IgnoreProcessorToolTargetSchema = import_mini21.z.enum(ignoreProcessorToolTargets);
6143
6368
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
6144
6369
  ["augmentcode", { class: AugmentcodeIgnore }],
6145
6370
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -6278,55 +6503,55 @@ var IgnoreProcessor = class extends FeatureProcessor {
6278
6503
  };
6279
6504
 
6280
6505
  // src/features/mcp/mcp-processor.ts
6281
- var import_mini25 = require("zod/mini");
6506
+ var import_mini26 = require("zod/mini");
6282
6507
 
6283
6508
  // src/features/mcp/claudecode-mcp.ts
6284
- var import_node_path48 = require("path");
6509
+ var import_node_path49 = require("path");
6285
6510
 
6286
6511
  // src/features/mcp/rulesync-mcp.ts
6287
- var import_node_path47 = require("path");
6512
+ var import_node_path48 = require("path");
6288
6513
  var import_object = require("es-toolkit/object");
6289
- var import_mini22 = require("zod/mini");
6514
+ var import_mini23 = require("zod/mini");
6290
6515
 
6291
6516
  // src/types/mcp.ts
6292
- var import_mini21 = require("zod/mini");
6293
- var McpServerSchema = import_mini21.z.looseObject({
6294
- type: import_mini21.z.optional(import_mini21.z.enum(["local", "stdio", "sse", "http"])),
6295
- command: import_mini21.z.optional(import_mini21.z.union([import_mini21.z.string(), import_mini21.z.array(import_mini21.z.string())])),
6296
- args: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6297
- url: import_mini21.z.optional(import_mini21.z.string()),
6298
- httpUrl: import_mini21.z.optional(import_mini21.z.string()),
6299
- env: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6300
- disabled: import_mini21.z.optional(import_mini21.z.boolean()),
6301
- networkTimeout: import_mini21.z.optional(import_mini21.z.number()),
6302
- timeout: import_mini21.z.optional(import_mini21.z.number()),
6303
- trust: import_mini21.z.optional(import_mini21.z.boolean()),
6304
- cwd: import_mini21.z.optional(import_mini21.z.string()),
6305
- transport: import_mini21.z.optional(import_mini21.z.enum(["local", "stdio", "sse", "http"])),
6306
- alwaysAllow: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6307
- tools: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6308
- kiroAutoApprove: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6309
- kiroAutoBlock: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6310
- headers: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6311
- enabledTools: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string())),
6312
- disabledTools: import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string()))
6517
+ var import_mini22 = require("zod/mini");
6518
+ var McpServerSchema = import_mini22.z.looseObject({
6519
+ type: import_mini22.z.optional(import_mini22.z.enum(["local", "stdio", "sse", "http"])),
6520
+ command: import_mini22.z.optional(import_mini22.z.union([import_mini22.z.string(), import_mini22.z.array(import_mini22.z.string())])),
6521
+ args: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6522
+ url: import_mini22.z.optional(import_mini22.z.string()),
6523
+ httpUrl: import_mini22.z.optional(import_mini22.z.string()),
6524
+ env: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
6525
+ disabled: import_mini22.z.optional(import_mini22.z.boolean()),
6526
+ networkTimeout: import_mini22.z.optional(import_mini22.z.number()),
6527
+ timeout: import_mini22.z.optional(import_mini22.z.number()),
6528
+ trust: import_mini22.z.optional(import_mini22.z.boolean()),
6529
+ cwd: import_mini22.z.optional(import_mini22.z.string()),
6530
+ transport: import_mini22.z.optional(import_mini22.z.enum(["local", "stdio", "sse", "http"])),
6531
+ alwaysAllow: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6532
+ tools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6533
+ kiroAutoApprove: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6534
+ kiroAutoBlock: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6535
+ headers: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
6536
+ enabledTools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
6537
+ disabledTools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
6313
6538
  });
6314
- var McpServersSchema = import_mini21.z.record(import_mini21.z.string(), McpServerSchema);
6539
+ var McpServersSchema = import_mini22.z.record(import_mini22.z.string(), McpServerSchema);
6315
6540
  function isMcpServers(value) {
6316
6541
  return value !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value);
6317
6542
  }
6318
6543
 
6319
6544
  // src/features/mcp/rulesync-mcp.ts
6320
- var RulesyncMcpServerSchema = import_mini22.z.extend(McpServerSchema, {
6321
- targets: import_mini22.z.optional(RulesyncTargetsSchema),
6322
- description: import_mini22.z.optional(import_mini22.z.string()),
6323
- exposed: import_mini22.z.optional(import_mini22.z.boolean())
6545
+ var RulesyncMcpServerSchema = import_mini23.z.extend(McpServerSchema, {
6546
+ targets: import_mini23.z.optional(RulesyncTargetsSchema),
6547
+ description: import_mini23.z.optional(import_mini23.z.string()),
6548
+ exposed: import_mini23.z.optional(import_mini23.z.boolean())
6324
6549
  });
6325
- var RulesyncMcpConfigSchema = import_mini22.z.object({
6326
- mcpServers: import_mini22.z.record(import_mini22.z.string(), RulesyncMcpServerSchema)
6550
+ var RulesyncMcpConfigSchema = import_mini23.z.object({
6551
+ mcpServers: import_mini23.z.record(import_mini23.z.string(), RulesyncMcpServerSchema)
6327
6552
  });
6328
- var RulesyncMcpFileSchema = import_mini22.z.looseObject({
6329
- $schema: import_mini22.z.optional(import_mini22.z.string()),
6553
+ var RulesyncMcpFileSchema = import_mini23.z.looseObject({
6554
+ $schema: import_mini23.z.optional(import_mini23.z.string()),
6330
6555
  ...RulesyncMcpConfigSchema.shape
6331
6556
  });
6332
6557
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
@@ -6366,12 +6591,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
6366
6591
  }) {
6367
6592
  const baseDir = process.cwd();
6368
6593
  const paths = this.getSettablePaths();
6369
- const recommendedPath = (0, import_node_path47.join)(
6594
+ const recommendedPath = (0, import_node_path48.join)(
6370
6595
  baseDir,
6371
6596
  paths.recommended.relativeDirPath,
6372
6597
  paths.recommended.relativeFilePath
6373
6598
  );
6374
- const legacyPath = (0, import_node_path47.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
6599
+ const legacyPath = (0, import_node_path48.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
6375
6600
  if (await fileExists(recommendedPath)) {
6376
6601
  const fileContent2 = await readFileContent(recommendedPath);
6377
6602
  return new _RulesyncMcp({
@@ -6525,7 +6750,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6525
6750
  global = false
6526
6751
  }) {
6527
6752
  const paths = this.getSettablePaths({ global });
6528
- const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6753
+ const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6529
6754
  const json = JSON.parse(fileContent);
6530
6755
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6531
6756
  return new _ClaudecodeMcp({
@@ -6544,7 +6769,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6544
6769
  }) {
6545
6770
  const paths = this.getSettablePaths({ global });
6546
6771
  const fileContent = await readOrInitializeFileContent(
6547
- (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6772
+ (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6548
6773
  JSON.stringify({ mcpServers: {} }, null, 2)
6549
6774
  );
6550
6775
  const json = JSON.parse(fileContent);
@@ -6583,7 +6808,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6583
6808
  };
6584
6809
 
6585
6810
  // src/features/mcp/cline-mcp.ts
6586
- var import_node_path49 = require("path");
6811
+ var import_node_path50 = require("path");
6587
6812
  var ClineMcp = class _ClineMcp extends ToolMcp {
6588
6813
  json;
6589
6814
  constructor(params) {
@@ -6604,7 +6829,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6604
6829
  validate = true
6605
6830
  }) {
6606
6831
  const fileContent = await readFileContent(
6607
- (0, import_node_path49.join)(
6832
+ (0, import_node_path50.join)(
6608
6833
  baseDir,
6609
6834
  this.getSettablePaths().relativeDirPath,
6610
6835
  this.getSettablePaths().relativeFilePath
@@ -6653,8 +6878,8 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6653
6878
  };
6654
6879
 
6655
6880
  // src/features/mcp/codexcli-mcp.ts
6656
- var import_node_path50 = require("path");
6657
- var smolToml2 = __toESM(require("smol-toml"), 1);
6881
+ var import_node_path51 = require("path");
6882
+ var smolToml3 = __toESM(require("smol-toml"), 1);
6658
6883
  function convertFromCodexFormat(codexMcp) {
6659
6884
  const result = {};
6660
6885
  for (const [name, config] of Object.entries(codexMcp)) {
@@ -6707,7 +6932,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6707
6932
  ...rest,
6708
6933
  validate: false
6709
6934
  });
6710
- this.toml = smolToml2.parse(this.fileContent);
6935
+ this.toml = smolToml3.parse(this.fileContent);
6711
6936
  if (rest.validate) {
6712
6937
  const result = this.validate();
6713
6938
  if (!result.success) {
@@ -6736,7 +6961,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6736
6961
  global = false
6737
6962
  }) {
6738
6963
  const paths = this.getSettablePaths({ global });
6739
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml2.stringify({});
6964
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml3.stringify({});
6740
6965
  return new _CodexcliMcp({
6741
6966
  baseDir,
6742
6967
  relativeDirPath: paths.relativeDirPath,
@@ -6752,12 +6977,12 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6752
6977
  global = false
6753
6978
  }) {
6754
6979
  const paths = this.getSettablePaths({ global });
6755
- const configTomlFilePath = (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6980
+ const configTomlFilePath = (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6756
6981
  const configTomlFileContent = await readOrInitializeFileContent(
6757
6982
  configTomlFilePath,
6758
- smolToml2.stringify({})
6983
+ smolToml3.stringify({})
6759
6984
  );
6760
- const configToml = smolToml2.parse(configTomlFileContent);
6985
+ const configToml = smolToml3.parse(configTomlFileContent);
6761
6986
  const mcpServers = rulesyncMcp.getJson().mcpServers;
6762
6987
  const converted = convertToCodexFormat(mcpServers);
6763
6988
  const filteredMcpServers = this.removeEmptyEntries(converted);
@@ -6766,7 +6991,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6766
6991
  baseDir,
6767
6992
  relativeDirPath: paths.relativeDirPath,
6768
6993
  relativeFilePath: paths.relativeFilePath,
6769
- fileContent: smolToml2.stringify(configToml),
6994
+ fileContent: smolToml3.stringify(configToml),
6770
6995
  validate
6771
6996
  });
6772
6997
  }
@@ -6806,7 +7031,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6806
7031
  };
6807
7032
 
6808
7033
  // src/features/mcp/copilot-mcp.ts
6809
- var import_node_path51 = require("path");
7034
+ var import_node_path52 = require("path");
6810
7035
  function convertToCopilotFormat(mcpServers) {
6811
7036
  return { servers: mcpServers };
6812
7037
  }
@@ -6833,7 +7058,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6833
7058
  validate = true
6834
7059
  }) {
6835
7060
  const fileContent = await readFileContent(
6836
- (0, import_node_path51.join)(
7061
+ (0, import_node_path52.join)(
6837
7062
  baseDir,
6838
7063
  this.getSettablePaths().relativeDirPath,
6839
7064
  this.getSettablePaths().relativeFilePath
@@ -6886,7 +7111,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6886
7111
  };
6887
7112
 
6888
7113
  // src/features/mcp/copilotcli-mcp.ts
6889
- var import_node_path52 = require("path");
7114
+ var import_node_path53 = require("path");
6890
7115
  var isRemoteServerType = (type) => {
6891
7116
  return type === "http" || type === "sse";
6892
7117
  };
@@ -6984,7 +7209,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
6984
7209
  global = false
6985
7210
  }) {
6986
7211
  const paths = this.getSettablePaths({ global });
6987
- const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7212
+ const fileContent = await readFileContentOrNull((0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6988
7213
  const json = JSON.parse(fileContent);
6989
7214
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6990
7215
  return new _CopilotcliMcp({
@@ -7004,7 +7229,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
7004
7229
  }) {
7005
7230
  const paths = this.getSettablePaths({ global });
7006
7231
  const fileContent = await readOrInitializeFileContent(
7007
- (0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7232
+ (0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7008
7233
  JSON.stringify({ mcpServers: {} }, null, 2)
7009
7234
  );
7010
7235
  const json = JSON.parse(fileContent);
@@ -7046,7 +7271,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
7046
7271
  };
7047
7272
 
7048
7273
  // src/features/mcp/cursor-mcp.ts
7049
- var import_node_path53 = require("path");
7274
+ var import_node_path54 = require("path");
7050
7275
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
7051
7276
  function convertEnvFromCursorFormat(mcpServers) {
7052
7277
  return Object.fromEntries(
@@ -7093,7 +7318,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
7093
7318
  this.json = JSON.parse(this.fileContent);
7094
7319
  } catch (error) {
7095
7320
  throw new Error(
7096
- `Failed to parse Cursor MCP config at ${(0, import_node_path53.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
7321
+ `Failed to parse Cursor MCP config at ${(0, import_node_path54.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
7097
7322
  { cause: error }
7098
7323
  );
7099
7324
  }
@@ -7119,14 +7344,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
7119
7344
  global = false
7120
7345
  }) {
7121
7346
  const paths = this.getSettablePaths({ global });
7122
- const filePath = (0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
7347
+ const filePath = (0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
7123
7348
  const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
7124
7349
  let json;
7125
7350
  try {
7126
7351
  json = JSON.parse(fileContent);
7127
7352
  } catch (error) {
7128
7353
  throw new Error(
7129
- `Failed to parse Cursor MCP config at ${(0, import_node_path53.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
7354
+ `Failed to parse Cursor MCP config at ${(0, import_node_path54.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
7130
7355
  { cause: error }
7131
7356
  );
7132
7357
  }
@@ -7148,7 +7373,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
7148
7373
  }) {
7149
7374
  const paths = this.getSettablePaths({ global });
7150
7375
  const fileContent = await readOrInitializeFileContent(
7151
- (0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7376
+ (0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7152
7377
  JSON.stringify({ mcpServers: {} }, null, 2)
7153
7378
  );
7154
7379
  let json;
@@ -7156,7 +7381,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
7156
7381
  json = JSON.parse(fileContent);
7157
7382
  } catch (error) {
7158
7383
  throw new Error(
7159
- `Failed to parse Cursor MCP config at ${(0, import_node_path53.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
7384
+ `Failed to parse Cursor MCP config at ${(0, import_node_path54.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
7160
7385
  { cause: error }
7161
7386
  );
7162
7387
  }
@@ -7205,7 +7430,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
7205
7430
  };
7206
7431
 
7207
7432
  // src/features/mcp/deepagents-mcp.ts
7208
- var import_node_path54 = require("path");
7433
+ var import_node_path55 = require("path");
7209
7434
  var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
7210
7435
  json;
7211
7436
  constructor(params) {
@@ -7230,7 +7455,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
7230
7455
  global = false
7231
7456
  }) {
7232
7457
  const paths = this.getSettablePaths({ global });
7233
- const fileContent = await readFileContentOrNull((0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7458
+ const fileContent = await readFileContentOrNull((0, import_node_path55.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7234
7459
  const json = JSON.parse(fileContent);
7235
7460
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
7236
7461
  return new _DeepagentsMcp({
@@ -7249,7 +7474,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
7249
7474
  }) {
7250
7475
  const paths = this.getSettablePaths({ global });
7251
7476
  const fileContent = await readOrInitializeFileContent(
7252
- (0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7477
+ (0, import_node_path55.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7253
7478
  JSON.stringify({ mcpServers: {} }, null, 2)
7254
7479
  );
7255
7480
  const json = JSON.parse(fileContent);
@@ -7288,7 +7513,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
7288
7513
  };
7289
7514
 
7290
7515
  // src/features/mcp/factorydroid-mcp.ts
7291
- var import_node_path55 = require("path");
7516
+ var import_node_path56 = require("path");
7292
7517
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
7293
7518
  json;
7294
7519
  constructor(params) {
@@ -7309,7 +7534,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
7309
7534
  validate = true
7310
7535
  }) {
7311
7536
  const fileContent = await readFileContent(
7312
- (0, import_node_path55.join)(
7537
+ (0, import_node_path56.join)(
7313
7538
  baseDir,
7314
7539
  this.getSettablePaths().relativeDirPath,
7315
7540
  this.getSettablePaths().relativeFilePath
@@ -7363,7 +7588,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
7363
7588
  };
7364
7589
 
7365
7590
  // src/features/mcp/geminicli-mcp.ts
7366
- var import_node_path56 = require("path");
7591
+ var import_node_path57 = require("path");
7367
7592
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
7368
7593
  json;
7369
7594
  constructor(params) {
@@ -7391,7 +7616,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
7391
7616
  global = false
7392
7617
  }) {
7393
7618
  const paths = this.getSettablePaths({ global });
7394
- const fileContent = await readFileContentOrNull((0, import_node_path56.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7619
+ const fileContent = await readFileContentOrNull((0, import_node_path57.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7395
7620
  const json = JSON.parse(fileContent);
7396
7621
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
7397
7622
  return new _GeminiCliMcp({
@@ -7410,7 +7635,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
7410
7635
  }) {
7411
7636
  const paths = this.getSettablePaths({ global });
7412
7637
  const fileContent = await readOrInitializeFileContent(
7413
- (0, import_node_path56.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7638
+ (0, import_node_path57.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7414
7639
  JSON.stringify({ mcpServers: {} }, null, 2)
7415
7640
  );
7416
7641
  const json = JSON.parse(fileContent);
@@ -7455,7 +7680,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
7455
7680
  };
7456
7681
 
7457
7682
  // src/features/mcp/junie-mcp.ts
7458
- var import_node_path57 = require("path");
7683
+ var import_node_path58 = require("path");
7459
7684
  var JunieMcp = class _JunieMcp extends ToolMcp {
7460
7685
  json;
7461
7686
  constructor(params) {
@@ -7467,7 +7692,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
7467
7692
  }
7468
7693
  static getSettablePaths() {
7469
7694
  return {
7470
- relativeDirPath: (0, import_node_path57.join)(".junie", "mcp"),
7695
+ relativeDirPath: (0, import_node_path58.join)(".junie", "mcp"),
7471
7696
  relativeFilePath: "mcp.json"
7472
7697
  };
7473
7698
  }
@@ -7476,7 +7701,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
7476
7701
  validate = true
7477
7702
  }) {
7478
7703
  const fileContent = await readFileContent(
7479
- (0, import_node_path57.join)(
7704
+ (0, import_node_path58.join)(
7480
7705
  baseDir,
7481
7706
  this.getSettablePaths().relativeDirPath,
7482
7707
  this.getSettablePaths().relativeFilePath
@@ -7525,27 +7750,27 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
7525
7750
  };
7526
7751
 
7527
7752
  // src/features/mcp/kilo-mcp.ts
7528
- var import_node_path58 = require("path");
7753
+ var import_node_path59 = require("path");
7529
7754
  var import_jsonc_parser3 = require("jsonc-parser");
7530
- var import_mini23 = require("zod/mini");
7531
- var KiloMcpLocalServerSchema = import_mini23.z.object({
7532
- type: import_mini23.z.literal("local"),
7533
- command: import_mini23.z.array(import_mini23.z.string()),
7534
- environment: import_mini23.z.optional(import_mini23.z.record(import_mini23.z.string(), import_mini23.z.string())),
7535
- enabled: import_mini23.z._default(import_mini23.z.boolean(), true),
7536
- cwd: import_mini23.z.optional(import_mini23.z.string())
7755
+ var import_mini24 = require("zod/mini");
7756
+ var KiloMcpLocalServerSchema = import_mini24.z.object({
7757
+ type: import_mini24.z.literal("local"),
7758
+ command: import_mini24.z.array(import_mini24.z.string()),
7759
+ environment: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
7760
+ enabled: import_mini24.z._default(import_mini24.z.boolean(), true),
7761
+ cwd: import_mini24.z.optional(import_mini24.z.string())
7537
7762
  });
7538
- var KiloMcpRemoteServerSchema = import_mini23.z.object({
7539
- type: import_mini23.z.literal("remote"),
7540
- url: import_mini23.z.string(),
7541
- headers: import_mini23.z.optional(import_mini23.z.record(import_mini23.z.string(), import_mini23.z.string())),
7542
- enabled: import_mini23.z._default(import_mini23.z.boolean(), true)
7763
+ var KiloMcpRemoteServerSchema = import_mini24.z.object({
7764
+ type: import_mini24.z.literal("remote"),
7765
+ url: import_mini24.z.string(),
7766
+ headers: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
7767
+ enabled: import_mini24.z._default(import_mini24.z.boolean(), true)
7543
7768
  });
7544
- var KiloMcpServerSchema = import_mini23.z.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
7545
- var KiloConfigSchema = import_mini23.z.looseObject({
7546
- $schema: import_mini23.z.optional(import_mini23.z.string()),
7547
- mcp: import_mini23.z.optional(import_mini23.z.record(import_mini23.z.string(), KiloMcpServerSchema)),
7548
- tools: import_mini23.z.optional(import_mini23.z.record(import_mini23.z.string(), import_mini23.z.boolean()))
7769
+ var KiloMcpServerSchema = import_mini24.z.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
7770
+ var KiloConfigSchema = import_mini24.z.looseObject({
7771
+ $schema: import_mini24.z.optional(import_mini24.z.string()),
7772
+ mcp: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), KiloMcpServerSchema)),
7773
+ tools: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.boolean()))
7549
7774
  });
7550
7775
  function convertFromKiloFormat(kiloMcp, tools) {
7551
7776
  return Object.fromEntries(
@@ -7663,7 +7888,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7663
7888
  static getSettablePaths({ global } = {}) {
7664
7889
  if (global) {
7665
7890
  return {
7666
- relativeDirPath: (0, import_node_path58.join)(".config", "kilo"),
7891
+ relativeDirPath: (0, import_node_path59.join)(".config", "kilo"),
7667
7892
  relativeFilePath: "kilo.json"
7668
7893
  };
7669
7894
  }
@@ -7678,11 +7903,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7678
7903
  global = false
7679
7904
  }) {
7680
7905
  const basePaths = this.getSettablePaths({ global });
7681
- const jsonDir = (0, import_node_path58.join)(baseDir, basePaths.relativeDirPath);
7906
+ const jsonDir = (0, import_node_path59.join)(baseDir, basePaths.relativeDirPath);
7682
7907
  let fileContent = null;
7683
7908
  let relativeFilePath = "kilo.jsonc";
7684
- const jsoncPath = (0, import_node_path58.join)(jsonDir, "kilo.jsonc");
7685
- const jsonPath = (0, import_node_path58.join)(jsonDir, "kilo.json");
7909
+ const jsoncPath = (0, import_node_path59.join)(jsonDir, "kilo.jsonc");
7910
+ const jsonPath = (0, import_node_path59.join)(jsonDir, "kilo.json");
7686
7911
  fileContent = await readFileContentOrNull(jsoncPath);
7687
7912
  if (!fileContent) {
7688
7913
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7708,11 +7933,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7708
7933
  global = false
7709
7934
  }) {
7710
7935
  const basePaths = this.getSettablePaths({ global });
7711
- const jsonDir = (0, import_node_path58.join)(baseDir, basePaths.relativeDirPath);
7936
+ const jsonDir = (0, import_node_path59.join)(baseDir, basePaths.relativeDirPath);
7712
7937
  let fileContent = null;
7713
7938
  let relativeFilePath = "kilo.jsonc";
7714
- const jsoncPath = (0, import_node_path58.join)(jsonDir, "kilo.jsonc");
7715
- const jsonPath = (0, import_node_path58.join)(jsonDir, "kilo.json");
7939
+ const jsoncPath = (0, import_node_path59.join)(jsonDir, "kilo.jsonc");
7940
+ const jsonPath = (0, import_node_path59.join)(jsonDir, "kilo.json");
7716
7941
  fileContent = await readFileContentOrNull(jsoncPath);
7717
7942
  if (!fileContent) {
7718
7943
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7771,7 +7996,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7771
7996
  };
7772
7997
 
7773
7998
  // src/features/mcp/kiro-mcp.ts
7774
- var import_node_path59 = require("path");
7999
+ var import_node_path60 = require("path");
7775
8000
  var KiroMcp = class _KiroMcp extends ToolMcp {
7776
8001
  json;
7777
8002
  constructor(params) {
@@ -7783,7 +8008,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7783
8008
  }
7784
8009
  static getSettablePaths() {
7785
8010
  return {
7786
- relativeDirPath: (0, import_node_path59.join)(".kiro", "settings"),
8011
+ relativeDirPath: (0, import_node_path60.join)(".kiro", "settings"),
7787
8012
  relativeFilePath: "mcp.json"
7788
8013
  };
7789
8014
  }
@@ -7792,7 +8017,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7792
8017
  validate = true
7793
8018
  }) {
7794
8019
  const paths = this.getSettablePaths();
7795
- const fileContent = await readFileContentOrNull((0, import_node_path59.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
8020
+ const fileContent = await readFileContentOrNull((0, import_node_path60.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7796
8021
  return new _KiroMcp({
7797
8022
  baseDir,
7798
8023
  relativeDirPath: paths.relativeDirPath,
@@ -7840,30 +8065,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7840
8065
  };
7841
8066
 
7842
8067
  // src/features/mcp/opencode-mcp.ts
7843
- var import_node_path60 = require("path");
8068
+ var import_node_path61 = require("path");
7844
8069
  var import_jsonc_parser4 = require("jsonc-parser");
7845
- var import_mini24 = require("zod/mini");
7846
- var OpencodeMcpLocalServerSchema = import_mini24.z.object({
7847
- type: import_mini24.z.literal("local"),
7848
- command: import_mini24.z.array(import_mini24.z.string()),
7849
- environment: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
7850
- enabled: import_mini24.z._default(import_mini24.z.boolean(), true),
7851
- cwd: import_mini24.z.optional(import_mini24.z.string())
8070
+ var import_mini25 = require("zod/mini");
8071
+ var OpencodeMcpLocalServerSchema = import_mini25.z.object({
8072
+ type: import_mini25.z.literal("local"),
8073
+ command: import_mini25.z.array(import_mini25.z.string()),
8074
+ environment: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.string())),
8075
+ enabled: import_mini25.z._default(import_mini25.z.boolean(), true),
8076
+ cwd: import_mini25.z.optional(import_mini25.z.string())
7852
8077
  });
7853
- var OpencodeMcpRemoteServerSchema = import_mini24.z.object({
7854
- type: import_mini24.z.literal("remote"),
7855
- url: import_mini24.z.string(),
7856
- headers: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
7857
- enabled: import_mini24.z._default(import_mini24.z.boolean(), true)
8078
+ var OpencodeMcpRemoteServerSchema = import_mini25.z.object({
8079
+ type: import_mini25.z.literal("remote"),
8080
+ url: import_mini25.z.string(),
8081
+ headers: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.string())),
8082
+ enabled: import_mini25.z._default(import_mini25.z.boolean(), true)
7858
8083
  });
7859
- var OpencodeMcpServerSchema = import_mini24.z.union([
8084
+ var OpencodeMcpServerSchema = import_mini25.z.union([
7860
8085
  OpencodeMcpLocalServerSchema,
7861
8086
  OpencodeMcpRemoteServerSchema
7862
8087
  ]);
7863
- var OpencodeConfigSchema = import_mini24.z.looseObject({
7864
- $schema: import_mini24.z.optional(import_mini24.z.string()),
7865
- mcp: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), OpencodeMcpServerSchema)),
7866
- tools: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.boolean()))
8088
+ var OpencodeConfigSchema = import_mini25.z.looseObject({
8089
+ $schema: import_mini25.z.optional(import_mini25.z.string()),
8090
+ mcp: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), OpencodeMcpServerSchema)),
8091
+ tools: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.boolean()))
7867
8092
  });
7868
8093
  function convertFromOpencodeFormat(opencodeMcp, tools) {
7869
8094
  return Object.fromEntries(
@@ -7981,7 +8206,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7981
8206
  static getSettablePaths({ global } = {}) {
7982
8207
  if (global) {
7983
8208
  return {
7984
- relativeDirPath: (0, import_node_path60.join)(".config", "opencode"),
8209
+ relativeDirPath: (0, import_node_path61.join)(".config", "opencode"),
7985
8210
  relativeFilePath: "opencode.json"
7986
8211
  };
7987
8212
  }
@@ -7996,11 +8221,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7996
8221
  global = false
7997
8222
  }) {
7998
8223
  const basePaths = this.getSettablePaths({ global });
7999
- const jsonDir = (0, import_node_path60.join)(baseDir, basePaths.relativeDirPath);
8224
+ const jsonDir = (0, import_node_path61.join)(baseDir, basePaths.relativeDirPath);
8000
8225
  let fileContent = null;
8001
8226
  let relativeFilePath = "opencode.jsonc";
8002
- const jsoncPath = (0, import_node_path60.join)(jsonDir, "opencode.jsonc");
8003
- const jsonPath = (0, import_node_path60.join)(jsonDir, "opencode.json");
8227
+ const jsoncPath = (0, import_node_path61.join)(jsonDir, "opencode.jsonc");
8228
+ const jsonPath = (0, import_node_path61.join)(jsonDir, "opencode.json");
8004
8229
  fileContent = await readFileContentOrNull(jsoncPath);
8005
8230
  if (!fileContent) {
8006
8231
  fileContent = await readFileContentOrNull(jsonPath);
@@ -8026,11 +8251,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
8026
8251
  global = false
8027
8252
  }) {
8028
8253
  const basePaths = this.getSettablePaths({ global });
8029
- const jsonDir = (0, import_node_path60.join)(baseDir, basePaths.relativeDirPath);
8254
+ const jsonDir = (0, import_node_path61.join)(baseDir, basePaths.relativeDirPath);
8030
8255
  let fileContent = null;
8031
8256
  let relativeFilePath = "opencode.jsonc";
8032
- const jsoncPath = (0, import_node_path60.join)(jsonDir, "opencode.jsonc");
8033
- const jsonPath = (0, import_node_path60.join)(jsonDir, "opencode.json");
8257
+ const jsoncPath = (0, import_node_path61.join)(jsonDir, "opencode.jsonc");
8258
+ const jsonPath = (0, import_node_path61.join)(jsonDir, "opencode.json");
8034
8259
  fileContent = await readFileContentOrNull(jsoncPath);
8035
8260
  if (!fileContent) {
8036
8261
  fileContent = await readFileContentOrNull(jsonPath);
@@ -8091,7 +8316,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
8091
8316
  };
8092
8317
 
8093
8318
  // src/features/mcp/roo-mcp.ts
8094
- var import_node_path61 = require("path");
8319
+ var import_node_path62 = require("path");
8095
8320
  function convertToRooFormat(mcpServers) {
8096
8321
  return Object.fromEntries(
8097
8322
  Object.entries(mcpServers).map(([serverName, serverConfig]) => {
@@ -8143,7 +8368,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
8143
8368
  validate = true
8144
8369
  }) {
8145
8370
  const fileContent = await readFileContent(
8146
- (0, import_node_path61.join)(
8371
+ (0, import_node_path62.join)(
8147
8372
  baseDir,
8148
8373
  this.getSettablePaths().relativeDirPath,
8149
8374
  this.getSettablePaths().relativeFilePath
@@ -8198,9 +8423,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
8198
8423
  };
8199
8424
 
8200
8425
  // src/features/mcp/rovodev-mcp.ts
8201
- var import_node_path62 = require("path");
8426
+ var import_node_path63 = require("path");
8202
8427
  function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
8203
- const configPath = (0, import_node_path62.join)(relativeDirPath, relativeFilePath);
8428
+ const configPath = (0, import_node_path63.join)(relativeDirPath, relativeFilePath);
8204
8429
  let parsed;
8205
8430
  try {
8206
8431
  parsed = JSON.parse(fileContent);
@@ -8249,7 +8474,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
8249
8474
  throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
8250
8475
  }
8251
8476
  const paths = this.getSettablePaths({ global });
8252
- const filePath = (0, import_node_path62.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
8477
+ const filePath = (0, import_node_path63.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
8253
8478
  const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
8254
8479
  const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
8255
8480
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
@@ -8273,7 +8498,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
8273
8498
  }
8274
8499
  const paths = this.getSettablePaths({ global });
8275
8500
  const fileContent = await readOrInitializeFileContent(
8276
- (0, import_node_path62.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
8501
+ (0, import_node_path63.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
8277
8502
  JSON.stringify({ mcpServers: {} }, null, 2)
8278
8503
  );
8279
8504
  const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
@@ -8334,7 +8559,7 @@ var mcpProcessorToolTargetTuple = [
8334
8559
  "roo",
8335
8560
  "rovodev"
8336
8561
  ];
8337
- var McpProcessorToolTargetSchema = import_mini25.z.enum(mcpProcessorToolTargetTuple);
8562
+ var McpProcessorToolTargetSchema = import_mini26.z.enum(mcpProcessorToolTargetTuple);
8338
8563
  var toolMcpFactories = /* @__PURE__ */ new Map([
8339
8564
  [
8340
8565
  "claudecode",
@@ -8673,25 +8898,25 @@ var McpProcessor = class extends FeatureProcessor {
8673
8898
  };
8674
8899
 
8675
8900
  // src/features/rules/rules-processor.ts
8676
- var import_node_path132 = require("path");
8901
+ var import_node_path133 = require("path");
8677
8902
  var import_toon = require("@toon-format/toon");
8678
- var import_mini64 = require("zod/mini");
8903
+ var import_mini65 = require("zod/mini");
8679
8904
 
8680
8905
  // src/constants/general.ts
8681
8906
  var SKILL_FILE_NAME = "SKILL.md";
8682
8907
 
8683
8908
  // src/features/skills/agentsmd-skill.ts
8684
- var import_node_path66 = require("path");
8909
+ var import_node_path67 = require("path");
8685
8910
 
8686
8911
  // src/features/skills/simulated-skill.ts
8687
- var import_node_path65 = require("path");
8688
- var import_mini26 = require("zod/mini");
8912
+ var import_node_path66 = require("path");
8913
+ var import_mini27 = require("zod/mini");
8689
8914
 
8690
8915
  // src/features/skills/tool-skill.ts
8691
- var import_node_path64 = require("path");
8916
+ var import_node_path65 = require("path");
8692
8917
 
8693
8918
  // src/types/ai-dir.ts
8694
- var import_node_path63 = __toESM(require("path"), 1);
8919
+ var import_node_path64 = __toESM(require("path"), 1);
8695
8920
  var AiDir = class {
8696
8921
  /**
8697
8922
  * @example "."
@@ -8725,7 +8950,7 @@ var AiDir = class {
8725
8950
  otherFiles = [],
8726
8951
  global = false
8727
8952
  }) {
8728
- if (dirName.includes(import_node_path63.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
8953
+ if (dirName.includes(import_node_path64.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
8729
8954
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
8730
8955
  }
8731
8956
  this.baseDir = baseDir;
@@ -8748,11 +8973,11 @@ var AiDir = class {
8748
8973
  return this.dirName;
8749
8974
  }
8750
8975
  getDirPath() {
8751
- const fullPath = import_node_path63.default.join(this.baseDir, this.relativeDirPath, this.dirName);
8752
- const resolvedFull = (0, import_node_path63.resolve)(fullPath);
8753
- const resolvedBase = (0, import_node_path63.resolve)(this.baseDir);
8754
- const rel = (0, import_node_path63.relative)(resolvedBase, resolvedFull);
8755
- if (rel.startsWith("..") || import_node_path63.default.isAbsolute(rel)) {
8976
+ const fullPath = import_node_path64.default.join(this.baseDir, this.relativeDirPath, this.dirName);
8977
+ const resolvedFull = (0, import_node_path64.resolve)(fullPath);
8978
+ const resolvedBase = (0, import_node_path64.resolve)(this.baseDir);
8979
+ const rel = (0, import_node_path64.relative)(resolvedBase, resolvedFull);
8980
+ if (rel.startsWith("..") || import_node_path64.default.isAbsolute(rel)) {
8756
8981
  throw new Error(
8757
8982
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
8758
8983
  );
@@ -8769,7 +8994,7 @@ var AiDir = class {
8769
8994
  * Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
8770
8995
  */
8771
8996
  getRelativePathFromCwd() {
8772
- return toPosixPath(import_node_path63.default.join(this.relativeDirPath, this.dirName));
8997
+ return toPosixPath(import_node_path64.default.join(this.relativeDirPath, this.dirName));
8773
8998
  }
8774
8999
  getGlobal() {
8775
9000
  return this.global;
@@ -8788,15 +9013,15 @@ var AiDir = class {
8788
9013
  * @returns Array of files with their relative paths and buffers
8789
9014
  */
8790
9015
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
8791
- const dirPath = (0, import_node_path63.join)(baseDir, relativeDirPath, dirName);
8792
- const glob = (0, import_node_path63.join)(dirPath, "**", "*");
9016
+ const dirPath = (0, import_node_path64.join)(baseDir, relativeDirPath, dirName);
9017
+ const glob = (0, import_node_path64.join)(dirPath, "**", "*");
8793
9018
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
8794
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path63.basename)(filePath) !== excludeFileName);
9019
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path64.basename)(filePath) !== excludeFileName);
8795
9020
  const files = await Promise.all(
8796
9021
  filteredPaths.map(async (filePath) => {
8797
9022
  const fileBuffer = await readFileBuffer(filePath);
8798
9023
  return {
8799
- relativeFilePathToDirPath: (0, import_node_path63.relative)(dirPath, filePath),
9024
+ relativeFilePathToDirPath: (0, import_node_path64.relative)(dirPath, filePath),
8800
9025
  fileBuffer
8801
9026
  };
8802
9027
  })
@@ -8890,8 +9115,8 @@ var ToolSkill = class extends AiDir {
8890
9115
  }) {
8891
9116
  const settablePaths = getSettablePaths({ global });
8892
9117
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
8893
- const skillDirPath = (0, import_node_path64.join)(baseDir, actualRelativeDirPath, dirName);
8894
- const skillFilePath = (0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME);
9118
+ const skillDirPath = (0, import_node_path65.join)(baseDir, actualRelativeDirPath, dirName);
9119
+ const skillFilePath = (0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME);
8895
9120
  if (!await fileExists(skillFilePath)) {
8896
9121
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8897
9122
  }
@@ -8915,16 +9140,16 @@ var ToolSkill = class extends AiDir {
8915
9140
  }
8916
9141
  requireMainFileFrontmatter() {
8917
9142
  if (!this.mainFile?.frontmatter) {
8918
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path64.join)(this.relativeDirPath, this.dirName)}`);
9143
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path65.join)(this.relativeDirPath, this.dirName)}`);
8919
9144
  }
8920
9145
  return this.mainFile.frontmatter;
8921
9146
  }
8922
9147
  };
8923
9148
 
8924
9149
  // src/features/skills/simulated-skill.ts
8925
- var SimulatedSkillFrontmatterSchema = import_mini26.z.looseObject({
8926
- name: import_mini26.z.string(),
8927
- description: import_mini26.z.string()
9150
+ var SimulatedSkillFrontmatterSchema = import_mini27.z.looseObject({
9151
+ name: import_mini27.z.string(),
9152
+ description: import_mini27.z.string()
8928
9153
  });
8929
9154
  var SimulatedSkill = class extends ToolSkill {
8930
9155
  frontmatter;
@@ -8955,7 +9180,7 @@ var SimulatedSkill = class extends ToolSkill {
8955
9180
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
8956
9181
  if (!result.success) {
8957
9182
  throw new Error(
8958
- `Invalid frontmatter in ${(0, import_node_path65.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
9183
+ `Invalid frontmatter in ${(0, import_node_path66.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
8959
9184
  );
8960
9185
  }
8961
9186
  }
@@ -9014,8 +9239,8 @@ var SimulatedSkill = class extends ToolSkill {
9014
9239
  }) {
9015
9240
  const settablePaths = this.getSettablePaths();
9016
9241
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9017
- const skillDirPath = (0, import_node_path65.join)(baseDir, actualRelativeDirPath, dirName);
9018
- const skillFilePath = (0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME);
9242
+ const skillDirPath = (0, import_node_path66.join)(baseDir, actualRelativeDirPath, dirName);
9243
+ const skillFilePath = (0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME);
9019
9244
  if (!await fileExists(skillFilePath)) {
9020
9245
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9021
9246
  }
@@ -9092,7 +9317,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9092
9317
  throw new Error("AgentsmdSkill does not support global mode.");
9093
9318
  }
9094
9319
  return {
9095
- relativeDirPath: (0, import_node_path66.join)(".agents", "skills")
9320
+ relativeDirPath: (0, import_node_path67.join)(".agents", "skills")
9096
9321
  };
9097
9322
  }
9098
9323
  static async fromDir(params) {
@@ -9119,11 +9344,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9119
9344
  };
9120
9345
 
9121
9346
  // src/features/skills/factorydroid-skill.ts
9122
- var import_node_path67 = require("path");
9347
+ var import_node_path68 = require("path");
9123
9348
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
9124
9349
  static getSettablePaths(_options) {
9125
9350
  return {
9126
- relativeDirPath: (0, import_node_path67.join)(".factory", "skills")
9351
+ relativeDirPath: (0, import_node_path68.join)(".factory", "skills")
9127
9352
  };
9128
9353
  }
9129
9354
  static async fromDir(params) {
@@ -9150,50 +9375,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
9150
9375
  };
9151
9376
 
9152
9377
  // src/features/skills/rovodev-skill.ts
9153
- var import_node_path69 = require("path");
9154
- var import_mini28 = require("zod/mini");
9378
+ var import_node_path70 = require("path");
9379
+ var import_mini29 = require("zod/mini");
9155
9380
 
9156
9381
  // src/features/skills/rulesync-skill.ts
9157
- var import_node_path68 = require("path");
9158
- var import_mini27 = require("zod/mini");
9159
- var RulesyncSkillFrontmatterSchemaInternal = import_mini27.z.looseObject({
9160
- name: import_mini27.z.string(),
9161
- description: import_mini27.z.string(),
9162
- targets: import_mini27.z._default(RulesyncTargetsSchema, ["*"]),
9163
- claudecode: import_mini27.z.optional(
9164
- import_mini27.z.looseObject({
9165
- "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string())),
9166
- model: import_mini27.z.optional(import_mini27.z.string()),
9167
- "disable-model-invocation": import_mini27.z.optional(import_mini27.z.boolean())
9382
+ var import_node_path69 = require("path");
9383
+ var import_mini28 = require("zod/mini");
9384
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini28.z.looseObject({
9385
+ name: import_mini28.z.string(),
9386
+ description: import_mini28.z.string(),
9387
+ targets: import_mini28.z._default(RulesyncTargetsSchema, ["*"]),
9388
+ claudecode: import_mini28.z.optional(
9389
+ import_mini28.z.looseObject({
9390
+ "allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string())),
9391
+ model: import_mini28.z.optional(import_mini28.z.string()),
9392
+ "disable-model-invocation": import_mini28.z.optional(import_mini28.z.boolean())
9168
9393
  })
9169
9394
  ),
9170
- codexcli: import_mini27.z.optional(
9171
- import_mini27.z.looseObject({
9172
- "short-description": import_mini27.z.optional(import_mini27.z.string())
9395
+ codexcli: import_mini28.z.optional(
9396
+ import_mini28.z.looseObject({
9397
+ "short-description": import_mini28.z.optional(import_mini28.z.string())
9173
9398
  })
9174
9399
  ),
9175
- opencode: import_mini27.z.optional(
9176
- import_mini27.z.looseObject({
9177
- "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string()))
9400
+ opencode: import_mini28.z.optional(
9401
+ import_mini28.z.looseObject({
9402
+ "allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string()))
9178
9403
  })
9179
9404
  ),
9180
- kilo: import_mini27.z.optional(
9181
- import_mini27.z.looseObject({
9182
- "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string()))
9405
+ kilo: import_mini28.z.optional(
9406
+ import_mini28.z.looseObject({
9407
+ "allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string()))
9183
9408
  })
9184
9409
  ),
9185
- deepagents: import_mini27.z.optional(
9186
- import_mini27.z.looseObject({
9187
- "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string()))
9410
+ deepagents: import_mini28.z.optional(
9411
+ import_mini28.z.looseObject({
9412
+ "allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string()))
9188
9413
  })
9189
9414
  ),
9190
- copilot: import_mini27.z.optional(
9191
- import_mini27.z.looseObject({
9192
- license: import_mini27.z.optional(import_mini27.z.string())
9415
+ copilot: import_mini28.z.optional(
9416
+ import_mini28.z.looseObject({
9417
+ license: import_mini28.z.optional(import_mini28.z.string())
9193
9418
  })
9194
9419
  ),
9195
- cline: import_mini27.z.optional(import_mini27.z.looseObject({})),
9196
- roo: import_mini27.z.optional(import_mini27.z.looseObject({}))
9420
+ cline: import_mini28.z.optional(import_mini28.z.looseObject({})),
9421
+ roo: import_mini28.z.optional(import_mini28.z.looseObject({}))
9197
9422
  });
9198
9423
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
9199
9424
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -9233,7 +9458,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9233
9458
  }
9234
9459
  getFrontmatter() {
9235
9460
  if (!this.mainFile?.frontmatter) {
9236
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path68.join)(this.relativeDirPath, this.dirName)}`);
9461
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path69.join)(this.relativeDirPath, this.dirName)}`);
9237
9462
  }
9238
9463
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
9239
9464
  return result;
@@ -9259,8 +9484,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9259
9484
  dirName,
9260
9485
  global = false
9261
9486
  }) {
9262
- const skillDirPath = (0, import_node_path68.join)(baseDir, relativeDirPath, dirName);
9263
- const skillFilePath = (0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME);
9487
+ const skillDirPath = (0, import_node_path69.join)(baseDir, relativeDirPath, dirName);
9488
+ const skillFilePath = (0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME);
9264
9489
  if (!await fileExists(skillFilePath)) {
9265
9490
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9266
9491
  }
@@ -9290,14 +9515,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9290
9515
  };
9291
9516
 
9292
9517
  // src/features/skills/rovodev-skill.ts
9293
- var RovodevSkillFrontmatterSchema = import_mini28.z.looseObject({
9294
- name: import_mini28.z.string(),
9295
- description: import_mini28.z.string()
9518
+ var RovodevSkillFrontmatterSchema = import_mini29.z.looseObject({
9519
+ name: import_mini29.z.string(),
9520
+ description: import_mini29.z.string()
9296
9521
  });
9297
9522
  var RovodevSkill = class _RovodevSkill extends ToolSkill {
9298
9523
  constructor({
9299
9524
  baseDir = process.cwd(),
9300
- relativeDirPath = (0, import_node_path69.join)(".rovodev", "skills"),
9525
+ relativeDirPath = (0, import_node_path70.join)(".rovodev", "skills"),
9301
9526
  dirName,
9302
9527
  frontmatter,
9303
9528
  body,
@@ -9326,8 +9551,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9326
9551
  }
9327
9552
  static getSettablePaths(_options) {
9328
9553
  return {
9329
- relativeDirPath: (0, import_node_path69.join)(".rovodev", "skills"),
9330
- alternativeSkillRoots: [(0, import_node_path69.join)(".agents", "skills")]
9554
+ relativeDirPath: (0, import_node_path70.join)(".rovodev", "skills"),
9555
+ alternativeSkillRoots: [(0, import_node_path70.join)(".agents", "skills")]
9331
9556
  };
9332
9557
  }
9333
9558
  getFrontmatter() {
@@ -9415,13 +9640,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9415
9640
  });
9416
9641
  const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9417
9642
  if (!result.success) {
9418
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9643
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9419
9644
  throw new Error(
9420
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9645
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9421
9646
  );
9422
9647
  }
9423
9648
  if (result.data.name !== loaded.dirName) {
9424
- const skillFilePath = (0, import_node_path69.join)(
9649
+ const skillFilePath = (0, import_node_path70.join)(
9425
9650
  loaded.baseDir,
9426
9651
  loaded.relativeDirPath,
9427
9652
  loaded.dirName,
@@ -9463,11 +9688,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9463
9688
  };
9464
9689
 
9465
9690
  // src/features/skills/skills-processor.ts
9466
- var import_node_path87 = require("path");
9467
- var import_mini44 = require("zod/mini");
9691
+ var import_node_path88 = require("path");
9692
+ var import_mini45 = require("zod/mini");
9468
9693
 
9469
9694
  // src/types/dir-feature-processor.ts
9470
- var import_node_path70 = require("path");
9695
+ var import_node_path71 = require("path");
9471
9696
  var DirFeatureProcessor = class {
9472
9697
  baseDir;
9473
9698
  dryRun;
@@ -9507,7 +9732,7 @@ var DirFeatureProcessor = class {
9507
9732
  const mainFile = aiDir.getMainFile();
9508
9733
  let mainFileContent;
9509
9734
  if (mainFile) {
9510
- const mainFilePath = (0, import_node_path70.join)(dirPath, mainFile.name);
9735
+ const mainFilePath = (0, import_node_path71.join)(dirPath, mainFile.name);
9511
9736
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
9512
9737
  avoidBlockScalars: this.avoidBlockScalars
9513
9738
  });
@@ -9527,7 +9752,7 @@ var DirFeatureProcessor = class {
9527
9752
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
9528
9753
  otherFileContents.push(contentWithNewline);
9529
9754
  if (!dirHasChanges) {
9530
- const filePath = (0, import_node_path70.join)(dirPath, file.relativeFilePathToDirPath);
9755
+ const filePath = (0, import_node_path71.join)(dirPath, file.relativeFilePathToDirPath);
9531
9756
  const existingContent = await readFileContentOrNull(filePath);
9532
9757
  if (!fileContentsEquivalent({
9533
9758
  filePath,
@@ -9545,24 +9770,24 @@ var DirFeatureProcessor = class {
9545
9770
  if (this.dryRun) {
9546
9771
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
9547
9772
  if (mainFile) {
9548
- this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path70.join)(dirPath, mainFile.name)}`);
9549
- changedPaths.push((0, import_node_path70.join)(relativeDir, mainFile.name));
9773
+ this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path71.join)(dirPath, mainFile.name)}`);
9774
+ changedPaths.push((0, import_node_path71.join)(relativeDir, mainFile.name));
9550
9775
  }
9551
9776
  for (const file of otherFiles) {
9552
9777
  this.logger.info(
9553
- `[DRY RUN] Would write: ${(0, import_node_path70.join)(dirPath, file.relativeFilePathToDirPath)}`
9778
+ `[DRY RUN] Would write: ${(0, import_node_path71.join)(dirPath, file.relativeFilePathToDirPath)}`
9554
9779
  );
9555
- changedPaths.push((0, import_node_path70.join)(relativeDir, file.relativeFilePathToDirPath));
9780
+ changedPaths.push((0, import_node_path71.join)(relativeDir, file.relativeFilePathToDirPath));
9556
9781
  }
9557
9782
  } else {
9558
9783
  await ensureDir(dirPath);
9559
9784
  if (mainFile && mainFileContent) {
9560
- const mainFilePath = (0, import_node_path70.join)(dirPath, mainFile.name);
9785
+ const mainFilePath = (0, import_node_path71.join)(dirPath, mainFile.name);
9561
9786
  await writeFileContent(mainFilePath, mainFileContent);
9562
- changedPaths.push((0, import_node_path70.join)(relativeDir, mainFile.name));
9787
+ changedPaths.push((0, import_node_path71.join)(relativeDir, mainFile.name));
9563
9788
  }
9564
9789
  for (const [i, file] of otherFiles.entries()) {
9565
- const filePath = (0, import_node_path70.join)(dirPath, file.relativeFilePathToDirPath);
9790
+ const filePath = (0, import_node_path71.join)(dirPath, file.relativeFilePathToDirPath);
9566
9791
  const content = otherFileContents[i];
9567
9792
  if (content === void 0) {
9568
9793
  throw new Error(
@@ -9570,7 +9795,7 @@ var DirFeatureProcessor = class {
9570
9795
  );
9571
9796
  }
9572
9797
  await writeFileContent(filePath, content);
9573
- changedPaths.push((0, import_node_path70.join)(relativeDir, file.relativeFilePathToDirPath));
9798
+ changedPaths.push((0, import_node_path71.join)(relativeDir, file.relativeFilePathToDirPath));
9574
9799
  }
9575
9800
  }
9576
9801
  changedCount++;
@@ -9602,16 +9827,16 @@ var DirFeatureProcessor = class {
9602
9827
  };
9603
9828
 
9604
9829
  // src/features/skills/agentsskills-skill.ts
9605
- var import_node_path71 = require("path");
9606
- var import_mini29 = require("zod/mini");
9607
- var AgentsSkillsSkillFrontmatterSchema = import_mini29.z.looseObject({
9608
- name: import_mini29.z.string(),
9609
- description: import_mini29.z.string()
9830
+ var import_node_path72 = require("path");
9831
+ var import_mini30 = require("zod/mini");
9832
+ var AgentsSkillsSkillFrontmatterSchema = import_mini30.z.looseObject({
9833
+ name: import_mini30.z.string(),
9834
+ description: import_mini30.z.string()
9610
9835
  });
9611
9836
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9612
9837
  constructor({
9613
9838
  baseDir = process.cwd(),
9614
- relativeDirPath = (0, import_node_path71.join)(".agents", "skills"),
9839
+ relativeDirPath = (0, import_node_path72.join)(".agents", "skills"),
9615
9840
  dirName,
9616
9841
  frontmatter,
9617
9842
  body,
@@ -9643,7 +9868,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9643
9868
  throw new Error("AgentsSkillsSkill does not support global mode.");
9644
9869
  }
9645
9870
  return {
9646
- relativeDirPath: (0, import_node_path71.join)(".agents", "skills")
9871
+ relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
9647
9872
  };
9648
9873
  }
9649
9874
  getFrontmatter() {
@@ -9723,9 +9948,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9723
9948
  });
9724
9949
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9725
9950
  if (!result.success) {
9726
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9951
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9727
9952
  throw new Error(
9728
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9953
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9729
9954
  );
9730
9955
  }
9731
9956
  return new _AgentsSkillsSkill({
@@ -9760,16 +9985,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9760
9985
  };
9761
9986
 
9762
9987
  // src/features/skills/antigravity-skill.ts
9763
- var import_node_path72 = require("path");
9764
- var import_mini30 = require("zod/mini");
9765
- var AntigravitySkillFrontmatterSchema = import_mini30.z.looseObject({
9766
- name: import_mini30.z.string(),
9767
- description: import_mini30.z.string()
9988
+ var import_node_path73 = require("path");
9989
+ var import_mini31 = require("zod/mini");
9990
+ var AntigravitySkillFrontmatterSchema = import_mini31.z.looseObject({
9991
+ name: import_mini31.z.string(),
9992
+ description: import_mini31.z.string()
9768
9993
  });
9769
9994
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
9770
9995
  constructor({
9771
9996
  baseDir = process.cwd(),
9772
- relativeDirPath = (0, import_node_path72.join)(".agent", "skills"),
9997
+ relativeDirPath = (0, import_node_path73.join)(".agent", "skills"),
9773
9998
  dirName,
9774
9999
  frontmatter,
9775
10000
  body,
@@ -9801,11 +10026,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
9801
10026
  } = {}) {
9802
10027
  if (global) {
9803
10028
  return {
9804
- relativeDirPath: (0, import_node_path72.join)(".gemini", "antigravity", "skills")
10029
+ relativeDirPath: (0, import_node_path73.join)(".gemini", "antigravity", "skills")
9805
10030
  };
9806
10031
  }
9807
10032
  return {
9808
- relativeDirPath: (0, import_node_path72.join)(".agent", "skills")
10033
+ relativeDirPath: (0, import_node_path73.join)(".agent", "skills")
9809
10034
  };
9810
10035
  }
9811
10036
  getFrontmatter() {
@@ -9885,9 +10110,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
9885
10110
  });
9886
10111
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
9887
10112
  if (!result.success) {
9888
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10113
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9889
10114
  throw new Error(
9890
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10115
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9891
10116
  );
9892
10117
  }
9893
10118
  return new _AntigravitySkill({
@@ -9921,19 +10146,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
9921
10146
  };
9922
10147
 
9923
10148
  // src/features/skills/claudecode-skill.ts
9924
- var import_node_path73 = require("path");
9925
- var import_mini31 = require("zod/mini");
9926
- var ClaudecodeSkillFrontmatterSchema = import_mini31.z.looseObject({
9927
- name: import_mini31.z.string(),
9928
- description: import_mini31.z.string(),
9929
- "allowed-tools": import_mini31.z.optional(import_mini31.z.array(import_mini31.z.string())),
9930
- model: import_mini31.z.optional(import_mini31.z.string()),
9931
- "disable-model-invocation": import_mini31.z.optional(import_mini31.z.boolean())
10149
+ var import_node_path74 = require("path");
10150
+ var import_mini32 = require("zod/mini");
10151
+ var ClaudecodeSkillFrontmatterSchema = import_mini32.z.looseObject({
10152
+ name: import_mini32.z.string(),
10153
+ description: import_mini32.z.string(),
10154
+ "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string())),
10155
+ model: import_mini32.z.optional(import_mini32.z.string()),
10156
+ "disable-model-invocation": import_mini32.z.optional(import_mini32.z.boolean())
9932
10157
  });
9933
10158
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
9934
10159
  constructor({
9935
10160
  baseDir = process.cwd(),
9936
- relativeDirPath = (0, import_node_path73.join)(".claude", "skills"),
10161
+ relativeDirPath = (0, import_node_path74.join)(".claude", "skills"),
9937
10162
  dirName,
9938
10163
  frontmatter,
9939
10164
  body,
@@ -9964,7 +10189,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
9964
10189
  global: _global = false
9965
10190
  } = {}) {
9966
10191
  return {
9967
- relativeDirPath: (0, import_node_path73.join)(".claude", "skills")
10192
+ relativeDirPath: (0, import_node_path74.join)(".claude", "skills")
9968
10193
  };
9969
10194
  }
9970
10195
  getFrontmatter() {
@@ -10061,9 +10286,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10061
10286
  });
10062
10287
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10063
10288
  if (!result.success) {
10064
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10289
+ const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10065
10290
  throw new Error(
10066
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10291
+ `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10067
10292
  );
10068
10293
  }
10069
10294
  return new _ClaudecodeSkill({
@@ -10097,16 +10322,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10097
10322
  };
10098
10323
 
10099
10324
  // src/features/skills/cline-skill.ts
10100
- var import_node_path74 = require("path");
10101
- var import_mini32 = require("zod/mini");
10102
- var ClineSkillFrontmatterSchema = import_mini32.z.looseObject({
10103
- name: import_mini32.z.string(),
10104
- description: import_mini32.z.string()
10325
+ var import_node_path75 = require("path");
10326
+ var import_mini33 = require("zod/mini");
10327
+ var ClineSkillFrontmatterSchema = import_mini33.z.looseObject({
10328
+ name: import_mini33.z.string(),
10329
+ description: import_mini33.z.string()
10105
10330
  });
10106
10331
  var ClineSkill = class _ClineSkill extends ToolSkill {
10107
10332
  constructor({
10108
10333
  baseDir = process.cwd(),
10109
- relativeDirPath = (0, import_node_path74.join)(".cline", "skills"),
10334
+ relativeDirPath = (0, import_node_path75.join)(".cline", "skills"),
10110
10335
  dirName,
10111
10336
  frontmatter,
10112
10337
  body,
@@ -10135,7 +10360,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10135
10360
  }
10136
10361
  static getSettablePaths(_options = {}) {
10137
10362
  return {
10138
- relativeDirPath: (0, import_node_path74.join)(".cline", "skills")
10363
+ relativeDirPath: (0, import_node_path75.join)(".cline", "skills")
10139
10364
  };
10140
10365
  }
10141
10366
  getFrontmatter() {
@@ -10223,13 +10448,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10223
10448
  });
10224
10449
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10225
10450
  if (!result.success) {
10226
- const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10451
+ const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10227
10452
  throw new Error(
10228
- `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10453
+ `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10229
10454
  );
10230
10455
  }
10231
10456
  if (result.data.name !== loaded.dirName) {
10232
- const skillFilePath = (0, import_node_path74.join)(
10457
+ const skillFilePath = (0, import_node_path75.join)(
10233
10458
  loaded.baseDir,
10234
10459
  loaded.relativeDirPath,
10235
10460
  loaded.dirName,
@@ -10270,21 +10495,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10270
10495
  };
10271
10496
 
10272
10497
  // src/features/skills/codexcli-skill.ts
10273
- var import_node_path75 = require("path");
10274
- var import_mini33 = require("zod/mini");
10275
- var CodexCliSkillFrontmatterSchema = import_mini33.z.looseObject({
10276
- name: import_mini33.z.string(),
10277
- description: import_mini33.z.string(),
10278
- metadata: import_mini33.z.optional(
10279
- import_mini33.z.looseObject({
10280
- "short-description": import_mini33.z.optional(import_mini33.z.string())
10498
+ var import_node_path76 = require("path");
10499
+ var import_mini34 = require("zod/mini");
10500
+ var CodexCliSkillFrontmatterSchema = import_mini34.z.looseObject({
10501
+ name: import_mini34.z.string(),
10502
+ description: import_mini34.z.string(),
10503
+ metadata: import_mini34.z.optional(
10504
+ import_mini34.z.looseObject({
10505
+ "short-description": import_mini34.z.optional(import_mini34.z.string())
10281
10506
  })
10282
10507
  )
10283
10508
  });
10284
10509
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10285
10510
  constructor({
10286
10511
  baseDir = process.cwd(),
10287
- relativeDirPath = (0, import_node_path75.join)(".codex", "skills"),
10512
+ relativeDirPath = (0, import_node_path76.join)(".codex", "skills"),
10288
10513
  dirName,
10289
10514
  frontmatter,
10290
10515
  body,
@@ -10315,7 +10540,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10315
10540
  global: _global = false
10316
10541
  } = {}) {
10317
10542
  return {
10318
- relativeDirPath: (0, import_node_path75.join)(".codex", "skills")
10543
+ relativeDirPath: (0, import_node_path76.join)(".codex", "skills")
10319
10544
  };
10320
10545
  }
10321
10546
  getFrontmatter() {
@@ -10405,9 +10630,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10405
10630
  });
10406
10631
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10407
10632
  if (!result.success) {
10408
- const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10633
+ const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10409
10634
  throw new Error(
10410
- `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10635
+ `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10411
10636
  );
10412
10637
  }
10413
10638
  return new _CodexCliSkill({
@@ -10441,17 +10666,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10441
10666
  };
10442
10667
 
10443
10668
  // src/features/skills/copilot-skill.ts
10444
- var import_node_path76 = require("path");
10445
- var import_mini34 = require("zod/mini");
10446
- var CopilotSkillFrontmatterSchema = import_mini34.z.looseObject({
10447
- name: import_mini34.z.string(),
10448
- description: import_mini34.z.string(),
10449
- license: import_mini34.z.optional(import_mini34.z.string())
10669
+ var import_node_path77 = require("path");
10670
+ var import_mini35 = require("zod/mini");
10671
+ var CopilotSkillFrontmatterSchema = import_mini35.z.looseObject({
10672
+ name: import_mini35.z.string(),
10673
+ description: import_mini35.z.string(),
10674
+ license: import_mini35.z.optional(import_mini35.z.string())
10450
10675
  });
10451
10676
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
10452
10677
  constructor({
10453
10678
  baseDir = process.cwd(),
10454
- relativeDirPath = (0, import_node_path76.join)(".github", "skills"),
10679
+ relativeDirPath = (0, import_node_path77.join)(".github", "skills"),
10455
10680
  dirName,
10456
10681
  frontmatter,
10457
10682
  body,
@@ -10483,7 +10708,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10483
10708
  throw new Error("CopilotSkill does not support global mode.");
10484
10709
  }
10485
10710
  return {
10486
- relativeDirPath: (0, import_node_path76.join)(".github", "skills")
10711
+ relativeDirPath: (0, import_node_path77.join)(".github", "skills")
10487
10712
  };
10488
10713
  }
10489
10714
  getFrontmatter() {
@@ -10569,9 +10794,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10569
10794
  });
10570
10795
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10571
10796
  if (!result.success) {
10572
- const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10797
+ const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10573
10798
  throw new Error(
10574
- `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10799
+ `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10575
10800
  );
10576
10801
  }
10577
10802
  return new _CopilotSkill({
@@ -10606,16 +10831,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10606
10831
  };
10607
10832
 
10608
10833
  // src/features/skills/cursor-skill.ts
10609
- var import_node_path77 = require("path");
10610
- var import_mini35 = require("zod/mini");
10611
- var CursorSkillFrontmatterSchema = import_mini35.z.looseObject({
10612
- name: import_mini35.z.string(),
10613
- description: import_mini35.z.string()
10834
+ var import_node_path78 = require("path");
10835
+ var import_mini36 = require("zod/mini");
10836
+ var CursorSkillFrontmatterSchema = import_mini36.z.looseObject({
10837
+ name: import_mini36.z.string(),
10838
+ description: import_mini36.z.string()
10614
10839
  });
10615
10840
  var CursorSkill = class _CursorSkill extends ToolSkill {
10616
10841
  constructor({
10617
10842
  baseDir = process.cwd(),
10618
- relativeDirPath = (0, import_node_path77.join)(".cursor", "skills"),
10843
+ relativeDirPath = (0, import_node_path78.join)(".cursor", "skills"),
10619
10844
  dirName,
10620
10845
  frontmatter,
10621
10846
  body,
@@ -10644,7 +10869,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10644
10869
  }
10645
10870
  static getSettablePaths(_options) {
10646
10871
  return {
10647
- relativeDirPath: (0, import_node_path77.join)(".cursor", "skills")
10872
+ relativeDirPath: (0, import_node_path78.join)(".cursor", "skills")
10648
10873
  };
10649
10874
  }
10650
10875
  getFrontmatter() {
@@ -10724,9 +10949,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10724
10949
  });
10725
10950
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10726
10951
  if (!result.success) {
10727
- const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10952
+ const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10728
10953
  throw new Error(
10729
- `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10954
+ `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10730
10955
  );
10731
10956
  }
10732
10957
  return new _CursorSkill({
@@ -10761,17 +10986,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10761
10986
  };
10762
10987
 
10763
10988
  // src/features/skills/deepagents-skill.ts
10764
- var import_node_path78 = require("path");
10765
- var import_mini36 = require("zod/mini");
10766
- var DeepagentsSkillFrontmatterSchema = import_mini36.z.looseObject({
10767
- name: import_mini36.z.string(),
10768
- description: import_mini36.z.string(),
10769
- "allowed-tools": import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string()))
10989
+ var import_node_path79 = require("path");
10990
+ var import_mini37 = require("zod/mini");
10991
+ var DeepagentsSkillFrontmatterSchema = import_mini37.z.looseObject({
10992
+ name: import_mini37.z.string(),
10993
+ description: import_mini37.z.string(),
10994
+ "allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string()))
10770
10995
  });
10771
10996
  var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10772
10997
  constructor({
10773
10998
  baseDir = process.cwd(),
10774
- relativeDirPath = (0, import_node_path78.join)(".deepagents", "skills"),
10999
+ relativeDirPath = (0, import_node_path79.join)(".deepagents", "skills"),
10775
11000
  dirName,
10776
11001
  frontmatter,
10777
11002
  body,
@@ -10798,12 +11023,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10798
11023
  }
10799
11024
  }
10800
11025
  }
10801
- static getSettablePaths(options) {
10802
- if (options?.global) {
10803
- throw new Error("DeepagentsSkill does not support global mode.");
10804
- }
11026
+ static getSettablePaths(_options) {
10805
11027
  return {
10806
- relativeDirPath: (0, import_node_path78.join)(".deepagents", "skills")
11028
+ relativeDirPath: (0, import_node_path79.join)(".deepagents", "skills")
10807
11029
  };
10808
11030
  }
10809
11031
  getFrontmatter() {
@@ -10863,7 +11085,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10863
11085
  const deepagentsFrontmatter = {
10864
11086
  name: rulesyncFrontmatter.name,
10865
11087
  description: rulesyncFrontmatter.description,
10866
- "allowed-tools": rulesyncFrontmatter.deepagents?.["allowed-tools"]
11088
+ ...rulesyncFrontmatter.deepagents?.["allowed-tools"] && {
11089
+ "allowed-tools": rulesyncFrontmatter.deepagents["allowed-tools"]
11090
+ }
10867
11091
  };
10868
11092
  return new _DeepagentsSkill({
10869
11093
  baseDir,
@@ -10887,9 +11111,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10887
11111
  });
10888
11112
  const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10889
11113
  if (!result.success) {
10890
- const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11114
+ const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10891
11115
  throw new Error(
10892
- `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11116
+ `Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10893
11117
  );
10894
11118
  }
10895
11119
  return new _DeepagentsSkill({
@@ -10924,11 +11148,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10924
11148
  };
10925
11149
 
10926
11150
  // src/features/skills/geminicli-skill.ts
10927
- var import_node_path79 = require("path");
10928
- var import_mini37 = require("zod/mini");
10929
- var GeminiCliSkillFrontmatterSchema = import_mini37.z.looseObject({
10930
- name: import_mini37.z.string(),
10931
- description: import_mini37.z.string()
11151
+ var import_node_path80 = require("path");
11152
+ var import_mini38 = require("zod/mini");
11153
+ var GeminiCliSkillFrontmatterSchema = import_mini38.z.looseObject({
11154
+ name: import_mini38.z.string(),
11155
+ description: import_mini38.z.string()
10932
11156
  });
10933
11157
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
10934
11158
  constructor({
@@ -10964,7 +11188,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
10964
11188
  global: _global = false
10965
11189
  } = {}) {
10966
11190
  return {
10967
- relativeDirPath: (0, import_node_path79.join)(".gemini", "skills")
11191
+ relativeDirPath: (0, import_node_path80.join)(".gemini", "skills")
10968
11192
  };
10969
11193
  }
10970
11194
  getFrontmatter() {
@@ -11044,9 +11268,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11044
11268
  });
11045
11269
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11046
11270
  if (!result.success) {
11047
- const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11271
+ const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11048
11272
  throw new Error(
11049
- `Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11273
+ `Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11050
11274
  );
11051
11275
  }
11052
11276
  return new _GeminiCliSkill({
@@ -11081,16 +11305,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11081
11305
  };
11082
11306
 
11083
11307
  // src/features/skills/junie-skill.ts
11084
- var import_node_path80 = require("path");
11085
- var import_mini38 = require("zod/mini");
11086
- var JunieSkillFrontmatterSchema = import_mini38.z.looseObject({
11087
- name: import_mini38.z.string(),
11088
- description: import_mini38.z.string()
11308
+ var import_node_path81 = require("path");
11309
+ var import_mini39 = require("zod/mini");
11310
+ var JunieSkillFrontmatterSchema = import_mini39.z.looseObject({
11311
+ name: import_mini39.z.string(),
11312
+ description: import_mini39.z.string()
11089
11313
  });
11090
11314
  var JunieSkill = class _JunieSkill extends ToolSkill {
11091
11315
  constructor({
11092
11316
  baseDir = process.cwd(),
11093
- relativeDirPath = (0, import_node_path80.join)(".junie", "skills"),
11317
+ relativeDirPath = (0, import_node_path81.join)(".junie", "skills"),
11094
11318
  dirName,
11095
11319
  frontmatter,
11096
11320
  body,
@@ -11122,7 +11346,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11122
11346
  throw new Error("JunieSkill does not support global mode.");
11123
11347
  }
11124
11348
  return {
11125
- relativeDirPath: (0, import_node_path80.join)(".junie", "skills")
11349
+ relativeDirPath: (0, import_node_path81.join)(".junie", "skills")
11126
11350
  };
11127
11351
  }
11128
11352
  getFrontmatter() {
@@ -11209,13 +11433,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11209
11433
  });
11210
11434
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11211
11435
  if (!result.success) {
11212
- const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11436
+ const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11213
11437
  throw new Error(
11214
- `Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11438
+ `Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11215
11439
  );
11216
11440
  }
11217
11441
  if (result.data.name !== loaded.dirName) {
11218
- const skillFilePath = (0, import_node_path80.join)(
11442
+ const skillFilePath = (0, import_node_path81.join)(
11219
11443
  loaded.baseDir,
11220
11444
  loaded.relativeDirPath,
11221
11445
  loaded.dirName,
@@ -11257,17 +11481,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11257
11481
  };
11258
11482
 
11259
11483
  // src/features/skills/kilo-skill.ts
11260
- var import_node_path81 = require("path");
11261
- var import_mini39 = require("zod/mini");
11262
- var KiloSkillFrontmatterSchema = import_mini39.z.looseObject({
11263
- name: import_mini39.z.string(),
11264
- description: import_mini39.z.string(),
11265
- "allowed-tools": import_mini39.z.optional(import_mini39.z.array(import_mini39.z.string()))
11484
+ var import_node_path82 = require("path");
11485
+ var import_mini40 = require("zod/mini");
11486
+ var KiloSkillFrontmatterSchema = import_mini40.z.looseObject({
11487
+ name: import_mini40.z.string(),
11488
+ description: import_mini40.z.string(),
11489
+ "allowed-tools": import_mini40.z.optional(import_mini40.z.array(import_mini40.z.string()))
11266
11490
  });
11267
11491
  var KiloSkill = class _KiloSkill extends ToolSkill {
11268
11492
  constructor({
11269
11493
  baseDir = process.cwd(),
11270
- relativeDirPath = (0, import_node_path81.join)(".kilo", "skills"),
11494
+ relativeDirPath = (0, import_node_path82.join)(".kilo", "skills"),
11271
11495
  dirName,
11272
11496
  frontmatter,
11273
11497
  body,
@@ -11296,7 +11520,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11296
11520
  }
11297
11521
  static getSettablePaths({ global = false } = {}) {
11298
11522
  return {
11299
- relativeDirPath: global ? (0, import_node_path81.join)(".config", "kilo", "skills") : (0, import_node_path81.join)(".kilo", "skills")
11523
+ relativeDirPath: global ? (0, import_node_path82.join)(".config", "kilo", "skills") : (0, import_node_path82.join)(".kilo", "skills")
11300
11524
  };
11301
11525
  }
11302
11526
  getFrontmatter() {
@@ -11382,9 +11606,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11382
11606
  });
11383
11607
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11384
11608
  if (!result.success) {
11385
- const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11609
+ const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11386
11610
  throw new Error(
11387
- `Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11611
+ `Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11388
11612
  );
11389
11613
  }
11390
11614
  return new _KiloSkill({
@@ -11418,16 +11642,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11418
11642
  };
11419
11643
 
11420
11644
  // src/features/skills/kiro-skill.ts
11421
- var import_node_path82 = require("path");
11422
- var import_mini40 = require("zod/mini");
11423
- var KiroSkillFrontmatterSchema = import_mini40.z.looseObject({
11424
- name: import_mini40.z.string(),
11425
- description: import_mini40.z.string()
11645
+ var import_node_path83 = require("path");
11646
+ var import_mini41 = require("zod/mini");
11647
+ var KiroSkillFrontmatterSchema = import_mini41.z.looseObject({
11648
+ name: import_mini41.z.string(),
11649
+ description: import_mini41.z.string()
11426
11650
  });
11427
11651
  var KiroSkill = class _KiroSkill extends ToolSkill {
11428
11652
  constructor({
11429
11653
  baseDir = process.cwd(),
11430
- relativeDirPath = (0, import_node_path82.join)(".kiro", "skills"),
11654
+ relativeDirPath = (0, import_node_path83.join)(".kiro", "skills"),
11431
11655
  dirName,
11432
11656
  frontmatter,
11433
11657
  body,
@@ -11459,7 +11683,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11459
11683
  throw new Error("KiroSkill does not support global mode.");
11460
11684
  }
11461
11685
  return {
11462
- relativeDirPath: (0, import_node_path82.join)(".kiro", "skills")
11686
+ relativeDirPath: (0, import_node_path83.join)(".kiro", "skills")
11463
11687
  };
11464
11688
  }
11465
11689
  getFrontmatter() {
@@ -11547,13 +11771,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11547
11771
  });
11548
11772
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11549
11773
  if (!result.success) {
11550
- const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11774
+ const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11551
11775
  throw new Error(
11552
- `Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11776
+ `Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11553
11777
  );
11554
11778
  }
11555
11779
  if (result.data.name !== loaded.dirName) {
11556
- const skillFilePath = (0, import_node_path82.join)(
11780
+ const skillFilePath = (0, import_node_path83.join)(
11557
11781
  loaded.baseDir,
11558
11782
  loaded.relativeDirPath,
11559
11783
  loaded.dirName,
@@ -11595,17 +11819,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11595
11819
  };
11596
11820
 
11597
11821
  // src/features/skills/opencode-skill.ts
11598
- var import_node_path83 = require("path");
11599
- var import_mini41 = require("zod/mini");
11600
- var OpenCodeSkillFrontmatterSchema = import_mini41.z.looseObject({
11601
- name: import_mini41.z.string(),
11602
- description: import_mini41.z.string(),
11603
- "allowed-tools": import_mini41.z.optional(import_mini41.z.array(import_mini41.z.string()))
11822
+ var import_node_path84 = require("path");
11823
+ var import_mini42 = require("zod/mini");
11824
+ var OpenCodeSkillFrontmatterSchema = import_mini42.z.looseObject({
11825
+ name: import_mini42.z.string(),
11826
+ description: import_mini42.z.string(),
11827
+ "allowed-tools": import_mini42.z.optional(import_mini42.z.array(import_mini42.z.string()))
11604
11828
  });
11605
11829
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11606
11830
  constructor({
11607
11831
  baseDir = process.cwd(),
11608
- relativeDirPath = (0, import_node_path83.join)(".opencode", "skill"),
11832
+ relativeDirPath = (0, import_node_path84.join)(".opencode", "skill"),
11609
11833
  dirName,
11610
11834
  frontmatter,
11611
11835
  body,
@@ -11634,7 +11858,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11634
11858
  }
11635
11859
  static getSettablePaths({ global = false } = {}) {
11636
11860
  return {
11637
- relativeDirPath: global ? (0, import_node_path83.join)(".config", "opencode", "skill") : (0, import_node_path83.join)(".opencode", "skill")
11861
+ relativeDirPath: global ? (0, import_node_path84.join)(".config", "opencode", "skill") : (0, import_node_path84.join)(".opencode", "skill")
11638
11862
  };
11639
11863
  }
11640
11864
  getFrontmatter() {
@@ -11720,9 +11944,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11720
11944
  });
11721
11945
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11722
11946
  if (!result.success) {
11723
- const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11947
+ const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11724
11948
  throw new Error(
11725
- `Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11949
+ `Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11726
11950
  );
11727
11951
  }
11728
11952
  return new _OpenCodeSkill({
@@ -11756,16 +11980,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11756
11980
  };
11757
11981
 
11758
11982
  // src/features/skills/replit-skill.ts
11759
- var import_node_path84 = require("path");
11760
- var import_mini42 = require("zod/mini");
11761
- var ReplitSkillFrontmatterSchema = import_mini42.z.looseObject({
11762
- name: import_mini42.z.string(),
11763
- description: import_mini42.z.string()
11983
+ var import_node_path85 = require("path");
11984
+ var import_mini43 = require("zod/mini");
11985
+ var ReplitSkillFrontmatterSchema = import_mini43.z.looseObject({
11986
+ name: import_mini43.z.string(),
11987
+ description: import_mini43.z.string()
11764
11988
  });
11765
11989
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
11766
11990
  constructor({
11767
11991
  baseDir = process.cwd(),
11768
- relativeDirPath = (0, import_node_path84.join)(".agents", "skills"),
11992
+ relativeDirPath = (0, import_node_path85.join)(".agents", "skills"),
11769
11993
  dirName,
11770
11994
  frontmatter,
11771
11995
  body,
@@ -11797,7 +12021,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
11797
12021
  throw new Error("ReplitSkill does not support global mode.");
11798
12022
  }
11799
12023
  return {
11800
- relativeDirPath: (0, import_node_path84.join)(".agents", "skills")
12024
+ relativeDirPath: (0, import_node_path85.join)(".agents", "skills")
11801
12025
  };
11802
12026
  }
11803
12027
  getFrontmatter() {
@@ -11877,9 +12101,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
11877
12101
  });
11878
12102
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11879
12103
  if (!result.success) {
11880
- const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12104
+ const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11881
12105
  throw new Error(
11882
- `Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12106
+ `Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11883
12107
  );
11884
12108
  }
11885
12109
  return new _ReplitSkill({
@@ -11914,16 +12138,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
11914
12138
  };
11915
12139
 
11916
12140
  // src/features/skills/roo-skill.ts
11917
- var import_node_path85 = require("path");
11918
- var import_mini43 = require("zod/mini");
11919
- var RooSkillFrontmatterSchema = import_mini43.z.looseObject({
11920
- name: import_mini43.z.string(),
11921
- description: import_mini43.z.string()
12141
+ var import_node_path86 = require("path");
12142
+ var import_mini44 = require("zod/mini");
12143
+ var RooSkillFrontmatterSchema = import_mini44.z.looseObject({
12144
+ name: import_mini44.z.string(),
12145
+ description: import_mini44.z.string()
11922
12146
  });
11923
12147
  var RooSkill = class _RooSkill extends ToolSkill {
11924
12148
  constructor({
11925
12149
  baseDir = process.cwd(),
11926
- relativeDirPath = (0, import_node_path85.join)(".roo", "skills"),
12150
+ relativeDirPath = (0, import_node_path86.join)(".roo", "skills"),
11927
12151
  dirName,
11928
12152
  frontmatter,
11929
12153
  body,
@@ -11954,7 +12178,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
11954
12178
  global: _global = false
11955
12179
  } = {}) {
11956
12180
  return {
11957
- relativeDirPath: (0, import_node_path85.join)(".roo", "skills")
12181
+ relativeDirPath: (0, import_node_path86.join)(".roo", "skills")
11958
12182
  };
11959
12183
  }
11960
12184
  getFrontmatter() {
@@ -12042,13 +12266,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
12042
12266
  });
12043
12267
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12044
12268
  if (!result.success) {
12045
- const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12269
+ const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12046
12270
  throw new Error(
12047
- `Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12271
+ `Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12048
12272
  );
12049
12273
  }
12050
12274
  if (result.data.name !== loaded.dirName) {
12051
- const skillFilePath = (0, import_node_path85.join)(
12275
+ const skillFilePath = (0, import_node_path86.join)(
12052
12276
  loaded.baseDir,
12053
12277
  loaded.relativeDirPath,
12054
12278
  loaded.dirName,
@@ -12089,17 +12313,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
12089
12313
  };
12090
12314
 
12091
12315
  // src/features/skills/skills-utils.ts
12092
- var import_node_path86 = require("path");
12316
+ var import_node_path87 = require("path");
12093
12317
  async function getLocalSkillDirNames(baseDir) {
12094
- const skillsDir = (0, import_node_path86.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12318
+ const skillsDir = (0, import_node_path87.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12095
12319
  const names = /* @__PURE__ */ new Set();
12096
12320
  if (!await directoryExists(skillsDir)) {
12097
12321
  return names;
12098
12322
  }
12099
- const dirPaths = await findFilesByGlobs((0, import_node_path86.join)(skillsDir, "*"), { type: "dir" });
12323
+ const dirPaths = await findFilesByGlobs((0, import_node_path87.join)(skillsDir, "*"), { type: "dir" });
12100
12324
  for (const dirPath of dirPaths) {
12101
- const name = (0, import_node_path86.basename)(dirPath);
12102
- if (name === (0, import_node_path86.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
12325
+ const name = (0, import_node_path87.basename)(dirPath);
12326
+ if (name === (0, import_node_path87.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
12103
12327
  names.add(name);
12104
12328
  }
12105
12329
  return names;
@@ -12127,7 +12351,7 @@ var skillsProcessorToolTargetTuple = [
12127
12351
  "roo",
12128
12352
  "rovodev"
12129
12353
  ];
12130
- var SkillsProcessorToolTargetSchema = import_mini44.z.enum(skillsProcessorToolTargetTuple);
12354
+ var SkillsProcessorToolTargetSchema = import_mini45.z.enum(skillsProcessorToolTargetTuple);
12131
12355
  var toolSkillFactories = /* @__PURE__ */ new Map([
12132
12356
  [
12133
12357
  "agentsmd",
@@ -12351,11 +12575,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12351
12575
  )
12352
12576
  );
12353
12577
  const localSkillNames = new Set(localDirNames);
12354
- const curatedDirPath = (0, import_node_path87.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
12578
+ const curatedDirPath = (0, import_node_path88.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
12355
12579
  let curatedSkills = [];
12356
12580
  if (await directoryExists(curatedDirPath)) {
12357
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path87.join)(curatedDirPath, "*"), { type: "dir" });
12358
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path87.basename)(path3));
12581
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path88.join)(curatedDirPath, "*"), { type: "dir" });
12582
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path88.basename)(path3));
12359
12583
  const nonConflicting = curatedDirNames.filter((name) => {
12360
12584
  if (localSkillNames.has(name)) {
12361
12585
  this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -12392,13 +12616,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12392
12616
  const seenDirNames = /* @__PURE__ */ new Set();
12393
12617
  const loadEntries = [];
12394
12618
  for (const root of roots) {
12395
- const skillsDirPath = (0, import_node_path87.join)(this.baseDir, root);
12619
+ const skillsDirPath = (0, import_node_path88.join)(this.baseDir, root);
12396
12620
  if (!await directoryExists(skillsDirPath)) {
12397
12621
  continue;
12398
12622
  }
12399
- const dirPaths = await findFilesByGlobs((0, import_node_path87.join)(skillsDirPath, "*"), { type: "dir" });
12623
+ const dirPaths = await findFilesByGlobs((0, import_node_path88.join)(skillsDirPath, "*"), { type: "dir" });
12400
12624
  for (const dirPath of dirPaths) {
12401
- const dirName = (0, import_node_path87.basename)(dirPath);
12625
+ const dirName = (0, import_node_path88.basename)(dirPath);
12402
12626
  if (seenDirNames.has(dirName)) {
12403
12627
  continue;
12404
12628
  }
@@ -12427,21 +12651,20 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12427
12651
  const roots = toolSkillSearchRoots(paths);
12428
12652
  const toolSkills = [];
12429
12653
  for (const root of roots) {
12430
- const skillsDirPath = (0, import_node_path87.join)(this.baseDir, root);
12654
+ const skillsDirPath = (0, import_node_path88.join)(this.baseDir, root);
12431
12655
  if (!await directoryExists(skillsDirPath)) {
12432
12656
  continue;
12433
12657
  }
12434
- const dirPaths = await findFilesByGlobs((0, import_node_path87.join)(skillsDirPath, "*"), { type: "dir" });
12658
+ const dirPaths = await findFilesByGlobs((0, import_node_path88.join)(skillsDirPath, "*"), { type: "dir" });
12435
12659
  for (const dirPath of dirPaths) {
12436
- const dirName = (0, import_node_path87.basename)(dirPath);
12437
- toolSkills.push(
12438
- factory.class.forDeletion({
12439
- baseDir: this.baseDir,
12440
- relativeDirPath: root,
12441
- dirName,
12442
- global: this.global
12443
- })
12444
- );
12660
+ const dirName = (0, import_node_path88.basename)(dirPath);
12661
+ const toolSkill = factory.class.forDeletion({
12662
+ baseDir: this.baseDir,
12663
+ relativeDirPath: root,
12664
+ dirName,
12665
+ global: this.global
12666
+ });
12667
+ toolSkills.push(toolSkill);
12445
12668
  }
12446
12669
  }
12447
12670
  this.logger.debug(
@@ -12496,11 +12719,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12496
12719
  };
12497
12720
 
12498
12721
  // src/features/subagents/agentsmd-subagent.ts
12499
- var import_node_path89 = require("path");
12722
+ var import_node_path90 = require("path");
12500
12723
 
12501
12724
  // src/features/subagents/simulated-subagent.ts
12502
- var import_node_path88 = require("path");
12503
- var import_mini45 = require("zod/mini");
12725
+ var import_node_path89 = require("path");
12726
+ var import_mini46 = require("zod/mini");
12504
12727
 
12505
12728
  // src/features/subagents/tool-subagent.ts
12506
12729
  var ToolSubagent = class extends ToolFile {
@@ -12552,9 +12775,9 @@ var ToolSubagent = class extends ToolFile {
12552
12775
  };
12553
12776
 
12554
12777
  // src/features/subagents/simulated-subagent.ts
12555
- var SimulatedSubagentFrontmatterSchema = import_mini45.z.object({
12556
- name: import_mini45.z.string(),
12557
- description: import_mini45.z.optional(import_mini45.z.string())
12778
+ var SimulatedSubagentFrontmatterSchema = import_mini46.z.object({
12779
+ name: import_mini46.z.string(),
12780
+ description: import_mini46.z.optional(import_mini46.z.string())
12558
12781
  });
12559
12782
  var SimulatedSubagent = class extends ToolSubagent {
12560
12783
  frontmatter;
@@ -12564,7 +12787,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12564
12787
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
12565
12788
  if (!result.success) {
12566
12789
  throw new Error(
12567
- `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12790
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12568
12791
  );
12569
12792
  }
12570
12793
  }
@@ -12615,7 +12838,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12615
12838
  return {
12616
12839
  success: false,
12617
12840
  error: new Error(
12618
- `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12841
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12619
12842
  )
12620
12843
  };
12621
12844
  }
@@ -12625,7 +12848,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12625
12848
  relativeFilePath,
12626
12849
  validate = true
12627
12850
  }) {
12628
- const filePath = (0, import_node_path88.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
12851
+ const filePath = (0, import_node_path89.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
12629
12852
  const fileContent = await readFileContent(filePath);
12630
12853
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12631
12854
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12635,7 +12858,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12635
12858
  return {
12636
12859
  baseDir,
12637
12860
  relativeDirPath: this.getSettablePaths().relativeDirPath,
12638
- relativeFilePath: (0, import_node_path88.basename)(relativeFilePath),
12861
+ relativeFilePath: (0, import_node_path89.basename)(relativeFilePath),
12639
12862
  frontmatter: result.data,
12640
12863
  body: content.trim(),
12641
12864
  validate
@@ -12661,7 +12884,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12661
12884
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
12662
12885
  static getSettablePaths() {
12663
12886
  return {
12664
- relativeDirPath: (0, import_node_path89.join)(".agents", "subagents")
12887
+ relativeDirPath: (0, import_node_path90.join)(".agents", "subagents")
12665
12888
  };
12666
12889
  }
12667
12890
  static async fromFile(params) {
@@ -12684,11 +12907,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
12684
12907
  };
12685
12908
 
12686
12909
  // src/features/subagents/factorydroid-subagent.ts
12687
- var import_node_path90 = require("path");
12910
+ var import_node_path91 = require("path");
12688
12911
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
12689
12912
  static getSettablePaths(_options) {
12690
12913
  return {
12691
- relativeDirPath: (0, import_node_path90.join)(".factory", "droids")
12914
+ relativeDirPath: (0, import_node_path91.join)(".factory", "droids")
12692
12915
  };
12693
12916
  }
12694
12917
  static async fromFile(params) {
@@ -12711,16 +12934,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
12711
12934
  };
12712
12935
 
12713
12936
  // src/features/subagents/geminicli-subagent.ts
12714
- var import_node_path92 = require("path");
12715
- var import_mini47 = require("zod/mini");
12937
+ var import_node_path93 = require("path");
12938
+ var import_mini48 = require("zod/mini");
12716
12939
 
12717
12940
  // src/features/subagents/rulesync-subagent.ts
12718
- var import_node_path91 = require("path");
12719
- var import_mini46 = require("zod/mini");
12720
- var RulesyncSubagentFrontmatterSchema = import_mini46.z.looseObject({
12721
- targets: import_mini46.z._default(RulesyncTargetsSchema, ["*"]),
12722
- name: import_mini46.z.string(),
12723
- description: import_mini46.z.optional(import_mini46.z.string())
12941
+ var import_node_path92 = require("path");
12942
+ var import_mini47 = require("zod/mini");
12943
+ var RulesyncSubagentFrontmatterSchema = import_mini47.z.looseObject({
12944
+ targets: import_mini47.z._default(RulesyncTargetsSchema, ["*"]),
12945
+ name: import_mini47.z.string(),
12946
+ description: import_mini47.z.optional(import_mini47.z.string())
12724
12947
  });
12725
12948
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12726
12949
  frontmatter;
@@ -12729,7 +12952,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12729
12952
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
12730
12953
  if (!parseResult.success && rest.validate !== false) {
12731
12954
  throw new Error(
12732
- `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12955
+ `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12733
12956
  );
12734
12957
  }
12735
12958
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -12762,7 +12985,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12762
12985
  return {
12763
12986
  success: false,
12764
12987
  error: new Error(
12765
- `Invalid frontmatter in ${(0, import_node_path91.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12988
+ `Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12766
12989
  )
12767
12990
  };
12768
12991
  }
@@ -12770,14 +12993,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12770
12993
  static async fromFile({
12771
12994
  relativeFilePath
12772
12995
  }) {
12773
- const filePath = (0, import_node_path91.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
12996
+ const filePath = (0, import_node_path92.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
12774
12997
  const fileContent = await readFileContent(filePath);
12775
12998
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12776
12999
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
12777
13000
  if (!result.success) {
12778
13001
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
12779
13002
  }
12780
- const filename = (0, import_node_path91.basename)(relativeFilePath);
13003
+ const filename = (0, import_node_path92.basename)(relativeFilePath);
12781
13004
  return new _RulesyncSubagent({
12782
13005
  baseDir: process.cwd(),
12783
13006
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -12789,9 +13012,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12789
13012
  };
12790
13013
 
12791
13014
  // src/features/subagents/geminicli-subagent.ts
12792
- var GeminiCliSubagentFrontmatterSchema = import_mini47.z.looseObject({
12793
- name: import_mini47.z.string(),
12794
- description: import_mini47.z.optional(import_mini47.z.string())
13015
+ var GeminiCliSubagentFrontmatterSchema = import_mini48.z.looseObject({
13016
+ name: import_mini48.z.string(),
13017
+ description: import_mini48.z.optional(import_mini48.z.string())
12795
13018
  });
12796
13019
  var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12797
13020
  frontmatter;
@@ -12801,7 +13024,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12801
13024
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
12802
13025
  if (!result.success) {
12803
13026
  throw new Error(
12804
- `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13027
+ `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12805
13028
  );
12806
13029
  }
12807
13030
  }
@@ -12814,7 +13037,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12814
13037
  }
12815
13038
  static getSettablePaths(_options = {}) {
12816
13039
  return {
12817
- relativeDirPath: (0, import_node_path92.join)(".gemini", "agents")
13040
+ relativeDirPath: (0, import_node_path93.join)(".gemini", "agents")
12818
13041
  };
12819
13042
  }
12820
13043
  getFrontmatter() {
@@ -12882,7 +13105,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12882
13105
  return {
12883
13106
  success: false,
12884
13107
  error: new Error(
12885
- `Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13108
+ `Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12886
13109
  )
12887
13110
  };
12888
13111
  }
@@ -12900,7 +13123,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12900
13123
  global = false
12901
13124
  }) {
12902
13125
  const paths = this.getSettablePaths({ global });
12903
- const filePath = (0, import_node_path92.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13126
+ const filePath = (0, import_node_path93.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12904
13127
  const fileContent = await readFileContent(filePath);
12905
13128
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12906
13129
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12910,7 +13133,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12910
13133
  return new _GeminiCliSubagent({
12911
13134
  baseDir,
12912
13135
  relativeDirPath: paths.relativeDirPath,
12913
- relativeFilePath: (0, import_node_path92.basename)(relativeFilePath),
13136
+ relativeFilePath,
12914
13137
  frontmatter: result.data,
12915
13138
  body: content.trim(),
12916
13139
  fileContent,
@@ -12936,11 +13159,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
12936
13159
  };
12937
13160
 
12938
13161
  // src/features/subagents/roo-subagent.ts
12939
- var import_node_path93 = require("path");
13162
+ var import_node_path94 = require("path");
12940
13163
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
12941
13164
  static getSettablePaths() {
12942
13165
  return {
12943
- relativeDirPath: (0, import_node_path93.join)(".roo", "subagents")
13166
+ relativeDirPath: (0, import_node_path94.join)(".roo", "subagents")
12944
13167
  };
12945
13168
  }
12946
13169
  static async fromFile(params) {
@@ -12963,11 +13186,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
12963
13186
  };
12964
13187
 
12965
13188
  // src/features/subagents/rovodev-subagent.ts
12966
- var import_node_path94 = require("path");
12967
- var import_mini48 = require("zod/mini");
12968
- var RovodevSubagentFrontmatterSchema = import_mini48.z.looseObject({
12969
- name: import_mini48.z.string(),
12970
- description: import_mini48.z.optional(import_mini48.z.string())
13189
+ var import_node_path95 = require("path");
13190
+ var import_mini49 = require("zod/mini");
13191
+ var RovodevSubagentFrontmatterSchema = import_mini49.z.looseObject({
13192
+ name: import_mini49.z.string(),
13193
+ description: import_mini49.z.optional(import_mini49.z.string())
12971
13194
  });
12972
13195
  var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
12973
13196
  frontmatter;
@@ -12977,7 +13200,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
12977
13200
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
12978
13201
  if (!result.success) {
12979
13202
  throw new Error(
12980
- `Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13203
+ `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12981
13204
  );
12982
13205
  }
12983
13206
  }
@@ -12989,7 +13212,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
12989
13212
  }
12990
13213
  static getSettablePaths(_options = {}) {
12991
13214
  return {
12992
- relativeDirPath: (0, import_node_path94.join)(".rovodev", "subagents")
13215
+ relativeDirPath: (0, import_node_path95.join)(".rovodev", "subagents")
12993
13216
  };
12994
13217
  }
12995
13218
  getFrontmatter() {
@@ -13052,7 +13275,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13052
13275
  return {
13053
13276
  success: false,
13054
13277
  error: new Error(
13055
- `Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13278
+ `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13056
13279
  )
13057
13280
  };
13058
13281
  }
@@ -13069,7 +13292,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13069
13292
  global = false
13070
13293
  }) {
13071
13294
  const paths = this.getSettablePaths({ global });
13072
- const filePath = (0, import_node_path94.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13295
+ const filePath = (0, import_node_path95.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13073
13296
  const fileContent = await readFileContent(filePath);
13074
13297
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13075
13298
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13108,19 +13331,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13108
13331
  };
13109
13332
 
13110
13333
  // src/features/subagents/subagents-processor.ts
13111
- var import_node_path105 = require("path");
13112
- var import_mini57 = require("zod/mini");
13334
+ var import_node_path106 = require("path");
13335
+ var import_mini58 = require("zod/mini");
13113
13336
 
13114
13337
  // src/features/subagents/claudecode-subagent.ts
13115
- var import_node_path95 = require("path");
13116
- var import_mini49 = require("zod/mini");
13117
- var ClaudecodeSubagentFrontmatterSchema = import_mini49.z.looseObject({
13118
- name: import_mini49.z.string(),
13119
- description: import_mini49.z.optional(import_mini49.z.string()),
13120
- model: import_mini49.z.optional(import_mini49.z.string()),
13121
- tools: import_mini49.z.optional(import_mini49.z.union([import_mini49.z.string(), import_mini49.z.array(import_mini49.z.string())])),
13122
- permissionMode: import_mini49.z.optional(import_mini49.z.string()),
13123
- skills: import_mini49.z.optional(import_mini49.z.union([import_mini49.z.string(), import_mini49.z.array(import_mini49.z.string())]))
13338
+ var import_node_path96 = require("path");
13339
+ var import_mini50 = require("zod/mini");
13340
+ var ClaudecodeSubagentFrontmatterSchema = import_mini50.z.looseObject({
13341
+ name: import_mini50.z.string(),
13342
+ description: import_mini50.z.optional(import_mini50.z.string()),
13343
+ model: import_mini50.z.optional(import_mini50.z.string()),
13344
+ tools: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.string(), import_mini50.z.array(import_mini50.z.string())])),
13345
+ permissionMode: import_mini50.z.optional(import_mini50.z.string()),
13346
+ skills: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.string(), import_mini50.z.array(import_mini50.z.string())]))
13124
13347
  });
13125
13348
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13126
13349
  frontmatter;
@@ -13130,7 +13353,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13130
13353
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
13131
13354
  if (!result.success) {
13132
13355
  throw new Error(
13133
- `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13356
+ `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13134
13357
  );
13135
13358
  }
13136
13359
  }
@@ -13142,7 +13365,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13142
13365
  }
13143
13366
  static getSettablePaths(_options = {}) {
13144
13367
  return {
13145
- relativeDirPath: (0, import_node_path95.join)(".claude", "agents")
13368
+ relativeDirPath: (0, import_node_path96.join)(".claude", "agents")
13146
13369
  };
13147
13370
  }
13148
13371
  getFrontmatter() {
@@ -13221,7 +13444,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13221
13444
  return {
13222
13445
  success: false,
13223
13446
  error: new Error(
13224
- `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13447
+ `Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13225
13448
  )
13226
13449
  };
13227
13450
  }
@@ -13239,7 +13462,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13239
13462
  global = false
13240
13463
  }) {
13241
13464
  const paths = this.getSettablePaths({ global });
13242
- const filePath = (0, import_node_path95.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13465
+ const filePath = (0, import_node_path96.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13243
13466
  const fileContent = await readFileContent(filePath);
13244
13467
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13245
13468
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13274,27 +13497,27 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13274
13497
  };
13275
13498
 
13276
13499
  // src/features/subagents/codexcli-subagent.ts
13277
- var import_node_path96 = require("path");
13278
- var smolToml3 = __toESM(require("smol-toml"), 1);
13279
- var import_mini50 = require("zod/mini");
13280
- var CodexCliSubagentTomlSchema = import_mini50.z.looseObject({
13281
- name: import_mini50.z.string(),
13282
- description: import_mini50.z.optional(import_mini50.z.string()),
13283
- developer_instructions: import_mini50.z.optional(import_mini50.z.string()),
13284
- model: import_mini50.z.optional(import_mini50.z.string()),
13285
- model_reasoning_effort: import_mini50.z.optional(import_mini50.z.string()),
13286
- sandbox_mode: import_mini50.z.optional(import_mini50.z.string())
13500
+ var import_node_path97 = require("path");
13501
+ var smolToml4 = __toESM(require("smol-toml"), 1);
13502
+ var import_mini51 = require("zod/mini");
13503
+ var CodexCliSubagentTomlSchema = import_mini51.z.looseObject({
13504
+ name: import_mini51.z.string(),
13505
+ description: import_mini51.z.optional(import_mini51.z.string()),
13506
+ developer_instructions: import_mini51.z.optional(import_mini51.z.string()),
13507
+ model: import_mini51.z.optional(import_mini51.z.string()),
13508
+ model_reasoning_effort: import_mini51.z.optional(import_mini51.z.string()),
13509
+ sandbox_mode: import_mini51.z.optional(import_mini51.z.string())
13287
13510
  });
13288
13511
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13289
13512
  body;
13290
13513
  constructor({ body, ...rest }) {
13291
13514
  if (rest.validate !== false) {
13292
13515
  try {
13293
- const parsed = smolToml3.parse(body);
13516
+ const parsed = smolToml4.parse(body);
13294
13517
  CodexCliSubagentTomlSchema.parse(parsed);
13295
13518
  } catch (error) {
13296
13519
  throw new Error(
13297
- `Invalid TOML in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
13520
+ `Invalid TOML in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
13298
13521
  { cause: error }
13299
13522
  );
13300
13523
  }
@@ -13306,7 +13529,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13306
13529
  }
13307
13530
  static getSettablePaths(_options = {}) {
13308
13531
  return {
13309
- relativeDirPath: (0, import_node_path96.join)(".codex", "agents")
13532
+ relativeDirPath: (0, import_node_path97.join)(".codex", "agents")
13310
13533
  };
13311
13534
  }
13312
13535
  getBody() {
@@ -13315,10 +13538,10 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13315
13538
  toRulesyncSubagent() {
13316
13539
  let parsed;
13317
13540
  try {
13318
- parsed = CodexCliSubagentTomlSchema.parse(smolToml3.parse(this.body));
13541
+ parsed = CodexCliSubagentTomlSchema.parse(smolToml4.parse(this.body));
13319
13542
  } catch (error) {
13320
13543
  throw new Error(
13321
- `Failed to parse TOML in ${(0, import_node_path96.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
13544
+ `Failed to parse TOML in ${(0, import_node_path97.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
13322
13545
  { cause: error }
13323
13546
  );
13324
13547
  }
@@ -13361,7 +13584,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13361
13584
  ...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
13362
13585
  ...codexcliSection
13363
13586
  };
13364
- const body = smolToml3.stringify(tomlObj);
13587
+ const body = smolToml4.stringify(tomlObj);
13365
13588
  const paths = this.getSettablePaths({ global });
13366
13589
  const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
13367
13590
  return new _CodexCliSubagent({
@@ -13376,7 +13599,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13376
13599
  }
13377
13600
  validate() {
13378
13601
  try {
13379
- const parsed = smolToml3.parse(this.body);
13602
+ const parsed = smolToml4.parse(this.body);
13380
13603
  CodexCliSubagentTomlSchema.parse(parsed);
13381
13604
  return { success: true, error: null };
13382
13605
  } catch (error) {
@@ -13399,7 +13622,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13399
13622
  global = false
13400
13623
  }) {
13401
13624
  const paths = this.getSettablePaths({ global });
13402
- const filePath = (0, import_node_path96.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13625
+ const filePath = (0, import_node_path97.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13403
13626
  const fileContent = await readFileContent(filePath);
13404
13627
  const subagent = new _CodexCliSubagent({
13405
13628
  baseDir,
@@ -13437,13 +13660,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13437
13660
  };
13438
13661
 
13439
13662
  // src/features/subagents/copilot-subagent.ts
13440
- var import_node_path97 = require("path");
13441
- var import_mini51 = require("zod/mini");
13663
+ var import_node_path98 = require("path");
13664
+ var import_mini52 = require("zod/mini");
13442
13665
  var REQUIRED_TOOL = "agent/runSubagent";
13443
- var CopilotSubagentFrontmatterSchema = import_mini51.z.looseObject({
13444
- name: import_mini51.z.string(),
13445
- description: import_mini51.z.optional(import_mini51.z.string()),
13446
- tools: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.string(), import_mini51.z.array(import_mini51.z.string())]))
13666
+ var CopilotSubagentFrontmatterSchema = import_mini52.z.looseObject({
13667
+ name: import_mini52.z.string(),
13668
+ description: import_mini52.z.optional(import_mini52.z.string()),
13669
+ tools: import_mini52.z.optional(import_mini52.z.union([import_mini52.z.string(), import_mini52.z.array(import_mini52.z.string())]))
13447
13670
  });
13448
13671
  var normalizeTools = (tools) => {
13449
13672
  if (!tools) {
@@ -13463,7 +13686,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13463
13686
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
13464
13687
  if (!result.success) {
13465
13688
  throw new Error(
13466
- `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13689
+ `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13467
13690
  );
13468
13691
  }
13469
13692
  }
@@ -13475,7 +13698,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13475
13698
  }
13476
13699
  static getSettablePaths(_options = {}) {
13477
13700
  return {
13478
- relativeDirPath: (0, import_node_path97.join)(".github", "agents")
13701
+ relativeDirPath: (0, import_node_path98.join)(".github", "agents")
13479
13702
  };
13480
13703
  }
13481
13704
  getFrontmatter() {
@@ -13549,7 +13772,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13549
13772
  return {
13550
13773
  success: false,
13551
13774
  error: new Error(
13552
- `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13775
+ `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13553
13776
  )
13554
13777
  };
13555
13778
  }
@@ -13567,7 +13790,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13567
13790
  global = false
13568
13791
  }) {
13569
13792
  const paths = this.getSettablePaths({ global });
13570
- const filePath = (0, import_node_path97.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13793
+ const filePath = (0, import_node_path98.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13571
13794
  const fileContent = await readFileContent(filePath);
13572
13795
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13573
13796
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13603,11 +13826,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13603
13826
  };
13604
13827
 
13605
13828
  // src/features/subagents/cursor-subagent.ts
13606
- var import_node_path98 = require("path");
13607
- var import_mini52 = require("zod/mini");
13608
- var CursorSubagentFrontmatterSchema = import_mini52.z.looseObject({
13609
- name: import_mini52.z.string(),
13610
- description: import_mini52.z.optional(import_mini52.z.string())
13829
+ var import_node_path99 = require("path");
13830
+ var import_mini53 = require("zod/mini");
13831
+ var CursorSubagentFrontmatterSchema = import_mini53.z.looseObject({
13832
+ name: import_mini53.z.string(),
13833
+ description: import_mini53.z.optional(import_mini53.z.string())
13611
13834
  });
13612
13835
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13613
13836
  frontmatter;
@@ -13617,7 +13840,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13617
13840
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
13618
13841
  if (!result.success) {
13619
13842
  throw new Error(
13620
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13843
+ `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13621
13844
  );
13622
13845
  }
13623
13846
  }
@@ -13629,7 +13852,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13629
13852
  }
13630
13853
  static getSettablePaths(_options = {}) {
13631
13854
  return {
13632
- relativeDirPath: (0, import_node_path98.join)(".cursor", "agents")
13855
+ relativeDirPath: (0, import_node_path99.join)(".cursor", "agents")
13633
13856
  };
13634
13857
  }
13635
13858
  getFrontmatter() {
@@ -13696,7 +13919,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13696
13919
  return {
13697
13920
  success: false,
13698
13921
  error: new Error(
13699
- `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13922
+ `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13700
13923
  )
13701
13924
  };
13702
13925
  }
@@ -13714,7 +13937,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13714
13937
  global = false
13715
13938
  }) {
13716
13939
  const paths = this.getSettablePaths({ global });
13717
- const filePath = (0, import_node_path98.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13940
+ const filePath = (0, import_node_path99.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13718
13941
  const fileContent = await readFileContent(filePath);
13719
13942
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13720
13943
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13750,12 +13973,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13750
13973
  };
13751
13974
 
13752
13975
  // src/features/subagents/deepagents-subagent.ts
13753
- var import_node_path99 = require("path");
13754
- var import_mini53 = require("zod/mini");
13755
- var DeepagentsSubagentFrontmatterSchema = import_mini53.z.looseObject({
13756
- name: import_mini53.z.string(),
13757
- description: import_mini53.z.optional(import_mini53.z.string()),
13758
- model: import_mini53.z.optional(import_mini53.z.string())
13976
+ var import_node_path100 = require("path");
13977
+ var import_mini54 = require("zod/mini");
13978
+ var DeepagentsSubagentFrontmatterSchema = import_mini54.z.looseObject({
13979
+ name: import_mini54.z.string(),
13980
+ description: import_mini54.z.optional(import_mini54.z.string()),
13981
+ model: import_mini54.z.optional(import_mini54.z.string())
13759
13982
  });
13760
13983
  var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13761
13984
  frontmatter;
@@ -13765,7 +13988,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13765
13988
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
13766
13989
  if (!result.success) {
13767
13990
  throw new Error(
13768
- `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13991
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13769
13992
  );
13770
13993
  }
13771
13994
  }
@@ -13775,7 +13998,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13775
13998
  }
13776
13999
  static getSettablePaths(_options = {}) {
13777
14000
  return {
13778
- relativeDirPath: (0, import_node_path99.join)(".deepagents", "agents")
14001
+ relativeDirPath: (0, import_node_path100.join)(".deepagents", "agents")
13779
14002
  };
13780
14003
  }
13781
14004
  getFrontmatter() {
@@ -13850,7 +14073,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13850
14073
  return {
13851
14074
  success: false,
13852
14075
  error: new Error(
13853
- `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14076
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13854
14077
  )
13855
14078
  };
13856
14079
  }
@@ -13868,7 +14091,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13868
14091
  global = false
13869
14092
  }) {
13870
14093
  const paths = this.getSettablePaths({ global });
13871
- const filePath = (0, import_node_path99.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14094
+ const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13872
14095
  const fileContent = await readFileContent(filePath);
13873
14096
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13874
14097
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13903,11 +14126,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13903
14126
  };
13904
14127
 
13905
14128
  // src/features/subagents/junie-subagent.ts
13906
- var import_node_path100 = require("path");
13907
- var import_mini54 = require("zod/mini");
13908
- var JunieSubagentFrontmatterSchema = import_mini54.z.looseObject({
13909
- name: import_mini54.z.optional(import_mini54.z.string()),
13910
- description: import_mini54.z.string()
14129
+ var import_node_path101 = require("path");
14130
+ var import_mini55 = require("zod/mini");
14131
+ var JunieSubagentFrontmatterSchema = import_mini55.z.looseObject({
14132
+ name: import_mini55.z.optional(import_mini55.z.string()),
14133
+ description: import_mini55.z.string()
13911
14134
  });
13912
14135
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
13913
14136
  frontmatter;
@@ -13917,7 +14140,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
13917
14140
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
13918
14141
  if (!result.success) {
13919
14142
  throw new Error(
13920
- `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14143
+ `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13921
14144
  );
13922
14145
  }
13923
14146
  }
@@ -13932,7 +14155,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
13932
14155
  throw new Error("JunieSubagent does not support global mode.");
13933
14156
  }
13934
14157
  return {
13935
- relativeDirPath: (0, import_node_path100.join)(".junie", "agents")
14158
+ relativeDirPath: (0, import_node_path101.join)(".junie", "agents")
13936
14159
  };
13937
14160
  }
13938
14161
  getFrontmatter() {
@@ -14008,7 +14231,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14008
14231
  return {
14009
14232
  success: false,
14010
14233
  error: new Error(
14011
- `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14234
+ `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14012
14235
  )
14013
14236
  };
14014
14237
  }
@@ -14026,7 +14249,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14026
14249
  global = false
14027
14250
  }) {
14028
14251
  const paths = this.getSettablePaths({ global });
14029
- const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14252
+ const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14030
14253
  const fileContent = await readFileContent(filePath);
14031
14254
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14032
14255
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14061,15 +14284,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14061
14284
  };
14062
14285
 
14063
14286
  // src/features/subagents/kilo-subagent.ts
14064
- var import_node_path102 = require("path");
14287
+ var import_node_path103 = require("path");
14065
14288
 
14066
14289
  // src/features/subagents/opencode-style-subagent.ts
14067
- var import_node_path101 = require("path");
14068
- var import_mini55 = require("zod/mini");
14069
- var OpenCodeStyleSubagentFrontmatterSchema = import_mini55.z.looseObject({
14070
- description: import_mini55.z.optional(import_mini55.z.string()),
14071
- mode: import_mini55.z._default(import_mini55.z.string(), "subagent"),
14072
- name: import_mini55.z.optional(import_mini55.z.string())
14290
+ var import_node_path102 = require("path");
14291
+ var import_mini56 = require("zod/mini");
14292
+ var OpenCodeStyleSubagentFrontmatterSchema = import_mini56.z.looseObject({
14293
+ description: import_mini56.z.optional(import_mini56.z.string()),
14294
+ mode: import_mini56.z._default(import_mini56.z.string(), "subagent"),
14295
+ name: import_mini56.z.optional(import_mini56.z.string())
14073
14296
  });
14074
14297
  var OpenCodeStyleSubagent = class extends ToolSubagent {
14075
14298
  frontmatter;
@@ -14079,7 +14302,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14079
14302
  const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
14080
14303
  if (!result.success) {
14081
14304
  throw new Error(
14082
- `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14305
+ `Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14083
14306
  );
14084
14307
  }
14085
14308
  }
@@ -14099,7 +14322,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14099
14322
  const { description, mode, name, ...toolSection } = this.frontmatter;
14100
14323
  const rulesyncFrontmatter = {
14101
14324
  targets: ["*"],
14102
- name: name ?? (0, import_node_path101.basename)(this.getRelativeFilePath(), ".md"),
14325
+ name: name ?? (0, import_node_path102.basename)(this.getRelativeFilePath(), ".md"),
14103
14326
  description,
14104
14327
  [this.getToolTarget()]: { mode, ...toolSection }
14105
14328
  };
@@ -14121,7 +14344,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14121
14344
  return {
14122
14345
  success: false,
14123
14346
  error: new Error(
14124
- `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14347
+ `Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14125
14348
  )
14126
14349
  };
14127
14350
  }
@@ -14137,7 +14360,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14137
14360
  global = false
14138
14361
  } = {}) {
14139
14362
  return {
14140
- relativeDirPath: global ? (0, import_node_path102.join)(".config", "kilo", "agent") : (0, import_node_path102.join)(".kilo", "agent")
14363
+ relativeDirPath: global ? (0, import_node_path103.join)(".config", "kilo", "agent") : (0, import_node_path103.join)(".kilo", "agent")
14141
14364
  };
14142
14365
  }
14143
14366
  static fromRulesyncSubagent({
@@ -14181,7 +14404,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14181
14404
  global = false
14182
14405
  }) {
14183
14406
  const paths = this.getSettablePaths({ global });
14184
- const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14407
+ const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14185
14408
  const fileContent = await readFileContent(filePath);
14186
14409
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14187
14410
  const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14217,23 +14440,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14217
14440
  };
14218
14441
 
14219
14442
  // src/features/subagents/kiro-subagent.ts
14220
- var import_node_path103 = require("path");
14221
- var import_mini56 = require("zod/mini");
14222
- var KiroCliSubagentJsonSchema = import_mini56.z.looseObject({
14223
- name: import_mini56.z.string(),
14224
- description: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.string())),
14225
- prompt: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.string())),
14226
- tools: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.array(import_mini56.z.string()))),
14227
- toolAliases: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.record(import_mini56.z.string(), import_mini56.z.string()))),
14228
- toolSettings: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.unknown())),
14229
- toolSchema: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.unknown())),
14230
- hooks: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.record(import_mini56.z.string(), import_mini56.z.array(import_mini56.z.unknown())))),
14231
- model: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.string())),
14232
- mcpServers: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.record(import_mini56.z.string(), import_mini56.z.unknown()))),
14233
- useLegacyMcpJson: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.boolean())),
14234
- resources: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.array(import_mini56.z.string()))),
14235
- allowedTools: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.array(import_mini56.z.string()))),
14236
- includeMcpJson: import_mini56.z.optional(import_mini56.z.nullable(import_mini56.z.boolean()))
14443
+ var import_node_path104 = require("path");
14444
+ var import_mini57 = require("zod/mini");
14445
+ var KiroCliSubagentJsonSchema = import_mini57.z.looseObject({
14446
+ name: import_mini57.z.string(),
14447
+ description: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.string())),
14448
+ prompt: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.string())),
14449
+ tools: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.array(import_mini57.z.string()))),
14450
+ toolAliases: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.record(import_mini57.z.string(), import_mini57.z.string()))),
14451
+ toolSettings: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.unknown())),
14452
+ toolSchema: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.unknown())),
14453
+ hooks: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.record(import_mini57.z.string(), import_mini57.z.array(import_mini57.z.unknown())))),
14454
+ model: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.string())),
14455
+ mcpServers: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.record(import_mini57.z.string(), import_mini57.z.unknown()))),
14456
+ useLegacyMcpJson: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.boolean())),
14457
+ resources: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.array(import_mini57.z.string()))),
14458
+ allowedTools: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.array(import_mini57.z.string()))),
14459
+ includeMcpJson: import_mini57.z.optional(import_mini57.z.nullable(import_mini57.z.boolean()))
14237
14460
  });
14238
14461
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14239
14462
  body;
@@ -14244,7 +14467,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14244
14467
  KiroCliSubagentJsonSchema.parse(parsed);
14245
14468
  } catch (error) {
14246
14469
  throw new Error(
14247
- `Invalid JSON in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14470
+ `Invalid JSON in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14248
14471
  { cause: error }
14249
14472
  );
14250
14473
  }
@@ -14256,7 +14479,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14256
14479
  }
14257
14480
  static getSettablePaths(_options = {}) {
14258
14481
  return {
14259
- relativeDirPath: (0, import_node_path103.join)(".kiro", "agents")
14482
+ relativeDirPath: (0, import_node_path104.join)(".kiro", "agents")
14260
14483
  };
14261
14484
  }
14262
14485
  getBody() {
@@ -14268,7 +14491,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14268
14491
  parsed = JSON.parse(this.body);
14269
14492
  } catch (error) {
14270
14493
  throw new Error(
14271
- `Failed to parse JSON in ${(0, import_node_path103.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14494
+ `Failed to parse JSON in ${(0, import_node_path104.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14272
14495
  { cause: error }
14273
14496
  );
14274
14497
  }
@@ -14349,7 +14572,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14349
14572
  global = false
14350
14573
  }) {
14351
14574
  const paths = this.getSettablePaths({ global });
14352
- const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14575
+ const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14353
14576
  const fileContent = await readFileContent(filePath);
14354
14577
  const subagent = new _KiroSubagent({
14355
14578
  baseDir,
@@ -14387,7 +14610,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14387
14610
  };
14388
14611
 
14389
14612
  // src/features/subagents/opencode-subagent.ts
14390
- var import_node_path104 = require("path");
14613
+ var import_node_path105 = require("path");
14391
14614
  var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
14392
14615
  var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14393
14616
  getToolTarget() {
@@ -14397,7 +14620,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14397
14620
  global = false
14398
14621
  } = {}) {
14399
14622
  return {
14400
- relativeDirPath: global ? (0, import_node_path104.join)(".config", "opencode", "agent") : (0, import_node_path104.join)(".opencode", "agent")
14623
+ relativeDirPath: global ? (0, import_node_path105.join)(".config", "opencode", "agent") : (0, import_node_path105.join)(".opencode", "agent")
14401
14624
  };
14402
14625
  }
14403
14626
  static fromRulesyncSubagent({
@@ -14441,7 +14664,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14441
14664
  global = false
14442
14665
  }) {
14443
14666
  const paths = this.getSettablePaths({ global });
14444
- const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14667
+ const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14445
14668
  const fileContent = await readFileContent(filePath);
14446
14669
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14447
14670
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14494,7 +14717,7 @@ var subagentsProcessorToolTargetTuple = [
14494
14717
  "roo",
14495
14718
  "rovodev"
14496
14719
  ];
14497
- var SubagentsProcessorToolTargetSchema = import_mini57.z.enum(subagentsProcessorToolTargetTuple);
14720
+ var SubagentsProcessorToolTargetSchema = import_mini58.z.enum(subagentsProcessorToolTargetTuple);
14498
14721
  var toolSubagentFactories = /* @__PURE__ */ new Map([
14499
14722
  [
14500
14723
  "agentsmd",
@@ -14685,7 +14908,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14685
14908
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
14686
14909
  */
14687
14910
  async loadRulesyncFiles() {
14688
- const subagentsDir = (0, import_node_path105.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
14911
+ const subagentsDir = (0, import_node_path106.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
14689
14912
  const dirExists = await directoryExists(subagentsDir);
14690
14913
  if (!dirExists) {
14691
14914
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -14700,7 +14923,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14700
14923
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
14701
14924
  const rulesyncSubagents = [];
14702
14925
  for (const mdFile of mdFiles) {
14703
- const filepath = (0, import_node_path105.join)(subagentsDir, mdFile);
14926
+ const filepath = (0, import_node_path106.join)(subagentsDir, mdFile);
14704
14927
  try {
14705
14928
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
14706
14929
  relativeFilePath: mdFile,
@@ -14730,14 +14953,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
14730
14953
  const factory = this.getFactory(this.toolTarget);
14731
14954
  const paths = factory.class.getSettablePaths({ global: this.global });
14732
14955
  const subagentFilePaths = await findFilesByGlobs(
14733
- (0, import_node_path105.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
14956
+ (0, import_node_path106.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
14734
14957
  );
14735
14958
  if (forDeletion) {
14736
14959
  const toolSubagents2 = subagentFilePaths.map(
14737
14960
  (path3) => factory.class.forDeletion({
14738
14961
  baseDir: this.baseDir,
14739
14962
  relativeDirPath: paths.relativeDirPath,
14740
- relativeFilePath: (0, import_node_path105.basename)(path3),
14963
+ relativeFilePath: (0, import_node_path106.basename)(path3),
14741
14964
  global: this.global
14742
14965
  })
14743
14966
  ).filter((subagent) => subagent.isDeletable());
@@ -14750,7 +14973,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14750
14973
  subagentFilePaths.map(
14751
14974
  (path3) => factory.class.fromFile({
14752
14975
  baseDir: this.baseDir,
14753
- relativeFilePath: (0, import_node_path105.basename)(path3),
14976
+ relativeFilePath: (0, import_node_path106.basename)(path3),
14754
14977
  global: this.global
14755
14978
  })
14756
14979
  )
@@ -14797,49 +15020,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
14797
15020
  };
14798
15021
 
14799
15022
  // src/features/rules/agentsmd-rule.ts
14800
- var import_node_path108 = require("path");
15023
+ var import_node_path109 = require("path");
14801
15024
 
14802
15025
  // src/features/rules/tool-rule.ts
14803
- var import_node_path107 = require("path");
15026
+ var import_node_path108 = require("path");
14804
15027
 
14805
15028
  // src/features/rules/rulesync-rule.ts
14806
- var import_node_path106 = require("path");
14807
- var import_mini58 = require("zod/mini");
14808
- var RulesyncRuleFrontmatterSchema = import_mini58.z.object({
14809
- root: import_mini58.z.optional(import_mini58.z.boolean()),
14810
- localRoot: import_mini58.z.optional(import_mini58.z.boolean()),
14811
- targets: import_mini58.z._default(RulesyncTargetsSchema, ["*"]),
14812
- description: import_mini58.z.optional(import_mini58.z.string()),
14813
- globs: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string())),
14814
- agentsmd: import_mini58.z.optional(
14815
- import_mini58.z.looseObject({
15029
+ var import_node_path107 = require("path");
15030
+ var import_mini59 = require("zod/mini");
15031
+ var RulesyncRuleFrontmatterSchema = import_mini59.z.object({
15032
+ root: import_mini59.z.optional(import_mini59.z.boolean()),
15033
+ localRoot: import_mini59.z.optional(import_mini59.z.boolean()),
15034
+ targets: import_mini59.z._default(RulesyncTargetsSchema, ["*"]),
15035
+ description: import_mini59.z.optional(import_mini59.z.string()),
15036
+ globs: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string())),
15037
+ agentsmd: import_mini59.z.optional(
15038
+ import_mini59.z.looseObject({
14816
15039
  // @example "path/to/subproject"
14817
- subprojectPath: import_mini58.z.optional(import_mini58.z.string())
15040
+ subprojectPath: import_mini59.z.optional(import_mini59.z.string())
14818
15041
  })
14819
15042
  ),
14820
- claudecode: import_mini58.z.optional(
14821
- import_mini58.z.looseObject({
15043
+ claudecode: import_mini59.z.optional(
15044
+ import_mini59.z.looseObject({
14822
15045
  // Glob patterns for conditional rules (takes precedence over globs)
14823
15046
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
14824
- paths: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string()))
15047
+ paths: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string()))
14825
15048
  })
14826
15049
  ),
14827
- cursor: import_mini58.z.optional(
14828
- import_mini58.z.looseObject({
14829
- alwaysApply: import_mini58.z.optional(import_mini58.z.boolean()),
14830
- description: import_mini58.z.optional(import_mini58.z.string()),
14831
- globs: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string()))
15050
+ cursor: import_mini59.z.optional(
15051
+ import_mini59.z.looseObject({
15052
+ alwaysApply: import_mini59.z.optional(import_mini59.z.boolean()),
15053
+ description: import_mini59.z.optional(import_mini59.z.string()),
15054
+ globs: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string()))
14832
15055
  })
14833
15056
  ),
14834
- copilot: import_mini58.z.optional(
14835
- import_mini58.z.looseObject({
14836
- excludeAgent: import_mini58.z.optional(import_mini58.z.union([import_mini58.z.literal("code-review"), import_mini58.z.literal("coding-agent")]))
15057
+ copilot: import_mini59.z.optional(
15058
+ import_mini59.z.looseObject({
15059
+ excludeAgent: import_mini59.z.optional(import_mini59.z.union([import_mini59.z.literal("code-review"), import_mini59.z.literal("coding-agent")]))
14837
15060
  })
14838
15061
  ),
14839
- antigravity: import_mini58.z.optional(
14840
- import_mini58.z.looseObject({
14841
- trigger: import_mini58.z.optional(import_mini58.z.string()),
14842
- globs: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string()))
15062
+ antigravity: import_mini59.z.optional(
15063
+ import_mini59.z.looseObject({
15064
+ trigger: import_mini59.z.optional(import_mini59.z.string()),
15065
+ globs: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string()))
14843
15066
  })
14844
15067
  )
14845
15068
  });
@@ -14850,7 +15073,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
14850
15073
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
14851
15074
  if (!parseResult.success && rest.validate !== false) {
14852
15075
  throw new Error(
14853
- `Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
15076
+ `Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
14854
15077
  );
14855
15078
  }
14856
15079
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -14885,7 +15108,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
14885
15108
  return {
14886
15109
  success: false,
14887
15110
  error: new Error(
14888
- `Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15111
+ `Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14889
15112
  )
14890
15113
  };
14891
15114
  }
@@ -14894,7 +15117,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
14894
15117
  relativeFilePath,
14895
15118
  validate = true
14896
15119
  }) {
14897
- const filePath = (0, import_node_path106.join)(
15120
+ const filePath = (0, import_node_path107.join)(
14898
15121
  process.cwd(),
14899
15122
  this.getSettablePaths().recommended.relativeDirPath,
14900
15123
  relativeFilePath
@@ -14993,7 +15216,7 @@ var ToolRule = class extends ToolFile {
14993
15216
  rulesyncRule,
14994
15217
  validate = true,
14995
15218
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
14996
- nonRootPath = { relativeDirPath: (0, import_node_path107.join)(".agents", "memories") }
15219
+ nonRootPath = { relativeDirPath: (0, import_node_path108.join)(".agents", "memories") }
14997
15220
  }) {
14998
15221
  const params = this.buildToolRuleParamsDefault({
14999
15222
  baseDir,
@@ -15004,7 +15227,7 @@ var ToolRule = class extends ToolFile {
15004
15227
  });
15005
15228
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
15006
15229
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
15007
- params.relativeDirPath = (0, import_node_path107.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
15230
+ params.relativeDirPath = (0, import_node_path108.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
15008
15231
  params.relativeFilePath = "AGENTS.md";
15009
15232
  }
15010
15233
  return params;
@@ -15053,7 +15276,7 @@ var ToolRule = class extends ToolFile {
15053
15276
  }
15054
15277
  };
15055
15278
  function buildToolPath(toolDir, subDir, excludeToolDir) {
15056
- return excludeToolDir ? subDir : (0, import_node_path107.join)(toolDir, subDir);
15279
+ return excludeToolDir ? subDir : (0, import_node_path108.join)(toolDir, subDir);
15057
15280
  }
15058
15281
 
15059
15282
  // src/features/rules/agentsmd-rule.ts
@@ -15082,8 +15305,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15082
15305
  validate = true
15083
15306
  }) {
15084
15307
  const isRoot = relativeFilePath === "AGENTS.md";
15085
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path108.join)(".agents", "memories", relativeFilePath);
15086
- const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
15308
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path109.join)(".agents", "memories", relativeFilePath);
15309
+ const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
15087
15310
  return new _AgentsMdRule({
15088
15311
  baseDir,
15089
15312
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -15138,21 +15361,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15138
15361
  };
15139
15362
 
15140
15363
  // src/features/rules/antigravity-rule.ts
15141
- var import_node_path109 = require("path");
15142
- var import_mini59 = require("zod/mini");
15143
- var AntigravityRuleFrontmatterSchema = import_mini59.z.looseObject({
15144
- trigger: import_mini59.z.optional(
15145
- import_mini59.z.union([
15146
- import_mini59.z.literal("always_on"),
15147
- import_mini59.z.literal("glob"),
15148
- import_mini59.z.literal("manual"),
15149
- import_mini59.z.literal("model_decision"),
15150
- import_mini59.z.string()
15364
+ var import_node_path110 = require("path");
15365
+ var import_mini60 = require("zod/mini");
15366
+ var AntigravityRuleFrontmatterSchema = import_mini60.z.looseObject({
15367
+ trigger: import_mini60.z.optional(
15368
+ import_mini60.z.union([
15369
+ import_mini60.z.literal("always_on"),
15370
+ import_mini60.z.literal("glob"),
15371
+ import_mini60.z.literal("manual"),
15372
+ import_mini60.z.literal("model_decision"),
15373
+ import_mini60.z.string()
15151
15374
  // accepts any string for forward compatibility
15152
15375
  ])
15153
15376
  ),
15154
- globs: import_mini59.z.optional(import_mini59.z.string()),
15155
- description: import_mini59.z.optional(import_mini59.z.string())
15377
+ globs: import_mini60.z.optional(import_mini60.z.string()),
15378
+ description: import_mini60.z.optional(import_mini60.z.string())
15156
15379
  });
15157
15380
  function parseGlobsString(globs) {
15158
15381
  if (!globs) {
@@ -15297,7 +15520,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15297
15520
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
15298
15521
  if (!result.success) {
15299
15522
  throw new Error(
15300
- `Invalid frontmatter in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15523
+ `Invalid frontmatter in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15301
15524
  );
15302
15525
  }
15303
15526
  }
@@ -15321,7 +15544,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15321
15544
  relativeFilePath,
15322
15545
  validate = true
15323
15546
  }) {
15324
- const filePath = (0, import_node_path109.join)(
15547
+ const filePath = (0, import_node_path110.join)(
15325
15548
  baseDir,
15326
15549
  this.getSettablePaths().nonRoot.relativeDirPath,
15327
15550
  relativeFilePath
@@ -15461,7 +15684,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15461
15684
  };
15462
15685
 
15463
15686
  // src/features/rules/augmentcode-legacy-rule.ts
15464
- var import_node_path110 = require("path");
15687
+ var import_node_path111 = require("path");
15465
15688
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15466
15689
  toRulesyncRule() {
15467
15690
  const rulesyncFrontmatter = {
@@ -15521,8 +15744,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15521
15744
  }) {
15522
15745
  const settablePaths = this.getSettablePaths();
15523
15746
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
15524
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path110.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
15525
- const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
15747
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path111.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
15748
+ const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
15526
15749
  return new _AugmentcodeLegacyRule({
15527
15750
  baseDir,
15528
15751
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -15551,7 +15774,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15551
15774
  };
15552
15775
 
15553
15776
  // src/features/rules/augmentcode-rule.ts
15554
- var import_node_path111 = require("path");
15777
+ var import_node_path112 = require("path");
15555
15778
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15556
15779
  toRulesyncRule() {
15557
15780
  return this.toRulesyncRuleDefault();
@@ -15582,7 +15805,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15582
15805
  relativeFilePath,
15583
15806
  validate = true
15584
15807
  }) {
15585
- const filePath = (0, import_node_path111.join)(
15808
+ const filePath = (0, import_node_path112.join)(
15586
15809
  baseDir,
15587
15810
  this.getSettablePaths().nonRoot.relativeDirPath,
15588
15811
  relativeFilePath
@@ -15622,7 +15845,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15622
15845
  };
15623
15846
 
15624
15847
  // src/features/rules/claudecode-legacy-rule.ts
15625
- var import_node_path112 = require("path");
15848
+ var import_node_path113 = require("path");
15626
15849
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15627
15850
  static getSettablePaths({
15628
15851
  global,
@@ -15664,7 +15887,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15664
15887
  if (isRoot) {
15665
15888
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
15666
15889
  const fileContent2 = await readFileContent(
15667
- (0, import_node_path112.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
15890
+ (0, import_node_path113.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
15668
15891
  );
15669
15892
  return new _ClaudecodeLegacyRule({
15670
15893
  baseDir,
@@ -15678,8 +15901,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15678
15901
  if (!paths.nonRoot) {
15679
15902
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15680
15903
  }
15681
- const relativePath = (0, import_node_path112.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15682
- const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
15904
+ const relativePath = (0, import_node_path113.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15905
+ const fileContent = await readFileContent((0, import_node_path113.join)(baseDir, relativePath));
15683
15906
  return new _ClaudecodeLegacyRule({
15684
15907
  baseDir,
15685
15908
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15738,10 +15961,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15738
15961
  };
15739
15962
 
15740
15963
  // src/features/rules/claudecode-rule.ts
15741
- var import_node_path113 = require("path");
15742
- var import_mini60 = require("zod/mini");
15743
- var ClaudecodeRuleFrontmatterSchema = import_mini60.z.object({
15744
- paths: import_mini60.z.optional(import_mini60.z.array(import_mini60.z.string()))
15964
+ var import_node_path114 = require("path");
15965
+ var import_mini61 = require("zod/mini");
15966
+ var ClaudecodeRuleFrontmatterSchema = import_mini61.z.object({
15967
+ paths: import_mini61.z.optional(import_mini61.z.array(import_mini61.z.string()))
15745
15968
  });
15746
15969
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15747
15970
  frontmatter;
@@ -15779,7 +16002,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15779
16002
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
15780
16003
  if (!result.success) {
15781
16004
  throw new Error(
15782
- `Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16005
+ `Invalid frontmatter in ${(0, import_node_path114.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15783
16006
  );
15784
16007
  }
15785
16008
  }
@@ -15809,7 +16032,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15809
16032
  if (isRoot) {
15810
16033
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
15811
16034
  const fileContent2 = await readFileContent(
15812
- (0, import_node_path113.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
16035
+ (0, import_node_path114.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
15813
16036
  );
15814
16037
  return new _ClaudecodeRule({
15815
16038
  baseDir,
@@ -15824,8 +16047,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15824
16047
  if (!paths.nonRoot) {
15825
16048
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15826
16049
  }
15827
- const relativePath = (0, import_node_path113.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15828
- const filePath = (0, import_node_path113.join)(baseDir, relativePath);
16050
+ const relativePath = (0, import_node_path114.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16051
+ const filePath = (0, import_node_path114.join)(baseDir, relativePath);
15829
16052
  const fileContent = await readFileContent(filePath);
15830
16053
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15831
16054
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -15936,7 +16159,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15936
16159
  return {
15937
16160
  success: false,
15938
16161
  error: new Error(
15939
- `Invalid frontmatter in ${(0, import_node_path113.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16162
+ `Invalid frontmatter in ${(0, import_node_path114.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15940
16163
  )
15941
16164
  };
15942
16165
  }
@@ -15956,10 +16179,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15956
16179
  };
15957
16180
 
15958
16181
  // src/features/rules/cline-rule.ts
15959
- var import_node_path114 = require("path");
15960
- var import_mini61 = require("zod/mini");
15961
- var ClineRuleFrontmatterSchema = import_mini61.z.object({
15962
- description: import_mini61.z.string()
16182
+ var import_node_path115 = require("path");
16183
+ var import_mini62 = require("zod/mini");
16184
+ var ClineRuleFrontmatterSchema = import_mini62.z.object({
16185
+ description: import_mini62.z.string()
15963
16186
  });
15964
16187
  var ClineRule = class _ClineRule extends ToolRule {
15965
16188
  static getSettablePaths(_options = {}) {
@@ -16002,7 +16225,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16002
16225
  validate = true
16003
16226
  }) {
16004
16227
  const fileContent = await readFileContent(
16005
- (0, import_node_path114.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16228
+ (0, import_node_path115.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16006
16229
  );
16007
16230
  return new _ClineRule({
16008
16231
  baseDir,
@@ -16028,7 +16251,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16028
16251
  };
16029
16252
 
16030
16253
  // src/features/rules/codexcli-rule.ts
16031
- var import_node_path115 = require("path");
16254
+ var import_node_path116 = require("path");
16032
16255
  var CodexcliRule = class _CodexcliRule extends ToolRule {
16033
16256
  static getSettablePaths({
16034
16257
  global,
@@ -16063,7 +16286,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16063
16286
  if (isRoot) {
16064
16287
  const relativePath2 = paths.root.relativeFilePath;
16065
16288
  const fileContent2 = await readFileContent(
16066
- (0, import_node_path115.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16289
+ (0, import_node_path116.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16067
16290
  );
16068
16291
  return new _CodexcliRule({
16069
16292
  baseDir,
@@ -16077,8 +16300,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16077
16300
  if (!paths.nonRoot) {
16078
16301
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16079
16302
  }
16080
- const relativePath = (0, import_node_path115.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16081
- const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
16303
+ const relativePath = (0, import_node_path116.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16304
+ const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
16082
16305
  return new _CodexcliRule({
16083
16306
  baseDir,
16084
16307
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16137,12 +16360,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16137
16360
  };
16138
16361
 
16139
16362
  // src/features/rules/copilot-rule.ts
16140
- var import_node_path116 = require("path");
16141
- var import_mini62 = require("zod/mini");
16142
- var CopilotRuleFrontmatterSchema = import_mini62.z.object({
16143
- description: import_mini62.z.optional(import_mini62.z.string()),
16144
- applyTo: import_mini62.z.optional(import_mini62.z.string()),
16145
- excludeAgent: import_mini62.z.optional(import_mini62.z.union([import_mini62.z.literal("code-review"), import_mini62.z.literal("coding-agent")]))
16363
+ var import_node_path117 = require("path");
16364
+ var import_mini63 = require("zod/mini");
16365
+ var CopilotRuleFrontmatterSchema = import_mini63.z.object({
16366
+ description: import_mini63.z.optional(import_mini63.z.string()),
16367
+ applyTo: import_mini63.z.optional(import_mini63.z.string()),
16368
+ excludeAgent: import_mini63.z.optional(import_mini63.z.union([import_mini63.z.literal("code-review"), import_mini63.z.literal("coding-agent")]))
16146
16369
  });
16147
16370
  var CopilotRule = class _CopilotRule extends ToolRule {
16148
16371
  frontmatter;
@@ -16174,7 +16397,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16174
16397
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
16175
16398
  if (!result.success) {
16176
16399
  throw new Error(
16177
- `Invalid frontmatter in ${(0, import_node_path116.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16400
+ `Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16178
16401
  );
16179
16402
  }
16180
16403
  }
@@ -16264,8 +16487,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16264
16487
  const paths = this.getSettablePaths({ global });
16265
16488
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
16266
16489
  if (isRoot) {
16267
- const relativePath2 = (0, import_node_path116.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
16268
- const filePath2 = (0, import_node_path116.join)(baseDir, relativePath2);
16490
+ const relativePath2 = (0, import_node_path117.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
16491
+ const filePath2 = (0, import_node_path117.join)(baseDir, relativePath2);
16269
16492
  const fileContent2 = await readFileContent(filePath2);
16270
16493
  return new _CopilotRule({
16271
16494
  baseDir,
@@ -16280,8 +16503,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16280
16503
  if (!paths.nonRoot) {
16281
16504
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16282
16505
  }
16283
- const relativePath = (0, import_node_path116.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16284
- const filePath = (0, import_node_path116.join)(baseDir, relativePath);
16506
+ const relativePath = (0, import_node_path117.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16507
+ const filePath = (0, import_node_path117.join)(baseDir, relativePath);
16285
16508
  const fileContent = await readFileContent(filePath);
16286
16509
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
16287
16510
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -16327,7 +16550,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16327
16550
  return {
16328
16551
  success: false,
16329
16552
  error: new Error(
16330
- `Invalid frontmatter in ${(0, import_node_path116.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16553
+ `Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16331
16554
  )
16332
16555
  };
16333
16556
  }
@@ -16383,12 +16606,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
16383
16606
  };
16384
16607
 
16385
16608
  // src/features/rules/cursor-rule.ts
16386
- var import_node_path117 = require("path");
16387
- var import_mini63 = require("zod/mini");
16388
- var CursorRuleFrontmatterSchema = import_mini63.z.object({
16389
- description: import_mini63.z.optional(import_mini63.z.string()),
16390
- globs: import_mini63.z.optional(import_mini63.z.string()),
16391
- alwaysApply: import_mini63.z.optional(import_mini63.z.boolean())
16609
+ var import_node_path118 = require("path");
16610
+ var import_mini64 = require("zod/mini");
16611
+ var CursorRuleFrontmatterSchema = import_mini64.z.object({
16612
+ description: import_mini64.z.optional(import_mini64.z.string()),
16613
+ globs: import_mini64.z.optional(import_mini64.z.string()),
16614
+ alwaysApply: import_mini64.z.optional(import_mini64.z.boolean())
16392
16615
  });
16393
16616
  var CursorRule = class _CursorRule extends ToolRule {
16394
16617
  frontmatter;
@@ -16405,7 +16628,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16405
16628
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
16406
16629
  if (!result.success) {
16407
16630
  throw new Error(
16408
- `Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16631
+ `Invalid frontmatter in ${(0, import_node_path118.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16409
16632
  );
16410
16633
  }
16411
16634
  }
@@ -16521,7 +16744,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16521
16744
  relativeFilePath,
16522
16745
  validate = true
16523
16746
  }) {
16524
- const filePath = (0, import_node_path117.join)(
16747
+ const filePath = (0, import_node_path118.join)(
16525
16748
  baseDir,
16526
16749
  this.getSettablePaths().nonRoot.relativeDirPath,
16527
16750
  relativeFilePath
@@ -16531,7 +16754,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16531
16754
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
16532
16755
  if (!result.success) {
16533
16756
  throw new Error(
16534
- `Invalid frontmatter in ${(0, import_node_path117.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
16757
+ `Invalid frontmatter in ${(0, import_node_path118.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
16535
16758
  );
16536
16759
  }
16537
16760
  return new _CursorRule({
@@ -16568,7 +16791,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16568
16791
  return {
16569
16792
  success: false,
16570
16793
  error: new Error(
16571
- `Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16794
+ `Invalid frontmatter in ${(0, import_node_path118.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16572
16795
  )
16573
16796
  };
16574
16797
  }
@@ -16588,7 +16811,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16588
16811
  };
16589
16812
 
16590
16813
  // src/features/rules/deepagents-rule.ts
16591
- var import_node_path118 = require("path");
16814
+ var import_node_path119 = require("path");
16592
16815
  var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16593
16816
  constructor({ fileContent, root, ...rest }) {
16594
16817
  super({
@@ -16613,12 +16836,13 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16613
16836
  relativeFilePath,
16614
16837
  validate = true
16615
16838
  }) {
16839
+ const settablePaths = this.getSettablePaths();
16616
16840
  const isRoot = relativeFilePath === "AGENTS.md";
16617
- const relativePath = isRoot ? (0, import_node_path118.join)(".deepagents", "AGENTS.md") : (0, import_node_path118.join)(".deepagents", "memories", relativeFilePath);
16618
- const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
16841
+ const relativePath = isRoot ? (0, import_node_path119.join)(".deepagents", "AGENTS.md") : (0, import_node_path119.join)(".deepagents", "memories", relativeFilePath);
16842
+ const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
16619
16843
  return new _DeepagentsRule({
16620
16844
  baseDir,
16621
- relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
16845
+ relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
16622
16846
  relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
16623
16847
  fileContent,
16624
16848
  validate,
@@ -16670,7 +16894,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16670
16894
  };
16671
16895
 
16672
16896
  // src/features/rules/factorydroid-rule.ts
16673
- var import_node_path119 = require("path");
16897
+ var import_node_path120 = require("path");
16674
16898
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16675
16899
  constructor({ fileContent, root, ...rest }) {
16676
16900
  super({
@@ -16710,8 +16934,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16710
16934
  const paths = this.getSettablePaths({ global });
16711
16935
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
16712
16936
  if (isRoot) {
16713
- const relativePath2 = (0, import_node_path119.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
16714
- const fileContent2 = await readFileContent((0, import_node_path119.join)(baseDir, relativePath2));
16937
+ const relativePath2 = (0, import_node_path120.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
16938
+ const fileContent2 = await readFileContent((0, import_node_path120.join)(baseDir, relativePath2));
16715
16939
  return new _FactorydroidRule({
16716
16940
  baseDir,
16717
16941
  relativeDirPath: paths.root.relativeDirPath,
@@ -16724,8 +16948,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16724
16948
  if (!paths.nonRoot) {
16725
16949
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16726
16950
  }
16727
- const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16728
- const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
16951
+ const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16952
+ const fileContent = await readFileContent((0, import_node_path120.join)(baseDir, relativePath));
16729
16953
  return new _FactorydroidRule({
16730
16954
  baseDir,
16731
16955
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16784,7 +17008,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16784
17008
  };
16785
17009
 
16786
17010
  // src/features/rules/geminicli-rule.ts
16787
- var import_node_path120 = require("path");
17011
+ var import_node_path121 = require("path");
16788
17012
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
16789
17013
  static getSettablePaths({
16790
17014
  global,
@@ -16819,7 +17043,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
16819
17043
  if (isRoot) {
16820
17044
  const relativePath2 = paths.root.relativeFilePath;
16821
17045
  const fileContent2 = await readFileContent(
16822
- (0, import_node_path120.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17046
+ (0, import_node_path121.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16823
17047
  );
16824
17048
  return new _GeminiCliRule({
16825
17049
  baseDir,
@@ -16833,8 +17057,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
16833
17057
  if (!paths.nonRoot) {
16834
17058
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16835
17059
  }
16836
- const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16837
- const fileContent = await readFileContent((0, import_node_path120.join)(baseDir, relativePath));
17060
+ const relativePath = (0, import_node_path121.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17061
+ const fileContent = await readFileContent((0, import_node_path121.join)(baseDir, relativePath));
16838
17062
  return new _GeminiCliRule({
16839
17063
  baseDir,
16840
17064
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16893,7 +17117,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
16893
17117
  };
16894
17118
 
16895
17119
  // src/features/rules/goose-rule.ts
16896
- var import_node_path121 = require("path");
17120
+ var import_node_path122 = require("path");
16897
17121
  var GooseRule = class _GooseRule extends ToolRule {
16898
17122
  static getSettablePaths({
16899
17123
  global,
@@ -16928,7 +17152,7 @@ var GooseRule = class _GooseRule extends ToolRule {
16928
17152
  if (isRoot) {
16929
17153
  const relativePath2 = paths.root.relativeFilePath;
16930
17154
  const fileContent2 = await readFileContent(
16931
- (0, import_node_path121.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17155
+ (0, import_node_path122.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16932
17156
  );
16933
17157
  return new _GooseRule({
16934
17158
  baseDir,
@@ -16942,8 +17166,8 @@ var GooseRule = class _GooseRule extends ToolRule {
16942
17166
  if (!paths.nonRoot) {
16943
17167
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16944
17168
  }
16945
- const relativePath = (0, import_node_path121.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16946
- const fileContent = await readFileContent((0, import_node_path121.join)(baseDir, relativePath));
17169
+ const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17170
+ const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
16947
17171
  return new _GooseRule({
16948
17172
  baseDir,
16949
17173
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17002,7 +17226,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17002
17226
  };
17003
17227
 
17004
17228
  // src/features/rules/junie-rule.ts
17005
- var import_node_path122 = require("path");
17229
+ var import_node_path123 = require("path");
17006
17230
  var JunieRule = class _JunieRule extends ToolRule {
17007
17231
  static getSettablePaths(_options = {}) {
17008
17232
  return {
@@ -17015,18 +17239,28 @@ var JunieRule = class _JunieRule extends ToolRule {
17015
17239
  }
17016
17240
  };
17017
17241
  }
17242
+ /**
17243
+ * Determines whether a given relative file path refers to the root
17244
+ * `guidelines.md` file. Memory files live under `.junie/memories/` and are
17245
+ * passed in as bare filenames (e.g. `memo.md`), so a top-level
17246
+ * `guidelines.md` is unambiguously the root entry.
17247
+ */
17248
+ static isRootRelativeFilePath(relativeFilePath) {
17249
+ return relativeFilePath === "guidelines.md";
17250
+ }
17018
17251
  static async fromFile({
17019
17252
  baseDir = process.cwd(),
17020
17253
  relativeFilePath,
17021
17254
  validate = true
17022
17255
  }) {
17023
- const isRoot = relativeFilePath === "guidelines.md";
17024
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path122.join)(".junie", "memories", relativeFilePath);
17025
- const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
17256
+ const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
17257
+ const settablePaths = this.getSettablePaths();
17258
+ const relativePath = isRoot ? (0, import_node_path123.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path123.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17259
+ const fileContent = await readFileContent((0, import_node_path123.join)(baseDir, relativePath));
17026
17260
  return new _JunieRule({
17027
17261
  baseDir,
17028
- relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
17029
- relativeFilePath: isRoot ? "guidelines.md" : relativeFilePath,
17262
+ relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
17263
+ relativeFilePath: isRoot ? settablePaths.root.relativeFilePath : relativeFilePath,
17030
17264
  fileContent,
17031
17265
  validate,
17032
17266
  root: isRoot
@@ -17058,7 +17292,7 @@ var JunieRule = class _JunieRule extends ToolRule {
17058
17292
  relativeDirPath,
17059
17293
  relativeFilePath
17060
17294
  }) {
17061
- const isRoot = relativeFilePath === "guidelines.md";
17295
+ const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
17062
17296
  return new _JunieRule({
17063
17297
  baseDir,
17064
17298
  relativeDirPath,
@@ -17077,7 +17311,7 @@ var JunieRule = class _JunieRule extends ToolRule {
17077
17311
  };
17078
17312
 
17079
17313
  // src/features/rules/kilo-rule.ts
17080
- var import_node_path123 = require("path");
17314
+ var import_node_path124 = require("path");
17081
17315
  var KiloRule = class _KiloRule extends ToolRule {
17082
17316
  static getSettablePaths({
17083
17317
  global,
@@ -17112,7 +17346,7 @@ var KiloRule = class _KiloRule extends ToolRule {
17112
17346
  if (isRoot) {
17113
17347
  const relativePath2 = paths.root.relativeFilePath;
17114
17348
  const fileContent2 = await readFileContent(
17115
- (0, import_node_path123.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17349
+ (0, import_node_path124.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17116
17350
  );
17117
17351
  return new _KiloRule({
17118
17352
  baseDir,
@@ -17126,8 +17360,8 @@ var KiloRule = class _KiloRule extends ToolRule {
17126
17360
  if (!paths.nonRoot) {
17127
17361
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17128
17362
  }
17129
- const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17130
- const fileContent = await readFileContent((0, import_node_path123.join)(baseDir, relativePath));
17363
+ const relativePath = (0, import_node_path124.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17364
+ const fileContent = await readFileContent((0, import_node_path124.join)(baseDir, relativePath));
17131
17365
  return new _KiloRule({
17132
17366
  baseDir,
17133
17367
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17186,7 +17420,7 @@ var KiloRule = class _KiloRule extends ToolRule {
17186
17420
  };
17187
17421
 
17188
17422
  // src/features/rules/kiro-rule.ts
17189
- var import_node_path124 = require("path");
17423
+ var import_node_path125 = require("path");
17190
17424
  var KiroRule = class _KiroRule extends ToolRule {
17191
17425
  static getSettablePaths(_options = {}) {
17192
17426
  return {
@@ -17201,7 +17435,7 @@ var KiroRule = class _KiroRule extends ToolRule {
17201
17435
  validate = true
17202
17436
  }) {
17203
17437
  const fileContent = await readFileContent(
17204
- (0, import_node_path124.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17438
+ (0, import_node_path125.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17205
17439
  );
17206
17440
  return new _KiroRule({
17207
17441
  baseDir,
@@ -17255,7 +17489,7 @@ var KiroRule = class _KiroRule extends ToolRule {
17255
17489
  };
17256
17490
 
17257
17491
  // src/features/rules/opencode-rule.ts
17258
- var import_node_path125 = require("path");
17492
+ var import_node_path126 = require("path");
17259
17493
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17260
17494
  static getSettablePaths({
17261
17495
  global,
@@ -17290,7 +17524,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17290
17524
  if (isRoot) {
17291
17525
  const relativePath2 = paths.root.relativeFilePath;
17292
17526
  const fileContent2 = await readFileContent(
17293
- (0, import_node_path125.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17527
+ (0, import_node_path126.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17294
17528
  );
17295
17529
  return new _OpenCodeRule({
17296
17530
  baseDir,
@@ -17304,8 +17538,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17304
17538
  if (!paths.nonRoot) {
17305
17539
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17306
17540
  }
17307
- const relativePath = (0, import_node_path125.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17308
- const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
17541
+ const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17542
+ const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
17309
17543
  return new _OpenCodeRule({
17310
17544
  baseDir,
17311
17545
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17364,7 +17598,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17364
17598
  };
17365
17599
 
17366
17600
  // src/features/rules/qwencode-rule.ts
17367
- var import_node_path126 = require("path");
17601
+ var import_node_path127 = require("path");
17368
17602
  var QwencodeRule = class _QwencodeRule extends ToolRule {
17369
17603
  static getSettablePaths(_options = {}) {
17370
17604
  return {
@@ -17383,8 +17617,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
17383
17617
  validate = true
17384
17618
  }) {
17385
17619
  const isRoot = relativeFilePath === "QWEN.md";
17386
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path126.join)(".qwen", "memories", relativeFilePath);
17387
- const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
17620
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path127.join)(".qwen", "memories", relativeFilePath);
17621
+ const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
17388
17622
  return new _QwencodeRule({
17389
17623
  baseDir,
17390
17624
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -17436,7 +17670,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
17436
17670
  };
17437
17671
 
17438
17672
  // src/features/rules/replit-rule.ts
17439
- var import_node_path127 = require("path");
17673
+ var import_node_path128 = require("path");
17440
17674
  var ReplitRule = class _ReplitRule extends ToolRule {
17441
17675
  static getSettablePaths(_options = {}) {
17442
17676
  return {
@@ -17458,7 +17692,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
17458
17692
  }
17459
17693
  const relativePath = paths.root.relativeFilePath;
17460
17694
  const fileContent = await readFileContent(
17461
- (0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath)
17695
+ (0, import_node_path128.join)(baseDir, paths.root.relativeDirPath, relativePath)
17462
17696
  );
17463
17697
  return new _ReplitRule({
17464
17698
  baseDir,
@@ -17524,7 +17758,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
17524
17758
  };
17525
17759
 
17526
17760
  // src/features/rules/roo-rule.ts
17527
- var import_node_path128 = require("path");
17761
+ var import_node_path129 = require("path");
17528
17762
  var RooRule = class _RooRule extends ToolRule {
17529
17763
  static getSettablePaths(_options = {}) {
17530
17764
  return {
@@ -17539,7 +17773,7 @@ var RooRule = class _RooRule extends ToolRule {
17539
17773
  validate = true
17540
17774
  }) {
17541
17775
  const fileContent = await readFileContent(
17542
- (0, import_node_path128.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17776
+ (0, import_node_path129.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17543
17777
  );
17544
17778
  return new _RooRule({
17545
17779
  baseDir,
@@ -17608,7 +17842,7 @@ var RooRule = class _RooRule extends ToolRule {
17608
17842
  };
17609
17843
 
17610
17844
  // src/features/rules/rovodev-rule.ts
17611
- var import_node_path129 = require("path");
17845
+ var import_node_path130 = require("path");
17612
17846
  var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
17613
17847
  var RovodevRule = class _RovodevRule extends ToolRule {
17614
17848
  /**
@@ -17652,7 +17886,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17652
17886
  root: rovodevAgents,
17653
17887
  alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
17654
17888
  nonRoot: {
17655
- relativeDirPath: (0, import_node_path129.join)(".rovodev", ".rulesync", "modular-rules")
17889
+ relativeDirPath: (0, import_node_path130.join)(".rovodev", ".rulesync", "modular-rules")
17656
17890
  }
17657
17891
  };
17658
17892
  }
@@ -17691,10 +17925,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17691
17925
  }) {
17692
17926
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
17693
17927
  throw new Error(
17694
- `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path129.join)(relativeDirPath, relativeFilePath)}`
17928
+ `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path130.join)(relativeDirPath, relativeFilePath)}`
17695
17929
  );
17696
17930
  }
17697
- const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativeDirPath, relativeFilePath));
17931
+ const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativeDirPath, relativeFilePath));
17698
17932
  return new _RovodevRule({
17699
17933
  baseDir,
17700
17934
  relativeDirPath,
@@ -17714,10 +17948,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17714
17948
  paths
17715
17949
  }) {
17716
17950
  const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
17717
- const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
17951
+ const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path130.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path130.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
17718
17952
  if (relativeFilePath !== "AGENTS.md") {
17719
17953
  throw new Error(
17720
- `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path129.join)(relativeDirPath, relativeFilePath)}`
17954
+ `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path130.join)(relativeDirPath, relativeFilePath)}`
17721
17955
  );
17722
17956
  }
17723
17957
  const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
@@ -17725,10 +17959,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17725
17959
  );
17726
17960
  if (!allowed) {
17727
17961
  throw new Error(
17728
- `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path129.join)(relativeDirPath, relativeFilePath)}`
17962
+ `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path130.join)(relativeDirPath, relativeFilePath)}`
17729
17963
  );
17730
17964
  }
17731
- const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativeDirPath, relativeFilePath));
17965
+ const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativeDirPath, relativeFilePath));
17732
17966
  return new _RovodevRule({
17733
17967
  baseDir,
17734
17968
  relativeDirPath,
@@ -17842,7 +18076,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17842
18076
  };
17843
18077
 
17844
18078
  // src/features/rules/warp-rule.ts
17845
- var import_node_path130 = require("path");
18079
+ var import_node_path131 = require("path");
17846
18080
  var WarpRule = class _WarpRule extends ToolRule {
17847
18081
  constructor({ fileContent, root, ...rest }) {
17848
18082
  super({
@@ -17868,8 +18102,8 @@ var WarpRule = class _WarpRule extends ToolRule {
17868
18102
  validate = true
17869
18103
  }) {
17870
18104
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
17871
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path130.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
17872
- const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
18105
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path131.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
18106
+ const fileContent = await readFileContent((0, import_node_path131.join)(baseDir, relativePath));
17873
18107
  return new _WarpRule({
17874
18108
  baseDir,
17875
18109
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -17924,7 +18158,7 @@ var WarpRule = class _WarpRule extends ToolRule {
17924
18158
  };
17925
18159
 
17926
18160
  // src/features/rules/windsurf-rule.ts
17927
- var import_node_path131 = require("path");
18161
+ var import_node_path132 = require("path");
17928
18162
  var WindsurfRule = class _WindsurfRule extends ToolRule {
17929
18163
  static getSettablePaths(_options = {}) {
17930
18164
  return {
@@ -17939,7 +18173,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
17939
18173
  validate = true
17940
18174
  }) {
17941
18175
  const fileContent = await readFileContent(
17942
- (0, import_node_path131.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18176
+ (0, import_node_path132.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17943
18177
  );
17944
18178
  return new _WindsurfRule({
17945
18179
  baseDir,
@@ -18018,8 +18252,8 @@ var rulesProcessorToolTargets = [
18018
18252
  "warp",
18019
18253
  "windsurf"
18020
18254
  ];
18021
- var RulesProcessorToolTargetSchema = import_mini64.z.enum(rulesProcessorToolTargets);
18022
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path132.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
18255
+ var RulesProcessorToolTargetSchema = import_mini65.z.enum(rulesProcessorToolTargets);
18256
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path133.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
18023
18257
  var toolRuleFactories = /* @__PURE__ */ new Map([
18024
18258
  [
18025
18259
  "agentsmd",
@@ -18447,7 +18681,7 @@ var RulesProcessor = class extends FeatureProcessor {
18447
18681
  }).relativeDirPath;
18448
18682
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
18449
18683
  const frontmatter = skill.getFrontmatter();
18450
- const relativePath = (0, import_node_path132.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
18684
+ const relativePath = (0, import_node_path133.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
18451
18685
  return {
18452
18686
  name: frontmatter.name,
18453
18687
  description: frontmatter.description,
@@ -18572,12 +18806,12 @@ var RulesProcessor = class extends FeatureProcessor {
18572
18806
  * Load and parse rulesync rule files from .rulesync/rules/ directory
18573
18807
  */
18574
18808
  async loadRulesyncFiles() {
18575
- const rulesyncBaseDir = (0, import_node_path132.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18576
- const files = await findFilesByGlobs((0, import_node_path132.join)(rulesyncBaseDir, "**", "*.md"));
18809
+ const rulesyncBaseDir = (0, import_node_path133.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18810
+ const files = await findFilesByGlobs((0, import_node_path133.join)(rulesyncBaseDir, "**", "*.md"));
18577
18811
  this.logger.debug(`Found ${files.length} rulesync files`);
18578
18812
  const rulesyncRules = await Promise.all(
18579
18813
  files.map((file) => {
18580
- const relativeFilePath = (0, import_node_path132.relative)(rulesyncBaseDir, file);
18814
+ const relativeFilePath = (0, import_node_path133.relative)(rulesyncBaseDir, file);
18581
18815
  checkPathTraversal({
18582
18816
  relativePath: relativeFilePath,
18583
18817
  intendedRootDir: rulesyncBaseDir
@@ -18652,7 +18886,7 @@ var RulesProcessor = class extends FeatureProcessor {
18652
18886
  global: this.global
18653
18887
  });
18654
18888
  const resolveRelativeDirPath = (filePath) => {
18655
- const dirName = (0, import_node_path132.dirname)((0, import_node_path132.relative)(this.baseDir, filePath));
18889
+ const dirName = (0, import_node_path133.dirname)((0, import_node_path133.relative)(this.baseDir, filePath));
18656
18890
  return dirName === "" ? "." : dirName;
18657
18891
  };
18658
18892
  const buildDeletionRulesFromPaths = (filePaths, opts) => {
@@ -18660,7 +18894,7 @@ var RulesProcessor = class extends FeatureProcessor {
18660
18894
  const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
18661
18895
  return filePaths.map((filePath) => {
18662
18896
  const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
18663
- const relativeFilePath = isNonRoot ? (0, import_node_path132.relative)(effectiveBaseDir, filePath) : (0, import_node_path132.basename)(filePath);
18897
+ const relativeFilePath = isNonRoot ? (0, import_node_path133.relative)(effectiveBaseDir, filePath) : (0, import_node_path133.basename)(filePath);
18664
18898
  checkPathTraversal({
18665
18899
  relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
18666
18900
  intendedRootDir: effectiveBaseDir
@@ -18688,13 +18922,13 @@ var RulesProcessor = class extends FeatureProcessor {
18688
18922
  return [];
18689
18923
  }
18690
18924
  const uniqueRootFilePaths = await findFilesWithFallback(
18691
- (0, import_node_path132.join)(
18925
+ (0, import_node_path133.join)(
18692
18926
  this.baseDir,
18693
18927
  settablePaths.root.relativeDirPath ?? ".",
18694
18928
  settablePaths.root.relativeFilePath
18695
18929
  ),
18696
18930
  settablePaths.alternativeRoots,
18697
- (alt) => (0, import_node_path132.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
18931
+ (alt) => (0, import_node_path133.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
18698
18932
  );
18699
18933
  if (forDeletion) {
18700
18934
  return buildDeletionRulesFromPaths(uniqueRootFilePaths);
@@ -18708,7 +18942,7 @@ var RulesProcessor = class extends FeatureProcessor {
18708
18942
  });
18709
18943
  return factory.class.fromFile({
18710
18944
  baseDir: this.baseDir,
18711
- relativeFilePath: (0, import_node_path132.basename)(filePath),
18945
+ relativeFilePath: (0, import_node_path133.basename)(filePath),
18712
18946
  relativeDirPath,
18713
18947
  global: this.global
18714
18948
  });
@@ -18725,7 +18959,7 @@ var RulesProcessor = class extends FeatureProcessor {
18725
18959
  return [];
18726
18960
  }
18727
18961
  const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
18728
- (0, import_node_path132.join)(this.baseDir, "AGENTS.local.md")
18962
+ (0, import_node_path133.join)(this.baseDir, "AGENTS.local.md")
18729
18963
  );
18730
18964
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
18731
18965
  }
@@ -18736,9 +18970,9 @@ var RulesProcessor = class extends FeatureProcessor {
18736
18970
  return [];
18737
18971
  }
18738
18972
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
18739
- (0, import_node_path132.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
18973
+ (0, import_node_path133.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
18740
18974
  settablePaths.alternativeRoots,
18741
- (alt) => (0, import_node_path132.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
18975
+ (alt) => (0, import_node_path133.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
18742
18976
  );
18743
18977
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
18744
18978
  })();
@@ -18749,20 +18983,20 @@ var RulesProcessor = class extends FeatureProcessor {
18749
18983
  if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
18750
18984
  return [];
18751
18985
  }
18752
- const primaryPaths = await findFilesByGlobs((0, import_node_path132.join)(this.baseDir, ".rovodev", "AGENTS.md"));
18986
+ const primaryPaths = await findFilesByGlobs((0, import_node_path133.join)(this.baseDir, ".rovodev", "AGENTS.md"));
18753
18987
  if (primaryPaths.length === 0) {
18754
18988
  return [];
18755
18989
  }
18756
- const mirrorPaths = await findFilesByGlobs((0, import_node_path132.join)(this.baseDir, "AGENTS.md"));
18990
+ const mirrorPaths = await findFilesByGlobs((0, import_node_path133.join)(this.baseDir, "AGENTS.md"));
18757
18991
  return buildDeletionRulesFromPaths(mirrorPaths);
18758
18992
  })();
18759
18993
  const nonRootToolRules = await (async () => {
18760
18994
  if (!settablePaths.nonRoot) {
18761
18995
  return [];
18762
18996
  }
18763
- const nonRootBaseDir = (0, import_node_path132.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
18997
+ const nonRootBaseDir = (0, import_node_path133.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
18764
18998
  const nonRootFilePaths = await findFilesByGlobs(
18765
- (0, import_node_path132.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
18999
+ (0, import_node_path133.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
18766
19000
  );
18767
19001
  if (forDeletion) {
18768
19002
  return buildDeletionRulesFromPaths(nonRootFilePaths, {
@@ -18772,18 +19006,18 @@ var RulesProcessor = class extends FeatureProcessor {
18772
19006
  }
18773
19007
  const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
18774
19008
  const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
18775
- const relativeFilePath = (0, import_node_path132.relative)(nonRootBaseDir, filePath);
19009
+ const relativeFilePath = (0, import_node_path133.relative)(nonRootBaseDir, filePath);
18776
19010
  const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
18777
19011
  if (!ok) {
18778
19012
  this.logger.warn(
18779
- `Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path132.join)(modularRootRelative, relativeFilePath)}`
19013
+ `Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path133.join)(modularRootRelative, relativeFilePath)}`
18780
19014
  );
18781
19015
  }
18782
19016
  return ok;
18783
19017
  }) : nonRootFilePaths;
18784
19018
  return await Promise.all(
18785
19019
  nonRootPathsForImport.map((filePath) => {
18786
- const relativeFilePath = (0, import_node_path132.relative)(nonRootBaseDir, filePath);
19020
+ const relativeFilePath = (0, import_node_path133.relative)(nonRootBaseDir, filePath);
18787
19021
  checkPathTraversal({
18788
19022
  relativePath: relativeFilePath,
18789
19023
  intendedRootDir: nonRootBaseDir
@@ -18902,14 +19136,14 @@ s/<command> [arguments]
18902
19136
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
18903
19137
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
18904
19138
 
18905
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path132.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
19139
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path133.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
18906
19140
  const subagentsSection = subagents ? `## Simulated Subagents
18907
19141
 
18908
19142
  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.
18909
19143
 
18910
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path132.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
19144
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path133.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
18911
19145
 
18912
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path132.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
19146
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path133.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
18913
19147
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
18914
19148
  const result = [
18915
19149
  overview,
@@ -18980,6 +19214,14 @@ async function processEmptyFeatureGeneration(params) {
18980
19214
  }
18981
19215
  return { count: totalCount, paths: [], hasDiff };
18982
19216
  }
19217
+ async function processFeatureWithRulesyncFiles(params) {
19218
+ const { config, processor, rulesyncFiles } = params;
19219
+ if (rulesyncFiles.length === 0) {
19220
+ return processEmptyFeatureGeneration({ config, processor });
19221
+ }
19222
+ const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19223
+ return processFeatureGeneration({ config, processor, toolFiles });
19224
+ }
18983
19225
  var SIMULATE_OPTION_MAP = {
18984
19226
  commands: "--simulate-commands",
18985
19227
  subagents: "--simulate-subagents",
@@ -19001,7 +19243,7 @@ function warnUnsupportedTargets(params) {
19001
19243
  }
19002
19244
  }
19003
19245
  async function checkRulesyncDirExists(params) {
19004
- return fileExists((0, import_node_path133.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19246
+ return fileExists((0, import_node_path134.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19005
19247
  }
19006
19248
  async function generate(params) {
19007
19249
  const { config, logger } = params;
@@ -19057,12 +19299,7 @@ async function generateRulesCore(params) {
19057
19299
  logger
19058
19300
  });
19059
19301
  const rulesyncFiles = await processor.loadRulesyncFiles();
19060
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19061
- const result = await processFeatureGeneration({
19062
- config,
19063
- processor,
19064
- toolFiles
19065
- });
19302
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19066
19303
  totalCount += result.count;
19067
19304
  allPaths.push(...result.paths);
19068
19305
  if (result.hasDiff) hasDiff = true;
@@ -19098,20 +19335,7 @@ async function generateIgnoreCore(params) {
19098
19335
  logger
19099
19336
  });
19100
19337
  const rulesyncFiles = await processor.loadRulesyncFiles();
19101
- let result;
19102
- if (rulesyncFiles.length > 0) {
19103
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19104
- result = await processFeatureGeneration({
19105
- config,
19106
- processor,
19107
- toolFiles
19108
- });
19109
- } else {
19110
- result = await processEmptyFeatureGeneration({
19111
- config,
19112
- processor
19113
- });
19114
- }
19338
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19115
19339
  totalCount += result.count;
19116
19340
  allPaths.push(...result.paths);
19117
19341
  if (result.hasDiff) hasDiff = true;
@@ -19151,12 +19375,7 @@ async function generateMcpCore(params) {
19151
19375
  logger
19152
19376
  });
19153
19377
  const rulesyncFiles = await processor.loadRulesyncFiles();
19154
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19155
- const result = await processFeatureGeneration({
19156
- config,
19157
- processor,
19158
- toolFiles
19159
- });
19378
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19160
19379
  totalCount += result.count;
19161
19380
  allPaths.push(...result.paths);
19162
19381
  if (result.hasDiff) hasDiff = true;
@@ -19194,12 +19413,7 @@ async function generateCommandsCore(params) {
19194
19413
  logger
19195
19414
  });
19196
19415
  const rulesyncFiles = await processor.loadRulesyncFiles();
19197
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19198
- const result = await processFeatureGeneration({
19199
- config,
19200
- processor,
19201
- toolFiles
19202
- });
19416
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19203
19417
  totalCount += result.count;
19204
19418
  allPaths.push(...result.paths);
19205
19419
  if (result.hasDiff) hasDiff = true;
@@ -19237,12 +19451,7 @@ async function generateSubagentsCore(params) {
19237
19451
  logger
19238
19452
  });
19239
19453
  const rulesyncFiles = await processor.loadRulesyncFiles();
19240
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19241
- const result = await processFeatureGeneration({
19242
- config,
19243
- processor,
19244
- toolFiles
19245
- });
19454
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19246
19455
  totalCount += result.count;
19247
19456
  allPaths.push(...result.paths);
19248
19457
  if (result.hasDiff) hasDiff = true;
@@ -19325,20 +19534,7 @@ async function generateHooksCore(params) {
19325
19534
  logger
19326
19535
  });
19327
19536
  const rulesyncFiles = await processor.loadRulesyncFiles();
19328
- let result;
19329
- if (rulesyncFiles.length === 0) {
19330
- result = await processEmptyFeatureGeneration({
19331
- config,
19332
- processor
19333
- });
19334
- } else {
19335
- const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
19336
- result = await processFeatureGeneration({
19337
- config,
19338
- processor,
19339
- toolFiles
19340
- });
19341
- }
19537
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
19342
19538
  totalCount += result.count;
19343
19539
  allPaths.push(...result.paths);
19344
19540
  if (result.hasDiff) hasDiff = true;
@@ -19650,17 +19846,18 @@ async function generate2(options = {}) {
19650
19846
  });
19651
19847
  for (const baseDir of config.getBaseDirs()) {
19652
19848
  if (!await checkRulesyncDirExists({ baseDir })) {
19653
- throw new Error(".rulesync directory not found. Run 'rulesync init' first.");
19849
+ throw new Error(`.rulesync directory not found in '${baseDir}'. Run 'rulesync init' first.`);
19654
19850
  }
19655
19851
  }
19656
19852
  return generate({ config, logger });
19657
19853
  }
19658
19854
  async function importFromTool2(options) {
19659
- const { target, silent = true, verbose = false, ...rest } = options;
19855
+ const { target, features, silent = true, verbose = false, ...rest } = options;
19660
19856
  const logger = new ConsoleLogger({ verbose, silent });
19661
19857
  const config = await ConfigResolver.resolve({
19662
19858
  ...rest,
19663
19859
  targets: [target],
19860
+ features,
19664
19861
  verbose,
19665
19862
  silent
19666
19863
  });