rulesync 7.8.0 → 7.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -128,7 +128,7 @@ var Logger = class {
128
128
  var logger = new Logger();
129
129
 
130
130
  // src/lib/fetch.ts
131
- var import_node_path112 = require("path");
131
+ var import_node_path113 = require("path");
132
132
  var import_promise = require("es-toolkit/promise");
133
133
 
134
134
  // src/constants/rulesync-paths.ts
@@ -2726,7 +2726,7 @@ var CommandsProcessor = class extends FeatureProcessor {
2726
2726
  };
2727
2727
 
2728
2728
  // src/features/hooks/hooks-processor.ts
2729
- var import_mini14 = require("zod/mini");
2729
+ var import_mini15 = require("zod/mini");
2730
2730
 
2731
2731
  // src/types/hooks.ts
2732
2732
  var import_mini13 = require("zod/mini");
@@ -2791,6 +2791,14 @@ var OPENCODE_HOOK_EVENTS = [
2791
2791
  "afterShellExecution",
2792
2792
  "permissionRequest"
2793
2793
  ];
2794
+ var COPILOT_HOOK_EVENTS = [
2795
+ "sessionStart",
2796
+ "sessionEnd",
2797
+ "afterSubmitPrompt",
2798
+ "preToolUse",
2799
+ "postToolUse",
2800
+ "afterError"
2801
+ ];
2794
2802
  var FACTORYDROID_HOOK_EVENTS = [
2795
2803
  "sessionStart",
2796
2804
  "sessionEnd",
@@ -2810,6 +2818,7 @@ var HooksConfigSchema = import_mini13.z.looseObject({
2810
2818
  hooks: hooksRecordSchema,
2811
2819
  cursor: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2812
2820
  claudecode: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2821
+ copilot: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2813
2822
  opencode: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) })),
2814
2823
  factorydroid: import_mini13.z.optional(import_mini13.z.looseObject({ hooks: import_mini13.z.optional(hooksRecordSchema) }))
2815
2824
  });
@@ -2879,6 +2888,17 @@ var CANONICAL_TO_OPENCODE_EVENT_NAMES = {
2879
2888
  afterShellExecution: "command.executed",
2880
2889
  permissionRequest: "permission.asked"
2881
2890
  };
2891
+ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
2892
+ sessionStart: "sessionStart",
2893
+ sessionEnd: "sessionEnd",
2894
+ afterSubmitPrompt: "userPromptSubmitted",
2895
+ preToolUse: "preToolUse",
2896
+ postToolUse: "postToolUse",
2897
+ afterError: "errorOccurred"
2898
+ };
2899
+ var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
2900
+ Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
2901
+ );
2882
2902
 
2883
2903
  // src/features/hooks/claudecode-hooks.ts
2884
2904
  var import_node_path21 = require("path");
@@ -3155,8 +3175,185 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3155
3175
  }
3156
3176
  };
3157
3177
 
3158
- // src/features/hooks/cursor-hooks.ts
3178
+ // src/features/hooks/copilot-hooks.ts
3159
3179
  var import_node_path22 = require("path");
3180
+ var import_mini14 = require("zod/mini");
3181
+ var CopilotHookEntrySchema = import_mini14.z.looseObject({
3182
+ type: import_mini14.z.string(),
3183
+ bash: import_mini14.z.optional(import_mini14.z.string()),
3184
+ powershell: import_mini14.z.optional(import_mini14.z.string()),
3185
+ timeoutSec: import_mini14.z.optional(import_mini14.z.number())
3186
+ });
3187
+ function canonicalToCopilotHooks(config) {
3188
+ const isWindows = process.platform === "win32";
3189
+ const commandField = isWindows ? "powershell" : "bash";
3190
+ const supported = new Set(COPILOT_HOOK_EVENTS);
3191
+ const sharedConfigHooks = {};
3192
+ for (const [event, defs] of Object.entries(config.hooks)) {
3193
+ if (supported.has(event)) {
3194
+ sharedConfigHooks[event] = defs;
3195
+ }
3196
+ }
3197
+ const effectiveHooks = {
3198
+ ...sharedConfigHooks,
3199
+ ...config.copilot?.hooks
3200
+ };
3201
+ const copilot = {};
3202
+ for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
3203
+ const copilotEventName = CANONICAL_TO_COPILOT_EVENT_NAMES[eventName] ?? eventName;
3204
+ const entries = [];
3205
+ for (const def of definitions) {
3206
+ const hookType = def.type ?? "command";
3207
+ if (def.matcher) continue;
3208
+ if (hookType !== "command") continue;
3209
+ const command = def.command;
3210
+ const timeout = def.timeout;
3211
+ const rest = Object.fromEntries(
3212
+ Object.entries(def).filter(
3213
+ ([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
3214
+ )
3215
+ );
3216
+ entries.push({
3217
+ type: hookType,
3218
+ ...command !== void 0 && command !== null && { [commandField]: command },
3219
+ ...timeout !== void 0 && timeout !== null && { timeoutSec: timeout },
3220
+ ...rest
3221
+ });
3222
+ }
3223
+ if (entries.length > 0) {
3224
+ copilot[copilotEventName] = entries;
3225
+ }
3226
+ }
3227
+ return copilot;
3228
+ }
3229
+ function resolveImportCommand(entry) {
3230
+ const hasBash = typeof entry.bash === "string";
3231
+ const hasPowershell = typeof entry.powershell === "string";
3232
+ if (hasBash && hasPowershell) {
3233
+ const isWindows = process.platform === "win32";
3234
+ const chosen = isWindows ? "powershell" : "bash";
3235
+ const ignored = isWindows ? "bash" : "powershell";
3236
+ logger.warn(
3237
+ `Copilot hook has both bash and powershell commands; using ${chosen} and ignoring ${ignored} on this platform.`
3238
+ );
3239
+ return isWindows ? entry.powershell : entry.bash;
3240
+ } else if (hasBash) {
3241
+ return entry.bash;
3242
+ } else if (hasPowershell) {
3243
+ return entry.powershell;
3244
+ }
3245
+ return void 0;
3246
+ }
3247
+ function copilotHooksToCanonical(copilotHooks) {
3248
+ if (copilotHooks === null || copilotHooks === void 0 || typeof copilotHooks !== "object") {
3249
+ return {};
3250
+ }
3251
+ const canonical = {};
3252
+ for (const [copilotEventName, hookEntries] of Object.entries(copilotHooks)) {
3253
+ const eventName = COPILOT_TO_CANONICAL_EVENT_NAMES[copilotEventName] ?? copilotEventName;
3254
+ if (!Array.isArray(hookEntries)) continue;
3255
+ const defs = [];
3256
+ for (const rawEntry of hookEntries) {
3257
+ const parseResult = CopilotHookEntrySchema.safeParse(rawEntry);
3258
+ if (!parseResult.success) continue;
3259
+ const entry = parseResult.data;
3260
+ const command = resolveImportCommand(entry);
3261
+ const timeout = entry.timeoutSec;
3262
+ defs.push({
3263
+ type: "command",
3264
+ ...command !== void 0 && { command },
3265
+ ...timeout !== void 0 && { timeout }
3266
+ });
3267
+ }
3268
+ if (defs.length > 0) {
3269
+ canonical[eventName] = defs;
3270
+ }
3271
+ }
3272
+ return canonical;
3273
+ }
3274
+ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3275
+ constructor(params) {
3276
+ super({
3277
+ ...params,
3278
+ fileContent: params.fileContent ?? "{}"
3279
+ });
3280
+ }
3281
+ static getSettablePaths(_options = {}) {
3282
+ return {
3283
+ relativeDirPath: (0, import_node_path22.join)(".github", "hooks"),
3284
+ relativeFilePath: "copilot-hooks.json"
3285
+ };
3286
+ }
3287
+ static async fromFile({
3288
+ baseDir = process.cwd(),
3289
+ validate = true,
3290
+ global = false
3291
+ }) {
3292
+ const paths = _CopilotHooks.getSettablePaths({ global });
3293
+ const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3294
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3295
+ return new _CopilotHooks({
3296
+ baseDir,
3297
+ relativeDirPath: paths.relativeDirPath,
3298
+ relativeFilePath: paths.relativeFilePath,
3299
+ fileContent,
3300
+ validate
3301
+ });
3302
+ }
3303
+ static async fromRulesyncHooks({
3304
+ baseDir = process.cwd(),
3305
+ rulesyncHooks,
3306
+ validate = true
3307
+ }) {
3308
+ const paths = _CopilotHooks.getSettablePaths();
3309
+ const config = rulesyncHooks.getJson();
3310
+ const copilotHooks = canonicalToCopilotHooks(config);
3311
+ const fileContent = JSON.stringify({ version: 1, hooks: copilotHooks }, null, 2);
3312
+ return new _CopilotHooks({
3313
+ baseDir,
3314
+ relativeDirPath: paths.relativeDirPath,
3315
+ relativeFilePath: paths.relativeFilePath,
3316
+ fileContent,
3317
+ validate
3318
+ });
3319
+ }
3320
+ toRulesyncHooks() {
3321
+ let parsed;
3322
+ try {
3323
+ parsed = JSON.parse(this.getFileContent());
3324
+ } catch (error) {
3325
+ throw new Error(
3326
+ `Failed to parse Copilot hooks content in ${(0, import_node_path22.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3327
+ {
3328
+ cause: error
3329
+ }
3330
+ );
3331
+ }
3332
+ const hooks = copilotHooksToCanonical(parsed.hooks);
3333
+ return this.toRulesyncHooksDefault({
3334
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
3335
+ });
3336
+ }
3337
+ validate() {
3338
+ return { success: true, error: null };
3339
+ }
3340
+ static forDeletion({
3341
+ baseDir = process.cwd(),
3342
+ relativeDirPath,
3343
+ relativeFilePath
3344
+ }) {
3345
+ return new _CopilotHooks({
3346
+ baseDir,
3347
+ relativeDirPath,
3348
+ relativeFilePath,
3349
+ fileContent: JSON.stringify({ hooks: {} }, null, 2),
3350
+ validate: false
3351
+ });
3352
+ }
3353
+ };
3354
+
3355
+ // src/features/hooks/cursor-hooks.ts
3356
+ var import_node_path23 = require("path");
3160
3357
  var CursorHooks = class _CursorHooks extends ToolHooks {
3161
3358
  constructor(params) {
3162
3359
  const { rulesyncHooks: _r, ...rest } = params;
@@ -3177,7 +3374,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3177
3374
  }) {
3178
3375
  const paths = _CursorHooks.getSettablePaths();
3179
3376
  const fileContent = await readFileContent(
3180
- (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3377
+ (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3181
3378
  );
3182
3379
  return new _CursorHooks({
3183
3380
  baseDir,
@@ -3257,7 +3454,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3257
3454
  };
3258
3455
 
3259
3456
  // src/features/hooks/factorydroid-hooks.ts
3260
- var import_node_path23 = require("path");
3457
+ var import_node_path24 = require("path");
3261
3458
  function canonicalToFactorydroidHooks(config) {
3262
3459
  const supported = new Set(FACTORYDROID_HOOK_EVENTS);
3263
3460
  const sharedHooks = {};
@@ -3362,7 +3559,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3362
3559
  global = false
3363
3560
  }) {
3364
3561
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3365
- const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3562
+ const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3366
3563
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3367
3564
  return new _FactorydroidHooks({
3368
3565
  baseDir,
@@ -3379,7 +3576,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3379
3576
  global = false
3380
3577
  }) {
3381
3578
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3382
- const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3579
+ const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3383
3580
  const existingContent = await readOrInitializeFileContent(
3384
3581
  filePath,
3385
3582
  JSON.stringify({}, null, 2)
@@ -3411,7 +3608,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3411
3608
  settings = JSON.parse(this.getFileContent());
3412
3609
  } catch (error) {
3413
3610
  throw new Error(
3414
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3611
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3415
3612
  {
3416
3613
  cause: error
3417
3614
  }
@@ -3441,7 +3638,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3441
3638
  };
3442
3639
 
3443
3640
  // src/features/hooks/opencode-hooks.ts
3444
- var import_node_path24 = require("path");
3641
+ var import_node_path25 = require("path");
3445
3642
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
3446
3643
  function escapeForTemplateLiteral(command) {
3447
3644
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -3539,7 +3736,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3539
3736
  }
3540
3737
  static getSettablePaths(options) {
3541
3738
  return {
3542
- relativeDirPath: options?.global ? (0, import_node_path24.join)(".config", "opencode", "plugins") : (0, import_node_path24.join)(".opencode", "plugins"),
3739
+ relativeDirPath: options?.global ? (0, import_node_path25.join)(".config", "opencode", "plugins") : (0, import_node_path25.join)(".opencode", "plugins"),
3543
3740
  relativeFilePath: "rulesync-hooks.js"
3544
3741
  };
3545
3742
  }
@@ -3550,7 +3747,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3550
3747
  }) {
3551
3748
  const paths = _OpencodeHooks.getSettablePaths({ global });
3552
3749
  const fileContent = await readFileContent(
3553
- (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3750
+ (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3554
3751
  );
3555
3752
  return new _OpencodeHooks({
3556
3753
  baseDir,
@@ -3599,43 +3796,83 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
3599
3796
  };
3600
3797
 
3601
3798
  // src/features/hooks/hooks-processor.ts
3602
- var hooksProcessorToolTargetTuple = ["cursor", "claudecode", "opencode", "factorydroid"];
3603
- var HooksProcessorToolTargetSchema = import_mini14.z.enum(hooksProcessorToolTargetTuple);
3799
+ var hooksProcessorToolTargetTuple = [
3800
+ "cursor",
3801
+ "claudecode",
3802
+ "copilot",
3803
+ "opencode",
3804
+ "factorydroid"
3805
+ ];
3806
+ var HooksProcessorToolTargetSchema = import_mini15.z.enum(hooksProcessorToolTargetTuple);
3604
3807
  var toolHooksFactories = /* @__PURE__ */ new Map([
3605
3808
  [
3606
3809
  "cursor",
3607
3810
  {
3608
3811
  class: CursorHooks,
3609
- meta: { supportsProject: true, supportsGlobal: false, supportsImport: true },
3812
+ meta: {
3813
+ supportsProject: true,
3814
+ supportsGlobal: false,
3815
+ supportsImport: true
3816
+ },
3610
3817
  supportedEvents: CURSOR_HOOK_EVENTS,
3611
- supportedHookTypes: ["command", "prompt"]
3818
+ supportedHookTypes: ["command", "prompt"],
3819
+ supportsMatcher: true
3612
3820
  }
3613
3821
  ],
3614
3822
  [
3615
3823
  "claudecode",
3616
3824
  {
3617
3825
  class: ClaudecodeHooks,
3618
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
3826
+ meta: {
3827
+ supportsProject: true,
3828
+ supportsGlobal: true,
3829
+ supportsImport: true
3830
+ },
3619
3831
  supportedEvents: CLAUDE_HOOK_EVENTS,
3620
- supportedHookTypes: ["command", "prompt"]
3832
+ supportedHookTypes: ["command", "prompt"],
3833
+ supportsMatcher: true
3834
+ }
3835
+ ],
3836
+ [
3837
+ "copilot",
3838
+ {
3839
+ class: CopilotHooks,
3840
+ meta: {
3841
+ supportsProject: true,
3842
+ supportsGlobal: false,
3843
+ supportsImport: true
3844
+ },
3845
+ supportedEvents: COPILOT_HOOK_EVENTS,
3846
+ supportedHookTypes: ["command"],
3847
+ supportsMatcher: false
3621
3848
  }
3622
3849
  ],
3623
3850
  [
3624
3851
  "opencode",
3625
3852
  {
3626
3853
  class: OpencodeHooks,
3627
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: false },
3854
+ meta: {
3855
+ supportsProject: true,
3856
+ supportsGlobal: true,
3857
+ supportsImport: false
3858
+ },
3628
3859
  supportedEvents: OPENCODE_HOOK_EVENTS,
3629
- supportedHookTypes: ["command"]
3860
+ supportedHookTypes: ["command"],
3861
+ supportsMatcher: true
3630
3862
  }
3631
3863
  ],
3632
3864
  [
3633
3865
  "factorydroid",
3634
3866
  {
3635
3867
  class: FactorydroidHooks,
3636
- meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
3868
+ meta: {
3869
+ supportsProject: true,
3870
+ supportsGlobal: true,
3871
+ supportsImport: true
3872
+ },
3637
3873
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
3638
- supportedHookTypes: ["command", "prompt"]
3874
+ supportedHookTypes: ["command", "prompt"],
3875
+ supportsMatcher: true
3639
3876
  }
3640
3877
  ]
3641
3878
  ]);
@@ -3752,6 +3989,21 @@ var HooksProcessor = class extends FeatureProcessor {
3752
3989
  );
3753
3990
  }
3754
3991
  }
3992
+ if (!factory.supportsMatcher) {
3993
+ const eventsWithMatcher = /* @__PURE__ */ new Set();
3994
+ for (const [event, defs] of Object.entries(effectiveHooks)) {
3995
+ for (const def of defs) {
3996
+ if (def.matcher) {
3997
+ eventsWithMatcher.add(event);
3998
+ }
3999
+ }
4000
+ }
4001
+ if (eventsWithMatcher.size > 0) {
4002
+ logger.warn(
4003
+ `Skipped matcher hook(s) for ${this.toolTarget} (not supported): ${Array.from(eventsWithMatcher).join(", ")}`
4004
+ );
4005
+ }
4006
+ }
3755
4007
  const toolHooks = await factory.class.fromRulesyncHooks({
3756
4008
  baseDir: this.baseDir,
3757
4009
  rulesyncHooks,
@@ -3776,13 +4028,13 @@ var HooksProcessor = class extends FeatureProcessor {
3776
4028
  };
3777
4029
 
3778
4030
  // src/features/ignore/ignore-processor.ts
3779
- var import_mini15 = require("zod/mini");
4031
+ var import_mini16 = require("zod/mini");
3780
4032
 
3781
4033
  // src/features/ignore/augmentcode-ignore.ts
3782
- var import_node_path26 = require("path");
4034
+ var import_node_path27 = require("path");
3783
4035
 
3784
4036
  // src/features/ignore/rulesync-ignore.ts
3785
- var import_node_path25 = require("path");
4037
+ var import_node_path26 = require("path");
3786
4038
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
3787
4039
  validate() {
3788
4040
  return { success: true, error: null };
@@ -3802,12 +4054,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
3802
4054
  static async fromFile() {
3803
4055
  const baseDir = process.cwd();
3804
4056
  const paths = this.getSettablePaths();
3805
- const recommendedPath = (0, import_node_path25.join)(
4057
+ const recommendedPath = (0, import_node_path26.join)(
3806
4058
  baseDir,
3807
4059
  paths.recommended.relativeDirPath,
3808
4060
  paths.recommended.relativeFilePath
3809
4061
  );
3810
- const legacyPath = (0, import_node_path25.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4062
+ const legacyPath = (0, import_node_path26.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
3811
4063
  if (await fileExists(recommendedPath)) {
3812
4064
  const fileContent2 = await readFileContent(recommendedPath);
3813
4065
  return new _RulesyncIgnore({
@@ -3923,7 +4175,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
3923
4175
  validate = true
3924
4176
  }) {
3925
4177
  const fileContent = await readFileContent(
3926
- (0, import_node_path26.join)(
4178
+ (0, import_node_path27.join)(
3927
4179
  baseDir,
3928
4180
  this.getSettablePaths().relativeDirPath,
3929
4181
  this.getSettablePaths().relativeFilePath
@@ -3953,7 +4205,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
3953
4205
  };
3954
4206
 
3955
4207
  // src/features/ignore/claudecode-ignore.ts
3956
- var import_node_path27 = require("path");
4208
+ var import_node_path28 = require("path");
3957
4209
  var import_es_toolkit2 = require("es-toolkit");
3958
4210
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
3959
4211
  constructor(params) {
@@ -3996,7 +4248,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
3996
4248
  const fileContent = rulesyncIgnore.getFileContent();
3997
4249
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
3998
4250
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
3999
- const filePath = (0, import_node_path27.join)(
4251
+ const filePath = (0, import_node_path28.join)(
4000
4252
  baseDir,
4001
4253
  this.getSettablePaths().relativeDirPath,
4002
4254
  this.getSettablePaths().relativeFilePath
@@ -4032,7 +4284,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4032
4284
  validate = true
4033
4285
  }) {
4034
4286
  const fileContent = await readFileContent(
4035
- (0, import_node_path27.join)(
4287
+ (0, import_node_path28.join)(
4036
4288
  baseDir,
4037
4289
  this.getSettablePaths().relativeDirPath,
4038
4290
  this.getSettablePaths().relativeFilePath
@@ -4062,7 +4314,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4062
4314
  };
4063
4315
 
4064
4316
  // src/features/ignore/cline-ignore.ts
4065
- var import_node_path28 = require("path");
4317
+ var import_node_path29 = require("path");
4066
4318
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4067
4319
  static getSettablePaths() {
4068
4320
  return {
@@ -4099,7 +4351,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4099
4351
  validate = true
4100
4352
  }) {
4101
4353
  const fileContent = await readFileContent(
4102
- (0, import_node_path28.join)(
4354
+ (0, import_node_path29.join)(
4103
4355
  baseDir,
4104
4356
  this.getSettablePaths().relativeDirPath,
4105
4357
  this.getSettablePaths().relativeFilePath
@@ -4129,7 +4381,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4129
4381
  };
4130
4382
 
4131
4383
  // src/features/ignore/cursor-ignore.ts
4132
- var import_node_path29 = require("path");
4384
+ var import_node_path30 = require("path");
4133
4385
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4134
4386
  static getSettablePaths() {
4135
4387
  return {
@@ -4162,7 +4414,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4162
4414
  validate = true
4163
4415
  }) {
4164
4416
  const fileContent = await readFileContent(
4165
- (0, import_node_path29.join)(
4417
+ (0, import_node_path30.join)(
4166
4418
  baseDir,
4167
4419
  this.getSettablePaths().relativeDirPath,
4168
4420
  this.getSettablePaths().relativeFilePath
@@ -4192,7 +4444,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4192
4444
  };
4193
4445
 
4194
4446
  // src/features/ignore/geminicli-ignore.ts
4195
- var import_node_path30 = require("path");
4447
+ var import_node_path31 = require("path");
4196
4448
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4197
4449
  static getSettablePaths() {
4198
4450
  return {
@@ -4219,7 +4471,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4219
4471
  validate = true
4220
4472
  }) {
4221
4473
  const fileContent = await readFileContent(
4222
- (0, import_node_path30.join)(
4474
+ (0, import_node_path31.join)(
4223
4475
  baseDir,
4224
4476
  this.getSettablePaths().relativeDirPath,
4225
4477
  this.getSettablePaths().relativeFilePath
@@ -4249,7 +4501,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4249
4501
  };
4250
4502
 
4251
4503
  // src/features/ignore/goose-ignore.ts
4252
- var import_node_path31 = require("path");
4504
+ var import_node_path32 = require("path");
4253
4505
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4254
4506
  static getSettablePaths() {
4255
4507
  return {
@@ -4286,7 +4538,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4286
4538
  validate = true
4287
4539
  }) {
4288
4540
  const fileContent = await readFileContent(
4289
- (0, import_node_path31.join)(
4541
+ (0, import_node_path32.join)(
4290
4542
  baseDir,
4291
4543
  this.getSettablePaths().relativeDirPath,
4292
4544
  this.getSettablePaths().relativeFilePath
@@ -4316,7 +4568,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4316
4568
  };
4317
4569
 
4318
4570
  // src/features/ignore/junie-ignore.ts
4319
- var import_node_path32 = require("path");
4571
+ var import_node_path33 = require("path");
4320
4572
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4321
4573
  static getSettablePaths() {
4322
4574
  return {
@@ -4343,7 +4595,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4343
4595
  validate = true
4344
4596
  }) {
4345
4597
  const fileContent = await readFileContent(
4346
- (0, import_node_path32.join)(
4598
+ (0, import_node_path33.join)(
4347
4599
  baseDir,
4348
4600
  this.getSettablePaths().relativeDirPath,
4349
4601
  this.getSettablePaths().relativeFilePath
@@ -4373,7 +4625,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
4373
4625
  };
4374
4626
 
4375
4627
  // src/features/ignore/kilo-ignore.ts
4376
- var import_node_path33 = require("path");
4628
+ var import_node_path34 = require("path");
4377
4629
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4378
4630
  static getSettablePaths() {
4379
4631
  return {
@@ -4410,7 +4662,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4410
4662
  validate = true
4411
4663
  }) {
4412
4664
  const fileContent = await readFileContent(
4413
- (0, import_node_path33.join)(
4665
+ (0, import_node_path34.join)(
4414
4666
  baseDir,
4415
4667
  this.getSettablePaths().relativeDirPath,
4416
4668
  this.getSettablePaths().relativeFilePath
@@ -4440,7 +4692,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
4440
4692
  };
4441
4693
 
4442
4694
  // src/features/ignore/kiro-ignore.ts
4443
- var import_node_path34 = require("path");
4695
+ var import_node_path35 = require("path");
4444
4696
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4445
4697
  static getSettablePaths() {
4446
4698
  return {
@@ -4467,7 +4719,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4467
4719
  validate = true
4468
4720
  }) {
4469
4721
  const fileContent = await readFileContent(
4470
- (0, import_node_path34.join)(
4722
+ (0, import_node_path35.join)(
4471
4723
  baseDir,
4472
4724
  this.getSettablePaths().relativeDirPath,
4473
4725
  this.getSettablePaths().relativeFilePath
@@ -4497,7 +4749,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
4497
4749
  };
4498
4750
 
4499
4751
  // src/features/ignore/qwencode-ignore.ts
4500
- var import_node_path35 = require("path");
4752
+ var import_node_path36 = require("path");
4501
4753
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4502
4754
  static getSettablePaths() {
4503
4755
  return {
@@ -4524,7 +4776,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4524
4776
  validate = true
4525
4777
  }) {
4526
4778
  const fileContent = await readFileContent(
4527
- (0, import_node_path35.join)(
4779
+ (0, import_node_path36.join)(
4528
4780
  baseDir,
4529
4781
  this.getSettablePaths().relativeDirPath,
4530
4782
  this.getSettablePaths().relativeFilePath
@@ -4554,7 +4806,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
4554
4806
  };
4555
4807
 
4556
4808
  // src/features/ignore/roo-ignore.ts
4557
- var import_node_path36 = require("path");
4809
+ var import_node_path37 = require("path");
4558
4810
  var RooIgnore = class _RooIgnore extends ToolIgnore {
4559
4811
  static getSettablePaths() {
4560
4812
  return {
@@ -4581,7 +4833,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4581
4833
  validate = true
4582
4834
  }) {
4583
4835
  const fileContent = await readFileContent(
4584
- (0, import_node_path36.join)(
4836
+ (0, import_node_path37.join)(
4585
4837
  baseDir,
4586
4838
  this.getSettablePaths().relativeDirPath,
4587
4839
  this.getSettablePaths().relativeFilePath
@@ -4611,7 +4863,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
4611
4863
  };
4612
4864
 
4613
4865
  // src/features/ignore/windsurf-ignore.ts
4614
- var import_node_path37 = require("path");
4866
+ var import_node_path38 = require("path");
4615
4867
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4616
4868
  static getSettablePaths() {
4617
4869
  return {
@@ -4638,7 +4890,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4638
4890
  validate = true
4639
4891
  }) {
4640
4892
  const fileContent = await readFileContent(
4641
- (0, import_node_path37.join)(
4893
+ (0, import_node_path38.join)(
4642
4894
  baseDir,
4643
4895
  this.getSettablePaths().relativeDirPath,
4644
4896
  this.getSettablePaths().relativeFilePath
@@ -4668,7 +4920,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
4668
4920
  };
4669
4921
 
4670
4922
  // src/features/ignore/zed-ignore.ts
4671
- var import_node_path38 = require("path");
4923
+ var import_node_path39 = require("path");
4672
4924
  var import_es_toolkit3 = require("es-toolkit");
4673
4925
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4674
4926
  constructor(params) {
@@ -4705,7 +4957,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4705
4957
  }) {
4706
4958
  const fileContent = rulesyncIgnore.getFileContent();
4707
4959
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4708
- const filePath = (0, import_node_path38.join)(
4960
+ const filePath = (0, import_node_path39.join)(
4709
4961
  baseDir,
4710
4962
  this.getSettablePaths().relativeDirPath,
4711
4963
  this.getSettablePaths().relativeFilePath
@@ -4732,7 +4984,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
4732
4984
  validate = true
4733
4985
  }) {
4734
4986
  const fileContent = await readFileContent(
4735
- (0, import_node_path38.join)(
4987
+ (0, import_node_path39.join)(
4736
4988
  baseDir,
4737
4989
  this.getSettablePaths().relativeDirPath,
4738
4990
  this.getSettablePaths().relativeFilePath
@@ -4778,7 +5030,7 @@ var ignoreProcessorToolTargets = [
4778
5030
  "windsurf",
4779
5031
  "zed"
4780
5032
  ];
4781
- var IgnoreProcessorToolTargetSchema = import_mini15.z.enum(ignoreProcessorToolTargets);
5033
+ var IgnoreProcessorToolTargetSchema = import_mini16.z.enum(ignoreProcessorToolTargets);
4782
5034
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
4783
5035
  ["augmentcode", { class: AugmentcodeIgnore }],
4784
5036
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -4916,49 +5168,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
4916
5168
  };
4917
5169
 
4918
5170
  // src/features/mcp/mcp-processor.ts
4919
- var import_mini19 = require("zod/mini");
5171
+ var import_mini20 = require("zod/mini");
4920
5172
 
4921
5173
  // src/features/mcp/claudecode-mcp.ts
4922
- var import_node_path40 = require("path");
5174
+ var import_node_path41 = require("path");
4923
5175
 
4924
5176
  // src/features/mcp/rulesync-mcp.ts
4925
- var import_node_path39 = require("path");
5177
+ var import_node_path40 = require("path");
4926
5178
  var import_object = require("es-toolkit/object");
4927
- var import_mini17 = require("zod/mini");
5179
+ var import_mini18 = require("zod/mini");
4928
5180
 
4929
5181
  // src/types/mcp.ts
4930
- var import_mini16 = require("zod/mini");
4931
- var McpServerSchema = import_mini16.z.object({
4932
- type: import_mini16.z.optional(import_mini16.z.enum(["stdio", "sse", "http"])),
4933
- command: import_mini16.z.optional(import_mini16.z.union([import_mini16.z.string(), import_mini16.z.array(import_mini16.z.string())])),
4934
- args: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4935
- url: import_mini16.z.optional(import_mini16.z.string()),
4936
- httpUrl: import_mini16.z.optional(import_mini16.z.string()),
4937
- env: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
4938
- disabled: import_mini16.z.optional(import_mini16.z.boolean()),
4939
- networkTimeout: import_mini16.z.optional(import_mini16.z.number()),
4940
- timeout: import_mini16.z.optional(import_mini16.z.number()),
4941
- trust: import_mini16.z.optional(import_mini16.z.boolean()),
4942
- cwd: import_mini16.z.optional(import_mini16.z.string()),
4943
- transport: import_mini16.z.optional(import_mini16.z.enum(["stdio", "sse", "http"])),
4944
- alwaysAllow: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4945
- tools: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4946
- kiroAutoApprove: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4947
- kiroAutoBlock: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4948
- headers: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
4949
- enabledTools: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
4950
- disabledTools: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string()))
5182
+ var import_mini17 = require("zod/mini");
5183
+ var McpServerSchema = import_mini17.z.object({
5184
+ type: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5185
+ command: import_mini17.z.optional(import_mini17.z.union([import_mini17.z.string(), import_mini17.z.array(import_mini17.z.string())])),
5186
+ args: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5187
+ url: import_mini17.z.optional(import_mini17.z.string()),
5188
+ httpUrl: import_mini17.z.optional(import_mini17.z.string()),
5189
+ env: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5190
+ disabled: import_mini17.z.optional(import_mini17.z.boolean()),
5191
+ networkTimeout: import_mini17.z.optional(import_mini17.z.number()),
5192
+ timeout: import_mini17.z.optional(import_mini17.z.number()),
5193
+ trust: import_mini17.z.optional(import_mini17.z.boolean()),
5194
+ cwd: import_mini17.z.optional(import_mini17.z.string()),
5195
+ transport: import_mini17.z.optional(import_mini17.z.enum(["stdio", "sse", "http"])),
5196
+ alwaysAllow: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5197
+ tools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5198
+ kiroAutoApprove: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5199
+ kiroAutoBlock: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5200
+ headers: import_mini17.z.optional(import_mini17.z.record(import_mini17.z.string(), import_mini17.z.string())),
5201
+ enabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
5202
+ disabledTools: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
4951
5203
  });
4952
- var McpServersSchema = import_mini16.z.record(import_mini16.z.string(), McpServerSchema);
5204
+ var McpServersSchema = import_mini17.z.record(import_mini17.z.string(), McpServerSchema);
4953
5205
 
4954
5206
  // src/features/mcp/rulesync-mcp.ts
4955
- var RulesyncMcpServerSchema = import_mini17.z.extend(McpServerSchema, {
4956
- targets: import_mini17.z.optional(RulesyncTargetsSchema),
4957
- description: import_mini17.z.optional(import_mini17.z.string()),
4958
- exposed: import_mini17.z.optional(import_mini17.z.boolean())
5207
+ var RulesyncMcpServerSchema = import_mini18.z.extend(McpServerSchema, {
5208
+ targets: import_mini18.z.optional(RulesyncTargetsSchema),
5209
+ description: import_mini18.z.optional(import_mini18.z.string()),
5210
+ exposed: import_mini18.z.optional(import_mini18.z.boolean())
4959
5211
  });
4960
- var RulesyncMcpConfigSchema = import_mini17.z.object({
4961
- mcpServers: import_mini17.z.record(import_mini17.z.string(), RulesyncMcpServerSchema)
5212
+ var RulesyncMcpConfigSchema = import_mini18.z.object({
5213
+ mcpServers: import_mini18.z.record(import_mini18.z.string(), RulesyncMcpServerSchema)
4962
5214
  });
4963
5215
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
4964
5216
  json;
@@ -4994,12 +5246,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
4994
5246
  static async fromFile({ validate = true }) {
4995
5247
  const baseDir = process.cwd();
4996
5248
  const paths = this.getSettablePaths();
4997
- const recommendedPath = (0, import_node_path39.join)(
5249
+ const recommendedPath = (0, import_node_path40.join)(
4998
5250
  baseDir,
4999
5251
  paths.recommended.relativeDirPath,
5000
5252
  paths.recommended.relativeFilePath
5001
5253
  );
5002
- const legacyPath = (0, import_node_path39.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5254
+ const legacyPath = (0, import_node_path40.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5003
5255
  if (await fileExists(recommendedPath)) {
5004
5256
  const fileContent2 = await readFileContent(recommendedPath);
5005
5257
  return new _RulesyncMcp({
@@ -5144,7 +5396,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5144
5396
  global = false
5145
5397
  }) {
5146
5398
  const paths = this.getSettablePaths({ global });
5147
- const fileContent = await readFileContentOrNull((0, import_node_path40.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5399
+ const fileContent = await readFileContentOrNull((0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5148
5400
  const json = JSON.parse(fileContent);
5149
5401
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5150
5402
  return new _ClaudecodeMcp({
@@ -5163,7 +5415,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5163
5415
  }) {
5164
5416
  const paths = this.getSettablePaths({ global });
5165
5417
  const fileContent = await readOrInitializeFileContent(
5166
- (0, import_node_path40.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5418
+ (0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5167
5419
  JSON.stringify({ mcpServers: {} }, null, 2)
5168
5420
  );
5169
5421
  const json = JSON.parse(fileContent);
@@ -5202,7 +5454,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5202
5454
  };
5203
5455
 
5204
5456
  // src/features/mcp/cline-mcp.ts
5205
- var import_node_path41 = require("path");
5457
+ var import_node_path42 = require("path");
5206
5458
  var ClineMcp = class _ClineMcp extends ToolMcp {
5207
5459
  json;
5208
5460
  constructor(params) {
@@ -5223,7 +5475,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5223
5475
  validate = true
5224
5476
  }) {
5225
5477
  const fileContent = await readFileContent(
5226
- (0, import_node_path41.join)(
5478
+ (0, import_node_path42.join)(
5227
5479
  baseDir,
5228
5480
  this.getSettablePaths().relativeDirPath,
5229
5481
  this.getSettablePaths().relativeFilePath
@@ -5272,7 +5524,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5272
5524
  };
5273
5525
 
5274
5526
  // src/features/mcp/codexcli-mcp.ts
5275
- var import_node_path42 = require("path");
5527
+ var import_node_path43 = require("path");
5276
5528
  var smolToml = __toESM(require("smol-toml"), 1);
5277
5529
  function convertFromCodexFormat(codexMcp) {
5278
5530
  const result = {};
@@ -5355,7 +5607,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5355
5607
  global = false
5356
5608
  }) {
5357
5609
  const paths = this.getSettablePaths({ global });
5358
- const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5610
+ const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5359
5611
  return new _CodexcliMcp({
5360
5612
  baseDir,
5361
5613
  relativeDirPath: paths.relativeDirPath,
@@ -5371,7 +5623,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5371
5623
  global = false
5372
5624
  }) {
5373
5625
  const paths = this.getSettablePaths({ global });
5374
- const configTomlFilePath = (0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5626
+ const configTomlFilePath = (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5375
5627
  const configTomlFileContent = await readOrInitializeFileContent(
5376
5628
  configTomlFilePath,
5377
5629
  smolToml.stringify({})
@@ -5428,7 +5680,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5428
5680
  };
5429
5681
 
5430
5682
  // src/features/mcp/copilot-mcp.ts
5431
- var import_node_path43 = require("path");
5683
+ var import_node_path44 = require("path");
5432
5684
  function convertToCopilotFormat(mcpServers) {
5433
5685
  return { servers: mcpServers };
5434
5686
  }
@@ -5455,7 +5707,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5455
5707
  validate = true
5456
5708
  }) {
5457
5709
  const fileContent = await readFileContent(
5458
- (0, import_node_path43.join)(
5710
+ (0, import_node_path44.join)(
5459
5711
  baseDir,
5460
5712
  this.getSettablePaths().relativeDirPath,
5461
5713
  this.getSettablePaths().relativeFilePath
@@ -5508,7 +5760,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
5508
5760
  };
5509
5761
 
5510
5762
  // src/features/mcp/cursor-mcp.ts
5511
- var import_node_path44 = require("path");
5763
+ var import_node_path45 = require("path");
5512
5764
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
5513
5765
  function isMcpServers(value) {
5514
5766
  return value !== void 0 && value !== null && typeof value === "object";
@@ -5569,7 +5821,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5569
5821
  validate = true
5570
5822
  }) {
5571
5823
  const fileContent = await readFileContent(
5572
- (0, import_node_path44.join)(
5824
+ (0, import_node_path45.join)(
5573
5825
  baseDir,
5574
5826
  this.getSettablePaths().relativeDirPath,
5575
5827
  this.getSettablePaths().relativeFilePath
@@ -5637,7 +5889,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
5637
5889
  };
5638
5890
 
5639
5891
  // src/features/mcp/factorydroid-mcp.ts
5640
- var import_node_path45 = require("path");
5892
+ var import_node_path46 = require("path");
5641
5893
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5642
5894
  json;
5643
5895
  constructor(params) {
@@ -5658,7 +5910,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5658
5910
  validate = true
5659
5911
  }) {
5660
5912
  const fileContent = await readFileContent(
5661
- (0, import_node_path45.join)(
5913
+ (0, import_node_path46.join)(
5662
5914
  baseDir,
5663
5915
  this.getSettablePaths().relativeDirPath,
5664
5916
  this.getSettablePaths().relativeFilePath
@@ -5718,7 +5970,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
5718
5970
  };
5719
5971
 
5720
5972
  // src/features/mcp/geminicli-mcp.ts
5721
- var import_node_path46 = require("path");
5973
+ var import_node_path47 = require("path");
5722
5974
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5723
5975
  json;
5724
5976
  constructor(params) {
@@ -5746,7 +5998,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5746
5998
  global = false
5747
5999
  }) {
5748
6000
  const paths = this.getSettablePaths({ global });
5749
- const fileContent = await readFileContentOrNull((0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6001
+ const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5750
6002
  const json = JSON.parse(fileContent);
5751
6003
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5752
6004
  return new _GeminiCliMcp({
@@ -5765,7 +6017,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5765
6017
  }) {
5766
6018
  const paths = this.getSettablePaths({ global });
5767
6019
  const fileContent = await readOrInitializeFileContent(
5768
- (0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6020
+ (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5769
6021
  JSON.stringify({ mcpServers: {} }, null, 2)
5770
6022
  );
5771
6023
  const json = JSON.parse(fileContent);
@@ -5810,7 +6062,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
5810
6062
  };
5811
6063
 
5812
6064
  // src/features/mcp/junie-mcp.ts
5813
- var import_node_path47 = require("path");
6065
+ var import_node_path48 = require("path");
5814
6066
  var JunieMcp = class _JunieMcp extends ToolMcp {
5815
6067
  json;
5816
6068
  constructor(params) {
@@ -5822,7 +6074,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
5822
6074
  }
5823
6075
  static getSettablePaths() {
5824
6076
  return {
5825
- relativeDirPath: (0, import_node_path47.join)(".junie", "mcp"),
6077
+ relativeDirPath: (0, import_node_path48.join)(".junie", "mcp"),
5826
6078
  relativeFilePath: "mcp.json"
5827
6079
  };
5828
6080
  }
@@ -5831,7 +6083,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
5831
6083
  validate = true
5832
6084
  }) {
5833
6085
  const fileContent = await readFileContent(
5834
- (0, import_node_path47.join)(
6086
+ (0, import_node_path48.join)(
5835
6087
  baseDir,
5836
6088
  this.getSettablePaths().relativeDirPath,
5837
6089
  this.getSettablePaths().relativeFilePath
@@ -5880,7 +6132,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
5880
6132
  };
5881
6133
 
5882
6134
  // src/features/mcp/kilo-mcp.ts
5883
- var import_node_path48 = require("path");
6135
+ var import_node_path49 = require("path");
5884
6136
  var KiloMcp = class _KiloMcp extends ToolMcp {
5885
6137
  json;
5886
6138
  constructor(params) {
@@ -5901,7 +6153,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
5901
6153
  validate = true
5902
6154
  }) {
5903
6155
  const paths = this.getSettablePaths();
5904
- const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6156
+ const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5905
6157
  return new _KiloMcp({
5906
6158
  baseDir,
5907
6159
  relativeDirPath: paths.relativeDirPath,
@@ -5949,7 +6201,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
5949
6201
  };
5950
6202
 
5951
6203
  // src/features/mcp/kiro-mcp.ts
5952
- var import_node_path49 = require("path");
6204
+ var import_node_path50 = require("path");
5953
6205
  var KiroMcp = class _KiroMcp extends ToolMcp {
5954
6206
  json;
5955
6207
  constructor(params) {
@@ -5961,7 +6213,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
5961
6213
  }
5962
6214
  static getSettablePaths() {
5963
6215
  return {
5964
- relativeDirPath: (0, import_node_path49.join)(".kiro", "settings"),
6216
+ relativeDirPath: (0, import_node_path50.join)(".kiro", "settings"),
5965
6217
  relativeFilePath: "mcp.json"
5966
6218
  };
5967
6219
  }
@@ -5970,7 +6222,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
5970
6222
  validate = true
5971
6223
  }) {
5972
6224
  const paths = this.getSettablePaths();
5973
- const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6225
+ const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5974
6226
  return new _KiroMcp({
5975
6227
  baseDir,
5976
6228
  relativeDirPath: paths.relativeDirPath,
@@ -6018,29 +6270,29 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6018
6270
  };
6019
6271
 
6020
6272
  // src/features/mcp/opencode-mcp.ts
6021
- var import_node_path50 = require("path");
6022
- var import_mini18 = require("zod/mini");
6023
- var OpencodeMcpLocalServerSchema = import_mini18.z.object({
6024
- type: import_mini18.z.literal("local"),
6025
- command: import_mini18.z.array(import_mini18.z.string()),
6026
- environment: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
6027
- enabled: import_mini18.z._default(import_mini18.z.boolean(), true),
6028
- cwd: import_mini18.z.optional(import_mini18.z.string())
6273
+ var import_node_path51 = require("path");
6274
+ var import_mini19 = require("zod/mini");
6275
+ var OpencodeMcpLocalServerSchema = import_mini19.z.object({
6276
+ type: import_mini19.z.literal("local"),
6277
+ command: import_mini19.z.array(import_mini19.z.string()),
6278
+ environment: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6279
+ enabled: import_mini19.z._default(import_mini19.z.boolean(), true),
6280
+ cwd: import_mini19.z.optional(import_mini19.z.string())
6029
6281
  });
6030
- var OpencodeMcpRemoteServerSchema = import_mini18.z.object({
6031
- type: import_mini18.z.literal("remote"),
6032
- url: import_mini18.z.string(),
6033
- headers: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
6034
- enabled: import_mini18.z._default(import_mini18.z.boolean(), true)
6282
+ var OpencodeMcpRemoteServerSchema = import_mini19.z.object({
6283
+ type: import_mini19.z.literal("remote"),
6284
+ url: import_mini19.z.string(),
6285
+ headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
6286
+ enabled: import_mini19.z._default(import_mini19.z.boolean(), true)
6035
6287
  });
6036
- var OpencodeMcpServerSchema = import_mini18.z.union([
6288
+ var OpencodeMcpServerSchema = import_mini19.z.union([
6037
6289
  OpencodeMcpLocalServerSchema,
6038
6290
  OpencodeMcpRemoteServerSchema
6039
6291
  ]);
6040
- var OpencodeConfigSchema = import_mini18.z.looseObject({
6041
- $schema: import_mini18.z.optional(import_mini18.z.string()),
6042
- mcp: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), OpencodeMcpServerSchema)),
6043
- tools: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.boolean()))
6292
+ var OpencodeConfigSchema = import_mini19.z.looseObject({
6293
+ $schema: import_mini19.z.optional(import_mini19.z.string()),
6294
+ mcp: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), OpencodeMcpServerSchema)),
6295
+ tools: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.boolean()))
6044
6296
  });
6045
6297
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6046
6298
  return Object.fromEntries(
@@ -6158,7 +6410,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6158
6410
  static getSettablePaths({ global } = {}) {
6159
6411
  if (global) {
6160
6412
  return {
6161
- relativeDirPath: (0, import_node_path50.join)(".config", "opencode"),
6413
+ relativeDirPath: (0, import_node_path51.join)(".config", "opencode"),
6162
6414
  relativeFilePath: "opencode.json"
6163
6415
  };
6164
6416
  }
@@ -6173,7 +6425,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6173
6425
  global = false
6174
6426
  }) {
6175
6427
  const paths = this.getSettablePaths({ global });
6176
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6428
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6177
6429
  const json = JSON.parse(fileContent);
6178
6430
  const newJson = { ...json, mcp: json.mcp ?? {} };
6179
6431
  return new _OpencodeMcp({
@@ -6192,7 +6444,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6192
6444
  }) {
6193
6445
  const paths = this.getSettablePaths({ global });
6194
6446
  const fileContent = await readOrInitializeFileContent(
6195
- (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6447
+ (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6196
6448
  JSON.stringify({ mcp: {} }, null, 2)
6197
6449
  );
6198
6450
  const json = JSON.parse(fileContent);
@@ -6245,7 +6497,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6245
6497
  };
6246
6498
 
6247
6499
  // src/features/mcp/roo-mcp.ts
6248
- var import_node_path51 = require("path");
6500
+ var import_node_path52 = require("path");
6249
6501
  function isRooMcpServers(value) {
6250
6502
  return value !== void 0 && value !== null && typeof value === "object";
6251
6503
  }
@@ -6297,7 +6549,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
6297
6549
  validate = true
6298
6550
  }) {
6299
6551
  const fileContent = await readFileContent(
6300
- (0, import_node_path51.join)(
6552
+ (0, import_node_path52.join)(
6301
6553
  baseDir,
6302
6554
  this.getSettablePaths().relativeDirPath,
6303
6555
  this.getSettablePaths().relativeFilePath
@@ -6368,7 +6620,7 @@ var mcpProcessorToolTargetTuple = [
6368
6620
  "opencode",
6369
6621
  "roo"
6370
6622
  ];
6371
- var McpProcessorToolTargetSchema = import_mini19.z.enum(mcpProcessorToolTargetTuple);
6623
+ var McpProcessorToolTargetSchema = import_mini20.z.enum(mcpProcessorToolTargetTuple);
6372
6624
  var toolMcpFactories = /* @__PURE__ */ new Map([
6373
6625
  [
6374
6626
  "claudecode",
@@ -6670,25 +6922,25 @@ var McpProcessor = class extends FeatureProcessor {
6670
6922
  };
6671
6923
 
6672
6924
  // src/features/rules/rules-processor.ts
6673
- var import_node_path111 = require("path");
6925
+ var import_node_path112 = require("path");
6674
6926
  var import_toon = require("@toon-format/toon");
6675
- var import_mini51 = require("zod/mini");
6927
+ var import_mini52 = require("zod/mini");
6676
6928
 
6677
6929
  // src/constants/general.ts
6678
6930
  var SKILL_FILE_NAME = "SKILL.md";
6679
6931
 
6680
6932
  // src/features/skills/agentsmd-skill.ts
6681
- var import_node_path55 = require("path");
6933
+ var import_node_path56 = require("path");
6682
6934
 
6683
6935
  // src/features/skills/simulated-skill.ts
6684
- var import_node_path54 = require("path");
6685
- var import_mini20 = require("zod/mini");
6936
+ var import_node_path55 = require("path");
6937
+ var import_mini21 = require("zod/mini");
6686
6938
 
6687
6939
  // src/features/skills/tool-skill.ts
6688
- var import_node_path53 = require("path");
6940
+ var import_node_path54 = require("path");
6689
6941
 
6690
6942
  // src/types/ai-dir.ts
6691
- var import_node_path52 = __toESM(require("path"), 1);
6943
+ var import_node_path53 = __toESM(require("path"), 1);
6692
6944
  var AiDir = class {
6693
6945
  /**
6694
6946
  * @example "."
@@ -6722,7 +6974,7 @@ var AiDir = class {
6722
6974
  otherFiles = [],
6723
6975
  global = false
6724
6976
  }) {
6725
- if (dirName.includes(import_node_path52.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
6977
+ if (dirName.includes(import_node_path53.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
6726
6978
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
6727
6979
  }
6728
6980
  this.baseDir = baseDir;
@@ -6745,11 +6997,11 @@ var AiDir = class {
6745
6997
  return this.dirName;
6746
6998
  }
6747
6999
  getDirPath() {
6748
- const fullPath = import_node_path52.default.join(this.baseDir, this.relativeDirPath, this.dirName);
6749
- const resolvedFull = (0, import_node_path52.resolve)(fullPath);
6750
- const resolvedBase = (0, import_node_path52.resolve)(this.baseDir);
6751
- const rel = (0, import_node_path52.relative)(resolvedBase, resolvedFull);
6752
- if (rel.startsWith("..") || import_node_path52.default.isAbsolute(rel)) {
7000
+ const fullPath = import_node_path53.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7001
+ const resolvedFull = (0, import_node_path53.resolve)(fullPath);
7002
+ const resolvedBase = (0, import_node_path53.resolve)(this.baseDir);
7003
+ const rel = (0, import_node_path53.relative)(resolvedBase, resolvedFull);
7004
+ if (rel.startsWith("..") || import_node_path53.default.isAbsolute(rel)) {
6753
7005
  throw new Error(
6754
7006
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
6755
7007
  );
@@ -6763,7 +7015,7 @@ var AiDir = class {
6763
7015
  return this.otherFiles;
6764
7016
  }
6765
7017
  getRelativePathFromCwd() {
6766
- return import_node_path52.default.join(this.relativeDirPath, this.dirName);
7018
+ return import_node_path53.default.join(this.relativeDirPath, this.dirName);
6767
7019
  }
6768
7020
  getGlobal() {
6769
7021
  return this.global;
@@ -6782,15 +7034,15 @@ var AiDir = class {
6782
7034
  * @returns Array of files with their relative paths and buffers
6783
7035
  */
6784
7036
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
6785
- const dirPath = (0, import_node_path52.join)(baseDir, relativeDirPath, dirName);
6786
- const glob = (0, import_node_path52.join)(dirPath, "**", "*");
7037
+ const dirPath = (0, import_node_path53.join)(baseDir, relativeDirPath, dirName);
7038
+ const glob = (0, import_node_path53.join)(dirPath, "**", "*");
6787
7039
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
6788
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path52.basename)(filePath) !== excludeFileName);
7040
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path53.basename)(filePath) !== excludeFileName);
6789
7041
  const files = await Promise.all(
6790
7042
  filteredPaths.map(async (filePath) => {
6791
7043
  const fileBuffer = await readFileBuffer(filePath);
6792
7044
  return {
6793
- relativeFilePathToDirPath: (0, import_node_path52.relative)(dirPath, filePath),
7045
+ relativeFilePathToDirPath: (0, import_node_path53.relative)(dirPath, filePath),
6794
7046
  fileBuffer
6795
7047
  };
6796
7048
  })
@@ -6881,8 +7133,8 @@ var ToolSkill = class extends AiDir {
6881
7133
  }) {
6882
7134
  const settablePaths = getSettablePaths({ global });
6883
7135
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
6884
- const skillDirPath = (0, import_node_path53.join)(baseDir, actualRelativeDirPath, dirName);
6885
- const skillFilePath = (0, import_node_path53.join)(skillDirPath, SKILL_FILE_NAME);
7136
+ const skillDirPath = (0, import_node_path54.join)(baseDir, actualRelativeDirPath, dirName);
7137
+ const skillFilePath = (0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME);
6886
7138
  if (!await fileExists(skillFilePath)) {
6887
7139
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
6888
7140
  }
@@ -6906,16 +7158,16 @@ var ToolSkill = class extends AiDir {
6906
7158
  }
6907
7159
  requireMainFileFrontmatter() {
6908
7160
  if (!this.mainFile?.frontmatter) {
6909
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path53.join)(this.relativeDirPath, this.dirName)}`);
7161
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path54.join)(this.relativeDirPath, this.dirName)}`);
6910
7162
  }
6911
7163
  return this.mainFile.frontmatter;
6912
7164
  }
6913
7165
  };
6914
7166
 
6915
7167
  // src/features/skills/simulated-skill.ts
6916
- var SimulatedSkillFrontmatterSchema = import_mini20.z.looseObject({
6917
- name: import_mini20.z.string(),
6918
- description: import_mini20.z.string()
7168
+ var SimulatedSkillFrontmatterSchema = import_mini21.z.looseObject({
7169
+ name: import_mini21.z.string(),
7170
+ description: import_mini21.z.string()
6919
7171
  });
6920
7172
  var SimulatedSkill = class extends ToolSkill {
6921
7173
  frontmatter;
@@ -6946,7 +7198,7 @@ var SimulatedSkill = class extends ToolSkill {
6946
7198
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
6947
7199
  if (!result.success) {
6948
7200
  throw new Error(
6949
- `Invalid frontmatter in ${(0, import_node_path54.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7201
+ `Invalid frontmatter in ${(0, import_node_path55.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
6950
7202
  );
6951
7203
  }
6952
7204
  }
@@ -7004,8 +7256,8 @@ var SimulatedSkill = class extends ToolSkill {
7004
7256
  }) {
7005
7257
  const settablePaths = this.getSettablePaths();
7006
7258
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7007
- const skillDirPath = (0, import_node_path54.join)(baseDir, actualRelativeDirPath, dirName);
7008
- const skillFilePath = (0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME);
7259
+ const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
7260
+ const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
7009
7261
  if (!await fileExists(skillFilePath)) {
7010
7262
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7011
7263
  }
@@ -7082,7 +7334,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7082
7334
  throw new Error("AgentsmdSkill does not support global mode.");
7083
7335
  }
7084
7336
  return {
7085
- relativeDirPath: (0, import_node_path55.join)(".agents", "skills")
7337
+ relativeDirPath: (0, import_node_path56.join)(".agents", "skills")
7086
7338
  };
7087
7339
  }
7088
7340
  static async fromDir(params) {
@@ -7109,11 +7361,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7109
7361
  };
7110
7362
 
7111
7363
  // src/features/skills/factorydroid-skill.ts
7112
- var import_node_path56 = require("path");
7364
+ var import_node_path57 = require("path");
7113
7365
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7114
7366
  static getSettablePaths(_options) {
7115
7367
  return {
7116
- relativeDirPath: (0, import_node_path56.join)(".factory", "skills")
7368
+ relativeDirPath: (0, import_node_path57.join)(".factory", "skills")
7117
7369
  };
7118
7370
  }
7119
7371
  static async fromDir(params) {
@@ -7140,11 +7392,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7140
7392
  };
7141
7393
 
7142
7394
  // src/features/skills/skills-processor.ts
7143
- var import_node_path73 = require("path");
7144
- var import_mini35 = require("zod/mini");
7395
+ var import_node_path74 = require("path");
7396
+ var import_mini36 = require("zod/mini");
7145
7397
 
7146
7398
  // src/types/dir-feature-processor.ts
7147
- var import_node_path57 = require("path");
7399
+ var import_node_path58 = require("path");
7148
7400
  var DirFeatureProcessor = class {
7149
7401
  baseDir;
7150
7402
  dryRun;
@@ -7175,7 +7427,7 @@ var DirFeatureProcessor = class {
7175
7427
  const mainFile = aiDir.getMainFile();
7176
7428
  let mainFileContent;
7177
7429
  if (mainFile) {
7178
- const mainFilePath = (0, import_node_path57.join)(dirPath, mainFile.name);
7430
+ const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7179
7431
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7180
7432
  mainFileContent = addTrailingNewline(content);
7181
7433
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7189,7 +7441,7 @@ var DirFeatureProcessor = class {
7189
7441
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7190
7442
  otherFileContents.push(contentWithNewline);
7191
7443
  if (!dirHasChanges) {
7192
- const filePath = (0, import_node_path57.join)(dirPath, file.relativeFilePathToDirPath);
7444
+ const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7193
7445
  const existingContent = await readFileContentOrNull(filePath);
7194
7446
  if (existingContent !== contentWithNewline) {
7195
7447
  dirHasChanges = true;
@@ -7203,22 +7455,22 @@ var DirFeatureProcessor = class {
7203
7455
  if (this.dryRun) {
7204
7456
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7205
7457
  if (mainFile) {
7206
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path57.join)(dirPath, mainFile.name)}`);
7207
- changedPaths.push((0, import_node_path57.join)(relativeDir, mainFile.name));
7458
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, mainFile.name)}`);
7459
+ changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7208
7460
  }
7209
7461
  for (const file of otherFiles) {
7210
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path57.join)(dirPath, file.relativeFilePathToDirPath)}`);
7211
- changedPaths.push((0, import_node_path57.join)(relativeDir, file.relativeFilePathToDirPath));
7462
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath)}`);
7463
+ changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7212
7464
  }
7213
7465
  } else {
7214
7466
  await ensureDir(dirPath);
7215
7467
  if (mainFile && mainFileContent) {
7216
- const mainFilePath = (0, import_node_path57.join)(dirPath, mainFile.name);
7468
+ const mainFilePath = (0, import_node_path58.join)(dirPath, mainFile.name);
7217
7469
  await writeFileContent(mainFilePath, mainFileContent);
7218
- changedPaths.push((0, import_node_path57.join)(relativeDir, mainFile.name));
7470
+ changedPaths.push((0, import_node_path58.join)(relativeDir, mainFile.name));
7219
7471
  }
7220
7472
  for (const [i, file] of otherFiles.entries()) {
7221
- const filePath = (0, import_node_path57.join)(dirPath, file.relativeFilePathToDirPath);
7473
+ const filePath = (0, import_node_path58.join)(dirPath, file.relativeFilePathToDirPath);
7222
7474
  const content = otherFileContents[i];
7223
7475
  if (content === void 0) {
7224
7476
  throw new Error(
@@ -7226,7 +7478,7 @@ var DirFeatureProcessor = class {
7226
7478
  );
7227
7479
  }
7228
7480
  await writeFileContent(filePath, content);
7229
- changedPaths.push((0, import_node_path57.join)(relativeDir, file.relativeFilePathToDirPath));
7481
+ changedPaths.push((0, import_node_path58.join)(relativeDir, file.relativeFilePathToDirPath));
7230
7482
  }
7231
7483
  }
7232
7484
  changedCount++;
@@ -7258,38 +7510,38 @@ var DirFeatureProcessor = class {
7258
7510
  };
7259
7511
 
7260
7512
  // src/features/skills/agentsskills-skill.ts
7261
- var import_node_path59 = require("path");
7262
- var import_mini22 = require("zod/mini");
7513
+ var import_node_path60 = require("path");
7514
+ var import_mini23 = require("zod/mini");
7263
7515
 
7264
7516
  // src/features/skills/rulesync-skill.ts
7265
- var import_node_path58 = require("path");
7266
- var import_mini21 = require("zod/mini");
7267
- var RulesyncSkillFrontmatterSchemaInternal = import_mini21.z.looseObject({
7268
- name: import_mini21.z.string(),
7269
- description: import_mini21.z.string(),
7270
- targets: import_mini21.z._default(RulesyncTargetsSchema, ["*"]),
7271
- claudecode: import_mini21.z.optional(
7272
- import_mini21.z.looseObject({
7273
- "allowed-tools": import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string()))
7517
+ var import_node_path59 = require("path");
7518
+ var import_mini22 = require("zod/mini");
7519
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini22.z.looseObject({
7520
+ name: import_mini22.z.string(),
7521
+ description: import_mini22.z.string(),
7522
+ targets: import_mini22.z._default(RulesyncTargetsSchema, ["*"]),
7523
+ claudecode: import_mini22.z.optional(
7524
+ import_mini22.z.looseObject({
7525
+ "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7274
7526
  })
7275
7527
  ),
7276
- codexcli: import_mini21.z.optional(
7277
- import_mini21.z.looseObject({
7278
- "short-description": import_mini21.z.optional(import_mini21.z.string())
7528
+ codexcli: import_mini22.z.optional(
7529
+ import_mini22.z.looseObject({
7530
+ "short-description": import_mini22.z.optional(import_mini22.z.string())
7279
7531
  })
7280
7532
  ),
7281
- opencode: import_mini21.z.optional(
7282
- import_mini21.z.looseObject({
7283
- "allowed-tools": import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string()))
7533
+ opencode: import_mini22.z.optional(
7534
+ import_mini22.z.looseObject({
7535
+ "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
7284
7536
  })
7285
7537
  ),
7286
- copilot: import_mini21.z.optional(
7287
- import_mini21.z.looseObject({
7288
- license: import_mini21.z.optional(import_mini21.z.string())
7538
+ copilot: import_mini22.z.optional(
7539
+ import_mini22.z.looseObject({
7540
+ license: import_mini22.z.optional(import_mini22.z.string())
7289
7541
  })
7290
7542
  ),
7291
- cline: import_mini21.z.optional(import_mini21.z.looseObject({})),
7292
- roo: import_mini21.z.optional(import_mini21.z.looseObject({}))
7543
+ cline: import_mini22.z.optional(import_mini22.z.looseObject({})),
7544
+ roo: import_mini22.z.optional(import_mini22.z.looseObject({}))
7293
7545
  });
7294
7546
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
7295
7547
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -7329,7 +7581,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7329
7581
  }
7330
7582
  getFrontmatter() {
7331
7583
  if (!this.mainFile?.frontmatter) {
7332
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path58.join)(this.relativeDirPath, this.dirName)}`);
7584
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path59.join)(this.relativeDirPath, this.dirName)}`);
7333
7585
  }
7334
7586
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
7335
7587
  return result;
@@ -7355,8 +7607,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7355
7607
  dirName,
7356
7608
  global = false
7357
7609
  }) {
7358
- const skillDirPath = (0, import_node_path58.join)(baseDir, relativeDirPath, dirName);
7359
- const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
7610
+ const skillDirPath = (0, import_node_path59.join)(baseDir, relativeDirPath, dirName);
7611
+ const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
7360
7612
  if (!await fileExists(skillFilePath)) {
7361
7613
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7362
7614
  }
@@ -7386,14 +7638,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
7386
7638
  };
7387
7639
 
7388
7640
  // src/features/skills/agentsskills-skill.ts
7389
- var AgentsSkillsSkillFrontmatterSchema = import_mini22.z.looseObject({
7390
- name: import_mini22.z.string(),
7391
- description: import_mini22.z.string()
7641
+ var AgentsSkillsSkillFrontmatterSchema = import_mini23.z.looseObject({
7642
+ name: import_mini23.z.string(),
7643
+ description: import_mini23.z.string()
7392
7644
  });
7393
7645
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7394
7646
  constructor({
7395
7647
  baseDir = process.cwd(),
7396
- relativeDirPath = (0, import_node_path59.join)(".agents", "skills"),
7648
+ relativeDirPath = (0, import_node_path60.join)(".agents", "skills"),
7397
7649
  dirName,
7398
7650
  frontmatter,
7399
7651
  body,
@@ -7425,7 +7677,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7425
7677
  throw new Error("AgentsSkillsSkill does not support global mode.");
7426
7678
  }
7427
7679
  return {
7428
- relativeDirPath: (0, import_node_path59.join)(".agents", "skills")
7680
+ relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
7429
7681
  };
7430
7682
  }
7431
7683
  getFrontmatter() {
@@ -7504,9 +7756,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7504
7756
  });
7505
7757
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
7506
7758
  if (!result.success) {
7507
- const skillDirPath = (0, import_node_path59.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7759
+ const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7508
7760
  throw new Error(
7509
- `Invalid frontmatter in ${(0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7761
+ `Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7510
7762
  );
7511
7763
  }
7512
7764
  return new _AgentsSkillsSkill({
@@ -7541,16 +7793,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
7541
7793
  };
7542
7794
 
7543
7795
  // src/features/skills/antigravity-skill.ts
7544
- var import_node_path60 = require("path");
7545
- var import_mini23 = require("zod/mini");
7546
- var AntigravitySkillFrontmatterSchema = import_mini23.z.looseObject({
7547
- name: import_mini23.z.string(),
7548
- description: import_mini23.z.string()
7796
+ var import_node_path61 = require("path");
7797
+ var import_mini24 = require("zod/mini");
7798
+ var AntigravitySkillFrontmatterSchema = import_mini24.z.looseObject({
7799
+ name: import_mini24.z.string(),
7800
+ description: import_mini24.z.string()
7549
7801
  });
7550
7802
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7551
7803
  constructor({
7552
7804
  baseDir = process.cwd(),
7553
- relativeDirPath = (0, import_node_path60.join)(".agent", "skills"),
7805
+ relativeDirPath = (0, import_node_path61.join)(".agent", "skills"),
7554
7806
  dirName,
7555
7807
  frontmatter,
7556
7808
  body,
@@ -7582,11 +7834,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7582
7834
  } = {}) {
7583
7835
  if (global) {
7584
7836
  return {
7585
- relativeDirPath: (0, import_node_path60.join)(".gemini", "antigravity", "skills")
7837
+ relativeDirPath: (0, import_node_path61.join)(".gemini", "antigravity", "skills")
7586
7838
  };
7587
7839
  }
7588
7840
  return {
7589
- relativeDirPath: (0, import_node_path60.join)(".agent", "skills")
7841
+ relativeDirPath: (0, import_node_path61.join)(".agent", "skills")
7590
7842
  };
7591
7843
  }
7592
7844
  getFrontmatter() {
@@ -7665,9 +7917,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7665
7917
  });
7666
7918
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
7667
7919
  if (!result.success) {
7668
- const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7920
+ const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7669
7921
  throw new Error(
7670
- `Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7922
+ `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7671
7923
  );
7672
7924
  }
7673
7925
  return new _AntigravitySkill({
@@ -7701,17 +7953,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
7701
7953
  };
7702
7954
 
7703
7955
  // src/features/skills/claudecode-skill.ts
7704
- var import_node_path61 = require("path");
7705
- var import_mini24 = require("zod/mini");
7706
- var ClaudecodeSkillFrontmatterSchema = import_mini24.z.looseObject({
7707
- name: import_mini24.z.string(),
7708
- description: import_mini24.z.string(),
7709
- "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string()))
7956
+ var import_node_path62 = require("path");
7957
+ var import_mini25 = require("zod/mini");
7958
+ var ClaudecodeSkillFrontmatterSchema = import_mini25.z.looseObject({
7959
+ name: import_mini25.z.string(),
7960
+ description: import_mini25.z.string(),
7961
+ "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
7710
7962
  });
7711
7963
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
7712
7964
  constructor({
7713
7965
  baseDir = process.cwd(),
7714
- relativeDirPath = (0, import_node_path61.join)(".claude", "skills"),
7966
+ relativeDirPath = (0, import_node_path62.join)(".claude", "skills"),
7715
7967
  dirName,
7716
7968
  frontmatter,
7717
7969
  body,
@@ -7742,7 +7994,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
7742
7994
  global: _global = false
7743
7995
  } = {}) {
7744
7996
  return {
7745
- relativeDirPath: (0, import_node_path61.join)(".claude", "skills")
7997
+ relativeDirPath: (0, import_node_path62.join)(".claude", "skills")
7746
7998
  };
7747
7999
  }
7748
8000
  getFrontmatter() {
@@ -7827,9 +8079,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
7827
8079
  });
7828
8080
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
7829
8081
  if (!result.success) {
7830
- const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8082
+ const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7831
8083
  throw new Error(
7832
- `Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8084
+ `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7833
8085
  );
7834
8086
  }
7835
8087
  return new _ClaudecodeSkill({
@@ -7863,16 +8115,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
7863
8115
  };
7864
8116
 
7865
8117
  // src/features/skills/cline-skill.ts
7866
- var import_node_path62 = require("path");
7867
- var import_mini25 = require("zod/mini");
7868
- var ClineSkillFrontmatterSchema = import_mini25.z.looseObject({
7869
- name: import_mini25.z.string(),
7870
- description: import_mini25.z.string()
8118
+ var import_node_path63 = require("path");
8119
+ var import_mini26 = require("zod/mini");
8120
+ var ClineSkillFrontmatterSchema = import_mini26.z.looseObject({
8121
+ name: import_mini26.z.string(),
8122
+ description: import_mini26.z.string()
7871
8123
  });
7872
8124
  var ClineSkill = class _ClineSkill extends ToolSkill {
7873
8125
  constructor({
7874
8126
  baseDir = process.cwd(),
7875
- relativeDirPath = (0, import_node_path62.join)(".cline", "skills"),
8127
+ relativeDirPath = (0, import_node_path63.join)(".cline", "skills"),
7876
8128
  dirName,
7877
8129
  frontmatter,
7878
8130
  body,
@@ -7901,7 +8153,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
7901
8153
  }
7902
8154
  static getSettablePaths(_options = {}) {
7903
8155
  return {
7904
- relativeDirPath: (0, import_node_path62.join)(".cline", "skills")
8156
+ relativeDirPath: (0, import_node_path63.join)(".cline", "skills")
7905
8157
  };
7906
8158
  }
7907
8159
  getFrontmatter() {
@@ -7988,13 +8240,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
7988
8240
  });
7989
8241
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
7990
8242
  if (!result.success) {
7991
- const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8243
+ const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
7992
8244
  throw new Error(
7993
- `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8245
+ `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
7994
8246
  );
7995
8247
  }
7996
8248
  if (result.data.name !== loaded.dirName) {
7997
- const skillFilePath = (0, import_node_path62.join)(
8249
+ const skillFilePath = (0, import_node_path63.join)(
7998
8250
  loaded.baseDir,
7999
8251
  loaded.relativeDirPath,
8000
8252
  loaded.dirName,
@@ -8035,21 +8287,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8035
8287
  };
8036
8288
 
8037
8289
  // src/features/skills/codexcli-skill.ts
8038
- var import_node_path63 = require("path");
8039
- var import_mini26 = require("zod/mini");
8040
- var CodexCliSkillFrontmatterSchema = import_mini26.z.looseObject({
8041
- name: import_mini26.z.string(),
8042
- description: import_mini26.z.string(),
8043
- metadata: import_mini26.z.optional(
8044
- import_mini26.z.looseObject({
8045
- "short-description": import_mini26.z.optional(import_mini26.z.string())
8290
+ var import_node_path64 = require("path");
8291
+ var import_mini27 = require("zod/mini");
8292
+ var CodexCliSkillFrontmatterSchema = import_mini27.z.looseObject({
8293
+ name: import_mini27.z.string(),
8294
+ description: import_mini27.z.string(),
8295
+ metadata: import_mini27.z.optional(
8296
+ import_mini27.z.looseObject({
8297
+ "short-description": import_mini27.z.optional(import_mini27.z.string())
8046
8298
  })
8047
8299
  )
8048
8300
  });
8049
8301
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8050
8302
  constructor({
8051
8303
  baseDir = process.cwd(),
8052
- relativeDirPath = (0, import_node_path63.join)(".codex", "skills"),
8304
+ relativeDirPath = (0, import_node_path64.join)(".codex", "skills"),
8053
8305
  dirName,
8054
8306
  frontmatter,
8055
8307
  body,
@@ -8080,7 +8332,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8080
8332
  global: _global = false
8081
8333
  } = {}) {
8082
8334
  return {
8083
- relativeDirPath: (0, import_node_path63.join)(".codex", "skills")
8335
+ relativeDirPath: (0, import_node_path64.join)(".codex", "skills")
8084
8336
  };
8085
8337
  }
8086
8338
  getFrontmatter() {
@@ -8169,9 +8421,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8169
8421
  });
8170
8422
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8171
8423
  if (!result.success) {
8172
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8424
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8173
8425
  throw new Error(
8174
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8426
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8175
8427
  );
8176
8428
  }
8177
8429
  return new _CodexCliSkill({
@@ -8205,17 +8457,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8205
8457
  };
8206
8458
 
8207
8459
  // src/features/skills/copilot-skill.ts
8208
- var import_node_path64 = require("path");
8209
- var import_mini27 = require("zod/mini");
8210
- var CopilotSkillFrontmatterSchema = import_mini27.z.looseObject({
8211
- name: import_mini27.z.string(),
8212
- description: import_mini27.z.string(),
8213
- license: import_mini27.z.optional(import_mini27.z.string())
8460
+ var import_node_path65 = require("path");
8461
+ var import_mini28 = require("zod/mini");
8462
+ var CopilotSkillFrontmatterSchema = import_mini28.z.looseObject({
8463
+ name: import_mini28.z.string(),
8464
+ description: import_mini28.z.string(),
8465
+ license: import_mini28.z.optional(import_mini28.z.string())
8214
8466
  });
8215
8467
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8216
8468
  constructor({
8217
8469
  baseDir = process.cwd(),
8218
- relativeDirPath = (0, import_node_path64.join)(".github", "skills"),
8470
+ relativeDirPath = (0, import_node_path65.join)(".github", "skills"),
8219
8471
  dirName,
8220
8472
  frontmatter,
8221
8473
  body,
@@ -8247,7 +8499,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8247
8499
  throw new Error("CopilotSkill does not support global mode.");
8248
8500
  }
8249
8501
  return {
8250
- relativeDirPath: (0, import_node_path64.join)(".github", "skills")
8502
+ relativeDirPath: (0, import_node_path65.join)(".github", "skills")
8251
8503
  };
8252
8504
  }
8253
8505
  getFrontmatter() {
@@ -8332,9 +8584,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8332
8584
  });
8333
8585
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8334
8586
  if (!result.success) {
8335
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8587
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8336
8588
  throw new Error(
8337
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8589
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8338
8590
  );
8339
8591
  }
8340
8592
  return new _CopilotSkill({
@@ -8369,16 +8621,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
8369
8621
  };
8370
8622
 
8371
8623
  // src/features/skills/cursor-skill.ts
8372
- var import_node_path65 = require("path");
8373
- var import_mini28 = require("zod/mini");
8374
- var CursorSkillFrontmatterSchema = import_mini28.z.looseObject({
8375
- name: import_mini28.z.string(),
8376
- description: import_mini28.z.string()
8624
+ var import_node_path66 = require("path");
8625
+ var import_mini29 = require("zod/mini");
8626
+ var CursorSkillFrontmatterSchema = import_mini29.z.looseObject({
8627
+ name: import_mini29.z.string(),
8628
+ description: import_mini29.z.string()
8377
8629
  });
8378
8630
  var CursorSkill = class _CursorSkill extends ToolSkill {
8379
8631
  constructor({
8380
8632
  baseDir = process.cwd(),
8381
- relativeDirPath = (0, import_node_path65.join)(".cursor", "skills"),
8633
+ relativeDirPath = (0, import_node_path66.join)(".cursor", "skills"),
8382
8634
  dirName,
8383
8635
  frontmatter,
8384
8636
  body,
@@ -8407,7 +8659,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8407
8659
  }
8408
8660
  static getSettablePaths(_options) {
8409
8661
  return {
8410
- relativeDirPath: (0, import_node_path65.join)(".cursor", "skills")
8662
+ relativeDirPath: (0, import_node_path66.join)(".cursor", "skills")
8411
8663
  };
8412
8664
  }
8413
8665
  getFrontmatter() {
@@ -8486,9 +8738,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8486
8738
  });
8487
8739
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8488
8740
  if (!result.success) {
8489
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8741
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8490
8742
  throw new Error(
8491
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8743
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8492
8744
  );
8493
8745
  }
8494
8746
  return new _CursorSkill({
@@ -8523,11 +8775,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
8523
8775
  };
8524
8776
 
8525
8777
  // src/features/skills/geminicli-skill.ts
8526
- var import_node_path66 = require("path");
8527
- var import_mini29 = require("zod/mini");
8528
- var GeminiCliSkillFrontmatterSchema = import_mini29.z.looseObject({
8529
- name: import_mini29.z.string(),
8530
- description: import_mini29.z.string()
8778
+ var import_node_path67 = require("path");
8779
+ var import_mini30 = require("zod/mini");
8780
+ var GeminiCliSkillFrontmatterSchema = import_mini30.z.looseObject({
8781
+ name: import_mini30.z.string(),
8782
+ description: import_mini30.z.string()
8531
8783
  });
8532
8784
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8533
8785
  constructor({
@@ -8563,7 +8815,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8563
8815
  global: _global = false
8564
8816
  } = {}) {
8565
8817
  return {
8566
- relativeDirPath: (0, import_node_path66.join)(".gemini", "skills")
8818
+ relativeDirPath: (0, import_node_path67.join)(".gemini", "skills")
8567
8819
  };
8568
8820
  }
8569
8821
  getFrontmatter() {
@@ -8642,9 +8894,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8642
8894
  });
8643
8895
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8644
8896
  if (!result.success) {
8645
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8897
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8646
8898
  throw new Error(
8647
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8899
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8648
8900
  );
8649
8901
  }
8650
8902
  return new _GeminiCliSkill({
@@ -8679,16 +8931,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
8679
8931
  };
8680
8932
 
8681
8933
  // src/features/skills/kilo-skill.ts
8682
- var import_node_path67 = require("path");
8683
- var import_mini30 = require("zod/mini");
8684
- var KiloSkillFrontmatterSchema = import_mini30.z.looseObject({
8685
- name: import_mini30.z.string(),
8686
- description: import_mini30.z.string()
8934
+ var import_node_path68 = require("path");
8935
+ var import_mini31 = require("zod/mini");
8936
+ var KiloSkillFrontmatterSchema = import_mini31.z.looseObject({
8937
+ name: import_mini31.z.string(),
8938
+ description: import_mini31.z.string()
8687
8939
  });
8688
8940
  var KiloSkill = class _KiloSkill extends ToolSkill {
8689
8941
  constructor({
8690
8942
  baseDir = process.cwd(),
8691
- relativeDirPath = (0, import_node_path67.join)(".kilocode", "skills"),
8943
+ relativeDirPath = (0, import_node_path68.join)(".kilocode", "skills"),
8692
8944
  dirName,
8693
8945
  frontmatter,
8694
8946
  body,
@@ -8719,7 +8971,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
8719
8971
  global: _global = false
8720
8972
  } = {}) {
8721
8973
  return {
8722
- relativeDirPath: (0, import_node_path67.join)(".kilocode", "skills")
8974
+ relativeDirPath: (0, import_node_path68.join)(".kilocode", "skills")
8723
8975
  };
8724
8976
  }
8725
8977
  getFrontmatter() {
@@ -8806,13 +9058,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
8806
9058
  });
8807
9059
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8808
9060
  if (!result.success) {
8809
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9061
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8810
9062
  throw new Error(
8811
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9063
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8812
9064
  );
8813
9065
  }
8814
9066
  if (result.data.name !== loaded.dirName) {
8815
- const skillFilePath = (0, import_node_path67.join)(
9067
+ const skillFilePath = (0, import_node_path68.join)(
8816
9068
  loaded.baseDir,
8817
9069
  loaded.relativeDirPath,
8818
9070
  loaded.dirName,
@@ -8853,16 +9105,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
8853
9105
  };
8854
9106
 
8855
9107
  // src/features/skills/kiro-skill.ts
8856
- var import_node_path68 = require("path");
8857
- var import_mini31 = require("zod/mini");
8858
- var KiroSkillFrontmatterSchema = import_mini31.z.looseObject({
8859
- name: import_mini31.z.string(),
8860
- description: import_mini31.z.string()
9108
+ var import_node_path69 = require("path");
9109
+ var import_mini32 = require("zod/mini");
9110
+ var KiroSkillFrontmatterSchema = import_mini32.z.looseObject({
9111
+ name: import_mini32.z.string(),
9112
+ description: import_mini32.z.string()
8861
9113
  });
8862
9114
  var KiroSkill = class _KiroSkill extends ToolSkill {
8863
9115
  constructor({
8864
9116
  baseDir = process.cwd(),
8865
- relativeDirPath = (0, import_node_path68.join)(".kiro", "skills"),
9117
+ relativeDirPath = (0, import_node_path69.join)(".kiro", "skills"),
8866
9118
  dirName,
8867
9119
  frontmatter,
8868
9120
  body,
@@ -8894,7 +9146,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
8894
9146
  throw new Error("KiroSkill does not support global mode.");
8895
9147
  }
8896
9148
  return {
8897
- relativeDirPath: (0, import_node_path68.join)(".kiro", "skills")
9149
+ relativeDirPath: (0, import_node_path69.join)(".kiro", "skills")
8898
9150
  };
8899
9151
  }
8900
9152
  getFrontmatter() {
@@ -8981,13 +9233,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
8981
9233
  });
8982
9234
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8983
9235
  if (!result.success) {
8984
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9236
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8985
9237
  throw new Error(
8986
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9238
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8987
9239
  );
8988
9240
  }
8989
9241
  if (result.data.name !== loaded.dirName) {
8990
- const skillFilePath = (0, import_node_path68.join)(
9242
+ const skillFilePath = (0, import_node_path69.join)(
8991
9243
  loaded.baseDir,
8992
9244
  loaded.relativeDirPath,
8993
9245
  loaded.dirName,
@@ -9029,17 +9281,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9029
9281
  };
9030
9282
 
9031
9283
  // src/features/skills/opencode-skill.ts
9032
- var import_node_path69 = require("path");
9033
- var import_mini32 = require("zod/mini");
9034
- var OpenCodeSkillFrontmatterSchema = import_mini32.z.looseObject({
9035
- name: import_mini32.z.string(),
9036
- description: import_mini32.z.string(),
9037
- "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string()))
9284
+ var import_node_path70 = require("path");
9285
+ var import_mini33 = require("zod/mini");
9286
+ var OpenCodeSkillFrontmatterSchema = import_mini33.z.looseObject({
9287
+ name: import_mini33.z.string(),
9288
+ description: import_mini33.z.string(),
9289
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
9038
9290
  });
9039
9291
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9040
9292
  constructor({
9041
9293
  baseDir = process.cwd(),
9042
- relativeDirPath = (0, import_node_path69.join)(".opencode", "skill"),
9294
+ relativeDirPath = (0, import_node_path70.join)(".opencode", "skill"),
9043
9295
  dirName,
9044
9296
  frontmatter,
9045
9297
  body,
@@ -9068,7 +9320,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9068
9320
  }
9069
9321
  static getSettablePaths({ global = false } = {}) {
9070
9322
  return {
9071
- relativeDirPath: global ? (0, import_node_path69.join)(".config", "opencode", "skill") : (0, import_node_path69.join)(".opencode", "skill")
9323
+ relativeDirPath: global ? (0, import_node_path70.join)(".config", "opencode", "skill") : (0, import_node_path70.join)(".opencode", "skill")
9072
9324
  };
9073
9325
  }
9074
9326
  getFrontmatter() {
@@ -9153,9 +9405,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9153
9405
  });
9154
9406
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9155
9407
  if (!result.success) {
9156
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9408
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9157
9409
  throw new Error(
9158
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9410
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9159
9411
  );
9160
9412
  }
9161
9413
  return new _OpenCodeSkill({
@@ -9189,16 +9441,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9189
9441
  };
9190
9442
 
9191
9443
  // src/features/skills/replit-skill.ts
9192
- var import_node_path70 = require("path");
9193
- var import_mini33 = require("zod/mini");
9194
- var ReplitSkillFrontmatterSchema = import_mini33.z.looseObject({
9195
- name: import_mini33.z.string(),
9196
- description: import_mini33.z.string()
9444
+ var import_node_path71 = require("path");
9445
+ var import_mini34 = require("zod/mini");
9446
+ var ReplitSkillFrontmatterSchema = import_mini34.z.looseObject({
9447
+ name: import_mini34.z.string(),
9448
+ description: import_mini34.z.string()
9197
9449
  });
9198
9450
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9199
9451
  constructor({
9200
9452
  baseDir = process.cwd(),
9201
- relativeDirPath = (0, import_node_path70.join)(".agents", "skills"),
9453
+ relativeDirPath = (0, import_node_path71.join)(".agents", "skills"),
9202
9454
  dirName,
9203
9455
  frontmatter,
9204
9456
  body,
@@ -9230,7 +9482,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9230
9482
  throw new Error("ReplitSkill does not support global mode.");
9231
9483
  }
9232
9484
  return {
9233
- relativeDirPath: (0, import_node_path70.join)(".agents", "skills")
9485
+ relativeDirPath: (0, import_node_path71.join)(".agents", "skills")
9234
9486
  };
9235
9487
  }
9236
9488
  getFrontmatter() {
@@ -9309,9 +9561,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9309
9561
  });
9310
9562
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9311
9563
  if (!result.success) {
9312
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9564
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9313
9565
  throw new Error(
9314
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9566
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9315
9567
  );
9316
9568
  }
9317
9569
  return new _ReplitSkill({
@@ -9346,16 +9598,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9346
9598
  };
9347
9599
 
9348
9600
  // src/features/skills/roo-skill.ts
9349
- var import_node_path71 = require("path");
9350
- var import_mini34 = require("zod/mini");
9351
- var RooSkillFrontmatterSchema = import_mini34.z.looseObject({
9352
- name: import_mini34.z.string(),
9353
- description: import_mini34.z.string()
9601
+ var import_node_path72 = require("path");
9602
+ var import_mini35 = require("zod/mini");
9603
+ var RooSkillFrontmatterSchema = import_mini35.z.looseObject({
9604
+ name: import_mini35.z.string(),
9605
+ description: import_mini35.z.string()
9354
9606
  });
9355
9607
  var RooSkill = class _RooSkill extends ToolSkill {
9356
9608
  constructor({
9357
9609
  baseDir = process.cwd(),
9358
- relativeDirPath = (0, import_node_path71.join)(".roo", "skills"),
9610
+ relativeDirPath = (0, import_node_path72.join)(".roo", "skills"),
9359
9611
  dirName,
9360
9612
  frontmatter,
9361
9613
  body,
@@ -9386,7 +9638,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
9386
9638
  global: _global = false
9387
9639
  } = {}) {
9388
9640
  return {
9389
- relativeDirPath: (0, import_node_path71.join)(".roo", "skills")
9641
+ relativeDirPath: (0, import_node_path72.join)(".roo", "skills")
9390
9642
  };
9391
9643
  }
9392
9644
  getFrontmatter() {
@@ -9473,13 +9725,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
9473
9725
  });
9474
9726
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9475
9727
  if (!result.success) {
9476
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9728
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9477
9729
  throw new Error(
9478
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9730
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9479
9731
  );
9480
9732
  }
9481
9733
  if (result.data.name !== loaded.dirName) {
9482
- const skillFilePath = (0, import_node_path71.join)(
9734
+ const skillFilePath = (0, import_node_path72.join)(
9483
9735
  loaded.baseDir,
9484
9736
  loaded.relativeDirPath,
9485
9737
  loaded.dirName,
@@ -9520,17 +9772,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
9520
9772
  };
9521
9773
 
9522
9774
  // src/features/skills/skills-utils.ts
9523
- var import_node_path72 = require("path");
9775
+ var import_node_path73 = require("path");
9524
9776
  async function getLocalSkillDirNames(baseDir) {
9525
- const skillsDir = (0, import_node_path72.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
9777
+ const skillsDir = (0, import_node_path73.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
9526
9778
  const names = /* @__PURE__ */ new Set();
9527
9779
  if (!await directoryExists(skillsDir)) {
9528
9780
  return names;
9529
9781
  }
9530
- const dirPaths = await findFilesByGlobs((0, import_node_path72.join)(skillsDir, "*"), { type: "dir" });
9782
+ const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDir, "*"), { type: "dir" });
9531
9783
  for (const dirPath of dirPaths) {
9532
- const name = (0, import_node_path72.basename)(dirPath);
9533
- if (name === (0, import_node_path72.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
9784
+ const name = (0, import_node_path73.basename)(dirPath);
9785
+ if (name === (0, import_node_path73.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
9534
9786
  names.add(name);
9535
9787
  }
9536
9788
  return names;
@@ -9555,7 +9807,7 @@ var skillsProcessorToolTargetTuple = [
9555
9807
  "replit",
9556
9808
  "roo"
9557
9809
  ];
9558
- var SkillsProcessorToolTargetSchema = import_mini35.z.enum(skillsProcessorToolTargetTuple);
9810
+ var SkillsProcessorToolTargetSchema = import_mini36.z.enum(skillsProcessorToolTargetTuple);
9559
9811
  var toolSkillFactories = /* @__PURE__ */ new Map([
9560
9812
  [
9561
9813
  "agentsmd",
@@ -9756,11 +10008,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9756
10008
  )
9757
10009
  );
9758
10010
  const localSkillNames = new Set(localDirNames);
9759
- const curatedDirPath = (0, import_node_path73.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10011
+ const curatedDirPath = (0, import_node_path74.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
9760
10012
  let curatedSkills = [];
9761
10013
  if (await directoryExists(curatedDirPath)) {
9762
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path73.join)(curatedDirPath, "*"), { type: "dir" });
9763
- const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path73.basename)(path4));
10014
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path74.join)(curatedDirPath, "*"), { type: "dir" });
10015
+ const curatedDirNames = curatedDirPaths.map((path4) => (0, import_node_path74.basename)(path4));
9764
10016
  const nonConflicting = curatedDirNames.filter((name) => {
9765
10017
  if (localSkillNames.has(name)) {
9766
10018
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -9793,9 +10045,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9793
10045
  async loadToolDirs() {
9794
10046
  const factory = this.getFactory(this.toolTarget);
9795
10047
  const paths = factory.class.getSettablePaths({ global: this.global });
9796
- const skillsDirPath = (0, import_node_path73.join)(this.baseDir, paths.relativeDirPath);
9797
- const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDirPath, "*"), { type: "dir" });
9798
- const dirNames = dirPaths.map((path4) => (0, import_node_path73.basename)(path4));
10048
+ const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10049
+ const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10050
+ const dirNames = dirPaths.map((path4) => (0, import_node_path74.basename)(path4));
9799
10051
  const toolSkills = await Promise.all(
9800
10052
  dirNames.map(
9801
10053
  (dirName) => factory.class.fromDir({
@@ -9811,9 +10063,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9811
10063
  async loadToolDirsToDelete() {
9812
10064
  const factory = this.getFactory(this.toolTarget);
9813
10065
  const paths = factory.class.getSettablePaths({ global: this.global });
9814
- const skillsDirPath = (0, import_node_path73.join)(this.baseDir, paths.relativeDirPath);
9815
- const dirPaths = await findFilesByGlobs((0, import_node_path73.join)(skillsDirPath, "*"), { type: "dir" });
9816
- const dirNames = dirPaths.map((path4) => (0, import_node_path73.basename)(path4));
10066
+ const skillsDirPath = (0, import_node_path74.join)(this.baseDir, paths.relativeDirPath);
10067
+ const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDirPath, "*"), { type: "dir" });
10068
+ const dirNames = dirPaths.map((path4) => (0, import_node_path74.basename)(path4));
9817
10069
  const toolSkills = dirNames.map(
9818
10070
  (dirName) => factory.class.forDeletion({
9819
10071
  baseDir: this.baseDir,
@@ -9874,11 +10126,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9874
10126
  };
9875
10127
 
9876
10128
  // src/features/subagents/agentsmd-subagent.ts
9877
- var import_node_path75 = require("path");
10129
+ var import_node_path76 = require("path");
9878
10130
 
9879
10131
  // src/features/subagents/simulated-subagent.ts
9880
- var import_node_path74 = require("path");
9881
- var import_mini36 = require("zod/mini");
10132
+ var import_node_path75 = require("path");
10133
+ var import_mini37 = require("zod/mini");
9882
10134
 
9883
10135
  // src/features/subagents/tool-subagent.ts
9884
10136
  var ToolSubagent = class extends ToolFile {
@@ -9930,9 +10182,9 @@ var ToolSubagent = class extends ToolFile {
9930
10182
  };
9931
10183
 
9932
10184
  // src/features/subagents/simulated-subagent.ts
9933
- var SimulatedSubagentFrontmatterSchema = import_mini36.z.object({
9934
- name: import_mini36.z.string(),
9935
- description: import_mini36.z.string()
10185
+ var SimulatedSubagentFrontmatterSchema = import_mini37.z.object({
10186
+ name: import_mini37.z.string(),
10187
+ description: import_mini37.z.string()
9936
10188
  });
9937
10189
  var SimulatedSubagent = class extends ToolSubagent {
9938
10190
  frontmatter;
@@ -9942,7 +10194,7 @@ var SimulatedSubagent = class extends ToolSubagent {
9942
10194
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
9943
10195
  if (!result.success) {
9944
10196
  throw new Error(
9945
- `Invalid frontmatter in ${(0, import_node_path74.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10197
+ `Invalid frontmatter in ${(0, import_node_path75.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
9946
10198
  );
9947
10199
  }
9948
10200
  }
@@ -9993,7 +10245,7 @@ var SimulatedSubagent = class extends ToolSubagent {
9993
10245
  return {
9994
10246
  success: false,
9995
10247
  error: new Error(
9996
- `Invalid frontmatter in ${(0, import_node_path74.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10248
+ `Invalid frontmatter in ${(0, import_node_path75.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
9997
10249
  )
9998
10250
  };
9999
10251
  }
@@ -10003,7 +10255,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10003
10255
  relativeFilePath,
10004
10256
  validate = true
10005
10257
  }) {
10006
- const filePath = (0, import_node_path74.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10258
+ const filePath = (0, import_node_path75.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10007
10259
  const fileContent = await readFileContent(filePath);
10008
10260
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10009
10261
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10013,7 +10265,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10013
10265
  return {
10014
10266
  baseDir,
10015
10267
  relativeDirPath: this.getSettablePaths().relativeDirPath,
10016
- relativeFilePath: (0, import_node_path74.basename)(relativeFilePath),
10268
+ relativeFilePath: (0, import_node_path75.basename)(relativeFilePath),
10017
10269
  frontmatter: result.data,
10018
10270
  body: content.trim(),
10019
10271
  validate
@@ -10039,7 +10291,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10039
10291
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10040
10292
  static getSettablePaths() {
10041
10293
  return {
10042
- relativeDirPath: (0, import_node_path75.join)(".agents", "subagents")
10294
+ relativeDirPath: (0, import_node_path76.join)(".agents", "subagents")
10043
10295
  };
10044
10296
  }
10045
10297
  static async fromFile(params) {
@@ -10062,11 +10314,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10062
10314
  };
10063
10315
 
10064
10316
  // src/features/subagents/factorydroid-subagent.ts
10065
- var import_node_path76 = require("path");
10317
+ var import_node_path77 = require("path");
10066
10318
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10067
10319
  static getSettablePaths(_options) {
10068
10320
  return {
10069
- relativeDirPath: (0, import_node_path76.join)(".factory", "droids")
10321
+ relativeDirPath: (0, import_node_path77.join)(".factory", "droids")
10070
10322
  };
10071
10323
  }
10072
10324
  static async fromFile(params) {
@@ -10089,11 +10341,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10089
10341
  };
10090
10342
 
10091
10343
  // src/features/subagents/geminicli-subagent.ts
10092
- var import_node_path77 = require("path");
10344
+ var import_node_path78 = require("path");
10093
10345
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10094
10346
  static getSettablePaths() {
10095
10347
  return {
10096
- relativeDirPath: (0, import_node_path77.join)(".gemini", "subagents")
10348
+ relativeDirPath: (0, import_node_path78.join)(".gemini", "subagents")
10097
10349
  };
10098
10350
  }
10099
10351
  static async fromFile(params) {
@@ -10116,11 +10368,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10116
10368
  };
10117
10369
 
10118
10370
  // src/features/subagents/roo-subagent.ts
10119
- var import_node_path78 = require("path");
10371
+ var import_node_path79 = require("path");
10120
10372
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10121
10373
  static getSettablePaths() {
10122
10374
  return {
10123
- relativeDirPath: (0, import_node_path78.join)(".roo", "subagents")
10375
+ relativeDirPath: (0, import_node_path79.join)(".roo", "subagents")
10124
10376
  };
10125
10377
  }
10126
10378
  static async fromFile(params) {
@@ -10143,20 +10395,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10143
10395
  };
10144
10396
 
10145
10397
  // src/features/subagents/subagents-processor.ts
10146
- var import_node_path86 = require("path");
10147
- var import_mini44 = require("zod/mini");
10398
+ var import_node_path87 = require("path");
10399
+ var import_mini45 = require("zod/mini");
10148
10400
 
10149
10401
  // src/features/subagents/claudecode-subagent.ts
10150
- var import_node_path80 = require("path");
10151
- var import_mini38 = require("zod/mini");
10402
+ var import_node_path81 = require("path");
10403
+ var import_mini39 = require("zod/mini");
10152
10404
 
10153
10405
  // src/features/subagents/rulesync-subagent.ts
10154
- var import_node_path79 = require("path");
10155
- var import_mini37 = require("zod/mini");
10156
- var RulesyncSubagentFrontmatterSchema = import_mini37.z.looseObject({
10157
- targets: import_mini37.z._default(RulesyncTargetsSchema, ["*"]),
10158
- name: import_mini37.z.string(),
10159
- description: import_mini37.z.string()
10406
+ var import_node_path80 = require("path");
10407
+ var import_mini38 = require("zod/mini");
10408
+ var RulesyncSubagentFrontmatterSchema = import_mini38.z.looseObject({
10409
+ targets: import_mini38.z._default(RulesyncTargetsSchema, ["*"]),
10410
+ name: import_mini38.z.string(),
10411
+ description: import_mini38.z.string()
10160
10412
  });
10161
10413
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10162
10414
  frontmatter;
@@ -10165,7 +10417,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10165
10417
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10166
10418
  if (!parseResult.success && rest.validate !== false) {
10167
10419
  throw new Error(
10168
- `Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10420
+ `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10169
10421
  );
10170
10422
  }
10171
10423
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10198,7 +10450,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10198
10450
  return {
10199
10451
  success: false,
10200
10452
  error: new Error(
10201
- `Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10453
+ `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10202
10454
  )
10203
10455
  };
10204
10456
  }
@@ -10206,14 +10458,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10206
10458
  static async fromFile({
10207
10459
  relativeFilePath
10208
10460
  }) {
10209
- const filePath = (0, import_node_path79.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10461
+ const filePath = (0, import_node_path80.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10210
10462
  const fileContent = await readFileContent(filePath);
10211
10463
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10212
10464
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10213
10465
  if (!result.success) {
10214
10466
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10215
10467
  }
10216
- const filename = (0, import_node_path79.basename)(relativeFilePath);
10468
+ const filename = (0, import_node_path80.basename)(relativeFilePath);
10217
10469
  return new _RulesyncSubagent({
10218
10470
  baseDir: process.cwd(),
10219
10471
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10225,13 +10477,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10225
10477
  };
10226
10478
 
10227
10479
  // src/features/subagents/claudecode-subagent.ts
10228
- var ClaudecodeSubagentFrontmatterSchema = import_mini38.z.looseObject({
10229
- name: import_mini38.z.string(),
10230
- description: import_mini38.z.string(),
10231
- model: import_mini38.z.optional(import_mini38.z.string()),
10232
- tools: import_mini38.z.optional(import_mini38.z.union([import_mini38.z.string(), import_mini38.z.array(import_mini38.z.string())])),
10233
- permissionMode: import_mini38.z.optional(import_mini38.z.string()),
10234
- skills: import_mini38.z.optional(import_mini38.z.union([import_mini38.z.string(), import_mini38.z.array(import_mini38.z.string())]))
10480
+ var ClaudecodeSubagentFrontmatterSchema = import_mini39.z.looseObject({
10481
+ name: import_mini39.z.string(),
10482
+ description: import_mini39.z.string(),
10483
+ model: import_mini39.z.optional(import_mini39.z.string()),
10484
+ tools: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())])),
10485
+ permissionMode: import_mini39.z.optional(import_mini39.z.string()),
10486
+ skills: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())]))
10235
10487
  });
10236
10488
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10237
10489
  frontmatter;
@@ -10241,7 +10493,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10241
10493
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10242
10494
  if (!result.success) {
10243
10495
  throw new Error(
10244
- `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10496
+ `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10245
10497
  );
10246
10498
  }
10247
10499
  }
@@ -10253,7 +10505,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10253
10505
  }
10254
10506
  static getSettablePaths(_options = {}) {
10255
10507
  return {
10256
- relativeDirPath: (0, import_node_path80.join)(".claude", "agents")
10508
+ relativeDirPath: (0, import_node_path81.join)(".claude", "agents")
10257
10509
  };
10258
10510
  }
10259
10511
  getFrontmatter() {
@@ -10329,7 +10581,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10329
10581
  return {
10330
10582
  success: false,
10331
10583
  error: new Error(
10332
- `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10584
+ `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10333
10585
  )
10334
10586
  };
10335
10587
  }
@@ -10347,7 +10599,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10347
10599
  global = false
10348
10600
  }) {
10349
10601
  const paths = this.getSettablePaths({ global });
10350
- const filePath = (0, import_node_path80.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10602
+ const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10351
10603
  const fileContent = await readFileContent(filePath);
10352
10604
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10353
10605
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10382,16 +10634,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10382
10634
  };
10383
10635
 
10384
10636
  // src/features/subagents/codexcli-subagent.ts
10385
- var import_node_path81 = require("path");
10637
+ var import_node_path82 = require("path");
10386
10638
  var smolToml2 = __toESM(require("smol-toml"), 1);
10387
- var import_mini39 = require("zod/mini");
10388
- var CodexCliSubagentTomlSchema = import_mini39.z.looseObject({
10389
- name: import_mini39.z.string(),
10390
- description: import_mini39.z.optional(import_mini39.z.string()),
10391
- developer_instructions: import_mini39.z.optional(import_mini39.z.string()),
10392
- model: import_mini39.z.optional(import_mini39.z.string()),
10393
- model_reasoning_effort: import_mini39.z.optional(import_mini39.z.string()),
10394
- sandbox_mode: import_mini39.z.optional(import_mini39.z.string())
10639
+ var import_mini40 = require("zod/mini");
10640
+ var CodexCliSubagentTomlSchema = import_mini40.z.looseObject({
10641
+ name: import_mini40.z.string(),
10642
+ description: import_mini40.z.optional(import_mini40.z.string()),
10643
+ developer_instructions: import_mini40.z.optional(import_mini40.z.string()),
10644
+ model: import_mini40.z.optional(import_mini40.z.string()),
10645
+ model_reasoning_effort: import_mini40.z.optional(import_mini40.z.string()),
10646
+ sandbox_mode: import_mini40.z.optional(import_mini40.z.string())
10395
10647
  });
10396
10648
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10397
10649
  body;
@@ -10402,7 +10654,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10402
10654
  CodexCliSubagentTomlSchema.parse(parsed);
10403
10655
  } catch (error) {
10404
10656
  throw new Error(
10405
- `Invalid TOML in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10657
+ `Invalid TOML in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10406
10658
  { cause: error }
10407
10659
  );
10408
10660
  }
@@ -10414,7 +10666,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10414
10666
  }
10415
10667
  static getSettablePaths(_options = {}) {
10416
10668
  return {
10417
- relativeDirPath: (0, import_node_path81.join)(".codex", "agents")
10669
+ relativeDirPath: (0, import_node_path82.join)(".codex", "agents")
10418
10670
  };
10419
10671
  }
10420
10672
  getBody() {
@@ -10426,7 +10678,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10426
10678
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10427
10679
  } catch (error) {
10428
10680
  throw new Error(
10429
- `Failed to parse TOML in ${(0, import_node_path81.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10681
+ `Failed to parse TOML in ${(0, import_node_path82.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10430
10682
  { cause: error }
10431
10683
  );
10432
10684
  }
@@ -10507,7 +10759,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10507
10759
  global = false
10508
10760
  }) {
10509
10761
  const paths = this.getSettablePaths({ global });
10510
- const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10762
+ const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10511
10763
  const fileContent = await readFileContent(filePath);
10512
10764
  const subagent = new _CodexCliSubagent({
10513
10765
  baseDir,
@@ -10545,13 +10797,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10545
10797
  };
10546
10798
 
10547
10799
  // src/features/subagents/copilot-subagent.ts
10548
- var import_node_path82 = require("path");
10549
- var import_mini40 = require("zod/mini");
10800
+ var import_node_path83 = require("path");
10801
+ var import_mini41 = require("zod/mini");
10550
10802
  var REQUIRED_TOOL = "agent/runSubagent";
10551
- var CopilotSubagentFrontmatterSchema = import_mini40.z.looseObject({
10552
- name: import_mini40.z.string(),
10553
- description: import_mini40.z.string(),
10554
- tools: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())]))
10803
+ var CopilotSubagentFrontmatterSchema = import_mini41.z.looseObject({
10804
+ name: import_mini41.z.string(),
10805
+ description: import_mini41.z.string(),
10806
+ tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
10555
10807
  });
10556
10808
  var normalizeTools = (tools) => {
10557
10809
  if (!tools) {
@@ -10571,7 +10823,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10571
10823
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
10572
10824
  if (!result.success) {
10573
10825
  throw new Error(
10574
- `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10826
+ `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10575
10827
  );
10576
10828
  }
10577
10829
  }
@@ -10583,7 +10835,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10583
10835
  }
10584
10836
  static getSettablePaths(_options = {}) {
10585
10837
  return {
10586
- relativeDirPath: (0, import_node_path82.join)(".github", "agents")
10838
+ relativeDirPath: (0, import_node_path83.join)(".github", "agents")
10587
10839
  };
10588
10840
  }
10589
10841
  getFrontmatter() {
@@ -10657,7 +10909,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10657
10909
  return {
10658
10910
  success: false,
10659
10911
  error: new Error(
10660
- `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10912
+ `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10661
10913
  )
10662
10914
  };
10663
10915
  }
@@ -10675,7 +10927,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10675
10927
  global = false
10676
10928
  }) {
10677
10929
  const paths = this.getSettablePaths({ global });
10678
- const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10930
+ const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10679
10931
  const fileContent = await readFileContent(filePath);
10680
10932
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10681
10933
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10711,11 +10963,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10711
10963
  };
10712
10964
 
10713
10965
  // src/features/subagents/cursor-subagent.ts
10714
- var import_node_path83 = require("path");
10715
- var import_mini41 = require("zod/mini");
10716
- var CursorSubagentFrontmatterSchema = import_mini41.z.looseObject({
10717
- name: import_mini41.z.string(),
10718
- description: import_mini41.z.string()
10966
+ var import_node_path84 = require("path");
10967
+ var import_mini42 = require("zod/mini");
10968
+ var CursorSubagentFrontmatterSchema = import_mini42.z.looseObject({
10969
+ name: import_mini42.z.string(),
10970
+ description: import_mini42.z.string()
10719
10971
  });
10720
10972
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10721
10973
  frontmatter;
@@ -10725,7 +10977,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10725
10977
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
10726
10978
  if (!result.success) {
10727
10979
  throw new Error(
10728
- `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10980
+ `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10729
10981
  );
10730
10982
  }
10731
10983
  }
@@ -10737,7 +10989,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10737
10989
  }
10738
10990
  static getSettablePaths(_options = {}) {
10739
10991
  return {
10740
- relativeDirPath: (0, import_node_path83.join)(".cursor", "agents")
10992
+ relativeDirPath: (0, import_node_path84.join)(".cursor", "agents")
10741
10993
  };
10742
10994
  }
10743
10995
  getFrontmatter() {
@@ -10804,7 +11056,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10804
11056
  return {
10805
11057
  success: false,
10806
11058
  error: new Error(
10807
- `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11059
+ `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10808
11060
  )
10809
11061
  };
10810
11062
  }
@@ -10822,7 +11074,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10822
11074
  global = false
10823
11075
  }) {
10824
11076
  const paths = this.getSettablePaths({ global });
10825
- const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11077
+ const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10826
11078
  const fileContent = await readFileContent(filePath);
10827
11079
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10828
11080
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10858,23 +11110,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10858
11110
  };
10859
11111
 
10860
11112
  // src/features/subagents/kiro-subagent.ts
10861
- var import_node_path84 = require("path");
10862
- var import_mini42 = require("zod/mini");
10863
- var KiroCliSubagentJsonSchema = import_mini42.z.looseObject({
10864
- name: import_mini42.z.string(),
10865
- description: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.string())),
10866
- prompt: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.string())),
10867
- tools: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.array(import_mini42.z.string()))),
10868
- toolAliases: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.record(import_mini42.z.string(), import_mini42.z.string()))),
10869
- toolSettings: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.unknown())),
10870
- toolSchema: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.unknown())),
10871
- hooks: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.record(import_mini42.z.string(), import_mini42.z.array(import_mini42.z.unknown())))),
10872
- model: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.string())),
10873
- mcpServers: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.record(import_mini42.z.string(), import_mini42.z.unknown()))),
10874
- useLegacyMcpJson: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.boolean())),
10875
- resources: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.array(import_mini42.z.string()))),
10876
- allowedTools: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.array(import_mini42.z.string()))),
10877
- includeMcpJson: import_mini42.z.optional(import_mini42.z.nullable(import_mini42.z.boolean()))
11113
+ var import_node_path85 = require("path");
11114
+ var import_mini43 = require("zod/mini");
11115
+ var KiroCliSubagentJsonSchema = import_mini43.z.looseObject({
11116
+ name: import_mini43.z.string(),
11117
+ description: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11118
+ prompt: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11119
+ tools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11120
+ toolAliases: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.string()))),
11121
+ toolSettings: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11122
+ toolSchema: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.unknown())),
11123
+ hooks: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.array(import_mini43.z.unknown())))),
11124
+ model: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.string())),
11125
+ mcpServers: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.record(import_mini43.z.string(), import_mini43.z.unknown()))),
11126
+ useLegacyMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean())),
11127
+ resources: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11128
+ allowedTools: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.array(import_mini43.z.string()))),
11129
+ includeMcpJson: import_mini43.z.optional(import_mini43.z.nullable(import_mini43.z.boolean()))
10878
11130
  });
10879
11131
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10880
11132
  body;
@@ -10885,7 +11137,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10885
11137
  KiroCliSubagentJsonSchema.parse(parsed);
10886
11138
  } catch (error) {
10887
11139
  throw new Error(
10888
- `Invalid JSON in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11140
+ `Invalid JSON in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
10889
11141
  { cause: error }
10890
11142
  );
10891
11143
  }
@@ -10897,7 +11149,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10897
11149
  }
10898
11150
  static getSettablePaths(_options = {}) {
10899
11151
  return {
10900
- relativeDirPath: (0, import_node_path84.join)(".kiro", "agents")
11152
+ relativeDirPath: (0, import_node_path85.join)(".kiro", "agents")
10901
11153
  };
10902
11154
  }
10903
11155
  getBody() {
@@ -10909,7 +11161,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10909
11161
  parsed = JSON.parse(this.body);
10910
11162
  } catch (error) {
10911
11163
  throw new Error(
10912
- `Failed to parse JSON in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11164
+ `Failed to parse JSON in ${(0, import_node_path85.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10913
11165
  { cause: error }
10914
11166
  );
10915
11167
  }
@@ -10990,7 +11242,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10990
11242
  global = false
10991
11243
  }) {
10992
11244
  const paths = this.getSettablePaths({ global });
10993
- const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11245
+ const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10994
11246
  const fileContent = await readFileContent(filePath);
10995
11247
  const subagent = new _KiroSubagent({
10996
11248
  baseDir,
@@ -11028,12 +11280,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11028
11280
  };
11029
11281
 
11030
11282
  // src/features/subagents/opencode-subagent.ts
11031
- var import_node_path85 = require("path");
11032
- var import_mini43 = require("zod/mini");
11033
- var OpenCodeSubagentFrontmatterSchema = import_mini43.z.looseObject({
11034
- description: import_mini43.z.string(),
11035
- mode: import_mini43.z._default(import_mini43.z.string(), "subagent"),
11036
- name: import_mini43.z.optional(import_mini43.z.string())
11283
+ var import_node_path86 = require("path");
11284
+ var import_mini44 = require("zod/mini");
11285
+ var OpenCodeSubagentFrontmatterSchema = import_mini44.z.looseObject({
11286
+ description: import_mini44.z.string(),
11287
+ mode: import_mini44.z._default(import_mini44.z.string(), "subagent"),
11288
+ name: import_mini44.z.optional(import_mini44.z.string())
11037
11289
  });
11038
11290
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11039
11291
  frontmatter;
@@ -11043,7 +11295,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11043
11295
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11044
11296
  if (!result.success) {
11045
11297
  throw new Error(
11046
- `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11298
+ `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11047
11299
  );
11048
11300
  }
11049
11301
  }
@@ -11057,7 +11309,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11057
11309
  global = false
11058
11310
  } = {}) {
11059
11311
  return {
11060
- relativeDirPath: global ? (0, import_node_path85.join)(".config", "opencode", "agent") : (0, import_node_path85.join)(".opencode", "agent")
11312
+ relativeDirPath: global ? (0, import_node_path86.join)(".config", "opencode", "agent") : (0, import_node_path86.join)(".opencode", "agent")
11061
11313
  };
11062
11314
  }
11063
11315
  getFrontmatter() {
@@ -11070,7 +11322,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11070
11322
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
11071
11323
  const rulesyncFrontmatter = {
11072
11324
  targets: ["*"],
11073
- name: name ?? (0, import_node_path85.basename)(this.getRelativeFilePath(), ".md"),
11325
+ name: name ?? (0, import_node_path86.basename)(this.getRelativeFilePath(), ".md"),
11074
11326
  description,
11075
11327
  opencode: { mode, ...opencodeSection }
11076
11328
  };
@@ -11123,7 +11375,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11123
11375
  return {
11124
11376
  success: false,
11125
11377
  error: new Error(
11126
- `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11378
+ `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11127
11379
  )
11128
11380
  };
11129
11381
  }
@@ -11140,7 +11392,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11140
11392
  global = false
11141
11393
  }) {
11142
11394
  const paths = this.getSettablePaths({ global });
11143
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11395
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11144
11396
  const fileContent = await readFileContent(filePath);
11145
11397
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11146
11398
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11189,7 +11441,7 @@ var subagentsProcessorToolTargetTuple = [
11189
11441
  "opencode",
11190
11442
  "roo"
11191
11443
  ];
11192
- var SubagentsProcessorToolTargetSchema = import_mini44.z.enum(subagentsProcessorToolTargetTuple);
11444
+ var SubagentsProcessorToolTargetSchema = import_mini45.z.enum(subagentsProcessorToolTargetTuple);
11193
11445
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11194
11446
  [
11195
11447
  "agentsmd",
@@ -11351,7 +11603,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11351
11603
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11352
11604
  */
11353
11605
  async loadRulesyncFiles() {
11354
- const subagentsDir = (0, import_node_path86.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11606
+ const subagentsDir = (0, import_node_path87.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11355
11607
  const dirExists = await directoryExists(subagentsDir);
11356
11608
  if (!dirExists) {
11357
11609
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11366,7 +11618,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11366
11618
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
11367
11619
  const rulesyncSubagents = [];
11368
11620
  for (const mdFile of mdFiles) {
11369
- const filepath = (0, import_node_path86.join)(subagentsDir, mdFile);
11621
+ const filepath = (0, import_node_path87.join)(subagentsDir, mdFile);
11370
11622
  try {
11371
11623
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
11372
11624
  relativeFilePath: mdFile,
@@ -11396,14 +11648,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
11396
11648
  const factory = this.getFactory(this.toolTarget);
11397
11649
  const paths = factory.class.getSettablePaths({ global: this.global });
11398
11650
  const subagentFilePaths = await findFilesByGlobs(
11399
- (0, import_node_path86.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11651
+ (0, import_node_path87.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
11400
11652
  );
11401
11653
  if (forDeletion) {
11402
11654
  const toolSubagents2 = subagentFilePaths.map(
11403
11655
  (path4) => factory.class.forDeletion({
11404
11656
  baseDir: this.baseDir,
11405
11657
  relativeDirPath: paths.relativeDirPath,
11406
- relativeFilePath: (0, import_node_path86.basename)(path4),
11658
+ relativeFilePath: (0, import_node_path87.basename)(path4),
11407
11659
  global: this.global
11408
11660
  })
11409
11661
  ).filter((subagent) => subagent.isDeletable());
@@ -11416,7 +11668,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11416
11668
  subagentFilePaths.map(
11417
11669
  (path4) => factory.class.fromFile({
11418
11670
  baseDir: this.baseDir,
11419
- relativeFilePath: (0, import_node_path86.basename)(path4),
11671
+ relativeFilePath: (0, import_node_path87.basename)(path4),
11420
11672
  global: this.global
11421
11673
  })
11422
11674
  )
@@ -11461,49 +11713,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
11461
11713
  };
11462
11714
 
11463
11715
  // src/features/rules/agentsmd-rule.ts
11464
- var import_node_path89 = require("path");
11716
+ var import_node_path90 = require("path");
11465
11717
 
11466
11718
  // src/features/rules/tool-rule.ts
11467
- var import_node_path88 = require("path");
11719
+ var import_node_path89 = require("path");
11468
11720
 
11469
11721
  // src/features/rules/rulesync-rule.ts
11470
- var import_node_path87 = require("path");
11471
- var import_mini45 = require("zod/mini");
11472
- var RulesyncRuleFrontmatterSchema = import_mini45.z.object({
11473
- root: import_mini45.z.optional(import_mini45.z.boolean()),
11474
- localRoot: import_mini45.z.optional(import_mini45.z.boolean()),
11475
- targets: import_mini45.z._default(RulesyncTargetsSchema, ["*"]),
11476
- description: import_mini45.z.optional(import_mini45.z.string()),
11477
- globs: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string())),
11478
- agentsmd: import_mini45.z.optional(
11479
- import_mini45.z.object({
11722
+ var import_node_path88 = require("path");
11723
+ var import_mini46 = require("zod/mini");
11724
+ var RulesyncRuleFrontmatterSchema = import_mini46.z.object({
11725
+ root: import_mini46.z.optional(import_mini46.z.boolean()),
11726
+ localRoot: import_mini46.z.optional(import_mini46.z.boolean()),
11727
+ targets: import_mini46.z._default(RulesyncTargetsSchema, ["*"]),
11728
+ description: import_mini46.z.optional(import_mini46.z.string()),
11729
+ globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string())),
11730
+ agentsmd: import_mini46.z.optional(
11731
+ import_mini46.z.object({
11480
11732
  // @example "path/to/subproject"
11481
- subprojectPath: import_mini45.z.optional(import_mini45.z.string())
11733
+ subprojectPath: import_mini46.z.optional(import_mini46.z.string())
11482
11734
  })
11483
11735
  ),
11484
- claudecode: import_mini45.z.optional(
11485
- import_mini45.z.object({
11736
+ claudecode: import_mini46.z.optional(
11737
+ import_mini46.z.object({
11486
11738
  // Glob patterns for conditional rules (takes precedence over globs)
11487
11739
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
11488
- paths: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
11740
+ paths: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
11489
11741
  })
11490
11742
  ),
11491
- cursor: import_mini45.z.optional(
11492
- import_mini45.z.object({
11493
- alwaysApply: import_mini45.z.optional(import_mini45.z.boolean()),
11494
- description: import_mini45.z.optional(import_mini45.z.string()),
11495
- globs: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
11743
+ cursor: import_mini46.z.optional(
11744
+ import_mini46.z.object({
11745
+ alwaysApply: import_mini46.z.optional(import_mini46.z.boolean()),
11746
+ description: import_mini46.z.optional(import_mini46.z.string()),
11747
+ globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
11496
11748
  })
11497
11749
  ),
11498
- copilot: import_mini45.z.optional(
11499
- import_mini45.z.object({
11500
- excludeAgent: import_mini45.z.optional(import_mini45.z.union([import_mini45.z.literal("code-review"), import_mini45.z.literal("coding-agent")]))
11750
+ copilot: import_mini46.z.optional(
11751
+ import_mini46.z.object({
11752
+ excludeAgent: import_mini46.z.optional(import_mini46.z.union([import_mini46.z.literal("code-review"), import_mini46.z.literal("coding-agent")]))
11501
11753
  })
11502
11754
  ),
11503
- antigravity: import_mini45.z.optional(
11504
- import_mini45.z.looseObject({
11505
- trigger: import_mini45.z.optional(import_mini45.z.string()),
11506
- globs: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
11755
+ antigravity: import_mini46.z.optional(
11756
+ import_mini46.z.looseObject({
11757
+ trigger: import_mini46.z.optional(import_mini46.z.string()),
11758
+ globs: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
11507
11759
  })
11508
11760
  )
11509
11761
  });
@@ -11514,7 +11766,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11514
11766
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
11515
11767
  if (!parseResult.success && rest.validate !== false) {
11516
11768
  throw new Error(
11517
- `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11769
+ `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11518
11770
  );
11519
11771
  }
11520
11772
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -11549,7 +11801,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11549
11801
  return {
11550
11802
  success: false,
11551
11803
  error: new Error(
11552
- `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11804
+ `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11553
11805
  )
11554
11806
  };
11555
11807
  }
@@ -11558,7 +11810,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
11558
11810
  relativeFilePath,
11559
11811
  validate = true
11560
11812
  }) {
11561
- const filePath = (0, import_node_path87.join)(
11813
+ const filePath = (0, import_node_path88.join)(
11562
11814
  process.cwd(),
11563
11815
  this.getSettablePaths().recommended.relativeDirPath,
11564
11816
  relativeFilePath
@@ -11660,7 +11912,7 @@ var ToolRule = class extends ToolFile {
11660
11912
  rulesyncRule,
11661
11913
  validate = true,
11662
11914
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
11663
- nonRootPath = { relativeDirPath: (0, import_node_path88.join)(".agents", "memories") }
11915
+ nonRootPath = { relativeDirPath: (0, import_node_path89.join)(".agents", "memories") }
11664
11916
  }) {
11665
11917
  const params = this.buildToolRuleParamsDefault({
11666
11918
  baseDir,
@@ -11671,7 +11923,7 @@ var ToolRule = class extends ToolFile {
11671
11923
  });
11672
11924
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
11673
11925
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
11674
- params.relativeDirPath = (0, import_node_path88.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
11926
+ params.relativeDirPath = (0, import_node_path89.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
11675
11927
  params.relativeFilePath = "AGENTS.md";
11676
11928
  }
11677
11929
  return params;
@@ -11720,7 +11972,7 @@ var ToolRule = class extends ToolFile {
11720
11972
  }
11721
11973
  };
11722
11974
  function buildToolPath(toolDir, subDir, excludeToolDir) {
11723
- return excludeToolDir ? subDir : (0, import_node_path88.join)(toolDir, subDir);
11975
+ return excludeToolDir ? subDir : (0, import_node_path89.join)(toolDir, subDir);
11724
11976
  }
11725
11977
 
11726
11978
  // src/features/rules/agentsmd-rule.ts
@@ -11749,8 +12001,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
11749
12001
  validate = true
11750
12002
  }) {
11751
12003
  const isRoot = relativeFilePath === "AGENTS.md";
11752
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path89.join)(".agents", "memories", relativeFilePath);
11753
- const fileContent = await readFileContent((0, import_node_path89.join)(baseDir, relativePath));
12004
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path90.join)(".agents", "memories", relativeFilePath);
12005
+ const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
11754
12006
  return new _AgentsMdRule({
11755
12007
  baseDir,
11756
12008
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -11805,21 +12057,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
11805
12057
  };
11806
12058
 
11807
12059
  // src/features/rules/antigravity-rule.ts
11808
- var import_node_path90 = require("path");
11809
- var import_mini46 = require("zod/mini");
11810
- var AntigravityRuleFrontmatterSchema = import_mini46.z.looseObject({
11811
- trigger: import_mini46.z.optional(
11812
- import_mini46.z.union([
11813
- import_mini46.z.literal("always_on"),
11814
- import_mini46.z.literal("glob"),
11815
- import_mini46.z.literal("manual"),
11816
- import_mini46.z.literal("model_decision"),
11817
- import_mini46.z.string()
12060
+ var import_node_path91 = require("path");
12061
+ var import_mini47 = require("zod/mini");
12062
+ var AntigravityRuleFrontmatterSchema = import_mini47.z.looseObject({
12063
+ trigger: import_mini47.z.optional(
12064
+ import_mini47.z.union([
12065
+ import_mini47.z.literal("always_on"),
12066
+ import_mini47.z.literal("glob"),
12067
+ import_mini47.z.literal("manual"),
12068
+ import_mini47.z.literal("model_decision"),
12069
+ import_mini47.z.string()
11818
12070
  // accepts any string for forward compatibility
11819
12071
  ])
11820
12072
  ),
11821
- globs: import_mini46.z.optional(import_mini46.z.string()),
11822
- description: import_mini46.z.optional(import_mini46.z.string())
12073
+ globs: import_mini47.z.optional(import_mini47.z.string()),
12074
+ description: import_mini47.z.optional(import_mini47.z.string())
11823
12075
  });
11824
12076
  function parseGlobsString(globs) {
11825
12077
  if (!globs) {
@@ -11964,7 +12216,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
11964
12216
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
11965
12217
  if (!result.success) {
11966
12218
  throw new Error(
11967
- `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12219
+ `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11968
12220
  );
11969
12221
  }
11970
12222
  }
@@ -11988,7 +12240,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
11988
12240
  relativeFilePath,
11989
12241
  validate = true
11990
12242
  }) {
11991
- const filePath = (0, import_node_path90.join)(
12243
+ const filePath = (0, import_node_path91.join)(
11992
12244
  baseDir,
11993
12245
  this.getSettablePaths().nonRoot.relativeDirPath,
11994
12246
  relativeFilePath
@@ -12129,7 +12381,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12129
12381
  };
12130
12382
 
12131
12383
  // src/features/rules/augmentcode-legacy-rule.ts
12132
- var import_node_path91 = require("path");
12384
+ var import_node_path92 = require("path");
12133
12385
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12134
12386
  toRulesyncRule() {
12135
12387
  const rulesyncFrontmatter = {
@@ -12190,8 +12442,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12190
12442
  }) {
12191
12443
  const settablePaths = this.getSettablePaths();
12192
12444
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12193
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path91.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12194
- const fileContent = await readFileContent((0, import_node_path91.join)(baseDir, relativePath));
12445
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path92.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12446
+ const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
12195
12447
  return new _AugmentcodeLegacyRule({
12196
12448
  baseDir,
12197
12449
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12220,7 +12472,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12220
12472
  };
12221
12473
 
12222
12474
  // src/features/rules/augmentcode-rule.ts
12223
- var import_node_path92 = require("path");
12475
+ var import_node_path93 = require("path");
12224
12476
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12225
12477
  toRulesyncRule() {
12226
12478
  return this.toRulesyncRuleDefault();
@@ -12251,7 +12503,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12251
12503
  relativeFilePath,
12252
12504
  validate = true
12253
12505
  }) {
12254
- const filePath = (0, import_node_path92.join)(
12506
+ const filePath = (0, import_node_path93.join)(
12255
12507
  baseDir,
12256
12508
  this.getSettablePaths().nonRoot.relativeDirPath,
12257
12509
  relativeFilePath
@@ -12291,7 +12543,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12291
12543
  };
12292
12544
 
12293
12545
  // src/features/rules/claudecode-legacy-rule.ts
12294
- var import_node_path93 = require("path");
12546
+ var import_node_path94 = require("path");
12295
12547
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12296
12548
  static getSettablePaths({
12297
12549
  global,
@@ -12326,7 +12578,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12326
12578
  if (isRoot) {
12327
12579
  const relativePath2 = paths.root.relativeFilePath;
12328
12580
  const fileContent2 = await readFileContent(
12329
- (0, import_node_path93.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12581
+ (0, import_node_path94.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12330
12582
  );
12331
12583
  return new _ClaudecodeLegacyRule({
12332
12584
  baseDir,
@@ -12340,8 +12592,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12340
12592
  if (!paths.nonRoot) {
12341
12593
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12342
12594
  }
12343
- const relativePath = (0, import_node_path93.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12344
- const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
12595
+ const relativePath = (0, import_node_path94.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12596
+ const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
12345
12597
  return new _ClaudecodeLegacyRule({
12346
12598
  baseDir,
12347
12599
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12400,10 +12652,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12400
12652
  };
12401
12653
 
12402
12654
  // src/features/rules/claudecode-rule.ts
12403
- var import_node_path94 = require("path");
12404
- var import_mini47 = require("zod/mini");
12405
- var ClaudecodeRuleFrontmatterSchema = import_mini47.z.object({
12406
- paths: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
12655
+ var import_node_path95 = require("path");
12656
+ var import_mini48 = require("zod/mini");
12657
+ var ClaudecodeRuleFrontmatterSchema = import_mini48.z.object({
12658
+ paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12407
12659
  });
12408
12660
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12409
12661
  frontmatter;
@@ -12435,7 +12687,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12435
12687
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12436
12688
  if (!result.success) {
12437
12689
  throw new Error(
12438
- `Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12690
+ `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12439
12691
  );
12440
12692
  }
12441
12693
  }
@@ -12463,7 +12715,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12463
12715
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
12464
12716
  if (isRoot) {
12465
12717
  const fileContent2 = await readFileContent(
12466
- (0, import_node_path94.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
12718
+ (0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
12467
12719
  );
12468
12720
  return new _ClaudecodeRule({
12469
12721
  baseDir,
@@ -12478,16 +12730,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12478
12730
  if (!paths.nonRoot) {
12479
12731
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12480
12732
  }
12481
- const relativePath = (0, import_node_path94.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12482
- const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
12733
+ const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12734
+ const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
12483
12735
  const { frontmatter, body: content } = parseFrontmatter(
12484
12736
  fileContent,
12485
- (0, import_node_path94.join)(baseDir, relativePath)
12737
+ (0, import_node_path95.join)(baseDir, relativePath)
12486
12738
  );
12487
12739
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
12488
12740
  if (!result.success) {
12489
12741
  throw new Error(
12490
- `Invalid frontmatter in ${(0, import_node_path94.join)(baseDir, relativePath)}: ${formatError(result.error)}`
12742
+ `Invalid frontmatter in ${(0, import_node_path95.join)(baseDir, relativePath)}: ${formatError(result.error)}`
12491
12743
  );
12492
12744
  }
12493
12745
  return new _ClaudecodeRule({
@@ -12594,7 +12846,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12594
12846
  return {
12595
12847
  success: false,
12596
12848
  error: new Error(
12597
- `Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12849
+ `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12598
12850
  )
12599
12851
  };
12600
12852
  }
@@ -12614,10 +12866,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12614
12866
  };
12615
12867
 
12616
12868
  // src/features/rules/cline-rule.ts
12617
- var import_node_path95 = require("path");
12618
- var import_mini48 = require("zod/mini");
12619
- var ClineRuleFrontmatterSchema = import_mini48.z.object({
12620
- description: import_mini48.z.string()
12869
+ var import_node_path96 = require("path");
12870
+ var import_mini49 = require("zod/mini");
12871
+ var ClineRuleFrontmatterSchema = import_mini49.z.object({
12872
+ description: import_mini49.z.string()
12621
12873
  });
12622
12874
  var ClineRule = class _ClineRule extends ToolRule {
12623
12875
  static getSettablePaths(_options = {}) {
@@ -12660,7 +12912,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12660
12912
  validate = true
12661
12913
  }) {
12662
12914
  const fileContent = await readFileContent(
12663
- (0, import_node_path95.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
12915
+ (0, import_node_path96.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
12664
12916
  );
12665
12917
  return new _ClineRule({
12666
12918
  baseDir,
@@ -12686,7 +12938,7 @@ var ClineRule = class _ClineRule extends ToolRule {
12686
12938
  };
12687
12939
 
12688
12940
  // src/features/rules/codexcli-rule.ts
12689
- var import_node_path96 = require("path");
12941
+ var import_node_path97 = require("path");
12690
12942
  var CodexcliRule = class _CodexcliRule extends ToolRule {
12691
12943
  static getSettablePaths({
12692
12944
  global,
@@ -12721,7 +12973,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12721
12973
  if (isRoot) {
12722
12974
  const relativePath2 = paths.root.relativeFilePath;
12723
12975
  const fileContent2 = await readFileContent(
12724
- (0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12976
+ (0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, relativePath2)
12725
12977
  );
12726
12978
  return new _CodexcliRule({
12727
12979
  baseDir,
@@ -12735,8 +12987,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12735
12987
  if (!paths.nonRoot) {
12736
12988
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12737
12989
  }
12738
- const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12739
- const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
12990
+ const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12991
+ const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
12740
12992
  return new _CodexcliRule({
12741
12993
  baseDir,
12742
12994
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -12795,12 +13047,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12795
13047
  };
12796
13048
 
12797
13049
  // src/features/rules/copilot-rule.ts
12798
- var import_node_path97 = require("path");
12799
- var import_mini49 = require("zod/mini");
12800
- var CopilotRuleFrontmatterSchema = import_mini49.z.object({
12801
- description: import_mini49.z.optional(import_mini49.z.string()),
12802
- applyTo: import_mini49.z.optional(import_mini49.z.string()),
12803
- excludeAgent: import_mini49.z.optional(import_mini49.z.union([import_mini49.z.literal("code-review"), import_mini49.z.literal("coding-agent")]))
13050
+ var import_node_path98 = require("path");
13051
+ var import_mini50 = require("zod/mini");
13052
+ var CopilotRuleFrontmatterSchema = import_mini50.z.object({
13053
+ description: import_mini50.z.optional(import_mini50.z.string()),
13054
+ applyTo: import_mini50.z.optional(import_mini50.z.string()),
13055
+ excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
12804
13056
  });
12805
13057
  var CopilotRule = class _CopilotRule extends ToolRule {
12806
13058
  frontmatter;
@@ -12829,7 +13081,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12829
13081
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
12830
13082
  if (!result.success) {
12831
13083
  throw new Error(
12832
- `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13084
+ `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12833
13085
  );
12834
13086
  }
12835
13087
  }
@@ -12919,8 +13171,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12919
13171
  const paths = this.getSettablePaths({ global });
12920
13172
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
12921
13173
  if (isRoot) {
12922
- const relativePath2 = (0, import_node_path97.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
12923
- const fileContent2 = await readFileContent((0, import_node_path97.join)(baseDir, relativePath2));
13174
+ const relativePath2 = (0, import_node_path98.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13175
+ const fileContent2 = await readFileContent((0, import_node_path98.join)(baseDir, relativePath2));
12924
13176
  return new _CopilotRule({
12925
13177
  baseDir,
12926
13178
  relativeDirPath: paths.root.relativeDirPath,
@@ -12934,16 +13186,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12934
13186
  if (!paths.nonRoot) {
12935
13187
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
12936
13188
  }
12937
- const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
12938
- const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
13189
+ const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13190
+ const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
12939
13191
  const { frontmatter, body: content } = parseFrontmatter(
12940
13192
  fileContent,
12941
- (0, import_node_path97.join)(baseDir, relativePath)
13193
+ (0, import_node_path98.join)(baseDir, relativePath)
12942
13194
  );
12943
13195
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
12944
13196
  if (!result.success) {
12945
13197
  throw new Error(
12946
- `Invalid frontmatter in ${(0, import_node_path97.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13198
+ `Invalid frontmatter in ${(0, import_node_path98.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
12947
13199
  );
12948
13200
  }
12949
13201
  return new _CopilotRule({
@@ -12985,7 +13237,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12985
13237
  return {
12986
13238
  success: false,
12987
13239
  error: new Error(
12988
- `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13240
+ `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12989
13241
  )
12990
13242
  };
12991
13243
  }
@@ -13005,12 +13257,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13005
13257
  };
13006
13258
 
13007
13259
  // src/features/rules/cursor-rule.ts
13008
- var import_node_path98 = require("path");
13009
- var import_mini50 = require("zod/mini");
13010
- var CursorRuleFrontmatterSchema = import_mini50.z.object({
13011
- description: import_mini50.z.optional(import_mini50.z.string()),
13012
- globs: import_mini50.z.optional(import_mini50.z.string()),
13013
- alwaysApply: import_mini50.z.optional(import_mini50.z.boolean())
13260
+ var import_node_path99 = require("path");
13261
+ var import_mini51 = require("zod/mini");
13262
+ var CursorRuleFrontmatterSchema = import_mini51.z.object({
13263
+ description: import_mini51.z.optional(import_mini51.z.string()),
13264
+ globs: import_mini51.z.optional(import_mini51.z.string()),
13265
+ alwaysApply: import_mini51.z.optional(import_mini51.z.boolean())
13014
13266
  });
13015
13267
  var CursorRule = class _CursorRule extends ToolRule {
13016
13268
  frontmatter;
@@ -13027,7 +13279,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13027
13279
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13028
13280
  if (!result.success) {
13029
13281
  throw new Error(
13030
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13282
+ `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13031
13283
  );
13032
13284
  }
13033
13285
  }
@@ -13143,7 +13395,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13143
13395
  relativeFilePath,
13144
13396
  validate = true
13145
13397
  }) {
13146
- const filePath = (0, import_node_path98.join)(
13398
+ const filePath = (0, import_node_path99.join)(
13147
13399
  baseDir,
13148
13400
  this.getSettablePaths().nonRoot.relativeDirPath,
13149
13401
  relativeFilePath
@@ -13153,7 +13405,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13153
13405
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13154
13406
  if (!result.success) {
13155
13407
  throw new Error(
13156
- `Invalid frontmatter in ${(0, import_node_path98.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13408
+ `Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13157
13409
  );
13158
13410
  }
13159
13411
  return new _CursorRule({
@@ -13190,7 +13442,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13190
13442
  return {
13191
13443
  success: false,
13192
13444
  error: new Error(
13193
- `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13445
+ `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13194
13446
  )
13195
13447
  };
13196
13448
  }
@@ -13210,7 +13462,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13210
13462
  };
13211
13463
 
13212
13464
  // src/features/rules/factorydroid-rule.ts
13213
- var import_node_path99 = require("path");
13465
+ var import_node_path100 = require("path");
13214
13466
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13215
13467
  constructor({ fileContent, root, ...rest }) {
13216
13468
  super({
@@ -13250,8 +13502,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13250
13502
  const paths = this.getSettablePaths({ global });
13251
13503
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13252
13504
  if (isRoot) {
13253
- const relativePath2 = (0, import_node_path99.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13254
- const fileContent2 = await readFileContent((0, import_node_path99.join)(baseDir, relativePath2));
13505
+ const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13506
+ const fileContent2 = await readFileContent((0, import_node_path100.join)(baseDir, relativePath2));
13255
13507
  return new _FactorydroidRule({
13256
13508
  baseDir,
13257
13509
  relativeDirPath: paths.root.relativeDirPath,
@@ -13264,8 +13516,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13264
13516
  if (!paths.nonRoot) {
13265
13517
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13266
13518
  }
13267
- const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13268
- const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13519
+ const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13520
+ const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13269
13521
  return new _FactorydroidRule({
13270
13522
  baseDir,
13271
13523
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13324,7 +13576,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13324
13576
  };
13325
13577
 
13326
13578
  // src/features/rules/geminicli-rule.ts
13327
- var import_node_path100 = require("path");
13579
+ var import_node_path101 = require("path");
13328
13580
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13329
13581
  static getSettablePaths({
13330
13582
  global,
@@ -13359,7 +13611,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13359
13611
  if (isRoot) {
13360
13612
  const relativePath2 = paths.root.relativeFilePath;
13361
13613
  const fileContent2 = await readFileContent(
13362
- (0, import_node_path100.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13614
+ (0, import_node_path101.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13363
13615
  );
13364
13616
  return new _GeminiCliRule({
13365
13617
  baseDir,
@@ -13373,8 +13625,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13373
13625
  if (!paths.nonRoot) {
13374
13626
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13375
13627
  }
13376
- const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13377
- const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13628
+ const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13629
+ const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13378
13630
  return new _GeminiCliRule({
13379
13631
  baseDir,
13380
13632
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13433,7 +13685,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13433
13685
  };
13434
13686
 
13435
13687
  // src/features/rules/goose-rule.ts
13436
- var import_node_path101 = require("path");
13688
+ var import_node_path102 = require("path");
13437
13689
  var GooseRule = class _GooseRule extends ToolRule {
13438
13690
  static getSettablePaths({
13439
13691
  global,
@@ -13468,7 +13720,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13468
13720
  if (isRoot) {
13469
13721
  const relativePath2 = paths.root.relativeFilePath;
13470
13722
  const fileContent2 = await readFileContent(
13471
- (0, import_node_path101.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13723
+ (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13472
13724
  );
13473
13725
  return new _GooseRule({
13474
13726
  baseDir,
@@ -13482,8 +13734,8 @@ var GooseRule = class _GooseRule extends ToolRule {
13482
13734
  if (!paths.nonRoot) {
13483
13735
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13484
13736
  }
13485
- const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13486
- const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13737
+ const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13738
+ const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13487
13739
  return new _GooseRule({
13488
13740
  baseDir,
13489
13741
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13542,7 +13794,7 @@ var GooseRule = class _GooseRule extends ToolRule {
13542
13794
  };
13543
13795
 
13544
13796
  // src/features/rules/junie-rule.ts
13545
- var import_node_path102 = require("path");
13797
+ var import_node_path103 = require("path");
13546
13798
  var JunieRule = class _JunieRule extends ToolRule {
13547
13799
  static getSettablePaths(_options = {}) {
13548
13800
  return {
@@ -13561,8 +13813,8 @@ var JunieRule = class _JunieRule extends ToolRule {
13561
13813
  validate = true
13562
13814
  }) {
13563
13815
  const isRoot = relativeFilePath === "guidelines.md";
13564
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path102.join)(".junie", "memories", relativeFilePath);
13565
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13816
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path103.join)(".junie", "memories", relativeFilePath);
13817
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13566
13818
  return new _JunieRule({
13567
13819
  baseDir,
13568
13820
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13617,7 +13869,7 @@ var JunieRule = class _JunieRule extends ToolRule {
13617
13869
  };
13618
13870
 
13619
13871
  // src/features/rules/kilo-rule.ts
13620
- var import_node_path103 = require("path");
13872
+ var import_node_path104 = require("path");
13621
13873
  var KiloRule = class _KiloRule extends ToolRule {
13622
13874
  static getSettablePaths(_options = {}) {
13623
13875
  return {
@@ -13632,7 +13884,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13632
13884
  validate = true
13633
13885
  }) {
13634
13886
  const fileContent = await readFileContent(
13635
- (0, import_node_path103.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13887
+ (0, import_node_path104.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13636
13888
  );
13637
13889
  return new _KiloRule({
13638
13890
  baseDir,
@@ -13684,7 +13936,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13684
13936
  };
13685
13937
 
13686
13938
  // src/features/rules/kiro-rule.ts
13687
- var import_node_path104 = require("path");
13939
+ var import_node_path105 = require("path");
13688
13940
  var KiroRule = class _KiroRule extends ToolRule {
13689
13941
  static getSettablePaths(_options = {}) {
13690
13942
  return {
@@ -13699,7 +13951,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13699
13951
  validate = true
13700
13952
  }) {
13701
13953
  const fileContent = await readFileContent(
13702
- (0, import_node_path104.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13954
+ (0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13703
13955
  );
13704
13956
  return new _KiroRule({
13705
13957
  baseDir,
@@ -13753,7 +14005,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13753
14005
  };
13754
14006
 
13755
14007
  // src/features/rules/opencode-rule.ts
13756
- var import_node_path105 = require("path");
14008
+ var import_node_path106 = require("path");
13757
14009
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13758
14010
  static getSettablePaths({
13759
14011
  global,
@@ -13788,7 +14040,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13788
14040
  if (isRoot) {
13789
14041
  const relativePath2 = paths.root.relativeFilePath;
13790
14042
  const fileContent2 = await readFileContent(
13791
- (0, import_node_path105.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14043
+ (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13792
14044
  );
13793
14045
  return new _OpenCodeRule({
13794
14046
  baseDir,
@@ -13802,8 +14054,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13802
14054
  if (!paths.nonRoot) {
13803
14055
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13804
14056
  }
13805
- const relativePath = (0, import_node_path105.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13806
- const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
14057
+ const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14058
+ const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
13807
14059
  return new _OpenCodeRule({
13808
14060
  baseDir,
13809
14061
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13862,7 +14114,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13862
14114
  };
13863
14115
 
13864
14116
  // src/features/rules/qwencode-rule.ts
13865
- var import_node_path106 = require("path");
14117
+ var import_node_path107 = require("path");
13866
14118
  var QwencodeRule = class _QwencodeRule extends ToolRule {
13867
14119
  static getSettablePaths(_options = {}) {
13868
14120
  return {
@@ -13881,8 +14133,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13881
14133
  validate = true
13882
14134
  }) {
13883
14135
  const isRoot = relativeFilePath === "QWEN.md";
13884
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path106.join)(".qwen", "memories", relativeFilePath);
13885
- const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14136
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path107.join)(".qwen", "memories", relativeFilePath);
14137
+ const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
13886
14138
  return new _QwencodeRule({
13887
14139
  baseDir,
13888
14140
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13934,7 +14186,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13934
14186
  };
13935
14187
 
13936
14188
  // src/features/rules/replit-rule.ts
13937
- var import_node_path107 = require("path");
14189
+ var import_node_path108 = require("path");
13938
14190
  var ReplitRule = class _ReplitRule extends ToolRule {
13939
14191
  static getSettablePaths(_options = {}) {
13940
14192
  return {
@@ -13956,7 +14208,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
13956
14208
  }
13957
14209
  const relativePath = paths.root.relativeFilePath;
13958
14210
  const fileContent = await readFileContent(
13959
- (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath)
14211
+ (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath)
13960
14212
  );
13961
14213
  return new _ReplitRule({
13962
14214
  baseDir,
@@ -14022,7 +14274,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14022
14274
  };
14023
14275
 
14024
14276
  // src/features/rules/roo-rule.ts
14025
- var import_node_path108 = require("path");
14277
+ var import_node_path109 = require("path");
14026
14278
  var RooRule = class _RooRule extends ToolRule {
14027
14279
  static getSettablePaths(_options = {}) {
14028
14280
  return {
@@ -14037,7 +14289,7 @@ var RooRule = class _RooRule extends ToolRule {
14037
14289
  validate = true
14038
14290
  }) {
14039
14291
  const fileContent = await readFileContent(
14040
- (0, import_node_path108.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14292
+ (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14041
14293
  );
14042
14294
  return new _RooRule({
14043
14295
  baseDir,
@@ -14106,7 +14358,7 @@ var RooRule = class _RooRule extends ToolRule {
14106
14358
  };
14107
14359
 
14108
14360
  // src/features/rules/warp-rule.ts
14109
- var import_node_path109 = require("path");
14361
+ var import_node_path110 = require("path");
14110
14362
  var WarpRule = class _WarpRule extends ToolRule {
14111
14363
  constructor({ fileContent, root, ...rest }) {
14112
14364
  super({
@@ -14132,8 +14384,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14132
14384
  validate = true
14133
14385
  }) {
14134
14386
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14135
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path109.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14136
- const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
14387
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path110.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14388
+ const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
14137
14389
  return new _WarpRule({
14138
14390
  baseDir,
14139
14391
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14188,7 +14440,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14188
14440
  };
14189
14441
 
14190
14442
  // src/features/rules/windsurf-rule.ts
14191
- var import_node_path110 = require("path");
14443
+ var import_node_path111 = require("path");
14192
14444
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14193
14445
  static getSettablePaths(_options = {}) {
14194
14446
  return {
@@ -14203,7 +14455,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14203
14455
  validate = true
14204
14456
  }) {
14205
14457
  const fileContent = await readFileContent(
14206
- (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14458
+ (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14207
14459
  );
14208
14460
  return new _WindsurfRule({
14209
14461
  baseDir,
@@ -14279,8 +14531,8 @@ var rulesProcessorToolTargets = [
14279
14531
  "warp",
14280
14532
  "windsurf"
14281
14533
  ];
14282
- var RulesProcessorToolTargetSchema = import_mini51.z.enum(rulesProcessorToolTargets);
14283
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path111.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14534
+ var RulesProcessorToolTargetSchema = import_mini52.z.enum(rulesProcessorToolTargets);
14535
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path112.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14284
14536
  var toolRuleFactories = /* @__PURE__ */ new Map([
14285
14537
  [
14286
14538
  "agentsmd",
@@ -14655,7 +14907,7 @@ var RulesProcessor = class extends FeatureProcessor {
14655
14907
  }).relativeDirPath;
14656
14908
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
14657
14909
  const frontmatter = skill.getFrontmatter();
14658
- const relativePath = (0, import_node_path111.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14910
+ const relativePath = (0, import_node_path112.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14659
14911
  return {
14660
14912
  name: frontmatter.name,
14661
14913
  description: frontmatter.description,
@@ -14768,12 +15020,12 @@ var RulesProcessor = class extends FeatureProcessor {
14768
15020
  * Load and parse rulesync rule files from .rulesync/rules/ directory
14769
15021
  */
14770
15022
  async loadRulesyncFiles() {
14771
- const rulesyncBaseDir = (0, import_node_path111.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
14772
- const files = await findFilesByGlobs((0, import_node_path111.join)(rulesyncBaseDir, "**", "*.md"));
15023
+ const rulesyncBaseDir = (0, import_node_path112.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15024
+ const files = await findFilesByGlobs((0, import_node_path112.join)(rulesyncBaseDir, "**", "*.md"));
14773
15025
  logger.debug(`Found ${files.length} rulesync files`);
14774
15026
  const rulesyncRules = await Promise.all(
14775
15027
  files.map((file) => {
14776
- const relativeFilePath = (0, import_node_path111.relative)(rulesyncBaseDir, file);
15028
+ const relativeFilePath = (0, import_node_path112.relative)(rulesyncBaseDir, file);
14777
15029
  checkPathTraversal({
14778
15030
  relativePath: relativeFilePath,
14779
15031
  intendedRootDir: rulesyncBaseDir
@@ -14836,7 +15088,7 @@ var RulesProcessor = class extends FeatureProcessor {
14836
15088
  return [];
14837
15089
  }
14838
15090
  const rootFilePaths = await findFilesByGlobs(
14839
- (0, import_node_path111.join)(
15091
+ (0, import_node_path112.join)(
14840
15092
  this.baseDir,
14841
15093
  settablePaths.root.relativeDirPath ?? ".",
14842
15094
  settablePaths.root.relativeFilePath
@@ -14847,7 +15099,7 @@ var RulesProcessor = class extends FeatureProcessor {
14847
15099
  (filePath) => factory.class.forDeletion({
14848
15100
  baseDir: this.baseDir,
14849
15101
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
14850
- relativeFilePath: (0, import_node_path111.basename)(filePath),
15102
+ relativeFilePath: (0, import_node_path112.basename)(filePath),
14851
15103
  global: this.global
14852
15104
  })
14853
15105
  ).filter((rule) => rule.isDeletable());
@@ -14856,7 +15108,7 @@ var RulesProcessor = class extends FeatureProcessor {
14856
15108
  rootFilePaths.map(
14857
15109
  (filePath) => factory.class.fromFile({
14858
15110
  baseDir: this.baseDir,
14859
- relativeFilePath: (0, import_node_path111.basename)(filePath),
15111
+ relativeFilePath: (0, import_node_path112.basename)(filePath),
14860
15112
  global: this.global
14861
15113
  })
14862
15114
  )
@@ -14874,13 +15126,13 @@ var RulesProcessor = class extends FeatureProcessor {
14874
15126
  return [];
14875
15127
  }
14876
15128
  const localRootFilePaths = await findFilesByGlobs(
14877
- (0, import_node_path111.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
15129
+ (0, import_node_path112.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
14878
15130
  );
14879
15131
  return localRootFilePaths.map(
14880
15132
  (filePath) => factory.class.forDeletion({
14881
15133
  baseDir: this.baseDir,
14882
15134
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
14883
- relativeFilePath: (0, import_node_path111.basename)(filePath),
15135
+ relativeFilePath: (0, import_node_path112.basename)(filePath),
14884
15136
  global: this.global
14885
15137
  })
14886
15138
  ).filter((rule) => rule.isDeletable());
@@ -14890,13 +15142,13 @@ var RulesProcessor = class extends FeatureProcessor {
14890
15142
  if (!settablePaths.nonRoot) {
14891
15143
  return [];
14892
15144
  }
14893
- const nonRootBaseDir = (0, import_node_path111.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15145
+ const nonRootBaseDir = (0, import_node_path112.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
14894
15146
  const nonRootFilePaths = await findFilesByGlobs(
14895
- (0, import_node_path111.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15147
+ (0, import_node_path112.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
14896
15148
  );
14897
15149
  if (forDeletion) {
14898
15150
  return nonRootFilePaths.map((filePath) => {
14899
- const relativeFilePath = (0, import_node_path111.relative)(nonRootBaseDir, filePath);
15151
+ const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
14900
15152
  checkPathTraversal({
14901
15153
  relativePath: relativeFilePath,
14902
15154
  intendedRootDir: nonRootBaseDir
@@ -14911,7 +15163,7 @@ var RulesProcessor = class extends FeatureProcessor {
14911
15163
  }
14912
15164
  return await Promise.all(
14913
15165
  nonRootFilePaths.map((filePath) => {
14914
- const relativeFilePath = (0, import_node_path111.relative)(nonRootBaseDir, filePath);
15166
+ const relativeFilePath = (0, import_node_path112.relative)(nonRootBaseDir, filePath);
14915
15167
  checkPathTraversal({
14916
15168
  relativePath: relativeFilePath,
14917
15169
  intendedRootDir: nonRootBaseDir
@@ -15024,14 +15276,14 @@ s/<command> [arguments]
15024
15276
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15025
15277
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15026
15278
 
15027
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path111.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15279
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15028
15280
  const subagentsSection = subagents ? `## Simulated Subagents
15029
15281
 
15030
15282
  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.
15031
15283
 
15032
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path111.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15284
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15033
15285
 
15034
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path111.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15286
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path112.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15035
15287
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15036
15288
  const result = [
15037
15289
  overview,
@@ -15063,51 +15315,51 @@ var import_request_error = require("@octokit/request-error");
15063
15315
  var import_rest = require("@octokit/rest");
15064
15316
 
15065
15317
  // src/types/fetch.ts
15066
- var import_mini53 = require("zod/mini");
15318
+ var import_mini54 = require("zod/mini");
15067
15319
 
15068
15320
  // src/types/fetch-targets.ts
15069
- var import_mini52 = require("zod/mini");
15321
+ var import_mini53 = require("zod/mini");
15070
15322
  var ALL_FETCH_TARGETS = ["rulesync", ...ALL_TOOL_TARGETS];
15071
- var FetchTargetSchema = import_mini52.z.enum(ALL_FETCH_TARGETS);
15323
+ var FetchTargetSchema = import_mini53.z.enum(ALL_FETCH_TARGETS);
15072
15324
 
15073
15325
  // src/types/fetch.ts
15074
- var ConflictStrategySchema = import_mini53.z.enum(["skip", "overwrite"]);
15075
- var GitHubFileTypeSchema = import_mini53.z.enum(["file", "dir", "symlink", "submodule"]);
15076
- var GitHubFileEntrySchema = import_mini53.z.looseObject({
15077
- name: import_mini53.z.string(),
15078
- path: import_mini53.z.string(),
15079
- sha: import_mini53.z.string(),
15080
- size: import_mini53.z.number(),
15326
+ var ConflictStrategySchema = import_mini54.z.enum(["skip", "overwrite"]);
15327
+ var GitHubFileTypeSchema = import_mini54.z.enum(["file", "dir", "symlink", "submodule"]);
15328
+ var GitHubFileEntrySchema = import_mini54.z.looseObject({
15329
+ name: import_mini54.z.string(),
15330
+ path: import_mini54.z.string(),
15331
+ sha: import_mini54.z.string(),
15332
+ size: import_mini54.z.number(),
15081
15333
  type: GitHubFileTypeSchema,
15082
- download_url: import_mini53.z.nullable(import_mini53.z.string())
15334
+ download_url: import_mini54.z.nullable(import_mini54.z.string())
15083
15335
  });
15084
- var FetchOptionsSchema = import_mini53.z.looseObject({
15085
- target: import_mini53.z.optional(FetchTargetSchema),
15086
- features: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.enum(ALL_FEATURES_WITH_WILDCARD))),
15087
- ref: import_mini53.z.optional(import_mini53.z.string()),
15088
- path: import_mini53.z.optional(import_mini53.z.string()),
15089
- output: import_mini53.z.optional(import_mini53.z.string()),
15090
- conflict: import_mini53.z.optional(ConflictStrategySchema),
15091
- token: import_mini53.z.optional(import_mini53.z.string()),
15092
- verbose: import_mini53.z.optional(import_mini53.z.boolean()),
15093
- silent: import_mini53.z.optional(import_mini53.z.boolean())
15336
+ var FetchOptionsSchema = import_mini54.z.looseObject({
15337
+ target: import_mini54.z.optional(FetchTargetSchema),
15338
+ features: import_mini54.z.optional(import_mini54.z.array(import_mini54.z.enum(ALL_FEATURES_WITH_WILDCARD))),
15339
+ ref: import_mini54.z.optional(import_mini54.z.string()),
15340
+ path: import_mini54.z.optional(import_mini54.z.string()),
15341
+ output: import_mini54.z.optional(import_mini54.z.string()),
15342
+ conflict: import_mini54.z.optional(ConflictStrategySchema),
15343
+ token: import_mini54.z.optional(import_mini54.z.string()),
15344
+ verbose: import_mini54.z.optional(import_mini54.z.boolean()),
15345
+ silent: import_mini54.z.optional(import_mini54.z.boolean())
15094
15346
  });
15095
- var FetchFileStatusSchema = import_mini53.z.enum(["created", "overwritten", "skipped"]);
15096
- var GitHubRepoInfoSchema = import_mini53.z.looseObject({
15097
- default_branch: import_mini53.z.string(),
15098
- private: import_mini53.z.boolean()
15347
+ var FetchFileStatusSchema = import_mini54.z.enum(["created", "overwritten", "skipped"]);
15348
+ var GitHubRepoInfoSchema = import_mini54.z.looseObject({
15349
+ default_branch: import_mini54.z.string(),
15350
+ private: import_mini54.z.boolean()
15099
15351
  });
15100
- var GitHubReleaseAssetSchema = import_mini53.z.looseObject({
15101
- name: import_mini53.z.string(),
15102
- browser_download_url: import_mini53.z.string(),
15103
- size: import_mini53.z.number()
15352
+ var GitHubReleaseAssetSchema = import_mini54.z.looseObject({
15353
+ name: import_mini54.z.string(),
15354
+ browser_download_url: import_mini54.z.string(),
15355
+ size: import_mini54.z.number()
15104
15356
  });
15105
- var GitHubReleaseSchema = import_mini53.z.looseObject({
15106
- tag_name: import_mini53.z.string(),
15107
- name: import_mini53.z.nullable(import_mini53.z.string()),
15108
- prerelease: import_mini53.z.boolean(),
15109
- draft: import_mini53.z.boolean(),
15110
- assets: import_mini53.z.array(GitHubReleaseAssetSchema)
15357
+ var GitHubReleaseSchema = import_mini54.z.looseObject({
15358
+ tag_name: import_mini54.z.string(),
15359
+ name: import_mini54.z.nullable(import_mini54.z.string()),
15360
+ prerelease: import_mini54.z.boolean(),
15361
+ draft: import_mini54.z.boolean(),
15362
+ assets: import_mini54.z.array(GitHubReleaseAssetSchema)
15111
15363
  });
15112
15364
 
15113
15365
  // src/lib/github-client.ts
@@ -15407,9 +15659,9 @@ async function listDirectoryRecursive(params) {
15407
15659
  }
15408
15660
 
15409
15661
  // src/types/git-provider.ts
15410
- var import_mini54 = require("zod/mini");
15662
+ var import_mini55 = require("zod/mini");
15411
15663
  var ALL_GIT_PROVIDERS = ["github", "gitlab"];
15412
- var GitProviderSchema = import_mini54.z.enum(ALL_GIT_PROVIDERS);
15664
+ var GitProviderSchema = import_mini55.z.enum(ALL_GIT_PROVIDERS);
15413
15665
 
15414
15666
  // src/lib/source-parser.ts
15415
15667
  var GITHUB_HOSTS = /* @__PURE__ */ new Set(["github.com", "www.github.com"]);
@@ -15534,8 +15786,8 @@ async function processFeatureConversion(params) {
15534
15786
  }
15535
15787
  const rulesyncFiles = await processor.convertToolFilesToRulesyncFiles(toolFiles);
15536
15788
  for (const file of rulesyncFiles) {
15537
- const relativePath = (0, import_node_path112.join)(file.getRelativeDirPath(), file.getRelativeFilePath());
15538
- const outputPath = (0, import_node_path112.join)(outputDir, relativePath);
15789
+ const relativePath = (0, import_node_path113.join)(file.getRelativeDirPath(), file.getRelativeFilePath());
15790
+ const outputPath = (0, import_node_path113.join)(outputDir, relativePath);
15539
15791
  await writeFileContent(outputPath, file.getFileContent());
15540
15792
  paths.push(relativePath);
15541
15793
  }
@@ -15681,7 +15933,7 @@ async function fetchFiles(params) {
15681
15933
  skipped: 0
15682
15934
  };
15683
15935
  }
15684
- const outputBasePath = (0, import_node_path112.join)(baseDir, outputDir);
15936
+ const outputBasePath = (0, import_node_path113.join)(baseDir, outputDir);
15685
15937
  for (const { relativePath, size } of filesToFetch) {
15686
15938
  checkPathTraversal({
15687
15939
  relativePath,
@@ -15691,7 +15943,7 @@ async function fetchFiles(params) {
15691
15943
  }
15692
15944
  const results = await Promise.all(
15693
15945
  filesToFetch.map(async ({ remotePath, relativePath }) => {
15694
- const localPath = (0, import_node_path112.join)(outputBasePath, relativePath);
15946
+ const localPath = (0, import_node_path113.join)(outputBasePath, relativePath);
15695
15947
  const exists = await fileExists(localPath);
15696
15948
  if (exists && conflictStrategy === "skip") {
15697
15949
  logger.debug(`Skipping existing file: ${relativePath}`);
@@ -15733,7 +15985,7 @@ async function collectFeatureFiles(params) {
15733
15985
  );
15734
15986
  const results = await Promise.all(
15735
15987
  tasks.map(async ({ featurePath }) => {
15736
- const fullPath = basePath === "." || basePath === "" ? featurePath : (0, import_node_path112.join)(basePath, featurePath);
15988
+ const fullPath = basePath === "." || basePath === "" ? featurePath : (0, import_node_path113.join)(basePath, featurePath);
15737
15989
  const collected = [];
15738
15990
  try {
15739
15991
  if (featurePath.includes(".")) {
@@ -15833,7 +16085,7 @@ async function fetchAndConvertToolFiles(params) {
15833
16085
  relativePath: toolRelativePath,
15834
16086
  intendedRootDir: tempDir
15835
16087
  });
15836
- const localPath = (0, import_node_path112.join)(tempDir, toolRelativePath);
16088
+ const localPath = (0, import_node_path113.join)(tempDir, toolRelativePath);
15837
16089
  const content = await withSemaphore(
15838
16090
  semaphore,
15839
16091
  () => client.getFileContent(parsed.owner, parsed.repo, remotePath, ref)
@@ -15842,7 +16094,7 @@ async function fetchAndConvertToolFiles(params) {
15842
16094
  logger.debug(`Fetched to temp: ${toolRelativePath}`);
15843
16095
  })
15844
16096
  );
15845
- const outputBasePath = (0, import_node_path112.join)(baseDir, outputDir);
16097
+ const outputBasePath = (0, import_node_path113.join)(baseDir, outputDir);
15846
16098
  const { converted, convertedPaths } = await convertFetchedFilesToRulesync({
15847
16099
  tempDir,
15848
16100
  outputDir: outputBasePath,
@@ -15915,7 +16167,7 @@ function mapToToolPath(relativePath, toolPaths) {
15915
16167
  if (relativePath.startsWith("rules/")) {
15916
16168
  const restPath = relativePath.substring("rules/".length);
15917
16169
  if (toolPaths.rules?.nonRoot) {
15918
- return (0, import_node_path112.join)(toolPaths.rules.nonRoot, restPath);
16170
+ return (0, import_node_path113.join)(toolPaths.rules.nonRoot, restPath);
15919
16171
  }
15920
16172
  }
15921
16173
  if (toolPaths.rules?.root && relativePath === toolPaths.rules.root) {
@@ -15924,19 +16176,19 @@ function mapToToolPath(relativePath, toolPaths) {
15924
16176
  if (relativePath.startsWith("commands/")) {
15925
16177
  const restPath = relativePath.substring("commands/".length);
15926
16178
  if (toolPaths.commands) {
15927
- return (0, import_node_path112.join)(toolPaths.commands, restPath);
16179
+ return (0, import_node_path113.join)(toolPaths.commands, restPath);
15928
16180
  }
15929
16181
  }
15930
16182
  if (relativePath.startsWith("subagents/")) {
15931
16183
  const restPath = relativePath.substring("subagents/".length);
15932
16184
  if (toolPaths.subagents) {
15933
- return (0, import_node_path112.join)(toolPaths.subagents, restPath);
16185
+ return (0, import_node_path113.join)(toolPaths.subagents, restPath);
15934
16186
  }
15935
16187
  }
15936
16188
  if (relativePath.startsWith("skills/")) {
15937
16189
  const restPath = relativePath.substring("skills/".length);
15938
16190
  if (toolPaths.skills) {
15939
- return (0, import_node_path112.join)(toolPaths.skills, restPath);
16191
+ return (0, import_node_path113.join)(toolPaths.skills, restPath);
15940
16192
  }
15941
16193
  }
15942
16194
  return relativePath;
@@ -15988,38 +16240,38 @@ async function fetchCommand(options) {
15988
16240
  }
15989
16241
 
15990
16242
  // src/config/config-resolver.ts
15991
- var import_node_path113 = require("path");
16243
+ var import_node_path114 = require("path");
15992
16244
  var import_jsonc_parser = require("jsonc-parser");
15993
16245
 
15994
16246
  // src/config/config.ts
15995
- var import_mini55 = require("zod/mini");
15996
- var SourceEntrySchema = import_mini55.z.object({
15997
- source: import_mini55.z.string().check((0, import_mini55.minLength)(1, "source must be a non-empty string")),
15998
- skills: (0, import_mini55.optional)(import_mini55.z.array(import_mini55.z.string()))
16247
+ var import_mini56 = require("zod/mini");
16248
+ var SourceEntrySchema = import_mini56.z.object({
16249
+ source: import_mini56.z.string().check((0, import_mini56.minLength)(1, "source must be a non-empty string")),
16250
+ skills: (0, import_mini56.optional)(import_mini56.z.array(import_mini56.z.string()))
15999
16251
  });
16000
- var ConfigParamsSchema = import_mini55.z.object({
16001
- baseDirs: import_mini55.z.array(import_mini55.z.string()),
16252
+ var ConfigParamsSchema = import_mini56.z.object({
16253
+ baseDirs: import_mini56.z.array(import_mini56.z.string()),
16002
16254
  targets: RulesyncTargetsSchema,
16003
16255
  features: RulesyncFeaturesSchema,
16004
- verbose: import_mini55.z.boolean(),
16005
- delete: import_mini55.z.boolean(),
16256
+ verbose: import_mini56.z.boolean(),
16257
+ delete: import_mini56.z.boolean(),
16006
16258
  // New non-experimental options
16007
- global: (0, import_mini55.optional)(import_mini55.z.boolean()),
16008
- silent: (0, import_mini55.optional)(import_mini55.z.boolean()),
16009
- simulateCommands: (0, import_mini55.optional)(import_mini55.z.boolean()),
16010
- simulateSubagents: (0, import_mini55.optional)(import_mini55.z.boolean()),
16011
- simulateSkills: (0, import_mini55.optional)(import_mini55.z.boolean()),
16012
- dryRun: (0, import_mini55.optional)(import_mini55.z.boolean()),
16013
- check: (0, import_mini55.optional)(import_mini55.z.boolean()),
16259
+ global: (0, import_mini56.optional)(import_mini56.z.boolean()),
16260
+ silent: (0, import_mini56.optional)(import_mini56.z.boolean()),
16261
+ simulateCommands: (0, import_mini56.optional)(import_mini56.z.boolean()),
16262
+ simulateSubagents: (0, import_mini56.optional)(import_mini56.z.boolean()),
16263
+ simulateSkills: (0, import_mini56.optional)(import_mini56.z.boolean()),
16264
+ dryRun: (0, import_mini56.optional)(import_mini56.z.boolean()),
16265
+ check: (0, import_mini56.optional)(import_mini56.z.boolean()),
16014
16266
  // Declarative skill sources
16015
- sources: (0, import_mini55.optional)(import_mini55.z.array(SourceEntrySchema))
16267
+ sources: (0, import_mini56.optional)(import_mini56.z.array(SourceEntrySchema))
16016
16268
  });
16017
- var PartialConfigParamsSchema = import_mini55.z.partial(ConfigParamsSchema);
16018
- var ConfigFileSchema = import_mini55.z.object({
16019
- $schema: (0, import_mini55.optional)(import_mini55.z.string()),
16020
- ...import_mini55.z.partial(ConfigParamsSchema).shape
16269
+ var PartialConfigParamsSchema = import_mini56.z.partial(ConfigParamsSchema);
16270
+ var ConfigFileSchema = import_mini56.z.object({
16271
+ $schema: (0, import_mini56.optional)(import_mini56.z.string()),
16272
+ ...import_mini56.z.partial(ConfigParamsSchema).shape
16021
16273
  });
16022
- var RequiredConfigParamsSchema = import_mini55.z.required(ConfigParamsSchema);
16274
+ var RequiredConfigParamsSchema = import_mini56.z.required(ConfigParamsSchema);
16023
16275
  var CONFLICTING_TARGET_PAIRS = [
16024
16276
  ["augmentcode", "augmentcode-legacy"],
16025
16277
  ["claudecode", "claudecode-legacy"]
@@ -16240,8 +16492,8 @@ var ConfigResolver = class {
16240
16492
  }) {
16241
16493
  const validatedConfigPath = resolvePath(configPath, process.cwd());
16242
16494
  const baseConfig = await loadConfigFromFile(validatedConfigPath);
16243
- const configDir = (0, import_node_path113.dirname)(validatedConfigPath);
16244
- const localConfigPath = (0, import_node_path113.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
16495
+ const configDir = (0, import_node_path114.dirname)(validatedConfigPath);
16496
+ const localConfigPath = (0, import_node_path114.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
16245
16497
  const localConfig = await loadConfigFromFile(localConfigPath);
16246
16498
  const configByFile = mergeConfigs(baseConfig, localConfig);
16247
16499
  const resolvedGlobal = global ?? configByFile.global ?? getDefaults().global;
@@ -16276,7 +16528,7 @@ function getBaseDirsInLightOfGlobal({
16276
16528
  if (global) {
16277
16529
  return [getHomeDirectory()];
16278
16530
  }
16279
- const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path113.resolve)(baseDir));
16531
+ const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path114.resolve)(baseDir));
16280
16532
  resolvedBaseDirs.forEach((baseDir) => {
16281
16533
  validateBaseDir(baseDir);
16282
16534
  });
@@ -16284,7 +16536,7 @@ function getBaseDirsInLightOfGlobal({
16284
16536
  }
16285
16537
 
16286
16538
  // src/lib/generate.ts
16287
- var import_node_path114 = require("path");
16539
+ var import_node_path115 = require("path");
16288
16540
  var import_es_toolkit4 = require("es-toolkit");
16289
16541
  async function processFeatureGeneration(params) {
16290
16542
  const { config, processor, toolFiles } = params;
@@ -16330,7 +16582,7 @@ async function processEmptyFeatureGeneration(params) {
16330
16582
  return { count: totalCount, paths: [], hasDiff };
16331
16583
  }
16332
16584
  async function checkRulesyncDirExists(params) {
16333
- return fileExists((0, import_node_path114.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16585
+ return fileExists((0, import_node_path115.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16334
16586
  }
16335
16587
  async function generate(params) {
16336
16588
  const { config } = params;
@@ -16776,7 +17028,7 @@ async function generateCommand(options) {
16776
17028
  }
16777
17029
 
16778
17030
  // src/cli/commands/gitignore.ts
16779
- var import_node_path115 = require("path");
17031
+ var import_node_path116 = require("path");
16780
17032
  var RULESYNC_HEADER = "# Generated by Rulesync";
16781
17033
  var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
16782
17034
  var RULESYNC_IGNORE_ENTRIES = [
@@ -16931,7 +17183,7 @@ var removeExistingRulesyncEntries = (content) => {
16931
17183
  return result;
16932
17184
  };
16933
17185
  var gitignoreCommand = async () => {
16934
- const gitignorePath = (0, import_node_path115.join)(process.cwd(), ".gitignore");
17186
+ const gitignorePath = (0, import_node_path116.join)(process.cwd(), ".gitignore");
16935
17187
  let gitignoreContent = "";
16936
17188
  if (await fileExists(gitignorePath)) {
16937
17189
  gitignoreContent = await readFileContent(gitignorePath);
@@ -17211,7 +17463,7 @@ async function importCommand(options) {
17211
17463
  }
17212
17464
 
17213
17465
  // src/lib/init.ts
17214
- var import_node_path116 = require("path");
17466
+ var import_node_path117 = require("path");
17215
17467
  async function init() {
17216
17468
  const sampleFiles = await createSampleFiles();
17217
17469
  const configFile = await createConfigFile();
@@ -17401,27 +17653,27 @@ Keep the summary concise and ready to reuse in future tasks.`
17401
17653
  await ensureDir(subagentPaths.relativeDirPath);
17402
17654
  await ensureDir(skillPaths.relativeDirPath);
17403
17655
  await ensureDir(ignorePaths.recommended.relativeDirPath);
17404
- const ruleFilepath = (0, import_node_path116.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
17656
+ const ruleFilepath = (0, import_node_path117.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
17405
17657
  results.push(await writeIfNotExists(ruleFilepath, sampleRuleFile.content));
17406
- const mcpFilepath = (0, import_node_path116.join)(
17658
+ const mcpFilepath = (0, import_node_path117.join)(
17407
17659
  mcpPaths.recommended.relativeDirPath,
17408
17660
  mcpPaths.recommended.relativeFilePath
17409
17661
  );
17410
17662
  results.push(await writeIfNotExists(mcpFilepath, sampleMcpFile.content));
17411
- const commandFilepath = (0, import_node_path116.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
17663
+ const commandFilepath = (0, import_node_path117.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
17412
17664
  results.push(await writeIfNotExists(commandFilepath, sampleCommandFile.content));
17413
- const subagentFilepath = (0, import_node_path116.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
17665
+ const subagentFilepath = (0, import_node_path117.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
17414
17666
  results.push(await writeIfNotExists(subagentFilepath, sampleSubagentFile.content));
17415
- const skillDirPath = (0, import_node_path116.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
17667
+ const skillDirPath = (0, import_node_path117.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
17416
17668
  await ensureDir(skillDirPath);
17417
- const skillFilepath = (0, import_node_path116.join)(skillDirPath, SKILL_FILE_NAME);
17669
+ const skillFilepath = (0, import_node_path117.join)(skillDirPath, SKILL_FILE_NAME);
17418
17670
  results.push(await writeIfNotExists(skillFilepath, sampleSkillFile.content));
17419
- const ignoreFilepath = (0, import_node_path116.join)(
17671
+ const ignoreFilepath = (0, import_node_path117.join)(
17420
17672
  ignorePaths.recommended.relativeDirPath,
17421
17673
  ignorePaths.recommended.relativeFilePath
17422
17674
  );
17423
17675
  results.push(await writeIfNotExists(ignoreFilepath, sampleIgnoreFile.content));
17424
- const hooksFilepath = (0, import_node_path116.join)(hooksPaths.relativeDirPath, hooksPaths.relativeFilePath);
17676
+ const hooksFilepath = (0, import_node_path117.join)(hooksPaths.relativeDirPath, hooksPaths.relativeFilePath);
17425
17677
  results.push(await writeIfNotExists(hooksFilepath, sampleHooksFile.content));
17426
17678
  return results;
17427
17679
  }
@@ -17459,33 +17711,33 @@ async function initCommand() {
17459
17711
  }
17460
17712
 
17461
17713
  // src/lib/sources.ts
17462
- var import_node_path118 = require("path");
17714
+ var import_node_path119 = require("path");
17463
17715
  var import_promise2 = require("es-toolkit/promise");
17464
17716
 
17465
17717
  // src/lib/sources-lock.ts
17466
17718
  var import_node_crypto = require("crypto");
17467
- var import_node_path117 = require("path");
17468
- var import_mini56 = require("zod/mini");
17719
+ var import_node_path118 = require("path");
17720
+ var import_mini57 = require("zod/mini");
17469
17721
  var LOCKFILE_VERSION = 1;
17470
- var LockedSkillSchema = import_mini56.z.object({
17471
- integrity: import_mini56.z.string()
17722
+ var LockedSkillSchema = import_mini57.z.object({
17723
+ integrity: import_mini57.z.string()
17472
17724
  });
17473
- var LockedSourceSchema = import_mini56.z.object({
17474
- requestedRef: (0, import_mini56.optional)(import_mini56.z.string()),
17475
- resolvedRef: import_mini56.z.string(),
17476
- resolvedAt: (0, import_mini56.optional)(import_mini56.z.string()),
17477
- skills: import_mini56.z.record(import_mini56.z.string(), LockedSkillSchema)
17725
+ var LockedSourceSchema = import_mini57.z.object({
17726
+ requestedRef: (0, import_mini57.optional)(import_mini57.z.string()),
17727
+ resolvedRef: import_mini57.z.string(),
17728
+ resolvedAt: (0, import_mini57.optional)(import_mini57.z.string()),
17729
+ skills: import_mini57.z.record(import_mini57.z.string(), LockedSkillSchema)
17478
17730
  });
17479
- var SourcesLockSchema = import_mini56.z.object({
17480
- lockfileVersion: import_mini56.z.number(),
17481
- sources: import_mini56.z.record(import_mini56.z.string(), LockedSourceSchema)
17731
+ var SourcesLockSchema = import_mini57.z.object({
17732
+ lockfileVersion: import_mini57.z.number(),
17733
+ sources: import_mini57.z.record(import_mini57.z.string(), LockedSourceSchema)
17482
17734
  });
17483
- var LegacyLockedSourceSchema = import_mini56.z.object({
17484
- resolvedRef: import_mini56.z.string(),
17485
- skills: import_mini56.z.array(import_mini56.z.string())
17735
+ var LegacyLockedSourceSchema = import_mini57.z.object({
17736
+ resolvedRef: import_mini57.z.string(),
17737
+ skills: import_mini57.z.array(import_mini57.z.string())
17486
17738
  });
17487
- var LegacySourcesLockSchema = import_mini56.z.object({
17488
- sources: import_mini56.z.record(import_mini56.z.string(), LegacyLockedSourceSchema)
17739
+ var LegacySourcesLockSchema = import_mini57.z.object({
17740
+ sources: import_mini57.z.record(import_mini57.z.string(), LegacyLockedSourceSchema)
17489
17741
  });
17490
17742
  function migrateLegacyLock(legacy) {
17491
17743
  const sources = {};
@@ -17508,7 +17760,7 @@ function createEmptyLock() {
17508
17760
  return { lockfileVersion: LOCKFILE_VERSION, sources: {} };
17509
17761
  }
17510
17762
  async function readLockFile(params) {
17511
- const lockPath = (0, import_node_path117.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17763
+ const lockPath = (0, import_node_path118.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17512
17764
  if (!await fileExists(lockPath)) {
17513
17765
  logger.debug("No sources lockfile found, starting fresh.");
17514
17766
  return createEmptyLock();
@@ -17536,7 +17788,7 @@ async function readLockFile(params) {
17536
17788
  }
17537
17789
  }
17538
17790
  async function writeLockFile(params) {
17539
- const lockPath = (0, import_node_path117.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17791
+ const lockPath = (0, import_node_path118.join)(params.baseDir, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH);
17540
17792
  const content = JSON.stringify(params.lock, null, 2) + "\n";
17541
17793
  await writeFileContent(lockPath, content);
17542
17794
  logger.debug(`Wrote sources lockfile to ${lockPath}`);
@@ -17677,7 +17929,7 @@ async function resolveAndFetchSources(params) {
17677
17929
  async function checkLockedSkillsExist(curatedDir, skillNames) {
17678
17930
  if (skillNames.length === 0) return true;
17679
17931
  for (const name of skillNames) {
17680
- if (!await directoryExists((0, import_node_path118.join)(curatedDir, name))) {
17932
+ if (!await directoryExists((0, import_node_path119.join)(curatedDir, name))) {
17681
17933
  return false;
17682
17934
  }
17683
17935
  }
@@ -17707,7 +17959,7 @@ async function fetchSource(params) {
17707
17959
  ref = resolvedSha;
17708
17960
  logger.debug(`Resolved ${sourceKey} ref "${requestedRef}" to SHA: ${resolvedSha}`);
17709
17961
  }
17710
- const curatedDir = (0, import_node_path118.join)(baseDir, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
17962
+ const curatedDir = (0, import_node_path119.join)(baseDir, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
17711
17963
  if (locked && resolvedSha === locked.resolvedRef && !updateSources) {
17712
17964
  const allExist = await checkLockedSkillsExist(curatedDir, lockedSkillNames);
17713
17965
  if (allExist) {
@@ -17737,10 +17989,10 @@ async function fetchSource(params) {
17737
17989
  const semaphore = new import_promise2.Semaphore(FETCH_CONCURRENCY_LIMIT);
17738
17990
  const fetchedSkills = {};
17739
17991
  if (locked) {
17740
- const resolvedCuratedDir = (0, import_node_path118.resolve)(curatedDir);
17992
+ const resolvedCuratedDir = (0, import_node_path119.resolve)(curatedDir);
17741
17993
  for (const prevSkill of lockedSkillNames) {
17742
- const prevDir = (0, import_node_path118.join)(curatedDir, prevSkill);
17743
- if (!(0, import_node_path118.resolve)(prevDir).startsWith(resolvedCuratedDir + import_node_path118.sep)) {
17994
+ const prevDir = (0, import_node_path119.join)(curatedDir, prevSkill);
17995
+ if (!(0, import_node_path119.resolve)(prevDir).startsWith(resolvedCuratedDir + import_node_path119.sep)) {
17744
17996
  logger.warn(
17745
17997
  `Skipping removal of "${prevSkill}": resolved path is outside the curated directory.`
17746
17998
  );
@@ -17790,10 +18042,10 @@ async function fetchSource(params) {
17790
18042
  const skillFiles = [];
17791
18043
  for (const file of files) {
17792
18044
  const relativeToSkill = file.path.substring(skillDir.path.length + 1);
17793
- const localFilePath = (0, import_node_path118.join)(curatedDir, skillDir.name, relativeToSkill);
18045
+ const localFilePath = (0, import_node_path119.join)(curatedDir, skillDir.name, relativeToSkill);
17794
18046
  checkPathTraversal({
17795
18047
  relativePath: relativeToSkill,
17796
- intendedRootDir: (0, import_node_path118.join)(curatedDir, skillDir.name)
18048
+ intendedRootDir: (0, import_node_path119.join)(curatedDir, skillDir.name)
17797
18049
  });
17798
18050
  const content = await withSemaphore(
17799
18051
  semaphore,
@@ -17876,15 +18128,15 @@ async function installCommand(options) {
17876
18128
  var import_fastmcp = require("fastmcp");
17877
18129
 
17878
18130
  // src/mcp/tools.ts
17879
- var import_mini65 = require("zod/mini");
18131
+ var import_mini66 = require("zod/mini");
17880
18132
 
17881
18133
  // src/mcp/commands.ts
17882
- var import_node_path119 = require("path");
17883
- var import_mini57 = require("zod/mini");
18134
+ var import_node_path120 = require("path");
18135
+ var import_mini58 = require("zod/mini");
17884
18136
  var maxCommandSizeBytes = 1024 * 1024;
17885
18137
  var maxCommandsCount = 1e3;
17886
18138
  async function listCommands() {
17887
- const commandsDir = (0, import_node_path119.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18139
+ const commandsDir = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
17888
18140
  try {
17889
18141
  const files = await listDirectoryFiles(commandsDir);
17890
18142
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -17900,7 +18152,7 @@ async function listCommands() {
17900
18152
  });
17901
18153
  const frontmatter = command.getFrontmatter();
17902
18154
  return {
17903
- relativePathFromCwd: (0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
18155
+ relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
17904
18156
  frontmatter
17905
18157
  };
17906
18158
  } catch (error) {
@@ -17922,13 +18174,13 @@ async function getCommand({ relativePathFromCwd }) {
17922
18174
  relativePath: relativePathFromCwd,
17923
18175
  intendedRootDir: process.cwd()
17924
18176
  });
17925
- const filename = (0, import_node_path119.basename)(relativePathFromCwd);
18177
+ const filename = (0, import_node_path120.basename)(relativePathFromCwd);
17926
18178
  try {
17927
18179
  const command = await RulesyncCommand.fromFile({
17928
18180
  relativeFilePath: filename
17929
18181
  });
17930
18182
  return {
17931
- relativePathFromCwd: (0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18183
+ relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
17932
18184
  frontmatter: command.getFrontmatter(),
17933
18185
  body: command.getBody()
17934
18186
  };
@@ -17947,7 +18199,7 @@ async function putCommand({
17947
18199
  relativePath: relativePathFromCwd,
17948
18200
  intendedRootDir: process.cwd()
17949
18201
  });
17950
- const filename = (0, import_node_path119.basename)(relativePathFromCwd);
18202
+ const filename = (0, import_node_path120.basename)(relativePathFromCwd);
17951
18203
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
17952
18204
  if (estimatedSize > maxCommandSizeBytes) {
17953
18205
  throw new Error(
@@ -17957,7 +18209,7 @@ async function putCommand({
17957
18209
  try {
17958
18210
  const existingCommands = await listCommands();
17959
18211
  const isUpdate = existingCommands.some(
17960
- (command2) => command2.relativePathFromCwd === (0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18212
+ (command2) => command2.relativePathFromCwd === (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
17961
18213
  );
17962
18214
  if (!isUpdate && existingCommands.length >= maxCommandsCount) {
17963
18215
  throw new Error(
@@ -17974,11 +18226,11 @@ async function putCommand({
17974
18226
  fileContent,
17975
18227
  validate: true
17976
18228
  });
17977
- const commandsDir = (0, import_node_path119.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
18229
+ const commandsDir = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
17978
18230
  await ensureDir(commandsDir);
17979
18231
  await writeFileContent(command.getFilePath(), command.getFileContent());
17980
18232
  return {
17981
- relativePathFromCwd: (0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
18233
+ relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
17982
18234
  frontmatter: command.getFrontmatter(),
17983
18235
  body: command.getBody()
17984
18236
  };
@@ -17993,12 +18245,12 @@ async function deleteCommand({ relativePathFromCwd }) {
17993
18245
  relativePath: relativePathFromCwd,
17994
18246
  intendedRootDir: process.cwd()
17995
18247
  });
17996
- const filename = (0, import_node_path119.basename)(relativePathFromCwd);
17997
- const fullPath = (0, import_node_path119.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
18248
+ const filename = (0, import_node_path120.basename)(relativePathFromCwd);
18249
+ const fullPath = (0, import_node_path120.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
17998
18250
  try {
17999
18251
  await removeFile(fullPath);
18000
18252
  return {
18001
- relativePathFromCwd: (0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18253
+ relativePathFromCwd: (0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
18002
18254
  };
18003
18255
  } catch (error) {
18004
18256
  throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
@@ -18007,23 +18259,23 @@ async function deleteCommand({ relativePathFromCwd }) {
18007
18259
  }
18008
18260
  }
18009
18261
  var commandToolSchemas = {
18010
- listCommands: import_mini57.z.object({}),
18011
- getCommand: import_mini57.z.object({
18012
- relativePathFromCwd: import_mini57.z.string()
18262
+ listCommands: import_mini58.z.object({}),
18263
+ getCommand: import_mini58.z.object({
18264
+ relativePathFromCwd: import_mini58.z.string()
18013
18265
  }),
18014
- putCommand: import_mini57.z.object({
18015
- relativePathFromCwd: import_mini57.z.string(),
18266
+ putCommand: import_mini58.z.object({
18267
+ relativePathFromCwd: import_mini58.z.string(),
18016
18268
  frontmatter: RulesyncCommandFrontmatterSchema,
18017
- body: import_mini57.z.string()
18269
+ body: import_mini58.z.string()
18018
18270
  }),
18019
- deleteCommand: import_mini57.z.object({
18020
- relativePathFromCwd: import_mini57.z.string()
18271
+ deleteCommand: import_mini58.z.object({
18272
+ relativePathFromCwd: import_mini58.z.string()
18021
18273
  })
18022
18274
  };
18023
18275
  var commandTools = {
18024
18276
  listCommands: {
18025
18277
  name: "listCommands",
18026
- description: `List all commands from ${(0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18278
+ description: `List all commands from ${(0, import_node_path120.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18027
18279
  parameters: commandToolSchemas.listCommands,
18028
18280
  execute: async () => {
18029
18281
  const commands = await listCommands();
@@ -18065,15 +18317,15 @@ var commandTools = {
18065
18317
  };
18066
18318
 
18067
18319
  // src/mcp/generate.ts
18068
- var import_mini58 = require("zod/mini");
18069
- var generateOptionsSchema = import_mini58.z.object({
18070
- targets: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string())),
18071
- features: import_mini58.z.optional(import_mini58.z.array(import_mini58.z.string())),
18072
- delete: import_mini58.z.optional(import_mini58.z.boolean()),
18073
- global: import_mini58.z.optional(import_mini58.z.boolean()),
18074
- simulateCommands: import_mini58.z.optional(import_mini58.z.boolean()),
18075
- simulateSubagents: import_mini58.z.optional(import_mini58.z.boolean()),
18076
- simulateSkills: import_mini58.z.optional(import_mini58.z.boolean())
18320
+ var import_mini59 = require("zod/mini");
18321
+ var generateOptionsSchema = import_mini59.z.object({
18322
+ targets: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string())),
18323
+ features: import_mini59.z.optional(import_mini59.z.array(import_mini59.z.string())),
18324
+ delete: import_mini59.z.optional(import_mini59.z.boolean()),
18325
+ global: import_mini59.z.optional(import_mini59.z.boolean()),
18326
+ simulateCommands: import_mini59.z.optional(import_mini59.z.boolean()),
18327
+ simulateSubagents: import_mini59.z.optional(import_mini59.z.boolean()),
18328
+ simulateSkills: import_mini59.z.optional(import_mini59.z.boolean())
18077
18329
  });
18078
18330
  async function executeGenerate(options = {}) {
18079
18331
  try {
@@ -18150,11 +18402,11 @@ var generateTools = {
18150
18402
  };
18151
18403
 
18152
18404
  // src/mcp/ignore.ts
18153
- var import_node_path120 = require("path");
18154
- var import_mini59 = require("zod/mini");
18405
+ var import_node_path121 = require("path");
18406
+ var import_mini60 = require("zod/mini");
18155
18407
  var maxIgnoreFileSizeBytes = 100 * 1024;
18156
18408
  async function getIgnoreFile() {
18157
- const ignoreFilePath = (0, import_node_path120.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18409
+ const ignoreFilePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18158
18410
  try {
18159
18411
  const content = await readFileContent(ignoreFilePath);
18160
18412
  return {
@@ -18171,7 +18423,7 @@ async function getIgnoreFile() {
18171
18423
  }
18172
18424
  }
18173
18425
  async function putIgnoreFile({ content }) {
18174
- const ignoreFilePath = (0, import_node_path120.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18426
+ const ignoreFilePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18175
18427
  const contentSizeBytes = Buffer.byteLength(content, "utf8");
18176
18428
  if (contentSizeBytes > maxIgnoreFileSizeBytes) {
18177
18429
  throw new Error(
@@ -18195,8 +18447,8 @@ async function putIgnoreFile({ content }) {
18195
18447
  }
18196
18448
  }
18197
18449
  async function deleteIgnoreFile() {
18198
- const aiignorePath = (0, import_node_path120.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18199
- const legacyIgnorePath = (0, import_node_path120.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
18450
+ const aiignorePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
18451
+ const legacyIgnorePath = (0, import_node_path121.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
18200
18452
  try {
18201
18453
  await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
18202
18454
  return {
@@ -18214,11 +18466,11 @@ async function deleteIgnoreFile() {
18214
18466
  }
18215
18467
  }
18216
18468
  var ignoreToolSchemas = {
18217
- getIgnoreFile: import_mini59.z.object({}),
18218
- putIgnoreFile: import_mini59.z.object({
18219
- content: import_mini59.z.string()
18469
+ getIgnoreFile: import_mini60.z.object({}),
18470
+ putIgnoreFile: import_mini60.z.object({
18471
+ content: import_mini60.z.string()
18220
18472
  }),
18221
- deleteIgnoreFile: import_mini59.z.object({})
18473
+ deleteIgnoreFile: import_mini60.z.object({})
18222
18474
  };
18223
18475
  var ignoreTools = {
18224
18476
  getIgnoreFile: {
@@ -18251,11 +18503,11 @@ var ignoreTools = {
18251
18503
  };
18252
18504
 
18253
18505
  // src/mcp/import.ts
18254
- var import_mini60 = require("zod/mini");
18255
- var importOptionsSchema = import_mini60.z.object({
18256
- target: import_mini60.z.string(),
18257
- features: import_mini60.z.optional(import_mini60.z.array(import_mini60.z.string())),
18258
- global: import_mini60.z.optional(import_mini60.z.boolean())
18506
+ var import_mini61 = require("zod/mini");
18507
+ var importOptionsSchema = import_mini61.z.object({
18508
+ target: import_mini61.z.string(),
18509
+ features: import_mini61.z.optional(import_mini61.z.array(import_mini61.z.string())),
18510
+ global: import_mini61.z.optional(import_mini61.z.boolean())
18259
18511
  });
18260
18512
  async function executeImport(options) {
18261
18513
  try {
@@ -18324,15 +18576,15 @@ var importTools = {
18324
18576
  };
18325
18577
 
18326
18578
  // src/mcp/mcp.ts
18327
- var import_node_path121 = require("path");
18328
- var import_mini61 = require("zod/mini");
18579
+ var import_node_path122 = require("path");
18580
+ var import_mini62 = require("zod/mini");
18329
18581
  var maxMcpSizeBytes = 1024 * 1024;
18330
18582
  async function getMcpFile() {
18331
18583
  try {
18332
18584
  const rulesyncMcp = await RulesyncMcp.fromFile({
18333
18585
  validate: true
18334
18586
  });
18335
- const relativePathFromCwd = (0, import_node_path121.join)(
18587
+ const relativePathFromCwd = (0, import_node_path122.join)(
18336
18588
  rulesyncMcp.getRelativeDirPath(),
18337
18589
  rulesyncMcp.getRelativeFilePath()
18338
18590
  );
@@ -18370,7 +18622,7 @@ async function putMcpFile({ content }) {
18370
18622
  const paths = RulesyncMcp.getSettablePaths();
18371
18623
  const relativeDirPath = paths.recommended.relativeDirPath;
18372
18624
  const relativeFilePath = paths.recommended.relativeFilePath;
18373
- const fullPath = (0, import_node_path121.join)(baseDir, relativeDirPath, relativeFilePath);
18625
+ const fullPath = (0, import_node_path122.join)(baseDir, relativeDirPath, relativeFilePath);
18374
18626
  const rulesyncMcp = new RulesyncMcp({
18375
18627
  baseDir,
18376
18628
  relativeDirPath,
@@ -18378,9 +18630,9 @@ async function putMcpFile({ content }) {
18378
18630
  fileContent: content,
18379
18631
  validate: true
18380
18632
  });
18381
- await ensureDir((0, import_node_path121.join)(baseDir, relativeDirPath));
18633
+ await ensureDir((0, import_node_path122.join)(baseDir, relativeDirPath));
18382
18634
  await writeFileContent(fullPath, content);
18383
- const relativePathFromCwd = (0, import_node_path121.join)(relativeDirPath, relativeFilePath);
18635
+ const relativePathFromCwd = (0, import_node_path122.join)(relativeDirPath, relativeFilePath);
18384
18636
  return {
18385
18637
  relativePathFromCwd,
18386
18638
  content: rulesyncMcp.getFileContent()
@@ -18398,15 +18650,15 @@ async function deleteMcpFile() {
18398
18650
  try {
18399
18651
  const baseDir = process.cwd();
18400
18652
  const paths = RulesyncMcp.getSettablePaths();
18401
- const recommendedPath = (0, import_node_path121.join)(
18653
+ const recommendedPath = (0, import_node_path122.join)(
18402
18654
  baseDir,
18403
18655
  paths.recommended.relativeDirPath,
18404
18656
  paths.recommended.relativeFilePath
18405
18657
  );
18406
- const legacyPath = (0, import_node_path121.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
18658
+ const legacyPath = (0, import_node_path122.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
18407
18659
  await removeFile(recommendedPath);
18408
18660
  await removeFile(legacyPath);
18409
- const relativePathFromCwd = (0, import_node_path121.join)(
18661
+ const relativePathFromCwd = (0, import_node_path122.join)(
18410
18662
  paths.recommended.relativeDirPath,
18411
18663
  paths.recommended.relativeFilePath
18412
18664
  );
@@ -18423,11 +18675,11 @@ async function deleteMcpFile() {
18423
18675
  }
18424
18676
  }
18425
18677
  var mcpToolSchemas = {
18426
- getMcpFile: import_mini61.z.object({}),
18427
- putMcpFile: import_mini61.z.object({
18428
- content: import_mini61.z.string()
18678
+ getMcpFile: import_mini62.z.object({}),
18679
+ putMcpFile: import_mini62.z.object({
18680
+ content: import_mini62.z.string()
18429
18681
  }),
18430
- deleteMcpFile: import_mini61.z.object({})
18682
+ deleteMcpFile: import_mini62.z.object({})
18431
18683
  };
18432
18684
  var mcpTools = {
18433
18685
  getMcpFile: {
@@ -18460,12 +18712,12 @@ var mcpTools = {
18460
18712
  };
18461
18713
 
18462
18714
  // src/mcp/rules.ts
18463
- var import_node_path122 = require("path");
18464
- var import_mini62 = require("zod/mini");
18715
+ var import_node_path123 = require("path");
18716
+ var import_mini63 = require("zod/mini");
18465
18717
  var maxRuleSizeBytes = 1024 * 1024;
18466
18718
  var maxRulesCount = 1e3;
18467
18719
  async function listRules() {
18468
- const rulesDir = (0, import_node_path122.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18720
+ const rulesDir = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18469
18721
  try {
18470
18722
  const files = await listDirectoryFiles(rulesDir);
18471
18723
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -18478,7 +18730,7 @@ async function listRules() {
18478
18730
  });
18479
18731
  const frontmatter = rule.getFrontmatter();
18480
18732
  return {
18481
- relativePathFromCwd: (0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
18733
+ relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
18482
18734
  frontmatter
18483
18735
  };
18484
18736
  } catch (error) {
@@ -18500,14 +18752,14 @@ async function getRule({ relativePathFromCwd }) {
18500
18752
  relativePath: relativePathFromCwd,
18501
18753
  intendedRootDir: process.cwd()
18502
18754
  });
18503
- const filename = (0, import_node_path122.basename)(relativePathFromCwd);
18755
+ const filename = (0, import_node_path123.basename)(relativePathFromCwd);
18504
18756
  try {
18505
18757
  const rule = await RulesyncRule.fromFile({
18506
18758
  relativeFilePath: filename,
18507
18759
  validate: true
18508
18760
  });
18509
18761
  return {
18510
- relativePathFromCwd: (0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18762
+ relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18511
18763
  frontmatter: rule.getFrontmatter(),
18512
18764
  body: rule.getBody()
18513
18765
  };
@@ -18526,7 +18778,7 @@ async function putRule({
18526
18778
  relativePath: relativePathFromCwd,
18527
18779
  intendedRootDir: process.cwd()
18528
18780
  });
18529
- const filename = (0, import_node_path122.basename)(relativePathFromCwd);
18781
+ const filename = (0, import_node_path123.basename)(relativePathFromCwd);
18530
18782
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
18531
18783
  if (estimatedSize > maxRuleSizeBytes) {
18532
18784
  throw new Error(
@@ -18536,7 +18788,7 @@ async function putRule({
18536
18788
  try {
18537
18789
  const existingRules = await listRules();
18538
18790
  const isUpdate = existingRules.some(
18539
- (rule2) => rule2.relativePathFromCwd === (0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18791
+ (rule2) => rule2.relativePathFromCwd === (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18540
18792
  );
18541
18793
  if (!isUpdate && existingRules.length >= maxRulesCount) {
18542
18794
  throw new Error(
@@ -18551,11 +18803,11 @@ async function putRule({
18551
18803
  body,
18552
18804
  validate: true
18553
18805
  });
18554
- const rulesDir = (0, import_node_path122.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18806
+ const rulesDir = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18555
18807
  await ensureDir(rulesDir);
18556
18808
  await writeFileContent(rule.getFilePath(), rule.getFileContent());
18557
18809
  return {
18558
- relativePathFromCwd: (0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18810
+ relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
18559
18811
  frontmatter: rule.getFrontmatter(),
18560
18812
  body: rule.getBody()
18561
18813
  };
@@ -18570,12 +18822,12 @@ async function deleteRule({ relativePathFromCwd }) {
18570
18822
  relativePath: relativePathFromCwd,
18571
18823
  intendedRootDir: process.cwd()
18572
18824
  });
18573
- const filename = (0, import_node_path122.basename)(relativePathFromCwd);
18574
- const fullPath = (0, import_node_path122.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
18825
+ const filename = (0, import_node_path123.basename)(relativePathFromCwd);
18826
+ const fullPath = (0, import_node_path123.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
18575
18827
  try {
18576
18828
  await removeFile(fullPath);
18577
18829
  return {
18578
- relativePathFromCwd: (0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18830
+ relativePathFromCwd: (0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
18579
18831
  };
18580
18832
  } catch (error) {
18581
18833
  throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
@@ -18584,23 +18836,23 @@ async function deleteRule({ relativePathFromCwd }) {
18584
18836
  }
18585
18837
  }
18586
18838
  var ruleToolSchemas = {
18587
- listRules: import_mini62.z.object({}),
18588
- getRule: import_mini62.z.object({
18589
- relativePathFromCwd: import_mini62.z.string()
18839
+ listRules: import_mini63.z.object({}),
18840
+ getRule: import_mini63.z.object({
18841
+ relativePathFromCwd: import_mini63.z.string()
18590
18842
  }),
18591
- putRule: import_mini62.z.object({
18592
- relativePathFromCwd: import_mini62.z.string(),
18843
+ putRule: import_mini63.z.object({
18844
+ relativePathFromCwd: import_mini63.z.string(),
18593
18845
  frontmatter: RulesyncRuleFrontmatterSchema,
18594
- body: import_mini62.z.string()
18846
+ body: import_mini63.z.string()
18595
18847
  }),
18596
- deleteRule: import_mini62.z.object({
18597
- relativePathFromCwd: import_mini62.z.string()
18848
+ deleteRule: import_mini63.z.object({
18849
+ relativePathFromCwd: import_mini63.z.string()
18598
18850
  })
18599
18851
  };
18600
18852
  var ruleTools = {
18601
18853
  listRules: {
18602
18854
  name: "listRules",
18603
- description: `List all rules from ${(0, import_node_path122.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18855
+ description: `List all rules from ${(0, import_node_path123.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
18604
18856
  parameters: ruleToolSchemas.listRules,
18605
18857
  execute: async () => {
18606
18858
  const rules = await listRules();
@@ -18642,8 +18894,8 @@ var ruleTools = {
18642
18894
  };
18643
18895
 
18644
18896
  // src/mcp/skills.ts
18645
- var import_node_path123 = require("path");
18646
- var import_mini63 = require("zod/mini");
18897
+ var import_node_path124 = require("path");
18898
+ var import_mini64 = require("zod/mini");
18647
18899
  var maxSkillSizeBytes = 1024 * 1024;
18648
18900
  var maxSkillsCount = 1e3;
18649
18901
  function aiDirFileToMcpSkillFile(file) {
@@ -18659,19 +18911,19 @@ function mcpSkillFileToAiDirFile(file) {
18659
18911
  };
18660
18912
  }
18661
18913
  function extractDirName(relativeDirPathFromCwd) {
18662
- const dirName = (0, import_node_path123.basename)(relativeDirPathFromCwd);
18914
+ const dirName = (0, import_node_path124.basename)(relativeDirPathFromCwd);
18663
18915
  if (!dirName) {
18664
18916
  throw new Error(`Invalid path: ${relativeDirPathFromCwd}`);
18665
18917
  }
18666
18918
  return dirName;
18667
18919
  }
18668
18920
  async function listSkills() {
18669
- const skillsDir = (0, import_node_path123.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
18921
+ const skillsDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
18670
18922
  try {
18671
- const skillDirPaths = await findFilesByGlobs((0, import_node_path123.join)(skillsDir, "*"), { type: "dir" });
18923
+ const skillDirPaths = await findFilesByGlobs((0, import_node_path124.join)(skillsDir, "*"), { type: "dir" });
18672
18924
  const skills = await Promise.all(
18673
18925
  skillDirPaths.map(async (dirPath) => {
18674
- const dirName = (0, import_node_path123.basename)(dirPath);
18926
+ const dirName = (0, import_node_path124.basename)(dirPath);
18675
18927
  if (!dirName) return null;
18676
18928
  try {
18677
18929
  const skill = await RulesyncSkill.fromDir({
@@ -18679,7 +18931,7 @@ async function listSkills() {
18679
18931
  });
18680
18932
  const frontmatter = skill.getFrontmatter();
18681
18933
  return {
18682
- relativeDirPathFromCwd: (0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18934
+ relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18683
18935
  frontmatter
18684
18936
  };
18685
18937
  } catch (error) {
@@ -18707,7 +18959,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
18707
18959
  dirName
18708
18960
  });
18709
18961
  return {
18710
- relativeDirPathFromCwd: (0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18962
+ relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18711
18963
  frontmatter: skill.getFrontmatter(),
18712
18964
  body: skill.getBody(),
18713
18965
  otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
@@ -18741,7 +18993,7 @@ async function putSkill({
18741
18993
  try {
18742
18994
  const existingSkills = await listSkills();
18743
18995
  const isUpdate = existingSkills.some(
18744
- (skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
18996
+ (skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
18745
18997
  );
18746
18998
  if (!isUpdate && existingSkills.length >= maxSkillsCount) {
18747
18999
  throw new Error(
@@ -18758,9 +19010,9 @@ async function putSkill({
18758
19010
  otherFiles: aiDirFiles,
18759
19011
  validate: true
18760
19012
  });
18761
- const skillDirPath = (0, import_node_path123.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19013
+ const skillDirPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
18762
19014
  await ensureDir(skillDirPath);
18763
- const skillFilePath = (0, import_node_path123.join)(skillDirPath, SKILL_FILE_NAME);
19015
+ const skillFilePath = (0, import_node_path124.join)(skillDirPath, SKILL_FILE_NAME);
18764
19016
  const skillFileContent = stringifyFrontmatter(body, frontmatter);
18765
19017
  await writeFileContent(skillFilePath, skillFileContent);
18766
19018
  for (const file of otherFiles) {
@@ -18768,15 +19020,15 @@ async function putSkill({
18768
19020
  relativePath: file.name,
18769
19021
  intendedRootDir: skillDirPath
18770
19022
  });
18771
- const filePath = (0, import_node_path123.join)(skillDirPath, file.name);
18772
- const fileDir = (0, import_node_path123.join)(skillDirPath, (0, import_node_path123.dirname)(file.name));
19023
+ const filePath = (0, import_node_path124.join)(skillDirPath, file.name);
19024
+ const fileDir = (0, import_node_path124.join)(skillDirPath, (0, import_node_path124.dirname)(file.name));
18773
19025
  if (fileDir !== skillDirPath) {
18774
19026
  await ensureDir(fileDir);
18775
19027
  }
18776
19028
  await writeFileContent(filePath, file.body);
18777
19029
  }
18778
19030
  return {
18779
- relativeDirPathFromCwd: (0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
19031
+ relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
18780
19032
  frontmatter: skill.getFrontmatter(),
18781
19033
  body: skill.getBody(),
18782
19034
  otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
@@ -18798,13 +19050,13 @@ async function deleteSkill({
18798
19050
  intendedRootDir: process.cwd()
18799
19051
  });
18800
19052
  const dirName = extractDirName(relativeDirPathFromCwd);
18801
- const skillDirPath = (0, import_node_path123.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
19053
+ const skillDirPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
18802
19054
  try {
18803
19055
  if (await directoryExists(skillDirPath)) {
18804
19056
  await removeDirectory(skillDirPath);
18805
19057
  }
18806
19058
  return {
18807
- relativeDirPathFromCwd: (0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
19059
+ relativeDirPathFromCwd: (0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
18808
19060
  };
18809
19061
  } catch (error) {
18810
19062
  throw new Error(
@@ -18815,29 +19067,29 @@ async function deleteSkill({
18815
19067
  );
18816
19068
  }
18817
19069
  }
18818
- var McpSkillFileSchema = import_mini63.z.object({
18819
- name: import_mini63.z.string(),
18820
- body: import_mini63.z.string()
19070
+ var McpSkillFileSchema = import_mini64.z.object({
19071
+ name: import_mini64.z.string(),
19072
+ body: import_mini64.z.string()
18821
19073
  });
18822
19074
  var skillToolSchemas = {
18823
- listSkills: import_mini63.z.object({}),
18824
- getSkill: import_mini63.z.object({
18825
- relativeDirPathFromCwd: import_mini63.z.string()
19075
+ listSkills: import_mini64.z.object({}),
19076
+ getSkill: import_mini64.z.object({
19077
+ relativeDirPathFromCwd: import_mini64.z.string()
18826
19078
  }),
18827
- putSkill: import_mini63.z.object({
18828
- relativeDirPathFromCwd: import_mini63.z.string(),
19079
+ putSkill: import_mini64.z.object({
19080
+ relativeDirPathFromCwd: import_mini64.z.string(),
18829
19081
  frontmatter: RulesyncSkillFrontmatterSchema,
18830
- body: import_mini63.z.string(),
18831
- otherFiles: import_mini63.z.optional(import_mini63.z.array(McpSkillFileSchema))
19082
+ body: import_mini64.z.string(),
19083
+ otherFiles: import_mini64.z.optional(import_mini64.z.array(McpSkillFileSchema))
18832
19084
  }),
18833
- deleteSkill: import_mini63.z.object({
18834
- relativeDirPathFromCwd: import_mini63.z.string()
19085
+ deleteSkill: import_mini64.z.object({
19086
+ relativeDirPathFromCwd: import_mini64.z.string()
18835
19087
  })
18836
19088
  };
18837
19089
  var skillTools = {
18838
19090
  listSkills: {
18839
19091
  name: "listSkills",
18840
- description: `List all skills from ${(0, import_node_path123.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
19092
+ description: `List all skills from ${(0, import_node_path124.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
18841
19093
  parameters: skillToolSchemas.listSkills,
18842
19094
  execute: async () => {
18843
19095
  const skills = await listSkills();
@@ -18880,12 +19132,12 @@ var skillTools = {
18880
19132
  };
18881
19133
 
18882
19134
  // src/mcp/subagents.ts
18883
- var import_node_path124 = require("path");
18884
- var import_mini64 = require("zod/mini");
19135
+ var import_node_path125 = require("path");
19136
+ var import_mini65 = require("zod/mini");
18885
19137
  var maxSubagentSizeBytes = 1024 * 1024;
18886
19138
  var maxSubagentsCount = 1e3;
18887
19139
  async function listSubagents() {
18888
- const subagentsDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19140
+ const subagentsDir = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
18889
19141
  try {
18890
19142
  const files = await listDirectoryFiles(subagentsDir);
18891
19143
  const mdFiles = files.filter((file) => file.endsWith(".md"));
@@ -18898,7 +19150,7 @@ async function listSubagents() {
18898
19150
  });
18899
19151
  const frontmatter = subagent.getFrontmatter();
18900
19152
  return {
18901
- relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
19153
+ relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
18902
19154
  frontmatter
18903
19155
  };
18904
19156
  } catch (error) {
@@ -18922,14 +19174,14 @@ async function getSubagent({ relativePathFromCwd }) {
18922
19174
  relativePath: relativePathFromCwd,
18923
19175
  intendedRootDir: process.cwd()
18924
19176
  });
18925
- const filename = (0, import_node_path124.basename)(relativePathFromCwd);
19177
+ const filename = (0, import_node_path125.basename)(relativePathFromCwd);
18926
19178
  try {
18927
19179
  const subagent = await RulesyncSubagent.fromFile({
18928
19180
  relativeFilePath: filename,
18929
19181
  validate: true
18930
19182
  });
18931
19183
  return {
18932
- relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19184
+ relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
18933
19185
  frontmatter: subagent.getFrontmatter(),
18934
19186
  body: subagent.getBody()
18935
19187
  };
@@ -18948,7 +19200,7 @@ async function putSubagent({
18948
19200
  relativePath: relativePathFromCwd,
18949
19201
  intendedRootDir: process.cwd()
18950
19202
  });
18951
- const filename = (0, import_node_path124.basename)(relativePathFromCwd);
19203
+ const filename = (0, import_node_path125.basename)(relativePathFromCwd);
18952
19204
  const estimatedSize = JSON.stringify(frontmatter).length + body.length;
18953
19205
  if (estimatedSize > maxSubagentSizeBytes) {
18954
19206
  throw new Error(
@@ -18958,7 +19210,7 @@ async function putSubagent({
18958
19210
  try {
18959
19211
  const existingSubagents = await listSubagents();
18960
19212
  const isUpdate = existingSubagents.some(
18961
- (subagent2) => subagent2.relativePathFromCwd === (0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19213
+ (subagent2) => subagent2.relativePathFromCwd === (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
18962
19214
  );
18963
19215
  if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
18964
19216
  throw new Error(
@@ -18973,11 +19225,11 @@ async function putSubagent({
18973
19225
  body,
18974
19226
  validate: true
18975
19227
  });
18976
- const subagentsDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
19228
+ const subagentsDir = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
18977
19229
  await ensureDir(subagentsDir);
18978
19230
  await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
18979
19231
  return {
18980
- relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
19232
+ relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
18981
19233
  frontmatter: subagent.getFrontmatter(),
18982
19234
  body: subagent.getBody()
18983
19235
  };
@@ -18992,12 +19244,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
18992
19244
  relativePath: relativePathFromCwd,
18993
19245
  intendedRootDir: process.cwd()
18994
19246
  });
18995
- const filename = (0, import_node_path124.basename)(relativePathFromCwd);
18996
- const fullPath = (0, import_node_path124.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
19247
+ const filename = (0, import_node_path125.basename)(relativePathFromCwd);
19248
+ const fullPath = (0, import_node_path125.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
18997
19249
  try {
18998
19250
  await removeFile(fullPath);
18999
19251
  return {
19000
- relativePathFromCwd: (0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19252
+ relativePathFromCwd: (0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
19001
19253
  };
19002
19254
  } catch (error) {
19003
19255
  throw new Error(
@@ -19009,23 +19261,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
19009
19261
  }
19010
19262
  }
19011
19263
  var subagentToolSchemas = {
19012
- listSubagents: import_mini64.z.object({}),
19013
- getSubagent: import_mini64.z.object({
19014
- relativePathFromCwd: import_mini64.z.string()
19264
+ listSubagents: import_mini65.z.object({}),
19265
+ getSubagent: import_mini65.z.object({
19266
+ relativePathFromCwd: import_mini65.z.string()
19015
19267
  }),
19016
- putSubagent: import_mini64.z.object({
19017
- relativePathFromCwd: import_mini64.z.string(),
19268
+ putSubagent: import_mini65.z.object({
19269
+ relativePathFromCwd: import_mini65.z.string(),
19018
19270
  frontmatter: RulesyncSubagentFrontmatterSchema,
19019
- body: import_mini64.z.string()
19271
+ body: import_mini65.z.string()
19020
19272
  }),
19021
- deleteSubagent: import_mini64.z.object({
19022
- relativePathFromCwd: import_mini64.z.string()
19273
+ deleteSubagent: import_mini65.z.object({
19274
+ relativePathFromCwd: import_mini65.z.string()
19023
19275
  })
19024
19276
  };
19025
19277
  var subagentTools = {
19026
19278
  listSubagents: {
19027
19279
  name: "listSubagents",
19028
- description: `List all subagents from ${(0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
19280
+ description: `List all subagents from ${(0, import_node_path125.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
19029
19281
  parameters: subagentToolSchemas.listSubagents,
19030
19282
  execute: async () => {
19031
19283
  const subagents = await listSubagents();
@@ -19067,7 +19319,7 @@ var subagentTools = {
19067
19319
  };
19068
19320
 
19069
19321
  // src/mcp/tools.ts
19070
- var rulesyncFeatureSchema = import_mini65.z.enum([
19322
+ var rulesyncFeatureSchema = import_mini66.z.enum([
19071
19323
  "rule",
19072
19324
  "command",
19073
19325
  "subagent",
@@ -19077,21 +19329,21 @@ var rulesyncFeatureSchema = import_mini65.z.enum([
19077
19329
  "generate",
19078
19330
  "import"
19079
19331
  ]);
19080
- var rulesyncOperationSchema = import_mini65.z.enum(["list", "get", "put", "delete", "run"]);
19081
- var skillFileSchema = import_mini65.z.object({
19082
- name: import_mini65.z.string(),
19083
- body: import_mini65.z.string()
19332
+ var rulesyncOperationSchema = import_mini66.z.enum(["list", "get", "put", "delete", "run"]);
19333
+ var skillFileSchema = import_mini66.z.object({
19334
+ name: import_mini66.z.string(),
19335
+ body: import_mini66.z.string()
19084
19336
  });
19085
- var rulesyncToolSchema = import_mini65.z.object({
19337
+ var rulesyncToolSchema = import_mini66.z.object({
19086
19338
  feature: rulesyncFeatureSchema,
19087
19339
  operation: rulesyncOperationSchema,
19088
- targetPathFromCwd: import_mini65.z.optional(import_mini65.z.string()),
19089
- frontmatter: import_mini65.z.optional(import_mini65.z.unknown()),
19090
- body: import_mini65.z.optional(import_mini65.z.string()),
19091
- otherFiles: import_mini65.z.optional(import_mini65.z.array(skillFileSchema)),
19092
- content: import_mini65.z.optional(import_mini65.z.string()),
19093
- generateOptions: import_mini65.z.optional(generateOptionsSchema),
19094
- importOptions: import_mini65.z.optional(importOptionsSchema)
19340
+ targetPathFromCwd: import_mini66.z.optional(import_mini66.z.string()),
19341
+ frontmatter: import_mini66.z.optional(import_mini66.z.unknown()),
19342
+ body: import_mini66.z.optional(import_mini66.z.string()),
19343
+ otherFiles: import_mini66.z.optional(import_mini66.z.array(skillFileSchema)),
19344
+ content: import_mini66.z.optional(import_mini66.z.string()),
19345
+ generateOptions: import_mini66.z.optional(generateOptionsSchema),
19346
+ importOptions: import_mini66.z.optional(importOptionsSchema)
19095
19347
  });
19096
19348
  var supportedOperationsByFeature = {
19097
19349
  rule: ["list", "get", "put", "delete"],
@@ -19650,7 +19902,7 @@ async function updateCommand(currentVersion, options) {
19650
19902
  }
19651
19903
 
19652
19904
  // src/cli/index.ts
19653
- var getVersion = () => "7.8.0";
19905
+ var getVersion = () => "7.9.0";
19654
19906
  var main = async () => {
19655
19907
  const program = new import_commander.Command();
19656
19908
  const version = getVersion();