rulesync 7.16.0 → 7.17.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.
@@ -157,6 +157,8 @@ var RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = join(
157
157
  var RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH = "rulesync.lock";
158
158
  var RULESYNC_MCP_FILE_NAME = "mcp.json";
159
159
  var RULESYNC_HOOKS_FILE_NAME = "hooks.json";
160
+ var RULESYNC_CONFIG_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/config-schema.json";
161
+ var RULESYNC_MCP_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/mcp-schema.json";
160
162
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
161
163
  var FETCH_CONCURRENCY_LIMIT = 10;
162
164
 
@@ -5741,7 +5743,7 @@ import { z as z20 } from "zod/mini";
5741
5743
 
5742
5744
  // src/types/mcp.ts
5743
5745
  import { z as z19 } from "zod/mini";
5744
- var McpServerSchema = z19.object({
5746
+ var McpServerSchema = z19.looseObject({
5745
5747
  type: z19.optional(z19.enum(["stdio", "sse", "http"])),
5746
5748
  command: z19.optional(z19.union([z19.string(), z19.array(z19.string())])),
5747
5749
  args: z19.optional(z19.array(z19.string())),
@@ -5773,6 +5775,10 @@ var RulesyncMcpServerSchema = z20.extend(McpServerSchema, {
5773
5775
  var RulesyncMcpConfigSchema = z20.object({
5774
5776
  mcpServers: z20.record(z20.string(), RulesyncMcpServerSchema)
5775
5777
  });
5778
+ var RulesyncMcpFileSchema = z20.looseObject({
5779
+ $schema: z20.optional(z20.string()),
5780
+ ...RulesyncMcpConfigSchema.shape
5781
+ });
5776
5782
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5777
5783
  json;
5778
5784
  constructor(params) {
@@ -5798,7 +5804,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5798
5804
  };
5799
5805
  }
5800
5806
  validate() {
5801
- const result = RulesyncMcpConfigSchema.safeParse(this.json);
5807
+ const result = RulesyncMcpFileSchema.safeParse(this.json);
5802
5808
  if (!result.success) {
5803
5809
  return { success: false, error: result.error };
5804
5810
  }
@@ -5901,11 +5907,17 @@ var ToolMcp = class extends ToolFile {
5901
5907
  toRulesyncMcpDefault({
5902
5908
  fileContent = void 0
5903
5909
  } = {}) {
5910
+ const content = fileContent ?? this.fileContent;
5911
+ const { $schema: _, ...json } = JSON.parse(content);
5912
+ const withSchema = {
5913
+ $schema: RULESYNC_MCP_SCHEMA_URL,
5914
+ ...json
5915
+ };
5904
5916
  return new RulesyncMcp({
5905
5917
  baseDir: this.baseDir,
5906
5918
  relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5907
- relativeFilePath: ".mcp.json",
5908
- fileContent: fileContent ?? this.fileContent
5919
+ relativeFilePath: RULESYNC_MCP_FILE_NAME,
5920
+ fileContent: JSON.stringify(withSchema, null, 2)
5909
5921
  });
5910
5922
  }
5911
5923
  static async fromFile(_params) {
@@ -6208,10 +6220,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6208
6220
  toRulesyncMcp() {
6209
6221
  const mcpServers = this.toml.mcp_servers ?? {};
6210
6222
  const converted = convertFromCodexFormat(mcpServers);
6211
- return new RulesyncMcp({
6212
- baseDir: this.baseDir,
6213
- relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
6214
- relativeFilePath: ".mcp.json",
6223
+ return this.toRulesyncMcpDefault({
6215
6224
  fileContent: JSON.stringify({ mcpServers: converted }, null, 2)
6216
6225
  });
6217
6226
  }
@@ -6461,12 +6470,8 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6461
6470
  ...this.json,
6462
6471
  mcpServers: transformedServers
6463
6472
  };
6464
- return new RulesyncMcp({
6465
- baseDir: this.baseDir,
6466
- relativeDirPath: this.relativeDirPath,
6467
- relativeFilePath: "rulesync.mcp.json",
6468
- fileContent: JSON.stringify(transformedJson),
6469
- validate: true
6473
+ return this.toRulesyncMcpDefault({
6474
+ fileContent: JSON.stringify(transformedJson, null, 2)
6470
6475
  });
6471
6476
  }
6472
6477
  validate() {
@@ -6544,13 +6549,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6544
6549
  });
6545
6550
  }
6546
6551
  toRulesyncMcp() {
6547
- return new RulesyncMcp({
6548
- baseDir: this.baseDir,
6549
- relativeDirPath: this.relativeDirPath,
6550
- relativeFilePath: "rulesync.mcp.json",
6551
- fileContent: JSON.stringify(this.json),
6552
- validate: true
6553
- });
6552
+ return this.toRulesyncMcpDefault();
6554
6553
  }
6555
6554
  validate() {
6556
6555
  return { success: true, error: null };
@@ -16996,6 +16995,8 @@ export {
16996
16995
  RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH,
16997
16996
  RULESYNC_MCP_FILE_NAME,
16998
16997
  RULESYNC_HOOKS_FILE_NAME,
16998
+ RULESYNC_CONFIG_SCHEMA_URL,
16999
+ RULESYNC_MCP_SCHEMA_URL,
16999
17000
  MAX_FILE_SIZE,
17000
17001
  FETCH_CONCURRENCY_LIMIT,
17001
17002
  formatError,
@@ -155,6 +155,8 @@ var RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path.join)(
155
155
  var RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH = "rulesync.lock";
156
156
  var RULESYNC_MCP_FILE_NAME = "mcp.json";
157
157
  var RULESYNC_HOOKS_FILE_NAME = "hooks.json";
158
+ var RULESYNC_CONFIG_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/config-schema.json";
159
+ var RULESYNC_MCP_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/mcp-schema.json";
158
160
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
159
161
  var FETCH_CONCURRENCY_LIMIT = 10;
160
162
 
@@ -5445,7 +5447,7 @@ var import_mini19 = require("zod/mini");
5445
5447
 
5446
5448
  // src/types/mcp.ts
5447
5449
  var import_mini18 = require("zod/mini");
5448
- var McpServerSchema = import_mini18.z.object({
5450
+ var McpServerSchema = import_mini18.z.looseObject({
5449
5451
  type: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
5450
5452
  command: import_mini18.z.optional(import_mini18.z.union([import_mini18.z.string(), import_mini18.z.array(import_mini18.z.string())])),
5451
5453
  args: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
@@ -5477,6 +5479,10 @@ var RulesyncMcpServerSchema = import_mini19.z.extend(McpServerSchema, {
5477
5479
  var RulesyncMcpConfigSchema = import_mini19.z.object({
5478
5480
  mcpServers: import_mini19.z.record(import_mini19.z.string(), RulesyncMcpServerSchema)
5479
5481
  });
5482
+ var RulesyncMcpFileSchema = import_mini19.z.looseObject({
5483
+ $schema: import_mini19.z.optional(import_mini19.z.string()),
5484
+ ...RulesyncMcpConfigSchema.shape
5485
+ });
5480
5486
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5481
5487
  json;
5482
5488
  constructor(params) {
@@ -5502,7 +5508,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5502
5508
  };
5503
5509
  }
5504
5510
  validate() {
5505
- const result = RulesyncMcpConfigSchema.safeParse(this.json);
5511
+ const result = RulesyncMcpFileSchema.safeParse(this.json);
5506
5512
  if (!result.success) {
5507
5513
  return { success: false, error: result.error };
5508
5514
  }
@@ -5605,11 +5611,17 @@ var ToolMcp = class extends ToolFile {
5605
5611
  toRulesyncMcpDefault({
5606
5612
  fileContent = void 0
5607
5613
  } = {}) {
5614
+ const content = fileContent ?? this.fileContent;
5615
+ const { $schema: _, ...json } = JSON.parse(content);
5616
+ const withSchema = {
5617
+ $schema: RULESYNC_MCP_SCHEMA_URL,
5618
+ ...json
5619
+ };
5608
5620
  return new RulesyncMcp({
5609
5621
  baseDir: this.baseDir,
5610
5622
  relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5611
- relativeFilePath: ".mcp.json",
5612
- fileContent: fileContent ?? this.fileContent
5623
+ relativeFilePath: RULESYNC_MCP_FILE_NAME,
5624
+ fileContent: JSON.stringify(withSchema, null, 2)
5613
5625
  });
5614
5626
  }
5615
5627
  static async fromFile(_params) {
@@ -5912,10 +5924,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5912
5924
  toRulesyncMcp() {
5913
5925
  const mcpServers = this.toml.mcp_servers ?? {};
5914
5926
  const converted = convertFromCodexFormat(mcpServers);
5915
- return new RulesyncMcp({
5916
- baseDir: this.baseDir,
5917
- relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5918
- relativeFilePath: ".mcp.json",
5927
+ return this.toRulesyncMcpDefault({
5919
5928
  fileContent: JSON.stringify({ mcpServers: converted }, null, 2)
5920
5929
  });
5921
5930
  }
@@ -6165,12 +6174,8 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6165
6174
  ...this.json,
6166
6175
  mcpServers: transformedServers
6167
6176
  };
6168
- return new RulesyncMcp({
6169
- baseDir: this.baseDir,
6170
- relativeDirPath: this.relativeDirPath,
6171
- relativeFilePath: "rulesync.mcp.json",
6172
- fileContent: JSON.stringify(transformedJson),
6173
- validate: true
6177
+ return this.toRulesyncMcpDefault({
6178
+ fileContent: JSON.stringify(transformedJson, null, 2)
6174
6179
  });
6175
6180
  }
6176
6181
  validate() {
@@ -6248,13 +6253,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6248
6253
  });
6249
6254
  }
6250
6255
  toRulesyncMcp() {
6251
- return new RulesyncMcp({
6252
- baseDir: this.baseDir,
6253
- relativeDirPath: this.relativeDirPath,
6254
- relativeFilePath: "rulesync.mcp.json",
6255
- fileContent: JSON.stringify(this.json),
6256
- validate: true
6257
- });
6256
+ return this.toRulesyncMcpDefault();
6258
6257
  }
6259
6258
  validate() {
6260
6259
  return { success: true, error: null };
@@ -18321,6 +18320,7 @@ async function createConfigFile() {
18321
18320
  path4,
18322
18321
  JSON.stringify(
18323
18322
  {
18323
+ $schema: RULESYNC_CONFIG_SCHEMA_URL,
18324
18324
  targets: ["copilot", "cursor", "claudecode", "codexcli"],
18325
18325
  features: ["rules", "ignore", "mcp", "commands", "subagents", "skills", "hooks"],
18326
18326
  baseDirs: ["."],
@@ -18378,6 +18378,7 @@ globs: ["**/*"]
18378
18378
  const sampleMcpFile = {
18379
18379
  filename: "mcp.json",
18380
18380
  content: `{
18381
+ "$schema": "${RULESYNC_MCP_SCHEMA_URL}",
18381
18382
  "mcpServers": {
18382
18383
  "serena": {
18383
18384
  "type": "stdio",
@@ -21082,7 +21083,7 @@ async function updateCommand(currentVersion, options) {
21082
21083
  }
21083
21084
 
21084
21085
  // src/cli/index.ts
21085
- var getVersion = () => "7.16.0";
21086
+ var getVersion = () => "7.17.0";
21086
21087
  var main = async () => {
21087
21088
  const program = new import_commander.Command();
21088
21089
  const version = getVersion();
package/dist/cli/index.js CHANGED
@@ -14,12 +14,14 @@ import {
14
14
  RULESYNC_AIIGNORE_RELATIVE_FILE_PATH,
15
15
  RULESYNC_COMMANDS_RELATIVE_DIR_PATH,
16
16
  RULESYNC_CONFIG_RELATIVE_FILE_PATH,
17
+ RULESYNC_CONFIG_SCHEMA_URL,
17
18
  RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH,
18
19
  RULESYNC_HOOKS_FILE_NAME,
19
20
  RULESYNC_HOOKS_RELATIVE_FILE_PATH,
20
21
  RULESYNC_IGNORE_RELATIVE_FILE_PATH,
21
22
  RULESYNC_MCP_FILE_NAME,
22
23
  RULESYNC_MCP_RELATIVE_FILE_PATH,
24
+ RULESYNC_MCP_SCHEMA_URL,
23
25
  RULESYNC_OVERVIEW_FILE_NAME,
24
26
  RULESYNC_RELATIVE_DIR_PATH,
25
27
  RULESYNC_RULES_RELATIVE_DIR_PATH,
@@ -63,7 +65,7 @@ import {
63
65
  removeTempDirectory,
64
66
  stringifyFrontmatter,
65
67
  writeFileContent
66
- } from "../chunk-E5YWRHGW.js";
68
+ } from "../chunk-ZQUEAGJI.js";
67
69
 
68
70
  // src/cli/index.ts
69
71
  import { Command } from "commander";
@@ -1384,6 +1386,7 @@ async function createConfigFile() {
1384
1386
  path2,
1385
1387
  JSON.stringify(
1386
1388
  {
1389
+ $schema: RULESYNC_CONFIG_SCHEMA_URL,
1387
1390
  targets: ["copilot", "cursor", "claudecode", "codexcli"],
1388
1391
  features: ["rules", "ignore", "mcp", "commands", "subagents", "skills", "hooks"],
1389
1392
  baseDirs: ["."],
@@ -1441,6 +1444,7 @@ globs: ["**/*"]
1441
1444
  const sampleMcpFile = {
1442
1445
  filename: "mcp.json",
1443
1446
  content: `{
1447
+ "$schema": "${RULESYNC_MCP_SCHEMA_URL}",
1444
1448
  "mcpServers": {
1445
1449
  "serena": {
1446
1450
  "type": "stdio",
@@ -4145,7 +4149,7 @@ async function updateCommand(currentVersion, options) {
4145
4149
  }
4146
4150
 
4147
4151
  // src/cli/index.ts
4148
- var getVersion = () => "7.16.0";
4152
+ var getVersion = () => "7.17.0";
4149
4153
  var main = async () => {
4150
4154
  const program = new Command();
4151
4155
  const version = getVersion();
package/dist/index.cjs CHANGED
@@ -60,6 +60,8 @@ var RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path.join)(
60
60
  RULESYNC_SKILLS_RELATIVE_DIR_PATH,
61
61
  ".curated"
62
62
  );
63
+ var RULESYNC_MCP_FILE_NAME = "mcp.json";
64
+ var RULESYNC_MCP_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/mcp-schema.json";
63
65
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
64
66
 
65
67
  // src/utils/error.ts
@@ -5749,7 +5751,7 @@ var import_mini20 = require("zod/mini");
5749
5751
 
5750
5752
  // src/types/mcp.ts
5751
5753
  var import_mini19 = require("zod/mini");
5752
- var McpServerSchema = import_mini19.z.object({
5754
+ var McpServerSchema = import_mini19.z.looseObject({
5753
5755
  type: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
5754
5756
  command: import_mini19.z.optional(import_mini19.z.union([import_mini19.z.string(), import_mini19.z.array(import_mini19.z.string())])),
5755
5757
  args: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
@@ -5781,6 +5783,10 @@ var RulesyncMcpServerSchema = import_mini20.z.extend(McpServerSchema, {
5781
5783
  var RulesyncMcpConfigSchema = import_mini20.z.object({
5782
5784
  mcpServers: import_mini20.z.record(import_mini20.z.string(), RulesyncMcpServerSchema)
5783
5785
  });
5786
+ var RulesyncMcpFileSchema = import_mini20.z.looseObject({
5787
+ $schema: import_mini20.z.optional(import_mini20.z.string()),
5788
+ ...RulesyncMcpConfigSchema.shape
5789
+ });
5784
5790
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5785
5791
  json;
5786
5792
  constructor(params) {
@@ -5806,7 +5812,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5806
5812
  };
5807
5813
  }
5808
5814
  validate() {
5809
- const result = RulesyncMcpConfigSchema.safeParse(this.json);
5815
+ const result = RulesyncMcpFileSchema.safeParse(this.json);
5810
5816
  if (!result.success) {
5811
5817
  return { success: false, error: result.error };
5812
5818
  }
@@ -5909,11 +5915,17 @@ var ToolMcp = class extends ToolFile {
5909
5915
  toRulesyncMcpDefault({
5910
5916
  fileContent = void 0
5911
5917
  } = {}) {
5918
+ const content = fileContent ?? this.fileContent;
5919
+ const { $schema: _, ...json } = JSON.parse(content);
5920
+ const withSchema = {
5921
+ $schema: RULESYNC_MCP_SCHEMA_URL,
5922
+ ...json
5923
+ };
5912
5924
  return new RulesyncMcp({
5913
5925
  baseDir: this.baseDir,
5914
5926
  relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
5915
- relativeFilePath: ".mcp.json",
5916
- fileContent: fileContent ?? this.fileContent
5927
+ relativeFilePath: RULESYNC_MCP_FILE_NAME,
5928
+ fileContent: JSON.stringify(withSchema, null, 2)
5917
5929
  });
5918
5930
  }
5919
5931
  static async fromFile(_params) {
@@ -6216,10 +6228,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6216
6228
  toRulesyncMcp() {
6217
6229
  const mcpServers = this.toml.mcp_servers ?? {};
6218
6230
  const converted = convertFromCodexFormat(mcpServers);
6219
- return new RulesyncMcp({
6220
- baseDir: this.baseDir,
6221
- relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
6222
- relativeFilePath: ".mcp.json",
6231
+ return this.toRulesyncMcpDefault({
6223
6232
  fileContent: JSON.stringify({ mcpServers: converted }, null, 2)
6224
6233
  });
6225
6234
  }
@@ -6469,12 +6478,8 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6469
6478
  ...this.json,
6470
6479
  mcpServers: transformedServers
6471
6480
  };
6472
- return new RulesyncMcp({
6473
- baseDir: this.baseDir,
6474
- relativeDirPath: this.relativeDirPath,
6475
- relativeFilePath: "rulesync.mcp.json",
6476
- fileContent: JSON.stringify(transformedJson),
6477
- validate: true
6481
+ return this.toRulesyncMcpDefault({
6482
+ fileContent: JSON.stringify(transformedJson, null, 2)
6478
6483
  });
6479
6484
  }
6480
6485
  validate() {
@@ -6552,13 +6557,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6552
6557
  });
6553
6558
  }
6554
6559
  toRulesyncMcp() {
6555
- return new RulesyncMcp({
6556
- baseDir: this.baseDir,
6557
- relativeDirPath: this.relativeDirPath,
6558
- relativeFilePath: "rulesync.mcp.json",
6559
- fileContent: JSON.stringify(this.json),
6560
- validate: true
6561
- });
6560
+ return this.toRulesyncMcpDefault();
6562
6561
  }
6563
6562
  validate() {
6564
6563
  return { success: true, error: null };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  generate,
7
7
  importFromTool,
8
8
  logger
9
- } from "./chunk-E5YWRHGW.js";
9
+ } from "./chunk-ZQUEAGJI.js";
10
10
 
11
11
  // src/index.ts
12
12
  async function generate2(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",