rulesync 8.16.0 → 8.18.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/{chunk-DOWXY74I.js → chunk-KDGHMXTY.js} +189 -107
- package/dist/cli/index.cjs +394 -312
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +189 -107
- package/dist/index.js +1 -1
- package/package.json +3 -1
|
@@ -7610,6 +7610,16 @@ var McpServerSchema = z24.looseObject({
|
|
|
7610
7610
|
tools: z24.optional(z24.array(z24.string())),
|
|
7611
7611
|
kiroAutoApprove: z24.optional(z24.array(z24.string())),
|
|
7612
7612
|
kiroAutoBlock: z24.optional(z24.array(z24.string())),
|
|
7613
|
+
// Codex CLI-specific: list of shell env var names that codex should pass
|
|
7614
|
+
// through from the user's environment to the MCP server process.
|
|
7615
|
+
// Distinct from `env` (a literal name→value map): `envVars` is a list of
|
|
7616
|
+
// variable NAMES whose values come from the user's shell at runtime.
|
|
7617
|
+
// Only honoured by the codex generator (renamed to `env_vars` in codex
|
|
7618
|
+
// TOML output, matching codex's native field name — see the
|
|
7619
|
+
// `enabledTools`→`enabled_tools` precedent in `codexcli-mcp.ts`).
|
|
7620
|
+
// Stripped by `RulesyncMcp.getMcpServers()` so it does not leak into
|
|
7621
|
+
// other tools' configs.
|
|
7622
|
+
envVars: z24.optional(z24.array(z24.string())),
|
|
7613
7623
|
headers: z24.optional(z24.record(z24.string(), z24.string())),
|
|
7614
7624
|
enabledTools: z24.optional(z24.array(z24.string())),
|
|
7615
7625
|
disabledTools: z24.optional(z24.array(z24.string()))
|
|
@@ -7712,10 +7722,11 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
7712
7722
|
});
|
|
7713
7723
|
}
|
|
7714
7724
|
getMcpServers() {
|
|
7715
|
-
const
|
|
7725
|
+
const mcpServers = this.json.mcpServers ?? {};
|
|
7726
|
+
const entries = Object.entries(mcpServers);
|
|
7716
7727
|
return Object.fromEntries(
|
|
7717
7728
|
entries.map(([serverName, serverConfig]) => {
|
|
7718
|
-
return [serverName, omit(serverConfig, ["targets", "description", "exposed"])];
|
|
7729
|
+
return [serverName, omit(serverConfig, ["targets", "description", "exposed", "envVars"])];
|
|
7719
7730
|
})
|
|
7720
7731
|
);
|
|
7721
7732
|
}
|
|
@@ -7934,11 +7945,17 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
7934
7945
|
rulesyncMcp,
|
|
7935
7946
|
validate = true
|
|
7936
7947
|
}) {
|
|
7948
|
+
const json = rulesyncMcp.getJson();
|
|
7949
|
+
const fileContent = JSON.stringify(
|
|
7950
|
+
{ ...json, mcpServers: rulesyncMcp.getMcpServers() },
|
|
7951
|
+
null,
|
|
7952
|
+
2
|
|
7953
|
+
);
|
|
7937
7954
|
return new _ClineMcp({
|
|
7938
7955
|
outputRoot,
|
|
7939
7956
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
7940
7957
|
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
7941
|
-
fileContent
|
|
7958
|
+
fileContent,
|
|
7942
7959
|
validate
|
|
7943
7960
|
});
|
|
7944
7961
|
}
|
|
@@ -7966,14 +7983,21 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
7966
7983
|
// src/features/mcp/codexcli-mcp.ts
|
|
7967
7984
|
import { join as join51 } from "path";
|
|
7968
7985
|
import * as smolToml3 from "smol-toml";
|
|
7986
|
+
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
7987
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
7988
|
+
function isPlainObject2(value) {
|
|
7989
|
+
if (!isRecord(value)) return false;
|
|
7990
|
+
const proto = Object.getPrototypeOf(value);
|
|
7991
|
+
return proto === null || proto === Object.prototype;
|
|
7992
|
+
}
|
|
7969
7993
|
function convertFromCodexFormat(codexMcp) {
|
|
7970
7994
|
const result = {};
|
|
7971
7995
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
7972
|
-
if (
|
|
7973
|
-
|
|
7974
|
-
}
|
|
7996
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
|
|
7997
|
+
if (!isRecord(config)) continue;
|
|
7975
7998
|
const converted = {};
|
|
7976
7999
|
for (const [key, value] of Object.entries(config)) {
|
|
8000
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
7977
8001
|
if (key === "enabled") {
|
|
7978
8002
|
if (value === false) {
|
|
7979
8003
|
converted["disabled"] = true;
|
|
@@ -7982,6 +8006,8 @@ function convertFromCodexFormat(codexMcp) {
|
|
|
7982
8006
|
converted["enabledTools"] = value;
|
|
7983
8007
|
} else if (key === "disabled_tools") {
|
|
7984
8008
|
converted["disabledTools"] = value;
|
|
8009
|
+
} else if (key === "env_vars") {
|
|
8010
|
+
converted["envVars"] = value;
|
|
7985
8011
|
} else {
|
|
7986
8012
|
converted[key] = value;
|
|
7987
8013
|
}
|
|
@@ -7993,8 +8019,11 @@ function convertFromCodexFormat(codexMcp) {
|
|
|
7993
8019
|
function convertToCodexFormat(mcpServers) {
|
|
7994
8020
|
const result = {};
|
|
7995
8021
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
8022
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
|
|
8023
|
+
if (!isRecord(config)) continue;
|
|
7996
8024
|
const converted = {};
|
|
7997
8025
|
for (const [key, value] of Object.entries(config)) {
|
|
8026
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
7998
8027
|
if (key === "disabled") {
|
|
7999
8028
|
if (value === true) {
|
|
8000
8029
|
converted["enabled"] = false;
|
|
@@ -8003,6 +8032,8 @@ function convertToCodexFormat(mcpServers) {
|
|
|
8003
8032
|
converted["enabled_tools"] = value;
|
|
8004
8033
|
} else if (key === "disabledTools") {
|
|
8005
8034
|
converted["disabled_tools"] = value;
|
|
8035
|
+
} else if (key === "envVars") {
|
|
8036
|
+
converted["env_vars"] = value;
|
|
8006
8037
|
} else {
|
|
8007
8038
|
converted[key] = value;
|
|
8008
8039
|
}
|
|
@@ -8074,6 +8105,14 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8074
8105
|
const mcpServers = rulesyncMcp.getJson().mcpServers;
|
|
8075
8106
|
const converted = convertToCodexFormat(mcpServers);
|
|
8076
8107
|
const filteredMcpServers = this.removeEmptyEntries(converted);
|
|
8108
|
+
for (const name of Object.keys(converted)) {
|
|
8109
|
+
if (!Object.hasOwn(filteredMcpServers, name)) {
|
|
8110
|
+
warnWithFallback(
|
|
8111
|
+
void 0,
|
|
8112
|
+
`MCP server "${name}" had no non-empty configuration and was dropped from the codex CLI config`
|
|
8113
|
+
);
|
|
8114
|
+
}
|
|
8115
|
+
}
|
|
8077
8116
|
configToml["mcp_servers"] = filteredMcpServers;
|
|
8078
8117
|
return new _CodexcliMcp({
|
|
8079
8118
|
outputRoot,
|
|
@@ -8093,12 +8132,25 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8093
8132
|
validate() {
|
|
8094
8133
|
return { success: true, error: null };
|
|
8095
8134
|
}
|
|
8096
|
-
static removeEmptyEntries(obj) {
|
|
8135
|
+
static removeEmptyEntries(obj, depth = 0) {
|
|
8097
8136
|
if (!obj) return {};
|
|
8137
|
+
if (depth > MAX_REMOVE_EMPTY_ENTRIES_DEPTH) {
|
|
8138
|
+
warnWithFallback(
|
|
8139
|
+
void 0,
|
|
8140
|
+
`removeEmptyEntries: maximum recursion depth (${MAX_REMOVE_EMPTY_ENTRIES_DEPTH}) exceeded; empty nested objects may remain`
|
|
8141
|
+
);
|
|
8142
|
+
return obj;
|
|
8143
|
+
}
|
|
8098
8144
|
const filtered = {};
|
|
8099
8145
|
for (const [key, value] of Object.entries(obj)) {
|
|
8146
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
8100
8147
|
if (value === null) continue;
|
|
8101
|
-
if (
|
|
8148
|
+
if (isPlainObject2(value)) {
|
|
8149
|
+
const cleaned = this.removeEmptyEntries(value, depth + 1);
|
|
8150
|
+
if (Object.keys(cleaned).length === 0) continue;
|
|
8151
|
+
filtered[key] = cleaned;
|
|
8152
|
+
continue;
|
|
8153
|
+
}
|
|
8102
8154
|
filtered[key] = value;
|
|
8103
8155
|
}
|
|
8104
8156
|
return filtered;
|
|
@@ -8475,8 +8527,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
8475
8527
|
{ cause: error }
|
|
8476
8528
|
);
|
|
8477
8529
|
}
|
|
8478
|
-
const
|
|
8479
|
-
const mcpServers = isMcpServers(rulesyncJson.mcpServers) ? rulesyncJson.mcpServers : {};
|
|
8530
|
+
const mcpServers = rulesyncMcp.getMcpServers();
|
|
8480
8531
|
const transformedServers = convertEnvToCursorFormat(mcpServers);
|
|
8481
8532
|
const cursorConfig = { ...json, mcpServers: transformedServers };
|
|
8482
8533
|
return new _CursorMcp({
|
|
@@ -8645,9 +8696,9 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
8645
8696
|
rulesyncMcp,
|
|
8646
8697
|
validate = true
|
|
8647
8698
|
}) {
|
|
8648
|
-
const
|
|
8699
|
+
const mcpServers = rulesyncMcp.getMcpServers();
|
|
8649
8700
|
const factorydroidConfig = {
|
|
8650
|
-
mcpServers
|
|
8701
|
+
mcpServers
|
|
8651
8702
|
};
|
|
8652
8703
|
const fileContent = JSON.stringify(factorydroidConfig, null, 2);
|
|
8653
8704
|
return new _FactorydroidMcp({
|
|
@@ -8733,7 +8784,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
8733
8784
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8734
8785
|
);
|
|
8735
8786
|
const json = JSON.parse(fileContent);
|
|
8736
|
-
const newJson = { ...json, mcpServers: rulesyncMcp.
|
|
8787
|
+
const newJson = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
8737
8788
|
return new _GeminiCliMcp({
|
|
8738
8789
|
outputRoot,
|
|
8739
8790
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -8814,11 +8865,17 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
8814
8865
|
rulesyncMcp,
|
|
8815
8866
|
validate = true
|
|
8816
8867
|
}) {
|
|
8868
|
+
const json = rulesyncMcp.getJson();
|
|
8869
|
+
const fileContent = JSON.stringify(
|
|
8870
|
+
{ ...json, mcpServers: rulesyncMcp.getMcpServers() },
|
|
8871
|
+
null,
|
|
8872
|
+
2
|
|
8873
|
+
);
|
|
8817
8874
|
return new _JunieMcp({
|
|
8818
8875
|
outputRoot,
|
|
8819
8876
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
8820
8877
|
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
8821
|
-
fileContent
|
|
8878
|
+
fileContent,
|
|
8822
8879
|
validate
|
|
8823
8880
|
});
|
|
8824
8881
|
}
|
|
@@ -9598,8 +9655,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
9598
9655
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
9599
9656
|
);
|
|
9600
9657
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
9601
|
-
const
|
|
9602
|
-
const mcpServers = isMcpServers(rulesyncJson.mcpServers) ? rulesyncJson.mcpServers : {};
|
|
9658
|
+
const mcpServers = rulesyncMcp.getMcpServers();
|
|
9603
9659
|
const rovodevConfig = { ...json, mcpServers };
|
|
9604
9660
|
return new _RovodevMcp({
|
|
9605
9661
|
outputRoot,
|
|
@@ -9783,7 +9839,13 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
9783
9839
|
class: KiloMcp,
|
|
9784
9840
|
meta: {
|
|
9785
9841
|
supportsProject: true,
|
|
9786
|
-
|
|
9842
|
+
// Kilo CLI reads global MCP from `~/.config/kilo/kilo.json` (or
|
|
9843
|
+
// `kilo.jsonc`). The path machinery in `KiloMcp.getSettablePaths`
|
|
9844
|
+
// already routes global mode to that location; only this flag
|
|
9845
|
+
// was gating it off. Kilo is an OpenCode fork and uses an
|
|
9846
|
+
// identical native MCP schema, so global parity with opencode
|
|
9847
|
+
// is the natural state.
|
|
9848
|
+
supportsGlobal: true,
|
|
9787
9849
|
supportsEnabledTools: false,
|
|
9788
9850
|
supportsDisabledTools: false
|
|
9789
9851
|
}
|
|
@@ -11024,7 +11086,8 @@ function convertRulesyncToCodexProfile({
|
|
|
11024
11086
|
filesystem,
|
|
11025
11087
|
projectRootFilesystem,
|
|
11026
11088
|
pattern,
|
|
11027
|
-
access: mapReadAction(action)
|
|
11089
|
+
access: mapReadAction(action),
|
|
11090
|
+
logger
|
|
11028
11091
|
});
|
|
11029
11092
|
}
|
|
11030
11093
|
continue;
|
|
@@ -11035,7 +11098,8 @@ function convertRulesyncToCodexProfile({
|
|
|
11035
11098
|
filesystem,
|
|
11036
11099
|
projectRootFilesystem,
|
|
11037
11100
|
pattern,
|
|
11038
|
-
access: mapWriteAction(action)
|
|
11101
|
+
access: mapWriteAction(action),
|
|
11102
|
+
logger
|
|
11039
11103
|
});
|
|
11040
11104
|
}
|
|
11041
11105
|
continue;
|
|
@@ -11057,6 +11121,11 @@ function convertRulesyncToCodexProfile({
|
|
|
11057
11121
|
);
|
|
11058
11122
|
}
|
|
11059
11123
|
if (Object.keys(projectRootFilesystem).length > 0) {
|
|
11124
|
+
if (typeof filesystem[CODEX_PROJECT_ROOTS_KEY] === "string") {
|
|
11125
|
+
logger?.warn(
|
|
11126
|
+
`"${CODEX_PROJECT_ROOTS_KEY}" is set as a direct filesystem access rule in the permissions, but it will be overwritten by project-root rules. Consider removing the direct "${CODEX_PROJECT_ROOTS_KEY}" entry.`
|
|
11127
|
+
);
|
|
11128
|
+
}
|
|
11060
11129
|
if (Object.keys(projectRootFilesystem).some((pattern) => pattern.includes("**"))) {
|
|
11061
11130
|
filesystem.glob_scan_max_depth = CODEX_GLOB_SCAN_MAX_DEPTH;
|
|
11062
11131
|
}
|
|
@@ -11107,8 +11176,13 @@ function addFilesystemRule({
|
|
|
11107
11176
|
filesystem,
|
|
11108
11177
|
projectRootFilesystem,
|
|
11109
11178
|
pattern,
|
|
11110
|
-
access
|
|
11179
|
+
access,
|
|
11180
|
+
logger
|
|
11111
11181
|
}) {
|
|
11182
|
+
if (pattern.trim() === "") {
|
|
11183
|
+
logger?.warn("Skipping empty pattern in filesystem permissions.");
|
|
11184
|
+
return;
|
|
11185
|
+
}
|
|
11112
11186
|
if (canBeCodexFilesystemRoot(pattern)) {
|
|
11113
11187
|
filesystem[pattern] = access;
|
|
11114
11188
|
return;
|
|
@@ -12892,7 +12966,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
12892
12966
|
// src/features/rules/rules-processor.ts
|
|
12893
12967
|
import { basename as basename10, dirname as dirname3, join as join151, relative as relative6 } from "path";
|
|
12894
12968
|
import { encode } from "@toon-format/toon";
|
|
12895
|
-
import { z as
|
|
12969
|
+
import { z as z80 } from "zod/mini";
|
|
12896
12970
|
|
|
12897
12971
|
// src/constants/general.ts
|
|
12898
12972
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -17844,7 +17918,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
17844
17918
|
|
|
17845
17919
|
// src/features/subagents/subagents-processor.ts
|
|
17846
17920
|
import { basename as basename9, join as join122 } from "path";
|
|
17847
|
-
import { z as
|
|
17921
|
+
import { z as z73 } from "zod/mini";
|
|
17848
17922
|
|
|
17849
17923
|
// src/features/subagents/claudecode-subagent.ts
|
|
17850
17924
|
import { join as join110 } from "path";
|
|
@@ -19004,6 +19078,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
19004
19078
|
|
|
19005
19079
|
// src/features/subagents/kilo-subagent.ts
|
|
19006
19080
|
import { join as join118 } from "path";
|
|
19081
|
+
import { z as z71 } from "zod/mini";
|
|
19007
19082
|
|
|
19008
19083
|
// src/features/subagents/opencode-style-subagent.ts
|
|
19009
19084
|
import { basename as basename8, join as join117 } from "path";
|
|
@@ -19070,7 +19145,13 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
19070
19145
|
};
|
|
19071
19146
|
|
|
19072
19147
|
// src/features/subagents/kilo-subagent.ts
|
|
19073
|
-
var KiloSubagentFrontmatterSchema =
|
|
19148
|
+
var KiloSubagentFrontmatterSchema = z71.looseObject({
|
|
19149
|
+
description: z71.optional(z71.string()),
|
|
19150
|
+
// Kilo's documented default for user-defined agents is "all":
|
|
19151
|
+
// available both as a top-level pick and as a subagent.
|
|
19152
|
+
mode: z71._default(z71.string(), "all"),
|
|
19153
|
+
name: z71.optional(z71.string())
|
|
19154
|
+
});
|
|
19074
19155
|
var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
19075
19156
|
getToolTarget() {
|
|
19076
19157
|
return "kilo";
|
|
@@ -19090,12 +19171,11 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
19090
19171
|
}) {
|
|
19091
19172
|
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
19092
19173
|
const kiloSection = rulesyncFrontmatter.kilo ?? {};
|
|
19093
|
-
const kiloFrontmatter = {
|
|
19174
|
+
const kiloFrontmatter = KiloSubagentFrontmatterSchema.parse({
|
|
19094
19175
|
...kiloSection,
|
|
19095
19176
|
description: rulesyncFrontmatter.description,
|
|
19096
|
-
mode: typeof kiloSection.mode === "string" ? kiloSection.mode : "subagent",
|
|
19097
19177
|
...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
|
|
19098
|
-
};
|
|
19178
|
+
});
|
|
19099
19179
|
const body = rulesyncSubagent.getBody();
|
|
19100
19180
|
const fileContent = stringifyFrontmatter(body, kiloFrontmatter);
|
|
19101
19181
|
const paths = this.getSettablePaths({ global });
|
|
@@ -19144,38 +19224,40 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
19144
19224
|
static forDeletion({
|
|
19145
19225
|
outputRoot = process.cwd(),
|
|
19146
19226
|
relativeDirPath,
|
|
19147
|
-
relativeFilePath
|
|
19227
|
+
relativeFilePath,
|
|
19228
|
+
global = false
|
|
19148
19229
|
}) {
|
|
19149
19230
|
return new _KiloSubagent({
|
|
19150
19231
|
outputRoot,
|
|
19151
19232
|
relativeDirPath,
|
|
19152
19233
|
relativeFilePath,
|
|
19153
|
-
frontmatter: { description: "", mode: "
|
|
19234
|
+
frontmatter: { description: "", mode: "all" },
|
|
19154
19235
|
body: "",
|
|
19155
19236
|
fileContent: "",
|
|
19156
|
-
validate: false
|
|
19237
|
+
validate: false,
|
|
19238
|
+
global
|
|
19157
19239
|
});
|
|
19158
19240
|
}
|
|
19159
19241
|
};
|
|
19160
19242
|
|
|
19161
19243
|
// src/features/subagents/kiro-subagent.ts
|
|
19162
19244
|
import { join as join119 } from "path";
|
|
19163
|
-
import { z as
|
|
19164
|
-
var KiroCliSubagentJsonSchema =
|
|
19165
|
-
name:
|
|
19166
|
-
description:
|
|
19167
|
-
prompt:
|
|
19168
|
-
tools:
|
|
19169
|
-
toolAliases:
|
|
19170
|
-
toolSettings:
|
|
19171
|
-
toolSchema:
|
|
19172
|
-
hooks:
|
|
19173
|
-
model:
|
|
19174
|
-
mcpServers:
|
|
19175
|
-
useLegacyMcpJson:
|
|
19176
|
-
resources:
|
|
19177
|
-
allowedTools:
|
|
19178
|
-
includeMcpJson:
|
|
19245
|
+
import { z as z72 } from "zod/mini";
|
|
19246
|
+
var KiroCliSubagentJsonSchema = z72.looseObject({
|
|
19247
|
+
name: z72.string(),
|
|
19248
|
+
description: z72.optional(z72.nullable(z72.string())),
|
|
19249
|
+
prompt: z72.optional(z72.nullable(z72.string())),
|
|
19250
|
+
tools: z72.optional(z72.nullable(z72.array(z72.string()))),
|
|
19251
|
+
toolAliases: z72.optional(z72.nullable(z72.record(z72.string(), z72.string()))),
|
|
19252
|
+
toolSettings: z72.optional(z72.nullable(z72.unknown())),
|
|
19253
|
+
toolSchema: z72.optional(z72.nullable(z72.unknown())),
|
|
19254
|
+
hooks: z72.optional(z72.nullable(z72.record(z72.string(), z72.array(z72.unknown())))),
|
|
19255
|
+
model: z72.optional(z72.nullable(z72.string())),
|
|
19256
|
+
mcpServers: z72.optional(z72.nullable(z72.record(z72.string(), z72.unknown()))),
|
|
19257
|
+
useLegacyMcpJson: z72.optional(z72.nullable(z72.boolean())),
|
|
19258
|
+
resources: z72.optional(z72.nullable(z72.array(z72.string()))),
|
|
19259
|
+
allowedTools: z72.optional(z72.nullable(z72.array(z72.string()))),
|
|
19260
|
+
includeMcpJson: z72.optional(z72.nullable(z72.boolean()))
|
|
19179
19261
|
});
|
|
19180
19262
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
19181
19263
|
body;
|
|
@@ -19541,7 +19623,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
19541
19623
|
"rovodev",
|
|
19542
19624
|
"takt"
|
|
19543
19625
|
];
|
|
19544
|
-
var SubagentsProcessorToolTargetSchema =
|
|
19626
|
+
var SubagentsProcessorToolTargetSchema = z73.enum(subagentsProcessorToolTargetTuple);
|
|
19545
19627
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
19546
19628
|
[
|
|
19547
19629
|
"agentsmd",
|
|
@@ -19870,48 +19952,48 @@ import { join as join124 } from "path";
|
|
|
19870
19952
|
|
|
19871
19953
|
// src/features/rules/rulesync-rule.ts
|
|
19872
19954
|
import { join as join123 } from "path";
|
|
19873
|
-
import { z as
|
|
19874
|
-
var RulesyncRuleFrontmatterSchema =
|
|
19875
|
-
root:
|
|
19876
|
-
localRoot:
|
|
19877
|
-
targets:
|
|
19878
|
-
description:
|
|
19879
|
-
globs:
|
|
19880
|
-
agentsmd:
|
|
19881
|
-
|
|
19955
|
+
import { z as z74 } from "zod/mini";
|
|
19956
|
+
var RulesyncRuleFrontmatterSchema = z74.object({
|
|
19957
|
+
root: z74.optional(z74.boolean()),
|
|
19958
|
+
localRoot: z74.optional(z74.boolean()),
|
|
19959
|
+
targets: z74._default(RulesyncTargetsSchema, ["*"]),
|
|
19960
|
+
description: z74.optional(z74.string()),
|
|
19961
|
+
globs: z74.optional(z74.array(z74.string())),
|
|
19962
|
+
agentsmd: z74.optional(
|
|
19963
|
+
z74.looseObject({
|
|
19882
19964
|
// @example "path/to/subproject"
|
|
19883
|
-
subprojectPath:
|
|
19965
|
+
subprojectPath: z74.optional(z74.string())
|
|
19884
19966
|
})
|
|
19885
19967
|
),
|
|
19886
|
-
claudecode:
|
|
19887
|
-
|
|
19968
|
+
claudecode: z74.optional(
|
|
19969
|
+
z74.looseObject({
|
|
19888
19970
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
19889
19971
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
19890
|
-
paths:
|
|
19972
|
+
paths: z74.optional(z74.array(z74.string()))
|
|
19891
19973
|
})
|
|
19892
19974
|
),
|
|
19893
|
-
cursor:
|
|
19894
|
-
|
|
19895
|
-
alwaysApply:
|
|
19896
|
-
description:
|
|
19897
|
-
globs:
|
|
19975
|
+
cursor: z74.optional(
|
|
19976
|
+
z74.looseObject({
|
|
19977
|
+
alwaysApply: z74.optional(z74.boolean()),
|
|
19978
|
+
description: z74.optional(z74.string()),
|
|
19979
|
+
globs: z74.optional(z74.array(z74.string()))
|
|
19898
19980
|
})
|
|
19899
19981
|
),
|
|
19900
|
-
copilot:
|
|
19901
|
-
|
|
19902
|
-
excludeAgent:
|
|
19982
|
+
copilot: z74.optional(
|
|
19983
|
+
z74.looseObject({
|
|
19984
|
+
excludeAgent: z74.optional(z74.union([z74.literal("code-review"), z74.literal("coding-agent")]))
|
|
19903
19985
|
})
|
|
19904
19986
|
),
|
|
19905
|
-
antigravity:
|
|
19906
|
-
|
|
19907
|
-
trigger:
|
|
19908
|
-
globs:
|
|
19987
|
+
antigravity: z74.optional(
|
|
19988
|
+
z74.looseObject({
|
|
19989
|
+
trigger: z74.optional(z74.string()),
|
|
19990
|
+
globs: z74.optional(z74.array(z74.string()))
|
|
19909
19991
|
})
|
|
19910
19992
|
),
|
|
19911
|
-
takt:
|
|
19912
|
-
|
|
19993
|
+
takt: z74.optional(
|
|
19994
|
+
z74.looseObject({
|
|
19913
19995
|
// Rename the emitted file stem (e.g. "coder.md" → "{name}.md").
|
|
19914
|
-
name:
|
|
19996
|
+
name: z74.optional(z74.string())
|
|
19915
19997
|
})
|
|
19916
19998
|
)
|
|
19917
19999
|
});
|
|
@@ -20212,20 +20294,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
20212
20294
|
|
|
20213
20295
|
// src/features/rules/antigravity-rule.ts
|
|
20214
20296
|
import { join as join126 } from "path";
|
|
20215
|
-
import { z as
|
|
20216
|
-
var AntigravityRuleFrontmatterSchema =
|
|
20217
|
-
trigger:
|
|
20218
|
-
|
|
20219
|
-
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20297
|
+
import { z as z75 } from "zod/mini";
|
|
20298
|
+
var AntigravityRuleFrontmatterSchema = z75.looseObject({
|
|
20299
|
+
trigger: z75.optional(
|
|
20300
|
+
z75.union([
|
|
20301
|
+
z75.literal("always_on"),
|
|
20302
|
+
z75.literal("glob"),
|
|
20303
|
+
z75.literal("manual"),
|
|
20304
|
+
z75.literal("model_decision"),
|
|
20305
|
+
z75.string()
|
|
20224
20306
|
// accepts any string for forward compatibility
|
|
20225
20307
|
])
|
|
20226
20308
|
),
|
|
20227
|
-
globs:
|
|
20228
|
-
description:
|
|
20309
|
+
globs: z75.optional(z75.string()),
|
|
20310
|
+
description: z75.optional(z75.string())
|
|
20229
20311
|
});
|
|
20230
20312
|
function parseGlobsString(globs) {
|
|
20231
20313
|
if (!globs) {
|
|
@@ -20812,9 +20894,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
20812
20894
|
|
|
20813
20895
|
// src/features/rules/claudecode-rule.ts
|
|
20814
20896
|
import { join as join130 } from "path";
|
|
20815
|
-
import { z as
|
|
20816
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
20817
|
-
paths:
|
|
20897
|
+
import { z as z76 } from "zod/mini";
|
|
20898
|
+
var ClaudecodeRuleFrontmatterSchema = z76.object({
|
|
20899
|
+
paths: z76.optional(z76.array(z76.string()))
|
|
20818
20900
|
});
|
|
20819
20901
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
20820
20902
|
frontmatter;
|
|
@@ -21030,9 +21112,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
21030
21112
|
|
|
21031
21113
|
// src/features/rules/cline-rule.ts
|
|
21032
21114
|
import { join as join131 } from "path";
|
|
21033
|
-
import { z as
|
|
21034
|
-
var ClineRuleFrontmatterSchema =
|
|
21035
|
-
description:
|
|
21115
|
+
import { z as z77 } from "zod/mini";
|
|
21116
|
+
var ClineRuleFrontmatterSchema = z77.object({
|
|
21117
|
+
description: z77.string()
|
|
21036
21118
|
});
|
|
21037
21119
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
21038
21120
|
static getSettablePaths(_options = {}) {
|
|
@@ -21211,11 +21293,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
21211
21293
|
|
|
21212
21294
|
// src/features/rules/copilot-rule.ts
|
|
21213
21295
|
import { join as join133 } from "path";
|
|
21214
|
-
import { z as
|
|
21215
|
-
var CopilotRuleFrontmatterSchema =
|
|
21216
|
-
description:
|
|
21217
|
-
applyTo:
|
|
21218
|
-
excludeAgent:
|
|
21296
|
+
import { z as z78 } from "zod/mini";
|
|
21297
|
+
var CopilotRuleFrontmatterSchema = z78.object({
|
|
21298
|
+
description: z78.optional(z78.string()),
|
|
21299
|
+
applyTo: z78.optional(z78.string()),
|
|
21300
|
+
excludeAgent: z78.optional(z78.union([z78.literal("code-review"), z78.literal("coding-agent")]))
|
|
21219
21301
|
});
|
|
21220
21302
|
var normalizeRelativePath = (path4) => path4.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
21221
21303
|
var sameRelativePath = (leftDir, leftFile, rightDir, rightFile) => normalizeRelativePath(join133(leftDir, leftFile)) === normalizeRelativePath(join133(rightDir, rightFile));
|
|
@@ -21469,11 +21551,11 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
21469
21551
|
|
|
21470
21552
|
// src/features/rules/cursor-rule.ts
|
|
21471
21553
|
import { join as join134 } from "path";
|
|
21472
|
-
import { z as
|
|
21473
|
-
var CursorRuleFrontmatterSchema =
|
|
21474
|
-
description:
|
|
21475
|
-
globs:
|
|
21476
|
-
alwaysApply:
|
|
21554
|
+
import { z as z79 } from "zod/mini";
|
|
21555
|
+
var CursorRuleFrontmatterSchema = z79.object({
|
|
21556
|
+
description: z79.optional(z79.string()),
|
|
21557
|
+
globs: z79.optional(z79.string()),
|
|
21558
|
+
alwaysApply: z79.optional(z79.boolean())
|
|
21477
21559
|
});
|
|
21478
21560
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
21479
21561
|
frontmatter;
|
|
@@ -23356,11 +23438,11 @@ var rulesProcessorToolTargets = [
|
|
|
23356
23438
|
"warp",
|
|
23357
23439
|
"windsurf"
|
|
23358
23440
|
];
|
|
23359
|
-
var RulesProcessorToolTargetSchema =
|
|
23441
|
+
var RulesProcessorToolTargetSchema = z80.enum(rulesProcessorToolTargets);
|
|
23360
23442
|
var formatRulePaths = (rules) => rules.map((r) => join151(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
23361
|
-
var RulesFeatureOptionsSchema =
|
|
23362
|
-
ruleDiscoveryMode:
|
|
23363
|
-
includeLocalRoot:
|
|
23443
|
+
var RulesFeatureOptionsSchema = z80.looseObject({
|
|
23444
|
+
ruleDiscoveryMode: z80.optional(z80.enum(["none", "explicit"])),
|
|
23445
|
+
includeLocalRoot: z80.optional(z80.boolean())
|
|
23364
23446
|
});
|
|
23365
23447
|
var resolveRuleDiscoveryMode = ({
|
|
23366
23448
|
defaultMode,
|
|
@@ -23381,8 +23463,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
23381
23463
|
}
|
|
23382
23464
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
23383
23465
|
};
|
|
23384
|
-
var IncludeLocalRootSchema =
|
|
23385
|
-
includeLocalRoot:
|
|
23466
|
+
var IncludeLocalRootSchema = z80.looseObject({
|
|
23467
|
+
includeLocalRoot: z80.optional(z80.boolean())
|
|
23386
23468
|
});
|
|
23387
23469
|
var resolveIncludeLocalRoot = (options) => {
|
|
23388
23470
|
if (!options) return true;
|