rulesync 7.27.0 → 7.28.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/README.md +1 -1
- package/dist/{chunk-AZJJUHWM.js → chunk-AKHOQKVV.js} +1031 -835
- package/dist/cli/index.cjs +1338 -1141
- package/dist/cli/index.js +13 -12
- package/dist/index.cjs +1054 -857
- package/dist/index.d.cts +18 -20
- package/dist/index.d.ts +18 -20
- package/dist/index.js +4 -3
- package/package.json +1 -3
|
@@ -607,7 +607,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
// src/lib/generate.ts
|
|
610
|
-
import { join as
|
|
610
|
+
import { join as join131 } from "path";
|
|
611
611
|
import { intersection } from "es-toolkit";
|
|
612
612
|
|
|
613
613
|
// src/features/commands/commands-processor.ts
|
|
@@ -3345,7 +3345,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3345
3345
|
};
|
|
3346
3346
|
|
|
3347
3347
|
// src/features/hooks/hooks-processor.ts
|
|
3348
|
-
import { z as
|
|
3348
|
+
import { z as z20 } from "zod/mini";
|
|
3349
3349
|
|
|
3350
3350
|
// src/types/hooks.ts
|
|
3351
3351
|
import { z as z16 } from "zod/mini";
|
|
@@ -3458,6 +3458,13 @@ var GEMINICLI_HOOK_EVENTS = [
|
|
|
3458
3458
|
"preCompact",
|
|
3459
3459
|
"notification"
|
|
3460
3460
|
];
|
|
3461
|
+
var CODEXCLI_HOOK_EVENTS = [
|
|
3462
|
+
"sessionStart",
|
|
3463
|
+
"preToolUse",
|
|
3464
|
+
"postToolUse",
|
|
3465
|
+
"beforeSubmitPrompt",
|
|
3466
|
+
"stop"
|
|
3467
|
+
];
|
|
3461
3468
|
var hooksRecordSchema = z16.record(z16.string(), z16.array(HookDefinitionSchema));
|
|
3462
3469
|
var HooksConfigSchema = z16.looseObject({
|
|
3463
3470
|
version: z16.optional(z16.number()),
|
|
@@ -3469,6 +3476,7 @@ var HooksConfigSchema = z16.looseObject({
|
|
|
3469
3476
|
kilo: z16.optional(z16.looseObject({ hooks: z16.optional(hooksRecordSchema) })),
|
|
3470
3477
|
factorydroid: z16.optional(z16.looseObject({ hooks: z16.optional(hooksRecordSchema) })),
|
|
3471
3478
|
geminicli: z16.optional(z16.looseObject({ hooks: z16.optional(hooksRecordSchema) })),
|
|
3479
|
+
codexcli: z16.optional(z16.looseObject({ hooks: z16.optional(hooksRecordSchema) })),
|
|
3472
3480
|
deepagents: z16.optional(z16.looseObject({ hooks: z16.optional(hooksRecordSchema) }))
|
|
3473
3481
|
});
|
|
3474
3482
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
@@ -3567,6 +3575,16 @@ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
|
|
|
3567
3575
|
var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3568
3576
|
Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3569
3577
|
);
|
|
3578
|
+
var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
3579
|
+
sessionStart: "SessionStart",
|
|
3580
|
+
preToolUse: "PreToolUse",
|
|
3581
|
+
postToolUse: "PostToolUse",
|
|
3582
|
+
beforeSubmitPrompt: "UserPromptSubmit",
|
|
3583
|
+
stop: "Stop"
|
|
3584
|
+
};
|
|
3585
|
+
var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3586
|
+
Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3587
|
+
);
|
|
3570
3588
|
var CANONICAL_TO_DEEPAGENTS_EVENT_NAMES = {
|
|
3571
3589
|
sessionStart: "session.start",
|
|
3572
3590
|
sessionEnd: "session.end",
|
|
@@ -3897,14 +3915,199 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3897
3915
|
}
|
|
3898
3916
|
};
|
|
3899
3917
|
|
|
3900
|
-
// src/features/hooks/
|
|
3918
|
+
// src/features/hooks/codexcli-hooks.ts
|
|
3901
3919
|
import { join as join23 } from "path";
|
|
3920
|
+
import * as smolToml2 from "smol-toml";
|
|
3902
3921
|
import { z as z17 } from "zod/mini";
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3922
|
+
function canonicalToCodexcliHooks(config) {
|
|
3923
|
+
const codexSupported = new Set(CODEXCLI_HOOK_EVENTS);
|
|
3924
|
+
const sharedHooks = {};
|
|
3925
|
+
for (const [event, defs] of Object.entries(config.hooks)) {
|
|
3926
|
+
if (codexSupported.has(event)) {
|
|
3927
|
+
sharedHooks[event] = defs;
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
const effectiveHooks = {
|
|
3931
|
+
...sharedHooks,
|
|
3932
|
+
...config.codexcli?.hooks
|
|
3933
|
+
};
|
|
3934
|
+
const codex = {};
|
|
3935
|
+
for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
|
|
3936
|
+
const codexEventName = CANONICAL_TO_CODEXCLI_EVENT_NAMES[eventName] ?? eventName;
|
|
3937
|
+
const byMatcher = /* @__PURE__ */ new Map();
|
|
3938
|
+
for (const def of definitions) {
|
|
3939
|
+
const key = def.matcher ?? "";
|
|
3940
|
+
const list = byMatcher.get(key);
|
|
3941
|
+
if (list) list.push(def);
|
|
3942
|
+
else byMatcher.set(key, [def]);
|
|
3943
|
+
}
|
|
3944
|
+
const entries = [];
|
|
3945
|
+
for (const [matcherKey, defs] of byMatcher) {
|
|
3946
|
+
const commandDefs = defs.filter((def) => !def.type || def.type === "command");
|
|
3947
|
+
if (commandDefs.length === 0) continue;
|
|
3948
|
+
const hooks = commandDefs.map((def) => ({
|
|
3949
|
+
type: "command",
|
|
3950
|
+
...def.command !== void 0 && def.command !== null && { command: def.command },
|
|
3951
|
+
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout }
|
|
3952
|
+
}));
|
|
3953
|
+
entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
|
|
3954
|
+
}
|
|
3955
|
+
if (entries.length > 0) {
|
|
3956
|
+
codex[codexEventName] = entries;
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
return codex;
|
|
3960
|
+
}
|
|
3961
|
+
var CodexHookEntrySchema = z17.looseObject({
|
|
3962
|
+
type: z17.optional(z17.string()),
|
|
3963
|
+
command: z17.optional(z17.string()),
|
|
3964
|
+
timeout: z17.optional(z17.number())
|
|
3965
|
+
});
|
|
3966
|
+
var CodexMatcherEntrySchema = z17.looseObject({
|
|
3967
|
+
matcher: z17.optional(z17.string()),
|
|
3968
|
+
hooks: z17.optional(z17.array(CodexHookEntrySchema))
|
|
3969
|
+
});
|
|
3970
|
+
function codexcliHooksToCanonical(codexHooks) {
|
|
3971
|
+
if (codexHooks === null || codexHooks === void 0 || typeof codexHooks !== "object") {
|
|
3972
|
+
return {};
|
|
3973
|
+
}
|
|
3974
|
+
const canonical = {};
|
|
3975
|
+
for (const [codexEventName, matcherEntries] of Object.entries(codexHooks)) {
|
|
3976
|
+
const eventName = CODEXCLI_TO_CANONICAL_EVENT_NAMES[codexEventName] ?? codexEventName;
|
|
3977
|
+
if (!Array.isArray(matcherEntries)) continue;
|
|
3978
|
+
const defs = [];
|
|
3979
|
+
for (const rawEntry of matcherEntries) {
|
|
3980
|
+
const parseResult = CodexMatcherEntrySchema.safeParse(rawEntry);
|
|
3981
|
+
if (!parseResult.success) continue;
|
|
3982
|
+
const entry = parseResult.data;
|
|
3983
|
+
const hooks = entry.hooks ?? [];
|
|
3984
|
+
for (const h of hooks) {
|
|
3985
|
+
const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
|
|
3986
|
+
defs.push({
|
|
3987
|
+
type: hookType,
|
|
3988
|
+
...h.command !== void 0 && h.command !== null && { command: h.command },
|
|
3989
|
+
...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
|
|
3990
|
+
...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
|
|
3991
|
+
});
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
if (defs.length > 0) {
|
|
3995
|
+
canonical[eventName] = defs;
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
return canonical;
|
|
3999
|
+
}
|
|
4000
|
+
async function buildCodexConfigTomlContent({ baseDir }) {
|
|
4001
|
+
const configPath = join23(baseDir, ".codex", "config.toml");
|
|
4002
|
+
const existingContent = await readFileContentOrNull(configPath) ?? smolToml2.stringify({});
|
|
4003
|
+
const configToml = smolToml2.parse(existingContent);
|
|
4004
|
+
if (typeof configToml.features !== "object" || configToml.features === null) {
|
|
4005
|
+
configToml.features = {};
|
|
4006
|
+
}
|
|
4007
|
+
configToml.features.codex_hooks = true;
|
|
4008
|
+
return smolToml2.stringify(configToml);
|
|
4009
|
+
}
|
|
4010
|
+
var CodexcliConfigToml = class _CodexcliConfigToml extends ToolFile {
|
|
4011
|
+
validate() {
|
|
4012
|
+
return { success: true, error: null };
|
|
4013
|
+
}
|
|
4014
|
+
static async fromBaseDir({ baseDir }) {
|
|
4015
|
+
const fileContent = await buildCodexConfigTomlContent({ baseDir });
|
|
4016
|
+
return new _CodexcliConfigToml({
|
|
4017
|
+
baseDir,
|
|
4018
|
+
relativeDirPath: ".codex",
|
|
4019
|
+
relativeFilePath: "config.toml",
|
|
4020
|
+
fileContent
|
|
4021
|
+
});
|
|
4022
|
+
}
|
|
4023
|
+
};
|
|
4024
|
+
var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
4025
|
+
constructor(params) {
|
|
4026
|
+
super({
|
|
4027
|
+
...params,
|
|
4028
|
+
fileContent: params.fileContent ?? "{}"
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
static getSettablePaths(_options = {}) {
|
|
4032
|
+
return { relativeDirPath: ".codex", relativeFilePath: "hooks.json" };
|
|
4033
|
+
}
|
|
4034
|
+
static async fromFile({
|
|
4035
|
+
baseDir = process.cwd(),
|
|
4036
|
+
validate = true,
|
|
4037
|
+
global = false
|
|
4038
|
+
}) {
|
|
4039
|
+
const paths = _CodexcliHooks.getSettablePaths({ global });
|
|
4040
|
+
const filePath = join23(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4041
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4042
|
+
return new _CodexcliHooks({
|
|
4043
|
+
baseDir,
|
|
4044
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4045
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4046
|
+
fileContent,
|
|
4047
|
+
validate
|
|
4048
|
+
});
|
|
4049
|
+
}
|
|
4050
|
+
static async fromRulesyncHooks({
|
|
4051
|
+
baseDir = process.cwd(),
|
|
4052
|
+
rulesyncHooks,
|
|
4053
|
+
validate = true,
|
|
4054
|
+
global = false
|
|
4055
|
+
}) {
|
|
4056
|
+
const paths = _CodexcliHooks.getSettablePaths({ global });
|
|
4057
|
+
const config = rulesyncHooks.getJson();
|
|
4058
|
+
const codexHooks = canonicalToCodexcliHooks(config);
|
|
4059
|
+
const fileContent = JSON.stringify({ hooks: codexHooks }, null, 2);
|
|
4060
|
+
return new _CodexcliHooks({
|
|
4061
|
+
baseDir,
|
|
4062
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4063
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4064
|
+
fileContent,
|
|
4065
|
+
validate
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
4068
|
+
toRulesyncHooks() {
|
|
4069
|
+
let parsed;
|
|
4070
|
+
try {
|
|
4071
|
+
parsed = JSON.parse(this.getFileContent());
|
|
4072
|
+
} catch (error) {
|
|
4073
|
+
throw new Error(
|
|
4074
|
+
`Failed to parse Codex CLI hooks content in ${join23(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4075
|
+
{
|
|
4076
|
+
cause: error
|
|
4077
|
+
}
|
|
4078
|
+
);
|
|
4079
|
+
}
|
|
4080
|
+
const hooks = codexcliHooksToCanonical(parsed.hooks);
|
|
4081
|
+
return this.toRulesyncHooksDefault({
|
|
4082
|
+
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
4083
|
+
});
|
|
4084
|
+
}
|
|
4085
|
+
validate() {
|
|
4086
|
+
return { success: true, error: null };
|
|
4087
|
+
}
|
|
4088
|
+
static forDeletion({
|
|
4089
|
+
baseDir = process.cwd(),
|
|
4090
|
+
relativeDirPath,
|
|
4091
|
+
relativeFilePath
|
|
4092
|
+
}) {
|
|
4093
|
+
return new _CodexcliHooks({
|
|
4094
|
+
baseDir,
|
|
4095
|
+
relativeDirPath,
|
|
4096
|
+
relativeFilePath,
|
|
4097
|
+
fileContent: JSON.stringify({ hooks: {} }, null, 2),
|
|
4098
|
+
validate: false
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
// src/features/hooks/copilot-hooks.ts
|
|
4104
|
+
import { join as join24 } from "path";
|
|
4105
|
+
import { z as z18 } from "zod/mini";
|
|
4106
|
+
var CopilotHookEntrySchema = z18.looseObject({
|
|
4107
|
+
type: z18.string(),
|
|
4108
|
+
bash: z18.optional(z18.string()),
|
|
4109
|
+
powershell: z18.optional(z18.string()),
|
|
4110
|
+
timeoutSec: z18.optional(z18.number())
|
|
3908
4111
|
});
|
|
3909
4112
|
function canonicalToCopilotHooks(config) {
|
|
3910
4113
|
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
@@ -4001,7 +4204,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4001
4204
|
}
|
|
4002
4205
|
static getSettablePaths(_options = {}) {
|
|
4003
4206
|
return {
|
|
4004
|
-
relativeDirPath:
|
|
4207
|
+
relativeDirPath: join24(".github", "hooks"),
|
|
4005
4208
|
relativeFilePath: "copilot-hooks.json"
|
|
4006
4209
|
};
|
|
4007
4210
|
}
|
|
@@ -4011,7 +4214,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4011
4214
|
global = false
|
|
4012
4215
|
}) {
|
|
4013
4216
|
const paths = _CopilotHooks.getSettablePaths({ global });
|
|
4014
|
-
const filePath =
|
|
4217
|
+
const filePath = join24(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4015
4218
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4016
4219
|
return new _CopilotHooks({
|
|
4017
4220
|
baseDir,
|
|
@@ -4044,7 +4247,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4044
4247
|
parsed = JSON.parse(this.getFileContent());
|
|
4045
4248
|
} catch (error) {
|
|
4046
4249
|
throw new Error(
|
|
4047
|
-
`Failed to parse Copilot hooks content in ${
|
|
4250
|
+
`Failed to parse Copilot hooks content in ${join24(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4048
4251
|
{
|
|
4049
4252
|
cause: error
|
|
4050
4253
|
}
|
|
@@ -4074,7 +4277,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4074
4277
|
};
|
|
4075
4278
|
|
|
4076
4279
|
// src/features/hooks/cursor-hooks.ts
|
|
4077
|
-
import { join as
|
|
4280
|
+
import { join as join25 } from "path";
|
|
4078
4281
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
4079
4282
|
constructor(params) {
|
|
4080
4283
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -4095,7 +4298,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4095
4298
|
}) {
|
|
4096
4299
|
const paths = _CursorHooks.getSettablePaths();
|
|
4097
4300
|
const fileContent = await readFileContent(
|
|
4098
|
-
|
|
4301
|
+
join25(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4099
4302
|
);
|
|
4100
4303
|
return new _CursorHooks({
|
|
4101
4304
|
baseDir,
|
|
@@ -4182,7 +4385,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4182
4385
|
};
|
|
4183
4386
|
|
|
4184
4387
|
// src/features/hooks/deepagents-hooks.ts
|
|
4185
|
-
import { join as
|
|
4388
|
+
import { join as join26 } from "path";
|
|
4186
4389
|
function isDeepagentsHooksFile(val) {
|
|
4187
4390
|
if (typeof val !== "object" || val === null || !("hooks" in val)) return false;
|
|
4188
4391
|
return Array.isArray(val.hooks);
|
|
@@ -4213,6 +4416,7 @@ function canonicalToDeepagentsHooks(config) {
|
|
|
4213
4416
|
function deepagentsToCanonicalHooks(hooksEntries) {
|
|
4214
4417
|
const canonical = {};
|
|
4215
4418
|
for (const entry of hooksEntries) {
|
|
4419
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
4216
4420
|
if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
|
|
4217
4421
|
let command;
|
|
4218
4422
|
if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
|
|
@@ -4256,7 +4460,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4256
4460
|
global = false
|
|
4257
4461
|
}) {
|
|
4258
4462
|
const paths = _DeepagentsHooks.getSettablePaths({ global });
|
|
4259
|
-
const filePath =
|
|
4463
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4260
4464
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({ hooks: [] }, null, 2);
|
|
4261
4465
|
return new _DeepagentsHooks({
|
|
4262
4466
|
baseDir,
|
|
@@ -4290,7 +4494,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4290
4494
|
parsed = JSON.parse(this.getFileContent());
|
|
4291
4495
|
} catch (error) {
|
|
4292
4496
|
throw new Error(
|
|
4293
|
-
`Failed to parse deepagents hooks content in ${
|
|
4497
|
+
`Failed to parse deepagents hooks content in ${join26(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4294
4498
|
{ cause: error }
|
|
4295
4499
|
);
|
|
4296
4500
|
}
|
|
@@ -4319,7 +4523,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4319
4523
|
};
|
|
4320
4524
|
|
|
4321
4525
|
// src/features/hooks/factorydroid-hooks.ts
|
|
4322
|
-
import { join as
|
|
4526
|
+
import { join as join27 } from "path";
|
|
4323
4527
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
4324
4528
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
4325
4529
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -4345,7 +4549,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4345
4549
|
global = false
|
|
4346
4550
|
}) {
|
|
4347
4551
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4348
|
-
const filePath =
|
|
4552
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4349
4553
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4350
4554
|
return new _FactorydroidHooks({
|
|
4351
4555
|
baseDir,
|
|
@@ -4363,7 +4567,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4363
4567
|
logger
|
|
4364
4568
|
}) {
|
|
4365
4569
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4366
|
-
const filePath =
|
|
4570
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4367
4571
|
const existingContent = await readOrInitializeFileContent(
|
|
4368
4572
|
filePath,
|
|
4369
4573
|
JSON.stringify({}, null, 2)
|
|
@@ -4400,7 +4604,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4400
4604
|
settings = JSON.parse(this.getFileContent());
|
|
4401
4605
|
} catch (error) {
|
|
4402
4606
|
throw new Error(
|
|
4403
|
-
`Failed to parse Factory Droid hooks content in ${
|
|
4607
|
+
`Failed to parse Factory Droid hooks content in ${join27(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4404
4608
|
{
|
|
4405
4609
|
cause: error
|
|
4406
4610
|
}
|
|
@@ -4433,8 +4637,8 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4433
4637
|
};
|
|
4434
4638
|
|
|
4435
4639
|
// src/features/hooks/geminicli-hooks.ts
|
|
4436
|
-
import { join as
|
|
4437
|
-
import { z as
|
|
4640
|
+
import { join as join28 } from "path";
|
|
4641
|
+
import { z as z19 } from "zod/mini";
|
|
4438
4642
|
function canonicalToGeminicliHooks(config) {
|
|
4439
4643
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
4440
4644
|
const sharedHooks = {};
|
|
@@ -4478,16 +4682,16 @@ function canonicalToGeminicliHooks(config) {
|
|
|
4478
4682
|
}
|
|
4479
4683
|
return gemini;
|
|
4480
4684
|
}
|
|
4481
|
-
var GeminiHookEntrySchema =
|
|
4482
|
-
type:
|
|
4483
|
-
command:
|
|
4484
|
-
timeout:
|
|
4485
|
-
name:
|
|
4486
|
-
description:
|
|
4685
|
+
var GeminiHookEntrySchema = z19.looseObject({
|
|
4686
|
+
type: z19.optional(z19.string()),
|
|
4687
|
+
command: z19.optional(z19.string()),
|
|
4688
|
+
timeout: z19.optional(z19.number()),
|
|
4689
|
+
name: z19.optional(z19.string()),
|
|
4690
|
+
description: z19.optional(z19.string())
|
|
4487
4691
|
});
|
|
4488
|
-
var GeminiMatcherEntrySchema =
|
|
4489
|
-
matcher:
|
|
4490
|
-
hooks:
|
|
4692
|
+
var GeminiMatcherEntrySchema = z19.looseObject({
|
|
4693
|
+
matcher: z19.optional(z19.string()),
|
|
4694
|
+
hooks: z19.optional(z19.array(GeminiHookEntrySchema))
|
|
4491
4695
|
});
|
|
4492
4696
|
function geminiHooksToCanonical(geminiHooks) {
|
|
4493
4697
|
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
@@ -4542,7 +4746,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4542
4746
|
global = false
|
|
4543
4747
|
}) {
|
|
4544
4748
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4545
|
-
const filePath =
|
|
4749
|
+
const filePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4546
4750
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4547
4751
|
return new _GeminicliHooks({
|
|
4548
4752
|
baseDir,
|
|
@@ -4559,7 +4763,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4559
4763
|
global = false
|
|
4560
4764
|
}) {
|
|
4561
4765
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4562
|
-
const filePath =
|
|
4766
|
+
const filePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4563
4767
|
const existingContent = await readOrInitializeFileContent(
|
|
4564
4768
|
filePath,
|
|
4565
4769
|
JSON.stringify({}, null, 2)
|
|
@@ -4591,7 +4795,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4591
4795
|
settings = JSON.parse(this.getFileContent());
|
|
4592
4796
|
} catch (error) {
|
|
4593
4797
|
throw new Error(
|
|
4594
|
-
`Failed to parse Gemini CLI hooks content in ${
|
|
4798
|
+
`Failed to parse Gemini CLI hooks content in ${join28(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4595
4799
|
{
|
|
4596
4800
|
cause: error
|
|
4597
4801
|
}
|
|
@@ -4621,7 +4825,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4621
4825
|
};
|
|
4622
4826
|
|
|
4623
4827
|
// src/features/hooks/kilo-hooks.ts
|
|
4624
|
-
import { join as
|
|
4828
|
+
import { join as join29 } from "path";
|
|
4625
4829
|
|
|
4626
4830
|
// src/features/hooks/opencode-style-generator.ts
|
|
4627
4831
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
@@ -4720,7 +4924,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
4720
4924
|
}
|
|
4721
4925
|
static getSettablePaths(options) {
|
|
4722
4926
|
return {
|
|
4723
|
-
relativeDirPath: options?.global ?
|
|
4927
|
+
relativeDirPath: options?.global ? join29(".config", "kilo", "plugins") : join29(".kilo", "plugins"),
|
|
4724
4928
|
relativeFilePath: "rulesync-hooks.js"
|
|
4725
4929
|
};
|
|
4726
4930
|
}
|
|
@@ -4731,7 +4935,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
4731
4935
|
}) {
|
|
4732
4936
|
const paths = _KiloHooks.getSettablePaths({ global });
|
|
4733
4937
|
const fileContent = await readFileContent(
|
|
4734
|
-
|
|
4938
|
+
join29(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4735
4939
|
);
|
|
4736
4940
|
return new _KiloHooks({
|
|
4737
4941
|
baseDir,
|
|
@@ -4785,7 +4989,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
4785
4989
|
};
|
|
4786
4990
|
|
|
4787
4991
|
// src/features/hooks/opencode-hooks.ts
|
|
4788
|
-
import { join as
|
|
4992
|
+
import { join as join30 } from "path";
|
|
4789
4993
|
var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
4790
4994
|
constructor(params) {
|
|
4791
4995
|
super({
|
|
@@ -4795,7 +4999,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4795
4999
|
}
|
|
4796
5000
|
static getSettablePaths(options) {
|
|
4797
5001
|
return {
|
|
4798
|
-
relativeDirPath: options?.global ?
|
|
5002
|
+
relativeDirPath: options?.global ? join30(".config", "opencode", "plugins") : join30(".opencode", "plugins"),
|
|
4799
5003
|
relativeFilePath: "rulesync-hooks.js"
|
|
4800
5004
|
};
|
|
4801
5005
|
}
|
|
@@ -4806,7 +5010,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4806
5010
|
}) {
|
|
4807
5011
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4808
5012
|
const fileContent = await readFileContent(
|
|
4809
|
-
|
|
5013
|
+
join30(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4810
5014
|
);
|
|
4811
5015
|
return new _OpencodeHooks({
|
|
4812
5016
|
baseDir,
|
|
@@ -4864,13 +5068,14 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4864
5068
|
"kilo",
|
|
4865
5069
|
"cursor",
|
|
4866
5070
|
"claudecode",
|
|
5071
|
+
"codexcli",
|
|
4867
5072
|
"copilot",
|
|
4868
5073
|
"opencode",
|
|
4869
5074
|
"factorydroid",
|
|
4870
5075
|
"geminicli",
|
|
4871
5076
|
"deepagents"
|
|
4872
5077
|
];
|
|
4873
|
-
var HooksProcessorToolTargetSchema =
|
|
5078
|
+
var HooksProcessorToolTargetSchema = z20.enum(hooksProcessorToolTargetTuple);
|
|
4874
5079
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
4875
5080
|
[
|
|
4876
5081
|
"cursor",
|
|
@@ -4900,6 +5105,20 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
|
4900
5105
|
supportsMatcher: true
|
|
4901
5106
|
}
|
|
4902
5107
|
],
|
|
5108
|
+
[
|
|
5109
|
+
"codexcli",
|
|
5110
|
+
{
|
|
5111
|
+
class: CodexcliHooks,
|
|
5112
|
+
meta: {
|
|
5113
|
+
supportsProject: true,
|
|
5114
|
+
supportsGlobal: true,
|
|
5115
|
+
supportsImport: true
|
|
5116
|
+
},
|
|
5117
|
+
supportedEvents: CODEXCLI_HOOK_EVENTS,
|
|
5118
|
+
supportedHookTypes: ["command"],
|
|
5119
|
+
supportsMatcher: true
|
|
5120
|
+
}
|
|
5121
|
+
],
|
|
4903
5122
|
[
|
|
4904
5123
|
"copilot",
|
|
4905
5124
|
{
|
|
@@ -5016,7 +5235,9 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5016
5235
|
return [];
|
|
5017
5236
|
}
|
|
5018
5237
|
}
|
|
5019
|
-
async loadToolFiles({
|
|
5238
|
+
async loadToolFiles({
|
|
5239
|
+
forDeletion = false
|
|
5240
|
+
} = {}) {
|
|
5020
5241
|
try {
|
|
5021
5242
|
const factory = toolHooksFactories.get(this.toolTarget);
|
|
5022
5243
|
if (!factory) throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
@@ -5112,7 +5333,11 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5112
5333
|
validate: true,
|
|
5113
5334
|
global: this.global
|
|
5114
5335
|
});
|
|
5115
|
-
|
|
5336
|
+
const result = [toolHooks];
|
|
5337
|
+
if (this.toolTarget === "codexcli") {
|
|
5338
|
+
result.push(await CodexcliConfigToml.fromBaseDir({ baseDir: this.baseDir }));
|
|
5339
|
+
}
|
|
5340
|
+
return result;
|
|
5116
5341
|
}
|
|
5117
5342
|
async convertToolFilesToRulesyncFiles(toolFiles) {
|
|
5118
5343
|
const hooks = toolFiles.filter((f) => f instanceof ToolHooks);
|
|
@@ -5130,13 +5355,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5130
5355
|
};
|
|
5131
5356
|
|
|
5132
5357
|
// src/features/ignore/ignore-processor.ts
|
|
5133
|
-
import { z as
|
|
5358
|
+
import { z as z21 } from "zod/mini";
|
|
5134
5359
|
|
|
5135
5360
|
// src/features/ignore/augmentcode-ignore.ts
|
|
5136
|
-
import { join as
|
|
5361
|
+
import { join as join32 } from "path";
|
|
5137
5362
|
|
|
5138
5363
|
// src/features/ignore/rulesync-ignore.ts
|
|
5139
|
-
import { join as
|
|
5364
|
+
import { join as join31 } from "path";
|
|
5140
5365
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
5141
5366
|
validate() {
|
|
5142
5367
|
return { success: true, error: null };
|
|
@@ -5156,12 +5381,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
5156
5381
|
static async fromFile() {
|
|
5157
5382
|
const baseDir = process.cwd();
|
|
5158
5383
|
const paths = this.getSettablePaths();
|
|
5159
|
-
const recommendedPath =
|
|
5384
|
+
const recommendedPath = join31(
|
|
5160
5385
|
baseDir,
|
|
5161
5386
|
paths.recommended.relativeDirPath,
|
|
5162
5387
|
paths.recommended.relativeFilePath
|
|
5163
5388
|
);
|
|
5164
|
-
const legacyPath =
|
|
5389
|
+
const legacyPath = join31(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5165
5390
|
if (await fileExists(recommendedPath)) {
|
|
5166
5391
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5167
5392
|
return new _RulesyncIgnore({
|
|
@@ -5277,7 +5502,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
5277
5502
|
validate = true
|
|
5278
5503
|
}) {
|
|
5279
5504
|
const fileContent = await readFileContent(
|
|
5280
|
-
|
|
5505
|
+
join32(
|
|
5281
5506
|
baseDir,
|
|
5282
5507
|
this.getSettablePaths().relativeDirPath,
|
|
5283
5508
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5307,7 +5532,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
5307
5532
|
};
|
|
5308
5533
|
|
|
5309
5534
|
// src/features/ignore/claudecode-ignore.ts
|
|
5310
|
-
import { join as
|
|
5535
|
+
import { join as join33 } from "path";
|
|
5311
5536
|
import { uniq } from "es-toolkit";
|
|
5312
5537
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
5313
5538
|
constructor(params) {
|
|
@@ -5350,7 +5575,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
5350
5575
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5351
5576
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5352
5577
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
5353
|
-
const filePath =
|
|
5578
|
+
const filePath = join33(
|
|
5354
5579
|
baseDir,
|
|
5355
5580
|
this.getSettablePaths().relativeDirPath,
|
|
5356
5581
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5386,7 +5611,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
5386
5611
|
validate = true
|
|
5387
5612
|
}) {
|
|
5388
5613
|
const fileContent = await readFileContent(
|
|
5389
|
-
|
|
5614
|
+
join33(
|
|
5390
5615
|
baseDir,
|
|
5391
5616
|
this.getSettablePaths().relativeDirPath,
|
|
5392
5617
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5416,7 +5641,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
5416
5641
|
};
|
|
5417
5642
|
|
|
5418
5643
|
// src/features/ignore/cline-ignore.ts
|
|
5419
|
-
import { join as
|
|
5644
|
+
import { join as join34 } from "path";
|
|
5420
5645
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
5421
5646
|
static getSettablePaths() {
|
|
5422
5647
|
return {
|
|
@@ -5453,7 +5678,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5453
5678
|
validate = true
|
|
5454
5679
|
}) {
|
|
5455
5680
|
const fileContent = await readFileContent(
|
|
5456
|
-
|
|
5681
|
+
join34(
|
|
5457
5682
|
baseDir,
|
|
5458
5683
|
this.getSettablePaths().relativeDirPath,
|
|
5459
5684
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5483,7 +5708,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5483
5708
|
};
|
|
5484
5709
|
|
|
5485
5710
|
// src/features/ignore/cursor-ignore.ts
|
|
5486
|
-
import { join as
|
|
5711
|
+
import { join as join35 } from "path";
|
|
5487
5712
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
5488
5713
|
static getSettablePaths() {
|
|
5489
5714
|
return {
|
|
@@ -5516,7 +5741,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5516
5741
|
validate = true
|
|
5517
5742
|
}) {
|
|
5518
5743
|
const fileContent = await readFileContent(
|
|
5519
|
-
|
|
5744
|
+
join35(
|
|
5520
5745
|
baseDir,
|
|
5521
5746
|
this.getSettablePaths().relativeDirPath,
|
|
5522
5747
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5546,7 +5771,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5546
5771
|
};
|
|
5547
5772
|
|
|
5548
5773
|
// src/features/ignore/geminicli-ignore.ts
|
|
5549
|
-
import { join as
|
|
5774
|
+
import { join as join36 } from "path";
|
|
5550
5775
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
5551
5776
|
static getSettablePaths() {
|
|
5552
5777
|
return {
|
|
@@ -5573,7 +5798,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5573
5798
|
validate = true
|
|
5574
5799
|
}) {
|
|
5575
5800
|
const fileContent = await readFileContent(
|
|
5576
|
-
|
|
5801
|
+
join36(
|
|
5577
5802
|
baseDir,
|
|
5578
5803
|
this.getSettablePaths().relativeDirPath,
|
|
5579
5804
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5603,7 +5828,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5603
5828
|
};
|
|
5604
5829
|
|
|
5605
5830
|
// src/features/ignore/goose-ignore.ts
|
|
5606
|
-
import { join as
|
|
5831
|
+
import { join as join37 } from "path";
|
|
5607
5832
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
5608
5833
|
static getSettablePaths() {
|
|
5609
5834
|
return {
|
|
@@ -5640,7 +5865,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5640
5865
|
validate = true
|
|
5641
5866
|
}) {
|
|
5642
5867
|
const fileContent = await readFileContent(
|
|
5643
|
-
|
|
5868
|
+
join37(
|
|
5644
5869
|
baseDir,
|
|
5645
5870
|
this.getSettablePaths().relativeDirPath,
|
|
5646
5871
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5670,7 +5895,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5670
5895
|
};
|
|
5671
5896
|
|
|
5672
5897
|
// src/features/ignore/junie-ignore.ts
|
|
5673
|
-
import { join as
|
|
5898
|
+
import { join as join38 } from "path";
|
|
5674
5899
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
5675
5900
|
static getSettablePaths() {
|
|
5676
5901
|
return {
|
|
@@ -5697,7 +5922,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5697
5922
|
validate = true
|
|
5698
5923
|
}) {
|
|
5699
5924
|
const fileContent = await readFileContent(
|
|
5700
|
-
|
|
5925
|
+
join38(
|
|
5701
5926
|
baseDir,
|
|
5702
5927
|
this.getSettablePaths().relativeDirPath,
|
|
5703
5928
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5727,7 +5952,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5727
5952
|
};
|
|
5728
5953
|
|
|
5729
5954
|
// src/features/ignore/kilo-ignore.ts
|
|
5730
|
-
import { join as
|
|
5955
|
+
import { join as join39 } from "path";
|
|
5731
5956
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
5732
5957
|
static getSettablePaths() {
|
|
5733
5958
|
return {
|
|
@@ -5764,7 +5989,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5764
5989
|
validate = true
|
|
5765
5990
|
}) {
|
|
5766
5991
|
const fileContent = await readFileContent(
|
|
5767
|
-
|
|
5992
|
+
join39(
|
|
5768
5993
|
baseDir,
|
|
5769
5994
|
this.getSettablePaths().relativeDirPath,
|
|
5770
5995
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5794,7 +6019,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5794
6019
|
};
|
|
5795
6020
|
|
|
5796
6021
|
// src/features/ignore/kiro-ignore.ts
|
|
5797
|
-
import { join as
|
|
6022
|
+
import { join as join40 } from "path";
|
|
5798
6023
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
5799
6024
|
static getSettablePaths() {
|
|
5800
6025
|
return {
|
|
@@ -5821,7 +6046,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5821
6046
|
validate = true
|
|
5822
6047
|
}) {
|
|
5823
6048
|
const fileContent = await readFileContent(
|
|
5824
|
-
|
|
6049
|
+
join40(
|
|
5825
6050
|
baseDir,
|
|
5826
6051
|
this.getSettablePaths().relativeDirPath,
|
|
5827
6052
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5851,7 +6076,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5851
6076
|
};
|
|
5852
6077
|
|
|
5853
6078
|
// src/features/ignore/qwencode-ignore.ts
|
|
5854
|
-
import { join as
|
|
6079
|
+
import { join as join41 } from "path";
|
|
5855
6080
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5856
6081
|
static getSettablePaths() {
|
|
5857
6082
|
return {
|
|
@@ -5878,7 +6103,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5878
6103
|
validate = true
|
|
5879
6104
|
}) {
|
|
5880
6105
|
const fileContent = await readFileContent(
|
|
5881
|
-
|
|
6106
|
+
join41(
|
|
5882
6107
|
baseDir,
|
|
5883
6108
|
this.getSettablePaths().relativeDirPath,
|
|
5884
6109
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5908,7 +6133,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5908
6133
|
};
|
|
5909
6134
|
|
|
5910
6135
|
// src/features/ignore/roo-ignore.ts
|
|
5911
|
-
import { join as
|
|
6136
|
+
import { join as join42 } from "path";
|
|
5912
6137
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5913
6138
|
static getSettablePaths() {
|
|
5914
6139
|
return {
|
|
@@ -5935,7 +6160,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5935
6160
|
validate = true
|
|
5936
6161
|
}) {
|
|
5937
6162
|
const fileContent = await readFileContent(
|
|
5938
|
-
|
|
6163
|
+
join42(
|
|
5939
6164
|
baseDir,
|
|
5940
6165
|
this.getSettablePaths().relativeDirPath,
|
|
5941
6166
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5965,7 +6190,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5965
6190
|
};
|
|
5966
6191
|
|
|
5967
6192
|
// src/features/ignore/windsurf-ignore.ts
|
|
5968
|
-
import { join as
|
|
6193
|
+
import { join as join43 } from "path";
|
|
5969
6194
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5970
6195
|
static getSettablePaths() {
|
|
5971
6196
|
return {
|
|
@@ -5992,7 +6217,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5992
6217
|
validate = true
|
|
5993
6218
|
}) {
|
|
5994
6219
|
const fileContent = await readFileContent(
|
|
5995
|
-
|
|
6220
|
+
join43(
|
|
5996
6221
|
baseDir,
|
|
5997
6222
|
this.getSettablePaths().relativeDirPath,
|
|
5998
6223
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6022,7 +6247,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
6022
6247
|
};
|
|
6023
6248
|
|
|
6024
6249
|
// src/features/ignore/zed-ignore.ts
|
|
6025
|
-
import { join as
|
|
6250
|
+
import { join as join44 } from "path";
|
|
6026
6251
|
import { uniq as uniq2 } from "es-toolkit";
|
|
6027
6252
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
6028
6253
|
constructor(params) {
|
|
@@ -6059,7 +6284,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
6059
6284
|
}) {
|
|
6060
6285
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
6061
6286
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
6062
|
-
const filePath =
|
|
6287
|
+
const filePath = join44(
|
|
6063
6288
|
baseDir,
|
|
6064
6289
|
this.getSettablePaths().relativeDirPath,
|
|
6065
6290
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6086,7 +6311,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
6086
6311
|
validate = true
|
|
6087
6312
|
}) {
|
|
6088
6313
|
const fileContent = await readFileContent(
|
|
6089
|
-
|
|
6314
|
+
join44(
|
|
6090
6315
|
baseDir,
|
|
6091
6316
|
this.getSettablePaths().relativeDirPath,
|
|
6092
6317
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6132,7 +6357,7 @@ var ignoreProcessorToolTargets = [
|
|
|
6132
6357
|
"windsurf",
|
|
6133
6358
|
"zed"
|
|
6134
6359
|
];
|
|
6135
|
-
var IgnoreProcessorToolTargetSchema =
|
|
6360
|
+
var IgnoreProcessorToolTargetSchema = z21.enum(ignoreProcessorToolTargets);
|
|
6136
6361
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
6137
6362
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
6138
6363
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -6271,55 +6496,55 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
6271
6496
|
};
|
|
6272
6497
|
|
|
6273
6498
|
// src/features/mcp/mcp-processor.ts
|
|
6274
|
-
import { z as
|
|
6499
|
+
import { z as z26 } from "zod/mini";
|
|
6275
6500
|
|
|
6276
6501
|
// src/features/mcp/claudecode-mcp.ts
|
|
6277
|
-
import { join as
|
|
6502
|
+
import { join as join46 } from "path";
|
|
6278
6503
|
|
|
6279
6504
|
// src/features/mcp/rulesync-mcp.ts
|
|
6280
|
-
import { join as
|
|
6505
|
+
import { join as join45 } from "path";
|
|
6281
6506
|
import { omit } from "es-toolkit/object";
|
|
6282
|
-
import { z as
|
|
6507
|
+
import { z as z23 } from "zod/mini";
|
|
6283
6508
|
|
|
6284
6509
|
// src/types/mcp.ts
|
|
6285
|
-
import { z as
|
|
6286
|
-
var McpServerSchema =
|
|
6287
|
-
type:
|
|
6288
|
-
command:
|
|
6289
|
-
args:
|
|
6290
|
-
url:
|
|
6291
|
-
httpUrl:
|
|
6292
|
-
env:
|
|
6293
|
-
disabled:
|
|
6294
|
-
networkTimeout:
|
|
6295
|
-
timeout:
|
|
6296
|
-
trust:
|
|
6297
|
-
cwd:
|
|
6298
|
-
transport:
|
|
6299
|
-
alwaysAllow:
|
|
6300
|
-
tools:
|
|
6301
|
-
kiroAutoApprove:
|
|
6302
|
-
kiroAutoBlock:
|
|
6303
|
-
headers:
|
|
6304
|
-
enabledTools:
|
|
6305
|
-
disabledTools:
|
|
6510
|
+
import { z as z22 } from "zod/mini";
|
|
6511
|
+
var McpServerSchema = z22.looseObject({
|
|
6512
|
+
type: z22.optional(z22.enum(["local", "stdio", "sse", "http"])),
|
|
6513
|
+
command: z22.optional(z22.union([z22.string(), z22.array(z22.string())])),
|
|
6514
|
+
args: z22.optional(z22.array(z22.string())),
|
|
6515
|
+
url: z22.optional(z22.string()),
|
|
6516
|
+
httpUrl: z22.optional(z22.string()),
|
|
6517
|
+
env: z22.optional(z22.record(z22.string(), z22.string())),
|
|
6518
|
+
disabled: z22.optional(z22.boolean()),
|
|
6519
|
+
networkTimeout: z22.optional(z22.number()),
|
|
6520
|
+
timeout: z22.optional(z22.number()),
|
|
6521
|
+
trust: z22.optional(z22.boolean()),
|
|
6522
|
+
cwd: z22.optional(z22.string()),
|
|
6523
|
+
transport: z22.optional(z22.enum(["local", "stdio", "sse", "http"])),
|
|
6524
|
+
alwaysAllow: z22.optional(z22.array(z22.string())),
|
|
6525
|
+
tools: z22.optional(z22.array(z22.string())),
|
|
6526
|
+
kiroAutoApprove: z22.optional(z22.array(z22.string())),
|
|
6527
|
+
kiroAutoBlock: z22.optional(z22.array(z22.string())),
|
|
6528
|
+
headers: z22.optional(z22.record(z22.string(), z22.string())),
|
|
6529
|
+
enabledTools: z22.optional(z22.array(z22.string())),
|
|
6530
|
+
disabledTools: z22.optional(z22.array(z22.string()))
|
|
6306
6531
|
});
|
|
6307
|
-
var McpServersSchema =
|
|
6532
|
+
var McpServersSchema = z22.record(z22.string(), McpServerSchema);
|
|
6308
6533
|
function isMcpServers(value) {
|
|
6309
6534
|
return value !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6310
6535
|
}
|
|
6311
6536
|
|
|
6312
6537
|
// src/features/mcp/rulesync-mcp.ts
|
|
6313
|
-
var RulesyncMcpServerSchema =
|
|
6314
|
-
targets:
|
|
6315
|
-
description:
|
|
6316
|
-
exposed:
|
|
6538
|
+
var RulesyncMcpServerSchema = z23.extend(McpServerSchema, {
|
|
6539
|
+
targets: z23.optional(RulesyncTargetsSchema),
|
|
6540
|
+
description: z23.optional(z23.string()),
|
|
6541
|
+
exposed: z23.optional(z23.boolean())
|
|
6317
6542
|
});
|
|
6318
|
-
var RulesyncMcpConfigSchema =
|
|
6319
|
-
mcpServers:
|
|
6543
|
+
var RulesyncMcpConfigSchema = z23.object({
|
|
6544
|
+
mcpServers: z23.record(z23.string(), RulesyncMcpServerSchema)
|
|
6320
6545
|
});
|
|
6321
|
-
var RulesyncMcpFileSchema =
|
|
6322
|
-
$schema:
|
|
6546
|
+
var RulesyncMcpFileSchema = z23.looseObject({
|
|
6547
|
+
$schema: z23.optional(z23.string()),
|
|
6323
6548
|
...RulesyncMcpConfigSchema.shape
|
|
6324
6549
|
});
|
|
6325
6550
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
@@ -6359,12 +6584,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
6359
6584
|
}) {
|
|
6360
6585
|
const baseDir = process.cwd();
|
|
6361
6586
|
const paths = this.getSettablePaths();
|
|
6362
|
-
const recommendedPath =
|
|
6587
|
+
const recommendedPath = join45(
|
|
6363
6588
|
baseDir,
|
|
6364
6589
|
paths.recommended.relativeDirPath,
|
|
6365
6590
|
paths.recommended.relativeFilePath
|
|
6366
6591
|
);
|
|
6367
|
-
const legacyPath =
|
|
6592
|
+
const legacyPath = join45(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
6368
6593
|
if (await fileExists(recommendedPath)) {
|
|
6369
6594
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
6370
6595
|
return new _RulesyncMcp({
|
|
@@ -6518,7 +6743,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6518
6743
|
global = false
|
|
6519
6744
|
}) {
|
|
6520
6745
|
const paths = this.getSettablePaths({ global });
|
|
6521
|
-
const fileContent = await readFileContentOrNull(
|
|
6746
|
+
const fileContent = await readFileContentOrNull(join46(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6522
6747
|
const json = JSON.parse(fileContent);
|
|
6523
6748
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6524
6749
|
return new _ClaudecodeMcp({
|
|
@@ -6537,7 +6762,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6537
6762
|
}) {
|
|
6538
6763
|
const paths = this.getSettablePaths({ global });
|
|
6539
6764
|
const fileContent = await readOrInitializeFileContent(
|
|
6540
|
-
|
|
6765
|
+
join46(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6541
6766
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6542
6767
|
);
|
|
6543
6768
|
const json = JSON.parse(fileContent);
|
|
@@ -6576,7 +6801,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6576
6801
|
};
|
|
6577
6802
|
|
|
6578
6803
|
// src/features/mcp/cline-mcp.ts
|
|
6579
|
-
import { join as
|
|
6804
|
+
import { join as join47 } from "path";
|
|
6580
6805
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
6581
6806
|
json;
|
|
6582
6807
|
constructor(params) {
|
|
@@ -6597,7 +6822,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6597
6822
|
validate = true
|
|
6598
6823
|
}) {
|
|
6599
6824
|
const fileContent = await readFileContent(
|
|
6600
|
-
|
|
6825
|
+
join47(
|
|
6601
6826
|
baseDir,
|
|
6602
6827
|
this.getSettablePaths().relativeDirPath,
|
|
6603
6828
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6646,8 +6871,8 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6646
6871
|
};
|
|
6647
6872
|
|
|
6648
6873
|
// src/features/mcp/codexcli-mcp.ts
|
|
6649
|
-
import { join as
|
|
6650
|
-
import * as
|
|
6874
|
+
import { join as join48 } from "path";
|
|
6875
|
+
import * as smolToml3 from "smol-toml";
|
|
6651
6876
|
function convertFromCodexFormat(codexMcp) {
|
|
6652
6877
|
const result = {};
|
|
6653
6878
|
for (const [name, config] of Object.entries(codexMcp)) {
|
|
@@ -6700,7 +6925,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6700
6925
|
...rest,
|
|
6701
6926
|
validate: false
|
|
6702
6927
|
});
|
|
6703
|
-
this.toml =
|
|
6928
|
+
this.toml = smolToml3.parse(this.fileContent);
|
|
6704
6929
|
if (rest.validate) {
|
|
6705
6930
|
const result = this.validate();
|
|
6706
6931
|
if (!result.success) {
|
|
@@ -6729,7 +6954,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6729
6954
|
global = false
|
|
6730
6955
|
}) {
|
|
6731
6956
|
const paths = this.getSettablePaths({ global });
|
|
6732
|
-
const fileContent = await readFileContentOrNull(
|
|
6957
|
+
const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml3.stringify({});
|
|
6733
6958
|
return new _CodexcliMcp({
|
|
6734
6959
|
baseDir,
|
|
6735
6960
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6745,12 +6970,12 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6745
6970
|
global = false
|
|
6746
6971
|
}) {
|
|
6747
6972
|
const paths = this.getSettablePaths({ global });
|
|
6748
|
-
const configTomlFilePath =
|
|
6973
|
+
const configTomlFilePath = join48(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6749
6974
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
6750
6975
|
configTomlFilePath,
|
|
6751
|
-
|
|
6976
|
+
smolToml3.stringify({})
|
|
6752
6977
|
);
|
|
6753
|
-
const configToml =
|
|
6978
|
+
const configToml = smolToml3.parse(configTomlFileContent);
|
|
6754
6979
|
const mcpServers = rulesyncMcp.getJson().mcpServers;
|
|
6755
6980
|
const converted = convertToCodexFormat(mcpServers);
|
|
6756
6981
|
const filteredMcpServers = this.removeEmptyEntries(converted);
|
|
@@ -6759,7 +6984,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6759
6984
|
baseDir,
|
|
6760
6985
|
relativeDirPath: paths.relativeDirPath,
|
|
6761
6986
|
relativeFilePath: paths.relativeFilePath,
|
|
6762
|
-
fileContent:
|
|
6987
|
+
fileContent: smolToml3.stringify(configToml),
|
|
6763
6988
|
validate
|
|
6764
6989
|
});
|
|
6765
6990
|
}
|
|
@@ -6799,7 +7024,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6799
7024
|
};
|
|
6800
7025
|
|
|
6801
7026
|
// src/features/mcp/copilot-mcp.ts
|
|
6802
|
-
import { join as
|
|
7027
|
+
import { join as join49 } from "path";
|
|
6803
7028
|
function convertToCopilotFormat(mcpServers) {
|
|
6804
7029
|
return { servers: mcpServers };
|
|
6805
7030
|
}
|
|
@@ -6826,7 +7051,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6826
7051
|
validate = true
|
|
6827
7052
|
}) {
|
|
6828
7053
|
const fileContent = await readFileContent(
|
|
6829
|
-
|
|
7054
|
+
join49(
|
|
6830
7055
|
baseDir,
|
|
6831
7056
|
this.getSettablePaths().relativeDirPath,
|
|
6832
7057
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6879,7 +7104,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6879
7104
|
};
|
|
6880
7105
|
|
|
6881
7106
|
// src/features/mcp/copilotcli-mcp.ts
|
|
6882
|
-
import { join as
|
|
7107
|
+
import { join as join50 } from "path";
|
|
6883
7108
|
var isRemoteServerType = (type) => {
|
|
6884
7109
|
return type === "http" || type === "sse";
|
|
6885
7110
|
};
|
|
@@ -6977,7 +7202,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6977
7202
|
global = false
|
|
6978
7203
|
}) {
|
|
6979
7204
|
const paths = this.getSettablePaths({ global });
|
|
6980
|
-
const fileContent = await readFileContentOrNull(
|
|
7205
|
+
const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6981
7206
|
const json = JSON.parse(fileContent);
|
|
6982
7207
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6983
7208
|
return new _CopilotcliMcp({
|
|
@@ -6997,7 +7222,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6997
7222
|
}) {
|
|
6998
7223
|
const paths = this.getSettablePaths({ global });
|
|
6999
7224
|
const fileContent = await readOrInitializeFileContent(
|
|
7000
|
-
|
|
7225
|
+
join50(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7001
7226
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7002
7227
|
);
|
|
7003
7228
|
const json = JSON.parse(fileContent);
|
|
@@ -7039,7 +7264,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
7039
7264
|
};
|
|
7040
7265
|
|
|
7041
7266
|
// src/features/mcp/cursor-mcp.ts
|
|
7042
|
-
import { join as
|
|
7267
|
+
import { join as join51 } from "path";
|
|
7043
7268
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
7044
7269
|
function convertEnvFromCursorFormat(mcpServers) {
|
|
7045
7270
|
return Object.fromEntries(
|
|
@@ -7086,7 +7311,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7086
7311
|
this.json = JSON.parse(this.fileContent);
|
|
7087
7312
|
} catch (error) {
|
|
7088
7313
|
throw new Error(
|
|
7089
|
-
`Failed to parse Cursor MCP config at ${
|
|
7314
|
+
`Failed to parse Cursor MCP config at ${join51(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
7090
7315
|
{ cause: error }
|
|
7091
7316
|
);
|
|
7092
7317
|
}
|
|
@@ -7112,14 +7337,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7112
7337
|
global = false
|
|
7113
7338
|
}) {
|
|
7114
7339
|
const paths = this.getSettablePaths({ global });
|
|
7115
|
-
const filePath =
|
|
7340
|
+
const filePath = join51(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
7116
7341
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
7117
7342
|
let json;
|
|
7118
7343
|
try {
|
|
7119
7344
|
json = JSON.parse(fileContent);
|
|
7120
7345
|
} catch (error) {
|
|
7121
7346
|
throw new Error(
|
|
7122
|
-
`Failed to parse Cursor MCP config at ${
|
|
7347
|
+
`Failed to parse Cursor MCP config at ${join51(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
7123
7348
|
{ cause: error }
|
|
7124
7349
|
);
|
|
7125
7350
|
}
|
|
@@ -7141,7 +7366,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7141
7366
|
}) {
|
|
7142
7367
|
const paths = this.getSettablePaths({ global });
|
|
7143
7368
|
const fileContent = await readOrInitializeFileContent(
|
|
7144
|
-
|
|
7369
|
+
join51(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7145
7370
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7146
7371
|
);
|
|
7147
7372
|
let json;
|
|
@@ -7149,7 +7374,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7149
7374
|
json = JSON.parse(fileContent);
|
|
7150
7375
|
} catch (error) {
|
|
7151
7376
|
throw new Error(
|
|
7152
|
-
`Failed to parse Cursor MCP config at ${
|
|
7377
|
+
`Failed to parse Cursor MCP config at ${join51(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
7153
7378
|
{ cause: error }
|
|
7154
7379
|
);
|
|
7155
7380
|
}
|
|
@@ -7198,7 +7423,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7198
7423
|
};
|
|
7199
7424
|
|
|
7200
7425
|
// src/features/mcp/deepagents-mcp.ts
|
|
7201
|
-
import { join as
|
|
7426
|
+
import { join as join52 } from "path";
|
|
7202
7427
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
7203
7428
|
json;
|
|
7204
7429
|
constructor(params) {
|
|
@@ -7223,7 +7448,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7223
7448
|
global = false
|
|
7224
7449
|
}) {
|
|
7225
7450
|
const paths = this.getSettablePaths({ global });
|
|
7226
|
-
const fileContent = await readFileContentOrNull(
|
|
7451
|
+
const fileContent = await readFileContentOrNull(join52(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7227
7452
|
const json = JSON.parse(fileContent);
|
|
7228
7453
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7229
7454
|
return new _DeepagentsMcp({
|
|
@@ -7242,7 +7467,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7242
7467
|
}) {
|
|
7243
7468
|
const paths = this.getSettablePaths({ global });
|
|
7244
7469
|
const fileContent = await readOrInitializeFileContent(
|
|
7245
|
-
|
|
7470
|
+
join52(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7246
7471
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7247
7472
|
);
|
|
7248
7473
|
const json = JSON.parse(fileContent);
|
|
@@ -7281,7 +7506,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7281
7506
|
};
|
|
7282
7507
|
|
|
7283
7508
|
// src/features/mcp/factorydroid-mcp.ts
|
|
7284
|
-
import { join as
|
|
7509
|
+
import { join as join53 } from "path";
|
|
7285
7510
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
7286
7511
|
json;
|
|
7287
7512
|
constructor(params) {
|
|
@@ -7302,7 +7527,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
7302
7527
|
validate = true
|
|
7303
7528
|
}) {
|
|
7304
7529
|
const fileContent = await readFileContent(
|
|
7305
|
-
|
|
7530
|
+
join53(
|
|
7306
7531
|
baseDir,
|
|
7307
7532
|
this.getSettablePaths().relativeDirPath,
|
|
7308
7533
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7356,7 +7581,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
7356
7581
|
};
|
|
7357
7582
|
|
|
7358
7583
|
// src/features/mcp/geminicli-mcp.ts
|
|
7359
|
-
import { join as
|
|
7584
|
+
import { join as join54 } from "path";
|
|
7360
7585
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
7361
7586
|
json;
|
|
7362
7587
|
constructor(params) {
|
|
@@ -7384,7 +7609,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
7384
7609
|
global = false
|
|
7385
7610
|
}) {
|
|
7386
7611
|
const paths = this.getSettablePaths({ global });
|
|
7387
|
-
const fileContent = await readFileContentOrNull(
|
|
7612
|
+
const fileContent = await readFileContentOrNull(join54(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7388
7613
|
const json = JSON.parse(fileContent);
|
|
7389
7614
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7390
7615
|
return new _GeminiCliMcp({
|
|
@@ -7403,7 +7628,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
7403
7628
|
}) {
|
|
7404
7629
|
const paths = this.getSettablePaths({ global });
|
|
7405
7630
|
const fileContent = await readOrInitializeFileContent(
|
|
7406
|
-
|
|
7631
|
+
join54(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7407
7632
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7408
7633
|
);
|
|
7409
7634
|
const json = JSON.parse(fileContent);
|
|
@@ -7448,7 +7673,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
7448
7673
|
};
|
|
7449
7674
|
|
|
7450
7675
|
// src/features/mcp/junie-mcp.ts
|
|
7451
|
-
import { join as
|
|
7676
|
+
import { join as join55 } from "path";
|
|
7452
7677
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
7453
7678
|
json;
|
|
7454
7679
|
constructor(params) {
|
|
@@ -7460,7 +7685,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
7460
7685
|
}
|
|
7461
7686
|
static getSettablePaths() {
|
|
7462
7687
|
return {
|
|
7463
|
-
relativeDirPath:
|
|
7688
|
+
relativeDirPath: join55(".junie", "mcp"),
|
|
7464
7689
|
relativeFilePath: "mcp.json"
|
|
7465
7690
|
};
|
|
7466
7691
|
}
|
|
@@ -7469,7 +7694,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
7469
7694
|
validate = true
|
|
7470
7695
|
}) {
|
|
7471
7696
|
const fileContent = await readFileContent(
|
|
7472
|
-
|
|
7697
|
+
join55(
|
|
7473
7698
|
baseDir,
|
|
7474
7699
|
this.getSettablePaths().relativeDirPath,
|
|
7475
7700
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7518,27 +7743,27 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
7518
7743
|
};
|
|
7519
7744
|
|
|
7520
7745
|
// src/features/mcp/kilo-mcp.ts
|
|
7521
|
-
import { join as
|
|
7746
|
+
import { join as join56 } from "path";
|
|
7522
7747
|
import { parse as parseJsonc3 } from "jsonc-parser";
|
|
7523
|
-
import { z as
|
|
7524
|
-
var KiloMcpLocalServerSchema =
|
|
7525
|
-
type:
|
|
7526
|
-
command:
|
|
7527
|
-
environment:
|
|
7528
|
-
enabled:
|
|
7529
|
-
cwd:
|
|
7748
|
+
import { z as z24 } from "zod/mini";
|
|
7749
|
+
var KiloMcpLocalServerSchema = z24.object({
|
|
7750
|
+
type: z24.literal("local"),
|
|
7751
|
+
command: z24.array(z24.string()),
|
|
7752
|
+
environment: z24.optional(z24.record(z24.string(), z24.string())),
|
|
7753
|
+
enabled: z24._default(z24.boolean(), true),
|
|
7754
|
+
cwd: z24.optional(z24.string())
|
|
7530
7755
|
});
|
|
7531
|
-
var KiloMcpRemoteServerSchema =
|
|
7532
|
-
type:
|
|
7533
|
-
url:
|
|
7534
|
-
headers:
|
|
7535
|
-
enabled:
|
|
7756
|
+
var KiloMcpRemoteServerSchema = z24.object({
|
|
7757
|
+
type: z24.literal("remote"),
|
|
7758
|
+
url: z24.string(),
|
|
7759
|
+
headers: z24.optional(z24.record(z24.string(), z24.string())),
|
|
7760
|
+
enabled: z24._default(z24.boolean(), true)
|
|
7536
7761
|
});
|
|
7537
|
-
var KiloMcpServerSchema =
|
|
7538
|
-
var KiloConfigSchema =
|
|
7539
|
-
$schema:
|
|
7540
|
-
mcp:
|
|
7541
|
-
tools:
|
|
7762
|
+
var KiloMcpServerSchema = z24.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
|
|
7763
|
+
var KiloConfigSchema = z24.looseObject({
|
|
7764
|
+
$schema: z24.optional(z24.string()),
|
|
7765
|
+
mcp: z24.optional(z24.record(z24.string(), KiloMcpServerSchema)),
|
|
7766
|
+
tools: z24.optional(z24.record(z24.string(), z24.boolean()))
|
|
7542
7767
|
});
|
|
7543
7768
|
function convertFromKiloFormat(kiloMcp, tools) {
|
|
7544
7769
|
return Object.fromEntries(
|
|
@@ -7656,7 +7881,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7656
7881
|
static getSettablePaths({ global } = {}) {
|
|
7657
7882
|
if (global) {
|
|
7658
7883
|
return {
|
|
7659
|
-
relativeDirPath:
|
|
7884
|
+
relativeDirPath: join56(".config", "kilo"),
|
|
7660
7885
|
relativeFilePath: "kilo.json"
|
|
7661
7886
|
};
|
|
7662
7887
|
}
|
|
@@ -7671,11 +7896,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7671
7896
|
global = false
|
|
7672
7897
|
}) {
|
|
7673
7898
|
const basePaths = this.getSettablePaths({ global });
|
|
7674
|
-
const jsonDir =
|
|
7899
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7675
7900
|
let fileContent = null;
|
|
7676
7901
|
let relativeFilePath = "kilo.jsonc";
|
|
7677
|
-
const jsoncPath =
|
|
7678
|
-
const jsonPath =
|
|
7902
|
+
const jsoncPath = join56(jsonDir, "kilo.jsonc");
|
|
7903
|
+
const jsonPath = join56(jsonDir, "kilo.json");
|
|
7679
7904
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7680
7905
|
if (!fileContent) {
|
|
7681
7906
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7701,11 +7926,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7701
7926
|
global = false
|
|
7702
7927
|
}) {
|
|
7703
7928
|
const basePaths = this.getSettablePaths({ global });
|
|
7704
|
-
const jsonDir =
|
|
7929
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7705
7930
|
let fileContent = null;
|
|
7706
7931
|
let relativeFilePath = "kilo.jsonc";
|
|
7707
|
-
const jsoncPath =
|
|
7708
|
-
const jsonPath =
|
|
7932
|
+
const jsoncPath = join56(jsonDir, "kilo.jsonc");
|
|
7933
|
+
const jsonPath = join56(jsonDir, "kilo.json");
|
|
7709
7934
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7710
7935
|
if (!fileContent) {
|
|
7711
7936
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7764,7 +7989,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7764
7989
|
};
|
|
7765
7990
|
|
|
7766
7991
|
// src/features/mcp/kiro-mcp.ts
|
|
7767
|
-
import { join as
|
|
7992
|
+
import { join as join57 } from "path";
|
|
7768
7993
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
7769
7994
|
json;
|
|
7770
7995
|
constructor(params) {
|
|
@@ -7776,7 +8001,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7776
8001
|
}
|
|
7777
8002
|
static getSettablePaths() {
|
|
7778
8003
|
return {
|
|
7779
|
-
relativeDirPath:
|
|
8004
|
+
relativeDirPath: join57(".kiro", "settings"),
|
|
7780
8005
|
relativeFilePath: "mcp.json"
|
|
7781
8006
|
};
|
|
7782
8007
|
}
|
|
@@ -7785,7 +8010,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7785
8010
|
validate = true
|
|
7786
8011
|
}) {
|
|
7787
8012
|
const paths = this.getSettablePaths();
|
|
7788
|
-
const fileContent = await readFileContentOrNull(
|
|
8013
|
+
const fileContent = await readFileContentOrNull(join57(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7789
8014
|
return new _KiroMcp({
|
|
7790
8015
|
baseDir,
|
|
7791
8016
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7833,30 +8058,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7833
8058
|
};
|
|
7834
8059
|
|
|
7835
8060
|
// src/features/mcp/opencode-mcp.ts
|
|
7836
|
-
import { join as
|
|
8061
|
+
import { join as join58 } from "path";
|
|
7837
8062
|
import { parse as parseJsonc4 } from "jsonc-parser";
|
|
7838
|
-
import { z as
|
|
7839
|
-
var OpencodeMcpLocalServerSchema =
|
|
7840
|
-
type:
|
|
7841
|
-
command:
|
|
7842
|
-
environment:
|
|
7843
|
-
enabled:
|
|
7844
|
-
cwd:
|
|
8063
|
+
import { z as z25 } from "zod/mini";
|
|
8064
|
+
var OpencodeMcpLocalServerSchema = z25.object({
|
|
8065
|
+
type: z25.literal("local"),
|
|
8066
|
+
command: z25.array(z25.string()),
|
|
8067
|
+
environment: z25.optional(z25.record(z25.string(), z25.string())),
|
|
8068
|
+
enabled: z25._default(z25.boolean(), true),
|
|
8069
|
+
cwd: z25.optional(z25.string())
|
|
7845
8070
|
});
|
|
7846
|
-
var OpencodeMcpRemoteServerSchema =
|
|
7847
|
-
type:
|
|
7848
|
-
url:
|
|
7849
|
-
headers:
|
|
7850
|
-
enabled:
|
|
8071
|
+
var OpencodeMcpRemoteServerSchema = z25.object({
|
|
8072
|
+
type: z25.literal("remote"),
|
|
8073
|
+
url: z25.string(),
|
|
8074
|
+
headers: z25.optional(z25.record(z25.string(), z25.string())),
|
|
8075
|
+
enabled: z25._default(z25.boolean(), true)
|
|
7851
8076
|
});
|
|
7852
|
-
var OpencodeMcpServerSchema =
|
|
8077
|
+
var OpencodeMcpServerSchema = z25.union([
|
|
7853
8078
|
OpencodeMcpLocalServerSchema,
|
|
7854
8079
|
OpencodeMcpRemoteServerSchema
|
|
7855
8080
|
]);
|
|
7856
|
-
var OpencodeConfigSchema =
|
|
7857
|
-
$schema:
|
|
7858
|
-
mcp:
|
|
7859
|
-
tools:
|
|
8081
|
+
var OpencodeConfigSchema = z25.looseObject({
|
|
8082
|
+
$schema: z25.optional(z25.string()),
|
|
8083
|
+
mcp: z25.optional(z25.record(z25.string(), OpencodeMcpServerSchema)),
|
|
8084
|
+
tools: z25.optional(z25.record(z25.string(), z25.boolean()))
|
|
7860
8085
|
});
|
|
7861
8086
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
7862
8087
|
return Object.fromEntries(
|
|
@@ -7974,7 +8199,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7974
8199
|
static getSettablePaths({ global } = {}) {
|
|
7975
8200
|
if (global) {
|
|
7976
8201
|
return {
|
|
7977
|
-
relativeDirPath:
|
|
8202
|
+
relativeDirPath: join58(".config", "opencode"),
|
|
7978
8203
|
relativeFilePath: "opencode.json"
|
|
7979
8204
|
};
|
|
7980
8205
|
}
|
|
@@ -7989,11 +8214,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7989
8214
|
global = false
|
|
7990
8215
|
}) {
|
|
7991
8216
|
const basePaths = this.getSettablePaths({ global });
|
|
7992
|
-
const jsonDir =
|
|
8217
|
+
const jsonDir = join58(baseDir, basePaths.relativeDirPath);
|
|
7993
8218
|
let fileContent = null;
|
|
7994
8219
|
let relativeFilePath = "opencode.jsonc";
|
|
7995
|
-
const jsoncPath =
|
|
7996
|
-
const jsonPath =
|
|
8220
|
+
const jsoncPath = join58(jsonDir, "opencode.jsonc");
|
|
8221
|
+
const jsonPath = join58(jsonDir, "opencode.json");
|
|
7997
8222
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7998
8223
|
if (!fileContent) {
|
|
7999
8224
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8019,11 +8244,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8019
8244
|
global = false
|
|
8020
8245
|
}) {
|
|
8021
8246
|
const basePaths = this.getSettablePaths({ global });
|
|
8022
|
-
const jsonDir =
|
|
8247
|
+
const jsonDir = join58(baseDir, basePaths.relativeDirPath);
|
|
8023
8248
|
let fileContent = null;
|
|
8024
8249
|
let relativeFilePath = "opencode.jsonc";
|
|
8025
|
-
const jsoncPath =
|
|
8026
|
-
const jsonPath =
|
|
8250
|
+
const jsoncPath = join58(jsonDir, "opencode.jsonc");
|
|
8251
|
+
const jsonPath = join58(jsonDir, "opencode.json");
|
|
8027
8252
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
8028
8253
|
if (!fileContent) {
|
|
8029
8254
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8084,7 +8309,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8084
8309
|
};
|
|
8085
8310
|
|
|
8086
8311
|
// src/features/mcp/roo-mcp.ts
|
|
8087
|
-
import { join as
|
|
8312
|
+
import { join as join59 } from "path";
|
|
8088
8313
|
function convertToRooFormat(mcpServers) {
|
|
8089
8314
|
return Object.fromEntries(
|
|
8090
8315
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -8136,7 +8361,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
8136
8361
|
validate = true
|
|
8137
8362
|
}) {
|
|
8138
8363
|
const fileContent = await readFileContent(
|
|
8139
|
-
|
|
8364
|
+
join59(
|
|
8140
8365
|
baseDir,
|
|
8141
8366
|
this.getSettablePaths().relativeDirPath,
|
|
8142
8367
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8191,9 +8416,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
8191
8416
|
};
|
|
8192
8417
|
|
|
8193
8418
|
// src/features/mcp/rovodev-mcp.ts
|
|
8194
|
-
import { join as
|
|
8419
|
+
import { join as join60 } from "path";
|
|
8195
8420
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
8196
|
-
const configPath =
|
|
8421
|
+
const configPath = join60(relativeDirPath, relativeFilePath);
|
|
8197
8422
|
let parsed;
|
|
8198
8423
|
try {
|
|
8199
8424
|
parsed = JSON.parse(fileContent);
|
|
@@ -8242,7 +8467,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
8242
8467
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
8243
8468
|
}
|
|
8244
8469
|
const paths = this.getSettablePaths({ global });
|
|
8245
|
-
const filePath =
|
|
8470
|
+
const filePath = join60(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
8246
8471
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
8247
8472
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
8248
8473
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8266,7 +8491,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
8266
8491
|
}
|
|
8267
8492
|
const paths = this.getSettablePaths({ global });
|
|
8268
8493
|
const fileContent = await readOrInitializeFileContent(
|
|
8269
|
-
|
|
8494
|
+
join60(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
8270
8495
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8271
8496
|
);
|
|
8272
8497
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -8327,7 +8552,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
8327
8552
|
"roo",
|
|
8328
8553
|
"rovodev"
|
|
8329
8554
|
];
|
|
8330
|
-
var McpProcessorToolTargetSchema =
|
|
8555
|
+
var McpProcessorToolTargetSchema = z26.enum(mcpProcessorToolTargetTuple);
|
|
8331
8556
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
8332
8557
|
[
|
|
8333
8558
|
"claudecode",
|
|
@@ -8666,25 +8891,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
8666
8891
|
};
|
|
8667
8892
|
|
|
8668
8893
|
// src/features/rules/rules-processor.ts
|
|
8669
|
-
import { basename as
|
|
8894
|
+
import { basename as basename10, dirname as dirname3, join as join130, relative as relative5 } from "path";
|
|
8670
8895
|
import { encode } from "@toon-format/toon";
|
|
8671
|
-
import { z as
|
|
8896
|
+
import { z as z65 } from "zod/mini";
|
|
8672
8897
|
|
|
8673
8898
|
// src/constants/general.ts
|
|
8674
8899
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
8675
8900
|
|
|
8676
8901
|
// src/features/skills/agentsmd-skill.ts
|
|
8677
|
-
import { join as
|
|
8902
|
+
import { join as join64 } from "path";
|
|
8678
8903
|
|
|
8679
8904
|
// src/features/skills/simulated-skill.ts
|
|
8680
|
-
import { join as
|
|
8681
|
-
import { z as
|
|
8905
|
+
import { join as join63 } from "path";
|
|
8906
|
+
import { z as z27 } from "zod/mini";
|
|
8682
8907
|
|
|
8683
8908
|
// src/features/skills/tool-skill.ts
|
|
8684
|
-
import { join as
|
|
8909
|
+
import { join as join62 } from "path";
|
|
8685
8910
|
|
|
8686
8911
|
// src/types/ai-dir.ts
|
|
8687
|
-
import path2, { basename as basename3, join as
|
|
8912
|
+
import path2, { basename as basename3, join as join61, relative as relative4, resolve as resolve4 } from "path";
|
|
8688
8913
|
var AiDir = class {
|
|
8689
8914
|
/**
|
|
8690
8915
|
* @example "."
|
|
@@ -8781,8 +9006,8 @@ var AiDir = class {
|
|
|
8781
9006
|
* @returns Array of files with their relative paths and buffers
|
|
8782
9007
|
*/
|
|
8783
9008
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
8784
|
-
const dirPath =
|
|
8785
|
-
const glob =
|
|
9009
|
+
const dirPath = join61(baseDir, relativeDirPath, dirName);
|
|
9010
|
+
const glob = join61(dirPath, "**", "*");
|
|
8786
9011
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
8787
9012
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
8788
9013
|
const files = await Promise.all(
|
|
@@ -8883,8 +9108,8 @@ var ToolSkill = class extends AiDir {
|
|
|
8883
9108
|
}) {
|
|
8884
9109
|
const settablePaths = getSettablePaths({ global });
|
|
8885
9110
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
8886
|
-
const skillDirPath =
|
|
8887
|
-
const skillFilePath =
|
|
9111
|
+
const skillDirPath = join62(baseDir, actualRelativeDirPath, dirName);
|
|
9112
|
+
const skillFilePath = join62(skillDirPath, SKILL_FILE_NAME);
|
|
8888
9113
|
if (!await fileExists(skillFilePath)) {
|
|
8889
9114
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8890
9115
|
}
|
|
@@ -8908,16 +9133,16 @@ var ToolSkill = class extends AiDir {
|
|
|
8908
9133
|
}
|
|
8909
9134
|
requireMainFileFrontmatter() {
|
|
8910
9135
|
if (!this.mainFile?.frontmatter) {
|
|
8911
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
9136
|
+
throw new Error(`Frontmatter is not defined in ${join62(this.relativeDirPath, this.dirName)}`);
|
|
8912
9137
|
}
|
|
8913
9138
|
return this.mainFile.frontmatter;
|
|
8914
9139
|
}
|
|
8915
9140
|
};
|
|
8916
9141
|
|
|
8917
9142
|
// src/features/skills/simulated-skill.ts
|
|
8918
|
-
var SimulatedSkillFrontmatterSchema =
|
|
8919
|
-
name:
|
|
8920
|
-
description:
|
|
9143
|
+
var SimulatedSkillFrontmatterSchema = z27.looseObject({
|
|
9144
|
+
name: z27.string(),
|
|
9145
|
+
description: z27.string()
|
|
8921
9146
|
});
|
|
8922
9147
|
var SimulatedSkill = class extends ToolSkill {
|
|
8923
9148
|
frontmatter;
|
|
@@ -8948,7 +9173,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
8948
9173
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
8949
9174
|
if (!result.success) {
|
|
8950
9175
|
throw new Error(
|
|
8951
|
-
`Invalid frontmatter in ${
|
|
9176
|
+
`Invalid frontmatter in ${join63(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
8952
9177
|
);
|
|
8953
9178
|
}
|
|
8954
9179
|
}
|
|
@@ -9007,8 +9232,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
9007
9232
|
}) {
|
|
9008
9233
|
const settablePaths = this.getSettablePaths();
|
|
9009
9234
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
9010
|
-
const skillDirPath =
|
|
9011
|
-
const skillFilePath =
|
|
9235
|
+
const skillDirPath = join63(baseDir, actualRelativeDirPath, dirName);
|
|
9236
|
+
const skillFilePath = join63(skillDirPath, SKILL_FILE_NAME);
|
|
9012
9237
|
if (!await fileExists(skillFilePath)) {
|
|
9013
9238
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
9014
9239
|
}
|
|
@@ -9085,7 +9310,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
9085
9310
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
9086
9311
|
}
|
|
9087
9312
|
return {
|
|
9088
|
-
relativeDirPath:
|
|
9313
|
+
relativeDirPath: join64(".agents", "skills")
|
|
9089
9314
|
};
|
|
9090
9315
|
}
|
|
9091
9316
|
static async fromDir(params) {
|
|
@@ -9112,11 +9337,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
9112
9337
|
};
|
|
9113
9338
|
|
|
9114
9339
|
// src/features/skills/factorydroid-skill.ts
|
|
9115
|
-
import { join as
|
|
9340
|
+
import { join as join65 } from "path";
|
|
9116
9341
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
9117
9342
|
static getSettablePaths(_options) {
|
|
9118
9343
|
return {
|
|
9119
|
-
relativeDirPath:
|
|
9344
|
+
relativeDirPath: join65(".factory", "skills")
|
|
9120
9345
|
};
|
|
9121
9346
|
}
|
|
9122
9347
|
static async fromDir(params) {
|
|
@@ -9143,50 +9368,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
9143
9368
|
};
|
|
9144
9369
|
|
|
9145
9370
|
// src/features/skills/rovodev-skill.ts
|
|
9146
|
-
import { join as
|
|
9147
|
-
import { z as
|
|
9371
|
+
import { join as join67 } from "path";
|
|
9372
|
+
import { z as z29 } from "zod/mini";
|
|
9148
9373
|
|
|
9149
9374
|
// src/features/skills/rulesync-skill.ts
|
|
9150
|
-
import { join as
|
|
9151
|
-
import { z as
|
|
9152
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
9153
|
-
name:
|
|
9154
|
-
description:
|
|
9155
|
-
targets:
|
|
9156
|
-
claudecode:
|
|
9157
|
-
|
|
9158
|
-
"allowed-tools":
|
|
9159
|
-
model:
|
|
9160
|
-
"disable-model-invocation":
|
|
9375
|
+
import { join as join66 } from "path";
|
|
9376
|
+
import { z as z28 } from "zod/mini";
|
|
9377
|
+
var RulesyncSkillFrontmatterSchemaInternal = z28.looseObject({
|
|
9378
|
+
name: z28.string(),
|
|
9379
|
+
description: z28.string(),
|
|
9380
|
+
targets: z28._default(RulesyncTargetsSchema, ["*"]),
|
|
9381
|
+
claudecode: z28.optional(
|
|
9382
|
+
z28.looseObject({
|
|
9383
|
+
"allowed-tools": z28.optional(z28.array(z28.string())),
|
|
9384
|
+
model: z28.optional(z28.string()),
|
|
9385
|
+
"disable-model-invocation": z28.optional(z28.boolean())
|
|
9161
9386
|
})
|
|
9162
9387
|
),
|
|
9163
|
-
codexcli:
|
|
9164
|
-
|
|
9165
|
-
"short-description":
|
|
9388
|
+
codexcli: z28.optional(
|
|
9389
|
+
z28.looseObject({
|
|
9390
|
+
"short-description": z28.optional(z28.string())
|
|
9166
9391
|
})
|
|
9167
9392
|
),
|
|
9168
|
-
opencode:
|
|
9169
|
-
|
|
9170
|
-
"allowed-tools":
|
|
9393
|
+
opencode: z28.optional(
|
|
9394
|
+
z28.looseObject({
|
|
9395
|
+
"allowed-tools": z28.optional(z28.array(z28.string()))
|
|
9171
9396
|
})
|
|
9172
9397
|
),
|
|
9173
|
-
kilo:
|
|
9174
|
-
|
|
9175
|
-
"allowed-tools":
|
|
9398
|
+
kilo: z28.optional(
|
|
9399
|
+
z28.looseObject({
|
|
9400
|
+
"allowed-tools": z28.optional(z28.array(z28.string()))
|
|
9176
9401
|
})
|
|
9177
9402
|
),
|
|
9178
|
-
deepagents:
|
|
9179
|
-
|
|
9180
|
-
"allowed-tools":
|
|
9403
|
+
deepagents: z28.optional(
|
|
9404
|
+
z28.looseObject({
|
|
9405
|
+
"allowed-tools": z28.optional(z28.array(z28.string()))
|
|
9181
9406
|
})
|
|
9182
9407
|
),
|
|
9183
|
-
copilot:
|
|
9184
|
-
|
|
9185
|
-
license:
|
|
9408
|
+
copilot: z28.optional(
|
|
9409
|
+
z28.looseObject({
|
|
9410
|
+
license: z28.optional(z28.string())
|
|
9186
9411
|
})
|
|
9187
9412
|
),
|
|
9188
|
-
cline:
|
|
9189
|
-
roo:
|
|
9413
|
+
cline: z28.optional(z28.looseObject({})),
|
|
9414
|
+
roo: z28.optional(z28.looseObject({}))
|
|
9190
9415
|
});
|
|
9191
9416
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
9192
9417
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -9226,7 +9451,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
9226
9451
|
}
|
|
9227
9452
|
getFrontmatter() {
|
|
9228
9453
|
if (!this.mainFile?.frontmatter) {
|
|
9229
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
9454
|
+
throw new Error(`Frontmatter is not defined in ${join66(this.relativeDirPath, this.dirName)}`);
|
|
9230
9455
|
}
|
|
9231
9456
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
9232
9457
|
return result;
|
|
@@ -9252,8 +9477,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
9252
9477
|
dirName,
|
|
9253
9478
|
global = false
|
|
9254
9479
|
}) {
|
|
9255
|
-
const skillDirPath =
|
|
9256
|
-
const skillFilePath =
|
|
9480
|
+
const skillDirPath = join66(baseDir, relativeDirPath, dirName);
|
|
9481
|
+
const skillFilePath = join66(skillDirPath, SKILL_FILE_NAME);
|
|
9257
9482
|
if (!await fileExists(skillFilePath)) {
|
|
9258
9483
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
9259
9484
|
}
|
|
@@ -9283,14 +9508,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
9283
9508
|
};
|
|
9284
9509
|
|
|
9285
9510
|
// src/features/skills/rovodev-skill.ts
|
|
9286
|
-
var RovodevSkillFrontmatterSchema =
|
|
9287
|
-
name:
|
|
9288
|
-
description:
|
|
9511
|
+
var RovodevSkillFrontmatterSchema = z29.looseObject({
|
|
9512
|
+
name: z29.string(),
|
|
9513
|
+
description: z29.string()
|
|
9289
9514
|
});
|
|
9290
9515
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
9291
9516
|
constructor({
|
|
9292
9517
|
baseDir = process.cwd(),
|
|
9293
|
-
relativeDirPath =
|
|
9518
|
+
relativeDirPath = join67(".rovodev", "skills"),
|
|
9294
9519
|
dirName,
|
|
9295
9520
|
frontmatter,
|
|
9296
9521
|
body,
|
|
@@ -9319,8 +9544,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
9319
9544
|
}
|
|
9320
9545
|
static getSettablePaths(_options) {
|
|
9321
9546
|
return {
|
|
9322
|
-
relativeDirPath:
|
|
9323
|
-
alternativeSkillRoots: [
|
|
9547
|
+
relativeDirPath: join67(".rovodev", "skills"),
|
|
9548
|
+
alternativeSkillRoots: [join67(".agents", "skills")]
|
|
9324
9549
|
};
|
|
9325
9550
|
}
|
|
9326
9551
|
getFrontmatter() {
|
|
@@ -9408,13 +9633,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
9408
9633
|
});
|
|
9409
9634
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9410
9635
|
if (!result.success) {
|
|
9411
|
-
const skillDirPath =
|
|
9636
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9412
9637
|
throw new Error(
|
|
9413
|
-
`Invalid frontmatter in ${
|
|
9638
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9414
9639
|
);
|
|
9415
9640
|
}
|
|
9416
9641
|
if (result.data.name !== loaded.dirName) {
|
|
9417
|
-
const skillFilePath =
|
|
9642
|
+
const skillFilePath = join67(
|
|
9418
9643
|
loaded.baseDir,
|
|
9419
9644
|
loaded.relativeDirPath,
|
|
9420
9645
|
loaded.dirName,
|
|
@@ -9456,11 +9681,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
9456
9681
|
};
|
|
9457
9682
|
|
|
9458
9683
|
// src/features/skills/skills-processor.ts
|
|
9459
|
-
import { basename as basename5, join as
|
|
9460
|
-
import { z as
|
|
9684
|
+
import { basename as basename5, join as join85 } from "path";
|
|
9685
|
+
import { z as z45 } from "zod/mini";
|
|
9461
9686
|
|
|
9462
9687
|
// src/types/dir-feature-processor.ts
|
|
9463
|
-
import { join as
|
|
9688
|
+
import { join as join68 } from "path";
|
|
9464
9689
|
var DirFeatureProcessor = class {
|
|
9465
9690
|
baseDir;
|
|
9466
9691
|
dryRun;
|
|
@@ -9500,7 +9725,7 @@ var DirFeatureProcessor = class {
|
|
|
9500
9725
|
const mainFile = aiDir.getMainFile();
|
|
9501
9726
|
let mainFileContent;
|
|
9502
9727
|
if (mainFile) {
|
|
9503
|
-
const mainFilePath =
|
|
9728
|
+
const mainFilePath = join68(dirPath, mainFile.name);
|
|
9504
9729
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
9505
9730
|
avoidBlockScalars: this.avoidBlockScalars
|
|
9506
9731
|
});
|
|
@@ -9520,7 +9745,7 @@ var DirFeatureProcessor = class {
|
|
|
9520
9745
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
9521
9746
|
otherFileContents.push(contentWithNewline);
|
|
9522
9747
|
if (!dirHasChanges) {
|
|
9523
|
-
const filePath =
|
|
9748
|
+
const filePath = join68(dirPath, file.relativeFilePathToDirPath);
|
|
9524
9749
|
const existingContent = await readFileContentOrNull(filePath);
|
|
9525
9750
|
if (!fileContentsEquivalent({
|
|
9526
9751
|
filePath,
|
|
@@ -9538,24 +9763,24 @@ var DirFeatureProcessor = class {
|
|
|
9538
9763
|
if (this.dryRun) {
|
|
9539
9764
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
9540
9765
|
if (mainFile) {
|
|
9541
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
9542
|
-
changedPaths.push(
|
|
9766
|
+
this.logger.info(`[DRY RUN] Would write: ${join68(dirPath, mainFile.name)}`);
|
|
9767
|
+
changedPaths.push(join68(relativeDir, mainFile.name));
|
|
9543
9768
|
}
|
|
9544
9769
|
for (const file of otherFiles) {
|
|
9545
9770
|
this.logger.info(
|
|
9546
|
-
`[DRY RUN] Would write: ${
|
|
9771
|
+
`[DRY RUN] Would write: ${join68(dirPath, file.relativeFilePathToDirPath)}`
|
|
9547
9772
|
);
|
|
9548
|
-
changedPaths.push(
|
|
9773
|
+
changedPaths.push(join68(relativeDir, file.relativeFilePathToDirPath));
|
|
9549
9774
|
}
|
|
9550
9775
|
} else {
|
|
9551
9776
|
await ensureDir(dirPath);
|
|
9552
9777
|
if (mainFile && mainFileContent) {
|
|
9553
|
-
const mainFilePath =
|
|
9778
|
+
const mainFilePath = join68(dirPath, mainFile.name);
|
|
9554
9779
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
9555
|
-
changedPaths.push(
|
|
9780
|
+
changedPaths.push(join68(relativeDir, mainFile.name));
|
|
9556
9781
|
}
|
|
9557
9782
|
for (const [i, file] of otherFiles.entries()) {
|
|
9558
|
-
const filePath =
|
|
9783
|
+
const filePath = join68(dirPath, file.relativeFilePathToDirPath);
|
|
9559
9784
|
const content = otherFileContents[i];
|
|
9560
9785
|
if (content === void 0) {
|
|
9561
9786
|
throw new Error(
|
|
@@ -9563,7 +9788,7 @@ var DirFeatureProcessor = class {
|
|
|
9563
9788
|
);
|
|
9564
9789
|
}
|
|
9565
9790
|
await writeFileContent(filePath, content);
|
|
9566
|
-
changedPaths.push(
|
|
9791
|
+
changedPaths.push(join68(relativeDir, file.relativeFilePathToDirPath));
|
|
9567
9792
|
}
|
|
9568
9793
|
}
|
|
9569
9794
|
changedCount++;
|
|
@@ -9595,16 +9820,16 @@ var DirFeatureProcessor = class {
|
|
|
9595
9820
|
};
|
|
9596
9821
|
|
|
9597
9822
|
// src/features/skills/agentsskills-skill.ts
|
|
9598
|
-
import { join as
|
|
9599
|
-
import { z as
|
|
9600
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
9601
|
-
name:
|
|
9602
|
-
description:
|
|
9823
|
+
import { join as join69 } from "path";
|
|
9824
|
+
import { z as z30 } from "zod/mini";
|
|
9825
|
+
var AgentsSkillsSkillFrontmatterSchema = z30.looseObject({
|
|
9826
|
+
name: z30.string(),
|
|
9827
|
+
description: z30.string()
|
|
9603
9828
|
});
|
|
9604
9829
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
9605
9830
|
constructor({
|
|
9606
9831
|
baseDir = process.cwd(),
|
|
9607
|
-
relativeDirPath =
|
|
9832
|
+
relativeDirPath = join69(".agents", "skills"),
|
|
9608
9833
|
dirName,
|
|
9609
9834
|
frontmatter,
|
|
9610
9835
|
body,
|
|
@@ -9636,7 +9861,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
9636
9861
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
9637
9862
|
}
|
|
9638
9863
|
return {
|
|
9639
|
-
relativeDirPath:
|
|
9864
|
+
relativeDirPath: join69(".agents", "skills")
|
|
9640
9865
|
};
|
|
9641
9866
|
}
|
|
9642
9867
|
getFrontmatter() {
|
|
@@ -9716,9 +9941,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
9716
9941
|
});
|
|
9717
9942
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9718
9943
|
if (!result.success) {
|
|
9719
|
-
const skillDirPath =
|
|
9944
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9720
9945
|
throw new Error(
|
|
9721
|
-
`Invalid frontmatter in ${
|
|
9946
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9722
9947
|
);
|
|
9723
9948
|
}
|
|
9724
9949
|
return new _AgentsSkillsSkill({
|
|
@@ -9753,16 +9978,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
9753
9978
|
};
|
|
9754
9979
|
|
|
9755
9980
|
// src/features/skills/antigravity-skill.ts
|
|
9756
|
-
import { join as
|
|
9757
|
-
import { z as
|
|
9758
|
-
var AntigravitySkillFrontmatterSchema =
|
|
9759
|
-
name:
|
|
9760
|
-
description:
|
|
9981
|
+
import { join as join70 } from "path";
|
|
9982
|
+
import { z as z31 } from "zod/mini";
|
|
9983
|
+
var AntigravitySkillFrontmatterSchema = z31.looseObject({
|
|
9984
|
+
name: z31.string(),
|
|
9985
|
+
description: z31.string()
|
|
9761
9986
|
});
|
|
9762
9987
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
9763
9988
|
constructor({
|
|
9764
9989
|
baseDir = process.cwd(),
|
|
9765
|
-
relativeDirPath =
|
|
9990
|
+
relativeDirPath = join70(".agent", "skills"),
|
|
9766
9991
|
dirName,
|
|
9767
9992
|
frontmatter,
|
|
9768
9993
|
body,
|
|
@@ -9794,11 +10019,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
9794
10019
|
} = {}) {
|
|
9795
10020
|
if (global) {
|
|
9796
10021
|
return {
|
|
9797
|
-
relativeDirPath:
|
|
10022
|
+
relativeDirPath: join70(".gemini", "antigravity", "skills")
|
|
9798
10023
|
};
|
|
9799
10024
|
}
|
|
9800
10025
|
return {
|
|
9801
|
-
relativeDirPath:
|
|
10026
|
+
relativeDirPath: join70(".agent", "skills")
|
|
9802
10027
|
};
|
|
9803
10028
|
}
|
|
9804
10029
|
getFrontmatter() {
|
|
@@ -9878,9 +10103,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
9878
10103
|
});
|
|
9879
10104
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9880
10105
|
if (!result.success) {
|
|
9881
|
-
const skillDirPath =
|
|
10106
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9882
10107
|
throw new Error(
|
|
9883
|
-
`Invalid frontmatter in ${
|
|
10108
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9884
10109
|
);
|
|
9885
10110
|
}
|
|
9886
10111
|
return new _AntigravitySkill({
|
|
@@ -9914,19 +10139,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
9914
10139
|
};
|
|
9915
10140
|
|
|
9916
10141
|
// src/features/skills/claudecode-skill.ts
|
|
9917
|
-
import { join as
|
|
9918
|
-
import { z as
|
|
9919
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
9920
|
-
name:
|
|
9921
|
-
description:
|
|
9922
|
-
"allowed-tools":
|
|
9923
|
-
model:
|
|
9924
|
-
"disable-model-invocation":
|
|
10142
|
+
import { join as join71 } from "path";
|
|
10143
|
+
import { z as z32 } from "zod/mini";
|
|
10144
|
+
var ClaudecodeSkillFrontmatterSchema = z32.looseObject({
|
|
10145
|
+
name: z32.string(),
|
|
10146
|
+
description: z32.string(),
|
|
10147
|
+
"allowed-tools": z32.optional(z32.array(z32.string())),
|
|
10148
|
+
model: z32.optional(z32.string()),
|
|
10149
|
+
"disable-model-invocation": z32.optional(z32.boolean())
|
|
9925
10150
|
});
|
|
9926
10151
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
9927
10152
|
constructor({
|
|
9928
10153
|
baseDir = process.cwd(),
|
|
9929
|
-
relativeDirPath =
|
|
10154
|
+
relativeDirPath = join71(".claude", "skills"),
|
|
9930
10155
|
dirName,
|
|
9931
10156
|
frontmatter,
|
|
9932
10157
|
body,
|
|
@@ -9957,7 +10182,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
9957
10182
|
global: _global = false
|
|
9958
10183
|
} = {}) {
|
|
9959
10184
|
return {
|
|
9960
|
-
relativeDirPath:
|
|
10185
|
+
relativeDirPath: join71(".claude", "skills")
|
|
9961
10186
|
};
|
|
9962
10187
|
}
|
|
9963
10188
|
getFrontmatter() {
|
|
@@ -10054,9 +10279,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
10054
10279
|
});
|
|
10055
10280
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10056
10281
|
if (!result.success) {
|
|
10057
|
-
const skillDirPath =
|
|
10282
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10058
10283
|
throw new Error(
|
|
10059
|
-
`Invalid frontmatter in ${
|
|
10284
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10060
10285
|
);
|
|
10061
10286
|
}
|
|
10062
10287
|
return new _ClaudecodeSkill({
|
|
@@ -10090,16 +10315,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
10090
10315
|
};
|
|
10091
10316
|
|
|
10092
10317
|
// src/features/skills/cline-skill.ts
|
|
10093
|
-
import { join as
|
|
10094
|
-
import { z as
|
|
10095
|
-
var ClineSkillFrontmatterSchema =
|
|
10096
|
-
name:
|
|
10097
|
-
description:
|
|
10318
|
+
import { join as join72 } from "path";
|
|
10319
|
+
import { z as z33 } from "zod/mini";
|
|
10320
|
+
var ClineSkillFrontmatterSchema = z33.looseObject({
|
|
10321
|
+
name: z33.string(),
|
|
10322
|
+
description: z33.string()
|
|
10098
10323
|
});
|
|
10099
10324
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
10100
10325
|
constructor({
|
|
10101
10326
|
baseDir = process.cwd(),
|
|
10102
|
-
relativeDirPath =
|
|
10327
|
+
relativeDirPath = join72(".cline", "skills"),
|
|
10103
10328
|
dirName,
|
|
10104
10329
|
frontmatter,
|
|
10105
10330
|
body,
|
|
@@ -10128,7 +10353,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
10128
10353
|
}
|
|
10129
10354
|
static getSettablePaths(_options = {}) {
|
|
10130
10355
|
return {
|
|
10131
|
-
relativeDirPath:
|
|
10356
|
+
relativeDirPath: join72(".cline", "skills")
|
|
10132
10357
|
};
|
|
10133
10358
|
}
|
|
10134
10359
|
getFrontmatter() {
|
|
@@ -10216,13 +10441,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
10216
10441
|
});
|
|
10217
10442
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10218
10443
|
if (!result.success) {
|
|
10219
|
-
const skillDirPath =
|
|
10444
|
+
const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10220
10445
|
throw new Error(
|
|
10221
|
-
`Invalid frontmatter in ${
|
|
10446
|
+
`Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10222
10447
|
);
|
|
10223
10448
|
}
|
|
10224
10449
|
if (result.data.name !== loaded.dirName) {
|
|
10225
|
-
const skillFilePath =
|
|
10450
|
+
const skillFilePath = join72(
|
|
10226
10451
|
loaded.baseDir,
|
|
10227
10452
|
loaded.relativeDirPath,
|
|
10228
10453
|
loaded.dirName,
|
|
@@ -10263,21 +10488,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
10263
10488
|
};
|
|
10264
10489
|
|
|
10265
10490
|
// src/features/skills/codexcli-skill.ts
|
|
10266
|
-
import { join as
|
|
10267
|
-
import { z as
|
|
10268
|
-
var CodexCliSkillFrontmatterSchema =
|
|
10269
|
-
name:
|
|
10270
|
-
description:
|
|
10271
|
-
metadata:
|
|
10272
|
-
|
|
10273
|
-
"short-description":
|
|
10491
|
+
import { join as join73 } from "path";
|
|
10492
|
+
import { z as z34 } from "zod/mini";
|
|
10493
|
+
var CodexCliSkillFrontmatterSchema = z34.looseObject({
|
|
10494
|
+
name: z34.string(),
|
|
10495
|
+
description: z34.string(),
|
|
10496
|
+
metadata: z34.optional(
|
|
10497
|
+
z34.looseObject({
|
|
10498
|
+
"short-description": z34.optional(z34.string())
|
|
10274
10499
|
})
|
|
10275
10500
|
)
|
|
10276
10501
|
});
|
|
10277
10502
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
10278
10503
|
constructor({
|
|
10279
10504
|
baseDir = process.cwd(),
|
|
10280
|
-
relativeDirPath =
|
|
10505
|
+
relativeDirPath = join73(".codex", "skills"),
|
|
10281
10506
|
dirName,
|
|
10282
10507
|
frontmatter,
|
|
10283
10508
|
body,
|
|
@@ -10308,7 +10533,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
10308
10533
|
global: _global = false
|
|
10309
10534
|
} = {}) {
|
|
10310
10535
|
return {
|
|
10311
|
-
relativeDirPath:
|
|
10536
|
+
relativeDirPath: join73(".codex", "skills")
|
|
10312
10537
|
};
|
|
10313
10538
|
}
|
|
10314
10539
|
getFrontmatter() {
|
|
@@ -10398,9 +10623,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
10398
10623
|
});
|
|
10399
10624
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10400
10625
|
if (!result.success) {
|
|
10401
|
-
const skillDirPath =
|
|
10626
|
+
const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10402
10627
|
throw new Error(
|
|
10403
|
-
`Invalid frontmatter in ${
|
|
10628
|
+
`Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10404
10629
|
);
|
|
10405
10630
|
}
|
|
10406
10631
|
return new _CodexCliSkill({
|
|
@@ -10434,17 +10659,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
10434
10659
|
};
|
|
10435
10660
|
|
|
10436
10661
|
// src/features/skills/copilot-skill.ts
|
|
10437
|
-
import { join as
|
|
10438
|
-
import { z as
|
|
10439
|
-
var CopilotSkillFrontmatterSchema =
|
|
10440
|
-
name:
|
|
10441
|
-
description:
|
|
10442
|
-
license:
|
|
10662
|
+
import { join as join74 } from "path";
|
|
10663
|
+
import { z as z35 } from "zod/mini";
|
|
10664
|
+
var CopilotSkillFrontmatterSchema = z35.looseObject({
|
|
10665
|
+
name: z35.string(),
|
|
10666
|
+
description: z35.string(),
|
|
10667
|
+
license: z35.optional(z35.string())
|
|
10443
10668
|
});
|
|
10444
10669
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
10445
10670
|
constructor({
|
|
10446
10671
|
baseDir = process.cwd(),
|
|
10447
|
-
relativeDirPath =
|
|
10672
|
+
relativeDirPath = join74(".github", "skills"),
|
|
10448
10673
|
dirName,
|
|
10449
10674
|
frontmatter,
|
|
10450
10675
|
body,
|
|
@@ -10476,7 +10701,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
10476
10701
|
throw new Error("CopilotSkill does not support global mode.");
|
|
10477
10702
|
}
|
|
10478
10703
|
return {
|
|
10479
|
-
relativeDirPath:
|
|
10704
|
+
relativeDirPath: join74(".github", "skills")
|
|
10480
10705
|
};
|
|
10481
10706
|
}
|
|
10482
10707
|
getFrontmatter() {
|
|
@@ -10562,9 +10787,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
10562
10787
|
});
|
|
10563
10788
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10564
10789
|
if (!result.success) {
|
|
10565
|
-
const skillDirPath =
|
|
10790
|
+
const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10566
10791
|
throw new Error(
|
|
10567
|
-
`Invalid frontmatter in ${
|
|
10792
|
+
`Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10568
10793
|
);
|
|
10569
10794
|
}
|
|
10570
10795
|
return new _CopilotSkill({
|
|
@@ -10599,16 +10824,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
10599
10824
|
};
|
|
10600
10825
|
|
|
10601
10826
|
// src/features/skills/cursor-skill.ts
|
|
10602
|
-
import { join as
|
|
10603
|
-
import { z as
|
|
10604
|
-
var CursorSkillFrontmatterSchema =
|
|
10605
|
-
name:
|
|
10606
|
-
description:
|
|
10827
|
+
import { join as join75 } from "path";
|
|
10828
|
+
import { z as z36 } from "zod/mini";
|
|
10829
|
+
var CursorSkillFrontmatterSchema = z36.looseObject({
|
|
10830
|
+
name: z36.string(),
|
|
10831
|
+
description: z36.string()
|
|
10607
10832
|
});
|
|
10608
10833
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
10609
10834
|
constructor({
|
|
10610
10835
|
baseDir = process.cwd(),
|
|
10611
|
-
relativeDirPath =
|
|
10836
|
+
relativeDirPath = join75(".cursor", "skills"),
|
|
10612
10837
|
dirName,
|
|
10613
10838
|
frontmatter,
|
|
10614
10839
|
body,
|
|
@@ -10637,7 +10862,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
10637
10862
|
}
|
|
10638
10863
|
static getSettablePaths(_options) {
|
|
10639
10864
|
return {
|
|
10640
|
-
relativeDirPath:
|
|
10865
|
+
relativeDirPath: join75(".cursor", "skills")
|
|
10641
10866
|
};
|
|
10642
10867
|
}
|
|
10643
10868
|
getFrontmatter() {
|
|
@@ -10717,9 +10942,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
10717
10942
|
});
|
|
10718
10943
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10719
10944
|
if (!result.success) {
|
|
10720
|
-
const skillDirPath =
|
|
10945
|
+
const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10721
10946
|
throw new Error(
|
|
10722
|
-
`Invalid frontmatter in ${
|
|
10947
|
+
`Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10723
10948
|
);
|
|
10724
10949
|
}
|
|
10725
10950
|
return new _CursorSkill({
|
|
@@ -10754,17 +10979,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
10754
10979
|
};
|
|
10755
10980
|
|
|
10756
10981
|
// src/features/skills/deepagents-skill.ts
|
|
10757
|
-
import { join as
|
|
10758
|
-
import { z as
|
|
10759
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
10760
|
-
name:
|
|
10761
|
-
description:
|
|
10762
|
-
"allowed-tools":
|
|
10982
|
+
import { join as join76 } from "path";
|
|
10983
|
+
import { z as z37 } from "zod/mini";
|
|
10984
|
+
var DeepagentsSkillFrontmatterSchema = z37.looseObject({
|
|
10985
|
+
name: z37.string(),
|
|
10986
|
+
description: z37.string(),
|
|
10987
|
+
"allowed-tools": z37.optional(z37.array(z37.string()))
|
|
10763
10988
|
});
|
|
10764
10989
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
10765
10990
|
constructor({
|
|
10766
10991
|
baseDir = process.cwd(),
|
|
10767
|
-
relativeDirPath =
|
|
10992
|
+
relativeDirPath = join76(".deepagents", "skills"),
|
|
10768
10993
|
dirName,
|
|
10769
10994
|
frontmatter,
|
|
10770
10995
|
body,
|
|
@@ -10791,12 +11016,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10791
11016
|
}
|
|
10792
11017
|
}
|
|
10793
11018
|
}
|
|
10794
|
-
static getSettablePaths(
|
|
10795
|
-
if (options?.global) {
|
|
10796
|
-
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10797
|
-
}
|
|
11019
|
+
static getSettablePaths(_options) {
|
|
10798
11020
|
return {
|
|
10799
|
-
relativeDirPath:
|
|
11021
|
+
relativeDirPath: join76(".deepagents", "skills")
|
|
10800
11022
|
};
|
|
10801
11023
|
}
|
|
10802
11024
|
getFrontmatter() {
|
|
@@ -10856,7 +11078,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10856
11078
|
const deepagentsFrontmatter = {
|
|
10857
11079
|
name: rulesyncFrontmatter.name,
|
|
10858
11080
|
description: rulesyncFrontmatter.description,
|
|
10859
|
-
|
|
11081
|
+
...rulesyncFrontmatter.deepagents?.["allowed-tools"] && {
|
|
11082
|
+
"allowed-tools": rulesyncFrontmatter.deepagents["allowed-tools"]
|
|
11083
|
+
}
|
|
10860
11084
|
};
|
|
10861
11085
|
return new _DeepagentsSkill({
|
|
10862
11086
|
baseDir,
|
|
@@ -10880,9 +11104,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10880
11104
|
});
|
|
10881
11105
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10882
11106
|
if (!result.success) {
|
|
10883
|
-
const skillDirPath =
|
|
11107
|
+
const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10884
11108
|
throw new Error(
|
|
10885
|
-
`Invalid frontmatter in ${
|
|
11109
|
+
`Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10886
11110
|
);
|
|
10887
11111
|
}
|
|
10888
11112
|
return new _DeepagentsSkill({
|
|
@@ -10917,11 +11141,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
10917
11141
|
};
|
|
10918
11142
|
|
|
10919
11143
|
// src/features/skills/geminicli-skill.ts
|
|
10920
|
-
import { join as
|
|
10921
|
-
import { z as
|
|
10922
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
10923
|
-
name:
|
|
10924
|
-
description:
|
|
11144
|
+
import { join as join77 } from "path";
|
|
11145
|
+
import { z as z38 } from "zod/mini";
|
|
11146
|
+
var GeminiCliSkillFrontmatterSchema = z38.looseObject({
|
|
11147
|
+
name: z38.string(),
|
|
11148
|
+
description: z38.string()
|
|
10925
11149
|
});
|
|
10926
11150
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
10927
11151
|
constructor({
|
|
@@ -10957,7 +11181,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
10957
11181
|
global: _global = false
|
|
10958
11182
|
} = {}) {
|
|
10959
11183
|
return {
|
|
10960
|
-
relativeDirPath:
|
|
11184
|
+
relativeDirPath: join77(".gemini", "skills")
|
|
10961
11185
|
};
|
|
10962
11186
|
}
|
|
10963
11187
|
getFrontmatter() {
|
|
@@ -11037,9 +11261,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
11037
11261
|
});
|
|
11038
11262
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11039
11263
|
if (!result.success) {
|
|
11040
|
-
const skillDirPath =
|
|
11264
|
+
const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11041
11265
|
throw new Error(
|
|
11042
|
-
`Invalid frontmatter in ${
|
|
11266
|
+
`Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11043
11267
|
);
|
|
11044
11268
|
}
|
|
11045
11269
|
return new _GeminiCliSkill({
|
|
@@ -11074,16 +11298,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
11074
11298
|
};
|
|
11075
11299
|
|
|
11076
11300
|
// src/features/skills/junie-skill.ts
|
|
11077
|
-
import { join as
|
|
11078
|
-
import { z as
|
|
11079
|
-
var JunieSkillFrontmatterSchema =
|
|
11080
|
-
name:
|
|
11081
|
-
description:
|
|
11301
|
+
import { join as join78 } from "path";
|
|
11302
|
+
import { z as z39 } from "zod/mini";
|
|
11303
|
+
var JunieSkillFrontmatterSchema = z39.looseObject({
|
|
11304
|
+
name: z39.string(),
|
|
11305
|
+
description: z39.string()
|
|
11082
11306
|
});
|
|
11083
11307
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
11084
11308
|
constructor({
|
|
11085
11309
|
baseDir = process.cwd(),
|
|
11086
|
-
relativeDirPath =
|
|
11310
|
+
relativeDirPath = join78(".junie", "skills"),
|
|
11087
11311
|
dirName,
|
|
11088
11312
|
frontmatter,
|
|
11089
11313
|
body,
|
|
@@ -11115,7 +11339,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
11115
11339
|
throw new Error("JunieSkill does not support global mode.");
|
|
11116
11340
|
}
|
|
11117
11341
|
return {
|
|
11118
|
-
relativeDirPath:
|
|
11342
|
+
relativeDirPath: join78(".junie", "skills")
|
|
11119
11343
|
};
|
|
11120
11344
|
}
|
|
11121
11345
|
getFrontmatter() {
|
|
@@ -11202,13 +11426,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
11202
11426
|
});
|
|
11203
11427
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11204
11428
|
if (!result.success) {
|
|
11205
|
-
const skillDirPath =
|
|
11429
|
+
const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11206
11430
|
throw new Error(
|
|
11207
|
-
`Invalid frontmatter in ${
|
|
11431
|
+
`Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11208
11432
|
);
|
|
11209
11433
|
}
|
|
11210
11434
|
if (result.data.name !== loaded.dirName) {
|
|
11211
|
-
const skillFilePath =
|
|
11435
|
+
const skillFilePath = join78(
|
|
11212
11436
|
loaded.baseDir,
|
|
11213
11437
|
loaded.relativeDirPath,
|
|
11214
11438
|
loaded.dirName,
|
|
@@ -11250,17 +11474,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
11250
11474
|
};
|
|
11251
11475
|
|
|
11252
11476
|
// src/features/skills/kilo-skill.ts
|
|
11253
|
-
import { join as
|
|
11254
|
-
import { z as
|
|
11255
|
-
var KiloSkillFrontmatterSchema =
|
|
11256
|
-
name:
|
|
11257
|
-
description:
|
|
11258
|
-
"allowed-tools":
|
|
11477
|
+
import { join as join79 } from "path";
|
|
11478
|
+
import { z as z40 } from "zod/mini";
|
|
11479
|
+
var KiloSkillFrontmatterSchema = z40.looseObject({
|
|
11480
|
+
name: z40.string(),
|
|
11481
|
+
description: z40.string(),
|
|
11482
|
+
"allowed-tools": z40.optional(z40.array(z40.string()))
|
|
11259
11483
|
});
|
|
11260
11484
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
11261
11485
|
constructor({
|
|
11262
11486
|
baseDir = process.cwd(),
|
|
11263
|
-
relativeDirPath =
|
|
11487
|
+
relativeDirPath = join79(".kilo", "skills"),
|
|
11264
11488
|
dirName,
|
|
11265
11489
|
frontmatter,
|
|
11266
11490
|
body,
|
|
@@ -11289,7 +11513,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
11289
11513
|
}
|
|
11290
11514
|
static getSettablePaths({ global = false } = {}) {
|
|
11291
11515
|
return {
|
|
11292
|
-
relativeDirPath: global ?
|
|
11516
|
+
relativeDirPath: global ? join79(".config", "kilo", "skills") : join79(".kilo", "skills")
|
|
11293
11517
|
};
|
|
11294
11518
|
}
|
|
11295
11519
|
getFrontmatter() {
|
|
@@ -11375,9 +11599,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
11375
11599
|
});
|
|
11376
11600
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11377
11601
|
if (!result.success) {
|
|
11378
|
-
const skillDirPath =
|
|
11602
|
+
const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11379
11603
|
throw new Error(
|
|
11380
|
-
`Invalid frontmatter in ${
|
|
11604
|
+
`Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11381
11605
|
);
|
|
11382
11606
|
}
|
|
11383
11607
|
return new _KiloSkill({
|
|
@@ -11411,16 +11635,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
11411
11635
|
};
|
|
11412
11636
|
|
|
11413
11637
|
// src/features/skills/kiro-skill.ts
|
|
11414
|
-
import { join as
|
|
11415
|
-
import { z as
|
|
11416
|
-
var KiroSkillFrontmatterSchema =
|
|
11417
|
-
name:
|
|
11418
|
-
description:
|
|
11638
|
+
import { join as join80 } from "path";
|
|
11639
|
+
import { z as z41 } from "zod/mini";
|
|
11640
|
+
var KiroSkillFrontmatterSchema = z41.looseObject({
|
|
11641
|
+
name: z41.string(),
|
|
11642
|
+
description: z41.string()
|
|
11419
11643
|
});
|
|
11420
11644
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
11421
11645
|
constructor({
|
|
11422
11646
|
baseDir = process.cwd(),
|
|
11423
|
-
relativeDirPath =
|
|
11647
|
+
relativeDirPath = join80(".kiro", "skills"),
|
|
11424
11648
|
dirName,
|
|
11425
11649
|
frontmatter,
|
|
11426
11650
|
body,
|
|
@@ -11452,7 +11676,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
11452
11676
|
throw new Error("KiroSkill does not support global mode.");
|
|
11453
11677
|
}
|
|
11454
11678
|
return {
|
|
11455
|
-
relativeDirPath:
|
|
11679
|
+
relativeDirPath: join80(".kiro", "skills")
|
|
11456
11680
|
};
|
|
11457
11681
|
}
|
|
11458
11682
|
getFrontmatter() {
|
|
@@ -11540,13 +11764,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
11540
11764
|
});
|
|
11541
11765
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11542
11766
|
if (!result.success) {
|
|
11543
|
-
const skillDirPath =
|
|
11767
|
+
const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11544
11768
|
throw new Error(
|
|
11545
|
-
`Invalid frontmatter in ${
|
|
11769
|
+
`Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11546
11770
|
);
|
|
11547
11771
|
}
|
|
11548
11772
|
if (result.data.name !== loaded.dirName) {
|
|
11549
|
-
const skillFilePath =
|
|
11773
|
+
const skillFilePath = join80(
|
|
11550
11774
|
loaded.baseDir,
|
|
11551
11775
|
loaded.relativeDirPath,
|
|
11552
11776
|
loaded.dirName,
|
|
@@ -11588,17 +11812,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
11588
11812
|
};
|
|
11589
11813
|
|
|
11590
11814
|
// src/features/skills/opencode-skill.ts
|
|
11591
|
-
import { join as
|
|
11592
|
-
import { z as
|
|
11593
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
11594
|
-
name:
|
|
11595
|
-
description:
|
|
11596
|
-
"allowed-tools":
|
|
11815
|
+
import { join as join81 } from "path";
|
|
11816
|
+
import { z as z42 } from "zod/mini";
|
|
11817
|
+
var OpenCodeSkillFrontmatterSchema = z42.looseObject({
|
|
11818
|
+
name: z42.string(),
|
|
11819
|
+
description: z42.string(),
|
|
11820
|
+
"allowed-tools": z42.optional(z42.array(z42.string()))
|
|
11597
11821
|
});
|
|
11598
11822
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
11599
11823
|
constructor({
|
|
11600
11824
|
baseDir = process.cwd(),
|
|
11601
|
-
relativeDirPath =
|
|
11825
|
+
relativeDirPath = join81(".opencode", "skill"),
|
|
11602
11826
|
dirName,
|
|
11603
11827
|
frontmatter,
|
|
11604
11828
|
body,
|
|
@@ -11627,7 +11851,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
11627
11851
|
}
|
|
11628
11852
|
static getSettablePaths({ global = false } = {}) {
|
|
11629
11853
|
return {
|
|
11630
|
-
relativeDirPath: global ?
|
|
11854
|
+
relativeDirPath: global ? join81(".config", "opencode", "skill") : join81(".opencode", "skill")
|
|
11631
11855
|
};
|
|
11632
11856
|
}
|
|
11633
11857
|
getFrontmatter() {
|
|
@@ -11713,9 +11937,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
11713
11937
|
});
|
|
11714
11938
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11715
11939
|
if (!result.success) {
|
|
11716
|
-
const skillDirPath =
|
|
11940
|
+
const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11717
11941
|
throw new Error(
|
|
11718
|
-
`Invalid frontmatter in ${
|
|
11942
|
+
`Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11719
11943
|
);
|
|
11720
11944
|
}
|
|
11721
11945
|
return new _OpenCodeSkill({
|
|
@@ -11749,16 +11973,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
11749
11973
|
};
|
|
11750
11974
|
|
|
11751
11975
|
// src/features/skills/replit-skill.ts
|
|
11752
|
-
import { join as
|
|
11753
|
-
import { z as
|
|
11754
|
-
var ReplitSkillFrontmatterSchema =
|
|
11755
|
-
name:
|
|
11756
|
-
description:
|
|
11976
|
+
import { join as join82 } from "path";
|
|
11977
|
+
import { z as z43 } from "zod/mini";
|
|
11978
|
+
var ReplitSkillFrontmatterSchema = z43.looseObject({
|
|
11979
|
+
name: z43.string(),
|
|
11980
|
+
description: z43.string()
|
|
11757
11981
|
});
|
|
11758
11982
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
11759
11983
|
constructor({
|
|
11760
11984
|
baseDir = process.cwd(),
|
|
11761
|
-
relativeDirPath =
|
|
11985
|
+
relativeDirPath = join82(".agents", "skills"),
|
|
11762
11986
|
dirName,
|
|
11763
11987
|
frontmatter,
|
|
11764
11988
|
body,
|
|
@@ -11790,7 +12014,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
11790
12014
|
throw new Error("ReplitSkill does not support global mode.");
|
|
11791
12015
|
}
|
|
11792
12016
|
return {
|
|
11793
|
-
relativeDirPath:
|
|
12017
|
+
relativeDirPath: join82(".agents", "skills")
|
|
11794
12018
|
};
|
|
11795
12019
|
}
|
|
11796
12020
|
getFrontmatter() {
|
|
@@ -11870,9 +12094,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
11870
12094
|
});
|
|
11871
12095
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11872
12096
|
if (!result.success) {
|
|
11873
|
-
const skillDirPath =
|
|
12097
|
+
const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11874
12098
|
throw new Error(
|
|
11875
|
-
`Invalid frontmatter in ${
|
|
12099
|
+
`Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11876
12100
|
);
|
|
11877
12101
|
}
|
|
11878
12102
|
return new _ReplitSkill({
|
|
@@ -11907,16 +12131,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
11907
12131
|
};
|
|
11908
12132
|
|
|
11909
12133
|
// src/features/skills/roo-skill.ts
|
|
11910
|
-
import { join as
|
|
11911
|
-
import { z as
|
|
11912
|
-
var RooSkillFrontmatterSchema =
|
|
11913
|
-
name:
|
|
11914
|
-
description:
|
|
12134
|
+
import { join as join83 } from "path";
|
|
12135
|
+
import { z as z44 } from "zod/mini";
|
|
12136
|
+
var RooSkillFrontmatterSchema = z44.looseObject({
|
|
12137
|
+
name: z44.string(),
|
|
12138
|
+
description: z44.string()
|
|
11915
12139
|
});
|
|
11916
12140
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
11917
12141
|
constructor({
|
|
11918
12142
|
baseDir = process.cwd(),
|
|
11919
|
-
relativeDirPath =
|
|
12143
|
+
relativeDirPath = join83(".roo", "skills"),
|
|
11920
12144
|
dirName,
|
|
11921
12145
|
frontmatter,
|
|
11922
12146
|
body,
|
|
@@ -11947,7 +12171,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
11947
12171
|
global: _global = false
|
|
11948
12172
|
} = {}) {
|
|
11949
12173
|
return {
|
|
11950
|
-
relativeDirPath:
|
|
12174
|
+
relativeDirPath: join83(".roo", "skills")
|
|
11951
12175
|
};
|
|
11952
12176
|
}
|
|
11953
12177
|
getFrontmatter() {
|
|
@@ -12035,13 +12259,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
12035
12259
|
});
|
|
12036
12260
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12037
12261
|
if (!result.success) {
|
|
12038
|
-
const skillDirPath =
|
|
12262
|
+
const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12039
12263
|
throw new Error(
|
|
12040
|
-
`Invalid frontmatter in ${
|
|
12264
|
+
`Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12041
12265
|
);
|
|
12042
12266
|
}
|
|
12043
12267
|
if (result.data.name !== loaded.dirName) {
|
|
12044
|
-
const skillFilePath =
|
|
12268
|
+
const skillFilePath = join83(
|
|
12045
12269
|
loaded.baseDir,
|
|
12046
12270
|
loaded.relativeDirPath,
|
|
12047
12271
|
loaded.dirName,
|
|
@@ -12082,14 +12306,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
12082
12306
|
};
|
|
12083
12307
|
|
|
12084
12308
|
// src/features/skills/skills-utils.ts
|
|
12085
|
-
import { basename as basename4, join as
|
|
12309
|
+
import { basename as basename4, join as join84 } from "path";
|
|
12086
12310
|
async function getLocalSkillDirNames(baseDir) {
|
|
12087
|
-
const skillsDir =
|
|
12311
|
+
const skillsDir = join84(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
12088
12312
|
const names = /* @__PURE__ */ new Set();
|
|
12089
12313
|
if (!await directoryExists(skillsDir)) {
|
|
12090
12314
|
return names;
|
|
12091
12315
|
}
|
|
12092
|
-
const dirPaths = await findFilesByGlobs(
|
|
12316
|
+
const dirPaths = await findFilesByGlobs(join84(skillsDir, "*"), { type: "dir" });
|
|
12093
12317
|
for (const dirPath of dirPaths) {
|
|
12094
12318
|
const name = basename4(dirPath);
|
|
12095
12319
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -12120,7 +12344,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
12120
12344
|
"roo",
|
|
12121
12345
|
"rovodev"
|
|
12122
12346
|
];
|
|
12123
|
-
var SkillsProcessorToolTargetSchema =
|
|
12347
|
+
var SkillsProcessorToolTargetSchema = z45.enum(skillsProcessorToolTargetTuple);
|
|
12124
12348
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
12125
12349
|
[
|
|
12126
12350
|
"agentsmd",
|
|
@@ -12344,10 +12568,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
12344
12568
|
)
|
|
12345
12569
|
);
|
|
12346
12570
|
const localSkillNames = new Set(localDirNames);
|
|
12347
|
-
const curatedDirPath =
|
|
12571
|
+
const curatedDirPath = join85(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
12348
12572
|
let curatedSkills = [];
|
|
12349
12573
|
if (await directoryExists(curatedDirPath)) {
|
|
12350
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
12574
|
+
const curatedDirPaths = await findFilesByGlobs(join85(curatedDirPath, "*"), { type: "dir" });
|
|
12351
12575
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
12352
12576
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
12353
12577
|
if (localSkillNames.has(name)) {
|
|
@@ -12385,11 +12609,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
12385
12609
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
12386
12610
|
const loadEntries = [];
|
|
12387
12611
|
for (const root of roots) {
|
|
12388
|
-
const skillsDirPath =
|
|
12612
|
+
const skillsDirPath = join85(this.baseDir, root);
|
|
12389
12613
|
if (!await directoryExists(skillsDirPath)) {
|
|
12390
12614
|
continue;
|
|
12391
12615
|
}
|
|
12392
|
-
const dirPaths = await findFilesByGlobs(
|
|
12616
|
+
const dirPaths = await findFilesByGlobs(join85(skillsDirPath, "*"), { type: "dir" });
|
|
12393
12617
|
for (const dirPath of dirPaths) {
|
|
12394
12618
|
const dirName = basename5(dirPath);
|
|
12395
12619
|
if (seenDirNames.has(dirName)) {
|
|
@@ -12420,21 +12644,20 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
12420
12644
|
const roots = toolSkillSearchRoots(paths);
|
|
12421
12645
|
const toolSkills = [];
|
|
12422
12646
|
for (const root of roots) {
|
|
12423
|
-
const skillsDirPath =
|
|
12647
|
+
const skillsDirPath = join85(this.baseDir, root);
|
|
12424
12648
|
if (!await directoryExists(skillsDirPath)) {
|
|
12425
12649
|
continue;
|
|
12426
12650
|
}
|
|
12427
|
-
const dirPaths = await findFilesByGlobs(
|
|
12651
|
+
const dirPaths = await findFilesByGlobs(join85(skillsDirPath, "*"), { type: "dir" });
|
|
12428
12652
|
for (const dirPath of dirPaths) {
|
|
12429
12653
|
const dirName = basename5(dirPath);
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
);
|
|
12654
|
+
const toolSkill = factory.class.forDeletion({
|
|
12655
|
+
baseDir: this.baseDir,
|
|
12656
|
+
relativeDirPath: root,
|
|
12657
|
+
dirName,
|
|
12658
|
+
global: this.global
|
|
12659
|
+
});
|
|
12660
|
+
toolSkills.push(toolSkill);
|
|
12438
12661
|
}
|
|
12439
12662
|
}
|
|
12440
12663
|
this.logger.debug(
|
|
@@ -12489,11 +12712,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
12489
12712
|
};
|
|
12490
12713
|
|
|
12491
12714
|
// src/features/subagents/agentsmd-subagent.ts
|
|
12492
|
-
import { join as
|
|
12715
|
+
import { join as join87 } from "path";
|
|
12493
12716
|
|
|
12494
12717
|
// src/features/subagents/simulated-subagent.ts
|
|
12495
|
-
import { basename as basename6, join as
|
|
12496
|
-
import { z as
|
|
12718
|
+
import { basename as basename6, join as join86 } from "path";
|
|
12719
|
+
import { z as z46 } from "zod/mini";
|
|
12497
12720
|
|
|
12498
12721
|
// src/features/subagents/tool-subagent.ts
|
|
12499
12722
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -12545,9 +12768,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
12545
12768
|
};
|
|
12546
12769
|
|
|
12547
12770
|
// src/features/subagents/simulated-subagent.ts
|
|
12548
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
12549
|
-
name:
|
|
12550
|
-
description:
|
|
12771
|
+
var SimulatedSubagentFrontmatterSchema = z46.object({
|
|
12772
|
+
name: z46.string(),
|
|
12773
|
+
description: z46.optional(z46.string())
|
|
12551
12774
|
});
|
|
12552
12775
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
12553
12776
|
frontmatter;
|
|
@@ -12557,7 +12780,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
12557
12780
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12558
12781
|
if (!result.success) {
|
|
12559
12782
|
throw new Error(
|
|
12560
|
-
`Invalid frontmatter in ${
|
|
12783
|
+
`Invalid frontmatter in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12561
12784
|
);
|
|
12562
12785
|
}
|
|
12563
12786
|
}
|
|
@@ -12608,7 +12831,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
12608
12831
|
return {
|
|
12609
12832
|
success: false,
|
|
12610
12833
|
error: new Error(
|
|
12611
|
-
`Invalid frontmatter in ${
|
|
12834
|
+
`Invalid frontmatter in ${join86(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12612
12835
|
)
|
|
12613
12836
|
};
|
|
12614
12837
|
}
|
|
@@ -12618,7 +12841,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
12618
12841
|
relativeFilePath,
|
|
12619
12842
|
validate = true
|
|
12620
12843
|
}) {
|
|
12621
|
-
const filePath =
|
|
12844
|
+
const filePath = join86(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
12622
12845
|
const fileContent = await readFileContent(filePath);
|
|
12623
12846
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12624
12847
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12654,7 +12877,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
12654
12877
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
12655
12878
|
static getSettablePaths() {
|
|
12656
12879
|
return {
|
|
12657
|
-
relativeDirPath:
|
|
12880
|
+
relativeDirPath: join87(".agents", "subagents")
|
|
12658
12881
|
};
|
|
12659
12882
|
}
|
|
12660
12883
|
static async fromFile(params) {
|
|
@@ -12677,11 +12900,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
12677
12900
|
};
|
|
12678
12901
|
|
|
12679
12902
|
// src/features/subagents/factorydroid-subagent.ts
|
|
12680
|
-
import { join as
|
|
12903
|
+
import { join as join88 } from "path";
|
|
12681
12904
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
12682
12905
|
static getSettablePaths(_options) {
|
|
12683
12906
|
return {
|
|
12684
|
-
relativeDirPath:
|
|
12907
|
+
relativeDirPath: join88(".factory", "droids")
|
|
12685
12908
|
};
|
|
12686
12909
|
}
|
|
12687
12910
|
static async fromFile(params) {
|
|
@@ -12704,16 +12927,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
12704
12927
|
};
|
|
12705
12928
|
|
|
12706
12929
|
// src/features/subagents/geminicli-subagent.ts
|
|
12707
|
-
import {
|
|
12708
|
-
import { z as
|
|
12930
|
+
import { join as join90 } from "path";
|
|
12931
|
+
import { z as z48 } from "zod/mini";
|
|
12709
12932
|
|
|
12710
12933
|
// src/features/subagents/rulesync-subagent.ts
|
|
12711
|
-
import { basename as basename7, join as
|
|
12712
|
-
import { z as
|
|
12713
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
12714
|
-
targets:
|
|
12715
|
-
name:
|
|
12716
|
-
description:
|
|
12934
|
+
import { basename as basename7, join as join89 } from "path";
|
|
12935
|
+
import { z as z47 } from "zod/mini";
|
|
12936
|
+
var RulesyncSubagentFrontmatterSchema = z47.looseObject({
|
|
12937
|
+
targets: z47._default(RulesyncTargetsSchema, ["*"]),
|
|
12938
|
+
name: z47.string(),
|
|
12939
|
+
description: z47.optional(z47.string())
|
|
12717
12940
|
});
|
|
12718
12941
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
12719
12942
|
frontmatter;
|
|
@@ -12722,7 +12945,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
12722
12945
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12723
12946
|
if (!parseResult.success && rest.validate !== false) {
|
|
12724
12947
|
throw new Error(
|
|
12725
|
-
`Invalid frontmatter in ${
|
|
12948
|
+
`Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
12726
12949
|
);
|
|
12727
12950
|
}
|
|
12728
12951
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -12755,7 +12978,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
12755
12978
|
return {
|
|
12756
12979
|
success: false,
|
|
12757
12980
|
error: new Error(
|
|
12758
|
-
`Invalid frontmatter in ${
|
|
12981
|
+
`Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12759
12982
|
)
|
|
12760
12983
|
};
|
|
12761
12984
|
}
|
|
@@ -12763,7 +12986,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
12763
12986
|
static async fromFile({
|
|
12764
12987
|
relativeFilePath
|
|
12765
12988
|
}) {
|
|
12766
|
-
const filePath =
|
|
12989
|
+
const filePath = join89(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
12767
12990
|
const fileContent = await readFileContent(filePath);
|
|
12768
12991
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12769
12992
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12782,9 +13005,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
12782
13005
|
};
|
|
12783
13006
|
|
|
12784
13007
|
// src/features/subagents/geminicli-subagent.ts
|
|
12785
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
12786
|
-
name:
|
|
12787
|
-
description:
|
|
13008
|
+
var GeminiCliSubagentFrontmatterSchema = z48.looseObject({
|
|
13009
|
+
name: z48.string(),
|
|
13010
|
+
description: z48.optional(z48.string())
|
|
12788
13011
|
});
|
|
12789
13012
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
12790
13013
|
frontmatter;
|
|
@@ -12794,7 +13017,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12794
13017
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12795
13018
|
if (!result.success) {
|
|
12796
13019
|
throw new Error(
|
|
12797
|
-
`Invalid frontmatter in ${
|
|
13020
|
+
`Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12798
13021
|
);
|
|
12799
13022
|
}
|
|
12800
13023
|
}
|
|
@@ -12807,7 +13030,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12807
13030
|
}
|
|
12808
13031
|
static getSettablePaths(_options = {}) {
|
|
12809
13032
|
return {
|
|
12810
|
-
relativeDirPath:
|
|
13033
|
+
relativeDirPath: join90(".gemini", "agents")
|
|
12811
13034
|
};
|
|
12812
13035
|
}
|
|
12813
13036
|
getFrontmatter() {
|
|
@@ -12875,7 +13098,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12875
13098
|
return {
|
|
12876
13099
|
success: false,
|
|
12877
13100
|
error: new Error(
|
|
12878
|
-
`Invalid frontmatter in ${
|
|
13101
|
+
`Invalid frontmatter in ${join90(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12879
13102
|
)
|
|
12880
13103
|
};
|
|
12881
13104
|
}
|
|
@@ -12893,7 +13116,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12893
13116
|
global = false
|
|
12894
13117
|
}) {
|
|
12895
13118
|
const paths = this.getSettablePaths({ global });
|
|
12896
|
-
const filePath =
|
|
13119
|
+
const filePath = join90(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12897
13120
|
const fileContent = await readFileContent(filePath);
|
|
12898
13121
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12899
13122
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12903,7 +13126,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12903
13126
|
return new _GeminiCliSubagent({
|
|
12904
13127
|
baseDir,
|
|
12905
13128
|
relativeDirPath: paths.relativeDirPath,
|
|
12906
|
-
relativeFilePath
|
|
13129
|
+
relativeFilePath,
|
|
12907
13130
|
frontmatter: result.data,
|
|
12908
13131
|
body: content.trim(),
|
|
12909
13132
|
fileContent,
|
|
@@ -12929,11 +13152,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
12929
13152
|
};
|
|
12930
13153
|
|
|
12931
13154
|
// src/features/subagents/roo-subagent.ts
|
|
12932
|
-
import { join as
|
|
13155
|
+
import { join as join91 } from "path";
|
|
12933
13156
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
12934
13157
|
static getSettablePaths() {
|
|
12935
13158
|
return {
|
|
12936
|
-
relativeDirPath:
|
|
13159
|
+
relativeDirPath: join91(".roo", "subagents")
|
|
12937
13160
|
};
|
|
12938
13161
|
}
|
|
12939
13162
|
static async fromFile(params) {
|
|
@@ -12956,11 +13179,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
12956
13179
|
};
|
|
12957
13180
|
|
|
12958
13181
|
// src/features/subagents/rovodev-subagent.ts
|
|
12959
|
-
import { join as
|
|
12960
|
-
import { z as
|
|
12961
|
-
var RovodevSubagentFrontmatterSchema =
|
|
12962
|
-
name:
|
|
12963
|
-
description:
|
|
13182
|
+
import { join as join92 } from "path";
|
|
13183
|
+
import { z as z49 } from "zod/mini";
|
|
13184
|
+
var RovodevSubagentFrontmatterSchema = z49.looseObject({
|
|
13185
|
+
name: z49.string(),
|
|
13186
|
+
description: z49.optional(z49.string())
|
|
12964
13187
|
});
|
|
12965
13188
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
12966
13189
|
frontmatter;
|
|
@@ -12970,7 +13193,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
12970
13193
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12971
13194
|
if (!result.success) {
|
|
12972
13195
|
throw new Error(
|
|
12973
|
-
`Invalid frontmatter in ${
|
|
13196
|
+
`Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12974
13197
|
);
|
|
12975
13198
|
}
|
|
12976
13199
|
}
|
|
@@ -12982,7 +13205,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
12982
13205
|
}
|
|
12983
13206
|
static getSettablePaths(_options = {}) {
|
|
12984
13207
|
return {
|
|
12985
|
-
relativeDirPath:
|
|
13208
|
+
relativeDirPath: join92(".rovodev", "subagents")
|
|
12986
13209
|
};
|
|
12987
13210
|
}
|
|
12988
13211
|
getFrontmatter() {
|
|
@@ -13045,7 +13268,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13045
13268
|
return {
|
|
13046
13269
|
success: false,
|
|
13047
13270
|
error: new Error(
|
|
13048
|
-
`Invalid frontmatter in ${
|
|
13271
|
+
`Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13049
13272
|
)
|
|
13050
13273
|
};
|
|
13051
13274
|
}
|
|
@@ -13062,7 +13285,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13062
13285
|
global = false
|
|
13063
13286
|
}) {
|
|
13064
13287
|
const paths = this.getSettablePaths({ global });
|
|
13065
|
-
const filePath =
|
|
13288
|
+
const filePath = join92(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13066
13289
|
const fileContent = await readFileContent(filePath);
|
|
13067
13290
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13068
13291
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13101,19 +13324,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13101
13324
|
};
|
|
13102
13325
|
|
|
13103
13326
|
// src/features/subagents/subagents-processor.ts
|
|
13104
|
-
import { basename as
|
|
13105
|
-
import { z as
|
|
13327
|
+
import { basename as basename9, join as join103 } from "path";
|
|
13328
|
+
import { z as z58 } from "zod/mini";
|
|
13106
13329
|
|
|
13107
13330
|
// src/features/subagents/claudecode-subagent.ts
|
|
13108
|
-
import { join as
|
|
13109
|
-
import { z as
|
|
13110
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
13111
|
-
name:
|
|
13112
|
-
description:
|
|
13113
|
-
model:
|
|
13114
|
-
tools:
|
|
13115
|
-
permissionMode:
|
|
13116
|
-
skills:
|
|
13331
|
+
import { join as join93 } from "path";
|
|
13332
|
+
import { z as z50 } from "zod/mini";
|
|
13333
|
+
var ClaudecodeSubagentFrontmatterSchema = z50.looseObject({
|
|
13334
|
+
name: z50.string(),
|
|
13335
|
+
description: z50.optional(z50.string()),
|
|
13336
|
+
model: z50.optional(z50.string()),
|
|
13337
|
+
tools: z50.optional(z50.union([z50.string(), z50.array(z50.string())])),
|
|
13338
|
+
permissionMode: z50.optional(z50.string()),
|
|
13339
|
+
skills: z50.optional(z50.union([z50.string(), z50.array(z50.string())]))
|
|
13117
13340
|
});
|
|
13118
13341
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
13119
13342
|
frontmatter;
|
|
@@ -13123,7 +13346,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
13123
13346
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13124
13347
|
if (!result.success) {
|
|
13125
13348
|
throw new Error(
|
|
13126
|
-
`Invalid frontmatter in ${
|
|
13349
|
+
`Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13127
13350
|
);
|
|
13128
13351
|
}
|
|
13129
13352
|
}
|
|
@@ -13135,7 +13358,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
13135
13358
|
}
|
|
13136
13359
|
static getSettablePaths(_options = {}) {
|
|
13137
13360
|
return {
|
|
13138
|
-
relativeDirPath:
|
|
13361
|
+
relativeDirPath: join93(".claude", "agents")
|
|
13139
13362
|
};
|
|
13140
13363
|
}
|
|
13141
13364
|
getFrontmatter() {
|
|
@@ -13214,7 +13437,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
13214
13437
|
return {
|
|
13215
13438
|
success: false,
|
|
13216
13439
|
error: new Error(
|
|
13217
|
-
`Invalid frontmatter in ${
|
|
13440
|
+
`Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13218
13441
|
)
|
|
13219
13442
|
};
|
|
13220
13443
|
}
|
|
@@ -13232,7 +13455,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
13232
13455
|
global = false
|
|
13233
13456
|
}) {
|
|
13234
13457
|
const paths = this.getSettablePaths({ global });
|
|
13235
|
-
const filePath =
|
|
13458
|
+
const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13236
13459
|
const fileContent = await readFileContent(filePath);
|
|
13237
13460
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13238
13461
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13267,27 +13490,27 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
13267
13490
|
};
|
|
13268
13491
|
|
|
13269
13492
|
// src/features/subagents/codexcli-subagent.ts
|
|
13270
|
-
import { join as
|
|
13271
|
-
import * as
|
|
13272
|
-
import { z as
|
|
13273
|
-
var CodexCliSubagentTomlSchema =
|
|
13274
|
-
name:
|
|
13275
|
-
description:
|
|
13276
|
-
developer_instructions:
|
|
13277
|
-
model:
|
|
13278
|
-
model_reasoning_effort:
|
|
13279
|
-
sandbox_mode:
|
|
13493
|
+
import { join as join94 } from "path";
|
|
13494
|
+
import * as smolToml4 from "smol-toml";
|
|
13495
|
+
import { z as z51 } from "zod/mini";
|
|
13496
|
+
var CodexCliSubagentTomlSchema = z51.looseObject({
|
|
13497
|
+
name: z51.string(),
|
|
13498
|
+
description: z51.optional(z51.string()),
|
|
13499
|
+
developer_instructions: z51.optional(z51.string()),
|
|
13500
|
+
model: z51.optional(z51.string()),
|
|
13501
|
+
model_reasoning_effort: z51.optional(z51.string()),
|
|
13502
|
+
sandbox_mode: z51.optional(z51.string())
|
|
13280
13503
|
});
|
|
13281
13504
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
13282
13505
|
body;
|
|
13283
13506
|
constructor({ body, ...rest }) {
|
|
13284
13507
|
if (rest.validate !== false) {
|
|
13285
13508
|
try {
|
|
13286
|
-
const parsed =
|
|
13509
|
+
const parsed = smolToml4.parse(body);
|
|
13287
13510
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
13288
13511
|
} catch (error) {
|
|
13289
13512
|
throw new Error(
|
|
13290
|
-
`Invalid TOML in ${
|
|
13513
|
+
`Invalid TOML in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
13291
13514
|
{ cause: error }
|
|
13292
13515
|
);
|
|
13293
13516
|
}
|
|
@@ -13299,7 +13522,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13299
13522
|
}
|
|
13300
13523
|
static getSettablePaths(_options = {}) {
|
|
13301
13524
|
return {
|
|
13302
|
-
relativeDirPath:
|
|
13525
|
+
relativeDirPath: join94(".codex", "agents")
|
|
13303
13526
|
};
|
|
13304
13527
|
}
|
|
13305
13528
|
getBody() {
|
|
@@ -13308,10 +13531,10 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13308
13531
|
toRulesyncSubagent() {
|
|
13309
13532
|
let parsed;
|
|
13310
13533
|
try {
|
|
13311
|
-
parsed = CodexCliSubagentTomlSchema.parse(
|
|
13534
|
+
parsed = CodexCliSubagentTomlSchema.parse(smolToml4.parse(this.body));
|
|
13312
13535
|
} catch (error) {
|
|
13313
13536
|
throw new Error(
|
|
13314
|
-
`Failed to parse TOML in ${
|
|
13537
|
+
`Failed to parse TOML in ${join94(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
13315
13538
|
{ cause: error }
|
|
13316
13539
|
);
|
|
13317
13540
|
}
|
|
@@ -13354,7 +13577,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13354
13577
|
...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
|
|
13355
13578
|
...codexcliSection
|
|
13356
13579
|
};
|
|
13357
|
-
const body =
|
|
13580
|
+
const body = smolToml4.stringify(tomlObj);
|
|
13358
13581
|
const paths = this.getSettablePaths({ global });
|
|
13359
13582
|
const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
|
|
13360
13583
|
return new _CodexCliSubagent({
|
|
@@ -13369,7 +13592,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13369
13592
|
}
|
|
13370
13593
|
validate() {
|
|
13371
13594
|
try {
|
|
13372
|
-
const parsed =
|
|
13595
|
+
const parsed = smolToml4.parse(this.body);
|
|
13373
13596
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
13374
13597
|
return { success: true, error: null };
|
|
13375
13598
|
} catch (error) {
|
|
@@ -13392,7 +13615,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13392
13615
|
global = false
|
|
13393
13616
|
}) {
|
|
13394
13617
|
const paths = this.getSettablePaths({ global });
|
|
13395
|
-
const filePath =
|
|
13618
|
+
const filePath = join94(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13396
13619
|
const fileContent = await readFileContent(filePath);
|
|
13397
13620
|
const subagent = new _CodexCliSubagent({
|
|
13398
13621
|
baseDir,
|
|
@@ -13430,13 +13653,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
13430
13653
|
};
|
|
13431
13654
|
|
|
13432
13655
|
// src/features/subagents/copilot-subagent.ts
|
|
13433
|
-
import { join as
|
|
13434
|
-
import { z as
|
|
13656
|
+
import { join as join95 } from "path";
|
|
13657
|
+
import { z as z52 } from "zod/mini";
|
|
13435
13658
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
13436
|
-
var CopilotSubagentFrontmatterSchema =
|
|
13437
|
-
name:
|
|
13438
|
-
description:
|
|
13439
|
-
tools:
|
|
13659
|
+
var CopilotSubagentFrontmatterSchema = z52.looseObject({
|
|
13660
|
+
name: z52.string(),
|
|
13661
|
+
description: z52.optional(z52.string()),
|
|
13662
|
+
tools: z52.optional(z52.union([z52.string(), z52.array(z52.string())]))
|
|
13440
13663
|
});
|
|
13441
13664
|
var normalizeTools = (tools) => {
|
|
13442
13665
|
if (!tools) {
|
|
@@ -13456,7 +13679,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
13456
13679
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13457
13680
|
if (!result.success) {
|
|
13458
13681
|
throw new Error(
|
|
13459
|
-
`Invalid frontmatter in ${
|
|
13682
|
+
`Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13460
13683
|
);
|
|
13461
13684
|
}
|
|
13462
13685
|
}
|
|
@@ -13468,7 +13691,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
13468
13691
|
}
|
|
13469
13692
|
static getSettablePaths(_options = {}) {
|
|
13470
13693
|
return {
|
|
13471
|
-
relativeDirPath:
|
|
13694
|
+
relativeDirPath: join95(".github", "agents")
|
|
13472
13695
|
};
|
|
13473
13696
|
}
|
|
13474
13697
|
getFrontmatter() {
|
|
@@ -13542,7 +13765,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
13542
13765
|
return {
|
|
13543
13766
|
success: false,
|
|
13544
13767
|
error: new Error(
|
|
13545
|
-
`Invalid frontmatter in ${
|
|
13768
|
+
`Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13546
13769
|
)
|
|
13547
13770
|
};
|
|
13548
13771
|
}
|
|
@@ -13560,7 +13783,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
13560
13783
|
global = false
|
|
13561
13784
|
}) {
|
|
13562
13785
|
const paths = this.getSettablePaths({ global });
|
|
13563
|
-
const filePath =
|
|
13786
|
+
const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13564
13787
|
const fileContent = await readFileContent(filePath);
|
|
13565
13788
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13566
13789
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13596,11 +13819,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
13596
13819
|
};
|
|
13597
13820
|
|
|
13598
13821
|
// src/features/subagents/cursor-subagent.ts
|
|
13599
|
-
import { join as
|
|
13600
|
-
import { z as
|
|
13601
|
-
var CursorSubagentFrontmatterSchema =
|
|
13602
|
-
name:
|
|
13603
|
-
description:
|
|
13822
|
+
import { join as join96 } from "path";
|
|
13823
|
+
import { z as z53 } from "zod/mini";
|
|
13824
|
+
var CursorSubagentFrontmatterSchema = z53.looseObject({
|
|
13825
|
+
name: z53.string(),
|
|
13826
|
+
description: z53.optional(z53.string())
|
|
13604
13827
|
});
|
|
13605
13828
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
13606
13829
|
frontmatter;
|
|
@@ -13610,7 +13833,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
13610
13833
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13611
13834
|
if (!result.success) {
|
|
13612
13835
|
throw new Error(
|
|
13613
|
-
`Invalid frontmatter in ${
|
|
13836
|
+
`Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13614
13837
|
);
|
|
13615
13838
|
}
|
|
13616
13839
|
}
|
|
@@ -13622,7 +13845,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
13622
13845
|
}
|
|
13623
13846
|
static getSettablePaths(_options = {}) {
|
|
13624
13847
|
return {
|
|
13625
|
-
relativeDirPath:
|
|
13848
|
+
relativeDirPath: join96(".cursor", "agents")
|
|
13626
13849
|
};
|
|
13627
13850
|
}
|
|
13628
13851
|
getFrontmatter() {
|
|
@@ -13689,7 +13912,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
13689
13912
|
return {
|
|
13690
13913
|
success: false,
|
|
13691
13914
|
error: new Error(
|
|
13692
|
-
`Invalid frontmatter in ${
|
|
13915
|
+
`Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13693
13916
|
)
|
|
13694
13917
|
};
|
|
13695
13918
|
}
|
|
@@ -13707,7 +13930,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
13707
13930
|
global = false
|
|
13708
13931
|
}) {
|
|
13709
13932
|
const paths = this.getSettablePaths({ global });
|
|
13710
|
-
const filePath =
|
|
13933
|
+
const filePath = join96(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13711
13934
|
const fileContent = await readFileContent(filePath);
|
|
13712
13935
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13713
13936
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13743,12 +13966,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
13743
13966
|
};
|
|
13744
13967
|
|
|
13745
13968
|
// src/features/subagents/deepagents-subagent.ts
|
|
13746
|
-
import { join as
|
|
13747
|
-
import { z as
|
|
13748
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
13749
|
-
name:
|
|
13750
|
-
description:
|
|
13751
|
-
model:
|
|
13969
|
+
import { join as join97 } from "path";
|
|
13970
|
+
import { z as z54 } from "zod/mini";
|
|
13971
|
+
var DeepagentsSubagentFrontmatterSchema = z54.looseObject({
|
|
13972
|
+
name: z54.string(),
|
|
13973
|
+
description: z54.optional(z54.string()),
|
|
13974
|
+
model: z54.optional(z54.string())
|
|
13752
13975
|
});
|
|
13753
13976
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
13754
13977
|
frontmatter;
|
|
@@ -13758,7 +13981,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
13758
13981
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13759
13982
|
if (!result.success) {
|
|
13760
13983
|
throw new Error(
|
|
13761
|
-
`Invalid frontmatter in ${
|
|
13984
|
+
`Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13762
13985
|
);
|
|
13763
13986
|
}
|
|
13764
13987
|
}
|
|
@@ -13768,7 +13991,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
13768
13991
|
}
|
|
13769
13992
|
static getSettablePaths(_options = {}) {
|
|
13770
13993
|
return {
|
|
13771
|
-
relativeDirPath:
|
|
13994
|
+
relativeDirPath: join97(".deepagents", "agents")
|
|
13772
13995
|
};
|
|
13773
13996
|
}
|
|
13774
13997
|
getFrontmatter() {
|
|
@@ -13843,7 +14066,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
13843
14066
|
return {
|
|
13844
14067
|
success: false,
|
|
13845
14068
|
error: new Error(
|
|
13846
|
-
`Invalid frontmatter in ${
|
|
14069
|
+
`Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13847
14070
|
)
|
|
13848
14071
|
};
|
|
13849
14072
|
}
|
|
@@ -13861,7 +14084,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
13861
14084
|
global = false
|
|
13862
14085
|
}) {
|
|
13863
14086
|
const paths = this.getSettablePaths({ global });
|
|
13864
|
-
const filePath =
|
|
14087
|
+
const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13865
14088
|
const fileContent = await readFileContent(filePath);
|
|
13866
14089
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13867
14090
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13896,11 +14119,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
13896
14119
|
};
|
|
13897
14120
|
|
|
13898
14121
|
// src/features/subagents/junie-subagent.ts
|
|
13899
|
-
import { join as
|
|
13900
|
-
import { z as
|
|
13901
|
-
var JunieSubagentFrontmatterSchema =
|
|
13902
|
-
name:
|
|
13903
|
-
description:
|
|
14122
|
+
import { join as join98 } from "path";
|
|
14123
|
+
import { z as z55 } from "zod/mini";
|
|
14124
|
+
var JunieSubagentFrontmatterSchema = z55.looseObject({
|
|
14125
|
+
name: z55.optional(z55.string()),
|
|
14126
|
+
description: z55.string()
|
|
13904
14127
|
});
|
|
13905
14128
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
13906
14129
|
frontmatter;
|
|
@@ -13910,7 +14133,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
13910
14133
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13911
14134
|
if (!result.success) {
|
|
13912
14135
|
throw new Error(
|
|
13913
|
-
`Invalid frontmatter in ${
|
|
14136
|
+
`Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13914
14137
|
);
|
|
13915
14138
|
}
|
|
13916
14139
|
}
|
|
@@ -13925,7 +14148,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
13925
14148
|
throw new Error("JunieSubagent does not support global mode.");
|
|
13926
14149
|
}
|
|
13927
14150
|
return {
|
|
13928
|
-
relativeDirPath:
|
|
14151
|
+
relativeDirPath: join98(".junie", "agents")
|
|
13929
14152
|
};
|
|
13930
14153
|
}
|
|
13931
14154
|
getFrontmatter() {
|
|
@@ -14001,7 +14224,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14001
14224
|
return {
|
|
14002
14225
|
success: false,
|
|
14003
14226
|
error: new Error(
|
|
14004
|
-
`Invalid frontmatter in ${
|
|
14227
|
+
`Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14005
14228
|
)
|
|
14006
14229
|
};
|
|
14007
14230
|
}
|
|
@@ -14019,7 +14242,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14019
14242
|
global = false
|
|
14020
14243
|
}) {
|
|
14021
14244
|
const paths = this.getSettablePaths({ global });
|
|
14022
|
-
const filePath =
|
|
14245
|
+
const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14023
14246
|
const fileContent = await readFileContent(filePath);
|
|
14024
14247
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14025
14248
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14054,15 +14277,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14054
14277
|
};
|
|
14055
14278
|
|
|
14056
14279
|
// src/features/subagents/kilo-subagent.ts
|
|
14057
|
-
import { join as
|
|
14280
|
+
import { join as join100 } from "path";
|
|
14058
14281
|
|
|
14059
14282
|
// src/features/subagents/opencode-style-subagent.ts
|
|
14060
|
-
import { basename as
|
|
14061
|
-
import { z as
|
|
14062
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
14063
|
-
description:
|
|
14064
|
-
mode:
|
|
14065
|
-
name:
|
|
14283
|
+
import { basename as basename8, join as join99 } from "path";
|
|
14284
|
+
import { z as z56 } from "zod/mini";
|
|
14285
|
+
var OpenCodeStyleSubagentFrontmatterSchema = z56.looseObject({
|
|
14286
|
+
description: z56.optional(z56.string()),
|
|
14287
|
+
mode: z56._default(z56.string(), "subagent"),
|
|
14288
|
+
name: z56.optional(z56.string())
|
|
14066
14289
|
});
|
|
14067
14290
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
14068
14291
|
frontmatter;
|
|
@@ -14072,7 +14295,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14072
14295
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14073
14296
|
if (!result.success) {
|
|
14074
14297
|
throw new Error(
|
|
14075
|
-
`Invalid frontmatter in ${
|
|
14298
|
+
`Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14076
14299
|
);
|
|
14077
14300
|
}
|
|
14078
14301
|
}
|
|
@@ -14092,7 +14315,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14092
14315
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
14093
14316
|
const rulesyncFrontmatter = {
|
|
14094
14317
|
targets: ["*"],
|
|
14095
|
-
name: name ??
|
|
14318
|
+
name: name ?? basename8(this.getRelativeFilePath(), ".md"),
|
|
14096
14319
|
description,
|
|
14097
14320
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
14098
14321
|
};
|
|
@@ -14114,7 +14337,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14114
14337
|
return {
|
|
14115
14338
|
success: false,
|
|
14116
14339
|
error: new Error(
|
|
14117
|
-
`Invalid frontmatter in ${
|
|
14340
|
+
`Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14118
14341
|
)
|
|
14119
14342
|
};
|
|
14120
14343
|
}
|
|
@@ -14130,7 +14353,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
14130
14353
|
global = false
|
|
14131
14354
|
} = {}) {
|
|
14132
14355
|
return {
|
|
14133
|
-
relativeDirPath: global ?
|
|
14356
|
+
relativeDirPath: global ? join100(".config", "kilo", "agent") : join100(".kilo", "agent")
|
|
14134
14357
|
};
|
|
14135
14358
|
}
|
|
14136
14359
|
static fromRulesyncSubagent({
|
|
@@ -14174,7 +14397,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
14174
14397
|
global = false
|
|
14175
14398
|
}) {
|
|
14176
14399
|
const paths = this.getSettablePaths({ global });
|
|
14177
|
-
const filePath =
|
|
14400
|
+
const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14178
14401
|
const fileContent = await readFileContent(filePath);
|
|
14179
14402
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14180
14403
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14210,23 +14433,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
14210
14433
|
};
|
|
14211
14434
|
|
|
14212
14435
|
// src/features/subagents/kiro-subagent.ts
|
|
14213
|
-
import { join as
|
|
14214
|
-
import { z as
|
|
14215
|
-
var KiroCliSubagentJsonSchema =
|
|
14216
|
-
name:
|
|
14217
|
-
description:
|
|
14218
|
-
prompt:
|
|
14219
|
-
tools:
|
|
14220
|
-
toolAliases:
|
|
14221
|
-
toolSettings:
|
|
14222
|
-
toolSchema:
|
|
14223
|
-
hooks:
|
|
14224
|
-
model:
|
|
14225
|
-
mcpServers:
|
|
14226
|
-
useLegacyMcpJson:
|
|
14227
|
-
resources:
|
|
14228
|
-
allowedTools:
|
|
14229
|
-
includeMcpJson:
|
|
14436
|
+
import { join as join101 } from "path";
|
|
14437
|
+
import { z as z57 } from "zod/mini";
|
|
14438
|
+
var KiroCliSubagentJsonSchema = z57.looseObject({
|
|
14439
|
+
name: z57.string(),
|
|
14440
|
+
description: z57.optional(z57.nullable(z57.string())),
|
|
14441
|
+
prompt: z57.optional(z57.nullable(z57.string())),
|
|
14442
|
+
tools: z57.optional(z57.nullable(z57.array(z57.string()))),
|
|
14443
|
+
toolAliases: z57.optional(z57.nullable(z57.record(z57.string(), z57.string()))),
|
|
14444
|
+
toolSettings: z57.optional(z57.nullable(z57.unknown())),
|
|
14445
|
+
toolSchema: z57.optional(z57.nullable(z57.unknown())),
|
|
14446
|
+
hooks: z57.optional(z57.nullable(z57.record(z57.string(), z57.array(z57.unknown())))),
|
|
14447
|
+
model: z57.optional(z57.nullable(z57.string())),
|
|
14448
|
+
mcpServers: z57.optional(z57.nullable(z57.record(z57.string(), z57.unknown()))),
|
|
14449
|
+
useLegacyMcpJson: z57.optional(z57.nullable(z57.boolean())),
|
|
14450
|
+
resources: z57.optional(z57.nullable(z57.array(z57.string()))),
|
|
14451
|
+
allowedTools: z57.optional(z57.nullable(z57.array(z57.string()))),
|
|
14452
|
+
includeMcpJson: z57.optional(z57.nullable(z57.boolean()))
|
|
14230
14453
|
});
|
|
14231
14454
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
14232
14455
|
body;
|
|
@@ -14237,7 +14460,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
14237
14460
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
14238
14461
|
} catch (error) {
|
|
14239
14462
|
throw new Error(
|
|
14240
|
-
`Invalid JSON in ${
|
|
14463
|
+
`Invalid JSON in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14241
14464
|
{ cause: error }
|
|
14242
14465
|
);
|
|
14243
14466
|
}
|
|
@@ -14249,7 +14472,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
14249
14472
|
}
|
|
14250
14473
|
static getSettablePaths(_options = {}) {
|
|
14251
14474
|
return {
|
|
14252
|
-
relativeDirPath:
|
|
14475
|
+
relativeDirPath: join101(".kiro", "agents")
|
|
14253
14476
|
};
|
|
14254
14477
|
}
|
|
14255
14478
|
getBody() {
|
|
@@ -14261,7 +14484,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
14261
14484
|
parsed = JSON.parse(this.body);
|
|
14262
14485
|
} catch (error) {
|
|
14263
14486
|
throw new Error(
|
|
14264
|
-
`Failed to parse JSON in ${
|
|
14487
|
+
`Failed to parse JSON in ${join101(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14265
14488
|
{ cause: error }
|
|
14266
14489
|
);
|
|
14267
14490
|
}
|
|
@@ -14342,7 +14565,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
14342
14565
|
global = false
|
|
14343
14566
|
}) {
|
|
14344
14567
|
const paths = this.getSettablePaths({ global });
|
|
14345
|
-
const filePath =
|
|
14568
|
+
const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14346
14569
|
const fileContent = await readFileContent(filePath);
|
|
14347
14570
|
const subagent = new _KiroSubagent({
|
|
14348
14571
|
baseDir,
|
|
@@ -14380,7 +14603,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
14380
14603
|
};
|
|
14381
14604
|
|
|
14382
14605
|
// src/features/subagents/opencode-subagent.ts
|
|
14383
|
-
import { join as
|
|
14606
|
+
import { join as join102 } from "path";
|
|
14384
14607
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
14385
14608
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
14386
14609
|
getToolTarget() {
|
|
@@ -14390,7 +14613,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
14390
14613
|
global = false
|
|
14391
14614
|
} = {}) {
|
|
14392
14615
|
return {
|
|
14393
|
-
relativeDirPath: global ?
|
|
14616
|
+
relativeDirPath: global ? join102(".config", "opencode", "agent") : join102(".opencode", "agent")
|
|
14394
14617
|
};
|
|
14395
14618
|
}
|
|
14396
14619
|
static fromRulesyncSubagent({
|
|
@@ -14434,7 +14657,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
14434
14657
|
global = false
|
|
14435
14658
|
}) {
|
|
14436
14659
|
const paths = this.getSettablePaths({ global });
|
|
14437
|
-
const filePath =
|
|
14660
|
+
const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14438
14661
|
const fileContent = await readFileContent(filePath);
|
|
14439
14662
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14440
14663
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14487,7 +14710,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
14487
14710
|
"roo",
|
|
14488
14711
|
"rovodev"
|
|
14489
14712
|
];
|
|
14490
|
-
var SubagentsProcessorToolTargetSchema =
|
|
14713
|
+
var SubagentsProcessorToolTargetSchema = z58.enum(subagentsProcessorToolTargetTuple);
|
|
14491
14714
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
14492
14715
|
[
|
|
14493
14716
|
"agentsmd",
|
|
@@ -14678,7 +14901,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14678
14901
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
14679
14902
|
*/
|
|
14680
14903
|
async loadRulesyncFiles() {
|
|
14681
|
-
const subagentsDir =
|
|
14904
|
+
const subagentsDir = join103(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
14682
14905
|
const dirExists = await directoryExists(subagentsDir);
|
|
14683
14906
|
if (!dirExists) {
|
|
14684
14907
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -14693,7 +14916,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14693
14916
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
14694
14917
|
const rulesyncSubagents = [];
|
|
14695
14918
|
for (const mdFile of mdFiles) {
|
|
14696
|
-
const filepath =
|
|
14919
|
+
const filepath = join103(subagentsDir, mdFile);
|
|
14697
14920
|
try {
|
|
14698
14921
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
14699
14922
|
relativeFilePath: mdFile,
|
|
@@ -14723,14 +14946,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14723
14946
|
const factory = this.getFactory(this.toolTarget);
|
|
14724
14947
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
14725
14948
|
const subagentFilePaths = await findFilesByGlobs(
|
|
14726
|
-
|
|
14949
|
+
join103(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
14727
14950
|
);
|
|
14728
14951
|
if (forDeletion) {
|
|
14729
14952
|
const toolSubagents2 = subagentFilePaths.map(
|
|
14730
14953
|
(path3) => factory.class.forDeletion({
|
|
14731
14954
|
baseDir: this.baseDir,
|
|
14732
14955
|
relativeDirPath: paths.relativeDirPath,
|
|
14733
|
-
relativeFilePath:
|
|
14956
|
+
relativeFilePath: basename9(path3),
|
|
14734
14957
|
global: this.global
|
|
14735
14958
|
})
|
|
14736
14959
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -14743,7 +14966,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14743
14966
|
subagentFilePaths.map(
|
|
14744
14967
|
(path3) => factory.class.fromFile({
|
|
14745
14968
|
baseDir: this.baseDir,
|
|
14746
|
-
relativeFilePath:
|
|
14969
|
+
relativeFilePath: basename9(path3),
|
|
14747
14970
|
global: this.global
|
|
14748
14971
|
})
|
|
14749
14972
|
)
|
|
@@ -14790,49 +15013,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
14790
15013
|
};
|
|
14791
15014
|
|
|
14792
15015
|
// src/features/rules/agentsmd-rule.ts
|
|
14793
|
-
import { join as
|
|
15016
|
+
import { join as join106 } from "path";
|
|
14794
15017
|
|
|
14795
15018
|
// src/features/rules/tool-rule.ts
|
|
14796
|
-
import { join as
|
|
15019
|
+
import { join as join105 } from "path";
|
|
14797
15020
|
|
|
14798
15021
|
// src/features/rules/rulesync-rule.ts
|
|
14799
|
-
import { join as
|
|
14800
|
-
import { z as
|
|
14801
|
-
var RulesyncRuleFrontmatterSchema =
|
|
14802
|
-
root:
|
|
14803
|
-
localRoot:
|
|
14804
|
-
targets:
|
|
14805
|
-
description:
|
|
14806
|
-
globs:
|
|
14807
|
-
agentsmd:
|
|
14808
|
-
|
|
15022
|
+
import { join as join104 } from "path";
|
|
15023
|
+
import { z as z59 } from "zod/mini";
|
|
15024
|
+
var RulesyncRuleFrontmatterSchema = z59.object({
|
|
15025
|
+
root: z59.optional(z59.boolean()),
|
|
15026
|
+
localRoot: z59.optional(z59.boolean()),
|
|
15027
|
+
targets: z59._default(RulesyncTargetsSchema, ["*"]),
|
|
15028
|
+
description: z59.optional(z59.string()),
|
|
15029
|
+
globs: z59.optional(z59.array(z59.string())),
|
|
15030
|
+
agentsmd: z59.optional(
|
|
15031
|
+
z59.looseObject({
|
|
14809
15032
|
// @example "path/to/subproject"
|
|
14810
|
-
subprojectPath:
|
|
15033
|
+
subprojectPath: z59.optional(z59.string())
|
|
14811
15034
|
})
|
|
14812
15035
|
),
|
|
14813
|
-
claudecode:
|
|
14814
|
-
|
|
15036
|
+
claudecode: z59.optional(
|
|
15037
|
+
z59.looseObject({
|
|
14815
15038
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
14816
15039
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
14817
|
-
paths:
|
|
15040
|
+
paths: z59.optional(z59.array(z59.string()))
|
|
14818
15041
|
})
|
|
14819
15042
|
),
|
|
14820
|
-
cursor:
|
|
14821
|
-
|
|
14822
|
-
alwaysApply:
|
|
14823
|
-
description:
|
|
14824
|
-
globs:
|
|
15043
|
+
cursor: z59.optional(
|
|
15044
|
+
z59.looseObject({
|
|
15045
|
+
alwaysApply: z59.optional(z59.boolean()),
|
|
15046
|
+
description: z59.optional(z59.string()),
|
|
15047
|
+
globs: z59.optional(z59.array(z59.string()))
|
|
14825
15048
|
})
|
|
14826
15049
|
),
|
|
14827
|
-
copilot:
|
|
14828
|
-
|
|
14829
|
-
excludeAgent:
|
|
15050
|
+
copilot: z59.optional(
|
|
15051
|
+
z59.looseObject({
|
|
15052
|
+
excludeAgent: z59.optional(z59.union([z59.literal("code-review"), z59.literal("coding-agent")]))
|
|
14830
15053
|
})
|
|
14831
15054
|
),
|
|
14832
|
-
antigravity:
|
|
14833
|
-
|
|
14834
|
-
trigger:
|
|
14835
|
-
globs:
|
|
15055
|
+
antigravity: z59.optional(
|
|
15056
|
+
z59.looseObject({
|
|
15057
|
+
trigger: z59.optional(z59.string()),
|
|
15058
|
+
globs: z59.optional(z59.array(z59.string()))
|
|
14836
15059
|
})
|
|
14837
15060
|
)
|
|
14838
15061
|
});
|
|
@@ -14843,7 +15066,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
14843
15066
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14844
15067
|
if (!parseResult.success && rest.validate !== false) {
|
|
14845
15068
|
throw new Error(
|
|
14846
|
-
`Invalid frontmatter in ${
|
|
15069
|
+
`Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14847
15070
|
);
|
|
14848
15071
|
}
|
|
14849
15072
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -14878,7 +15101,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
14878
15101
|
return {
|
|
14879
15102
|
success: false,
|
|
14880
15103
|
error: new Error(
|
|
14881
|
-
`Invalid frontmatter in ${
|
|
15104
|
+
`Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14882
15105
|
)
|
|
14883
15106
|
};
|
|
14884
15107
|
}
|
|
@@ -14887,7 +15110,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
14887
15110
|
relativeFilePath,
|
|
14888
15111
|
validate = true
|
|
14889
15112
|
}) {
|
|
14890
|
-
const filePath =
|
|
15113
|
+
const filePath = join104(
|
|
14891
15114
|
process.cwd(),
|
|
14892
15115
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
14893
15116
|
relativeFilePath
|
|
@@ -14986,7 +15209,7 @@ var ToolRule = class extends ToolFile {
|
|
|
14986
15209
|
rulesyncRule,
|
|
14987
15210
|
validate = true,
|
|
14988
15211
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
14989
|
-
nonRootPath = { relativeDirPath:
|
|
15212
|
+
nonRootPath = { relativeDirPath: join105(".agents", "memories") }
|
|
14990
15213
|
}) {
|
|
14991
15214
|
const params = this.buildToolRuleParamsDefault({
|
|
14992
15215
|
baseDir,
|
|
@@ -14997,7 +15220,7 @@ var ToolRule = class extends ToolFile {
|
|
|
14997
15220
|
});
|
|
14998
15221
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
14999
15222
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
15000
|
-
params.relativeDirPath =
|
|
15223
|
+
params.relativeDirPath = join105(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
15001
15224
|
params.relativeFilePath = "AGENTS.md";
|
|
15002
15225
|
}
|
|
15003
15226
|
return params;
|
|
@@ -15046,7 +15269,7 @@ var ToolRule = class extends ToolFile {
|
|
|
15046
15269
|
}
|
|
15047
15270
|
};
|
|
15048
15271
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
15049
|
-
return excludeToolDir ? subDir :
|
|
15272
|
+
return excludeToolDir ? subDir : join105(toolDir, subDir);
|
|
15050
15273
|
}
|
|
15051
15274
|
|
|
15052
15275
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -15075,8 +15298,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
15075
15298
|
validate = true
|
|
15076
15299
|
}) {
|
|
15077
15300
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
15078
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
15079
|
-
const fileContent = await readFileContent(
|
|
15301
|
+
const relativePath = isRoot ? "AGENTS.md" : join106(".agents", "memories", relativeFilePath);
|
|
15302
|
+
const fileContent = await readFileContent(join106(baseDir, relativePath));
|
|
15080
15303
|
return new _AgentsMdRule({
|
|
15081
15304
|
baseDir,
|
|
15082
15305
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15131,21 +15354,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
15131
15354
|
};
|
|
15132
15355
|
|
|
15133
15356
|
// src/features/rules/antigravity-rule.ts
|
|
15134
|
-
import { join as
|
|
15135
|
-
import { z as
|
|
15136
|
-
var AntigravityRuleFrontmatterSchema =
|
|
15137
|
-
trigger:
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15357
|
+
import { join as join107 } from "path";
|
|
15358
|
+
import { z as z60 } from "zod/mini";
|
|
15359
|
+
var AntigravityRuleFrontmatterSchema = z60.looseObject({
|
|
15360
|
+
trigger: z60.optional(
|
|
15361
|
+
z60.union([
|
|
15362
|
+
z60.literal("always_on"),
|
|
15363
|
+
z60.literal("glob"),
|
|
15364
|
+
z60.literal("manual"),
|
|
15365
|
+
z60.literal("model_decision"),
|
|
15366
|
+
z60.string()
|
|
15144
15367
|
// accepts any string for forward compatibility
|
|
15145
15368
|
])
|
|
15146
15369
|
),
|
|
15147
|
-
globs:
|
|
15148
|
-
description:
|
|
15370
|
+
globs: z60.optional(z60.string()),
|
|
15371
|
+
description: z60.optional(z60.string())
|
|
15149
15372
|
});
|
|
15150
15373
|
function parseGlobsString(globs) {
|
|
15151
15374
|
if (!globs) {
|
|
@@ -15290,7 +15513,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
15290
15513
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
15291
15514
|
if (!result.success) {
|
|
15292
15515
|
throw new Error(
|
|
15293
|
-
`Invalid frontmatter in ${
|
|
15516
|
+
`Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15294
15517
|
);
|
|
15295
15518
|
}
|
|
15296
15519
|
}
|
|
@@ -15314,7 +15537,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
15314
15537
|
relativeFilePath,
|
|
15315
15538
|
validate = true
|
|
15316
15539
|
}) {
|
|
15317
|
-
const filePath =
|
|
15540
|
+
const filePath = join107(
|
|
15318
15541
|
baseDir,
|
|
15319
15542
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
15320
15543
|
relativeFilePath
|
|
@@ -15454,7 +15677,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
15454
15677
|
};
|
|
15455
15678
|
|
|
15456
15679
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
15457
|
-
import { join as
|
|
15680
|
+
import { join as join108 } from "path";
|
|
15458
15681
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
15459
15682
|
toRulesyncRule() {
|
|
15460
15683
|
const rulesyncFrontmatter = {
|
|
@@ -15514,8 +15737,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
15514
15737
|
}) {
|
|
15515
15738
|
const settablePaths = this.getSettablePaths();
|
|
15516
15739
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
15517
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
15518
|
-
const fileContent = await readFileContent(
|
|
15740
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join108(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15741
|
+
const fileContent = await readFileContent(join108(baseDir, relativePath));
|
|
15519
15742
|
return new _AugmentcodeLegacyRule({
|
|
15520
15743
|
baseDir,
|
|
15521
15744
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -15544,7 +15767,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
15544
15767
|
};
|
|
15545
15768
|
|
|
15546
15769
|
// src/features/rules/augmentcode-rule.ts
|
|
15547
|
-
import { join as
|
|
15770
|
+
import { join as join109 } from "path";
|
|
15548
15771
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
15549
15772
|
toRulesyncRule() {
|
|
15550
15773
|
return this.toRulesyncRuleDefault();
|
|
@@ -15575,7 +15798,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
15575
15798
|
relativeFilePath,
|
|
15576
15799
|
validate = true
|
|
15577
15800
|
}) {
|
|
15578
|
-
const filePath =
|
|
15801
|
+
const filePath = join109(
|
|
15579
15802
|
baseDir,
|
|
15580
15803
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
15581
15804
|
relativeFilePath
|
|
@@ -15615,7 +15838,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
15615
15838
|
};
|
|
15616
15839
|
|
|
15617
15840
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
15618
|
-
import { join as
|
|
15841
|
+
import { join as join110 } from "path";
|
|
15619
15842
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
15620
15843
|
static getSettablePaths({
|
|
15621
15844
|
global,
|
|
@@ -15657,7 +15880,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
15657
15880
|
if (isRoot) {
|
|
15658
15881
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
15659
15882
|
const fileContent2 = await readFileContent(
|
|
15660
|
-
|
|
15883
|
+
join110(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
15661
15884
|
);
|
|
15662
15885
|
return new _ClaudecodeLegacyRule({
|
|
15663
15886
|
baseDir,
|
|
@@ -15671,8 +15894,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
15671
15894
|
if (!paths.nonRoot) {
|
|
15672
15895
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15673
15896
|
}
|
|
15674
|
-
const relativePath =
|
|
15675
|
-
const fileContent = await readFileContent(
|
|
15897
|
+
const relativePath = join110(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15898
|
+
const fileContent = await readFileContent(join110(baseDir, relativePath));
|
|
15676
15899
|
return new _ClaudecodeLegacyRule({
|
|
15677
15900
|
baseDir,
|
|
15678
15901
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15731,10 +15954,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
15731
15954
|
};
|
|
15732
15955
|
|
|
15733
15956
|
// src/features/rules/claudecode-rule.ts
|
|
15734
|
-
import { join as
|
|
15735
|
-
import { z as
|
|
15736
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
15737
|
-
paths:
|
|
15957
|
+
import { join as join111 } from "path";
|
|
15958
|
+
import { z as z61 } from "zod/mini";
|
|
15959
|
+
var ClaudecodeRuleFrontmatterSchema = z61.object({
|
|
15960
|
+
paths: z61.optional(z61.array(z61.string()))
|
|
15738
15961
|
});
|
|
15739
15962
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
15740
15963
|
frontmatter;
|
|
@@ -15772,7 +15995,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
15772
15995
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
15773
15996
|
if (!result.success) {
|
|
15774
15997
|
throw new Error(
|
|
15775
|
-
`Invalid frontmatter in ${
|
|
15998
|
+
`Invalid frontmatter in ${join111(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15776
15999
|
);
|
|
15777
16000
|
}
|
|
15778
16001
|
}
|
|
@@ -15802,7 +16025,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
15802
16025
|
if (isRoot) {
|
|
15803
16026
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
15804
16027
|
const fileContent2 = await readFileContent(
|
|
15805
|
-
|
|
16028
|
+
join111(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
15806
16029
|
);
|
|
15807
16030
|
return new _ClaudecodeRule({
|
|
15808
16031
|
baseDir,
|
|
@@ -15817,8 +16040,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
15817
16040
|
if (!paths.nonRoot) {
|
|
15818
16041
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15819
16042
|
}
|
|
15820
|
-
const relativePath =
|
|
15821
|
-
const filePath =
|
|
16043
|
+
const relativePath = join111(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16044
|
+
const filePath = join111(baseDir, relativePath);
|
|
15822
16045
|
const fileContent = await readFileContent(filePath);
|
|
15823
16046
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15824
16047
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15929,7 +16152,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
15929
16152
|
return {
|
|
15930
16153
|
success: false,
|
|
15931
16154
|
error: new Error(
|
|
15932
|
-
`Invalid frontmatter in ${
|
|
16155
|
+
`Invalid frontmatter in ${join111(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15933
16156
|
)
|
|
15934
16157
|
};
|
|
15935
16158
|
}
|
|
@@ -15949,10 +16172,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
15949
16172
|
};
|
|
15950
16173
|
|
|
15951
16174
|
// src/features/rules/cline-rule.ts
|
|
15952
|
-
import { join as
|
|
15953
|
-
import { z as
|
|
15954
|
-
var ClineRuleFrontmatterSchema =
|
|
15955
|
-
description:
|
|
16175
|
+
import { join as join112 } from "path";
|
|
16176
|
+
import { z as z62 } from "zod/mini";
|
|
16177
|
+
var ClineRuleFrontmatterSchema = z62.object({
|
|
16178
|
+
description: z62.string()
|
|
15956
16179
|
});
|
|
15957
16180
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
15958
16181
|
static getSettablePaths(_options = {}) {
|
|
@@ -15995,7 +16218,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
15995
16218
|
validate = true
|
|
15996
16219
|
}) {
|
|
15997
16220
|
const fileContent = await readFileContent(
|
|
15998
|
-
|
|
16221
|
+
join112(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15999
16222
|
);
|
|
16000
16223
|
return new _ClineRule({
|
|
16001
16224
|
baseDir,
|
|
@@ -16021,7 +16244,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
16021
16244
|
};
|
|
16022
16245
|
|
|
16023
16246
|
// src/features/rules/codexcli-rule.ts
|
|
16024
|
-
import { join as
|
|
16247
|
+
import { join as join113 } from "path";
|
|
16025
16248
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
16026
16249
|
static getSettablePaths({
|
|
16027
16250
|
global,
|
|
@@ -16056,7 +16279,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
16056
16279
|
if (isRoot) {
|
|
16057
16280
|
const relativePath2 = paths.root.relativeFilePath;
|
|
16058
16281
|
const fileContent2 = await readFileContent(
|
|
16059
|
-
|
|
16282
|
+
join113(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
16060
16283
|
);
|
|
16061
16284
|
return new _CodexcliRule({
|
|
16062
16285
|
baseDir,
|
|
@@ -16070,8 +16293,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
16070
16293
|
if (!paths.nonRoot) {
|
|
16071
16294
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16072
16295
|
}
|
|
16073
|
-
const relativePath =
|
|
16074
|
-
const fileContent = await readFileContent(
|
|
16296
|
+
const relativePath = join113(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16297
|
+
const fileContent = await readFileContent(join113(baseDir, relativePath));
|
|
16075
16298
|
return new _CodexcliRule({
|
|
16076
16299
|
baseDir,
|
|
16077
16300
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -16130,12 +16353,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
16130
16353
|
};
|
|
16131
16354
|
|
|
16132
16355
|
// src/features/rules/copilot-rule.ts
|
|
16133
|
-
import { join as
|
|
16134
|
-
import { z as
|
|
16135
|
-
var CopilotRuleFrontmatterSchema =
|
|
16136
|
-
description:
|
|
16137
|
-
applyTo:
|
|
16138
|
-
excludeAgent:
|
|
16356
|
+
import { join as join114 } from "path";
|
|
16357
|
+
import { z as z63 } from "zod/mini";
|
|
16358
|
+
var CopilotRuleFrontmatterSchema = z63.object({
|
|
16359
|
+
description: z63.optional(z63.string()),
|
|
16360
|
+
applyTo: z63.optional(z63.string()),
|
|
16361
|
+
excludeAgent: z63.optional(z63.union([z63.literal("code-review"), z63.literal("coding-agent")]))
|
|
16139
16362
|
});
|
|
16140
16363
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
16141
16364
|
frontmatter;
|
|
@@ -16167,7 +16390,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
16167
16390
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16168
16391
|
if (!result.success) {
|
|
16169
16392
|
throw new Error(
|
|
16170
|
-
`Invalid frontmatter in ${
|
|
16393
|
+
`Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16171
16394
|
);
|
|
16172
16395
|
}
|
|
16173
16396
|
}
|
|
@@ -16257,8 +16480,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
16257
16480
|
const paths = this.getSettablePaths({ global });
|
|
16258
16481
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
16259
16482
|
if (isRoot) {
|
|
16260
|
-
const relativePath2 =
|
|
16261
|
-
const filePath2 =
|
|
16483
|
+
const relativePath2 = join114(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
16484
|
+
const filePath2 = join114(baseDir, relativePath2);
|
|
16262
16485
|
const fileContent2 = await readFileContent(filePath2);
|
|
16263
16486
|
return new _CopilotRule({
|
|
16264
16487
|
baseDir,
|
|
@@ -16273,8 +16496,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
16273
16496
|
if (!paths.nonRoot) {
|
|
16274
16497
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16275
16498
|
}
|
|
16276
|
-
const relativePath =
|
|
16277
|
-
const filePath =
|
|
16499
|
+
const relativePath = join114(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16500
|
+
const filePath = join114(baseDir, relativePath);
|
|
16278
16501
|
const fileContent = await readFileContent(filePath);
|
|
16279
16502
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16280
16503
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16320,7 +16543,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
16320
16543
|
return {
|
|
16321
16544
|
success: false,
|
|
16322
16545
|
error: new Error(
|
|
16323
|
-
`Invalid frontmatter in ${
|
|
16546
|
+
`Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16324
16547
|
)
|
|
16325
16548
|
};
|
|
16326
16549
|
}
|
|
@@ -16376,12 +16599,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
16376
16599
|
};
|
|
16377
16600
|
|
|
16378
16601
|
// src/features/rules/cursor-rule.ts
|
|
16379
|
-
import { join as
|
|
16380
|
-
import { z as
|
|
16381
|
-
var CursorRuleFrontmatterSchema =
|
|
16382
|
-
description:
|
|
16383
|
-
globs:
|
|
16384
|
-
alwaysApply:
|
|
16602
|
+
import { join as join115 } from "path";
|
|
16603
|
+
import { z as z64 } from "zod/mini";
|
|
16604
|
+
var CursorRuleFrontmatterSchema = z64.object({
|
|
16605
|
+
description: z64.optional(z64.string()),
|
|
16606
|
+
globs: z64.optional(z64.string()),
|
|
16607
|
+
alwaysApply: z64.optional(z64.boolean())
|
|
16385
16608
|
});
|
|
16386
16609
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
16387
16610
|
frontmatter;
|
|
@@ -16398,7 +16621,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
16398
16621
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16399
16622
|
if (!result.success) {
|
|
16400
16623
|
throw new Error(
|
|
16401
|
-
`Invalid frontmatter in ${
|
|
16624
|
+
`Invalid frontmatter in ${join115(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16402
16625
|
);
|
|
16403
16626
|
}
|
|
16404
16627
|
}
|
|
@@ -16514,7 +16737,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
16514
16737
|
relativeFilePath,
|
|
16515
16738
|
validate = true
|
|
16516
16739
|
}) {
|
|
16517
|
-
const filePath =
|
|
16740
|
+
const filePath = join115(
|
|
16518
16741
|
baseDir,
|
|
16519
16742
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16520
16743
|
relativeFilePath
|
|
@@ -16524,7 +16747,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
16524
16747
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16525
16748
|
if (!result.success) {
|
|
16526
16749
|
throw new Error(
|
|
16527
|
-
`Invalid frontmatter in ${
|
|
16750
|
+
`Invalid frontmatter in ${join115(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
16528
16751
|
);
|
|
16529
16752
|
}
|
|
16530
16753
|
return new _CursorRule({
|
|
@@ -16561,7 +16784,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
16561
16784
|
return {
|
|
16562
16785
|
success: false,
|
|
16563
16786
|
error: new Error(
|
|
16564
|
-
`Invalid frontmatter in ${
|
|
16787
|
+
`Invalid frontmatter in ${join115(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16565
16788
|
)
|
|
16566
16789
|
};
|
|
16567
16790
|
}
|
|
@@ -16581,7 +16804,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
16581
16804
|
};
|
|
16582
16805
|
|
|
16583
16806
|
// src/features/rules/deepagents-rule.ts
|
|
16584
|
-
import { join as
|
|
16807
|
+
import { join as join116 } from "path";
|
|
16585
16808
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
16586
16809
|
constructor({ fileContent, root, ...rest }) {
|
|
16587
16810
|
super({
|
|
@@ -16606,12 +16829,13 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
16606
16829
|
relativeFilePath,
|
|
16607
16830
|
validate = true
|
|
16608
16831
|
}) {
|
|
16832
|
+
const settablePaths = this.getSettablePaths();
|
|
16609
16833
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16610
|
-
const relativePath = isRoot ?
|
|
16611
|
-
const fileContent = await readFileContent(
|
|
16834
|
+
const relativePath = isRoot ? join116(".deepagents", "AGENTS.md") : join116(".deepagents", "memories", relativeFilePath);
|
|
16835
|
+
const fileContent = await readFileContent(join116(baseDir, relativePath));
|
|
16612
16836
|
return new _DeepagentsRule({
|
|
16613
16837
|
baseDir,
|
|
16614
|
-
relativeDirPath: isRoot ?
|
|
16838
|
+
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
16615
16839
|
relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
|
|
16616
16840
|
fileContent,
|
|
16617
16841
|
validate,
|
|
@@ -16663,7 +16887,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
16663
16887
|
};
|
|
16664
16888
|
|
|
16665
16889
|
// src/features/rules/factorydroid-rule.ts
|
|
16666
|
-
import { join as
|
|
16890
|
+
import { join as join117 } from "path";
|
|
16667
16891
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
16668
16892
|
constructor({ fileContent, root, ...rest }) {
|
|
16669
16893
|
super({
|
|
@@ -16703,8 +16927,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
16703
16927
|
const paths = this.getSettablePaths({ global });
|
|
16704
16928
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
16705
16929
|
if (isRoot) {
|
|
16706
|
-
const relativePath2 =
|
|
16707
|
-
const fileContent2 = await readFileContent(
|
|
16930
|
+
const relativePath2 = join117(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
16931
|
+
const fileContent2 = await readFileContent(join117(baseDir, relativePath2));
|
|
16708
16932
|
return new _FactorydroidRule({
|
|
16709
16933
|
baseDir,
|
|
16710
16934
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -16717,8 +16941,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
16717
16941
|
if (!paths.nonRoot) {
|
|
16718
16942
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16719
16943
|
}
|
|
16720
|
-
const relativePath =
|
|
16721
|
-
const fileContent = await readFileContent(
|
|
16944
|
+
const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16945
|
+
const fileContent = await readFileContent(join117(baseDir, relativePath));
|
|
16722
16946
|
return new _FactorydroidRule({
|
|
16723
16947
|
baseDir,
|
|
16724
16948
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -16777,7 +17001,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
16777
17001
|
};
|
|
16778
17002
|
|
|
16779
17003
|
// src/features/rules/geminicli-rule.ts
|
|
16780
|
-
import { join as
|
|
17004
|
+
import { join as join118 } from "path";
|
|
16781
17005
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
16782
17006
|
static getSettablePaths({
|
|
16783
17007
|
global,
|
|
@@ -16812,7 +17036,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
16812
17036
|
if (isRoot) {
|
|
16813
17037
|
const relativePath2 = paths.root.relativeFilePath;
|
|
16814
17038
|
const fileContent2 = await readFileContent(
|
|
16815
|
-
|
|
17039
|
+
join118(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
16816
17040
|
);
|
|
16817
17041
|
return new _GeminiCliRule({
|
|
16818
17042
|
baseDir,
|
|
@@ -16826,8 +17050,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
16826
17050
|
if (!paths.nonRoot) {
|
|
16827
17051
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16828
17052
|
}
|
|
16829
|
-
const relativePath =
|
|
16830
|
-
const fileContent = await readFileContent(
|
|
17053
|
+
const relativePath = join118(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17054
|
+
const fileContent = await readFileContent(join118(baseDir, relativePath));
|
|
16831
17055
|
return new _GeminiCliRule({
|
|
16832
17056
|
baseDir,
|
|
16833
17057
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -16886,7 +17110,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
16886
17110
|
};
|
|
16887
17111
|
|
|
16888
17112
|
// src/features/rules/goose-rule.ts
|
|
16889
|
-
import { join as
|
|
17113
|
+
import { join as join119 } from "path";
|
|
16890
17114
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
16891
17115
|
static getSettablePaths({
|
|
16892
17116
|
global,
|
|
@@ -16921,7 +17145,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
16921
17145
|
if (isRoot) {
|
|
16922
17146
|
const relativePath2 = paths.root.relativeFilePath;
|
|
16923
17147
|
const fileContent2 = await readFileContent(
|
|
16924
|
-
|
|
17148
|
+
join119(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
16925
17149
|
);
|
|
16926
17150
|
return new _GooseRule({
|
|
16927
17151
|
baseDir,
|
|
@@ -16935,8 +17159,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
16935
17159
|
if (!paths.nonRoot) {
|
|
16936
17160
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16937
17161
|
}
|
|
16938
|
-
const relativePath =
|
|
16939
|
-
const fileContent = await readFileContent(
|
|
17162
|
+
const relativePath = join119(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17163
|
+
const fileContent = await readFileContent(join119(baseDir, relativePath));
|
|
16940
17164
|
return new _GooseRule({
|
|
16941
17165
|
baseDir,
|
|
16942
17166
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -16995,7 +17219,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
16995
17219
|
};
|
|
16996
17220
|
|
|
16997
17221
|
// src/features/rules/junie-rule.ts
|
|
16998
|
-
import { join as
|
|
17222
|
+
import { join as join120 } from "path";
|
|
16999
17223
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
17000
17224
|
static getSettablePaths(_options = {}) {
|
|
17001
17225
|
return {
|
|
@@ -17008,18 +17232,28 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
17008
17232
|
}
|
|
17009
17233
|
};
|
|
17010
17234
|
}
|
|
17235
|
+
/**
|
|
17236
|
+
* Determines whether a given relative file path refers to the root
|
|
17237
|
+
* `guidelines.md` file. Memory files live under `.junie/memories/` and are
|
|
17238
|
+
* passed in as bare filenames (e.g. `memo.md`), so a top-level
|
|
17239
|
+
* `guidelines.md` is unambiguously the root entry.
|
|
17240
|
+
*/
|
|
17241
|
+
static isRootRelativeFilePath(relativeFilePath) {
|
|
17242
|
+
return relativeFilePath === "guidelines.md";
|
|
17243
|
+
}
|
|
17011
17244
|
static async fromFile({
|
|
17012
17245
|
baseDir = process.cwd(),
|
|
17013
17246
|
relativeFilePath,
|
|
17014
17247
|
validate = true
|
|
17015
17248
|
}) {
|
|
17016
|
-
const isRoot = relativeFilePath
|
|
17017
|
-
const
|
|
17018
|
-
const
|
|
17249
|
+
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
17250
|
+
const settablePaths = this.getSettablePaths();
|
|
17251
|
+
const relativePath = isRoot ? join120(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join120(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17252
|
+
const fileContent = await readFileContent(join120(baseDir, relativePath));
|
|
17019
17253
|
return new _JunieRule({
|
|
17020
17254
|
baseDir,
|
|
17021
|
-
relativeDirPath: isRoot ?
|
|
17022
|
-
relativeFilePath: isRoot ?
|
|
17255
|
+
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
17256
|
+
relativeFilePath: isRoot ? settablePaths.root.relativeFilePath : relativeFilePath,
|
|
17023
17257
|
fileContent,
|
|
17024
17258
|
validate,
|
|
17025
17259
|
root: isRoot
|
|
@@ -17051,7 +17285,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
17051
17285
|
relativeDirPath,
|
|
17052
17286
|
relativeFilePath
|
|
17053
17287
|
}) {
|
|
17054
|
-
const isRoot = relativeFilePath
|
|
17288
|
+
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
17055
17289
|
return new _JunieRule({
|
|
17056
17290
|
baseDir,
|
|
17057
17291
|
relativeDirPath,
|
|
@@ -17070,7 +17304,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
17070
17304
|
};
|
|
17071
17305
|
|
|
17072
17306
|
// src/features/rules/kilo-rule.ts
|
|
17073
|
-
import { join as
|
|
17307
|
+
import { join as join121 } from "path";
|
|
17074
17308
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
17075
17309
|
static getSettablePaths({
|
|
17076
17310
|
global,
|
|
@@ -17105,7 +17339,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
17105
17339
|
if (isRoot) {
|
|
17106
17340
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17107
17341
|
const fileContent2 = await readFileContent(
|
|
17108
|
-
|
|
17342
|
+
join121(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17109
17343
|
);
|
|
17110
17344
|
return new _KiloRule({
|
|
17111
17345
|
baseDir,
|
|
@@ -17119,8 +17353,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
17119
17353
|
if (!paths.nonRoot) {
|
|
17120
17354
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17121
17355
|
}
|
|
17122
|
-
const relativePath =
|
|
17123
|
-
const fileContent = await readFileContent(
|
|
17356
|
+
const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17357
|
+
const fileContent = await readFileContent(join121(baseDir, relativePath));
|
|
17124
17358
|
return new _KiloRule({
|
|
17125
17359
|
baseDir,
|
|
17126
17360
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17179,7 +17413,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
17179
17413
|
};
|
|
17180
17414
|
|
|
17181
17415
|
// src/features/rules/kiro-rule.ts
|
|
17182
|
-
import { join as
|
|
17416
|
+
import { join as join122 } from "path";
|
|
17183
17417
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
17184
17418
|
static getSettablePaths(_options = {}) {
|
|
17185
17419
|
return {
|
|
@@ -17194,7 +17428,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
17194
17428
|
validate = true
|
|
17195
17429
|
}) {
|
|
17196
17430
|
const fileContent = await readFileContent(
|
|
17197
|
-
|
|
17431
|
+
join122(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17198
17432
|
);
|
|
17199
17433
|
return new _KiroRule({
|
|
17200
17434
|
baseDir,
|
|
@@ -17248,7 +17482,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
17248
17482
|
};
|
|
17249
17483
|
|
|
17250
17484
|
// src/features/rules/opencode-rule.ts
|
|
17251
|
-
import { join as
|
|
17485
|
+
import { join as join123 } from "path";
|
|
17252
17486
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
17253
17487
|
static getSettablePaths({
|
|
17254
17488
|
global,
|
|
@@ -17283,7 +17517,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
17283
17517
|
if (isRoot) {
|
|
17284
17518
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17285
17519
|
const fileContent2 = await readFileContent(
|
|
17286
|
-
|
|
17520
|
+
join123(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17287
17521
|
);
|
|
17288
17522
|
return new _OpenCodeRule({
|
|
17289
17523
|
baseDir,
|
|
@@ -17297,8 +17531,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
17297
17531
|
if (!paths.nonRoot) {
|
|
17298
17532
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17299
17533
|
}
|
|
17300
|
-
const relativePath =
|
|
17301
|
-
const fileContent = await readFileContent(
|
|
17534
|
+
const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17535
|
+
const fileContent = await readFileContent(join123(baseDir, relativePath));
|
|
17302
17536
|
return new _OpenCodeRule({
|
|
17303
17537
|
baseDir,
|
|
17304
17538
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17357,7 +17591,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
17357
17591
|
};
|
|
17358
17592
|
|
|
17359
17593
|
// src/features/rules/qwencode-rule.ts
|
|
17360
|
-
import { join as
|
|
17594
|
+
import { join as join124 } from "path";
|
|
17361
17595
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
17362
17596
|
static getSettablePaths(_options = {}) {
|
|
17363
17597
|
return {
|
|
@@ -17376,8 +17610,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
17376
17610
|
validate = true
|
|
17377
17611
|
}) {
|
|
17378
17612
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
17379
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
17380
|
-
const fileContent = await readFileContent(
|
|
17613
|
+
const relativePath = isRoot ? "QWEN.md" : join124(".qwen", "memories", relativeFilePath);
|
|
17614
|
+
const fileContent = await readFileContent(join124(baseDir, relativePath));
|
|
17381
17615
|
return new _QwencodeRule({
|
|
17382
17616
|
baseDir,
|
|
17383
17617
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -17429,7 +17663,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
17429
17663
|
};
|
|
17430
17664
|
|
|
17431
17665
|
// src/features/rules/replit-rule.ts
|
|
17432
|
-
import { join as
|
|
17666
|
+
import { join as join125 } from "path";
|
|
17433
17667
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
17434
17668
|
static getSettablePaths(_options = {}) {
|
|
17435
17669
|
return {
|
|
@@ -17451,7 +17685,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
17451
17685
|
}
|
|
17452
17686
|
const relativePath = paths.root.relativeFilePath;
|
|
17453
17687
|
const fileContent = await readFileContent(
|
|
17454
|
-
|
|
17688
|
+
join125(baseDir, paths.root.relativeDirPath, relativePath)
|
|
17455
17689
|
);
|
|
17456
17690
|
return new _ReplitRule({
|
|
17457
17691
|
baseDir,
|
|
@@ -17517,7 +17751,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
17517
17751
|
};
|
|
17518
17752
|
|
|
17519
17753
|
// src/features/rules/roo-rule.ts
|
|
17520
|
-
import { join as
|
|
17754
|
+
import { join as join126 } from "path";
|
|
17521
17755
|
var RooRule = class _RooRule extends ToolRule {
|
|
17522
17756
|
static getSettablePaths(_options = {}) {
|
|
17523
17757
|
return {
|
|
@@ -17532,7 +17766,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
17532
17766
|
validate = true
|
|
17533
17767
|
}) {
|
|
17534
17768
|
const fileContent = await readFileContent(
|
|
17535
|
-
|
|
17769
|
+
join126(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17536
17770
|
);
|
|
17537
17771
|
return new _RooRule({
|
|
17538
17772
|
baseDir,
|
|
@@ -17601,7 +17835,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
17601
17835
|
};
|
|
17602
17836
|
|
|
17603
17837
|
// src/features/rules/rovodev-rule.ts
|
|
17604
|
-
import { join as
|
|
17838
|
+
import { join as join127 } from "path";
|
|
17605
17839
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
17606
17840
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
17607
17841
|
/**
|
|
@@ -17645,7 +17879,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
17645
17879
|
root: rovodevAgents,
|
|
17646
17880
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
17647
17881
|
nonRoot: {
|
|
17648
|
-
relativeDirPath:
|
|
17882
|
+
relativeDirPath: join127(".rovodev", ".rulesync", "modular-rules")
|
|
17649
17883
|
}
|
|
17650
17884
|
};
|
|
17651
17885
|
}
|
|
@@ -17684,10 +17918,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
17684
17918
|
}) {
|
|
17685
17919
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
17686
17920
|
throw new Error(
|
|
17687
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${
|
|
17921
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join127(relativeDirPath, relativeFilePath)}`
|
|
17688
17922
|
);
|
|
17689
17923
|
}
|
|
17690
|
-
const fileContent = await readFileContent(
|
|
17924
|
+
const fileContent = await readFileContent(join127(baseDir, relativeDirPath, relativeFilePath));
|
|
17691
17925
|
return new _RovodevRule({
|
|
17692
17926
|
baseDir,
|
|
17693
17927
|
relativeDirPath,
|
|
@@ -17707,10 +17941,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
17707
17941
|
paths
|
|
17708
17942
|
}) {
|
|
17709
17943
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17710
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${
|
|
17944
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join127(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join127(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17711
17945
|
if (relativeFilePath !== "AGENTS.md") {
|
|
17712
17946
|
throw new Error(
|
|
17713
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
17947
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join127(relativeDirPath, relativeFilePath)}`
|
|
17714
17948
|
);
|
|
17715
17949
|
}
|
|
17716
17950
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -17718,10 +17952,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
17718
17952
|
);
|
|
17719
17953
|
if (!allowed) {
|
|
17720
17954
|
throw new Error(
|
|
17721
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
17955
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join127(relativeDirPath, relativeFilePath)}`
|
|
17722
17956
|
);
|
|
17723
17957
|
}
|
|
17724
|
-
const fileContent = await readFileContent(
|
|
17958
|
+
const fileContent = await readFileContent(join127(baseDir, relativeDirPath, relativeFilePath));
|
|
17725
17959
|
return new _RovodevRule({
|
|
17726
17960
|
baseDir,
|
|
17727
17961
|
relativeDirPath,
|
|
@@ -17835,7 +18069,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
17835
18069
|
};
|
|
17836
18070
|
|
|
17837
18071
|
// src/features/rules/warp-rule.ts
|
|
17838
|
-
import { join as
|
|
18072
|
+
import { join as join128 } from "path";
|
|
17839
18073
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
17840
18074
|
constructor({ fileContent, root, ...rest }) {
|
|
17841
18075
|
super({
|
|
@@ -17861,8 +18095,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
17861
18095
|
validate = true
|
|
17862
18096
|
}) {
|
|
17863
18097
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
17864
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
17865
|
-
const fileContent = await readFileContent(
|
|
18098
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join128(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
18099
|
+
const fileContent = await readFileContent(join128(baseDir, relativePath));
|
|
17866
18100
|
return new _WarpRule({
|
|
17867
18101
|
baseDir,
|
|
17868
18102
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -17917,7 +18151,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
17917
18151
|
};
|
|
17918
18152
|
|
|
17919
18153
|
// src/features/rules/windsurf-rule.ts
|
|
17920
|
-
import { join as
|
|
18154
|
+
import { join as join129 } from "path";
|
|
17921
18155
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
17922
18156
|
static getSettablePaths(_options = {}) {
|
|
17923
18157
|
return {
|
|
@@ -17932,7 +18166,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
17932
18166
|
validate = true
|
|
17933
18167
|
}) {
|
|
17934
18168
|
const fileContent = await readFileContent(
|
|
17935
|
-
|
|
18169
|
+
join129(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17936
18170
|
);
|
|
17937
18171
|
return new _WindsurfRule({
|
|
17938
18172
|
baseDir,
|
|
@@ -18011,8 +18245,8 @@ var rulesProcessorToolTargets = [
|
|
|
18011
18245
|
"warp",
|
|
18012
18246
|
"windsurf"
|
|
18013
18247
|
];
|
|
18014
|
-
var RulesProcessorToolTargetSchema =
|
|
18015
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
18248
|
+
var RulesProcessorToolTargetSchema = z65.enum(rulesProcessorToolTargets);
|
|
18249
|
+
var formatRulePaths = (rules) => rules.map((r) => join130(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
18016
18250
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
18017
18251
|
[
|
|
18018
18252
|
"agentsmd",
|
|
@@ -18440,7 +18674,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18440
18674
|
}).relativeDirPath;
|
|
18441
18675
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
18442
18676
|
const frontmatter = skill.getFrontmatter();
|
|
18443
|
-
const relativePath =
|
|
18677
|
+
const relativePath = join130(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
18444
18678
|
return {
|
|
18445
18679
|
name: frontmatter.name,
|
|
18446
18680
|
description: frontmatter.description,
|
|
@@ -18565,8 +18799,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18565
18799
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
18566
18800
|
*/
|
|
18567
18801
|
async loadRulesyncFiles() {
|
|
18568
|
-
const rulesyncBaseDir =
|
|
18569
|
-
const files = await findFilesByGlobs(
|
|
18802
|
+
const rulesyncBaseDir = join130(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
18803
|
+
const files = await findFilesByGlobs(join130(rulesyncBaseDir, "**", "*.md"));
|
|
18570
18804
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
18571
18805
|
const rulesyncRules = await Promise.all(
|
|
18572
18806
|
files.map((file) => {
|
|
@@ -18653,7 +18887,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18653
18887
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
18654
18888
|
return filePaths.map((filePath) => {
|
|
18655
18889
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
18656
|
-
const relativeFilePath = isNonRoot ? relative5(effectiveBaseDir, filePath) :
|
|
18890
|
+
const relativeFilePath = isNonRoot ? relative5(effectiveBaseDir, filePath) : basename10(filePath);
|
|
18657
18891
|
checkPathTraversal({
|
|
18658
18892
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
18659
18893
|
intendedRootDir: effectiveBaseDir
|
|
@@ -18681,13 +18915,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18681
18915
|
return [];
|
|
18682
18916
|
}
|
|
18683
18917
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
18684
|
-
|
|
18918
|
+
join130(
|
|
18685
18919
|
this.baseDir,
|
|
18686
18920
|
settablePaths.root.relativeDirPath ?? ".",
|
|
18687
18921
|
settablePaths.root.relativeFilePath
|
|
18688
18922
|
),
|
|
18689
18923
|
settablePaths.alternativeRoots,
|
|
18690
|
-
(alt) =>
|
|
18924
|
+
(alt) => join130(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
18691
18925
|
);
|
|
18692
18926
|
if (forDeletion) {
|
|
18693
18927
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -18701,7 +18935,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18701
18935
|
});
|
|
18702
18936
|
return factory.class.fromFile({
|
|
18703
18937
|
baseDir: this.baseDir,
|
|
18704
|
-
relativeFilePath:
|
|
18938
|
+
relativeFilePath: basename10(filePath),
|
|
18705
18939
|
relativeDirPath,
|
|
18706
18940
|
global: this.global
|
|
18707
18941
|
});
|
|
@@ -18718,7 +18952,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18718
18952
|
return [];
|
|
18719
18953
|
}
|
|
18720
18954
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
18721
|
-
|
|
18955
|
+
join130(this.baseDir, "AGENTS.local.md")
|
|
18722
18956
|
);
|
|
18723
18957
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
18724
18958
|
}
|
|
@@ -18729,9 +18963,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18729
18963
|
return [];
|
|
18730
18964
|
}
|
|
18731
18965
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
18732
|
-
|
|
18966
|
+
join130(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
18733
18967
|
settablePaths.alternativeRoots,
|
|
18734
|
-
(alt) =>
|
|
18968
|
+
(alt) => join130(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
18735
18969
|
);
|
|
18736
18970
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
18737
18971
|
})();
|
|
@@ -18742,20 +18976,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18742
18976
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
18743
18977
|
return [];
|
|
18744
18978
|
}
|
|
18745
|
-
const primaryPaths = await findFilesByGlobs(
|
|
18979
|
+
const primaryPaths = await findFilesByGlobs(join130(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
18746
18980
|
if (primaryPaths.length === 0) {
|
|
18747
18981
|
return [];
|
|
18748
18982
|
}
|
|
18749
|
-
const mirrorPaths = await findFilesByGlobs(
|
|
18983
|
+
const mirrorPaths = await findFilesByGlobs(join130(this.baseDir, "AGENTS.md"));
|
|
18750
18984
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
18751
18985
|
})();
|
|
18752
18986
|
const nonRootToolRules = await (async () => {
|
|
18753
18987
|
if (!settablePaths.nonRoot) {
|
|
18754
18988
|
return [];
|
|
18755
18989
|
}
|
|
18756
|
-
const nonRootBaseDir =
|
|
18990
|
+
const nonRootBaseDir = join130(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
18757
18991
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
18758
|
-
|
|
18992
|
+
join130(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
18759
18993
|
);
|
|
18760
18994
|
if (forDeletion) {
|
|
18761
18995
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -18769,7 +19003,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
18769
19003
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
18770
19004
|
if (!ok) {
|
|
18771
19005
|
this.logger.warn(
|
|
18772
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${
|
|
19006
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${join130(modularRootRelative, relativeFilePath)}`
|
|
18773
19007
|
);
|
|
18774
19008
|
}
|
|
18775
19009
|
return ok;
|
|
@@ -18895,14 +19129,14 @@ s/<command> [arguments]
|
|
|
18895
19129
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
18896
19130
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
18897
19131
|
|
|
18898
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
19132
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join130(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
18899
19133
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
18900
19134
|
|
|
18901
19135
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
18902
19136
|
|
|
18903
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
19137
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join130(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
18904
19138
|
|
|
18905
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
19139
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join130(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
18906
19140
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
18907
19141
|
const result = [
|
|
18908
19142
|
overview,
|
|
@@ -18973,6 +19207,14 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
18973
19207
|
}
|
|
18974
19208
|
return { count: totalCount, paths: [], hasDiff };
|
|
18975
19209
|
}
|
|
19210
|
+
async function processFeatureWithRulesyncFiles(params) {
|
|
19211
|
+
const { config, processor, rulesyncFiles } = params;
|
|
19212
|
+
if (rulesyncFiles.length === 0) {
|
|
19213
|
+
return processEmptyFeatureGeneration({ config, processor });
|
|
19214
|
+
}
|
|
19215
|
+
const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
|
|
19216
|
+
return processFeatureGeneration({ config, processor, toolFiles });
|
|
19217
|
+
}
|
|
18976
19218
|
var SIMULATE_OPTION_MAP = {
|
|
18977
19219
|
commands: "--simulate-commands",
|
|
18978
19220
|
subagents: "--simulate-subagents",
|
|
@@ -18994,7 +19236,7 @@ function warnUnsupportedTargets(params) {
|
|
|
18994
19236
|
}
|
|
18995
19237
|
}
|
|
18996
19238
|
async function checkRulesyncDirExists(params) {
|
|
18997
|
-
return fileExists(
|
|
19239
|
+
return fileExists(join131(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
18998
19240
|
}
|
|
18999
19241
|
async function generate(params) {
|
|
19000
19242
|
const { config, logger } = params;
|
|
@@ -19050,12 +19292,7 @@ async function generateRulesCore(params) {
|
|
|
19050
19292
|
logger
|
|
19051
19293
|
});
|
|
19052
19294
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19053
|
-
const
|
|
19054
|
-
const result = await processFeatureGeneration({
|
|
19055
|
-
config,
|
|
19056
|
-
processor,
|
|
19057
|
-
toolFiles
|
|
19058
|
-
});
|
|
19295
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19059
19296
|
totalCount += result.count;
|
|
19060
19297
|
allPaths.push(...result.paths);
|
|
19061
19298
|
if (result.hasDiff) hasDiff = true;
|
|
@@ -19091,20 +19328,7 @@ async function generateIgnoreCore(params) {
|
|
|
19091
19328
|
logger
|
|
19092
19329
|
});
|
|
19093
19330
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19094
|
-
|
|
19095
|
-
if (rulesyncFiles.length > 0) {
|
|
19096
|
-
const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
|
|
19097
|
-
result = await processFeatureGeneration({
|
|
19098
|
-
config,
|
|
19099
|
-
processor,
|
|
19100
|
-
toolFiles
|
|
19101
|
-
});
|
|
19102
|
-
} else {
|
|
19103
|
-
result = await processEmptyFeatureGeneration({
|
|
19104
|
-
config,
|
|
19105
|
-
processor
|
|
19106
|
-
});
|
|
19107
|
-
}
|
|
19331
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19108
19332
|
totalCount += result.count;
|
|
19109
19333
|
allPaths.push(...result.paths);
|
|
19110
19334
|
if (result.hasDiff) hasDiff = true;
|
|
@@ -19144,12 +19368,7 @@ async function generateMcpCore(params) {
|
|
|
19144
19368
|
logger
|
|
19145
19369
|
});
|
|
19146
19370
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19147
|
-
const
|
|
19148
|
-
const result = await processFeatureGeneration({
|
|
19149
|
-
config,
|
|
19150
|
-
processor,
|
|
19151
|
-
toolFiles
|
|
19152
|
-
});
|
|
19371
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19153
19372
|
totalCount += result.count;
|
|
19154
19373
|
allPaths.push(...result.paths);
|
|
19155
19374
|
if (result.hasDiff) hasDiff = true;
|
|
@@ -19187,12 +19406,7 @@ async function generateCommandsCore(params) {
|
|
|
19187
19406
|
logger
|
|
19188
19407
|
});
|
|
19189
19408
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19190
|
-
const
|
|
19191
|
-
const result = await processFeatureGeneration({
|
|
19192
|
-
config,
|
|
19193
|
-
processor,
|
|
19194
|
-
toolFiles
|
|
19195
|
-
});
|
|
19409
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19196
19410
|
totalCount += result.count;
|
|
19197
19411
|
allPaths.push(...result.paths);
|
|
19198
19412
|
if (result.hasDiff) hasDiff = true;
|
|
@@ -19230,12 +19444,7 @@ async function generateSubagentsCore(params) {
|
|
|
19230
19444
|
logger
|
|
19231
19445
|
});
|
|
19232
19446
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19233
|
-
const
|
|
19234
|
-
const result = await processFeatureGeneration({
|
|
19235
|
-
config,
|
|
19236
|
-
processor,
|
|
19237
|
-
toolFiles
|
|
19238
|
-
});
|
|
19447
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19239
19448
|
totalCount += result.count;
|
|
19240
19449
|
allPaths.push(...result.paths);
|
|
19241
19450
|
if (result.hasDiff) hasDiff = true;
|
|
@@ -19318,20 +19527,7 @@ async function generateHooksCore(params) {
|
|
|
19318
19527
|
logger
|
|
19319
19528
|
});
|
|
19320
19529
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
19321
|
-
|
|
19322
|
-
if (rulesyncFiles.length === 0) {
|
|
19323
|
-
result = await processEmptyFeatureGeneration({
|
|
19324
|
-
config,
|
|
19325
|
-
processor
|
|
19326
|
-
});
|
|
19327
|
-
} else {
|
|
19328
|
-
const toolFiles = await processor.convertRulesyncFilesToToolFiles(rulesyncFiles);
|
|
19329
|
-
result = await processFeatureGeneration({
|
|
19330
|
-
config,
|
|
19331
|
-
processor,
|
|
19332
|
-
toolFiles
|
|
19333
|
-
});
|
|
19334
|
-
}
|
|
19530
|
+
const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
|
|
19335
19531
|
totalCount += result.count;
|
|
19336
19532
|
allPaths.push(...result.paths);
|
|
19337
19533
|
if (result.hasDiff) hasDiff = true;
|