rulesync 6.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4047,14 +4047,16 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
4047
4047
  static forDeletion({
4048
4048
  baseDir = process.cwd(),
4049
4049
  relativeDirPath,
4050
- relativeFilePath
4050
+ relativeFilePath,
4051
+ global = false
4051
4052
  }) {
4052
4053
  return new _ClaudecodeMcp({
4053
4054
  baseDir,
4054
4055
  relativeDirPath,
4055
4056
  relativeFilePath,
4056
4057
  fileContent: "{}",
4057
- validate: false
4058
+ validate: false,
4059
+ global
4058
4060
  });
4059
4061
  }
4060
4062
  };
@@ -4517,17 +4519,25 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
4517
4519
  validate() {
4518
4520
  return { success: true, error: null };
4519
4521
  }
4522
+ /**
4523
+ * settings.json may contain other settings, so it should not be deleted.
4524
+ */
4525
+ isDeletable() {
4526
+ return false;
4527
+ }
4520
4528
  static forDeletion({
4521
4529
  baseDir = process.cwd(),
4522
4530
  relativeDirPath,
4523
- relativeFilePath
4531
+ relativeFilePath,
4532
+ global = false
4524
4533
  }) {
4525
4534
  return new _GeminiCliMcp({
4526
4535
  baseDir,
4527
4536
  relativeDirPath,
4528
4537
  relativeFilePath,
4529
4538
  fileContent: "{}",
4530
- validate: false
4539
+ validate: false,
4540
+ global
4531
4541
  });
4532
4542
  }
4533
4543
  };
@@ -4931,14 +4941,16 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
4931
4941
  static forDeletion({
4932
4942
  baseDir = process.cwd(),
4933
4943
  relativeDirPath,
4934
- relativeFilePath
4944
+ relativeFilePath,
4945
+ global = false
4935
4946
  }) {
4936
4947
  return new _OpencodeMcp({
4937
4948
  baseDir,
4938
4949
  relativeDirPath,
4939
4950
  relativeFilePath,
4940
4951
  fileContent: "{}",
4941
- validate: false
4952
+ validate: false,
4953
+ global
4942
4954
  });
4943
4955
  }
4944
4956
  };
@@ -5312,7 +5324,7 @@ var McpProcessor = class extends FeatureProcessor {
5312
5324
  // src/features/rules/rules-processor.ts
5313
5325
  import { encode } from "@toon-format/toon";
5314
5326
  import { basename as basename22, join as join96, relative as relative4 } from "path";
5315
- import { z as z44 } from "zod/mini";
5327
+ import { z as z45 } from "zod/mini";
5316
5328
 
5317
5329
  // src/constants/general.ts
5318
5330
  var SKILL_FILE_NAME = "SKILL.md";
@@ -7943,39 +7955,12 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
7943
7955
  }
7944
7956
  };
7945
7957
 
7946
- // src/features/subagents/cursor-subagent.ts
7947
- import { join as join65 } from "path";
7948
- var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
7949
- static getSettablePaths() {
7950
- return {
7951
- relativeDirPath: join65(".cursor", "subagents")
7952
- };
7953
- }
7954
- static async fromFile(params) {
7955
- const baseParams = await this.fromFileDefault(params);
7956
- return new _CursorSubagent(baseParams);
7957
- }
7958
- static fromRulesyncSubagent(params) {
7959
- const baseParams = this.fromRulesyncSubagentDefault(params);
7960
- return new _CursorSubagent(baseParams);
7961
- }
7962
- static isTargetedByRulesyncSubagent(rulesyncSubagent) {
7963
- return this.isTargetedByRulesyncSubagentDefault({
7964
- rulesyncSubagent,
7965
- toolTarget: "cursor"
7966
- });
7967
- }
7968
- static forDeletion(params) {
7969
- return new _CursorSubagent(this.forDeletionDefault(params));
7970
- }
7971
- };
7972
-
7973
7958
  // src/features/subagents/geminicli-subagent.ts
7974
- import { join as join66 } from "path";
7959
+ import { join as join65 } from "path";
7975
7960
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
7976
7961
  static getSettablePaths() {
7977
7962
  return {
7978
- relativeDirPath: join66(".gemini", "subagents")
7963
+ relativeDirPath: join65(".gemini", "subagents")
7979
7964
  };
7980
7965
  }
7981
7966
  static async fromFile(params) {
@@ -7998,11 +7983,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
7998
7983
  };
7999
7984
 
8000
7985
  // src/features/subagents/roo-subagent.ts
8001
- import { join as join67 } from "path";
7986
+ import { join as join66 } from "path";
8002
7987
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
8003
7988
  static getSettablePaths() {
8004
7989
  return {
8005
- relativeDirPath: join67(".roo", "subagents")
7990
+ relativeDirPath: join66(".roo", "subagents")
8006
7991
  };
8007
7992
  }
8008
7993
  static async fromFile(params) {
@@ -8026,14 +8011,14 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
8026
8011
 
8027
8012
  // src/features/subagents/subagents-processor.ts
8028
8013
  import { basename as basename21, join as join73 } from "path";
8029
- import { z as z37 } from "zod/mini";
8014
+ import { z as z38 } from "zod/mini";
8030
8015
 
8031
8016
  // src/features/subagents/claudecode-subagent.ts
8032
- import { join as join69 } from "path";
8017
+ import { join as join68 } from "path";
8033
8018
  import { z as z33 } from "zod/mini";
8034
8019
 
8035
8020
  // src/features/subagents/rulesync-subagent.ts
8036
- import { basename as basename19, join as join68 } from "path";
8021
+ import { basename as basename19, join as join67 } from "path";
8037
8022
  import { z as z32 } from "zod/mini";
8038
8023
  var RulesyncSubagentFrontmatterSchema = z32.looseObject({
8039
8024
  targets: RulesyncTargetsSchema,
@@ -8048,7 +8033,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
8048
8033
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
8049
8034
  if (!result.success) {
8050
8035
  throw new Error(
8051
- `Invalid frontmatter in ${join68(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8036
+ `Invalid frontmatter in ${join67(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8052
8037
  );
8053
8038
  }
8054
8039
  }
@@ -8081,7 +8066,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
8081
8066
  return {
8082
8067
  success: false,
8083
8068
  error: new Error(
8084
- `Invalid frontmatter in ${join68(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8069
+ `Invalid frontmatter in ${join67(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8085
8070
  )
8086
8071
  };
8087
8072
  }
@@ -8090,7 +8075,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
8090
8075
  relativeFilePath
8091
8076
  }) {
8092
8077
  const fileContent = await readFileContent(
8093
- join68(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
8078
+ join67(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
8094
8079
  );
8095
8080
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
8096
8081
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -8125,7 +8110,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
8125
8110
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
8126
8111
  if (!result.success) {
8127
8112
  throw new Error(
8128
- `Invalid frontmatter in ${join69(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8113
+ `Invalid frontmatter in ${join68(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8129
8114
  );
8130
8115
  }
8131
8116
  }
@@ -8137,7 +8122,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
8137
8122
  }
8138
8123
  static getSettablePaths(_options = {}) {
8139
8124
  return {
8140
- relativeDirPath: join69(".claude", "agents")
8125
+ relativeDirPath: join68(".claude", "agents")
8141
8126
  };
8142
8127
  }
8143
8128
  getFrontmatter() {
@@ -8211,7 +8196,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
8211
8196
  return {
8212
8197
  success: false,
8213
8198
  error: new Error(
8214
- `Invalid frontmatter in ${join69(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8199
+ `Invalid frontmatter in ${join68(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8215
8200
  )
8216
8201
  };
8217
8202
  }
@@ -8229,7 +8214,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
8229
8214
  global = false
8230
8215
  }) {
8231
8216
  const paths = this.getSettablePaths({ global });
8232
- const filePath = join69(baseDir, paths.relativeDirPath, relativeFilePath);
8217
+ const filePath = join68(baseDir, paths.relativeDirPath, relativeFilePath);
8233
8218
  const fileContent = await readFileContent(filePath);
8234
8219
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
8235
8220
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -8264,7 +8249,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
8264
8249
  };
8265
8250
 
8266
8251
  // src/features/subagents/copilot-subagent.ts
8267
- import { join as join70 } from "path";
8252
+ import { join as join69 } from "path";
8268
8253
  import { z as z34 } from "zod/mini";
8269
8254
  var REQUIRED_TOOL = "agent/runSubagent";
8270
8255
  var CopilotSubagentFrontmatterSchema = z34.looseObject({
@@ -8290,7 +8275,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
8290
8275
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
8291
8276
  if (!result.success) {
8292
8277
  throw new Error(
8293
- `Invalid frontmatter in ${join70(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8278
+ `Invalid frontmatter in ${join69(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8294
8279
  );
8295
8280
  }
8296
8281
  }
@@ -8302,7 +8287,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
8302
8287
  }
8303
8288
  static getSettablePaths(_options = {}) {
8304
8289
  return {
8305
- relativeDirPath: join70(".github", "agents")
8290
+ relativeDirPath: join69(".github", "agents")
8306
8291
  };
8307
8292
  }
8308
8293
  getFrontmatter() {
@@ -8376,7 +8361,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
8376
8361
  return {
8377
8362
  success: false,
8378
8363
  error: new Error(
8379
- `Invalid frontmatter in ${join70(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8364
+ `Invalid frontmatter in ${join69(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8380
8365
  )
8381
8366
  };
8382
8367
  }
@@ -8394,7 +8379,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
8394
8379
  global = false
8395
8380
  }) {
8396
8381
  const paths = this.getSettablePaths({ global });
8397
- const filePath = join70(baseDir, paths.relativeDirPath, relativeFilePath);
8382
+ const filePath = join69(baseDir, paths.relativeDirPath, relativeFilePath);
8398
8383
  const fileContent = await readFileContent(filePath);
8399
8384
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
8400
8385
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -8429,24 +8414,171 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
8429
8414
  }
8430
8415
  };
8431
8416
 
8432
- // src/features/subagents/kiro-subagent.ts
8433
- import { join as join71 } from "path";
8417
+ // src/features/subagents/cursor-subagent.ts
8418
+ import { join as join70 } from "path";
8434
8419
  import { z as z35 } from "zod/mini";
8435
- var KiroCliSubagentJsonSchema = z35.looseObject({
8420
+ var CursorSubagentFrontmatterSchema = z35.looseObject({
8436
8421
  name: z35.string(),
8437
- description: z35.optional(z35.nullable(z35.string())),
8438
- prompt: z35.optional(z35.nullable(z35.string())),
8439
- tools: z35.optional(z35.nullable(z35.array(z35.string()))),
8440
- toolAliases: z35.optional(z35.nullable(z35.record(z35.string(), z35.string()))),
8441
- toolSettings: z35.optional(z35.nullable(z35.unknown())),
8442
- toolSchema: z35.optional(z35.nullable(z35.unknown())),
8443
- hooks: z35.optional(z35.nullable(z35.record(z35.string(), z35.array(z35.unknown())))),
8444
- model: z35.optional(z35.nullable(z35.string())),
8445
- mcpServers: z35.optional(z35.nullable(z35.record(z35.string(), z35.unknown()))),
8446
- useLegacyMcpJson: z35.optional(z35.nullable(z35.boolean())),
8447
- resources: z35.optional(z35.nullable(z35.array(z35.string()))),
8448
- allowedTools: z35.optional(z35.nullable(z35.array(z35.string()))),
8449
- includeMcpJson: z35.optional(z35.nullable(z35.boolean()))
8422
+ description: z35.string()
8423
+ });
8424
+ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
8425
+ frontmatter;
8426
+ body;
8427
+ constructor({ frontmatter, body, ...rest }) {
8428
+ if (rest.validate !== false) {
8429
+ const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
8430
+ if (!result.success) {
8431
+ throw new Error(
8432
+ `Invalid frontmatter in ${join70(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
8433
+ );
8434
+ }
8435
+ }
8436
+ super({
8437
+ ...rest
8438
+ });
8439
+ this.frontmatter = frontmatter;
8440
+ this.body = body;
8441
+ }
8442
+ static getSettablePaths(_options = {}) {
8443
+ return {
8444
+ relativeDirPath: join70(".cursor", "agents")
8445
+ };
8446
+ }
8447
+ getFrontmatter() {
8448
+ return this.frontmatter;
8449
+ }
8450
+ getBody() {
8451
+ return this.body;
8452
+ }
8453
+ toRulesyncSubagent() {
8454
+ const { name, description, ...rest } = this.frontmatter;
8455
+ const rulesyncFrontmatter = {
8456
+ targets: ["*"],
8457
+ name,
8458
+ description,
8459
+ cursor: {
8460
+ ...rest
8461
+ }
8462
+ };
8463
+ return new RulesyncSubagent({
8464
+ baseDir: ".",
8465
+ // RulesyncSubagent baseDir is always the project root directory
8466
+ frontmatter: rulesyncFrontmatter,
8467
+ body: this.body,
8468
+ relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
8469
+ relativeFilePath: this.getRelativeFilePath(),
8470
+ validate: true
8471
+ });
8472
+ }
8473
+ static fromRulesyncSubagent({
8474
+ baseDir = process.cwd(),
8475
+ rulesyncSubagent,
8476
+ validate = true,
8477
+ global = false
8478
+ }) {
8479
+ const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
8480
+ const cursorSection = rulesyncFrontmatter.cursor ?? {};
8481
+ const cursorFrontmatter = {
8482
+ name: rulesyncFrontmatter.name,
8483
+ description: rulesyncFrontmatter.description,
8484
+ ...cursorSection
8485
+ };
8486
+ const body = rulesyncSubagent.getBody();
8487
+ const fileContent = stringifyFrontmatter(body, cursorFrontmatter);
8488
+ const paths = this.getSettablePaths({ global });
8489
+ return new _CursorSubagent({
8490
+ baseDir,
8491
+ frontmatter: cursorFrontmatter,
8492
+ body,
8493
+ relativeDirPath: paths.relativeDirPath,
8494
+ relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
8495
+ fileContent,
8496
+ validate,
8497
+ global
8498
+ });
8499
+ }
8500
+ validate() {
8501
+ if (!this.frontmatter) {
8502
+ return { success: true, error: null };
8503
+ }
8504
+ const result = CursorSubagentFrontmatterSchema.safeParse(this.frontmatter);
8505
+ if (result.success) {
8506
+ return { success: true, error: null };
8507
+ } else {
8508
+ return {
8509
+ success: false,
8510
+ error: new Error(
8511
+ `Invalid frontmatter in ${join70(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
8512
+ )
8513
+ };
8514
+ }
8515
+ }
8516
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
8517
+ return this.isTargetedByRulesyncSubagentDefault({
8518
+ rulesyncSubagent,
8519
+ toolTarget: "cursor"
8520
+ });
8521
+ }
8522
+ static async fromFile({
8523
+ baseDir = process.cwd(),
8524
+ relativeFilePath,
8525
+ validate = true,
8526
+ global = false
8527
+ }) {
8528
+ const paths = this.getSettablePaths({ global });
8529
+ const filePath = join70(baseDir, paths.relativeDirPath, relativeFilePath);
8530
+ const fileContent = await readFileContent(filePath);
8531
+ const { frontmatter, body: content } = parseFrontmatter(fileContent);
8532
+ const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
8533
+ if (!result.success) {
8534
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
8535
+ }
8536
+ return new _CursorSubagent({
8537
+ baseDir,
8538
+ relativeDirPath: paths.relativeDirPath,
8539
+ relativeFilePath,
8540
+ frontmatter: result.data,
8541
+ body: content.trim(),
8542
+ fileContent,
8543
+ validate,
8544
+ global
8545
+ });
8546
+ }
8547
+ static forDeletion({
8548
+ baseDir = process.cwd(),
8549
+ relativeDirPath,
8550
+ relativeFilePath
8551
+ }) {
8552
+ return new _CursorSubagent({
8553
+ baseDir,
8554
+ relativeDirPath,
8555
+ relativeFilePath,
8556
+ frontmatter: { name: "", description: "" },
8557
+ body: "",
8558
+ fileContent: "",
8559
+ validate: false
8560
+ });
8561
+ }
8562
+ };
8563
+
8564
+ // src/features/subagents/kiro-subagent.ts
8565
+ import { join as join71 } from "path";
8566
+ import { z as z36 } from "zod/mini";
8567
+ var KiroCliSubagentJsonSchema = z36.looseObject({
8568
+ name: z36.string(),
8569
+ description: z36.optional(z36.nullable(z36.string())),
8570
+ prompt: z36.optional(z36.nullable(z36.string())),
8571
+ tools: z36.optional(z36.nullable(z36.array(z36.string()))),
8572
+ toolAliases: z36.optional(z36.nullable(z36.record(z36.string(), z36.string()))),
8573
+ toolSettings: z36.optional(z36.nullable(z36.unknown())),
8574
+ toolSchema: z36.optional(z36.nullable(z36.unknown())),
8575
+ hooks: z36.optional(z36.nullable(z36.record(z36.string(), z36.array(z36.unknown())))),
8576
+ model: z36.optional(z36.nullable(z36.string())),
8577
+ mcpServers: z36.optional(z36.nullable(z36.record(z36.string(), z36.unknown()))),
8578
+ useLegacyMcpJson: z36.optional(z36.nullable(z36.boolean())),
8579
+ resources: z36.optional(z36.nullable(z36.array(z36.string()))),
8580
+ allowedTools: z36.optional(z36.nullable(z36.array(z36.string()))),
8581
+ includeMcpJson: z36.optional(z36.nullable(z36.boolean()))
8450
8582
  });
8451
8583
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
8452
8584
  body;
@@ -8568,11 +8700,11 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
8568
8700
 
8569
8701
  // src/features/subagents/opencode-subagent.ts
8570
8702
  import { basename as basename20, join as join72 } from "path";
8571
- import { z as z36 } from "zod/mini";
8572
- var OpenCodeSubagentFrontmatterSchema = z36.looseObject({
8573
- description: z36.string(),
8574
- mode: z36.literal("subagent"),
8575
- name: z36.optional(z36.string())
8703
+ import { z as z37 } from "zod/mini";
8704
+ var OpenCodeSubagentFrontmatterSchema = z37.looseObject({
8705
+ description: z37.string(),
8706
+ mode: z37.literal("subagent"),
8707
+ name: z37.optional(z37.string())
8576
8708
  });
8577
8709
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
8578
8710
  frontmatter;
@@ -8727,7 +8859,7 @@ var subagentsProcessorToolTargetTuple = [
8727
8859
  "opencode",
8728
8860
  "roo"
8729
8861
  ];
8730
- var SubagentsProcessorToolTargetSchema = z37.enum(subagentsProcessorToolTargetTuple);
8862
+ var SubagentsProcessorToolTargetSchema = z38.enum(subagentsProcessorToolTargetTuple);
8731
8863
  var toolSubagentFactories = /* @__PURE__ */ new Map([
8732
8864
  [
8733
8865
  "agentsmd",
@@ -8768,7 +8900,7 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
8768
8900
  "cursor",
8769
8901
  {
8770
8902
  class: CursorSubagent,
8771
- meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
8903
+ meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
8772
8904
  }
8773
8905
  ],
8774
8906
  [
@@ -8983,42 +9115,42 @@ import { join as join75 } from "path";
8983
9115
 
8984
9116
  // src/features/rules/rulesync-rule.ts
8985
9117
  import { join as join74 } from "path";
8986
- import { z as z38 } from "zod/mini";
8987
- var RulesyncRuleFrontmatterSchema = z38.object({
8988
- root: z38.optional(z38.boolean()),
8989
- localRoot: z38.optional(z38.boolean()),
8990
- targets: z38.optional(RulesyncTargetsSchema),
8991
- description: z38.optional(z38.string()),
8992
- globs: z38.optional(z38.array(z38.string())),
8993
- agentsmd: z38.optional(
8994
- z38.object({
9118
+ import { z as z39 } from "zod/mini";
9119
+ var RulesyncRuleFrontmatterSchema = z39.object({
9120
+ root: z39.optional(z39.boolean()),
9121
+ localRoot: z39.optional(z39.boolean()),
9122
+ targets: z39.optional(RulesyncTargetsSchema),
9123
+ description: z39.optional(z39.string()),
9124
+ globs: z39.optional(z39.array(z39.string())),
9125
+ agentsmd: z39.optional(
9126
+ z39.object({
8995
9127
  // @example "path/to/subproject"
8996
- subprojectPath: z38.optional(z38.string())
9128
+ subprojectPath: z39.optional(z39.string())
8997
9129
  })
8998
9130
  ),
8999
- claudecode: z38.optional(
9000
- z38.object({
9131
+ claudecode: z39.optional(
9132
+ z39.object({
9001
9133
  // Glob patterns for conditional rules (takes precedence over globs)
9002
9134
  // @example "src/**/*.ts, tests/**/*.test.ts"
9003
- paths: z38.optional(z38.string())
9135
+ paths: z39.optional(z39.string())
9004
9136
  })
9005
9137
  ),
9006
- cursor: z38.optional(
9007
- z38.object({
9008
- alwaysApply: z38.optional(z38.boolean()),
9009
- description: z38.optional(z38.string()),
9010
- globs: z38.optional(z38.array(z38.string()))
9138
+ cursor: z39.optional(
9139
+ z39.object({
9140
+ alwaysApply: z39.optional(z39.boolean()),
9141
+ description: z39.optional(z39.string()),
9142
+ globs: z39.optional(z39.array(z39.string()))
9011
9143
  })
9012
9144
  ),
9013
- copilot: z38.optional(
9014
- z38.object({
9015
- excludeAgent: z38.optional(z38.union([z38.literal("code-review"), z38.literal("coding-agent")]))
9145
+ copilot: z39.optional(
9146
+ z39.object({
9147
+ excludeAgent: z39.optional(z39.union([z39.literal("code-review"), z39.literal("coding-agent")]))
9016
9148
  })
9017
9149
  ),
9018
- antigravity: z38.optional(
9019
- z38.looseObject({
9020
- trigger: z38.optional(z38.string()),
9021
- globs: z38.optional(z38.array(z38.string()))
9150
+ antigravity: z39.optional(
9151
+ z39.looseObject({
9152
+ trigger: z39.optional(z39.string()),
9153
+ globs: z39.optional(z39.array(z39.string()))
9022
9154
  })
9023
9155
  )
9024
9156
  });
@@ -9319,20 +9451,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
9319
9451
 
9320
9452
  // src/features/rules/antigravity-rule.ts
9321
9453
  import { join as join77 } from "path";
9322
- import { z as z39 } from "zod/mini";
9323
- var AntigravityRuleFrontmatterSchema = z39.looseObject({
9324
- trigger: z39.optional(
9325
- z39.union([
9326
- z39.literal("always_on"),
9327
- z39.literal("glob"),
9328
- z39.literal("manual"),
9329
- z39.literal("model_decision"),
9330
- z39.string()
9454
+ import { z as z40 } from "zod/mini";
9455
+ var AntigravityRuleFrontmatterSchema = z40.looseObject({
9456
+ trigger: z40.optional(
9457
+ z40.union([
9458
+ z40.literal("always_on"),
9459
+ z40.literal("glob"),
9460
+ z40.literal("manual"),
9461
+ z40.literal("model_decision"),
9462
+ z40.string()
9331
9463
  // accepts any string for forward compatibility
9332
9464
  ])
9333
9465
  ),
9334
- globs: z39.optional(z39.string()),
9335
- description: z39.optional(z39.string())
9466
+ globs: z40.optional(z40.string()),
9467
+ description: z40.optional(z40.string())
9336
9468
  });
9337
9469
  function parseGlobsString(globs) {
9338
9470
  if (!globs) {
@@ -9910,9 +10042,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
9910
10042
 
9911
10043
  // src/features/rules/claudecode-rule.ts
9912
10044
  import { join as join81 } from "path";
9913
- import { z as z40 } from "zod/mini";
9914
- var ClaudecodeRuleFrontmatterSchema = z40.object({
9915
- paths: z40.optional(z40.string())
10045
+ import { z as z41 } from "zod/mini";
10046
+ var ClaudecodeRuleFrontmatterSchema = z41.object({
10047
+ paths: z41.optional(z41.string())
9916
10048
  });
9917
10049
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
9918
10050
  frontmatter;
@@ -10120,9 +10252,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
10120
10252
 
10121
10253
  // src/features/rules/cline-rule.ts
10122
10254
  import { join as join82 } from "path";
10123
- import { z as z41 } from "zod/mini";
10124
- var ClineRuleFrontmatterSchema = z41.object({
10125
- description: z41.string()
10255
+ import { z as z42 } from "zod/mini";
10256
+ var ClineRuleFrontmatterSchema = z42.object({
10257
+ description: z42.string()
10126
10258
  });
10127
10259
  var ClineRule = class _ClineRule extends ToolRule {
10128
10260
  static getSettablePaths() {
@@ -10299,11 +10431,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
10299
10431
 
10300
10432
  // src/features/rules/copilot-rule.ts
10301
10433
  import { join as join84 } from "path";
10302
- import { z as z42 } from "zod/mini";
10303
- var CopilotRuleFrontmatterSchema = z42.object({
10304
- description: z42.optional(z42.string()),
10305
- applyTo: z42.optional(z42.string()),
10306
- excludeAgent: z42.optional(z42.union([z42.literal("code-review"), z42.literal("coding-agent")]))
10434
+ import { z as z43 } from "zod/mini";
10435
+ var CopilotRuleFrontmatterSchema = z43.object({
10436
+ description: z43.optional(z43.string()),
10437
+ applyTo: z43.optional(z43.string()),
10438
+ excludeAgent: z43.optional(z43.union([z43.literal("code-review"), z43.literal("coding-agent")]))
10307
10439
  });
10308
10440
  var CopilotRule = class _CopilotRule extends ToolRule {
10309
10441
  frontmatter;
@@ -10487,11 +10619,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
10487
10619
 
10488
10620
  // src/features/rules/cursor-rule.ts
10489
10621
  import { join as join85 } from "path";
10490
- import { z as z43 } from "zod/mini";
10491
- var CursorRuleFrontmatterSchema = z43.object({
10492
- description: z43.optional(z43.string()),
10493
- globs: z43.optional(z43.string()),
10494
- alwaysApply: z43.optional(z43.boolean())
10622
+ import { z as z44 } from "zod/mini";
10623
+ var CursorRuleFrontmatterSchema = z44.object({
10624
+ description: z44.optional(z44.string()),
10625
+ globs: z44.optional(z44.string()),
10626
+ alwaysApply: z44.optional(z44.boolean())
10495
10627
  });
10496
10628
  var CursorRule = class _CursorRule extends ToolRule {
10497
10629
  frontmatter;
@@ -11497,7 +11629,7 @@ var rulesProcessorToolTargets = [
11497
11629
  "warp",
11498
11630
  "windsurf"
11499
11631
  ];
11500
- var RulesProcessorToolTargetSchema = z44.enum(rulesProcessorToolTargets);
11632
+ var RulesProcessorToolTargetSchema = z45.enum(rulesProcessorToolTargets);
11501
11633
  var toolRuleFactories = /* @__PURE__ */ new Map([
11502
11634
  [
11503
11635
  "agentsmd",
@@ -11589,11 +11721,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
11589
11721
  meta: {
11590
11722
  extension: "mdc",
11591
11723
  supportsGlobal: false,
11592
- ruleDiscoveryMode: "auto",
11593
- additionalConventions: {
11594
- subagents: { subagentClass: CursorSubagent }
11595
- },
11596
- createsSeparateConventionsRule: true
11724
+ ruleDiscoveryMode: "auto"
11597
11725
  }
11598
11726
  }
11599
11727
  ],
@@ -12404,7 +12532,7 @@ async function generateCommand(options) {
12404
12532
  silent: config.getSilent()
12405
12533
  });
12406
12534
  logger.info("Generating files...");
12407
- if (!await checkRulesyncDirExists({ baseDir: config.getBaseDirs()[0] ?? process.cwd() })) {
12535
+ if (!await checkRulesyncDirExists({ baseDir: process.cwd() })) {
12408
12536
  logger.error("\u274C .rulesync directory not found. Run 'rulesync init' first.");
12409
12537
  process.exit(1);
12410
12538
  }
@@ -13049,11 +13177,11 @@ Keep the summary concise and ready to reuse in future tasks.`
13049
13177
  import { FastMCP } from "fastmcp";
13050
13178
 
13051
13179
  // src/mcp/tools.ts
13052
- import { z as z51 } from "zod/mini";
13180
+ import { z as z52 } from "zod/mini";
13053
13181
 
13054
13182
  // src/mcp/commands.ts
13055
13183
  import { basename as basename23, join as join100 } from "path";
13056
- import { z as z45 } from "zod/mini";
13184
+ import { z as z46 } from "zod/mini";
13057
13185
  var maxCommandSizeBytes = 1024 * 1024;
13058
13186
  var maxCommandsCount = 1e3;
13059
13187
  async function listCommands() {
@@ -13172,17 +13300,17 @@ async function deleteCommand({ relativePathFromCwd }) {
13172
13300
  }
13173
13301
  }
13174
13302
  var commandToolSchemas = {
13175
- listCommands: z45.object({}),
13176
- getCommand: z45.object({
13177
- relativePathFromCwd: z45.string()
13303
+ listCommands: z46.object({}),
13304
+ getCommand: z46.object({
13305
+ relativePathFromCwd: z46.string()
13178
13306
  }),
13179
- putCommand: z45.object({
13180
- relativePathFromCwd: z45.string(),
13307
+ putCommand: z46.object({
13308
+ relativePathFromCwd: z46.string(),
13181
13309
  frontmatter: RulesyncCommandFrontmatterSchema,
13182
- body: z45.string()
13310
+ body: z46.string()
13183
13311
  }),
13184
- deleteCommand: z45.object({
13185
- relativePathFromCwd: z45.string()
13312
+ deleteCommand: z46.object({
13313
+ relativePathFromCwd: z46.string()
13186
13314
  })
13187
13315
  };
13188
13316
  var commandTools = {
@@ -13231,7 +13359,7 @@ var commandTools = {
13231
13359
 
13232
13360
  // src/mcp/ignore.ts
13233
13361
  import { join as join101 } from "path";
13234
- import { z as z46 } from "zod/mini";
13362
+ import { z as z47 } from "zod/mini";
13235
13363
  var maxIgnoreFileSizeBytes = 100 * 1024;
13236
13364
  async function getIgnoreFile() {
13237
13365
  const ignoreFilePath = join101(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
@@ -13288,11 +13416,11 @@ async function deleteIgnoreFile() {
13288
13416
  }
13289
13417
  }
13290
13418
  var ignoreToolSchemas = {
13291
- getIgnoreFile: z46.object({}),
13292
- putIgnoreFile: z46.object({
13293
- content: z46.string()
13419
+ getIgnoreFile: z47.object({}),
13420
+ putIgnoreFile: z47.object({
13421
+ content: z47.string()
13294
13422
  }),
13295
- deleteIgnoreFile: z46.object({})
13423
+ deleteIgnoreFile: z47.object({})
13296
13424
  };
13297
13425
  var ignoreTools = {
13298
13426
  getIgnoreFile: {
@@ -13326,7 +13454,7 @@ var ignoreTools = {
13326
13454
 
13327
13455
  // src/mcp/mcp.ts
13328
13456
  import { join as join102 } from "path";
13329
- import { z as z47 } from "zod/mini";
13457
+ import { z as z48 } from "zod/mini";
13330
13458
  var maxMcpSizeBytes = 1024 * 1024;
13331
13459
  async function getMcpFile() {
13332
13460
  const config = await ConfigResolver.resolve({});
@@ -13416,11 +13544,11 @@ async function deleteMcpFile() {
13416
13544
  }
13417
13545
  }
13418
13546
  var mcpToolSchemas = {
13419
- getMcpFile: z47.object({}),
13420
- putMcpFile: z47.object({
13421
- content: z47.string()
13547
+ getMcpFile: z48.object({}),
13548
+ putMcpFile: z48.object({
13549
+ content: z48.string()
13422
13550
  }),
13423
- deleteMcpFile: z47.object({})
13551
+ deleteMcpFile: z48.object({})
13424
13552
  };
13425
13553
  var mcpTools = {
13426
13554
  getMcpFile: {
@@ -13454,7 +13582,7 @@ var mcpTools = {
13454
13582
 
13455
13583
  // src/mcp/rules.ts
13456
13584
  import { basename as basename24, join as join103 } from "path";
13457
- import { z as z48 } from "zod/mini";
13585
+ import { z as z49 } from "zod/mini";
13458
13586
  var maxRuleSizeBytes = 1024 * 1024;
13459
13587
  var maxRulesCount = 1e3;
13460
13588
  async function listRules() {
@@ -13573,17 +13701,17 @@ async function deleteRule({ relativePathFromCwd }) {
13573
13701
  }
13574
13702
  }
13575
13703
  var ruleToolSchemas = {
13576
- listRules: z48.object({}),
13577
- getRule: z48.object({
13578
- relativePathFromCwd: z48.string()
13704
+ listRules: z49.object({}),
13705
+ getRule: z49.object({
13706
+ relativePathFromCwd: z49.string()
13579
13707
  }),
13580
- putRule: z48.object({
13581
- relativePathFromCwd: z48.string(),
13708
+ putRule: z49.object({
13709
+ relativePathFromCwd: z49.string(),
13582
13710
  frontmatter: RulesyncRuleFrontmatterSchema,
13583
- body: z48.string()
13711
+ body: z49.string()
13584
13712
  }),
13585
- deleteRule: z48.object({
13586
- relativePathFromCwd: z48.string()
13713
+ deleteRule: z49.object({
13714
+ relativePathFromCwd: z49.string()
13587
13715
  })
13588
13716
  };
13589
13717
  var ruleTools = {
@@ -13632,7 +13760,7 @@ var ruleTools = {
13632
13760
 
13633
13761
  // src/mcp/skills.ts
13634
13762
  import { basename as basename25, dirname as dirname3, join as join104 } from "path";
13635
- import { z as z49 } from "zod/mini";
13763
+ import { z as z50 } from "zod/mini";
13636
13764
  var maxSkillSizeBytes = 1024 * 1024;
13637
13765
  var maxSkillsCount = 1e3;
13638
13766
  function aiDirFileToMcpSkillFile(file) {
@@ -13800,23 +13928,23 @@ async function deleteSkill({
13800
13928
  );
13801
13929
  }
13802
13930
  }
13803
- var McpSkillFileSchema = z49.object({
13804
- name: z49.string(),
13805
- body: z49.string()
13931
+ var McpSkillFileSchema = z50.object({
13932
+ name: z50.string(),
13933
+ body: z50.string()
13806
13934
  });
13807
13935
  var skillToolSchemas = {
13808
- listSkills: z49.object({}),
13809
- getSkill: z49.object({
13810
- relativeDirPathFromCwd: z49.string()
13936
+ listSkills: z50.object({}),
13937
+ getSkill: z50.object({
13938
+ relativeDirPathFromCwd: z50.string()
13811
13939
  }),
13812
- putSkill: z49.object({
13813
- relativeDirPathFromCwd: z49.string(),
13940
+ putSkill: z50.object({
13941
+ relativeDirPathFromCwd: z50.string(),
13814
13942
  frontmatter: RulesyncSkillFrontmatterSchema,
13815
- body: z49.string(),
13816
- otherFiles: z49.optional(z49.array(McpSkillFileSchema))
13943
+ body: z50.string(),
13944
+ otherFiles: z50.optional(z50.array(McpSkillFileSchema))
13817
13945
  }),
13818
- deleteSkill: z49.object({
13819
- relativeDirPathFromCwd: z49.string()
13946
+ deleteSkill: z50.object({
13947
+ relativeDirPathFromCwd: z50.string()
13820
13948
  })
13821
13949
  };
13822
13950
  var skillTools = {
@@ -13866,7 +13994,7 @@ var skillTools = {
13866
13994
 
13867
13995
  // src/mcp/subagents.ts
13868
13996
  import { basename as basename26, join as join105 } from "path";
13869
- import { z as z50 } from "zod/mini";
13997
+ import { z as z51 } from "zod/mini";
13870
13998
  var maxSubagentSizeBytes = 1024 * 1024;
13871
13999
  var maxSubagentsCount = 1e3;
13872
14000
  async function listSubagents() {
@@ -13990,17 +14118,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
13990
14118
  }
13991
14119
  }
13992
14120
  var subagentToolSchemas = {
13993
- listSubagents: z50.object({}),
13994
- getSubagent: z50.object({
13995
- relativePathFromCwd: z50.string()
14121
+ listSubagents: z51.object({}),
14122
+ getSubagent: z51.object({
14123
+ relativePathFromCwd: z51.string()
13996
14124
  }),
13997
- putSubagent: z50.object({
13998
- relativePathFromCwd: z50.string(),
14125
+ putSubagent: z51.object({
14126
+ relativePathFromCwd: z51.string(),
13999
14127
  frontmatter: RulesyncSubagentFrontmatterSchema,
14000
- body: z50.string()
14128
+ body: z51.string()
14001
14129
  }),
14002
- deleteSubagent: z50.object({
14003
- relativePathFromCwd: z50.string()
14130
+ deleteSubagent: z51.object({
14131
+ relativePathFromCwd: z51.string()
14004
14132
  })
14005
14133
  };
14006
14134
  var subagentTools = {
@@ -14048,20 +14176,20 @@ var subagentTools = {
14048
14176
  };
14049
14177
 
14050
14178
  // src/mcp/tools.ts
14051
- var rulesyncFeatureSchema = z51.enum(["rule", "command", "subagent", "skill", "ignore", "mcp"]);
14052
- var rulesyncOperationSchema = z51.enum(["list", "get", "put", "delete"]);
14053
- var skillFileSchema = z51.object({
14054
- name: z51.string(),
14055
- body: z51.string()
14179
+ var rulesyncFeatureSchema = z52.enum(["rule", "command", "subagent", "skill", "ignore", "mcp"]);
14180
+ var rulesyncOperationSchema = z52.enum(["list", "get", "put", "delete"]);
14181
+ var skillFileSchema = z52.object({
14182
+ name: z52.string(),
14183
+ body: z52.string()
14056
14184
  });
14057
- var rulesyncToolSchema = z51.object({
14185
+ var rulesyncToolSchema = z52.object({
14058
14186
  feature: rulesyncFeatureSchema,
14059
14187
  operation: rulesyncOperationSchema,
14060
- targetPathFromCwd: z51.optional(z51.string()),
14061
- frontmatter: z51.optional(z51.unknown()),
14062
- body: z51.optional(z51.string()),
14063
- otherFiles: z51.optional(z51.array(skillFileSchema)),
14064
- content: z51.optional(z51.string())
14188
+ targetPathFromCwd: z52.optional(z52.string()),
14189
+ frontmatter: z52.optional(z52.unknown()),
14190
+ body: z52.optional(z52.string()),
14191
+ otherFiles: z52.optional(z52.array(skillFileSchema)),
14192
+ content: z52.optional(z52.string())
14065
14193
  });
14066
14194
  var supportedOperationsByFeature = {
14067
14195
  rule: ["list", "get", "put", "delete"],
@@ -14257,7 +14385,7 @@ async function mcpCommand({ version }) {
14257
14385
  }
14258
14386
 
14259
14387
  // src/cli/index.ts
14260
- var getVersion = () => "6.1.0";
14388
+ var getVersion = () => "6.2.0";
14261
14389
  var main = async () => {
14262
14390
  const program = new Command();
14263
14391
  const version = getVersion();
@@ -14324,7 +14452,7 @@ var main = async () => {
14324
14452
  "Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
14325
14453
  ).option(
14326
14454
  "--simulate-subagents",
14327
- "Generate simulated subagents. This feature is only available for copilot, cursor and codexcli."
14455
+ "Generate simulated subagents. This feature is only available for copilot and codexcli."
14328
14456
  ).option(
14329
14457
  "--simulate-skills",
14330
14458
  "Generate simulated skills. This feature is only available for copilot, cursor and codexcli."