rulesync 43.4.0 → 43.4.2

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.
@@ -22206,7 +22206,7 @@ var OpenCodeCommand = class extends ToolCommand {
22206
22206
  * and `~/.config/mimocode/commands/` (global), so this target reuses
22207
22207
  * {@link OpenCodeCommand} with that layout.
22208
22208
  *
22209
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/config/command.ts
22209
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/command.ts
22210
22210
  */
22211
22211
  var MimocodeCommand = class extends OpenCodeCommand {
22212
22212
  static layout = MIMOCODE_LAYOUT;
@@ -30129,7 +30129,7 @@ function normalizeDisableModelInvocation({ frontmatter, skillFilePath }) {
30129
30129
  * `~/.config/mimocode/` (global), so this target reuses {@link OpenCodeSkill}
30130
30130
  * with that layout.
30131
30131
  *
30132
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/skill/index.ts
30132
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/index.ts
30133
30133
  */
30134
30134
  var MimocodeSkill = class extends OpenCodeSkill {
30135
30135
  static layout = MIMOCODE_LAYOUT;
@@ -38602,7 +38602,7 @@ var OpenCodeSubagent = class extends OpenCodeStyleSubagent {
38602
38602
  * `~/.config/mimocode/agents/` (global), so this target reuses
38603
38603
  * {@link OpenCodeSubagent} with that layout.
38604
38604
  *
38605
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/config/agent.ts
38605
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/agent.ts
38606
38606
  */
38607
38607
  var MimocodeSubagent = class extends OpenCodeSubagent {
38608
38608
  static layout = MIMOCODE_LAYOUT;
@@ -42993,7 +42993,10 @@ function convertToOpencodeFormat(mcpServers, existingMcp, configShape, logger) {
42993
42993
  return {
42994
42994
  mcp: Object.fromEntries(Object.entries(mcpServers).map(([serverName, serverConfig]) => {
42995
42995
  const converted = convertServerToOpencodeFormat(serverName, serverConfig, existingMcp[serverName], configShape, logger);
42996
- if (serverConfig.enabledTools) for (const tool of serverConfig.enabledTools) tools[opencodeMcpToolPermissionKey(serverName, tool)] = true;
42996
+ if (serverConfig.enabledTools) for (const tool of serverConfig.enabledTools) {
42997
+ const key = opencodeMcpToolPermissionKey(serverName, tool);
42998
+ tools[key] = tools[key] !== false;
42999
+ }
42997
43000
  if (serverConfig.disabledTools) for (const tool of serverConfig.disabledTools) tools[opencodeMcpToolPermissionKey(serverName, tool)] = false;
42998
43001
  return converted === null ? null : [serverName, converted];
42999
43002
  }).filter((entry) => entry !== null)),
@@ -43004,6 +43007,12 @@ const OpencodeMcpFeatureOptionsSchema = zod_mini.z.looseObject({ configShape: zo
43004
43007
  var OpencodeMcp = class extends ToolMcp {
43005
43008
  /** Directory layout; OpenCode forks (MiMo Code) override it. */
43006
43009
  static layout = OPENCODE_LAYOUT;
43010
+ /**
43011
+ * Per-server keys a fork's MCP schema adds on top of OpenCode's. On generate
43012
+ * each one a canonical server carries is copied verbatim onto that server's
43013
+ * local or remote entry, as `timeout` and `oauth` are. OpenCode adds none.
43014
+ */
43015
+ static extraPassthroughServerFields = [];
43007
43016
  json;
43008
43017
  /**
43009
43018
  * With a `logger`, the V2 values that lowering the content drops are warned
@@ -43122,6 +43131,10 @@ var OpencodeMcp = class extends ToolMcp {
43122
43131
  if (containers.length > 0) logger?.warn(`OpenCode MCP: the whole "mcp" key is rewritten in the flat V1 shape, so ${containers.map(quoteValueForWarning).join(" and ")} ${containers.length === 1 ? "is" : "are"} not kept.`);
43123
43132
  }
43124
43133
  const { mcp: convertedMcp, tools: mcpTools } = convertToOpencodeFormat(transformedServers, (existingMcp.success ? existingMcp.data.mcp : void 0) ?? {}, configShape, logger);
43134
+ this.copyExtraPassthroughServerFields({
43135
+ convertedMcp,
43136
+ mcpServers: transformedServers
43137
+ });
43125
43138
  if (this.layout.configVersion === "v2") warnAboutOpencodeV2SseServers({
43126
43139
  mcpServers: transformedServers,
43127
43140
  convertedMcp,
@@ -43171,6 +43184,21 @@ var OpencodeMcp = class extends ToolMcp {
43171
43184
  });
43172
43185
  }
43173
43186
  /**
43187
+ * Copies {@link OpencodeMcp.extraPassthroughServerFields} from each canonical
43188
+ * server onto its generated transport entry. A toggle entry is left alone:
43189
+ * it has no transport for these keys to configure.
43190
+ */
43191
+ static copyExtraPassthroughServerFields({ convertedMcp, mcpServers }) {
43192
+ if (this.extraPassthroughServerFields.length === 0) return;
43193
+ for (const [serverName, entry] of Object.entries(convertedMcp)) {
43194
+ const source = Object.hasOwn(mcpServers, serverName) ? mcpServers[serverName] : void 0;
43195
+ if (source === void 0 || !isOpencodeTransportServer(entry)) continue;
43196
+ const sourceRecord = source;
43197
+ const entryRecord = entry;
43198
+ for (const key of this.extraPassthroughServerFields) if (sourceRecord[key] !== void 0) entryRecord[key] = sourceRecord[key];
43199
+ }
43200
+ }
43201
+ /**
43174
43202
  * Builds the V2 `mcp` value: each server raised to the V2 spelling under the
43175
43203
  * `mcp.servers` envelope, keeping what the existing file has that Rulesync
43176
43204
  * cannot express (see {@link raiseOpencodeServerToV2}), plus the existing
@@ -43300,16 +43328,30 @@ var OpencodeMcp = class extends ToolMcp {
43300
43328
  * `.mimocode/mimocode.jsonc` (project) and `~/.config/mimocode/mimocode.jsonc`
43301
43329
  * (global), so this target reuses {@link OpencodeMcp} with that layout.
43302
43330
  *
43303
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/config/mcp.ts
43331
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/mcp.ts
43304
43332
  */
43305
43333
  var MimocodeMcp = class extends OpencodeMcp {
43306
43334
  static layout = MIMOCODE_LAYOUT;
43307
43335
  /**
43336
+ * MiMo Code's local and remote server schemas add two keys OpenCode does not
43337
+ * have:
43338
+ * - `sampling` (`"deny"` | `"ask"` | `"allow"`): the policy for the server's
43339
+ * client-side sampling requests (since v0.1.10).
43340
+ * - `alwaysDirectTools` (string array): tools exposed as top-level tools
43341
+ * instead of through `mcp_tool_search` / `mcp_tool_use` (on `main`, not yet
43342
+ * released). Releases without it ignore the key, since MiMo Code only
43343
+ * rejects unknown keys at the top level of the config.
43344
+ *
43345
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/mcp.ts
43346
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/v0.1.16/packages/cli/src/config/config.ts
43347
+ */
43348
+ static extraPassthroughServerFields = ["sampling", "alwaysDirectTools"];
43349
+ /**
43308
43350
  * MiMo Code resolves a relative `instructions` entry against the project
43309
43351
  * directory, not the config directory, so a global rule is written as a
43310
43352
  * `~/`-rooted path (which MiMo Code expands to the home directory).
43311
43353
  *
43312
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/session/instruction.ts
43354
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/session/instruction.ts
43313
43355
  */
43314
43356
  static toGlobalInstructionEntry({ path }) {
43315
43357
  return `~/${path}`;
@@ -48679,7 +48721,7 @@ var OpenCodeRule = class extends ToolRule {
48679
48721
  * `instructions` list of its config, so this target reuses {@link OpenCodeRule}
48680
48722
  * with the `.mimocode/` layout.
48681
48723
  *
48682
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/session/instruction.ts
48724
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/session/instruction.ts
48683
48725
  */
48684
48726
  var MimocodeRule = class extends OpenCodeRule {
48685
48727
  static layout = MIMOCODE_LAYOUT;
@@ -63881,7 +63923,7 @@ var OpencodeHooks = class extends ToolHooks {
63881
63923
  * `~/.config/mimocode/plugins/` (global) and keeps OpenCode's plugin event
63882
63924
  * names, so this target reuses {@link OpencodeHooks} with that layout.
63883
63925
  *
63884
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/config/plugin.ts
63926
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/plugin.ts
63885
63927
  */
63886
63928
  var MimocodeHooks = class extends OpencodeHooks {
63887
63929
  static layout = MIMOCODE_LAYOUT;
@@ -96007,7 +96049,7 @@ var OpencodePermissions = class extends ToolPermissions {
96007
96049
  * `.mimocode/` layout. Tool-only categories round-trip through the `mimocode`
96008
96050
  * override block.
96009
96051
  *
96010
- * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/opencode/src/config/permission.ts
96052
+ * @see https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/config/permission.ts
96011
96053
  */
96012
96054
  var MimocodePermissions = class extends OpencodePermissions {
96013
96055
  static layout = MIMOCODE_LAYOUT;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_import = require("./import-BU6Goa-J.cjs");
2
+ const require_import = require("./import-ClFasGQ6.cjs");
3
3
  // src/index.ts
4
4
  async function generate(options = {}) {
5
5
  const { silent = true, verbose = false, ...rest } = options;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Tn as ALL_FEATURES, Tt as ConsoleLogger, a as convertFromTool$1, ht as ConfigResolver, i as inspectInputRoots, r as generate$1, t as importFromTool$1, xn as ALL_TOOL_TARGETS } from "./import-D2mUPFM0.js";
1
+ import { Tn as ALL_FEATURES, Tt as ConsoleLogger, a as convertFromTool$1, ht as ConfigResolver, i as inspectInputRoots, r as generate$1, t as importFromTool$1, xn as ALL_TOOL_TARGETS } from "./import-BWOC-Tig.js";
2
2
  // src/index.ts
3
3
  async function generate(options = {}) {
4
4
  const { silent = true, verbose = false, ...rest } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "43.4.0",
3
+ "version": "43.4.2",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -44,9 +44,6 @@
44
44
  "files": [
45
45
  "dist"
46
46
  ],
47
- "simple-git-hooks": {
48
- "pre-commit": "pnpm exec lint-staged"
49
- },
50
47
  "dependencies": {
51
48
  "@inquirer/checkbox": "5.2.8",
52
49
  "@modelcontextprotocol/sdk": "1.32.2",
@@ -66,7 +63,7 @@
66
63
  },
67
64
  "devDependencies": {
68
65
  "@anthropic-ai/claude-agent-sdk": "0.3.312",
69
- "@openrouter/sdk": "1.5.20",
66
+ "@openrouter/sdk": "1.5.21",
70
67
  "@secretlint/secretlint-rule-preset-recommend": "13.1.0",
71
68
  "@tsconfig/node24": "24.0.5",
72
69
  "@types/node": "26.6.6",
@@ -75,19 +72,17 @@
75
72
  "cspell": "10.4.0",
76
73
  "get-east-asian-width": "1.7.0",
77
74
  "knip": "6.43.0",
78
- "lint-staged": "17.6.0",
79
75
  "oxfmt": "0.75.0",
80
76
  "oxlint": "1.90.0",
81
77
  "repomix": "1.18.1",
82
78
  "resend": "6.35.0",
83
79
  "secretlint": "13.1.0",
84
80
  "simple-git": "4.0.2",
85
- "simple-git-hooks": "2.14.0",
86
81
  "sort-package-json": "4.1.0",
87
- "tsdown": "0.23.3",
88
82
  "tsx": "4.23.15",
89
83
  "typescript": "7.0.2",
90
- "vite": "8.3.5",
84
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
85
+ "vite-plus": "1.4.0",
91
86
  "vitepress": "1.6.4",
92
87
  "vitest": "5.0.5"
93
88
  },
@@ -99,7 +94,7 @@
99
94
  "access": "public"
100
95
  },
101
96
  "scripts": {
102
- "build": "tsdown",
97
+ "build": "vp pack",
103
98
  "check": "pnpm run fmt:check && pnpm run oxlint && pnpm run typecheck",
104
99
  "check:docs-content": "pnpm run generate:docs-content && git diff --exit-code src/generated/docs-content.ts docs/reference/file-formats.md",
105
100
  "check:gitignore": "pnpm run dev gitignore && git diff --exit-code .gitignore .gitattributes",
@@ -114,23 +109,23 @@
114
109
  "docs:dev": "vitepress dev docs",
115
110
  "docs:preview": "vitepress preview docs",
116
111
  "fix": "pnpm run fmt && pnpm run oxlint:fix",
117
- "fmt": "oxfmt .",
118
- "fmt:check": "oxfmt --check .",
112
+ "fmt": "vp fmt",
113
+ "fmt:check": "vp fmt --check",
119
114
  "generate": "pnpm run dev generate",
120
115
  "generate:docs-content": "tsx scripts/generate-docs-content.ts",
121
116
  "generate:schema": "tsx scripts/generate-json-schema.ts",
122
117
  "generate:tables": "tsx scripts/generate-supported-tools-tables.ts",
123
118
  "knip": "knip",
124
- "oxlint": "oxlint . --max-warnings 0",
125
- "oxlint:fix": "oxlint . --fix --max-warnings 0",
119
+ "oxlint": "vp lint --max-warnings 0",
120
+ "oxlint:fix": "vp lint --fix --max-warnings 0",
126
121
  "pr-continuation": "tsx scripts/pr-continuation.ts",
127
122
  "secretlint": "secretlint --secretlintignore .gitignore \"**/*\"",
128
123
  "sort": "sort-package-json",
129
124
  "task": "tsx scripts/run-tasks.ts",
130
- "test": "vitest run --silent=true",
131
- "test:coverage": "vitest run --coverage --silent=true",
132
- "test:e2e": "vitest run --config vitest.e2e.config.ts --silent=false",
133
- "test:watch": "vitest --silent=true",
125
+ "test": "vp test run --silent=true",
126
+ "test:coverage": "vp test run --coverage --silent=true",
127
+ "test:e2e": "vp test run --config vitest.e2e.config.ts --silent=false",
128
+ "test:watch": "vp test --silent=true",
134
129
  "typecheck": "tsgo --noEmit"
135
130
  }
136
131
  }