rulesync 7.9.0 → 7.11.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-HA3HGPC7.js → chunk-T5MWTRJM.js} +852 -594
- package/dist/cli/index.cjs +1144 -882
- package/dist/cli/index.js +8 -4
- package/dist/index.cjs +877 -619
- package/dist/index.js +1 -1
- package/package.json +13 -13
package/dist/index.cjs
CHANGED
|
@@ -634,7 +634,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
// src/lib/generate.ts
|
|
637
|
-
var
|
|
637
|
+
var import_node_path115 = require("path");
|
|
638
638
|
var import_es_toolkit4 = require("es-toolkit");
|
|
639
639
|
|
|
640
640
|
// src/features/commands/commands-processor.ts
|
|
@@ -3019,7 +3019,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3019
3019
|
};
|
|
3020
3020
|
|
|
3021
3021
|
// src/features/hooks/hooks-processor.ts
|
|
3022
|
-
var
|
|
3022
|
+
var import_mini17 = require("zod/mini");
|
|
3023
3023
|
|
|
3024
3024
|
// src/types/hooks.ts
|
|
3025
3025
|
var import_mini14 = require("zod/mini");
|
|
@@ -3038,7 +3038,9 @@ var HookDefinitionSchema = import_mini14.z.looseObject({
|
|
|
3038
3038
|
timeout: import_mini14.z.optional(import_mini14.z.number()),
|
|
3039
3039
|
matcher: import_mini14.z.optional(safeString),
|
|
3040
3040
|
prompt: import_mini14.z.optional(import_mini14.z.string()),
|
|
3041
|
-
loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number()))
|
|
3041
|
+
loop_limit: import_mini14.z.optional(import_mini14.z.nullable(import_mini14.z.number())),
|
|
3042
|
+
name: import_mini14.z.optional(safeString),
|
|
3043
|
+
description: import_mini14.z.optional(safeString)
|
|
3042
3044
|
});
|
|
3043
3045
|
var CURSOR_HOOK_EVENTS = [
|
|
3044
3046
|
"sessionStart",
|
|
@@ -3105,6 +3107,19 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
3105
3107
|
"notification",
|
|
3106
3108
|
"setup"
|
|
3107
3109
|
];
|
|
3110
|
+
var GEMINICLI_HOOK_EVENTS = [
|
|
3111
|
+
"sessionStart",
|
|
3112
|
+
"sessionEnd",
|
|
3113
|
+
"beforeSubmitPrompt",
|
|
3114
|
+
"stop",
|
|
3115
|
+
"beforeAgentResponse",
|
|
3116
|
+
"afterAgentResponse",
|
|
3117
|
+
"beforeToolSelection",
|
|
3118
|
+
"preToolUse",
|
|
3119
|
+
"postToolUse",
|
|
3120
|
+
"preCompact",
|
|
3121
|
+
"notification"
|
|
3122
|
+
];
|
|
3108
3123
|
var hooksRecordSchema = import_mini14.z.record(import_mini14.z.string(), import_mini14.z.array(HookDefinitionSchema));
|
|
3109
3124
|
var HooksConfigSchema = import_mini14.z.looseObject({
|
|
3110
3125
|
version: import_mini14.z.optional(import_mini14.z.number()),
|
|
@@ -3113,7 +3128,8 @@ var HooksConfigSchema = import_mini14.z.looseObject({
|
|
|
3113
3128
|
claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3114
3129
|
copilot: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3115
3130
|
opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3116
|
-
factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
|
|
3131
|
+
factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3132
|
+
geminicli: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
|
|
3117
3133
|
});
|
|
3118
3134
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3119
3135
|
sessionStart: "SessionStart",
|
|
@@ -3192,6 +3208,22 @@ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
|
|
|
3192
3208
|
var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3193
3209
|
Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3194
3210
|
);
|
|
3211
|
+
var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
|
|
3212
|
+
sessionStart: "SessionStart",
|
|
3213
|
+
sessionEnd: "SessionEnd",
|
|
3214
|
+
beforeSubmitPrompt: "BeforeAgent",
|
|
3215
|
+
stop: "AfterAgent",
|
|
3216
|
+
beforeAgentResponse: "BeforeModel",
|
|
3217
|
+
afterAgentResponse: "AfterModel",
|
|
3218
|
+
beforeToolSelection: "BeforeToolSelection",
|
|
3219
|
+
preToolUse: "BeforeTool",
|
|
3220
|
+
postToolUse: "AfterTool",
|
|
3221
|
+
preCompact: "PreCompress",
|
|
3222
|
+
notification: "Notification"
|
|
3223
|
+
};
|
|
3224
|
+
var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3225
|
+
Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3226
|
+
);
|
|
3195
3227
|
|
|
3196
3228
|
// src/features/hooks/claudecode-hooks.ts
|
|
3197
3229
|
var import_node_path22 = require("path");
|
|
@@ -3478,6 +3510,7 @@ var CopilotHookEntrySchema = import_mini15.z.looseObject({
|
|
|
3478
3510
|
timeoutSec: import_mini15.z.optional(import_mini15.z.number())
|
|
3479
3511
|
});
|
|
3480
3512
|
function canonicalToCopilotHooks(config) {
|
|
3513
|
+
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
3481
3514
|
const isWindows = process.platform === "win32";
|
|
3482
3515
|
const commandField = isWindows ? "powershell" : "bash";
|
|
3483
3516
|
const supported = new Set(COPILOT_HOOK_EVENTS);
|
|
@@ -3502,9 +3535,7 @@ function canonicalToCopilotHooks(config) {
|
|
|
3502
3535
|
const command = def.command;
|
|
3503
3536
|
const timeout = def.timeout;
|
|
3504
3537
|
const rest = Object.fromEntries(
|
|
3505
|
-
Object.entries(def).filter(
|
|
3506
|
-
([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
|
|
3507
|
-
)
|
|
3538
|
+
Object.entries(def).filter(([k]) => !canonicalSchemaKeys.includes(k))
|
|
3508
3539
|
);
|
|
3509
3540
|
entries.push({
|
|
3510
3541
|
type: hookType,
|
|
@@ -3697,7 +3728,14 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3697
3728
|
const mappedHooks = {};
|
|
3698
3729
|
for (const [eventName, defs] of Object.entries(mergedHooks)) {
|
|
3699
3730
|
const cursorEventName = CANONICAL_TO_CURSOR_EVENT_NAMES[eventName] ?? eventName;
|
|
3700
|
-
mappedHooks[cursorEventName] = defs
|
|
3731
|
+
mappedHooks[cursorEventName] = defs.map((def) => ({
|
|
3732
|
+
...def.type !== void 0 && def.type !== null && { type: def.type },
|
|
3733
|
+
...def.command !== void 0 && def.command !== null && { command: def.command },
|
|
3734
|
+
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
|
|
3735
|
+
...def.loop_limit !== void 0 && { loop_limit: def.loop_limit },
|
|
3736
|
+
...def.matcher !== void 0 && def.matcher !== null && { matcher: def.matcher },
|
|
3737
|
+
...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
|
|
3738
|
+
}));
|
|
3701
3739
|
}
|
|
3702
3740
|
const cursorConfig = {
|
|
3703
3741
|
version: config.version ?? 1,
|
|
@@ -3930,8 +3968,193 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3930
3968
|
}
|
|
3931
3969
|
};
|
|
3932
3970
|
|
|
3933
|
-
// src/features/hooks/
|
|
3971
|
+
// src/features/hooks/geminicli-hooks.ts
|
|
3934
3972
|
var import_node_path26 = require("path");
|
|
3973
|
+
var import_mini16 = require("zod/mini");
|
|
3974
|
+
function canonicalToGeminicliHooks(config) {
|
|
3975
|
+
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
3976
|
+
const sharedHooks = {};
|
|
3977
|
+
for (const [event, defs] of Object.entries(config.hooks)) {
|
|
3978
|
+
if (geminiSupported.has(event)) {
|
|
3979
|
+
sharedHooks[event] = defs;
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
const effectiveHooks = {
|
|
3983
|
+
...sharedHooks,
|
|
3984
|
+
...config.geminicli?.hooks
|
|
3985
|
+
};
|
|
3986
|
+
const gemini = {};
|
|
3987
|
+
for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
|
|
3988
|
+
const geminiEventName = CANONICAL_TO_GEMINICLI_EVENT_NAMES[eventName] ?? eventName;
|
|
3989
|
+
const byMatcher = /* @__PURE__ */ new Map();
|
|
3990
|
+
for (const def of definitions) {
|
|
3991
|
+
const key = def.matcher ?? "";
|
|
3992
|
+
const list = byMatcher.get(key);
|
|
3993
|
+
if (list) list.push(def);
|
|
3994
|
+
else byMatcher.set(key, [def]);
|
|
3995
|
+
}
|
|
3996
|
+
const entries = [];
|
|
3997
|
+
for (const [matcherKey, defs] of byMatcher) {
|
|
3998
|
+
const hooks = defs.map((def) => {
|
|
3999
|
+
const command = def.command !== void 0 && def.command !== null && !def.command.startsWith("$") ? `$GEMINI_PROJECT_DIR/${def.command.replace(/^\.\//, "")}` : def.command;
|
|
4000
|
+
return {
|
|
4001
|
+
type: def.type ?? "command",
|
|
4002
|
+
...command !== void 0 && command !== null && { command },
|
|
4003
|
+
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
|
|
4004
|
+
...def.name !== void 0 && def.name !== null && { name: def.name },
|
|
4005
|
+
...def.description !== void 0 && def.description !== null && { description: def.description }
|
|
4006
|
+
};
|
|
4007
|
+
});
|
|
4008
|
+
entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
|
|
4009
|
+
}
|
|
4010
|
+
gemini[geminiEventName] = entries;
|
|
4011
|
+
}
|
|
4012
|
+
return gemini;
|
|
4013
|
+
}
|
|
4014
|
+
var GeminiHookEntrySchema = import_mini16.z.looseObject({
|
|
4015
|
+
type: import_mini16.z.optional(import_mini16.z.string()),
|
|
4016
|
+
command: import_mini16.z.optional(import_mini16.z.string()),
|
|
4017
|
+
timeout: import_mini16.z.optional(import_mini16.z.number()),
|
|
4018
|
+
name: import_mini16.z.optional(import_mini16.z.string()),
|
|
4019
|
+
description: import_mini16.z.optional(import_mini16.z.string())
|
|
4020
|
+
});
|
|
4021
|
+
var GeminiMatcherEntrySchema = import_mini16.z.looseObject({
|
|
4022
|
+
matcher: import_mini16.z.optional(import_mini16.z.string()),
|
|
4023
|
+
hooks: import_mini16.z.optional(import_mini16.z.array(GeminiHookEntrySchema))
|
|
4024
|
+
});
|
|
4025
|
+
function geminiHooksToCanonical(geminiHooks) {
|
|
4026
|
+
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
4027
|
+
return {};
|
|
4028
|
+
}
|
|
4029
|
+
const canonical = {};
|
|
4030
|
+
for (const [geminiEventName, matcherEntries] of Object.entries(geminiHooks)) {
|
|
4031
|
+
const eventName = GEMINICLI_TO_CANONICAL_EVENT_NAMES[geminiEventName] ?? geminiEventName;
|
|
4032
|
+
if (!Array.isArray(matcherEntries)) continue;
|
|
4033
|
+
const defs = [];
|
|
4034
|
+
for (const rawEntry of matcherEntries) {
|
|
4035
|
+
const parseResult = GeminiMatcherEntrySchema.safeParse(rawEntry);
|
|
4036
|
+
if (!parseResult.success) continue;
|
|
4037
|
+
const entry = parseResult.data;
|
|
4038
|
+
const hooks = entry.hooks ?? [];
|
|
4039
|
+
for (const h of hooks) {
|
|
4040
|
+
const cmd = h.command;
|
|
4041
|
+
const command = typeof cmd === "string" && cmd.startsWith("$GEMINI_PROJECT_DIR/") ? cmd.replace(/^\$GEMINI_PROJECT_DIR\/?/, "./") : cmd;
|
|
4042
|
+
const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
|
|
4043
|
+
defs.push({
|
|
4044
|
+
type: hookType,
|
|
4045
|
+
...command !== void 0 && command !== null && { command },
|
|
4046
|
+
...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
|
|
4047
|
+
...h.name !== void 0 && h.name !== null && { name: h.name },
|
|
4048
|
+
...h.description !== void 0 && h.description !== null && { description: h.description },
|
|
4049
|
+
...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
|
|
4050
|
+
});
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
if (defs.length > 0) {
|
|
4054
|
+
canonical[eventName] = defs;
|
|
4055
|
+
}
|
|
4056
|
+
}
|
|
4057
|
+
return canonical;
|
|
4058
|
+
}
|
|
4059
|
+
var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
4060
|
+
constructor(params) {
|
|
4061
|
+
super({
|
|
4062
|
+
...params,
|
|
4063
|
+
fileContent: params.fileContent ?? "{}"
|
|
4064
|
+
});
|
|
4065
|
+
}
|
|
4066
|
+
isDeletable() {
|
|
4067
|
+
return false;
|
|
4068
|
+
}
|
|
4069
|
+
static getSettablePaths(_options = {}) {
|
|
4070
|
+
return { relativeDirPath: ".gemini", relativeFilePath: "settings.json" };
|
|
4071
|
+
}
|
|
4072
|
+
static async fromFile({
|
|
4073
|
+
baseDir = process.cwd(),
|
|
4074
|
+
validate = true,
|
|
4075
|
+
global = false
|
|
4076
|
+
}) {
|
|
4077
|
+
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4078
|
+
const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4079
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4080
|
+
return new _GeminicliHooks({
|
|
4081
|
+
baseDir,
|
|
4082
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4083
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4084
|
+
fileContent,
|
|
4085
|
+
validate
|
|
4086
|
+
});
|
|
4087
|
+
}
|
|
4088
|
+
static async fromRulesyncHooks({
|
|
4089
|
+
baseDir = process.cwd(),
|
|
4090
|
+
rulesyncHooks,
|
|
4091
|
+
validate = true,
|
|
4092
|
+
global = false
|
|
4093
|
+
}) {
|
|
4094
|
+
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4095
|
+
const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4096
|
+
const existingContent = await readOrInitializeFileContent(
|
|
4097
|
+
filePath,
|
|
4098
|
+
JSON.stringify({}, null, 2)
|
|
4099
|
+
);
|
|
4100
|
+
let settings;
|
|
4101
|
+
try {
|
|
4102
|
+
settings = JSON.parse(existingContent);
|
|
4103
|
+
} catch (error) {
|
|
4104
|
+
throw new Error(
|
|
4105
|
+
`Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(error)}`,
|
|
4106
|
+
{ cause: error }
|
|
4107
|
+
);
|
|
4108
|
+
}
|
|
4109
|
+
const config = rulesyncHooks.getJson();
|
|
4110
|
+
const geminiHooks = canonicalToGeminicliHooks(config);
|
|
4111
|
+
const merged = { ...settings, hooks: geminiHooks };
|
|
4112
|
+
const fileContent = JSON.stringify(merged, null, 2);
|
|
4113
|
+
return new _GeminicliHooks({
|
|
4114
|
+
baseDir,
|
|
4115
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4116
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4117
|
+
fileContent,
|
|
4118
|
+
validate
|
|
4119
|
+
});
|
|
4120
|
+
}
|
|
4121
|
+
toRulesyncHooks() {
|
|
4122
|
+
let settings;
|
|
4123
|
+
try {
|
|
4124
|
+
settings = JSON.parse(this.getFileContent());
|
|
4125
|
+
} catch (error) {
|
|
4126
|
+
throw new Error(
|
|
4127
|
+
`Failed to parse Gemini CLI hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4128
|
+
{
|
|
4129
|
+
cause: error
|
|
4130
|
+
}
|
|
4131
|
+
);
|
|
4132
|
+
}
|
|
4133
|
+
const hooks = geminiHooksToCanonical(settings.hooks);
|
|
4134
|
+
return this.toRulesyncHooksDefault({
|
|
4135
|
+
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
4136
|
+
});
|
|
4137
|
+
}
|
|
4138
|
+
validate() {
|
|
4139
|
+
return { success: true, error: null };
|
|
4140
|
+
}
|
|
4141
|
+
static forDeletion({
|
|
4142
|
+
baseDir = process.cwd(),
|
|
4143
|
+
relativeDirPath,
|
|
4144
|
+
relativeFilePath
|
|
4145
|
+
}) {
|
|
4146
|
+
return new _GeminicliHooks({
|
|
4147
|
+
baseDir,
|
|
4148
|
+
relativeDirPath,
|
|
4149
|
+
relativeFilePath,
|
|
4150
|
+
fileContent: JSON.stringify({ hooks: {} }, null, 2),
|
|
4151
|
+
validate: false
|
|
4152
|
+
});
|
|
4153
|
+
}
|
|
4154
|
+
};
|
|
4155
|
+
|
|
4156
|
+
// src/features/hooks/opencode-hooks.ts
|
|
4157
|
+
var import_node_path27 = require("path");
|
|
3935
4158
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
3936
4159
|
function escapeForTemplateLiteral(command) {
|
|
3937
4160
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4029,7 +4252,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4029
4252
|
}
|
|
4030
4253
|
static getSettablePaths(options) {
|
|
4031
4254
|
return {
|
|
4032
|
-
relativeDirPath: options?.global ? (0,
|
|
4255
|
+
relativeDirPath: options?.global ? (0, import_node_path27.join)(".config", "opencode", "plugins") : (0, import_node_path27.join)(".opencode", "plugins"),
|
|
4033
4256
|
relativeFilePath: "rulesync-hooks.js"
|
|
4034
4257
|
};
|
|
4035
4258
|
}
|
|
@@ -4040,7 +4263,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4040
4263
|
}) {
|
|
4041
4264
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4042
4265
|
const fileContent = await readFileContent(
|
|
4043
|
-
(0,
|
|
4266
|
+
(0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4044
4267
|
);
|
|
4045
4268
|
return new _OpencodeHooks({
|
|
4046
4269
|
baseDir,
|
|
@@ -4094,9 +4317,10 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4094
4317
|
"claudecode",
|
|
4095
4318
|
"copilot",
|
|
4096
4319
|
"opencode",
|
|
4097
|
-
"factorydroid"
|
|
4320
|
+
"factorydroid",
|
|
4321
|
+
"geminicli"
|
|
4098
4322
|
];
|
|
4099
|
-
var HooksProcessorToolTargetSchema =
|
|
4323
|
+
var HooksProcessorToolTargetSchema = import_mini17.z.enum(hooksProcessorToolTargetTuple);
|
|
4100
4324
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
4101
4325
|
[
|
|
4102
4326
|
"cursor",
|
|
@@ -4167,6 +4391,16 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
|
4167
4391
|
supportedHookTypes: ["command", "prompt"],
|
|
4168
4392
|
supportsMatcher: true
|
|
4169
4393
|
}
|
|
4394
|
+
],
|
|
4395
|
+
[
|
|
4396
|
+
"geminicli",
|
|
4397
|
+
{
|
|
4398
|
+
class: GeminicliHooks,
|
|
4399
|
+
meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
|
|
4400
|
+
supportedEvents: GEMINICLI_HOOK_EVENTS,
|
|
4401
|
+
supportedHookTypes: ["command"],
|
|
4402
|
+
supportsMatcher: true
|
|
4403
|
+
}
|
|
4170
4404
|
]
|
|
4171
4405
|
]);
|
|
4172
4406
|
var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
|
|
@@ -4321,13 +4555,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4321
4555
|
};
|
|
4322
4556
|
|
|
4323
4557
|
// src/features/ignore/ignore-processor.ts
|
|
4324
|
-
var
|
|
4558
|
+
var import_mini18 = require("zod/mini");
|
|
4325
4559
|
|
|
4326
4560
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4327
|
-
var
|
|
4561
|
+
var import_node_path29 = require("path");
|
|
4328
4562
|
|
|
4329
4563
|
// src/features/ignore/rulesync-ignore.ts
|
|
4330
|
-
var
|
|
4564
|
+
var import_node_path28 = require("path");
|
|
4331
4565
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4332
4566
|
validate() {
|
|
4333
4567
|
return { success: true, error: null };
|
|
@@ -4347,12 +4581,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4347
4581
|
static async fromFile() {
|
|
4348
4582
|
const baseDir = process.cwd();
|
|
4349
4583
|
const paths = this.getSettablePaths();
|
|
4350
|
-
const recommendedPath = (0,
|
|
4584
|
+
const recommendedPath = (0, import_node_path28.join)(
|
|
4351
4585
|
baseDir,
|
|
4352
4586
|
paths.recommended.relativeDirPath,
|
|
4353
4587
|
paths.recommended.relativeFilePath
|
|
4354
4588
|
);
|
|
4355
|
-
const legacyPath = (0,
|
|
4589
|
+
const legacyPath = (0, import_node_path28.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4356
4590
|
if (await fileExists(recommendedPath)) {
|
|
4357
4591
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4358
4592
|
return new _RulesyncIgnore({
|
|
@@ -4468,7 +4702,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4468
4702
|
validate = true
|
|
4469
4703
|
}) {
|
|
4470
4704
|
const fileContent = await readFileContent(
|
|
4471
|
-
(0,
|
|
4705
|
+
(0, import_node_path29.join)(
|
|
4472
4706
|
baseDir,
|
|
4473
4707
|
this.getSettablePaths().relativeDirPath,
|
|
4474
4708
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4498,7 +4732,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4498
4732
|
};
|
|
4499
4733
|
|
|
4500
4734
|
// src/features/ignore/claudecode-ignore.ts
|
|
4501
|
-
var
|
|
4735
|
+
var import_node_path30 = require("path");
|
|
4502
4736
|
var import_es_toolkit2 = require("es-toolkit");
|
|
4503
4737
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4504
4738
|
constructor(params) {
|
|
@@ -4541,7 +4775,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4541
4775
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4542
4776
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4543
4777
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4544
|
-
const filePath = (0,
|
|
4778
|
+
const filePath = (0, import_node_path30.join)(
|
|
4545
4779
|
baseDir,
|
|
4546
4780
|
this.getSettablePaths().relativeDirPath,
|
|
4547
4781
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4577,7 +4811,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4577
4811
|
validate = true
|
|
4578
4812
|
}) {
|
|
4579
4813
|
const fileContent = await readFileContent(
|
|
4580
|
-
(0,
|
|
4814
|
+
(0, import_node_path30.join)(
|
|
4581
4815
|
baseDir,
|
|
4582
4816
|
this.getSettablePaths().relativeDirPath,
|
|
4583
4817
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4607,7 +4841,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4607
4841
|
};
|
|
4608
4842
|
|
|
4609
4843
|
// src/features/ignore/cline-ignore.ts
|
|
4610
|
-
var
|
|
4844
|
+
var import_node_path31 = require("path");
|
|
4611
4845
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4612
4846
|
static getSettablePaths() {
|
|
4613
4847
|
return {
|
|
@@ -4644,7 +4878,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4644
4878
|
validate = true
|
|
4645
4879
|
}) {
|
|
4646
4880
|
const fileContent = await readFileContent(
|
|
4647
|
-
(0,
|
|
4881
|
+
(0, import_node_path31.join)(
|
|
4648
4882
|
baseDir,
|
|
4649
4883
|
this.getSettablePaths().relativeDirPath,
|
|
4650
4884
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4674,7 +4908,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4674
4908
|
};
|
|
4675
4909
|
|
|
4676
4910
|
// src/features/ignore/cursor-ignore.ts
|
|
4677
|
-
var
|
|
4911
|
+
var import_node_path32 = require("path");
|
|
4678
4912
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
4679
4913
|
static getSettablePaths() {
|
|
4680
4914
|
return {
|
|
@@ -4707,7 +4941,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4707
4941
|
validate = true
|
|
4708
4942
|
}) {
|
|
4709
4943
|
const fileContent = await readFileContent(
|
|
4710
|
-
(0,
|
|
4944
|
+
(0, import_node_path32.join)(
|
|
4711
4945
|
baseDir,
|
|
4712
4946
|
this.getSettablePaths().relativeDirPath,
|
|
4713
4947
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4737,7 +4971,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4737
4971
|
};
|
|
4738
4972
|
|
|
4739
4973
|
// src/features/ignore/geminicli-ignore.ts
|
|
4740
|
-
var
|
|
4974
|
+
var import_node_path33 = require("path");
|
|
4741
4975
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
4742
4976
|
static getSettablePaths() {
|
|
4743
4977
|
return {
|
|
@@ -4764,7 +4998,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4764
4998
|
validate = true
|
|
4765
4999
|
}) {
|
|
4766
5000
|
const fileContent = await readFileContent(
|
|
4767
|
-
(0,
|
|
5001
|
+
(0, import_node_path33.join)(
|
|
4768
5002
|
baseDir,
|
|
4769
5003
|
this.getSettablePaths().relativeDirPath,
|
|
4770
5004
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4794,7 +5028,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4794
5028
|
};
|
|
4795
5029
|
|
|
4796
5030
|
// src/features/ignore/goose-ignore.ts
|
|
4797
|
-
var
|
|
5031
|
+
var import_node_path34 = require("path");
|
|
4798
5032
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
4799
5033
|
static getSettablePaths() {
|
|
4800
5034
|
return {
|
|
@@ -4831,7 +5065,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4831
5065
|
validate = true
|
|
4832
5066
|
}) {
|
|
4833
5067
|
const fileContent = await readFileContent(
|
|
4834
|
-
(0,
|
|
5068
|
+
(0, import_node_path34.join)(
|
|
4835
5069
|
baseDir,
|
|
4836
5070
|
this.getSettablePaths().relativeDirPath,
|
|
4837
5071
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4861,7 +5095,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4861
5095
|
};
|
|
4862
5096
|
|
|
4863
5097
|
// src/features/ignore/junie-ignore.ts
|
|
4864
|
-
var
|
|
5098
|
+
var import_node_path35 = require("path");
|
|
4865
5099
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
4866
5100
|
static getSettablePaths() {
|
|
4867
5101
|
return {
|
|
@@ -4888,7 +5122,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4888
5122
|
validate = true
|
|
4889
5123
|
}) {
|
|
4890
5124
|
const fileContent = await readFileContent(
|
|
4891
|
-
(0,
|
|
5125
|
+
(0, import_node_path35.join)(
|
|
4892
5126
|
baseDir,
|
|
4893
5127
|
this.getSettablePaths().relativeDirPath,
|
|
4894
5128
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4918,7 +5152,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4918
5152
|
};
|
|
4919
5153
|
|
|
4920
5154
|
// src/features/ignore/kilo-ignore.ts
|
|
4921
|
-
var
|
|
5155
|
+
var import_node_path36 = require("path");
|
|
4922
5156
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
4923
5157
|
static getSettablePaths() {
|
|
4924
5158
|
return {
|
|
@@ -4955,7 +5189,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4955
5189
|
validate = true
|
|
4956
5190
|
}) {
|
|
4957
5191
|
const fileContent = await readFileContent(
|
|
4958
|
-
(0,
|
|
5192
|
+
(0, import_node_path36.join)(
|
|
4959
5193
|
baseDir,
|
|
4960
5194
|
this.getSettablePaths().relativeDirPath,
|
|
4961
5195
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4985,7 +5219,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4985
5219
|
};
|
|
4986
5220
|
|
|
4987
5221
|
// src/features/ignore/kiro-ignore.ts
|
|
4988
|
-
var
|
|
5222
|
+
var import_node_path37 = require("path");
|
|
4989
5223
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
4990
5224
|
static getSettablePaths() {
|
|
4991
5225
|
return {
|
|
@@ -5012,7 +5246,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5012
5246
|
validate = true
|
|
5013
5247
|
}) {
|
|
5014
5248
|
const fileContent = await readFileContent(
|
|
5015
|
-
(0,
|
|
5249
|
+
(0, import_node_path37.join)(
|
|
5016
5250
|
baseDir,
|
|
5017
5251
|
this.getSettablePaths().relativeDirPath,
|
|
5018
5252
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5042,7 +5276,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5042
5276
|
};
|
|
5043
5277
|
|
|
5044
5278
|
// src/features/ignore/qwencode-ignore.ts
|
|
5045
|
-
var
|
|
5279
|
+
var import_node_path38 = require("path");
|
|
5046
5280
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5047
5281
|
static getSettablePaths() {
|
|
5048
5282
|
return {
|
|
@@ -5069,7 +5303,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5069
5303
|
validate = true
|
|
5070
5304
|
}) {
|
|
5071
5305
|
const fileContent = await readFileContent(
|
|
5072
|
-
(0,
|
|
5306
|
+
(0, import_node_path38.join)(
|
|
5073
5307
|
baseDir,
|
|
5074
5308
|
this.getSettablePaths().relativeDirPath,
|
|
5075
5309
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5099,7 +5333,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5099
5333
|
};
|
|
5100
5334
|
|
|
5101
5335
|
// src/features/ignore/roo-ignore.ts
|
|
5102
|
-
var
|
|
5336
|
+
var import_node_path39 = require("path");
|
|
5103
5337
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5104
5338
|
static getSettablePaths() {
|
|
5105
5339
|
return {
|
|
@@ -5126,7 +5360,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5126
5360
|
validate = true
|
|
5127
5361
|
}) {
|
|
5128
5362
|
const fileContent = await readFileContent(
|
|
5129
|
-
(0,
|
|
5363
|
+
(0, import_node_path39.join)(
|
|
5130
5364
|
baseDir,
|
|
5131
5365
|
this.getSettablePaths().relativeDirPath,
|
|
5132
5366
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5156,7 +5390,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5156
5390
|
};
|
|
5157
5391
|
|
|
5158
5392
|
// src/features/ignore/windsurf-ignore.ts
|
|
5159
|
-
var
|
|
5393
|
+
var import_node_path40 = require("path");
|
|
5160
5394
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5161
5395
|
static getSettablePaths() {
|
|
5162
5396
|
return {
|
|
@@ -5183,7 +5417,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5183
5417
|
validate = true
|
|
5184
5418
|
}) {
|
|
5185
5419
|
const fileContent = await readFileContent(
|
|
5186
|
-
(0,
|
|
5420
|
+
(0, import_node_path40.join)(
|
|
5187
5421
|
baseDir,
|
|
5188
5422
|
this.getSettablePaths().relativeDirPath,
|
|
5189
5423
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5213,7 +5447,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5213
5447
|
};
|
|
5214
5448
|
|
|
5215
5449
|
// src/features/ignore/zed-ignore.ts
|
|
5216
|
-
var
|
|
5450
|
+
var import_node_path41 = require("path");
|
|
5217
5451
|
var import_es_toolkit3 = require("es-toolkit");
|
|
5218
5452
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5219
5453
|
constructor(params) {
|
|
@@ -5250,7 +5484,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5250
5484
|
}) {
|
|
5251
5485
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5252
5486
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5253
|
-
const filePath = (0,
|
|
5487
|
+
const filePath = (0, import_node_path41.join)(
|
|
5254
5488
|
baseDir,
|
|
5255
5489
|
this.getSettablePaths().relativeDirPath,
|
|
5256
5490
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5277,7 +5511,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5277
5511
|
validate = true
|
|
5278
5512
|
}) {
|
|
5279
5513
|
const fileContent = await readFileContent(
|
|
5280
|
-
(0,
|
|
5514
|
+
(0, import_node_path41.join)(
|
|
5281
5515
|
baseDir,
|
|
5282
5516
|
this.getSettablePaths().relativeDirPath,
|
|
5283
5517
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5323,7 +5557,7 @@ var ignoreProcessorToolTargets = [
|
|
|
5323
5557
|
"windsurf",
|
|
5324
5558
|
"zed"
|
|
5325
5559
|
];
|
|
5326
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5560
|
+
var IgnoreProcessorToolTargetSchema = import_mini18.z.enum(ignoreProcessorToolTargets);
|
|
5327
5561
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
5328
5562
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
5329
5563
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -5461,49 +5695,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5461
5695
|
};
|
|
5462
5696
|
|
|
5463
5697
|
// src/features/mcp/mcp-processor.ts
|
|
5464
|
-
var
|
|
5698
|
+
var import_mini22 = require("zod/mini");
|
|
5465
5699
|
|
|
5466
5700
|
// src/features/mcp/claudecode-mcp.ts
|
|
5467
|
-
var
|
|
5701
|
+
var import_node_path43 = require("path");
|
|
5468
5702
|
|
|
5469
5703
|
// src/features/mcp/rulesync-mcp.ts
|
|
5470
|
-
var
|
|
5704
|
+
var import_node_path42 = require("path");
|
|
5471
5705
|
var import_object = require("es-toolkit/object");
|
|
5472
|
-
var
|
|
5706
|
+
var import_mini20 = require("zod/mini");
|
|
5473
5707
|
|
|
5474
5708
|
// src/types/mcp.ts
|
|
5475
|
-
var
|
|
5476
|
-
var McpServerSchema =
|
|
5477
|
-
type:
|
|
5478
|
-
command:
|
|
5479
|
-
args:
|
|
5480
|
-
url:
|
|
5481
|
-
httpUrl:
|
|
5482
|
-
env:
|
|
5483
|
-
disabled:
|
|
5484
|
-
networkTimeout:
|
|
5485
|
-
timeout:
|
|
5486
|
-
trust:
|
|
5487
|
-
cwd:
|
|
5488
|
-
transport:
|
|
5489
|
-
alwaysAllow:
|
|
5490
|
-
tools:
|
|
5491
|
-
kiroAutoApprove:
|
|
5492
|
-
kiroAutoBlock:
|
|
5493
|
-
headers:
|
|
5494
|
-
enabledTools:
|
|
5495
|
-
disabledTools:
|
|
5709
|
+
var import_mini19 = require("zod/mini");
|
|
5710
|
+
var McpServerSchema = import_mini19.z.object({
|
|
5711
|
+
type: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
|
|
5712
|
+
command: import_mini19.z.optional(import_mini19.z.union([import_mini19.z.string(), import_mini19.z.array(import_mini19.z.string())])),
|
|
5713
|
+
args: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5714
|
+
url: import_mini19.z.optional(import_mini19.z.string()),
|
|
5715
|
+
httpUrl: import_mini19.z.optional(import_mini19.z.string()),
|
|
5716
|
+
env: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
|
|
5717
|
+
disabled: import_mini19.z.optional(import_mini19.z.boolean()),
|
|
5718
|
+
networkTimeout: import_mini19.z.optional(import_mini19.z.number()),
|
|
5719
|
+
timeout: import_mini19.z.optional(import_mini19.z.number()),
|
|
5720
|
+
trust: import_mini19.z.optional(import_mini19.z.boolean()),
|
|
5721
|
+
cwd: import_mini19.z.optional(import_mini19.z.string()),
|
|
5722
|
+
transport: import_mini19.z.optional(import_mini19.z.enum(["stdio", "sse", "http"])),
|
|
5723
|
+
alwaysAllow: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5724
|
+
tools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5725
|
+
kiroAutoApprove: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5726
|
+
kiroAutoBlock: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5727
|
+
headers: import_mini19.z.optional(import_mini19.z.record(import_mini19.z.string(), import_mini19.z.string())),
|
|
5728
|
+
enabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string())),
|
|
5729
|
+
disabledTools: import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string()))
|
|
5496
5730
|
});
|
|
5497
|
-
var McpServersSchema =
|
|
5731
|
+
var McpServersSchema = import_mini19.z.record(import_mini19.z.string(), McpServerSchema);
|
|
5498
5732
|
|
|
5499
5733
|
// src/features/mcp/rulesync-mcp.ts
|
|
5500
|
-
var RulesyncMcpServerSchema =
|
|
5501
|
-
targets:
|
|
5502
|
-
description:
|
|
5503
|
-
exposed:
|
|
5734
|
+
var RulesyncMcpServerSchema = import_mini20.z.extend(McpServerSchema, {
|
|
5735
|
+
targets: import_mini20.z.optional(RulesyncTargetsSchema),
|
|
5736
|
+
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
5737
|
+
exposed: import_mini20.z.optional(import_mini20.z.boolean())
|
|
5504
5738
|
});
|
|
5505
|
-
var RulesyncMcpConfigSchema =
|
|
5506
|
-
mcpServers:
|
|
5739
|
+
var RulesyncMcpConfigSchema = import_mini20.z.object({
|
|
5740
|
+
mcpServers: import_mini20.z.record(import_mini20.z.string(), RulesyncMcpServerSchema)
|
|
5507
5741
|
});
|
|
5508
5742
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
5509
5743
|
json;
|
|
@@ -5539,12 +5773,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5539
5773
|
static async fromFile({ validate = true }) {
|
|
5540
5774
|
const baseDir = process.cwd();
|
|
5541
5775
|
const paths = this.getSettablePaths();
|
|
5542
|
-
const recommendedPath = (0,
|
|
5776
|
+
const recommendedPath = (0, import_node_path42.join)(
|
|
5543
5777
|
baseDir,
|
|
5544
5778
|
paths.recommended.relativeDirPath,
|
|
5545
5779
|
paths.recommended.relativeFilePath
|
|
5546
5780
|
);
|
|
5547
|
-
const legacyPath = (0,
|
|
5781
|
+
const legacyPath = (0, import_node_path42.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5548
5782
|
if (await fileExists(recommendedPath)) {
|
|
5549
5783
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5550
5784
|
return new _RulesyncMcp({
|
|
@@ -5689,7 +5923,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5689
5923
|
global = false
|
|
5690
5924
|
}) {
|
|
5691
5925
|
const paths = this.getSettablePaths({ global });
|
|
5692
|
-
const fileContent = await readFileContentOrNull((0,
|
|
5926
|
+
const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5693
5927
|
const json = JSON.parse(fileContent);
|
|
5694
5928
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5695
5929
|
return new _ClaudecodeMcp({
|
|
@@ -5708,7 +5942,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5708
5942
|
}) {
|
|
5709
5943
|
const paths = this.getSettablePaths({ global });
|
|
5710
5944
|
const fileContent = await readOrInitializeFileContent(
|
|
5711
|
-
(0,
|
|
5945
|
+
(0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5712
5946
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5713
5947
|
);
|
|
5714
5948
|
const json = JSON.parse(fileContent);
|
|
@@ -5747,7 +5981,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5747
5981
|
};
|
|
5748
5982
|
|
|
5749
5983
|
// src/features/mcp/cline-mcp.ts
|
|
5750
|
-
var
|
|
5984
|
+
var import_node_path44 = require("path");
|
|
5751
5985
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
5752
5986
|
json;
|
|
5753
5987
|
constructor(params) {
|
|
@@ -5768,7 +6002,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5768
6002
|
validate = true
|
|
5769
6003
|
}) {
|
|
5770
6004
|
const fileContent = await readFileContent(
|
|
5771
|
-
(0,
|
|
6005
|
+
(0, import_node_path44.join)(
|
|
5772
6006
|
baseDir,
|
|
5773
6007
|
this.getSettablePaths().relativeDirPath,
|
|
5774
6008
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5817,7 +6051,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5817
6051
|
};
|
|
5818
6052
|
|
|
5819
6053
|
// src/features/mcp/codexcli-mcp.ts
|
|
5820
|
-
var
|
|
6054
|
+
var import_node_path45 = require("path");
|
|
5821
6055
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
5822
6056
|
function convertFromCodexFormat(codexMcp) {
|
|
5823
6057
|
const result = {};
|
|
@@ -5900,7 +6134,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5900
6134
|
global = false
|
|
5901
6135
|
}) {
|
|
5902
6136
|
const paths = this.getSettablePaths({ global });
|
|
5903
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6137
|
+
const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
5904
6138
|
return new _CodexcliMcp({
|
|
5905
6139
|
baseDir,
|
|
5906
6140
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -5916,7 +6150,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5916
6150
|
global = false
|
|
5917
6151
|
}) {
|
|
5918
6152
|
const paths = this.getSettablePaths({ global });
|
|
5919
|
-
const configTomlFilePath = (0,
|
|
6153
|
+
const configTomlFilePath = (0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5920
6154
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
5921
6155
|
configTomlFilePath,
|
|
5922
6156
|
smolToml.stringify({})
|
|
@@ -5973,7 +6207,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5973
6207
|
};
|
|
5974
6208
|
|
|
5975
6209
|
// src/features/mcp/copilot-mcp.ts
|
|
5976
|
-
var
|
|
6210
|
+
var import_node_path46 = require("path");
|
|
5977
6211
|
function convertToCopilotFormat(mcpServers) {
|
|
5978
6212
|
return { servers: mcpServers };
|
|
5979
6213
|
}
|
|
@@ -6000,7 +6234,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6000
6234
|
validate = true
|
|
6001
6235
|
}) {
|
|
6002
6236
|
const fileContent = await readFileContent(
|
|
6003
|
-
(0,
|
|
6237
|
+
(0, import_node_path46.join)(
|
|
6004
6238
|
baseDir,
|
|
6005
6239
|
this.getSettablePaths().relativeDirPath,
|
|
6006
6240
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6053,7 +6287,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6053
6287
|
};
|
|
6054
6288
|
|
|
6055
6289
|
// src/features/mcp/cursor-mcp.ts
|
|
6056
|
-
var
|
|
6290
|
+
var import_node_path47 = require("path");
|
|
6057
6291
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6058
6292
|
function isMcpServers(value) {
|
|
6059
6293
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6114,7 +6348,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6114
6348
|
validate = true
|
|
6115
6349
|
}) {
|
|
6116
6350
|
const fileContent = await readFileContent(
|
|
6117
|
-
(0,
|
|
6351
|
+
(0, import_node_path47.join)(
|
|
6118
6352
|
baseDir,
|
|
6119
6353
|
this.getSettablePaths().relativeDirPath,
|
|
6120
6354
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6182,7 +6416,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6182
6416
|
};
|
|
6183
6417
|
|
|
6184
6418
|
// src/features/mcp/factorydroid-mcp.ts
|
|
6185
|
-
var
|
|
6419
|
+
var import_node_path48 = require("path");
|
|
6186
6420
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
6187
6421
|
json;
|
|
6188
6422
|
constructor(params) {
|
|
@@ -6203,7 +6437,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6203
6437
|
validate = true
|
|
6204
6438
|
}) {
|
|
6205
6439
|
const fileContent = await readFileContent(
|
|
6206
|
-
(0,
|
|
6440
|
+
(0, import_node_path48.join)(
|
|
6207
6441
|
baseDir,
|
|
6208
6442
|
this.getSettablePaths().relativeDirPath,
|
|
6209
6443
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6263,7 +6497,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6263
6497
|
};
|
|
6264
6498
|
|
|
6265
6499
|
// src/features/mcp/geminicli-mcp.ts
|
|
6266
|
-
var
|
|
6500
|
+
var import_node_path49 = require("path");
|
|
6267
6501
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6268
6502
|
json;
|
|
6269
6503
|
constructor(params) {
|
|
@@ -6291,7 +6525,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6291
6525
|
global = false
|
|
6292
6526
|
}) {
|
|
6293
6527
|
const paths = this.getSettablePaths({ global });
|
|
6294
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6528
|
+
const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6295
6529
|
const json = JSON.parse(fileContent);
|
|
6296
6530
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6297
6531
|
return new _GeminiCliMcp({
|
|
@@ -6310,7 +6544,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6310
6544
|
}) {
|
|
6311
6545
|
const paths = this.getSettablePaths({ global });
|
|
6312
6546
|
const fileContent = await readOrInitializeFileContent(
|
|
6313
|
-
(0,
|
|
6547
|
+
(0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6314
6548
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6315
6549
|
);
|
|
6316
6550
|
const json = JSON.parse(fileContent);
|
|
@@ -6355,7 +6589,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6355
6589
|
};
|
|
6356
6590
|
|
|
6357
6591
|
// src/features/mcp/junie-mcp.ts
|
|
6358
|
-
var
|
|
6592
|
+
var import_node_path50 = require("path");
|
|
6359
6593
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6360
6594
|
json;
|
|
6361
6595
|
constructor(params) {
|
|
@@ -6367,7 +6601,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6367
6601
|
}
|
|
6368
6602
|
static getSettablePaths() {
|
|
6369
6603
|
return {
|
|
6370
|
-
relativeDirPath: (0,
|
|
6604
|
+
relativeDirPath: (0, import_node_path50.join)(".junie", "mcp"),
|
|
6371
6605
|
relativeFilePath: "mcp.json"
|
|
6372
6606
|
};
|
|
6373
6607
|
}
|
|
@@ -6376,7 +6610,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6376
6610
|
validate = true
|
|
6377
6611
|
}) {
|
|
6378
6612
|
const fileContent = await readFileContent(
|
|
6379
|
-
(0,
|
|
6613
|
+
(0, import_node_path50.join)(
|
|
6380
6614
|
baseDir,
|
|
6381
6615
|
this.getSettablePaths().relativeDirPath,
|
|
6382
6616
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6425,7 +6659,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6425
6659
|
};
|
|
6426
6660
|
|
|
6427
6661
|
// src/features/mcp/kilo-mcp.ts
|
|
6428
|
-
var
|
|
6662
|
+
var import_node_path51 = require("path");
|
|
6429
6663
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6430
6664
|
json;
|
|
6431
6665
|
constructor(params) {
|
|
@@ -6446,7 +6680,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6446
6680
|
validate = true
|
|
6447
6681
|
}) {
|
|
6448
6682
|
const paths = this.getSettablePaths();
|
|
6449
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6683
|
+
const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6450
6684
|
return new _KiloMcp({
|
|
6451
6685
|
baseDir,
|
|
6452
6686
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6494,7 +6728,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6494
6728
|
};
|
|
6495
6729
|
|
|
6496
6730
|
// src/features/mcp/kiro-mcp.ts
|
|
6497
|
-
var
|
|
6731
|
+
var import_node_path52 = require("path");
|
|
6498
6732
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6499
6733
|
json;
|
|
6500
6734
|
constructor(params) {
|
|
@@ -6506,7 +6740,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6506
6740
|
}
|
|
6507
6741
|
static getSettablePaths() {
|
|
6508
6742
|
return {
|
|
6509
|
-
relativeDirPath: (0,
|
|
6743
|
+
relativeDirPath: (0, import_node_path52.join)(".kiro", "settings"),
|
|
6510
6744
|
relativeFilePath: "mcp.json"
|
|
6511
6745
|
};
|
|
6512
6746
|
}
|
|
@@ -6515,7 +6749,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6515
6749
|
validate = true
|
|
6516
6750
|
}) {
|
|
6517
6751
|
const paths = this.getSettablePaths();
|
|
6518
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6752
|
+
const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6519
6753
|
return new _KiroMcp({
|
|
6520
6754
|
baseDir,
|
|
6521
6755
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6563,29 +6797,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6563
6797
|
};
|
|
6564
6798
|
|
|
6565
6799
|
// src/features/mcp/opencode-mcp.ts
|
|
6566
|
-
var
|
|
6567
|
-
var
|
|
6568
|
-
var
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6800
|
+
var import_node_path53 = require("path");
|
|
6801
|
+
var import_jsonc_parser2 = require("jsonc-parser");
|
|
6802
|
+
var import_mini21 = require("zod/mini");
|
|
6803
|
+
var OpencodeMcpLocalServerSchema = import_mini21.z.object({
|
|
6804
|
+
type: import_mini21.z.literal("local"),
|
|
6805
|
+
command: import_mini21.z.array(import_mini21.z.string()),
|
|
6806
|
+
environment: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
|
|
6807
|
+
enabled: import_mini21.z._default(import_mini21.z.boolean(), true),
|
|
6808
|
+
cwd: import_mini21.z.optional(import_mini21.z.string())
|
|
6574
6809
|
});
|
|
6575
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6576
|
-
type:
|
|
6577
|
-
url:
|
|
6578
|
-
headers:
|
|
6579
|
-
enabled:
|
|
6810
|
+
var OpencodeMcpRemoteServerSchema = import_mini21.z.object({
|
|
6811
|
+
type: import_mini21.z.literal("remote"),
|
|
6812
|
+
url: import_mini21.z.string(),
|
|
6813
|
+
headers: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.string())),
|
|
6814
|
+
enabled: import_mini21.z._default(import_mini21.z.boolean(), true)
|
|
6580
6815
|
});
|
|
6581
|
-
var OpencodeMcpServerSchema =
|
|
6816
|
+
var OpencodeMcpServerSchema = import_mini21.z.union([
|
|
6582
6817
|
OpencodeMcpLocalServerSchema,
|
|
6583
6818
|
OpencodeMcpRemoteServerSchema
|
|
6584
6819
|
]);
|
|
6585
|
-
var OpencodeConfigSchema =
|
|
6586
|
-
$schema:
|
|
6587
|
-
mcp:
|
|
6588
|
-
tools:
|
|
6820
|
+
var OpencodeConfigSchema = import_mini21.z.looseObject({
|
|
6821
|
+
$schema: import_mini21.z.optional(import_mini21.z.string()),
|
|
6822
|
+
mcp: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), OpencodeMcpServerSchema)),
|
|
6823
|
+
tools: import_mini21.z.optional(import_mini21.z.record(import_mini21.z.string(), import_mini21.z.boolean()))
|
|
6589
6824
|
});
|
|
6590
6825
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6591
6826
|
return Object.fromEntries(
|
|
@@ -6689,7 +6924,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6689
6924
|
json;
|
|
6690
6925
|
constructor(params) {
|
|
6691
6926
|
super(params);
|
|
6692
|
-
this.json = OpencodeConfigSchema.parse(
|
|
6927
|
+
this.json = OpencodeConfigSchema.parse((0, import_jsonc_parser2.parse)(this.fileContent || "{}"));
|
|
6693
6928
|
}
|
|
6694
6929
|
getJson() {
|
|
6695
6930
|
return this.json;
|
|
@@ -6703,7 +6938,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6703
6938
|
static getSettablePaths({ global } = {}) {
|
|
6704
6939
|
if (global) {
|
|
6705
6940
|
return {
|
|
6706
|
-
relativeDirPath: (0,
|
|
6941
|
+
relativeDirPath: (0, import_node_path53.join)(".config", "opencode"),
|
|
6707
6942
|
relativeFilePath: "opencode.json"
|
|
6708
6943
|
};
|
|
6709
6944
|
}
|
|
@@ -6717,14 +6952,26 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6717
6952
|
validate = true,
|
|
6718
6953
|
global = false
|
|
6719
6954
|
}) {
|
|
6720
|
-
const
|
|
6721
|
-
const
|
|
6722
|
-
|
|
6955
|
+
const basePaths = this.getSettablePaths({ global });
|
|
6956
|
+
const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
|
|
6957
|
+
let fileContent = null;
|
|
6958
|
+
let relativeFilePath = "opencode.jsonc";
|
|
6959
|
+
const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
|
|
6960
|
+
const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
|
|
6961
|
+
fileContent = await readFileContentOrNull(jsoncPath);
|
|
6962
|
+
if (!fileContent) {
|
|
6963
|
+
fileContent = await readFileContentOrNull(jsonPath);
|
|
6964
|
+
if (fileContent) {
|
|
6965
|
+
relativeFilePath = "opencode.json";
|
|
6966
|
+
}
|
|
6967
|
+
}
|
|
6968
|
+
const fileContentToUse = fileContent ?? '{"mcp":{}}';
|
|
6969
|
+
const json = (0, import_jsonc_parser2.parse)(fileContentToUse);
|
|
6723
6970
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
6724
6971
|
return new _OpencodeMcp({
|
|
6725
6972
|
baseDir,
|
|
6726
|
-
relativeDirPath:
|
|
6727
|
-
relativeFilePath
|
|
6973
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
6974
|
+
relativeFilePath,
|
|
6728
6975
|
fileContent: JSON.stringify(newJson, null, 2),
|
|
6729
6976
|
validate
|
|
6730
6977
|
});
|
|
@@ -6735,12 +6982,23 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6735
6982
|
validate = true,
|
|
6736
6983
|
global = false
|
|
6737
6984
|
}) {
|
|
6738
|
-
const
|
|
6739
|
-
const
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
);
|
|
6743
|
-
const
|
|
6985
|
+
const basePaths = this.getSettablePaths({ global });
|
|
6986
|
+
const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
|
|
6987
|
+
let fileContent = null;
|
|
6988
|
+
let relativeFilePath = "opencode.jsonc";
|
|
6989
|
+
const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
|
|
6990
|
+
const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
|
|
6991
|
+
fileContent = await readFileContentOrNull(jsoncPath);
|
|
6992
|
+
if (!fileContent) {
|
|
6993
|
+
fileContent = await readFileContentOrNull(jsonPath);
|
|
6994
|
+
if (fileContent) {
|
|
6995
|
+
relativeFilePath = "opencode.json";
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
if (!fileContent) {
|
|
6999
|
+
fileContent = JSON.stringify({ mcp: {} }, null, 2);
|
|
7000
|
+
}
|
|
7001
|
+
const json = (0, import_jsonc_parser2.parse)(fileContent);
|
|
6744
7002
|
const { mcp: convertedMcp, tools: mcpTools } = convertToOpencodeFormat(
|
|
6745
7003
|
rulesyncMcp.getMcpServers()
|
|
6746
7004
|
);
|
|
@@ -6752,8 +7010,8 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6752
7010
|
};
|
|
6753
7011
|
return new _OpencodeMcp({
|
|
6754
7012
|
baseDir,
|
|
6755
|
-
relativeDirPath:
|
|
6756
|
-
relativeFilePath
|
|
7013
|
+
relativeDirPath: basePaths.relativeDirPath,
|
|
7014
|
+
relativeFilePath,
|
|
6757
7015
|
fileContent: JSON.stringify(newJson, null, 2),
|
|
6758
7016
|
validate
|
|
6759
7017
|
});
|
|
@@ -6790,7 +7048,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6790
7048
|
};
|
|
6791
7049
|
|
|
6792
7050
|
// src/features/mcp/roo-mcp.ts
|
|
6793
|
-
var
|
|
7051
|
+
var import_node_path54 = require("path");
|
|
6794
7052
|
function isRooMcpServers(value) {
|
|
6795
7053
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
6796
7054
|
}
|
|
@@ -6842,7 +7100,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
6842
7100
|
validate = true
|
|
6843
7101
|
}) {
|
|
6844
7102
|
const fileContent = await readFileContent(
|
|
6845
|
-
(0,
|
|
7103
|
+
(0, import_node_path54.join)(
|
|
6846
7104
|
baseDir,
|
|
6847
7105
|
this.getSettablePaths().relativeDirPath,
|
|
6848
7106
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6913,7 +7171,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
6913
7171
|
"opencode",
|
|
6914
7172
|
"roo"
|
|
6915
7173
|
];
|
|
6916
|
-
var McpProcessorToolTargetSchema =
|
|
7174
|
+
var McpProcessorToolTargetSchema = import_mini22.z.enum(mcpProcessorToolTargetTuple);
|
|
6917
7175
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
6918
7176
|
[
|
|
6919
7177
|
"claudecode",
|
|
@@ -7215,25 +7473,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7215
7473
|
};
|
|
7216
7474
|
|
|
7217
7475
|
// src/features/rules/rules-processor.ts
|
|
7218
|
-
var
|
|
7476
|
+
var import_node_path114 = require("path");
|
|
7219
7477
|
var import_toon = require("@toon-format/toon");
|
|
7220
|
-
var
|
|
7478
|
+
var import_mini54 = require("zod/mini");
|
|
7221
7479
|
|
|
7222
7480
|
// src/constants/general.ts
|
|
7223
7481
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7224
7482
|
|
|
7225
7483
|
// src/features/skills/agentsmd-skill.ts
|
|
7226
|
-
var
|
|
7484
|
+
var import_node_path58 = require("path");
|
|
7227
7485
|
|
|
7228
7486
|
// src/features/skills/simulated-skill.ts
|
|
7229
|
-
var
|
|
7230
|
-
var
|
|
7487
|
+
var import_node_path57 = require("path");
|
|
7488
|
+
var import_mini23 = require("zod/mini");
|
|
7231
7489
|
|
|
7232
7490
|
// src/features/skills/tool-skill.ts
|
|
7233
|
-
var
|
|
7491
|
+
var import_node_path56 = require("path");
|
|
7234
7492
|
|
|
7235
7493
|
// src/types/ai-dir.ts
|
|
7236
|
-
var
|
|
7494
|
+
var import_node_path55 = __toESM(require("path"), 1);
|
|
7237
7495
|
var AiDir = class {
|
|
7238
7496
|
/**
|
|
7239
7497
|
* @example "."
|
|
@@ -7267,7 +7525,7 @@ var AiDir = class {
|
|
|
7267
7525
|
otherFiles = [],
|
|
7268
7526
|
global = false
|
|
7269
7527
|
}) {
|
|
7270
|
-
if (dirName.includes(
|
|
7528
|
+
if (dirName.includes(import_node_path55.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
7271
7529
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
7272
7530
|
}
|
|
7273
7531
|
this.baseDir = baseDir;
|
|
@@ -7290,11 +7548,11 @@ var AiDir = class {
|
|
|
7290
7548
|
return this.dirName;
|
|
7291
7549
|
}
|
|
7292
7550
|
getDirPath() {
|
|
7293
|
-
const fullPath =
|
|
7294
|
-
const resolvedFull = (0,
|
|
7295
|
-
const resolvedBase = (0,
|
|
7296
|
-
const rel = (0,
|
|
7297
|
-
if (rel.startsWith("..") ||
|
|
7551
|
+
const fullPath = import_node_path55.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
7552
|
+
const resolvedFull = (0, import_node_path55.resolve)(fullPath);
|
|
7553
|
+
const resolvedBase = (0, import_node_path55.resolve)(this.baseDir);
|
|
7554
|
+
const rel = (0, import_node_path55.relative)(resolvedBase, resolvedFull);
|
|
7555
|
+
if (rel.startsWith("..") || import_node_path55.default.isAbsolute(rel)) {
|
|
7298
7556
|
throw new Error(
|
|
7299
7557
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
7300
7558
|
);
|
|
@@ -7308,7 +7566,7 @@ var AiDir = class {
|
|
|
7308
7566
|
return this.otherFiles;
|
|
7309
7567
|
}
|
|
7310
7568
|
getRelativePathFromCwd() {
|
|
7311
|
-
return
|
|
7569
|
+
return import_node_path55.default.join(this.relativeDirPath, this.dirName);
|
|
7312
7570
|
}
|
|
7313
7571
|
getGlobal() {
|
|
7314
7572
|
return this.global;
|
|
@@ -7327,15 +7585,15 @@ var AiDir = class {
|
|
|
7327
7585
|
* @returns Array of files with their relative paths and buffers
|
|
7328
7586
|
*/
|
|
7329
7587
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7330
|
-
const dirPath = (0,
|
|
7331
|
-
const glob = (0,
|
|
7588
|
+
const dirPath = (0, import_node_path55.join)(baseDir, relativeDirPath, dirName);
|
|
7589
|
+
const glob = (0, import_node_path55.join)(dirPath, "**", "*");
|
|
7332
7590
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7333
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
7591
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path55.basename)(filePath) !== excludeFileName);
|
|
7334
7592
|
const files = await Promise.all(
|
|
7335
7593
|
filteredPaths.map(async (filePath) => {
|
|
7336
7594
|
const fileBuffer = await readFileBuffer(filePath);
|
|
7337
7595
|
return {
|
|
7338
|
-
relativeFilePathToDirPath: (0,
|
|
7596
|
+
relativeFilePathToDirPath: (0, import_node_path55.relative)(dirPath, filePath),
|
|
7339
7597
|
fileBuffer
|
|
7340
7598
|
};
|
|
7341
7599
|
})
|
|
@@ -7426,8 +7684,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7426
7684
|
}) {
|
|
7427
7685
|
const settablePaths = getSettablePaths({ global });
|
|
7428
7686
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7429
|
-
const skillDirPath = (0,
|
|
7430
|
-
const skillFilePath = (0,
|
|
7687
|
+
const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7688
|
+
const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7431
7689
|
if (!await fileExists(skillFilePath)) {
|
|
7432
7690
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7433
7691
|
}
|
|
@@ -7451,16 +7709,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7451
7709
|
}
|
|
7452
7710
|
requireMainFileFrontmatter() {
|
|
7453
7711
|
if (!this.mainFile?.frontmatter) {
|
|
7454
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7712
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path56.join)(this.relativeDirPath, this.dirName)}`);
|
|
7455
7713
|
}
|
|
7456
7714
|
return this.mainFile.frontmatter;
|
|
7457
7715
|
}
|
|
7458
7716
|
};
|
|
7459
7717
|
|
|
7460
7718
|
// src/features/skills/simulated-skill.ts
|
|
7461
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7462
|
-
name:
|
|
7463
|
-
description:
|
|
7719
|
+
var SimulatedSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
7720
|
+
name: import_mini23.z.string(),
|
|
7721
|
+
description: import_mini23.z.string()
|
|
7464
7722
|
});
|
|
7465
7723
|
var SimulatedSkill = class extends ToolSkill {
|
|
7466
7724
|
frontmatter;
|
|
@@ -7491,7 +7749,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7491
7749
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7492
7750
|
if (!result.success) {
|
|
7493
7751
|
throw new Error(
|
|
7494
|
-
`Invalid frontmatter in ${(0,
|
|
7752
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7495
7753
|
);
|
|
7496
7754
|
}
|
|
7497
7755
|
}
|
|
@@ -7549,8 +7807,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7549
7807
|
}) {
|
|
7550
7808
|
const settablePaths = this.getSettablePaths();
|
|
7551
7809
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7552
|
-
const skillDirPath = (0,
|
|
7553
|
-
const skillFilePath = (0,
|
|
7810
|
+
const skillDirPath = (0, import_node_path57.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7811
|
+
const skillFilePath = (0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7554
7812
|
if (!await fileExists(skillFilePath)) {
|
|
7555
7813
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7556
7814
|
}
|
|
@@ -7627,7 +7885,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7627
7885
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7628
7886
|
}
|
|
7629
7887
|
return {
|
|
7630
|
-
relativeDirPath: (0,
|
|
7888
|
+
relativeDirPath: (0, import_node_path58.join)(".agents", "skills")
|
|
7631
7889
|
};
|
|
7632
7890
|
}
|
|
7633
7891
|
static async fromDir(params) {
|
|
@@ -7654,11 +7912,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7654
7912
|
};
|
|
7655
7913
|
|
|
7656
7914
|
// src/features/skills/factorydroid-skill.ts
|
|
7657
|
-
var
|
|
7915
|
+
var import_node_path59 = require("path");
|
|
7658
7916
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7659
7917
|
static getSettablePaths(_options) {
|
|
7660
7918
|
return {
|
|
7661
|
-
relativeDirPath: (0,
|
|
7919
|
+
relativeDirPath: (0, import_node_path59.join)(".factory", "skills")
|
|
7662
7920
|
};
|
|
7663
7921
|
}
|
|
7664
7922
|
static async fromDir(params) {
|
|
@@ -7685,11 +7943,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
7685
7943
|
};
|
|
7686
7944
|
|
|
7687
7945
|
// src/features/skills/skills-processor.ts
|
|
7688
|
-
var
|
|
7689
|
-
var
|
|
7946
|
+
var import_node_path76 = require("path");
|
|
7947
|
+
var import_mini38 = require("zod/mini");
|
|
7690
7948
|
|
|
7691
7949
|
// src/types/dir-feature-processor.ts
|
|
7692
|
-
var
|
|
7950
|
+
var import_node_path60 = require("path");
|
|
7693
7951
|
var DirFeatureProcessor = class {
|
|
7694
7952
|
baseDir;
|
|
7695
7953
|
dryRun;
|
|
@@ -7720,7 +7978,7 @@ var DirFeatureProcessor = class {
|
|
|
7720
7978
|
const mainFile = aiDir.getMainFile();
|
|
7721
7979
|
let mainFileContent;
|
|
7722
7980
|
if (mainFile) {
|
|
7723
|
-
const mainFilePath = (0,
|
|
7981
|
+
const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
|
|
7724
7982
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
7725
7983
|
mainFileContent = addTrailingNewline(content);
|
|
7726
7984
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -7734,7 +7992,7 @@ var DirFeatureProcessor = class {
|
|
|
7734
7992
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
7735
7993
|
otherFileContents.push(contentWithNewline);
|
|
7736
7994
|
if (!dirHasChanges) {
|
|
7737
|
-
const filePath = (0,
|
|
7995
|
+
const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7738
7996
|
const existingContent = await readFileContentOrNull(filePath);
|
|
7739
7997
|
if (existingContent !== contentWithNewline) {
|
|
7740
7998
|
dirHasChanges = true;
|
|
@@ -7748,22 +8006,22 @@ var DirFeatureProcessor = class {
|
|
|
7748
8006
|
if (this.dryRun) {
|
|
7749
8007
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
7750
8008
|
if (mainFile) {
|
|
7751
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7752
|
-
changedPaths.push((0,
|
|
8009
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, mainFile.name)}`);
|
|
8010
|
+
changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
|
|
7753
8011
|
}
|
|
7754
8012
|
for (const file of otherFiles) {
|
|
7755
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7756
|
-
changedPaths.push((0,
|
|
8013
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath)}`);
|
|
8014
|
+
changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7757
8015
|
}
|
|
7758
8016
|
} else {
|
|
7759
8017
|
await ensureDir(dirPath);
|
|
7760
8018
|
if (mainFile && mainFileContent) {
|
|
7761
|
-
const mainFilePath = (0,
|
|
8019
|
+
const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
|
|
7762
8020
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
7763
|
-
changedPaths.push((0,
|
|
8021
|
+
changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
|
|
7764
8022
|
}
|
|
7765
8023
|
for (const [i, file] of otherFiles.entries()) {
|
|
7766
|
-
const filePath = (0,
|
|
8024
|
+
const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7767
8025
|
const content = otherFileContents[i];
|
|
7768
8026
|
if (content === void 0) {
|
|
7769
8027
|
throw new Error(
|
|
@@ -7771,7 +8029,7 @@ var DirFeatureProcessor = class {
|
|
|
7771
8029
|
);
|
|
7772
8030
|
}
|
|
7773
8031
|
await writeFileContent(filePath, content);
|
|
7774
|
-
changedPaths.push((0,
|
|
8032
|
+
changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7775
8033
|
}
|
|
7776
8034
|
}
|
|
7777
8035
|
changedCount++;
|
|
@@ -7803,38 +8061,38 @@ var DirFeatureProcessor = class {
|
|
|
7803
8061
|
};
|
|
7804
8062
|
|
|
7805
8063
|
// src/features/skills/agentsskills-skill.ts
|
|
7806
|
-
var
|
|
7807
|
-
var
|
|
8064
|
+
var import_node_path62 = require("path");
|
|
8065
|
+
var import_mini25 = require("zod/mini");
|
|
7808
8066
|
|
|
7809
8067
|
// src/features/skills/rulesync-skill.ts
|
|
7810
|
-
var
|
|
7811
|
-
var
|
|
7812
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
7813
|
-
name:
|
|
7814
|
-
description:
|
|
7815
|
-
targets:
|
|
7816
|
-
claudecode:
|
|
7817
|
-
|
|
7818
|
-
"allowed-tools":
|
|
8068
|
+
var import_node_path61 = require("path");
|
|
8069
|
+
var import_mini24 = require("zod/mini");
|
|
8070
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini24.z.looseObject({
|
|
8071
|
+
name: import_mini24.z.string(),
|
|
8072
|
+
description: import_mini24.z.string(),
|
|
8073
|
+
targets: import_mini24.z._default(RulesyncTargetsSchema, ["*"]),
|
|
8074
|
+
claudecode: import_mini24.z.optional(
|
|
8075
|
+
import_mini24.z.looseObject({
|
|
8076
|
+
"allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string()))
|
|
7819
8077
|
})
|
|
7820
8078
|
),
|
|
7821
|
-
codexcli:
|
|
7822
|
-
|
|
7823
|
-
"short-description":
|
|
8079
|
+
codexcli: import_mini24.z.optional(
|
|
8080
|
+
import_mini24.z.looseObject({
|
|
8081
|
+
"short-description": import_mini24.z.optional(import_mini24.z.string())
|
|
7824
8082
|
})
|
|
7825
8083
|
),
|
|
7826
|
-
opencode:
|
|
7827
|
-
|
|
7828
|
-
"allowed-tools":
|
|
8084
|
+
opencode: import_mini24.z.optional(
|
|
8085
|
+
import_mini24.z.looseObject({
|
|
8086
|
+
"allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string()))
|
|
7829
8087
|
})
|
|
7830
8088
|
),
|
|
7831
|
-
copilot:
|
|
7832
|
-
|
|
7833
|
-
license:
|
|
8089
|
+
copilot: import_mini24.z.optional(
|
|
8090
|
+
import_mini24.z.looseObject({
|
|
8091
|
+
license: import_mini24.z.optional(import_mini24.z.string())
|
|
7834
8092
|
})
|
|
7835
8093
|
),
|
|
7836
|
-
cline:
|
|
7837
|
-
roo:
|
|
8094
|
+
cline: import_mini24.z.optional(import_mini24.z.looseObject({})),
|
|
8095
|
+
roo: import_mini24.z.optional(import_mini24.z.looseObject({}))
|
|
7838
8096
|
});
|
|
7839
8097
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
7840
8098
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -7874,7 +8132,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7874
8132
|
}
|
|
7875
8133
|
getFrontmatter() {
|
|
7876
8134
|
if (!this.mainFile?.frontmatter) {
|
|
7877
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
8135
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path61.join)(this.relativeDirPath, this.dirName)}`);
|
|
7878
8136
|
}
|
|
7879
8137
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7880
8138
|
return result;
|
|
@@ -7900,8 +8158,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7900
8158
|
dirName,
|
|
7901
8159
|
global = false
|
|
7902
8160
|
}) {
|
|
7903
|
-
const skillDirPath = (0,
|
|
7904
|
-
const skillFilePath = (0,
|
|
8161
|
+
const skillDirPath = (0, import_node_path61.join)(baseDir, relativeDirPath, dirName);
|
|
8162
|
+
const skillFilePath = (0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7905
8163
|
if (!await fileExists(skillFilePath)) {
|
|
7906
8164
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7907
8165
|
}
|
|
@@ -7931,14 +8189,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7931
8189
|
};
|
|
7932
8190
|
|
|
7933
8191
|
// src/features/skills/agentsskills-skill.ts
|
|
7934
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
7935
|
-
name:
|
|
7936
|
-
description:
|
|
8192
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
8193
|
+
name: import_mini25.z.string(),
|
|
8194
|
+
description: import_mini25.z.string()
|
|
7937
8195
|
});
|
|
7938
8196
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
7939
8197
|
constructor({
|
|
7940
8198
|
baseDir = process.cwd(),
|
|
7941
|
-
relativeDirPath = (0,
|
|
8199
|
+
relativeDirPath = (0, import_node_path62.join)(".agents", "skills"),
|
|
7942
8200
|
dirName,
|
|
7943
8201
|
frontmatter,
|
|
7944
8202
|
body,
|
|
@@ -7970,7 +8228,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7970
8228
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
7971
8229
|
}
|
|
7972
8230
|
return {
|
|
7973
|
-
relativeDirPath: (0,
|
|
8231
|
+
relativeDirPath: (0, import_node_path62.join)(".agents", "skills")
|
|
7974
8232
|
};
|
|
7975
8233
|
}
|
|
7976
8234
|
getFrontmatter() {
|
|
@@ -8049,9 +8307,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8049
8307
|
});
|
|
8050
8308
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8051
8309
|
if (!result.success) {
|
|
8052
|
-
const skillDirPath = (0,
|
|
8310
|
+
const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8053
8311
|
throw new Error(
|
|
8054
|
-
`Invalid frontmatter in ${(0,
|
|
8312
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8055
8313
|
);
|
|
8056
8314
|
}
|
|
8057
8315
|
return new _AgentsSkillsSkill({
|
|
@@ -8086,16 +8344,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8086
8344
|
};
|
|
8087
8345
|
|
|
8088
8346
|
// src/features/skills/antigravity-skill.ts
|
|
8089
|
-
var
|
|
8090
|
-
var
|
|
8091
|
-
var AntigravitySkillFrontmatterSchema =
|
|
8092
|
-
name:
|
|
8093
|
-
description:
|
|
8347
|
+
var import_node_path63 = require("path");
|
|
8348
|
+
var import_mini26 = require("zod/mini");
|
|
8349
|
+
var AntigravitySkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
8350
|
+
name: import_mini26.z.string(),
|
|
8351
|
+
description: import_mini26.z.string()
|
|
8094
8352
|
});
|
|
8095
8353
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8096
8354
|
constructor({
|
|
8097
8355
|
baseDir = process.cwd(),
|
|
8098
|
-
relativeDirPath = (0,
|
|
8356
|
+
relativeDirPath = (0, import_node_path63.join)(".agent", "skills"),
|
|
8099
8357
|
dirName,
|
|
8100
8358
|
frontmatter,
|
|
8101
8359
|
body,
|
|
@@ -8127,11 +8385,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8127
8385
|
} = {}) {
|
|
8128
8386
|
if (global) {
|
|
8129
8387
|
return {
|
|
8130
|
-
relativeDirPath: (0,
|
|
8388
|
+
relativeDirPath: (0, import_node_path63.join)(".gemini", "antigravity", "skills")
|
|
8131
8389
|
};
|
|
8132
8390
|
}
|
|
8133
8391
|
return {
|
|
8134
|
-
relativeDirPath: (0,
|
|
8392
|
+
relativeDirPath: (0, import_node_path63.join)(".agent", "skills")
|
|
8135
8393
|
};
|
|
8136
8394
|
}
|
|
8137
8395
|
getFrontmatter() {
|
|
@@ -8210,9 +8468,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8210
8468
|
});
|
|
8211
8469
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8212
8470
|
if (!result.success) {
|
|
8213
|
-
const skillDirPath = (0,
|
|
8471
|
+
const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8214
8472
|
throw new Error(
|
|
8215
|
-
`Invalid frontmatter in ${(0,
|
|
8473
|
+
`Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8216
8474
|
);
|
|
8217
8475
|
}
|
|
8218
8476
|
return new _AntigravitySkill({
|
|
@@ -8246,17 +8504,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8246
8504
|
};
|
|
8247
8505
|
|
|
8248
8506
|
// src/features/skills/claudecode-skill.ts
|
|
8249
|
-
var
|
|
8250
|
-
var
|
|
8251
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
8252
|
-
name:
|
|
8253
|
-
description:
|
|
8254
|
-
"allowed-tools":
|
|
8507
|
+
var import_node_path64 = require("path");
|
|
8508
|
+
var import_mini27 = require("zod/mini");
|
|
8509
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
8510
|
+
name: import_mini27.z.string(),
|
|
8511
|
+
description: import_mini27.z.string(),
|
|
8512
|
+
"allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string()))
|
|
8255
8513
|
});
|
|
8256
8514
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8257
8515
|
constructor({
|
|
8258
8516
|
baseDir = process.cwd(),
|
|
8259
|
-
relativeDirPath = (0,
|
|
8517
|
+
relativeDirPath = (0, import_node_path64.join)(".claude", "skills"),
|
|
8260
8518
|
dirName,
|
|
8261
8519
|
frontmatter,
|
|
8262
8520
|
body,
|
|
@@ -8287,7 +8545,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8287
8545
|
global: _global = false
|
|
8288
8546
|
} = {}) {
|
|
8289
8547
|
return {
|
|
8290
|
-
relativeDirPath: (0,
|
|
8548
|
+
relativeDirPath: (0, import_node_path64.join)(".claude", "skills")
|
|
8291
8549
|
};
|
|
8292
8550
|
}
|
|
8293
8551
|
getFrontmatter() {
|
|
@@ -8372,9 +8630,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8372
8630
|
});
|
|
8373
8631
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8374
8632
|
if (!result.success) {
|
|
8375
|
-
const skillDirPath = (0,
|
|
8633
|
+
const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8376
8634
|
throw new Error(
|
|
8377
|
-
`Invalid frontmatter in ${(0,
|
|
8635
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8378
8636
|
);
|
|
8379
8637
|
}
|
|
8380
8638
|
return new _ClaudecodeSkill({
|
|
@@ -8408,16 +8666,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8408
8666
|
};
|
|
8409
8667
|
|
|
8410
8668
|
// src/features/skills/cline-skill.ts
|
|
8411
|
-
var
|
|
8412
|
-
var
|
|
8413
|
-
var ClineSkillFrontmatterSchema =
|
|
8414
|
-
name:
|
|
8415
|
-
description:
|
|
8669
|
+
var import_node_path65 = require("path");
|
|
8670
|
+
var import_mini28 = require("zod/mini");
|
|
8671
|
+
var ClineSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
8672
|
+
name: import_mini28.z.string(),
|
|
8673
|
+
description: import_mini28.z.string()
|
|
8416
8674
|
});
|
|
8417
8675
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8418
8676
|
constructor({
|
|
8419
8677
|
baseDir = process.cwd(),
|
|
8420
|
-
relativeDirPath = (0,
|
|
8678
|
+
relativeDirPath = (0, import_node_path65.join)(".cline", "skills"),
|
|
8421
8679
|
dirName,
|
|
8422
8680
|
frontmatter,
|
|
8423
8681
|
body,
|
|
@@ -8446,7 +8704,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8446
8704
|
}
|
|
8447
8705
|
static getSettablePaths(_options = {}) {
|
|
8448
8706
|
return {
|
|
8449
|
-
relativeDirPath: (0,
|
|
8707
|
+
relativeDirPath: (0, import_node_path65.join)(".cline", "skills")
|
|
8450
8708
|
};
|
|
8451
8709
|
}
|
|
8452
8710
|
getFrontmatter() {
|
|
@@ -8533,13 +8791,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8533
8791
|
});
|
|
8534
8792
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8535
8793
|
if (!result.success) {
|
|
8536
|
-
const skillDirPath = (0,
|
|
8794
|
+
const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8537
8795
|
throw new Error(
|
|
8538
|
-
`Invalid frontmatter in ${(0,
|
|
8796
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8539
8797
|
);
|
|
8540
8798
|
}
|
|
8541
8799
|
if (result.data.name !== loaded.dirName) {
|
|
8542
|
-
const skillFilePath = (0,
|
|
8800
|
+
const skillFilePath = (0, import_node_path65.join)(
|
|
8543
8801
|
loaded.baseDir,
|
|
8544
8802
|
loaded.relativeDirPath,
|
|
8545
8803
|
loaded.dirName,
|
|
@@ -8580,21 +8838,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8580
8838
|
};
|
|
8581
8839
|
|
|
8582
8840
|
// src/features/skills/codexcli-skill.ts
|
|
8583
|
-
var
|
|
8584
|
-
var
|
|
8585
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8586
|
-
name:
|
|
8587
|
-
description:
|
|
8588
|
-
metadata:
|
|
8589
|
-
|
|
8590
|
-
"short-description":
|
|
8841
|
+
var import_node_path66 = require("path");
|
|
8842
|
+
var import_mini29 = require("zod/mini");
|
|
8843
|
+
var CodexCliSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
8844
|
+
name: import_mini29.z.string(),
|
|
8845
|
+
description: import_mini29.z.string(),
|
|
8846
|
+
metadata: import_mini29.z.optional(
|
|
8847
|
+
import_mini29.z.looseObject({
|
|
8848
|
+
"short-description": import_mini29.z.optional(import_mini29.z.string())
|
|
8591
8849
|
})
|
|
8592
8850
|
)
|
|
8593
8851
|
});
|
|
8594
8852
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8595
8853
|
constructor({
|
|
8596
8854
|
baseDir = process.cwd(),
|
|
8597
|
-
relativeDirPath = (0,
|
|
8855
|
+
relativeDirPath = (0, import_node_path66.join)(".codex", "skills"),
|
|
8598
8856
|
dirName,
|
|
8599
8857
|
frontmatter,
|
|
8600
8858
|
body,
|
|
@@ -8625,7 +8883,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8625
8883
|
global: _global = false
|
|
8626
8884
|
} = {}) {
|
|
8627
8885
|
return {
|
|
8628
|
-
relativeDirPath: (0,
|
|
8886
|
+
relativeDirPath: (0, import_node_path66.join)(".codex", "skills")
|
|
8629
8887
|
};
|
|
8630
8888
|
}
|
|
8631
8889
|
getFrontmatter() {
|
|
@@ -8714,9 +8972,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8714
8972
|
});
|
|
8715
8973
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8716
8974
|
if (!result.success) {
|
|
8717
|
-
const skillDirPath = (0,
|
|
8975
|
+
const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8718
8976
|
throw new Error(
|
|
8719
|
-
`Invalid frontmatter in ${(0,
|
|
8977
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8720
8978
|
);
|
|
8721
8979
|
}
|
|
8722
8980
|
return new _CodexCliSkill({
|
|
@@ -8750,17 +9008,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8750
9008
|
};
|
|
8751
9009
|
|
|
8752
9010
|
// src/features/skills/copilot-skill.ts
|
|
8753
|
-
var
|
|
8754
|
-
var
|
|
8755
|
-
var CopilotSkillFrontmatterSchema =
|
|
8756
|
-
name:
|
|
8757
|
-
description:
|
|
8758
|
-
license:
|
|
9011
|
+
var import_node_path67 = require("path");
|
|
9012
|
+
var import_mini30 = require("zod/mini");
|
|
9013
|
+
var CopilotSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
9014
|
+
name: import_mini30.z.string(),
|
|
9015
|
+
description: import_mini30.z.string(),
|
|
9016
|
+
license: import_mini30.z.optional(import_mini30.z.string())
|
|
8759
9017
|
});
|
|
8760
9018
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
8761
9019
|
constructor({
|
|
8762
9020
|
baseDir = process.cwd(),
|
|
8763
|
-
relativeDirPath = (0,
|
|
9021
|
+
relativeDirPath = (0, import_node_path67.join)(".github", "skills"),
|
|
8764
9022
|
dirName,
|
|
8765
9023
|
frontmatter,
|
|
8766
9024
|
body,
|
|
@@ -8792,7 +9050,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8792
9050
|
throw new Error("CopilotSkill does not support global mode.");
|
|
8793
9051
|
}
|
|
8794
9052
|
return {
|
|
8795
|
-
relativeDirPath: (0,
|
|
9053
|
+
relativeDirPath: (0, import_node_path67.join)(".github", "skills")
|
|
8796
9054
|
};
|
|
8797
9055
|
}
|
|
8798
9056
|
getFrontmatter() {
|
|
@@ -8877,9 +9135,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8877
9135
|
});
|
|
8878
9136
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8879
9137
|
if (!result.success) {
|
|
8880
|
-
const skillDirPath = (0,
|
|
9138
|
+
const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8881
9139
|
throw new Error(
|
|
8882
|
-
`Invalid frontmatter in ${(0,
|
|
9140
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8883
9141
|
);
|
|
8884
9142
|
}
|
|
8885
9143
|
return new _CopilotSkill({
|
|
@@ -8914,16 +9172,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8914
9172
|
};
|
|
8915
9173
|
|
|
8916
9174
|
// src/features/skills/cursor-skill.ts
|
|
8917
|
-
var
|
|
8918
|
-
var
|
|
8919
|
-
var CursorSkillFrontmatterSchema =
|
|
8920
|
-
name:
|
|
8921
|
-
description:
|
|
9175
|
+
var import_node_path68 = require("path");
|
|
9176
|
+
var import_mini31 = require("zod/mini");
|
|
9177
|
+
var CursorSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
9178
|
+
name: import_mini31.z.string(),
|
|
9179
|
+
description: import_mini31.z.string()
|
|
8922
9180
|
});
|
|
8923
9181
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
8924
9182
|
constructor({
|
|
8925
9183
|
baseDir = process.cwd(),
|
|
8926
|
-
relativeDirPath = (0,
|
|
9184
|
+
relativeDirPath = (0, import_node_path68.join)(".cursor", "skills"),
|
|
8927
9185
|
dirName,
|
|
8928
9186
|
frontmatter,
|
|
8929
9187
|
body,
|
|
@@ -8952,7 +9210,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8952
9210
|
}
|
|
8953
9211
|
static getSettablePaths(_options) {
|
|
8954
9212
|
return {
|
|
8955
|
-
relativeDirPath: (0,
|
|
9213
|
+
relativeDirPath: (0, import_node_path68.join)(".cursor", "skills")
|
|
8956
9214
|
};
|
|
8957
9215
|
}
|
|
8958
9216
|
getFrontmatter() {
|
|
@@ -9031,9 +9289,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9031
9289
|
});
|
|
9032
9290
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9033
9291
|
if (!result.success) {
|
|
9034
|
-
const skillDirPath = (0,
|
|
9292
|
+
const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9035
9293
|
throw new Error(
|
|
9036
|
-
`Invalid frontmatter in ${(0,
|
|
9294
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9037
9295
|
);
|
|
9038
9296
|
}
|
|
9039
9297
|
return new _CursorSkill({
|
|
@@ -9068,11 +9326,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9068
9326
|
};
|
|
9069
9327
|
|
|
9070
9328
|
// src/features/skills/geminicli-skill.ts
|
|
9071
|
-
var
|
|
9072
|
-
var
|
|
9073
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
9074
|
-
name:
|
|
9075
|
-
description:
|
|
9329
|
+
var import_node_path69 = require("path");
|
|
9330
|
+
var import_mini32 = require("zod/mini");
|
|
9331
|
+
var GeminiCliSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
9332
|
+
name: import_mini32.z.string(),
|
|
9333
|
+
description: import_mini32.z.string()
|
|
9076
9334
|
});
|
|
9077
9335
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9078
9336
|
constructor({
|
|
@@ -9108,7 +9366,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9108
9366
|
global: _global = false
|
|
9109
9367
|
} = {}) {
|
|
9110
9368
|
return {
|
|
9111
|
-
relativeDirPath: (0,
|
|
9369
|
+
relativeDirPath: (0, import_node_path69.join)(".gemini", "skills")
|
|
9112
9370
|
};
|
|
9113
9371
|
}
|
|
9114
9372
|
getFrontmatter() {
|
|
@@ -9187,9 +9445,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9187
9445
|
});
|
|
9188
9446
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9189
9447
|
if (!result.success) {
|
|
9190
|
-
const skillDirPath = (0,
|
|
9448
|
+
const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9191
9449
|
throw new Error(
|
|
9192
|
-
`Invalid frontmatter in ${(0,
|
|
9450
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9193
9451
|
);
|
|
9194
9452
|
}
|
|
9195
9453
|
return new _GeminiCliSkill({
|
|
@@ -9224,16 +9482,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9224
9482
|
};
|
|
9225
9483
|
|
|
9226
9484
|
// src/features/skills/kilo-skill.ts
|
|
9227
|
-
var
|
|
9228
|
-
var
|
|
9229
|
-
var KiloSkillFrontmatterSchema =
|
|
9230
|
-
name:
|
|
9231
|
-
description:
|
|
9485
|
+
var import_node_path70 = require("path");
|
|
9486
|
+
var import_mini33 = require("zod/mini");
|
|
9487
|
+
var KiloSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
9488
|
+
name: import_mini33.z.string(),
|
|
9489
|
+
description: import_mini33.z.string()
|
|
9232
9490
|
});
|
|
9233
9491
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
9234
9492
|
constructor({
|
|
9235
9493
|
baseDir = process.cwd(),
|
|
9236
|
-
relativeDirPath = (0,
|
|
9494
|
+
relativeDirPath = (0, import_node_path70.join)(".kilocode", "skills"),
|
|
9237
9495
|
dirName,
|
|
9238
9496
|
frontmatter,
|
|
9239
9497
|
body,
|
|
@@ -9264,7 +9522,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9264
9522
|
global: _global = false
|
|
9265
9523
|
} = {}) {
|
|
9266
9524
|
return {
|
|
9267
|
-
relativeDirPath: (0,
|
|
9525
|
+
relativeDirPath: (0, import_node_path70.join)(".kilocode", "skills")
|
|
9268
9526
|
};
|
|
9269
9527
|
}
|
|
9270
9528
|
getFrontmatter() {
|
|
@@ -9351,13 +9609,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9351
9609
|
});
|
|
9352
9610
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9353
9611
|
if (!result.success) {
|
|
9354
|
-
const skillDirPath = (0,
|
|
9612
|
+
const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9355
9613
|
throw new Error(
|
|
9356
|
-
`Invalid frontmatter in ${(0,
|
|
9614
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9357
9615
|
);
|
|
9358
9616
|
}
|
|
9359
9617
|
if (result.data.name !== loaded.dirName) {
|
|
9360
|
-
const skillFilePath = (0,
|
|
9618
|
+
const skillFilePath = (0, import_node_path70.join)(
|
|
9361
9619
|
loaded.baseDir,
|
|
9362
9620
|
loaded.relativeDirPath,
|
|
9363
9621
|
loaded.dirName,
|
|
@@ -9398,16 +9656,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9398
9656
|
};
|
|
9399
9657
|
|
|
9400
9658
|
// src/features/skills/kiro-skill.ts
|
|
9401
|
-
var
|
|
9402
|
-
var
|
|
9403
|
-
var KiroSkillFrontmatterSchema =
|
|
9404
|
-
name:
|
|
9405
|
-
description:
|
|
9659
|
+
var import_node_path71 = require("path");
|
|
9660
|
+
var import_mini34 = require("zod/mini");
|
|
9661
|
+
var KiroSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
9662
|
+
name: import_mini34.z.string(),
|
|
9663
|
+
description: import_mini34.z.string()
|
|
9406
9664
|
});
|
|
9407
9665
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
9408
9666
|
constructor({
|
|
9409
9667
|
baseDir = process.cwd(),
|
|
9410
|
-
relativeDirPath = (0,
|
|
9668
|
+
relativeDirPath = (0, import_node_path71.join)(".kiro", "skills"),
|
|
9411
9669
|
dirName,
|
|
9412
9670
|
frontmatter,
|
|
9413
9671
|
body,
|
|
@@ -9439,7 +9697,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9439
9697
|
throw new Error("KiroSkill does not support global mode.");
|
|
9440
9698
|
}
|
|
9441
9699
|
return {
|
|
9442
|
-
relativeDirPath: (0,
|
|
9700
|
+
relativeDirPath: (0, import_node_path71.join)(".kiro", "skills")
|
|
9443
9701
|
};
|
|
9444
9702
|
}
|
|
9445
9703
|
getFrontmatter() {
|
|
@@ -9526,13 +9784,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9526
9784
|
});
|
|
9527
9785
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9528
9786
|
if (!result.success) {
|
|
9529
|
-
const skillDirPath = (0,
|
|
9787
|
+
const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9530
9788
|
throw new Error(
|
|
9531
|
-
`Invalid frontmatter in ${(0,
|
|
9789
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9532
9790
|
);
|
|
9533
9791
|
}
|
|
9534
9792
|
if (result.data.name !== loaded.dirName) {
|
|
9535
|
-
const skillFilePath = (0,
|
|
9793
|
+
const skillFilePath = (0, import_node_path71.join)(
|
|
9536
9794
|
loaded.baseDir,
|
|
9537
9795
|
loaded.relativeDirPath,
|
|
9538
9796
|
loaded.dirName,
|
|
@@ -9574,17 +9832,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9574
9832
|
};
|
|
9575
9833
|
|
|
9576
9834
|
// src/features/skills/opencode-skill.ts
|
|
9577
|
-
var
|
|
9578
|
-
var
|
|
9579
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
9580
|
-
name:
|
|
9581
|
-
description:
|
|
9582
|
-
"allowed-tools":
|
|
9835
|
+
var import_node_path72 = require("path");
|
|
9836
|
+
var import_mini35 = require("zod/mini");
|
|
9837
|
+
var OpenCodeSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
9838
|
+
name: import_mini35.z.string(),
|
|
9839
|
+
description: import_mini35.z.string(),
|
|
9840
|
+
"allowed-tools": import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string()))
|
|
9583
9841
|
});
|
|
9584
9842
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
9585
9843
|
constructor({
|
|
9586
9844
|
baseDir = process.cwd(),
|
|
9587
|
-
relativeDirPath = (0,
|
|
9845
|
+
relativeDirPath = (0, import_node_path72.join)(".opencode", "skill"),
|
|
9588
9846
|
dirName,
|
|
9589
9847
|
frontmatter,
|
|
9590
9848
|
body,
|
|
@@ -9613,7 +9871,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9613
9871
|
}
|
|
9614
9872
|
static getSettablePaths({ global = false } = {}) {
|
|
9615
9873
|
return {
|
|
9616
|
-
relativeDirPath: global ? (0,
|
|
9874
|
+
relativeDirPath: global ? (0, import_node_path72.join)(".config", "opencode", "skill") : (0, import_node_path72.join)(".opencode", "skill")
|
|
9617
9875
|
};
|
|
9618
9876
|
}
|
|
9619
9877
|
getFrontmatter() {
|
|
@@ -9698,9 +9956,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9698
9956
|
});
|
|
9699
9957
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9700
9958
|
if (!result.success) {
|
|
9701
|
-
const skillDirPath = (0,
|
|
9959
|
+
const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9702
9960
|
throw new Error(
|
|
9703
|
-
`Invalid frontmatter in ${(0,
|
|
9961
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9704
9962
|
);
|
|
9705
9963
|
}
|
|
9706
9964
|
return new _OpenCodeSkill({
|
|
@@ -9734,16 +9992,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9734
9992
|
};
|
|
9735
9993
|
|
|
9736
9994
|
// src/features/skills/replit-skill.ts
|
|
9737
|
-
var
|
|
9738
|
-
var
|
|
9739
|
-
var ReplitSkillFrontmatterSchema =
|
|
9740
|
-
name:
|
|
9741
|
-
description:
|
|
9995
|
+
var import_node_path73 = require("path");
|
|
9996
|
+
var import_mini36 = require("zod/mini");
|
|
9997
|
+
var ReplitSkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
9998
|
+
name: import_mini36.z.string(),
|
|
9999
|
+
description: import_mini36.z.string()
|
|
9742
10000
|
});
|
|
9743
10001
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
9744
10002
|
constructor({
|
|
9745
10003
|
baseDir = process.cwd(),
|
|
9746
|
-
relativeDirPath = (0,
|
|
10004
|
+
relativeDirPath = (0, import_node_path73.join)(".agents", "skills"),
|
|
9747
10005
|
dirName,
|
|
9748
10006
|
frontmatter,
|
|
9749
10007
|
body,
|
|
@@ -9775,7 +10033,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9775
10033
|
throw new Error("ReplitSkill does not support global mode.");
|
|
9776
10034
|
}
|
|
9777
10035
|
return {
|
|
9778
|
-
relativeDirPath: (0,
|
|
10036
|
+
relativeDirPath: (0, import_node_path73.join)(".agents", "skills")
|
|
9779
10037
|
};
|
|
9780
10038
|
}
|
|
9781
10039
|
getFrontmatter() {
|
|
@@ -9854,9 +10112,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9854
10112
|
});
|
|
9855
10113
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9856
10114
|
if (!result.success) {
|
|
9857
|
-
const skillDirPath = (0,
|
|
10115
|
+
const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9858
10116
|
throw new Error(
|
|
9859
|
-
`Invalid frontmatter in ${(0,
|
|
10117
|
+
`Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9860
10118
|
);
|
|
9861
10119
|
}
|
|
9862
10120
|
return new _ReplitSkill({
|
|
@@ -9891,16 +10149,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9891
10149
|
};
|
|
9892
10150
|
|
|
9893
10151
|
// src/features/skills/roo-skill.ts
|
|
9894
|
-
var
|
|
9895
|
-
var
|
|
9896
|
-
var RooSkillFrontmatterSchema =
|
|
9897
|
-
name:
|
|
9898
|
-
description:
|
|
10152
|
+
var import_node_path74 = require("path");
|
|
10153
|
+
var import_mini37 = require("zod/mini");
|
|
10154
|
+
var RooSkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
10155
|
+
name: import_mini37.z.string(),
|
|
10156
|
+
description: import_mini37.z.string()
|
|
9899
10157
|
});
|
|
9900
10158
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
9901
10159
|
constructor({
|
|
9902
10160
|
baseDir = process.cwd(),
|
|
9903
|
-
relativeDirPath = (0,
|
|
10161
|
+
relativeDirPath = (0, import_node_path74.join)(".roo", "skills"),
|
|
9904
10162
|
dirName,
|
|
9905
10163
|
frontmatter,
|
|
9906
10164
|
body,
|
|
@@ -9931,7 +10189,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9931
10189
|
global: _global = false
|
|
9932
10190
|
} = {}) {
|
|
9933
10191
|
return {
|
|
9934
|
-
relativeDirPath: (0,
|
|
10192
|
+
relativeDirPath: (0, import_node_path74.join)(".roo", "skills")
|
|
9935
10193
|
};
|
|
9936
10194
|
}
|
|
9937
10195
|
getFrontmatter() {
|
|
@@ -10018,13 +10276,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10018
10276
|
});
|
|
10019
10277
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10020
10278
|
if (!result.success) {
|
|
10021
|
-
const skillDirPath = (0,
|
|
10279
|
+
const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10022
10280
|
throw new Error(
|
|
10023
|
-
`Invalid frontmatter in ${(0,
|
|
10281
|
+
`Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10024
10282
|
);
|
|
10025
10283
|
}
|
|
10026
10284
|
if (result.data.name !== loaded.dirName) {
|
|
10027
|
-
const skillFilePath = (0,
|
|
10285
|
+
const skillFilePath = (0, import_node_path74.join)(
|
|
10028
10286
|
loaded.baseDir,
|
|
10029
10287
|
loaded.relativeDirPath,
|
|
10030
10288
|
loaded.dirName,
|
|
@@ -10065,17 +10323,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10065
10323
|
};
|
|
10066
10324
|
|
|
10067
10325
|
// src/features/skills/skills-utils.ts
|
|
10068
|
-
var
|
|
10326
|
+
var import_node_path75 = require("path");
|
|
10069
10327
|
async function getLocalSkillDirNames(baseDir) {
|
|
10070
|
-
const skillsDir = (0,
|
|
10328
|
+
const skillsDir = (0, import_node_path75.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10071
10329
|
const names = /* @__PURE__ */ new Set();
|
|
10072
10330
|
if (!await directoryExists(skillsDir)) {
|
|
10073
10331
|
return names;
|
|
10074
10332
|
}
|
|
10075
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10333
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDir, "*"), { type: "dir" });
|
|
10076
10334
|
for (const dirPath of dirPaths) {
|
|
10077
|
-
const name = (0,
|
|
10078
|
-
if (name === (0,
|
|
10335
|
+
const name = (0, import_node_path75.basename)(dirPath);
|
|
10336
|
+
if (name === (0, import_node_path75.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
10079
10337
|
names.add(name);
|
|
10080
10338
|
}
|
|
10081
10339
|
return names;
|
|
@@ -10100,7 +10358,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10100
10358
|
"replit",
|
|
10101
10359
|
"roo"
|
|
10102
10360
|
];
|
|
10103
|
-
var SkillsProcessorToolTargetSchema =
|
|
10361
|
+
var SkillsProcessorToolTargetSchema = import_mini38.z.enum(skillsProcessorToolTargetTuple);
|
|
10104
10362
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10105
10363
|
[
|
|
10106
10364
|
"agentsmd",
|
|
@@ -10301,11 +10559,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10301
10559
|
)
|
|
10302
10560
|
);
|
|
10303
10561
|
const localSkillNames = new Set(localDirNames);
|
|
10304
|
-
const curatedDirPath = (0,
|
|
10562
|
+
const curatedDirPath = (0, import_node_path76.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
10305
10563
|
let curatedSkills = [];
|
|
10306
10564
|
if (await directoryExists(curatedDirPath)) {
|
|
10307
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
10308
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
10565
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path76.join)(curatedDirPath, "*"), { type: "dir" });
|
|
10566
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path76.basename)(path3));
|
|
10309
10567
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
10310
10568
|
if (localSkillNames.has(name)) {
|
|
10311
10569
|
logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -10338,9 +10596,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10338
10596
|
async loadToolDirs() {
|
|
10339
10597
|
const factory = this.getFactory(this.toolTarget);
|
|
10340
10598
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10341
|
-
const skillsDirPath = (0,
|
|
10342
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10343
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10599
|
+
const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
|
|
10600
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10601
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
|
|
10344
10602
|
const toolSkills = await Promise.all(
|
|
10345
10603
|
dirNames.map(
|
|
10346
10604
|
(dirName) => factory.class.fromDir({
|
|
@@ -10356,9 +10614,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10356
10614
|
async loadToolDirsToDelete() {
|
|
10357
10615
|
const factory = this.getFactory(this.toolTarget);
|
|
10358
10616
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10359
|
-
const skillsDirPath = (0,
|
|
10360
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10361
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10617
|
+
const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
|
|
10618
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10619
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
|
|
10362
10620
|
const toolSkills = dirNames.map(
|
|
10363
10621
|
(dirName) => factory.class.forDeletion({
|
|
10364
10622
|
baseDir: this.baseDir,
|
|
@@ -10419,11 +10677,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10419
10677
|
};
|
|
10420
10678
|
|
|
10421
10679
|
// src/features/subagents/agentsmd-subagent.ts
|
|
10422
|
-
var
|
|
10680
|
+
var import_node_path78 = require("path");
|
|
10423
10681
|
|
|
10424
10682
|
// src/features/subagents/simulated-subagent.ts
|
|
10425
|
-
var
|
|
10426
|
-
var
|
|
10683
|
+
var import_node_path77 = require("path");
|
|
10684
|
+
var import_mini39 = require("zod/mini");
|
|
10427
10685
|
|
|
10428
10686
|
// src/features/subagents/tool-subagent.ts
|
|
10429
10687
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -10475,9 +10733,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
10475
10733
|
};
|
|
10476
10734
|
|
|
10477
10735
|
// src/features/subagents/simulated-subagent.ts
|
|
10478
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
10479
|
-
name:
|
|
10480
|
-
description:
|
|
10736
|
+
var SimulatedSubagentFrontmatterSchema = import_mini39.z.object({
|
|
10737
|
+
name: import_mini39.z.string(),
|
|
10738
|
+
description: import_mini39.z.string()
|
|
10481
10739
|
});
|
|
10482
10740
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
10483
10741
|
frontmatter;
|
|
@@ -10487,7 +10745,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10487
10745
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10488
10746
|
if (!result.success) {
|
|
10489
10747
|
throw new Error(
|
|
10490
|
-
`Invalid frontmatter in ${(0,
|
|
10748
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10491
10749
|
);
|
|
10492
10750
|
}
|
|
10493
10751
|
}
|
|
@@ -10538,7 +10796,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10538
10796
|
return {
|
|
10539
10797
|
success: false,
|
|
10540
10798
|
error: new Error(
|
|
10541
|
-
`Invalid frontmatter in ${(0,
|
|
10799
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10542
10800
|
)
|
|
10543
10801
|
};
|
|
10544
10802
|
}
|
|
@@ -10548,7 +10806,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10548
10806
|
relativeFilePath,
|
|
10549
10807
|
validate = true
|
|
10550
10808
|
}) {
|
|
10551
|
-
const filePath = (0,
|
|
10809
|
+
const filePath = (0, import_node_path77.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
10552
10810
|
const fileContent = await readFileContent(filePath);
|
|
10553
10811
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10554
10812
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10558,7 +10816,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10558
10816
|
return {
|
|
10559
10817
|
baseDir,
|
|
10560
10818
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
10561
|
-
relativeFilePath: (0,
|
|
10819
|
+
relativeFilePath: (0, import_node_path77.basename)(relativeFilePath),
|
|
10562
10820
|
frontmatter: result.data,
|
|
10563
10821
|
body: content.trim(),
|
|
10564
10822
|
validate
|
|
@@ -10584,7 +10842,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10584
10842
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
10585
10843
|
static getSettablePaths() {
|
|
10586
10844
|
return {
|
|
10587
|
-
relativeDirPath: (0,
|
|
10845
|
+
relativeDirPath: (0, import_node_path78.join)(".agents", "subagents")
|
|
10588
10846
|
};
|
|
10589
10847
|
}
|
|
10590
10848
|
static async fromFile(params) {
|
|
@@ -10607,11 +10865,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
10607
10865
|
};
|
|
10608
10866
|
|
|
10609
10867
|
// src/features/subagents/factorydroid-subagent.ts
|
|
10610
|
-
var
|
|
10868
|
+
var import_node_path79 = require("path");
|
|
10611
10869
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
10612
10870
|
static getSettablePaths(_options) {
|
|
10613
10871
|
return {
|
|
10614
|
-
relativeDirPath: (0,
|
|
10872
|
+
relativeDirPath: (0, import_node_path79.join)(".factory", "droids")
|
|
10615
10873
|
};
|
|
10616
10874
|
}
|
|
10617
10875
|
static async fromFile(params) {
|
|
@@ -10634,11 +10892,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
10634
10892
|
};
|
|
10635
10893
|
|
|
10636
10894
|
// src/features/subagents/geminicli-subagent.ts
|
|
10637
|
-
var
|
|
10895
|
+
var import_node_path80 = require("path");
|
|
10638
10896
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
10639
10897
|
static getSettablePaths() {
|
|
10640
10898
|
return {
|
|
10641
|
-
relativeDirPath: (0,
|
|
10899
|
+
relativeDirPath: (0, import_node_path80.join)(".gemini", "subagents")
|
|
10642
10900
|
};
|
|
10643
10901
|
}
|
|
10644
10902
|
static async fromFile(params) {
|
|
@@ -10661,11 +10919,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
10661
10919
|
};
|
|
10662
10920
|
|
|
10663
10921
|
// src/features/subagents/roo-subagent.ts
|
|
10664
|
-
var
|
|
10922
|
+
var import_node_path81 = require("path");
|
|
10665
10923
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
10666
10924
|
static getSettablePaths() {
|
|
10667
10925
|
return {
|
|
10668
|
-
relativeDirPath: (0,
|
|
10926
|
+
relativeDirPath: (0, import_node_path81.join)(".roo", "subagents")
|
|
10669
10927
|
};
|
|
10670
10928
|
}
|
|
10671
10929
|
static async fromFile(params) {
|
|
@@ -10688,20 +10946,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
10688
10946
|
};
|
|
10689
10947
|
|
|
10690
10948
|
// src/features/subagents/subagents-processor.ts
|
|
10691
|
-
var
|
|
10692
|
-
var
|
|
10949
|
+
var import_node_path89 = require("path");
|
|
10950
|
+
var import_mini47 = require("zod/mini");
|
|
10693
10951
|
|
|
10694
10952
|
// src/features/subagents/claudecode-subagent.ts
|
|
10695
|
-
var
|
|
10696
|
-
var
|
|
10953
|
+
var import_node_path83 = require("path");
|
|
10954
|
+
var import_mini41 = require("zod/mini");
|
|
10697
10955
|
|
|
10698
10956
|
// src/features/subagents/rulesync-subagent.ts
|
|
10699
|
-
var
|
|
10700
|
-
var
|
|
10701
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
10702
|
-
targets:
|
|
10703
|
-
name:
|
|
10704
|
-
description:
|
|
10957
|
+
var import_node_path82 = require("path");
|
|
10958
|
+
var import_mini40 = require("zod/mini");
|
|
10959
|
+
var RulesyncSubagentFrontmatterSchema = import_mini40.z.looseObject({
|
|
10960
|
+
targets: import_mini40.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10961
|
+
name: import_mini40.z.string(),
|
|
10962
|
+
description: import_mini40.z.string()
|
|
10705
10963
|
});
|
|
10706
10964
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
10707
10965
|
frontmatter;
|
|
@@ -10710,7 +10968,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10710
10968
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10711
10969
|
if (!parseResult.success && rest.validate !== false) {
|
|
10712
10970
|
throw new Error(
|
|
10713
|
-
`Invalid frontmatter in ${(0,
|
|
10971
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
10714
10972
|
);
|
|
10715
10973
|
}
|
|
10716
10974
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -10743,7 +11001,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10743
11001
|
return {
|
|
10744
11002
|
success: false,
|
|
10745
11003
|
error: new Error(
|
|
10746
|
-
`Invalid frontmatter in ${(0,
|
|
11004
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10747
11005
|
)
|
|
10748
11006
|
};
|
|
10749
11007
|
}
|
|
@@ -10751,14 +11009,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10751
11009
|
static async fromFile({
|
|
10752
11010
|
relativeFilePath
|
|
10753
11011
|
}) {
|
|
10754
|
-
const filePath = (0,
|
|
11012
|
+
const filePath = (0, import_node_path82.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
10755
11013
|
const fileContent = await readFileContent(filePath);
|
|
10756
11014
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10757
11015
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10758
11016
|
if (!result.success) {
|
|
10759
11017
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
10760
11018
|
}
|
|
10761
|
-
const filename = (0,
|
|
11019
|
+
const filename = (0, import_node_path82.basename)(relativeFilePath);
|
|
10762
11020
|
return new _RulesyncSubagent({
|
|
10763
11021
|
baseDir: process.cwd(),
|
|
10764
11022
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -10770,13 +11028,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10770
11028
|
};
|
|
10771
11029
|
|
|
10772
11030
|
// src/features/subagents/claudecode-subagent.ts
|
|
10773
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
10774
|
-
name:
|
|
10775
|
-
description:
|
|
10776
|
-
model:
|
|
10777
|
-
tools:
|
|
10778
|
-
permissionMode:
|
|
10779
|
-
skills:
|
|
11031
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini41.z.looseObject({
|
|
11032
|
+
name: import_mini41.z.string(),
|
|
11033
|
+
description: import_mini41.z.string(),
|
|
11034
|
+
model: import_mini41.z.optional(import_mini41.z.string()),
|
|
11035
|
+
tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())])),
|
|
11036
|
+
permissionMode: import_mini41.z.optional(import_mini41.z.string()),
|
|
11037
|
+
skills: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
|
|
10780
11038
|
});
|
|
10781
11039
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
10782
11040
|
frontmatter;
|
|
@@ -10786,7 +11044,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10786
11044
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10787
11045
|
if (!result.success) {
|
|
10788
11046
|
throw new Error(
|
|
10789
|
-
`Invalid frontmatter in ${(0,
|
|
11047
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10790
11048
|
);
|
|
10791
11049
|
}
|
|
10792
11050
|
}
|
|
@@ -10798,7 +11056,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10798
11056
|
}
|
|
10799
11057
|
static getSettablePaths(_options = {}) {
|
|
10800
11058
|
return {
|
|
10801
|
-
relativeDirPath: (0,
|
|
11059
|
+
relativeDirPath: (0, import_node_path83.join)(".claude", "agents")
|
|
10802
11060
|
};
|
|
10803
11061
|
}
|
|
10804
11062
|
getFrontmatter() {
|
|
@@ -10874,7 +11132,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10874
11132
|
return {
|
|
10875
11133
|
success: false,
|
|
10876
11134
|
error: new Error(
|
|
10877
|
-
`Invalid frontmatter in ${(0,
|
|
11135
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10878
11136
|
)
|
|
10879
11137
|
};
|
|
10880
11138
|
}
|
|
@@ -10892,7 +11150,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10892
11150
|
global = false
|
|
10893
11151
|
}) {
|
|
10894
11152
|
const paths = this.getSettablePaths({ global });
|
|
10895
|
-
const filePath = (0,
|
|
11153
|
+
const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10896
11154
|
const fileContent = await readFileContent(filePath);
|
|
10897
11155
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10898
11156
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10927,16 +11185,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10927
11185
|
};
|
|
10928
11186
|
|
|
10929
11187
|
// src/features/subagents/codexcli-subagent.ts
|
|
10930
|
-
var
|
|
11188
|
+
var import_node_path84 = require("path");
|
|
10931
11189
|
var smolToml2 = __toESM(require("smol-toml"), 1);
|
|
10932
|
-
var
|
|
10933
|
-
var CodexCliSubagentTomlSchema =
|
|
10934
|
-
name:
|
|
10935
|
-
description:
|
|
10936
|
-
developer_instructions:
|
|
10937
|
-
model:
|
|
10938
|
-
model_reasoning_effort:
|
|
10939
|
-
sandbox_mode:
|
|
11190
|
+
var import_mini42 = require("zod/mini");
|
|
11191
|
+
var CodexCliSubagentTomlSchema = import_mini42.z.looseObject({
|
|
11192
|
+
name: import_mini42.z.string(),
|
|
11193
|
+
description: import_mini42.z.optional(import_mini42.z.string()),
|
|
11194
|
+
developer_instructions: import_mini42.z.optional(import_mini42.z.string()),
|
|
11195
|
+
model: import_mini42.z.optional(import_mini42.z.string()),
|
|
11196
|
+
model_reasoning_effort: import_mini42.z.optional(import_mini42.z.string()),
|
|
11197
|
+
sandbox_mode: import_mini42.z.optional(import_mini42.z.string())
|
|
10940
11198
|
});
|
|
10941
11199
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
10942
11200
|
body;
|
|
@@ -10947,7 +11205,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10947
11205
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
10948
11206
|
} catch (error) {
|
|
10949
11207
|
throw new Error(
|
|
10950
|
-
`Invalid TOML in ${(0,
|
|
11208
|
+
`Invalid TOML in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10951
11209
|
{ cause: error }
|
|
10952
11210
|
);
|
|
10953
11211
|
}
|
|
@@ -10959,7 +11217,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10959
11217
|
}
|
|
10960
11218
|
static getSettablePaths(_options = {}) {
|
|
10961
11219
|
return {
|
|
10962
|
-
relativeDirPath: (0,
|
|
11220
|
+
relativeDirPath: (0, import_node_path84.join)(".codex", "agents")
|
|
10963
11221
|
};
|
|
10964
11222
|
}
|
|
10965
11223
|
getBody() {
|
|
@@ -10971,7 +11229,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10971
11229
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
10972
11230
|
} catch (error) {
|
|
10973
11231
|
throw new Error(
|
|
10974
|
-
`Failed to parse TOML in ${(0,
|
|
11232
|
+
`Failed to parse TOML in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10975
11233
|
{ cause: error }
|
|
10976
11234
|
);
|
|
10977
11235
|
}
|
|
@@ -11052,7 +11310,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11052
11310
|
global = false
|
|
11053
11311
|
}) {
|
|
11054
11312
|
const paths = this.getSettablePaths({ global });
|
|
11055
|
-
const filePath = (0,
|
|
11313
|
+
const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11056
11314
|
const fileContent = await readFileContent(filePath);
|
|
11057
11315
|
const subagent = new _CodexCliSubagent({
|
|
11058
11316
|
baseDir,
|
|
@@ -11090,13 +11348,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11090
11348
|
};
|
|
11091
11349
|
|
|
11092
11350
|
// src/features/subagents/copilot-subagent.ts
|
|
11093
|
-
var
|
|
11094
|
-
var
|
|
11351
|
+
var import_node_path85 = require("path");
|
|
11352
|
+
var import_mini43 = require("zod/mini");
|
|
11095
11353
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11096
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11097
|
-
name:
|
|
11098
|
-
description:
|
|
11099
|
-
tools:
|
|
11354
|
+
var CopilotSubagentFrontmatterSchema = import_mini43.z.looseObject({
|
|
11355
|
+
name: import_mini43.z.string(),
|
|
11356
|
+
description: import_mini43.z.string(),
|
|
11357
|
+
tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
|
|
11100
11358
|
});
|
|
11101
11359
|
var normalizeTools = (tools) => {
|
|
11102
11360
|
if (!tools) {
|
|
@@ -11116,7 +11374,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11116
11374
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11117
11375
|
if (!result.success) {
|
|
11118
11376
|
throw new Error(
|
|
11119
|
-
`Invalid frontmatter in ${(0,
|
|
11377
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11120
11378
|
);
|
|
11121
11379
|
}
|
|
11122
11380
|
}
|
|
@@ -11128,7 +11386,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11128
11386
|
}
|
|
11129
11387
|
static getSettablePaths(_options = {}) {
|
|
11130
11388
|
return {
|
|
11131
|
-
relativeDirPath: (0,
|
|
11389
|
+
relativeDirPath: (0, import_node_path85.join)(".github", "agents")
|
|
11132
11390
|
};
|
|
11133
11391
|
}
|
|
11134
11392
|
getFrontmatter() {
|
|
@@ -11202,7 +11460,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11202
11460
|
return {
|
|
11203
11461
|
success: false,
|
|
11204
11462
|
error: new Error(
|
|
11205
|
-
`Invalid frontmatter in ${(0,
|
|
11463
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11206
11464
|
)
|
|
11207
11465
|
};
|
|
11208
11466
|
}
|
|
@@ -11220,7 +11478,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11220
11478
|
global = false
|
|
11221
11479
|
}) {
|
|
11222
11480
|
const paths = this.getSettablePaths({ global });
|
|
11223
|
-
const filePath = (0,
|
|
11481
|
+
const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11224
11482
|
const fileContent = await readFileContent(filePath);
|
|
11225
11483
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11226
11484
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11256,11 +11514,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11256
11514
|
};
|
|
11257
11515
|
|
|
11258
11516
|
// src/features/subagents/cursor-subagent.ts
|
|
11259
|
-
var
|
|
11260
|
-
var
|
|
11261
|
-
var CursorSubagentFrontmatterSchema =
|
|
11262
|
-
name:
|
|
11263
|
-
description:
|
|
11517
|
+
var import_node_path86 = require("path");
|
|
11518
|
+
var import_mini44 = require("zod/mini");
|
|
11519
|
+
var CursorSubagentFrontmatterSchema = import_mini44.z.looseObject({
|
|
11520
|
+
name: import_mini44.z.string(),
|
|
11521
|
+
description: import_mini44.z.string()
|
|
11264
11522
|
});
|
|
11265
11523
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
11266
11524
|
frontmatter;
|
|
@@ -11270,7 +11528,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11270
11528
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11271
11529
|
if (!result.success) {
|
|
11272
11530
|
throw new Error(
|
|
11273
|
-
`Invalid frontmatter in ${(0,
|
|
11531
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11274
11532
|
);
|
|
11275
11533
|
}
|
|
11276
11534
|
}
|
|
@@ -11282,7 +11540,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11282
11540
|
}
|
|
11283
11541
|
static getSettablePaths(_options = {}) {
|
|
11284
11542
|
return {
|
|
11285
|
-
relativeDirPath: (0,
|
|
11543
|
+
relativeDirPath: (0, import_node_path86.join)(".cursor", "agents")
|
|
11286
11544
|
};
|
|
11287
11545
|
}
|
|
11288
11546
|
getFrontmatter() {
|
|
@@ -11349,7 +11607,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11349
11607
|
return {
|
|
11350
11608
|
success: false,
|
|
11351
11609
|
error: new Error(
|
|
11352
|
-
`Invalid frontmatter in ${(0,
|
|
11610
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11353
11611
|
)
|
|
11354
11612
|
};
|
|
11355
11613
|
}
|
|
@@ -11367,7 +11625,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11367
11625
|
global = false
|
|
11368
11626
|
}) {
|
|
11369
11627
|
const paths = this.getSettablePaths({ global });
|
|
11370
|
-
const filePath = (0,
|
|
11628
|
+
const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11371
11629
|
const fileContent = await readFileContent(filePath);
|
|
11372
11630
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11373
11631
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11403,23 +11661,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11403
11661
|
};
|
|
11404
11662
|
|
|
11405
11663
|
// src/features/subagents/kiro-subagent.ts
|
|
11406
|
-
var
|
|
11407
|
-
var
|
|
11408
|
-
var KiroCliSubagentJsonSchema =
|
|
11409
|
-
name:
|
|
11410
|
-
description:
|
|
11411
|
-
prompt:
|
|
11412
|
-
tools:
|
|
11413
|
-
toolAliases:
|
|
11414
|
-
toolSettings:
|
|
11415
|
-
toolSchema:
|
|
11416
|
-
hooks:
|
|
11417
|
-
model:
|
|
11418
|
-
mcpServers:
|
|
11419
|
-
useLegacyMcpJson:
|
|
11420
|
-
resources:
|
|
11421
|
-
allowedTools:
|
|
11422
|
-
includeMcpJson:
|
|
11664
|
+
var import_node_path87 = require("path");
|
|
11665
|
+
var import_mini45 = require("zod/mini");
|
|
11666
|
+
var KiroCliSubagentJsonSchema = import_mini45.z.looseObject({
|
|
11667
|
+
name: import_mini45.z.string(),
|
|
11668
|
+
description: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
|
|
11669
|
+
prompt: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
|
|
11670
|
+
tools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
|
|
11671
|
+
toolAliases: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.string()))),
|
|
11672
|
+
toolSettings: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
|
|
11673
|
+
toolSchema: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
|
|
11674
|
+
hooks: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.array(import_mini45.z.unknown())))),
|
|
11675
|
+
model: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
|
|
11676
|
+
mcpServers: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.unknown()))),
|
|
11677
|
+
useLegacyMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean())),
|
|
11678
|
+
resources: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
|
|
11679
|
+
allowedTools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
|
|
11680
|
+
includeMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean()))
|
|
11423
11681
|
});
|
|
11424
11682
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
11425
11683
|
body;
|
|
@@ -11430,7 +11688,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11430
11688
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
11431
11689
|
} catch (error) {
|
|
11432
11690
|
throw new Error(
|
|
11433
|
-
`Invalid JSON in ${(0,
|
|
11691
|
+
`Invalid JSON in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11434
11692
|
{ cause: error }
|
|
11435
11693
|
);
|
|
11436
11694
|
}
|
|
@@ -11442,7 +11700,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11442
11700
|
}
|
|
11443
11701
|
static getSettablePaths(_options = {}) {
|
|
11444
11702
|
return {
|
|
11445
|
-
relativeDirPath: (0,
|
|
11703
|
+
relativeDirPath: (0, import_node_path87.join)(".kiro", "agents")
|
|
11446
11704
|
};
|
|
11447
11705
|
}
|
|
11448
11706
|
getBody() {
|
|
@@ -11454,7 +11712,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11454
11712
|
parsed = JSON.parse(this.body);
|
|
11455
11713
|
} catch (error) {
|
|
11456
11714
|
throw new Error(
|
|
11457
|
-
`Failed to parse JSON in ${(0,
|
|
11715
|
+
`Failed to parse JSON in ${(0, import_node_path87.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11458
11716
|
{ cause: error }
|
|
11459
11717
|
);
|
|
11460
11718
|
}
|
|
@@ -11535,7 +11793,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11535
11793
|
global = false
|
|
11536
11794
|
}) {
|
|
11537
11795
|
const paths = this.getSettablePaths({ global });
|
|
11538
|
-
const filePath = (0,
|
|
11796
|
+
const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11539
11797
|
const fileContent = await readFileContent(filePath);
|
|
11540
11798
|
const subagent = new _KiroSubagent({
|
|
11541
11799
|
baseDir,
|
|
@@ -11573,12 +11831,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11573
11831
|
};
|
|
11574
11832
|
|
|
11575
11833
|
// src/features/subagents/opencode-subagent.ts
|
|
11576
|
-
var
|
|
11577
|
-
var
|
|
11578
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
11579
|
-
description:
|
|
11580
|
-
mode:
|
|
11581
|
-
name:
|
|
11834
|
+
var import_node_path88 = require("path");
|
|
11835
|
+
var import_mini46 = require("zod/mini");
|
|
11836
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini46.z.looseObject({
|
|
11837
|
+
description: import_mini46.z.string(),
|
|
11838
|
+
mode: import_mini46.z._default(import_mini46.z.string(), "subagent"),
|
|
11839
|
+
name: import_mini46.z.optional(import_mini46.z.string())
|
|
11582
11840
|
});
|
|
11583
11841
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
11584
11842
|
frontmatter;
|
|
@@ -11588,7 +11846,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11588
11846
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11589
11847
|
if (!result.success) {
|
|
11590
11848
|
throw new Error(
|
|
11591
|
-
`Invalid frontmatter in ${(0,
|
|
11849
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11592
11850
|
);
|
|
11593
11851
|
}
|
|
11594
11852
|
}
|
|
@@ -11602,7 +11860,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11602
11860
|
global = false
|
|
11603
11861
|
} = {}) {
|
|
11604
11862
|
return {
|
|
11605
|
-
relativeDirPath: global ? (0,
|
|
11863
|
+
relativeDirPath: global ? (0, import_node_path88.join)(".config", "opencode", "agent") : (0, import_node_path88.join)(".opencode", "agent")
|
|
11606
11864
|
};
|
|
11607
11865
|
}
|
|
11608
11866
|
getFrontmatter() {
|
|
@@ -11615,7 +11873,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11615
11873
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
11616
11874
|
const rulesyncFrontmatter = {
|
|
11617
11875
|
targets: ["*"],
|
|
11618
|
-
name: name ?? (0,
|
|
11876
|
+
name: name ?? (0, import_node_path88.basename)(this.getRelativeFilePath(), ".md"),
|
|
11619
11877
|
description,
|
|
11620
11878
|
opencode: { mode, ...opencodeSection }
|
|
11621
11879
|
};
|
|
@@ -11640,7 +11898,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11640
11898
|
const opencodeFrontmatter = {
|
|
11641
11899
|
...opencodeSection,
|
|
11642
11900
|
description: rulesyncFrontmatter.description,
|
|
11643
|
-
mode: "subagent",
|
|
11901
|
+
mode: typeof opencodeSection.mode === "string" ? opencodeSection.mode : "subagent",
|
|
11644
11902
|
...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
|
|
11645
11903
|
};
|
|
11646
11904
|
const body = rulesyncSubagent.getBody();
|
|
@@ -11668,7 +11926,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11668
11926
|
return {
|
|
11669
11927
|
success: false,
|
|
11670
11928
|
error: new Error(
|
|
11671
|
-
`Invalid frontmatter in ${(0,
|
|
11929
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11672
11930
|
)
|
|
11673
11931
|
};
|
|
11674
11932
|
}
|
|
@@ -11685,7 +11943,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11685
11943
|
global = false
|
|
11686
11944
|
}) {
|
|
11687
11945
|
const paths = this.getSettablePaths({ global });
|
|
11688
|
-
const filePath = (0,
|
|
11946
|
+
const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11689
11947
|
const fileContent = await readFileContent(filePath);
|
|
11690
11948
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11691
11949
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11734,7 +11992,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
11734
11992
|
"opencode",
|
|
11735
11993
|
"roo"
|
|
11736
11994
|
];
|
|
11737
|
-
var SubagentsProcessorToolTargetSchema =
|
|
11995
|
+
var SubagentsProcessorToolTargetSchema = import_mini47.z.enum(subagentsProcessorToolTargetTuple);
|
|
11738
11996
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
11739
11997
|
[
|
|
11740
11998
|
"agentsmd",
|
|
@@ -11896,7 +12154,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11896
12154
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
11897
12155
|
*/
|
|
11898
12156
|
async loadRulesyncFiles() {
|
|
11899
|
-
const subagentsDir = (0,
|
|
12157
|
+
const subagentsDir = (0, import_node_path89.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
11900
12158
|
const dirExists = await directoryExists(subagentsDir);
|
|
11901
12159
|
if (!dirExists) {
|
|
11902
12160
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -11911,7 +12169,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11911
12169
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
11912
12170
|
const rulesyncSubagents = [];
|
|
11913
12171
|
for (const mdFile of mdFiles) {
|
|
11914
|
-
const filepath = (0,
|
|
12172
|
+
const filepath = (0, import_node_path89.join)(subagentsDir, mdFile);
|
|
11915
12173
|
try {
|
|
11916
12174
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
11917
12175
|
relativeFilePath: mdFile,
|
|
@@ -11941,14 +12199,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11941
12199
|
const factory = this.getFactory(this.toolTarget);
|
|
11942
12200
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11943
12201
|
const subagentFilePaths = await findFilesByGlobs(
|
|
11944
|
-
(0,
|
|
12202
|
+
(0, import_node_path89.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
11945
12203
|
);
|
|
11946
12204
|
if (forDeletion) {
|
|
11947
12205
|
const toolSubagents2 = subagentFilePaths.map(
|
|
11948
12206
|
(path3) => factory.class.forDeletion({
|
|
11949
12207
|
baseDir: this.baseDir,
|
|
11950
12208
|
relativeDirPath: paths.relativeDirPath,
|
|
11951
|
-
relativeFilePath: (0,
|
|
12209
|
+
relativeFilePath: (0, import_node_path89.basename)(path3),
|
|
11952
12210
|
global: this.global
|
|
11953
12211
|
})
|
|
11954
12212
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -11961,7 +12219,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11961
12219
|
subagentFilePaths.map(
|
|
11962
12220
|
(path3) => factory.class.fromFile({
|
|
11963
12221
|
baseDir: this.baseDir,
|
|
11964
|
-
relativeFilePath: (0,
|
|
12222
|
+
relativeFilePath: (0, import_node_path89.basename)(path3),
|
|
11965
12223
|
global: this.global
|
|
11966
12224
|
})
|
|
11967
12225
|
)
|
|
@@ -12006,49 +12264,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12006
12264
|
};
|
|
12007
12265
|
|
|
12008
12266
|
// src/features/rules/agentsmd-rule.ts
|
|
12009
|
-
var
|
|
12267
|
+
var import_node_path92 = require("path");
|
|
12010
12268
|
|
|
12011
12269
|
// src/features/rules/tool-rule.ts
|
|
12012
|
-
var
|
|
12270
|
+
var import_node_path91 = require("path");
|
|
12013
12271
|
|
|
12014
12272
|
// src/features/rules/rulesync-rule.ts
|
|
12015
|
-
var
|
|
12016
|
-
var
|
|
12017
|
-
var RulesyncRuleFrontmatterSchema =
|
|
12018
|
-
root:
|
|
12019
|
-
localRoot:
|
|
12020
|
-
targets:
|
|
12021
|
-
description:
|
|
12022
|
-
globs:
|
|
12023
|
-
agentsmd:
|
|
12024
|
-
|
|
12273
|
+
var import_node_path90 = require("path");
|
|
12274
|
+
var import_mini48 = require("zod/mini");
|
|
12275
|
+
var RulesyncRuleFrontmatterSchema = import_mini48.z.object({
|
|
12276
|
+
root: import_mini48.z.optional(import_mini48.z.boolean()),
|
|
12277
|
+
localRoot: import_mini48.z.optional(import_mini48.z.boolean()),
|
|
12278
|
+
targets: import_mini48.z._default(RulesyncTargetsSchema, ["*"]),
|
|
12279
|
+
description: import_mini48.z.optional(import_mini48.z.string()),
|
|
12280
|
+
globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string())),
|
|
12281
|
+
agentsmd: import_mini48.z.optional(
|
|
12282
|
+
import_mini48.z.object({
|
|
12025
12283
|
// @example "path/to/subproject"
|
|
12026
|
-
subprojectPath:
|
|
12284
|
+
subprojectPath: import_mini48.z.optional(import_mini48.z.string())
|
|
12027
12285
|
})
|
|
12028
12286
|
),
|
|
12029
|
-
claudecode:
|
|
12030
|
-
|
|
12287
|
+
claudecode: import_mini48.z.optional(
|
|
12288
|
+
import_mini48.z.object({
|
|
12031
12289
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
12032
12290
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
12033
|
-
paths:
|
|
12291
|
+
paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
12034
12292
|
})
|
|
12035
12293
|
),
|
|
12036
|
-
cursor:
|
|
12037
|
-
|
|
12038
|
-
alwaysApply:
|
|
12039
|
-
description:
|
|
12040
|
-
globs:
|
|
12294
|
+
cursor: import_mini48.z.optional(
|
|
12295
|
+
import_mini48.z.object({
|
|
12296
|
+
alwaysApply: import_mini48.z.optional(import_mini48.z.boolean()),
|
|
12297
|
+
description: import_mini48.z.optional(import_mini48.z.string()),
|
|
12298
|
+
globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
12041
12299
|
})
|
|
12042
12300
|
),
|
|
12043
|
-
copilot:
|
|
12044
|
-
|
|
12045
|
-
excludeAgent:
|
|
12301
|
+
copilot: import_mini48.z.optional(
|
|
12302
|
+
import_mini48.z.object({
|
|
12303
|
+
excludeAgent: import_mini48.z.optional(import_mini48.z.union([import_mini48.z.literal("code-review"), import_mini48.z.literal("coding-agent")]))
|
|
12046
12304
|
})
|
|
12047
12305
|
),
|
|
12048
|
-
antigravity:
|
|
12049
|
-
|
|
12050
|
-
trigger:
|
|
12051
|
-
globs:
|
|
12306
|
+
antigravity: import_mini48.z.optional(
|
|
12307
|
+
import_mini48.z.looseObject({
|
|
12308
|
+
trigger: import_mini48.z.optional(import_mini48.z.string()),
|
|
12309
|
+
globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
|
|
12052
12310
|
})
|
|
12053
12311
|
)
|
|
12054
12312
|
});
|
|
@@ -12059,7 +12317,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12059
12317
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12060
12318
|
if (!parseResult.success && rest.validate !== false) {
|
|
12061
12319
|
throw new Error(
|
|
12062
|
-
`Invalid frontmatter in ${(0,
|
|
12320
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
12063
12321
|
);
|
|
12064
12322
|
}
|
|
12065
12323
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -12094,7 +12352,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12094
12352
|
return {
|
|
12095
12353
|
success: false,
|
|
12096
12354
|
error: new Error(
|
|
12097
|
-
`Invalid frontmatter in ${(0,
|
|
12355
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12098
12356
|
)
|
|
12099
12357
|
};
|
|
12100
12358
|
}
|
|
@@ -12103,7 +12361,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12103
12361
|
relativeFilePath,
|
|
12104
12362
|
validate = true
|
|
12105
12363
|
}) {
|
|
12106
|
-
const filePath = (0,
|
|
12364
|
+
const filePath = (0, import_node_path90.join)(
|
|
12107
12365
|
process.cwd(),
|
|
12108
12366
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
12109
12367
|
relativeFilePath
|
|
@@ -12205,7 +12463,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12205
12463
|
rulesyncRule,
|
|
12206
12464
|
validate = true,
|
|
12207
12465
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
12208
|
-
nonRootPath = { relativeDirPath: (0,
|
|
12466
|
+
nonRootPath = { relativeDirPath: (0, import_node_path91.join)(".agents", "memories") }
|
|
12209
12467
|
}) {
|
|
12210
12468
|
const params = this.buildToolRuleParamsDefault({
|
|
12211
12469
|
baseDir,
|
|
@@ -12216,7 +12474,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12216
12474
|
});
|
|
12217
12475
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
12218
12476
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
12219
|
-
params.relativeDirPath = (0,
|
|
12477
|
+
params.relativeDirPath = (0, import_node_path91.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
12220
12478
|
params.relativeFilePath = "AGENTS.md";
|
|
12221
12479
|
}
|
|
12222
12480
|
return params;
|
|
@@ -12265,7 +12523,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12265
12523
|
}
|
|
12266
12524
|
};
|
|
12267
12525
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
12268
|
-
return excludeToolDir ? subDir : (0,
|
|
12526
|
+
return excludeToolDir ? subDir : (0, import_node_path91.join)(toolDir, subDir);
|
|
12269
12527
|
}
|
|
12270
12528
|
|
|
12271
12529
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -12294,8 +12552,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12294
12552
|
validate = true
|
|
12295
12553
|
}) {
|
|
12296
12554
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
12297
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
12298
|
-
const fileContent = await readFileContent((0,
|
|
12555
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path92.join)(".agents", "memories", relativeFilePath);
|
|
12556
|
+
const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
|
|
12299
12557
|
return new _AgentsMdRule({
|
|
12300
12558
|
baseDir,
|
|
12301
12559
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -12350,21 +12608,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12350
12608
|
};
|
|
12351
12609
|
|
|
12352
12610
|
// src/features/rules/antigravity-rule.ts
|
|
12353
|
-
var
|
|
12354
|
-
var
|
|
12355
|
-
var AntigravityRuleFrontmatterSchema =
|
|
12356
|
-
trigger:
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12611
|
+
var import_node_path93 = require("path");
|
|
12612
|
+
var import_mini49 = require("zod/mini");
|
|
12613
|
+
var AntigravityRuleFrontmatterSchema = import_mini49.z.looseObject({
|
|
12614
|
+
trigger: import_mini49.z.optional(
|
|
12615
|
+
import_mini49.z.union([
|
|
12616
|
+
import_mini49.z.literal("always_on"),
|
|
12617
|
+
import_mini49.z.literal("glob"),
|
|
12618
|
+
import_mini49.z.literal("manual"),
|
|
12619
|
+
import_mini49.z.literal("model_decision"),
|
|
12620
|
+
import_mini49.z.string()
|
|
12363
12621
|
// accepts any string for forward compatibility
|
|
12364
12622
|
])
|
|
12365
12623
|
),
|
|
12366
|
-
globs:
|
|
12367
|
-
description:
|
|
12624
|
+
globs: import_mini49.z.optional(import_mini49.z.string()),
|
|
12625
|
+
description: import_mini49.z.optional(import_mini49.z.string())
|
|
12368
12626
|
});
|
|
12369
12627
|
function parseGlobsString(globs) {
|
|
12370
12628
|
if (!globs) {
|
|
@@ -12509,7 +12767,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12509
12767
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12510
12768
|
if (!result.success) {
|
|
12511
12769
|
throw new Error(
|
|
12512
|
-
`Invalid frontmatter in ${(0,
|
|
12770
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12513
12771
|
);
|
|
12514
12772
|
}
|
|
12515
12773
|
}
|
|
@@ -12533,7 +12791,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12533
12791
|
relativeFilePath,
|
|
12534
12792
|
validate = true
|
|
12535
12793
|
}) {
|
|
12536
|
-
const filePath = (0,
|
|
12794
|
+
const filePath = (0, import_node_path93.join)(
|
|
12537
12795
|
baseDir,
|
|
12538
12796
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12539
12797
|
relativeFilePath
|
|
@@ -12674,7 +12932,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12674
12932
|
};
|
|
12675
12933
|
|
|
12676
12934
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
12677
|
-
var
|
|
12935
|
+
var import_node_path94 = require("path");
|
|
12678
12936
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
12679
12937
|
toRulesyncRule() {
|
|
12680
12938
|
const rulesyncFrontmatter = {
|
|
@@ -12735,8 +12993,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12735
12993
|
}) {
|
|
12736
12994
|
const settablePaths = this.getSettablePaths();
|
|
12737
12995
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
12738
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
12739
|
-
const fileContent = await readFileContent((0,
|
|
12996
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path94.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12997
|
+
const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
|
|
12740
12998
|
return new _AugmentcodeLegacyRule({
|
|
12741
12999
|
baseDir,
|
|
12742
13000
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -12765,7 +13023,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12765
13023
|
};
|
|
12766
13024
|
|
|
12767
13025
|
// src/features/rules/augmentcode-rule.ts
|
|
12768
|
-
var
|
|
13026
|
+
var import_node_path95 = require("path");
|
|
12769
13027
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
12770
13028
|
toRulesyncRule() {
|
|
12771
13029
|
return this.toRulesyncRuleDefault();
|
|
@@ -12796,7 +13054,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12796
13054
|
relativeFilePath,
|
|
12797
13055
|
validate = true
|
|
12798
13056
|
}) {
|
|
12799
|
-
const filePath = (0,
|
|
13057
|
+
const filePath = (0, import_node_path95.join)(
|
|
12800
13058
|
baseDir,
|
|
12801
13059
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12802
13060
|
relativeFilePath
|
|
@@ -12836,7 +13094,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12836
13094
|
};
|
|
12837
13095
|
|
|
12838
13096
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
12839
|
-
var
|
|
13097
|
+
var import_node_path96 = require("path");
|
|
12840
13098
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
12841
13099
|
static getSettablePaths({
|
|
12842
13100
|
global,
|
|
@@ -12871,7 +13129,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12871
13129
|
if (isRoot) {
|
|
12872
13130
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12873
13131
|
const fileContent2 = await readFileContent(
|
|
12874
|
-
(0,
|
|
13132
|
+
(0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12875
13133
|
);
|
|
12876
13134
|
return new _ClaudecodeLegacyRule({
|
|
12877
13135
|
baseDir,
|
|
@@ -12885,8 +13143,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12885
13143
|
if (!paths.nonRoot) {
|
|
12886
13144
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12887
13145
|
}
|
|
12888
|
-
const relativePath = (0,
|
|
12889
|
-
const fileContent = await readFileContent((0,
|
|
13146
|
+
const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13147
|
+
const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
|
|
12890
13148
|
return new _ClaudecodeLegacyRule({
|
|
12891
13149
|
baseDir,
|
|
12892
13150
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12945,10 +13203,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12945
13203
|
};
|
|
12946
13204
|
|
|
12947
13205
|
// src/features/rules/claudecode-rule.ts
|
|
12948
|
-
var
|
|
12949
|
-
var
|
|
12950
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
12951
|
-
paths:
|
|
13206
|
+
var import_node_path97 = require("path");
|
|
13207
|
+
var import_mini50 = require("zod/mini");
|
|
13208
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini50.z.object({
|
|
13209
|
+
paths: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
|
|
12952
13210
|
});
|
|
12953
13211
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
12954
13212
|
frontmatter;
|
|
@@ -12980,7 +13238,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12980
13238
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12981
13239
|
if (!result.success) {
|
|
12982
13240
|
throw new Error(
|
|
12983
|
-
`Invalid frontmatter in ${(0,
|
|
13241
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12984
13242
|
);
|
|
12985
13243
|
}
|
|
12986
13244
|
}
|
|
@@ -13008,7 +13266,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13008
13266
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13009
13267
|
if (isRoot) {
|
|
13010
13268
|
const fileContent2 = await readFileContent(
|
|
13011
|
-
(0,
|
|
13269
|
+
(0, import_node_path97.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
13012
13270
|
);
|
|
13013
13271
|
return new _ClaudecodeRule({
|
|
13014
13272
|
baseDir,
|
|
@@ -13023,16 +13281,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13023
13281
|
if (!paths.nonRoot) {
|
|
13024
13282
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13025
13283
|
}
|
|
13026
|
-
const relativePath = (0,
|
|
13027
|
-
const fileContent = await readFileContent((0,
|
|
13284
|
+
const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13285
|
+
const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
|
|
13028
13286
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
13029
13287
|
fileContent,
|
|
13030
|
-
(0,
|
|
13288
|
+
(0, import_node_path97.join)(baseDir, relativePath)
|
|
13031
13289
|
);
|
|
13032
13290
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13033
13291
|
if (!result.success) {
|
|
13034
13292
|
throw new Error(
|
|
13035
|
-
`Invalid frontmatter in ${(0,
|
|
13293
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
13036
13294
|
);
|
|
13037
13295
|
}
|
|
13038
13296
|
return new _ClaudecodeRule({
|
|
@@ -13139,7 +13397,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13139
13397
|
return {
|
|
13140
13398
|
success: false,
|
|
13141
13399
|
error: new Error(
|
|
13142
|
-
`Invalid frontmatter in ${(0,
|
|
13400
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13143
13401
|
)
|
|
13144
13402
|
};
|
|
13145
13403
|
}
|
|
@@ -13159,10 +13417,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13159
13417
|
};
|
|
13160
13418
|
|
|
13161
13419
|
// src/features/rules/cline-rule.ts
|
|
13162
|
-
var
|
|
13163
|
-
var
|
|
13164
|
-
var ClineRuleFrontmatterSchema =
|
|
13165
|
-
description:
|
|
13420
|
+
var import_node_path98 = require("path");
|
|
13421
|
+
var import_mini51 = require("zod/mini");
|
|
13422
|
+
var ClineRuleFrontmatterSchema = import_mini51.z.object({
|
|
13423
|
+
description: import_mini51.z.string()
|
|
13166
13424
|
});
|
|
13167
13425
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
13168
13426
|
static getSettablePaths(_options = {}) {
|
|
@@ -13205,7 +13463,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13205
13463
|
validate = true
|
|
13206
13464
|
}) {
|
|
13207
13465
|
const fileContent = await readFileContent(
|
|
13208
|
-
(0,
|
|
13466
|
+
(0, import_node_path98.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13209
13467
|
);
|
|
13210
13468
|
return new _ClineRule({
|
|
13211
13469
|
baseDir,
|
|
@@ -13231,7 +13489,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13231
13489
|
};
|
|
13232
13490
|
|
|
13233
13491
|
// src/features/rules/codexcli-rule.ts
|
|
13234
|
-
var
|
|
13492
|
+
var import_node_path99 = require("path");
|
|
13235
13493
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
13236
13494
|
static getSettablePaths({
|
|
13237
13495
|
global,
|
|
@@ -13266,7 +13524,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13266
13524
|
if (isRoot) {
|
|
13267
13525
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13268
13526
|
const fileContent2 = await readFileContent(
|
|
13269
|
-
(0,
|
|
13527
|
+
(0, import_node_path99.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13270
13528
|
);
|
|
13271
13529
|
return new _CodexcliRule({
|
|
13272
13530
|
baseDir,
|
|
@@ -13280,8 +13538,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13280
13538
|
if (!paths.nonRoot) {
|
|
13281
13539
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13282
13540
|
}
|
|
13283
|
-
const relativePath = (0,
|
|
13284
|
-
const fileContent = await readFileContent((0,
|
|
13541
|
+
const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13542
|
+
const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
|
|
13285
13543
|
return new _CodexcliRule({
|
|
13286
13544
|
baseDir,
|
|
13287
13545
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13340,12 +13598,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13340
13598
|
};
|
|
13341
13599
|
|
|
13342
13600
|
// src/features/rules/copilot-rule.ts
|
|
13343
|
-
var
|
|
13344
|
-
var
|
|
13345
|
-
var CopilotRuleFrontmatterSchema =
|
|
13346
|
-
description:
|
|
13347
|
-
applyTo:
|
|
13348
|
-
excludeAgent:
|
|
13601
|
+
var import_node_path100 = require("path");
|
|
13602
|
+
var import_mini52 = require("zod/mini");
|
|
13603
|
+
var CopilotRuleFrontmatterSchema = import_mini52.z.object({
|
|
13604
|
+
description: import_mini52.z.optional(import_mini52.z.string()),
|
|
13605
|
+
applyTo: import_mini52.z.optional(import_mini52.z.string()),
|
|
13606
|
+
excludeAgent: import_mini52.z.optional(import_mini52.z.union([import_mini52.z.literal("code-review"), import_mini52.z.literal("coding-agent")]))
|
|
13349
13607
|
});
|
|
13350
13608
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
13351
13609
|
frontmatter;
|
|
@@ -13374,7 +13632,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13374
13632
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13375
13633
|
if (!result.success) {
|
|
13376
13634
|
throw new Error(
|
|
13377
|
-
`Invalid frontmatter in ${(0,
|
|
13635
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13378
13636
|
);
|
|
13379
13637
|
}
|
|
13380
13638
|
}
|
|
@@ -13464,8 +13722,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13464
13722
|
const paths = this.getSettablePaths({ global });
|
|
13465
13723
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13466
13724
|
if (isRoot) {
|
|
13467
|
-
const relativePath2 = (0,
|
|
13468
|
-
const fileContent2 = await readFileContent((0,
|
|
13725
|
+
const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13726
|
+
const fileContent2 = await readFileContent((0, import_node_path100.join)(baseDir, relativePath2));
|
|
13469
13727
|
return new _CopilotRule({
|
|
13470
13728
|
baseDir,
|
|
13471
13729
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13479,16 +13737,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13479
13737
|
if (!paths.nonRoot) {
|
|
13480
13738
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13481
13739
|
}
|
|
13482
|
-
const relativePath = (0,
|
|
13483
|
-
const fileContent = await readFileContent((0,
|
|
13740
|
+
const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13741
|
+
const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
|
|
13484
13742
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
13485
13743
|
fileContent,
|
|
13486
|
-
(0,
|
|
13744
|
+
(0, import_node_path100.join)(baseDir, relativePath)
|
|
13487
13745
|
);
|
|
13488
13746
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13489
13747
|
if (!result.success) {
|
|
13490
13748
|
throw new Error(
|
|
13491
|
-
`Invalid frontmatter in ${(0,
|
|
13749
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13492
13750
|
);
|
|
13493
13751
|
}
|
|
13494
13752
|
return new _CopilotRule({
|
|
@@ -13530,7 +13788,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13530
13788
|
return {
|
|
13531
13789
|
success: false,
|
|
13532
13790
|
error: new Error(
|
|
13533
|
-
`Invalid frontmatter in ${(0,
|
|
13791
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13534
13792
|
)
|
|
13535
13793
|
};
|
|
13536
13794
|
}
|
|
@@ -13550,12 +13808,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13550
13808
|
};
|
|
13551
13809
|
|
|
13552
13810
|
// src/features/rules/cursor-rule.ts
|
|
13553
|
-
var
|
|
13554
|
-
var
|
|
13555
|
-
var CursorRuleFrontmatterSchema =
|
|
13556
|
-
description:
|
|
13557
|
-
globs:
|
|
13558
|
-
alwaysApply:
|
|
13811
|
+
var import_node_path101 = require("path");
|
|
13812
|
+
var import_mini53 = require("zod/mini");
|
|
13813
|
+
var CursorRuleFrontmatterSchema = import_mini53.z.object({
|
|
13814
|
+
description: import_mini53.z.optional(import_mini53.z.string()),
|
|
13815
|
+
globs: import_mini53.z.optional(import_mini53.z.string()),
|
|
13816
|
+
alwaysApply: import_mini53.z.optional(import_mini53.z.boolean())
|
|
13559
13817
|
});
|
|
13560
13818
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
13561
13819
|
frontmatter;
|
|
@@ -13572,7 +13830,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13572
13830
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13573
13831
|
if (!result.success) {
|
|
13574
13832
|
throw new Error(
|
|
13575
|
-
`Invalid frontmatter in ${(0,
|
|
13833
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13576
13834
|
);
|
|
13577
13835
|
}
|
|
13578
13836
|
}
|
|
@@ -13688,7 +13946,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13688
13946
|
relativeFilePath,
|
|
13689
13947
|
validate = true
|
|
13690
13948
|
}) {
|
|
13691
|
-
const filePath = (0,
|
|
13949
|
+
const filePath = (0, import_node_path101.join)(
|
|
13692
13950
|
baseDir,
|
|
13693
13951
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13694
13952
|
relativeFilePath
|
|
@@ -13698,7 +13956,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13698
13956
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13699
13957
|
if (!result.success) {
|
|
13700
13958
|
throw new Error(
|
|
13701
|
-
`Invalid frontmatter in ${(0,
|
|
13959
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13702
13960
|
);
|
|
13703
13961
|
}
|
|
13704
13962
|
return new _CursorRule({
|
|
@@ -13735,7 +13993,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13735
13993
|
return {
|
|
13736
13994
|
success: false,
|
|
13737
13995
|
error: new Error(
|
|
13738
|
-
`Invalid frontmatter in ${(0,
|
|
13996
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13739
13997
|
)
|
|
13740
13998
|
};
|
|
13741
13999
|
}
|
|
@@ -13755,7 +14013,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13755
14013
|
};
|
|
13756
14014
|
|
|
13757
14015
|
// src/features/rules/factorydroid-rule.ts
|
|
13758
|
-
var
|
|
14016
|
+
var import_node_path102 = require("path");
|
|
13759
14017
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
13760
14018
|
constructor({ fileContent, root, ...rest }) {
|
|
13761
14019
|
super({
|
|
@@ -13795,8 +14053,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13795
14053
|
const paths = this.getSettablePaths({ global });
|
|
13796
14054
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13797
14055
|
if (isRoot) {
|
|
13798
|
-
const relativePath2 = (0,
|
|
13799
|
-
const fileContent2 = await readFileContent((0,
|
|
14056
|
+
const relativePath2 = (0, import_node_path102.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14057
|
+
const fileContent2 = await readFileContent((0, import_node_path102.join)(baseDir, relativePath2));
|
|
13800
14058
|
return new _FactorydroidRule({
|
|
13801
14059
|
baseDir,
|
|
13802
14060
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13809,8 +14067,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13809
14067
|
if (!paths.nonRoot) {
|
|
13810
14068
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13811
14069
|
}
|
|
13812
|
-
const relativePath = (0,
|
|
13813
|
-
const fileContent = await readFileContent((0,
|
|
14070
|
+
const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14071
|
+
const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
|
|
13814
14072
|
return new _FactorydroidRule({
|
|
13815
14073
|
baseDir,
|
|
13816
14074
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13869,7 +14127,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13869
14127
|
};
|
|
13870
14128
|
|
|
13871
14129
|
// src/features/rules/geminicli-rule.ts
|
|
13872
|
-
var
|
|
14130
|
+
var import_node_path103 = require("path");
|
|
13873
14131
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
13874
14132
|
static getSettablePaths({
|
|
13875
14133
|
global,
|
|
@@ -13904,7 +14162,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13904
14162
|
if (isRoot) {
|
|
13905
14163
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13906
14164
|
const fileContent2 = await readFileContent(
|
|
13907
|
-
(0,
|
|
14165
|
+
(0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13908
14166
|
);
|
|
13909
14167
|
return new _GeminiCliRule({
|
|
13910
14168
|
baseDir,
|
|
@@ -13918,8 +14176,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13918
14176
|
if (!paths.nonRoot) {
|
|
13919
14177
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13920
14178
|
}
|
|
13921
|
-
const relativePath = (0,
|
|
13922
|
-
const fileContent = await readFileContent((0,
|
|
14179
|
+
const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14180
|
+
const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
|
|
13923
14181
|
return new _GeminiCliRule({
|
|
13924
14182
|
baseDir,
|
|
13925
14183
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13978,7 +14236,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13978
14236
|
};
|
|
13979
14237
|
|
|
13980
14238
|
// src/features/rules/goose-rule.ts
|
|
13981
|
-
var
|
|
14239
|
+
var import_node_path104 = require("path");
|
|
13982
14240
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
13983
14241
|
static getSettablePaths({
|
|
13984
14242
|
global,
|
|
@@ -14013,7 +14271,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14013
14271
|
if (isRoot) {
|
|
14014
14272
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14015
14273
|
const fileContent2 = await readFileContent(
|
|
14016
|
-
(0,
|
|
14274
|
+
(0, import_node_path104.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14017
14275
|
);
|
|
14018
14276
|
return new _GooseRule({
|
|
14019
14277
|
baseDir,
|
|
@@ -14027,8 +14285,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14027
14285
|
if (!paths.nonRoot) {
|
|
14028
14286
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14029
14287
|
}
|
|
14030
|
-
const relativePath = (0,
|
|
14031
|
-
const fileContent = await readFileContent((0,
|
|
14288
|
+
const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14289
|
+
const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
|
|
14032
14290
|
return new _GooseRule({
|
|
14033
14291
|
baseDir,
|
|
14034
14292
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14087,7 +14345,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14087
14345
|
};
|
|
14088
14346
|
|
|
14089
14347
|
// src/features/rules/junie-rule.ts
|
|
14090
|
-
var
|
|
14348
|
+
var import_node_path105 = require("path");
|
|
14091
14349
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
14092
14350
|
static getSettablePaths(_options = {}) {
|
|
14093
14351
|
return {
|
|
@@ -14106,8 +14364,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14106
14364
|
validate = true
|
|
14107
14365
|
}) {
|
|
14108
14366
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
14109
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
14110
|
-
const fileContent = await readFileContent((0,
|
|
14367
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path105.join)(".junie", "memories", relativeFilePath);
|
|
14368
|
+
const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
|
|
14111
14369
|
return new _JunieRule({
|
|
14112
14370
|
baseDir,
|
|
14113
14371
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14162,7 +14420,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14162
14420
|
};
|
|
14163
14421
|
|
|
14164
14422
|
// src/features/rules/kilo-rule.ts
|
|
14165
|
-
var
|
|
14423
|
+
var import_node_path106 = require("path");
|
|
14166
14424
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
14167
14425
|
static getSettablePaths(_options = {}) {
|
|
14168
14426
|
return {
|
|
@@ -14177,7 +14435,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14177
14435
|
validate = true
|
|
14178
14436
|
}) {
|
|
14179
14437
|
const fileContent = await readFileContent(
|
|
14180
|
-
(0,
|
|
14438
|
+
(0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14181
14439
|
);
|
|
14182
14440
|
return new _KiloRule({
|
|
14183
14441
|
baseDir,
|
|
@@ -14229,7 +14487,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14229
14487
|
};
|
|
14230
14488
|
|
|
14231
14489
|
// src/features/rules/kiro-rule.ts
|
|
14232
|
-
var
|
|
14490
|
+
var import_node_path107 = require("path");
|
|
14233
14491
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
14234
14492
|
static getSettablePaths(_options = {}) {
|
|
14235
14493
|
return {
|
|
@@ -14244,7 +14502,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14244
14502
|
validate = true
|
|
14245
14503
|
}) {
|
|
14246
14504
|
const fileContent = await readFileContent(
|
|
14247
|
-
(0,
|
|
14505
|
+
(0, import_node_path107.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14248
14506
|
);
|
|
14249
14507
|
return new _KiroRule({
|
|
14250
14508
|
baseDir,
|
|
@@ -14298,7 +14556,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14298
14556
|
};
|
|
14299
14557
|
|
|
14300
14558
|
// src/features/rules/opencode-rule.ts
|
|
14301
|
-
var
|
|
14559
|
+
var import_node_path108 = require("path");
|
|
14302
14560
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
14303
14561
|
static getSettablePaths({
|
|
14304
14562
|
global,
|
|
@@ -14333,7 +14591,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14333
14591
|
if (isRoot) {
|
|
14334
14592
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14335
14593
|
const fileContent2 = await readFileContent(
|
|
14336
|
-
(0,
|
|
14594
|
+
(0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14337
14595
|
);
|
|
14338
14596
|
return new _OpenCodeRule({
|
|
14339
14597
|
baseDir,
|
|
@@ -14347,8 +14605,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14347
14605
|
if (!paths.nonRoot) {
|
|
14348
14606
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14349
14607
|
}
|
|
14350
|
-
const relativePath = (0,
|
|
14351
|
-
const fileContent = await readFileContent((0,
|
|
14608
|
+
const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14609
|
+
const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
|
|
14352
14610
|
return new _OpenCodeRule({
|
|
14353
14611
|
baseDir,
|
|
14354
14612
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14407,7 +14665,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14407
14665
|
};
|
|
14408
14666
|
|
|
14409
14667
|
// src/features/rules/qwencode-rule.ts
|
|
14410
|
-
var
|
|
14668
|
+
var import_node_path109 = require("path");
|
|
14411
14669
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
14412
14670
|
static getSettablePaths(_options = {}) {
|
|
14413
14671
|
return {
|
|
@@ -14426,8 +14684,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14426
14684
|
validate = true
|
|
14427
14685
|
}) {
|
|
14428
14686
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
14429
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
14430
|
-
const fileContent = await readFileContent((0,
|
|
14687
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path109.join)(".qwen", "memories", relativeFilePath);
|
|
14688
|
+
const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
|
|
14431
14689
|
return new _QwencodeRule({
|
|
14432
14690
|
baseDir,
|
|
14433
14691
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14479,7 +14737,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14479
14737
|
};
|
|
14480
14738
|
|
|
14481
14739
|
// src/features/rules/replit-rule.ts
|
|
14482
|
-
var
|
|
14740
|
+
var import_node_path110 = require("path");
|
|
14483
14741
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
14484
14742
|
static getSettablePaths(_options = {}) {
|
|
14485
14743
|
return {
|
|
@@ -14501,7 +14759,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14501
14759
|
}
|
|
14502
14760
|
const relativePath = paths.root.relativeFilePath;
|
|
14503
14761
|
const fileContent = await readFileContent(
|
|
14504
|
-
(0,
|
|
14762
|
+
(0, import_node_path110.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
14505
14763
|
);
|
|
14506
14764
|
return new _ReplitRule({
|
|
14507
14765
|
baseDir,
|
|
@@ -14567,7 +14825,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14567
14825
|
};
|
|
14568
14826
|
|
|
14569
14827
|
// src/features/rules/roo-rule.ts
|
|
14570
|
-
var
|
|
14828
|
+
var import_node_path111 = require("path");
|
|
14571
14829
|
var RooRule = class _RooRule extends ToolRule {
|
|
14572
14830
|
static getSettablePaths(_options = {}) {
|
|
14573
14831
|
return {
|
|
@@ -14582,7 +14840,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14582
14840
|
validate = true
|
|
14583
14841
|
}) {
|
|
14584
14842
|
const fileContent = await readFileContent(
|
|
14585
|
-
(0,
|
|
14843
|
+
(0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14586
14844
|
);
|
|
14587
14845
|
return new _RooRule({
|
|
14588
14846
|
baseDir,
|
|
@@ -14651,7 +14909,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14651
14909
|
};
|
|
14652
14910
|
|
|
14653
14911
|
// src/features/rules/warp-rule.ts
|
|
14654
|
-
var
|
|
14912
|
+
var import_node_path112 = require("path");
|
|
14655
14913
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
14656
14914
|
constructor({ fileContent, root, ...rest }) {
|
|
14657
14915
|
super({
|
|
@@ -14677,8 +14935,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14677
14935
|
validate = true
|
|
14678
14936
|
}) {
|
|
14679
14937
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
14680
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
14681
|
-
const fileContent = await readFileContent((0,
|
|
14938
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path112.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
14939
|
+
const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
|
|
14682
14940
|
return new _WarpRule({
|
|
14683
14941
|
baseDir,
|
|
14684
14942
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -14733,7 +14991,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14733
14991
|
};
|
|
14734
14992
|
|
|
14735
14993
|
// src/features/rules/windsurf-rule.ts
|
|
14736
|
-
var
|
|
14994
|
+
var import_node_path113 = require("path");
|
|
14737
14995
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
14738
14996
|
static getSettablePaths(_options = {}) {
|
|
14739
14997
|
return {
|
|
@@ -14748,7 +15006,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
14748
15006
|
validate = true
|
|
14749
15007
|
}) {
|
|
14750
15008
|
const fileContent = await readFileContent(
|
|
14751
|
-
(0,
|
|
15009
|
+
(0, import_node_path113.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14752
15010
|
);
|
|
14753
15011
|
return new _WindsurfRule({
|
|
14754
15012
|
baseDir,
|
|
@@ -14824,8 +15082,8 @@ var rulesProcessorToolTargets = [
|
|
|
14824
15082
|
"warp",
|
|
14825
15083
|
"windsurf"
|
|
14826
15084
|
];
|
|
14827
|
-
var RulesProcessorToolTargetSchema =
|
|
14828
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
15085
|
+
var RulesProcessorToolTargetSchema = import_mini54.z.enum(rulesProcessorToolTargets);
|
|
15086
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path114.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
14829
15087
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
14830
15088
|
[
|
|
14831
15089
|
"agentsmd",
|
|
@@ -15200,7 +15458,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15200
15458
|
}).relativeDirPath;
|
|
15201
15459
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
15202
15460
|
const frontmatter = skill.getFrontmatter();
|
|
15203
|
-
const relativePath = (0,
|
|
15461
|
+
const relativePath = (0, import_node_path114.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
15204
15462
|
return {
|
|
15205
15463
|
name: frontmatter.name,
|
|
15206
15464
|
description: frontmatter.description,
|
|
@@ -15313,12 +15571,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15313
15571
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
15314
15572
|
*/
|
|
15315
15573
|
async loadRulesyncFiles() {
|
|
15316
|
-
const rulesyncBaseDir = (0,
|
|
15317
|
-
const files = await findFilesByGlobs((0,
|
|
15574
|
+
const rulesyncBaseDir = (0, import_node_path114.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
15575
|
+
const files = await findFilesByGlobs((0, import_node_path114.join)(rulesyncBaseDir, "**", "*.md"));
|
|
15318
15576
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
15319
15577
|
const rulesyncRules = await Promise.all(
|
|
15320
15578
|
files.map((file) => {
|
|
15321
|
-
const relativeFilePath = (0,
|
|
15579
|
+
const relativeFilePath = (0, import_node_path114.relative)(rulesyncBaseDir, file);
|
|
15322
15580
|
checkPathTraversal({
|
|
15323
15581
|
relativePath: relativeFilePath,
|
|
15324
15582
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -15381,7 +15639,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15381
15639
|
return [];
|
|
15382
15640
|
}
|
|
15383
15641
|
const rootFilePaths = await findFilesByGlobs(
|
|
15384
|
-
(0,
|
|
15642
|
+
(0, import_node_path114.join)(
|
|
15385
15643
|
this.baseDir,
|
|
15386
15644
|
settablePaths.root.relativeDirPath ?? ".",
|
|
15387
15645
|
settablePaths.root.relativeFilePath
|
|
@@ -15392,7 +15650,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15392
15650
|
(filePath) => factory.class.forDeletion({
|
|
15393
15651
|
baseDir: this.baseDir,
|
|
15394
15652
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
15395
|
-
relativeFilePath: (0,
|
|
15653
|
+
relativeFilePath: (0, import_node_path114.basename)(filePath),
|
|
15396
15654
|
global: this.global
|
|
15397
15655
|
})
|
|
15398
15656
|
).filter((rule) => rule.isDeletable());
|
|
@@ -15401,7 +15659,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15401
15659
|
rootFilePaths.map(
|
|
15402
15660
|
(filePath) => factory.class.fromFile({
|
|
15403
15661
|
baseDir: this.baseDir,
|
|
15404
|
-
relativeFilePath: (0,
|
|
15662
|
+
relativeFilePath: (0, import_node_path114.basename)(filePath),
|
|
15405
15663
|
global: this.global
|
|
15406
15664
|
})
|
|
15407
15665
|
)
|
|
@@ -15419,13 +15677,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15419
15677
|
return [];
|
|
15420
15678
|
}
|
|
15421
15679
|
const localRootFilePaths = await findFilesByGlobs(
|
|
15422
|
-
(0,
|
|
15680
|
+
(0, import_node_path114.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
15423
15681
|
);
|
|
15424
15682
|
return localRootFilePaths.map(
|
|
15425
15683
|
(filePath) => factory.class.forDeletion({
|
|
15426
15684
|
baseDir: this.baseDir,
|
|
15427
15685
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
15428
|
-
relativeFilePath: (0,
|
|
15686
|
+
relativeFilePath: (0, import_node_path114.basename)(filePath),
|
|
15429
15687
|
global: this.global
|
|
15430
15688
|
})
|
|
15431
15689
|
).filter((rule) => rule.isDeletable());
|
|
@@ -15435,13 +15693,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15435
15693
|
if (!settablePaths.nonRoot) {
|
|
15436
15694
|
return [];
|
|
15437
15695
|
}
|
|
15438
|
-
const nonRootBaseDir = (0,
|
|
15696
|
+
const nonRootBaseDir = (0, import_node_path114.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
15439
15697
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
15440
|
-
(0,
|
|
15698
|
+
(0, import_node_path114.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
15441
15699
|
);
|
|
15442
15700
|
if (forDeletion) {
|
|
15443
15701
|
return nonRootFilePaths.map((filePath) => {
|
|
15444
|
-
const relativeFilePath = (0,
|
|
15702
|
+
const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
|
|
15445
15703
|
checkPathTraversal({
|
|
15446
15704
|
relativePath: relativeFilePath,
|
|
15447
15705
|
intendedRootDir: nonRootBaseDir
|
|
@@ -15456,7 +15714,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15456
15714
|
}
|
|
15457
15715
|
return await Promise.all(
|
|
15458
15716
|
nonRootFilePaths.map((filePath) => {
|
|
15459
|
-
const relativeFilePath = (0,
|
|
15717
|
+
const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
|
|
15460
15718
|
checkPathTraversal({
|
|
15461
15719
|
relativePath: relativeFilePath,
|
|
15462
15720
|
intendedRootDir: nonRootBaseDir
|
|
@@ -15569,14 +15827,14 @@ s/<command> [arguments]
|
|
|
15569
15827
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
15570
15828
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
15571
15829
|
|
|
15572
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
15830
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
15573
15831
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
15574
15832
|
|
|
15575
15833
|
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.
|
|
15576
15834
|
|
|
15577
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
15835
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
15578
15836
|
|
|
15579
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
15837
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
15580
15838
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
15581
15839
|
const result = [
|
|
15582
15840
|
overview,
|
|
@@ -15648,7 +15906,7 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
15648
15906
|
return { count: totalCount, paths: [], hasDiff };
|
|
15649
15907
|
}
|
|
15650
15908
|
async function checkRulesyncDirExists(params) {
|
|
15651
|
-
return fileExists((0,
|
|
15909
|
+
return fileExists((0, import_node_path115.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
15652
15910
|
}
|
|
15653
15911
|
async function generate(params) {
|
|
15654
15912
|
const { config } = params;
|