rulesync 7.30.0 → 8.1.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
@@ -356,6 +356,7 @@ var ConfigParamsSchema = import_mini3.z.object({
356
356
  simulateCommands: (0, import_mini3.optional)(import_mini3.z.boolean()),
357
357
  simulateSubagents: (0, import_mini3.optional)(import_mini3.z.boolean()),
358
358
  simulateSkills: (0, import_mini3.optional)(import_mini3.z.boolean()),
359
+ gitignoreTargetsOnly: (0, import_mini3.optional)(import_mini3.z.boolean()),
359
360
  dryRun: (0, import_mini3.optional)(import_mini3.z.boolean()),
360
361
  check: (0, import_mini3.optional)(import_mini3.z.boolean()),
361
362
  // Declarative skill sources
@@ -383,6 +384,7 @@ var Config = class _Config {
383
384
  simulateCommands;
384
385
  simulateSubagents;
385
386
  simulateSkills;
387
+ gitignoreTargetsOnly;
386
388
  dryRun;
387
389
  check;
388
390
  sources;
@@ -397,6 +399,7 @@ var Config = class _Config {
397
399
  simulateCommands,
398
400
  simulateSubagents,
399
401
  simulateSkills,
402
+ gitignoreTargetsOnly,
400
403
  dryRun,
401
404
  check,
402
405
  sources
@@ -415,6 +418,7 @@ var Config = class _Config {
415
418
  this.simulateCommands = simulateCommands ?? false;
416
419
  this.simulateSubagents = simulateSubagents ?? false;
417
420
  this.simulateSkills = simulateSkills ?? false;
421
+ this.gitignoreTargetsOnly = gitignoreTargetsOnly ?? true;
418
422
  this.dryRun = dryRun ?? false;
419
423
  this.check = check ?? false;
420
424
  this.sources = sources ?? [];
@@ -540,6 +544,9 @@ var Config = class _Config {
540
544
  getSimulateSkills() {
541
545
  return this.simulateSkills;
542
546
  }
547
+ getGitignoreTargetsOnly() {
548
+ return this.gitignoreTargetsOnly;
549
+ }
543
550
  getDryRun() {
544
551
  return this.dryRun;
545
552
  }
@@ -571,6 +578,7 @@ var getDefaults = () => ({
571
578
  simulateCommands: false,
572
579
  simulateSubagents: false,
573
580
  simulateSkills: false,
581
+ gitignoreTargetsOnly: true,
574
582
  dryRun: false,
575
583
  check: false,
576
584
  sources: []
@@ -597,6 +605,7 @@ var mergeConfigs = (baseConfig, localConfig) => {
597
605
  simulateCommands: localConfig.simulateCommands ?? baseConfig.simulateCommands,
598
606
  simulateSubagents: localConfig.simulateSubagents ?? baseConfig.simulateSubagents,
599
607
  simulateSkills: localConfig.simulateSkills ?? baseConfig.simulateSkills,
608
+ gitignoreTargetsOnly: localConfig.gitignoreTargetsOnly ?? baseConfig.gitignoreTargetsOnly,
600
609
  dryRun: localConfig.dryRun ?? baseConfig.dryRun,
601
610
  check: localConfig.check ?? baseConfig.check,
602
611
  sources: localConfig.sources ?? baseConfig.sources
@@ -615,6 +624,7 @@ var ConfigResolver = class {
615
624
  simulateCommands,
616
625
  simulateSubagents,
617
626
  simulateSkills,
627
+ gitignoreTargetsOnly,
618
628
  dryRun,
619
629
  check
620
630
  }) {
@@ -628,6 +638,7 @@ var ConfigResolver = class {
628
638
  const resolvedSimulateCommands = simulateCommands ?? configByFile.simulateCommands ?? getDefaults().simulateCommands;
629
639
  const resolvedSimulateSubagents = simulateSubagents ?? configByFile.simulateSubagents ?? getDefaults().simulateSubagents;
630
640
  const resolvedSimulateSkills = simulateSkills ?? configByFile.simulateSkills ?? getDefaults().simulateSkills;
641
+ const resolvedGitignoreTargetsOnly = gitignoreTargetsOnly ?? configByFile.gitignoreTargetsOnly ?? getDefaults().gitignoreTargetsOnly;
631
642
  const configParams = {
632
643
  targets: targets ?? configByFile.targets ?? getDefaults().targets,
633
644
  features: features ?? configByFile.features ?? getDefaults().features,
@@ -642,6 +653,7 @@ var ConfigResolver = class {
642
653
  simulateCommands: resolvedSimulateCommands,
643
654
  simulateSubagents: resolvedSimulateSubagents,
644
655
  simulateSkills: resolvedSimulateSkills,
656
+ gitignoreTargetsOnly: resolvedGitignoreTargetsOnly,
645
657
  dryRun: dryRun ?? configByFile.dryRun ?? getDefaults().dryRun,
646
658
  check: check ?? configByFile.check ?? getDefaults().check,
647
659
  sources: configByFile.sources ?? getDefaults().sources
@@ -664,7 +676,7 @@ function getBaseDirsInLightOfGlobal({
664
676
  }
665
677
 
666
678
  // src/lib/generate.ts
667
- var import_node_path137 = require("path");
679
+ var import_node_path139 = require("path");
668
680
  var import_es_toolkit5 = require("es-toolkit");
669
681
 
670
682
  // src/features/commands/commands-processor.ts
@@ -6838,7 +6850,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6838
6850
  relativeDirPath: paths.relativeDirPath,
6839
6851
  relativeFilePath: paths.relativeFilePath,
6840
6852
  fileContent: JSON.stringify(newJson, null, 2),
6841
- validate
6853
+ validate,
6854
+ global
6842
6855
  });
6843
6856
  }
6844
6857
  static async fromRulesyncMcp({
@@ -6859,7 +6872,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6859
6872
  relativeDirPath: paths.relativeDirPath,
6860
6873
  relativeFilePath: paths.relativeFilePath,
6861
6874
  fileContent: JSON.stringify(mcpJson, null, 2),
6862
- validate
6875
+ validate,
6876
+ global
6863
6877
  });
6864
6878
  }
6865
6879
  toRulesyncMcp() {
@@ -8978,7 +8992,7 @@ var McpProcessor = class extends FeatureProcessor {
8978
8992
  };
8979
8993
 
8980
8994
  // src/features/permissions/permissions-processor.ts
8981
- var import_mini30 = require("zod/mini");
8995
+ var import_mini31 = require("zod/mini");
8982
8996
 
8983
8997
  // src/features/permissions/claudecode-permissions.ts
8984
8998
  var import_node_path65 = require("path");
@@ -9303,16 +9317,382 @@ function convertClaudeToRulesyncPermissions(params) {
9303
9317
  return { permission };
9304
9318
  }
9305
9319
 
9306
- // src/features/permissions/opencode-permissions.ts
9320
+ // src/features/permissions/codexcli-permissions.ts
9307
9321
  var import_node_path66 = require("path");
9308
- var import_jsonc_parser5 = require("jsonc-parser");
9322
+ var smolToml4 = __toESM(require("smol-toml"), 1);
9323
+ var RULESYNC_PROFILE_NAME = "rulesync";
9324
+ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
9325
+ static getSettablePaths(_options = {}) {
9326
+ return {
9327
+ relativeDirPath: ".codex",
9328
+ relativeFilePath: "config.toml"
9329
+ };
9330
+ }
9331
+ isDeletable() {
9332
+ return false;
9333
+ }
9334
+ static async fromFile({
9335
+ baseDir = process.cwd(),
9336
+ validate = true,
9337
+ global = false
9338
+ }) {
9339
+ const paths = this.getSettablePaths({ global });
9340
+ const filePath = (0, import_node_path66.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9341
+ const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
9342
+ return new _CodexcliPermissions({
9343
+ baseDir,
9344
+ relativeDirPath: paths.relativeDirPath,
9345
+ relativeFilePath: paths.relativeFilePath,
9346
+ fileContent,
9347
+ validate
9348
+ });
9349
+ }
9350
+ static async fromRulesyncPermissions({
9351
+ baseDir = process.cwd(),
9352
+ rulesyncPermissions,
9353
+ validate = true,
9354
+ logger,
9355
+ global = false
9356
+ }) {
9357
+ const paths = this.getSettablePaths({ global });
9358
+ const filePath = (0, import_node_path66.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9359
+ const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
9360
+ const parsed = toMutableTable(smolToml4.parse(existingContent));
9361
+ const profile = convertRulesyncToCodexProfile({
9362
+ config: rulesyncPermissions.getJson(),
9363
+ logger
9364
+ });
9365
+ const permissionsTable = toMutableTable(parsed.permissions);
9366
+ permissionsTable[RULESYNC_PROFILE_NAME] = profile;
9367
+ parsed.permissions = permissionsTable;
9368
+ parsed.default_permissions = RULESYNC_PROFILE_NAME;
9369
+ return new _CodexcliPermissions({
9370
+ baseDir,
9371
+ relativeDirPath: paths.relativeDirPath,
9372
+ relativeFilePath: paths.relativeFilePath,
9373
+ fileContent: smolToml4.stringify(parsed),
9374
+ validate
9375
+ });
9376
+ }
9377
+ toRulesyncPermissions() {
9378
+ let parsed;
9379
+ try {
9380
+ parsed = smolToml4.parse(this.getFileContent());
9381
+ } catch (error) {
9382
+ throw new Error(
9383
+ `Failed to parse Codex CLI permissions content in ${(0, import_node_path66.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9384
+ { cause: error }
9385
+ );
9386
+ }
9387
+ const table = toMutableTable(parsed);
9388
+ const defaultProfile = typeof table.default_permissions === "string" ? table.default_permissions : void 0;
9389
+ const permissionsTable = toMutableTable(table.permissions);
9390
+ const profile = toCodexProfile(permissionsTable[defaultProfile ?? RULESYNC_PROFILE_NAME]) ?? toCodexProfile(permissionsTable[RULESYNC_PROFILE_NAME]);
9391
+ const config = convertCodexProfileToRulesync(profile);
9392
+ return this.toRulesyncPermissionsDefault({
9393
+ fileContent: JSON.stringify(config, null, 2)
9394
+ });
9395
+ }
9396
+ validate() {
9397
+ return { success: true, error: null };
9398
+ }
9399
+ static forDeletion({
9400
+ baseDir = process.cwd(),
9401
+ relativeDirPath,
9402
+ relativeFilePath
9403
+ }) {
9404
+ return new _CodexcliPermissions({
9405
+ baseDir,
9406
+ relativeDirPath,
9407
+ relativeFilePath,
9408
+ fileContent: smolToml4.stringify({}),
9409
+ validate: false
9410
+ });
9411
+ }
9412
+ };
9413
+ function convertRulesyncToCodexProfile({
9414
+ config,
9415
+ logger
9416
+ }) {
9417
+ const filesystem = {};
9418
+ const domains = {};
9419
+ for (const [toolName, rules] of Object.entries(config.permission)) {
9420
+ if (toolName === "read") {
9421
+ for (const [pattern, action] of Object.entries(rules)) {
9422
+ filesystem[pattern] = mapReadAction(action);
9423
+ }
9424
+ continue;
9425
+ }
9426
+ if (toolName === "edit" || toolName === "write") {
9427
+ for (const [pattern, action] of Object.entries(rules)) {
9428
+ filesystem[pattern] = mapWriteAction(action);
9429
+ }
9430
+ continue;
9431
+ }
9432
+ if (toolName === "webfetch") {
9433
+ for (const [pattern, action] of Object.entries(rules)) {
9434
+ if (action === "ask") {
9435
+ logger?.warn(
9436
+ `Codex CLI does not support "ask" for network domain permissions. Skipping webfetch rule: ${pattern}`
9437
+ );
9438
+ continue;
9439
+ }
9440
+ domains[pattern] = action;
9441
+ }
9442
+ continue;
9443
+ }
9444
+ logger?.warn(
9445
+ `Codex CLI permissions support only read/edit/write/webfetch categories. Skipping: ${toolName}`
9446
+ );
9447
+ }
9448
+ return {
9449
+ ...Object.keys(filesystem).length > 0 ? { filesystem } : {},
9450
+ ...Object.keys(domains).length > 0 ? { network: { domains } } : {}
9451
+ };
9452
+ }
9453
+ function convertCodexProfileToRulesync(profile) {
9454
+ const permission = {};
9455
+ if (profile?.filesystem) {
9456
+ permission.read = {};
9457
+ permission.edit = {};
9458
+ for (const [pattern, access] of Object.entries(profile.filesystem)) {
9459
+ if (access === "none") {
9460
+ permission.read[pattern] = "deny";
9461
+ permission.edit[pattern] = "deny";
9462
+ } else if (access === "read") {
9463
+ permission.read[pattern] = "allow";
9464
+ } else {
9465
+ permission.edit[pattern] = "allow";
9466
+ }
9467
+ }
9468
+ }
9469
+ if (profile?.network?.domains) {
9470
+ permission.webfetch = {};
9471
+ for (const [domain, value] of Object.entries(profile.network.domains)) {
9472
+ permission.webfetch[domain] = value;
9473
+ }
9474
+ }
9475
+ return { permission };
9476
+ }
9477
+ function toCodexProfile(value) {
9478
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9479
+ const table = toMutableTable(value);
9480
+ const filesystem = toFilesystemRecord(table.filesystem);
9481
+ const networkRaw = toMutableTable(table.network);
9482
+ const domains = toDomainRecord(networkRaw.domains);
9483
+ return {
9484
+ ...filesystem ? { filesystem } : {},
9485
+ ...domains ? { network: { domains } } : {}
9486
+ };
9487
+ }
9488
+ function toMutableTable(value) {
9489
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
9490
+ return {};
9491
+ }
9492
+ return { ...value };
9493
+ }
9494
+ function toFilesystemRecord(value) {
9495
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9496
+ const result = {};
9497
+ for (const [key, raw] of Object.entries(value)) {
9498
+ if (typeof raw !== "string") continue;
9499
+ if (raw === "read" || raw === "write" || raw === "none") {
9500
+ result[key] = raw;
9501
+ }
9502
+ }
9503
+ return Object.keys(result).length > 0 ? result : void 0;
9504
+ }
9505
+ function toDomainRecord(value) {
9506
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9507
+ const result = {};
9508
+ for (const [key, raw] of Object.entries(value)) {
9509
+ if (raw === "allow" || raw === "deny") {
9510
+ result[key] = raw;
9511
+ }
9512
+ }
9513
+ return Object.keys(result).length > 0 ? result : void 0;
9514
+ }
9515
+ function mapReadAction(action) {
9516
+ return action === "allow" ? "read" : "none";
9517
+ }
9518
+ function mapWriteAction(action) {
9519
+ return action === "allow" ? "write" : "none";
9520
+ }
9521
+
9522
+ // src/features/permissions/geminicli-permissions.ts
9523
+ var import_node_path67 = require("path");
9309
9524
  var import_mini29 = require("zod/mini");
9310
- var OpencodePermissionSchema = import_mini29.z.union([
9311
- import_mini29.z.enum(["allow", "ask", "deny"]),
9312
- import_mini29.z.record(import_mini29.z.string(), import_mini29.z.enum(["allow", "ask", "deny"]))
9525
+ var GeminiCliSettingsSchema = import_mini29.z.looseObject({
9526
+ tools: import_mini29.z.optional(
9527
+ import_mini29.z.looseObject({
9528
+ allowed: import_mini29.z.optional(import_mini29.z.array(import_mini29.z.string())),
9529
+ exclude: import_mini29.z.optional(import_mini29.z.array(import_mini29.z.string()))
9530
+ })
9531
+ )
9532
+ });
9533
+ var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
9534
+ bash: "run_shell_command",
9535
+ read: "read_file",
9536
+ edit: "replace",
9537
+ write: "write_file",
9538
+ webfetch: "web_fetch"
9539
+ };
9540
+ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
9541
+ static getSettablePaths(_options = {}) {
9542
+ return {
9543
+ relativeDirPath: ".gemini",
9544
+ relativeFilePath: "settings.json"
9545
+ };
9546
+ }
9547
+ isDeletable() {
9548
+ return false;
9549
+ }
9550
+ static async fromFile({
9551
+ baseDir = process.cwd(),
9552
+ validate = true,
9553
+ global = false
9554
+ }) {
9555
+ const paths = this.getSettablePaths({ global });
9556
+ const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9557
+ const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9558
+ return new _GeminicliPermissions({
9559
+ baseDir,
9560
+ relativeDirPath: paths.relativeDirPath,
9561
+ relativeFilePath: paths.relativeFilePath,
9562
+ fileContent,
9563
+ validate
9564
+ });
9565
+ }
9566
+ static async fromRulesyncPermissions({
9567
+ baseDir = process.cwd(),
9568
+ rulesyncPermissions,
9569
+ validate = true,
9570
+ logger,
9571
+ global = false
9572
+ }) {
9573
+ const paths = this.getSettablePaths({ global });
9574
+ const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9575
+ const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9576
+ const settingsResult = GeminiCliSettingsSchema.safeParse(JSON.parse(existingContent));
9577
+ if (!settingsResult.success) {
9578
+ throw new Error(
9579
+ `Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(settingsResult.error)}`
9580
+ );
9581
+ }
9582
+ const { allowed, exclude } = convertRulesyncToGeminicliTools({
9583
+ config: rulesyncPermissions.getJson(),
9584
+ logger
9585
+ });
9586
+ const merged = {
9587
+ ...settingsResult.data,
9588
+ tools: {
9589
+ ...settingsResult.data.tools,
9590
+ ...allowed.length > 0 ? { allowed } : {},
9591
+ ...exclude.length > 0 ? { exclude } : {}
9592
+ }
9593
+ };
9594
+ return new _GeminicliPermissions({
9595
+ baseDir,
9596
+ relativeDirPath: paths.relativeDirPath,
9597
+ relativeFilePath: paths.relativeFilePath,
9598
+ fileContent: JSON.stringify(merged, null, 2),
9599
+ validate
9600
+ });
9601
+ }
9602
+ toRulesyncPermissions() {
9603
+ let settings;
9604
+ try {
9605
+ const parsed = JSON.parse(this.getFileContent());
9606
+ settings = GeminiCliSettingsSchema.parse(parsed);
9607
+ } catch (error) {
9608
+ throw new Error(
9609
+ `Failed to parse Gemini CLI permissions content in ${(0, import_node_path67.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9610
+ { cause: error }
9611
+ );
9612
+ }
9613
+ const permission = {};
9614
+ for (const toolEntry of settings.tools?.allowed ?? []) {
9615
+ const mapped = parseGeminicliToolEntry({ entry: toolEntry });
9616
+ const rules = permission[mapped.category] ??= {};
9617
+ rules[mapped.pattern] = "allow";
9618
+ }
9619
+ for (const toolEntry of settings.tools?.exclude ?? []) {
9620
+ const mapped = parseGeminicliToolEntry({ entry: toolEntry });
9621
+ const rules = permission[mapped.category] ??= {};
9622
+ rules[mapped.pattern] = "deny";
9623
+ }
9624
+ return this.toRulesyncPermissionsDefault({
9625
+ fileContent: JSON.stringify({ permission }, null, 2)
9626
+ });
9627
+ }
9628
+ validate() {
9629
+ return { success: true, error: null };
9630
+ }
9631
+ static forDeletion({
9632
+ baseDir = process.cwd(),
9633
+ relativeDirPath,
9634
+ relativeFilePath
9635
+ }) {
9636
+ return new _GeminicliPermissions({
9637
+ baseDir,
9638
+ relativeDirPath,
9639
+ relativeFilePath,
9640
+ fileContent: JSON.stringify({}, null, 2),
9641
+ validate: false
9642
+ });
9643
+ }
9644
+ };
9645
+ function convertRulesyncToGeminicliTools({
9646
+ config,
9647
+ logger
9648
+ }) {
9649
+ const allowed = [];
9650
+ const exclude = [];
9651
+ for (const [toolName, rules] of Object.entries(config.permission)) {
9652
+ const mappedToolName = RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName] ?? toolName;
9653
+ if (!RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName]) {
9654
+ logger?.warn(`Gemini CLI permissions use direct tool names. Mapping as-is: ${toolName}`);
9655
+ }
9656
+ for (const [pattern, action] of Object.entries(rules)) {
9657
+ if (action === "ask") {
9658
+ logger?.warn(
9659
+ `Gemini CLI does not support explicit "ask" rules in settings. Skipping ${toolName}:${pattern}`
9660
+ );
9661
+ continue;
9662
+ }
9663
+ const geminiEntry = pattern === "*" ? mappedToolName : `${mappedToolName}(${pattern})`;
9664
+ if (action === "allow") {
9665
+ allowed.push(geminiEntry);
9666
+ } else {
9667
+ exclude.push(geminiEntry);
9668
+ }
9669
+ }
9670
+ }
9671
+ return { allowed, exclude };
9672
+ }
9673
+ function parseGeminicliToolEntry({ entry }) {
9674
+ const match = /^([^()]+?)(?:\((.*)\))?$/.exec(entry);
9675
+ if (!match) return { category: entry, pattern: "*" };
9676
+ const rawToolName = match[1]?.trim() ?? entry;
9677
+ const mappedCategory = Object.entries(RULESYNC_TO_GEMINICLI_TOOL_NAME).find(
9678
+ ([, value]) => value === rawToolName
9679
+ )?.[0];
9680
+ return {
9681
+ category: mappedCategory ?? rawToolName,
9682
+ pattern: (match[2] ?? "*").trim()
9683
+ };
9684
+ }
9685
+
9686
+ // src/features/permissions/opencode-permissions.ts
9687
+ var import_node_path68 = require("path");
9688
+ var import_jsonc_parser5 = require("jsonc-parser");
9689
+ var import_mini30 = require("zod/mini");
9690
+ var OpencodePermissionSchema = import_mini30.z.union([
9691
+ import_mini30.z.enum(["allow", "ask", "deny"]),
9692
+ import_mini30.z.record(import_mini30.z.string(), import_mini30.z.enum(["allow", "ask", "deny"]))
9313
9693
  ]);
9314
- var OpencodePermissionsConfigSchema = import_mini29.z.looseObject({
9315
- permission: import_mini29.z.optional(import_mini29.z.record(import_mini29.z.string(), OpencodePermissionSchema))
9694
+ var OpencodePermissionsConfigSchema = import_mini30.z.looseObject({
9695
+ permission: import_mini30.z.optional(import_mini30.z.record(import_mini30.z.string(), OpencodePermissionSchema))
9316
9696
  });
9317
9697
  var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9318
9698
  json;
@@ -9329,7 +9709,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9329
9709
  static getSettablePaths({
9330
9710
  global = false
9331
9711
  } = {}) {
9332
- return global ? { relativeDirPath: (0, import_node_path66.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9712
+ return global ? { relativeDirPath: (0, import_node_path68.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9333
9713
  }
9334
9714
  static async fromFile({
9335
9715
  baseDir = process.cwd(),
@@ -9337,9 +9717,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9337
9717
  global = false
9338
9718
  }) {
9339
9719
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9340
- const jsonDir = (0, import_node_path66.join)(baseDir, basePaths.relativeDirPath);
9341
- const jsoncPath = (0, import_node_path66.join)(jsonDir, "opencode.jsonc");
9342
- const jsonPath = (0, import_node_path66.join)(jsonDir, "opencode.json");
9720
+ const jsonDir = (0, import_node_path68.join)(baseDir, basePaths.relativeDirPath);
9721
+ const jsoncPath = (0, import_node_path68.join)(jsonDir, "opencode.jsonc");
9722
+ const jsonPath = (0, import_node_path68.join)(jsonDir, "opencode.json");
9343
9723
  let fileContent = await readFileContentOrNull(jsoncPath);
9344
9724
  let relativeFilePath = "opencode.jsonc";
9345
9725
  if (!fileContent) {
@@ -9364,9 +9744,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9364
9744
  global = false
9365
9745
  }) {
9366
9746
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9367
- const jsonDir = (0, import_node_path66.join)(baseDir, basePaths.relativeDirPath);
9368
- const jsoncPath = (0, import_node_path66.join)(jsonDir, "opencode.jsonc");
9369
- const jsonPath = (0, import_node_path66.join)(jsonDir, "opencode.json");
9747
+ const jsonDir = (0, import_node_path68.join)(baseDir, basePaths.relativeDirPath);
9748
+ const jsoncPath = (0, import_node_path68.join)(jsonDir, "opencode.jsonc");
9749
+ const jsonPath = (0, import_node_path68.join)(jsonDir, "opencode.json");
9370
9750
  let fileContent = await readFileContentOrNull(jsoncPath);
9371
9751
  let relativeFilePath = "opencode.jsonc";
9372
9752
  if (!fileContent) {
@@ -9436,8 +9816,13 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9436
9816
  };
9437
9817
 
9438
9818
  // src/features/permissions/permissions-processor.ts
9439
- var permissionsProcessorToolTargetTuple = ["claudecode", "opencode"];
9440
- var PermissionsProcessorToolTargetSchema = import_mini30.z.enum(permissionsProcessorToolTargetTuple);
9819
+ var permissionsProcessorToolTargetTuple = [
9820
+ "claudecode",
9821
+ "codexcli",
9822
+ "geminicli",
9823
+ "opencode"
9824
+ ];
9825
+ var PermissionsProcessorToolTargetSchema = import_mini31.z.enum(permissionsProcessorToolTargetTuple);
9441
9826
  var toolPermissionsFactories = /* @__PURE__ */ new Map([
9442
9827
  [
9443
9828
  "claudecode",
@@ -9450,6 +9835,28 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
9450
9835
  }
9451
9836
  }
9452
9837
  ],
9838
+ [
9839
+ "codexcli",
9840
+ {
9841
+ class: CodexcliPermissions,
9842
+ meta: {
9843
+ supportsProject: true,
9844
+ supportsGlobal: true,
9845
+ supportsImport: true
9846
+ }
9847
+ }
9848
+ ],
9849
+ [
9850
+ "geminicli",
9851
+ {
9852
+ class: GeminicliPermissions,
9853
+ meta: {
9854
+ supportsProject: true,
9855
+ supportsGlobal: true,
9856
+ supportsImport: true
9857
+ }
9858
+ }
9859
+ ],
9453
9860
  [
9454
9861
  "opencode",
9455
9862
  {
@@ -9560,25 +9967,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
9560
9967
  };
9561
9968
 
9562
9969
  // src/features/rules/rules-processor.ts
9563
- var import_node_path136 = require("path");
9970
+ var import_node_path138 = require("path");
9564
9971
  var import_toon = require("@toon-format/toon");
9565
- var import_mini69 = require("zod/mini");
9972
+ var import_mini70 = require("zod/mini");
9566
9973
 
9567
9974
  // src/constants/general.ts
9568
9975
  var SKILL_FILE_NAME = "SKILL.md";
9569
9976
 
9570
9977
  // src/features/skills/agentsmd-skill.ts
9571
- var import_node_path70 = require("path");
9978
+ var import_node_path72 = require("path");
9572
9979
 
9573
9980
  // src/features/skills/simulated-skill.ts
9574
- var import_node_path69 = require("path");
9575
- var import_mini31 = require("zod/mini");
9981
+ var import_node_path71 = require("path");
9982
+ var import_mini32 = require("zod/mini");
9576
9983
 
9577
9984
  // src/features/skills/tool-skill.ts
9578
- var import_node_path68 = require("path");
9985
+ var import_node_path70 = require("path");
9579
9986
 
9580
9987
  // src/types/ai-dir.ts
9581
- var import_node_path67 = __toESM(require("path"), 1);
9988
+ var import_node_path69 = __toESM(require("path"), 1);
9582
9989
  var AiDir = class {
9583
9990
  /**
9584
9991
  * @example "."
@@ -9612,7 +10019,7 @@ var AiDir = class {
9612
10019
  otherFiles = [],
9613
10020
  global = false
9614
10021
  }) {
9615
- if (dirName.includes(import_node_path67.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
10022
+ if (dirName.includes(import_node_path69.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
9616
10023
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
9617
10024
  }
9618
10025
  this.baseDir = baseDir;
@@ -9635,11 +10042,11 @@ var AiDir = class {
9635
10042
  return this.dirName;
9636
10043
  }
9637
10044
  getDirPath() {
9638
- const fullPath = import_node_path67.default.join(this.baseDir, this.relativeDirPath, this.dirName);
9639
- const resolvedFull = (0, import_node_path67.resolve)(fullPath);
9640
- const resolvedBase = (0, import_node_path67.resolve)(this.baseDir);
9641
- const rel = (0, import_node_path67.relative)(resolvedBase, resolvedFull);
9642
- if (rel.startsWith("..") || import_node_path67.default.isAbsolute(rel)) {
10045
+ const fullPath = import_node_path69.default.join(this.baseDir, this.relativeDirPath, this.dirName);
10046
+ const resolvedFull = (0, import_node_path69.resolve)(fullPath);
10047
+ const resolvedBase = (0, import_node_path69.resolve)(this.baseDir);
10048
+ const rel = (0, import_node_path69.relative)(resolvedBase, resolvedFull);
10049
+ if (rel.startsWith("..") || import_node_path69.default.isAbsolute(rel)) {
9643
10050
  throw new Error(
9644
10051
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
9645
10052
  );
@@ -9656,7 +10063,7 @@ var AiDir = class {
9656
10063
  * Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
9657
10064
  */
9658
10065
  getRelativePathFromCwd() {
9659
- return toPosixPath(import_node_path67.default.join(this.relativeDirPath, this.dirName));
10066
+ return toPosixPath(import_node_path69.default.join(this.relativeDirPath, this.dirName));
9660
10067
  }
9661
10068
  getGlobal() {
9662
10069
  return this.global;
@@ -9675,15 +10082,15 @@ var AiDir = class {
9675
10082
  * @returns Array of files with their relative paths and buffers
9676
10083
  */
9677
10084
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
9678
- const dirPath = (0, import_node_path67.join)(baseDir, relativeDirPath, dirName);
9679
- const glob = (0, import_node_path67.join)(dirPath, "**", "*");
10085
+ const dirPath = (0, import_node_path69.join)(baseDir, relativeDirPath, dirName);
10086
+ const glob = (0, import_node_path69.join)(dirPath, "**", "*");
9680
10087
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
9681
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path67.basename)(filePath) !== excludeFileName);
10088
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path69.basename)(filePath) !== excludeFileName);
9682
10089
  const files = await Promise.all(
9683
10090
  filteredPaths.map(async (filePath) => {
9684
10091
  const fileBuffer = await readFileBuffer(filePath);
9685
10092
  return {
9686
- relativeFilePathToDirPath: (0, import_node_path67.relative)(dirPath, filePath),
10093
+ relativeFilePathToDirPath: (0, import_node_path69.relative)(dirPath, filePath),
9687
10094
  fileBuffer
9688
10095
  };
9689
10096
  })
@@ -9777,8 +10184,8 @@ var ToolSkill = class extends AiDir {
9777
10184
  }) {
9778
10185
  const settablePaths = getSettablePaths({ global });
9779
10186
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9780
- const skillDirPath = (0, import_node_path68.join)(baseDir, actualRelativeDirPath, dirName);
9781
- const skillFilePath = (0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME);
10187
+ const skillDirPath = (0, import_node_path70.join)(baseDir, actualRelativeDirPath, dirName);
10188
+ const skillFilePath = (0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME);
9782
10189
  if (!await fileExists(skillFilePath)) {
9783
10190
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9784
10191
  }
@@ -9802,16 +10209,16 @@ var ToolSkill = class extends AiDir {
9802
10209
  }
9803
10210
  requireMainFileFrontmatter() {
9804
10211
  if (!this.mainFile?.frontmatter) {
9805
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path68.join)(this.relativeDirPath, this.dirName)}`);
10212
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path70.join)(this.relativeDirPath, this.dirName)}`);
9806
10213
  }
9807
10214
  return this.mainFile.frontmatter;
9808
10215
  }
9809
10216
  };
9810
10217
 
9811
10218
  // src/features/skills/simulated-skill.ts
9812
- var SimulatedSkillFrontmatterSchema = import_mini31.z.looseObject({
9813
- name: import_mini31.z.string(),
9814
- description: import_mini31.z.string()
10219
+ var SimulatedSkillFrontmatterSchema = import_mini32.z.looseObject({
10220
+ name: import_mini32.z.string(),
10221
+ description: import_mini32.z.string()
9815
10222
  });
9816
10223
  var SimulatedSkill = class extends ToolSkill {
9817
10224
  frontmatter;
@@ -9842,7 +10249,7 @@ var SimulatedSkill = class extends ToolSkill {
9842
10249
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
9843
10250
  if (!result.success) {
9844
10251
  throw new Error(
9845
- `Invalid frontmatter in ${(0, import_node_path69.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
10252
+ `Invalid frontmatter in ${(0, import_node_path71.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
9846
10253
  );
9847
10254
  }
9848
10255
  }
@@ -9901,8 +10308,8 @@ var SimulatedSkill = class extends ToolSkill {
9901
10308
  }) {
9902
10309
  const settablePaths = this.getSettablePaths();
9903
10310
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9904
- const skillDirPath = (0, import_node_path69.join)(baseDir, actualRelativeDirPath, dirName);
9905
- const skillFilePath = (0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME);
10311
+ const skillDirPath = (0, import_node_path71.join)(baseDir, actualRelativeDirPath, dirName);
10312
+ const skillFilePath = (0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME);
9906
10313
  if (!await fileExists(skillFilePath)) {
9907
10314
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9908
10315
  }
@@ -9979,7 +10386,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9979
10386
  throw new Error("AgentsmdSkill does not support global mode.");
9980
10387
  }
9981
10388
  return {
9982
- relativeDirPath: (0, import_node_path70.join)(".agents", "skills")
10389
+ relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
9983
10390
  };
9984
10391
  }
9985
10392
  static async fromDir(params) {
@@ -10006,11 +10413,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
10006
10413
  };
10007
10414
 
10008
10415
  // src/features/skills/factorydroid-skill.ts
10009
- var import_node_path71 = require("path");
10416
+ var import_node_path73 = require("path");
10010
10417
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10011
10418
  static getSettablePaths(_options) {
10012
10419
  return {
10013
- relativeDirPath: (0, import_node_path71.join)(".factory", "skills")
10420
+ relativeDirPath: (0, import_node_path73.join)(".factory", "skills")
10014
10421
  };
10015
10422
  }
10016
10423
  static async fromDir(params) {
@@ -10037,50 +10444,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10037
10444
  };
10038
10445
 
10039
10446
  // src/features/skills/rovodev-skill.ts
10040
- var import_node_path73 = require("path");
10041
- var import_mini33 = require("zod/mini");
10447
+ var import_node_path75 = require("path");
10448
+ var import_mini34 = require("zod/mini");
10042
10449
 
10043
10450
  // src/features/skills/rulesync-skill.ts
10044
- var import_node_path72 = require("path");
10045
- var import_mini32 = require("zod/mini");
10046
- var RulesyncSkillFrontmatterSchemaInternal = import_mini32.z.looseObject({
10047
- name: import_mini32.z.string(),
10048
- description: import_mini32.z.string(),
10049
- targets: import_mini32.z._default(RulesyncTargetsSchema, ["*"]),
10050
- claudecode: import_mini32.z.optional(
10051
- import_mini32.z.looseObject({
10052
- "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string())),
10053
- model: import_mini32.z.optional(import_mini32.z.string()),
10054
- "disable-model-invocation": import_mini32.z.optional(import_mini32.z.boolean())
10451
+ var import_node_path74 = require("path");
10452
+ var import_mini33 = require("zod/mini");
10453
+ var RulesyncSkillFrontmatterSchemaInternal = import_mini33.z.looseObject({
10454
+ name: import_mini33.z.string(),
10455
+ description: import_mini33.z.string(),
10456
+ targets: import_mini33.z._default(RulesyncTargetsSchema, ["*"]),
10457
+ claudecode: import_mini33.z.optional(
10458
+ import_mini33.z.looseObject({
10459
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string())),
10460
+ model: import_mini33.z.optional(import_mini33.z.string()),
10461
+ "disable-model-invocation": import_mini33.z.optional(import_mini33.z.boolean())
10055
10462
  })
10056
10463
  ),
10057
- codexcli: import_mini32.z.optional(
10058
- import_mini32.z.looseObject({
10059
- "short-description": import_mini32.z.optional(import_mini32.z.string())
10464
+ codexcli: import_mini33.z.optional(
10465
+ import_mini33.z.looseObject({
10466
+ "short-description": import_mini33.z.optional(import_mini33.z.string())
10060
10467
  })
10061
10468
  ),
10062
- opencode: import_mini32.z.optional(
10063
- import_mini32.z.looseObject({
10064
- "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string()))
10469
+ opencode: import_mini33.z.optional(
10470
+ import_mini33.z.looseObject({
10471
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
10065
10472
  })
10066
10473
  ),
10067
- kilo: import_mini32.z.optional(
10068
- import_mini32.z.looseObject({
10069
- "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string()))
10474
+ kilo: import_mini33.z.optional(
10475
+ import_mini33.z.looseObject({
10476
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
10070
10477
  })
10071
10478
  ),
10072
- deepagents: import_mini32.z.optional(
10073
- import_mini32.z.looseObject({
10074
- "allowed-tools": import_mini32.z.optional(import_mini32.z.array(import_mini32.z.string()))
10479
+ deepagents: import_mini33.z.optional(
10480
+ import_mini33.z.looseObject({
10481
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
10075
10482
  })
10076
10483
  ),
10077
- copilot: import_mini32.z.optional(
10078
- import_mini32.z.looseObject({
10079
- license: import_mini32.z.optional(import_mini32.z.string())
10484
+ copilot: import_mini33.z.optional(
10485
+ import_mini33.z.looseObject({
10486
+ license: import_mini33.z.optional(import_mini33.z.string())
10080
10487
  })
10081
10488
  ),
10082
- cline: import_mini32.z.optional(import_mini32.z.looseObject({})),
10083
- roo: import_mini32.z.optional(import_mini32.z.looseObject({}))
10489
+ cline: import_mini33.z.optional(import_mini33.z.looseObject({})),
10490
+ roo: import_mini33.z.optional(import_mini33.z.looseObject({}))
10084
10491
  });
10085
10492
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
10086
10493
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -10120,7 +10527,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10120
10527
  }
10121
10528
  getFrontmatter() {
10122
10529
  if (!this.mainFile?.frontmatter) {
10123
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path72.join)(this.relativeDirPath, this.dirName)}`);
10530
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path74.join)(this.relativeDirPath, this.dirName)}`);
10124
10531
  }
10125
10532
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
10126
10533
  return result;
@@ -10146,8 +10553,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10146
10553
  dirName,
10147
10554
  global = false
10148
10555
  }) {
10149
- const skillDirPath = (0, import_node_path72.join)(baseDir, relativeDirPath, dirName);
10150
- const skillFilePath = (0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME);
10556
+ const skillDirPath = (0, import_node_path74.join)(baseDir, relativeDirPath, dirName);
10557
+ const skillFilePath = (0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME);
10151
10558
  if (!await fileExists(skillFilePath)) {
10152
10559
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
10153
10560
  }
@@ -10177,14 +10584,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10177
10584
  };
10178
10585
 
10179
10586
  // src/features/skills/rovodev-skill.ts
10180
- var RovodevSkillFrontmatterSchema = import_mini33.z.looseObject({
10181
- name: import_mini33.z.string(),
10182
- description: import_mini33.z.string()
10587
+ var RovodevSkillFrontmatterSchema = import_mini34.z.looseObject({
10588
+ name: import_mini34.z.string(),
10589
+ description: import_mini34.z.string()
10183
10590
  });
10184
10591
  var RovodevSkill = class _RovodevSkill extends ToolSkill {
10185
10592
  constructor({
10186
10593
  baseDir = process.cwd(),
10187
- relativeDirPath = (0, import_node_path73.join)(".rovodev", "skills"),
10594
+ relativeDirPath = (0, import_node_path75.join)(".rovodev", "skills"),
10188
10595
  dirName,
10189
10596
  frontmatter,
10190
10597
  body,
@@ -10213,8 +10620,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10213
10620
  }
10214
10621
  static getSettablePaths(_options) {
10215
10622
  return {
10216
- relativeDirPath: (0, import_node_path73.join)(".rovodev", "skills"),
10217
- alternativeSkillRoots: [(0, import_node_path73.join)(".agents", "skills")]
10623
+ relativeDirPath: (0, import_node_path75.join)(".rovodev", "skills"),
10624
+ alternativeSkillRoots: [(0, import_node_path75.join)(".agents", "skills")]
10218
10625
  };
10219
10626
  }
10220
10627
  getFrontmatter() {
@@ -10302,13 +10709,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10302
10709
  });
10303
10710
  const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10304
10711
  if (!result.success) {
10305
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10712
+ const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10306
10713
  throw new Error(
10307
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10714
+ `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10308
10715
  );
10309
10716
  }
10310
10717
  if (result.data.name !== loaded.dirName) {
10311
- const skillFilePath = (0, import_node_path73.join)(
10718
+ const skillFilePath = (0, import_node_path75.join)(
10312
10719
  loaded.baseDir,
10313
10720
  loaded.relativeDirPath,
10314
10721
  loaded.dirName,
@@ -10350,11 +10757,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10350
10757
  };
10351
10758
 
10352
10759
  // src/features/skills/skills-processor.ts
10353
- var import_node_path91 = require("path");
10354
- var import_mini49 = require("zod/mini");
10760
+ var import_node_path93 = require("path");
10761
+ var import_mini50 = require("zod/mini");
10355
10762
 
10356
10763
  // src/types/dir-feature-processor.ts
10357
- var import_node_path74 = require("path");
10764
+ var import_node_path76 = require("path");
10358
10765
  var DirFeatureProcessor = class {
10359
10766
  baseDir;
10360
10767
  dryRun;
@@ -10394,7 +10801,7 @@ var DirFeatureProcessor = class {
10394
10801
  const mainFile = aiDir.getMainFile();
10395
10802
  let mainFileContent;
10396
10803
  if (mainFile) {
10397
- const mainFilePath = (0, import_node_path74.join)(dirPath, mainFile.name);
10804
+ const mainFilePath = (0, import_node_path76.join)(dirPath, mainFile.name);
10398
10805
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
10399
10806
  avoidBlockScalars: this.avoidBlockScalars
10400
10807
  });
@@ -10414,7 +10821,7 @@ var DirFeatureProcessor = class {
10414
10821
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
10415
10822
  otherFileContents.push(contentWithNewline);
10416
10823
  if (!dirHasChanges) {
10417
- const filePath = (0, import_node_path74.join)(dirPath, file.relativeFilePathToDirPath);
10824
+ const filePath = (0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath);
10418
10825
  const existingContent = await readFileContentOrNull(filePath);
10419
10826
  if (!fileContentsEquivalent({
10420
10827
  filePath,
@@ -10432,24 +10839,24 @@ var DirFeatureProcessor = class {
10432
10839
  if (this.dryRun) {
10433
10840
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
10434
10841
  if (mainFile) {
10435
- this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path74.join)(dirPath, mainFile.name)}`);
10436
- changedPaths.push((0, import_node_path74.join)(relativeDir, mainFile.name));
10842
+ this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path76.join)(dirPath, mainFile.name)}`);
10843
+ changedPaths.push((0, import_node_path76.join)(relativeDir, mainFile.name));
10437
10844
  }
10438
10845
  for (const file of otherFiles) {
10439
10846
  this.logger.info(
10440
- `[DRY RUN] Would write: ${(0, import_node_path74.join)(dirPath, file.relativeFilePathToDirPath)}`
10847
+ `[DRY RUN] Would write: ${(0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath)}`
10441
10848
  );
10442
- changedPaths.push((0, import_node_path74.join)(relativeDir, file.relativeFilePathToDirPath));
10849
+ changedPaths.push((0, import_node_path76.join)(relativeDir, file.relativeFilePathToDirPath));
10443
10850
  }
10444
10851
  } else {
10445
10852
  await ensureDir(dirPath);
10446
10853
  if (mainFile && mainFileContent) {
10447
- const mainFilePath = (0, import_node_path74.join)(dirPath, mainFile.name);
10854
+ const mainFilePath = (0, import_node_path76.join)(dirPath, mainFile.name);
10448
10855
  await writeFileContent(mainFilePath, mainFileContent);
10449
- changedPaths.push((0, import_node_path74.join)(relativeDir, mainFile.name));
10856
+ changedPaths.push((0, import_node_path76.join)(relativeDir, mainFile.name));
10450
10857
  }
10451
10858
  for (const [i, file] of otherFiles.entries()) {
10452
- const filePath = (0, import_node_path74.join)(dirPath, file.relativeFilePathToDirPath);
10859
+ const filePath = (0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath);
10453
10860
  const content = otherFileContents[i];
10454
10861
  if (content === void 0) {
10455
10862
  throw new Error(
@@ -10457,7 +10864,7 @@ var DirFeatureProcessor = class {
10457
10864
  );
10458
10865
  }
10459
10866
  await writeFileContent(filePath, content);
10460
- changedPaths.push((0, import_node_path74.join)(relativeDir, file.relativeFilePathToDirPath));
10867
+ changedPaths.push((0, import_node_path76.join)(relativeDir, file.relativeFilePathToDirPath));
10461
10868
  }
10462
10869
  }
10463
10870
  changedCount++;
@@ -10489,16 +10896,16 @@ var DirFeatureProcessor = class {
10489
10896
  };
10490
10897
 
10491
10898
  // src/features/skills/agentsskills-skill.ts
10492
- var import_node_path75 = require("path");
10493
- var import_mini34 = require("zod/mini");
10494
- var AgentsSkillsSkillFrontmatterSchema = import_mini34.z.looseObject({
10495
- name: import_mini34.z.string(),
10496
- description: import_mini34.z.string()
10899
+ var import_node_path77 = require("path");
10900
+ var import_mini35 = require("zod/mini");
10901
+ var AgentsSkillsSkillFrontmatterSchema = import_mini35.z.looseObject({
10902
+ name: import_mini35.z.string(),
10903
+ description: import_mini35.z.string()
10497
10904
  });
10498
10905
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10499
10906
  constructor({
10500
10907
  baseDir = process.cwd(),
10501
- relativeDirPath = (0, import_node_path75.join)(".agents", "skills"),
10908
+ relativeDirPath = (0, import_node_path77.join)(".agents", "skills"),
10502
10909
  dirName,
10503
10910
  frontmatter,
10504
10911
  body,
@@ -10530,7 +10937,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10530
10937
  throw new Error("AgentsSkillsSkill does not support global mode.");
10531
10938
  }
10532
10939
  return {
10533
- relativeDirPath: (0, import_node_path75.join)(".agents", "skills")
10940
+ relativeDirPath: (0, import_node_path77.join)(".agents", "skills")
10534
10941
  };
10535
10942
  }
10536
10943
  getFrontmatter() {
@@ -10610,9 +11017,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10610
11017
  });
10611
11018
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10612
11019
  if (!result.success) {
10613
- const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11020
+ const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10614
11021
  throw new Error(
10615
- `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11022
+ `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10616
11023
  );
10617
11024
  }
10618
11025
  return new _AgentsSkillsSkill({
@@ -10647,16 +11054,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10647
11054
  };
10648
11055
 
10649
11056
  // src/features/skills/antigravity-skill.ts
10650
- var import_node_path76 = require("path");
10651
- var import_mini35 = require("zod/mini");
10652
- var AntigravitySkillFrontmatterSchema = import_mini35.z.looseObject({
10653
- name: import_mini35.z.string(),
10654
- description: import_mini35.z.string()
11057
+ var import_node_path78 = require("path");
11058
+ var import_mini36 = require("zod/mini");
11059
+ var AntigravitySkillFrontmatterSchema = import_mini36.z.looseObject({
11060
+ name: import_mini36.z.string(),
11061
+ description: import_mini36.z.string()
10655
11062
  });
10656
11063
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10657
11064
  constructor({
10658
11065
  baseDir = process.cwd(),
10659
- relativeDirPath = (0, import_node_path76.join)(".agent", "skills"),
11066
+ relativeDirPath = (0, import_node_path78.join)(".agent", "skills"),
10660
11067
  dirName,
10661
11068
  frontmatter,
10662
11069
  body,
@@ -10688,11 +11095,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10688
11095
  } = {}) {
10689
11096
  if (global) {
10690
11097
  return {
10691
- relativeDirPath: (0, import_node_path76.join)(".gemini", "antigravity", "skills")
11098
+ relativeDirPath: (0, import_node_path78.join)(".gemini", "antigravity", "skills")
10692
11099
  };
10693
11100
  }
10694
11101
  return {
10695
- relativeDirPath: (0, import_node_path76.join)(".agent", "skills")
11102
+ relativeDirPath: (0, import_node_path78.join)(".agent", "skills")
10696
11103
  };
10697
11104
  }
10698
11105
  getFrontmatter() {
@@ -10772,9 +11179,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10772
11179
  });
10773
11180
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
10774
11181
  if (!result.success) {
10775
- const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11182
+ const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10776
11183
  throw new Error(
10777
- `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11184
+ `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10778
11185
  );
10779
11186
  }
10780
11187
  return new _AntigravitySkill({
@@ -10808,19 +11215,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10808
11215
  };
10809
11216
 
10810
11217
  // src/features/skills/claudecode-skill.ts
10811
- var import_node_path77 = require("path");
10812
- var import_mini36 = require("zod/mini");
10813
- var ClaudecodeSkillFrontmatterSchema = import_mini36.z.looseObject({
10814
- name: import_mini36.z.string(),
10815
- description: import_mini36.z.string(),
10816
- "allowed-tools": import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string())),
10817
- model: import_mini36.z.optional(import_mini36.z.string()),
10818
- "disable-model-invocation": import_mini36.z.optional(import_mini36.z.boolean())
11218
+ var import_node_path79 = require("path");
11219
+ var import_mini37 = require("zod/mini");
11220
+ var ClaudecodeSkillFrontmatterSchema = import_mini37.z.looseObject({
11221
+ name: import_mini37.z.string(),
11222
+ description: import_mini37.z.string(),
11223
+ "allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string())),
11224
+ model: import_mini37.z.optional(import_mini37.z.string()),
11225
+ "disable-model-invocation": import_mini37.z.optional(import_mini37.z.boolean())
10819
11226
  });
10820
11227
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10821
11228
  constructor({
10822
11229
  baseDir = process.cwd(),
10823
- relativeDirPath = (0, import_node_path77.join)(".claude", "skills"),
11230
+ relativeDirPath = (0, import_node_path79.join)(".claude", "skills"),
10824
11231
  dirName,
10825
11232
  frontmatter,
10826
11233
  body,
@@ -10851,7 +11258,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10851
11258
  global: _global = false
10852
11259
  } = {}) {
10853
11260
  return {
10854
- relativeDirPath: (0, import_node_path77.join)(".claude", "skills")
11261
+ relativeDirPath: (0, import_node_path79.join)(".claude", "skills")
10855
11262
  };
10856
11263
  }
10857
11264
  getFrontmatter() {
@@ -10948,9 +11355,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10948
11355
  });
10949
11356
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10950
11357
  if (!result.success) {
10951
- const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11358
+ const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10952
11359
  throw new Error(
10953
- `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11360
+ `Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10954
11361
  );
10955
11362
  }
10956
11363
  return new _ClaudecodeSkill({
@@ -10984,16 +11391,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10984
11391
  };
10985
11392
 
10986
11393
  // src/features/skills/cline-skill.ts
10987
- var import_node_path78 = require("path");
10988
- var import_mini37 = require("zod/mini");
10989
- var ClineSkillFrontmatterSchema = import_mini37.z.looseObject({
10990
- name: import_mini37.z.string(),
10991
- description: import_mini37.z.string()
11394
+ var import_node_path80 = require("path");
11395
+ var import_mini38 = require("zod/mini");
11396
+ var ClineSkillFrontmatterSchema = import_mini38.z.looseObject({
11397
+ name: import_mini38.z.string(),
11398
+ description: import_mini38.z.string()
10992
11399
  });
10993
11400
  var ClineSkill = class _ClineSkill extends ToolSkill {
10994
11401
  constructor({
10995
11402
  baseDir = process.cwd(),
10996
- relativeDirPath = (0, import_node_path78.join)(".cline", "skills"),
11403
+ relativeDirPath = (0, import_node_path80.join)(".cline", "skills"),
10997
11404
  dirName,
10998
11405
  frontmatter,
10999
11406
  body,
@@ -11022,7 +11429,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11022
11429
  }
11023
11430
  static getSettablePaths(_options = {}) {
11024
11431
  return {
11025
- relativeDirPath: (0, import_node_path78.join)(".cline", "skills")
11432
+ relativeDirPath: (0, import_node_path80.join)(".cline", "skills")
11026
11433
  };
11027
11434
  }
11028
11435
  getFrontmatter() {
@@ -11110,13 +11517,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11110
11517
  });
11111
11518
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11112
11519
  if (!result.success) {
11113
- const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11520
+ const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11114
11521
  throw new Error(
11115
- `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11522
+ `Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11116
11523
  );
11117
11524
  }
11118
11525
  if (result.data.name !== loaded.dirName) {
11119
- const skillFilePath = (0, import_node_path78.join)(
11526
+ const skillFilePath = (0, import_node_path80.join)(
11120
11527
  loaded.baseDir,
11121
11528
  loaded.relativeDirPath,
11122
11529
  loaded.dirName,
@@ -11157,21 +11564,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11157
11564
  };
11158
11565
 
11159
11566
  // src/features/skills/codexcli-skill.ts
11160
- var import_node_path79 = require("path");
11161
- var import_mini38 = require("zod/mini");
11162
- var CodexCliSkillFrontmatterSchema = import_mini38.z.looseObject({
11163
- name: import_mini38.z.string(),
11164
- description: import_mini38.z.string(),
11165
- metadata: import_mini38.z.optional(
11166
- import_mini38.z.looseObject({
11167
- "short-description": import_mini38.z.optional(import_mini38.z.string())
11567
+ var import_node_path81 = require("path");
11568
+ var import_mini39 = require("zod/mini");
11569
+ var CodexCliSkillFrontmatterSchema = import_mini39.z.looseObject({
11570
+ name: import_mini39.z.string(),
11571
+ description: import_mini39.z.string(),
11572
+ metadata: import_mini39.z.optional(
11573
+ import_mini39.z.looseObject({
11574
+ "short-description": import_mini39.z.optional(import_mini39.z.string())
11168
11575
  })
11169
11576
  )
11170
11577
  });
11171
11578
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11172
11579
  constructor({
11173
11580
  baseDir = process.cwd(),
11174
- relativeDirPath = (0, import_node_path79.join)(".codex", "skills"),
11581
+ relativeDirPath = (0, import_node_path81.join)(".codex", "skills"),
11175
11582
  dirName,
11176
11583
  frontmatter,
11177
11584
  body,
@@ -11202,7 +11609,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11202
11609
  global: _global = false
11203
11610
  } = {}) {
11204
11611
  return {
11205
- relativeDirPath: (0, import_node_path79.join)(".codex", "skills")
11612
+ relativeDirPath: (0, import_node_path81.join)(".codex", "skills")
11206
11613
  };
11207
11614
  }
11208
11615
  getFrontmatter() {
@@ -11292,9 +11699,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11292
11699
  });
11293
11700
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11294
11701
  if (!result.success) {
11295
- const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11702
+ const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11296
11703
  throw new Error(
11297
- `Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11704
+ `Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11298
11705
  );
11299
11706
  }
11300
11707
  return new _CodexCliSkill({
@@ -11328,17 +11735,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11328
11735
  };
11329
11736
 
11330
11737
  // src/features/skills/copilot-skill.ts
11331
- var import_node_path80 = require("path");
11332
- var import_mini39 = require("zod/mini");
11333
- var CopilotSkillFrontmatterSchema = import_mini39.z.looseObject({
11334
- name: import_mini39.z.string(),
11335
- description: import_mini39.z.string(),
11336
- license: import_mini39.z.optional(import_mini39.z.string())
11738
+ var import_node_path82 = require("path");
11739
+ var import_mini40 = require("zod/mini");
11740
+ var CopilotSkillFrontmatterSchema = import_mini40.z.looseObject({
11741
+ name: import_mini40.z.string(),
11742
+ description: import_mini40.z.string(),
11743
+ license: import_mini40.z.optional(import_mini40.z.string())
11337
11744
  });
11338
11745
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
11339
11746
  constructor({
11340
11747
  baseDir = process.cwd(),
11341
- relativeDirPath = (0, import_node_path80.join)(".github", "skills"),
11748
+ relativeDirPath = (0, import_node_path82.join)(".github", "skills"),
11342
11749
  dirName,
11343
11750
  frontmatter,
11344
11751
  body,
@@ -11370,7 +11777,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11370
11777
  throw new Error("CopilotSkill does not support global mode.");
11371
11778
  }
11372
11779
  return {
11373
- relativeDirPath: (0, import_node_path80.join)(".github", "skills")
11780
+ relativeDirPath: (0, import_node_path82.join)(".github", "skills")
11374
11781
  };
11375
11782
  }
11376
11783
  getFrontmatter() {
@@ -11456,9 +11863,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11456
11863
  });
11457
11864
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11458
11865
  if (!result.success) {
11459
- const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11866
+ const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11460
11867
  throw new Error(
11461
- `Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11868
+ `Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11462
11869
  );
11463
11870
  }
11464
11871
  return new _CopilotSkill({
@@ -11493,16 +11900,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11493
11900
  };
11494
11901
 
11495
11902
  // src/features/skills/cursor-skill.ts
11496
- var import_node_path81 = require("path");
11497
- var import_mini40 = require("zod/mini");
11498
- var CursorSkillFrontmatterSchema = import_mini40.z.looseObject({
11499
- name: import_mini40.z.string(),
11500
- description: import_mini40.z.string()
11903
+ var import_node_path83 = require("path");
11904
+ var import_mini41 = require("zod/mini");
11905
+ var CursorSkillFrontmatterSchema = import_mini41.z.looseObject({
11906
+ name: import_mini41.z.string(),
11907
+ description: import_mini41.z.string()
11501
11908
  });
11502
11909
  var CursorSkill = class _CursorSkill extends ToolSkill {
11503
11910
  constructor({
11504
11911
  baseDir = process.cwd(),
11505
- relativeDirPath = (0, import_node_path81.join)(".cursor", "skills"),
11912
+ relativeDirPath = (0, import_node_path83.join)(".cursor", "skills"),
11506
11913
  dirName,
11507
11914
  frontmatter,
11508
11915
  body,
@@ -11531,7 +11938,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11531
11938
  }
11532
11939
  static getSettablePaths(_options) {
11533
11940
  return {
11534
- relativeDirPath: (0, import_node_path81.join)(".cursor", "skills")
11941
+ relativeDirPath: (0, import_node_path83.join)(".cursor", "skills")
11535
11942
  };
11536
11943
  }
11537
11944
  getFrontmatter() {
@@ -11611,9 +12018,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11611
12018
  });
11612
12019
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11613
12020
  if (!result.success) {
11614
- const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12021
+ const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11615
12022
  throw new Error(
11616
- `Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12023
+ `Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11617
12024
  );
11618
12025
  }
11619
12026
  return new _CursorSkill({
@@ -11648,17 +12055,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11648
12055
  };
11649
12056
 
11650
12057
  // src/features/skills/deepagents-skill.ts
11651
- var import_node_path82 = require("path");
11652
- var import_mini41 = require("zod/mini");
11653
- var DeepagentsSkillFrontmatterSchema = import_mini41.z.looseObject({
11654
- name: import_mini41.z.string(),
11655
- description: import_mini41.z.string(),
11656
- "allowed-tools": import_mini41.z.optional(import_mini41.z.array(import_mini41.z.string()))
12058
+ var import_node_path84 = require("path");
12059
+ var import_mini42 = require("zod/mini");
12060
+ var DeepagentsSkillFrontmatterSchema = import_mini42.z.looseObject({
12061
+ name: import_mini42.z.string(),
12062
+ description: import_mini42.z.string(),
12063
+ "allowed-tools": import_mini42.z.optional(import_mini42.z.array(import_mini42.z.string()))
11657
12064
  });
11658
12065
  var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11659
12066
  constructor({
11660
12067
  baseDir = process.cwd(),
11661
- relativeDirPath = (0, import_node_path82.join)(".deepagents", "skills"),
12068
+ relativeDirPath = (0, import_node_path84.join)(".deepagents", "skills"),
11662
12069
  dirName,
11663
12070
  frontmatter,
11664
12071
  body,
@@ -11687,7 +12094,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11687
12094
  }
11688
12095
  static getSettablePaths(_options) {
11689
12096
  return {
11690
- relativeDirPath: (0, import_node_path82.join)(".deepagents", "skills")
12097
+ relativeDirPath: (0, import_node_path84.join)(".deepagents", "skills")
11691
12098
  };
11692
12099
  }
11693
12100
  getFrontmatter() {
@@ -11773,9 +12180,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11773
12180
  });
11774
12181
  const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11775
12182
  if (!result.success) {
11776
- const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12183
+ const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11777
12184
  throw new Error(
11778
- `Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12185
+ `Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11779
12186
  );
11780
12187
  }
11781
12188
  return new _DeepagentsSkill({
@@ -11810,11 +12217,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11810
12217
  };
11811
12218
 
11812
12219
  // src/features/skills/geminicli-skill.ts
11813
- var import_node_path83 = require("path");
11814
- var import_mini42 = require("zod/mini");
11815
- var GeminiCliSkillFrontmatterSchema = import_mini42.z.looseObject({
11816
- name: import_mini42.z.string(),
11817
- description: import_mini42.z.string()
12220
+ var import_node_path85 = require("path");
12221
+ var import_mini43 = require("zod/mini");
12222
+ var GeminiCliSkillFrontmatterSchema = import_mini43.z.looseObject({
12223
+ name: import_mini43.z.string(),
12224
+ description: import_mini43.z.string()
11818
12225
  });
11819
12226
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11820
12227
  constructor({
@@ -11850,7 +12257,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11850
12257
  global: _global = false
11851
12258
  } = {}) {
11852
12259
  return {
11853
- relativeDirPath: (0, import_node_path83.join)(".gemini", "skills")
12260
+ relativeDirPath: (0, import_node_path85.join)(".gemini", "skills")
11854
12261
  };
11855
12262
  }
11856
12263
  getFrontmatter() {
@@ -11930,9 +12337,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11930
12337
  });
11931
12338
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11932
12339
  if (!result.success) {
11933
- const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12340
+ const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11934
12341
  throw new Error(
11935
- `Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12342
+ `Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11936
12343
  );
11937
12344
  }
11938
12345
  return new _GeminiCliSkill({
@@ -11967,16 +12374,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11967
12374
  };
11968
12375
 
11969
12376
  // src/features/skills/junie-skill.ts
11970
- var import_node_path84 = require("path");
11971
- var import_mini43 = require("zod/mini");
11972
- var JunieSkillFrontmatterSchema = import_mini43.z.looseObject({
11973
- name: import_mini43.z.string(),
11974
- description: import_mini43.z.string()
12377
+ var import_node_path86 = require("path");
12378
+ var import_mini44 = require("zod/mini");
12379
+ var JunieSkillFrontmatterSchema = import_mini44.z.looseObject({
12380
+ name: import_mini44.z.string(),
12381
+ description: import_mini44.z.string()
11975
12382
  });
11976
12383
  var JunieSkill = class _JunieSkill extends ToolSkill {
11977
12384
  constructor({
11978
12385
  baseDir = process.cwd(),
11979
- relativeDirPath = (0, import_node_path84.join)(".junie", "skills"),
12386
+ relativeDirPath = (0, import_node_path86.join)(".junie", "skills"),
11980
12387
  dirName,
11981
12388
  frontmatter,
11982
12389
  body,
@@ -12008,7 +12415,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12008
12415
  throw new Error("JunieSkill does not support global mode.");
12009
12416
  }
12010
12417
  return {
12011
- relativeDirPath: (0, import_node_path84.join)(".junie", "skills")
12418
+ relativeDirPath: (0, import_node_path86.join)(".junie", "skills")
12012
12419
  };
12013
12420
  }
12014
12421
  getFrontmatter() {
@@ -12095,13 +12502,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12095
12502
  });
12096
12503
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12097
12504
  if (!result.success) {
12098
- const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12505
+ const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12099
12506
  throw new Error(
12100
- `Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12507
+ `Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12101
12508
  );
12102
12509
  }
12103
12510
  if (result.data.name !== loaded.dirName) {
12104
- const skillFilePath = (0, import_node_path84.join)(
12511
+ const skillFilePath = (0, import_node_path86.join)(
12105
12512
  loaded.baseDir,
12106
12513
  loaded.relativeDirPath,
12107
12514
  loaded.dirName,
@@ -12143,17 +12550,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12143
12550
  };
12144
12551
 
12145
12552
  // src/features/skills/kilo-skill.ts
12146
- var import_node_path85 = require("path");
12147
- var import_mini44 = require("zod/mini");
12148
- var KiloSkillFrontmatterSchema = import_mini44.z.looseObject({
12149
- name: import_mini44.z.string(),
12150
- description: import_mini44.z.string(),
12151
- "allowed-tools": import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string()))
12553
+ var import_node_path87 = require("path");
12554
+ var import_mini45 = require("zod/mini");
12555
+ var KiloSkillFrontmatterSchema = import_mini45.z.looseObject({
12556
+ name: import_mini45.z.string(),
12557
+ description: import_mini45.z.string(),
12558
+ "allowed-tools": import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
12152
12559
  });
12153
12560
  var KiloSkill = class _KiloSkill extends ToolSkill {
12154
12561
  constructor({
12155
12562
  baseDir = process.cwd(),
12156
- relativeDirPath = (0, import_node_path85.join)(".kilo", "skills"),
12563
+ relativeDirPath = (0, import_node_path87.join)(".kilo", "skills"),
12157
12564
  dirName,
12158
12565
  frontmatter,
12159
12566
  body,
@@ -12182,7 +12589,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12182
12589
  }
12183
12590
  static getSettablePaths({ global = false } = {}) {
12184
12591
  return {
12185
- relativeDirPath: global ? (0, import_node_path85.join)(".config", "kilo", "skills") : (0, import_node_path85.join)(".kilo", "skills")
12592
+ relativeDirPath: global ? (0, import_node_path87.join)(".config", "kilo", "skills") : (0, import_node_path87.join)(".kilo", "skills")
12186
12593
  };
12187
12594
  }
12188
12595
  getFrontmatter() {
@@ -12268,9 +12675,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12268
12675
  });
12269
12676
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12270
12677
  if (!result.success) {
12271
- const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12678
+ const skillDirPath = (0, import_node_path87.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12272
12679
  throw new Error(
12273
- `Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12680
+ `Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12274
12681
  );
12275
12682
  }
12276
12683
  return new _KiloSkill({
@@ -12304,16 +12711,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12304
12711
  };
12305
12712
 
12306
12713
  // src/features/skills/kiro-skill.ts
12307
- var import_node_path86 = require("path");
12308
- var import_mini45 = require("zod/mini");
12309
- var KiroSkillFrontmatterSchema = import_mini45.z.looseObject({
12310
- name: import_mini45.z.string(),
12311
- description: import_mini45.z.string()
12714
+ var import_node_path88 = require("path");
12715
+ var import_mini46 = require("zod/mini");
12716
+ var KiroSkillFrontmatterSchema = import_mini46.z.looseObject({
12717
+ name: import_mini46.z.string(),
12718
+ description: import_mini46.z.string()
12312
12719
  });
12313
12720
  var KiroSkill = class _KiroSkill extends ToolSkill {
12314
12721
  constructor({
12315
12722
  baseDir = process.cwd(),
12316
- relativeDirPath = (0, import_node_path86.join)(".kiro", "skills"),
12723
+ relativeDirPath = (0, import_node_path88.join)(".kiro", "skills"),
12317
12724
  dirName,
12318
12725
  frontmatter,
12319
12726
  body,
@@ -12345,7 +12752,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12345
12752
  throw new Error("KiroSkill does not support global mode.");
12346
12753
  }
12347
12754
  return {
12348
- relativeDirPath: (0, import_node_path86.join)(".kiro", "skills")
12755
+ relativeDirPath: (0, import_node_path88.join)(".kiro", "skills")
12349
12756
  };
12350
12757
  }
12351
12758
  getFrontmatter() {
@@ -12433,13 +12840,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12433
12840
  });
12434
12841
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12435
12842
  if (!result.success) {
12436
- const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12843
+ const skillDirPath = (0, import_node_path88.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12437
12844
  throw new Error(
12438
- `Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12845
+ `Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12439
12846
  );
12440
12847
  }
12441
12848
  if (result.data.name !== loaded.dirName) {
12442
- const skillFilePath = (0, import_node_path86.join)(
12849
+ const skillFilePath = (0, import_node_path88.join)(
12443
12850
  loaded.baseDir,
12444
12851
  loaded.relativeDirPath,
12445
12852
  loaded.dirName,
@@ -12481,17 +12888,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12481
12888
  };
12482
12889
 
12483
12890
  // src/features/skills/opencode-skill.ts
12484
- var import_node_path87 = require("path");
12485
- var import_mini46 = require("zod/mini");
12486
- var OpenCodeSkillFrontmatterSchema = import_mini46.z.looseObject({
12487
- name: import_mini46.z.string(),
12488
- description: import_mini46.z.string(),
12489
- "allowed-tools": import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12891
+ var import_node_path89 = require("path");
12892
+ var import_mini47 = require("zod/mini");
12893
+ var OpenCodeSkillFrontmatterSchema = import_mini47.z.looseObject({
12894
+ name: import_mini47.z.string(),
12895
+ description: import_mini47.z.string(),
12896
+ "allowed-tools": import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
12490
12897
  });
12491
12898
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12492
12899
  constructor({
12493
12900
  baseDir = process.cwd(),
12494
- relativeDirPath = (0, import_node_path87.join)(".opencode", "skill"),
12901
+ relativeDirPath = (0, import_node_path89.join)(".opencode", "skill"),
12495
12902
  dirName,
12496
12903
  frontmatter,
12497
12904
  body,
@@ -12520,7 +12927,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12520
12927
  }
12521
12928
  static getSettablePaths({ global = false } = {}) {
12522
12929
  return {
12523
- relativeDirPath: global ? (0, import_node_path87.join)(".config", "opencode", "skill") : (0, import_node_path87.join)(".opencode", "skill")
12930
+ relativeDirPath: global ? (0, import_node_path89.join)(".config", "opencode", "skill") : (0, import_node_path89.join)(".opencode", "skill")
12524
12931
  };
12525
12932
  }
12526
12933
  getFrontmatter() {
@@ -12606,9 +13013,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12606
13013
  });
12607
13014
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12608
13015
  if (!result.success) {
12609
- const skillDirPath = (0, import_node_path87.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13016
+ const skillDirPath = (0, import_node_path89.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12610
13017
  throw new Error(
12611
- `Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13018
+ `Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12612
13019
  );
12613
13020
  }
12614
13021
  return new _OpenCodeSkill({
@@ -12642,16 +13049,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12642
13049
  };
12643
13050
 
12644
13051
  // src/features/skills/replit-skill.ts
12645
- var import_node_path88 = require("path");
12646
- var import_mini47 = require("zod/mini");
12647
- var ReplitSkillFrontmatterSchema = import_mini47.z.looseObject({
12648
- name: import_mini47.z.string(),
12649
- description: import_mini47.z.string()
13052
+ var import_node_path90 = require("path");
13053
+ var import_mini48 = require("zod/mini");
13054
+ var ReplitSkillFrontmatterSchema = import_mini48.z.looseObject({
13055
+ name: import_mini48.z.string(),
13056
+ description: import_mini48.z.string()
12650
13057
  });
12651
13058
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
12652
13059
  constructor({
12653
13060
  baseDir = process.cwd(),
12654
- relativeDirPath = (0, import_node_path88.join)(".agents", "skills"),
13061
+ relativeDirPath = (0, import_node_path90.join)(".agents", "skills"),
12655
13062
  dirName,
12656
13063
  frontmatter,
12657
13064
  body,
@@ -12683,7 +13090,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12683
13090
  throw new Error("ReplitSkill does not support global mode.");
12684
13091
  }
12685
13092
  return {
12686
- relativeDirPath: (0, import_node_path88.join)(".agents", "skills")
13093
+ relativeDirPath: (0, import_node_path90.join)(".agents", "skills")
12687
13094
  };
12688
13095
  }
12689
13096
  getFrontmatter() {
@@ -12763,9 +13170,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12763
13170
  });
12764
13171
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12765
13172
  if (!result.success) {
12766
- const skillDirPath = (0, import_node_path88.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13173
+ const skillDirPath = (0, import_node_path90.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12767
13174
  throw new Error(
12768
- `Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13175
+ `Invalid frontmatter in ${(0, import_node_path90.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12769
13176
  );
12770
13177
  }
12771
13178
  return new _ReplitSkill({
@@ -12800,16 +13207,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12800
13207
  };
12801
13208
 
12802
13209
  // src/features/skills/roo-skill.ts
12803
- var import_node_path89 = require("path");
12804
- var import_mini48 = require("zod/mini");
12805
- var RooSkillFrontmatterSchema = import_mini48.z.looseObject({
12806
- name: import_mini48.z.string(),
12807
- description: import_mini48.z.string()
13210
+ var import_node_path91 = require("path");
13211
+ var import_mini49 = require("zod/mini");
13212
+ var RooSkillFrontmatterSchema = import_mini49.z.looseObject({
13213
+ name: import_mini49.z.string(),
13214
+ description: import_mini49.z.string()
12808
13215
  });
12809
13216
  var RooSkill = class _RooSkill extends ToolSkill {
12810
13217
  constructor({
12811
13218
  baseDir = process.cwd(),
12812
- relativeDirPath = (0, import_node_path89.join)(".roo", "skills"),
13219
+ relativeDirPath = (0, import_node_path91.join)(".roo", "skills"),
12813
13220
  dirName,
12814
13221
  frontmatter,
12815
13222
  body,
@@ -12840,7 +13247,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
12840
13247
  global: _global = false
12841
13248
  } = {}) {
12842
13249
  return {
12843
- relativeDirPath: (0, import_node_path89.join)(".roo", "skills")
13250
+ relativeDirPath: (0, import_node_path91.join)(".roo", "skills")
12844
13251
  };
12845
13252
  }
12846
13253
  getFrontmatter() {
@@ -12928,13 +13335,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
12928
13335
  });
12929
13336
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12930
13337
  if (!result.success) {
12931
- const skillDirPath = (0, import_node_path89.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13338
+ const skillDirPath = (0, import_node_path91.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12932
13339
  throw new Error(
12933
- `Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13340
+ `Invalid frontmatter in ${(0, import_node_path91.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12934
13341
  );
12935
13342
  }
12936
13343
  if (result.data.name !== loaded.dirName) {
12937
- const skillFilePath = (0, import_node_path89.join)(
13344
+ const skillFilePath = (0, import_node_path91.join)(
12938
13345
  loaded.baseDir,
12939
13346
  loaded.relativeDirPath,
12940
13347
  loaded.dirName,
@@ -12975,17 +13382,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
12975
13382
  };
12976
13383
 
12977
13384
  // src/features/skills/skills-utils.ts
12978
- var import_node_path90 = require("path");
13385
+ var import_node_path92 = require("path");
12979
13386
  async function getLocalSkillDirNames(baseDir) {
12980
- const skillsDir = (0, import_node_path90.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
13387
+ const skillsDir = (0, import_node_path92.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12981
13388
  const names = /* @__PURE__ */ new Set();
12982
13389
  if (!await directoryExists(skillsDir)) {
12983
13390
  return names;
12984
13391
  }
12985
- const dirPaths = await findFilesByGlobs((0, import_node_path90.join)(skillsDir, "*"), { type: "dir" });
13392
+ const dirPaths = await findFilesByGlobs((0, import_node_path92.join)(skillsDir, "*"), { type: "dir" });
12986
13393
  for (const dirPath of dirPaths) {
12987
- const name = (0, import_node_path90.basename)(dirPath);
12988
- if (name === (0, import_node_path90.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
13394
+ const name = (0, import_node_path92.basename)(dirPath);
13395
+ if (name === (0, import_node_path92.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
12989
13396
  names.add(name);
12990
13397
  }
12991
13398
  return names;
@@ -13013,7 +13420,7 @@ var skillsProcessorToolTargetTuple = [
13013
13420
  "roo",
13014
13421
  "rovodev"
13015
13422
  ];
13016
- var SkillsProcessorToolTargetSchema = import_mini49.z.enum(skillsProcessorToolTargetTuple);
13423
+ var SkillsProcessorToolTargetSchema = import_mini50.z.enum(skillsProcessorToolTargetTuple);
13017
13424
  var toolSkillFactories = /* @__PURE__ */ new Map([
13018
13425
  [
13019
13426
  "agentsmd",
@@ -13237,11 +13644,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13237
13644
  )
13238
13645
  );
13239
13646
  const localSkillNames = new Set(localDirNames);
13240
- const curatedDirPath = (0, import_node_path91.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13647
+ const curatedDirPath = (0, import_node_path93.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13241
13648
  let curatedSkills = [];
13242
13649
  if (await directoryExists(curatedDirPath)) {
13243
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path91.join)(curatedDirPath, "*"), { type: "dir" });
13244
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path91.basename)(path3));
13650
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path93.join)(curatedDirPath, "*"), { type: "dir" });
13651
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path93.basename)(path3));
13245
13652
  const nonConflicting = curatedDirNames.filter((name) => {
13246
13653
  if (localSkillNames.has(name)) {
13247
13654
  this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -13278,13 +13685,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13278
13685
  const seenDirNames = /* @__PURE__ */ new Set();
13279
13686
  const loadEntries = [];
13280
13687
  for (const root of roots) {
13281
- const skillsDirPath = (0, import_node_path91.join)(this.baseDir, root);
13688
+ const skillsDirPath = (0, import_node_path93.join)(this.baseDir, root);
13282
13689
  if (!await directoryExists(skillsDirPath)) {
13283
13690
  continue;
13284
13691
  }
13285
- const dirPaths = await findFilesByGlobs((0, import_node_path91.join)(skillsDirPath, "*"), { type: "dir" });
13692
+ const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDirPath, "*"), { type: "dir" });
13286
13693
  for (const dirPath of dirPaths) {
13287
- const dirName = (0, import_node_path91.basename)(dirPath);
13694
+ const dirName = (0, import_node_path93.basename)(dirPath);
13288
13695
  if (seenDirNames.has(dirName)) {
13289
13696
  continue;
13290
13697
  }
@@ -13313,13 +13720,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13313
13720
  const roots = toolSkillSearchRoots(paths);
13314
13721
  const toolSkills = [];
13315
13722
  for (const root of roots) {
13316
- const skillsDirPath = (0, import_node_path91.join)(this.baseDir, root);
13723
+ const skillsDirPath = (0, import_node_path93.join)(this.baseDir, root);
13317
13724
  if (!await directoryExists(skillsDirPath)) {
13318
13725
  continue;
13319
13726
  }
13320
- const dirPaths = await findFilesByGlobs((0, import_node_path91.join)(skillsDirPath, "*"), { type: "dir" });
13727
+ const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDirPath, "*"), { type: "dir" });
13321
13728
  for (const dirPath of dirPaths) {
13322
- const dirName = (0, import_node_path91.basename)(dirPath);
13729
+ const dirName = (0, import_node_path93.basename)(dirPath);
13323
13730
  const toolSkill = factory.class.forDeletion({
13324
13731
  baseDir: this.baseDir,
13325
13732
  relativeDirPath: root,
@@ -13381,11 +13788,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13381
13788
  };
13382
13789
 
13383
13790
  // src/features/subagents/agentsmd-subagent.ts
13384
- var import_node_path93 = require("path");
13791
+ var import_node_path95 = require("path");
13385
13792
 
13386
13793
  // src/features/subagents/simulated-subagent.ts
13387
- var import_node_path92 = require("path");
13388
- var import_mini50 = require("zod/mini");
13794
+ var import_node_path94 = require("path");
13795
+ var import_mini51 = require("zod/mini");
13389
13796
 
13390
13797
  // src/features/subagents/tool-subagent.ts
13391
13798
  var ToolSubagent = class extends ToolFile {
@@ -13437,9 +13844,9 @@ var ToolSubagent = class extends ToolFile {
13437
13844
  };
13438
13845
 
13439
13846
  // src/features/subagents/simulated-subagent.ts
13440
- var SimulatedSubagentFrontmatterSchema = import_mini50.z.object({
13441
- name: import_mini50.z.string(),
13442
- description: import_mini50.z.optional(import_mini50.z.string())
13847
+ var SimulatedSubagentFrontmatterSchema = import_mini51.z.object({
13848
+ name: import_mini51.z.string(),
13849
+ description: import_mini51.z.optional(import_mini51.z.string())
13443
13850
  });
13444
13851
  var SimulatedSubagent = class extends ToolSubagent {
13445
13852
  frontmatter;
@@ -13449,7 +13856,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13449
13856
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
13450
13857
  if (!result.success) {
13451
13858
  throw new Error(
13452
- `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13859
+ `Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13453
13860
  );
13454
13861
  }
13455
13862
  }
@@ -13500,7 +13907,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13500
13907
  return {
13501
13908
  success: false,
13502
13909
  error: new Error(
13503
- `Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13910
+ `Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13504
13911
  )
13505
13912
  };
13506
13913
  }
@@ -13510,7 +13917,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13510
13917
  relativeFilePath,
13511
13918
  validate = true
13512
13919
  }) {
13513
- const filePath = (0, import_node_path92.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13920
+ const filePath = (0, import_node_path94.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13514
13921
  const fileContent = await readFileContent(filePath);
13515
13922
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13516
13923
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13520,7 +13927,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13520
13927
  return {
13521
13928
  baseDir,
13522
13929
  relativeDirPath: this.getSettablePaths().relativeDirPath,
13523
- relativeFilePath: (0, import_node_path92.basename)(relativeFilePath),
13930
+ relativeFilePath: (0, import_node_path94.basename)(relativeFilePath),
13524
13931
  frontmatter: result.data,
13525
13932
  body: content.trim(),
13526
13933
  validate
@@ -13546,7 +13953,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13546
13953
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13547
13954
  static getSettablePaths() {
13548
13955
  return {
13549
- relativeDirPath: (0, import_node_path93.join)(".agents", "subagents")
13956
+ relativeDirPath: (0, import_node_path95.join)(".agents", "subagents")
13550
13957
  };
13551
13958
  }
13552
13959
  static async fromFile(params) {
@@ -13569,11 +13976,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13569
13976
  };
13570
13977
 
13571
13978
  // src/features/subagents/factorydroid-subagent.ts
13572
- var import_node_path94 = require("path");
13979
+ var import_node_path96 = require("path");
13573
13980
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
13574
13981
  static getSettablePaths(_options) {
13575
13982
  return {
13576
- relativeDirPath: (0, import_node_path94.join)(".factory", "droids")
13983
+ relativeDirPath: (0, import_node_path96.join)(".factory", "droids")
13577
13984
  };
13578
13985
  }
13579
13986
  static async fromFile(params) {
@@ -13596,16 +14003,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
13596
14003
  };
13597
14004
 
13598
14005
  // src/features/subagents/geminicli-subagent.ts
13599
- var import_node_path96 = require("path");
13600
- var import_mini52 = require("zod/mini");
14006
+ var import_node_path98 = require("path");
14007
+ var import_mini53 = require("zod/mini");
13601
14008
 
13602
14009
  // src/features/subagents/rulesync-subagent.ts
13603
- var import_node_path95 = require("path");
13604
- var import_mini51 = require("zod/mini");
13605
- var RulesyncSubagentFrontmatterSchema = import_mini51.z.looseObject({
13606
- targets: import_mini51.z._default(RulesyncTargetsSchema, ["*"]),
13607
- name: import_mini51.z.string(),
13608
- description: import_mini51.z.optional(import_mini51.z.string())
14010
+ var import_node_path97 = require("path");
14011
+ var import_mini52 = require("zod/mini");
14012
+ var RulesyncSubagentFrontmatterSchema = import_mini52.z.looseObject({
14013
+ targets: import_mini52.z._default(RulesyncTargetsSchema, ["*"]),
14014
+ name: import_mini52.z.string(),
14015
+ description: import_mini52.z.optional(import_mini52.z.string())
13609
14016
  });
13610
14017
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13611
14018
  frontmatter;
@@ -13614,7 +14021,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13614
14021
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
13615
14022
  if (!parseResult.success && rest.validate !== false) {
13616
14023
  throw new Error(
13617
- `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
14024
+ `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
13618
14025
  );
13619
14026
  }
13620
14027
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -13647,7 +14054,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13647
14054
  return {
13648
14055
  success: false,
13649
14056
  error: new Error(
13650
- `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14057
+ `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13651
14058
  )
13652
14059
  };
13653
14060
  }
@@ -13655,14 +14062,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13655
14062
  static async fromFile({
13656
14063
  relativeFilePath
13657
14064
  }) {
13658
- const filePath = (0, import_node_path95.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
14065
+ const filePath = (0, import_node_path97.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
13659
14066
  const fileContent = await readFileContent(filePath);
13660
14067
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13661
14068
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
13662
14069
  if (!result.success) {
13663
14070
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
13664
14071
  }
13665
- const filename = (0, import_node_path95.basename)(relativeFilePath);
14072
+ const filename = (0, import_node_path97.basename)(relativeFilePath);
13666
14073
  return new _RulesyncSubagent({
13667
14074
  baseDir: process.cwd(),
13668
14075
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -13674,9 +14081,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13674
14081
  };
13675
14082
 
13676
14083
  // src/features/subagents/geminicli-subagent.ts
13677
- var GeminiCliSubagentFrontmatterSchema = import_mini52.z.looseObject({
13678
- name: import_mini52.z.string(),
13679
- description: import_mini52.z.optional(import_mini52.z.string())
14084
+ var GeminiCliSubagentFrontmatterSchema = import_mini53.z.looseObject({
14085
+ name: import_mini53.z.string(),
14086
+ description: import_mini53.z.optional(import_mini53.z.string())
13680
14087
  });
13681
14088
  var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13682
14089
  frontmatter;
@@ -13686,7 +14093,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13686
14093
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
13687
14094
  if (!result.success) {
13688
14095
  throw new Error(
13689
- `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14096
+ `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13690
14097
  );
13691
14098
  }
13692
14099
  }
@@ -13699,7 +14106,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13699
14106
  }
13700
14107
  static getSettablePaths(_options = {}) {
13701
14108
  return {
13702
- relativeDirPath: (0, import_node_path96.join)(".gemini", "agents")
14109
+ relativeDirPath: (0, import_node_path98.join)(".gemini", "agents")
13703
14110
  };
13704
14111
  }
13705
14112
  getFrontmatter() {
@@ -13767,7 +14174,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13767
14174
  return {
13768
14175
  success: false,
13769
14176
  error: new Error(
13770
- `Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14177
+ `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13771
14178
  )
13772
14179
  };
13773
14180
  }
@@ -13785,7 +14192,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13785
14192
  global = false
13786
14193
  }) {
13787
14194
  const paths = this.getSettablePaths({ global });
13788
- const filePath = (0, import_node_path96.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14195
+ const filePath = (0, import_node_path98.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13789
14196
  const fileContent = await readFileContent(filePath);
13790
14197
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13791
14198
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13821,11 +14228,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13821
14228
  };
13822
14229
 
13823
14230
  // src/features/subagents/roo-subagent.ts
13824
- var import_node_path97 = require("path");
14231
+ var import_node_path99 = require("path");
13825
14232
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13826
14233
  static getSettablePaths() {
13827
14234
  return {
13828
- relativeDirPath: (0, import_node_path97.join)(".roo", "subagents")
14235
+ relativeDirPath: (0, import_node_path99.join)(".roo", "subagents")
13829
14236
  };
13830
14237
  }
13831
14238
  static async fromFile(params) {
@@ -13848,11 +14255,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13848
14255
  };
13849
14256
 
13850
14257
  // src/features/subagents/rovodev-subagent.ts
13851
- var import_node_path98 = require("path");
13852
- var import_mini53 = require("zod/mini");
13853
- var RovodevSubagentFrontmatterSchema = import_mini53.z.looseObject({
13854
- name: import_mini53.z.string(),
13855
- description: import_mini53.z.optional(import_mini53.z.string())
14258
+ var import_node_path100 = require("path");
14259
+ var import_mini54 = require("zod/mini");
14260
+ var RovodevSubagentFrontmatterSchema = import_mini54.z.looseObject({
14261
+ name: import_mini54.z.string(),
14262
+ description: import_mini54.z.optional(import_mini54.z.string())
13856
14263
  });
13857
14264
  var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13858
14265
  frontmatter;
@@ -13862,7 +14269,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13862
14269
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
13863
14270
  if (!result.success) {
13864
14271
  throw new Error(
13865
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14272
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13866
14273
  );
13867
14274
  }
13868
14275
  }
@@ -13874,7 +14281,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13874
14281
  }
13875
14282
  static getSettablePaths(_options = {}) {
13876
14283
  return {
13877
- relativeDirPath: (0, import_node_path98.join)(".rovodev", "subagents")
14284
+ relativeDirPath: (0, import_node_path100.join)(".rovodev", "subagents")
13878
14285
  };
13879
14286
  }
13880
14287
  getFrontmatter() {
@@ -13937,7 +14344,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13937
14344
  return {
13938
14345
  success: false,
13939
14346
  error: new Error(
13940
- `Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14347
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13941
14348
  )
13942
14349
  };
13943
14350
  }
@@ -13954,7 +14361,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13954
14361
  global = false
13955
14362
  }) {
13956
14363
  const paths = this.getSettablePaths({ global });
13957
- const filePath = (0, import_node_path98.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14364
+ const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13958
14365
  const fileContent = await readFileContent(filePath);
13959
14366
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13960
14367
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13993,19 +14400,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13993
14400
  };
13994
14401
 
13995
14402
  // src/features/subagents/subagents-processor.ts
13996
- var import_node_path109 = require("path");
13997
- var import_mini62 = require("zod/mini");
14403
+ var import_node_path111 = require("path");
14404
+ var import_mini63 = require("zod/mini");
13998
14405
 
13999
14406
  // src/features/subagents/claudecode-subagent.ts
14000
- var import_node_path99 = require("path");
14001
- var import_mini54 = require("zod/mini");
14002
- var ClaudecodeSubagentFrontmatterSchema = import_mini54.z.looseObject({
14003
- name: import_mini54.z.string(),
14004
- description: import_mini54.z.optional(import_mini54.z.string()),
14005
- model: import_mini54.z.optional(import_mini54.z.string()),
14006
- tools: import_mini54.z.optional(import_mini54.z.union([import_mini54.z.string(), import_mini54.z.array(import_mini54.z.string())])),
14007
- permissionMode: import_mini54.z.optional(import_mini54.z.string()),
14008
- skills: import_mini54.z.optional(import_mini54.z.union([import_mini54.z.string(), import_mini54.z.array(import_mini54.z.string())]))
14407
+ var import_node_path101 = require("path");
14408
+ var import_mini55 = require("zod/mini");
14409
+ var ClaudecodeSubagentFrontmatterSchema = import_mini55.z.looseObject({
14410
+ name: import_mini55.z.string(),
14411
+ description: import_mini55.z.optional(import_mini55.z.string()),
14412
+ model: import_mini55.z.optional(import_mini55.z.string()),
14413
+ tools: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.string(), import_mini55.z.array(import_mini55.z.string())])),
14414
+ permissionMode: import_mini55.z.optional(import_mini55.z.string()),
14415
+ skills: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.string(), import_mini55.z.array(import_mini55.z.string())]))
14009
14416
  });
14010
14417
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14011
14418
  frontmatter;
@@ -14015,7 +14422,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14015
14422
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
14016
14423
  if (!result.success) {
14017
14424
  throw new Error(
14018
- `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14425
+ `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14019
14426
  );
14020
14427
  }
14021
14428
  }
@@ -14027,7 +14434,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14027
14434
  }
14028
14435
  static getSettablePaths(_options = {}) {
14029
14436
  return {
14030
- relativeDirPath: (0, import_node_path99.join)(".claude", "agents")
14437
+ relativeDirPath: (0, import_node_path101.join)(".claude", "agents")
14031
14438
  };
14032
14439
  }
14033
14440
  getFrontmatter() {
@@ -14106,7 +14513,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14106
14513
  return {
14107
14514
  success: false,
14108
14515
  error: new Error(
14109
- `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14516
+ `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14110
14517
  )
14111
14518
  };
14112
14519
  }
@@ -14124,7 +14531,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14124
14531
  global = false
14125
14532
  }) {
14126
14533
  const paths = this.getSettablePaths({ global });
14127
- const filePath = (0, import_node_path99.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14534
+ const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14128
14535
  const fileContent = await readFileContent(filePath);
14129
14536
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14130
14537
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14159,27 +14566,27 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14159
14566
  };
14160
14567
 
14161
14568
  // src/features/subagents/codexcli-subagent.ts
14162
- var import_node_path100 = require("path");
14163
- var smolToml4 = __toESM(require("smol-toml"), 1);
14164
- var import_mini55 = require("zod/mini");
14165
- var CodexCliSubagentTomlSchema = import_mini55.z.looseObject({
14166
- name: import_mini55.z.string(),
14167
- description: import_mini55.z.optional(import_mini55.z.string()),
14168
- developer_instructions: import_mini55.z.optional(import_mini55.z.string()),
14169
- model: import_mini55.z.optional(import_mini55.z.string()),
14170
- model_reasoning_effort: import_mini55.z.optional(import_mini55.z.string()),
14171
- sandbox_mode: import_mini55.z.optional(import_mini55.z.string())
14569
+ var import_node_path102 = require("path");
14570
+ var smolToml5 = __toESM(require("smol-toml"), 1);
14571
+ var import_mini56 = require("zod/mini");
14572
+ var CodexCliSubagentTomlSchema = import_mini56.z.looseObject({
14573
+ name: import_mini56.z.string(),
14574
+ description: import_mini56.z.optional(import_mini56.z.string()),
14575
+ developer_instructions: import_mini56.z.optional(import_mini56.z.string()),
14576
+ model: import_mini56.z.optional(import_mini56.z.string()),
14577
+ model_reasoning_effort: import_mini56.z.optional(import_mini56.z.string()),
14578
+ sandbox_mode: import_mini56.z.optional(import_mini56.z.string())
14172
14579
  });
14173
14580
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14174
14581
  body;
14175
14582
  constructor({ body, ...rest }) {
14176
14583
  if (rest.validate !== false) {
14177
14584
  try {
14178
- const parsed = smolToml4.parse(body);
14585
+ const parsed = smolToml5.parse(body);
14179
14586
  CodexCliSubagentTomlSchema.parse(parsed);
14180
14587
  } catch (error) {
14181
14588
  throw new Error(
14182
- `Invalid TOML in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14589
+ `Invalid TOML in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14183
14590
  { cause: error }
14184
14591
  );
14185
14592
  }
@@ -14191,7 +14598,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14191
14598
  }
14192
14599
  static getSettablePaths(_options = {}) {
14193
14600
  return {
14194
- relativeDirPath: (0, import_node_path100.join)(".codex", "agents")
14601
+ relativeDirPath: (0, import_node_path102.join)(".codex", "agents")
14195
14602
  };
14196
14603
  }
14197
14604
  getBody() {
@@ -14200,10 +14607,10 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14200
14607
  toRulesyncSubagent() {
14201
14608
  let parsed;
14202
14609
  try {
14203
- parsed = CodexCliSubagentTomlSchema.parse(smolToml4.parse(this.body));
14610
+ parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
14204
14611
  } catch (error) {
14205
14612
  throw new Error(
14206
- `Failed to parse TOML in ${(0, import_node_path100.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14613
+ `Failed to parse TOML in ${(0, import_node_path102.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14207
14614
  { cause: error }
14208
14615
  );
14209
14616
  }
@@ -14246,7 +14653,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14246
14653
  ...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
14247
14654
  ...codexcliSection
14248
14655
  };
14249
- const body = smolToml4.stringify(tomlObj);
14656
+ const body = smolToml5.stringify(tomlObj);
14250
14657
  const paths = this.getSettablePaths({ global });
14251
14658
  const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
14252
14659
  return new _CodexCliSubagent({
@@ -14261,7 +14668,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14261
14668
  }
14262
14669
  validate() {
14263
14670
  try {
14264
- const parsed = smolToml4.parse(this.body);
14671
+ const parsed = smolToml5.parse(this.body);
14265
14672
  CodexCliSubagentTomlSchema.parse(parsed);
14266
14673
  return { success: true, error: null };
14267
14674
  } catch (error) {
@@ -14284,7 +14691,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14284
14691
  global = false
14285
14692
  }) {
14286
14693
  const paths = this.getSettablePaths({ global });
14287
- const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14694
+ const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14288
14695
  const fileContent = await readFileContent(filePath);
14289
14696
  const subagent = new _CodexCliSubagent({
14290
14697
  baseDir,
@@ -14322,13 +14729,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14322
14729
  };
14323
14730
 
14324
14731
  // src/features/subagents/copilot-subagent.ts
14325
- var import_node_path101 = require("path");
14326
- var import_mini56 = require("zod/mini");
14732
+ var import_node_path103 = require("path");
14733
+ var import_mini57 = require("zod/mini");
14327
14734
  var REQUIRED_TOOL = "agent/runSubagent";
14328
- var CopilotSubagentFrontmatterSchema = import_mini56.z.looseObject({
14329
- name: import_mini56.z.string(),
14330
- description: import_mini56.z.optional(import_mini56.z.string()),
14331
- tools: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())]))
14735
+ var CopilotSubagentFrontmatterSchema = import_mini57.z.looseObject({
14736
+ name: import_mini57.z.string(),
14737
+ description: import_mini57.z.optional(import_mini57.z.string()),
14738
+ tools: import_mini57.z.optional(import_mini57.z.union([import_mini57.z.string(), import_mini57.z.array(import_mini57.z.string())]))
14332
14739
  });
14333
14740
  var normalizeTools = (tools) => {
14334
14741
  if (!tools) {
@@ -14348,7 +14755,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14348
14755
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
14349
14756
  if (!result.success) {
14350
14757
  throw new Error(
14351
- `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14758
+ `Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14352
14759
  );
14353
14760
  }
14354
14761
  }
@@ -14360,7 +14767,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14360
14767
  }
14361
14768
  static getSettablePaths(_options = {}) {
14362
14769
  return {
14363
- relativeDirPath: (0, import_node_path101.join)(".github", "agents")
14770
+ relativeDirPath: (0, import_node_path103.join)(".github", "agents")
14364
14771
  };
14365
14772
  }
14366
14773
  getFrontmatter() {
@@ -14412,12 +14819,16 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14412
14819
  const body = rulesyncSubagent.getBody();
14413
14820
  const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
14414
14821
  const paths = this.getSettablePaths({ global });
14822
+ let relativeFilePath = rulesyncSubagent.getRelativeFilePath();
14823
+ if (!relativeFilePath.endsWith(".agent.md")) {
14824
+ relativeFilePath = relativeFilePath.replace(/\.md$/, ".agent.md");
14825
+ }
14415
14826
  return new _CopilotSubagent({
14416
14827
  baseDir,
14417
14828
  frontmatter: copilotFrontmatter,
14418
14829
  body,
14419
14830
  relativeDirPath: paths.relativeDirPath,
14420
- relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
14831
+ relativeFilePath,
14421
14832
  fileContent,
14422
14833
  validate,
14423
14834
  global
@@ -14434,7 +14845,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14434
14845
  return {
14435
14846
  success: false,
14436
14847
  error: new Error(
14437
- `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14848
+ `Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14438
14849
  )
14439
14850
  };
14440
14851
  }
@@ -14452,7 +14863,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14452
14863
  global = false
14453
14864
  }) {
14454
14865
  const paths = this.getSettablePaths({ global });
14455
- const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14866
+ const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14456
14867
  const fileContent = await readFileContent(filePath);
14457
14868
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14458
14869
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14488,11 +14899,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14488
14899
  };
14489
14900
 
14490
14901
  // src/features/subagents/cursor-subagent.ts
14491
- var import_node_path102 = require("path");
14492
- var import_mini57 = require("zod/mini");
14493
- var CursorSubagentFrontmatterSchema = import_mini57.z.looseObject({
14494
- name: import_mini57.z.string(),
14495
- description: import_mini57.z.optional(import_mini57.z.string())
14902
+ var import_node_path104 = require("path");
14903
+ var import_mini58 = require("zod/mini");
14904
+ var CursorSubagentFrontmatterSchema = import_mini58.z.looseObject({
14905
+ name: import_mini58.z.string(),
14906
+ description: import_mini58.z.optional(import_mini58.z.string())
14496
14907
  });
14497
14908
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14498
14909
  frontmatter;
@@ -14502,7 +14913,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14502
14913
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
14503
14914
  if (!result.success) {
14504
14915
  throw new Error(
14505
- `Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14916
+ `Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14506
14917
  );
14507
14918
  }
14508
14919
  }
@@ -14514,7 +14925,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14514
14925
  }
14515
14926
  static getSettablePaths(_options = {}) {
14516
14927
  return {
14517
- relativeDirPath: (0, import_node_path102.join)(".cursor", "agents")
14928
+ relativeDirPath: (0, import_node_path104.join)(".cursor", "agents")
14518
14929
  };
14519
14930
  }
14520
14931
  getFrontmatter() {
@@ -14581,7 +14992,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14581
14992
  return {
14582
14993
  success: false,
14583
14994
  error: new Error(
14584
- `Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14995
+ `Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14585
14996
  )
14586
14997
  };
14587
14998
  }
@@ -14599,7 +15010,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14599
15010
  global = false
14600
15011
  }) {
14601
15012
  const paths = this.getSettablePaths({ global });
14602
- const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15013
+ const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14603
15014
  const fileContent = await readFileContent(filePath);
14604
15015
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14605
15016
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14635,12 +15046,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14635
15046
  };
14636
15047
 
14637
15048
  // src/features/subagents/deepagents-subagent.ts
14638
- var import_node_path103 = require("path");
14639
- var import_mini58 = require("zod/mini");
14640
- var DeepagentsSubagentFrontmatterSchema = import_mini58.z.looseObject({
14641
- name: import_mini58.z.string(),
14642
- description: import_mini58.z.optional(import_mini58.z.string()),
14643
- model: import_mini58.z.optional(import_mini58.z.string())
15049
+ var import_node_path105 = require("path");
15050
+ var import_mini59 = require("zod/mini");
15051
+ var DeepagentsSubagentFrontmatterSchema = import_mini59.z.looseObject({
15052
+ name: import_mini59.z.string(),
15053
+ description: import_mini59.z.optional(import_mini59.z.string()),
15054
+ model: import_mini59.z.optional(import_mini59.z.string())
14644
15055
  });
14645
15056
  var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14646
15057
  frontmatter;
@@ -14650,7 +15061,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14650
15061
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
14651
15062
  if (!result.success) {
14652
15063
  throw new Error(
14653
- `Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15064
+ `Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14654
15065
  );
14655
15066
  }
14656
15067
  }
@@ -14660,7 +15071,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14660
15071
  }
14661
15072
  static getSettablePaths(_options = {}) {
14662
15073
  return {
14663
- relativeDirPath: (0, import_node_path103.join)(".deepagents", "agents")
15074
+ relativeDirPath: (0, import_node_path105.join)(".deepagents", "agents")
14664
15075
  };
14665
15076
  }
14666
15077
  getFrontmatter() {
@@ -14735,7 +15146,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14735
15146
  return {
14736
15147
  success: false,
14737
15148
  error: new Error(
14738
- `Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15149
+ `Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14739
15150
  )
14740
15151
  };
14741
15152
  }
@@ -14753,7 +15164,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14753
15164
  global = false
14754
15165
  }) {
14755
15166
  const paths = this.getSettablePaths({ global });
14756
- const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15167
+ const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14757
15168
  const fileContent = await readFileContent(filePath);
14758
15169
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14759
15170
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14788,11 +15199,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14788
15199
  };
14789
15200
 
14790
15201
  // src/features/subagents/junie-subagent.ts
14791
- var import_node_path104 = require("path");
14792
- var import_mini59 = require("zod/mini");
14793
- var JunieSubagentFrontmatterSchema = import_mini59.z.looseObject({
14794
- name: import_mini59.z.optional(import_mini59.z.string()),
14795
- description: import_mini59.z.string()
15202
+ var import_node_path106 = require("path");
15203
+ var import_mini60 = require("zod/mini");
15204
+ var JunieSubagentFrontmatterSchema = import_mini60.z.looseObject({
15205
+ name: import_mini60.z.optional(import_mini60.z.string()),
15206
+ description: import_mini60.z.string()
14796
15207
  });
14797
15208
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14798
15209
  frontmatter;
@@ -14802,7 +15213,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14802
15213
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
14803
15214
  if (!result.success) {
14804
15215
  throw new Error(
14805
- `Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15216
+ `Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14806
15217
  );
14807
15218
  }
14808
15219
  }
@@ -14817,7 +15228,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14817
15228
  throw new Error("JunieSubagent does not support global mode.");
14818
15229
  }
14819
15230
  return {
14820
- relativeDirPath: (0, import_node_path104.join)(".junie", "agents")
15231
+ relativeDirPath: (0, import_node_path106.join)(".junie", "agents")
14821
15232
  };
14822
15233
  }
14823
15234
  getFrontmatter() {
@@ -14893,7 +15304,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14893
15304
  return {
14894
15305
  success: false,
14895
15306
  error: new Error(
14896
- `Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15307
+ `Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14897
15308
  )
14898
15309
  };
14899
15310
  }
@@ -14911,7 +15322,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14911
15322
  global = false
14912
15323
  }) {
14913
15324
  const paths = this.getSettablePaths({ global });
14914
- const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15325
+ const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
14915
15326
  const fileContent = await readFileContent(filePath);
14916
15327
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14917
15328
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14946,15 +15357,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14946
15357
  };
14947
15358
 
14948
15359
  // src/features/subagents/kilo-subagent.ts
14949
- var import_node_path106 = require("path");
15360
+ var import_node_path108 = require("path");
14950
15361
 
14951
15362
  // src/features/subagents/opencode-style-subagent.ts
14952
- var import_node_path105 = require("path");
14953
- var import_mini60 = require("zod/mini");
14954
- var OpenCodeStyleSubagentFrontmatterSchema = import_mini60.z.looseObject({
14955
- description: import_mini60.z.optional(import_mini60.z.string()),
14956
- mode: import_mini60.z._default(import_mini60.z.string(), "subagent"),
14957
- name: import_mini60.z.optional(import_mini60.z.string())
15363
+ var import_node_path107 = require("path");
15364
+ var import_mini61 = require("zod/mini");
15365
+ var OpenCodeStyleSubagentFrontmatterSchema = import_mini61.z.looseObject({
15366
+ description: import_mini61.z.optional(import_mini61.z.string()),
15367
+ mode: import_mini61.z._default(import_mini61.z.string(), "subagent"),
15368
+ name: import_mini61.z.optional(import_mini61.z.string())
14958
15369
  });
14959
15370
  var OpenCodeStyleSubagent = class extends ToolSubagent {
14960
15371
  frontmatter;
@@ -14964,7 +15375,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14964
15375
  const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
14965
15376
  if (!result.success) {
14966
15377
  throw new Error(
14967
- `Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15378
+ `Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14968
15379
  );
14969
15380
  }
14970
15381
  }
@@ -14984,7 +15395,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14984
15395
  const { description, mode, name, ...toolSection } = this.frontmatter;
14985
15396
  const rulesyncFrontmatter = {
14986
15397
  targets: ["*"],
14987
- name: name ?? (0, import_node_path105.basename)(this.getRelativeFilePath(), ".md"),
15398
+ name: name ?? (0, import_node_path107.basename)(this.getRelativeFilePath(), ".md"),
14988
15399
  description,
14989
15400
  [this.getToolTarget()]: { mode, ...toolSection }
14990
15401
  };
@@ -15006,7 +15417,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
15006
15417
  return {
15007
15418
  success: false,
15008
15419
  error: new Error(
15009
- `Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15420
+ `Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15010
15421
  )
15011
15422
  };
15012
15423
  }
@@ -15022,7 +15433,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15022
15433
  global = false
15023
15434
  } = {}) {
15024
15435
  return {
15025
- relativeDirPath: global ? (0, import_node_path106.join)(".config", "kilo", "agent") : (0, import_node_path106.join)(".kilo", "agent")
15436
+ relativeDirPath: global ? (0, import_node_path108.join)(".config", "kilo", "agent") : (0, import_node_path108.join)(".kilo", "agent")
15026
15437
  };
15027
15438
  }
15028
15439
  static fromRulesyncSubagent({
@@ -15066,7 +15477,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15066
15477
  global = false
15067
15478
  }) {
15068
15479
  const paths = this.getSettablePaths({ global });
15069
- const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15480
+ const filePath = (0, import_node_path108.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15070
15481
  const fileContent = await readFileContent(filePath);
15071
15482
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15072
15483
  const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15102,23 +15513,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15102
15513
  };
15103
15514
 
15104
15515
  // src/features/subagents/kiro-subagent.ts
15105
- var import_node_path107 = require("path");
15106
- var import_mini61 = require("zod/mini");
15107
- var KiroCliSubagentJsonSchema = import_mini61.z.looseObject({
15108
- name: import_mini61.z.string(),
15109
- description: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.string())),
15110
- prompt: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.string())),
15111
- tools: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.array(import_mini61.z.string()))),
15112
- toolAliases: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.record(import_mini61.z.string(), import_mini61.z.string()))),
15113
- toolSettings: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.unknown())),
15114
- toolSchema: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.unknown())),
15115
- hooks: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.record(import_mini61.z.string(), import_mini61.z.array(import_mini61.z.unknown())))),
15116
- model: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.string())),
15117
- mcpServers: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.record(import_mini61.z.string(), import_mini61.z.unknown()))),
15118
- useLegacyMcpJson: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.boolean())),
15119
- resources: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.array(import_mini61.z.string()))),
15120
- allowedTools: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.array(import_mini61.z.string()))),
15121
- includeMcpJson: import_mini61.z.optional(import_mini61.z.nullable(import_mini61.z.boolean()))
15516
+ var import_node_path109 = require("path");
15517
+ var import_mini62 = require("zod/mini");
15518
+ var KiroCliSubagentJsonSchema = import_mini62.z.looseObject({
15519
+ name: import_mini62.z.string(),
15520
+ description: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
15521
+ prompt: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
15522
+ tools: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
15523
+ toolAliases: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.string()))),
15524
+ toolSettings: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.unknown())),
15525
+ toolSchema: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.unknown())),
15526
+ hooks: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.array(import_mini62.z.unknown())))),
15527
+ model: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
15528
+ mcpServers: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.unknown()))),
15529
+ useLegacyMcpJson: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.boolean())),
15530
+ resources: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
15531
+ allowedTools: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
15532
+ includeMcpJson: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.boolean()))
15122
15533
  });
15123
15534
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15124
15535
  body;
@@ -15129,7 +15540,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15129
15540
  KiroCliSubagentJsonSchema.parse(parsed);
15130
15541
  } catch (error) {
15131
15542
  throw new Error(
15132
- `Invalid JSON in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15543
+ `Invalid JSON in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15133
15544
  { cause: error }
15134
15545
  );
15135
15546
  }
@@ -15141,7 +15552,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15141
15552
  }
15142
15553
  static getSettablePaths(_options = {}) {
15143
15554
  return {
15144
- relativeDirPath: (0, import_node_path107.join)(".kiro", "agents")
15555
+ relativeDirPath: (0, import_node_path109.join)(".kiro", "agents")
15145
15556
  };
15146
15557
  }
15147
15558
  getBody() {
@@ -15153,7 +15564,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15153
15564
  parsed = JSON.parse(this.body);
15154
15565
  } catch (error) {
15155
15566
  throw new Error(
15156
- `Failed to parse JSON in ${(0, import_node_path107.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15567
+ `Failed to parse JSON in ${(0, import_node_path109.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15157
15568
  { cause: error }
15158
15569
  );
15159
15570
  }
@@ -15234,7 +15645,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15234
15645
  global = false
15235
15646
  }) {
15236
15647
  const paths = this.getSettablePaths({ global });
15237
- const filePath = (0, import_node_path107.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15648
+ const filePath = (0, import_node_path109.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15238
15649
  const fileContent = await readFileContent(filePath);
15239
15650
  const subagent = new _KiroSubagent({
15240
15651
  baseDir,
@@ -15272,7 +15683,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15272
15683
  };
15273
15684
 
15274
15685
  // src/features/subagents/opencode-subagent.ts
15275
- var import_node_path108 = require("path");
15686
+ var import_node_path110 = require("path");
15276
15687
  var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
15277
15688
  var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15278
15689
  getToolTarget() {
@@ -15282,7 +15693,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15282
15693
  global = false
15283
15694
  } = {}) {
15284
15695
  return {
15285
- relativeDirPath: global ? (0, import_node_path108.join)(".config", "opencode", "agent") : (0, import_node_path108.join)(".opencode", "agent")
15696
+ relativeDirPath: global ? (0, import_node_path110.join)(".config", "opencode", "agent") : (0, import_node_path110.join)(".opencode", "agent")
15286
15697
  };
15287
15698
  }
15288
15699
  static fromRulesyncSubagent({
@@ -15326,7 +15737,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15326
15737
  global = false
15327
15738
  }) {
15328
15739
  const paths = this.getSettablePaths({ global });
15329
- const filePath = (0, import_node_path108.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15740
+ const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
15330
15741
  const fileContent = await readFileContent(filePath);
15331
15742
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15332
15743
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15379,7 +15790,7 @@ var subagentsProcessorToolTargetTuple = [
15379
15790
  "roo",
15380
15791
  "rovodev"
15381
15792
  ];
15382
- var SubagentsProcessorToolTargetSchema = import_mini62.z.enum(subagentsProcessorToolTargetTuple);
15793
+ var SubagentsProcessorToolTargetSchema = import_mini63.z.enum(subagentsProcessorToolTargetTuple);
15383
15794
  var toolSubagentFactories = /* @__PURE__ */ new Map([
15384
15795
  [
15385
15796
  "agentsmd",
@@ -15570,7 +15981,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15570
15981
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
15571
15982
  */
15572
15983
  async loadRulesyncFiles() {
15573
- const subagentsDir = (0, import_node_path109.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15984
+ const subagentsDir = (0, import_node_path111.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15574
15985
  const dirExists = await directoryExists(subagentsDir);
15575
15986
  if (!dirExists) {
15576
15987
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -15585,7 +15996,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15585
15996
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
15586
15997
  const rulesyncSubagents = [];
15587
15998
  for (const mdFile of mdFiles) {
15588
- const filepath = (0, import_node_path109.join)(subagentsDir, mdFile);
15999
+ const filepath = (0, import_node_path111.join)(subagentsDir, mdFile);
15589
16000
  try {
15590
16001
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
15591
16002
  relativeFilePath: mdFile,
@@ -15615,14 +16026,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
15615
16026
  const factory = this.getFactory(this.toolTarget);
15616
16027
  const paths = factory.class.getSettablePaths({ global: this.global });
15617
16028
  const subagentFilePaths = await findFilesByGlobs(
15618
- (0, import_node_path109.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
16029
+ (0, import_node_path111.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
15619
16030
  );
15620
16031
  if (forDeletion) {
15621
16032
  const toolSubagents2 = subagentFilePaths.map(
15622
16033
  (path3) => factory.class.forDeletion({
15623
16034
  baseDir: this.baseDir,
15624
16035
  relativeDirPath: paths.relativeDirPath,
15625
- relativeFilePath: (0, import_node_path109.basename)(path3),
16036
+ relativeFilePath: (0, import_node_path111.basename)(path3),
15626
16037
  global: this.global
15627
16038
  })
15628
16039
  ).filter((subagent) => subagent.isDeletable());
@@ -15635,7 +16046,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15635
16046
  subagentFilePaths.map(
15636
16047
  (path3) => factory.class.fromFile({
15637
16048
  baseDir: this.baseDir,
15638
- relativeFilePath: (0, import_node_path109.basename)(path3),
16049
+ relativeFilePath: (0, import_node_path111.basename)(path3),
15639
16050
  global: this.global
15640
16051
  })
15641
16052
  )
@@ -15682,49 +16093,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
15682
16093
  };
15683
16094
 
15684
16095
  // src/features/rules/agentsmd-rule.ts
15685
- var import_node_path112 = require("path");
16096
+ var import_node_path114 = require("path");
15686
16097
 
15687
16098
  // src/features/rules/tool-rule.ts
15688
- var import_node_path111 = require("path");
16099
+ var import_node_path113 = require("path");
15689
16100
 
15690
16101
  // src/features/rules/rulesync-rule.ts
15691
- var import_node_path110 = require("path");
15692
- var import_mini63 = require("zod/mini");
15693
- var RulesyncRuleFrontmatterSchema = import_mini63.z.object({
15694
- root: import_mini63.z.optional(import_mini63.z.boolean()),
15695
- localRoot: import_mini63.z.optional(import_mini63.z.boolean()),
15696
- targets: import_mini63.z._default(RulesyncTargetsSchema, ["*"]),
15697
- description: import_mini63.z.optional(import_mini63.z.string()),
15698
- globs: import_mini63.z.optional(import_mini63.z.array(import_mini63.z.string())),
15699
- agentsmd: import_mini63.z.optional(
15700
- import_mini63.z.looseObject({
16102
+ var import_node_path112 = require("path");
16103
+ var import_mini64 = require("zod/mini");
16104
+ var RulesyncRuleFrontmatterSchema = import_mini64.z.object({
16105
+ root: import_mini64.z.optional(import_mini64.z.boolean()),
16106
+ localRoot: import_mini64.z.optional(import_mini64.z.boolean()),
16107
+ targets: import_mini64.z._default(RulesyncTargetsSchema, ["*"]),
16108
+ description: import_mini64.z.optional(import_mini64.z.string()),
16109
+ globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string())),
16110
+ agentsmd: import_mini64.z.optional(
16111
+ import_mini64.z.looseObject({
15701
16112
  // @example "path/to/subproject"
15702
- subprojectPath: import_mini63.z.optional(import_mini63.z.string())
16113
+ subprojectPath: import_mini64.z.optional(import_mini64.z.string())
15703
16114
  })
15704
16115
  ),
15705
- claudecode: import_mini63.z.optional(
15706
- import_mini63.z.looseObject({
16116
+ claudecode: import_mini64.z.optional(
16117
+ import_mini64.z.looseObject({
15707
16118
  // Glob patterns for conditional rules (takes precedence over globs)
15708
16119
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
15709
- paths: import_mini63.z.optional(import_mini63.z.array(import_mini63.z.string()))
16120
+ paths: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
15710
16121
  })
15711
16122
  ),
15712
- cursor: import_mini63.z.optional(
15713
- import_mini63.z.looseObject({
15714
- alwaysApply: import_mini63.z.optional(import_mini63.z.boolean()),
15715
- description: import_mini63.z.optional(import_mini63.z.string()),
15716
- globs: import_mini63.z.optional(import_mini63.z.array(import_mini63.z.string()))
16123
+ cursor: import_mini64.z.optional(
16124
+ import_mini64.z.looseObject({
16125
+ alwaysApply: import_mini64.z.optional(import_mini64.z.boolean()),
16126
+ description: import_mini64.z.optional(import_mini64.z.string()),
16127
+ globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
15717
16128
  })
15718
16129
  ),
15719
- copilot: import_mini63.z.optional(
15720
- import_mini63.z.looseObject({
15721
- excludeAgent: import_mini63.z.optional(import_mini63.z.union([import_mini63.z.literal("code-review"), import_mini63.z.literal("coding-agent")]))
16130
+ copilot: import_mini64.z.optional(
16131
+ import_mini64.z.looseObject({
16132
+ excludeAgent: import_mini64.z.optional(import_mini64.z.union([import_mini64.z.literal("code-review"), import_mini64.z.literal("coding-agent")]))
15722
16133
  })
15723
16134
  ),
15724
- antigravity: import_mini63.z.optional(
15725
- import_mini63.z.looseObject({
15726
- trigger: import_mini63.z.optional(import_mini63.z.string()),
15727
- globs: import_mini63.z.optional(import_mini63.z.array(import_mini63.z.string()))
16135
+ antigravity: import_mini64.z.optional(
16136
+ import_mini64.z.looseObject({
16137
+ trigger: import_mini64.z.optional(import_mini64.z.string()),
16138
+ globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
15728
16139
  })
15729
16140
  )
15730
16141
  });
@@ -15735,7 +16146,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15735
16146
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
15736
16147
  if (!parseResult.success && rest.validate !== false) {
15737
16148
  throw new Error(
15738
- `Invalid frontmatter in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
16149
+ `Invalid frontmatter in ${(0, import_node_path112.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
15739
16150
  );
15740
16151
  }
15741
16152
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -15770,7 +16181,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15770
16181
  return {
15771
16182
  success: false,
15772
16183
  error: new Error(
15773
- `Invalid frontmatter in ${(0, import_node_path110.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16184
+ `Invalid frontmatter in ${(0, import_node_path112.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15774
16185
  )
15775
16186
  };
15776
16187
  }
@@ -15779,7 +16190,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15779
16190
  relativeFilePath,
15780
16191
  validate = true
15781
16192
  }) {
15782
- const filePath = (0, import_node_path110.join)(
16193
+ const filePath = (0, import_node_path112.join)(
15783
16194
  process.cwd(),
15784
16195
  this.getSettablePaths().recommended.relativeDirPath,
15785
16196
  relativeFilePath
@@ -15878,7 +16289,7 @@ var ToolRule = class extends ToolFile {
15878
16289
  rulesyncRule,
15879
16290
  validate = true,
15880
16291
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
15881
- nonRootPath = { relativeDirPath: (0, import_node_path111.join)(".agents", "memories") }
16292
+ nonRootPath = { relativeDirPath: (0, import_node_path113.join)(".agents", "memories") }
15882
16293
  }) {
15883
16294
  const params = this.buildToolRuleParamsDefault({
15884
16295
  baseDir,
@@ -15889,7 +16300,7 @@ var ToolRule = class extends ToolFile {
15889
16300
  });
15890
16301
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
15891
16302
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
15892
- params.relativeDirPath = (0, import_node_path111.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
16303
+ params.relativeDirPath = (0, import_node_path113.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
15893
16304
  params.relativeFilePath = "AGENTS.md";
15894
16305
  }
15895
16306
  return params;
@@ -15938,7 +16349,7 @@ var ToolRule = class extends ToolFile {
15938
16349
  }
15939
16350
  };
15940
16351
  function buildToolPath(toolDir, subDir, excludeToolDir) {
15941
- return excludeToolDir ? subDir : (0, import_node_path111.join)(toolDir, subDir);
16352
+ return excludeToolDir ? subDir : (0, import_node_path113.join)(toolDir, subDir);
15942
16353
  }
15943
16354
 
15944
16355
  // src/features/rules/agentsmd-rule.ts
@@ -15967,8 +16378,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15967
16378
  validate = true
15968
16379
  }) {
15969
16380
  const isRoot = relativeFilePath === "AGENTS.md";
15970
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path112.join)(".agents", "memories", relativeFilePath);
15971
- const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
16381
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path114.join)(".agents", "memories", relativeFilePath);
16382
+ const fileContent = await readFileContent((0, import_node_path114.join)(baseDir, relativePath));
15972
16383
  return new _AgentsMdRule({
15973
16384
  baseDir,
15974
16385
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -16023,21 +16434,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
16023
16434
  };
16024
16435
 
16025
16436
  // src/features/rules/antigravity-rule.ts
16026
- var import_node_path113 = require("path");
16027
- var import_mini64 = require("zod/mini");
16028
- var AntigravityRuleFrontmatterSchema = import_mini64.z.looseObject({
16029
- trigger: import_mini64.z.optional(
16030
- import_mini64.z.union([
16031
- import_mini64.z.literal("always_on"),
16032
- import_mini64.z.literal("glob"),
16033
- import_mini64.z.literal("manual"),
16034
- import_mini64.z.literal("model_decision"),
16035
- import_mini64.z.string()
16437
+ var import_node_path115 = require("path");
16438
+ var import_mini65 = require("zod/mini");
16439
+ var AntigravityRuleFrontmatterSchema = import_mini65.z.looseObject({
16440
+ trigger: import_mini65.z.optional(
16441
+ import_mini65.z.union([
16442
+ import_mini65.z.literal("always_on"),
16443
+ import_mini65.z.literal("glob"),
16444
+ import_mini65.z.literal("manual"),
16445
+ import_mini65.z.literal("model_decision"),
16446
+ import_mini65.z.string()
16036
16447
  // accepts any string for forward compatibility
16037
16448
  ])
16038
16449
  ),
16039
- globs: import_mini64.z.optional(import_mini64.z.string()),
16040
- description: import_mini64.z.optional(import_mini64.z.string())
16450
+ globs: import_mini65.z.optional(import_mini65.z.string()),
16451
+ description: import_mini65.z.optional(import_mini65.z.string())
16041
16452
  });
16042
16453
  function parseGlobsString(globs) {
16043
16454
  if (!globs) {
@@ -16182,7 +16593,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16182
16593
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
16183
16594
  if (!result.success) {
16184
16595
  throw new Error(
16185
- `Invalid frontmatter in ${(0, import_node_path113.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16596
+ `Invalid frontmatter in ${(0, import_node_path115.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16186
16597
  );
16187
16598
  }
16188
16599
  }
@@ -16206,7 +16617,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16206
16617
  relativeFilePath,
16207
16618
  validate = true
16208
16619
  }) {
16209
- const filePath = (0, import_node_path113.join)(
16620
+ const filePath = (0, import_node_path115.join)(
16210
16621
  baseDir,
16211
16622
  this.getSettablePaths().nonRoot.relativeDirPath,
16212
16623
  relativeFilePath
@@ -16346,7 +16757,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16346
16757
  };
16347
16758
 
16348
16759
  // src/features/rules/augmentcode-legacy-rule.ts
16349
- var import_node_path114 = require("path");
16760
+ var import_node_path116 = require("path");
16350
16761
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16351
16762
  toRulesyncRule() {
16352
16763
  const rulesyncFrontmatter = {
@@ -16406,8 +16817,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16406
16817
  }) {
16407
16818
  const settablePaths = this.getSettablePaths();
16408
16819
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
16409
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path114.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16410
- const fileContent = await readFileContent((0, import_node_path114.join)(baseDir, relativePath));
16820
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path116.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16821
+ const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
16411
16822
  return new _AugmentcodeLegacyRule({
16412
16823
  baseDir,
16413
16824
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -16436,7 +16847,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16436
16847
  };
16437
16848
 
16438
16849
  // src/features/rules/augmentcode-rule.ts
16439
- var import_node_path115 = require("path");
16850
+ var import_node_path117 = require("path");
16440
16851
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16441
16852
  toRulesyncRule() {
16442
16853
  return this.toRulesyncRuleDefault();
@@ -16467,7 +16878,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16467
16878
  relativeFilePath,
16468
16879
  validate = true
16469
16880
  }) {
16470
- const filePath = (0, import_node_path115.join)(
16881
+ const filePath = (0, import_node_path117.join)(
16471
16882
  baseDir,
16472
16883
  this.getSettablePaths().nonRoot.relativeDirPath,
16473
16884
  relativeFilePath
@@ -16507,7 +16918,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16507
16918
  };
16508
16919
 
16509
16920
  // src/features/rules/claudecode-legacy-rule.ts
16510
- var import_node_path116 = require("path");
16921
+ var import_node_path118 = require("path");
16511
16922
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16512
16923
  static getSettablePaths({
16513
16924
  global,
@@ -16549,7 +16960,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16549
16960
  if (isRoot) {
16550
16961
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16551
16962
  const fileContent2 = await readFileContent(
16552
- (0, import_node_path116.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
16963
+ (0, import_node_path118.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
16553
16964
  );
16554
16965
  return new _ClaudecodeLegacyRule({
16555
16966
  baseDir,
@@ -16563,8 +16974,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16563
16974
  if (!paths.nonRoot) {
16564
16975
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16565
16976
  }
16566
- const relativePath = (0, import_node_path116.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16567
- const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
16977
+ const relativePath = (0, import_node_path118.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16978
+ const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
16568
16979
  return new _ClaudecodeLegacyRule({
16569
16980
  baseDir,
16570
16981
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16623,10 +17034,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16623
17034
  };
16624
17035
 
16625
17036
  // src/features/rules/claudecode-rule.ts
16626
- var import_node_path117 = require("path");
16627
- var import_mini65 = require("zod/mini");
16628
- var ClaudecodeRuleFrontmatterSchema = import_mini65.z.object({
16629
- paths: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
17037
+ var import_node_path119 = require("path");
17038
+ var import_mini66 = require("zod/mini");
17039
+ var ClaudecodeRuleFrontmatterSchema = import_mini66.z.object({
17040
+ paths: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string()))
16630
17041
  });
16631
17042
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16632
17043
  frontmatter;
@@ -16664,7 +17075,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16664
17075
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
16665
17076
  if (!result.success) {
16666
17077
  throw new Error(
16667
- `Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17078
+ `Invalid frontmatter in ${(0, import_node_path119.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16668
17079
  );
16669
17080
  }
16670
17081
  }
@@ -16694,7 +17105,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16694
17105
  if (isRoot) {
16695
17106
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16696
17107
  const fileContent2 = await readFileContent(
16697
- (0, import_node_path117.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
17108
+ (0, import_node_path119.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
16698
17109
  );
16699
17110
  return new _ClaudecodeRule({
16700
17111
  baseDir,
@@ -16709,8 +17120,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16709
17120
  if (!paths.nonRoot) {
16710
17121
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16711
17122
  }
16712
- const relativePath = (0, import_node_path117.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16713
- const filePath = (0, import_node_path117.join)(baseDir, relativePath);
17123
+ const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17124
+ const filePath = (0, import_node_path119.join)(baseDir, relativePath);
16714
17125
  const fileContent = await readFileContent(filePath);
16715
17126
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
16716
17127
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -16821,7 +17232,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16821
17232
  return {
16822
17233
  success: false,
16823
17234
  error: new Error(
16824
- `Invalid frontmatter in ${(0, import_node_path117.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17235
+ `Invalid frontmatter in ${(0, import_node_path119.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16825
17236
  )
16826
17237
  };
16827
17238
  }
@@ -16841,10 +17252,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16841
17252
  };
16842
17253
 
16843
17254
  // src/features/rules/cline-rule.ts
16844
- var import_node_path118 = require("path");
16845
- var import_mini66 = require("zod/mini");
16846
- var ClineRuleFrontmatterSchema = import_mini66.z.object({
16847
- description: import_mini66.z.string()
17255
+ var import_node_path120 = require("path");
17256
+ var import_mini67 = require("zod/mini");
17257
+ var ClineRuleFrontmatterSchema = import_mini67.z.object({
17258
+ description: import_mini67.z.string()
16848
17259
  });
16849
17260
  var ClineRule = class _ClineRule extends ToolRule {
16850
17261
  static getSettablePaths(_options = {}) {
@@ -16887,7 +17298,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16887
17298
  validate = true
16888
17299
  }) {
16889
17300
  const fileContent = await readFileContent(
16890
- (0, import_node_path118.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17301
+ (0, import_node_path120.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16891
17302
  );
16892
17303
  return new _ClineRule({
16893
17304
  baseDir,
@@ -16913,7 +17324,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16913
17324
  };
16914
17325
 
16915
17326
  // src/features/rules/codexcli-rule.ts
16916
- var import_node_path119 = require("path");
17327
+ var import_node_path121 = require("path");
16917
17328
  var CodexcliRule = class _CodexcliRule extends ToolRule {
16918
17329
  static getSettablePaths({
16919
17330
  global,
@@ -16948,7 +17359,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16948
17359
  if (isRoot) {
16949
17360
  const relativePath2 = paths.root.relativeFilePath;
16950
17361
  const fileContent2 = await readFileContent(
16951
- (0, import_node_path119.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17362
+ (0, import_node_path121.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16952
17363
  );
16953
17364
  return new _CodexcliRule({
16954
17365
  baseDir,
@@ -16962,8 +17373,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16962
17373
  if (!paths.nonRoot) {
16963
17374
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16964
17375
  }
16965
- const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16966
- const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
17376
+ const relativePath = (0, import_node_path121.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17377
+ const fileContent = await readFileContent((0, import_node_path121.join)(baseDir, relativePath));
16967
17378
  return new _CodexcliRule({
16968
17379
  baseDir,
16969
17380
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17022,12 +17433,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
17022
17433
  };
17023
17434
 
17024
17435
  // src/features/rules/copilot-rule.ts
17025
- var import_node_path120 = require("path");
17026
- var import_mini67 = require("zod/mini");
17027
- var CopilotRuleFrontmatterSchema = import_mini67.z.object({
17028
- description: import_mini67.z.optional(import_mini67.z.string()),
17029
- applyTo: import_mini67.z.optional(import_mini67.z.string()),
17030
- excludeAgent: import_mini67.z.optional(import_mini67.z.union([import_mini67.z.literal("code-review"), import_mini67.z.literal("coding-agent")]))
17436
+ var import_node_path122 = require("path");
17437
+ var import_mini68 = require("zod/mini");
17438
+ var CopilotRuleFrontmatterSchema = import_mini68.z.object({
17439
+ description: import_mini68.z.optional(import_mini68.z.string()),
17440
+ applyTo: import_mini68.z.optional(import_mini68.z.string()),
17441
+ excludeAgent: import_mini68.z.optional(import_mini68.z.union([import_mini68.z.literal("code-review"), import_mini68.z.literal("coding-agent")]))
17031
17442
  });
17032
17443
  var CopilotRule = class _CopilotRule extends ToolRule {
17033
17444
  frontmatter;
@@ -17059,7 +17470,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17059
17470
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
17060
17471
  if (!result.success) {
17061
17472
  throw new Error(
17062
- `Invalid frontmatter in ${(0, import_node_path120.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17473
+ `Invalid frontmatter in ${(0, import_node_path122.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17063
17474
  );
17064
17475
  }
17065
17476
  }
@@ -17149,8 +17560,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17149
17560
  const paths = this.getSettablePaths({ global });
17150
17561
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
17151
17562
  if (isRoot) {
17152
- const relativePath2 = (0, import_node_path120.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
17153
- const filePath2 = (0, import_node_path120.join)(baseDir, relativePath2);
17563
+ const relativePath2 = (0, import_node_path122.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
17564
+ const filePath2 = (0, import_node_path122.join)(baseDir, relativePath2);
17154
17565
  const fileContent2 = await readFileContent(filePath2);
17155
17566
  return new _CopilotRule({
17156
17567
  baseDir,
@@ -17165,8 +17576,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17165
17576
  if (!paths.nonRoot) {
17166
17577
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17167
17578
  }
17168
- const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17169
- const filePath = (0, import_node_path120.join)(baseDir, relativePath);
17579
+ const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17580
+ const filePath = (0, import_node_path122.join)(baseDir, relativePath);
17170
17581
  const fileContent = await readFileContent(filePath);
17171
17582
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
17172
17583
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -17212,7 +17623,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17212
17623
  return {
17213
17624
  success: false,
17214
17625
  error: new Error(
17215
- `Invalid frontmatter in ${(0, import_node_path120.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17626
+ `Invalid frontmatter in ${(0, import_node_path122.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17216
17627
  )
17217
17628
  };
17218
17629
  }
@@ -17268,12 +17679,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
17268
17679
  };
17269
17680
 
17270
17681
  // src/features/rules/cursor-rule.ts
17271
- var import_node_path121 = require("path");
17272
- var import_mini68 = require("zod/mini");
17273
- var CursorRuleFrontmatterSchema = import_mini68.z.object({
17274
- description: import_mini68.z.optional(import_mini68.z.string()),
17275
- globs: import_mini68.z.optional(import_mini68.z.string()),
17276
- alwaysApply: import_mini68.z.optional(import_mini68.z.boolean())
17682
+ var import_node_path123 = require("path");
17683
+ var import_mini69 = require("zod/mini");
17684
+ var CursorRuleFrontmatterSchema = import_mini69.z.object({
17685
+ description: import_mini69.z.optional(import_mini69.z.string()),
17686
+ globs: import_mini69.z.optional(import_mini69.z.string()),
17687
+ alwaysApply: import_mini69.z.optional(import_mini69.z.boolean())
17277
17688
  });
17278
17689
  var CursorRule = class _CursorRule extends ToolRule {
17279
17690
  frontmatter;
@@ -17290,7 +17701,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17290
17701
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17291
17702
  if (!result.success) {
17292
17703
  throw new Error(
17293
- `Invalid frontmatter in ${(0, import_node_path121.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17704
+ `Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17294
17705
  );
17295
17706
  }
17296
17707
  }
@@ -17406,7 +17817,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17406
17817
  relativeFilePath,
17407
17818
  validate = true
17408
17819
  }) {
17409
- const filePath = (0, import_node_path121.join)(
17820
+ const filePath = (0, import_node_path123.join)(
17410
17821
  baseDir,
17411
17822
  this.getSettablePaths().nonRoot.relativeDirPath,
17412
17823
  relativeFilePath
@@ -17416,7 +17827,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17416
17827
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17417
17828
  if (!result.success) {
17418
17829
  throw new Error(
17419
- `Invalid frontmatter in ${(0, import_node_path121.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17830
+ `Invalid frontmatter in ${(0, import_node_path123.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17420
17831
  );
17421
17832
  }
17422
17833
  return new _CursorRule({
@@ -17453,7 +17864,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17453
17864
  return {
17454
17865
  success: false,
17455
17866
  error: new Error(
17456
- `Invalid frontmatter in ${(0, import_node_path121.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17867
+ `Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17457
17868
  )
17458
17869
  };
17459
17870
  }
@@ -17473,7 +17884,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17473
17884
  };
17474
17885
 
17475
17886
  // src/features/rules/deepagents-rule.ts
17476
- var import_node_path122 = require("path");
17887
+ var import_node_path124 = require("path");
17477
17888
  var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17478
17889
  constructor({ fileContent, root, ...rest }) {
17479
17890
  super({
@@ -17500,8 +17911,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17500
17911
  }) {
17501
17912
  const settablePaths = this.getSettablePaths();
17502
17913
  const isRoot = relativeFilePath === "AGENTS.md";
17503
- const relativePath = isRoot ? (0, import_node_path122.join)(".deepagents", "AGENTS.md") : (0, import_node_path122.join)(".deepagents", "memories", relativeFilePath);
17504
- const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
17914
+ const relativePath = isRoot ? (0, import_node_path124.join)(".deepagents", "AGENTS.md") : (0, import_node_path124.join)(".deepagents", "memories", relativeFilePath);
17915
+ const fileContent = await readFileContent((0, import_node_path124.join)(baseDir, relativePath));
17505
17916
  return new _DeepagentsRule({
17506
17917
  baseDir,
17507
17918
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17556,7 +17967,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17556
17967
  };
17557
17968
 
17558
17969
  // src/features/rules/factorydroid-rule.ts
17559
- var import_node_path123 = require("path");
17970
+ var import_node_path125 = require("path");
17560
17971
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17561
17972
  constructor({ fileContent, root, ...rest }) {
17562
17973
  super({
@@ -17596,8 +18007,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17596
18007
  const paths = this.getSettablePaths({ global });
17597
18008
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
17598
18009
  if (isRoot) {
17599
- const relativePath2 = (0, import_node_path123.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
17600
- const fileContent2 = await readFileContent((0, import_node_path123.join)(baseDir, relativePath2));
18010
+ const relativePath2 = (0, import_node_path125.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
18011
+ const fileContent2 = await readFileContent((0, import_node_path125.join)(baseDir, relativePath2));
17601
18012
  return new _FactorydroidRule({
17602
18013
  baseDir,
17603
18014
  relativeDirPath: paths.root.relativeDirPath,
@@ -17610,8 +18021,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17610
18021
  if (!paths.nonRoot) {
17611
18022
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17612
18023
  }
17613
- const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17614
- const fileContent = await readFileContent((0, import_node_path123.join)(baseDir, relativePath));
18024
+ const relativePath = (0, import_node_path125.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18025
+ const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
17615
18026
  return new _FactorydroidRule({
17616
18027
  baseDir,
17617
18028
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17670,7 +18081,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17670
18081
  };
17671
18082
 
17672
18083
  // src/features/rules/geminicli-rule.ts
17673
- var import_node_path124 = require("path");
18084
+ var import_node_path126 = require("path");
17674
18085
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17675
18086
  static getSettablePaths({
17676
18087
  global,
@@ -17705,7 +18116,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17705
18116
  if (isRoot) {
17706
18117
  const relativePath2 = paths.root.relativeFilePath;
17707
18118
  const fileContent2 = await readFileContent(
17708
- (0, import_node_path124.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18119
+ (0, import_node_path126.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17709
18120
  );
17710
18121
  return new _GeminiCliRule({
17711
18122
  baseDir,
@@ -17719,8 +18130,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17719
18130
  if (!paths.nonRoot) {
17720
18131
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17721
18132
  }
17722
- const relativePath = (0, import_node_path124.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17723
- const fileContent = await readFileContent((0, import_node_path124.join)(baseDir, relativePath));
18133
+ const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18134
+ const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
17724
18135
  return new _GeminiCliRule({
17725
18136
  baseDir,
17726
18137
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17779,7 +18190,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17779
18190
  };
17780
18191
 
17781
18192
  // src/features/rules/goose-rule.ts
17782
- var import_node_path125 = require("path");
18193
+ var import_node_path127 = require("path");
17783
18194
  var GooseRule = class _GooseRule extends ToolRule {
17784
18195
  static getSettablePaths({
17785
18196
  global,
@@ -17814,7 +18225,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17814
18225
  if (isRoot) {
17815
18226
  const relativePath2 = paths.root.relativeFilePath;
17816
18227
  const fileContent2 = await readFileContent(
17817
- (0, import_node_path125.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18228
+ (0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
17818
18229
  );
17819
18230
  return new _GooseRule({
17820
18231
  baseDir,
@@ -17828,8 +18239,8 @@ var GooseRule = class _GooseRule extends ToolRule {
17828
18239
  if (!paths.nonRoot) {
17829
18240
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17830
18241
  }
17831
- const relativePath = (0, import_node_path125.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
17832
- const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
18242
+ const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18243
+ const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
17833
18244
  return new _GooseRule({
17834
18245
  baseDir,
17835
18246
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17888,7 +18299,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17888
18299
  };
17889
18300
 
17890
18301
  // src/features/rules/junie-rule.ts
17891
- var import_node_path126 = require("path");
18302
+ var import_node_path128 = require("path");
17892
18303
  var JunieRule = class _JunieRule extends ToolRule {
17893
18304
  static getSettablePaths(_options = {}) {
17894
18305
  return {
@@ -17917,8 +18328,8 @@ var JunieRule = class _JunieRule extends ToolRule {
17917
18328
  }) {
17918
18329
  const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
17919
18330
  const settablePaths = this.getSettablePaths();
17920
- const relativePath = isRoot ? (0, import_node_path126.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path126.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17921
- const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
18331
+ const relativePath = isRoot ? (0, import_node_path128.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path128.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
18332
+ const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
17922
18333
  return new _JunieRule({
17923
18334
  baseDir,
17924
18335
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17973,7 +18384,7 @@ var JunieRule = class _JunieRule extends ToolRule {
17973
18384
  };
17974
18385
 
17975
18386
  // src/features/rules/kilo-rule.ts
17976
- var import_node_path127 = require("path");
18387
+ var import_node_path129 = require("path");
17977
18388
  var KiloRule = class _KiloRule extends ToolRule {
17978
18389
  static getSettablePaths({
17979
18390
  global,
@@ -18008,7 +18419,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18008
18419
  if (isRoot) {
18009
18420
  const relativePath2 = paths.root.relativeFilePath;
18010
18421
  const fileContent2 = await readFileContent(
18011
- (0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18422
+ (0, import_node_path129.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18012
18423
  );
18013
18424
  return new _KiloRule({
18014
18425
  baseDir,
@@ -18022,8 +18433,8 @@ var KiloRule = class _KiloRule extends ToolRule {
18022
18433
  if (!paths.nonRoot) {
18023
18434
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18024
18435
  }
18025
- const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18026
- const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
18436
+ const relativePath = (0, import_node_path129.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18437
+ const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
18027
18438
  return new _KiloRule({
18028
18439
  baseDir,
18029
18440
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18082,7 +18493,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18082
18493
  };
18083
18494
 
18084
18495
  // src/features/rules/kiro-rule.ts
18085
- var import_node_path128 = require("path");
18496
+ var import_node_path130 = require("path");
18086
18497
  var KiroRule = class _KiroRule extends ToolRule {
18087
18498
  static getSettablePaths(_options = {}) {
18088
18499
  return {
@@ -18097,7 +18508,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18097
18508
  validate = true
18098
18509
  }) {
18099
18510
  const fileContent = await readFileContent(
18100
- (0, import_node_path128.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18511
+ (0, import_node_path130.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18101
18512
  );
18102
18513
  return new _KiroRule({
18103
18514
  baseDir,
@@ -18151,7 +18562,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18151
18562
  };
18152
18563
 
18153
18564
  // src/features/rules/opencode-rule.ts
18154
- var import_node_path129 = require("path");
18565
+ var import_node_path131 = require("path");
18155
18566
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18156
18567
  static getSettablePaths({
18157
18568
  global,
@@ -18186,7 +18597,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18186
18597
  if (isRoot) {
18187
18598
  const relativePath2 = paths.root.relativeFilePath;
18188
18599
  const fileContent2 = await readFileContent(
18189
- (0, import_node_path129.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18600
+ (0, import_node_path131.join)(baseDir, paths.root.relativeDirPath, relativePath2)
18190
18601
  );
18191
18602
  return new _OpenCodeRule({
18192
18603
  baseDir,
@@ -18200,8 +18611,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18200
18611
  if (!paths.nonRoot) {
18201
18612
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18202
18613
  }
18203
- const relativePath = (0, import_node_path129.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18204
- const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
18614
+ const relativePath = (0, import_node_path131.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
18615
+ const fileContent = await readFileContent((0, import_node_path131.join)(baseDir, relativePath));
18205
18616
  return new _OpenCodeRule({
18206
18617
  baseDir,
18207
18618
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18260,7 +18671,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18260
18671
  };
18261
18672
 
18262
18673
  // src/features/rules/qwencode-rule.ts
18263
- var import_node_path130 = require("path");
18674
+ var import_node_path132 = require("path");
18264
18675
  var QwencodeRule = class _QwencodeRule extends ToolRule {
18265
18676
  static getSettablePaths(_options = {}) {
18266
18677
  return {
@@ -18279,8 +18690,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18279
18690
  validate = true
18280
18691
  }) {
18281
18692
  const isRoot = relativeFilePath === "QWEN.md";
18282
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path130.join)(".qwen", "memories", relativeFilePath);
18283
- const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
18693
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path132.join)(".qwen", "memories", relativeFilePath);
18694
+ const fileContent = await readFileContent((0, import_node_path132.join)(baseDir, relativePath));
18284
18695
  return new _QwencodeRule({
18285
18696
  baseDir,
18286
18697
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -18332,7 +18743,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18332
18743
  };
18333
18744
 
18334
18745
  // src/features/rules/replit-rule.ts
18335
- var import_node_path131 = require("path");
18746
+ var import_node_path133 = require("path");
18336
18747
  var ReplitRule = class _ReplitRule extends ToolRule {
18337
18748
  static getSettablePaths(_options = {}) {
18338
18749
  return {
@@ -18354,7 +18765,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18354
18765
  }
18355
18766
  const relativePath = paths.root.relativeFilePath;
18356
18767
  const fileContent = await readFileContent(
18357
- (0, import_node_path131.join)(baseDir, paths.root.relativeDirPath, relativePath)
18768
+ (0, import_node_path133.join)(baseDir, paths.root.relativeDirPath, relativePath)
18358
18769
  );
18359
18770
  return new _ReplitRule({
18360
18771
  baseDir,
@@ -18420,7 +18831,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18420
18831
  };
18421
18832
 
18422
18833
  // src/features/rules/roo-rule.ts
18423
- var import_node_path132 = require("path");
18834
+ var import_node_path134 = require("path");
18424
18835
  var RooRule = class _RooRule extends ToolRule {
18425
18836
  static getSettablePaths(_options = {}) {
18426
18837
  return {
@@ -18435,7 +18846,7 @@ var RooRule = class _RooRule extends ToolRule {
18435
18846
  validate = true
18436
18847
  }) {
18437
18848
  const fileContent = await readFileContent(
18438
- (0, import_node_path132.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18849
+ (0, import_node_path134.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18439
18850
  );
18440
18851
  return new _RooRule({
18441
18852
  baseDir,
@@ -18504,7 +18915,7 @@ var RooRule = class _RooRule extends ToolRule {
18504
18915
  };
18505
18916
 
18506
18917
  // src/features/rules/rovodev-rule.ts
18507
- var import_node_path133 = require("path");
18918
+ var import_node_path135 = require("path");
18508
18919
  var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
18509
18920
  var RovodevRule = class _RovodevRule extends ToolRule {
18510
18921
  /**
@@ -18548,7 +18959,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18548
18959
  root: rovodevAgents,
18549
18960
  alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
18550
18961
  nonRoot: {
18551
- relativeDirPath: (0, import_node_path133.join)(".rovodev", ".rulesync", "modular-rules")
18962
+ relativeDirPath: (0, import_node_path135.join)(".rovodev", ".rulesync", "modular-rules")
18552
18963
  }
18553
18964
  };
18554
18965
  }
@@ -18587,10 +18998,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18587
18998
  }) {
18588
18999
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
18589
19000
  throw new Error(
18590
- `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path133.join)(relativeDirPath, relativeFilePath)}`
19001
+ `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
18591
19002
  );
18592
19003
  }
18593
- const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativeDirPath, relativeFilePath));
19004
+ const fileContent = await readFileContent((0, import_node_path135.join)(baseDir, relativeDirPath, relativeFilePath));
18594
19005
  return new _RovodevRule({
18595
19006
  baseDir,
18596
19007
  relativeDirPath,
@@ -18610,10 +19021,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18610
19021
  paths
18611
19022
  }) {
18612
19023
  const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
18613
- const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path133.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path133.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
19024
+ const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path135.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path135.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
18614
19025
  if (relativeFilePath !== "AGENTS.md") {
18615
19026
  throw new Error(
18616
- `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path133.join)(relativeDirPath, relativeFilePath)}`
19027
+ `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
18617
19028
  );
18618
19029
  }
18619
19030
  const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
@@ -18621,10 +19032,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18621
19032
  );
18622
19033
  if (!allowed) {
18623
19034
  throw new Error(
18624
- `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path133.join)(relativeDirPath, relativeFilePath)}`
19035
+ `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
18625
19036
  );
18626
19037
  }
18627
- const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativeDirPath, relativeFilePath));
19038
+ const fileContent = await readFileContent((0, import_node_path135.join)(baseDir, relativeDirPath, relativeFilePath));
18628
19039
  return new _RovodevRule({
18629
19040
  baseDir,
18630
19041
  relativeDirPath,
@@ -18738,7 +19149,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18738
19149
  };
18739
19150
 
18740
19151
  // src/features/rules/warp-rule.ts
18741
- var import_node_path134 = require("path");
19152
+ var import_node_path136 = require("path");
18742
19153
  var WarpRule = class _WarpRule extends ToolRule {
18743
19154
  constructor({ fileContent, root, ...rest }) {
18744
19155
  super({
@@ -18764,8 +19175,8 @@ var WarpRule = class _WarpRule extends ToolRule {
18764
19175
  validate = true
18765
19176
  }) {
18766
19177
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
18767
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path134.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
18768
- const fileContent = await readFileContent((0, import_node_path134.join)(baseDir, relativePath));
19178
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path136.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
19179
+ const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativePath));
18769
19180
  return new _WarpRule({
18770
19181
  baseDir,
18771
19182
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -18820,7 +19231,7 @@ var WarpRule = class _WarpRule extends ToolRule {
18820
19231
  };
18821
19232
 
18822
19233
  // src/features/rules/windsurf-rule.ts
18823
- var import_node_path135 = require("path");
19234
+ var import_node_path137 = require("path");
18824
19235
  var WindsurfRule = class _WindsurfRule extends ToolRule {
18825
19236
  static getSettablePaths(_options = {}) {
18826
19237
  return {
@@ -18835,7 +19246,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18835
19246
  validate = true
18836
19247
  }) {
18837
19248
  const fileContent = await readFileContent(
18838
- (0, import_node_path135.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
19249
+ (0, import_node_path137.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18839
19250
  );
18840
19251
  return new _WindsurfRule({
18841
19252
  baseDir,
@@ -18850,14 +19261,21 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18850
19261
  rulesyncRule,
18851
19262
  validate = true
18852
19263
  }) {
18853
- return new _WindsurfRule(
18854
- this.buildToolRuleParamsDefault({
18855
- baseDir,
18856
- rulesyncRule,
18857
- validate,
18858
- nonRootPath: this.getSettablePaths().nonRoot
18859
- })
18860
- );
19264
+ const toolRuleParams = this.buildToolRuleParamsDefault({
19265
+ baseDir,
19266
+ rulesyncRule,
19267
+ validate,
19268
+ nonRootPath: this.getSettablePaths().nonRoot
19269
+ });
19270
+ const windsurfFrontmatter = this.buildWindsurfFrontmatter({
19271
+ relativeFilePath: rulesyncRule.getRelativeFilePath(),
19272
+ description: rulesyncRule.getFrontmatter().description,
19273
+ globs: rulesyncRule.getFrontmatter().globs
19274
+ });
19275
+ return new _WindsurfRule({
19276
+ ...toolRuleParams,
19277
+ fileContent: stringifyFrontmatter(rulesyncRule.getBody(), windsurfFrontmatter)
19278
+ });
18861
19279
  }
18862
19280
  toRulesyncRule() {
18863
19281
  return this.toRulesyncRuleDefault();
@@ -18884,6 +19302,18 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18884
19302
  toolTarget: "windsurf"
18885
19303
  });
18886
19304
  }
19305
+ static buildWindsurfFrontmatter({
19306
+ relativeFilePath,
19307
+ description,
19308
+ globs
19309
+ }) {
19310
+ const hasSpecificGlobs = Boolean(globs && globs.length > 0 && !globs.includes("**/*"));
19311
+ return {
19312
+ title: description ?? relativeFilePath.replace(/\.md$/, ""),
19313
+ trigger: hasSpecificGlobs ? "glob" : "always_on",
19314
+ ...hasSpecificGlobs && { globs }
19315
+ };
19316
+ }
18887
19317
  };
18888
19318
 
18889
19319
  // src/features/rules/rules-processor.ts
@@ -18914,8 +19344,44 @@ var rulesProcessorToolTargets = [
18914
19344
  "warp",
18915
19345
  "windsurf"
18916
19346
  ];
18917
- var RulesProcessorToolTargetSchema = import_mini69.z.enum(rulesProcessorToolTargets);
18918
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path136.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19347
+ var RulesProcessorToolTargetSchema = import_mini70.z.enum(rulesProcessorToolTargets);
19348
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path138.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19349
+ var RulesFeatureOptionsSchema = import_mini70.z.looseObject({
19350
+ ruleDiscoveryMode: import_mini70.z.optional(import_mini70.z.enum(["none", "explicit"])),
19351
+ includeLocalRoot: import_mini70.z.optional(import_mini70.z.boolean())
19352
+ });
19353
+ var resolveRuleDiscoveryMode = ({
19354
+ defaultMode,
19355
+ options
19356
+ }) => {
19357
+ if (defaultMode === "claudecode-legacy") {
19358
+ return defaultMode;
19359
+ }
19360
+ if (!options) return defaultMode;
19361
+ const parsed = RulesFeatureOptionsSchema.safeParse(options);
19362
+ if (!parsed.success) {
19363
+ throw new Error(
19364
+ `Invalid options for rules feature: ${parsed.error.message}. \`ruleDiscoveryMode\` must be either "none" or "explicit".`
19365
+ );
19366
+ }
19367
+ if (!parsed.data.ruleDiscoveryMode) {
19368
+ return defaultMode;
19369
+ }
19370
+ return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
19371
+ };
19372
+ var IncludeLocalRootSchema = import_mini70.z.looseObject({
19373
+ includeLocalRoot: import_mini70.z.optional(import_mini70.z.boolean())
19374
+ });
19375
+ var resolveIncludeLocalRoot = (options) => {
19376
+ if (!options) return true;
19377
+ const parsed = IncludeLocalRootSchema.safeParse(options);
19378
+ if (!parsed.success) {
19379
+ throw new Error(
19380
+ `Invalid options for rules feature: ${parsed.error.message}. \`includeLocalRoot\` must be a boolean.`
19381
+ );
19382
+ }
19383
+ return parsed.data.includeLocalRoot ?? true;
19384
+ };
18919
19385
  var toolRuleFactories = /* @__PURE__ */ new Map([
18920
19386
  [
18921
19387
  "agentsmd",
@@ -19230,6 +19696,7 @@ var RulesProcessor = class extends FeatureProcessor {
19230
19696
  global;
19231
19697
  getFactory;
19232
19698
  skills;
19699
+ featureOptions;
19233
19700
  constructor({
19234
19701
  baseDir = process.cwd(),
19235
19702
  toolTarget,
@@ -19239,6 +19706,7 @@ var RulesProcessor = class extends FeatureProcessor {
19239
19706
  global = false,
19240
19707
  getFactory = defaultGetFactory6,
19241
19708
  skills,
19709
+ featureOptions,
19242
19710
  dryRun = false,
19243
19711
  logger
19244
19712
  }) {
@@ -19256,6 +19724,7 @@ var RulesProcessor = class extends FeatureProcessor {
19256
19724
  this.simulateSkills = simulateSkills;
19257
19725
  this.getFactory = getFactory;
19258
19726
  this.skills = skills;
19727
+ this.featureOptions = featureOptions;
19259
19728
  }
19260
19729
  async convertRulesyncFilesToToolFiles(rulesyncFiles) {
19261
19730
  const rulesyncRules = rulesyncFiles.filter(
@@ -19276,7 +19745,8 @@ var RulesProcessor = class extends FeatureProcessor {
19276
19745
  global: this.global
19277
19746
  });
19278
19747
  }).filter((rule) => rule !== null);
19279
- if (localRootRules.length > 0 && !this.global) {
19748
+ const includeLocalRoot = resolveIncludeLocalRoot(this.featureOptions);
19749
+ if (localRootRules.length > 0 && !this.global && includeLocalRoot) {
19280
19750
  const localRootRule = localRootRules[0];
19281
19751
  if (localRootRule && factory.class.isTargetedByRulesyncRule(localRootRule)) {
19282
19752
  this.handleLocalRootRule(toolRules, localRootRule, factory);
@@ -19343,7 +19813,7 @@ var RulesProcessor = class extends FeatureProcessor {
19343
19813
  }).relativeDirPath;
19344
19814
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
19345
19815
  const frontmatter = skill.getFrontmatter();
19346
- const relativePath = (0, import_node_path136.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19816
+ const relativePath = (0, import_node_path138.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19347
19817
  return {
19348
19818
  name: frontmatter.name,
19349
19819
  description: frontmatter.description,
@@ -19413,7 +19883,11 @@ var RulesProcessor = class extends FeatureProcessor {
19413
19883
  * Generate reference section based on meta configuration.
19414
19884
  */
19415
19885
  generateReferenceSectionFromMeta(meta, toolRules) {
19416
- switch (meta.ruleDiscoveryMode) {
19886
+ const mode = resolveRuleDiscoveryMode({
19887
+ defaultMode: meta.ruleDiscoveryMode,
19888
+ options: this.featureOptions
19889
+ });
19890
+ switch (mode) {
19417
19891
  case "toon":
19418
19892
  return this.generateToonReferencesSection(toolRules);
19419
19893
  case "claudecode-legacy":
@@ -19468,12 +19942,12 @@ var RulesProcessor = class extends FeatureProcessor {
19468
19942
  * Load and parse rulesync rule files from .rulesync/rules/ directory
19469
19943
  */
19470
19944
  async loadRulesyncFiles() {
19471
- const rulesyncBaseDir = (0, import_node_path136.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19472
- const files = await findFilesByGlobs((0, import_node_path136.join)(rulesyncBaseDir, "**", "*.md"));
19945
+ const rulesyncBaseDir = (0, import_node_path138.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19946
+ const files = await findFilesByGlobs((0, import_node_path138.join)(rulesyncBaseDir, "**", "*.md"));
19473
19947
  this.logger.debug(`Found ${files.length} rulesync files`);
19474
19948
  const rulesyncRules = await Promise.all(
19475
19949
  files.map((file) => {
19476
- const relativeFilePath = (0, import_node_path136.relative)(rulesyncBaseDir, file);
19950
+ const relativeFilePath = (0, import_node_path138.relative)(rulesyncBaseDir, file);
19477
19951
  checkPathTraversal({
19478
19952
  relativePath: relativeFilePath,
19479
19953
  intendedRootDir: rulesyncBaseDir
@@ -19548,7 +20022,7 @@ var RulesProcessor = class extends FeatureProcessor {
19548
20022
  global: this.global
19549
20023
  });
19550
20024
  const resolveRelativeDirPath = (filePath) => {
19551
- const dirName = (0, import_node_path136.dirname)((0, import_node_path136.relative)(this.baseDir, filePath));
20025
+ const dirName = (0, import_node_path138.dirname)((0, import_node_path138.relative)(this.baseDir, filePath));
19552
20026
  return dirName === "" ? "." : dirName;
19553
20027
  };
19554
20028
  const buildDeletionRulesFromPaths = (filePaths, opts) => {
@@ -19556,7 +20030,7 @@ var RulesProcessor = class extends FeatureProcessor {
19556
20030
  const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
19557
20031
  return filePaths.map((filePath) => {
19558
20032
  const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
19559
- const relativeFilePath = isNonRoot ? (0, import_node_path136.relative)(effectiveBaseDir, filePath) : (0, import_node_path136.basename)(filePath);
20033
+ const relativeFilePath = isNonRoot ? (0, import_node_path138.relative)(effectiveBaseDir, filePath) : (0, import_node_path138.basename)(filePath);
19560
20034
  checkPathTraversal({
19561
20035
  relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
19562
20036
  intendedRootDir: effectiveBaseDir
@@ -19584,13 +20058,13 @@ var RulesProcessor = class extends FeatureProcessor {
19584
20058
  return [];
19585
20059
  }
19586
20060
  const uniqueRootFilePaths = await findFilesWithFallback(
19587
- (0, import_node_path136.join)(
20061
+ (0, import_node_path138.join)(
19588
20062
  this.baseDir,
19589
20063
  settablePaths.root.relativeDirPath ?? ".",
19590
20064
  settablePaths.root.relativeFilePath
19591
20065
  ),
19592
20066
  settablePaths.alternativeRoots,
19593
- (alt) => (0, import_node_path136.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
20067
+ (alt) => (0, import_node_path138.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
19594
20068
  );
19595
20069
  if (forDeletion) {
19596
20070
  return buildDeletionRulesFromPaths(uniqueRootFilePaths);
@@ -19604,7 +20078,7 @@ var RulesProcessor = class extends FeatureProcessor {
19604
20078
  });
19605
20079
  return factory.class.fromFile({
19606
20080
  baseDir: this.baseDir,
19607
- relativeFilePath: (0, import_node_path136.basename)(filePath),
20081
+ relativeFilePath: (0, import_node_path138.basename)(filePath),
19608
20082
  relativeDirPath,
19609
20083
  global: this.global
19610
20084
  });
@@ -19621,7 +20095,7 @@ var RulesProcessor = class extends FeatureProcessor {
19621
20095
  return [];
19622
20096
  }
19623
20097
  const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
19624
- (0, import_node_path136.join)(this.baseDir, "AGENTS.local.md")
20098
+ (0, import_node_path138.join)(this.baseDir, "AGENTS.local.md")
19625
20099
  );
19626
20100
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
19627
20101
  }
@@ -19632,9 +20106,9 @@ var RulesProcessor = class extends FeatureProcessor {
19632
20106
  return [];
19633
20107
  }
19634
20108
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
19635
- (0, import_node_path136.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
20109
+ (0, import_node_path138.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
19636
20110
  settablePaths.alternativeRoots,
19637
- (alt) => (0, import_node_path136.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
20111
+ (alt) => (0, import_node_path138.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
19638
20112
  );
19639
20113
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
19640
20114
  })();
@@ -19645,20 +20119,20 @@ var RulesProcessor = class extends FeatureProcessor {
19645
20119
  if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
19646
20120
  return [];
19647
20121
  }
19648
- const primaryPaths = await findFilesByGlobs((0, import_node_path136.join)(this.baseDir, ".rovodev", "AGENTS.md"));
20122
+ const primaryPaths = await findFilesByGlobs((0, import_node_path138.join)(this.baseDir, ".rovodev", "AGENTS.md"));
19649
20123
  if (primaryPaths.length === 0) {
19650
20124
  return [];
19651
20125
  }
19652
- const mirrorPaths = await findFilesByGlobs((0, import_node_path136.join)(this.baseDir, "AGENTS.md"));
20126
+ const mirrorPaths = await findFilesByGlobs((0, import_node_path138.join)(this.baseDir, "AGENTS.md"));
19653
20127
  return buildDeletionRulesFromPaths(mirrorPaths);
19654
20128
  })();
19655
20129
  const nonRootToolRules = await (async () => {
19656
20130
  if (!settablePaths.nonRoot) {
19657
20131
  return [];
19658
20132
  }
19659
- const nonRootBaseDir = (0, import_node_path136.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
20133
+ const nonRootBaseDir = (0, import_node_path138.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
19660
20134
  const nonRootFilePaths = await findFilesByGlobs(
19661
- (0, import_node_path136.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
20135
+ (0, import_node_path138.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
19662
20136
  );
19663
20137
  if (forDeletion) {
19664
20138
  return buildDeletionRulesFromPaths(nonRootFilePaths, {
@@ -19668,18 +20142,18 @@ var RulesProcessor = class extends FeatureProcessor {
19668
20142
  }
19669
20143
  const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
19670
20144
  const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
19671
- const relativeFilePath = (0, import_node_path136.relative)(nonRootBaseDir, filePath);
20145
+ const relativeFilePath = (0, import_node_path138.relative)(nonRootBaseDir, filePath);
19672
20146
  const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
19673
20147
  if (!ok) {
19674
20148
  this.logger.warn(
19675
- `Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path136.join)(modularRootRelative, relativeFilePath)}`
20149
+ `Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path138.join)(modularRootRelative, relativeFilePath)}`
19676
20150
  );
19677
20151
  }
19678
20152
  return ok;
19679
20153
  }) : nonRootFilePaths;
19680
20154
  return await Promise.all(
19681
20155
  nonRootPathsForImport.map((filePath) => {
19682
- const relativeFilePath = (0, import_node_path136.relative)(nonRootBaseDir, filePath);
20156
+ const relativeFilePath = (0, import_node_path138.relative)(nonRootBaseDir, filePath);
19683
20157
  checkPathTraversal({
19684
20158
  relativePath: relativeFilePath,
19685
20159
  intendedRootDir: nonRootBaseDir
@@ -19798,14 +20272,14 @@ s/<command> [arguments]
19798
20272
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
19799
20273
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
19800
20274
 
19801
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path136.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
20275
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path138.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
19802
20276
  const subagentsSection = subagents ? `## Simulated Subagents
19803
20277
 
19804
20278
  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.
19805
20279
 
19806
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path136.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
20280
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path138.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
19807
20281
 
19808
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path136.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
20282
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path138.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
19809
20283
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
19810
20284
  const result = [
19811
20285
  overview,
@@ -19905,7 +20379,7 @@ function warnUnsupportedTargets(params) {
19905
20379
  }
19906
20380
  }
19907
20381
  async function checkRulesyncDirExists(params) {
19908
- return fileExists((0, import_node_path137.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
20382
+ return fileExists((0, import_node_path139.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19909
20383
  }
19910
20384
  async function generate(params) {
19911
20385
  const { config, logger } = params;
@@ -19960,6 +20434,7 @@ async function generateRulesCore(params) {
19960
20434
  simulateSubagents: config.getSimulateSubagents(),
19961
20435
  simulateSkills: config.getSimulateSkills(),
19962
20436
  skills,
20437
+ featureOptions: config.getFeatureOptions(toolTarget, "rules"),
19963
20438
  dryRun: config.isPreviewMode(),
19964
20439
  logger
19965
20440
  });