rulesync 8.17.0 → 8.19.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-RXCRO26Z.js → chunk-66SPWRYP.js} +248 -127
- package/dist/cli/index.cjs +453 -332
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +248 -127
- package/dist/index.js +1 -1
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -1064,11 +1064,18 @@ var smolToml = __toESM(require("smol-toml"), 1);
|
|
|
1064
1064
|
// src/utils/frontmatter.ts
|
|
1065
1065
|
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
1066
1066
|
var import_js_yaml = require("js-yaml");
|
|
1067
|
+
|
|
1068
|
+
// src/utils/type-guards.ts
|
|
1069
|
+
function isRecord(value) {
|
|
1070
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1071
|
+
}
|
|
1067
1072
|
function isPlainObject(value) {
|
|
1068
|
-
if (value
|
|
1069
|
-
const
|
|
1070
|
-
return
|
|
1073
|
+
if (!isRecord(value)) return false;
|
|
1074
|
+
const proto = Object.getPrototypeOf(value);
|
|
1075
|
+
return proto === null || proto === Object.prototype;
|
|
1071
1076
|
}
|
|
1077
|
+
|
|
1078
|
+
// src/utils/frontmatter.ts
|
|
1072
1079
|
function deepRemoveNullishValue(value) {
|
|
1073
1080
|
if (value === null || value === void 0) {
|
|
1074
1081
|
return void 0;
|
|
@@ -1659,11 +1666,6 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
1659
1666
|
var import_node_path10 = require("path");
|
|
1660
1667
|
var import_mini6 = require("zod/mini");
|
|
1661
1668
|
|
|
1662
|
-
// src/utils/type-guards.ts
|
|
1663
|
-
function isRecord(value) {
|
|
1664
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
1669
|
// src/features/commands/rulesync-command.ts
|
|
1668
1670
|
var import_node_path9 = require("path");
|
|
1669
1671
|
var import_mini5 = require("zod/mini");
|
|
@@ -7666,7 +7668,7 @@ var ToolMcp = class extends ToolFile {
|
|
|
7666
7668
|
super({
|
|
7667
7669
|
...rest,
|
|
7668
7670
|
validate: true
|
|
7669
|
-
//
|
|
7671
|
+
// ToolMcp runs subclass validation below when requested
|
|
7670
7672
|
});
|
|
7671
7673
|
if (rest.validate) {
|
|
7672
7674
|
const result = this.validate();
|
|
@@ -7724,17 +7726,26 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7724
7726
|
return this.json;
|
|
7725
7727
|
}
|
|
7726
7728
|
/**
|
|
7727
|
-
* In global mode, ~/.claude
|
|
7728
|
-
*
|
|
7729
|
+
* In global mode, ~/.claude.json should not be deleted as it is the
|
|
7730
|
+
* user's primary Claude Code config and contains many other settings
|
|
7731
|
+
* managed by Claude Code itself (feature flags, project trust list,
|
|
7732
|
+
* hooks, user settings, model selection, etc.).
|
|
7729
7733
|
* In local mode, .mcp.json can be safely deleted.
|
|
7730
7734
|
*/
|
|
7731
7735
|
isDeletable() {
|
|
7732
7736
|
return !this.global;
|
|
7733
7737
|
}
|
|
7738
|
+
/**
|
|
7739
|
+
* Legacy global path used by rulesync ≤ v8.17.0. The documented store
|
|
7740
|
+
* is `~/.claude.json`; `fromFile` falls back here with a deprecation
|
|
7741
|
+
* warning (mirrors PR #333). Never modified or removed by rulesync.
|
|
7742
|
+
*/
|
|
7743
|
+
static LEGACY_GLOBAL_DIR = ".claude";
|
|
7744
|
+
static LEGACY_GLOBAL_FILE = ".claude.json";
|
|
7734
7745
|
static getSettablePaths({ global } = {}) {
|
|
7735
7746
|
if (global) {
|
|
7736
7747
|
return {
|
|
7737
|
-
relativeDirPath: ".
|
|
7748
|
+
relativeDirPath: ".",
|
|
7738
7749
|
relativeFilePath: ".claude.json"
|
|
7739
7750
|
};
|
|
7740
7751
|
}
|
|
@@ -7746,19 +7757,52 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7746
7757
|
static async fromFile({
|
|
7747
7758
|
outputRoot = process.cwd(),
|
|
7748
7759
|
validate = true,
|
|
7749
|
-
global = false
|
|
7760
|
+
global = false,
|
|
7761
|
+
logger
|
|
7750
7762
|
}) {
|
|
7751
7763
|
const paths = this.getSettablePaths({ global });
|
|
7752
|
-
const
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7764
|
+
const recommendedPath = (0, import_node_path52.join)(outputRoot, paths.relativeDirPath, paths.relativeFilePath);
|
|
7765
|
+
if (await fileExists(recommendedPath)) {
|
|
7766
|
+
const fileContent = await readFileContent(recommendedPath);
|
|
7767
|
+
const json = JSON.parse(fileContent);
|
|
7768
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7769
|
+
return new _ClaudecodeMcp({
|
|
7770
|
+
outputRoot,
|
|
7771
|
+
relativeDirPath: paths.relativeDirPath,
|
|
7772
|
+
relativeFilePath: paths.relativeFilePath,
|
|
7773
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
7774
|
+
validate,
|
|
7775
|
+
global
|
|
7776
|
+
});
|
|
7777
|
+
}
|
|
7778
|
+
if (global) {
|
|
7779
|
+
const legacyPath = (0, import_node_path52.join)(
|
|
7780
|
+
outputRoot,
|
|
7781
|
+
_ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
7782
|
+
_ClaudecodeMcp.LEGACY_GLOBAL_FILE
|
|
7783
|
+
);
|
|
7784
|
+
if (await fileExists(legacyPath)) {
|
|
7785
|
+
logger?.warn(
|
|
7786
|
+
`Warning: using deprecated path "${legacyPath}". Please migrate to "${recommendedPath}"`
|
|
7787
|
+
);
|
|
7788
|
+
const fileContent = await readFileContent(legacyPath);
|
|
7789
|
+
const json = JSON.parse(fileContent);
|
|
7790
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7791
|
+
return new _ClaudecodeMcp({
|
|
7792
|
+
outputRoot,
|
|
7793
|
+
relativeDirPath: _ClaudecodeMcp.LEGACY_GLOBAL_DIR,
|
|
7794
|
+
relativeFilePath: _ClaudecodeMcp.LEGACY_GLOBAL_FILE,
|
|
7795
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
7796
|
+
validate,
|
|
7797
|
+
global
|
|
7798
|
+
});
|
|
7799
|
+
}
|
|
7800
|
+
}
|
|
7757
7801
|
return new _ClaudecodeMcp({
|
|
7758
7802
|
outputRoot,
|
|
7759
7803
|
relativeDirPath: paths.relativeDirPath,
|
|
7760
7804
|
relativeFilePath: paths.relativeFilePath,
|
|
7761
|
-
fileContent: JSON.stringify(
|
|
7805
|
+
fileContent: JSON.stringify({ mcpServers: {} }, null, 2),
|
|
7762
7806
|
validate,
|
|
7763
7807
|
global
|
|
7764
7808
|
});
|
|
@@ -7787,7 +7831,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7787
7831
|
}
|
|
7788
7832
|
toRulesyncMcp() {
|
|
7789
7833
|
return this.toRulesyncMcpDefault({
|
|
7790
|
-
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
|
|
7834
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
7791
7835
|
});
|
|
7792
7836
|
}
|
|
7793
7837
|
validate() {
|
|
@@ -7889,14 +7933,16 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
7889
7933
|
// src/features/mcp/codexcli-mcp.ts
|
|
7890
7934
|
var import_node_path54 = require("path");
|
|
7891
7935
|
var smolToml3 = __toESM(require("smol-toml"), 1);
|
|
7936
|
+
var MAX_REMOVE_EMPTY_ENTRIES_DEPTH = 32;
|
|
7937
|
+
var PROTOTYPE_POLLUTION_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
7892
7938
|
function convertFromCodexFormat(codexMcp) {
|
|
7893
7939
|
const result = {};
|
|
7894
7940
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
7895
|
-
if (
|
|
7896
|
-
|
|
7897
|
-
}
|
|
7941
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
|
|
7942
|
+
if (!isRecord(config)) continue;
|
|
7898
7943
|
const converted = {};
|
|
7899
7944
|
for (const [key, value] of Object.entries(config)) {
|
|
7945
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
7900
7946
|
if (key === "enabled") {
|
|
7901
7947
|
if (value === false) {
|
|
7902
7948
|
converted["disabled"] = true;
|
|
@@ -7918,8 +7964,11 @@ function convertFromCodexFormat(codexMcp) {
|
|
|
7918
7964
|
function convertToCodexFormat(mcpServers) {
|
|
7919
7965
|
const result = {};
|
|
7920
7966
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
7967
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
|
|
7968
|
+
if (!isRecord(config)) continue;
|
|
7921
7969
|
const converted = {};
|
|
7922
7970
|
for (const [key, value] of Object.entries(config)) {
|
|
7971
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
7923
7972
|
if (key === "disabled") {
|
|
7924
7973
|
if (value === true) {
|
|
7925
7974
|
converted["enabled"] = false;
|
|
@@ -8001,6 +8050,14 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8001
8050
|
const mcpServers = rulesyncMcp.getJson().mcpServers;
|
|
8002
8051
|
const converted = convertToCodexFormat(mcpServers);
|
|
8003
8052
|
const filteredMcpServers = this.removeEmptyEntries(converted);
|
|
8053
|
+
for (const name of Object.keys(converted)) {
|
|
8054
|
+
if (!Object.hasOwn(filteredMcpServers, name)) {
|
|
8055
|
+
warnWithFallback(
|
|
8056
|
+
void 0,
|
|
8057
|
+
`MCP server "${name}" had no non-empty configuration and was dropped from the codex CLI config`
|
|
8058
|
+
);
|
|
8059
|
+
}
|
|
8060
|
+
}
|
|
8004
8061
|
configToml["mcp_servers"] = filteredMcpServers;
|
|
8005
8062
|
return new _CodexcliMcp({
|
|
8006
8063
|
outputRoot,
|
|
@@ -8020,13 +8077,21 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
8020
8077
|
validate() {
|
|
8021
8078
|
return { success: true, error: null };
|
|
8022
8079
|
}
|
|
8023
|
-
static removeEmptyEntries(obj) {
|
|
8080
|
+
static removeEmptyEntries(obj, depth = 0) {
|
|
8024
8081
|
if (!obj) return {};
|
|
8082
|
+
if (depth > MAX_REMOVE_EMPTY_ENTRIES_DEPTH) {
|
|
8083
|
+
warnWithFallback(
|
|
8084
|
+
void 0,
|
|
8085
|
+
`removeEmptyEntries: maximum recursion depth (${MAX_REMOVE_EMPTY_ENTRIES_DEPTH}) exceeded; empty nested objects may remain`
|
|
8086
|
+
);
|
|
8087
|
+
return obj;
|
|
8088
|
+
}
|
|
8025
8089
|
const filtered = {};
|
|
8026
8090
|
for (const [key, value] of Object.entries(obj)) {
|
|
8091
|
+
if (PROTOTYPE_POLLUTION_KEYS.has(key)) continue;
|
|
8027
8092
|
if (value === null) continue;
|
|
8028
|
-
if (
|
|
8029
|
-
const cleaned = this.removeEmptyEntries(value);
|
|
8093
|
+
if (isPlainObject(value)) {
|
|
8094
|
+
const cleaned = this.removeEmptyEntries(value, depth + 1);
|
|
8030
8095
|
if (Object.keys(cleaned).length === 0) continue;
|
|
8031
8096
|
filtered[key] = cleaned;
|
|
8032
8097
|
continue;
|
|
@@ -9719,7 +9784,13 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
9719
9784
|
class: KiloMcp,
|
|
9720
9785
|
meta: {
|
|
9721
9786
|
supportsProject: true,
|
|
9722
|
-
|
|
9787
|
+
// Kilo CLI reads global MCP from `~/.config/kilo/kilo.json` (or
|
|
9788
|
+
// `kilo.jsonc`). The path machinery in `KiloMcp.getSettablePaths`
|
|
9789
|
+
// already routes global mode to that location; only this flag
|
|
9790
|
+
// was gating it off. Kilo is an OpenCode fork and uses an
|
|
9791
|
+
// identical native MCP schema, so global parity with opencode
|
|
9792
|
+
// is the natural state.
|
|
9793
|
+
supportsGlobal: true,
|
|
9723
9794
|
supportsEnabledTools: false,
|
|
9724
9795
|
supportsDisabledTools: false
|
|
9725
9796
|
}
|
|
@@ -9865,7 +9936,8 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
9865
9936
|
await factory.class.fromFile({
|
|
9866
9937
|
outputRoot: this.outputRoot,
|
|
9867
9938
|
validate: true,
|
|
9868
|
-
global: this.global
|
|
9939
|
+
global: this.global,
|
|
9940
|
+
logger: this.logger
|
|
9869
9941
|
})
|
|
9870
9942
|
];
|
|
9871
9943
|
this.logger.debug(`Successfully loaded ${toolMcps.length} ${this.toolTarget} MCP files`);
|
|
@@ -12840,7 +12912,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
12840
12912
|
// src/features/rules/rules-processor.ts
|
|
12841
12913
|
var import_node_path154 = require("path");
|
|
12842
12914
|
var import_toon = require("@toon-format/toon");
|
|
12843
|
-
var
|
|
12915
|
+
var import_mini80 = require("zod/mini");
|
|
12844
12916
|
|
|
12845
12917
|
// src/constants/general.ts
|
|
12846
12918
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -17792,7 +17864,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
17792
17864
|
|
|
17793
17865
|
// src/features/subagents/subagents-processor.ts
|
|
17794
17866
|
var import_node_path125 = require("path");
|
|
17795
|
-
var
|
|
17867
|
+
var import_mini73 = require("zod/mini");
|
|
17796
17868
|
|
|
17797
17869
|
// src/features/subagents/claudecode-subagent.ts
|
|
17798
17870
|
var import_node_path113 = require("path");
|
|
@@ -18952,6 +19024,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
18952
19024
|
|
|
18953
19025
|
// src/features/subagents/kilo-subagent.ts
|
|
18954
19026
|
var import_node_path121 = require("path");
|
|
19027
|
+
var import_mini71 = require("zod/mini");
|
|
18955
19028
|
|
|
18956
19029
|
// src/features/subagents/opencode-style-subagent.ts
|
|
18957
19030
|
var import_node_path120 = require("path");
|
|
@@ -19018,11 +19091,54 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
19018
19091
|
};
|
|
19019
19092
|
|
|
19020
19093
|
// src/features/subagents/kilo-subagent.ts
|
|
19021
|
-
var KiloSubagentFrontmatterSchema =
|
|
19094
|
+
var KiloSubagentFrontmatterSchema = import_mini71.z.looseObject({
|
|
19095
|
+
description: import_mini71.z.optional(import_mini71.z.string()),
|
|
19096
|
+
mode: import_mini71.z._default(import_mini71.z.string(), "all"),
|
|
19097
|
+
name: import_mini71.z.optional(import_mini71.z.string()),
|
|
19098
|
+
displayName: import_mini71.z.optional(import_mini71.z.string()),
|
|
19099
|
+
deprecated: import_mini71.z.optional(import_mini71.z.boolean()),
|
|
19100
|
+
native: import_mini71.z.optional(import_mini71.z.boolean()),
|
|
19101
|
+
hidden: import_mini71.z.optional(import_mini71.z.boolean()),
|
|
19102
|
+
top_p: import_mini71.z.optional(import_mini71.z.number()),
|
|
19103
|
+
temperature: import_mini71.z.optional(import_mini71.z.number()),
|
|
19104
|
+
color: import_mini71.z.optional(import_mini71.z.string()),
|
|
19105
|
+
permission: import_mini71.z.optional(import_mini71.z.string()),
|
|
19106
|
+
model: import_mini71.z.optional(import_mini71.z.string()),
|
|
19107
|
+
variant: import_mini71.z.optional(import_mini71.z.string()),
|
|
19108
|
+
prompt: import_mini71.z.optional(import_mini71.z.string()),
|
|
19109
|
+
options: import_mini71.z.optional(import_mini71.z.looseObject({})),
|
|
19110
|
+
steps: import_mini71.z.optional(import_mini71.z.array(import_mini71.z.looseObject({}))),
|
|
19111
|
+
disable: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19112
|
+
});
|
|
19022
19113
|
var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
19114
|
+
constructor(params) {
|
|
19115
|
+
super(params);
|
|
19116
|
+
if (params.validate !== false) {
|
|
19117
|
+
const result = this.validate();
|
|
19118
|
+
if (!result.success) {
|
|
19119
|
+
throw result.error;
|
|
19120
|
+
}
|
|
19121
|
+
}
|
|
19122
|
+
}
|
|
19023
19123
|
getToolTarget() {
|
|
19024
19124
|
return "kilo";
|
|
19025
19125
|
}
|
|
19126
|
+
getFrontmatter() {
|
|
19127
|
+
return this.frontmatter;
|
|
19128
|
+
}
|
|
19129
|
+
validate() {
|
|
19130
|
+
const result = KiloSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
19131
|
+
if (result.success) {
|
|
19132
|
+
this.frontmatter = result.data;
|
|
19133
|
+
return { success: true, error: null };
|
|
19134
|
+
}
|
|
19135
|
+
return {
|
|
19136
|
+
success: false,
|
|
19137
|
+
error: new Error(
|
|
19138
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
19139
|
+
)
|
|
19140
|
+
};
|
|
19141
|
+
}
|
|
19026
19142
|
static getSettablePaths({
|
|
19027
19143
|
global = false
|
|
19028
19144
|
} = {}) {
|
|
@@ -19038,12 +19154,17 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
19038
19154
|
}) {
|
|
19039
19155
|
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
19040
19156
|
const kiloSection = rulesyncFrontmatter.kilo ?? {};
|
|
19041
|
-
const
|
|
19157
|
+
const parseResult = KiloSubagentFrontmatterSchema.safeParse({
|
|
19042
19158
|
...kiloSection,
|
|
19043
19159
|
description: rulesyncFrontmatter.description,
|
|
19044
|
-
mode: typeof kiloSection.mode === "string" ? kiloSection.mode : "subagent",
|
|
19045
19160
|
...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
|
|
19046
|
-
};
|
|
19161
|
+
});
|
|
19162
|
+
if (!parseResult.success) {
|
|
19163
|
+
throw new Error(
|
|
19164
|
+
`Invalid frontmatter in ${rulesyncSubagent.getRelativeFilePath()}: ${formatError(parseResult.error)}`
|
|
19165
|
+
);
|
|
19166
|
+
}
|
|
19167
|
+
const kiloFrontmatter = parseResult.data;
|
|
19047
19168
|
const body = rulesyncSubagent.getBody();
|
|
19048
19169
|
const fileContent = stringifyFrontmatter(body, kiloFrontmatter);
|
|
19049
19170
|
const paths = this.getSettablePaths({ global });
|
|
@@ -19092,38 +19213,40 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
19092
19213
|
static forDeletion({
|
|
19093
19214
|
outputRoot = process.cwd(),
|
|
19094
19215
|
relativeDirPath,
|
|
19095
|
-
relativeFilePath
|
|
19216
|
+
relativeFilePath,
|
|
19217
|
+
global = false
|
|
19096
19218
|
}) {
|
|
19097
19219
|
return new _KiloSubagent({
|
|
19098
19220
|
outputRoot,
|
|
19099
19221
|
relativeDirPath,
|
|
19100
19222
|
relativeFilePath,
|
|
19101
|
-
frontmatter: { description: "", mode: "
|
|
19223
|
+
frontmatter: { description: "", mode: "all" },
|
|
19102
19224
|
body: "",
|
|
19103
19225
|
fileContent: "",
|
|
19104
|
-
validate: false
|
|
19226
|
+
validate: false,
|
|
19227
|
+
global
|
|
19105
19228
|
});
|
|
19106
19229
|
}
|
|
19107
19230
|
};
|
|
19108
19231
|
|
|
19109
19232
|
// src/features/subagents/kiro-subagent.ts
|
|
19110
19233
|
var import_node_path122 = require("path");
|
|
19111
|
-
var
|
|
19112
|
-
var KiroCliSubagentJsonSchema =
|
|
19113
|
-
name:
|
|
19114
|
-
description:
|
|
19115
|
-
prompt:
|
|
19116
|
-
tools:
|
|
19117
|
-
toolAliases:
|
|
19118
|
-
toolSettings:
|
|
19119
|
-
toolSchema:
|
|
19120
|
-
hooks:
|
|
19121
|
-
model:
|
|
19122
|
-
mcpServers:
|
|
19123
|
-
useLegacyMcpJson:
|
|
19124
|
-
resources:
|
|
19125
|
-
allowedTools:
|
|
19126
|
-
includeMcpJson:
|
|
19234
|
+
var import_mini72 = require("zod/mini");
|
|
19235
|
+
var KiroCliSubagentJsonSchema = import_mini72.z.looseObject({
|
|
19236
|
+
name: import_mini72.z.string(),
|
|
19237
|
+
description: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.string())),
|
|
19238
|
+
prompt: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.string())),
|
|
19239
|
+
tools: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.array(import_mini72.z.string()))),
|
|
19240
|
+
toolAliases: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.record(import_mini72.z.string(), import_mini72.z.string()))),
|
|
19241
|
+
toolSettings: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.unknown())),
|
|
19242
|
+
toolSchema: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.unknown())),
|
|
19243
|
+
hooks: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.record(import_mini72.z.string(), import_mini72.z.array(import_mini72.z.unknown())))),
|
|
19244
|
+
model: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.string())),
|
|
19245
|
+
mcpServers: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.record(import_mini72.z.string(), import_mini72.z.unknown()))),
|
|
19246
|
+
useLegacyMcpJson: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.boolean())),
|
|
19247
|
+
resources: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.array(import_mini72.z.string()))),
|
|
19248
|
+
allowedTools: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.array(import_mini72.z.string()))),
|
|
19249
|
+
includeMcpJson: import_mini72.z.optional(import_mini72.z.nullable(import_mini72.z.boolean()))
|
|
19127
19250
|
});
|
|
19128
19251
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
19129
19252
|
body;
|
|
@@ -19352,7 +19475,8 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
19352
19475
|
static forDeletion({
|
|
19353
19476
|
outputRoot = process.cwd(),
|
|
19354
19477
|
relativeDirPath,
|
|
19355
|
-
relativeFilePath
|
|
19478
|
+
relativeFilePath,
|
|
19479
|
+
global = false
|
|
19356
19480
|
}) {
|
|
19357
19481
|
return new _OpenCodeSubagent({
|
|
19358
19482
|
outputRoot,
|
|
@@ -19361,7 +19485,8 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
19361
19485
|
frontmatter: { description: "", mode: "subagent" },
|
|
19362
19486
|
body: "",
|
|
19363
19487
|
fileContent: "",
|
|
19364
|
-
validate: false
|
|
19488
|
+
validate: false,
|
|
19489
|
+
global
|
|
19365
19490
|
});
|
|
19366
19491
|
}
|
|
19367
19492
|
};
|
|
@@ -19489,7 +19614,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
19489
19614
|
"rovodev",
|
|
19490
19615
|
"takt"
|
|
19491
19616
|
];
|
|
19492
|
-
var SubagentsProcessorToolTargetSchema =
|
|
19617
|
+
var SubagentsProcessorToolTargetSchema = import_mini73.z.enum(subagentsProcessorToolTargetTuple);
|
|
19493
19618
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
19494
19619
|
[
|
|
19495
19620
|
"agentsmd",
|
|
@@ -19818,48 +19943,48 @@ var import_node_path127 = require("path");
|
|
|
19818
19943
|
|
|
19819
19944
|
// src/features/rules/rulesync-rule.ts
|
|
19820
19945
|
var import_node_path126 = require("path");
|
|
19821
|
-
var
|
|
19822
|
-
var RulesyncRuleFrontmatterSchema =
|
|
19823
|
-
root:
|
|
19824
|
-
localRoot:
|
|
19825
|
-
targets:
|
|
19826
|
-
description:
|
|
19827
|
-
globs:
|
|
19828
|
-
agentsmd:
|
|
19829
|
-
|
|
19946
|
+
var import_mini74 = require("zod/mini");
|
|
19947
|
+
var RulesyncRuleFrontmatterSchema = import_mini74.z.object({
|
|
19948
|
+
root: import_mini74.z.optional(import_mini74.z.boolean()),
|
|
19949
|
+
localRoot: import_mini74.z.optional(import_mini74.z.boolean()),
|
|
19950
|
+
targets: import_mini74.z._default(RulesyncTargetsSchema, ["*"]),
|
|
19951
|
+
description: import_mini74.z.optional(import_mini74.z.string()),
|
|
19952
|
+
globs: import_mini74.z.optional(import_mini74.z.array(import_mini74.z.string())),
|
|
19953
|
+
agentsmd: import_mini74.z.optional(
|
|
19954
|
+
import_mini74.z.looseObject({
|
|
19830
19955
|
// @example "path/to/subproject"
|
|
19831
|
-
subprojectPath:
|
|
19956
|
+
subprojectPath: import_mini74.z.optional(import_mini74.z.string())
|
|
19832
19957
|
})
|
|
19833
19958
|
),
|
|
19834
|
-
claudecode:
|
|
19835
|
-
|
|
19959
|
+
claudecode: import_mini74.z.optional(
|
|
19960
|
+
import_mini74.z.looseObject({
|
|
19836
19961
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
19837
19962
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
19838
|
-
paths:
|
|
19963
|
+
paths: import_mini74.z.optional(import_mini74.z.array(import_mini74.z.string()))
|
|
19839
19964
|
})
|
|
19840
19965
|
),
|
|
19841
|
-
cursor:
|
|
19842
|
-
|
|
19843
|
-
alwaysApply:
|
|
19844
|
-
description:
|
|
19845
|
-
globs:
|
|
19966
|
+
cursor: import_mini74.z.optional(
|
|
19967
|
+
import_mini74.z.looseObject({
|
|
19968
|
+
alwaysApply: import_mini74.z.optional(import_mini74.z.boolean()),
|
|
19969
|
+
description: import_mini74.z.optional(import_mini74.z.string()),
|
|
19970
|
+
globs: import_mini74.z.optional(import_mini74.z.array(import_mini74.z.string()))
|
|
19846
19971
|
})
|
|
19847
19972
|
),
|
|
19848
|
-
copilot:
|
|
19849
|
-
|
|
19850
|
-
excludeAgent:
|
|
19973
|
+
copilot: import_mini74.z.optional(
|
|
19974
|
+
import_mini74.z.looseObject({
|
|
19975
|
+
excludeAgent: import_mini74.z.optional(import_mini74.z.union([import_mini74.z.literal("code-review"), import_mini74.z.literal("coding-agent")]))
|
|
19851
19976
|
})
|
|
19852
19977
|
),
|
|
19853
|
-
antigravity:
|
|
19854
|
-
|
|
19855
|
-
trigger:
|
|
19856
|
-
globs:
|
|
19978
|
+
antigravity: import_mini74.z.optional(
|
|
19979
|
+
import_mini74.z.looseObject({
|
|
19980
|
+
trigger: import_mini74.z.optional(import_mini74.z.string()),
|
|
19981
|
+
globs: import_mini74.z.optional(import_mini74.z.array(import_mini74.z.string()))
|
|
19857
19982
|
})
|
|
19858
19983
|
),
|
|
19859
|
-
takt:
|
|
19860
|
-
|
|
19984
|
+
takt: import_mini74.z.optional(
|
|
19985
|
+
import_mini74.z.looseObject({
|
|
19861
19986
|
// Rename the emitted file stem (e.g. "coder.md" → "{name}.md").
|
|
19862
|
-
name:
|
|
19987
|
+
name: import_mini74.z.optional(import_mini74.z.string())
|
|
19863
19988
|
})
|
|
19864
19989
|
)
|
|
19865
19990
|
});
|
|
@@ -20160,20 +20285,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
20160
20285
|
|
|
20161
20286
|
// src/features/rules/antigravity-rule.ts
|
|
20162
20287
|
var import_node_path129 = require("path");
|
|
20163
|
-
var
|
|
20164
|
-
var AntigravityRuleFrontmatterSchema =
|
|
20165
|
-
trigger:
|
|
20166
|
-
|
|
20167
|
-
|
|
20168
|
-
|
|
20169
|
-
|
|
20170
|
-
|
|
20171
|
-
|
|
20288
|
+
var import_mini75 = require("zod/mini");
|
|
20289
|
+
var AntigravityRuleFrontmatterSchema = import_mini75.z.looseObject({
|
|
20290
|
+
trigger: import_mini75.z.optional(
|
|
20291
|
+
import_mini75.z.union([
|
|
20292
|
+
import_mini75.z.literal("always_on"),
|
|
20293
|
+
import_mini75.z.literal("glob"),
|
|
20294
|
+
import_mini75.z.literal("manual"),
|
|
20295
|
+
import_mini75.z.literal("model_decision"),
|
|
20296
|
+
import_mini75.z.string()
|
|
20172
20297
|
// accepts any string for forward compatibility
|
|
20173
20298
|
])
|
|
20174
20299
|
),
|
|
20175
|
-
globs:
|
|
20176
|
-
description:
|
|
20300
|
+
globs: import_mini75.z.optional(import_mini75.z.string()),
|
|
20301
|
+
description: import_mini75.z.optional(import_mini75.z.string())
|
|
20177
20302
|
});
|
|
20178
20303
|
function parseGlobsString(globs) {
|
|
20179
20304
|
if (!globs) {
|
|
@@ -20760,9 +20885,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
20760
20885
|
|
|
20761
20886
|
// src/features/rules/claudecode-rule.ts
|
|
20762
20887
|
var import_node_path133 = require("path");
|
|
20763
|
-
var
|
|
20764
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
20765
|
-
paths:
|
|
20888
|
+
var import_mini76 = require("zod/mini");
|
|
20889
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini76.z.object({
|
|
20890
|
+
paths: import_mini76.z.optional(import_mini76.z.array(import_mini76.z.string()))
|
|
20766
20891
|
});
|
|
20767
20892
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
20768
20893
|
frontmatter;
|
|
@@ -20978,9 +21103,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
20978
21103
|
|
|
20979
21104
|
// src/features/rules/cline-rule.ts
|
|
20980
21105
|
var import_node_path134 = require("path");
|
|
20981
|
-
var
|
|
20982
|
-
var ClineRuleFrontmatterSchema =
|
|
20983
|
-
description:
|
|
21106
|
+
var import_mini77 = require("zod/mini");
|
|
21107
|
+
var ClineRuleFrontmatterSchema = import_mini77.z.object({
|
|
21108
|
+
description: import_mini77.z.string()
|
|
20984
21109
|
});
|
|
20985
21110
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
20986
21111
|
static getSettablePaths(_options = {}) {
|
|
@@ -21159,14 +21284,14 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
21159
21284
|
|
|
21160
21285
|
// src/features/rules/copilot-rule.ts
|
|
21161
21286
|
var import_node_path136 = require("path");
|
|
21162
|
-
var
|
|
21163
|
-
var CopilotRuleFrontmatterSchema =
|
|
21164
|
-
description:
|
|
21165
|
-
applyTo:
|
|
21166
|
-
excludeAgent:
|
|
21287
|
+
var import_mini78 = require("zod/mini");
|
|
21288
|
+
var CopilotRuleFrontmatterSchema = import_mini78.z.object({
|
|
21289
|
+
description: import_mini78.z.optional(import_mini78.z.string()),
|
|
21290
|
+
applyTo: import_mini78.z.optional(import_mini78.z.string()),
|
|
21291
|
+
excludeAgent: import_mini78.z.optional(import_mini78.z.union([import_mini78.z.literal("code-review"), import_mini78.z.literal("coding-agent")]))
|
|
21167
21292
|
});
|
|
21168
|
-
var normalizeRelativePath = (
|
|
21169
|
-
var sameRelativePath = (
|
|
21293
|
+
var normalizeRelativePath = (p) => toPosixPath(p).replace(/\/+/g, "/");
|
|
21294
|
+
var sameRelativePath = (left, right) => normalizeRelativePath((0, import_node_path136.join)(left.dir, left.file)) === normalizeRelativePath((0, import_node_path136.join)(right.dir, right.file));
|
|
21170
21295
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
21171
21296
|
frontmatter;
|
|
21172
21297
|
body;
|
|
@@ -21285,10 +21410,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
21285
21410
|
}) {
|
|
21286
21411
|
const paths = this.getSettablePaths({ global });
|
|
21287
21412
|
const isRoot = relativeDirPath ? sameRelativePath(
|
|
21288
|
-
relativeDirPath,
|
|
21289
|
-
relativeFilePath
|
|
21290
|
-
paths.root.relativeDirPath,
|
|
21291
|
-
paths.root.relativeFilePath
|
|
21413
|
+
{ dir: relativeDirPath, file: relativeFilePath },
|
|
21414
|
+
{ dir: paths.root.relativeDirPath, file: paths.root.relativeFilePath }
|
|
21292
21415
|
) : relativeFilePath === paths.root.relativeFilePath;
|
|
21293
21416
|
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
21294
21417
|
if (isRoot) {
|
|
@@ -21334,10 +21457,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
21334
21457
|
}) {
|
|
21335
21458
|
const paths = this.getSettablePaths({ global });
|
|
21336
21459
|
const isRoot = sameRelativePath(
|
|
21337
|
-
relativeDirPath,
|
|
21338
|
-
relativeFilePath
|
|
21339
|
-
paths.root.relativeDirPath,
|
|
21340
|
-
paths.root.relativeFilePath
|
|
21460
|
+
{ dir: relativeDirPath, file: relativeFilePath },
|
|
21461
|
+
{ dir: paths.root.relativeDirPath, file: paths.root.relativeFilePath }
|
|
21341
21462
|
);
|
|
21342
21463
|
return new _CopilotRule({
|
|
21343
21464
|
outputRoot,
|
|
@@ -21417,11 +21538,11 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
21417
21538
|
|
|
21418
21539
|
// src/features/rules/cursor-rule.ts
|
|
21419
21540
|
var import_node_path137 = require("path");
|
|
21420
|
-
var
|
|
21421
|
-
var CursorRuleFrontmatterSchema =
|
|
21422
|
-
description:
|
|
21423
|
-
globs:
|
|
21424
|
-
alwaysApply:
|
|
21541
|
+
var import_mini79 = require("zod/mini");
|
|
21542
|
+
var CursorRuleFrontmatterSchema = import_mini79.z.object({
|
|
21543
|
+
description: import_mini79.z.optional(import_mini79.z.string()),
|
|
21544
|
+
globs: import_mini79.z.optional(import_mini79.z.string()),
|
|
21545
|
+
alwaysApply: import_mini79.z.optional(import_mini79.z.boolean())
|
|
21425
21546
|
});
|
|
21426
21547
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
21427
21548
|
frontmatter;
|
|
@@ -23304,11 +23425,11 @@ var rulesProcessorToolTargets = [
|
|
|
23304
23425
|
"warp",
|
|
23305
23426
|
"windsurf"
|
|
23306
23427
|
];
|
|
23307
|
-
var RulesProcessorToolTargetSchema =
|
|
23428
|
+
var RulesProcessorToolTargetSchema = import_mini80.z.enum(rulesProcessorToolTargets);
|
|
23308
23429
|
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path154.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
23309
|
-
var RulesFeatureOptionsSchema =
|
|
23310
|
-
ruleDiscoveryMode:
|
|
23311
|
-
includeLocalRoot:
|
|
23430
|
+
var RulesFeatureOptionsSchema = import_mini80.z.looseObject({
|
|
23431
|
+
ruleDiscoveryMode: import_mini80.z.optional(import_mini80.z.enum(["none", "explicit"])),
|
|
23432
|
+
includeLocalRoot: import_mini80.z.optional(import_mini80.z.boolean())
|
|
23312
23433
|
});
|
|
23313
23434
|
var resolveRuleDiscoveryMode = ({
|
|
23314
23435
|
defaultMode,
|
|
@@ -23329,8 +23450,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
23329
23450
|
}
|
|
23330
23451
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
23331
23452
|
};
|
|
23332
|
-
var IncludeLocalRootSchema =
|
|
23333
|
-
includeLocalRoot:
|
|
23453
|
+
var IncludeLocalRootSchema = import_mini80.z.looseObject({
|
|
23454
|
+
includeLocalRoot: import_mini80.z.optional(import_mini80.z.boolean())
|
|
23334
23455
|
});
|
|
23335
23456
|
var resolveIncludeLocalRoot = (options) => {
|
|
23336
23457
|
if (!options) return true;
|