rulesync 7.9.0 → 7.10.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.
@@ -6536,6 +6536,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6536
6536
 
6537
6537
  // src/features/mcp/opencode-mcp.ts
6538
6538
  import { join as join51 } from "path";
6539
+ import { parse as parseJsonc2 } from "jsonc-parser";
6539
6540
  import { z as z20 } from "zod/mini";
6540
6541
  var OpencodeMcpLocalServerSchema = z20.object({
6541
6542
  type: z20.literal("local"),
@@ -6661,7 +6662,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6661
6662
  json;
6662
6663
  constructor(params) {
6663
6664
  super(params);
6664
- this.json = OpencodeConfigSchema.parse(JSON.parse(this.fileContent || "{}"));
6665
+ this.json = OpencodeConfigSchema.parse(parseJsonc2(this.fileContent || "{}"));
6665
6666
  }
6666
6667
  getJson() {
6667
6668
  return this.json;
@@ -6689,14 +6690,26 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6689
6690
  validate = true,
6690
6691
  global = false
6691
6692
  }) {
6692
- const paths = this.getSettablePaths({ global });
6693
- const fileContent = await readFileContentOrNull(join51(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6694
- const json = JSON.parse(fileContent);
6693
+ const basePaths = this.getSettablePaths({ global });
6694
+ const jsonDir = join51(baseDir, basePaths.relativeDirPath);
6695
+ let fileContent = null;
6696
+ let relativeFilePath = "opencode.jsonc";
6697
+ const jsoncPath = join51(jsonDir, "opencode.jsonc");
6698
+ const jsonPath = join51(jsonDir, "opencode.json");
6699
+ fileContent = await readFileContentOrNull(jsoncPath);
6700
+ if (!fileContent) {
6701
+ fileContent = await readFileContentOrNull(jsonPath);
6702
+ if (fileContent) {
6703
+ relativeFilePath = "opencode.json";
6704
+ }
6705
+ }
6706
+ const fileContentToUse = fileContent ?? '{"mcp":{}}';
6707
+ const json = parseJsonc2(fileContentToUse);
6695
6708
  const newJson = { ...json, mcp: json.mcp ?? {} };
6696
6709
  return new _OpencodeMcp({
6697
6710
  baseDir,
6698
- relativeDirPath: paths.relativeDirPath,
6699
- relativeFilePath: paths.relativeFilePath,
6711
+ relativeDirPath: basePaths.relativeDirPath,
6712
+ relativeFilePath,
6700
6713
  fileContent: JSON.stringify(newJson, null, 2),
6701
6714
  validate
6702
6715
  });
@@ -6707,12 +6720,23 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6707
6720
  validate = true,
6708
6721
  global = false
6709
6722
  }) {
6710
- const paths = this.getSettablePaths({ global });
6711
- const fileContent = await readOrInitializeFileContent(
6712
- join51(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6713
- JSON.stringify({ mcp: {} }, null, 2)
6714
- );
6715
- const json = JSON.parse(fileContent);
6723
+ const basePaths = this.getSettablePaths({ global });
6724
+ const jsonDir = join51(baseDir, basePaths.relativeDirPath);
6725
+ let fileContent = null;
6726
+ let relativeFilePath = "opencode.jsonc";
6727
+ const jsoncPath = join51(jsonDir, "opencode.jsonc");
6728
+ const jsonPath = join51(jsonDir, "opencode.json");
6729
+ fileContent = await readFileContentOrNull(jsoncPath);
6730
+ if (!fileContent) {
6731
+ fileContent = await readFileContentOrNull(jsonPath);
6732
+ if (fileContent) {
6733
+ relativeFilePath = "opencode.json";
6734
+ }
6735
+ }
6736
+ if (!fileContent) {
6737
+ fileContent = JSON.stringify({ mcp: {} }, null, 2);
6738
+ }
6739
+ const json = parseJsonc2(fileContent);
6716
6740
  const { mcp: convertedMcp, tools: mcpTools } = convertToOpencodeFormat(
6717
6741
  rulesyncMcp.getMcpServers()
6718
6742
  );
@@ -6724,8 +6748,8 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6724
6748
  };
6725
6749
  return new _OpencodeMcp({
6726
6750
  baseDir,
6727
- relativeDirPath: paths.relativeDirPath,
6728
- relativeFilePath: paths.relativeFilePath,
6751
+ relativeDirPath: basePaths.relativeDirPath,
6752
+ relativeFilePath,
6729
6753
  fileContent: JSON.stringify(newJson, null, 2),
6730
6754
  validate
6731
6755
  });
@@ -6271,6 +6271,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6271
6271
 
6272
6272
  // src/features/mcp/opencode-mcp.ts
6273
6273
  var import_node_path51 = require("path");
6274
+ var import_jsonc_parser = require("jsonc-parser");
6274
6275
  var import_mini19 = require("zod/mini");
6275
6276
  var OpencodeMcpLocalServerSchema = import_mini19.z.object({
6276
6277
  type: import_mini19.z.literal("local"),
@@ -6396,7 +6397,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6396
6397
  json;
6397
6398
  constructor(params) {
6398
6399
  super(params);
6399
- this.json = OpencodeConfigSchema.parse(JSON.parse(this.fileContent || "{}"));
6400
+ this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser.parse)(this.fileContent || "{}"));
6400
6401
  }
6401
6402
  getJson() {
6402
6403
  return this.json;
@@ -6424,14 +6425,26 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6424
6425
  validate = true,
6425
6426
  global = false
6426
6427
  }) {
6427
- const paths = this.getSettablePaths({ global });
6428
- const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6429
- const json = JSON.parse(fileContent);
6428
+ const basePaths = this.getSettablePaths({ global });
6429
+ const jsonDir = (0, import_node_path51.join)(baseDir, basePaths.relativeDirPath);
6430
+ let fileContent = null;
6431
+ let relativeFilePath = "opencode.jsonc";
6432
+ const jsoncPath = (0, import_node_path51.join)(jsonDir, "opencode.jsonc");
6433
+ const jsonPath = (0, import_node_path51.join)(jsonDir, "opencode.json");
6434
+ fileContent = await readFileContentOrNull(jsoncPath);
6435
+ if (!fileContent) {
6436
+ fileContent = await readFileContentOrNull(jsonPath);
6437
+ if (fileContent) {
6438
+ relativeFilePath = "opencode.json";
6439
+ }
6440
+ }
6441
+ const fileContentToUse = fileContent ?? '{"mcp":{}}';
6442
+ const json = (0, import_jsonc_parser.parse)(fileContentToUse);
6430
6443
  const newJson = { ...json, mcp: json.mcp ?? {} };
6431
6444
  return new _OpencodeMcp({
6432
6445
  baseDir,
6433
- relativeDirPath: paths.relativeDirPath,
6434
- relativeFilePath: paths.relativeFilePath,
6446
+ relativeDirPath: basePaths.relativeDirPath,
6447
+ relativeFilePath,
6435
6448
  fileContent: JSON.stringify(newJson, null, 2),
6436
6449
  validate
6437
6450
  });
@@ -6442,12 +6455,23 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6442
6455
  validate = true,
6443
6456
  global = false
6444
6457
  }) {
6445
- const paths = this.getSettablePaths({ global });
6446
- const fileContent = await readOrInitializeFileContent(
6447
- (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6448
- JSON.stringify({ mcp: {} }, null, 2)
6449
- );
6450
- const json = JSON.parse(fileContent);
6458
+ const basePaths = this.getSettablePaths({ global });
6459
+ const jsonDir = (0, import_node_path51.join)(baseDir, basePaths.relativeDirPath);
6460
+ let fileContent = null;
6461
+ let relativeFilePath = "opencode.jsonc";
6462
+ const jsoncPath = (0, import_node_path51.join)(jsonDir, "opencode.jsonc");
6463
+ const jsonPath = (0, import_node_path51.join)(jsonDir, "opencode.json");
6464
+ fileContent = await readFileContentOrNull(jsoncPath);
6465
+ if (!fileContent) {
6466
+ fileContent = await readFileContentOrNull(jsonPath);
6467
+ if (fileContent) {
6468
+ relativeFilePath = "opencode.json";
6469
+ }
6470
+ }
6471
+ if (!fileContent) {
6472
+ fileContent = JSON.stringify({ mcp: {} }, null, 2);
6473
+ }
6474
+ const json = (0, import_jsonc_parser.parse)(fileContent);
6451
6475
  const { mcp: convertedMcp, tools: mcpTools2 } = convertToOpencodeFormat(
6452
6476
  rulesyncMcp.getMcpServers()
6453
6477
  );
@@ -6459,8 +6483,8 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6459
6483
  };
6460
6484
  return new _OpencodeMcp({
6461
6485
  baseDir,
6462
- relativeDirPath: paths.relativeDirPath,
6463
- relativeFilePath: paths.relativeFilePath,
6486
+ relativeDirPath: basePaths.relativeDirPath,
6487
+ relativeFilePath,
6464
6488
  fileContent: JSON.stringify(newJson, null, 2),
6465
6489
  validate
6466
6490
  });
@@ -16241,7 +16265,7 @@ async function fetchCommand(options) {
16241
16265
 
16242
16266
  // src/config/config-resolver.ts
16243
16267
  var import_node_path114 = require("path");
16244
- var import_jsonc_parser = require("jsonc-parser");
16268
+ var import_jsonc_parser2 = require("jsonc-parser");
16245
16269
 
16246
16270
  // src/config/config.ts
16247
16271
  var import_mini56 = require("zod/mini");
@@ -16448,7 +16472,7 @@ var loadConfigFromFile = async (filePath) => {
16448
16472
  }
16449
16473
  try {
16450
16474
  const fileContent = await readFileContent(filePath);
16451
- const jsonData = (0, import_jsonc_parser.parse)(fileContent);
16475
+ const jsonData = (0, import_jsonc_parser2.parse)(fileContent);
16452
16476
  const parsed = ConfigFileSchema.parse(jsonData);
16453
16477
  const { $schema: _schema, ...configParams } = parsed;
16454
16478
  return configParams;
@@ -19902,7 +19926,7 @@ async function updateCommand(currentVersion, options) {
19902
19926
  }
19903
19927
 
19904
19928
  // src/cli/index.ts
19905
- var getVersion = () => "7.9.0";
19929
+ var getVersion = () => "7.10.0";
19906
19930
  var main = async () => {
19907
19931
  const program = new import_commander.Command();
19908
19932
  const version = getVersion();
@@ -20007,7 +20031,10 @@ var main = async () => {
20007
20031
  }
20008
20032
  ).option("--delete", "Delete all existing files in output directories before generating").option(
20009
20033
  "-b, --base-dir <paths>",
20010
- "Base directories to generate files (comma-separated for multiple paths)"
20034
+ "Base directories to generate files (comma-separated for multiple paths)",
20035
+ (value) => {
20036
+ return value.split(",").map((p) => p.trim());
20037
+ }
20011
20038
  ).option("-V, --verbose", "Verbose output").option("-s, --silent", "Suppress all output").option("-c, --config <path>", "Path to configuration file").option("-g, --global", "Generate for global(user scope) configuration files").option(
20012
20039
  "--simulate-commands",
20013
20040
  "Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
@@ -20025,7 +20052,7 @@ var main = async () => {
20025
20052
  verbose: options.verbose,
20026
20053
  silent: options.silent,
20027
20054
  delete: options.delete,
20028
- baseDirs: options.baseDirs,
20055
+ baseDirs: options.baseDir,
20029
20056
  configPath: options.config,
20030
20057
  global: options.global,
20031
20058
  simulateCommands: options.simulateCommands,
package/dist/cli/index.js CHANGED
@@ -60,7 +60,7 @@ import {
60
60
  removeTempDirectory,
61
61
  stringifyFrontmatter,
62
62
  writeFileContent
63
- } from "../chunk-HA3HGPC7.js";
63
+ } from "../chunk-57CDMFYZ.js";
64
64
 
65
65
  // src/cli/index.ts
66
66
  import { Command } from "commander";
@@ -3799,7 +3799,7 @@ async function updateCommand(currentVersion, options) {
3799
3799
  }
3800
3800
 
3801
3801
  // src/cli/index.ts
3802
- var getVersion = () => "7.9.0";
3802
+ var getVersion = () => "7.10.0";
3803
3803
  var main = async () => {
3804
3804
  const program = new Command();
3805
3805
  const version = getVersion();
@@ -3904,7 +3904,10 @@ var main = async () => {
3904
3904
  }
3905
3905
  ).option("--delete", "Delete all existing files in output directories before generating").option(
3906
3906
  "-b, --base-dir <paths>",
3907
- "Base directories to generate files (comma-separated for multiple paths)"
3907
+ "Base directories to generate files (comma-separated for multiple paths)",
3908
+ (value) => {
3909
+ return value.split(",").map((p) => p.trim());
3910
+ }
3908
3911
  ).option("-V, --verbose", "Verbose output").option("-s, --silent", "Suppress all output").option("-c, --config <path>", "Path to configuration file").option("-g, --global", "Generate for global(user scope) configuration files").option(
3909
3912
  "--simulate-commands",
3910
3913
  "Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
@@ -3922,7 +3925,7 @@ var main = async () => {
3922
3925
  verbose: options.verbose,
3923
3926
  silent: options.silent,
3924
3927
  delete: options.delete,
3925
- baseDirs: options.baseDirs,
3928
+ baseDirs: options.baseDir,
3926
3929
  configPath: options.config,
3927
3930
  global: options.global,
3928
3931
  simulateCommands: options.simulateCommands,
package/dist/index.cjs CHANGED
@@ -6564,6 +6564,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6564
6564
 
6565
6565
  // src/features/mcp/opencode-mcp.ts
6566
6566
  var import_node_path52 = require("path");
6567
+ var import_jsonc_parser2 = require("jsonc-parser");
6567
6568
  var import_mini20 = require("zod/mini");
6568
6569
  var OpencodeMcpLocalServerSchema = import_mini20.z.object({
6569
6570
  type: import_mini20.z.literal("local"),
@@ -6689,7 +6690,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6689
6690
  json;
6690
6691
  constructor(params) {
6691
6692
  super(params);
6692
- this.json = OpencodeConfigSchema.parse(JSON.parse(this.fileContent || "{}"));
6693
+ this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser2.parse)(this.fileContent || "{}"));
6693
6694
  }
6694
6695
  getJson() {
6695
6696
  return this.json;
@@ -6717,14 +6718,26 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6717
6718
  validate = true,
6718
6719
  global = false
6719
6720
  }) {
6720
- const paths = this.getSettablePaths({ global });
6721
- const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
6722
- const json = JSON.parse(fileContent);
6721
+ const basePaths = this.getSettablePaths({ global });
6722
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6723
+ let fileContent = null;
6724
+ let relativeFilePath = "opencode.jsonc";
6725
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6726
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6727
+ fileContent = await readFileContentOrNull(jsoncPath);
6728
+ if (!fileContent) {
6729
+ fileContent = await readFileContentOrNull(jsonPath);
6730
+ if (fileContent) {
6731
+ relativeFilePath = "opencode.json";
6732
+ }
6733
+ }
6734
+ const fileContentToUse = fileContent ?? '{"mcp":{}}';
6735
+ const json = (0, import_jsonc_parser2.parse)(fileContentToUse);
6723
6736
  const newJson = { ...json, mcp: json.mcp ?? {} };
6724
6737
  return new _OpencodeMcp({
6725
6738
  baseDir,
6726
- relativeDirPath: paths.relativeDirPath,
6727
- relativeFilePath: paths.relativeFilePath,
6739
+ relativeDirPath: basePaths.relativeDirPath,
6740
+ relativeFilePath,
6728
6741
  fileContent: JSON.stringify(newJson, null, 2),
6729
6742
  validate
6730
6743
  });
@@ -6735,12 +6748,23 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6735
6748
  validate = true,
6736
6749
  global = false
6737
6750
  }) {
6738
- const paths = this.getSettablePaths({ global });
6739
- const fileContent = await readOrInitializeFileContent(
6740
- (0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6741
- JSON.stringify({ mcp: {} }, null, 2)
6742
- );
6743
- const json = JSON.parse(fileContent);
6751
+ const basePaths = this.getSettablePaths({ global });
6752
+ const jsonDir = (0, import_node_path52.join)(baseDir, basePaths.relativeDirPath);
6753
+ let fileContent = null;
6754
+ let relativeFilePath = "opencode.jsonc";
6755
+ const jsoncPath = (0, import_node_path52.join)(jsonDir, "opencode.jsonc");
6756
+ const jsonPath = (0, import_node_path52.join)(jsonDir, "opencode.json");
6757
+ fileContent = await readFileContentOrNull(jsoncPath);
6758
+ if (!fileContent) {
6759
+ fileContent = await readFileContentOrNull(jsonPath);
6760
+ if (fileContent) {
6761
+ relativeFilePath = "opencode.json";
6762
+ }
6763
+ }
6764
+ if (!fileContent) {
6765
+ fileContent = JSON.stringify({ mcp: {} }, null, 2);
6766
+ }
6767
+ const json = (0, import_jsonc_parser2.parse)(fileContent);
6744
6768
  const { mcp: convertedMcp, tools: mcpTools } = convertToOpencodeFormat(
6745
6769
  rulesyncMcp.getMcpServers()
6746
6770
  );
@@ -6752,8 +6776,8 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6752
6776
  };
6753
6777
  return new _OpencodeMcp({
6754
6778
  baseDir,
6755
- relativeDirPath: paths.relativeDirPath,
6756
- relativeFilePath: paths.relativeFilePath,
6779
+ relativeDirPath: basePaths.relativeDirPath,
6780
+ relativeFilePath,
6757
6781
  fileContent: JSON.stringify(newJson, null, 2),
6758
6782
  validate
6759
6783
  });
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  generate,
7
7
  importFromTool,
8
8
  logger
9
- } from "./chunk-HA3HGPC7.js";
9
+ } from "./chunk-57CDMFYZ.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.9.0",
3
+ "version": "7.10.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",
@@ -48,14 +48,14 @@
48
48
  "pre-commit": "pnpm exec lint-staged"
49
49
  },
50
50
  "dependencies": {
51
- "@modelcontextprotocol/sdk": "1.26.0",
51
+ "@modelcontextprotocol/sdk": "1.27.1",
52
52
  "@octokit/request-error": "7.1.0",
53
53
  "@octokit/rest": "22.0.1",
54
54
  "@toon-format/toon": "2.1.0",
55
55
  "@valibot/to-json-schema": "1.5.0",
56
56
  "commander": "14.0.3",
57
57
  "consola": "3.4.2",
58
- "effect": "3.19.18",
58
+ "effect": "3.19.19",
59
59
  "es-toolkit": "1.44.0",
60
60
  "fastmcp": "3.33.0",
61
61
  "globby": "16.1.1",
@@ -67,26 +67,26 @@
67
67
  "zod": "4.3.6"
68
68
  },
69
69
  "devDependencies": {
70
- "@anthropic-ai/claude-agent-sdk": "0.2.47",
70
+ "@anthropic-ai/claude-agent-sdk": "0.2.59",
71
71
  "@eslint/js": "9.39.2",
72
- "@openrouter/sdk": "0.8.0",
72
+ "@openrouter/sdk": "0.9.11",
73
73
  "@secretlint/secretlint-rule-preset-recommend": "11.3.1",
74
74
  "@tsconfig/node24": "24.0.4",
75
75
  "@types/js-yaml": "4.0.9",
76
- "@types/node": "25.3.0",
77
- "@typescript/native-preview": "7.0.0-dev.20260218.1",
76
+ "@types/node": "25.3.1",
77
+ "@typescript/native-preview": "7.0.0-dev.20260225.1",
78
78
  "@vitest/coverage-v8": "4.0.18",
79
- "cspell": "9.6.4",
79
+ "cspell": "9.7.0",
80
80
  "eslint": "9.39.2",
81
81
  "eslint-plugin-import": "2.32.0",
82
82
  "eslint-plugin-no-type-assertion": "1.3.0",
83
- "eslint-plugin-oxlint": "1.48.0",
83
+ "eslint-plugin-oxlint": "1.50.0",
84
84
  "eslint-plugin-strict-dependencies": "1.3.31",
85
85
  "eslint-plugin-zod-import": "0.3.0",
86
- "knip": "5.84.1",
86
+ "knip": "5.85.0",
87
87
  "lint-staged": "16.2.7",
88
- "oxfmt": "0.33.0",
89
- "oxlint": "1.48.0",
88
+ "oxfmt": "0.35.0",
89
+ "oxlint": "1.50.0",
90
90
  "repomix": "1.11.1",
91
91
  "resend": "6.9.2",
92
92
  "secretlint": "11.3.1",
@@ -95,7 +95,7 @@
95
95
  "tsup": "8.5.1",
96
96
  "tsx": "4.21.0",
97
97
  "typescript": "5.9.3",
98
- "typescript-eslint": "8.56.0",
98
+ "typescript-eslint": "8.56.1",
99
99
  "vitepress": "1.6.4",
100
100
  "vitest": "4.0.18"
101
101
  },