rulesync 7.16.0 → 7.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -60,6 +60,8 @@ var RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path.join)(
60
60
  RULESYNC_SKILLS_RELATIVE_DIR_PATH,
61
61
  ".curated"
62
62
  );
63
+ var RULESYNC_MCP_FILE_NAME = "mcp.json";
64
+ var RULESYNC_MCP_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/mcp-schema.json";
63
65
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
64
66
 
65
67
  // src/utils/error.ts
@@ -671,12 +673,12 @@ function getBaseDirsInLightOfGlobal({
671
673
  }
672
674
 
673
675
  // src/lib/generate.ts
674
- var import_node_path118 = require("path");
676
+ var import_node_path119 = require("path");
675
677
  var import_es_toolkit4 = require("es-toolkit");
676
678
 
677
679
  // src/features/commands/commands-processor.ts
678
- var import_node_path21 = require("path");
679
- var import_mini13 = require("zod/mini");
680
+ var import_node_path22 = require("path");
681
+ var import_mini14 = require("zod/mini");
680
682
 
681
683
  // src/types/feature-processor.ts
682
684
  var FeatureProcessor = class {
@@ -2275,12 +2277,152 @@ prompt = ""`;
2275
2277
  }
2276
2278
  };
2277
2279
 
2278
- // src/features/commands/kilo-command.ts
2280
+ // src/features/commands/junie-command.ts
2279
2281
  var import_node_path17 = require("path");
2282
+ var import_mini11 = require("zod/mini");
2283
+ var JunieCommandFrontmatterSchema = import_mini11.z.looseObject({
2284
+ description: import_mini11.z.optional(import_mini11.z.string())
2285
+ });
2286
+ var JunieCommand = class _JunieCommand extends ToolCommand {
2287
+ frontmatter;
2288
+ body;
2289
+ constructor({ frontmatter, body, ...rest }) {
2290
+ if (rest.validate) {
2291
+ const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
2292
+ if (!result.success) {
2293
+ throw new Error(
2294
+ `Invalid frontmatter in ${(0, import_node_path17.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2295
+ );
2296
+ }
2297
+ }
2298
+ super({
2299
+ ...rest,
2300
+ fileContent: stringifyFrontmatter(body, frontmatter)
2301
+ });
2302
+ this.frontmatter = frontmatter;
2303
+ this.body = body;
2304
+ }
2305
+ static getSettablePaths(_options = {}) {
2306
+ return {
2307
+ relativeDirPath: (0, import_node_path17.join)(".junie", "commands")
2308
+ };
2309
+ }
2310
+ getBody() {
2311
+ return this.body;
2312
+ }
2313
+ getFrontmatter() {
2314
+ return this.frontmatter;
2315
+ }
2316
+ toRulesyncCommand() {
2317
+ const { description, ...restFields } = this.frontmatter;
2318
+ const rulesyncFrontmatter = {
2319
+ targets: ["*"],
2320
+ description,
2321
+ // Preserve extra fields in junie section
2322
+ ...Object.keys(restFields).length > 0 && { junie: restFields }
2323
+ };
2324
+ const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
2325
+ return new RulesyncCommand({
2326
+ baseDir: process.cwd(),
2327
+ // RulesyncCommand baseDir is always the project root directory
2328
+ frontmatter: rulesyncFrontmatter,
2329
+ body: this.body,
2330
+ relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
2331
+ relativeFilePath: this.relativeFilePath,
2332
+ fileContent,
2333
+ validate: true
2334
+ });
2335
+ }
2336
+ static fromRulesyncCommand({
2337
+ baseDir = process.cwd(),
2338
+ rulesyncCommand,
2339
+ validate = true,
2340
+ global = false
2341
+ }) {
2342
+ const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
2343
+ const junieFields = rulesyncFrontmatter.junie ?? {};
2344
+ const junieFrontmatter = {
2345
+ description: rulesyncFrontmatter.description,
2346
+ ...junieFields
2347
+ };
2348
+ const body = rulesyncCommand.getBody();
2349
+ const paths = this.getSettablePaths({ global });
2350
+ return new _JunieCommand({
2351
+ baseDir,
2352
+ frontmatter: junieFrontmatter,
2353
+ body,
2354
+ relativeDirPath: paths.relativeDirPath,
2355
+ relativeFilePath: rulesyncCommand.getRelativeFilePath(),
2356
+ validate
2357
+ });
2358
+ }
2359
+ validate() {
2360
+ if (!this.frontmatter) {
2361
+ return { success: true, error: null };
2362
+ }
2363
+ const result = JunieCommandFrontmatterSchema.safeParse(this.frontmatter);
2364
+ if (result.success) {
2365
+ return { success: true, error: null };
2366
+ } else {
2367
+ return {
2368
+ success: false,
2369
+ error: new Error(
2370
+ `Invalid frontmatter in ${(0, import_node_path17.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2371
+ )
2372
+ };
2373
+ }
2374
+ }
2375
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
2376
+ return this.isTargetedByRulesyncCommandDefault({
2377
+ rulesyncCommand,
2378
+ toolTarget: "junie"
2379
+ });
2380
+ }
2381
+ static async fromFile({
2382
+ baseDir = process.cwd(),
2383
+ relativeFilePath,
2384
+ validate = true,
2385
+ global = false
2386
+ }) {
2387
+ const paths = this.getSettablePaths({ global });
2388
+ const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2389
+ const fileContent = await readFileContent(filePath);
2390
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2391
+ const result = JunieCommandFrontmatterSchema.safeParse(frontmatter);
2392
+ if (!result.success) {
2393
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
2394
+ }
2395
+ return new _JunieCommand({
2396
+ baseDir,
2397
+ relativeDirPath: paths.relativeDirPath,
2398
+ relativeFilePath,
2399
+ frontmatter: result.data,
2400
+ body: content.trim(),
2401
+ validate
2402
+ });
2403
+ }
2404
+ static forDeletion({
2405
+ baseDir = process.cwd(),
2406
+ relativeDirPath,
2407
+ relativeFilePath
2408
+ }) {
2409
+ return new _JunieCommand({
2410
+ baseDir,
2411
+ relativeDirPath,
2412
+ relativeFilePath,
2413
+ frontmatter: { description: "" },
2414
+ body: "",
2415
+ validate: false
2416
+ });
2417
+ }
2418
+ };
2419
+
2420
+ // src/features/commands/kilo-command.ts
2421
+ var import_node_path18 = require("path");
2280
2422
  var KiloCommand = class _KiloCommand extends ToolCommand {
2281
2423
  static getSettablePaths(_options = {}) {
2282
2424
  return {
2283
- relativeDirPath: (0, import_node_path17.join)(".kilocode", "workflows")
2425
+ relativeDirPath: (0, import_node_path18.join)(".kilocode", "workflows")
2284
2426
  };
2285
2427
  }
2286
2428
  toRulesyncCommand() {
@@ -2329,7 +2471,7 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
2329
2471
  validate = true
2330
2472
  }) {
2331
2473
  const paths = this.getSettablePaths();
2332
- const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2474
+ const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2333
2475
  const fileContent = await readFileContent(filePath);
2334
2476
  const { body: content } = parseFrontmatter(fileContent, filePath);
2335
2477
  return new _KiloCommand({
@@ -2356,11 +2498,11 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
2356
2498
  };
2357
2499
 
2358
2500
  // src/features/commands/kiro-command.ts
2359
- var import_node_path18 = require("path");
2501
+ var import_node_path19 = require("path");
2360
2502
  var KiroCommand = class _KiroCommand extends ToolCommand {
2361
2503
  static getSettablePaths(_options = {}) {
2362
2504
  return {
2363
- relativeDirPath: (0, import_node_path18.join)(".kiro", "prompts")
2505
+ relativeDirPath: (0, import_node_path19.join)(".kiro", "prompts")
2364
2506
  };
2365
2507
  }
2366
2508
  toRulesyncCommand() {
@@ -2409,7 +2551,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
2409
2551
  validate = true
2410
2552
  }) {
2411
2553
  const paths = this.getSettablePaths();
2412
- const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2554
+ const filePath = (0, import_node_path19.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2413
2555
  const fileContent = await readFileContent(filePath);
2414
2556
  const { body: content } = parseFrontmatter(fileContent, filePath);
2415
2557
  return new _KiroCommand({
@@ -2436,13 +2578,13 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
2436
2578
  };
2437
2579
 
2438
2580
  // src/features/commands/opencode-command.ts
2439
- var import_node_path19 = require("path");
2440
- var import_mini11 = require("zod/mini");
2441
- var OpenCodeCommandFrontmatterSchema = import_mini11.z.looseObject({
2442
- description: import_mini11.z.optional(import_mini11.z.string()),
2443
- agent: (0, import_mini11.optional)(import_mini11.z.string()),
2444
- subtask: (0, import_mini11.optional)(import_mini11.z.boolean()),
2445
- model: (0, import_mini11.optional)(import_mini11.z.string())
2581
+ var import_node_path20 = require("path");
2582
+ var import_mini12 = require("zod/mini");
2583
+ var OpenCodeCommandFrontmatterSchema = import_mini12.z.looseObject({
2584
+ description: import_mini12.z.optional(import_mini12.z.string()),
2585
+ agent: (0, import_mini12.optional)(import_mini12.z.string()),
2586
+ subtask: (0, import_mini12.optional)(import_mini12.z.boolean()),
2587
+ model: (0, import_mini12.optional)(import_mini12.z.string())
2446
2588
  });
2447
2589
  var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2448
2590
  frontmatter;
@@ -2452,7 +2594,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2452
2594
  const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
2453
2595
  if (!result.success) {
2454
2596
  throw new Error(
2455
- `Invalid frontmatter in ${(0, import_node_path19.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2597
+ `Invalid frontmatter in ${(0, import_node_path20.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2456
2598
  );
2457
2599
  }
2458
2600
  }
@@ -2465,7 +2607,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2465
2607
  }
2466
2608
  static getSettablePaths({ global } = {}) {
2467
2609
  return {
2468
- relativeDirPath: global ? (0, import_node_path19.join)(".config", "opencode", "command") : (0, import_node_path19.join)(".opencode", "command")
2610
+ relativeDirPath: global ? (0, import_node_path20.join)(".config", "opencode", "command") : (0, import_node_path20.join)(".opencode", "command")
2469
2611
  };
2470
2612
  }
2471
2613
  getBody() {
@@ -2526,7 +2668,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2526
2668
  return {
2527
2669
  success: false,
2528
2670
  error: new Error(
2529
- `Invalid frontmatter in ${(0, import_node_path19.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2671
+ `Invalid frontmatter in ${(0, import_node_path20.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2530
2672
  )
2531
2673
  };
2532
2674
  }
@@ -2537,7 +2679,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2537
2679
  global = false
2538
2680
  }) {
2539
2681
  const paths = this.getSettablePaths({ global });
2540
- const filePath = (0, import_node_path19.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2682
+ const filePath = (0, import_node_path20.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2541
2683
  const fileContent = await readFileContent(filePath);
2542
2684
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2543
2685
  const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
@@ -2576,18 +2718,18 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2576
2718
  };
2577
2719
 
2578
2720
  // src/features/commands/roo-command.ts
2579
- var import_node_path20 = require("path");
2580
- var import_mini12 = require("zod/mini");
2581
- var RooCommandFrontmatterSchema = import_mini12.z.looseObject({
2582
- description: import_mini12.z.optional(import_mini12.z.string()),
2583
- "argument-hint": (0, import_mini12.optional)(import_mini12.z.string())
2721
+ var import_node_path21 = require("path");
2722
+ var import_mini13 = require("zod/mini");
2723
+ var RooCommandFrontmatterSchema = import_mini13.z.looseObject({
2724
+ description: import_mini13.z.optional(import_mini13.z.string()),
2725
+ "argument-hint": (0, import_mini13.optional)(import_mini13.z.string())
2584
2726
  });
2585
2727
  var RooCommand = class _RooCommand extends ToolCommand {
2586
2728
  frontmatter;
2587
2729
  body;
2588
2730
  static getSettablePaths() {
2589
2731
  return {
2590
- relativeDirPath: (0, import_node_path20.join)(".roo", "commands")
2732
+ relativeDirPath: (0, import_node_path21.join)(".roo", "commands")
2591
2733
  };
2592
2734
  }
2593
2735
  constructor({ frontmatter, body, ...rest }) {
@@ -2595,7 +2737,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2595
2737
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
2596
2738
  if (!result.success) {
2597
2739
  throw new Error(
2598
- `Invalid frontmatter in ${(0, import_node_path20.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2740
+ `Invalid frontmatter in ${(0, import_node_path21.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2599
2741
  );
2600
2742
  }
2601
2743
  }
@@ -2666,7 +2808,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2666
2808
  return {
2667
2809
  success: false,
2668
2810
  error: new Error(
2669
- `Invalid frontmatter in ${(0, import_node_path20.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2811
+ `Invalid frontmatter in ${(0, import_node_path21.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2670
2812
  )
2671
2813
  };
2672
2814
  }
@@ -2682,7 +2824,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2682
2824
  relativeFilePath,
2683
2825
  validate = true
2684
2826
  }) {
2685
- const filePath = (0, import_node_path20.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
2827
+ const filePath = (0, import_node_path21.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
2686
2828
  const fileContent = await readFileContent(filePath);
2687
2829
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2688
2830
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
@@ -2728,12 +2870,13 @@ var commandsProcessorToolTargetTuple = [
2728
2870
  "cursor",
2729
2871
  "factorydroid",
2730
2872
  "geminicli",
2873
+ "junie",
2731
2874
  "kilo",
2732
2875
  "kiro",
2733
2876
  "opencode",
2734
2877
  "roo"
2735
2878
  ];
2736
- var CommandsProcessorToolTargetSchema = import_mini13.z.enum(commandsProcessorToolTargetTuple);
2879
+ var CommandsProcessorToolTargetSchema = import_mini14.z.enum(commandsProcessorToolTargetTuple);
2737
2880
  var toolCommandFactories = /* @__PURE__ */ new Map([
2738
2881
  [
2739
2882
  "agentsmd",
@@ -2865,6 +3008,19 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
2865
3008
  }
2866
3009
  }
2867
3010
  ],
3011
+ [
3012
+ "junie",
3013
+ {
3014
+ class: JunieCommand,
3015
+ meta: {
3016
+ extension: "md",
3017
+ supportsProject: true,
3018
+ supportsGlobal: true,
3019
+ isSimulated: false,
3020
+ supportsSubdirectory: false
3021
+ }
3022
+ }
3023
+ ],
2868
3024
  [
2869
3025
  "kilo",
2870
3026
  {
@@ -3003,12 +3159,12 @@ var CommandsProcessor = class extends FeatureProcessor {
3003
3159
  return rulesyncCommands;
3004
3160
  }
3005
3161
  flattenRelativeFilePath(rulesyncCommand) {
3006
- const flatPath = (0, import_node_path21.basename)(rulesyncCommand.getRelativeFilePath());
3162
+ const flatPath = (0, import_node_path22.basename)(rulesyncCommand.getRelativeFilePath());
3007
3163
  if (flatPath === rulesyncCommand.getRelativeFilePath()) return rulesyncCommand;
3008
3164
  return rulesyncCommand.withRelativeFilePath(flatPath);
3009
3165
  }
3010
3166
  safeRelativePath(basePath, fullPath) {
3011
- const rel = (0, import_node_path21.relative)(basePath, fullPath);
3167
+ const rel = (0, import_node_path22.relative)(basePath, fullPath);
3012
3168
  checkPathTraversal({ relativePath: rel, intendedRootDir: basePath });
3013
3169
  return rel;
3014
3170
  }
@@ -3018,7 +3174,7 @@ var CommandsProcessor = class extends FeatureProcessor {
3018
3174
  */
3019
3175
  async loadRulesyncFiles() {
3020
3176
  const basePath = RulesyncCommand.getSettablePaths().relativeDirPath;
3021
- const rulesyncCommandPaths = await findFilesByGlobs((0, import_node_path21.join)(basePath, "**", "*.md"));
3177
+ const rulesyncCommandPaths = await findFilesByGlobs((0, import_node_path22.join)(basePath, "**", "*.md"));
3022
3178
  const rulesyncCommands = await Promise.all(
3023
3179
  rulesyncCommandPaths.map(
3024
3180
  (path3) => RulesyncCommand.fromFile({ relativeFilePath: this.safeRelativePath(basePath, path3) })
@@ -3036,8 +3192,8 @@ var CommandsProcessor = class extends FeatureProcessor {
3036
3192
  } = {}) {
3037
3193
  const factory = this.getFactory(this.toolTarget);
3038
3194
  const paths = factory.class.getSettablePaths({ global: this.global });
3039
- const baseDirFull = (0, import_node_path21.join)(this.baseDir, paths.relativeDirPath);
3040
- const globPattern = factory.meta.supportsSubdirectory ? (0, import_node_path21.join)(baseDirFull, "**", `*.${factory.meta.extension}`) : (0, import_node_path21.join)(baseDirFull, `*.${factory.meta.extension}`);
3195
+ const baseDirFull = (0, import_node_path22.join)(this.baseDir, paths.relativeDirPath);
3196
+ const globPattern = factory.meta.supportsSubdirectory ? (0, import_node_path22.join)(baseDirFull, "**", `*.${factory.meta.extension}`) : (0, import_node_path22.join)(baseDirFull, `*.${factory.meta.extension}`);
3041
3197
  const commandFilePaths = await findFilesByGlobs(globPattern);
3042
3198
  if (forDeletion) {
3043
3199
  const toolCommands2 = commandFilePaths.map(
@@ -3100,28 +3256,28 @@ var CommandsProcessor = class extends FeatureProcessor {
3100
3256
  };
3101
3257
 
3102
3258
  // src/features/hooks/hooks-processor.ts
3103
- var import_mini17 = require("zod/mini");
3259
+ var import_mini18 = require("zod/mini");
3104
3260
 
3105
3261
  // src/types/hooks.ts
3106
- var import_mini14 = require("zod/mini");
3262
+ var import_mini15 = require("zod/mini");
3107
3263
  var CONTROL_CHARS = ["\n", "\r", "\0"];
3108
3264
  var hasControlChars = (val) => CONTROL_CHARS.some((char) => val.includes(char));
3109
- var safeString = import_mini14.z.pipe(
3110
- import_mini14.z.string(),
3111
- import_mini14.z.custom(
3265
+ var safeString = import_mini15.z.pipe(
3266
+ import_mini15.z.string(),
3267
+ import_mini15.z.custom(
3112
3268
  (val) => typeof val === "string" && !hasControlChars(val),
3113
3269
  "must not contain newline, carriage return, or NUL characters"
3114
3270
  )
3115
3271
  );
3116
- var HookDefinitionSchema = import_mini14.z.looseObject({
3117
- command: import_mini14.z.optional(safeString),
3118
- type: import_mini14.z.optional(import_mini14.z.enum(["command", "prompt"])),
3119
- timeout: import_mini14.z.optional(import_mini14.z.number()),
3120
- matcher: import_mini14.z.optional(safeString),
3121
- prompt: import_mini14.z.optional(safeString),
3122
- loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number())),
3123
- name: import_mini14.z.optional(safeString),
3124
- description: import_mini14.z.optional(safeString)
3272
+ var HookDefinitionSchema = import_mini15.z.looseObject({
3273
+ command: import_mini15.z.optional(safeString),
3274
+ type: import_mini15.z.optional(import_mini15.z.enum(["command", "prompt"])),
3275
+ timeout: import_mini15.z.optional(import_mini15.z.number()),
3276
+ matcher: import_mini15.z.optional(safeString),
3277
+ prompt: import_mini15.z.optional(safeString),
3278
+ loop_limit: import_mini15.z.optional(import_mini15.z.nullable(import_mini15.z.number())),
3279
+ name: import_mini15.z.optional(safeString),
3280
+ description: import_mini15.z.optional(safeString)
3125
3281
  });
3126
3282
  var CURSOR_HOOK_EVENTS = [
3127
3283
  "sessionStart",
@@ -3201,16 +3357,16 @@ var GEMINICLI_HOOK_EVENTS = [
3201
3357
  "preCompact",
3202
3358
  "notification"
3203
3359
  ];
3204
- var hooksRecordSchema = import_mini14.z.record(import_mini14.z.string(), import_mini14.z.array(HookDefinitionSchema));
3205
- var HooksConfigSchema = import_mini14.z.looseObject({
3206
- version: import_mini14.z.optional(import_mini14.z.number()),
3360
+ var hooksRecordSchema = import_mini15.z.record(import_mini15.z.string(), import_mini15.z.array(HookDefinitionSchema));
3361
+ var HooksConfigSchema = import_mini15.z.looseObject({
3362
+ version: import_mini15.z.optional(import_mini15.z.number()),
3207
3363
  hooks: hooksRecordSchema,
3208
- cursor: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3209
- claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3210
- copilot: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3211
- opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3212
- factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
3213
- geminicli: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
3364
+ cursor: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3365
+ claudecode: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3366
+ copilot: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3367
+ opencode: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3368
+ factorydroid: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3369
+ geminicli: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) }))
3214
3370
  });
3215
3371
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
3216
3372
  sessionStart: "SessionStart",
@@ -3307,7 +3463,7 @@ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3307
3463
  );
3308
3464
 
3309
3465
  // src/features/hooks/claudecode-hooks.ts
3310
- var import_node_path23 = require("path");
3466
+ var import_node_path24 = require("path");
3311
3467
 
3312
3468
  // src/features/hooks/tool-hooks-converter.ts
3313
3469
  function isToolMatcherEntry(x) {
@@ -3415,7 +3571,7 @@ var ToolFile = class extends AiFile {
3415
3571
  };
3416
3572
 
3417
3573
  // src/features/hooks/rulesync-hooks.ts
3418
- var import_node_path22 = require("path");
3574
+ var import_node_path23 = require("path");
3419
3575
  var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
3420
3576
  json;
3421
3577
  constructor(params) {
@@ -3446,7 +3602,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
3446
3602
  validate = true
3447
3603
  }) {
3448
3604
  const paths = _RulesyncHooks.getSettablePaths();
3449
- const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3605
+ const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3450
3606
  if (!await fileExists(filePath)) {
3451
3607
  throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
3452
3608
  }
@@ -3526,7 +3682,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3526
3682
  global = false
3527
3683
  }) {
3528
3684
  const paths = _ClaudecodeHooks.getSettablePaths({ global });
3529
- const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3685
+ const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3530
3686
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3531
3687
  return new _ClaudecodeHooks({
3532
3688
  baseDir,
@@ -3543,7 +3699,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3543
3699
  global = false
3544
3700
  }) {
3545
3701
  const paths = _ClaudecodeHooks.getSettablePaths({ global });
3546
- const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3702
+ const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3547
3703
  const existingContent = await readOrInitializeFileContent(
3548
3704
  filePath,
3549
3705
  JSON.stringify({}, null, 2)
@@ -3579,7 +3735,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3579
3735
  settings = JSON.parse(this.getFileContent());
3580
3736
  } catch (error) {
3581
3737
  throw new Error(
3582
- `Failed to parse Claude hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3738
+ `Failed to parse Claude hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3583
3739
  {
3584
3740
  cause: error
3585
3741
  }
@@ -3612,13 +3768,13 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3612
3768
  };
3613
3769
 
3614
3770
  // src/features/hooks/copilot-hooks.ts
3615
- var import_node_path24 = require("path");
3616
- var import_mini15 = require("zod/mini");
3617
- var CopilotHookEntrySchema = import_mini15.z.looseObject({
3618
- type: import_mini15.z.string(),
3619
- bash: import_mini15.z.optional(import_mini15.z.string()),
3620
- powershell: import_mini15.z.optional(import_mini15.z.string()),
3621
- timeoutSec: import_mini15.z.optional(import_mini15.z.number())
3771
+ var import_node_path25 = require("path");
3772
+ var import_mini16 = require("zod/mini");
3773
+ var CopilotHookEntrySchema = import_mini16.z.looseObject({
3774
+ type: import_mini16.z.string(),
3775
+ bash: import_mini16.z.optional(import_mini16.z.string()),
3776
+ powershell: import_mini16.z.optional(import_mini16.z.string()),
3777
+ timeoutSec: import_mini16.z.optional(import_mini16.z.number())
3622
3778
  });
3623
3779
  function canonicalToCopilotHooks(config) {
3624
3780
  const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
@@ -3715,7 +3871,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3715
3871
  }
3716
3872
  static getSettablePaths(_options = {}) {
3717
3873
  return {
3718
- relativeDirPath: (0, import_node_path24.join)(".github", "hooks"),
3874
+ relativeDirPath: (0, import_node_path25.join)(".github", "hooks"),
3719
3875
  relativeFilePath: "copilot-hooks.json"
3720
3876
  };
3721
3877
  }
@@ -3725,7 +3881,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3725
3881
  global = false
3726
3882
  }) {
3727
3883
  const paths = _CopilotHooks.getSettablePaths({ global });
3728
- const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3884
+ const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3729
3885
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3730
3886
  return new _CopilotHooks({
3731
3887
  baseDir,
@@ -3758,7 +3914,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3758
3914
  parsed = JSON.parse(this.getFileContent());
3759
3915
  } catch (error) {
3760
3916
  throw new Error(
3761
- `Failed to parse Copilot hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3917
+ `Failed to parse Copilot hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3762
3918
  {
3763
3919
  cause: error
3764
3920
  }
@@ -3788,7 +3944,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3788
3944
  };
3789
3945
 
3790
3946
  // src/features/hooks/cursor-hooks.ts
3791
- var import_node_path25 = require("path");
3947
+ var import_node_path26 = require("path");
3792
3948
  var CursorHooks = class _CursorHooks extends ToolHooks {
3793
3949
  constructor(params) {
3794
3950
  const { rulesyncHooks: _r, ...rest } = params;
@@ -3809,7 +3965,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3809
3965
  }) {
3810
3966
  const paths = _CursorHooks.getSettablePaths();
3811
3967
  const fileContent = await readFileContent(
3812
- (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3968
+ (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3813
3969
  );
3814
3970
  return new _CursorHooks({
3815
3971
  baseDir,
@@ -3896,7 +4052,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3896
4052
  };
3897
4053
 
3898
4054
  // src/features/hooks/factorydroid-hooks.ts
3899
- var import_node_path26 = require("path");
4055
+ var import_node_path27 = require("path");
3900
4056
  var FACTORYDROID_CONVERTER_CONFIG = {
3901
4057
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
3902
4058
  canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
@@ -3922,7 +4078,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3922
4078
  global = false
3923
4079
  }) {
3924
4080
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3925
- const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4081
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3926
4082
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3927
4083
  return new _FactorydroidHooks({
3928
4084
  baseDir,
@@ -3939,7 +4095,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3939
4095
  global = false
3940
4096
  }) {
3941
4097
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3942
- const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4098
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3943
4099
  const existingContent = await readOrInitializeFileContent(
3944
4100
  filePath,
3945
4101
  JSON.stringify({}, null, 2)
@@ -3975,7 +4131,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3975
4131
  settings = JSON.parse(this.getFileContent());
3976
4132
  } catch (error) {
3977
4133
  throw new Error(
3978
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4134
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3979
4135
  {
3980
4136
  cause: error
3981
4137
  }
@@ -4008,8 +4164,8 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4008
4164
  };
4009
4165
 
4010
4166
  // src/features/hooks/geminicli-hooks.ts
4011
- var import_node_path27 = require("path");
4012
- var import_mini16 = require("zod/mini");
4167
+ var import_node_path28 = require("path");
4168
+ var import_mini17 = require("zod/mini");
4013
4169
  function canonicalToGeminicliHooks(config) {
4014
4170
  const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
4015
4171
  const sharedHooks = {};
@@ -4053,16 +4209,16 @@ function canonicalToGeminicliHooks(config) {
4053
4209
  }
4054
4210
  return gemini;
4055
4211
  }
4056
- var GeminiHookEntrySchema = import_mini16.z.looseObject({
4057
- type: import_mini16.z.optional(import_mini16.z.string()),
4058
- command: import_mini16.z.optional(import_mini16.z.string()),
4059
- timeout: import_mini16.z.optional(import_mini16.z.number()),
4060
- name: import_mini16.z.optional(import_mini16.z.string()),
4061
- description: import_mini16.z.optional(import_mini16.z.string())
4212
+ var GeminiHookEntrySchema = import_mini17.z.looseObject({
4213
+ type: import_mini17.z.optional(import_mini17.z.string()),
4214
+ command: import_mini17.z.optional(import_mini17.z.string()),
4215
+ timeout: import_mini17.z.optional(import_mini17.z.number()),
4216
+ name: import_mini17.z.optional(import_mini17.z.string()),
4217
+ description: import_mini17.z.optional(import_mini17.z.string())
4062
4218
  });
4063
- var GeminiMatcherEntrySchema = import_mini16.z.looseObject({
4064
- matcher: import_mini16.z.optional(import_mini16.z.string()),
4065
- hooks: import_mini16.z.optional(import_mini16.z.array(GeminiHookEntrySchema))
4219
+ var GeminiMatcherEntrySchema = import_mini17.z.looseObject({
4220
+ matcher: import_mini17.z.optional(import_mini17.z.string()),
4221
+ hooks: import_mini17.z.optional(import_mini17.z.array(GeminiHookEntrySchema))
4066
4222
  });
4067
4223
  function geminiHooksToCanonical(geminiHooks) {
4068
4224
  if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
@@ -4117,7 +4273,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4117
4273
  global = false
4118
4274
  }) {
4119
4275
  const paths = _GeminicliHooks.getSettablePaths({ global });
4120
- const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4276
+ const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4121
4277
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4122
4278
  return new _GeminicliHooks({
4123
4279
  baseDir,
@@ -4134,7 +4290,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4134
4290
  global = false
4135
4291
  }) {
4136
4292
  const paths = _GeminicliHooks.getSettablePaths({ global });
4137
- const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4293
+ const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4138
4294
  const existingContent = await readOrInitializeFileContent(
4139
4295
  filePath,
4140
4296
  JSON.stringify({}, null, 2)
@@ -4166,7 +4322,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4166
4322
  settings = JSON.parse(this.getFileContent());
4167
4323
  } catch (error) {
4168
4324
  throw new Error(
4169
- `Failed to parse Gemini CLI hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4325
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path28.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4170
4326
  {
4171
4327
  cause: error
4172
4328
  }
@@ -4196,7 +4352,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4196
4352
  };
4197
4353
 
4198
4354
  // src/features/hooks/opencode-hooks.ts
4199
- var import_node_path28 = require("path");
4355
+ var import_node_path29 = require("path");
4200
4356
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
4201
4357
  function escapeForTemplateLiteral(command) {
4202
4358
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -4294,7 +4450,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4294
4450
  }
4295
4451
  static getSettablePaths(options) {
4296
4452
  return {
4297
- relativeDirPath: options?.global ? (0, import_node_path28.join)(".config", "opencode", "plugins") : (0, import_node_path28.join)(".opencode", "plugins"),
4453
+ relativeDirPath: options?.global ? (0, import_node_path29.join)(".config", "opencode", "plugins") : (0, import_node_path29.join)(".opencode", "plugins"),
4298
4454
  relativeFilePath: "rulesync-hooks.js"
4299
4455
  };
4300
4456
  }
@@ -4305,7 +4461,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4305
4461
  }) {
4306
4462
  const paths = _OpencodeHooks.getSettablePaths({ global });
4307
4463
  const fileContent = await readFileContent(
4308
- (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4464
+ (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4309
4465
  );
4310
4466
  return new _OpencodeHooks({
4311
4467
  baseDir,
@@ -4362,7 +4518,7 @@ var hooksProcessorToolTargetTuple = [
4362
4518
  "factorydroid",
4363
4519
  "geminicli"
4364
4520
  ];
4365
- var HooksProcessorToolTargetSchema = import_mini17.z.enum(hooksProcessorToolTargetTuple);
4521
+ var HooksProcessorToolTargetSchema = import_mini18.z.enum(hooksProcessorToolTargetTuple);
4366
4522
  var toolHooksFactories = /* @__PURE__ */ new Map([
4367
4523
  [
4368
4524
  "cursor",
@@ -4597,13 +4753,13 @@ var HooksProcessor = class extends FeatureProcessor {
4597
4753
  };
4598
4754
 
4599
4755
  // src/features/ignore/ignore-processor.ts
4600
- var import_mini18 = require("zod/mini");
4756
+ var import_mini19 = require("zod/mini");
4601
4757
 
4602
4758
  // src/features/ignore/augmentcode-ignore.ts
4603
- var import_node_path30 = require("path");
4759
+ var import_node_path31 = require("path");
4604
4760
 
4605
4761
  // src/features/ignore/rulesync-ignore.ts
4606
- var import_node_path29 = require("path");
4762
+ var import_node_path30 = require("path");
4607
4763
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4608
4764
  validate() {
4609
4765
  return { success: true, error: null };
@@ -4623,12 +4779,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4623
4779
  static async fromFile() {
4624
4780
  const baseDir = process.cwd();
4625
4781
  const paths = this.getSettablePaths();
4626
- const recommendedPath = (0, import_node_path29.join)(
4782
+ const recommendedPath = (0, import_node_path30.join)(
4627
4783
  baseDir,
4628
4784
  paths.recommended.relativeDirPath,
4629
4785
  paths.recommended.relativeFilePath
4630
4786
  );
4631
- const legacyPath = (0, import_node_path29.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4787
+ const legacyPath = (0, import_node_path30.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4632
4788
  if (await fileExists(recommendedPath)) {
4633
4789
  const fileContent2 = await readFileContent(recommendedPath);
4634
4790
  return new _RulesyncIgnore({
@@ -4744,7 +4900,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4744
4900
  validate = true
4745
4901
  }) {
4746
4902
  const fileContent = await readFileContent(
4747
- (0, import_node_path30.join)(
4903
+ (0, import_node_path31.join)(
4748
4904
  baseDir,
4749
4905
  this.getSettablePaths().relativeDirPath,
4750
4906
  this.getSettablePaths().relativeFilePath
@@ -4774,7 +4930,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4774
4930
  };
4775
4931
 
4776
4932
  // src/features/ignore/claudecode-ignore.ts
4777
- var import_node_path31 = require("path");
4933
+ var import_node_path32 = require("path");
4778
4934
  var import_es_toolkit2 = require("es-toolkit");
4779
4935
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4780
4936
  constructor(params) {
@@ -4817,7 +4973,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4817
4973
  const fileContent = rulesyncIgnore.getFileContent();
4818
4974
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4819
4975
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4820
- const filePath = (0, import_node_path31.join)(
4976
+ const filePath = (0, import_node_path32.join)(
4821
4977
  baseDir,
4822
4978
  this.getSettablePaths().relativeDirPath,
4823
4979
  this.getSettablePaths().relativeFilePath
@@ -4853,7 +5009,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4853
5009
  validate = true
4854
5010
  }) {
4855
5011
  const fileContent = await readFileContent(
4856
- (0, import_node_path31.join)(
5012
+ (0, import_node_path32.join)(
4857
5013
  baseDir,
4858
5014
  this.getSettablePaths().relativeDirPath,
4859
5015
  this.getSettablePaths().relativeFilePath
@@ -4883,7 +5039,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4883
5039
  };
4884
5040
 
4885
5041
  // src/features/ignore/cline-ignore.ts
4886
- var import_node_path32 = require("path");
5042
+ var import_node_path33 = require("path");
4887
5043
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4888
5044
  static getSettablePaths() {
4889
5045
  return {
@@ -4920,7 +5076,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4920
5076
  validate = true
4921
5077
  }) {
4922
5078
  const fileContent = await readFileContent(
4923
- (0, import_node_path32.join)(
5079
+ (0, import_node_path33.join)(
4924
5080
  baseDir,
4925
5081
  this.getSettablePaths().relativeDirPath,
4926
5082
  this.getSettablePaths().relativeFilePath
@@ -4950,7 +5106,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4950
5106
  };
4951
5107
 
4952
5108
  // src/features/ignore/cursor-ignore.ts
4953
- var import_node_path33 = require("path");
5109
+ var import_node_path34 = require("path");
4954
5110
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4955
5111
  static getSettablePaths() {
4956
5112
  return {
@@ -4983,7 +5139,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4983
5139
  validate = true
4984
5140
  }) {
4985
5141
  const fileContent = await readFileContent(
4986
- (0, import_node_path33.join)(
5142
+ (0, import_node_path34.join)(
4987
5143
  baseDir,
4988
5144
  this.getSettablePaths().relativeDirPath,
4989
5145
  this.getSettablePaths().relativeFilePath
@@ -5013,7 +5169,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5013
5169
  };
5014
5170
 
5015
5171
  // src/features/ignore/geminicli-ignore.ts
5016
- var import_node_path34 = require("path");
5172
+ var import_node_path35 = require("path");
5017
5173
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5018
5174
  static getSettablePaths() {
5019
5175
  return {
@@ -5040,7 +5196,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5040
5196
  validate = true
5041
5197
  }) {
5042
5198
  const fileContent = await readFileContent(
5043
- (0, import_node_path34.join)(
5199
+ (0, import_node_path35.join)(
5044
5200
  baseDir,
5045
5201
  this.getSettablePaths().relativeDirPath,
5046
5202
  this.getSettablePaths().relativeFilePath
@@ -5070,7 +5226,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5070
5226
  };
5071
5227
 
5072
5228
  // src/features/ignore/goose-ignore.ts
5073
- var import_node_path35 = require("path");
5229
+ var import_node_path36 = require("path");
5074
5230
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5075
5231
  static getSettablePaths() {
5076
5232
  return {
@@ -5107,7 +5263,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5107
5263
  validate = true
5108
5264
  }) {
5109
5265
  const fileContent = await readFileContent(
5110
- (0, import_node_path35.join)(
5266
+ (0, import_node_path36.join)(
5111
5267
  baseDir,
5112
5268
  this.getSettablePaths().relativeDirPath,
5113
5269
  this.getSettablePaths().relativeFilePath
@@ -5137,7 +5293,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5137
5293
  };
5138
5294
 
5139
5295
  // src/features/ignore/junie-ignore.ts
5140
- var import_node_path36 = require("path");
5296
+ var import_node_path37 = require("path");
5141
5297
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5142
5298
  static getSettablePaths() {
5143
5299
  return {
@@ -5164,7 +5320,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5164
5320
  validate = true
5165
5321
  }) {
5166
5322
  const fileContent = await readFileContent(
5167
- (0, import_node_path36.join)(
5323
+ (0, import_node_path37.join)(
5168
5324
  baseDir,
5169
5325
  this.getSettablePaths().relativeDirPath,
5170
5326
  this.getSettablePaths().relativeFilePath
@@ -5194,7 +5350,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5194
5350
  };
5195
5351
 
5196
5352
  // src/features/ignore/kilo-ignore.ts
5197
- var import_node_path37 = require("path");
5353
+ var import_node_path38 = require("path");
5198
5354
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5199
5355
  static getSettablePaths() {
5200
5356
  return {
@@ -5231,7 +5387,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5231
5387
  validate = true
5232
5388
  }) {
5233
5389
  const fileContent = await readFileContent(
5234
- (0, import_node_path37.join)(
5390
+ (0, import_node_path38.join)(
5235
5391
  baseDir,
5236
5392
  this.getSettablePaths().relativeDirPath,
5237
5393
  this.getSettablePaths().relativeFilePath
@@ -5261,7 +5417,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5261
5417
  };
5262
5418
 
5263
5419
  // src/features/ignore/kiro-ignore.ts
5264
- var import_node_path38 = require("path");
5420
+ var import_node_path39 = require("path");
5265
5421
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5266
5422
  static getSettablePaths() {
5267
5423
  return {
@@ -5288,7 +5444,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5288
5444
  validate = true
5289
5445
  }) {
5290
5446
  const fileContent = await readFileContent(
5291
- (0, import_node_path38.join)(
5447
+ (0, import_node_path39.join)(
5292
5448
  baseDir,
5293
5449
  this.getSettablePaths().relativeDirPath,
5294
5450
  this.getSettablePaths().relativeFilePath
@@ -5318,7 +5474,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5318
5474
  };
5319
5475
 
5320
5476
  // src/features/ignore/qwencode-ignore.ts
5321
- var import_node_path39 = require("path");
5477
+ var import_node_path40 = require("path");
5322
5478
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5323
5479
  static getSettablePaths() {
5324
5480
  return {
@@ -5345,7 +5501,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5345
5501
  validate = true
5346
5502
  }) {
5347
5503
  const fileContent = await readFileContent(
5348
- (0, import_node_path39.join)(
5504
+ (0, import_node_path40.join)(
5349
5505
  baseDir,
5350
5506
  this.getSettablePaths().relativeDirPath,
5351
5507
  this.getSettablePaths().relativeFilePath
@@ -5375,7 +5531,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5375
5531
  };
5376
5532
 
5377
5533
  // src/features/ignore/roo-ignore.ts
5378
- var import_node_path40 = require("path");
5534
+ var import_node_path41 = require("path");
5379
5535
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5380
5536
  static getSettablePaths() {
5381
5537
  return {
@@ -5402,7 +5558,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5402
5558
  validate = true
5403
5559
  }) {
5404
5560
  const fileContent = await readFileContent(
5405
- (0, import_node_path40.join)(
5561
+ (0, import_node_path41.join)(
5406
5562
  baseDir,
5407
5563
  this.getSettablePaths().relativeDirPath,
5408
5564
  this.getSettablePaths().relativeFilePath
@@ -5432,7 +5588,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5432
5588
  };
5433
5589
 
5434
5590
  // src/features/ignore/windsurf-ignore.ts
5435
- var import_node_path41 = require("path");
5591
+ var import_node_path42 = require("path");
5436
5592
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5437
5593
  static getSettablePaths() {
5438
5594
  return {
@@ -5459,7 +5615,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5459
5615
  validate = true
5460
5616
  }) {
5461
5617
  const fileContent = await readFileContent(
5462
- (0, import_node_path41.join)(
5618
+ (0, import_node_path42.join)(
5463
5619
  baseDir,
5464
5620
  this.getSettablePaths().relativeDirPath,
5465
5621
  this.getSettablePaths().relativeFilePath
@@ -5489,7 +5645,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5489
5645
  };
5490
5646
 
5491
5647
  // src/features/ignore/zed-ignore.ts
5492
- var import_node_path42 = require("path");
5648
+ var import_node_path43 = require("path");
5493
5649
  var import_es_toolkit3 = require("es-toolkit");
5494
5650
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5495
5651
  constructor(params) {
@@ -5526,7 +5682,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5526
5682
  }) {
5527
5683
  const fileContent = rulesyncIgnore.getFileContent();
5528
5684
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5529
- const filePath = (0, import_node_path42.join)(
5685
+ const filePath = (0, import_node_path43.join)(
5530
5686
  baseDir,
5531
5687
  this.getSettablePaths().relativeDirPath,
5532
5688
  this.getSettablePaths().relativeFilePath
@@ -5553,7 +5709,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5553
5709
  validate = true
5554
5710
  }) {
5555
5711
  const fileContent = await readFileContent(
5556
- (0, import_node_path42.join)(
5712
+ (0, import_node_path43.join)(
5557
5713
  baseDir,
5558
5714
  this.getSettablePaths().relativeDirPath,
5559
5715
  this.getSettablePaths().relativeFilePath
@@ -5599,7 +5755,7 @@ var ignoreProcessorToolTargets = [
5599
5755
  "windsurf",
5600
5756
  "zed"
5601
5757
  ];
5602
- var IgnoreProcessorToolTargetSchema = import_mini18.z.enum(ignoreProcessorToolTargets);
5758
+ var IgnoreProcessorToolTargetSchema = import_mini19.z.enum(ignoreProcessorToolTargets);
5603
5759
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
5604
5760
  ["augmentcode", { class: AugmentcodeIgnore }],
5605
5761
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -5737,49 +5893,53 @@ var IgnoreProcessor = class extends FeatureProcessor {
5737
5893
  };
5738
5894
 
5739
5895
  // src/features/mcp/mcp-processor.ts
5740
- var import_mini22 = require("zod/mini");
5896
+ var import_mini23 = require("zod/mini");
5741
5897
 
5742
5898
  // src/features/mcp/claudecode-mcp.ts
5743
- var import_node_path44 = require("path");
5899
+ var import_node_path45 = require("path");
5744
5900
 
5745
5901
  // src/features/mcp/rulesync-mcp.ts
5746
- var import_node_path43 = require("path");
5902
+ var import_node_path44 = require("path");
5747
5903
  var import_object = require("es-toolkit/object");
5748
- var import_mini20 = require("zod/mini");
5904
+ var import_mini21 = require("zod/mini");
5749
5905
 
5750
5906
  // src/types/mcp.ts
5751
- var import_mini19 = require("zod/mini");
5752
- var McpServerSchema = import_mini19.z.object({
5753
- type: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
5754
- command: import_mini19.z.optional(import_mini19.z.union([import_mini19.z.string(), import_mini19.z.array(import_mini19.z.string())])),
5755
- args: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5756
- url: import_mini19.z.optional(import_mini19.z.string()),
5757
- httpUrl: import_mini19.z.optional(import_mini19.z.string()),
5758
- env: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
5759
- disabled: import_mini19.z.optional(import_mini19.z.boolean()),
5760
- networkTimeout: import_mini19.z.optional(import_mini19.z.number()),
5761
- timeout: import_mini19.z.optional(import_mini19.z.number()),
5762
- trust: import_mini19.z.optional(import_mini19.z.boolean()),
5763
- cwd: import_mini19.z.optional(import_mini19.z.string()),
5764
- transport: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
5765
- alwaysAllow: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5766
- tools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5767
- kiroAutoApprove: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5768
- kiroAutoBlock: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5769
- headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
5770
- enabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
5771
- disabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string()))
5907
+ var import_mini20 = require("zod/mini");
5908
+ var McpServerSchema = import_mini20.z.looseObject({
5909
+ type: import_mini20.z.optional(import_mini20.z.enum(["stdio", "sse", "http"])),
5910
+ command: import_mini20.z.optional(import_mini20.z.union([import_mini20.z.string(), import_mini20.z.array(import_mini20.z.string())])),
5911
+ args: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5912
+ url: import_mini20.z.optional(import_mini20.z.string()),
5913
+ httpUrl: import_mini20.z.optional(import_mini20.z.string()),
5914
+ env: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
5915
+ disabled: import_mini20.z.optional(import_mini20.z.boolean()),
5916
+ networkTimeout: import_mini20.z.optional(import_mini20.z.number()),
5917
+ timeout: import_mini20.z.optional(import_mini20.z.number()),
5918
+ trust: import_mini20.z.optional(import_mini20.z.boolean()),
5919
+ cwd: import_mini20.z.optional(import_mini20.z.string()),
5920
+ transport: import_mini20.z.optional(import_mini20.z.enum(["stdio", "sse", "http"])),
5921
+ alwaysAllow: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5922
+ tools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5923
+ kiroAutoApprove: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5924
+ kiroAutoBlock: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5925
+ headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
5926
+ enabledTools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
5927
+ disabledTools: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
5772
5928
  });
5773
- var McpServersSchema = import_mini19.z.record(import_mini19.z.string(), McpServerSchema);
5929
+ var McpServersSchema = import_mini20.z.record(import_mini20.z.string(), McpServerSchema);
5774
5930
 
5775
5931
  // src/features/mcp/rulesync-mcp.ts
5776
- var RulesyncMcpServerSchema = import_mini20.z.extend(McpServerSchema, {
5777
- targets: import_mini20.z.optional(RulesyncTargetsSchema),
5778
- description: import_mini20.z.optional(import_mini20.z.string()),
5779
- exposed: import_mini20.z.optional(import_mini20.z.boolean())
5932
+ var RulesyncMcpServerSchema = import_mini21.z.extend(McpServerSchema, {
5933
+ targets: import_mini21.z.optional(RulesyncTargetsSchema),
5934
+ description: import_mini21.z.optional(import_mini21.z.string()),
5935
+ exposed: import_mini21.z.optional(import_mini21.z.boolean())
5780
5936
  });
5781
- var RulesyncMcpConfigSchema = import_mini20.z.object({
5782
- mcpServers: import_mini20.z.record(import_mini20.z.string(), RulesyncMcpServerSchema)
5937
+ var RulesyncMcpConfigSchema = import_mini21.z.object({
5938
+ mcpServers: import_mini21.z.record(import_mini21.z.string(), RulesyncMcpServerSchema)
5939
+ });
5940
+ var RulesyncMcpFileSchema = import_mini21.z.looseObject({
5941
+ $schema: import_mini21.z.optional(import_mini21.z.string()),
5942
+ ...RulesyncMcpConfigSchema.shape
5783
5943
  });
5784
5944
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5785
5945
  json;
@@ -5806,7 +5966,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5806
5966
  };
5807
5967
  }
5808
5968
  validate() {
5809
- const result = RulesyncMcpConfigSchema.safeParse(this.json);
5969
+ const result = RulesyncMcpFileSchema.safeParse(this.json);
5810
5970
  if (!result.success) {
5811
5971
  return { success: false, error: result.error };
5812
5972
  }
@@ -5815,12 +5975,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5815
5975
  static async fromFile({ validate = true }) {
5816
5976
  const baseDir = process.cwd();
5817
5977
  const paths = this.getSettablePaths();
5818
- const recommendedPath = (0, import_node_path43.join)(
5978
+ const recommendedPath = (0, import_node_path44.join)(
5819
5979
  baseDir,
5820
5980
  paths.recommended.relativeDirPath,
5821
5981
  paths.recommended.relativeFilePath
5822
5982
  );
5823
- const legacyPath = (0, import_node_path43.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5983
+ const legacyPath = (0, import_node_path44.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5824
5984
  if (await fileExists(recommendedPath)) {
5825
5985
  const fileContent2 = await readFileContent(recommendedPath);
5826
5986
  return new _RulesyncMcp({
@@ -5909,11 +6069,17 @@ var ToolMcp = class extends ToolFile {
5909
6069
  toRulesyncMcpDefault({
5910
6070
  fileContent = void 0
5911
6071
  } = {}) {
6072
+ const content = fileContent ?? this.fileContent;
6073
+ const { $schema: _, ...json } = JSON.parse(content);
6074
+ const withSchema = {
6075
+ $schema: RULESYNC_MCP_SCHEMA_URL,
6076
+ ...json
6077
+ };
5912
6078
  return new RulesyncMcp({
5913
6079
  baseDir: this.baseDir,
5914
6080
  relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5915
- relativeFilePath: ".mcp.json",
5916
- fileContent: fileContent ?? this.fileContent
6081
+ relativeFilePath: RULESYNC_MCP_FILE_NAME,
6082
+ fileContent: JSON.stringify(withSchema, null, 2)
5917
6083
  });
5918
6084
  }
5919
6085
  static async fromFile(_params) {
@@ -5968,7 +6134,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5968
6134
  global = false
5969
6135
  }) {
5970
6136
  const paths = this.getSettablePaths({ global });
5971
- const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6137
+ const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5972
6138
  const json = JSON.parse(fileContent);
5973
6139
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5974
6140
  return new _ClaudecodeMcp({
@@ -5987,7 +6153,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5987
6153
  }) {
5988
6154
  const paths = this.getSettablePaths({ global });
5989
6155
  const fileContent = await readOrInitializeFileContent(
5990
- (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6156
+ (0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5991
6157
  JSON.stringify({ mcpServers: {} }, null, 2)
5992
6158
  );
5993
6159
  const json = JSON.parse(fileContent);
@@ -6026,7 +6192,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6026
6192
  };
6027
6193
 
6028
6194
  // src/features/mcp/cline-mcp.ts
6029
- var import_node_path45 = require("path");
6195
+ var import_node_path46 = require("path");
6030
6196
  var ClineMcp = class _ClineMcp extends ToolMcp {
6031
6197
  json;
6032
6198
  constructor(params) {
@@ -6047,7 +6213,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6047
6213
  validate = true
6048
6214
  }) {
6049
6215
  const fileContent = await readFileContent(
6050
- (0, import_node_path45.join)(
6216
+ (0, import_node_path46.join)(
6051
6217
  baseDir,
6052
6218
  this.getSettablePaths().relativeDirPath,
6053
6219
  this.getSettablePaths().relativeFilePath
@@ -6096,7 +6262,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6096
6262
  };
6097
6263
 
6098
6264
  // src/features/mcp/codexcli-mcp.ts
6099
- var import_node_path46 = require("path");
6265
+ var import_node_path47 = require("path");
6100
6266
  var smolToml = __toESM(require("smol-toml"), 1);
6101
6267
  function convertFromCodexFormat(codexMcp) {
6102
6268
  const result = {};
@@ -6179,7 +6345,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6179
6345
  global = false
6180
6346
  }) {
6181
6347
  const paths = this.getSettablePaths({ global });
6182
- const fileContent = await readFileContentOrNull((0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6348
+ const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6183
6349
  return new _CodexcliMcp({
6184
6350
  baseDir,
6185
6351
  relativeDirPath: paths.relativeDirPath,
@@ -6195,7 +6361,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6195
6361
  global = false
6196
6362
  }) {
6197
6363
  const paths = this.getSettablePaths({ global });
6198
- const configTomlFilePath = (0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6364
+ const configTomlFilePath = (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6199
6365
  const configTomlFileContent = await readOrInitializeFileContent(
6200
6366
  configTomlFilePath,
6201
6367
  smolToml.stringify({})
@@ -6216,10 +6382,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6216
6382
  toRulesyncMcp() {
6217
6383
  const mcpServers = this.toml.mcp_servers ?? {};
6218
6384
  const converted = convertFromCodexFormat(mcpServers);
6219
- return new RulesyncMcp({
6220
- baseDir: this.baseDir,
6221
- relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
6222
- relativeFilePath: ".mcp.json",
6385
+ return this.toRulesyncMcpDefault({
6223
6386
  fileContent: JSON.stringify({ mcpServers: converted }, null, 2)
6224
6387
  });
6225
6388
  }
@@ -6252,7 +6415,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6252
6415
  };
6253
6416
 
6254
6417
  // src/features/mcp/copilot-mcp.ts
6255
- var import_node_path47 = require("path");
6418
+ var import_node_path48 = require("path");
6256
6419
  function convertToCopilotFormat(mcpServers) {
6257
6420
  return { servers: mcpServers };
6258
6421
  }
@@ -6279,7 +6442,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6279
6442
  validate = true
6280
6443
  }) {
6281
6444
  const fileContent = await readFileContent(
6282
- (0, import_node_path47.join)(
6445
+ (0, import_node_path48.join)(
6283
6446
  baseDir,
6284
6447
  this.getSettablePaths().relativeDirPath,
6285
6448
  this.getSettablePaths().relativeFilePath
@@ -6332,7 +6495,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6332
6495
  };
6333
6496
 
6334
6497
  // src/features/mcp/cursor-mcp.ts
6335
- var import_node_path48 = require("path");
6498
+ var import_node_path49 = require("path");
6336
6499
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
6337
6500
  function isMcpServers(value) {
6338
6501
  return value !== void 0 && value !== null && typeof value === "object";
@@ -6382,7 +6545,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6382
6545
  this.json = JSON.parse(this.fileContent);
6383
6546
  } catch (error) {
6384
6547
  throw new Error(
6385
- `Failed to parse Cursor MCP config at ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
6548
+ `Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
6386
6549
  { cause: error }
6387
6550
  );
6388
6551
  }
@@ -6408,14 +6571,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6408
6571
  global = false
6409
6572
  }) {
6410
6573
  const paths = this.getSettablePaths({ global });
6411
- const filePath = (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6574
+ const filePath = (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6412
6575
  const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
6413
6576
  let json;
6414
6577
  try {
6415
6578
  json = JSON.parse(fileContent);
6416
6579
  } catch (error) {
6417
6580
  throw new Error(
6418
- `Failed to parse Cursor MCP config at ${(0, import_node_path48.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6581
+ `Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6419
6582
  { cause: error }
6420
6583
  );
6421
6584
  }
@@ -6437,7 +6600,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6437
6600
  }) {
6438
6601
  const paths = this.getSettablePaths({ global });
6439
6602
  const fileContent = await readOrInitializeFileContent(
6440
- (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6603
+ (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6441
6604
  JSON.stringify({ mcpServers: {} }, null, 2)
6442
6605
  );
6443
6606
  let json;
@@ -6445,7 +6608,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6445
6608
  json = JSON.parse(fileContent);
6446
6609
  } catch (error) {
6447
6610
  throw new Error(
6448
- `Failed to parse Cursor MCP config at ${(0, import_node_path48.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6611
+ `Failed to parse Cursor MCP config at ${(0, import_node_path49.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6449
6612
  { cause: error }
6450
6613
  );
6451
6614
  }
@@ -6469,12 +6632,8 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6469
6632
  ...this.json,
6470
6633
  mcpServers: transformedServers
6471
6634
  };
6472
- return new RulesyncMcp({
6473
- baseDir: this.baseDir,
6474
- relativeDirPath: this.relativeDirPath,
6475
- relativeFilePath: "rulesync.mcp.json",
6476
- fileContent: JSON.stringify(transformedJson),
6477
- validate: true
6635
+ return this.toRulesyncMcpDefault({
6636
+ fileContent: JSON.stringify(transformedJson, null, 2)
6478
6637
  });
6479
6638
  }
6480
6639
  validate() {
@@ -6498,7 +6657,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6498
6657
  };
6499
6658
 
6500
6659
  // src/features/mcp/factorydroid-mcp.ts
6501
- var import_node_path49 = require("path");
6660
+ var import_node_path50 = require("path");
6502
6661
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6503
6662
  json;
6504
6663
  constructor(params) {
@@ -6519,7 +6678,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6519
6678
  validate = true
6520
6679
  }) {
6521
6680
  const fileContent = await readFileContent(
6522
- (0, import_node_path49.join)(
6681
+ (0, import_node_path50.join)(
6523
6682
  baseDir,
6524
6683
  this.getSettablePaths().relativeDirPath,
6525
6684
  this.getSettablePaths().relativeFilePath
@@ -6552,13 +6711,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6552
6711
  });
6553
6712
  }
6554
6713
  toRulesyncMcp() {
6555
- return new RulesyncMcp({
6556
- baseDir: this.baseDir,
6557
- relativeDirPath: this.relativeDirPath,
6558
- relativeFilePath: "rulesync.mcp.json",
6559
- fileContent: JSON.stringify(this.json),
6560
- validate: true
6561
- });
6714
+ return this.toRulesyncMcpDefault();
6562
6715
  }
6563
6716
  validate() {
6564
6717
  return { success: true, error: null };
@@ -6579,7 +6732,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6579
6732
  };
6580
6733
 
6581
6734
  // src/features/mcp/geminicli-mcp.ts
6582
- var import_node_path50 = require("path");
6735
+ var import_node_path51 = require("path");
6583
6736
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6584
6737
  json;
6585
6738
  constructor(params) {
@@ -6607,7 +6760,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6607
6760
  global = false
6608
6761
  }) {
6609
6762
  const paths = this.getSettablePaths({ global });
6610
- const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6763
+ const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6611
6764
  const json = JSON.parse(fileContent);
6612
6765
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6613
6766
  return new _GeminiCliMcp({
@@ -6626,7 +6779,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6626
6779
  }) {
6627
6780
  const paths = this.getSettablePaths({ global });
6628
6781
  const fileContent = await readOrInitializeFileContent(
6629
- (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6782
+ (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6630
6783
  JSON.stringify({ mcpServers: {} }, null, 2)
6631
6784
  );
6632
6785
  const json = JSON.parse(fileContent);
@@ -6671,7 +6824,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6671
6824
  };
6672
6825
 
6673
6826
  // src/features/mcp/junie-mcp.ts
6674
- var import_node_path51 = require("path");
6827
+ var import_node_path52 = require("path");
6675
6828
  var JunieMcp = class _JunieMcp extends ToolMcp {
6676
6829
  json;
6677
6830
  constructor(params) {
@@ -6683,7 +6836,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6683
6836
  }
6684
6837
  static getSettablePaths() {
6685
6838
  return {
6686
- relativeDirPath: (0, import_node_path51.join)(".junie", "mcp"),
6839
+ relativeDirPath: (0, import_node_path52.join)(".junie", "mcp"),
6687
6840
  relativeFilePath: "mcp.json"
6688
6841
  };
6689
6842
  }
@@ -6692,7 +6845,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6692
6845
  validate = true
6693
6846
  }) {
6694
6847
  const fileContent = await readFileContent(
6695
- (0, import_node_path51.join)(
6848
+ (0, import_node_path52.join)(
6696
6849
  baseDir,
6697
6850
  this.getSettablePaths().relativeDirPath,
6698
6851
  this.getSettablePaths().relativeFilePath
@@ -6741,7 +6894,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6741
6894
  };
6742
6895
 
6743
6896
  // src/features/mcp/kilo-mcp.ts
6744
- var import_node_path52 = require("path");
6897
+ var import_node_path53 = require("path");
6745
6898
  var KiloMcp = class _KiloMcp extends ToolMcp {
6746
6899
  json;
6747
6900
  constructor(params) {
@@ -6762,7 +6915,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6762
6915
  validate = true
6763
6916
  }) {
6764
6917
  const paths = this.getSettablePaths();
6765
- const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6918
+ const fileContent = await readFileContentOrNull((0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6766
6919
  return new _KiloMcp({
6767
6920
  baseDir,
6768
6921
  relativeDirPath: paths.relativeDirPath,
@@ -6810,7 +6963,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6810
6963
  };
6811
6964
 
6812
6965
  // src/features/mcp/kiro-mcp.ts
6813
- var import_node_path53 = require("path");
6966
+ var import_node_path54 = require("path");
6814
6967
  var KiroMcp = class _KiroMcp extends ToolMcp {
6815
6968
  json;
6816
6969
  constructor(params) {
@@ -6822,7 +6975,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6822
6975
  }
6823
6976
  static getSettablePaths() {
6824
6977
  return {
6825
- relativeDirPath: (0, import_node_path53.join)(".kiro", "settings"),
6978
+ relativeDirPath: (0, import_node_path54.join)(".kiro", "settings"),
6826
6979
  relativeFilePath: "mcp.json"
6827
6980
  };
6828
6981
  }
@@ -6831,7 +6984,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6831
6984
  validate = true
6832
6985
  }) {
6833
6986
  const paths = this.getSettablePaths();
6834
- const fileContent = await readFileContentOrNull((0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6987
+ const fileContent = await readFileContentOrNull((0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6835
6988
  return new _KiroMcp({
6836
6989
  baseDir,
6837
6990
  relativeDirPath: paths.relativeDirPath,
@@ -6879,30 +7032,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6879
7032
  };
6880
7033
 
6881
7034
  // src/features/mcp/opencode-mcp.ts
6882
- var import_node_path54 = require("path");
7035
+ var import_node_path55 = require("path");
6883
7036
  var import_jsonc_parser2 = require("jsonc-parser");
6884
- var import_mini21 = require("zod/mini");
6885
- var OpencodeMcpLocalServerSchema = import_mini21.z.object({
6886
- type: import_mini21.z.literal("local"),
6887
- command: import_mini21.z.array(import_mini21.z.string()),
6888
- environment: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6889
- enabled: import_mini21.z._default(import_mini21.z.boolean(), true),
6890
- cwd: import_mini21.z.optional(import_mini21.z.string())
7037
+ var import_mini22 = require("zod/mini");
7038
+ var OpencodeMcpLocalServerSchema = import_mini22.z.object({
7039
+ type: import_mini22.z.literal("local"),
7040
+ command: import_mini22.z.array(import_mini22.z.string()),
7041
+ environment: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
7042
+ enabled: import_mini22.z._default(import_mini22.z.boolean(), true),
7043
+ cwd: import_mini22.z.optional(import_mini22.z.string())
6891
7044
  });
6892
- var OpencodeMcpRemoteServerSchema = import_mini21.z.object({
6893
- type: import_mini21.z.literal("remote"),
6894
- url: import_mini21.z.string(),
6895
- headers: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
6896
- enabled: import_mini21.z._default(import_mini21.z.boolean(), true)
7045
+ var OpencodeMcpRemoteServerSchema = import_mini22.z.object({
7046
+ type: import_mini22.z.literal("remote"),
7047
+ url: import_mini22.z.string(),
7048
+ headers: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
7049
+ enabled: import_mini22.z._default(import_mini22.z.boolean(), true)
6897
7050
  });
6898
- var OpencodeMcpServerSchema = import_mini21.z.union([
7051
+ var OpencodeMcpServerSchema = import_mini22.z.union([
6899
7052
  OpencodeMcpLocalServerSchema,
6900
7053
  OpencodeMcpRemoteServerSchema
6901
7054
  ]);
6902
- var OpencodeConfigSchema = import_mini21.z.looseObject({
6903
- $schema: import_mini21.z.optional(import_mini21.z.string()),
6904
- mcp: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), OpencodeMcpServerSchema)),
6905
- tools: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.boolean()))
7055
+ var OpencodeConfigSchema = import_mini22.z.looseObject({
7056
+ $schema: import_mini22.z.optional(import_mini22.z.string()),
7057
+ mcp: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), OpencodeMcpServerSchema)),
7058
+ tools: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.boolean()))
6906
7059
  });
6907
7060
  function convertFromOpencodeFormat(opencodeMcp, tools) {
6908
7061
  return Object.fromEntries(
@@ -7020,7 +7173,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7020
7173
  static getSettablePaths({ global } = {}) {
7021
7174
  if (global) {
7022
7175
  return {
7023
- relativeDirPath: (0, import_node_path54.join)(".config", "opencode"),
7176
+ relativeDirPath: (0, import_node_path55.join)(".config", "opencode"),
7024
7177
  relativeFilePath: "opencode.json"
7025
7178
  };
7026
7179
  }
@@ -7035,11 +7188,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7035
7188
  global = false
7036
7189
  }) {
7037
7190
  const basePaths = this.getSettablePaths({ global });
7038
- const jsonDir = (0, import_node_path54.join)(baseDir, basePaths.relativeDirPath);
7191
+ const jsonDir = (0, import_node_path55.join)(baseDir, basePaths.relativeDirPath);
7039
7192
  let fileContent = null;
7040
7193
  let relativeFilePath = "opencode.jsonc";
7041
- const jsoncPath = (0, import_node_path54.join)(jsonDir, "opencode.jsonc");
7042
- const jsonPath = (0, import_node_path54.join)(jsonDir, "opencode.json");
7194
+ const jsoncPath = (0, import_node_path55.join)(jsonDir, "opencode.jsonc");
7195
+ const jsonPath = (0, import_node_path55.join)(jsonDir, "opencode.json");
7043
7196
  fileContent = await readFileContentOrNull(jsoncPath);
7044
7197
  if (!fileContent) {
7045
7198
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7065,11 +7218,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7065
7218
  global = false
7066
7219
  }) {
7067
7220
  const basePaths = this.getSettablePaths({ global });
7068
- const jsonDir = (0, import_node_path54.join)(baseDir, basePaths.relativeDirPath);
7221
+ const jsonDir = (0, import_node_path55.join)(baseDir, basePaths.relativeDirPath);
7069
7222
  let fileContent = null;
7070
7223
  let relativeFilePath = "opencode.jsonc";
7071
- const jsoncPath = (0, import_node_path54.join)(jsonDir, "opencode.jsonc");
7072
- const jsonPath = (0, import_node_path54.join)(jsonDir, "opencode.json");
7224
+ const jsoncPath = (0, import_node_path55.join)(jsonDir, "opencode.jsonc");
7225
+ const jsonPath = (0, import_node_path55.join)(jsonDir, "opencode.json");
7073
7226
  fileContent = await readFileContentOrNull(jsoncPath);
7074
7227
  if (!fileContent) {
7075
7228
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7130,7 +7283,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7130
7283
  };
7131
7284
 
7132
7285
  // src/features/mcp/roo-mcp.ts
7133
- var import_node_path55 = require("path");
7286
+ var import_node_path56 = require("path");
7134
7287
  function isRooMcpServers(value) {
7135
7288
  return value !== void 0 && value !== null && typeof value === "object";
7136
7289
  }
@@ -7182,7 +7335,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
7182
7335
  validate = true
7183
7336
  }) {
7184
7337
  const fileContent = await readFileContent(
7185
- (0, import_node_path55.join)(
7338
+ (0, import_node_path56.join)(
7186
7339
  baseDir,
7187
7340
  this.getSettablePaths().relativeDirPath,
7188
7341
  this.getSettablePaths().relativeFilePath
@@ -7253,7 +7406,7 @@ var mcpProcessorToolTargetTuple = [
7253
7406
  "opencode",
7254
7407
  "roo"
7255
7408
  ];
7256
- var McpProcessorToolTargetSchema = import_mini22.z.enum(mcpProcessorToolTargetTuple);
7409
+ var McpProcessorToolTargetSchema = import_mini23.z.enum(mcpProcessorToolTargetTuple);
7257
7410
  var toolMcpFactories = /* @__PURE__ */ new Map([
7258
7411
  [
7259
7412
  "claudecode",
@@ -7555,25 +7708,25 @@ var McpProcessor = class extends FeatureProcessor {
7555
7708
  };
7556
7709
 
7557
7710
  // src/features/rules/rules-processor.ts
7558
- var import_node_path117 = require("path");
7711
+ var import_node_path118 = require("path");
7559
7712
  var import_toon = require("@toon-format/toon");
7560
- var import_mini56 = require("zod/mini");
7713
+ var import_mini57 = require("zod/mini");
7561
7714
 
7562
7715
  // src/constants/general.ts
7563
7716
  var SKILL_FILE_NAME = "SKILL.md";
7564
7717
 
7565
7718
  // src/features/skills/agentsmd-skill.ts
7566
- var import_node_path59 = require("path");
7719
+ var import_node_path60 = require("path");
7567
7720
 
7568
7721
  // src/features/skills/simulated-skill.ts
7569
- var import_node_path58 = require("path");
7570
- var import_mini23 = require("zod/mini");
7722
+ var import_node_path59 = require("path");
7723
+ var import_mini24 = require("zod/mini");
7571
7724
 
7572
7725
  // src/features/skills/tool-skill.ts
7573
- var import_node_path57 = require("path");
7726
+ var import_node_path58 = require("path");
7574
7727
 
7575
7728
  // src/types/ai-dir.ts
7576
- var import_node_path56 = __toESM(require("path"), 1);
7729
+ var import_node_path57 = __toESM(require("path"), 1);
7577
7730
  var AiDir = class {
7578
7731
  /**
7579
7732
  * @example "."
@@ -7607,7 +7760,7 @@ var AiDir = class {
7607
7760
  otherFiles = [],
7608
7761
  global = false
7609
7762
  }) {
7610
- if (dirName.includes(import_node_path56.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7763
+ if (dirName.includes(import_node_path57.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7611
7764
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7612
7765
  }
7613
7766
  this.baseDir = baseDir;
@@ -7630,11 +7783,11 @@ var AiDir = class {
7630
7783
  return this.dirName;
7631
7784
  }
7632
7785
  getDirPath() {
7633
- const fullPath = import_node_path56.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7634
- const resolvedFull = (0, import_node_path56.resolve)(fullPath);
7635
- const resolvedBase = (0, import_node_path56.resolve)(this.baseDir);
7636
- const rel = (0, import_node_path56.relative)(resolvedBase, resolvedFull);
7637
- if (rel.startsWith("..") || import_node_path56.default.isAbsolute(rel)) {
7786
+ const fullPath = import_node_path57.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7787
+ const resolvedFull = (0, import_node_path57.resolve)(fullPath);
7788
+ const resolvedBase = (0, import_node_path57.resolve)(this.baseDir);
7789
+ const rel = (0, import_node_path57.relative)(resolvedBase, resolvedFull);
7790
+ if (rel.startsWith("..") || import_node_path57.default.isAbsolute(rel)) {
7638
7791
  throw new Error(
7639
7792
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7640
7793
  );
@@ -7648,7 +7801,7 @@ var AiDir = class {
7648
7801
  return this.otherFiles;
7649
7802
  }
7650
7803
  getRelativePathFromCwd() {
7651
- return import_node_path56.default.join(this.relativeDirPath, this.dirName);
7804
+ return import_node_path57.default.join(this.relativeDirPath, this.dirName);
7652
7805
  }
7653
7806
  getGlobal() {
7654
7807
  return this.global;
@@ -7667,15 +7820,15 @@ var AiDir = class {
7667
7820
  * @returns Array of files with their relative paths and buffers
7668
7821
  */
7669
7822
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7670
- const dirPath = (0, import_node_path56.join)(baseDir, relativeDirPath, dirName);
7671
- const glob = (0, import_node_path56.join)(dirPath, "**", "*");
7823
+ const dirPath = (0, import_node_path57.join)(baseDir, relativeDirPath, dirName);
7824
+ const glob = (0, import_node_path57.join)(dirPath, "**", "*");
7672
7825
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7673
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path56.basename)(filePath) !== excludeFileName);
7826
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path57.basename)(filePath) !== excludeFileName);
7674
7827
  const files = await Promise.all(
7675
7828
  filteredPaths.map(async (filePath) => {
7676
7829
  const fileBuffer = await readFileBuffer(filePath);
7677
7830
  return {
7678
- relativeFilePathToDirPath: (0, import_node_path56.relative)(dirPath, filePath),
7831
+ relativeFilePathToDirPath: (0, import_node_path57.relative)(dirPath, filePath),
7679
7832
  fileBuffer
7680
7833
  };
7681
7834
  })
@@ -7766,8 +7919,8 @@ var ToolSkill = class extends AiDir {
7766
7919
  }) {
7767
7920
  const settablePaths = getSettablePaths({ global });
7768
7921
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7769
- const skillDirPath = (0, import_node_path57.join)(baseDir, actualRelativeDirPath, dirName);
7770
- const skillFilePath = (0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME);
7922
+ const skillDirPath = (0, import_node_path58.join)(baseDir, actualRelativeDirPath, dirName);
7923
+ const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
7771
7924
  if (!await fileExists(skillFilePath)) {
7772
7925
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7773
7926
  }
@@ -7791,16 +7944,16 @@ var ToolSkill = class extends AiDir {
7791
7944
  }
7792
7945
  requireMainFileFrontmatter() {
7793
7946
  if (!this.mainFile?.frontmatter) {
7794
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path57.join)(this.relativeDirPath, this.dirName)}`);
7947
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path58.join)(this.relativeDirPath, this.dirName)}`);
7795
7948
  }
7796
7949
  return this.mainFile.frontmatter;
7797
7950
  }
7798
7951
  };
7799
7952
 
7800
7953
  // src/features/skills/simulated-skill.ts
7801
- var SimulatedSkillFrontmatterSchema = import_mini23.z.looseObject({
7802
- name: import_mini23.z.string(),
7803
- description: import_mini23.z.string()
7954
+ var SimulatedSkillFrontmatterSchema = import_mini24.z.looseObject({
7955
+ name: import_mini24.z.string(),
7956
+ description: import_mini24.z.string()
7804
7957
  });
7805
7958
  var SimulatedSkill = class extends ToolSkill {
7806
7959
  frontmatter;
@@ -7831,7 +7984,7 @@ var SimulatedSkill = class extends ToolSkill {
7831
7984
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7832
7985
  if (!result.success) {
7833
7986
  throw new Error(
7834
- `Invalid frontmatter in ${(0, import_node_path58.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7987
+ `Invalid frontmatter in ${(0, import_node_path59.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7835
7988
  );
7836
7989
  }
7837
7990
  }
@@ -7890,8 +8043,8 @@ var SimulatedSkill = class extends ToolSkill {
7890
8043
  }) {
7891
8044
  const settablePaths = this.getSettablePaths();
7892
8045
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7893
- const skillDirPath = (0, import_node_path58.join)(baseDir, actualRelativeDirPath, dirName);
7894
- const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
8046
+ const skillDirPath = (0, import_node_path59.join)(baseDir, actualRelativeDirPath, dirName);
8047
+ const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
7895
8048
  if (!await fileExists(skillFilePath)) {
7896
8049
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7897
8050
  }
@@ -7968,7 +8121,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7968
8121
  throw new Error("AgentsmdSkill does not support global mode.");
7969
8122
  }
7970
8123
  return {
7971
- relativeDirPath: (0, import_node_path59.join)(".agents", "skills")
8124
+ relativeDirPath: (0, import_node_path60.join)(".agents", "skills")
7972
8125
  };
7973
8126
  }
7974
8127
  static async fromDir(params) {
@@ -7995,11 +8148,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7995
8148
  };
7996
8149
 
7997
8150
  // src/features/skills/factorydroid-skill.ts
7998
- var import_node_path60 = require("path");
8151
+ var import_node_path61 = require("path");
7999
8152
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
8000
8153
  static getSettablePaths(_options) {
8001
8154
  return {
8002
- relativeDirPath: (0, import_node_path60.join)(".factory", "skills")
8155
+ relativeDirPath: (0, import_node_path61.join)(".factory", "skills")
8003
8156
  };
8004
8157
  }
8005
8158
  static async fromDir(params) {
@@ -8026,11 +8179,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
8026
8179
  };
8027
8180
 
8028
8181
  // src/features/skills/skills-processor.ts
8029
- var import_node_path78 = require("path");
8030
- var import_mini39 = require("zod/mini");
8182
+ var import_node_path79 = require("path");
8183
+ var import_mini40 = require("zod/mini");
8031
8184
 
8032
8185
  // src/types/dir-feature-processor.ts
8033
- var import_node_path61 = require("path");
8186
+ var import_node_path62 = require("path");
8034
8187
  var DirFeatureProcessor = class {
8035
8188
  baseDir;
8036
8189
  dryRun;
@@ -8067,7 +8220,7 @@ var DirFeatureProcessor = class {
8067
8220
  const mainFile = aiDir.getMainFile();
8068
8221
  let mainFileContent;
8069
8222
  if (mainFile) {
8070
- const mainFilePath = (0, import_node_path61.join)(dirPath, mainFile.name);
8223
+ const mainFilePath = (0, import_node_path62.join)(dirPath, mainFile.name);
8071
8224
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
8072
8225
  avoidBlockScalars: this.avoidBlockScalars
8073
8226
  });
@@ -8083,7 +8236,7 @@ var DirFeatureProcessor = class {
8083
8236
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
8084
8237
  otherFileContents.push(contentWithNewline);
8085
8238
  if (!dirHasChanges) {
8086
- const filePath = (0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath);
8239
+ const filePath = (0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath);
8087
8240
  const existingContent = await readFileContentOrNull(filePath);
8088
8241
  if (existingContent !== contentWithNewline) {
8089
8242
  dirHasChanges = true;
@@ -8097,22 +8250,22 @@ var DirFeatureProcessor = class {
8097
8250
  if (this.dryRun) {
8098
8251
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
8099
8252
  if (mainFile) {
8100
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path61.join)(dirPath, mainFile.name)}`);
8101
- changedPaths.push((0, import_node_path61.join)(relativeDir, mainFile.name));
8253
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path62.join)(dirPath, mainFile.name)}`);
8254
+ changedPaths.push((0, import_node_path62.join)(relativeDir, mainFile.name));
8102
8255
  }
8103
8256
  for (const file of otherFiles) {
8104
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath)}`);
8105
- changedPaths.push((0, import_node_path61.join)(relativeDir, file.relativeFilePathToDirPath));
8257
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath)}`);
8258
+ changedPaths.push((0, import_node_path62.join)(relativeDir, file.relativeFilePathToDirPath));
8106
8259
  }
8107
8260
  } else {
8108
8261
  await ensureDir(dirPath);
8109
8262
  if (mainFile && mainFileContent) {
8110
- const mainFilePath = (0, import_node_path61.join)(dirPath, mainFile.name);
8263
+ const mainFilePath = (0, import_node_path62.join)(dirPath, mainFile.name);
8111
8264
  await writeFileContent(mainFilePath, mainFileContent);
8112
- changedPaths.push((0, import_node_path61.join)(relativeDir, mainFile.name));
8265
+ changedPaths.push((0, import_node_path62.join)(relativeDir, mainFile.name));
8113
8266
  }
8114
8267
  for (const [i, file] of otherFiles.entries()) {
8115
- const filePath = (0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath);
8268
+ const filePath = (0, import_node_path62.join)(dirPath, file.relativeFilePathToDirPath);
8116
8269
  const content = otherFileContents[i];
8117
8270
  if (content === void 0) {
8118
8271
  throw new Error(
@@ -8120,7 +8273,7 @@ var DirFeatureProcessor = class {
8120
8273
  );
8121
8274
  }
8122
8275
  await writeFileContent(filePath, content);
8123
- changedPaths.push((0, import_node_path61.join)(relativeDir, file.relativeFilePathToDirPath));
8276
+ changedPaths.push((0, import_node_path62.join)(relativeDir, file.relativeFilePathToDirPath));
8124
8277
  }
8125
8278
  }
8126
8279
  changedCount++;
@@ -8152,40 +8305,40 @@ var DirFeatureProcessor = class {
8152
8305
  };
8153
8306
 
8154
8307
  // src/features/skills/agentsskills-skill.ts
8155
- var import_node_path63 = require("path");
8156
- var import_mini25 = require("zod/mini");
8308
+ var import_node_path64 = require("path");
8309
+ var import_mini26 = require("zod/mini");
8157
8310
 
8158
8311
  // src/features/skills/rulesync-skill.ts
8159
- var import_node_path62 = require("path");
8160
- var import_mini24 = require("zod/mini");
8161
- var RulesyncSkillFrontmatterSchemaInternal = import_mini24.z.looseObject({
8162
- name: import_mini24.z.string(),
8163
- description: import_mini24.z.string(),
8164
- targets: import_mini24.z._default(RulesyncTargetsSchema, ["*"]),
8165
- claudecode: import_mini24.z.optional(
8166
- import_mini24.z.looseObject({
8167
- "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string())),
8168
- model: import_mini24.z.optional(import_mini24.z.string()),
8169
- "disable-model-invocation": import_mini24.z.optional(import_mini24.z.boolean())
8312
+ var import_node_path63 = require("path");
8313
+ var import_mini25 = require("zod/mini");
8314
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini25.z.looseObject({
8315
+ name: import_mini25.z.string(),
8316
+ description: import_mini25.z.string(),
8317
+ targets: import_mini25.z._default(RulesyncTargetsSchema, ["*"]),
8318
+ claudecode: import_mini25.z.optional(
8319
+ import_mini25.z.looseObject({
8320
+ "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string())),
8321
+ model: import_mini25.z.optional(import_mini25.z.string()),
8322
+ "disable-model-invocation": import_mini25.z.optional(import_mini25.z.boolean())
8170
8323
  })
8171
8324
  ),
8172
- codexcli: import_mini24.z.optional(
8173
- import_mini24.z.looseObject({
8174
- "short-description": import_mini24.z.optional(import_mini24.z.string())
8325
+ codexcli: import_mini25.z.optional(
8326
+ import_mini25.z.looseObject({
8327
+ "short-description": import_mini25.z.optional(import_mini25.z.string())
8175
8328
  })
8176
8329
  ),
8177
- opencode: import_mini24.z.optional(
8178
- import_mini24.z.looseObject({
8179
- "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string()))
8330
+ opencode: import_mini25.z.optional(
8331
+ import_mini25.z.looseObject({
8332
+ "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
8180
8333
  })
8181
8334
  ),
8182
- copilot: import_mini24.z.optional(
8183
- import_mini24.z.looseObject({
8184
- license: import_mini24.z.optional(import_mini24.z.string())
8335
+ copilot: import_mini25.z.optional(
8336
+ import_mini25.z.looseObject({
8337
+ license: import_mini25.z.optional(import_mini25.z.string())
8185
8338
  })
8186
8339
  ),
8187
- cline: import_mini24.z.optional(import_mini24.z.looseObject({})),
8188
- roo: import_mini24.z.optional(import_mini24.z.looseObject({}))
8340
+ cline: import_mini25.z.optional(import_mini25.z.looseObject({})),
8341
+ roo: import_mini25.z.optional(import_mini25.z.looseObject({}))
8189
8342
  });
8190
8343
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
8191
8344
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -8225,7 +8378,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8225
8378
  }
8226
8379
  getFrontmatter() {
8227
8380
  if (!this.mainFile?.frontmatter) {
8228
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path62.join)(this.relativeDirPath, this.dirName)}`);
8381
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path63.join)(this.relativeDirPath, this.dirName)}`);
8229
8382
  }
8230
8383
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
8231
8384
  return result;
@@ -8251,8 +8404,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8251
8404
  dirName,
8252
8405
  global = false
8253
8406
  }) {
8254
- const skillDirPath = (0, import_node_path62.join)(baseDir, relativeDirPath, dirName);
8255
- const skillFilePath = (0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME);
8407
+ const skillDirPath = (0, import_node_path63.join)(baseDir, relativeDirPath, dirName);
8408
+ const skillFilePath = (0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME);
8256
8409
  if (!await fileExists(skillFilePath)) {
8257
8410
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8258
8411
  }
@@ -8282,14 +8435,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8282
8435
  };
8283
8436
 
8284
8437
  // src/features/skills/agentsskills-skill.ts
8285
- var AgentsSkillsSkillFrontmatterSchema = import_mini25.z.looseObject({
8286
- name: import_mini25.z.string(),
8287
- description: import_mini25.z.string()
8438
+ var AgentsSkillsSkillFrontmatterSchema = import_mini26.z.looseObject({
8439
+ name: import_mini26.z.string(),
8440
+ description: import_mini26.z.string()
8288
8441
  });
8289
8442
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8290
8443
  constructor({
8291
8444
  baseDir = process.cwd(),
8292
- relativeDirPath = (0, import_node_path63.join)(".agents", "skills"),
8445
+ relativeDirPath = (0, import_node_path64.join)(".agents", "skills"),
8293
8446
  dirName,
8294
8447
  frontmatter,
8295
8448
  body,
@@ -8321,7 +8474,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8321
8474
  throw new Error("AgentsSkillsSkill does not support global mode.");
8322
8475
  }
8323
8476
  return {
8324
- relativeDirPath: (0, import_node_path63.join)(".agents", "skills")
8477
+ relativeDirPath: (0, import_node_path64.join)(".agents", "skills")
8325
8478
  };
8326
8479
  }
8327
8480
  getFrontmatter() {
@@ -8401,9 +8554,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8401
8554
  });
8402
8555
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8403
8556
  if (!result.success) {
8404
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8557
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8405
8558
  throw new Error(
8406
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8559
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8407
8560
  );
8408
8561
  }
8409
8562
  return new _AgentsSkillsSkill({
@@ -8438,16 +8591,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8438
8591
  };
8439
8592
 
8440
8593
  // src/features/skills/antigravity-skill.ts
8441
- var import_node_path64 = require("path");
8442
- var import_mini26 = require("zod/mini");
8443
- var AntigravitySkillFrontmatterSchema = import_mini26.z.looseObject({
8444
- name: import_mini26.z.string(),
8445
- description: import_mini26.z.string()
8594
+ var import_node_path65 = require("path");
8595
+ var import_mini27 = require("zod/mini");
8596
+ var AntigravitySkillFrontmatterSchema = import_mini27.z.looseObject({
8597
+ name: import_mini27.z.string(),
8598
+ description: import_mini27.z.string()
8446
8599
  });
8447
8600
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8448
8601
  constructor({
8449
8602
  baseDir = process.cwd(),
8450
- relativeDirPath = (0, import_node_path64.join)(".agent", "skills"),
8603
+ relativeDirPath = (0, import_node_path65.join)(".agent", "skills"),
8451
8604
  dirName,
8452
8605
  frontmatter,
8453
8606
  body,
@@ -8479,11 +8632,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8479
8632
  } = {}) {
8480
8633
  if (global) {
8481
8634
  return {
8482
- relativeDirPath: (0, import_node_path64.join)(".gemini", "antigravity", "skills")
8635
+ relativeDirPath: (0, import_node_path65.join)(".gemini", "antigravity", "skills")
8483
8636
  };
8484
8637
  }
8485
8638
  return {
8486
- relativeDirPath: (0, import_node_path64.join)(".agent", "skills")
8639
+ relativeDirPath: (0, import_node_path65.join)(".agent", "skills")
8487
8640
  };
8488
8641
  }
8489
8642
  getFrontmatter() {
@@ -8563,9 +8716,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8563
8716
  });
8564
8717
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
8565
8718
  if (!result.success) {
8566
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8719
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8567
8720
  throw new Error(
8568
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8721
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8569
8722
  );
8570
8723
  }
8571
8724
  return new _AntigravitySkill({
@@ -8599,19 +8752,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8599
8752
  };
8600
8753
 
8601
8754
  // src/features/skills/claudecode-skill.ts
8602
- var import_node_path65 = require("path");
8603
- var import_mini27 = require("zod/mini");
8604
- var ClaudecodeSkillFrontmatterSchema = import_mini27.z.looseObject({
8605
- name: import_mini27.z.string(),
8606
- description: import_mini27.z.string(),
8607
- "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string())),
8608
- model: import_mini27.z.optional(import_mini27.z.string()),
8609
- "disable-model-invocation": import_mini27.z.optional(import_mini27.z.boolean())
8755
+ var import_node_path66 = require("path");
8756
+ var import_mini28 = require("zod/mini");
8757
+ var ClaudecodeSkillFrontmatterSchema = import_mini28.z.looseObject({
8758
+ name: import_mini28.z.string(),
8759
+ description: import_mini28.z.string(),
8760
+ "allowed-tools": import_mini28.z.optional(import_mini28.z.array(import_mini28.z.string())),
8761
+ model: import_mini28.z.optional(import_mini28.z.string()),
8762
+ "disable-model-invocation": import_mini28.z.optional(import_mini28.z.boolean())
8610
8763
  });
8611
8764
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8612
8765
  constructor({
8613
8766
  baseDir = process.cwd(),
8614
- relativeDirPath = (0, import_node_path65.join)(".claude", "skills"),
8767
+ relativeDirPath = (0, import_node_path66.join)(".claude", "skills"),
8615
8768
  dirName,
8616
8769
  frontmatter,
8617
8770
  body,
@@ -8642,7 +8795,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8642
8795
  global: _global = false
8643
8796
  } = {}) {
8644
8797
  return {
8645
- relativeDirPath: (0, import_node_path65.join)(".claude", "skills")
8798
+ relativeDirPath: (0, import_node_path66.join)(".claude", "skills")
8646
8799
  };
8647
8800
  }
8648
8801
  getFrontmatter() {
@@ -8739,9 +8892,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8739
8892
  });
8740
8893
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8741
8894
  if (!result.success) {
8742
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8895
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8743
8896
  throw new Error(
8744
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8897
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8745
8898
  );
8746
8899
  }
8747
8900
  return new _ClaudecodeSkill({
@@ -8775,16 +8928,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8775
8928
  };
8776
8929
 
8777
8930
  // src/features/skills/cline-skill.ts
8778
- var import_node_path66 = require("path");
8779
- var import_mini28 = require("zod/mini");
8780
- var ClineSkillFrontmatterSchema = import_mini28.z.looseObject({
8781
- name: import_mini28.z.string(),
8782
- description: import_mini28.z.string()
8931
+ var import_node_path67 = require("path");
8932
+ var import_mini29 = require("zod/mini");
8933
+ var ClineSkillFrontmatterSchema = import_mini29.z.looseObject({
8934
+ name: import_mini29.z.string(),
8935
+ description: import_mini29.z.string()
8783
8936
  });
8784
8937
  var ClineSkill = class _ClineSkill extends ToolSkill {
8785
8938
  constructor({
8786
8939
  baseDir = process.cwd(),
8787
- relativeDirPath = (0, import_node_path66.join)(".cline", "skills"),
8940
+ relativeDirPath = (0, import_node_path67.join)(".cline", "skills"),
8788
8941
  dirName,
8789
8942
  frontmatter,
8790
8943
  body,
@@ -8813,7 +8966,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8813
8966
  }
8814
8967
  static getSettablePaths(_options = {}) {
8815
8968
  return {
8816
- relativeDirPath: (0, import_node_path66.join)(".cline", "skills")
8969
+ relativeDirPath: (0, import_node_path67.join)(".cline", "skills")
8817
8970
  };
8818
8971
  }
8819
8972
  getFrontmatter() {
@@ -8901,13 +9054,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8901
9054
  });
8902
9055
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8903
9056
  if (!result.success) {
8904
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9057
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8905
9058
  throw new Error(
8906
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9059
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8907
9060
  );
8908
9061
  }
8909
9062
  if (result.data.name !== loaded.dirName) {
8910
- const skillFilePath = (0, import_node_path66.join)(
9063
+ const skillFilePath = (0, import_node_path67.join)(
8911
9064
  loaded.baseDir,
8912
9065
  loaded.relativeDirPath,
8913
9066
  loaded.dirName,
@@ -8948,21 +9101,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8948
9101
  };
8949
9102
 
8950
9103
  // src/features/skills/codexcli-skill.ts
8951
- var import_node_path67 = require("path");
8952
- var import_mini29 = require("zod/mini");
8953
- var CodexCliSkillFrontmatterSchema = import_mini29.z.looseObject({
8954
- name: import_mini29.z.string(),
8955
- description: import_mini29.z.string(),
8956
- metadata: import_mini29.z.optional(
8957
- import_mini29.z.looseObject({
8958
- "short-description": import_mini29.z.optional(import_mini29.z.string())
9104
+ var import_node_path68 = require("path");
9105
+ var import_mini30 = require("zod/mini");
9106
+ var CodexCliSkillFrontmatterSchema = import_mini30.z.looseObject({
9107
+ name: import_mini30.z.string(),
9108
+ description: import_mini30.z.string(),
9109
+ metadata: import_mini30.z.optional(
9110
+ import_mini30.z.looseObject({
9111
+ "short-description": import_mini30.z.optional(import_mini30.z.string())
8959
9112
  })
8960
9113
  )
8961
9114
  });
8962
9115
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8963
9116
  constructor({
8964
9117
  baseDir = process.cwd(),
8965
- relativeDirPath = (0, import_node_path67.join)(".codex", "skills"),
9118
+ relativeDirPath = (0, import_node_path68.join)(".codex", "skills"),
8966
9119
  dirName,
8967
9120
  frontmatter,
8968
9121
  body,
@@ -8993,7 +9146,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8993
9146
  global: _global = false
8994
9147
  } = {}) {
8995
9148
  return {
8996
- relativeDirPath: (0, import_node_path67.join)(".codex", "skills")
9149
+ relativeDirPath: (0, import_node_path68.join)(".codex", "skills")
8997
9150
  };
8998
9151
  }
8999
9152
  getFrontmatter() {
@@ -9083,9 +9236,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9083
9236
  });
9084
9237
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9085
9238
  if (!result.success) {
9086
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9239
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9087
9240
  throw new Error(
9088
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9241
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9089
9242
  );
9090
9243
  }
9091
9244
  return new _CodexCliSkill({
@@ -9119,17 +9272,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9119
9272
  };
9120
9273
 
9121
9274
  // src/features/skills/copilot-skill.ts
9122
- var import_node_path68 = require("path");
9123
- var import_mini30 = require("zod/mini");
9124
- var CopilotSkillFrontmatterSchema = import_mini30.z.looseObject({
9125
- name: import_mini30.z.string(),
9126
- description: import_mini30.z.string(),
9127
- license: import_mini30.z.optional(import_mini30.z.string())
9275
+ var import_node_path69 = require("path");
9276
+ var import_mini31 = require("zod/mini");
9277
+ var CopilotSkillFrontmatterSchema = import_mini31.z.looseObject({
9278
+ name: import_mini31.z.string(),
9279
+ description: import_mini31.z.string(),
9280
+ license: import_mini31.z.optional(import_mini31.z.string())
9128
9281
  });
9129
9282
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
9130
9283
  constructor({
9131
9284
  baseDir = process.cwd(),
9132
- relativeDirPath = (0, import_node_path68.join)(".github", "skills"),
9285
+ relativeDirPath = (0, import_node_path69.join)(".github", "skills"),
9133
9286
  dirName,
9134
9287
  frontmatter,
9135
9288
  body,
@@ -9161,7 +9314,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9161
9314
  throw new Error("CopilotSkill does not support global mode.");
9162
9315
  }
9163
9316
  return {
9164
- relativeDirPath: (0, import_node_path68.join)(".github", "skills")
9317
+ relativeDirPath: (0, import_node_path69.join)(".github", "skills")
9165
9318
  };
9166
9319
  }
9167
9320
  getFrontmatter() {
@@ -9247,9 +9400,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9247
9400
  });
9248
9401
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9249
9402
  if (!result.success) {
9250
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9403
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9251
9404
  throw new Error(
9252
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9405
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9253
9406
  );
9254
9407
  }
9255
9408
  return new _CopilotSkill({
@@ -9284,16 +9437,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9284
9437
  };
9285
9438
 
9286
9439
  // src/features/skills/cursor-skill.ts
9287
- var import_node_path69 = require("path");
9288
- var import_mini31 = require("zod/mini");
9289
- var CursorSkillFrontmatterSchema = import_mini31.z.looseObject({
9290
- name: import_mini31.z.string(),
9291
- description: import_mini31.z.string()
9440
+ var import_node_path70 = require("path");
9441
+ var import_mini32 = require("zod/mini");
9442
+ var CursorSkillFrontmatterSchema = import_mini32.z.looseObject({
9443
+ name: import_mini32.z.string(),
9444
+ description: import_mini32.z.string()
9292
9445
  });
9293
9446
  var CursorSkill = class _CursorSkill extends ToolSkill {
9294
9447
  constructor({
9295
9448
  baseDir = process.cwd(),
9296
- relativeDirPath = (0, import_node_path69.join)(".cursor", "skills"),
9449
+ relativeDirPath = (0, import_node_path70.join)(".cursor", "skills"),
9297
9450
  dirName,
9298
9451
  frontmatter,
9299
9452
  body,
@@ -9322,7 +9475,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9322
9475
  }
9323
9476
  static getSettablePaths(_options) {
9324
9477
  return {
9325
- relativeDirPath: (0, import_node_path69.join)(".cursor", "skills")
9478
+ relativeDirPath: (0, import_node_path70.join)(".cursor", "skills")
9326
9479
  };
9327
9480
  }
9328
9481
  getFrontmatter() {
@@ -9402,9 +9555,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9402
9555
  });
9403
9556
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9404
9557
  if (!result.success) {
9405
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9558
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9406
9559
  throw new Error(
9407
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9560
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9408
9561
  );
9409
9562
  }
9410
9563
  return new _CursorSkill({
@@ -9437,13 +9590,13 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9437
9590
  });
9438
9591
  }
9439
9592
  };
9440
-
9441
- // src/features/skills/geminicli-skill.ts
9442
- var import_node_path70 = require("path");
9443
- var import_mini32 = require("zod/mini");
9444
- var GeminiCliSkillFrontmatterSchema = import_mini32.z.looseObject({
9445
- name: import_mini32.z.string(),
9446
- description: import_mini32.z.string()
9593
+
9594
+ // src/features/skills/geminicli-skill.ts
9595
+ var import_node_path71 = require("path");
9596
+ var import_mini33 = require("zod/mini");
9597
+ var GeminiCliSkillFrontmatterSchema = import_mini33.z.looseObject({
9598
+ name: import_mini33.z.string(),
9599
+ description: import_mini33.z.string()
9447
9600
  });
9448
9601
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9449
9602
  constructor({
@@ -9479,7 +9632,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9479
9632
  global: _global = false
9480
9633
  } = {}) {
9481
9634
  return {
9482
- relativeDirPath: (0, import_node_path70.join)(".gemini", "skills")
9635
+ relativeDirPath: (0, import_node_path71.join)(".gemini", "skills")
9483
9636
  };
9484
9637
  }
9485
9638
  getFrontmatter() {
@@ -9559,9 +9712,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9559
9712
  });
9560
9713
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9561
9714
  if (!result.success) {
9562
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9715
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9563
9716
  throw new Error(
9564
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9717
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9565
9718
  );
9566
9719
  }
9567
9720
  return new _GeminiCliSkill({
@@ -9596,16 +9749,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9596
9749
  };
9597
9750
 
9598
9751
  // src/features/skills/junie-skill.ts
9599
- var import_node_path71 = require("path");
9600
- var import_mini33 = require("zod/mini");
9601
- var JunieSkillFrontmatterSchema = import_mini33.z.looseObject({
9602
- name: import_mini33.z.string(),
9603
- description: import_mini33.z.string()
9752
+ var import_node_path72 = require("path");
9753
+ var import_mini34 = require("zod/mini");
9754
+ var JunieSkillFrontmatterSchema = import_mini34.z.looseObject({
9755
+ name: import_mini34.z.string(),
9756
+ description: import_mini34.z.string()
9604
9757
  });
9605
9758
  var JunieSkill = class _JunieSkill extends ToolSkill {
9606
9759
  constructor({
9607
9760
  baseDir = process.cwd(),
9608
- relativeDirPath = (0, import_node_path71.join)(".junie", "skills"),
9761
+ relativeDirPath = (0, import_node_path72.join)(".junie", "skills"),
9609
9762
  dirName,
9610
9763
  frontmatter,
9611
9764
  body,
@@ -9637,7 +9790,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9637
9790
  throw new Error("JunieSkill does not support global mode.");
9638
9791
  }
9639
9792
  return {
9640
- relativeDirPath: (0, import_node_path71.join)(".junie", "skills")
9793
+ relativeDirPath: (0, import_node_path72.join)(".junie", "skills")
9641
9794
  };
9642
9795
  }
9643
9796
  getFrontmatter() {
@@ -9724,13 +9877,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9724
9877
  });
9725
9878
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9726
9879
  if (!result.success) {
9727
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9880
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9728
9881
  throw new Error(
9729
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9882
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9730
9883
  );
9731
9884
  }
9732
9885
  if (result.data.name !== loaded.dirName) {
9733
- const skillFilePath = (0, import_node_path71.join)(
9886
+ const skillFilePath = (0, import_node_path72.join)(
9734
9887
  loaded.baseDir,
9735
9888
  loaded.relativeDirPath,
9736
9889
  loaded.dirName,
@@ -9772,16 +9925,16 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9772
9925
  };
9773
9926
 
9774
9927
  // src/features/skills/kilo-skill.ts
9775
- var import_node_path72 = require("path");
9776
- var import_mini34 = require("zod/mini");
9777
- var KiloSkillFrontmatterSchema = import_mini34.z.looseObject({
9778
- name: import_mini34.z.string(),
9779
- description: import_mini34.z.string()
9928
+ var import_node_path73 = require("path");
9929
+ var import_mini35 = require("zod/mini");
9930
+ var KiloSkillFrontmatterSchema = import_mini35.z.looseObject({
9931
+ name: import_mini35.z.string(),
9932
+ description: import_mini35.z.string()
9780
9933
  });
9781
9934
  var KiloSkill = class _KiloSkill extends ToolSkill {
9782
9935
  constructor({
9783
9936
  baseDir = process.cwd(),
9784
- relativeDirPath = (0, import_node_path72.join)(".kilocode", "skills"),
9937
+ relativeDirPath = (0, import_node_path73.join)(".kilocode", "skills"),
9785
9938
  dirName,
9786
9939
  frontmatter,
9787
9940
  body,
@@ -9812,7 +9965,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9812
9965
  global: _global = false
9813
9966
  } = {}) {
9814
9967
  return {
9815
- relativeDirPath: (0, import_node_path72.join)(".kilocode", "skills")
9968
+ relativeDirPath: (0, import_node_path73.join)(".kilocode", "skills")
9816
9969
  };
9817
9970
  }
9818
9971
  getFrontmatter() {
@@ -9900,13 +10053,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9900
10053
  });
9901
10054
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9902
10055
  if (!result.success) {
9903
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10056
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9904
10057
  throw new Error(
9905
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10058
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9906
10059
  );
9907
10060
  }
9908
10061
  if (result.data.name !== loaded.dirName) {
9909
- const skillFilePath = (0, import_node_path72.join)(
10062
+ const skillFilePath = (0, import_node_path73.join)(
9910
10063
  loaded.baseDir,
9911
10064
  loaded.relativeDirPath,
9912
10065
  loaded.dirName,
@@ -9947,16 +10100,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9947
10100
  };
9948
10101
 
9949
10102
  // src/features/skills/kiro-skill.ts
9950
- var import_node_path73 = require("path");
9951
- var import_mini35 = require("zod/mini");
9952
- var KiroSkillFrontmatterSchema = import_mini35.z.looseObject({
9953
- name: import_mini35.z.string(),
9954
- description: import_mini35.z.string()
10103
+ var import_node_path74 = require("path");
10104
+ var import_mini36 = require("zod/mini");
10105
+ var KiroSkillFrontmatterSchema = import_mini36.z.looseObject({
10106
+ name: import_mini36.z.string(),
10107
+ description: import_mini36.z.string()
9955
10108
  });
9956
10109
  var KiroSkill = class _KiroSkill extends ToolSkill {
9957
10110
  constructor({
9958
10111
  baseDir = process.cwd(),
9959
- relativeDirPath = (0, import_node_path73.join)(".kiro", "skills"),
10112
+ relativeDirPath = (0, import_node_path74.join)(".kiro", "skills"),
9960
10113
  dirName,
9961
10114
  frontmatter,
9962
10115
  body,
@@ -9988,7 +10141,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9988
10141
  throw new Error("KiroSkill does not support global mode.");
9989
10142
  }
9990
10143
  return {
9991
- relativeDirPath: (0, import_node_path73.join)(".kiro", "skills")
10144
+ relativeDirPath: (0, import_node_path74.join)(".kiro", "skills")
9992
10145
  };
9993
10146
  }
9994
10147
  getFrontmatter() {
@@ -10076,13 +10229,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
10076
10229
  });
10077
10230
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10078
10231
  if (!result.success) {
10079
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10232
+ const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10080
10233
  throw new Error(
10081
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10234
+ `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10082
10235
  );
10083
10236
  }
10084
10237
  if (result.data.name !== loaded.dirName) {
10085
- const skillFilePath = (0, import_node_path73.join)(
10238
+ const skillFilePath = (0, import_node_path74.join)(
10086
10239
  loaded.baseDir,
10087
10240
  loaded.relativeDirPath,
10088
10241
  loaded.dirName,
@@ -10124,17 +10277,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
10124
10277
  };
10125
10278
 
10126
10279
  // src/features/skills/opencode-skill.ts
10127
- var import_node_path74 = require("path");
10128
- var import_mini36 = require("zod/mini");
10129
- var OpenCodeSkillFrontmatterSchema = import_mini36.z.looseObject({
10130
- name: import_mini36.z.string(),
10131
- description: import_mini36.z.string(),
10132
- "allowed-tools": import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string()))
10280
+ var import_node_path75 = require("path");
10281
+ var import_mini37 = require("zod/mini");
10282
+ var OpenCodeSkillFrontmatterSchema = import_mini37.z.looseObject({
10283
+ name: import_mini37.z.string(),
10284
+ description: import_mini37.z.string(),
10285
+ "allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string()))
10133
10286
  });
10134
10287
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10135
10288
  constructor({
10136
10289
  baseDir = process.cwd(),
10137
- relativeDirPath = (0, import_node_path74.join)(".opencode", "skill"),
10290
+ relativeDirPath = (0, import_node_path75.join)(".opencode", "skill"),
10138
10291
  dirName,
10139
10292
  frontmatter,
10140
10293
  body,
@@ -10163,7 +10316,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10163
10316
  }
10164
10317
  static getSettablePaths({ global = false } = {}) {
10165
10318
  return {
10166
- relativeDirPath: global ? (0, import_node_path74.join)(".config", "opencode", "skill") : (0, import_node_path74.join)(".opencode", "skill")
10319
+ relativeDirPath: global ? (0, import_node_path75.join)(".config", "opencode", "skill") : (0, import_node_path75.join)(".opencode", "skill")
10167
10320
  };
10168
10321
  }
10169
10322
  getFrontmatter() {
@@ -10249,9 +10402,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10249
10402
  });
10250
10403
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10251
10404
  if (!result.success) {
10252
- const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10405
+ const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10253
10406
  throw new Error(
10254
- `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10407
+ `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10255
10408
  );
10256
10409
  }
10257
10410
  return new _OpenCodeSkill({
@@ -10285,16 +10438,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10285
10438
  };
10286
10439
 
10287
10440
  // src/features/skills/replit-skill.ts
10288
- var import_node_path75 = require("path");
10289
- var import_mini37 = require("zod/mini");
10290
- var ReplitSkillFrontmatterSchema = import_mini37.z.looseObject({
10291
- name: import_mini37.z.string(),
10292
- description: import_mini37.z.string()
10441
+ var import_node_path76 = require("path");
10442
+ var import_mini38 = require("zod/mini");
10443
+ var ReplitSkillFrontmatterSchema = import_mini38.z.looseObject({
10444
+ name: import_mini38.z.string(),
10445
+ description: import_mini38.z.string()
10293
10446
  });
10294
10447
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
10295
10448
  constructor({
10296
10449
  baseDir = process.cwd(),
10297
- relativeDirPath = (0, import_node_path75.join)(".agents", "skills"),
10450
+ relativeDirPath = (0, import_node_path76.join)(".agents", "skills"),
10298
10451
  dirName,
10299
10452
  frontmatter,
10300
10453
  body,
@@ -10326,7 +10479,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10326
10479
  throw new Error("ReplitSkill does not support global mode.");
10327
10480
  }
10328
10481
  return {
10329
- relativeDirPath: (0, import_node_path75.join)(".agents", "skills")
10482
+ relativeDirPath: (0, import_node_path76.join)(".agents", "skills")
10330
10483
  };
10331
10484
  }
10332
10485
  getFrontmatter() {
@@ -10406,9 +10559,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10406
10559
  });
10407
10560
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10408
10561
  if (!result.success) {
10409
- const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10562
+ const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10410
10563
  throw new Error(
10411
- `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10564
+ `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10412
10565
  );
10413
10566
  }
10414
10567
  return new _ReplitSkill({
@@ -10443,16 +10596,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10443
10596
  };
10444
10597
 
10445
10598
  // src/features/skills/roo-skill.ts
10446
- var import_node_path76 = require("path");
10447
- var import_mini38 = require("zod/mini");
10448
- var RooSkillFrontmatterSchema = import_mini38.z.looseObject({
10449
- name: import_mini38.z.string(),
10450
- description: import_mini38.z.string()
10599
+ var import_node_path77 = require("path");
10600
+ var import_mini39 = require("zod/mini");
10601
+ var RooSkillFrontmatterSchema = import_mini39.z.looseObject({
10602
+ name: import_mini39.z.string(),
10603
+ description: import_mini39.z.string()
10451
10604
  });
10452
10605
  var RooSkill = class _RooSkill extends ToolSkill {
10453
10606
  constructor({
10454
10607
  baseDir = process.cwd(),
10455
- relativeDirPath = (0, import_node_path76.join)(".roo", "skills"),
10608
+ relativeDirPath = (0, import_node_path77.join)(".roo", "skills"),
10456
10609
  dirName,
10457
10610
  frontmatter,
10458
10611
  body,
@@ -10483,7 +10636,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
10483
10636
  global: _global = false
10484
10637
  } = {}) {
10485
10638
  return {
10486
- relativeDirPath: (0, import_node_path76.join)(".roo", "skills")
10639
+ relativeDirPath: (0, import_node_path77.join)(".roo", "skills")
10487
10640
  };
10488
10641
  }
10489
10642
  getFrontmatter() {
@@ -10571,13 +10724,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
10571
10724
  });
10572
10725
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10573
10726
  if (!result.success) {
10574
- const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10727
+ const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10575
10728
  throw new Error(
10576
- `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10729
+ `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10577
10730
  );
10578
10731
  }
10579
10732
  if (result.data.name !== loaded.dirName) {
10580
- const skillFilePath = (0, import_node_path76.join)(
10733
+ const skillFilePath = (0, import_node_path77.join)(
10581
10734
  loaded.baseDir,
10582
10735
  loaded.relativeDirPath,
10583
10736
  loaded.dirName,
@@ -10618,17 +10771,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
10618
10771
  };
10619
10772
 
10620
10773
  // src/features/skills/skills-utils.ts
10621
- var import_node_path77 = require("path");
10774
+ var import_node_path78 = require("path");
10622
10775
  async function getLocalSkillDirNames(baseDir) {
10623
- const skillsDir = (0, import_node_path77.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10776
+ const skillsDir = (0, import_node_path78.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10624
10777
  const names = /* @__PURE__ */ new Set();
10625
10778
  if (!await directoryExists(skillsDir)) {
10626
10779
  return names;
10627
10780
  }
10628
- const dirPaths = await findFilesByGlobs((0, import_node_path77.join)(skillsDir, "*"), { type: "dir" });
10781
+ const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDir, "*"), { type: "dir" });
10629
10782
  for (const dirPath of dirPaths) {
10630
- const name = (0, import_node_path77.basename)(dirPath);
10631
- if (name === (0, import_node_path77.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10783
+ const name = (0, import_node_path78.basename)(dirPath);
10784
+ if (name === (0, import_node_path78.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10632
10785
  names.add(name);
10633
10786
  }
10634
10787
  return names;
@@ -10654,7 +10807,7 @@ var skillsProcessorToolTargetTuple = [
10654
10807
  "replit",
10655
10808
  "roo"
10656
10809
  ];
10657
- var SkillsProcessorToolTargetSchema = import_mini39.z.enum(skillsProcessorToolTargetTuple);
10810
+ var SkillsProcessorToolTargetSchema = import_mini40.z.enum(skillsProcessorToolTargetTuple);
10658
10811
  var toolSkillFactories = /* @__PURE__ */ new Map([
10659
10812
  [
10660
10813
  "agentsmd",
@@ -10863,11 +11016,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10863
11016
  )
10864
11017
  );
10865
11018
  const localSkillNames = new Set(localDirNames);
10866
- const curatedDirPath = (0, import_node_path78.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
11019
+ const curatedDirPath = (0, import_node_path79.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10867
11020
  let curatedSkills = [];
10868
11021
  if (await directoryExists(curatedDirPath)) {
10869
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path78.join)(curatedDirPath, "*"), { type: "dir" });
10870
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path78.basename)(path3));
11022
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path79.join)(curatedDirPath, "*"), { type: "dir" });
11023
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path79.basename)(path3));
10871
11024
  const nonConflicting = curatedDirNames.filter((name) => {
10872
11025
  if (localSkillNames.has(name)) {
10873
11026
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -10900,9 +11053,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10900
11053
  async loadToolDirs() {
10901
11054
  const factory = this.getFactory(this.toolTarget);
10902
11055
  const paths = factory.class.getSettablePaths({ global: this.global });
10903
- const skillsDirPath = (0, import_node_path78.join)(this.baseDir, paths.relativeDirPath);
10904
- const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDirPath, "*"), { type: "dir" });
10905
- const dirNames = dirPaths.map((path3) => (0, import_node_path78.basename)(path3));
11056
+ const skillsDirPath = (0, import_node_path79.join)(this.baseDir, paths.relativeDirPath);
11057
+ const dirPaths = await findFilesByGlobs((0, import_node_path79.join)(skillsDirPath, "*"), { type: "dir" });
11058
+ const dirNames = dirPaths.map((path3) => (0, import_node_path79.basename)(path3));
10906
11059
  const toolSkills = await Promise.all(
10907
11060
  dirNames.map(
10908
11061
  (dirName) => factory.class.fromDir({
@@ -10918,9 +11071,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10918
11071
  async loadToolDirsToDelete() {
10919
11072
  const factory = this.getFactory(this.toolTarget);
10920
11073
  const paths = factory.class.getSettablePaths({ global: this.global });
10921
- const skillsDirPath = (0, import_node_path78.join)(this.baseDir, paths.relativeDirPath);
10922
- const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDirPath, "*"), { type: "dir" });
10923
- const dirNames = dirPaths.map((path3) => (0, import_node_path78.basename)(path3));
11074
+ const skillsDirPath = (0, import_node_path79.join)(this.baseDir, paths.relativeDirPath);
11075
+ const dirPaths = await findFilesByGlobs((0, import_node_path79.join)(skillsDirPath, "*"), { type: "dir" });
11076
+ const dirNames = dirPaths.map((path3) => (0, import_node_path79.basename)(path3));
10924
11077
  const toolSkills = dirNames.map(
10925
11078
  (dirName) => factory.class.forDeletion({
10926
11079
  baseDir: this.baseDir,
@@ -10981,11 +11134,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10981
11134
  };
10982
11135
 
10983
11136
  // src/features/subagents/agentsmd-subagent.ts
10984
- var import_node_path80 = require("path");
11137
+ var import_node_path81 = require("path");
10985
11138
 
10986
11139
  // src/features/subagents/simulated-subagent.ts
10987
- var import_node_path79 = require("path");
10988
- var import_mini40 = require("zod/mini");
11140
+ var import_node_path80 = require("path");
11141
+ var import_mini41 = require("zod/mini");
10989
11142
 
10990
11143
  // src/features/subagents/tool-subagent.ts
10991
11144
  var ToolSubagent = class extends ToolFile {
@@ -11037,9 +11190,9 @@ var ToolSubagent = class extends ToolFile {
11037
11190
  };
11038
11191
 
11039
11192
  // src/features/subagents/simulated-subagent.ts
11040
- var SimulatedSubagentFrontmatterSchema = import_mini40.z.object({
11041
- name: import_mini40.z.string(),
11042
- description: import_mini40.z.optional(import_mini40.z.string())
11193
+ var SimulatedSubagentFrontmatterSchema = import_mini41.z.object({
11194
+ name: import_mini41.z.string(),
11195
+ description: import_mini41.z.optional(import_mini41.z.string())
11043
11196
  });
11044
11197
  var SimulatedSubagent = class extends ToolSubagent {
11045
11198
  frontmatter;
@@ -11049,7 +11202,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11049
11202
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
11050
11203
  if (!result.success) {
11051
11204
  throw new Error(
11052
- `Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11205
+ `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11053
11206
  );
11054
11207
  }
11055
11208
  }
@@ -11100,7 +11253,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11100
11253
  return {
11101
11254
  success: false,
11102
11255
  error: new Error(
11103
- `Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11256
+ `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11104
11257
  )
11105
11258
  };
11106
11259
  }
@@ -11110,7 +11263,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11110
11263
  relativeFilePath,
11111
11264
  validate = true
11112
11265
  }) {
11113
- const filePath = (0, import_node_path79.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
11266
+ const filePath = (0, import_node_path80.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
11114
11267
  const fileContent = await readFileContent(filePath);
11115
11268
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11116
11269
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11120,7 +11273,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11120
11273
  return {
11121
11274
  baseDir,
11122
11275
  relativeDirPath: this.getSettablePaths().relativeDirPath,
11123
- relativeFilePath: (0, import_node_path79.basename)(relativeFilePath),
11276
+ relativeFilePath: (0, import_node_path80.basename)(relativeFilePath),
11124
11277
  frontmatter: result.data,
11125
11278
  body: content.trim(),
11126
11279
  validate
@@ -11146,7 +11299,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11146
11299
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
11147
11300
  static getSettablePaths() {
11148
11301
  return {
11149
- relativeDirPath: (0, import_node_path80.join)(".agents", "subagents")
11302
+ relativeDirPath: (0, import_node_path81.join)(".agents", "subagents")
11150
11303
  };
11151
11304
  }
11152
11305
  static async fromFile(params) {
@@ -11169,11 +11322,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
11169
11322
  };
11170
11323
 
11171
11324
  // src/features/subagents/factorydroid-subagent.ts
11172
- var import_node_path81 = require("path");
11325
+ var import_node_path82 = require("path");
11173
11326
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
11174
11327
  static getSettablePaths(_options) {
11175
11328
  return {
11176
- relativeDirPath: (0, import_node_path81.join)(".factory", "droids")
11329
+ relativeDirPath: (0, import_node_path82.join)(".factory", "droids")
11177
11330
  };
11178
11331
  }
11179
11332
  static async fromFile(params) {
@@ -11196,11 +11349,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
11196
11349
  };
11197
11350
 
11198
11351
  // src/features/subagents/geminicli-subagent.ts
11199
- var import_node_path82 = require("path");
11352
+ var import_node_path83 = require("path");
11200
11353
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
11201
11354
  static getSettablePaths() {
11202
11355
  return {
11203
- relativeDirPath: (0, import_node_path82.join)(".gemini", "subagents")
11356
+ relativeDirPath: (0, import_node_path83.join)(".gemini", "subagents")
11204
11357
  };
11205
11358
  }
11206
11359
  static async fromFile(params) {
@@ -11223,11 +11376,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
11223
11376
  };
11224
11377
 
11225
11378
  // src/features/subagents/roo-subagent.ts
11226
- var import_node_path83 = require("path");
11379
+ var import_node_path84 = require("path");
11227
11380
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
11228
11381
  static getSettablePaths() {
11229
11382
  return {
11230
- relativeDirPath: (0, import_node_path83.join)(".roo", "subagents")
11383
+ relativeDirPath: (0, import_node_path84.join)(".roo", "subagents")
11231
11384
  };
11232
11385
  }
11233
11386
  static async fromFile(params) {
@@ -11250,20 +11403,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
11250
11403
  };
11251
11404
 
11252
11405
  // src/features/subagents/subagents-processor.ts
11253
- var import_node_path92 = require("path");
11254
- var import_mini49 = require("zod/mini");
11406
+ var import_node_path93 = require("path");
11407
+ var import_mini50 = require("zod/mini");
11255
11408
 
11256
11409
  // src/features/subagents/claudecode-subagent.ts
11257
- var import_node_path85 = require("path");
11258
- var import_mini42 = require("zod/mini");
11410
+ var import_node_path86 = require("path");
11411
+ var import_mini43 = require("zod/mini");
11259
11412
 
11260
11413
  // src/features/subagents/rulesync-subagent.ts
11261
- var import_node_path84 = require("path");
11262
- var import_mini41 = require("zod/mini");
11263
- var RulesyncSubagentFrontmatterSchema = import_mini41.z.looseObject({
11264
- targets: import_mini41.z._default(RulesyncTargetsSchema, ["*"]),
11265
- name: import_mini41.z.string(),
11266
- description: import_mini41.z.optional(import_mini41.z.string())
11414
+ var import_node_path85 = require("path");
11415
+ var import_mini42 = require("zod/mini");
11416
+ var RulesyncSubagentFrontmatterSchema = import_mini42.z.looseObject({
11417
+ targets: import_mini42.z._default(RulesyncTargetsSchema, ["*"]),
11418
+ name: import_mini42.z.string(),
11419
+ description: import_mini42.z.optional(import_mini42.z.string())
11267
11420
  });
11268
11421
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11269
11422
  frontmatter;
@@ -11272,7 +11425,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11272
11425
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
11273
11426
  if (!parseResult.success && rest.validate !== false) {
11274
11427
  throw new Error(
11275
- `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11428
+ `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11276
11429
  );
11277
11430
  }
11278
11431
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -11305,7 +11458,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11305
11458
  return {
11306
11459
  success: false,
11307
11460
  error: new Error(
11308
- `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11461
+ `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11309
11462
  )
11310
11463
  };
11311
11464
  }
@@ -11313,14 +11466,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11313
11466
  static async fromFile({
11314
11467
  relativeFilePath
11315
11468
  }) {
11316
- const filePath = (0, import_node_path84.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
11469
+ const filePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
11317
11470
  const fileContent = await readFileContent(filePath);
11318
11471
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11319
11472
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
11320
11473
  if (!result.success) {
11321
11474
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
11322
11475
  }
11323
- const filename = (0, import_node_path84.basename)(relativeFilePath);
11476
+ const filename = (0, import_node_path85.basename)(relativeFilePath);
11324
11477
  return new _RulesyncSubagent({
11325
11478
  baseDir: process.cwd(),
11326
11479
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -11332,13 +11485,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11332
11485
  };
11333
11486
 
11334
11487
  // src/features/subagents/claudecode-subagent.ts
11335
- var ClaudecodeSubagentFrontmatterSchema = import_mini42.z.looseObject({
11336
- name: import_mini42.z.string(),
11337
- description: import_mini42.z.optional(import_mini42.z.string()),
11338
- model: import_mini42.z.optional(import_mini42.z.string()),
11339
- tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())])),
11340
- permissionMode: import_mini42.z.optional(import_mini42.z.string()),
11341
- skills: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
11488
+ var ClaudecodeSubagentFrontmatterSchema = import_mini43.z.looseObject({
11489
+ name: import_mini43.z.string(),
11490
+ description: import_mini43.z.optional(import_mini43.z.string()),
11491
+ model: import_mini43.z.optional(import_mini43.z.string()),
11492
+ tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())])),
11493
+ permissionMode: import_mini43.z.optional(import_mini43.z.string()),
11494
+ skills: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
11342
11495
  });
11343
11496
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11344
11497
  frontmatter;
@@ -11348,7 +11501,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11348
11501
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
11349
11502
  if (!result.success) {
11350
11503
  throw new Error(
11351
- `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11504
+ `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11352
11505
  );
11353
11506
  }
11354
11507
  }
@@ -11360,7 +11513,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11360
11513
  }
11361
11514
  static getSettablePaths(_options = {}) {
11362
11515
  return {
11363
- relativeDirPath: (0, import_node_path85.join)(".claude", "agents")
11516
+ relativeDirPath: (0, import_node_path86.join)(".claude", "agents")
11364
11517
  };
11365
11518
  }
11366
11519
  getFrontmatter() {
@@ -11439,7 +11592,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11439
11592
  return {
11440
11593
  success: false,
11441
11594
  error: new Error(
11442
- `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11595
+ `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11443
11596
  )
11444
11597
  };
11445
11598
  }
@@ -11457,7 +11610,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11457
11610
  global = false
11458
11611
  }) {
11459
11612
  const paths = this.getSettablePaths({ global });
11460
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11613
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11461
11614
  const fileContent = await readFileContent(filePath);
11462
11615
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11463
11616
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11492,16 +11645,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11492
11645
  };
11493
11646
 
11494
11647
  // src/features/subagents/codexcli-subagent.ts
11495
- var import_node_path86 = require("path");
11648
+ var import_node_path87 = require("path");
11496
11649
  var smolToml2 = __toESM(require("smol-toml"), 1);
11497
- var import_mini43 = require("zod/mini");
11498
- var CodexCliSubagentTomlSchema = import_mini43.z.looseObject({
11499
- name: import_mini43.z.string(),
11500
- description: import_mini43.z.optional(import_mini43.z.string()),
11501
- developer_instructions: import_mini43.z.optional(import_mini43.z.string()),
11502
- model: import_mini43.z.optional(import_mini43.z.string()),
11503
- model_reasoning_effort: import_mini43.z.optional(import_mini43.z.string()),
11504
- sandbox_mode: import_mini43.z.optional(import_mini43.z.string())
11650
+ var import_mini44 = require("zod/mini");
11651
+ var CodexCliSubagentTomlSchema = import_mini44.z.looseObject({
11652
+ name: import_mini44.z.string(),
11653
+ description: import_mini44.z.optional(import_mini44.z.string()),
11654
+ developer_instructions: import_mini44.z.optional(import_mini44.z.string()),
11655
+ model: import_mini44.z.optional(import_mini44.z.string()),
11656
+ model_reasoning_effort: import_mini44.z.optional(import_mini44.z.string()),
11657
+ sandbox_mode: import_mini44.z.optional(import_mini44.z.string())
11505
11658
  });
11506
11659
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11507
11660
  body;
@@ -11512,7 +11665,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11512
11665
  CodexCliSubagentTomlSchema.parse(parsed);
11513
11666
  } catch (error) {
11514
11667
  throw new Error(
11515
- `Invalid TOML in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11668
+ `Invalid TOML in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11516
11669
  { cause: error }
11517
11670
  );
11518
11671
  }
@@ -11524,7 +11677,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11524
11677
  }
11525
11678
  static getSettablePaths(_options = {}) {
11526
11679
  return {
11527
- relativeDirPath: (0, import_node_path86.join)(".codex", "agents")
11680
+ relativeDirPath: (0, import_node_path87.join)(".codex", "agents")
11528
11681
  };
11529
11682
  }
11530
11683
  getBody() {
@@ -11536,7 +11689,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11536
11689
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
11537
11690
  } catch (error) {
11538
11691
  throw new Error(
11539
- `Failed to parse TOML in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11692
+ `Failed to parse TOML in ${(0, import_node_path87.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11540
11693
  { cause: error }
11541
11694
  );
11542
11695
  }
@@ -11617,7 +11770,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11617
11770
  global = false
11618
11771
  }) {
11619
11772
  const paths = this.getSettablePaths({ global });
11620
- const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11773
+ const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11621
11774
  const fileContent = await readFileContent(filePath);
11622
11775
  const subagent = new _CodexCliSubagent({
11623
11776
  baseDir,
@@ -11655,13 +11808,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11655
11808
  };
11656
11809
 
11657
11810
  // src/features/subagents/copilot-subagent.ts
11658
- var import_node_path87 = require("path");
11659
- var import_mini44 = require("zod/mini");
11811
+ var import_node_path88 = require("path");
11812
+ var import_mini45 = require("zod/mini");
11660
11813
  var REQUIRED_TOOL = "agent/runSubagent";
11661
- var CopilotSubagentFrontmatterSchema = import_mini44.z.looseObject({
11662
- name: import_mini44.z.string(),
11663
- description: import_mini44.z.optional(import_mini44.z.string()),
11664
- tools: import_mini44.z.optional(import_mini44.z.union([import_mini44.z.string(), import_mini44.z.array(import_mini44.z.string())]))
11814
+ var CopilotSubagentFrontmatterSchema = import_mini45.z.looseObject({
11815
+ name: import_mini45.z.string(),
11816
+ description: import_mini45.z.optional(import_mini45.z.string()),
11817
+ tools: import_mini45.z.optional(import_mini45.z.union([import_mini45.z.string(), import_mini45.z.array(import_mini45.z.string())]))
11665
11818
  });
11666
11819
  var normalizeTools = (tools) => {
11667
11820
  if (!tools) {
@@ -11681,7 +11834,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11681
11834
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
11682
11835
  if (!result.success) {
11683
11836
  throw new Error(
11684
- `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11837
+ `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11685
11838
  );
11686
11839
  }
11687
11840
  }
@@ -11693,7 +11846,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11693
11846
  }
11694
11847
  static getSettablePaths(_options = {}) {
11695
11848
  return {
11696
- relativeDirPath: (0, import_node_path87.join)(".github", "agents")
11849
+ relativeDirPath: (0, import_node_path88.join)(".github", "agents")
11697
11850
  };
11698
11851
  }
11699
11852
  getFrontmatter() {
@@ -11767,7 +11920,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11767
11920
  return {
11768
11921
  success: false,
11769
11922
  error: new Error(
11770
- `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11923
+ `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11771
11924
  )
11772
11925
  };
11773
11926
  }
@@ -11785,7 +11938,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11785
11938
  global = false
11786
11939
  }) {
11787
11940
  const paths = this.getSettablePaths({ global });
11788
- const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11941
+ const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11789
11942
  const fileContent = await readFileContent(filePath);
11790
11943
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11791
11944
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11821,11 +11974,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11821
11974
  };
11822
11975
 
11823
11976
  // src/features/subagents/cursor-subagent.ts
11824
- var import_node_path88 = require("path");
11825
- var import_mini45 = require("zod/mini");
11826
- var CursorSubagentFrontmatterSchema = import_mini45.z.looseObject({
11827
- name: import_mini45.z.string(),
11828
- description: import_mini45.z.optional(import_mini45.z.string())
11977
+ var import_node_path89 = require("path");
11978
+ var import_mini46 = require("zod/mini");
11979
+ var CursorSubagentFrontmatterSchema = import_mini46.z.looseObject({
11980
+ name: import_mini46.z.string(),
11981
+ description: import_mini46.z.optional(import_mini46.z.string())
11829
11982
  });
11830
11983
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11831
11984
  frontmatter;
@@ -11835,7 +11988,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11835
11988
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11836
11989
  if (!result.success) {
11837
11990
  throw new Error(
11838
- `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11991
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11839
11992
  );
11840
11993
  }
11841
11994
  }
@@ -11847,7 +12000,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11847
12000
  }
11848
12001
  static getSettablePaths(_options = {}) {
11849
12002
  return {
11850
- relativeDirPath: (0, import_node_path88.join)(".cursor", "agents")
12003
+ relativeDirPath: (0, import_node_path89.join)(".cursor", "agents")
11851
12004
  };
11852
12005
  }
11853
12006
  getFrontmatter() {
@@ -11914,7 +12067,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11914
12067
  return {
11915
12068
  success: false,
11916
12069
  error: new Error(
11917
- `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12070
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11918
12071
  )
11919
12072
  };
11920
12073
  }
@@ -11932,7 +12085,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11932
12085
  global = false
11933
12086
  }) {
11934
12087
  const paths = this.getSettablePaths({ global });
11935
- const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12088
+ const filePath = (0, import_node_path89.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11936
12089
  const fileContent = await readFileContent(filePath);
11937
12090
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11938
12091
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11968,11 +12121,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11968
12121
  };
11969
12122
 
11970
12123
  // src/features/subagents/junie-subagent.ts
11971
- var import_node_path89 = require("path");
11972
- var import_mini46 = require("zod/mini");
11973
- var JunieSubagentFrontmatterSchema = import_mini46.z.looseObject({
11974
- name: import_mini46.z.optional(import_mini46.z.string()),
11975
- description: import_mini46.z.string()
12124
+ var import_node_path90 = require("path");
12125
+ var import_mini47 = require("zod/mini");
12126
+ var JunieSubagentFrontmatterSchema = import_mini47.z.looseObject({
12127
+ name: import_mini47.z.optional(import_mini47.z.string()),
12128
+ description: import_mini47.z.string()
11976
12129
  });
11977
12130
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
11978
12131
  frontmatter;
@@ -11982,7 +12135,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
11982
12135
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
11983
12136
  if (!result.success) {
11984
12137
  throw new Error(
11985
- `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12138
+ `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11986
12139
  );
11987
12140
  }
11988
12141
  }
@@ -11997,7 +12150,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
11997
12150
  throw new Error("JunieSubagent does not support global mode.");
11998
12151
  }
11999
12152
  return {
12000
- relativeDirPath: (0, import_node_path89.join)(".junie", "agents")
12153
+ relativeDirPath: (0, import_node_path90.join)(".junie", "agents")
12001
12154
  };
12002
12155
  }
12003
12156
  getFrontmatter() {
@@ -12073,7 +12226,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12073
12226
  return {
12074
12227
  success: false,
12075
12228
  error: new Error(
12076
- `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12229
+ `Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12077
12230
  )
12078
12231
  };
12079
12232
  }
@@ -12091,7 +12244,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12091
12244
  global = false
12092
12245
  }) {
12093
12246
  const paths = this.getSettablePaths({ global });
12094
- const filePath = (0, import_node_path89.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12247
+ const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12095
12248
  const fileContent = await readFileContent(filePath);
12096
12249
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12097
12250
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12126,23 +12279,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12126
12279
  };
12127
12280
 
12128
12281
  // src/features/subagents/kiro-subagent.ts
12129
- var import_node_path90 = require("path");
12130
- var import_mini47 = require("zod/mini");
12131
- var KiroCliSubagentJsonSchema = import_mini47.z.looseObject({
12132
- name: import_mini47.z.string(),
12133
- description: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12134
- prompt: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12135
- tools: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12136
- toolAliases: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.string()))),
12137
- toolSettings: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.unknown())),
12138
- toolSchema: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.unknown())),
12139
- hooks: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.array(import_mini47.z.unknown())))),
12140
- model: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12141
- mcpServers: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.unknown()))),
12142
- useLegacyMcpJson: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.boolean())),
12143
- resources: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12144
- allowedTools: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12145
- includeMcpJson: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.boolean()))
12282
+ var import_node_path91 = require("path");
12283
+ var import_mini48 = require("zod/mini");
12284
+ var KiroCliSubagentJsonSchema = import_mini48.z.looseObject({
12285
+ name: import_mini48.z.string(),
12286
+ description: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12287
+ prompt: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12288
+ tools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12289
+ toolAliases: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.string()))),
12290
+ toolSettings: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
12291
+ toolSchema: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
12292
+ hooks: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.array(import_mini48.z.unknown())))),
12293
+ model: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12294
+ mcpServers: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.unknown()))),
12295
+ useLegacyMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean())),
12296
+ resources: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12297
+ allowedTools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12298
+ includeMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean()))
12146
12299
  });
12147
12300
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12148
12301
  body;
@@ -12153,7 +12306,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12153
12306
  KiroCliSubagentJsonSchema.parse(parsed);
12154
12307
  } catch (error) {
12155
12308
  throw new Error(
12156
- `Invalid JSON in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
12309
+ `Invalid JSON in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
12157
12310
  { cause: error }
12158
12311
  );
12159
12312
  }
@@ -12165,7 +12318,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12165
12318
  }
12166
12319
  static getSettablePaths(_options = {}) {
12167
12320
  return {
12168
- relativeDirPath: (0, import_node_path90.join)(".kiro", "agents")
12321
+ relativeDirPath: (0, import_node_path91.join)(".kiro", "agents")
12169
12322
  };
12170
12323
  }
12171
12324
  getBody() {
@@ -12177,7 +12330,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12177
12330
  parsed = JSON.parse(this.body);
12178
12331
  } catch (error) {
12179
12332
  throw new Error(
12180
- `Failed to parse JSON in ${(0, import_node_path90.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
12333
+ `Failed to parse JSON in ${(0, import_node_path91.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
12181
12334
  { cause: error }
12182
12335
  );
12183
12336
  }
@@ -12258,7 +12411,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12258
12411
  global = false
12259
12412
  }) {
12260
12413
  const paths = this.getSettablePaths({ global });
12261
- const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12414
+ const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12262
12415
  const fileContent = await readFileContent(filePath);
12263
12416
  const subagent = new _KiroSubagent({
12264
12417
  baseDir,
@@ -12296,12 +12449,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12296
12449
  };
12297
12450
 
12298
12451
  // src/features/subagents/opencode-subagent.ts
12299
- var import_node_path91 = require("path");
12300
- var import_mini48 = require("zod/mini");
12301
- var OpenCodeSubagentFrontmatterSchema = import_mini48.z.looseObject({
12302
- description: import_mini48.z.optional(import_mini48.z.string()),
12303
- mode: import_mini48.z._default(import_mini48.z.string(), "subagent"),
12304
- name: import_mini48.z.optional(import_mini48.z.string())
12452
+ var import_node_path92 = require("path");
12453
+ var import_mini49 = require("zod/mini");
12454
+ var OpenCodeSubagentFrontmatterSchema = import_mini49.z.looseObject({
12455
+ description: import_mini49.z.optional(import_mini49.z.string()),
12456
+ mode: import_mini49.z._default(import_mini49.z.string(), "subagent"),
12457
+ name: import_mini49.z.optional(import_mini49.z.string())
12305
12458
  });
12306
12459
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12307
12460
  frontmatter;
@@ -12311,7 +12464,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12311
12464
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
12312
12465
  if (!result.success) {
12313
12466
  throw new Error(
12314
- `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12467
+ `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12315
12468
  );
12316
12469
  }
12317
12470
  }
@@ -12325,7 +12478,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12325
12478
  global = false
12326
12479
  } = {}) {
12327
12480
  return {
12328
- relativeDirPath: global ? (0, import_node_path91.join)(".config", "opencode", "agent") : (0, import_node_path91.join)(".opencode", "agent")
12481
+ relativeDirPath: global ? (0, import_node_path92.join)(".config", "opencode", "agent") : (0, import_node_path92.join)(".opencode", "agent")
12329
12482
  };
12330
12483
  }
12331
12484
  getFrontmatter() {
@@ -12338,7 +12491,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12338
12491
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
12339
12492
  const rulesyncFrontmatter = {
12340
12493
  targets: ["*"],
12341
- name: name ?? (0, import_node_path91.basename)(this.getRelativeFilePath(), ".md"),
12494
+ name: name ?? (0, import_node_path92.basename)(this.getRelativeFilePath(), ".md"),
12342
12495
  description,
12343
12496
  opencode: { mode, ...opencodeSection }
12344
12497
  };
@@ -12391,7 +12544,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12391
12544
  return {
12392
12545
  success: false,
12393
12546
  error: new Error(
12394
- `Invalid frontmatter in ${(0, import_node_path91.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12547
+ `Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12395
12548
  )
12396
12549
  };
12397
12550
  }
@@ -12408,7 +12561,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12408
12561
  global = false
12409
12562
  }) {
12410
12563
  const paths = this.getSettablePaths({ global });
12411
- const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12564
+ const filePath = (0, import_node_path92.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12412
12565
  const fileContent = await readFileContent(filePath);
12413
12566
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12414
12567
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12458,7 +12611,7 @@ var subagentsProcessorToolTargetTuple = [
12458
12611
  "opencode",
12459
12612
  "roo"
12460
12613
  ];
12461
- var SubagentsProcessorToolTargetSchema = import_mini49.z.enum(subagentsProcessorToolTargetTuple);
12614
+ var SubagentsProcessorToolTargetSchema = import_mini50.z.enum(subagentsProcessorToolTargetTuple);
12462
12615
  var toolSubagentFactories = /* @__PURE__ */ new Map([
12463
12616
  [
12464
12617
  "agentsmd",
@@ -12627,7 +12780,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12627
12780
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
12628
12781
  */
12629
12782
  async loadRulesyncFiles() {
12630
- const subagentsDir = (0, import_node_path92.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12783
+ const subagentsDir = (0, import_node_path93.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12631
12784
  const dirExists = await directoryExists(subagentsDir);
12632
12785
  if (!dirExists) {
12633
12786
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -12642,7 +12795,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12642
12795
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
12643
12796
  const rulesyncSubagents = [];
12644
12797
  for (const mdFile of mdFiles) {
12645
- const filepath = (0, import_node_path92.join)(subagentsDir, mdFile);
12798
+ const filepath = (0, import_node_path93.join)(subagentsDir, mdFile);
12646
12799
  try {
12647
12800
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
12648
12801
  relativeFilePath: mdFile,
@@ -12672,14 +12825,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
12672
12825
  const factory = this.getFactory(this.toolTarget);
12673
12826
  const paths = factory.class.getSettablePaths({ global: this.global });
12674
12827
  const subagentFilePaths = await findFilesByGlobs(
12675
- (0, import_node_path92.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12828
+ (0, import_node_path93.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12676
12829
  );
12677
12830
  if (forDeletion) {
12678
12831
  const toolSubagents2 = subagentFilePaths.map(
12679
12832
  (path3) => factory.class.forDeletion({
12680
12833
  baseDir: this.baseDir,
12681
12834
  relativeDirPath: paths.relativeDirPath,
12682
- relativeFilePath: (0, import_node_path92.basename)(path3),
12835
+ relativeFilePath: (0, import_node_path93.basename)(path3),
12683
12836
  global: this.global
12684
12837
  })
12685
12838
  ).filter((subagent) => subagent.isDeletable());
@@ -12692,7 +12845,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12692
12845
  subagentFilePaths.map(
12693
12846
  (path3) => factory.class.fromFile({
12694
12847
  baseDir: this.baseDir,
12695
- relativeFilePath: (0, import_node_path92.basename)(path3),
12848
+ relativeFilePath: (0, import_node_path93.basename)(path3),
12696
12849
  global: this.global
12697
12850
  })
12698
12851
  )
@@ -12737,49 +12890,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
12737
12890
  };
12738
12891
 
12739
12892
  // src/features/rules/agentsmd-rule.ts
12740
- var import_node_path95 = require("path");
12893
+ var import_node_path96 = require("path");
12741
12894
 
12742
12895
  // src/features/rules/tool-rule.ts
12743
- var import_node_path94 = require("path");
12896
+ var import_node_path95 = require("path");
12744
12897
 
12745
12898
  // src/features/rules/rulesync-rule.ts
12746
- var import_node_path93 = require("path");
12747
- var import_mini50 = require("zod/mini");
12748
- var RulesyncRuleFrontmatterSchema = import_mini50.z.object({
12749
- root: import_mini50.z.optional(import_mini50.z.boolean()),
12750
- localRoot: import_mini50.z.optional(import_mini50.z.boolean()),
12751
- targets: import_mini50.z._default(RulesyncTargetsSchema, ["*"]),
12752
- description: import_mini50.z.optional(import_mini50.z.string()),
12753
- globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string())),
12754
- agentsmd: import_mini50.z.optional(
12755
- import_mini50.z.object({
12899
+ var import_node_path94 = require("path");
12900
+ var import_mini51 = require("zod/mini");
12901
+ var RulesyncRuleFrontmatterSchema = import_mini51.z.object({
12902
+ root: import_mini51.z.optional(import_mini51.z.boolean()),
12903
+ localRoot: import_mini51.z.optional(import_mini51.z.boolean()),
12904
+ targets: import_mini51.z._default(RulesyncTargetsSchema, ["*"]),
12905
+ description: import_mini51.z.optional(import_mini51.z.string()),
12906
+ globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string())),
12907
+ agentsmd: import_mini51.z.optional(
12908
+ import_mini51.z.object({
12756
12909
  // @example "path/to/subproject"
12757
- subprojectPath: import_mini50.z.optional(import_mini50.z.string())
12910
+ subprojectPath: import_mini51.z.optional(import_mini51.z.string())
12758
12911
  })
12759
12912
  ),
12760
- claudecode: import_mini50.z.optional(
12761
- import_mini50.z.object({
12913
+ claudecode: import_mini51.z.optional(
12914
+ import_mini51.z.object({
12762
12915
  // Glob patterns for conditional rules (takes precedence over globs)
12763
12916
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
12764
- paths: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12917
+ paths: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
12765
12918
  })
12766
12919
  ),
12767
- cursor: import_mini50.z.optional(
12768
- import_mini50.z.object({
12769
- alwaysApply: import_mini50.z.optional(import_mini50.z.boolean()),
12770
- description: import_mini50.z.optional(import_mini50.z.string()),
12771
- globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12920
+ cursor: import_mini51.z.optional(
12921
+ import_mini51.z.object({
12922
+ alwaysApply: import_mini51.z.optional(import_mini51.z.boolean()),
12923
+ description: import_mini51.z.optional(import_mini51.z.string()),
12924
+ globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
12772
12925
  })
12773
12926
  ),
12774
- copilot: import_mini50.z.optional(
12775
- import_mini50.z.object({
12776
- excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
12927
+ copilot: import_mini51.z.optional(
12928
+ import_mini51.z.object({
12929
+ excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
12777
12930
  })
12778
12931
  ),
12779
- antigravity: import_mini50.z.optional(
12780
- import_mini50.z.looseObject({
12781
- trigger: import_mini50.z.optional(import_mini50.z.string()),
12782
- globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12932
+ antigravity: import_mini51.z.optional(
12933
+ import_mini51.z.looseObject({
12934
+ trigger: import_mini51.z.optional(import_mini51.z.string()),
12935
+ globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
12783
12936
  })
12784
12937
  )
12785
12938
  });
@@ -12790,7 +12943,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12790
12943
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
12791
12944
  if (!parseResult.success && rest.validate !== false) {
12792
12945
  throw new Error(
12793
- `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12946
+ `Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12794
12947
  );
12795
12948
  }
12796
12949
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -12825,7 +12978,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12825
12978
  return {
12826
12979
  success: false,
12827
12980
  error: new Error(
12828
- `Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12981
+ `Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12829
12982
  )
12830
12983
  };
12831
12984
  }
@@ -12834,7 +12987,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12834
12987
  relativeFilePath,
12835
12988
  validate = true
12836
12989
  }) {
12837
- const filePath = (0, import_node_path93.join)(
12990
+ const filePath = (0, import_node_path94.join)(
12838
12991
  process.cwd(),
12839
12992
  this.getSettablePaths().recommended.relativeDirPath,
12840
12993
  relativeFilePath
@@ -12936,7 +13089,7 @@ var ToolRule = class extends ToolFile {
12936
13089
  rulesyncRule,
12937
13090
  validate = true,
12938
13091
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
12939
- nonRootPath = { relativeDirPath: (0, import_node_path94.join)(".agents", "memories") }
13092
+ nonRootPath = { relativeDirPath: (0, import_node_path95.join)(".agents", "memories") }
12940
13093
  }) {
12941
13094
  const params = this.buildToolRuleParamsDefault({
12942
13095
  baseDir,
@@ -12947,7 +13100,7 @@ var ToolRule = class extends ToolFile {
12947
13100
  });
12948
13101
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
12949
13102
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
12950
- params.relativeDirPath = (0, import_node_path94.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
13103
+ params.relativeDirPath = (0, import_node_path95.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12951
13104
  params.relativeFilePath = "AGENTS.md";
12952
13105
  }
12953
13106
  return params;
@@ -12996,7 +13149,7 @@ var ToolRule = class extends ToolFile {
12996
13149
  }
12997
13150
  };
12998
13151
  function buildToolPath(toolDir, subDir, excludeToolDir) {
12999
- return excludeToolDir ? subDir : (0, import_node_path94.join)(toolDir, subDir);
13152
+ return excludeToolDir ? subDir : (0, import_node_path95.join)(toolDir, subDir);
13000
13153
  }
13001
13154
 
13002
13155
  // src/features/rules/agentsmd-rule.ts
@@ -13025,8 +13178,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
13025
13178
  validate = true
13026
13179
  }) {
13027
13180
  const isRoot = relativeFilePath === "AGENTS.md";
13028
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path95.join)(".agents", "memories", relativeFilePath);
13029
- const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
13181
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path96.join)(".agents", "memories", relativeFilePath);
13182
+ const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
13030
13183
  return new _AgentsMdRule({
13031
13184
  baseDir,
13032
13185
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13081,21 +13234,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
13081
13234
  };
13082
13235
 
13083
13236
  // src/features/rules/antigravity-rule.ts
13084
- var import_node_path96 = require("path");
13085
- var import_mini51 = require("zod/mini");
13086
- var AntigravityRuleFrontmatterSchema = import_mini51.z.looseObject({
13087
- trigger: import_mini51.z.optional(
13088
- import_mini51.z.union([
13089
- import_mini51.z.literal("always_on"),
13090
- import_mini51.z.literal("glob"),
13091
- import_mini51.z.literal("manual"),
13092
- import_mini51.z.literal("model_decision"),
13093
- import_mini51.z.string()
13237
+ var import_node_path97 = require("path");
13238
+ var import_mini52 = require("zod/mini");
13239
+ var AntigravityRuleFrontmatterSchema = import_mini52.z.looseObject({
13240
+ trigger: import_mini52.z.optional(
13241
+ import_mini52.z.union([
13242
+ import_mini52.z.literal("always_on"),
13243
+ import_mini52.z.literal("glob"),
13244
+ import_mini52.z.literal("manual"),
13245
+ import_mini52.z.literal("model_decision"),
13246
+ import_mini52.z.string()
13094
13247
  // accepts any string for forward compatibility
13095
13248
  ])
13096
13249
  ),
13097
- globs: import_mini51.z.optional(import_mini51.z.string()),
13098
- description: import_mini51.z.optional(import_mini51.z.string())
13250
+ globs: import_mini52.z.optional(import_mini52.z.string()),
13251
+ description: import_mini52.z.optional(import_mini52.z.string())
13099
13252
  });
13100
13253
  function parseGlobsString(globs) {
13101
13254
  if (!globs) {
@@ -13240,7 +13393,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13240
13393
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
13241
13394
  if (!result.success) {
13242
13395
  throw new Error(
13243
- `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13396
+ `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13244
13397
  );
13245
13398
  }
13246
13399
  }
@@ -13264,7 +13417,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13264
13417
  relativeFilePath,
13265
13418
  validate = true
13266
13419
  }) {
13267
- const filePath = (0, import_node_path96.join)(
13420
+ const filePath = (0, import_node_path97.join)(
13268
13421
  baseDir,
13269
13422
  this.getSettablePaths().nonRoot.relativeDirPath,
13270
13423
  relativeFilePath
@@ -13404,7 +13557,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13404
13557
  };
13405
13558
 
13406
13559
  // src/features/rules/augmentcode-legacy-rule.ts
13407
- var import_node_path97 = require("path");
13560
+ var import_node_path98 = require("path");
13408
13561
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13409
13562
  toRulesyncRule() {
13410
13563
  const rulesyncFrontmatter = {
@@ -13464,8 +13617,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13464
13617
  }) {
13465
13618
  const settablePaths = this.getSettablePaths();
13466
13619
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
13467
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path97.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
13468
- const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
13620
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path98.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
13621
+ const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
13469
13622
  return new _AugmentcodeLegacyRule({
13470
13623
  baseDir,
13471
13624
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -13494,7 +13647,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13494
13647
  };
13495
13648
 
13496
13649
  // src/features/rules/augmentcode-rule.ts
13497
- var import_node_path98 = require("path");
13650
+ var import_node_path99 = require("path");
13498
13651
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13499
13652
  toRulesyncRule() {
13500
13653
  return this.toRulesyncRuleDefault();
@@ -13525,7 +13678,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13525
13678
  relativeFilePath,
13526
13679
  validate = true
13527
13680
  }) {
13528
- const filePath = (0, import_node_path98.join)(
13681
+ const filePath = (0, import_node_path99.join)(
13529
13682
  baseDir,
13530
13683
  this.getSettablePaths().nonRoot.relativeDirPath,
13531
13684
  relativeFilePath
@@ -13565,7 +13718,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13565
13718
  };
13566
13719
 
13567
13720
  // src/features/rules/claudecode-legacy-rule.ts
13568
- var import_node_path99 = require("path");
13721
+ var import_node_path100 = require("path");
13569
13722
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13570
13723
  static getSettablePaths({
13571
13724
  global,
@@ -13607,7 +13760,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13607
13760
  if (isRoot) {
13608
13761
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
13609
13762
  const fileContent2 = await readFileContent(
13610
- (0, import_node_path99.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13763
+ (0, import_node_path100.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13611
13764
  );
13612
13765
  return new _ClaudecodeLegacyRule({
13613
13766
  baseDir,
@@ -13621,8 +13774,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13621
13774
  if (!paths.nonRoot) {
13622
13775
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13623
13776
  }
13624
- const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13625
- const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13777
+ const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13778
+ const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13626
13779
  return new _ClaudecodeLegacyRule({
13627
13780
  baseDir,
13628
13781
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13681,10 +13834,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13681
13834
  };
13682
13835
 
13683
13836
  // src/features/rules/claudecode-rule.ts
13684
- var import_node_path100 = require("path");
13685
- var import_mini52 = require("zod/mini");
13686
- var ClaudecodeRuleFrontmatterSchema = import_mini52.z.object({
13687
- paths: import_mini52.z.optional(import_mini52.z.array(import_mini52.z.string()))
13837
+ var import_node_path101 = require("path");
13838
+ var import_mini53 = require("zod/mini");
13839
+ var ClaudecodeRuleFrontmatterSchema = import_mini53.z.object({
13840
+ paths: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
13688
13841
  });
13689
13842
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13690
13843
  frontmatter;
@@ -13722,7 +13875,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13722
13875
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
13723
13876
  if (!result.success) {
13724
13877
  throw new Error(
13725
- `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13878
+ `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13726
13879
  );
13727
13880
  }
13728
13881
  }
@@ -13752,7 +13905,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13752
13905
  if (isRoot) {
13753
13906
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
13754
13907
  const fileContent2 = await readFileContent(
13755
- (0, import_node_path100.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13908
+ (0, import_node_path101.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13756
13909
  );
13757
13910
  return new _ClaudecodeRule({
13758
13911
  baseDir,
@@ -13767,8 +13920,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13767
13920
  if (!paths.nonRoot) {
13768
13921
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13769
13922
  }
13770
- const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13771
- const filePath = (0, import_node_path100.join)(baseDir, relativePath);
13923
+ const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13924
+ const filePath = (0, import_node_path101.join)(baseDir, relativePath);
13772
13925
  const fileContent = await readFileContent(filePath);
13773
13926
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13774
13927
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -13879,7 +14032,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13879
14032
  return {
13880
14033
  success: false,
13881
14034
  error: new Error(
13882
- `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14035
+ `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13883
14036
  )
13884
14037
  };
13885
14038
  }
@@ -13899,10 +14052,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13899
14052
  };
13900
14053
 
13901
14054
  // src/features/rules/cline-rule.ts
13902
- var import_node_path101 = require("path");
13903
- var import_mini53 = require("zod/mini");
13904
- var ClineRuleFrontmatterSchema = import_mini53.z.object({
13905
- description: import_mini53.z.string()
14055
+ var import_node_path102 = require("path");
14056
+ var import_mini54 = require("zod/mini");
14057
+ var ClineRuleFrontmatterSchema = import_mini54.z.object({
14058
+ description: import_mini54.z.string()
13906
14059
  });
13907
14060
  var ClineRule = class _ClineRule extends ToolRule {
13908
14061
  static getSettablePaths(_options = {}) {
@@ -13945,7 +14098,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13945
14098
  validate = true
13946
14099
  }) {
13947
14100
  const fileContent = await readFileContent(
13948
- (0, import_node_path101.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14101
+ (0, import_node_path102.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13949
14102
  );
13950
14103
  return new _ClineRule({
13951
14104
  baseDir,
@@ -13971,7 +14124,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13971
14124
  };
13972
14125
 
13973
14126
  // src/features/rules/codexcli-rule.ts
13974
- var import_node_path102 = require("path");
14127
+ var import_node_path103 = require("path");
13975
14128
  var CodexcliRule = class _CodexcliRule extends ToolRule {
13976
14129
  static getSettablePaths({
13977
14130
  global,
@@ -14006,7 +14159,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14006
14159
  if (isRoot) {
14007
14160
  const relativePath2 = paths.root.relativeFilePath;
14008
14161
  const fileContent2 = await readFileContent(
14009
- (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14162
+ (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14010
14163
  );
14011
14164
  return new _CodexcliRule({
14012
14165
  baseDir,
@@ -14020,8 +14173,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14020
14173
  if (!paths.nonRoot) {
14021
14174
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14022
14175
  }
14023
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14024
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
14176
+ const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14177
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
14025
14178
  return new _CodexcliRule({
14026
14179
  baseDir,
14027
14180
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14080,12 +14233,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14080
14233
  };
14081
14234
 
14082
14235
  // src/features/rules/copilot-rule.ts
14083
- var import_node_path103 = require("path");
14084
- var import_mini54 = require("zod/mini");
14085
- var CopilotRuleFrontmatterSchema = import_mini54.z.object({
14086
- description: import_mini54.z.optional(import_mini54.z.string()),
14087
- applyTo: import_mini54.z.optional(import_mini54.z.string()),
14088
- excludeAgent: import_mini54.z.optional(import_mini54.z.union([import_mini54.z.literal("code-review"), import_mini54.z.literal("coding-agent")]))
14236
+ var import_node_path104 = require("path");
14237
+ var import_mini55 = require("zod/mini");
14238
+ var CopilotRuleFrontmatterSchema = import_mini55.z.object({
14239
+ description: import_mini55.z.optional(import_mini55.z.string()),
14240
+ applyTo: import_mini55.z.optional(import_mini55.z.string()),
14241
+ excludeAgent: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.literal("code-review"), import_mini55.z.literal("coding-agent")]))
14089
14242
  });
14090
14243
  var CopilotRule = class _CopilotRule extends ToolRule {
14091
14244
  frontmatter;
@@ -14117,7 +14270,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14117
14270
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
14118
14271
  if (!result.success) {
14119
14272
  throw new Error(
14120
- `Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14273
+ `Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14121
14274
  );
14122
14275
  }
14123
14276
  }
@@ -14207,8 +14360,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14207
14360
  const paths = this.getSettablePaths({ global });
14208
14361
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
14209
14362
  if (isRoot) {
14210
- const relativePath2 = (0, import_node_path103.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14211
- const filePath2 = (0, import_node_path103.join)(baseDir, relativePath2);
14363
+ const relativePath2 = (0, import_node_path104.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14364
+ const filePath2 = (0, import_node_path104.join)(baseDir, relativePath2);
14212
14365
  const fileContent2 = await readFileContent(filePath2);
14213
14366
  return new _CopilotRule({
14214
14367
  baseDir,
@@ -14223,8 +14376,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14223
14376
  if (!paths.nonRoot) {
14224
14377
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14225
14378
  }
14226
- const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14227
- const filePath = (0, import_node_path103.join)(baseDir, relativePath);
14379
+ const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14380
+ const filePath = (0, import_node_path104.join)(baseDir, relativePath);
14228
14381
  const fileContent = await readFileContent(filePath);
14229
14382
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14230
14383
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -14270,7 +14423,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14270
14423
  return {
14271
14424
  success: false,
14272
14425
  error: new Error(
14273
- `Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14426
+ `Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14274
14427
  )
14275
14428
  };
14276
14429
  }
@@ -14290,12 +14443,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14290
14443
  };
14291
14444
 
14292
14445
  // src/features/rules/cursor-rule.ts
14293
- var import_node_path104 = require("path");
14294
- var import_mini55 = require("zod/mini");
14295
- var CursorRuleFrontmatterSchema = import_mini55.z.object({
14296
- description: import_mini55.z.optional(import_mini55.z.string()),
14297
- globs: import_mini55.z.optional(import_mini55.z.string()),
14298
- alwaysApply: import_mini55.z.optional(import_mini55.z.boolean())
14446
+ var import_node_path105 = require("path");
14447
+ var import_mini56 = require("zod/mini");
14448
+ var CursorRuleFrontmatterSchema = import_mini56.z.object({
14449
+ description: import_mini56.z.optional(import_mini56.z.string()),
14450
+ globs: import_mini56.z.optional(import_mini56.z.string()),
14451
+ alwaysApply: import_mini56.z.optional(import_mini56.z.boolean())
14299
14452
  });
14300
14453
  var CursorRule = class _CursorRule extends ToolRule {
14301
14454
  frontmatter;
@@ -14312,7 +14465,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14312
14465
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
14313
14466
  if (!result.success) {
14314
14467
  throw new Error(
14315
- `Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14468
+ `Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14316
14469
  );
14317
14470
  }
14318
14471
  }
@@ -14428,7 +14581,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14428
14581
  relativeFilePath,
14429
14582
  validate = true
14430
14583
  }) {
14431
- const filePath = (0, import_node_path104.join)(
14584
+ const filePath = (0, import_node_path105.join)(
14432
14585
  baseDir,
14433
14586
  this.getSettablePaths().nonRoot.relativeDirPath,
14434
14587
  relativeFilePath
@@ -14438,7 +14591,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14438
14591
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
14439
14592
  if (!result.success) {
14440
14593
  throw new Error(
14441
- `Invalid frontmatter in ${(0, import_node_path104.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
14594
+ `Invalid frontmatter in ${(0, import_node_path105.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
14442
14595
  );
14443
14596
  }
14444
14597
  return new _CursorRule({
@@ -14475,7 +14628,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14475
14628
  return {
14476
14629
  success: false,
14477
14630
  error: new Error(
14478
- `Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14631
+ `Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14479
14632
  )
14480
14633
  };
14481
14634
  }
@@ -14495,7 +14648,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14495
14648
  };
14496
14649
 
14497
14650
  // src/features/rules/factorydroid-rule.ts
14498
- var import_node_path105 = require("path");
14651
+ var import_node_path106 = require("path");
14499
14652
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14500
14653
  constructor({ fileContent, root, ...rest }) {
14501
14654
  super({
@@ -14535,8 +14688,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14535
14688
  const paths = this.getSettablePaths({ global });
14536
14689
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
14537
14690
  if (isRoot) {
14538
- const relativePath2 = (0, import_node_path105.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14539
- const fileContent2 = await readFileContent((0, import_node_path105.join)(baseDir, relativePath2));
14691
+ const relativePath2 = (0, import_node_path106.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14692
+ const fileContent2 = await readFileContent((0, import_node_path106.join)(baseDir, relativePath2));
14540
14693
  return new _FactorydroidRule({
14541
14694
  baseDir,
14542
14695
  relativeDirPath: paths.root.relativeDirPath,
@@ -14549,8 +14702,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14549
14702
  if (!paths.nonRoot) {
14550
14703
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14551
14704
  }
14552
- const relativePath = (0, import_node_path105.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14553
- const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
14705
+ const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14706
+ const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14554
14707
  return new _FactorydroidRule({
14555
14708
  baseDir,
14556
14709
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14609,7 +14762,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14609
14762
  };
14610
14763
 
14611
14764
  // src/features/rules/geminicli-rule.ts
14612
- var import_node_path106 = require("path");
14765
+ var import_node_path107 = require("path");
14613
14766
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14614
14767
  static getSettablePaths({
14615
14768
  global,
@@ -14644,7 +14797,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14644
14797
  if (isRoot) {
14645
14798
  const relativePath2 = paths.root.relativeFilePath;
14646
14799
  const fileContent2 = await readFileContent(
14647
- (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14800
+ (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14648
14801
  );
14649
14802
  return new _GeminiCliRule({
14650
14803
  baseDir,
@@ -14658,8 +14811,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14658
14811
  if (!paths.nonRoot) {
14659
14812
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14660
14813
  }
14661
- const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14662
- const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14814
+ const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14815
+ const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14663
14816
  return new _GeminiCliRule({
14664
14817
  baseDir,
14665
14818
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14718,7 +14871,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14718
14871
  };
14719
14872
 
14720
14873
  // src/features/rules/goose-rule.ts
14721
- var import_node_path107 = require("path");
14874
+ var import_node_path108 = require("path");
14722
14875
  var GooseRule = class _GooseRule extends ToolRule {
14723
14876
  static getSettablePaths({
14724
14877
  global,
@@ -14753,7 +14906,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14753
14906
  if (isRoot) {
14754
14907
  const relativePath2 = paths.root.relativeFilePath;
14755
14908
  const fileContent2 = await readFileContent(
14756
- (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14909
+ (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14757
14910
  );
14758
14911
  return new _GooseRule({
14759
14912
  baseDir,
@@ -14767,8 +14920,8 @@ var GooseRule = class _GooseRule extends ToolRule {
14767
14920
  if (!paths.nonRoot) {
14768
14921
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14769
14922
  }
14770
- const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14771
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14923
+ const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14924
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14772
14925
  return new _GooseRule({
14773
14926
  baseDir,
14774
14927
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14827,7 +14980,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14827
14980
  };
14828
14981
 
14829
14982
  // src/features/rules/junie-rule.ts
14830
- var import_node_path108 = require("path");
14983
+ var import_node_path109 = require("path");
14831
14984
  var JunieRule = class _JunieRule extends ToolRule {
14832
14985
  static getSettablePaths(_options = {}) {
14833
14986
  return {
@@ -14846,8 +14999,8 @@ var JunieRule = class _JunieRule extends ToolRule {
14846
14999
  validate = true
14847
15000
  }) {
14848
15001
  const isRoot = relativeFilePath === "guidelines.md";
14849
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path108.join)(".junie", "memories", relativeFilePath);
14850
- const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
15002
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path109.join)(".junie", "memories", relativeFilePath);
15003
+ const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
14851
15004
  return new _JunieRule({
14852
15005
  baseDir,
14853
15006
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14902,7 +15055,7 @@ var JunieRule = class _JunieRule extends ToolRule {
14902
15055
  };
14903
15056
 
14904
15057
  // src/features/rules/kilo-rule.ts
14905
- var import_node_path109 = require("path");
15058
+ var import_node_path110 = require("path");
14906
15059
  var KiloRule = class _KiloRule extends ToolRule {
14907
15060
  static getSettablePaths(_options = {}) {
14908
15061
  return {
@@ -14917,7 +15070,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14917
15070
  validate = true
14918
15071
  }) {
14919
15072
  const fileContent = await readFileContent(
14920
- (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15073
+ (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14921
15074
  );
14922
15075
  return new _KiloRule({
14923
15076
  baseDir,
@@ -14969,7 +15122,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14969
15122
  };
14970
15123
 
14971
15124
  // src/features/rules/kiro-rule.ts
14972
- var import_node_path110 = require("path");
15125
+ var import_node_path111 = require("path");
14973
15126
  var KiroRule = class _KiroRule extends ToolRule {
14974
15127
  static getSettablePaths(_options = {}) {
14975
15128
  return {
@@ -14984,7 +15137,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14984
15137
  validate = true
14985
15138
  }) {
14986
15139
  const fileContent = await readFileContent(
14987
- (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15140
+ (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14988
15141
  );
14989
15142
  return new _KiroRule({
14990
15143
  baseDir,
@@ -15038,7 +15191,7 @@ var KiroRule = class _KiroRule extends ToolRule {
15038
15191
  };
15039
15192
 
15040
15193
  // src/features/rules/opencode-rule.ts
15041
- var import_node_path111 = require("path");
15194
+ var import_node_path112 = require("path");
15042
15195
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15043
15196
  static getSettablePaths({
15044
15197
  global,
@@ -15073,7 +15226,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15073
15226
  if (isRoot) {
15074
15227
  const relativePath2 = paths.root.relativeFilePath;
15075
15228
  const fileContent2 = await readFileContent(
15076
- (0, import_node_path111.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15229
+ (0, import_node_path112.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15077
15230
  );
15078
15231
  return new _OpenCodeRule({
15079
15232
  baseDir,
@@ -15087,8 +15240,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15087
15240
  if (!paths.nonRoot) {
15088
15241
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15089
15242
  }
15090
- const relativePath = (0, import_node_path111.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15091
- const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
15243
+ const relativePath = (0, import_node_path112.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15244
+ const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
15092
15245
  return new _OpenCodeRule({
15093
15246
  baseDir,
15094
15247
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15147,7 +15300,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15147
15300
  };
15148
15301
 
15149
15302
  // src/features/rules/qwencode-rule.ts
15150
- var import_node_path112 = require("path");
15303
+ var import_node_path113 = require("path");
15151
15304
  var QwencodeRule = class _QwencodeRule extends ToolRule {
15152
15305
  static getSettablePaths(_options = {}) {
15153
15306
  return {
@@ -15166,8 +15319,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
15166
15319
  validate = true
15167
15320
  }) {
15168
15321
  const isRoot = relativeFilePath === "QWEN.md";
15169
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path112.join)(".qwen", "memories", relativeFilePath);
15170
- const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
15322
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path113.join)(".qwen", "memories", relativeFilePath);
15323
+ const fileContent = await readFileContent((0, import_node_path113.join)(baseDir, relativePath));
15171
15324
  return new _QwencodeRule({
15172
15325
  baseDir,
15173
15326
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -15219,7 +15372,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
15219
15372
  };
15220
15373
 
15221
15374
  // src/features/rules/replit-rule.ts
15222
- var import_node_path113 = require("path");
15375
+ var import_node_path114 = require("path");
15223
15376
  var ReplitRule = class _ReplitRule extends ToolRule {
15224
15377
  static getSettablePaths(_options = {}) {
15225
15378
  return {
@@ -15241,7 +15394,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
15241
15394
  }
15242
15395
  const relativePath = paths.root.relativeFilePath;
15243
15396
  const fileContent = await readFileContent(
15244
- (0, import_node_path113.join)(baseDir, paths.root.relativeDirPath, relativePath)
15397
+ (0, import_node_path114.join)(baseDir, paths.root.relativeDirPath, relativePath)
15245
15398
  );
15246
15399
  return new _ReplitRule({
15247
15400
  baseDir,
@@ -15307,7 +15460,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
15307
15460
  };
15308
15461
 
15309
15462
  // src/features/rules/roo-rule.ts
15310
- var import_node_path114 = require("path");
15463
+ var import_node_path115 = require("path");
15311
15464
  var RooRule = class _RooRule extends ToolRule {
15312
15465
  static getSettablePaths(_options = {}) {
15313
15466
  return {
@@ -15322,7 +15475,7 @@ var RooRule = class _RooRule extends ToolRule {
15322
15475
  validate = true
15323
15476
  }) {
15324
15477
  const fileContent = await readFileContent(
15325
- (0, import_node_path114.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15478
+ (0, import_node_path115.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15326
15479
  );
15327
15480
  return new _RooRule({
15328
15481
  baseDir,
@@ -15391,7 +15544,7 @@ var RooRule = class _RooRule extends ToolRule {
15391
15544
  };
15392
15545
 
15393
15546
  // src/features/rules/warp-rule.ts
15394
- var import_node_path115 = require("path");
15547
+ var import_node_path116 = require("path");
15395
15548
  var WarpRule = class _WarpRule extends ToolRule {
15396
15549
  constructor({ fileContent, root, ...rest }) {
15397
15550
  super({
@@ -15417,8 +15570,8 @@ var WarpRule = class _WarpRule extends ToolRule {
15417
15570
  validate = true
15418
15571
  }) {
15419
15572
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
15420
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path115.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
15421
- const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
15573
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path116.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
15574
+ const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
15422
15575
  return new _WarpRule({
15423
15576
  baseDir,
15424
15577
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -15473,7 +15626,7 @@ var WarpRule = class _WarpRule extends ToolRule {
15473
15626
  };
15474
15627
 
15475
15628
  // src/features/rules/windsurf-rule.ts
15476
- var import_node_path116 = require("path");
15629
+ var import_node_path117 = require("path");
15477
15630
  var WindsurfRule = class _WindsurfRule extends ToolRule {
15478
15631
  static getSettablePaths(_options = {}) {
15479
15632
  return {
@@ -15488,7 +15641,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
15488
15641
  validate = true
15489
15642
  }) {
15490
15643
  const fileContent = await readFileContent(
15491
- (0, import_node_path116.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15644
+ (0, import_node_path117.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15492
15645
  );
15493
15646
  return new _WindsurfRule({
15494
15647
  baseDir,
@@ -15564,8 +15717,8 @@ var rulesProcessorToolTargets = [
15564
15717
  "warp",
15565
15718
  "windsurf"
15566
15719
  ];
15567
- var RulesProcessorToolTargetSchema = import_mini56.z.enum(rulesProcessorToolTargets);
15568
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path117.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15720
+ var RulesProcessorToolTargetSchema = import_mini57.z.enum(rulesProcessorToolTargets);
15721
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path118.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15569
15722
  var toolRuleFactories = /* @__PURE__ */ new Map([
15570
15723
  [
15571
15724
  "agentsmd",
@@ -15940,7 +16093,7 @@ var RulesProcessor = class extends FeatureProcessor {
15940
16093
  }).relativeDirPath;
15941
16094
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
15942
16095
  const frontmatter = skill.getFrontmatter();
15943
- const relativePath = (0, import_node_path117.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
16096
+ const relativePath = (0, import_node_path118.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15944
16097
  return {
15945
16098
  name: frontmatter.name,
15946
16099
  description: frontmatter.description,
@@ -16053,12 +16206,12 @@ var RulesProcessor = class extends FeatureProcessor {
16053
16206
  * Load and parse rulesync rule files from .rulesync/rules/ directory
16054
16207
  */
16055
16208
  async loadRulesyncFiles() {
16056
- const rulesyncBaseDir = (0, import_node_path117.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
16057
- const files = await findFilesByGlobs((0, import_node_path117.join)(rulesyncBaseDir, "**", "*.md"));
16209
+ const rulesyncBaseDir = (0, import_node_path118.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
16210
+ const files = await findFilesByGlobs((0, import_node_path118.join)(rulesyncBaseDir, "**", "*.md"));
16058
16211
  logger.debug(`Found ${files.length} rulesync files`);
16059
16212
  const rulesyncRules = await Promise.all(
16060
16213
  files.map((file) => {
16061
- const relativeFilePath = (0, import_node_path117.relative)(rulesyncBaseDir, file);
16214
+ const relativeFilePath = (0, import_node_path118.relative)(rulesyncBaseDir, file);
16062
16215
  checkPathTraversal({
16063
16216
  relativePath: relativeFilePath,
16064
16217
  intendedRootDir: rulesyncBaseDir
@@ -16133,7 +16286,7 @@ var RulesProcessor = class extends FeatureProcessor {
16133
16286
  global: this.global
16134
16287
  });
16135
16288
  const resolveRelativeDirPath = (filePath) => {
16136
- const dirName = (0, import_node_path117.dirname)((0, import_node_path117.relative)(this.baseDir, filePath));
16289
+ const dirName = (0, import_node_path118.dirname)((0, import_node_path118.relative)(this.baseDir, filePath));
16137
16290
  return dirName === "" ? "." : dirName;
16138
16291
  };
16139
16292
  const findFilesWithFallback = async (primaryGlob, alternativeRoots, buildAltGlob) => {
@@ -16151,13 +16304,13 @@ var RulesProcessor = class extends FeatureProcessor {
16151
16304
  return [];
16152
16305
  }
16153
16306
  const uniqueRootFilePaths = await findFilesWithFallback(
16154
- (0, import_node_path117.join)(
16307
+ (0, import_node_path118.join)(
16155
16308
  this.baseDir,
16156
16309
  settablePaths.root.relativeDirPath ?? ".",
16157
16310
  settablePaths.root.relativeFilePath
16158
16311
  ),
16159
16312
  settablePaths.alternativeRoots,
16160
- (alt) => (0, import_node_path117.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
16313
+ (alt) => (0, import_node_path118.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
16161
16314
  );
16162
16315
  if (forDeletion) {
16163
16316
  return uniqueRootFilePaths.map((filePath) => {
@@ -16169,7 +16322,7 @@ var RulesProcessor = class extends FeatureProcessor {
16169
16322
  return factory.class.forDeletion({
16170
16323
  baseDir: this.baseDir,
16171
16324
  relativeDirPath,
16172
- relativeFilePath: (0, import_node_path117.basename)(filePath),
16325
+ relativeFilePath: (0, import_node_path118.basename)(filePath),
16173
16326
  global: this.global
16174
16327
  });
16175
16328
  }).filter((rule) => rule.isDeletable());
@@ -16183,7 +16336,7 @@ var RulesProcessor = class extends FeatureProcessor {
16183
16336
  });
16184
16337
  return factory.class.fromFile({
16185
16338
  baseDir: this.baseDir,
16186
- relativeFilePath: (0, import_node_path117.basename)(filePath),
16339
+ relativeFilePath: (0, import_node_path118.basename)(filePath),
16187
16340
  relativeDirPath,
16188
16341
  global: this.global
16189
16342
  });
@@ -16202,9 +16355,9 @@ var RulesProcessor = class extends FeatureProcessor {
16202
16355
  return [];
16203
16356
  }
16204
16357
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
16205
- (0, import_node_path117.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
16358
+ (0, import_node_path118.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
16206
16359
  settablePaths.alternativeRoots,
16207
- (alt) => (0, import_node_path117.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
16360
+ (alt) => (0, import_node_path118.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
16208
16361
  );
16209
16362
  return uniqueLocalRootFilePaths.map((filePath) => {
16210
16363
  const relativeDirPath = resolveRelativeDirPath(filePath);
@@ -16215,7 +16368,7 @@ var RulesProcessor = class extends FeatureProcessor {
16215
16368
  return factory.class.forDeletion({
16216
16369
  baseDir: this.baseDir,
16217
16370
  relativeDirPath,
16218
- relativeFilePath: (0, import_node_path117.basename)(filePath),
16371
+ relativeFilePath: (0, import_node_path118.basename)(filePath),
16219
16372
  global: this.global
16220
16373
  });
16221
16374
  }).filter((rule) => rule.isDeletable());
@@ -16225,13 +16378,13 @@ var RulesProcessor = class extends FeatureProcessor {
16225
16378
  if (!settablePaths.nonRoot) {
16226
16379
  return [];
16227
16380
  }
16228
- const nonRootBaseDir = (0, import_node_path117.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
16381
+ const nonRootBaseDir = (0, import_node_path118.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
16229
16382
  const nonRootFilePaths = await findFilesByGlobs(
16230
- (0, import_node_path117.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
16383
+ (0, import_node_path118.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
16231
16384
  );
16232
16385
  if (forDeletion) {
16233
16386
  return nonRootFilePaths.map((filePath) => {
16234
- const relativeFilePath = (0, import_node_path117.relative)(nonRootBaseDir, filePath);
16387
+ const relativeFilePath = (0, import_node_path118.relative)(nonRootBaseDir, filePath);
16235
16388
  checkPathTraversal({
16236
16389
  relativePath: relativeFilePath,
16237
16390
  intendedRootDir: nonRootBaseDir
@@ -16246,7 +16399,7 @@ var RulesProcessor = class extends FeatureProcessor {
16246
16399
  }
16247
16400
  return await Promise.all(
16248
16401
  nonRootFilePaths.map((filePath) => {
16249
- const relativeFilePath = (0, import_node_path117.relative)(nonRootBaseDir, filePath);
16402
+ const relativeFilePath = (0, import_node_path118.relative)(nonRootBaseDir, filePath);
16250
16403
  checkPathTraversal({
16251
16404
  relativePath: relativeFilePath,
16252
16405
  intendedRootDir: nonRootBaseDir
@@ -16359,14 +16512,14 @@ s/<command> [arguments]
16359
16512
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
16360
16513
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
16361
16514
 
16362
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path117.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
16515
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path118.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
16363
16516
  const subagentsSection = subagents ? `## Simulated Subagents
16364
16517
 
16365
16518
  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.
16366
16519
 
16367
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path117.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
16520
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path118.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
16368
16521
 
16369
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path117.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
16522
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path118.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
16370
16523
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
16371
16524
  const result = [
16372
16525
  overview,
@@ -16446,7 +16599,7 @@ function warnUnsupportedTargets(params) {
16446
16599
  }
16447
16600
  }
16448
16601
  async function checkRulesyncDirExists(params) {
16449
- return fileExists((0, import_node_path118.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16602
+ return fileExists((0, import_node_path119.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16450
16603
  }
16451
16604
  async function generate(params) {
16452
16605
  const { config } = params;