rulesync 8.5.0 → 8.7.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-Q5FDY7NL.js → chunk-QGQQJNZD.js} +932 -728
- package/dist/cli/index.cjs +2890 -1072
- package/dist/cli/index.js +1831 -211
- package/dist/index.cjs +822 -619
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -357,7 +357,13 @@ var SourceEntrySchema = import_mini3.z.object({
|
|
|
357
357
|
(0, import_mini3.refine)((v) => !(0, import_node_path3.isAbsolute)(v), "path must not be absolute"),
|
|
358
358
|
(0, import_mini3.refine)((v) => !hasControlCharacters(v), "path must not contain control characters")
|
|
359
359
|
)
|
|
360
|
-
)
|
|
360
|
+
),
|
|
361
|
+
// gh-mode-only fields. Ignored by --mode rulesync. Defaults applied at the
|
|
362
|
+
// gh install site (`agent` defaults to "github-copilot", `scope` to "project").
|
|
363
|
+
agent: (0, import_mini3.optional)(
|
|
364
|
+
import_mini3.z.enum(["github-copilot", "claude-code", "cursor", "codex", "gemini", "antigravity"])
|
|
365
|
+
),
|
|
366
|
+
scope: (0, import_mini3.optional)(import_mini3.z.enum(["project", "user"]))
|
|
361
367
|
});
|
|
362
368
|
var ConfigParamsSchema = import_mini3.z.object({
|
|
363
369
|
baseDirs: import_mini3.z.array(import_mini3.z.string()),
|
|
@@ -3607,7 +3613,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3607
3613
|
};
|
|
3608
3614
|
|
|
3609
3615
|
// src/features/hooks/hooks-processor.ts
|
|
3610
|
-
var
|
|
3616
|
+
var import_mini19 = require("zod/mini");
|
|
3611
3617
|
|
|
3612
3618
|
// src/types/hooks.ts
|
|
3613
3619
|
var import_mini16 = require("zod/mini");
|
|
@@ -3911,22 +3917,34 @@ function canonicalToToolHooks({
|
|
|
3911
3917
|
`matcher "${matcherKey}" on "${eventName}" hook will be ignored \u2014 this event does not support matchers`
|
|
3912
3918
|
);
|
|
3913
3919
|
}
|
|
3914
|
-
const hooks =
|
|
3920
|
+
const hooks = [];
|
|
3921
|
+
for (const def of defs) {
|
|
3922
|
+
const hookType = def.type ?? "command";
|
|
3923
|
+
if (converterConfig.supportedHookTypes && !converterConfig.supportedHookTypes.has(hookType)) {
|
|
3924
|
+
continue;
|
|
3925
|
+
}
|
|
3915
3926
|
const commandText = def.command;
|
|
3916
3927
|
const trimmedCommand = typeof commandText === "string" ? commandText.trimStart() : void 0;
|
|
3917
|
-
const shouldPrefix = typeof trimmedCommand === "string" && !trimmedCommand.startsWith("$") && (!converterConfig.prefixDotRelativeCommandsOnly || trimmedCommand.startsWith("."));
|
|
3928
|
+
const shouldPrefix = converterConfig.projectDirVar !== "" && typeof trimmedCommand === "string" && !trimmedCommand.startsWith("$") && (!converterConfig.prefixDotRelativeCommandsOnly || trimmedCommand.startsWith("."));
|
|
3918
3929
|
const command = shouldPrefix && typeof trimmedCommand === "string" ? `${converterConfig.projectDirVar}/${trimmedCommand.replace(/^\.\//, "")}` : def.command;
|
|
3919
|
-
|
|
3920
|
-
type:
|
|
3930
|
+
hooks.push({
|
|
3931
|
+
type: hookType,
|
|
3921
3932
|
...command !== void 0 && command !== null && { command },
|
|
3922
3933
|
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
|
|
3923
|
-
...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
|
|
3924
|
-
|
|
3925
|
-
|
|
3934
|
+
...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt },
|
|
3935
|
+
...converterConfig.passthroughFields?.includes("name") && def.name !== void 0 && def.name !== null && { name: def.name },
|
|
3936
|
+
...converterConfig.passthroughFields?.includes("description") && def.description !== void 0 && def.description !== null && { description: def.description }
|
|
3937
|
+
});
|
|
3938
|
+
}
|
|
3939
|
+
if (hooks.length === 0) {
|
|
3940
|
+
continue;
|
|
3941
|
+
}
|
|
3926
3942
|
const includeMatcher = matcherKey && !isNoMatcherEvent;
|
|
3927
3943
|
entries.push(includeMatcher ? { matcher: matcherKey, hooks } : { hooks });
|
|
3928
3944
|
}
|
|
3929
|
-
|
|
3945
|
+
if (entries.length > 0) {
|
|
3946
|
+
result[toolEventName] = entries;
|
|
3947
|
+
}
|
|
3930
3948
|
}
|
|
3931
3949
|
return result;
|
|
3932
3950
|
}
|
|
@@ -3947,7 +3965,7 @@ function toolHooksToCanonical({
|
|
|
3947
3965
|
const hookDefs = rawEntry.hooks ?? [];
|
|
3948
3966
|
for (const h of hookDefs) {
|
|
3949
3967
|
const cmd = typeof h.command === "string" ? h.command : void 0;
|
|
3950
|
-
const command = typeof cmd === "string" && cmd.includes(`${converterConfig.projectDirVar}/`) ? cmd.replace(
|
|
3968
|
+
const command = converterConfig.projectDirVar !== "" && typeof cmd === "string" && cmd.includes(`${converterConfig.projectDirVar}/`) ? cmd.replace(
|
|
3951
3969
|
new RegExp(
|
|
3952
3970
|
`^${converterConfig.projectDirVar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\/?`
|
|
3953
3971
|
),
|
|
@@ -3961,6 +3979,8 @@ function toolHooksToCanonical({
|
|
|
3961
3979
|
...command !== void 0 && command !== null && { command },
|
|
3962
3980
|
...timeout !== void 0 && timeout !== null && { timeout },
|
|
3963
3981
|
...prompt !== void 0 && prompt !== null && { prompt },
|
|
3982
|
+
...converterConfig.passthroughFields?.includes("name") && typeof h.name === "string" && { name: h.name },
|
|
3983
|
+
...converterConfig.passthroughFields?.includes("description") && typeof h.description === "string" && { description: h.description },
|
|
3964
3984
|
...rawEntry.matcher !== void 0 && rawEntry.matcher !== null && rawEntry.matcher !== "" && { matcher: rawEntry.matcher }
|
|
3965
3985
|
});
|
|
3966
3986
|
}
|
|
@@ -4059,6 +4079,9 @@ var ToolHooks = class extends ToolFile {
|
|
|
4059
4079
|
static forDeletion(_params) {
|
|
4060
4080
|
throw new Error("Please implement this method in the subclass.");
|
|
4061
4081
|
}
|
|
4082
|
+
static async getAuxiliaryFiles(_params) {
|
|
4083
|
+
return [];
|
|
4084
|
+
}
|
|
4062
4085
|
};
|
|
4063
4086
|
|
|
4064
4087
|
// src/features/hooks/claudecode-hooks.ts
|
|
@@ -4180,89 +4203,28 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
4180
4203
|
// src/features/hooks/codexcli-hooks.ts
|
|
4181
4204
|
var import_node_path26 = require("path");
|
|
4182
4205
|
var smolToml2 = __toESM(require("smol-toml"), 1);
|
|
4183
|
-
var
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
}
|
|
4192
|
-
const effectiveHooks = {
|
|
4193
|
-
...sharedHooks,
|
|
4194
|
-
...config.codexcli?.hooks
|
|
4195
|
-
};
|
|
4196
|
-
const codex = {};
|
|
4197
|
-
for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
|
|
4198
|
-
const codexEventName = CANONICAL_TO_CODEXCLI_EVENT_NAMES[eventName] ?? eventName;
|
|
4199
|
-
const byMatcher = /* @__PURE__ */ new Map();
|
|
4200
|
-
for (const def of definitions) {
|
|
4201
|
-
const key = def.matcher ?? "";
|
|
4202
|
-
const list = byMatcher.get(key);
|
|
4203
|
-
if (list) list.push(def);
|
|
4204
|
-
else byMatcher.set(key, [def]);
|
|
4205
|
-
}
|
|
4206
|
-
const entries = [];
|
|
4207
|
-
for (const [matcherKey, defs] of byMatcher) {
|
|
4208
|
-
const commandDefs = defs.filter((def) => !def.type || def.type === "command");
|
|
4209
|
-
if (commandDefs.length === 0) continue;
|
|
4210
|
-
const hooks = commandDefs.map((def) => ({
|
|
4211
|
-
type: "command",
|
|
4212
|
-
...def.command !== void 0 && def.command !== null && { command: def.command },
|
|
4213
|
-
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout }
|
|
4214
|
-
}));
|
|
4215
|
-
entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
|
|
4216
|
-
}
|
|
4217
|
-
if (entries.length > 0) {
|
|
4218
|
-
codex[codexEventName] = entries;
|
|
4219
|
-
}
|
|
4220
|
-
}
|
|
4221
|
-
return codex;
|
|
4222
|
-
}
|
|
4223
|
-
var CodexHookEntrySchema = import_mini17.z.looseObject({
|
|
4224
|
-
type: import_mini17.z.optional(import_mini17.z.string()),
|
|
4225
|
-
command: import_mini17.z.optional(import_mini17.z.string()),
|
|
4226
|
-
timeout: import_mini17.z.optional(import_mini17.z.number())
|
|
4227
|
-
});
|
|
4228
|
-
var CodexMatcherEntrySchema = import_mini17.z.looseObject({
|
|
4229
|
-
matcher: import_mini17.z.optional(import_mini17.z.string()),
|
|
4230
|
-
hooks: import_mini17.z.optional(import_mini17.z.array(CodexHookEntrySchema))
|
|
4231
|
-
});
|
|
4232
|
-
function codexcliHooksToCanonical(codexHooks) {
|
|
4233
|
-
if (codexHooks === null || codexHooks === void 0 || typeof codexHooks !== "object") {
|
|
4234
|
-
return {};
|
|
4235
|
-
}
|
|
4236
|
-
const canonical = {};
|
|
4237
|
-
for (const [codexEventName, matcherEntries] of Object.entries(codexHooks)) {
|
|
4238
|
-
const eventName = CODEXCLI_TO_CANONICAL_EVENT_NAMES[codexEventName] ?? codexEventName;
|
|
4239
|
-
if (!Array.isArray(matcherEntries)) continue;
|
|
4240
|
-
const defs = [];
|
|
4241
|
-
for (const rawEntry of matcherEntries) {
|
|
4242
|
-
const parseResult = CodexMatcherEntrySchema.safeParse(rawEntry);
|
|
4243
|
-
if (!parseResult.success) continue;
|
|
4244
|
-
const entry = parseResult.data;
|
|
4245
|
-
const hooks = entry.hooks ?? [];
|
|
4246
|
-
for (const h of hooks) {
|
|
4247
|
-
const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
|
|
4248
|
-
defs.push({
|
|
4249
|
-
type: hookType,
|
|
4250
|
-
...h.command !== void 0 && h.command !== null && { command: h.command },
|
|
4251
|
-
...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
|
|
4252
|
-
...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
|
|
4253
|
-
});
|
|
4254
|
-
}
|
|
4255
|
-
}
|
|
4256
|
-
if (defs.length > 0) {
|
|
4257
|
-
canonical[eventName] = defs;
|
|
4258
|
-
}
|
|
4259
|
-
}
|
|
4260
|
-
return canonical;
|
|
4261
|
-
}
|
|
4206
|
+
var CODEXCLI_CONVERTER_CONFIG = {
|
|
4207
|
+
supportedEvents: CODEXCLI_HOOK_EVENTS,
|
|
4208
|
+
canonicalToToolEventNames: CANONICAL_TO_CODEXCLI_EVENT_NAMES,
|
|
4209
|
+
toolToCanonicalEventNames: CODEXCLI_TO_CANONICAL_EVENT_NAMES,
|
|
4210
|
+
projectDirVar: "",
|
|
4211
|
+
supportedHookTypes: /* @__PURE__ */ new Set(["command"]),
|
|
4212
|
+
passthroughFields: ["name", "description"]
|
|
4213
|
+
};
|
|
4262
4214
|
async function buildCodexConfigTomlContent({ baseDir }) {
|
|
4263
4215
|
const configPath = (0, import_node_path26.join)(baseDir, ".codex", "config.toml");
|
|
4264
4216
|
const existingContent = await readFileContentOrNull(configPath) ?? smolToml2.stringify({});
|
|
4265
|
-
|
|
4217
|
+
let configToml;
|
|
4218
|
+
try {
|
|
4219
|
+
configToml = smolToml2.parse(existingContent);
|
|
4220
|
+
} catch (error) {
|
|
4221
|
+
throw new Error(
|
|
4222
|
+
`Failed to parse existing Codex CLI config at ${configPath}: ${formatError(error)}`,
|
|
4223
|
+
{
|
|
4224
|
+
cause: error
|
|
4225
|
+
}
|
|
4226
|
+
);
|
|
4227
|
+
}
|
|
4266
4228
|
if (typeof configToml.features !== "object" || configToml.features === null) {
|
|
4267
4229
|
configToml.features = {};
|
|
4268
4230
|
}
|
|
@@ -4317,7 +4279,11 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4317
4279
|
}) {
|
|
4318
4280
|
const paths = _CodexcliHooks.getSettablePaths({ global });
|
|
4319
4281
|
const config = rulesyncHooks.getJson();
|
|
4320
|
-
const codexHooks =
|
|
4282
|
+
const codexHooks = canonicalToToolHooks({
|
|
4283
|
+
config,
|
|
4284
|
+
toolOverrideHooks: config.codexcli?.hooks,
|
|
4285
|
+
converterConfig: CODEXCLI_CONVERTER_CONFIG
|
|
4286
|
+
});
|
|
4321
4287
|
const fileContent = JSON.stringify({ hooks: codexHooks }, null, 2);
|
|
4322
4288
|
return new _CodexcliHooks({
|
|
4323
4289
|
baseDir,
|
|
@@ -4339,7 +4305,10 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4339
4305
|
}
|
|
4340
4306
|
);
|
|
4341
4307
|
}
|
|
4342
|
-
const hooks =
|
|
4308
|
+
const hooks = toolHooksToCanonical({
|
|
4309
|
+
hooks: parsed.hooks,
|
|
4310
|
+
converterConfig: CODEXCLI_CONVERTER_CONFIG
|
|
4311
|
+
});
|
|
4343
4312
|
return this.toRulesyncHooksDefault({
|
|
4344
4313
|
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
4345
4314
|
});
|
|
@@ -4360,16 +4329,21 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4360
4329
|
validate: false
|
|
4361
4330
|
});
|
|
4362
4331
|
}
|
|
4332
|
+
static async getAuxiliaryFiles({
|
|
4333
|
+
baseDir = process.cwd()
|
|
4334
|
+
} = {}) {
|
|
4335
|
+
return [await CodexcliConfigToml.fromBaseDir({ baseDir })];
|
|
4336
|
+
}
|
|
4363
4337
|
};
|
|
4364
4338
|
|
|
4365
4339
|
// src/features/hooks/copilot-hooks.ts
|
|
4366
4340
|
var import_node_path27 = require("path");
|
|
4367
|
-
var
|
|
4368
|
-
var CopilotHookEntrySchema =
|
|
4369
|
-
type:
|
|
4370
|
-
bash:
|
|
4371
|
-
powershell:
|
|
4372
|
-
timeoutSec:
|
|
4341
|
+
var import_mini17 = require("zod/mini");
|
|
4342
|
+
var CopilotHookEntrySchema = import_mini17.z.looseObject({
|
|
4343
|
+
type: import_mini17.z.string(),
|
|
4344
|
+
bash: import_mini17.z.optional(import_mini17.z.string()),
|
|
4345
|
+
powershell: import_mini17.z.optional(import_mini17.z.string()),
|
|
4346
|
+
timeoutSec: import_mini17.z.optional(import_mini17.z.number())
|
|
4373
4347
|
});
|
|
4374
4348
|
function canonicalToCopilotHooks(config) {
|
|
4375
4349
|
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
@@ -4900,7 +4874,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4900
4874
|
|
|
4901
4875
|
// src/features/hooks/geminicli-hooks.ts
|
|
4902
4876
|
var import_node_path31 = require("path");
|
|
4903
|
-
var
|
|
4877
|
+
var import_mini18 = require("zod/mini");
|
|
4904
4878
|
function canonicalToGeminicliHooks(config) {
|
|
4905
4879
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
4906
4880
|
const sharedHooks = {};
|
|
@@ -4944,16 +4918,16 @@ function canonicalToGeminicliHooks(config) {
|
|
|
4944
4918
|
}
|
|
4945
4919
|
return gemini;
|
|
4946
4920
|
}
|
|
4947
|
-
var GeminiHookEntrySchema =
|
|
4948
|
-
type:
|
|
4949
|
-
command:
|
|
4950
|
-
timeout:
|
|
4951
|
-
name:
|
|
4952
|
-
description:
|
|
4921
|
+
var GeminiHookEntrySchema = import_mini18.z.looseObject({
|
|
4922
|
+
type: import_mini18.z.optional(import_mini18.z.string()),
|
|
4923
|
+
command: import_mini18.z.optional(import_mini18.z.string()),
|
|
4924
|
+
timeout: import_mini18.z.optional(import_mini18.z.number()),
|
|
4925
|
+
name: import_mini18.z.optional(import_mini18.z.string()),
|
|
4926
|
+
description: import_mini18.z.optional(import_mini18.z.string())
|
|
4953
4927
|
});
|
|
4954
|
-
var GeminiMatcherEntrySchema =
|
|
4955
|
-
matcher:
|
|
4956
|
-
hooks:
|
|
4928
|
+
var GeminiMatcherEntrySchema = import_mini18.z.looseObject({
|
|
4929
|
+
matcher: import_mini18.z.optional(import_mini18.z.string()),
|
|
4930
|
+
hooks: import_mini18.z.optional(import_mini18.z.array(GeminiHookEntrySchema))
|
|
4957
4931
|
});
|
|
4958
4932
|
function geminiHooksToCanonical(geminiHooks) {
|
|
4959
4933
|
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
@@ -5337,7 +5311,7 @@ var hooksProcessorToolTargetTuple = [
|
|
|
5337
5311
|
"geminicli",
|
|
5338
5312
|
"deepagents"
|
|
5339
5313
|
];
|
|
5340
|
-
var HooksProcessorToolTargetSchema =
|
|
5314
|
+
var HooksProcessorToolTargetSchema = import_mini19.z.enum(hooksProcessorToolTargetTuple);
|
|
5341
5315
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
5342
5316
|
[
|
|
5343
5317
|
"cursor",
|
|
@@ -5596,8 +5570,12 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5596
5570
|
global: this.global
|
|
5597
5571
|
});
|
|
5598
5572
|
const result = [toolHooks];
|
|
5599
|
-
|
|
5600
|
-
|
|
5573
|
+
const auxiliaryFiles = await factory.class.getAuxiliaryFiles?.({
|
|
5574
|
+
baseDir: this.baseDir,
|
|
5575
|
+
global: this.global
|
|
5576
|
+
});
|
|
5577
|
+
if (auxiliaryFiles && auxiliaryFiles.length > 0) {
|
|
5578
|
+
result.push(...auxiliaryFiles);
|
|
5601
5579
|
}
|
|
5602
5580
|
return result;
|
|
5603
5581
|
}
|
|
@@ -5617,7 +5595,7 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5617
5595
|
};
|
|
5618
5596
|
|
|
5619
5597
|
// src/features/ignore/ignore-processor.ts
|
|
5620
|
-
var
|
|
5598
|
+
var import_mini21 = require("zod/mini");
|
|
5621
5599
|
|
|
5622
5600
|
// src/features/ignore/augmentcode-ignore.ts
|
|
5623
5601
|
var import_node_path35 = require("path");
|
|
@@ -5796,12 +5774,12 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
5796
5774
|
// src/features/ignore/claudecode-ignore.ts
|
|
5797
5775
|
var import_node_path36 = require("path");
|
|
5798
5776
|
var import_es_toolkit2 = require("es-toolkit");
|
|
5799
|
-
var
|
|
5777
|
+
var import_mini20 = require("zod/mini");
|
|
5800
5778
|
var SHARED_SETTINGS_FILE = "settings.json";
|
|
5801
5779
|
var LOCAL_SETTINGS_FILE = "settings.local.json";
|
|
5802
5780
|
var DEFAULT_FILE_MODE = "shared";
|
|
5803
|
-
var ClaudecodeIgnoreOptionsSchema =
|
|
5804
|
-
fileMode:
|
|
5781
|
+
var ClaudecodeIgnoreOptionsSchema = import_mini20.z.looseObject({
|
|
5782
|
+
fileMode: import_mini20.z.optional(import_mini20.z.enum(["shared", "local"]))
|
|
5805
5783
|
});
|
|
5806
5784
|
var resolveFileMode = (options) => {
|
|
5807
5785
|
if (!options) return DEFAULT_FILE_MODE;
|
|
@@ -6645,7 +6623,7 @@ var ignoreProcessorToolTargets = [
|
|
|
6645
6623
|
"windsurf",
|
|
6646
6624
|
"zed"
|
|
6647
6625
|
];
|
|
6648
|
-
var IgnoreProcessorToolTargetSchema =
|
|
6626
|
+
var IgnoreProcessorToolTargetSchema = import_mini21.z.enum(ignoreProcessorToolTargets);
|
|
6649
6627
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
6650
6628
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
6651
6629
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -6788,7 +6766,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
6788
6766
|
};
|
|
6789
6767
|
|
|
6790
6768
|
// src/features/mcp/mcp-processor.ts
|
|
6791
|
-
var
|
|
6769
|
+
var import_mini26 = require("zod/mini");
|
|
6792
6770
|
|
|
6793
6771
|
// src/features/mcp/claudecode-mcp.ts
|
|
6794
6772
|
var import_node_path49 = require("path");
|
|
@@ -6796,47 +6774,47 @@ var import_node_path49 = require("path");
|
|
|
6796
6774
|
// src/features/mcp/rulesync-mcp.ts
|
|
6797
6775
|
var import_node_path48 = require("path");
|
|
6798
6776
|
var import_object = require("es-toolkit/object");
|
|
6799
|
-
var
|
|
6777
|
+
var import_mini23 = require("zod/mini");
|
|
6800
6778
|
|
|
6801
6779
|
// src/types/mcp.ts
|
|
6802
|
-
var
|
|
6803
|
-
var McpServerSchema =
|
|
6804
|
-
type:
|
|
6805
|
-
command:
|
|
6806
|
-
args:
|
|
6807
|
-
url:
|
|
6808
|
-
httpUrl:
|
|
6809
|
-
env:
|
|
6810
|
-
disabled:
|
|
6811
|
-
networkTimeout:
|
|
6812
|
-
timeout:
|
|
6813
|
-
trust:
|
|
6814
|
-
cwd:
|
|
6815
|
-
transport:
|
|
6816
|
-
alwaysAllow:
|
|
6817
|
-
tools:
|
|
6818
|
-
kiroAutoApprove:
|
|
6819
|
-
kiroAutoBlock:
|
|
6820
|
-
headers:
|
|
6821
|
-
enabledTools:
|
|
6822
|
-
disabledTools:
|
|
6780
|
+
var import_mini22 = require("zod/mini");
|
|
6781
|
+
var McpServerSchema = import_mini22.z.looseObject({
|
|
6782
|
+
type: import_mini22.z.optional(import_mini22.z.enum(["local", "stdio", "sse", "http"])),
|
|
6783
|
+
command: import_mini22.z.optional(import_mini22.z.union([import_mini22.z.string(), import_mini22.z.array(import_mini22.z.string())])),
|
|
6784
|
+
args: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6785
|
+
url: import_mini22.z.optional(import_mini22.z.string()),
|
|
6786
|
+
httpUrl: import_mini22.z.optional(import_mini22.z.string()),
|
|
6787
|
+
env: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
|
|
6788
|
+
disabled: import_mini22.z.optional(import_mini22.z.boolean()),
|
|
6789
|
+
networkTimeout: import_mini22.z.optional(import_mini22.z.number()),
|
|
6790
|
+
timeout: import_mini22.z.optional(import_mini22.z.number()),
|
|
6791
|
+
trust: import_mini22.z.optional(import_mini22.z.boolean()),
|
|
6792
|
+
cwd: import_mini22.z.optional(import_mini22.z.string()),
|
|
6793
|
+
transport: import_mini22.z.optional(import_mini22.z.enum(["local", "stdio", "sse", "http"])),
|
|
6794
|
+
alwaysAllow: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6795
|
+
tools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6796
|
+
kiroAutoApprove: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6797
|
+
kiroAutoBlock: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6798
|
+
headers: import_mini22.z.optional(import_mini22.z.record(import_mini22.z.string(), import_mini22.z.string())),
|
|
6799
|
+
enabledTools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string())),
|
|
6800
|
+
disabledTools: import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
|
|
6823
6801
|
});
|
|
6824
|
-
var McpServersSchema =
|
|
6802
|
+
var McpServersSchema = import_mini22.z.record(import_mini22.z.string(), McpServerSchema);
|
|
6825
6803
|
function isMcpServers(value) {
|
|
6826
6804
|
return value !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6827
6805
|
}
|
|
6828
6806
|
|
|
6829
6807
|
// src/features/mcp/rulesync-mcp.ts
|
|
6830
|
-
var RulesyncMcpServerSchema =
|
|
6831
|
-
targets:
|
|
6832
|
-
description:
|
|
6833
|
-
exposed:
|
|
6808
|
+
var RulesyncMcpServerSchema = import_mini23.z.extend(McpServerSchema, {
|
|
6809
|
+
targets: import_mini23.z.optional(RulesyncTargetsSchema),
|
|
6810
|
+
description: import_mini23.z.optional(import_mini23.z.string()),
|
|
6811
|
+
exposed: import_mini23.z.optional(import_mini23.z.boolean())
|
|
6834
6812
|
});
|
|
6835
|
-
var RulesyncMcpConfigSchema =
|
|
6836
|
-
mcpServers:
|
|
6813
|
+
var RulesyncMcpConfigSchema = import_mini23.z.object({
|
|
6814
|
+
mcpServers: import_mini23.z.record(import_mini23.z.string(), RulesyncMcpServerSchema)
|
|
6837
6815
|
});
|
|
6838
|
-
var RulesyncMcpFileSchema =
|
|
6839
|
-
$schema:
|
|
6816
|
+
var RulesyncMcpFileSchema = import_mini23.z.looseObject({
|
|
6817
|
+
$schema: import_mini23.z.optional(import_mini23.z.string()),
|
|
6840
6818
|
...RulesyncMcpConfigSchema.shape
|
|
6841
6819
|
});
|
|
6842
6820
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
@@ -8039,25 +8017,25 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
8039
8017
|
// src/features/mcp/kilo-mcp.ts
|
|
8040
8018
|
var import_node_path59 = require("path");
|
|
8041
8019
|
var import_jsonc_parser3 = require("jsonc-parser");
|
|
8042
|
-
var
|
|
8043
|
-
var KiloMcpLocalServerSchema =
|
|
8044
|
-
type:
|
|
8045
|
-
command:
|
|
8046
|
-
environment:
|
|
8047
|
-
enabled:
|
|
8048
|
-
cwd:
|
|
8020
|
+
var import_mini24 = require("zod/mini");
|
|
8021
|
+
var KiloMcpLocalServerSchema = import_mini24.z.object({
|
|
8022
|
+
type: import_mini24.z.literal("local"),
|
|
8023
|
+
command: import_mini24.z.array(import_mini24.z.string()),
|
|
8024
|
+
environment: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
|
|
8025
|
+
enabled: import_mini24.z._default(import_mini24.z.boolean(), true),
|
|
8026
|
+
cwd: import_mini24.z.optional(import_mini24.z.string())
|
|
8049
8027
|
});
|
|
8050
|
-
var KiloMcpRemoteServerSchema =
|
|
8051
|
-
type:
|
|
8052
|
-
url:
|
|
8053
|
-
headers:
|
|
8054
|
-
enabled:
|
|
8028
|
+
var KiloMcpRemoteServerSchema = import_mini24.z.object({
|
|
8029
|
+
type: import_mini24.z.literal("remote"),
|
|
8030
|
+
url: import_mini24.z.string(),
|
|
8031
|
+
headers: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.string())),
|
|
8032
|
+
enabled: import_mini24.z._default(import_mini24.z.boolean(), true)
|
|
8055
8033
|
});
|
|
8056
|
-
var KiloMcpServerSchema =
|
|
8057
|
-
var KiloConfigSchema =
|
|
8058
|
-
$schema:
|
|
8059
|
-
mcp:
|
|
8060
|
-
tools:
|
|
8034
|
+
var KiloMcpServerSchema = import_mini24.z.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
|
|
8035
|
+
var KiloConfigSchema = import_mini24.z.looseObject({
|
|
8036
|
+
$schema: import_mini24.z.optional(import_mini24.z.string()),
|
|
8037
|
+
mcp: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), KiloMcpServerSchema)),
|
|
8038
|
+
tools: import_mini24.z.optional(import_mini24.z.record(import_mini24.z.string(), import_mini24.z.boolean()))
|
|
8061
8039
|
});
|
|
8062
8040
|
function convertFromKiloFormat(kiloMcp, tools) {
|
|
8063
8041
|
return Object.fromEntries(
|
|
@@ -8354,28 +8332,28 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
8354
8332
|
// src/features/mcp/opencode-mcp.ts
|
|
8355
8333
|
var import_node_path61 = require("path");
|
|
8356
8334
|
var import_jsonc_parser4 = require("jsonc-parser");
|
|
8357
|
-
var
|
|
8358
|
-
var OpencodeMcpLocalServerSchema =
|
|
8359
|
-
type:
|
|
8360
|
-
command:
|
|
8361
|
-
environment:
|
|
8362
|
-
enabled:
|
|
8363
|
-
cwd:
|
|
8335
|
+
var import_mini25 = require("zod/mini");
|
|
8336
|
+
var OpencodeMcpLocalServerSchema = import_mini25.z.object({
|
|
8337
|
+
type: import_mini25.z.literal("local"),
|
|
8338
|
+
command: import_mini25.z.array(import_mini25.z.string()),
|
|
8339
|
+
environment: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.string())),
|
|
8340
|
+
enabled: import_mini25.z._default(import_mini25.z.boolean(), true),
|
|
8341
|
+
cwd: import_mini25.z.optional(import_mini25.z.string())
|
|
8364
8342
|
});
|
|
8365
|
-
var OpencodeMcpRemoteServerSchema =
|
|
8366
|
-
type:
|
|
8367
|
-
url:
|
|
8368
|
-
headers:
|
|
8369
|
-
enabled:
|
|
8343
|
+
var OpencodeMcpRemoteServerSchema = import_mini25.z.object({
|
|
8344
|
+
type: import_mini25.z.literal("remote"),
|
|
8345
|
+
url: import_mini25.z.string(),
|
|
8346
|
+
headers: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.string())),
|
|
8347
|
+
enabled: import_mini25.z._default(import_mini25.z.boolean(), true)
|
|
8370
8348
|
});
|
|
8371
|
-
var OpencodeMcpServerSchema =
|
|
8349
|
+
var OpencodeMcpServerSchema = import_mini25.z.union([
|
|
8372
8350
|
OpencodeMcpLocalServerSchema,
|
|
8373
8351
|
OpencodeMcpRemoteServerSchema
|
|
8374
8352
|
]);
|
|
8375
|
-
var OpencodeConfigSchema =
|
|
8376
|
-
$schema:
|
|
8377
|
-
mcp:
|
|
8378
|
-
tools:
|
|
8353
|
+
var OpencodeConfigSchema = import_mini25.z.looseObject({
|
|
8354
|
+
$schema: import_mini25.z.optional(import_mini25.z.string()),
|
|
8355
|
+
mcp: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), OpencodeMcpServerSchema)),
|
|
8356
|
+
tools: import_mini25.z.optional(import_mini25.z.record(import_mini25.z.string(), import_mini25.z.boolean()))
|
|
8379
8357
|
});
|
|
8380
8358
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
8381
8359
|
return Object.fromEntries(
|
|
@@ -8846,7 +8824,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
8846
8824
|
"roo",
|
|
8847
8825
|
"rovodev"
|
|
8848
8826
|
];
|
|
8849
|
-
var McpProcessorToolTargetSchema =
|
|
8827
|
+
var McpProcessorToolTargetSchema = import_mini26.z.enum(mcpProcessorToolTargetTuple);
|
|
8850
8828
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
8851
8829
|
[
|
|
8852
8830
|
"claudecode",
|
|
@@ -9185,7 +9163,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
9185
9163
|
};
|
|
9186
9164
|
|
|
9187
9165
|
// src/features/permissions/permissions-processor.ts
|
|
9188
|
-
var
|
|
9166
|
+
var import_mini31 = require("zod/mini");
|
|
9189
9167
|
|
|
9190
9168
|
// src/features/permissions/claudecode-permissions.ts
|
|
9191
9169
|
var import_node_path65 = require("path");
|
|
@@ -9195,14 +9173,14 @@ var import_es_toolkit4 = require("es-toolkit");
|
|
|
9195
9173
|
var import_node_path64 = require("path");
|
|
9196
9174
|
|
|
9197
9175
|
// src/types/permissions.ts
|
|
9198
|
-
var
|
|
9199
|
-
var PermissionActionSchema =
|
|
9200
|
-
var PermissionRulesSchema =
|
|
9201
|
-
var PermissionsConfigSchema =
|
|
9202
|
-
permission:
|
|
9176
|
+
var import_mini27 = require("zod/mini");
|
|
9177
|
+
var PermissionActionSchema = import_mini27.z.enum(["allow", "ask", "deny"]);
|
|
9178
|
+
var PermissionRulesSchema = import_mini27.z.record(import_mini27.z.string(), PermissionActionSchema);
|
|
9179
|
+
var PermissionsConfigSchema = import_mini27.z.looseObject({
|
|
9180
|
+
permission: import_mini27.z.record(import_mini27.z.string(), PermissionRulesSchema)
|
|
9203
9181
|
});
|
|
9204
|
-
var RulesyncPermissionsFileSchema =
|
|
9205
|
-
$schema:
|
|
9182
|
+
var RulesyncPermissionsFileSchema = import_mini27.z.looseObject({
|
|
9183
|
+
$schema: import_mini27.z.optional(import_mini27.z.string()),
|
|
9206
9184
|
...PermissionsConfigSchema.shape
|
|
9207
9185
|
});
|
|
9208
9186
|
|
|
@@ -9771,15 +9749,78 @@ function mapBashActionToDecision(action) {
|
|
|
9771
9749
|
|
|
9772
9750
|
// src/features/permissions/geminicli-permissions.ts
|
|
9773
9751
|
var import_node_path67 = require("path");
|
|
9774
|
-
var
|
|
9775
|
-
var
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
)
|
|
9782
|
-
|
|
9752
|
+
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
9753
|
+
var import_mini28 = require("zod/mini");
|
|
9754
|
+
|
|
9755
|
+
// src/utils/logger.ts
|
|
9756
|
+
var BaseLogger = class {
|
|
9757
|
+
_verbose = false;
|
|
9758
|
+
_silent = false;
|
|
9759
|
+
constructor({ verbose = false, silent = false } = {}) {
|
|
9760
|
+
this._silent = silent;
|
|
9761
|
+
this._verbose = verbose && !silent;
|
|
9762
|
+
}
|
|
9763
|
+
get verbose() {
|
|
9764
|
+
return this._verbose;
|
|
9765
|
+
}
|
|
9766
|
+
get silent() {
|
|
9767
|
+
return this._silent;
|
|
9768
|
+
}
|
|
9769
|
+
configure({ verbose, silent }) {
|
|
9770
|
+
if (verbose && silent) {
|
|
9771
|
+
this._silent = false;
|
|
9772
|
+
if (!isEnvTest()) {
|
|
9773
|
+
this.onConflictingFlags();
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
this._silent = silent;
|
|
9777
|
+
this._verbose = verbose && !silent;
|
|
9778
|
+
}
|
|
9779
|
+
onConflictingFlags() {
|
|
9780
|
+
console.warn("Both --verbose and --silent specified; --silent takes precedence");
|
|
9781
|
+
}
|
|
9782
|
+
};
|
|
9783
|
+
var ConsoleLogger = class extends BaseLogger {
|
|
9784
|
+
isSuppressed() {
|
|
9785
|
+
return isEnvTest() || this._silent;
|
|
9786
|
+
}
|
|
9787
|
+
get jsonMode() {
|
|
9788
|
+
return false;
|
|
9789
|
+
}
|
|
9790
|
+
captureData(_key, _value) {
|
|
9791
|
+
}
|
|
9792
|
+
getJsonData() {
|
|
9793
|
+
return {};
|
|
9794
|
+
}
|
|
9795
|
+
outputJson(_success, _error) {
|
|
9796
|
+
}
|
|
9797
|
+
info(message, ...args) {
|
|
9798
|
+
if (this.isSuppressed()) return;
|
|
9799
|
+
console.log(message, ...args);
|
|
9800
|
+
}
|
|
9801
|
+
success(message, ...args) {
|
|
9802
|
+
if (this.isSuppressed()) return;
|
|
9803
|
+
console.log(message, ...args);
|
|
9804
|
+
}
|
|
9805
|
+
warn(message, ...args) {
|
|
9806
|
+
if (this.isSuppressed()) return;
|
|
9807
|
+
console.warn(message, ...args);
|
|
9808
|
+
}
|
|
9809
|
+
// Errors are always emitted, even in silent mode
|
|
9810
|
+
error(message, _code, ...args) {
|
|
9811
|
+
if (isEnvTest()) return;
|
|
9812
|
+
const errorMessage = message instanceof Error ? message.message : message;
|
|
9813
|
+
console.error(errorMessage, ...args);
|
|
9814
|
+
}
|
|
9815
|
+
debug(message, ...args) {
|
|
9816
|
+
if (!this._verbose || this.isSuppressed()) return;
|
|
9817
|
+
console.log(message, ...args);
|
|
9818
|
+
}
|
|
9819
|
+
};
|
|
9820
|
+
|
|
9821
|
+
// src/features/permissions/geminicli-permissions.ts
|
|
9822
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = (0, import_node_path67.join)(".gemini", "policies");
|
|
9823
|
+
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
9783
9824
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
9784
9825
|
bash: "run_shell_command",
|
|
9785
9826
|
read: "read_file",
|
|
@@ -9787,16 +9828,32 @@ var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
|
9787
9828
|
write: "write_file",
|
|
9788
9829
|
webfetch: "web_fetch"
|
|
9789
9830
|
};
|
|
9831
|
+
var GEMINICLI_TO_RULESYNC_TOOL_NAME = Object.fromEntries(
|
|
9832
|
+
Object.entries(RULESYNC_TO_GEMINICLI_TOOL_NAME).map(([k, v]) => [v, k])
|
|
9833
|
+
);
|
|
9834
|
+
var PRIORITY_DENY = 1e6;
|
|
9835
|
+
var PRIORITY_ASK = 1e3;
|
|
9836
|
+
var PRIORITY_ALLOW = 1;
|
|
9837
|
+
var SINGLE_STAR_REGEX = '[^/\\"]*';
|
|
9838
|
+
var DOUBLE_STAR_REGEX = '[^\\"]*';
|
|
9839
|
+
var SINGLE_CHAR_REGEX = '[^/\\"]';
|
|
9840
|
+
var LEGACY_SINGLE_STAR_REGEX = '[^\\"]*';
|
|
9841
|
+
var LEGACY_DOUBLE_STAR_REGEX = ".*";
|
|
9842
|
+
var COMMAND_ARGS_ANCHOR = '"command":"';
|
|
9843
|
+
var VALUE_END_ANCHOR = '\\"';
|
|
9844
|
+
var RESERVED_OBJECT_KEYS = /* @__PURE__ */ new Set([
|
|
9845
|
+
"__proto__",
|
|
9846
|
+
"constructor",
|
|
9847
|
+
"prototype"
|
|
9848
|
+
]);
|
|
9849
|
+
var moduleLogger = new ConsoleLogger();
|
|
9790
9850
|
var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
9791
9851
|
static getSettablePaths(_options = {}) {
|
|
9792
9852
|
return {
|
|
9793
|
-
relativeDirPath:
|
|
9794
|
-
relativeFilePath:
|
|
9853
|
+
relativeDirPath: GEMINICLI_POLICY_RELATIVE_DIR_PATH,
|
|
9854
|
+
relativeFilePath: GEMINICLI_POLICY_FILE_NAME
|
|
9795
9855
|
};
|
|
9796
9856
|
}
|
|
9797
|
-
isDeletable() {
|
|
9798
|
-
return false;
|
|
9799
|
-
}
|
|
9800
9857
|
static async fromFile({
|
|
9801
9858
|
baseDir = process.cwd(),
|
|
9802
9859
|
validate = true,
|
|
@@ -9804,7 +9861,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
9804
9861
|
}) {
|
|
9805
9862
|
const paths = this.getSettablePaths({ global });
|
|
9806
9863
|
const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9807
|
-
const fileContent = await readFileContentOrNull(filePath) ??
|
|
9864
|
+
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
9808
9865
|
return new _GeminicliPermissions({
|
|
9809
9866
|
baseDir,
|
|
9810
9867
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -9813,63 +9870,72 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
9813
9870
|
validate
|
|
9814
9871
|
});
|
|
9815
9872
|
}
|
|
9816
|
-
static
|
|
9873
|
+
static fromRulesyncPermissions({
|
|
9817
9874
|
baseDir = process.cwd(),
|
|
9818
9875
|
rulesyncPermissions,
|
|
9819
9876
|
validate = true,
|
|
9820
|
-
|
|
9821
|
-
|
|
9877
|
+
global = false,
|
|
9878
|
+
logger = moduleLogger
|
|
9822
9879
|
}) {
|
|
9823
9880
|
const paths = this.getSettablePaths({ global });
|
|
9824
|
-
const
|
|
9825
|
-
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9826
|
-
const settingsResult = GeminiCliSettingsSchema.safeParse(JSON.parse(existingContent));
|
|
9827
|
-
if (!settingsResult.success) {
|
|
9828
|
-
throw new Error(
|
|
9829
|
-
`Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(settingsResult.error)}`
|
|
9830
|
-
);
|
|
9831
|
-
}
|
|
9832
|
-
const { allowed, exclude } = convertRulesyncToGeminicliTools({
|
|
9833
|
-
config: rulesyncPermissions.getJson(),
|
|
9834
|
-
logger
|
|
9835
|
-
});
|
|
9836
|
-
const merged = {
|
|
9837
|
-
...settingsResult.data,
|
|
9838
|
-
tools: {
|
|
9839
|
-
...settingsResult.data.tools,
|
|
9840
|
-
...allowed.length > 0 ? { allowed } : {},
|
|
9841
|
-
...exclude.length > 0 ? { exclude } : {}
|
|
9842
|
-
}
|
|
9843
|
-
};
|
|
9881
|
+
const fileContent = buildGeminicliPolicyContent(rulesyncPermissions.getJson(), logger);
|
|
9844
9882
|
return new _GeminicliPermissions({
|
|
9845
9883
|
baseDir,
|
|
9846
9884
|
relativeDirPath: paths.relativeDirPath,
|
|
9847
9885
|
relativeFilePath: paths.relativeFilePath,
|
|
9848
|
-
fileContent
|
|
9886
|
+
fileContent,
|
|
9849
9887
|
validate
|
|
9850
9888
|
});
|
|
9851
9889
|
}
|
|
9852
9890
|
toRulesyncPermissions() {
|
|
9853
|
-
let settings;
|
|
9854
|
-
try {
|
|
9855
|
-
const parsed = JSON.parse(this.getFileContent());
|
|
9856
|
-
settings = GeminiCliSettingsSchema.parse(parsed);
|
|
9857
|
-
} catch (error) {
|
|
9858
|
-
throw new Error(
|
|
9859
|
-
`Failed to parse Gemini CLI permissions content in ${(0, import_node_path67.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9860
|
-
{ cause: error }
|
|
9861
|
-
);
|
|
9862
|
-
}
|
|
9863
9891
|
const permission = {};
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9892
|
+
const fileContent = this.getFileContent();
|
|
9893
|
+
if (fileContent.trim().length > 0) {
|
|
9894
|
+
let parsed;
|
|
9895
|
+
try {
|
|
9896
|
+
parsed = smolToml5.parse(fileContent);
|
|
9897
|
+
} catch (error) {
|
|
9898
|
+
throw new Error(
|
|
9899
|
+
`Failed to parse Gemini CLI policy TOML in ${(0, import_node_path67.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9900
|
+
{ cause: error }
|
|
9901
|
+
);
|
|
9902
|
+
}
|
|
9903
|
+
const rules = extractRules(parsed, moduleLogger);
|
|
9904
|
+
for (const [index, rule] of rules.entries()) {
|
|
9905
|
+
const mappedCategory = Object.hasOwn(GEMINICLI_TO_RULESYNC_TOOL_NAME, rule.toolName) ? GEMINICLI_TO_RULESYNC_TOOL_NAME[rule.toolName] : void 0;
|
|
9906
|
+
const category = mappedCategory ?? rule.toolName;
|
|
9907
|
+
if (RESERVED_OBJECT_KEYS.has(category)) {
|
|
9908
|
+
moduleLogger.warn(
|
|
9909
|
+
`Skipping rule #${index} in ${this.getRelativeFilePath()}: toolName "${rule.toolName}" maps to a reserved object key ("${category}") and would risk prototype pollution.`
|
|
9910
|
+
);
|
|
9911
|
+
continue;
|
|
9912
|
+
}
|
|
9913
|
+
const action = mapFromGeminicliDecision(rule.decision);
|
|
9914
|
+
if (!action) {
|
|
9915
|
+
moduleLogger.warn(
|
|
9916
|
+
`Skipping rule #${index} (toolName="${rule.toolName}", commandPrefix=${JSON.stringify(rule.commandPrefix)}, argsPattern=${JSON.stringify(rule.argsPattern)}) in ${this.getRelativeFilePath()}: unknown decision ${JSON.stringify(rule.decision)}`
|
|
9917
|
+
);
|
|
9918
|
+
continue;
|
|
9919
|
+
}
|
|
9920
|
+
if (rule.toolName === "run_shell_command" && rule.commandPrefix !== void 0 && rule.argsPattern !== void 0) {
|
|
9921
|
+
moduleLogger.warn(
|
|
9922
|
+
`Rule #${index} in ${this.getRelativeFilePath()} sets both commandPrefix and argsPattern; rulesync will honor argsPattern and ignore commandPrefix=${JSON.stringify(rule.commandPrefix)}.`
|
|
9923
|
+
);
|
|
9924
|
+
}
|
|
9925
|
+
const pattern = extractPattern(rule);
|
|
9926
|
+
if (RESERVED_OBJECT_KEYS.has(pattern)) {
|
|
9927
|
+
moduleLogger.warn(
|
|
9928
|
+
`Skipping rule #${index} in ${this.getRelativeFilePath()}: pattern "${pattern}" is a reserved object key.`
|
|
9929
|
+
);
|
|
9930
|
+
continue;
|
|
9931
|
+
}
|
|
9932
|
+
const existing = Object.hasOwn(permission, category) ? permission[category] : void 0;
|
|
9933
|
+
const target = existing ?? {};
|
|
9934
|
+
if (existing === void 0) {
|
|
9935
|
+
permission[category] = target;
|
|
9936
|
+
}
|
|
9937
|
+
target[pattern] = action;
|
|
9938
|
+
}
|
|
9873
9939
|
}
|
|
9874
9940
|
return this.toRulesyncPermissionsDefault({
|
|
9875
9941
|
fileContent: JSON.stringify({ permission }, null, 2)
|
|
@@ -9887,60 +9953,248 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
9887
9953
|
baseDir,
|
|
9888
9954
|
relativeDirPath,
|
|
9889
9955
|
relativeFilePath,
|
|
9890
|
-
fileContent:
|
|
9956
|
+
fileContent: "",
|
|
9891
9957
|
validate: false
|
|
9892
9958
|
});
|
|
9893
9959
|
}
|
|
9894
9960
|
};
|
|
9895
|
-
function
|
|
9896
|
-
|
|
9961
|
+
function buildGeminicliPolicyContent(config, logger) {
|
|
9962
|
+
const rules = [];
|
|
9963
|
+
let order = 0;
|
|
9964
|
+
for (const [toolName, entries] of Object.entries(config.permission)) {
|
|
9965
|
+
const mappedToolName = RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName] ?? toolName;
|
|
9966
|
+
for (const [pattern, action] of Object.entries(entries)) {
|
|
9967
|
+
if (pattern === "") {
|
|
9968
|
+
logger.warn(
|
|
9969
|
+
`Skipping rule "${toolName}: "": empty pattern is not a valid permission target and would silently match every invocation (bash) or nothing (other tools).`
|
|
9970
|
+
);
|
|
9971
|
+
continue;
|
|
9972
|
+
}
|
|
9973
|
+
if (hasUnsafeAnchorChar(pattern)) {
|
|
9974
|
+
logger.warn(
|
|
9975
|
+
`Skipping rule "${toolName}: ${pattern}": pattern contains a character (" or \\) that would break JSON-anchor matching in the Gemini CLI Policy Engine.`
|
|
9976
|
+
);
|
|
9977
|
+
continue;
|
|
9978
|
+
}
|
|
9979
|
+
const decision = mapToGeminicliDecision(action);
|
|
9980
|
+
if (mappedToolName === "run_shell_command" && (pattern === "*" || pattern === "**") && decision !== "ask_user") {
|
|
9981
|
+
logger.warn(
|
|
9982
|
+
`Skipping rule "${toolName}: ${pattern}" with decision ${decision}: bash match-all patterns are only supported with "ask" because they would otherwise affect every shell command.`
|
|
9983
|
+
);
|
|
9984
|
+
continue;
|
|
9985
|
+
}
|
|
9986
|
+
const currentRule = {
|
|
9987
|
+
toolName: mappedToolName,
|
|
9988
|
+
decision,
|
|
9989
|
+
priority: priorityForDecision(decision)
|
|
9990
|
+
};
|
|
9991
|
+
if (mappedToolName === "run_shell_command") {
|
|
9992
|
+
applyShellPattern({ rule: currentRule, pattern, toolName, logger });
|
|
9993
|
+
} else if (pattern !== "*") {
|
|
9994
|
+
currentRule.argsPattern = buildNonShellArgsPattern(pattern);
|
|
9995
|
+
}
|
|
9996
|
+
rules.push({ rule: currentRule, order: order++ });
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
rules.sort((a, b) => {
|
|
10000
|
+
const diff = toNumber(b.rule.priority) - toNumber(a.rule.priority);
|
|
10001
|
+
return diff !== 0 ? diff : a.order - b.order;
|
|
10002
|
+
});
|
|
10003
|
+
return smolToml5.stringify({ rule: rules.map((entry) => entry.rule) });
|
|
10004
|
+
}
|
|
10005
|
+
function buildNonShellArgsPattern(pattern) {
|
|
10006
|
+
return `"${globPatternToRegex(pattern)}${VALUE_END_ANCHOR}`;
|
|
10007
|
+
}
|
|
10008
|
+
function hasUnsafeAnchorChar(pattern) {
|
|
10009
|
+
return pattern.includes('"') || pattern.includes("\\");
|
|
10010
|
+
}
|
|
10011
|
+
function toNumber(value) {
|
|
10012
|
+
return typeof value === "number" ? value : 0;
|
|
10013
|
+
}
|
|
10014
|
+
function applyShellPattern({
|
|
10015
|
+
rule,
|
|
10016
|
+
pattern,
|
|
10017
|
+
toolName,
|
|
9897
10018
|
logger
|
|
9898
10019
|
}) {
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
10020
|
+
if (pattern === "*") {
|
|
10021
|
+
return;
|
|
10022
|
+
}
|
|
10023
|
+
const trailingWildcardStripped = pattern.endsWith(" *") ? pattern.slice(0, -2) : pattern;
|
|
10024
|
+
if (hasGlobMetacharacter(trailingWildcardStripped)) {
|
|
10025
|
+
rule.argsPattern = `${COMMAND_ARGS_ANCHOR}${globPatternToRegex(pattern)}`;
|
|
10026
|
+
logger.warn(
|
|
10027
|
+
`Gemini CLI does not support glob metacharacters inside a bash command prefix; emitting argsPattern for rule "${toolName}: ${pattern}".`
|
|
10028
|
+
);
|
|
10029
|
+
return;
|
|
10030
|
+
}
|
|
10031
|
+
rule.commandPrefix = trailingWildcardStripped;
|
|
10032
|
+
}
|
|
10033
|
+
function hasGlobMetacharacter(pattern) {
|
|
10034
|
+
return /[*?[\]]/.test(pattern);
|
|
10035
|
+
}
|
|
10036
|
+
function priorityForDecision(decision) {
|
|
10037
|
+
if (decision === "deny") return PRIORITY_DENY;
|
|
10038
|
+
if (decision === "ask_user") return PRIORITY_ASK;
|
|
10039
|
+
return PRIORITY_ALLOW;
|
|
10040
|
+
}
|
|
10041
|
+
function mapToGeminicliDecision(action) {
|
|
10042
|
+
if (action === "ask") {
|
|
10043
|
+
return "ask_user";
|
|
10044
|
+
}
|
|
10045
|
+
return action;
|
|
10046
|
+
}
|
|
10047
|
+
function mapFromGeminicliDecision(decision) {
|
|
10048
|
+
if (decision === "allow") return "allow";
|
|
10049
|
+
if (decision === "deny") return "deny";
|
|
10050
|
+
if (decision === "ask_user") return "ask";
|
|
10051
|
+
return null;
|
|
10052
|
+
}
|
|
10053
|
+
function globPatternToRegex(pattern) {
|
|
10054
|
+
let regex = "";
|
|
10055
|
+
let i = 0;
|
|
10056
|
+
while (i < pattern.length) {
|
|
10057
|
+
const char = pattern[i];
|
|
10058
|
+
if (char === void 0) {
|
|
10059
|
+
break;
|
|
10060
|
+
}
|
|
10061
|
+
if (char === "*" && pattern[i + 1] === "*") {
|
|
10062
|
+
regex += DOUBLE_STAR_REGEX;
|
|
10063
|
+
i += 2;
|
|
10064
|
+
continue;
|
|
10065
|
+
}
|
|
10066
|
+
if (char === "*") {
|
|
10067
|
+
regex += SINGLE_STAR_REGEX;
|
|
10068
|
+
i += 1;
|
|
10069
|
+
continue;
|
|
10070
|
+
}
|
|
10071
|
+
if (char === "?") {
|
|
10072
|
+
regex += SINGLE_CHAR_REGEX;
|
|
10073
|
+
i += 1;
|
|
10074
|
+
continue;
|
|
10075
|
+
}
|
|
10076
|
+
if (char === "[") {
|
|
10077
|
+
regex += escapeRegexChar(char);
|
|
10078
|
+
i += 1;
|
|
10079
|
+
continue;
|
|
10080
|
+
}
|
|
10081
|
+
if (char === "]") {
|
|
10082
|
+
regex += escapeRegexChar(char);
|
|
10083
|
+
i += 1;
|
|
10084
|
+
continue;
|
|
10085
|
+
}
|
|
10086
|
+
if (isRegexMetacharacter(char)) {
|
|
10087
|
+
regex += `\\${char}`;
|
|
10088
|
+
i += 1;
|
|
10089
|
+
continue;
|
|
10090
|
+
}
|
|
10091
|
+
regex += char;
|
|
10092
|
+
i += 1;
|
|
10093
|
+
}
|
|
10094
|
+
return regex;
|
|
10095
|
+
}
|
|
10096
|
+
function escapeRegexChar(char) {
|
|
10097
|
+
return `\\${char}`;
|
|
10098
|
+
}
|
|
10099
|
+
function isRegexMetacharacter(char) {
|
|
10100
|
+
return /[.+^${}()|\\]/.test(char);
|
|
10101
|
+
}
|
|
10102
|
+
function regexToGlobPattern(regex) {
|
|
10103
|
+
let source = regex;
|
|
10104
|
+
if (source.endsWith(VALUE_END_ANCHOR)) {
|
|
10105
|
+
source = source.slice(0, -VALUE_END_ANCHOR.length);
|
|
10106
|
+
}
|
|
10107
|
+
let glob = "";
|
|
10108
|
+
let i = 0;
|
|
10109
|
+
while (i < source.length) {
|
|
10110
|
+
if (source.startsWith(DOUBLE_STAR_REGEX, i)) {
|
|
10111
|
+
glob += "**";
|
|
10112
|
+
i += DOUBLE_STAR_REGEX.length;
|
|
10113
|
+
continue;
|
|
10114
|
+
}
|
|
10115
|
+
if (source.startsWith(LEGACY_DOUBLE_STAR_REGEX, i)) {
|
|
10116
|
+
glob += "**";
|
|
10117
|
+
i += LEGACY_DOUBLE_STAR_REGEX.length;
|
|
10118
|
+
continue;
|
|
10119
|
+
}
|
|
10120
|
+
if (source.startsWith(SINGLE_STAR_REGEX, i)) {
|
|
10121
|
+
glob += "*";
|
|
10122
|
+
i += SINGLE_STAR_REGEX.length;
|
|
10123
|
+
continue;
|
|
10124
|
+
}
|
|
10125
|
+
if (source.startsWith(LEGACY_SINGLE_STAR_REGEX, i)) {
|
|
10126
|
+
glob += "*";
|
|
10127
|
+
i += LEGACY_SINGLE_STAR_REGEX.length;
|
|
10128
|
+
continue;
|
|
10129
|
+
}
|
|
10130
|
+
if (source.startsWith(SINGLE_CHAR_REGEX, i)) {
|
|
10131
|
+
glob += "?";
|
|
10132
|
+
i += SINGLE_CHAR_REGEX.length;
|
|
10133
|
+
continue;
|
|
9905
10134
|
}
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
10135
|
+
const char = source[i];
|
|
10136
|
+
if (char === "\\") {
|
|
10137
|
+
const escaped = source[i + 1];
|
|
10138
|
+
if (escaped !== void 0) {
|
|
10139
|
+
glob += escaped;
|
|
10140
|
+
i += 2;
|
|
9911
10141
|
continue;
|
|
9912
10142
|
}
|
|
9913
|
-
const geminiEntry = pattern === "*" ? mappedToolName : `${mappedToolName}(${pattern})`;
|
|
9914
|
-
if (action === "allow") {
|
|
9915
|
-
allowed.push(geminiEntry);
|
|
9916
|
-
} else {
|
|
9917
|
-
exclude.push(geminiEntry);
|
|
9918
|
-
}
|
|
9919
10143
|
}
|
|
10144
|
+
glob += char ?? "";
|
|
10145
|
+
i += 1;
|
|
9920
10146
|
}
|
|
9921
|
-
return
|
|
10147
|
+
return glob;
|
|
9922
10148
|
}
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
10149
|
+
var GeminicliPolicyRuleSchema = import_mini28.z.looseObject({
|
|
10150
|
+
toolName: import_mini28.z.string(),
|
|
10151
|
+
decision: import_mini28.z.optional(import_mini28.z.unknown()),
|
|
10152
|
+
commandPrefix: import_mini28.z.optional(import_mini28.z.string()),
|
|
10153
|
+
argsPattern: import_mini28.z.optional(import_mini28.z.string())
|
|
10154
|
+
});
|
|
10155
|
+
var GeminicliPolicyFileSchema = import_mini28.z.looseObject({
|
|
10156
|
+
rule: import_mini28.z.optional(import_mini28.z.array(import_mini28.z.looseObject({})))
|
|
10157
|
+
});
|
|
10158
|
+
function extractRules(parsed, logger) {
|
|
10159
|
+
const parsedFile = GeminicliPolicyFileSchema.safeParse(parsed);
|
|
10160
|
+
if (!parsedFile.success || !parsedFile.data.rule) {
|
|
10161
|
+
return [];
|
|
10162
|
+
}
|
|
10163
|
+
const rules = [];
|
|
10164
|
+
for (const [index, entry] of parsedFile.data.rule.entries()) {
|
|
10165
|
+
const result = GeminicliPolicyRuleSchema.safeParse(entry);
|
|
10166
|
+
if (result.success) {
|
|
10167
|
+
rules.push(result.data);
|
|
10168
|
+
continue;
|
|
10169
|
+
}
|
|
10170
|
+
logger.warn(
|
|
10171
|
+
`Skipping malformed Gemini CLI policy rule at index ${index}: ${formatError(result.error)}`
|
|
10172
|
+
);
|
|
10173
|
+
}
|
|
10174
|
+
return rules;
|
|
10175
|
+
}
|
|
10176
|
+
function extractPattern(rule) {
|
|
10177
|
+
if (rule.toolName === "run_shell_command") {
|
|
10178
|
+
if (rule.argsPattern) {
|
|
10179
|
+
const stripped = rule.argsPattern.startsWith(COMMAND_ARGS_ANCHOR) ? rule.argsPattern.slice(COMMAND_ARGS_ANCHOR.length) : rule.argsPattern;
|
|
10180
|
+
return regexToGlobPattern(stripped);
|
|
10181
|
+
}
|
|
10182
|
+
if (!rule.commandPrefix) return "*";
|
|
10183
|
+
return rule.commandPrefix.endsWith(" *") || rule.commandPrefix.endsWith("*") ? rule.commandPrefix : `${rule.commandPrefix} *`;
|
|
10184
|
+
}
|
|
10185
|
+
if (!rule.argsPattern) return "*";
|
|
10186
|
+
const regex = rule.argsPattern.startsWith('"') ? rule.argsPattern.slice(1) : rule.argsPattern;
|
|
10187
|
+
return regexToGlobPattern(regex);
|
|
9934
10188
|
}
|
|
9935
10189
|
|
|
9936
10190
|
// src/features/permissions/kiro-permissions.ts
|
|
9937
10191
|
var import_node_path68 = require("path");
|
|
9938
|
-
var
|
|
9939
|
-
var KiroAgentSchema =
|
|
9940
|
-
allowedTools:
|
|
9941
|
-
toolsSettings:
|
|
10192
|
+
var import_mini29 = require("zod/mini");
|
|
10193
|
+
var KiroAgentSchema = import_mini29.z.looseObject({
|
|
10194
|
+
allowedTools: import_mini29.z.optional(import_mini29.z.array(import_mini29.z.string())),
|
|
10195
|
+
toolsSettings: import_mini29.z.optional(import_mini29.z.record(import_mini29.z.string(), import_mini29.z.unknown()))
|
|
9942
10196
|
});
|
|
9943
|
-
var UnknownRecordSchema =
|
|
10197
|
+
var UnknownRecordSchema = import_mini29.z.record(import_mini29.z.string(), import_mini29.z.unknown());
|
|
9944
10198
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
9945
10199
|
static getSettablePaths(_options = {}) {
|
|
9946
10200
|
return {
|
|
@@ -10093,8 +10347,12 @@ function buildKiroPermissionsFromRulesync({
|
|
|
10093
10347
|
);
|
|
10094
10348
|
continue;
|
|
10095
10349
|
}
|
|
10096
|
-
|
|
10097
|
-
|
|
10350
|
+
const toolName = category === "webfetch" ? "web_fetch" : "web_search";
|
|
10351
|
+
if (action === "allow") {
|
|
10352
|
+
nextAllowedTools.add(toolName);
|
|
10353
|
+
} else {
|
|
10354
|
+
nextAllowedTools.delete(toolName);
|
|
10355
|
+
}
|
|
10098
10356
|
} else {
|
|
10099
10357
|
logger?.warn(`Kiro permissions do not support category: ${category}. Skipping.`);
|
|
10100
10358
|
}
|
|
@@ -10120,13 +10378,13 @@ function asStringArray(value) {
|
|
|
10120
10378
|
// src/features/permissions/opencode-permissions.ts
|
|
10121
10379
|
var import_node_path69 = require("path");
|
|
10122
10380
|
var import_jsonc_parser5 = require("jsonc-parser");
|
|
10123
|
-
var
|
|
10124
|
-
var OpencodePermissionSchema =
|
|
10125
|
-
|
|
10126
|
-
|
|
10381
|
+
var import_mini30 = require("zod/mini");
|
|
10382
|
+
var OpencodePermissionSchema = import_mini30.z.union([
|
|
10383
|
+
import_mini30.z.enum(["allow", "ask", "deny"]),
|
|
10384
|
+
import_mini30.z.record(import_mini30.z.string(), import_mini30.z.enum(["allow", "ask", "deny"]))
|
|
10127
10385
|
]);
|
|
10128
|
-
var OpencodePermissionsConfigSchema =
|
|
10129
|
-
permission:
|
|
10386
|
+
var OpencodePermissionsConfigSchema = import_mini30.z.looseObject({
|
|
10387
|
+
permission: import_mini30.z.optional(import_mini30.z.record(import_mini30.z.string(), OpencodePermissionSchema))
|
|
10130
10388
|
});
|
|
10131
10389
|
var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
10132
10390
|
json;
|
|
@@ -10257,7 +10515,7 @@ var permissionsProcessorToolTargetTuple = [
|
|
|
10257
10515
|
"kiro",
|
|
10258
10516
|
"opencode"
|
|
10259
10517
|
];
|
|
10260
|
-
var PermissionsProcessorToolTargetSchema =
|
|
10518
|
+
var PermissionsProcessorToolTargetSchema = import_mini31.z.enum(permissionsProcessorToolTargetTuple);
|
|
10261
10519
|
var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
10262
10520
|
[
|
|
10263
10521
|
"claudecode",
|
|
@@ -10422,7 +10680,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10422
10680
|
// src/features/rules/rules-processor.ts
|
|
10423
10681
|
var import_node_path140 = require("path");
|
|
10424
10682
|
var import_toon = require("@toon-format/toon");
|
|
10425
|
-
var
|
|
10683
|
+
var import_mini71 = require("zod/mini");
|
|
10426
10684
|
|
|
10427
10685
|
// src/constants/general.ts
|
|
10428
10686
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -10432,7 +10690,7 @@ var import_node_path73 = require("path");
|
|
|
10432
10690
|
|
|
10433
10691
|
// src/features/skills/simulated-skill.ts
|
|
10434
10692
|
var import_node_path72 = require("path");
|
|
10435
|
-
var
|
|
10693
|
+
var import_mini32 = require("zod/mini");
|
|
10436
10694
|
|
|
10437
10695
|
// src/features/skills/tool-skill.ts
|
|
10438
10696
|
var import_node_path71 = require("path");
|
|
@@ -10669,9 +10927,9 @@ var ToolSkill = class extends AiDir {
|
|
|
10669
10927
|
};
|
|
10670
10928
|
|
|
10671
10929
|
// src/features/skills/simulated-skill.ts
|
|
10672
|
-
var SimulatedSkillFrontmatterSchema =
|
|
10673
|
-
name:
|
|
10674
|
-
description:
|
|
10930
|
+
var SimulatedSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
10931
|
+
name: import_mini32.z.string(),
|
|
10932
|
+
description: import_mini32.z.string()
|
|
10675
10933
|
});
|
|
10676
10934
|
var SimulatedSkill = class extends ToolSkill {
|
|
10677
10935
|
frontmatter;
|
|
@@ -10898,49 +11156,49 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
10898
11156
|
|
|
10899
11157
|
// src/features/skills/rovodev-skill.ts
|
|
10900
11158
|
var import_node_path76 = require("path");
|
|
10901
|
-
var
|
|
11159
|
+
var import_mini34 = require("zod/mini");
|
|
10902
11160
|
|
|
10903
11161
|
// src/features/skills/rulesync-skill.ts
|
|
10904
11162
|
var import_node_path75 = require("path");
|
|
10905
|
-
var
|
|
10906
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
10907
|
-
name:
|
|
10908
|
-
description:
|
|
10909
|
-
targets:
|
|
10910
|
-
claudecode:
|
|
10911
|
-
|
|
10912
|
-
"allowed-tools":
|
|
10913
|
-
model:
|
|
10914
|
-
"disable-model-invocation":
|
|
11163
|
+
var import_mini33 = require("zod/mini");
|
|
11164
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini33.z.looseObject({
|
|
11165
|
+
name: import_mini33.z.string(),
|
|
11166
|
+
description: import_mini33.z.string(),
|
|
11167
|
+
targets: import_mini33.z._default(RulesyncTargetsSchema, ["*"]),
|
|
11168
|
+
claudecode: import_mini33.z.optional(
|
|
11169
|
+
import_mini33.z.looseObject({
|
|
11170
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string())),
|
|
11171
|
+
model: import_mini33.z.optional(import_mini33.z.string()),
|
|
11172
|
+
"disable-model-invocation": import_mini33.z.optional(import_mini33.z.boolean())
|
|
10915
11173
|
})
|
|
10916
11174
|
),
|
|
10917
|
-
codexcli:
|
|
10918
|
-
|
|
10919
|
-
"short-description":
|
|
11175
|
+
codexcli: import_mini33.z.optional(
|
|
11176
|
+
import_mini33.z.looseObject({
|
|
11177
|
+
"short-description": import_mini33.z.optional(import_mini33.z.string())
|
|
10920
11178
|
})
|
|
10921
11179
|
),
|
|
10922
|
-
opencode:
|
|
10923
|
-
|
|
10924
|
-
"allowed-tools":
|
|
11180
|
+
opencode: import_mini33.z.optional(
|
|
11181
|
+
import_mini33.z.looseObject({
|
|
11182
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10925
11183
|
})
|
|
10926
11184
|
),
|
|
10927
|
-
kilo:
|
|
10928
|
-
|
|
10929
|
-
"allowed-tools":
|
|
11185
|
+
kilo: import_mini33.z.optional(
|
|
11186
|
+
import_mini33.z.looseObject({
|
|
11187
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10930
11188
|
})
|
|
10931
11189
|
),
|
|
10932
|
-
deepagents:
|
|
10933
|
-
|
|
10934
|
-
"allowed-tools":
|
|
11190
|
+
deepagents: import_mini33.z.optional(
|
|
11191
|
+
import_mini33.z.looseObject({
|
|
11192
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10935
11193
|
})
|
|
10936
11194
|
),
|
|
10937
|
-
copilot:
|
|
10938
|
-
|
|
10939
|
-
license:
|
|
11195
|
+
copilot: import_mini33.z.optional(
|
|
11196
|
+
import_mini33.z.looseObject({
|
|
11197
|
+
license: import_mini33.z.optional(import_mini33.z.string())
|
|
10940
11198
|
})
|
|
10941
11199
|
),
|
|
10942
|
-
cline:
|
|
10943
|
-
roo:
|
|
11200
|
+
cline: import_mini33.z.optional(import_mini33.z.looseObject({})),
|
|
11201
|
+
roo: import_mini33.z.optional(import_mini33.z.looseObject({}))
|
|
10944
11202
|
});
|
|
10945
11203
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
10946
11204
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -11037,9 +11295,9 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
11037
11295
|
};
|
|
11038
11296
|
|
|
11039
11297
|
// src/features/skills/rovodev-skill.ts
|
|
11040
|
-
var RovodevSkillFrontmatterSchema =
|
|
11041
|
-
name:
|
|
11042
|
-
description:
|
|
11298
|
+
var RovodevSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
11299
|
+
name: import_mini34.z.string(),
|
|
11300
|
+
description: import_mini34.z.string()
|
|
11043
11301
|
});
|
|
11044
11302
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
11045
11303
|
constructor({
|
|
@@ -11211,7 +11469,7 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11211
11469
|
|
|
11212
11470
|
// src/features/skills/skills-processor.ts
|
|
11213
11471
|
var import_node_path95 = require("path");
|
|
11214
|
-
var
|
|
11472
|
+
var import_mini51 = require("zod/mini");
|
|
11215
11473
|
|
|
11216
11474
|
// src/types/dir-feature-processor.ts
|
|
11217
11475
|
var import_node_path77 = require("path");
|
|
@@ -11350,10 +11608,10 @@ var DirFeatureProcessor = class {
|
|
|
11350
11608
|
|
|
11351
11609
|
// src/features/skills/agentsskills-skill.ts
|
|
11352
11610
|
var import_node_path78 = require("path");
|
|
11353
|
-
var
|
|
11354
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
11355
|
-
name:
|
|
11356
|
-
description:
|
|
11611
|
+
var import_mini35 = require("zod/mini");
|
|
11612
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
11613
|
+
name: import_mini35.z.string(),
|
|
11614
|
+
description: import_mini35.z.string()
|
|
11357
11615
|
});
|
|
11358
11616
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
11359
11617
|
constructor({
|
|
@@ -11508,10 +11766,10 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11508
11766
|
|
|
11509
11767
|
// src/features/skills/antigravity-skill.ts
|
|
11510
11768
|
var import_node_path79 = require("path");
|
|
11511
|
-
var
|
|
11512
|
-
var AntigravitySkillFrontmatterSchema =
|
|
11513
|
-
name:
|
|
11514
|
-
description:
|
|
11769
|
+
var import_mini36 = require("zod/mini");
|
|
11770
|
+
var AntigravitySkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
11771
|
+
name: import_mini36.z.string(),
|
|
11772
|
+
description: import_mini36.z.string()
|
|
11515
11773
|
});
|
|
11516
11774
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
11517
11775
|
constructor({
|
|
@@ -11669,13 +11927,13 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11669
11927
|
|
|
11670
11928
|
// src/features/skills/claudecode-skill.ts
|
|
11671
11929
|
var import_node_path80 = require("path");
|
|
11672
|
-
var
|
|
11673
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
11674
|
-
name:
|
|
11675
|
-
description:
|
|
11676
|
-
"allowed-tools":
|
|
11677
|
-
model:
|
|
11678
|
-
"disable-model-invocation":
|
|
11930
|
+
var import_mini37 = require("zod/mini");
|
|
11931
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
11932
|
+
name: import_mini37.z.string(),
|
|
11933
|
+
description: import_mini37.z.string(),
|
|
11934
|
+
"allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string())),
|
|
11935
|
+
model: import_mini37.z.optional(import_mini37.z.string()),
|
|
11936
|
+
"disable-model-invocation": import_mini37.z.optional(import_mini37.z.boolean())
|
|
11679
11937
|
});
|
|
11680
11938
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
11681
11939
|
constructor({
|
|
@@ -11845,10 +12103,10 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
11845
12103
|
|
|
11846
12104
|
// src/features/skills/cline-skill.ts
|
|
11847
12105
|
var import_node_path81 = require("path");
|
|
11848
|
-
var
|
|
11849
|
-
var ClineSkillFrontmatterSchema =
|
|
11850
|
-
name:
|
|
11851
|
-
description:
|
|
12106
|
+
var import_mini38 = require("zod/mini");
|
|
12107
|
+
var ClineSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
12108
|
+
name: import_mini38.z.string(),
|
|
12109
|
+
description: import_mini38.z.string()
|
|
11852
12110
|
});
|
|
11853
12111
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
11854
12112
|
constructor({
|
|
@@ -12018,13 +12276,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
12018
12276
|
|
|
12019
12277
|
// src/features/skills/codexcli-skill.ts
|
|
12020
12278
|
var import_node_path82 = require("path");
|
|
12021
|
-
var
|
|
12022
|
-
var CodexCliSkillFrontmatterSchema =
|
|
12023
|
-
name:
|
|
12024
|
-
description:
|
|
12025
|
-
metadata:
|
|
12026
|
-
|
|
12027
|
-
"short-description":
|
|
12279
|
+
var import_mini39 = require("zod/mini");
|
|
12280
|
+
var CodexCliSkillFrontmatterSchema = import_mini39.z.looseObject({
|
|
12281
|
+
name: import_mini39.z.string(),
|
|
12282
|
+
description: import_mini39.z.string(),
|
|
12283
|
+
metadata: import_mini39.z.optional(
|
|
12284
|
+
import_mini39.z.looseObject({
|
|
12285
|
+
"short-description": import_mini39.z.optional(import_mini39.z.string())
|
|
12028
12286
|
})
|
|
12029
12287
|
)
|
|
12030
12288
|
});
|
|
@@ -12189,11 +12447,11 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
12189
12447
|
|
|
12190
12448
|
// src/features/skills/copilot-skill.ts
|
|
12191
12449
|
var import_node_path83 = require("path");
|
|
12192
|
-
var
|
|
12193
|
-
var CopilotSkillFrontmatterSchema =
|
|
12194
|
-
name:
|
|
12195
|
-
description:
|
|
12196
|
-
license:
|
|
12450
|
+
var import_mini40 = require("zod/mini");
|
|
12451
|
+
var CopilotSkillFrontmatterSchema = import_mini40.z.looseObject({
|
|
12452
|
+
name: import_mini40.z.string(),
|
|
12453
|
+
description: import_mini40.z.string(),
|
|
12454
|
+
license: import_mini40.z.optional(import_mini40.z.string())
|
|
12197
12455
|
});
|
|
12198
12456
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
12199
12457
|
constructor({
|
|
@@ -12354,10 +12612,10 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12354
12612
|
|
|
12355
12613
|
// src/features/skills/cursor-skill.ts
|
|
12356
12614
|
var import_node_path84 = require("path");
|
|
12357
|
-
var
|
|
12358
|
-
var CursorSkillFrontmatterSchema =
|
|
12359
|
-
name:
|
|
12360
|
-
description:
|
|
12615
|
+
var import_mini41 = require("zod/mini");
|
|
12616
|
+
var CursorSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
12617
|
+
name: import_mini41.z.string(),
|
|
12618
|
+
description: import_mini41.z.string()
|
|
12361
12619
|
});
|
|
12362
12620
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
12363
12621
|
constructor({
|
|
@@ -12509,11 +12767,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12509
12767
|
|
|
12510
12768
|
// src/features/skills/deepagents-skill.ts
|
|
12511
12769
|
var import_node_path85 = require("path");
|
|
12512
|
-
var
|
|
12513
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
12514
|
-
name:
|
|
12515
|
-
description:
|
|
12516
|
-
"allowed-tools":
|
|
12770
|
+
var import_mini42 = require("zod/mini");
|
|
12771
|
+
var DeepagentsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
12772
|
+
name: import_mini42.z.string(),
|
|
12773
|
+
description: import_mini42.z.string(),
|
|
12774
|
+
"allowed-tools": import_mini42.z.optional(import_mini42.z.array(import_mini42.z.string()))
|
|
12517
12775
|
});
|
|
12518
12776
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
12519
12777
|
constructor({
|
|
@@ -12671,10 +12929,10 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12671
12929
|
|
|
12672
12930
|
// src/features/skills/geminicli-skill.ts
|
|
12673
12931
|
var import_node_path86 = require("path");
|
|
12674
|
-
var
|
|
12675
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
12676
|
-
name:
|
|
12677
|
-
description:
|
|
12932
|
+
var import_mini43 = require("zod/mini");
|
|
12933
|
+
var GeminiCliSkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
12934
|
+
name: import_mini43.z.string(),
|
|
12935
|
+
description: import_mini43.z.string()
|
|
12678
12936
|
});
|
|
12679
12937
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
12680
12938
|
constructor({
|
|
@@ -12828,10 +13086,10 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
12828
13086
|
|
|
12829
13087
|
// src/features/skills/junie-skill.ts
|
|
12830
13088
|
var import_node_path87 = require("path");
|
|
12831
|
-
var
|
|
12832
|
-
var JunieSkillFrontmatterSchema =
|
|
12833
|
-
name:
|
|
12834
|
-
description:
|
|
13089
|
+
var import_mini44 = require("zod/mini");
|
|
13090
|
+
var JunieSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
13091
|
+
name: import_mini44.z.string(),
|
|
13092
|
+
description: import_mini44.z.string()
|
|
12835
13093
|
});
|
|
12836
13094
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
12837
13095
|
constructor({
|
|
@@ -13004,11 +13262,11 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
13004
13262
|
|
|
13005
13263
|
// src/features/skills/kilo-skill.ts
|
|
13006
13264
|
var import_node_path88 = require("path");
|
|
13007
|
-
var
|
|
13008
|
-
var KiloSkillFrontmatterSchema =
|
|
13009
|
-
name:
|
|
13010
|
-
description:
|
|
13011
|
-
"allowed-tools":
|
|
13265
|
+
var import_mini45 = require("zod/mini");
|
|
13266
|
+
var KiloSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
13267
|
+
name: import_mini45.z.string(),
|
|
13268
|
+
description: import_mini45.z.string(),
|
|
13269
|
+
"allowed-tools": import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
|
|
13012
13270
|
});
|
|
13013
13271
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
13014
13272
|
constructor({
|
|
@@ -13165,10 +13423,10 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
13165
13423
|
|
|
13166
13424
|
// src/features/skills/kiro-skill.ts
|
|
13167
13425
|
var import_node_path89 = require("path");
|
|
13168
|
-
var
|
|
13169
|
-
var KiroSkillFrontmatterSchema =
|
|
13170
|
-
name:
|
|
13171
|
-
description:
|
|
13426
|
+
var import_mini46 = require("zod/mini");
|
|
13427
|
+
var KiroSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
13428
|
+
name: import_mini46.z.string(),
|
|
13429
|
+
description: import_mini46.z.string()
|
|
13172
13430
|
});
|
|
13173
13431
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
13174
13432
|
constructor({
|
|
@@ -13342,11 +13600,11 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
13342
13600
|
|
|
13343
13601
|
// src/features/skills/opencode-skill.ts
|
|
13344
13602
|
var import_node_path90 = require("path");
|
|
13345
|
-
var
|
|
13346
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
13347
|
-
name:
|
|
13348
|
-
description:
|
|
13349
|
-
"allowed-tools":
|
|
13603
|
+
var import_mini47 = require("zod/mini");
|
|
13604
|
+
var OpenCodeSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
13605
|
+
name: import_mini47.z.string(),
|
|
13606
|
+
description: import_mini47.z.string(),
|
|
13607
|
+
"allowed-tools": import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
|
|
13350
13608
|
});
|
|
13351
13609
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
13352
13610
|
constructor({
|
|
@@ -13503,10 +13761,10 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13503
13761
|
|
|
13504
13762
|
// src/features/skills/replit-skill.ts
|
|
13505
13763
|
var import_node_path91 = require("path");
|
|
13506
|
-
var
|
|
13507
|
-
var ReplitSkillFrontmatterSchema =
|
|
13508
|
-
name:
|
|
13509
|
-
description:
|
|
13764
|
+
var import_mini48 = require("zod/mini");
|
|
13765
|
+
var ReplitSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
13766
|
+
name: import_mini48.z.string(),
|
|
13767
|
+
description: import_mini48.z.string()
|
|
13510
13768
|
});
|
|
13511
13769
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
13512
13770
|
constructor({
|
|
@@ -13661,10 +13919,10 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13661
13919
|
|
|
13662
13920
|
// src/features/skills/roo-skill.ts
|
|
13663
13921
|
var import_node_path92 = require("path");
|
|
13664
|
-
var
|
|
13665
|
-
var RooSkillFrontmatterSchema =
|
|
13666
|
-
name:
|
|
13667
|
-
description:
|
|
13922
|
+
var import_mini49 = require("zod/mini");
|
|
13923
|
+
var RooSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
13924
|
+
name: import_mini49.z.string(),
|
|
13925
|
+
description: import_mini49.z.string()
|
|
13668
13926
|
});
|
|
13669
13927
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
13670
13928
|
constructor({
|
|
@@ -13853,10 +14111,10 @@ async function getLocalSkillDirNames(baseDir) {
|
|
|
13853
14111
|
|
|
13854
14112
|
// src/features/skills/windsurf-skill.ts
|
|
13855
14113
|
var import_node_path94 = require("path");
|
|
13856
|
-
var
|
|
13857
|
-
var WindsurfSkillFrontmatterSchema =
|
|
13858
|
-
name:
|
|
13859
|
-
description:
|
|
14114
|
+
var import_mini50 = require("zod/mini");
|
|
14115
|
+
var WindsurfSkillFrontmatterSchema = import_mini50.z.looseObject({
|
|
14116
|
+
name: import_mini50.z.string(),
|
|
14117
|
+
description: import_mini50.z.string()
|
|
13860
14118
|
});
|
|
13861
14119
|
var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
13862
14120
|
constructor({
|
|
@@ -14034,7 +14292,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
14034
14292
|
"rovodev",
|
|
14035
14293
|
"windsurf"
|
|
14036
14294
|
];
|
|
14037
|
-
var SkillsProcessorToolTargetSchema =
|
|
14295
|
+
var SkillsProcessorToolTargetSchema = import_mini51.z.enum(skillsProcessorToolTargetTuple);
|
|
14038
14296
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
14039
14297
|
[
|
|
14040
14298
|
"agentsmd",
|
|
@@ -14413,7 +14671,7 @@ var import_node_path97 = require("path");
|
|
|
14413
14671
|
|
|
14414
14672
|
// src/features/subagents/simulated-subagent.ts
|
|
14415
14673
|
var import_node_path96 = require("path");
|
|
14416
|
-
var
|
|
14674
|
+
var import_mini52 = require("zod/mini");
|
|
14417
14675
|
|
|
14418
14676
|
// src/features/subagents/tool-subagent.ts
|
|
14419
14677
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -14465,9 +14723,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
14465
14723
|
};
|
|
14466
14724
|
|
|
14467
14725
|
// src/features/subagents/simulated-subagent.ts
|
|
14468
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
14469
|
-
name:
|
|
14470
|
-
description:
|
|
14726
|
+
var SimulatedSubagentFrontmatterSchema = import_mini52.z.object({
|
|
14727
|
+
name: import_mini52.z.string(),
|
|
14728
|
+
description: import_mini52.z.optional(import_mini52.z.string())
|
|
14471
14729
|
});
|
|
14472
14730
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
14473
14731
|
frontmatter;
|
|
@@ -14625,15 +14883,15 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14625
14883
|
|
|
14626
14884
|
// src/features/subagents/geminicli-subagent.ts
|
|
14627
14885
|
var import_node_path100 = require("path");
|
|
14628
|
-
var
|
|
14886
|
+
var import_mini54 = require("zod/mini");
|
|
14629
14887
|
|
|
14630
14888
|
// src/features/subagents/rulesync-subagent.ts
|
|
14631
14889
|
var import_node_path99 = require("path");
|
|
14632
|
-
var
|
|
14633
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
14634
|
-
targets:
|
|
14635
|
-
name:
|
|
14636
|
-
description:
|
|
14890
|
+
var import_mini53 = require("zod/mini");
|
|
14891
|
+
var RulesyncSubagentFrontmatterSchema = import_mini53.z.looseObject({
|
|
14892
|
+
targets: import_mini53.z._default(RulesyncTargetsSchema, ["*"]),
|
|
14893
|
+
name: import_mini53.z.string(),
|
|
14894
|
+
description: import_mini53.z.optional(import_mini53.z.string())
|
|
14637
14895
|
});
|
|
14638
14896
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14639
14897
|
frontmatter;
|
|
@@ -14702,9 +14960,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14702
14960
|
};
|
|
14703
14961
|
|
|
14704
14962
|
// src/features/subagents/geminicli-subagent.ts
|
|
14705
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
14706
|
-
name:
|
|
14707
|
-
description:
|
|
14963
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini54.z.looseObject({
|
|
14964
|
+
name: import_mini54.z.string(),
|
|
14965
|
+
description: import_mini54.z.optional(import_mini54.z.string())
|
|
14708
14966
|
});
|
|
14709
14967
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
14710
14968
|
frontmatter;
|
|
@@ -14877,10 +15135,10 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
14877
15135
|
|
|
14878
15136
|
// src/features/subagents/rovodev-subagent.ts
|
|
14879
15137
|
var import_node_path102 = require("path");
|
|
14880
|
-
var
|
|
14881
|
-
var RovodevSubagentFrontmatterSchema =
|
|
14882
|
-
name:
|
|
14883
|
-
description:
|
|
15138
|
+
var import_mini55 = require("zod/mini");
|
|
15139
|
+
var RovodevSubagentFrontmatterSchema = import_mini55.z.looseObject({
|
|
15140
|
+
name: import_mini55.z.string(),
|
|
15141
|
+
description: import_mini55.z.optional(import_mini55.z.string())
|
|
14884
15142
|
});
|
|
14885
15143
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
14886
15144
|
frontmatter;
|
|
@@ -15022,18 +15280,18 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15022
15280
|
|
|
15023
15281
|
// src/features/subagents/subagents-processor.ts
|
|
15024
15282
|
var import_node_path113 = require("path");
|
|
15025
|
-
var
|
|
15283
|
+
var import_mini64 = require("zod/mini");
|
|
15026
15284
|
|
|
15027
15285
|
// src/features/subagents/claudecode-subagent.ts
|
|
15028
15286
|
var import_node_path103 = require("path");
|
|
15029
|
-
var
|
|
15030
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
15031
|
-
name:
|
|
15032
|
-
description:
|
|
15033
|
-
model:
|
|
15034
|
-
tools:
|
|
15035
|
-
permissionMode:
|
|
15036
|
-
skills:
|
|
15287
|
+
var import_mini56 = require("zod/mini");
|
|
15288
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini56.z.looseObject({
|
|
15289
|
+
name: import_mini56.z.string(),
|
|
15290
|
+
description: import_mini56.z.optional(import_mini56.z.string()),
|
|
15291
|
+
model: import_mini56.z.optional(import_mini56.z.string()),
|
|
15292
|
+
tools: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())])),
|
|
15293
|
+
permissionMode: import_mini56.z.optional(import_mini56.z.string()),
|
|
15294
|
+
skills: import_mini56.z.optional(import_mini56.z.union([import_mini56.z.string(), import_mini56.z.array(import_mini56.z.string())]))
|
|
15037
15295
|
});
|
|
15038
15296
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
15039
15297
|
frontmatter;
|
|
@@ -15188,25 +15446,25 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15188
15446
|
|
|
15189
15447
|
// src/features/subagents/codexcli-subagent.ts
|
|
15190
15448
|
var import_node_path104 = require("path");
|
|
15191
|
-
var
|
|
15192
|
-
var
|
|
15193
|
-
var CodexCliSubagentTomlSchema =
|
|
15194
|
-
name:
|
|
15195
|
-
description:
|
|
15196
|
-
developer_instructions:
|
|
15197
|
-
model:
|
|
15198
|
-
model_reasoning_effort:
|
|
15199
|
-
sandbox_mode:
|
|
15449
|
+
var smolToml6 = __toESM(require("smol-toml"), 1);
|
|
15450
|
+
var import_mini57 = require("zod/mini");
|
|
15451
|
+
var CodexCliSubagentTomlSchema = import_mini57.z.looseObject({
|
|
15452
|
+
name: import_mini57.z.string(),
|
|
15453
|
+
description: import_mini57.z.optional(import_mini57.z.string()),
|
|
15454
|
+
developer_instructions: import_mini57.z.optional(import_mini57.z.string()),
|
|
15455
|
+
model: import_mini57.z.optional(import_mini57.z.string()),
|
|
15456
|
+
model_reasoning_effort: import_mini57.z.optional(import_mini57.z.string()),
|
|
15457
|
+
sandbox_mode: import_mini57.z.optional(import_mini57.z.string())
|
|
15200
15458
|
});
|
|
15201
15459
|
function stringifyCodexCliSubagentToml(tomlObj) {
|
|
15202
15460
|
const { developer_instructions, ...restFields } = tomlObj;
|
|
15203
|
-
const restToml =
|
|
15461
|
+
const restToml = smolToml6.stringify(restFields).trimEnd();
|
|
15204
15462
|
if (developer_instructions === void 0) {
|
|
15205
15463
|
return restToml;
|
|
15206
15464
|
}
|
|
15207
|
-
const developerInstructionsToml = developer_instructions.includes("\n") ? developer_instructions.includes("'''") ?
|
|
15465
|
+
const developerInstructionsToml = developer_instructions.includes("\n") ? developer_instructions.includes("'''") ? smolToml6.stringify({ developer_instructions }).trimEnd() : `developer_instructions = '''
|
|
15208
15466
|
${developer_instructions}
|
|
15209
|
-
'''` :
|
|
15467
|
+
'''` : smolToml6.stringify({ developer_instructions }).trimEnd();
|
|
15210
15468
|
return [restToml, developerInstructionsToml].filter((value) => value.length > 0).join("\n");
|
|
15211
15469
|
}
|
|
15212
15470
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
@@ -15214,7 +15472,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15214
15472
|
constructor({ body, ...rest }) {
|
|
15215
15473
|
if (rest.validate !== false) {
|
|
15216
15474
|
try {
|
|
15217
|
-
const parsed =
|
|
15475
|
+
const parsed = smolToml6.parse(body);
|
|
15218
15476
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
15219
15477
|
} catch (error) {
|
|
15220
15478
|
throw new Error(
|
|
@@ -15239,7 +15497,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15239
15497
|
toRulesyncSubagent() {
|
|
15240
15498
|
let parsed;
|
|
15241
15499
|
try {
|
|
15242
|
-
parsed = CodexCliSubagentTomlSchema.parse(
|
|
15500
|
+
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
15243
15501
|
} catch (error) {
|
|
15244
15502
|
throw new Error(
|
|
15245
15503
|
`Failed to parse TOML in ${(0, import_node_path104.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -15300,7 +15558,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15300
15558
|
}
|
|
15301
15559
|
validate() {
|
|
15302
15560
|
try {
|
|
15303
|
-
const parsed =
|
|
15561
|
+
const parsed = smolToml6.parse(this.body);
|
|
15304
15562
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
15305
15563
|
return { success: true, error: null };
|
|
15306
15564
|
} catch (error) {
|
|
@@ -15362,12 +15620,12 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15362
15620
|
|
|
15363
15621
|
// src/features/subagents/copilot-subagent.ts
|
|
15364
15622
|
var import_node_path105 = require("path");
|
|
15365
|
-
var
|
|
15623
|
+
var import_mini58 = require("zod/mini");
|
|
15366
15624
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
15367
|
-
var CopilotSubagentFrontmatterSchema =
|
|
15368
|
-
name:
|
|
15369
|
-
description:
|
|
15370
|
-
tools:
|
|
15625
|
+
var CopilotSubagentFrontmatterSchema = import_mini58.z.looseObject({
|
|
15626
|
+
name: import_mini58.z.string(),
|
|
15627
|
+
description: import_mini58.z.optional(import_mini58.z.string()),
|
|
15628
|
+
tools: import_mini58.z.optional(import_mini58.z.union([import_mini58.z.string(), import_mini58.z.array(import_mini58.z.string())]))
|
|
15371
15629
|
});
|
|
15372
15630
|
var normalizeTools = (tools) => {
|
|
15373
15631
|
if (!tools) {
|
|
@@ -15379,6 +15637,21 @@ var ensureRequiredTool = (tools) => {
|
|
|
15379
15637
|
const mergedTools = /* @__PURE__ */ new Set([REQUIRED_TOOL, ...tools]);
|
|
15380
15638
|
return Array.from(mergedTools);
|
|
15381
15639
|
};
|
|
15640
|
+
var toCopilotAgentFilePath = (relativeFilePath) => {
|
|
15641
|
+
if (relativeFilePath.endsWith(".agent.md")) {
|
|
15642
|
+
return relativeFilePath;
|
|
15643
|
+
}
|
|
15644
|
+
if (relativeFilePath.endsWith(".md")) {
|
|
15645
|
+
return relativeFilePath.replace(/\.md$/, ".agent.md");
|
|
15646
|
+
}
|
|
15647
|
+
return relativeFilePath;
|
|
15648
|
+
};
|
|
15649
|
+
var toRulesyncFilePath = (relativeFilePath) => {
|
|
15650
|
+
if (relativeFilePath.endsWith(".agent.md")) {
|
|
15651
|
+
return relativeFilePath.replace(/\.agent\.md$/, ".md");
|
|
15652
|
+
}
|
|
15653
|
+
return relativeFilePath;
|
|
15654
|
+
};
|
|
15382
15655
|
var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
15383
15656
|
frontmatter;
|
|
15384
15657
|
body;
|
|
@@ -15425,7 +15698,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15425
15698
|
frontmatter: rulesyncFrontmatter,
|
|
15426
15699
|
body: this.body,
|
|
15427
15700
|
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
15428
|
-
relativeFilePath: this.getRelativeFilePath(),
|
|
15701
|
+
relativeFilePath: toRulesyncFilePath(this.getRelativeFilePath()),
|
|
15429
15702
|
validate: true
|
|
15430
15703
|
});
|
|
15431
15704
|
}
|
|
@@ -15451,16 +15724,12 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15451
15724
|
const body = rulesyncSubagent.getBody();
|
|
15452
15725
|
const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
|
|
15453
15726
|
const paths = this.getSettablePaths({ global });
|
|
15454
|
-
let relativeFilePath = rulesyncSubagent.getRelativeFilePath();
|
|
15455
|
-
if (!relativeFilePath.endsWith(".agent.md")) {
|
|
15456
|
-
relativeFilePath = relativeFilePath.replace(/\.md$/, ".agent.md");
|
|
15457
|
-
}
|
|
15458
15727
|
return new _CopilotSubagent({
|
|
15459
15728
|
baseDir,
|
|
15460
15729
|
frontmatter: copilotFrontmatter,
|
|
15461
15730
|
body,
|
|
15462
15731
|
relativeDirPath: paths.relativeDirPath,
|
|
15463
|
-
relativeFilePath,
|
|
15732
|
+
relativeFilePath: toCopilotAgentFilePath(rulesyncSubagent.getRelativeFilePath()),
|
|
15464
15733
|
fileContent,
|
|
15465
15734
|
validate,
|
|
15466
15735
|
global
|
|
@@ -15532,10 +15801,10 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15532
15801
|
|
|
15533
15802
|
// src/features/subagents/cursor-subagent.ts
|
|
15534
15803
|
var import_node_path106 = require("path");
|
|
15535
|
-
var
|
|
15536
|
-
var CursorSubagentFrontmatterSchema =
|
|
15537
|
-
name:
|
|
15538
|
-
description:
|
|
15804
|
+
var import_mini59 = require("zod/mini");
|
|
15805
|
+
var CursorSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15806
|
+
name: import_mini59.z.string(),
|
|
15807
|
+
description: import_mini59.z.optional(import_mini59.z.string())
|
|
15539
15808
|
});
|
|
15540
15809
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
15541
15810
|
frontmatter;
|
|
@@ -15679,11 +15948,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15679
15948
|
|
|
15680
15949
|
// src/features/subagents/deepagents-subagent.ts
|
|
15681
15950
|
var import_node_path107 = require("path");
|
|
15682
|
-
var
|
|
15683
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15684
|
-
name:
|
|
15685
|
-
description:
|
|
15686
|
-
model:
|
|
15951
|
+
var import_mini60 = require("zod/mini");
|
|
15952
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15953
|
+
name: import_mini60.z.string(),
|
|
15954
|
+
description: import_mini60.z.optional(import_mini60.z.string()),
|
|
15955
|
+
model: import_mini60.z.optional(import_mini60.z.string())
|
|
15687
15956
|
});
|
|
15688
15957
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15689
15958
|
frontmatter;
|
|
@@ -15832,10 +16101,10 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15832
16101
|
|
|
15833
16102
|
// src/features/subagents/junie-subagent.ts
|
|
15834
16103
|
var import_node_path108 = require("path");
|
|
15835
|
-
var
|
|
15836
|
-
var JunieSubagentFrontmatterSchema =
|
|
15837
|
-
name:
|
|
15838
|
-
description:
|
|
16104
|
+
var import_mini61 = require("zod/mini");
|
|
16105
|
+
var JunieSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
16106
|
+
name: import_mini61.z.optional(import_mini61.z.string()),
|
|
16107
|
+
description: import_mini61.z.string()
|
|
15839
16108
|
});
|
|
15840
16109
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15841
16110
|
frontmatter;
|
|
@@ -15993,11 +16262,11 @@ var import_node_path110 = require("path");
|
|
|
15993
16262
|
|
|
15994
16263
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15995
16264
|
var import_node_path109 = require("path");
|
|
15996
|
-
var
|
|
15997
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15998
|
-
description:
|
|
15999
|
-
mode:
|
|
16000
|
-
name:
|
|
16265
|
+
var import_mini62 = require("zod/mini");
|
|
16266
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
16267
|
+
description: import_mini62.z.optional(import_mini62.z.string()),
|
|
16268
|
+
mode: import_mini62.z._default(import_mini62.z.string(), "subagent"),
|
|
16269
|
+
name: import_mini62.z.optional(import_mini62.z.string())
|
|
16001
16270
|
});
|
|
16002
16271
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
16003
16272
|
frontmatter;
|
|
@@ -16146,22 +16415,22 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
16146
16415
|
|
|
16147
16416
|
// src/features/subagents/kiro-subagent.ts
|
|
16148
16417
|
var import_node_path111 = require("path");
|
|
16149
|
-
var
|
|
16150
|
-
var KiroCliSubagentJsonSchema =
|
|
16151
|
-
name:
|
|
16152
|
-
description:
|
|
16153
|
-
prompt:
|
|
16154
|
-
tools:
|
|
16155
|
-
toolAliases:
|
|
16156
|
-
toolSettings:
|
|
16157
|
-
toolSchema:
|
|
16158
|
-
hooks:
|
|
16159
|
-
model:
|
|
16160
|
-
mcpServers:
|
|
16161
|
-
useLegacyMcpJson:
|
|
16162
|
-
resources:
|
|
16163
|
-
allowedTools:
|
|
16164
|
-
includeMcpJson:
|
|
16418
|
+
var import_mini63 = require("zod/mini");
|
|
16419
|
+
var KiroCliSubagentJsonSchema = import_mini63.z.looseObject({
|
|
16420
|
+
name: import_mini63.z.string(),
|
|
16421
|
+
description: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
16422
|
+
prompt: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
16423
|
+
tools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
16424
|
+
toolAliases: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.string()))),
|
|
16425
|
+
toolSettings: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
16426
|
+
toolSchema: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.unknown())),
|
|
16427
|
+
hooks: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.array(import_mini63.z.unknown())))),
|
|
16428
|
+
model: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.string())),
|
|
16429
|
+
mcpServers: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.record(import_mini63.z.string(), import_mini63.z.unknown()))),
|
|
16430
|
+
useLegacyMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean())),
|
|
16431
|
+
resources: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
16432
|
+
allowedTools: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.array(import_mini63.z.string()))),
|
|
16433
|
+
includeMcpJson: import_mini63.z.optional(import_mini63.z.nullable(import_mini63.z.boolean()))
|
|
16165
16434
|
});
|
|
16166
16435
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
16167
16436
|
body;
|
|
@@ -16422,7 +16691,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
16422
16691
|
"roo",
|
|
16423
16692
|
"rovodev"
|
|
16424
16693
|
];
|
|
16425
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16694
|
+
var SubagentsProcessorToolTargetSchema = import_mini64.z.enum(subagentsProcessorToolTargetTuple);
|
|
16426
16695
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
16427
16696
|
[
|
|
16428
16697
|
"agentsmd",
|
|
@@ -16732,42 +17001,42 @@ var import_node_path115 = require("path");
|
|
|
16732
17001
|
|
|
16733
17002
|
// src/features/rules/rulesync-rule.ts
|
|
16734
17003
|
var import_node_path114 = require("path");
|
|
16735
|
-
var
|
|
16736
|
-
var RulesyncRuleFrontmatterSchema =
|
|
16737
|
-
root:
|
|
16738
|
-
localRoot:
|
|
16739
|
-
targets:
|
|
16740
|
-
description:
|
|
16741
|
-
globs:
|
|
16742
|
-
agentsmd:
|
|
16743
|
-
|
|
17004
|
+
var import_mini65 = require("zod/mini");
|
|
17005
|
+
var RulesyncRuleFrontmatterSchema = import_mini65.z.object({
|
|
17006
|
+
root: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
17007
|
+
localRoot: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
17008
|
+
targets: import_mini65.z._default(RulesyncTargetsSchema, ["*"]),
|
|
17009
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
17010
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string())),
|
|
17011
|
+
agentsmd: import_mini65.z.optional(
|
|
17012
|
+
import_mini65.z.looseObject({
|
|
16744
17013
|
// @example "path/to/subproject"
|
|
16745
|
-
subprojectPath:
|
|
17014
|
+
subprojectPath: import_mini65.z.optional(import_mini65.z.string())
|
|
16746
17015
|
})
|
|
16747
17016
|
),
|
|
16748
|
-
claudecode:
|
|
16749
|
-
|
|
17017
|
+
claudecode: import_mini65.z.optional(
|
|
17018
|
+
import_mini65.z.looseObject({
|
|
16750
17019
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16751
17020
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16752
|
-
paths:
|
|
17021
|
+
paths: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16753
17022
|
})
|
|
16754
17023
|
),
|
|
16755
|
-
cursor:
|
|
16756
|
-
|
|
16757
|
-
alwaysApply:
|
|
16758
|
-
description:
|
|
16759
|
-
globs:
|
|
17024
|
+
cursor: import_mini65.z.optional(
|
|
17025
|
+
import_mini65.z.looseObject({
|
|
17026
|
+
alwaysApply: import_mini65.z.optional(import_mini65.z.boolean()),
|
|
17027
|
+
description: import_mini65.z.optional(import_mini65.z.string()),
|
|
17028
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16760
17029
|
})
|
|
16761
17030
|
),
|
|
16762
|
-
copilot:
|
|
16763
|
-
|
|
16764
|
-
excludeAgent:
|
|
17031
|
+
copilot: import_mini65.z.optional(
|
|
17032
|
+
import_mini65.z.looseObject({
|
|
17033
|
+
excludeAgent: import_mini65.z.optional(import_mini65.z.union([import_mini65.z.literal("code-review"), import_mini65.z.literal("coding-agent")]))
|
|
16765
17034
|
})
|
|
16766
17035
|
),
|
|
16767
|
-
antigravity:
|
|
16768
|
-
|
|
16769
|
-
trigger:
|
|
16770
|
-
globs:
|
|
17036
|
+
antigravity: import_mini65.z.optional(
|
|
17037
|
+
import_mini65.z.looseObject({
|
|
17038
|
+
trigger: import_mini65.z.optional(import_mini65.z.string()),
|
|
17039
|
+
globs: import_mini65.z.optional(import_mini65.z.array(import_mini65.z.string()))
|
|
16771
17040
|
})
|
|
16772
17041
|
)
|
|
16773
17042
|
});
|
|
@@ -17067,20 +17336,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
17067
17336
|
|
|
17068
17337
|
// src/features/rules/antigravity-rule.ts
|
|
17069
17338
|
var import_node_path117 = require("path");
|
|
17070
|
-
var
|
|
17071
|
-
var AntigravityRuleFrontmatterSchema =
|
|
17072
|
-
trigger:
|
|
17073
|
-
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17078
|
-
|
|
17339
|
+
var import_mini66 = require("zod/mini");
|
|
17340
|
+
var AntigravityRuleFrontmatterSchema = import_mini66.z.looseObject({
|
|
17341
|
+
trigger: import_mini66.z.optional(
|
|
17342
|
+
import_mini66.z.union([
|
|
17343
|
+
import_mini66.z.literal("always_on"),
|
|
17344
|
+
import_mini66.z.literal("glob"),
|
|
17345
|
+
import_mini66.z.literal("manual"),
|
|
17346
|
+
import_mini66.z.literal("model_decision"),
|
|
17347
|
+
import_mini66.z.string()
|
|
17079
17348
|
// accepts any string for forward compatibility
|
|
17080
17349
|
])
|
|
17081
17350
|
),
|
|
17082
|
-
globs:
|
|
17083
|
-
description:
|
|
17351
|
+
globs: import_mini66.z.optional(import_mini66.z.string()),
|
|
17352
|
+
description: import_mini66.z.optional(import_mini66.z.string())
|
|
17084
17353
|
});
|
|
17085
17354
|
function parseGlobsString(globs) {
|
|
17086
17355
|
if (!globs) {
|
|
@@ -17667,9 +17936,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17667
17936
|
|
|
17668
17937
|
// src/features/rules/claudecode-rule.ts
|
|
17669
17938
|
var import_node_path121 = require("path");
|
|
17670
|
-
var
|
|
17671
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17672
|
-
paths:
|
|
17939
|
+
var import_mini67 = require("zod/mini");
|
|
17940
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini67.z.object({
|
|
17941
|
+
paths: import_mini67.z.optional(import_mini67.z.array(import_mini67.z.string()))
|
|
17673
17942
|
});
|
|
17674
17943
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17675
17944
|
frontmatter;
|
|
@@ -17885,9 +18154,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17885
18154
|
|
|
17886
18155
|
// src/features/rules/cline-rule.ts
|
|
17887
18156
|
var import_node_path122 = require("path");
|
|
17888
|
-
var
|
|
17889
|
-
var ClineRuleFrontmatterSchema =
|
|
17890
|
-
description:
|
|
18157
|
+
var import_mini68 = require("zod/mini");
|
|
18158
|
+
var ClineRuleFrontmatterSchema = import_mini68.z.object({
|
|
18159
|
+
description: import_mini68.z.string()
|
|
17891
18160
|
});
|
|
17892
18161
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17893
18162
|
static getSettablePaths(_options = {}) {
|
|
@@ -18066,11 +18335,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
18066
18335
|
|
|
18067
18336
|
// src/features/rules/copilot-rule.ts
|
|
18068
18337
|
var import_node_path124 = require("path");
|
|
18069
|
-
var
|
|
18070
|
-
var CopilotRuleFrontmatterSchema =
|
|
18071
|
-
description:
|
|
18072
|
-
applyTo:
|
|
18073
|
-
excludeAgent:
|
|
18338
|
+
var import_mini69 = require("zod/mini");
|
|
18339
|
+
var CopilotRuleFrontmatterSchema = import_mini69.z.object({
|
|
18340
|
+
description: import_mini69.z.optional(import_mini69.z.string()),
|
|
18341
|
+
applyTo: import_mini69.z.optional(import_mini69.z.string()),
|
|
18342
|
+
excludeAgent: import_mini69.z.optional(import_mini69.z.union([import_mini69.z.literal("code-review"), import_mini69.z.literal("coding-agent")]))
|
|
18074
18343
|
});
|
|
18075
18344
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
18076
18345
|
frontmatter;
|
|
@@ -18312,11 +18581,11 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
18312
18581
|
|
|
18313
18582
|
// src/features/rules/cursor-rule.ts
|
|
18314
18583
|
var import_node_path125 = require("path");
|
|
18315
|
-
var
|
|
18316
|
-
var CursorRuleFrontmatterSchema =
|
|
18317
|
-
description:
|
|
18318
|
-
globs:
|
|
18319
|
-
alwaysApply:
|
|
18584
|
+
var import_mini70 = require("zod/mini");
|
|
18585
|
+
var CursorRuleFrontmatterSchema = import_mini70.z.object({
|
|
18586
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18587
|
+
globs: import_mini70.z.optional(import_mini70.z.string()),
|
|
18588
|
+
alwaysApply: import_mini70.z.optional(import_mini70.z.boolean())
|
|
18320
18589
|
});
|
|
18321
18590
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
18322
18591
|
frontmatter;
|
|
@@ -19976,11 +20245,11 @@ var rulesProcessorToolTargets = [
|
|
|
19976
20245
|
"warp",
|
|
19977
20246
|
"windsurf"
|
|
19978
20247
|
];
|
|
19979
|
-
var RulesProcessorToolTargetSchema =
|
|
20248
|
+
var RulesProcessorToolTargetSchema = import_mini71.z.enum(rulesProcessorToolTargets);
|
|
19980
20249
|
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path140.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19981
|
-
var RulesFeatureOptionsSchema =
|
|
19982
|
-
ruleDiscoveryMode:
|
|
19983
|
-
includeLocalRoot:
|
|
20250
|
+
var RulesFeatureOptionsSchema = import_mini71.z.looseObject({
|
|
20251
|
+
ruleDiscoveryMode: import_mini71.z.optional(import_mini71.z.enum(["none", "explicit"])),
|
|
20252
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
19984
20253
|
});
|
|
19985
20254
|
var resolveRuleDiscoveryMode = ({
|
|
19986
20255
|
defaultMode,
|
|
@@ -20001,8 +20270,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
20001
20270
|
}
|
|
20002
20271
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
20003
20272
|
};
|
|
20004
|
-
var IncludeLocalRootSchema =
|
|
20005
|
-
includeLocalRoot:
|
|
20273
|
+
var IncludeLocalRootSchema = import_mini71.z.looseObject({
|
|
20274
|
+
includeLocalRoot: import_mini71.z.optional(import_mini71.z.boolean())
|
|
20006
20275
|
});
|
|
20007
20276
|
var resolveIncludeLocalRoot = (options) => {
|
|
20008
20277
|
if (!options) return true;
|
|
@@ -21624,72 +21893,6 @@ async function importPermissionsCore(params) {
|
|
|
21624
21893
|
return writtenCount;
|
|
21625
21894
|
}
|
|
21626
21895
|
|
|
21627
|
-
// src/utils/logger.ts
|
|
21628
|
-
var BaseLogger = class {
|
|
21629
|
-
_verbose = false;
|
|
21630
|
-
_silent = false;
|
|
21631
|
-
constructor({ verbose = false, silent = false } = {}) {
|
|
21632
|
-
this._silent = silent;
|
|
21633
|
-
this._verbose = verbose && !silent;
|
|
21634
|
-
}
|
|
21635
|
-
get verbose() {
|
|
21636
|
-
return this._verbose;
|
|
21637
|
-
}
|
|
21638
|
-
get silent() {
|
|
21639
|
-
return this._silent;
|
|
21640
|
-
}
|
|
21641
|
-
configure({ verbose, silent }) {
|
|
21642
|
-
if (verbose && silent) {
|
|
21643
|
-
this._silent = false;
|
|
21644
|
-
if (!isEnvTest()) {
|
|
21645
|
-
this.onConflictingFlags();
|
|
21646
|
-
}
|
|
21647
|
-
}
|
|
21648
|
-
this._silent = silent;
|
|
21649
|
-
this._verbose = verbose && !silent;
|
|
21650
|
-
}
|
|
21651
|
-
onConflictingFlags() {
|
|
21652
|
-
console.warn("Both --verbose and --silent specified; --silent takes precedence");
|
|
21653
|
-
}
|
|
21654
|
-
};
|
|
21655
|
-
var ConsoleLogger = class extends BaseLogger {
|
|
21656
|
-
isSuppressed() {
|
|
21657
|
-
return isEnvTest() || this._silent;
|
|
21658
|
-
}
|
|
21659
|
-
get jsonMode() {
|
|
21660
|
-
return false;
|
|
21661
|
-
}
|
|
21662
|
-
captureData(_key, _value) {
|
|
21663
|
-
}
|
|
21664
|
-
getJsonData() {
|
|
21665
|
-
return {};
|
|
21666
|
-
}
|
|
21667
|
-
outputJson(_success, _error) {
|
|
21668
|
-
}
|
|
21669
|
-
info(message, ...args) {
|
|
21670
|
-
if (this.isSuppressed()) return;
|
|
21671
|
-
console.log(message, ...args);
|
|
21672
|
-
}
|
|
21673
|
-
success(message, ...args) {
|
|
21674
|
-
if (this.isSuppressed()) return;
|
|
21675
|
-
console.log(message, ...args);
|
|
21676
|
-
}
|
|
21677
|
-
warn(message, ...args) {
|
|
21678
|
-
if (this.isSuppressed()) return;
|
|
21679
|
-
console.warn(message, ...args);
|
|
21680
|
-
}
|
|
21681
|
-
// Errors are always emitted, even in silent mode
|
|
21682
|
-
error(message, _code, ...args) {
|
|
21683
|
-
if (isEnvTest()) return;
|
|
21684
|
-
const errorMessage = message instanceof Error ? message.message : message;
|
|
21685
|
-
console.error(errorMessage, ...args);
|
|
21686
|
-
}
|
|
21687
|
-
debug(message, ...args) {
|
|
21688
|
-
if (!this._verbose || this.isSuppressed()) return;
|
|
21689
|
-
console.log(message, ...args);
|
|
21690
|
-
}
|
|
21691
|
-
};
|
|
21692
|
-
|
|
21693
21896
|
// src/index.ts
|
|
21694
21897
|
async function generate2(options = {}) {
|
|
21695
21898
|
const { silent = true, verbose = false, ...rest } = options;
|