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.
@@ -348,6 +348,7 @@ var ConfigParamsSchema = z3.object({
348
348
  simulateCommands: optional(z3.boolean()),
349
349
  simulateSubagents: optional(z3.boolean()),
350
350
  simulateSkills: optional(z3.boolean()),
351
+ gitignoreTargetsOnly: optional(z3.boolean()),
351
352
  dryRun: optional(z3.boolean()),
352
353
  check: optional(z3.boolean()),
353
354
  // Declarative skill sources
@@ -375,6 +376,7 @@ var Config = class _Config {
375
376
  simulateCommands;
376
377
  simulateSubagents;
377
378
  simulateSkills;
379
+ gitignoreTargetsOnly;
378
380
  dryRun;
379
381
  check;
380
382
  sources;
@@ -389,6 +391,7 @@ var Config = class _Config {
389
391
  simulateCommands,
390
392
  simulateSubagents,
391
393
  simulateSkills,
394
+ gitignoreTargetsOnly,
392
395
  dryRun,
393
396
  check,
394
397
  sources
@@ -407,6 +410,7 @@ var Config = class _Config {
407
410
  this.simulateCommands = simulateCommands ?? false;
408
411
  this.simulateSubagents = simulateSubagents ?? false;
409
412
  this.simulateSkills = simulateSkills ?? false;
413
+ this.gitignoreTargetsOnly = gitignoreTargetsOnly ?? true;
410
414
  this.dryRun = dryRun ?? false;
411
415
  this.check = check ?? false;
412
416
  this.sources = sources ?? [];
@@ -532,6 +536,9 @@ var Config = class _Config {
532
536
  getSimulateSkills() {
533
537
  return this.simulateSkills;
534
538
  }
539
+ getGitignoreTargetsOnly() {
540
+ return this.gitignoreTargetsOnly;
541
+ }
535
542
  getDryRun() {
536
543
  return this.dryRun;
537
544
  }
@@ -563,6 +570,7 @@ var getDefaults = () => ({
563
570
  simulateCommands: false,
564
571
  simulateSubagents: false,
565
572
  simulateSkills: false,
573
+ gitignoreTargetsOnly: true,
566
574
  dryRun: false,
567
575
  check: false,
568
576
  sources: []
@@ -589,6 +597,7 @@ var mergeConfigs = (baseConfig, localConfig) => {
589
597
  simulateCommands: localConfig.simulateCommands ?? baseConfig.simulateCommands,
590
598
  simulateSubagents: localConfig.simulateSubagents ?? baseConfig.simulateSubagents,
591
599
  simulateSkills: localConfig.simulateSkills ?? baseConfig.simulateSkills,
600
+ gitignoreTargetsOnly: localConfig.gitignoreTargetsOnly ?? baseConfig.gitignoreTargetsOnly,
592
601
  dryRun: localConfig.dryRun ?? baseConfig.dryRun,
593
602
  check: localConfig.check ?? baseConfig.check,
594
603
  sources: localConfig.sources ?? baseConfig.sources
@@ -607,6 +616,7 @@ var ConfigResolver = class {
607
616
  simulateCommands,
608
617
  simulateSubagents,
609
618
  simulateSkills,
619
+ gitignoreTargetsOnly,
610
620
  dryRun,
611
621
  check
612
622
  }) {
@@ -620,6 +630,7 @@ var ConfigResolver = class {
620
630
  const resolvedSimulateCommands = simulateCommands ?? configByFile.simulateCommands ?? getDefaults().simulateCommands;
621
631
  const resolvedSimulateSubagents = simulateSubagents ?? configByFile.simulateSubagents ?? getDefaults().simulateSubagents;
622
632
  const resolvedSimulateSkills = simulateSkills ?? configByFile.simulateSkills ?? getDefaults().simulateSkills;
633
+ const resolvedGitignoreTargetsOnly = gitignoreTargetsOnly ?? configByFile.gitignoreTargetsOnly ?? getDefaults().gitignoreTargetsOnly;
623
634
  const configParams = {
624
635
  targets: targets ?? configByFile.targets ?? getDefaults().targets,
625
636
  features: features ?? configByFile.features ?? getDefaults().features,
@@ -634,6 +645,7 @@ var ConfigResolver = class {
634
645
  simulateCommands: resolvedSimulateCommands,
635
646
  simulateSubagents: resolvedSimulateSubagents,
636
647
  simulateSkills: resolvedSimulateSkills,
648
+ gitignoreTargetsOnly: resolvedGitignoreTargetsOnly,
637
649
  dryRun: dryRun ?? configByFile.dryRun ?? getDefaults().dryRun,
638
650
  check: check ?? configByFile.check ?? getDefaults().check,
639
651
  sources: configByFile.sources ?? getDefaults().sources
@@ -656,7 +668,7 @@ function getBaseDirsInLightOfGlobal({
656
668
  }
657
669
 
658
670
  // src/lib/generate.ts
659
- import { join as join134 } from "path";
671
+ import { join as join136 } from "path";
660
672
  import { intersection } from "es-toolkit";
661
673
 
662
674
  // src/features/commands/commands-processor.ts
@@ -6830,7 +6842,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6830
6842
  relativeDirPath: paths.relativeDirPath,
6831
6843
  relativeFilePath: paths.relativeFilePath,
6832
6844
  fileContent: JSON.stringify(newJson, null, 2),
6833
- validate
6845
+ validate,
6846
+ global
6834
6847
  });
6835
6848
  }
6836
6849
  static async fromRulesyncMcp({
@@ -6851,7 +6864,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6851
6864
  relativeDirPath: paths.relativeDirPath,
6852
6865
  relativeFilePath: paths.relativeFilePath,
6853
6866
  fileContent: JSON.stringify(mcpJson, null, 2),
6854
- validate
6867
+ validate,
6868
+ global
6855
6869
  });
6856
6870
  }
6857
6871
  toRulesyncMcp() {
@@ -8970,7 +8984,7 @@ var McpProcessor = class extends FeatureProcessor {
8970
8984
  };
8971
8985
 
8972
8986
  // src/features/permissions/permissions-processor.ts
8973
- import { z as z30 } from "zod/mini";
8987
+ import { z as z31 } from "zod/mini";
8974
8988
 
8975
8989
  // src/features/permissions/claudecode-permissions.ts
8976
8990
  import { join as join62 } from "path";
@@ -9295,16 +9309,382 @@ function convertClaudeToRulesyncPermissions(params) {
9295
9309
  return { permission };
9296
9310
  }
9297
9311
 
9298
- // src/features/permissions/opencode-permissions.ts
9312
+ // src/features/permissions/codexcli-permissions.ts
9299
9313
  import { join as join63 } from "path";
9300
- import { parse as parseJsonc5 } from "jsonc-parser";
9314
+ import * as smolToml4 from "smol-toml";
9315
+ var RULESYNC_PROFILE_NAME = "rulesync";
9316
+ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
9317
+ static getSettablePaths(_options = {}) {
9318
+ return {
9319
+ relativeDirPath: ".codex",
9320
+ relativeFilePath: "config.toml"
9321
+ };
9322
+ }
9323
+ isDeletable() {
9324
+ return false;
9325
+ }
9326
+ static async fromFile({
9327
+ baseDir = process.cwd(),
9328
+ validate = true,
9329
+ global = false
9330
+ }) {
9331
+ const paths = this.getSettablePaths({ global });
9332
+ const filePath = join63(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9333
+ const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
9334
+ return new _CodexcliPermissions({
9335
+ baseDir,
9336
+ relativeDirPath: paths.relativeDirPath,
9337
+ relativeFilePath: paths.relativeFilePath,
9338
+ fileContent,
9339
+ validate
9340
+ });
9341
+ }
9342
+ static async fromRulesyncPermissions({
9343
+ baseDir = process.cwd(),
9344
+ rulesyncPermissions,
9345
+ validate = true,
9346
+ logger,
9347
+ global = false
9348
+ }) {
9349
+ const paths = this.getSettablePaths({ global });
9350
+ const filePath = join63(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9351
+ const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
9352
+ const parsed = toMutableTable(smolToml4.parse(existingContent));
9353
+ const profile = convertRulesyncToCodexProfile({
9354
+ config: rulesyncPermissions.getJson(),
9355
+ logger
9356
+ });
9357
+ const permissionsTable = toMutableTable(parsed.permissions);
9358
+ permissionsTable[RULESYNC_PROFILE_NAME] = profile;
9359
+ parsed.permissions = permissionsTable;
9360
+ parsed.default_permissions = RULESYNC_PROFILE_NAME;
9361
+ return new _CodexcliPermissions({
9362
+ baseDir,
9363
+ relativeDirPath: paths.relativeDirPath,
9364
+ relativeFilePath: paths.relativeFilePath,
9365
+ fileContent: smolToml4.stringify(parsed),
9366
+ validate
9367
+ });
9368
+ }
9369
+ toRulesyncPermissions() {
9370
+ let parsed;
9371
+ try {
9372
+ parsed = smolToml4.parse(this.getFileContent());
9373
+ } catch (error) {
9374
+ throw new Error(
9375
+ `Failed to parse Codex CLI permissions content in ${join63(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9376
+ { cause: error }
9377
+ );
9378
+ }
9379
+ const table = toMutableTable(parsed);
9380
+ const defaultProfile = typeof table.default_permissions === "string" ? table.default_permissions : void 0;
9381
+ const permissionsTable = toMutableTable(table.permissions);
9382
+ const profile = toCodexProfile(permissionsTable[defaultProfile ?? RULESYNC_PROFILE_NAME]) ?? toCodexProfile(permissionsTable[RULESYNC_PROFILE_NAME]);
9383
+ const config = convertCodexProfileToRulesync(profile);
9384
+ return this.toRulesyncPermissionsDefault({
9385
+ fileContent: JSON.stringify(config, null, 2)
9386
+ });
9387
+ }
9388
+ validate() {
9389
+ return { success: true, error: null };
9390
+ }
9391
+ static forDeletion({
9392
+ baseDir = process.cwd(),
9393
+ relativeDirPath,
9394
+ relativeFilePath
9395
+ }) {
9396
+ return new _CodexcliPermissions({
9397
+ baseDir,
9398
+ relativeDirPath,
9399
+ relativeFilePath,
9400
+ fileContent: smolToml4.stringify({}),
9401
+ validate: false
9402
+ });
9403
+ }
9404
+ };
9405
+ function convertRulesyncToCodexProfile({
9406
+ config,
9407
+ logger
9408
+ }) {
9409
+ const filesystem = {};
9410
+ const domains = {};
9411
+ for (const [toolName, rules] of Object.entries(config.permission)) {
9412
+ if (toolName === "read") {
9413
+ for (const [pattern, action] of Object.entries(rules)) {
9414
+ filesystem[pattern] = mapReadAction(action);
9415
+ }
9416
+ continue;
9417
+ }
9418
+ if (toolName === "edit" || toolName === "write") {
9419
+ for (const [pattern, action] of Object.entries(rules)) {
9420
+ filesystem[pattern] = mapWriteAction(action);
9421
+ }
9422
+ continue;
9423
+ }
9424
+ if (toolName === "webfetch") {
9425
+ for (const [pattern, action] of Object.entries(rules)) {
9426
+ if (action === "ask") {
9427
+ logger?.warn(
9428
+ `Codex CLI does not support "ask" for network domain permissions. Skipping webfetch rule: ${pattern}`
9429
+ );
9430
+ continue;
9431
+ }
9432
+ domains[pattern] = action;
9433
+ }
9434
+ continue;
9435
+ }
9436
+ logger?.warn(
9437
+ `Codex CLI permissions support only read/edit/write/webfetch categories. Skipping: ${toolName}`
9438
+ );
9439
+ }
9440
+ return {
9441
+ ...Object.keys(filesystem).length > 0 ? { filesystem } : {},
9442
+ ...Object.keys(domains).length > 0 ? { network: { domains } } : {}
9443
+ };
9444
+ }
9445
+ function convertCodexProfileToRulesync(profile) {
9446
+ const permission = {};
9447
+ if (profile?.filesystem) {
9448
+ permission.read = {};
9449
+ permission.edit = {};
9450
+ for (const [pattern, access] of Object.entries(profile.filesystem)) {
9451
+ if (access === "none") {
9452
+ permission.read[pattern] = "deny";
9453
+ permission.edit[pattern] = "deny";
9454
+ } else if (access === "read") {
9455
+ permission.read[pattern] = "allow";
9456
+ } else {
9457
+ permission.edit[pattern] = "allow";
9458
+ }
9459
+ }
9460
+ }
9461
+ if (profile?.network?.domains) {
9462
+ permission.webfetch = {};
9463
+ for (const [domain, value] of Object.entries(profile.network.domains)) {
9464
+ permission.webfetch[domain] = value;
9465
+ }
9466
+ }
9467
+ return { permission };
9468
+ }
9469
+ function toCodexProfile(value) {
9470
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9471
+ const table = toMutableTable(value);
9472
+ const filesystem = toFilesystemRecord(table.filesystem);
9473
+ const networkRaw = toMutableTable(table.network);
9474
+ const domains = toDomainRecord(networkRaw.domains);
9475
+ return {
9476
+ ...filesystem ? { filesystem } : {},
9477
+ ...domains ? { network: { domains } } : {}
9478
+ };
9479
+ }
9480
+ function toMutableTable(value) {
9481
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
9482
+ return {};
9483
+ }
9484
+ return { ...value };
9485
+ }
9486
+ function toFilesystemRecord(value) {
9487
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9488
+ const result = {};
9489
+ for (const [key, raw] of Object.entries(value)) {
9490
+ if (typeof raw !== "string") continue;
9491
+ if (raw === "read" || raw === "write" || raw === "none") {
9492
+ result[key] = raw;
9493
+ }
9494
+ }
9495
+ return Object.keys(result).length > 0 ? result : void 0;
9496
+ }
9497
+ function toDomainRecord(value) {
9498
+ if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
9499
+ const result = {};
9500
+ for (const [key, raw] of Object.entries(value)) {
9501
+ if (raw === "allow" || raw === "deny") {
9502
+ result[key] = raw;
9503
+ }
9504
+ }
9505
+ return Object.keys(result).length > 0 ? result : void 0;
9506
+ }
9507
+ function mapReadAction(action) {
9508
+ return action === "allow" ? "read" : "none";
9509
+ }
9510
+ function mapWriteAction(action) {
9511
+ return action === "allow" ? "write" : "none";
9512
+ }
9513
+
9514
+ // src/features/permissions/geminicli-permissions.ts
9515
+ import { join as join64 } from "path";
9301
9516
  import { z as z29 } from "zod/mini";
9302
- var OpencodePermissionSchema = z29.union([
9303
- z29.enum(["allow", "ask", "deny"]),
9304
- z29.record(z29.string(), z29.enum(["allow", "ask", "deny"]))
9517
+ var GeminiCliSettingsSchema = z29.looseObject({
9518
+ tools: z29.optional(
9519
+ z29.looseObject({
9520
+ allowed: z29.optional(z29.array(z29.string())),
9521
+ exclude: z29.optional(z29.array(z29.string()))
9522
+ })
9523
+ )
9524
+ });
9525
+ var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
9526
+ bash: "run_shell_command",
9527
+ read: "read_file",
9528
+ edit: "replace",
9529
+ write: "write_file",
9530
+ webfetch: "web_fetch"
9531
+ };
9532
+ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
9533
+ static getSettablePaths(_options = {}) {
9534
+ return {
9535
+ relativeDirPath: ".gemini",
9536
+ relativeFilePath: "settings.json"
9537
+ };
9538
+ }
9539
+ isDeletable() {
9540
+ return false;
9541
+ }
9542
+ static async fromFile({
9543
+ baseDir = process.cwd(),
9544
+ validate = true,
9545
+ global = false
9546
+ }) {
9547
+ const paths = this.getSettablePaths({ global });
9548
+ const filePath = join64(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9549
+ const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9550
+ return new _GeminicliPermissions({
9551
+ baseDir,
9552
+ relativeDirPath: paths.relativeDirPath,
9553
+ relativeFilePath: paths.relativeFilePath,
9554
+ fileContent,
9555
+ validate
9556
+ });
9557
+ }
9558
+ static async fromRulesyncPermissions({
9559
+ baseDir = process.cwd(),
9560
+ rulesyncPermissions,
9561
+ validate = true,
9562
+ logger,
9563
+ global = false
9564
+ }) {
9565
+ const paths = this.getSettablePaths({ global });
9566
+ const filePath = join64(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9567
+ const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
9568
+ const settingsResult = GeminiCliSettingsSchema.safeParse(JSON.parse(existingContent));
9569
+ if (!settingsResult.success) {
9570
+ throw new Error(
9571
+ `Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(settingsResult.error)}`
9572
+ );
9573
+ }
9574
+ const { allowed, exclude } = convertRulesyncToGeminicliTools({
9575
+ config: rulesyncPermissions.getJson(),
9576
+ logger
9577
+ });
9578
+ const merged = {
9579
+ ...settingsResult.data,
9580
+ tools: {
9581
+ ...settingsResult.data.tools,
9582
+ ...allowed.length > 0 ? { allowed } : {},
9583
+ ...exclude.length > 0 ? { exclude } : {}
9584
+ }
9585
+ };
9586
+ return new _GeminicliPermissions({
9587
+ baseDir,
9588
+ relativeDirPath: paths.relativeDirPath,
9589
+ relativeFilePath: paths.relativeFilePath,
9590
+ fileContent: JSON.stringify(merged, null, 2),
9591
+ validate
9592
+ });
9593
+ }
9594
+ toRulesyncPermissions() {
9595
+ let settings;
9596
+ try {
9597
+ const parsed = JSON.parse(this.getFileContent());
9598
+ settings = GeminiCliSettingsSchema.parse(parsed);
9599
+ } catch (error) {
9600
+ throw new Error(
9601
+ `Failed to parse Gemini CLI permissions content in ${join64(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9602
+ { cause: error }
9603
+ );
9604
+ }
9605
+ const permission = {};
9606
+ for (const toolEntry of settings.tools?.allowed ?? []) {
9607
+ const mapped = parseGeminicliToolEntry({ entry: toolEntry });
9608
+ const rules = permission[mapped.category] ??= {};
9609
+ rules[mapped.pattern] = "allow";
9610
+ }
9611
+ for (const toolEntry of settings.tools?.exclude ?? []) {
9612
+ const mapped = parseGeminicliToolEntry({ entry: toolEntry });
9613
+ const rules = permission[mapped.category] ??= {};
9614
+ rules[mapped.pattern] = "deny";
9615
+ }
9616
+ return this.toRulesyncPermissionsDefault({
9617
+ fileContent: JSON.stringify({ permission }, null, 2)
9618
+ });
9619
+ }
9620
+ validate() {
9621
+ return { success: true, error: null };
9622
+ }
9623
+ static forDeletion({
9624
+ baseDir = process.cwd(),
9625
+ relativeDirPath,
9626
+ relativeFilePath
9627
+ }) {
9628
+ return new _GeminicliPermissions({
9629
+ baseDir,
9630
+ relativeDirPath,
9631
+ relativeFilePath,
9632
+ fileContent: JSON.stringify({}, null, 2),
9633
+ validate: false
9634
+ });
9635
+ }
9636
+ };
9637
+ function convertRulesyncToGeminicliTools({
9638
+ config,
9639
+ logger
9640
+ }) {
9641
+ const allowed = [];
9642
+ const exclude = [];
9643
+ for (const [toolName, rules] of Object.entries(config.permission)) {
9644
+ const mappedToolName = RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName] ?? toolName;
9645
+ if (!RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName]) {
9646
+ logger?.warn(`Gemini CLI permissions use direct tool names. Mapping as-is: ${toolName}`);
9647
+ }
9648
+ for (const [pattern, action] of Object.entries(rules)) {
9649
+ if (action === "ask") {
9650
+ logger?.warn(
9651
+ `Gemini CLI does not support explicit "ask" rules in settings. Skipping ${toolName}:${pattern}`
9652
+ );
9653
+ continue;
9654
+ }
9655
+ const geminiEntry = pattern === "*" ? mappedToolName : `${mappedToolName}(${pattern})`;
9656
+ if (action === "allow") {
9657
+ allowed.push(geminiEntry);
9658
+ } else {
9659
+ exclude.push(geminiEntry);
9660
+ }
9661
+ }
9662
+ }
9663
+ return { allowed, exclude };
9664
+ }
9665
+ function parseGeminicliToolEntry({ entry }) {
9666
+ const match = /^([^()]+?)(?:\((.*)\))?$/.exec(entry);
9667
+ if (!match) return { category: entry, pattern: "*" };
9668
+ const rawToolName = match[1]?.trim() ?? entry;
9669
+ const mappedCategory = Object.entries(RULESYNC_TO_GEMINICLI_TOOL_NAME).find(
9670
+ ([, value]) => value === rawToolName
9671
+ )?.[0];
9672
+ return {
9673
+ category: mappedCategory ?? rawToolName,
9674
+ pattern: (match[2] ?? "*").trim()
9675
+ };
9676
+ }
9677
+
9678
+ // src/features/permissions/opencode-permissions.ts
9679
+ import { join as join65 } from "path";
9680
+ import { parse as parseJsonc5 } from "jsonc-parser";
9681
+ import { z as z30 } from "zod/mini";
9682
+ var OpencodePermissionSchema = z30.union([
9683
+ z30.enum(["allow", "ask", "deny"]),
9684
+ z30.record(z30.string(), z30.enum(["allow", "ask", "deny"]))
9305
9685
  ]);
9306
- var OpencodePermissionsConfigSchema = z29.looseObject({
9307
- permission: z29.optional(z29.record(z29.string(), OpencodePermissionSchema))
9686
+ var OpencodePermissionsConfigSchema = z30.looseObject({
9687
+ permission: z30.optional(z30.record(z30.string(), OpencodePermissionSchema))
9308
9688
  });
9309
9689
  var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9310
9690
  json;
@@ -9321,7 +9701,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9321
9701
  static getSettablePaths({
9322
9702
  global = false
9323
9703
  } = {}) {
9324
- return global ? { relativeDirPath: join63(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9704
+ return global ? { relativeDirPath: join65(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9325
9705
  }
9326
9706
  static async fromFile({
9327
9707
  baseDir = process.cwd(),
@@ -9329,9 +9709,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9329
9709
  global = false
9330
9710
  }) {
9331
9711
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9332
- const jsonDir = join63(baseDir, basePaths.relativeDirPath);
9333
- const jsoncPath = join63(jsonDir, "opencode.jsonc");
9334
- const jsonPath = join63(jsonDir, "opencode.json");
9712
+ const jsonDir = join65(baseDir, basePaths.relativeDirPath);
9713
+ const jsoncPath = join65(jsonDir, "opencode.jsonc");
9714
+ const jsonPath = join65(jsonDir, "opencode.json");
9335
9715
  let fileContent = await readFileContentOrNull(jsoncPath);
9336
9716
  let relativeFilePath = "opencode.jsonc";
9337
9717
  if (!fileContent) {
@@ -9356,9 +9736,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9356
9736
  global = false
9357
9737
  }) {
9358
9738
  const basePaths = _OpencodePermissions.getSettablePaths({ global });
9359
- const jsonDir = join63(baseDir, basePaths.relativeDirPath);
9360
- const jsoncPath = join63(jsonDir, "opencode.jsonc");
9361
- const jsonPath = join63(jsonDir, "opencode.json");
9739
+ const jsonDir = join65(baseDir, basePaths.relativeDirPath);
9740
+ const jsoncPath = join65(jsonDir, "opencode.jsonc");
9741
+ const jsonPath = join65(jsonDir, "opencode.json");
9362
9742
  let fileContent = await readFileContentOrNull(jsoncPath);
9363
9743
  let relativeFilePath = "opencode.jsonc";
9364
9744
  if (!fileContent) {
@@ -9428,8 +9808,13 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9428
9808
  };
9429
9809
 
9430
9810
  // src/features/permissions/permissions-processor.ts
9431
- var permissionsProcessorToolTargetTuple = ["claudecode", "opencode"];
9432
- var PermissionsProcessorToolTargetSchema = z30.enum(permissionsProcessorToolTargetTuple);
9811
+ var permissionsProcessorToolTargetTuple = [
9812
+ "claudecode",
9813
+ "codexcli",
9814
+ "geminicli",
9815
+ "opencode"
9816
+ ];
9817
+ var PermissionsProcessorToolTargetSchema = z31.enum(permissionsProcessorToolTargetTuple);
9433
9818
  var toolPermissionsFactories = /* @__PURE__ */ new Map([
9434
9819
  [
9435
9820
  "claudecode",
@@ -9442,6 +9827,28 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
9442
9827
  }
9443
9828
  }
9444
9829
  ],
9830
+ [
9831
+ "codexcli",
9832
+ {
9833
+ class: CodexcliPermissions,
9834
+ meta: {
9835
+ supportsProject: true,
9836
+ supportsGlobal: true,
9837
+ supportsImport: true
9838
+ }
9839
+ }
9840
+ ],
9841
+ [
9842
+ "geminicli",
9843
+ {
9844
+ class: GeminicliPermissions,
9845
+ meta: {
9846
+ supportsProject: true,
9847
+ supportsGlobal: true,
9848
+ supportsImport: true
9849
+ }
9850
+ }
9851
+ ],
9445
9852
  [
9446
9853
  "opencode",
9447
9854
  {
@@ -9552,25 +9959,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
9552
9959
  };
9553
9960
 
9554
9961
  // src/features/rules/rules-processor.ts
9555
- import { basename as basename10, dirname as dirname3, join as join133, relative as relative5 } from "path";
9962
+ import { basename as basename10, dirname as dirname3, join as join135, relative as relative5 } from "path";
9556
9963
  import { encode } from "@toon-format/toon";
9557
- import { z as z69 } from "zod/mini";
9964
+ import { z as z70 } from "zod/mini";
9558
9965
 
9559
9966
  // src/constants/general.ts
9560
9967
  var SKILL_FILE_NAME = "SKILL.md";
9561
9968
 
9562
9969
  // src/features/skills/agentsmd-skill.ts
9563
- import { join as join67 } from "path";
9970
+ import { join as join69 } from "path";
9564
9971
 
9565
9972
  // src/features/skills/simulated-skill.ts
9566
- import { join as join66 } from "path";
9567
- import { z as z31 } from "zod/mini";
9973
+ import { join as join68 } from "path";
9974
+ import { z as z32 } from "zod/mini";
9568
9975
 
9569
9976
  // src/features/skills/tool-skill.ts
9570
- import { join as join65 } from "path";
9977
+ import { join as join67 } from "path";
9571
9978
 
9572
9979
  // src/types/ai-dir.ts
9573
- import path2, { basename as basename3, join as join64, relative as relative4, resolve as resolve4 } from "path";
9980
+ import path2, { basename as basename3, join as join66, relative as relative4, resolve as resolve4 } from "path";
9574
9981
  var AiDir = class {
9575
9982
  /**
9576
9983
  * @example "."
@@ -9667,8 +10074,8 @@ var AiDir = class {
9667
10074
  * @returns Array of files with their relative paths and buffers
9668
10075
  */
9669
10076
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
9670
- const dirPath = join64(baseDir, relativeDirPath, dirName);
9671
- const glob = join64(dirPath, "**", "*");
10077
+ const dirPath = join66(baseDir, relativeDirPath, dirName);
10078
+ const glob = join66(dirPath, "**", "*");
9672
10079
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
9673
10080
  const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
9674
10081
  const files = await Promise.all(
@@ -9769,8 +10176,8 @@ var ToolSkill = class extends AiDir {
9769
10176
  }) {
9770
10177
  const settablePaths = getSettablePaths({ global });
9771
10178
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9772
- const skillDirPath = join65(baseDir, actualRelativeDirPath, dirName);
9773
- const skillFilePath = join65(skillDirPath, SKILL_FILE_NAME);
10179
+ const skillDirPath = join67(baseDir, actualRelativeDirPath, dirName);
10180
+ const skillFilePath = join67(skillDirPath, SKILL_FILE_NAME);
9774
10181
  if (!await fileExists(skillFilePath)) {
9775
10182
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9776
10183
  }
@@ -9794,16 +10201,16 @@ var ToolSkill = class extends AiDir {
9794
10201
  }
9795
10202
  requireMainFileFrontmatter() {
9796
10203
  if (!this.mainFile?.frontmatter) {
9797
- throw new Error(`Frontmatter is not defined in ${join65(this.relativeDirPath, this.dirName)}`);
10204
+ throw new Error(`Frontmatter is not defined in ${join67(this.relativeDirPath, this.dirName)}`);
9798
10205
  }
9799
10206
  return this.mainFile.frontmatter;
9800
10207
  }
9801
10208
  };
9802
10209
 
9803
10210
  // src/features/skills/simulated-skill.ts
9804
- var SimulatedSkillFrontmatterSchema = z31.looseObject({
9805
- name: z31.string(),
9806
- description: z31.string()
10211
+ var SimulatedSkillFrontmatterSchema = z32.looseObject({
10212
+ name: z32.string(),
10213
+ description: z32.string()
9807
10214
  });
9808
10215
  var SimulatedSkill = class extends ToolSkill {
9809
10216
  frontmatter;
@@ -9834,7 +10241,7 @@ var SimulatedSkill = class extends ToolSkill {
9834
10241
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
9835
10242
  if (!result.success) {
9836
10243
  throw new Error(
9837
- `Invalid frontmatter in ${join66(relativeDirPath, dirName)}: ${formatError(result.error)}`
10244
+ `Invalid frontmatter in ${join68(relativeDirPath, dirName)}: ${formatError(result.error)}`
9838
10245
  );
9839
10246
  }
9840
10247
  }
@@ -9893,8 +10300,8 @@ var SimulatedSkill = class extends ToolSkill {
9893
10300
  }) {
9894
10301
  const settablePaths = this.getSettablePaths();
9895
10302
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9896
- const skillDirPath = join66(baseDir, actualRelativeDirPath, dirName);
9897
- const skillFilePath = join66(skillDirPath, SKILL_FILE_NAME);
10303
+ const skillDirPath = join68(baseDir, actualRelativeDirPath, dirName);
10304
+ const skillFilePath = join68(skillDirPath, SKILL_FILE_NAME);
9898
10305
  if (!await fileExists(skillFilePath)) {
9899
10306
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9900
10307
  }
@@ -9971,7 +10378,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9971
10378
  throw new Error("AgentsmdSkill does not support global mode.");
9972
10379
  }
9973
10380
  return {
9974
- relativeDirPath: join67(".agents", "skills")
10381
+ relativeDirPath: join69(".agents", "skills")
9975
10382
  };
9976
10383
  }
9977
10384
  static async fromDir(params) {
@@ -9998,11 +10405,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9998
10405
  };
9999
10406
 
10000
10407
  // src/features/skills/factorydroid-skill.ts
10001
- import { join as join68 } from "path";
10408
+ import { join as join70 } from "path";
10002
10409
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10003
10410
  static getSettablePaths(_options) {
10004
10411
  return {
10005
- relativeDirPath: join68(".factory", "skills")
10412
+ relativeDirPath: join70(".factory", "skills")
10006
10413
  };
10007
10414
  }
10008
10415
  static async fromDir(params) {
@@ -10029,50 +10436,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
10029
10436
  };
10030
10437
 
10031
10438
  // src/features/skills/rovodev-skill.ts
10032
- import { join as join70 } from "path";
10033
- import { z as z33 } from "zod/mini";
10439
+ import { join as join72 } from "path";
10440
+ import { z as z34 } from "zod/mini";
10034
10441
 
10035
10442
  // src/features/skills/rulesync-skill.ts
10036
- import { join as join69 } from "path";
10037
- import { z as z32 } from "zod/mini";
10038
- var RulesyncSkillFrontmatterSchemaInternal = z32.looseObject({
10039
- name: z32.string(),
10040
- description: z32.string(),
10041
- targets: z32._default(RulesyncTargetsSchema, ["*"]),
10042
- claudecode: z32.optional(
10043
- z32.looseObject({
10044
- "allowed-tools": z32.optional(z32.array(z32.string())),
10045
- model: z32.optional(z32.string()),
10046
- "disable-model-invocation": z32.optional(z32.boolean())
10443
+ import { join as join71 } from "path";
10444
+ import { z as z33 } from "zod/mini";
10445
+ var RulesyncSkillFrontmatterSchemaInternal = z33.looseObject({
10446
+ name: z33.string(),
10447
+ description: z33.string(),
10448
+ targets: z33._default(RulesyncTargetsSchema, ["*"]),
10449
+ claudecode: z33.optional(
10450
+ z33.looseObject({
10451
+ "allowed-tools": z33.optional(z33.array(z33.string())),
10452
+ model: z33.optional(z33.string()),
10453
+ "disable-model-invocation": z33.optional(z33.boolean())
10047
10454
  })
10048
10455
  ),
10049
- codexcli: z32.optional(
10050
- z32.looseObject({
10051
- "short-description": z32.optional(z32.string())
10456
+ codexcli: z33.optional(
10457
+ z33.looseObject({
10458
+ "short-description": z33.optional(z33.string())
10052
10459
  })
10053
10460
  ),
10054
- opencode: z32.optional(
10055
- z32.looseObject({
10056
- "allowed-tools": z32.optional(z32.array(z32.string()))
10461
+ opencode: z33.optional(
10462
+ z33.looseObject({
10463
+ "allowed-tools": z33.optional(z33.array(z33.string()))
10057
10464
  })
10058
10465
  ),
10059
- kilo: z32.optional(
10060
- z32.looseObject({
10061
- "allowed-tools": z32.optional(z32.array(z32.string()))
10466
+ kilo: z33.optional(
10467
+ z33.looseObject({
10468
+ "allowed-tools": z33.optional(z33.array(z33.string()))
10062
10469
  })
10063
10470
  ),
10064
- deepagents: z32.optional(
10065
- z32.looseObject({
10066
- "allowed-tools": z32.optional(z32.array(z32.string()))
10471
+ deepagents: z33.optional(
10472
+ z33.looseObject({
10473
+ "allowed-tools": z33.optional(z33.array(z33.string()))
10067
10474
  })
10068
10475
  ),
10069
- copilot: z32.optional(
10070
- z32.looseObject({
10071
- license: z32.optional(z32.string())
10476
+ copilot: z33.optional(
10477
+ z33.looseObject({
10478
+ license: z33.optional(z33.string())
10072
10479
  })
10073
10480
  ),
10074
- cline: z32.optional(z32.looseObject({})),
10075
- roo: z32.optional(z32.looseObject({}))
10481
+ cline: z33.optional(z33.looseObject({})),
10482
+ roo: z33.optional(z33.looseObject({}))
10076
10483
  });
10077
10484
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
10078
10485
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -10112,7 +10519,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10112
10519
  }
10113
10520
  getFrontmatter() {
10114
10521
  if (!this.mainFile?.frontmatter) {
10115
- throw new Error(`Frontmatter is not defined in ${join69(this.relativeDirPath, this.dirName)}`);
10522
+ throw new Error(`Frontmatter is not defined in ${join71(this.relativeDirPath, this.dirName)}`);
10116
10523
  }
10117
10524
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
10118
10525
  return result;
@@ -10138,8 +10545,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10138
10545
  dirName,
10139
10546
  global = false
10140
10547
  }) {
10141
- const skillDirPath = join69(baseDir, relativeDirPath, dirName);
10142
- const skillFilePath = join69(skillDirPath, SKILL_FILE_NAME);
10548
+ const skillDirPath = join71(baseDir, relativeDirPath, dirName);
10549
+ const skillFilePath = join71(skillDirPath, SKILL_FILE_NAME);
10143
10550
  if (!await fileExists(skillFilePath)) {
10144
10551
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
10145
10552
  }
@@ -10169,14 +10576,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
10169
10576
  };
10170
10577
 
10171
10578
  // src/features/skills/rovodev-skill.ts
10172
- var RovodevSkillFrontmatterSchema = z33.looseObject({
10173
- name: z33.string(),
10174
- description: z33.string()
10579
+ var RovodevSkillFrontmatterSchema = z34.looseObject({
10580
+ name: z34.string(),
10581
+ description: z34.string()
10175
10582
  });
10176
10583
  var RovodevSkill = class _RovodevSkill extends ToolSkill {
10177
10584
  constructor({
10178
10585
  baseDir = process.cwd(),
10179
- relativeDirPath = join70(".rovodev", "skills"),
10586
+ relativeDirPath = join72(".rovodev", "skills"),
10180
10587
  dirName,
10181
10588
  frontmatter,
10182
10589
  body,
@@ -10205,8 +10612,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10205
10612
  }
10206
10613
  static getSettablePaths(_options) {
10207
10614
  return {
10208
- relativeDirPath: join70(".rovodev", "skills"),
10209
- alternativeSkillRoots: [join70(".agents", "skills")]
10615
+ relativeDirPath: join72(".rovodev", "skills"),
10616
+ alternativeSkillRoots: [join72(".agents", "skills")]
10210
10617
  };
10211
10618
  }
10212
10619
  getFrontmatter() {
@@ -10294,13 +10701,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10294
10701
  });
10295
10702
  const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10296
10703
  if (!result.success) {
10297
- const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10704
+ const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10298
10705
  throw new Error(
10299
- `Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10706
+ `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10300
10707
  );
10301
10708
  }
10302
10709
  if (result.data.name !== loaded.dirName) {
10303
- const skillFilePath = join70(
10710
+ const skillFilePath = join72(
10304
10711
  loaded.baseDir,
10305
10712
  loaded.relativeDirPath,
10306
10713
  loaded.dirName,
@@ -10342,11 +10749,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
10342
10749
  };
10343
10750
 
10344
10751
  // src/features/skills/skills-processor.ts
10345
- import { basename as basename5, join as join88 } from "path";
10346
- import { z as z49 } from "zod/mini";
10752
+ import { basename as basename5, join as join90 } from "path";
10753
+ import { z as z50 } from "zod/mini";
10347
10754
 
10348
10755
  // src/types/dir-feature-processor.ts
10349
- import { join as join71 } from "path";
10756
+ import { join as join73 } from "path";
10350
10757
  var DirFeatureProcessor = class {
10351
10758
  baseDir;
10352
10759
  dryRun;
@@ -10386,7 +10793,7 @@ var DirFeatureProcessor = class {
10386
10793
  const mainFile = aiDir.getMainFile();
10387
10794
  let mainFileContent;
10388
10795
  if (mainFile) {
10389
- const mainFilePath = join71(dirPath, mainFile.name);
10796
+ const mainFilePath = join73(dirPath, mainFile.name);
10390
10797
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
10391
10798
  avoidBlockScalars: this.avoidBlockScalars
10392
10799
  });
@@ -10406,7 +10813,7 @@ var DirFeatureProcessor = class {
10406
10813
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
10407
10814
  otherFileContents.push(contentWithNewline);
10408
10815
  if (!dirHasChanges) {
10409
- const filePath = join71(dirPath, file.relativeFilePathToDirPath);
10816
+ const filePath = join73(dirPath, file.relativeFilePathToDirPath);
10410
10817
  const existingContent = await readFileContentOrNull(filePath);
10411
10818
  if (!fileContentsEquivalent({
10412
10819
  filePath,
@@ -10424,24 +10831,24 @@ var DirFeatureProcessor = class {
10424
10831
  if (this.dryRun) {
10425
10832
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
10426
10833
  if (mainFile) {
10427
- this.logger.info(`[DRY RUN] Would write: ${join71(dirPath, mainFile.name)}`);
10428
- changedPaths.push(join71(relativeDir, mainFile.name));
10834
+ this.logger.info(`[DRY RUN] Would write: ${join73(dirPath, mainFile.name)}`);
10835
+ changedPaths.push(join73(relativeDir, mainFile.name));
10429
10836
  }
10430
10837
  for (const file of otherFiles) {
10431
10838
  this.logger.info(
10432
- `[DRY RUN] Would write: ${join71(dirPath, file.relativeFilePathToDirPath)}`
10839
+ `[DRY RUN] Would write: ${join73(dirPath, file.relativeFilePathToDirPath)}`
10433
10840
  );
10434
- changedPaths.push(join71(relativeDir, file.relativeFilePathToDirPath));
10841
+ changedPaths.push(join73(relativeDir, file.relativeFilePathToDirPath));
10435
10842
  }
10436
10843
  } else {
10437
10844
  await ensureDir(dirPath);
10438
10845
  if (mainFile && mainFileContent) {
10439
- const mainFilePath = join71(dirPath, mainFile.name);
10846
+ const mainFilePath = join73(dirPath, mainFile.name);
10440
10847
  await writeFileContent(mainFilePath, mainFileContent);
10441
- changedPaths.push(join71(relativeDir, mainFile.name));
10848
+ changedPaths.push(join73(relativeDir, mainFile.name));
10442
10849
  }
10443
10850
  for (const [i, file] of otherFiles.entries()) {
10444
- const filePath = join71(dirPath, file.relativeFilePathToDirPath);
10851
+ const filePath = join73(dirPath, file.relativeFilePathToDirPath);
10445
10852
  const content = otherFileContents[i];
10446
10853
  if (content === void 0) {
10447
10854
  throw new Error(
@@ -10449,7 +10856,7 @@ var DirFeatureProcessor = class {
10449
10856
  );
10450
10857
  }
10451
10858
  await writeFileContent(filePath, content);
10452
- changedPaths.push(join71(relativeDir, file.relativeFilePathToDirPath));
10859
+ changedPaths.push(join73(relativeDir, file.relativeFilePathToDirPath));
10453
10860
  }
10454
10861
  }
10455
10862
  changedCount++;
@@ -10481,16 +10888,16 @@ var DirFeatureProcessor = class {
10481
10888
  };
10482
10889
 
10483
10890
  // src/features/skills/agentsskills-skill.ts
10484
- import { join as join72 } from "path";
10485
- import { z as z34 } from "zod/mini";
10486
- var AgentsSkillsSkillFrontmatterSchema = z34.looseObject({
10487
- name: z34.string(),
10488
- description: z34.string()
10891
+ import { join as join74 } from "path";
10892
+ import { z as z35 } from "zod/mini";
10893
+ var AgentsSkillsSkillFrontmatterSchema = z35.looseObject({
10894
+ name: z35.string(),
10895
+ description: z35.string()
10489
10896
  });
10490
10897
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10491
10898
  constructor({
10492
10899
  baseDir = process.cwd(),
10493
- relativeDirPath = join72(".agents", "skills"),
10900
+ relativeDirPath = join74(".agents", "skills"),
10494
10901
  dirName,
10495
10902
  frontmatter,
10496
10903
  body,
@@ -10522,7 +10929,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10522
10929
  throw new Error("AgentsSkillsSkill does not support global mode.");
10523
10930
  }
10524
10931
  return {
10525
- relativeDirPath: join72(".agents", "skills")
10932
+ relativeDirPath: join74(".agents", "skills")
10526
10933
  };
10527
10934
  }
10528
10935
  getFrontmatter() {
@@ -10602,9 +11009,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10602
11009
  });
10603
11010
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10604
11011
  if (!result.success) {
10605
- const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11012
+ const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10606
11013
  throw new Error(
10607
- `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11014
+ `Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10608
11015
  );
10609
11016
  }
10610
11017
  return new _AgentsSkillsSkill({
@@ -10639,16 +11046,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
10639
11046
  };
10640
11047
 
10641
11048
  // src/features/skills/antigravity-skill.ts
10642
- import { join as join73 } from "path";
10643
- import { z as z35 } from "zod/mini";
10644
- var AntigravitySkillFrontmatterSchema = z35.looseObject({
10645
- name: z35.string(),
10646
- description: z35.string()
11049
+ import { join as join75 } from "path";
11050
+ import { z as z36 } from "zod/mini";
11051
+ var AntigravitySkillFrontmatterSchema = z36.looseObject({
11052
+ name: z36.string(),
11053
+ description: z36.string()
10647
11054
  });
10648
11055
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10649
11056
  constructor({
10650
11057
  baseDir = process.cwd(),
10651
- relativeDirPath = join73(".agent", "skills"),
11058
+ relativeDirPath = join75(".agent", "skills"),
10652
11059
  dirName,
10653
11060
  frontmatter,
10654
11061
  body,
@@ -10680,11 +11087,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10680
11087
  } = {}) {
10681
11088
  if (global) {
10682
11089
  return {
10683
- relativeDirPath: join73(".gemini", "antigravity", "skills")
11090
+ relativeDirPath: join75(".gemini", "antigravity", "skills")
10684
11091
  };
10685
11092
  }
10686
11093
  return {
10687
- relativeDirPath: join73(".agent", "skills")
11094
+ relativeDirPath: join75(".agent", "skills")
10688
11095
  };
10689
11096
  }
10690
11097
  getFrontmatter() {
@@ -10764,9 +11171,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10764
11171
  });
10765
11172
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
10766
11173
  if (!result.success) {
10767
- const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11174
+ const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10768
11175
  throw new Error(
10769
- `Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11176
+ `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10770
11177
  );
10771
11178
  }
10772
11179
  return new _AntigravitySkill({
@@ -10800,19 +11207,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10800
11207
  };
10801
11208
 
10802
11209
  // src/features/skills/claudecode-skill.ts
10803
- import { join as join74 } from "path";
10804
- import { z as z36 } from "zod/mini";
10805
- var ClaudecodeSkillFrontmatterSchema = z36.looseObject({
10806
- name: z36.string(),
10807
- description: z36.string(),
10808
- "allowed-tools": z36.optional(z36.array(z36.string())),
10809
- model: z36.optional(z36.string()),
10810
- "disable-model-invocation": z36.optional(z36.boolean())
11210
+ import { join as join76 } from "path";
11211
+ import { z as z37 } from "zod/mini";
11212
+ var ClaudecodeSkillFrontmatterSchema = z37.looseObject({
11213
+ name: z37.string(),
11214
+ description: z37.string(),
11215
+ "allowed-tools": z37.optional(z37.array(z37.string())),
11216
+ model: z37.optional(z37.string()),
11217
+ "disable-model-invocation": z37.optional(z37.boolean())
10811
11218
  });
10812
11219
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10813
11220
  constructor({
10814
11221
  baseDir = process.cwd(),
10815
- relativeDirPath = join74(".claude", "skills"),
11222
+ relativeDirPath = join76(".claude", "skills"),
10816
11223
  dirName,
10817
11224
  frontmatter,
10818
11225
  body,
@@ -10843,7 +11250,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10843
11250
  global: _global = false
10844
11251
  } = {}) {
10845
11252
  return {
10846
- relativeDirPath: join74(".claude", "skills")
11253
+ relativeDirPath: join76(".claude", "skills")
10847
11254
  };
10848
11255
  }
10849
11256
  getFrontmatter() {
@@ -10940,9 +11347,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10940
11347
  });
10941
11348
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10942
11349
  if (!result.success) {
10943
- const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11350
+ const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10944
11351
  throw new Error(
10945
- `Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11352
+ `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10946
11353
  );
10947
11354
  }
10948
11355
  return new _ClaudecodeSkill({
@@ -10976,16 +11383,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10976
11383
  };
10977
11384
 
10978
11385
  // src/features/skills/cline-skill.ts
10979
- import { join as join75 } from "path";
10980
- import { z as z37 } from "zod/mini";
10981
- var ClineSkillFrontmatterSchema = z37.looseObject({
10982
- name: z37.string(),
10983
- description: z37.string()
11386
+ import { join as join77 } from "path";
11387
+ import { z as z38 } from "zod/mini";
11388
+ var ClineSkillFrontmatterSchema = z38.looseObject({
11389
+ name: z38.string(),
11390
+ description: z38.string()
10984
11391
  });
10985
11392
  var ClineSkill = class _ClineSkill extends ToolSkill {
10986
11393
  constructor({
10987
11394
  baseDir = process.cwd(),
10988
- relativeDirPath = join75(".cline", "skills"),
11395
+ relativeDirPath = join77(".cline", "skills"),
10989
11396
  dirName,
10990
11397
  frontmatter,
10991
11398
  body,
@@ -11014,7 +11421,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11014
11421
  }
11015
11422
  static getSettablePaths(_options = {}) {
11016
11423
  return {
11017
- relativeDirPath: join75(".cline", "skills")
11424
+ relativeDirPath: join77(".cline", "skills")
11018
11425
  };
11019
11426
  }
11020
11427
  getFrontmatter() {
@@ -11102,13 +11509,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11102
11509
  });
11103
11510
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11104
11511
  if (!result.success) {
11105
- const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11512
+ const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11106
11513
  throw new Error(
11107
- `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11514
+ `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11108
11515
  );
11109
11516
  }
11110
11517
  if (result.data.name !== loaded.dirName) {
11111
- const skillFilePath = join75(
11518
+ const skillFilePath = join77(
11112
11519
  loaded.baseDir,
11113
11520
  loaded.relativeDirPath,
11114
11521
  loaded.dirName,
@@ -11149,21 +11556,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
11149
11556
  };
11150
11557
 
11151
11558
  // src/features/skills/codexcli-skill.ts
11152
- import { join as join76 } from "path";
11153
- import { z as z38 } from "zod/mini";
11154
- var CodexCliSkillFrontmatterSchema = z38.looseObject({
11155
- name: z38.string(),
11156
- description: z38.string(),
11157
- metadata: z38.optional(
11158
- z38.looseObject({
11159
- "short-description": z38.optional(z38.string())
11559
+ import { join as join78 } from "path";
11560
+ import { z as z39 } from "zod/mini";
11561
+ var CodexCliSkillFrontmatterSchema = z39.looseObject({
11562
+ name: z39.string(),
11563
+ description: z39.string(),
11564
+ metadata: z39.optional(
11565
+ z39.looseObject({
11566
+ "short-description": z39.optional(z39.string())
11160
11567
  })
11161
11568
  )
11162
11569
  });
11163
11570
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11164
11571
  constructor({
11165
11572
  baseDir = process.cwd(),
11166
- relativeDirPath = join76(".codex", "skills"),
11573
+ relativeDirPath = join78(".codex", "skills"),
11167
11574
  dirName,
11168
11575
  frontmatter,
11169
11576
  body,
@@ -11194,7 +11601,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11194
11601
  global: _global = false
11195
11602
  } = {}) {
11196
11603
  return {
11197
- relativeDirPath: join76(".codex", "skills")
11604
+ relativeDirPath: join78(".codex", "skills")
11198
11605
  };
11199
11606
  }
11200
11607
  getFrontmatter() {
@@ -11284,9 +11691,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11284
11691
  });
11285
11692
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11286
11693
  if (!result.success) {
11287
- const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11694
+ const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11288
11695
  throw new Error(
11289
- `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11696
+ `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11290
11697
  );
11291
11698
  }
11292
11699
  return new _CodexCliSkill({
@@ -11320,17 +11727,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
11320
11727
  };
11321
11728
 
11322
11729
  // src/features/skills/copilot-skill.ts
11323
- import { join as join77 } from "path";
11324
- import { z as z39 } from "zod/mini";
11325
- var CopilotSkillFrontmatterSchema = z39.looseObject({
11326
- name: z39.string(),
11327
- description: z39.string(),
11328
- license: z39.optional(z39.string())
11730
+ import { join as join79 } from "path";
11731
+ import { z as z40 } from "zod/mini";
11732
+ var CopilotSkillFrontmatterSchema = z40.looseObject({
11733
+ name: z40.string(),
11734
+ description: z40.string(),
11735
+ license: z40.optional(z40.string())
11329
11736
  });
11330
11737
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
11331
11738
  constructor({
11332
11739
  baseDir = process.cwd(),
11333
- relativeDirPath = join77(".github", "skills"),
11740
+ relativeDirPath = join79(".github", "skills"),
11334
11741
  dirName,
11335
11742
  frontmatter,
11336
11743
  body,
@@ -11362,7 +11769,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11362
11769
  throw new Error("CopilotSkill does not support global mode.");
11363
11770
  }
11364
11771
  return {
11365
- relativeDirPath: join77(".github", "skills")
11772
+ relativeDirPath: join79(".github", "skills")
11366
11773
  };
11367
11774
  }
11368
11775
  getFrontmatter() {
@@ -11448,9 +11855,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11448
11855
  });
11449
11856
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11450
11857
  if (!result.success) {
11451
- const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11858
+ const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11452
11859
  throw new Error(
11453
- `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11860
+ `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11454
11861
  );
11455
11862
  }
11456
11863
  return new _CopilotSkill({
@@ -11485,16 +11892,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
11485
11892
  };
11486
11893
 
11487
11894
  // src/features/skills/cursor-skill.ts
11488
- import { join as join78 } from "path";
11489
- import { z as z40 } from "zod/mini";
11490
- var CursorSkillFrontmatterSchema = z40.looseObject({
11491
- name: z40.string(),
11492
- description: z40.string()
11895
+ import { join as join80 } from "path";
11896
+ import { z as z41 } from "zod/mini";
11897
+ var CursorSkillFrontmatterSchema = z41.looseObject({
11898
+ name: z41.string(),
11899
+ description: z41.string()
11493
11900
  });
11494
11901
  var CursorSkill = class _CursorSkill extends ToolSkill {
11495
11902
  constructor({
11496
11903
  baseDir = process.cwd(),
11497
- relativeDirPath = join78(".cursor", "skills"),
11904
+ relativeDirPath = join80(".cursor", "skills"),
11498
11905
  dirName,
11499
11906
  frontmatter,
11500
11907
  body,
@@ -11523,7 +11930,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11523
11930
  }
11524
11931
  static getSettablePaths(_options) {
11525
11932
  return {
11526
- relativeDirPath: join78(".cursor", "skills")
11933
+ relativeDirPath: join80(".cursor", "skills")
11527
11934
  };
11528
11935
  }
11529
11936
  getFrontmatter() {
@@ -11603,9 +12010,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11603
12010
  });
11604
12011
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11605
12012
  if (!result.success) {
11606
- const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12013
+ const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11607
12014
  throw new Error(
11608
- `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12015
+ `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11609
12016
  );
11610
12017
  }
11611
12018
  return new _CursorSkill({
@@ -11640,17 +12047,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
11640
12047
  };
11641
12048
 
11642
12049
  // src/features/skills/deepagents-skill.ts
11643
- import { join as join79 } from "path";
11644
- import { z as z41 } from "zod/mini";
11645
- var DeepagentsSkillFrontmatterSchema = z41.looseObject({
11646
- name: z41.string(),
11647
- description: z41.string(),
11648
- "allowed-tools": z41.optional(z41.array(z41.string()))
12050
+ import { join as join81 } from "path";
12051
+ import { z as z42 } from "zod/mini";
12052
+ var DeepagentsSkillFrontmatterSchema = z42.looseObject({
12053
+ name: z42.string(),
12054
+ description: z42.string(),
12055
+ "allowed-tools": z42.optional(z42.array(z42.string()))
11649
12056
  });
11650
12057
  var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11651
12058
  constructor({
11652
12059
  baseDir = process.cwd(),
11653
- relativeDirPath = join79(".deepagents", "skills"),
12060
+ relativeDirPath = join81(".deepagents", "skills"),
11654
12061
  dirName,
11655
12062
  frontmatter,
11656
12063
  body,
@@ -11679,7 +12086,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11679
12086
  }
11680
12087
  static getSettablePaths(_options) {
11681
12088
  return {
11682
- relativeDirPath: join79(".deepagents", "skills")
12089
+ relativeDirPath: join81(".deepagents", "skills")
11683
12090
  };
11684
12091
  }
11685
12092
  getFrontmatter() {
@@ -11765,9 +12172,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11765
12172
  });
11766
12173
  const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11767
12174
  if (!result.success) {
11768
- const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12175
+ const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11769
12176
  throw new Error(
11770
- `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12177
+ `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11771
12178
  );
11772
12179
  }
11773
12180
  return new _DeepagentsSkill({
@@ -11802,11 +12209,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11802
12209
  };
11803
12210
 
11804
12211
  // src/features/skills/geminicli-skill.ts
11805
- import { join as join80 } from "path";
11806
- import { z as z42 } from "zod/mini";
11807
- var GeminiCliSkillFrontmatterSchema = z42.looseObject({
11808
- name: z42.string(),
11809
- description: z42.string()
12212
+ import { join as join82 } from "path";
12213
+ import { z as z43 } from "zod/mini";
12214
+ var GeminiCliSkillFrontmatterSchema = z43.looseObject({
12215
+ name: z43.string(),
12216
+ description: z43.string()
11810
12217
  });
11811
12218
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11812
12219
  constructor({
@@ -11842,7 +12249,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11842
12249
  global: _global = false
11843
12250
  } = {}) {
11844
12251
  return {
11845
- relativeDirPath: join80(".gemini", "skills")
12252
+ relativeDirPath: join82(".gemini", "skills")
11846
12253
  };
11847
12254
  }
11848
12255
  getFrontmatter() {
@@ -11922,9 +12329,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11922
12329
  });
11923
12330
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11924
12331
  if (!result.success) {
11925
- const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12332
+ const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11926
12333
  throw new Error(
11927
- `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12334
+ `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11928
12335
  );
11929
12336
  }
11930
12337
  return new _GeminiCliSkill({
@@ -11959,16 +12366,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11959
12366
  };
11960
12367
 
11961
12368
  // src/features/skills/junie-skill.ts
11962
- import { join as join81 } from "path";
11963
- import { z as z43 } from "zod/mini";
11964
- var JunieSkillFrontmatterSchema = z43.looseObject({
11965
- name: z43.string(),
11966
- description: z43.string()
12369
+ import { join as join83 } from "path";
12370
+ import { z as z44 } from "zod/mini";
12371
+ var JunieSkillFrontmatterSchema = z44.looseObject({
12372
+ name: z44.string(),
12373
+ description: z44.string()
11967
12374
  });
11968
12375
  var JunieSkill = class _JunieSkill extends ToolSkill {
11969
12376
  constructor({
11970
12377
  baseDir = process.cwd(),
11971
- relativeDirPath = join81(".junie", "skills"),
12378
+ relativeDirPath = join83(".junie", "skills"),
11972
12379
  dirName,
11973
12380
  frontmatter,
11974
12381
  body,
@@ -12000,7 +12407,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12000
12407
  throw new Error("JunieSkill does not support global mode.");
12001
12408
  }
12002
12409
  return {
12003
- relativeDirPath: join81(".junie", "skills")
12410
+ relativeDirPath: join83(".junie", "skills")
12004
12411
  };
12005
12412
  }
12006
12413
  getFrontmatter() {
@@ -12087,13 +12494,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12087
12494
  });
12088
12495
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12089
12496
  if (!result.success) {
12090
- const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12497
+ const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12091
12498
  throw new Error(
12092
- `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12499
+ `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12093
12500
  );
12094
12501
  }
12095
12502
  if (result.data.name !== loaded.dirName) {
12096
- const skillFilePath = join81(
12503
+ const skillFilePath = join83(
12097
12504
  loaded.baseDir,
12098
12505
  loaded.relativeDirPath,
12099
12506
  loaded.dirName,
@@ -12135,17 +12542,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
12135
12542
  };
12136
12543
 
12137
12544
  // src/features/skills/kilo-skill.ts
12138
- import { join as join82 } from "path";
12139
- import { z as z44 } from "zod/mini";
12140
- var KiloSkillFrontmatterSchema = z44.looseObject({
12141
- name: z44.string(),
12142
- description: z44.string(),
12143
- "allowed-tools": z44.optional(z44.array(z44.string()))
12545
+ import { join as join84 } from "path";
12546
+ import { z as z45 } from "zod/mini";
12547
+ var KiloSkillFrontmatterSchema = z45.looseObject({
12548
+ name: z45.string(),
12549
+ description: z45.string(),
12550
+ "allowed-tools": z45.optional(z45.array(z45.string()))
12144
12551
  });
12145
12552
  var KiloSkill = class _KiloSkill extends ToolSkill {
12146
12553
  constructor({
12147
12554
  baseDir = process.cwd(),
12148
- relativeDirPath = join82(".kilo", "skills"),
12555
+ relativeDirPath = join84(".kilo", "skills"),
12149
12556
  dirName,
12150
12557
  frontmatter,
12151
12558
  body,
@@ -12174,7 +12581,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12174
12581
  }
12175
12582
  static getSettablePaths({ global = false } = {}) {
12176
12583
  return {
12177
- relativeDirPath: global ? join82(".config", "kilo", "skills") : join82(".kilo", "skills")
12584
+ relativeDirPath: global ? join84(".config", "kilo", "skills") : join84(".kilo", "skills")
12178
12585
  };
12179
12586
  }
12180
12587
  getFrontmatter() {
@@ -12260,9 +12667,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12260
12667
  });
12261
12668
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12262
12669
  if (!result.success) {
12263
- const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12670
+ const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12264
12671
  throw new Error(
12265
- `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12672
+ `Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12266
12673
  );
12267
12674
  }
12268
12675
  return new _KiloSkill({
@@ -12296,16 +12703,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
12296
12703
  };
12297
12704
 
12298
12705
  // src/features/skills/kiro-skill.ts
12299
- import { join as join83 } from "path";
12300
- import { z as z45 } from "zod/mini";
12301
- var KiroSkillFrontmatterSchema = z45.looseObject({
12302
- name: z45.string(),
12303
- description: z45.string()
12706
+ import { join as join85 } from "path";
12707
+ import { z as z46 } from "zod/mini";
12708
+ var KiroSkillFrontmatterSchema = z46.looseObject({
12709
+ name: z46.string(),
12710
+ description: z46.string()
12304
12711
  });
12305
12712
  var KiroSkill = class _KiroSkill extends ToolSkill {
12306
12713
  constructor({
12307
12714
  baseDir = process.cwd(),
12308
- relativeDirPath = join83(".kiro", "skills"),
12715
+ relativeDirPath = join85(".kiro", "skills"),
12309
12716
  dirName,
12310
12717
  frontmatter,
12311
12718
  body,
@@ -12337,7 +12744,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12337
12744
  throw new Error("KiroSkill does not support global mode.");
12338
12745
  }
12339
12746
  return {
12340
- relativeDirPath: join83(".kiro", "skills")
12747
+ relativeDirPath: join85(".kiro", "skills")
12341
12748
  };
12342
12749
  }
12343
12750
  getFrontmatter() {
@@ -12425,13 +12832,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12425
12832
  });
12426
12833
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12427
12834
  if (!result.success) {
12428
- const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12835
+ const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12429
12836
  throw new Error(
12430
- `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12837
+ `Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12431
12838
  );
12432
12839
  }
12433
12840
  if (result.data.name !== loaded.dirName) {
12434
- const skillFilePath = join83(
12841
+ const skillFilePath = join85(
12435
12842
  loaded.baseDir,
12436
12843
  loaded.relativeDirPath,
12437
12844
  loaded.dirName,
@@ -12473,17 +12880,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
12473
12880
  };
12474
12881
 
12475
12882
  // src/features/skills/opencode-skill.ts
12476
- import { join as join84 } from "path";
12477
- import { z as z46 } from "zod/mini";
12478
- var OpenCodeSkillFrontmatterSchema = z46.looseObject({
12479
- name: z46.string(),
12480
- description: z46.string(),
12481
- "allowed-tools": z46.optional(z46.array(z46.string()))
12883
+ import { join as join86 } from "path";
12884
+ import { z as z47 } from "zod/mini";
12885
+ var OpenCodeSkillFrontmatterSchema = z47.looseObject({
12886
+ name: z47.string(),
12887
+ description: z47.string(),
12888
+ "allowed-tools": z47.optional(z47.array(z47.string()))
12482
12889
  });
12483
12890
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12484
12891
  constructor({
12485
12892
  baseDir = process.cwd(),
12486
- relativeDirPath = join84(".opencode", "skill"),
12893
+ relativeDirPath = join86(".opencode", "skill"),
12487
12894
  dirName,
12488
12895
  frontmatter,
12489
12896
  body,
@@ -12512,7 +12919,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12512
12919
  }
12513
12920
  static getSettablePaths({ global = false } = {}) {
12514
12921
  return {
12515
- relativeDirPath: global ? join84(".config", "opencode", "skill") : join84(".opencode", "skill")
12922
+ relativeDirPath: global ? join86(".config", "opencode", "skill") : join86(".opencode", "skill")
12516
12923
  };
12517
12924
  }
12518
12925
  getFrontmatter() {
@@ -12598,9 +13005,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12598
13005
  });
12599
13006
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12600
13007
  if (!result.success) {
12601
- const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13008
+ const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12602
13009
  throw new Error(
12603
- `Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13010
+ `Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12604
13011
  );
12605
13012
  }
12606
13013
  return new _OpenCodeSkill({
@@ -12634,16 +13041,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
12634
13041
  };
12635
13042
 
12636
13043
  // src/features/skills/replit-skill.ts
12637
- import { join as join85 } from "path";
12638
- import { z as z47 } from "zod/mini";
12639
- var ReplitSkillFrontmatterSchema = z47.looseObject({
12640
- name: z47.string(),
12641
- description: z47.string()
13044
+ import { join as join87 } from "path";
13045
+ import { z as z48 } from "zod/mini";
13046
+ var ReplitSkillFrontmatterSchema = z48.looseObject({
13047
+ name: z48.string(),
13048
+ description: z48.string()
12642
13049
  });
12643
13050
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
12644
13051
  constructor({
12645
13052
  baseDir = process.cwd(),
12646
- relativeDirPath = join85(".agents", "skills"),
13053
+ relativeDirPath = join87(".agents", "skills"),
12647
13054
  dirName,
12648
13055
  frontmatter,
12649
13056
  body,
@@ -12675,7 +13082,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12675
13082
  throw new Error("ReplitSkill does not support global mode.");
12676
13083
  }
12677
13084
  return {
12678
- relativeDirPath: join85(".agents", "skills")
13085
+ relativeDirPath: join87(".agents", "skills")
12679
13086
  };
12680
13087
  }
12681
13088
  getFrontmatter() {
@@ -12755,9 +13162,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12755
13162
  });
12756
13163
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12757
13164
  if (!result.success) {
12758
- const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13165
+ const skillDirPath = join87(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12759
13166
  throw new Error(
12760
- `Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13167
+ `Invalid frontmatter in ${join87(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12761
13168
  );
12762
13169
  }
12763
13170
  return new _ReplitSkill({
@@ -12792,16 +13199,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12792
13199
  };
12793
13200
 
12794
13201
  // src/features/skills/roo-skill.ts
12795
- import { join as join86 } from "path";
12796
- import { z as z48 } from "zod/mini";
12797
- var RooSkillFrontmatterSchema = z48.looseObject({
12798
- name: z48.string(),
12799
- description: z48.string()
13202
+ import { join as join88 } from "path";
13203
+ import { z as z49 } from "zod/mini";
13204
+ var RooSkillFrontmatterSchema = z49.looseObject({
13205
+ name: z49.string(),
13206
+ description: z49.string()
12800
13207
  });
12801
13208
  var RooSkill = class _RooSkill extends ToolSkill {
12802
13209
  constructor({
12803
13210
  baseDir = process.cwd(),
12804
- relativeDirPath = join86(".roo", "skills"),
13211
+ relativeDirPath = join88(".roo", "skills"),
12805
13212
  dirName,
12806
13213
  frontmatter,
12807
13214
  body,
@@ -12832,7 +13239,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
12832
13239
  global: _global = false
12833
13240
  } = {}) {
12834
13241
  return {
12835
- relativeDirPath: join86(".roo", "skills")
13242
+ relativeDirPath: join88(".roo", "skills")
12836
13243
  };
12837
13244
  }
12838
13245
  getFrontmatter() {
@@ -12920,13 +13327,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
12920
13327
  });
12921
13328
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12922
13329
  if (!result.success) {
12923
- const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
13330
+ const skillDirPath = join88(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12924
13331
  throw new Error(
12925
- `Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
13332
+ `Invalid frontmatter in ${join88(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12926
13333
  );
12927
13334
  }
12928
13335
  if (result.data.name !== loaded.dirName) {
12929
- const skillFilePath = join86(
13336
+ const skillFilePath = join88(
12930
13337
  loaded.baseDir,
12931
13338
  loaded.relativeDirPath,
12932
13339
  loaded.dirName,
@@ -12967,14 +13374,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
12967
13374
  };
12968
13375
 
12969
13376
  // src/features/skills/skills-utils.ts
12970
- import { basename as basename4, join as join87 } from "path";
13377
+ import { basename as basename4, join as join89 } from "path";
12971
13378
  async function getLocalSkillDirNames(baseDir) {
12972
- const skillsDir = join87(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
13379
+ const skillsDir = join89(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12973
13380
  const names = /* @__PURE__ */ new Set();
12974
13381
  if (!await directoryExists(skillsDir)) {
12975
13382
  return names;
12976
13383
  }
12977
- const dirPaths = await findFilesByGlobs(join87(skillsDir, "*"), { type: "dir" });
13384
+ const dirPaths = await findFilesByGlobs(join89(skillsDir, "*"), { type: "dir" });
12978
13385
  for (const dirPath of dirPaths) {
12979
13386
  const name = basename4(dirPath);
12980
13387
  if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
@@ -13005,7 +13412,7 @@ var skillsProcessorToolTargetTuple = [
13005
13412
  "roo",
13006
13413
  "rovodev"
13007
13414
  ];
13008
- var SkillsProcessorToolTargetSchema = z49.enum(skillsProcessorToolTargetTuple);
13415
+ var SkillsProcessorToolTargetSchema = z50.enum(skillsProcessorToolTargetTuple);
13009
13416
  var toolSkillFactories = /* @__PURE__ */ new Map([
13010
13417
  [
13011
13418
  "agentsmd",
@@ -13229,10 +13636,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13229
13636
  )
13230
13637
  );
13231
13638
  const localSkillNames = new Set(localDirNames);
13232
- const curatedDirPath = join88(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13639
+ const curatedDirPath = join90(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13233
13640
  let curatedSkills = [];
13234
13641
  if (await directoryExists(curatedDirPath)) {
13235
- const curatedDirPaths = await findFilesByGlobs(join88(curatedDirPath, "*"), { type: "dir" });
13642
+ const curatedDirPaths = await findFilesByGlobs(join90(curatedDirPath, "*"), { type: "dir" });
13236
13643
  const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
13237
13644
  const nonConflicting = curatedDirNames.filter((name) => {
13238
13645
  if (localSkillNames.has(name)) {
@@ -13270,11 +13677,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13270
13677
  const seenDirNames = /* @__PURE__ */ new Set();
13271
13678
  const loadEntries = [];
13272
13679
  for (const root of roots) {
13273
- const skillsDirPath = join88(this.baseDir, root);
13680
+ const skillsDirPath = join90(this.baseDir, root);
13274
13681
  if (!await directoryExists(skillsDirPath)) {
13275
13682
  continue;
13276
13683
  }
13277
- const dirPaths = await findFilesByGlobs(join88(skillsDirPath, "*"), { type: "dir" });
13684
+ const dirPaths = await findFilesByGlobs(join90(skillsDirPath, "*"), { type: "dir" });
13278
13685
  for (const dirPath of dirPaths) {
13279
13686
  const dirName = basename5(dirPath);
13280
13687
  if (seenDirNames.has(dirName)) {
@@ -13305,11 +13712,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13305
13712
  const roots = toolSkillSearchRoots(paths);
13306
13713
  const toolSkills = [];
13307
13714
  for (const root of roots) {
13308
- const skillsDirPath = join88(this.baseDir, root);
13715
+ const skillsDirPath = join90(this.baseDir, root);
13309
13716
  if (!await directoryExists(skillsDirPath)) {
13310
13717
  continue;
13311
13718
  }
13312
- const dirPaths = await findFilesByGlobs(join88(skillsDirPath, "*"), { type: "dir" });
13719
+ const dirPaths = await findFilesByGlobs(join90(skillsDirPath, "*"), { type: "dir" });
13313
13720
  for (const dirPath of dirPaths) {
13314
13721
  const dirName = basename5(dirPath);
13315
13722
  const toolSkill = factory.class.forDeletion({
@@ -13373,11 +13780,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
13373
13780
  };
13374
13781
 
13375
13782
  // src/features/subagents/agentsmd-subagent.ts
13376
- import { join as join90 } from "path";
13783
+ import { join as join92 } from "path";
13377
13784
 
13378
13785
  // src/features/subagents/simulated-subagent.ts
13379
- import { basename as basename6, join as join89 } from "path";
13380
- import { z as z50 } from "zod/mini";
13786
+ import { basename as basename6, join as join91 } from "path";
13787
+ import { z as z51 } from "zod/mini";
13381
13788
 
13382
13789
  // src/features/subagents/tool-subagent.ts
13383
13790
  var ToolSubagent = class extends ToolFile {
@@ -13429,9 +13836,9 @@ var ToolSubagent = class extends ToolFile {
13429
13836
  };
13430
13837
 
13431
13838
  // src/features/subagents/simulated-subagent.ts
13432
- var SimulatedSubagentFrontmatterSchema = z50.object({
13433
- name: z50.string(),
13434
- description: z50.optional(z50.string())
13839
+ var SimulatedSubagentFrontmatterSchema = z51.object({
13840
+ name: z51.string(),
13841
+ description: z51.optional(z51.string())
13435
13842
  });
13436
13843
  var SimulatedSubagent = class extends ToolSubagent {
13437
13844
  frontmatter;
@@ -13441,7 +13848,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13441
13848
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
13442
13849
  if (!result.success) {
13443
13850
  throw new Error(
13444
- `Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13851
+ `Invalid frontmatter in ${join91(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13445
13852
  );
13446
13853
  }
13447
13854
  }
@@ -13492,7 +13899,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13492
13899
  return {
13493
13900
  success: false,
13494
13901
  error: new Error(
13495
- `Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13902
+ `Invalid frontmatter in ${join91(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13496
13903
  )
13497
13904
  };
13498
13905
  }
@@ -13502,7 +13909,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13502
13909
  relativeFilePath,
13503
13910
  validate = true
13504
13911
  }) {
13505
- const filePath = join89(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13912
+ const filePath = join91(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13506
13913
  const fileContent = await readFileContent(filePath);
13507
13914
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13508
13915
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13538,7 +13945,7 @@ var SimulatedSubagent = class extends ToolSubagent {
13538
13945
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13539
13946
  static getSettablePaths() {
13540
13947
  return {
13541
- relativeDirPath: join90(".agents", "subagents")
13948
+ relativeDirPath: join92(".agents", "subagents")
13542
13949
  };
13543
13950
  }
13544
13951
  static async fromFile(params) {
@@ -13561,11 +13968,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
13561
13968
  };
13562
13969
 
13563
13970
  // src/features/subagents/factorydroid-subagent.ts
13564
- import { join as join91 } from "path";
13971
+ import { join as join93 } from "path";
13565
13972
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
13566
13973
  static getSettablePaths(_options) {
13567
13974
  return {
13568
- relativeDirPath: join91(".factory", "droids")
13975
+ relativeDirPath: join93(".factory", "droids")
13569
13976
  };
13570
13977
  }
13571
13978
  static async fromFile(params) {
@@ -13588,16 +13995,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
13588
13995
  };
13589
13996
 
13590
13997
  // src/features/subagents/geminicli-subagent.ts
13591
- import { join as join93 } from "path";
13592
- import { z as z52 } from "zod/mini";
13998
+ import { join as join95 } from "path";
13999
+ import { z as z53 } from "zod/mini";
13593
14000
 
13594
14001
  // src/features/subagents/rulesync-subagent.ts
13595
- import { basename as basename7, join as join92 } from "path";
13596
- import { z as z51 } from "zod/mini";
13597
- var RulesyncSubagentFrontmatterSchema = z51.looseObject({
13598
- targets: z51._default(RulesyncTargetsSchema, ["*"]),
13599
- name: z51.string(),
13600
- description: z51.optional(z51.string())
14002
+ import { basename as basename7, join as join94 } from "path";
14003
+ import { z as z52 } from "zod/mini";
14004
+ var RulesyncSubagentFrontmatterSchema = z52.looseObject({
14005
+ targets: z52._default(RulesyncTargetsSchema, ["*"]),
14006
+ name: z52.string(),
14007
+ description: z52.optional(z52.string())
13601
14008
  });
13602
14009
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13603
14010
  frontmatter;
@@ -13606,7 +14013,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13606
14013
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
13607
14014
  if (!parseResult.success && rest.validate !== false) {
13608
14015
  throw new Error(
13609
- `Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
14016
+ `Invalid frontmatter in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
13610
14017
  );
13611
14018
  }
13612
14019
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -13639,7 +14046,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13639
14046
  return {
13640
14047
  success: false,
13641
14048
  error: new Error(
13642
- `Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14049
+ `Invalid frontmatter in ${join94(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13643
14050
  )
13644
14051
  };
13645
14052
  }
@@ -13647,7 +14054,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13647
14054
  static async fromFile({
13648
14055
  relativeFilePath
13649
14056
  }) {
13650
- const filePath = join92(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
14057
+ const filePath = join94(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
13651
14058
  const fileContent = await readFileContent(filePath);
13652
14059
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13653
14060
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13666,9 +14073,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13666
14073
  };
13667
14074
 
13668
14075
  // src/features/subagents/geminicli-subagent.ts
13669
- var GeminiCliSubagentFrontmatterSchema = z52.looseObject({
13670
- name: z52.string(),
13671
- description: z52.optional(z52.string())
14076
+ var GeminiCliSubagentFrontmatterSchema = z53.looseObject({
14077
+ name: z53.string(),
14078
+ description: z53.optional(z53.string())
13672
14079
  });
13673
14080
  var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13674
14081
  frontmatter;
@@ -13678,7 +14085,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13678
14085
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
13679
14086
  if (!result.success) {
13680
14087
  throw new Error(
13681
- `Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14088
+ `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13682
14089
  );
13683
14090
  }
13684
14091
  }
@@ -13691,7 +14098,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13691
14098
  }
13692
14099
  static getSettablePaths(_options = {}) {
13693
14100
  return {
13694
- relativeDirPath: join93(".gemini", "agents")
14101
+ relativeDirPath: join95(".gemini", "agents")
13695
14102
  };
13696
14103
  }
13697
14104
  getFrontmatter() {
@@ -13759,7 +14166,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13759
14166
  return {
13760
14167
  success: false,
13761
14168
  error: new Error(
13762
- `Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14169
+ `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13763
14170
  )
13764
14171
  };
13765
14172
  }
@@ -13777,7 +14184,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13777
14184
  global = false
13778
14185
  }) {
13779
14186
  const paths = this.getSettablePaths({ global });
13780
- const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
14187
+ const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
13781
14188
  const fileContent = await readFileContent(filePath);
13782
14189
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13783
14190
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13813,11 +14220,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13813
14220
  };
13814
14221
 
13815
14222
  // src/features/subagents/roo-subagent.ts
13816
- import { join as join94 } from "path";
14223
+ import { join as join96 } from "path";
13817
14224
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13818
14225
  static getSettablePaths() {
13819
14226
  return {
13820
- relativeDirPath: join94(".roo", "subagents")
14227
+ relativeDirPath: join96(".roo", "subagents")
13821
14228
  };
13822
14229
  }
13823
14230
  static async fromFile(params) {
@@ -13840,11 +14247,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13840
14247
  };
13841
14248
 
13842
14249
  // src/features/subagents/rovodev-subagent.ts
13843
- import { join as join95 } from "path";
13844
- import { z as z53 } from "zod/mini";
13845
- var RovodevSubagentFrontmatterSchema = z53.looseObject({
13846
- name: z53.string(),
13847
- description: z53.optional(z53.string())
14250
+ import { join as join97 } from "path";
14251
+ import { z as z54 } from "zod/mini";
14252
+ var RovodevSubagentFrontmatterSchema = z54.looseObject({
14253
+ name: z54.string(),
14254
+ description: z54.optional(z54.string())
13848
14255
  });
13849
14256
  var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13850
14257
  frontmatter;
@@ -13854,7 +14261,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13854
14261
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
13855
14262
  if (!result.success) {
13856
14263
  throw new Error(
13857
- `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14264
+ `Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13858
14265
  );
13859
14266
  }
13860
14267
  }
@@ -13866,7 +14273,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13866
14273
  }
13867
14274
  static getSettablePaths(_options = {}) {
13868
14275
  return {
13869
- relativeDirPath: join95(".rovodev", "subagents")
14276
+ relativeDirPath: join97(".rovodev", "subagents")
13870
14277
  };
13871
14278
  }
13872
14279
  getFrontmatter() {
@@ -13929,7 +14336,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13929
14336
  return {
13930
14337
  success: false,
13931
14338
  error: new Error(
13932
- `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14339
+ `Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13933
14340
  )
13934
14341
  };
13935
14342
  }
@@ -13946,7 +14353,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13946
14353
  global = false
13947
14354
  }) {
13948
14355
  const paths = this.getSettablePaths({ global });
13949
- const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
14356
+ const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
13950
14357
  const fileContent = await readFileContent(filePath);
13951
14358
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13952
14359
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13985,19 +14392,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13985
14392
  };
13986
14393
 
13987
14394
  // src/features/subagents/subagents-processor.ts
13988
- import { basename as basename9, join as join106 } from "path";
13989
- import { z as z62 } from "zod/mini";
14395
+ import { basename as basename9, join as join108 } from "path";
14396
+ import { z as z63 } from "zod/mini";
13990
14397
 
13991
14398
  // src/features/subagents/claudecode-subagent.ts
13992
- import { join as join96 } from "path";
13993
- import { z as z54 } from "zod/mini";
13994
- var ClaudecodeSubagentFrontmatterSchema = z54.looseObject({
13995
- name: z54.string(),
13996
- description: z54.optional(z54.string()),
13997
- model: z54.optional(z54.string()),
13998
- tools: z54.optional(z54.union([z54.string(), z54.array(z54.string())])),
13999
- permissionMode: z54.optional(z54.string()),
14000
- skills: z54.optional(z54.union([z54.string(), z54.array(z54.string())]))
14399
+ import { join as join98 } from "path";
14400
+ import { z as z55 } from "zod/mini";
14401
+ var ClaudecodeSubagentFrontmatterSchema = z55.looseObject({
14402
+ name: z55.string(),
14403
+ description: z55.optional(z55.string()),
14404
+ model: z55.optional(z55.string()),
14405
+ tools: z55.optional(z55.union([z55.string(), z55.array(z55.string())])),
14406
+ permissionMode: z55.optional(z55.string()),
14407
+ skills: z55.optional(z55.union([z55.string(), z55.array(z55.string())]))
14001
14408
  });
14002
14409
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14003
14410
  frontmatter;
@@ -14007,7 +14414,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14007
14414
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
14008
14415
  if (!result.success) {
14009
14416
  throw new Error(
14010
- `Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14417
+ `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14011
14418
  );
14012
14419
  }
14013
14420
  }
@@ -14019,7 +14426,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14019
14426
  }
14020
14427
  static getSettablePaths(_options = {}) {
14021
14428
  return {
14022
- relativeDirPath: join96(".claude", "agents")
14429
+ relativeDirPath: join98(".claude", "agents")
14023
14430
  };
14024
14431
  }
14025
14432
  getFrontmatter() {
@@ -14098,7 +14505,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14098
14505
  return {
14099
14506
  success: false,
14100
14507
  error: new Error(
14101
- `Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14508
+ `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14102
14509
  )
14103
14510
  };
14104
14511
  }
@@ -14116,7 +14523,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14116
14523
  global = false
14117
14524
  }) {
14118
14525
  const paths = this.getSettablePaths({ global });
14119
- const filePath = join96(baseDir, paths.relativeDirPath, relativeFilePath);
14526
+ const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
14120
14527
  const fileContent = await readFileContent(filePath);
14121
14528
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14122
14529
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14151,27 +14558,27 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
14151
14558
  };
14152
14559
 
14153
14560
  // src/features/subagents/codexcli-subagent.ts
14154
- import { join as join97 } from "path";
14155
- import * as smolToml4 from "smol-toml";
14156
- import { z as z55 } from "zod/mini";
14157
- var CodexCliSubagentTomlSchema = z55.looseObject({
14158
- name: z55.string(),
14159
- description: z55.optional(z55.string()),
14160
- developer_instructions: z55.optional(z55.string()),
14161
- model: z55.optional(z55.string()),
14162
- model_reasoning_effort: z55.optional(z55.string()),
14163
- sandbox_mode: z55.optional(z55.string())
14561
+ import { join as join99 } from "path";
14562
+ import * as smolToml5 from "smol-toml";
14563
+ import { z as z56 } from "zod/mini";
14564
+ var CodexCliSubagentTomlSchema = z56.looseObject({
14565
+ name: z56.string(),
14566
+ description: z56.optional(z56.string()),
14567
+ developer_instructions: z56.optional(z56.string()),
14568
+ model: z56.optional(z56.string()),
14569
+ model_reasoning_effort: z56.optional(z56.string()),
14570
+ sandbox_mode: z56.optional(z56.string())
14164
14571
  });
14165
14572
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14166
14573
  body;
14167
14574
  constructor({ body, ...rest }) {
14168
14575
  if (rest.validate !== false) {
14169
14576
  try {
14170
- const parsed = smolToml4.parse(body);
14577
+ const parsed = smolToml5.parse(body);
14171
14578
  CodexCliSubagentTomlSchema.parse(parsed);
14172
14579
  } catch (error) {
14173
14580
  throw new Error(
14174
- `Invalid TOML in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14581
+ `Invalid TOML in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14175
14582
  { cause: error }
14176
14583
  );
14177
14584
  }
@@ -14183,7 +14590,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14183
14590
  }
14184
14591
  static getSettablePaths(_options = {}) {
14185
14592
  return {
14186
- relativeDirPath: join97(".codex", "agents")
14593
+ relativeDirPath: join99(".codex", "agents")
14187
14594
  };
14188
14595
  }
14189
14596
  getBody() {
@@ -14192,10 +14599,10 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14192
14599
  toRulesyncSubagent() {
14193
14600
  let parsed;
14194
14601
  try {
14195
- parsed = CodexCliSubagentTomlSchema.parse(smolToml4.parse(this.body));
14602
+ parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
14196
14603
  } catch (error) {
14197
14604
  throw new Error(
14198
- `Failed to parse TOML in ${join97(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14605
+ `Failed to parse TOML in ${join99(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14199
14606
  { cause: error }
14200
14607
  );
14201
14608
  }
@@ -14238,7 +14645,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14238
14645
  ...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
14239
14646
  ...codexcliSection
14240
14647
  };
14241
- const body = smolToml4.stringify(tomlObj);
14648
+ const body = smolToml5.stringify(tomlObj);
14242
14649
  const paths = this.getSettablePaths({ global });
14243
14650
  const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
14244
14651
  return new _CodexCliSubagent({
@@ -14253,7 +14660,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14253
14660
  }
14254
14661
  validate() {
14255
14662
  try {
14256
- const parsed = smolToml4.parse(this.body);
14663
+ const parsed = smolToml5.parse(this.body);
14257
14664
  CodexCliSubagentTomlSchema.parse(parsed);
14258
14665
  return { success: true, error: null };
14259
14666
  } catch (error) {
@@ -14276,7 +14683,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14276
14683
  global = false
14277
14684
  }) {
14278
14685
  const paths = this.getSettablePaths({ global });
14279
- const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
14686
+ const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
14280
14687
  const fileContent = await readFileContent(filePath);
14281
14688
  const subagent = new _CodexCliSubagent({
14282
14689
  baseDir,
@@ -14314,13 +14721,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
14314
14721
  };
14315
14722
 
14316
14723
  // src/features/subagents/copilot-subagent.ts
14317
- import { join as join98 } from "path";
14318
- import { z as z56 } from "zod/mini";
14724
+ import { join as join100 } from "path";
14725
+ import { z as z57 } from "zod/mini";
14319
14726
  var REQUIRED_TOOL = "agent/runSubagent";
14320
- var CopilotSubagentFrontmatterSchema = z56.looseObject({
14321
- name: z56.string(),
14322
- description: z56.optional(z56.string()),
14323
- tools: z56.optional(z56.union([z56.string(), z56.array(z56.string())]))
14727
+ var CopilotSubagentFrontmatterSchema = z57.looseObject({
14728
+ name: z57.string(),
14729
+ description: z57.optional(z57.string()),
14730
+ tools: z57.optional(z57.union([z57.string(), z57.array(z57.string())]))
14324
14731
  });
14325
14732
  var normalizeTools = (tools) => {
14326
14733
  if (!tools) {
@@ -14340,7 +14747,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14340
14747
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
14341
14748
  if (!result.success) {
14342
14749
  throw new Error(
14343
- `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14750
+ `Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14344
14751
  );
14345
14752
  }
14346
14753
  }
@@ -14352,7 +14759,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14352
14759
  }
14353
14760
  static getSettablePaths(_options = {}) {
14354
14761
  return {
14355
- relativeDirPath: join98(".github", "agents")
14762
+ relativeDirPath: join100(".github", "agents")
14356
14763
  };
14357
14764
  }
14358
14765
  getFrontmatter() {
@@ -14404,12 +14811,16 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14404
14811
  const body = rulesyncSubagent.getBody();
14405
14812
  const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
14406
14813
  const paths = this.getSettablePaths({ global });
14814
+ let relativeFilePath = rulesyncSubagent.getRelativeFilePath();
14815
+ if (!relativeFilePath.endsWith(".agent.md")) {
14816
+ relativeFilePath = relativeFilePath.replace(/\.md$/, ".agent.md");
14817
+ }
14407
14818
  return new _CopilotSubagent({
14408
14819
  baseDir,
14409
14820
  frontmatter: copilotFrontmatter,
14410
14821
  body,
14411
14822
  relativeDirPath: paths.relativeDirPath,
14412
- relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
14823
+ relativeFilePath,
14413
14824
  fileContent,
14414
14825
  validate,
14415
14826
  global
@@ -14426,7 +14837,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14426
14837
  return {
14427
14838
  success: false,
14428
14839
  error: new Error(
14429
- `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14840
+ `Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14430
14841
  )
14431
14842
  };
14432
14843
  }
@@ -14444,7 +14855,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14444
14855
  global = false
14445
14856
  }) {
14446
14857
  const paths = this.getSettablePaths({ global });
14447
- const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
14858
+ const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
14448
14859
  const fileContent = await readFileContent(filePath);
14449
14860
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14450
14861
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14480,11 +14891,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
14480
14891
  };
14481
14892
 
14482
14893
  // src/features/subagents/cursor-subagent.ts
14483
- import { join as join99 } from "path";
14484
- import { z as z57 } from "zod/mini";
14485
- var CursorSubagentFrontmatterSchema = z57.looseObject({
14486
- name: z57.string(),
14487
- description: z57.optional(z57.string())
14894
+ import { join as join101 } from "path";
14895
+ import { z as z58 } from "zod/mini";
14896
+ var CursorSubagentFrontmatterSchema = z58.looseObject({
14897
+ name: z58.string(),
14898
+ description: z58.optional(z58.string())
14488
14899
  });
14489
14900
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14490
14901
  frontmatter;
@@ -14494,7 +14905,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14494
14905
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
14495
14906
  if (!result.success) {
14496
14907
  throw new Error(
14497
- `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14908
+ `Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14498
14909
  );
14499
14910
  }
14500
14911
  }
@@ -14506,7 +14917,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14506
14917
  }
14507
14918
  static getSettablePaths(_options = {}) {
14508
14919
  return {
14509
- relativeDirPath: join99(".cursor", "agents")
14920
+ relativeDirPath: join101(".cursor", "agents")
14510
14921
  };
14511
14922
  }
14512
14923
  getFrontmatter() {
@@ -14573,7 +14984,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14573
14984
  return {
14574
14985
  success: false,
14575
14986
  error: new Error(
14576
- `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14987
+ `Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14577
14988
  )
14578
14989
  };
14579
14990
  }
@@ -14591,7 +15002,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14591
15002
  global = false
14592
15003
  }) {
14593
15004
  const paths = this.getSettablePaths({ global });
14594
- const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
15005
+ const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
14595
15006
  const fileContent = await readFileContent(filePath);
14596
15007
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14597
15008
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14627,12 +15038,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
14627
15038
  };
14628
15039
 
14629
15040
  // src/features/subagents/deepagents-subagent.ts
14630
- import { join as join100 } from "path";
14631
- import { z as z58 } from "zod/mini";
14632
- var DeepagentsSubagentFrontmatterSchema = z58.looseObject({
14633
- name: z58.string(),
14634
- description: z58.optional(z58.string()),
14635
- model: z58.optional(z58.string())
15041
+ import { join as join102 } from "path";
15042
+ import { z as z59 } from "zod/mini";
15043
+ var DeepagentsSubagentFrontmatterSchema = z59.looseObject({
15044
+ name: z59.string(),
15045
+ description: z59.optional(z59.string()),
15046
+ model: z59.optional(z59.string())
14636
15047
  });
14637
15048
  var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14638
15049
  frontmatter;
@@ -14642,7 +15053,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14642
15053
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
14643
15054
  if (!result.success) {
14644
15055
  throw new Error(
14645
- `Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15056
+ `Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14646
15057
  );
14647
15058
  }
14648
15059
  }
@@ -14652,7 +15063,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14652
15063
  }
14653
15064
  static getSettablePaths(_options = {}) {
14654
15065
  return {
14655
- relativeDirPath: join100(".deepagents", "agents")
15066
+ relativeDirPath: join102(".deepagents", "agents")
14656
15067
  };
14657
15068
  }
14658
15069
  getFrontmatter() {
@@ -14727,7 +15138,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14727
15138
  return {
14728
15139
  success: false,
14729
15140
  error: new Error(
14730
- `Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15141
+ `Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14731
15142
  )
14732
15143
  };
14733
15144
  }
@@ -14745,7 +15156,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14745
15156
  global = false
14746
15157
  }) {
14747
15158
  const paths = this.getSettablePaths({ global });
14748
- const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
15159
+ const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
14749
15160
  const fileContent = await readFileContent(filePath);
14750
15161
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14751
15162
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14780,11 +15191,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14780
15191
  };
14781
15192
 
14782
15193
  // src/features/subagents/junie-subagent.ts
14783
- import { join as join101 } from "path";
14784
- import { z as z59 } from "zod/mini";
14785
- var JunieSubagentFrontmatterSchema = z59.looseObject({
14786
- name: z59.optional(z59.string()),
14787
- description: z59.string()
15194
+ import { join as join103 } from "path";
15195
+ import { z as z60 } from "zod/mini";
15196
+ var JunieSubagentFrontmatterSchema = z60.looseObject({
15197
+ name: z60.optional(z60.string()),
15198
+ description: z60.string()
14788
15199
  });
14789
15200
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14790
15201
  frontmatter;
@@ -14794,7 +15205,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14794
15205
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
14795
15206
  if (!result.success) {
14796
15207
  throw new Error(
14797
- `Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15208
+ `Invalid frontmatter in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14798
15209
  );
14799
15210
  }
14800
15211
  }
@@ -14809,7 +15220,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14809
15220
  throw new Error("JunieSubagent does not support global mode.");
14810
15221
  }
14811
15222
  return {
14812
- relativeDirPath: join101(".junie", "agents")
15223
+ relativeDirPath: join103(".junie", "agents")
14813
15224
  };
14814
15225
  }
14815
15226
  getFrontmatter() {
@@ -14885,7 +15296,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14885
15296
  return {
14886
15297
  success: false,
14887
15298
  error: new Error(
14888
- `Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15299
+ `Invalid frontmatter in ${join103(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14889
15300
  )
14890
15301
  };
14891
15302
  }
@@ -14903,7 +15314,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14903
15314
  global = false
14904
15315
  }) {
14905
15316
  const paths = this.getSettablePaths({ global });
14906
- const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
15317
+ const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
14907
15318
  const fileContent = await readFileContent(filePath);
14908
15319
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14909
15320
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14938,15 +15349,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14938
15349
  };
14939
15350
 
14940
15351
  // src/features/subagents/kilo-subagent.ts
14941
- import { join as join103 } from "path";
15352
+ import { join as join105 } from "path";
14942
15353
 
14943
15354
  // src/features/subagents/opencode-style-subagent.ts
14944
- import { basename as basename8, join as join102 } from "path";
14945
- import { z as z60 } from "zod/mini";
14946
- var OpenCodeStyleSubagentFrontmatterSchema = z60.looseObject({
14947
- description: z60.optional(z60.string()),
14948
- mode: z60._default(z60.string(), "subagent"),
14949
- name: z60.optional(z60.string())
15355
+ import { basename as basename8, join as join104 } from "path";
15356
+ import { z as z61 } from "zod/mini";
15357
+ var OpenCodeStyleSubagentFrontmatterSchema = z61.looseObject({
15358
+ description: z61.optional(z61.string()),
15359
+ mode: z61._default(z61.string(), "subagent"),
15360
+ name: z61.optional(z61.string())
14950
15361
  });
14951
15362
  var OpenCodeStyleSubagent = class extends ToolSubagent {
14952
15363
  frontmatter;
@@ -14956,7 +15367,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14956
15367
  const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
14957
15368
  if (!result.success) {
14958
15369
  throw new Error(
14959
- `Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15370
+ `Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14960
15371
  );
14961
15372
  }
14962
15373
  }
@@ -14998,7 +15409,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14998
15409
  return {
14999
15410
  success: false,
15000
15411
  error: new Error(
15001
- `Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15412
+ `Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15002
15413
  )
15003
15414
  };
15004
15415
  }
@@ -15014,7 +15425,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15014
15425
  global = false
15015
15426
  } = {}) {
15016
15427
  return {
15017
- relativeDirPath: global ? join103(".config", "kilo", "agent") : join103(".kilo", "agent")
15428
+ relativeDirPath: global ? join105(".config", "kilo", "agent") : join105(".kilo", "agent")
15018
15429
  };
15019
15430
  }
15020
15431
  static fromRulesyncSubagent({
@@ -15058,7 +15469,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15058
15469
  global = false
15059
15470
  }) {
15060
15471
  const paths = this.getSettablePaths({ global });
15061
- const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
15472
+ const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
15062
15473
  const fileContent = await readFileContent(filePath);
15063
15474
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15064
15475
  const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15094,23 +15505,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
15094
15505
  };
15095
15506
 
15096
15507
  // src/features/subagents/kiro-subagent.ts
15097
- import { join as join104 } from "path";
15098
- import { z as z61 } from "zod/mini";
15099
- var KiroCliSubagentJsonSchema = z61.looseObject({
15100
- name: z61.string(),
15101
- description: z61.optional(z61.nullable(z61.string())),
15102
- prompt: z61.optional(z61.nullable(z61.string())),
15103
- tools: z61.optional(z61.nullable(z61.array(z61.string()))),
15104
- toolAliases: z61.optional(z61.nullable(z61.record(z61.string(), z61.string()))),
15105
- toolSettings: z61.optional(z61.nullable(z61.unknown())),
15106
- toolSchema: z61.optional(z61.nullable(z61.unknown())),
15107
- hooks: z61.optional(z61.nullable(z61.record(z61.string(), z61.array(z61.unknown())))),
15108
- model: z61.optional(z61.nullable(z61.string())),
15109
- mcpServers: z61.optional(z61.nullable(z61.record(z61.string(), z61.unknown()))),
15110
- useLegacyMcpJson: z61.optional(z61.nullable(z61.boolean())),
15111
- resources: z61.optional(z61.nullable(z61.array(z61.string()))),
15112
- allowedTools: z61.optional(z61.nullable(z61.array(z61.string()))),
15113
- includeMcpJson: z61.optional(z61.nullable(z61.boolean()))
15508
+ import { join as join106 } from "path";
15509
+ import { z as z62 } from "zod/mini";
15510
+ var KiroCliSubagentJsonSchema = z62.looseObject({
15511
+ name: z62.string(),
15512
+ description: z62.optional(z62.nullable(z62.string())),
15513
+ prompt: z62.optional(z62.nullable(z62.string())),
15514
+ tools: z62.optional(z62.nullable(z62.array(z62.string()))),
15515
+ toolAliases: z62.optional(z62.nullable(z62.record(z62.string(), z62.string()))),
15516
+ toolSettings: z62.optional(z62.nullable(z62.unknown())),
15517
+ toolSchema: z62.optional(z62.nullable(z62.unknown())),
15518
+ hooks: z62.optional(z62.nullable(z62.record(z62.string(), z62.array(z62.unknown())))),
15519
+ model: z62.optional(z62.nullable(z62.string())),
15520
+ mcpServers: z62.optional(z62.nullable(z62.record(z62.string(), z62.unknown()))),
15521
+ useLegacyMcpJson: z62.optional(z62.nullable(z62.boolean())),
15522
+ resources: z62.optional(z62.nullable(z62.array(z62.string()))),
15523
+ allowedTools: z62.optional(z62.nullable(z62.array(z62.string()))),
15524
+ includeMcpJson: z62.optional(z62.nullable(z62.boolean()))
15114
15525
  });
15115
15526
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15116
15527
  body;
@@ -15121,7 +15532,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15121
15532
  KiroCliSubagentJsonSchema.parse(parsed);
15122
15533
  } catch (error) {
15123
15534
  throw new Error(
15124
- `Invalid JSON in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15535
+ `Invalid JSON in ${join106(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15125
15536
  { cause: error }
15126
15537
  );
15127
15538
  }
@@ -15133,7 +15544,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15133
15544
  }
15134
15545
  static getSettablePaths(_options = {}) {
15135
15546
  return {
15136
- relativeDirPath: join104(".kiro", "agents")
15547
+ relativeDirPath: join106(".kiro", "agents")
15137
15548
  };
15138
15549
  }
15139
15550
  getBody() {
@@ -15145,7 +15556,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15145
15556
  parsed = JSON.parse(this.body);
15146
15557
  } catch (error) {
15147
15558
  throw new Error(
15148
- `Failed to parse JSON in ${join104(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15559
+ `Failed to parse JSON in ${join106(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15149
15560
  { cause: error }
15150
15561
  );
15151
15562
  }
@@ -15226,7 +15637,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15226
15637
  global = false
15227
15638
  }) {
15228
15639
  const paths = this.getSettablePaths({ global });
15229
- const filePath = join104(baseDir, paths.relativeDirPath, relativeFilePath);
15640
+ const filePath = join106(baseDir, paths.relativeDirPath, relativeFilePath);
15230
15641
  const fileContent = await readFileContent(filePath);
15231
15642
  const subagent = new _KiroSubagent({
15232
15643
  baseDir,
@@ -15264,7 +15675,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
15264
15675
  };
15265
15676
 
15266
15677
  // src/features/subagents/opencode-subagent.ts
15267
- import { join as join105 } from "path";
15678
+ import { join as join107 } from "path";
15268
15679
  var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
15269
15680
  var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15270
15681
  getToolTarget() {
@@ -15274,7 +15685,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15274
15685
  global = false
15275
15686
  } = {}) {
15276
15687
  return {
15277
- relativeDirPath: global ? join105(".config", "opencode", "agent") : join105(".opencode", "agent")
15688
+ relativeDirPath: global ? join107(".config", "opencode", "agent") : join107(".opencode", "agent")
15278
15689
  };
15279
15690
  }
15280
15691
  static fromRulesyncSubagent({
@@ -15318,7 +15729,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
15318
15729
  global = false
15319
15730
  }) {
15320
15731
  const paths = this.getSettablePaths({ global });
15321
- const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
15732
+ const filePath = join107(baseDir, paths.relativeDirPath, relativeFilePath);
15322
15733
  const fileContent = await readFileContent(filePath);
15323
15734
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
15324
15735
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -15371,7 +15782,7 @@ var subagentsProcessorToolTargetTuple = [
15371
15782
  "roo",
15372
15783
  "rovodev"
15373
15784
  ];
15374
- var SubagentsProcessorToolTargetSchema = z62.enum(subagentsProcessorToolTargetTuple);
15785
+ var SubagentsProcessorToolTargetSchema = z63.enum(subagentsProcessorToolTargetTuple);
15375
15786
  var toolSubagentFactories = /* @__PURE__ */ new Map([
15376
15787
  [
15377
15788
  "agentsmd",
@@ -15562,7 +15973,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15562
15973
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
15563
15974
  */
15564
15975
  async loadRulesyncFiles() {
15565
- const subagentsDir = join106(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15976
+ const subagentsDir = join108(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15566
15977
  const dirExists = await directoryExists(subagentsDir);
15567
15978
  if (!dirExists) {
15568
15979
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -15577,7 +15988,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15577
15988
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
15578
15989
  const rulesyncSubagents = [];
15579
15990
  for (const mdFile of mdFiles) {
15580
- const filepath = join106(subagentsDir, mdFile);
15991
+ const filepath = join108(subagentsDir, mdFile);
15581
15992
  try {
15582
15993
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
15583
15994
  relativeFilePath: mdFile,
@@ -15607,7 +16018,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
15607
16018
  const factory = this.getFactory(this.toolTarget);
15608
16019
  const paths = factory.class.getSettablePaths({ global: this.global });
15609
16020
  const subagentFilePaths = await findFilesByGlobs(
15610
- join106(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
16021
+ join108(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
15611
16022
  );
15612
16023
  if (forDeletion) {
15613
16024
  const toolSubagents2 = subagentFilePaths.map(
@@ -15674,49 +16085,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
15674
16085
  };
15675
16086
 
15676
16087
  // src/features/rules/agentsmd-rule.ts
15677
- import { join as join109 } from "path";
16088
+ import { join as join111 } from "path";
15678
16089
 
15679
16090
  // src/features/rules/tool-rule.ts
15680
- import { join as join108 } from "path";
16091
+ import { join as join110 } from "path";
15681
16092
 
15682
16093
  // src/features/rules/rulesync-rule.ts
15683
- import { join as join107 } from "path";
15684
- import { z as z63 } from "zod/mini";
15685
- var RulesyncRuleFrontmatterSchema = z63.object({
15686
- root: z63.optional(z63.boolean()),
15687
- localRoot: z63.optional(z63.boolean()),
15688
- targets: z63._default(RulesyncTargetsSchema, ["*"]),
15689
- description: z63.optional(z63.string()),
15690
- globs: z63.optional(z63.array(z63.string())),
15691
- agentsmd: z63.optional(
15692
- z63.looseObject({
16094
+ import { join as join109 } from "path";
16095
+ import { z as z64 } from "zod/mini";
16096
+ var RulesyncRuleFrontmatterSchema = z64.object({
16097
+ root: z64.optional(z64.boolean()),
16098
+ localRoot: z64.optional(z64.boolean()),
16099
+ targets: z64._default(RulesyncTargetsSchema, ["*"]),
16100
+ description: z64.optional(z64.string()),
16101
+ globs: z64.optional(z64.array(z64.string())),
16102
+ agentsmd: z64.optional(
16103
+ z64.looseObject({
15693
16104
  // @example "path/to/subproject"
15694
- subprojectPath: z63.optional(z63.string())
16105
+ subprojectPath: z64.optional(z64.string())
15695
16106
  })
15696
16107
  ),
15697
- claudecode: z63.optional(
15698
- z63.looseObject({
16108
+ claudecode: z64.optional(
16109
+ z64.looseObject({
15699
16110
  // Glob patterns for conditional rules (takes precedence over globs)
15700
16111
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
15701
- paths: z63.optional(z63.array(z63.string()))
16112
+ paths: z64.optional(z64.array(z64.string()))
15702
16113
  })
15703
16114
  ),
15704
- cursor: z63.optional(
15705
- z63.looseObject({
15706
- alwaysApply: z63.optional(z63.boolean()),
15707
- description: z63.optional(z63.string()),
15708
- globs: z63.optional(z63.array(z63.string()))
16115
+ cursor: z64.optional(
16116
+ z64.looseObject({
16117
+ alwaysApply: z64.optional(z64.boolean()),
16118
+ description: z64.optional(z64.string()),
16119
+ globs: z64.optional(z64.array(z64.string()))
15709
16120
  })
15710
16121
  ),
15711
- copilot: z63.optional(
15712
- z63.looseObject({
15713
- excludeAgent: z63.optional(z63.union([z63.literal("code-review"), z63.literal("coding-agent")]))
16122
+ copilot: z64.optional(
16123
+ z64.looseObject({
16124
+ excludeAgent: z64.optional(z64.union([z64.literal("code-review"), z64.literal("coding-agent")]))
15714
16125
  })
15715
16126
  ),
15716
- antigravity: z63.optional(
15717
- z63.looseObject({
15718
- trigger: z63.optional(z63.string()),
15719
- globs: z63.optional(z63.array(z63.string()))
16127
+ antigravity: z64.optional(
16128
+ z64.looseObject({
16129
+ trigger: z64.optional(z64.string()),
16130
+ globs: z64.optional(z64.array(z64.string()))
15720
16131
  })
15721
16132
  )
15722
16133
  });
@@ -15727,7 +16138,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15727
16138
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
15728
16139
  if (!parseResult.success && rest.validate !== false) {
15729
16140
  throw new Error(
15730
- `Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
16141
+ `Invalid frontmatter in ${join109(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
15731
16142
  );
15732
16143
  }
15733
16144
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -15762,7 +16173,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15762
16173
  return {
15763
16174
  success: false,
15764
16175
  error: new Error(
15765
- `Invalid frontmatter in ${join107(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16176
+ `Invalid frontmatter in ${join109(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15766
16177
  )
15767
16178
  };
15768
16179
  }
@@ -15771,7 +16182,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15771
16182
  relativeFilePath,
15772
16183
  validate = true
15773
16184
  }) {
15774
- const filePath = join107(
16185
+ const filePath = join109(
15775
16186
  process.cwd(),
15776
16187
  this.getSettablePaths().recommended.relativeDirPath,
15777
16188
  relativeFilePath
@@ -15870,7 +16281,7 @@ var ToolRule = class extends ToolFile {
15870
16281
  rulesyncRule,
15871
16282
  validate = true,
15872
16283
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
15873
- nonRootPath = { relativeDirPath: join108(".agents", "memories") }
16284
+ nonRootPath = { relativeDirPath: join110(".agents", "memories") }
15874
16285
  }) {
15875
16286
  const params = this.buildToolRuleParamsDefault({
15876
16287
  baseDir,
@@ -15881,7 +16292,7 @@ var ToolRule = class extends ToolFile {
15881
16292
  });
15882
16293
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
15883
16294
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
15884
- params.relativeDirPath = join108(rulesyncFrontmatter.agentsmd.subprojectPath);
16295
+ params.relativeDirPath = join110(rulesyncFrontmatter.agentsmd.subprojectPath);
15885
16296
  params.relativeFilePath = "AGENTS.md";
15886
16297
  }
15887
16298
  return params;
@@ -15930,7 +16341,7 @@ var ToolRule = class extends ToolFile {
15930
16341
  }
15931
16342
  };
15932
16343
  function buildToolPath(toolDir, subDir, excludeToolDir) {
15933
- return excludeToolDir ? subDir : join108(toolDir, subDir);
16344
+ return excludeToolDir ? subDir : join110(toolDir, subDir);
15934
16345
  }
15935
16346
 
15936
16347
  // src/features/rules/agentsmd-rule.ts
@@ -15959,8 +16370,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15959
16370
  validate = true
15960
16371
  }) {
15961
16372
  const isRoot = relativeFilePath === "AGENTS.md";
15962
- const relativePath = isRoot ? "AGENTS.md" : join109(".agents", "memories", relativeFilePath);
15963
- const fileContent = await readFileContent(join109(baseDir, relativePath));
16373
+ const relativePath = isRoot ? "AGENTS.md" : join111(".agents", "memories", relativeFilePath);
16374
+ const fileContent = await readFileContent(join111(baseDir, relativePath));
15964
16375
  return new _AgentsMdRule({
15965
16376
  baseDir,
15966
16377
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -16015,21 +16426,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
16015
16426
  };
16016
16427
 
16017
16428
  // src/features/rules/antigravity-rule.ts
16018
- import { join as join110 } from "path";
16019
- import { z as z64 } from "zod/mini";
16020
- var AntigravityRuleFrontmatterSchema = z64.looseObject({
16021
- trigger: z64.optional(
16022
- z64.union([
16023
- z64.literal("always_on"),
16024
- z64.literal("glob"),
16025
- z64.literal("manual"),
16026
- z64.literal("model_decision"),
16027
- z64.string()
16429
+ import { join as join112 } from "path";
16430
+ import { z as z65 } from "zod/mini";
16431
+ var AntigravityRuleFrontmatterSchema = z65.looseObject({
16432
+ trigger: z65.optional(
16433
+ z65.union([
16434
+ z65.literal("always_on"),
16435
+ z65.literal("glob"),
16436
+ z65.literal("manual"),
16437
+ z65.literal("model_decision"),
16438
+ z65.string()
16028
16439
  // accepts any string for forward compatibility
16029
16440
  ])
16030
16441
  ),
16031
- globs: z64.optional(z64.string()),
16032
- description: z64.optional(z64.string())
16442
+ globs: z65.optional(z65.string()),
16443
+ description: z65.optional(z65.string())
16033
16444
  });
16034
16445
  function parseGlobsString(globs) {
16035
16446
  if (!globs) {
@@ -16174,7 +16585,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16174
16585
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
16175
16586
  if (!result.success) {
16176
16587
  throw new Error(
16177
- `Invalid frontmatter in ${join110(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16588
+ `Invalid frontmatter in ${join112(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16178
16589
  );
16179
16590
  }
16180
16591
  }
@@ -16198,7 +16609,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16198
16609
  relativeFilePath,
16199
16610
  validate = true
16200
16611
  }) {
16201
- const filePath = join110(
16612
+ const filePath = join112(
16202
16613
  baseDir,
16203
16614
  this.getSettablePaths().nonRoot.relativeDirPath,
16204
16615
  relativeFilePath
@@ -16338,7 +16749,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
16338
16749
  };
16339
16750
 
16340
16751
  // src/features/rules/augmentcode-legacy-rule.ts
16341
- import { join as join111 } from "path";
16752
+ import { join as join113 } from "path";
16342
16753
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16343
16754
  toRulesyncRule() {
16344
16755
  const rulesyncFrontmatter = {
@@ -16398,8 +16809,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16398
16809
  }) {
16399
16810
  const settablePaths = this.getSettablePaths();
16400
16811
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
16401
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : join111(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16402
- const fileContent = await readFileContent(join111(baseDir, relativePath));
16812
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : join113(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16813
+ const fileContent = await readFileContent(join113(baseDir, relativePath));
16403
16814
  return new _AugmentcodeLegacyRule({
16404
16815
  baseDir,
16405
16816
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -16428,7 +16839,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
16428
16839
  };
16429
16840
 
16430
16841
  // src/features/rules/augmentcode-rule.ts
16431
- import { join as join112 } from "path";
16842
+ import { join as join114 } from "path";
16432
16843
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16433
16844
  toRulesyncRule() {
16434
16845
  return this.toRulesyncRuleDefault();
@@ -16459,7 +16870,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16459
16870
  relativeFilePath,
16460
16871
  validate = true
16461
16872
  }) {
16462
- const filePath = join112(
16873
+ const filePath = join114(
16463
16874
  baseDir,
16464
16875
  this.getSettablePaths().nonRoot.relativeDirPath,
16465
16876
  relativeFilePath
@@ -16499,7 +16910,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
16499
16910
  };
16500
16911
 
16501
16912
  // src/features/rules/claudecode-legacy-rule.ts
16502
- import { join as join113 } from "path";
16913
+ import { join as join115 } from "path";
16503
16914
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16504
16915
  static getSettablePaths({
16505
16916
  global,
@@ -16541,7 +16952,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16541
16952
  if (isRoot) {
16542
16953
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16543
16954
  const fileContent2 = await readFileContent(
16544
- join113(baseDir, rootDirPath, paths.root.relativeFilePath)
16955
+ join115(baseDir, rootDirPath, paths.root.relativeFilePath)
16545
16956
  );
16546
16957
  return new _ClaudecodeLegacyRule({
16547
16958
  baseDir,
@@ -16555,8 +16966,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16555
16966
  if (!paths.nonRoot) {
16556
16967
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16557
16968
  }
16558
- const relativePath = join113(paths.nonRoot.relativeDirPath, relativeFilePath);
16559
- const fileContent = await readFileContent(join113(baseDir, relativePath));
16969
+ const relativePath = join115(paths.nonRoot.relativeDirPath, relativeFilePath);
16970
+ const fileContent = await readFileContent(join115(baseDir, relativePath));
16560
16971
  return new _ClaudecodeLegacyRule({
16561
16972
  baseDir,
16562
16973
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16615,10 +17026,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
16615
17026
  };
16616
17027
 
16617
17028
  // src/features/rules/claudecode-rule.ts
16618
- import { join as join114 } from "path";
16619
- import { z as z65 } from "zod/mini";
16620
- var ClaudecodeRuleFrontmatterSchema = z65.object({
16621
- paths: z65.optional(z65.array(z65.string()))
17029
+ import { join as join116 } from "path";
17030
+ import { z as z66 } from "zod/mini";
17031
+ var ClaudecodeRuleFrontmatterSchema = z66.object({
17032
+ paths: z66.optional(z66.array(z66.string()))
16622
17033
  });
16623
17034
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16624
17035
  frontmatter;
@@ -16656,7 +17067,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16656
17067
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
16657
17068
  if (!result.success) {
16658
17069
  throw new Error(
16659
- `Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17070
+ `Invalid frontmatter in ${join116(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16660
17071
  );
16661
17072
  }
16662
17073
  }
@@ -16686,7 +17097,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16686
17097
  if (isRoot) {
16687
17098
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16688
17099
  const fileContent2 = await readFileContent(
16689
- join114(baseDir, rootDirPath, paths.root.relativeFilePath)
17100
+ join116(baseDir, rootDirPath, paths.root.relativeFilePath)
16690
17101
  );
16691
17102
  return new _ClaudecodeRule({
16692
17103
  baseDir,
@@ -16701,8 +17112,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16701
17112
  if (!paths.nonRoot) {
16702
17113
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16703
17114
  }
16704
- const relativePath = join114(paths.nonRoot.relativeDirPath, relativeFilePath);
16705
- const filePath = join114(baseDir, relativePath);
17115
+ const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
17116
+ const filePath = join116(baseDir, relativePath);
16706
17117
  const fileContent = await readFileContent(filePath);
16707
17118
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
16708
17119
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -16813,7 +17224,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16813
17224
  return {
16814
17225
  success: false,
16815
17226
  error: new Error(
16816
- `Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17227
+ `Invalid frontmatter in ${join116(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16817
17228
  )
16818
17229
  };
16819
17230
  }
@@ -16833,10 +17244,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16833
17244
  };
16834
17245
 
16835
17246
  // src/features/rules/cline-rule.ts
16836
- import { join as join115 } from "path";
16837
- import { z as z66 } from "zod/mini";
16838
- var ClineRuleFrontmatterSchema = z66.object({
16839
- description: z66.string()
17247
+ import { join as join117 } from "path";
17248
+ import { z as z67 } from "zod/mini";
17249
+ var ClineRuleFrontmatterSchema = z67.object({
17250
+ description: z67.string()
16840
17251
  });
16841
17252
  var ClineRule = class _ClineRule extends ToolRule {
16842
17253
  static getSettablePaths(_options = {}) {
@@ -16879,7 +17290,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16879
17290
  validate = true
16880
17291
  }) {
16881
17292
  const fileContent = await readFileContent(
16882
- join115(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17293
+ join117(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16883
17294
  );
16884
17295
  return new _ClineRule({
16885
17296
  baseDir,
@@ -16905,7 +17316,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16905
17316
  };
16906
17317
 
16907
17318
  // src/features/rules/codexcli-rule.ts
16908
- import { join as join116 } from "path";
17319
+ import { join as join118 } from "path";
16909
17320
  var CodexcliRule = class _CodexcliRule extends ToolRule {
16910
17321
  static getSettablePaths({
16911
17322
  global,
@@ -16940,7 +17351,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16940
17351
  if (isRoot) {
16941
17352
  const relativePath2 = paths.root.relativeFilePath;
16942
17353
  const fileContent2 = await readFileContent(
16943
- join116(baseDir, paths.root.relativeDirPath, relativePath2)
17354
+ join118(baseDir, paths.root.relativeDirPath, relativePath2)
16944
17355
  );
16945
17356
  return new _CodexcliRule({
16946
17357
  baseDir,
@@ -16954,8 +17365,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16954
17365
  if (!paths.nonRoot) {
16955
17366
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16956
17367
  }
16957
- const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
16958
- const fileContent = await readFileContent(join116(baseDir, relativePath));
17368
+ const relativePath = join118(paths.nonRoot.relativeDirPath, relativeFilePath);
17369
+ const fileContent = await readFileContent(join118(baseDir, relativePath));
16959
17370
  return new _CodexcliRule({
16960
17371
  baseDir,
16961
17372
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17014,12 +17425,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
17014
17425
  };
17015
17426
 
17016
17427
  // src/features/rules/copilot-rule.ts
17017
- import { join as join117 } from "path";
17018
- import { z as z67 } from "zod/mini";
17019
- var CopilotRuleFrontmatterSchema = z67.object({
17020
- description: z67.optional(z67.string()),
17021
- applyTo: z67.optional(z67.string()),
17022
- excludeAgent: z67.optional(z67.union([z67.literal("code-review"), z67.literal("coding-agent")]))
17428
+ import { join as join119 } from "path";
17429
+ import { z as z68 } from "zod/mini";
17430
+ var CopilotRuleFrontmatterSchema = z68.object({
17431
+ description: z68.optional(z68.string()),
17432
+ applyTo: z68.optional(z68.string()),
17433
+ excludeAgent: z68.optional(z68.union([z68.literal("code-review"), z68.literal("coding-agent")]))
17023
17434
  });
17024
17435
  var CopilotRule = class _CopilotRule extends ToolRule {
17025
17436
  frontmatter;
@@ -17051,7 +17462,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17051
17462
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
17052
17463
  if (!result.success) {
17053
17464
  throw new Error(
17054
- `Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17465
+ `Invalid frontmatter in ${join119(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17055
17466
  );
17056
17467
  }
17057
17468
  }
@@ -17141,8 +17552,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17141
17552
  const paths = this.getSettablePaths({ global });
17142
17553
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
17143
17554
  if (isRoot) {
17144
- const relativePath2 = join117(paths.root.relativeDirPath, paths.root.relativeFilePath);
17145
- const filePath2 = join117(baseDir, relativePath2);
17555
+ const relativePath2 = join119(paths.root.relativeDirPath, paths.root.relativeFilePath);
17556
+ const filePath2 = join119(baseDir, relativePath2);
17146
17557
  const fileContent2 = await readFileContent(filePath2);
17147
17558
  return new _CopilotRule({
17148
17559
  baseDir,
@@ -17157,8 +17568,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17157
17568
  if (!paths.nonRoot) {
17158
17569
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17159
17570
  }
17160
- const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
17161
- const filePath = join117(baseDir, relativePath);
17571
+ const relativePath = join119(paths.nonRoot.relativeDirPath, relativeFilePath);
17572
+ const filePath = join119(baseDir, relativePath);
17162
17573
  const fileContent = await readFileContent(filePath);
17163
17574
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
17164
17575
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -17204,7 +17615,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
17204
17615
  return {
17205
17616
  success: false,
17206
17617
  error: new Error(
17207
- `Invalid frontmatter in ${join117(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17618
+ `Invalid frontmatter in ${join119(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17208
17619
  )
17209
17620
  };
17210
17621
  }
@@ -17260,12 +17671,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
17260
17671
  };
17261
17672
 
17262
17673
  // src/features/rules/cursor-rule.ts
17263
- import { join as join118 } from "path";
17264
- import { z as z68 } from "zod/mini";
17265
- var CursorRuleFrontmatterSchema = z68.object({
17266
- description: z68.optional(z68.string()),
17267
- globs: z68.optional(z68.string()),
17268
- alwaysApply: z68.optional(z68.boolean())
17674
+ import { join as join120 } from "path";
17675
+ import { z as z69 } from "zod/mini";
17676
+ var CursorRuleFrontmatterSchema = z69.object({
17677
+ description: z69.optional(z69.string()),
17678
+ globs: z69.optional(z69.string()),
17679
+ alwaysApply: z69.optional(z69.boolean())
17269
17680
  });
17270
17681
  var CursorRule = class _CursorRule extends ToolRule {
17271
17682
  frontmatter;
@@ -17282,7 +17693,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17282
17693
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17283
17694
  if (!result.success) {
17284
17695
  throw new Error(
17285
- `Invalid frontmatter in ${join118(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17696
+ `Invalid frontmatter in ${join120(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17286
17697
  );
17287
17698
  }
17288
17699
  }
@@ -17398,7 +17809,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17398
17809
  relativeFilePath,
17399
17810
  validate = true
17400
17811
  }) {
17401
- const filePath = join118(
17812
+ const filePath = join120(
17402
17813
  baseDir,
17403
17814
  this.getSettablePaths().nonRoot.relativeDirPath,
17404
17815
  relativeFilePath
@@ -17408,7 +17819,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17408
17819
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
17409
17820
  if (!result.success) {
17410
17821
  throw new Error(
17411
- `Invalid frontmatter in ${join118(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17822
+ `Invalid frontmatter in ${join120(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17412
17823
  );
17413
17824
  }
17414
17825
  return new _CursorRule({
@@ -17445,7 +17856,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17445
17856
  return {
17446
17857
  success: false,
17447
17858
  error: new Error(
17448
- `Invalid frontmatter in ${join118(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17859
+ `Invalid frontmatter in ${join120(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17449
17860
  )
17450
17861
  };
17451
17862
  }
@@ -17465,7 +17876,7 @@ var CursorRule = class _CursorRule extends ToolRule {
17465
17876
  };
17466
17877
 
17467
17878
  // src/features/rules/deepagents-rule.ts
17468
- import { join as join119 } from "path";
17879
+ import { join as join121 } from "path";
17469
17880
  var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17470
17881
  constructor({ fileContent, root, ...rest }) {
17471
17882
  super({
@@ -17492,8 +17903,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17492
17903
  }) {
17493
17904
  const settablePaths = this.getSettablePaths();
17494
17905
  const isRoot = relativeFilePath === "AGENTS.md";
17495
- const relativePath = isRoot ? join119(".deepagents", "AGENTS.md") : join119(".deepagents", "memories", relativeFilePath);
17496
- const fileContent = await readFileContent(join119(baseDir, relativePath));
17906
+ const relativePath = isRoot ? join121(".deepagents", "AGENTS.md") : join121(".deepagents", "memories", relativeFilePath);
17907
+ const fileContent = await readFileContent(join121(baseDir, relativePath));
17497
17908
  return new _DeepagentsRule({
17498
17909
  baseDir,
17499
17910
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17548,7 +17959,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
17548
17959
  };
17549
17960
 
17550
17961
  // src/features/rules/factorydroid-rule.ts
17551
- import { join as join120 } from "path";
17962
+ import { join as join122 } from "path";
17552
17963
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17553
17964
  constructor({ fileContent, root, ...rest }) {
17554
17965
  super({
@@ -17588,8 +17999,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17588
17999
  const paths = this.getSettablePaths({ global });
17589
18000
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
17590
18001
  if (isRoot) {
17591
- const relativePath2 = join120(paths.root.relativeDirPath, paths.root.relativeFilePath);
17592
- const fileContent2 = await readFileContent(join120(baseDir, relativePath2));
18002
+ const relativePath2 = join122(paths.root.relativeDirPath, paths.root.relativeFilePath);
18003
+ const fileContent2 = await readFileContent(join122(baseDir, relativePath2));
17593
18004
  return new _FactorydroidRule({
17594
18005
  baseDir,
17595
18006
  relativeDirPath: paths.root.relativeDirPath,
@@ -17602,8 +18013,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17602
18013
  if (!paths.nonRoot) {
17603
18014
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17604
18015
  }
17605
- const relativePath = join120(paths.nonRoot.relativeDirPath, relativeFilePath);
17606
- const fileContent = await readFileContent(join120(baseDir, relativePath));
18016
+ const relativePath = join122(paths.nonRoot.relativeDirPath, relativeFilePath);
18017
+ const fileContent = await readFileContent(join122(baseDir, relativePath));
17607
18018
  return new _FactorydroidRule({
17608
18019
  baseDir,
17609
18020
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17662,7 +18073,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17662
18073
  };
17663
18074
 
17664
18075
  // src/features/rules/geminicli-rule.ts
17665
- import { join as join121 } from "path";
18076
+ import { join as join123 } from "path";
17666
18077
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17667
18078
  static getSettablePaths({
17668
18079
  global,
@@ -17697,7 +18108,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17697
18108
  if (isRoot) {
17698
18109
  const relativePath2 = paths.root.relativeFilePath;
17699
18110
  const fileContent2 = await readFileContent(
17700
- join121(baseDir, paths.root.relativeDirPath, relativePath2)
18111
+ join123(baseDir, paths.root.relativeDirPath, relativePath2)
17701
18112
  );
17702
18113
  return new _GeminiCliRule({
17703
18114
  baseDir,
@@ -17711,8 +18122,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17711
18122
  if (!paths.nonRoot) {
17712
18123
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17713
18124
  }
17714
- const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
17715
- const fileContent = await readFileContent(join121(baseDir, relativePath));
18125
+ const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
18126
+ const fileContent = await readFileContent(join123(baseDir, relativePath));
17716
18127
  return new _GeminiCliRule({
17717
18128
  baseDir,
17718
18129
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17771,7 +18182,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17771
18182
  };
17772
18183
 
17773
18184
  // src/features/rules/goose-rule.ts
17774
- import { join as join122 } from "path";
18185
+ import { join as join124 } from "path";
17775
18186
  var GooseRule = class _GooseRule extends ToolRule {
17776
18187
  static getSettablePaths({
17777
18188
  global,
@@ -17806,7 +18217,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17806
18217
  if (isRoot) {
17807
18218
  const relativePath2 = paths.root.relativeFilePath;
17808
18219
  const fileContent2 = await readFileContent(
17809
- join122(baseDir, paths.root.relativeDirPath, relativePath2)
18220
+ join124(baseDir, paths.root.relativeDirPath, relativePath2)
17810
18221
  );
17811
18222
  return new _GooseRule({
17812
18223
  baseDir,
@@ -17820,8 +18231,8 @@ var GooseRule = class _GooseRule extends ToolRule {
17820
18231
  if (!paths.nonRoot) {
17821
18232
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17822
18233
  }
17823
- const relativePath = join122(paths.nonRoot.relativeDirPath, relativeFilePath);
17824
- const fileContent = await readFileContent(join122(baseDir, relativePath));
18234
+ const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
18235
+ const fileContent = await readFileContent(join124(baseDir, relativePath));
17825
18236
  return new _GooseRule({
17826
18237
  baseDir,
17827
18238
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17880,7 +18291,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17880
18291
  };
17881
18292
 
17882
18293
  // src/features/rules/junie-rule.ts
17883
- import { join as join123 } from "path";
18294
+ import { join as join125 } from "path";
17884
18295
  var JunieRule = class _JunieRule extends ToolRule {
17885
18296
  static getSettablePaths(_options = {}) {
17886
18297
  return {
@@ -17909,8 +18320,8 @@ var JunieRule = class _JunieRule extends ToolRule {
17909
18320
  }) {
17910
18321
  const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
17911
18322
  const settablePaths = this.getSettablePaths();
17912
- const relativePath = isRoot ? join123(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join123(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17913
- const fileContent = await readFileContent(join123(baseDir, relativePath));
18323
+ const relativePath = isRoot ? join125(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join125(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
18324
+ const fileContent = await readFileContent(join125(baseDir, relativePath));
17914
18325
  return new _JunieRule({
17915
18326
  baseDir,
17916
18327
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17965,7 +18376,7 @@ var JunieRule = class _JunieRule extends ToolRule {
17965
18376
  };
17966
18377
 
17967
18378
  // src/features/rules/kilo-rule.ts
17968
- import { join as join124 } from "path";
18379
+ import { join as join126 } from "path";
17969
18380
  var KiloRule = class _KiloRule extends ToolRule {
17970
18381
  static getSettablePaths({
17971
18382
  global,
@@ -18000,7 +18411,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18000
18411
  if (isRoot) {
18001
18412
  const relativePath2 = paths.root.relativeFilePath;
18002
18413
  const fileContent2 = await readFileContent(
18003
- join124(baseDir, paths.root.relativeDirPath, relativePath2)
18414
+ join126(baseDir, paths.root.relativeDirPath, relativePath2)
18004
18415
  );
18005
18416
  return new _KiloRule({
18006
18417
  baseDir,
@@ -18014,8 +18425,8 @@ var KiloRule = class _KiloRule extends ToolRule {
18014
18425
  if (!paths.nonRoot) {
18015
18426
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18016
18427
  }
18017
- const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
18018
- const fileContent = await readFileContent(join124(baseDir, relativePath));
18428
+ const relativePath = join126(paths.nonRoot.relativeDirPath, relativeFilePath);
18429
+ const fileContent = await readFileContent(join126(baseDir, relativePath));
18019
18430
  return new _KiloRule({
18020
18431
  baseDir,
18021
18432
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18074,7 +18485,7 @@ var KiloRule = class _KiloRule extends ToolRule {
18074
18485
  };
18075
18486
 
18076
18487
  // src/features/rules/kiro-rule.ts
18077
- import { join as join125 } from "path";
18488
+ import { join as join127 } from "path";
18078
18489
  var KiroRule = class _KiroRule extends ToolRule {
18079
18490
  static getSettablePaths(_options = {}) {
18080
18491
  return {
@@ -18089,7 +18500,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18089
18500
  validate = true
18090
18501
  }) {
18091
18502
  const fileContent = await readFileContent(
18092
- join125(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18503
+ join127(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18093
18504
  );
18094
18505
  return new _KiroRule({
18095
18506
  baseDir,
@@ -18143,7 +18554,7 @@ var KiroRule = class _KiroRule extends ToolRule {
18143
18554
  };
18144
18555
 
18145
18556
  // src/features/rules/opencode-rule.ts
18146
- import { join as join126 } from "path";
18557
+ import { join as join128 } from "path";
18147
18558
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18148
18559
  static getSettablePaths({
18149
18560
  global,
@@ -18178,7 +18589,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18178
18589
  if (isRoot) {
18179
18590
  const relativePath2 = paths.root.relativeFilePath;
18180
18591
  const fileContent2 = await readFileContent(
18181
- join126(baseDir, paths.root.relativeDirPath, relativePath2)
18592
+ join128(baseDir, paths.root.relativeDirPath, relativePath2)
18182
18593
  );
18183
18594
  return new _OpenCodeRule({
18184
18595
  baseDir,
@@ -18192,8 +18603,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18192
18603
  if (!paths.nonRoot) {
18193
18604
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
18194
18605
  }
18195
- const relativePath = join126(paths.nonRoot.relativeDirPath, relativeFilePath);
18196
- const fileContent = await readFileContent(join126(baseDir, relativePath));
18606
+ const relativePath = join128(paths.nonRoot.relativeDirPath, relativeFilePath);
18607
+ const fileContent = await readFileContent(join128(baseDir, relativePath));
18197
18608
  return new _OpenCodeRule({
18198
18609
  baseDir,
18199
18610
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -18252,7 +18663,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
18252
18663
  };
18253
18664
 
18254
18665
  // src/features/rules/qwencode-rule.ts
18255
- import { join as join127 } from "path";
18666
+ import { join as join129 } from "path";
18256
18667
  var QwencodeRule = class _QwencodeRule extends ToolRule {
18257
18668
  static getSettablePaths(_options = {}) {
18258
18669
  return {
@@ -18271,8 +18682,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18271
18682
  validate = true
18272
18683
  }) {
18273
18684
  const isRoot = relativeFilePath === "QWEN.md";
18274
- const relativePath = isRoot ? "QWEN.md" : join127(".qwen", "memories", relativeFilePath);
18275
- const fileContent = await readFileContent(join127(baseDir, relativePath));
18685
+ const relativePath = isRoot ? "QWEN.md" : join129(".qwen", "memories", relativeFilePath);
18686
+ const fileContent = await readFileContent(join129(baseDir, relativePath));
18276
18687
  return new _QwencodeRule({
18277
18688
  baseDir,
18278
18689
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -18324,7 +18735,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
18324
18735
  };
18325
18736
 
18326
18737
  // src/features/rules/replit-rule.ts
18327
- import { join as join128 } from "path";
18738
+ import { join as join130 } from "path";
18328
18739
  var ReplitRule = class _ReplitRule extends ToolRule {
18329
18740
  static getSettablePaths(_options = {}) {
18330
18741
  return {
@@ -18346,7 +18757,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18346
18757
  }
18347
18758
  const relativePath = paths.root.relativeFilePath;
18348
18759
  const fileContent = await readFileContent(
18349
- join128(baseDir, paths.root.relativeDirPath, relativePath)
18760
+ join130(baseDir, paths.root.relativeDirPath, relativePath)
18350
18761
  );
18351
18762
  return new _ReplitRule({
18352
18763
  baseDir,
@@ -18412,7 +18823,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
18412
18823
  };
18413
18824
 
18414
18825
  // src/features/rules/roo-rule.ts
18415
- import { join as join129 } from "path";
18826
+ import { join as join131 } from "path";
18416
18827
  var RooRule = class _RooRule extends ToolRule {
18417
18828
  static getSettablePaths(_options = {}) {
18418
18829
  return {
@@ -18427,7 +18838,7 @@ var RooRule = class _RooRule extends ToolRule {
18427
18838
  validate = true
18428
18839
  }) {
18429
18840
  const fileContent = await readFileContent(
18430
- join129(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18841
+ join131(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18431
18842
  );
18432
18843
  return new _RooRule({
18433
18844
  baseDir,
@@ -18496,7 +18907,7 @@ var RooRule = class _RooRule extends ToolRule {
18496
18907
  };
18497
18908
 
18498
18909
  // src/features/rules/rovodev-rule.ts
18499
- import { join as join130 } from "path";
18910
+ import { join as join132 } from "path";
18500
18911
  var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
18501
18912
  var RovodevRule = class _RovodevRule extends ToolRule {
18502
18913
  /**
@@ -18540,7 +18951,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18540
18951
  root: rovodevAgents,
18541
18952
  alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
18542
18953
  nonRoot: {
18543
- relativeDirPath: join130(".rovodev", ".rulesync", "modular-rules")
18954
+ relativeDirPath: join132(".rovodev", ".rulesync", "modular-rules")
18544
18955
  }
18545
18956
  };
18546
18957
  }
@@ -18579,10 +18990,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18579
18990
  }) {
18580
18991
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
18581
18992
  throw new Error(
18582
- `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join130(relativeDirPath, relativeFilePath)}`
18993
+ `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join132(relativeDirPath, relativeFilePath)}`
18583
18994
  );
18584
18995
  }
18585
- const fileContent = await readFileContent(join130(baseDir, relativeDirPath, relativeFilePath));
18996
+ const fileContent = await readFileContent(join132(baseDir, relativeDirPath, relativeFilePath));
18586
18997
  return new _RovodevRule({
18587
18998
  baseDir,
18588
18999
  relativeDirPath,
@@ -18602,10 +19013,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18602
19013
  paths
18603
19014
  }) {
18604
19015
  const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
18605
- const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join130(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join130(paths.root.relativeDirPath, paths.root.relativeFilePath);
19016
+ const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join132(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join132(paths.root.relativeDirPath, paths.root.relativeFilePath);
18606
19017
  if (relativeFilePath !== "AGENTS.md") {
18607
19018
  throw new Error(
18608
- `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join130(relativeDirPath, relativeFilePath)}`
19019
+ `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join132(relativeDirPath, relativeFilePath)}`
18609
19020
  );
18610
19021
  }
18611
19022
  const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
@@ -18613,10 +19024,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18613
19024
  );
18614
19025
  if (!allowed) {
18615
19026
  throw new Error(
18616
- `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join130(relativeDirPath, relativeFilePath)}`
19027
+ `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join132(relativeDirPath, relativeFilePath)}`
18617
19028
  );
18618
19029
  }
18619
- const fileContent = await readFileContent(join130(baseDir, relativeDirPath, relativeFilePath));
19030
+ const fileContent = await readFileContent(join132(baseDir, relativeDirPath, relativeFilePath));
18620
19031
  return new _RovodevRule({
18621
19032
  baseDir,
18622
19033
  relativeDirPath,
@@ -18730,7 +19141,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18730
19141
  };
18731
19142
 
18732
19143
  // src/features/rules/warp-rule.ts
18733
- import { join as join131 } from "path";
19144
+ import { join as join133 } from "path";
18734
19145
  var WarpRule = class _WarpRule extends ToolRule {
18735
19146
  constructor({ fileContent, root, ...rest }) {
18736
19147
  super({
@@ -18756,8 +19167,8 @@ var WarpRule = class _WarpRule extends ToolRule {
18756
19167
  validate = true
18757
19168
  }) {
18758
19169
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
18759
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join131(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
18760
- const fileContent = await readFileContent(join131(baseDir, relativePath));
19170
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join133(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
19171
+ const fileContent = await readFileContent(join133(baseDir, relativePath));
18761
19172
  return new _WarpRule({
18762
19173
  baseDir,
18763
19174
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -18812,7 +19223,7 @@ var WarpRule = class _WarpRule extends ToolRule {
18812
19223
  };
18813
19224
 
18814
19225
  // src/features/rules/windsurf-rule.ts
18815
- import { join as join132 } from "path";
19226
+ import { join as join134 } from "path";
18816
19227
  var WindsurfRule = class _WindsurfRule extends ToolRule {
18817
19228
  static getSettablePaths(_options = {}) {
18818
19229
  return {
@@ -18827,7 +19238,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18827
19238
  validate = true
18828
19239
  }) {
18829
19240
  const fileContent = await readFileContent(
18830
- join132(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
19241
+ join134(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18831
19242
  );
18832
19243
  return new _WindsurfRule({
18833
19244
  baseDir,
@@ -18842,14 +19253,21 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18842
19253
  rulesyncRule,
18843
19254
  validate = true
18844
19255
  }) {
18845
- return new _WindsurfRule(
18846
- this.buildToolRuleParamsDefault({
18847
- baseDir,
18848
- rulesyncRule,
18849
- validate,
18850
- nonRootPath: this.getSettablePaths().nonRoot
18851
- })
18852
- );
19256
+ const toolRuleParams = this.buildToolRuleParamsDefault({
19257
+ baseDir,
19258
+ rulesyncRule,
19259
+ validate,
19260
+ nonRootPath: this.getSettablePaths().nonRoot
19261
+ });
19262
+ const windsurfFrontmatter = this.buildWindsurfFrontmatter({
19263
+ relativeFilePath: rulesyncRule.getRelativeFilePath(),
19264
+ description: rulesyncRule.getFrontmatter().description,
19265
+ globs: rulesyncRule.getFrontmatter().globs
19266
+ });
19267
+ return new _WindsurfRule({
19268
+ ...toolRuleParams,
19269
+ fileContent: stringifyFrontmatter(rulesyncRule.getBody(), windsurfFrontmatter)
19270
+ });
18853
19271
  }
18854
19272
  toRulesyncRule() {
18855
19273
  return this.toRulesyncRuleDefault();
@@ -18876,6 +19294,18 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18876
19294
  toolTarget: "windsurf"
18877
19295
  });
18878
19296
  }
19297
+ static buildWindsurfFrontmatter({
19298
+ relativeFilePath,
19299
+ description,
19300
+ globs
19301
+ }) {
19302
+ const hasSpecificGlobs = Boolean(globs && globs.length > 0 && !globs.includes("**/*"));
19303
+ return {
19304
+ title: description ?? relativeFilePath.replace(/\.md$/, ""),
19305
+ trigger: hasSpecificGlobs ? "glob" : "always_on",
19306
+ ...hasSpecificGlobs && { globs }
19307
+ };
19308
+ }
18879
19309
  };
18880
19310
 
18881
19311
  // src/features/rules/rules-processor.ts
@@ -18906,8 +19336,44 @@ var rulesProcessorToolTargets = [
18906
19336
  "warp",
18907
19337
  "windsurf"
18908
19338
  ];
18909
- var RulesProcessorToolTargetSchema = z69.enum(rulesProcessorToolTargets);
18910
- var formatRulePaths = (rules) => rules.map((r) => join133(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19339
+ var RulesProcessorToolTargetSchema = z70.enum(rulesProcessorToolTargets);
19340
+ var formatRulePaths = (rules) => rules.map((r) => join135(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
19341
+ var RulesFeatureOptionsSchema = z70.looseObject({
19342
+ ruleDiscoveryMode: z70.optional(z70.enum(["none", "explicit"])),
19343
+ includeLocalRoot: z70.optional(z70.boolean())
19344
+ });
19345
+ var resolveRuleDiscoveryMode = ({
19346
+ defaultMode,
19347
+ options
19348
+ }) => {
19349
+ if (defaultMode === "claudecode-legacy") {
19350
+ return defaultMode;
19351
+ }
19352
+ if (!options) return defaultMode;
19353
+ const parsed = RulesFeatureOptionsSchema.safeParse(options);
19354
+ if (!parsed.success) {
19355
+ throw new Error(
19356
+ `Invalid options for rules feature: ${parsed.error.message}. \`ruleDiscoveryMode\` must be either "none" or "explicit".`
19357
+ );
19358
+ }
19359
+ if (!parsed.data.ruleDiscoveryMode) {
19360
+ return defaultMode;
19361
+ }
19362
+ return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
19363
+ };
19364
+ var IncludeLocalRootSchema = z70.looseObject({
19365
+ includeLocalRoot: z70.optional(z70.boolean())
19366
+ });
19367
+ var resolveIncludeLocalRoot = (options) => {
19368
+ if (!options) return true;
19369
+ const parsed = IncludeLocalRootSchema.safeParse(options);
19370
+ if (!parsed.success) {
19371
+ throw new Error(
19372
+ `Invalid options for rules feature: ${parsed.error.message}. \`includeLocalRoot\` must be a boolean.`
19373
+ );
19374
+ }
19375
+ return parsed.data.includeLocalRoot ?? true;
19376
+ };
18911
19377
  var toolRuleFactories = /* @__PURE__ */ new Map([
18912
19378
  [
18913
19379
  "agentsmd",
@@ -19222,6 +19688,7 @@ var RulesProcessor = class extends FeatureProcessor {
19222
19688
  global;
19223
19689
  getFactory;
19224
19690
  skills;
19691
+ featureOptions;
19225
19692
  constructor({
19226
19693
  baseDir = process.cwd(),
19227
19694
  toolTarget,
@@ -19231,6 +19698,7 @@ var RulesProcessor = class extends FeatureProcessor {
19231
19698
  global = false,
19232
19699
  getFactory = defaultGetFactory6,
19233
19700
  skills,
19701
+ featureOptions,
19234
19702
  dryRun = false,
19235
19703
  logger
19236
19704
  }) {
@@ -19248,6 +19716,7 @@ var RulesProcessor = class extends FeatureProcessor {
19248
19716
  this.simulateSkills = simulateSkills;
19249
19717
  this.getFactory = getFactory;
19250
19718
  this.skills = skills;
19719
+ this.featureOptions = featureOptions;
19251
19720
  }
19252
19721
  async convertRulesyncFilesToToolFiles(rulesyncFiles) {
19253
19722
  const rulesyncRules = rulesyncFiles.filter(
@@ -19268,7 +19737,8 @@ var RulesProcessor = class extends FeatureProcessor {
19268
19737
  global: this.global
19269
19738
  });
19270
19739
  }).filter((rule) => rule !== null);
19271
- if (localRootRules.length > 0 && !this.global) {
19740
+ const includeLocalRoot = resolveIncludeLocalRoot(this.featureOptions);
19741
+ if (localRootRules.length > 0 && !this.global && includeLocalRoot) {
19272
19742
  const localRootRule = localRootRules[0];
19273
19743
  if (localRootRule && factory.class.isTargetedByRulesyncRule(localRootRule)) {
19274
19744
  this.handleLocalRootRule(toolRules, localRootRule, factory);
@@ -19335,7 +19805,7 @@ var RulesProcessor = class extends FeatureProcessor {
19335
19805
  }).relativeDirPath;
19336
19806
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
19337
19807
  const frontmatter = skill.getFrontmatter();
19338
- const relativePath = join133(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19808
+ const relativePath = join135(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19339
19809
  return {
19340
19810
  name: frontmatter.name,
19341
19811
  description: frontmatter.description,
@@ -19405,7 +19875,11 @@ var RulesProcessor = class extends FeatureProcessor {
19405
19875
  * Generate reference section based on meta configuration.
19406
19876
  */
19407
19877
  generateReferenceSectionFromMeta(meta, toolRules) {
19408
- switch (meta.ruleDiscoveryMode) {
19878
+ const mode = resolveRuleDiscoveryMode({
19879
+ defaultMode: meta.ruleDiscoveryMode,
19880
+ options: this.featureOptions
19881
+ });
19882
+ switch (mode) {
19409
19883
  case "toon":
19410
19884
  return this.generateToonReferencesSection(toolRules);
19411
19885
  case "claudecode-legacy":
@@ -19460,8 +19934,8 @@ var RulesProcessor = class extends FeatureProcessor {
19460
19934
  * Load and parse rulesync rule files from .rulesync/rules/ directory
19461
19935
  */
19462
19936
  async loadRulesyncFiles() {
19463
- const rulesyncBaseDir = join133(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19464
- const files = await findFilesByGlobs(join133(rulesyncBaseDir, "**", "*.md"));
19937
+ const rulesyncBaseDir = join135(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19938
+ const files = await findFilesByGlobs(join135(rulesyncBaseDir, "**", "*.md"));
19465
19939
  this.logger.debug(`Found ${files.length} rulesync files`);
19466
19940
  const rulesyncRules = await Promise.all(
19467
19941
  files.map((file) => {
@@ -19576,13 +20050,13 @@ var RulesProcessor = class extends FeatureProcessor {
19576
20050
  return [];
19577
20051
  }
19578
20052
  const uniqueRootFilePaths = await findFilesWithFallback(
19579
- join133(
20053
+ join135(
19580
20054
  this.baseDir,
19581
20055
  settablePaths.root.relativeDirPath ?? ".",
19582
20056
  settablePaths.root.relativeFilePath
19583
20057
  ),
19584
20058
  settablePaths.alternativeRoots,
19585
- (alt) => join133(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
20059
+ (alt) => join135(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
19586
20060
  );
19587
20061
  if (forDeletion) {
19588
20062
  return buildDeletionRulesFromPaths(uniqueRootFilePaths);
@@ -19613,7 +20087,7 @@ var RulesProcessor = class extends FeatureProcessor {
19613
20087
  return [];
19614
20088
  }
19615
20089
  const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
19616
- join133(this.baseDir, "AGENTS.local.md")
20090
+ join135(this.baseDir, "AGENTS.local.md")
19617
20091
  );
19618
20092
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
19619
20093
  }
@@ -19624,9 +20098,9 @@ var RulesProcessor = class extends FeatureProcessor {
19624
20098
  return [];
19625
20099
  }
19626
20100
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
19627
- join133(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
20101
+ join135(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
19628
20102
  settablePaths.alternativeRoots,
19629
- (alt) => join133(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
20103
+ (alt) => join135(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
19630
20104
  );
19631
20105
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
19632
20106
  })();
@@ -19637,20 +20111,20 @@ var RulesProcessor = class extends FeatureProcessor {
19637
20111
  if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
19638
20112
  return [];
19639
20113
  }
19640
- const primaryPaths = await findFilesByGlobs(join133(this.baseDir, ".rovodev", "AGENTS.md"));
20114
+ const primaryPaths = await findFilesByGlobs(join135(this.baseDir, ".rovodev", "AGENTS.md"));
19641
20115
  if (primaryPaths.length === 0) {
19642
20116
  return [];
19643
20117
  }
19644
- const mirrorPaths = await findFilesByGlobs(join133(this.baseDir, "AGENTS.md"));
20118
+ const mirrorPaths = await findFilesByGlobs(join135(this.baseDir, "AGENTS.md"));
19645
20119
  return buildDeletionRulesFromPaths(mirrorPaths);
19646
20120
  })();
19647
20121
  const nonRootToolRules = await (async () => {
19648
20122
  if (!settablePaths.nonRoot) {
19649
20123
  return [];
19650
20124
  }
19651
- const nonRootBaseDir = join133(this.baseDir, settablePaths.nonRoot.relativeDirPath);
20125
+ const nonRootBaseDir = join135(this.baseDir, settablePaths.nonRoot.relativeDirPath);
19652
20126
  const nonRootFilePaths = await findFilesByGlobs(
19653
- join133(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
20127
+ join135(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
19654
20128
  );
19655
20129
  if (forDeletion) {
19656
20130
  return buildDeletionRulesFromPaths(nonRootFilePaths, {
@@ -19664,7 +20138,7 @@ var RulesProcessor = class extends FeatureProcessor {
19664
20138
  const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
19665
20139
  if (!ok) {
19666
20140
  this.logger.warn(
19667
- `Skipping reserved Rovodev path under modular-rules (import): ${join133(modularRootRelative, relativeFilePath)}`
20141
+ `Skipping reserved Rovodev path under modular-rules (import): ${join135(modularRootRelative, relativeFilePath)}`
19668
20142
  );
19669
20143
  }
19670
20144
  return ok;
@@ -19790,14 +20264,14 @@ s/<command> [arguments]
19790
20264
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
19791
20265
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
19792
20266
 
19793
- When users call a custom slash command, you have to look for the markdown file, \`${join133(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
20267
+ When users call a custom slash command, you have to look for the markdown file, \`${join135(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
19794
20268
  const subagentsSection = subagents ? `## Simulated Subagents
19795
20269
 
19796
20270
  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.
19797
20271
 
19798
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${join133(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
20272
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${join135(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
19799
20273
 
19800
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join133(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
20274
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join135(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
19801
20275
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
19802
20276
  const result = [
19803
20277
  overview,
@@ -19897,7 +20371,7 @@ function warnUnsupportedTargets(params) {
19897
20371
  }
19898
20372
  }
19899
20373
  async function checkRulesyncDirExists(params) {
19900
- return fileExists(join134(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
20374
+ return fileExists(join136(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19901
20375
  }
19902
20376
  async function generate(params) {
19903
20377
  const { config, logger } = params;
@@ -19952,6 +20426,7 @@ async function generateRulesCore(params) {
19952
20426
  simulateSubagents: config.getSimulateSubagents(),
19953
20427
  simulateSkills: config.getSimulateSkills(),
19954
20428
  skills,
20429
+ featureOptions: config.getFeatureOptions(toolTarget, "rules"),
19955
20430
  dryRun: config.isPreviewMode(),
19956
20431
  logger
19957
20432
  });
@@ -20679,6 +21154,7 @@ var JsonLogger = class extends BaseLogger {
20679
21154
 
20680
21155
  export {
20681
21156
  RULESYNC_CONFIG_RELATIVE_FILE_PATH,
21157
+ RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH,
20682
21158
  RULESYNC_RELATIVE_DIR_PATH,
20683
21159
  RULESYNC_RULES_RELATIVE_DIR_PATH,
20684
21160
  RULESYNC_COMMANDS_RELATIVE_DIR_PATH,