rulesync 7.10.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-57CDMFYZ.js → chunk-T5MWTRJM.js} +820 -586
- package/dist/cli/index.cjs +1105 -870
- package/dist/cli/index.js +3 -2
- package/dist/index.cjs +845 -611
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -606,7 +606,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
606
606
|
}
|
|
607
607
|
|
|
608
608
|
// src/lib/generate.ts
|
|
609
|
-
import { join as
|
|
609
|
+
import { join as join114 } from "path";
|
|
610
610
|
import { intersection } from "es-toolkit";
|
|
611
611
|
|
|
612
612
|
// src/features/commands/commands-processor.ts
|
|
@@ -2991,7 +2991,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2991
2991
|
};
|
|
2992
2992
|
|
|
2993
2993
|
// src/features/hooks/hooks-processor.ts
|
|
2994
|
-
import { z as
|
|
2994
|
+
import { z as z17 } from "zod/mini";
|
|
2995
2995
|
|
|
2996
2996
|
// src/types/hooks.ts
|
|
2997
2997
|
import { z as z14 } from "zod/mini";
|
|
@@ -3010,7 +3010,9 @@ var HookDefinitionSchema = z14.looseObject({
|
|
|
3010
3010
|
timeout: z14.optional(z14.number()),
|
|
3011
3011
|
matcher: z14.optional(safeString),
|
|
3012
3012
|
prompt: z14.optional(z14.string()),
|
|
3013
|
-
loop_limit: z14.optional(z14.nullable(z14.number()))
|
|
3013
|
+
loop_limit: z14.optional(z14.nullable(z14.number())),
|
|
3014
|
+
name: z14.optional(safeString),
|
|
3015
|
+
description: z14.optional(safeString)
|
|
3014
3016
|
});
|
|
3015
3017
|
var CURSOR_HOOK_EVENTS = [
|
|
3016
3018
|
"sessionStart",
|
|
@@ -3077,6 +3079,19 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
3077
3079
|
"notification",
|
|
3078
3080
|
"setup"
|
|
3079
3081
|
];
|
|
3082
|
+
var GEMINICLI_HOOK_EVENTS = [
|
|
3083
|
+
"sessionStart",
|
|
3084
|
+
"sessionEnd",
|
|
3085
|
+
"beforeSubmitPrompt",
|
|
3086
|
+
"stop",
|
|
3087
|
+
"beforeAgentResponse",
|
|
3088
|
+
"afterAgentResponse",
|
|
3089
|
+
"beforeToolSelection",
|
|
3090
|
+
"preToolUse",
|
|
3091
|
+
"postToolUse",
|
|
3092
|
+
"preCompact",
|
|
3093
|
+
"notification"
|
|
3094
|
+
];
|
|
3080
3095
|
var hooksRecordSchema = z14.record(z14.string(), z14.array(HookDefinitionSchema));
|
|
3081
3096
|
var HooksConfigSchema = z14.looseObject({
|
|
3082
3097
|
version: z14.optional(z14.number()),
|
|
@@ -3085,7 +3100,8 @@ var HooksConfigSchema = z14.looseObject({
|
|
|
3085
3100
|
claudecode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3086
3101
|
copilot: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3087
3102
|
opencode: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3088
|
-
factorydroid: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) }))
|
|
3103
|
+
factorydroid: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) })),
|
|
3104
|
+
geminicli: z14.optional(z14.looseObject({ hooks: z14.optional(hooksRecordSchema) }))
|
|
3089
3105
|
});
|
|
3090
3106
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3091
3107
|
sessionStart: "SessionStart",
|
|
@@ -3164,6 +3180,22 @@ var CANONICAL_TO_COPILOT_EVENT_NAMES = {
|
|
|
3164
3180
|
var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3165
3181
|
Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3166
3182
|
);
|
|
3183
|
+
var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
|
|
3184
|
+
sessionStart: "SessionStart",
|
|
3185
|
+
sessionEnd: "SessionEnd",
|
|
3186
|
+
beforeSubmitPrompt: "BeforeAgent",
|
|
3187
|
+
stop: "AfterAgent",
|
|
3188
|
+
beforeAgentResponse: "BeforeModel",
|
|
3189
|
+
afterAgentResponse: "AfterModel",
|
|
3190
|
+
beforeToolSelection: "BeforeToolSelection",
|
|
3191
|
+
preToolUse: "BeforeTool",
|
|
3192
|
+
postToolUse: "AfterTool",
|
|
3193
|
+
preCompact: "PreCompress",
|
|
3194
|
+
notification: "Notification"
|
|
3195
|
+
};
|
|
3196
|
+
var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3197
|
+
Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3198
|
+
);
|
|
3167
3199
|
|
|
3168
3200
|
// src/features/hooks/claudecode-hooks.ts
|
|
3169
3201
|
import { join as join21 } from "path";
|
|
@@ -3450,6 +3482,7 @@ var CopilotHookEntrySchema = z15.looseObject({
|
|
|
3450
3482
|
timeoutSec: z15.optional(z15.number())
|
|
3451
3483
|
});
|
|
3452
3484
|
function canonicalToCopilotHooks(config) {
|
|
3485
|
+
const canonicalSchemaKeys = Object.keys(HookDefinitionSchema.shape);
|
|
3453
3486
|
const isWindows = process.platform === "win32";
|
|
3454
3487
|
const commandField = isWindows ? "powershell" : "bash";
|
|
3455
3488
|
const supported = new Set(COPILOT_HOOK_EVENTS);
|
|
@@ -3474,9 +3507,7 @@ function canonicalToCopilotHooks(config) {
|
|
|
3474
3507
|
const command = def.command;
|
|
3475
3508
|
const timeout = def.timeout;
|
|
3476
3509
|
const rest = Object.fromEntries(
|
|
3477
|
-
Object.entries(def).filter(
|
|
3478
|
-
([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
|
|
3479
|
-
)
|
|
3510
|
+
Object.entries(def).filter(([k]) => !canonicalSchemaKeys.includes(k))
|
|
3480
3511
|
);
|
|
3481
3512
|
entries.push({
|
|
3482
3513
|
type: hookType,
|
|
@@ -3669,7 +3700,14 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3669
3700
|
const mappedHooks = {};
|
|
3670
3701
|
for (const [eventName, defs] of Object.entries(mergedHooks)) {
|
|
3671
3702
|
const cursorEventName = CANONICAL_TO_CURSOR_EVENT_NAMES[eventName] ?? eventName;
|
|
3672
|
-
mappedHooks[cursorEventName] = defs
|
|
3703
|
+
mappedHooks[cursorEventName] = defs.map((def) => ({
|
|
3704
|
+
...def.type !== void 0 && def.type !== null && { type: def.type },
|
|
3705
|
+
...def.command !== void 0 && def.command !== null && { command: def.command },
|
|
3706
|
+
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
|
|
3707
|
+
...def.loop_limit !== void 0 && { loop_limit: def.loop_limit },
|
|
3708
|
+
...def.matcher !== void 0 && def.matcher !== null && { matcher: def.matcher },
|
|
3709
|
+
...def.prompt !== void 0 && def.prompt !== null && { prompt: def.prompt }
|
|
3710
|
+
}));
|
|
3673
3711
|
}
|
|
3674
3712
|
const cursorConfig = {
|
|
3675
3713
|
version: config.version ?? 1,
|
|
@@ -3902,8 +3940,193 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3902
3940
|
}
|
|
3903
3941
|
};
|
|
3904
3942
|
|
|
3905
|
-
// src/features/hooks/
|
|
3943
|
+
// src/features/hooks/geminicli-hooks.ts
|
|
3906
3944
|
import { join as join25 } from "path";
|
|
3945
|
+
import { z as z16 } from "zod/mini";
|
|
3946
|
+
function canonicalToGeminicliHooks(config) {
|
|
3947
|
+
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
3948
|
+
const sharedHooks = {};
|
|
3949
|
+
for (const [event, defs] of Object.entries(config.hooks)) {
|
|
3950
|
+
if (geminiSupported.has(event)) {
|
|
3951
|
+
sharedHooks[event] = defs;
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
const effectiveHooks = {
|
|
3955
|
+
...sharedHooks,
|
|
3956
|
+
...config.geminicli?.hooks
|
|
3957
|
+
};
|
|
3958
|
+
const gemini = {};
|
|
3959
|
+
for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
|
|
3960
|
+
const geminiEventName = CANONICAL_TO_GEMINICLI_EVENT_NAMES[eventName] ?? eventName;
|
|
3961
|
+
const byMatcher = /* @__PURE__ */ new Map();
|
|
3962
|
+
for (const def of definitions) {
|
|
3963
|
+
const key = def.matcher ?? "";
|
|
3964
|
+
const list = byMatcher.get(key);
|
|
3965
|
+
if (list) list.push(def);
|
|
3966
|
+
else byMatcher.set(key, [def]);
|
|
3967
|
+
}
|
|
3968
|
+
const entries = [];
|
|
3969
|
+
for (const [matcherKey, defs] of byMatcher) {
|
|
3970
|
+
const hooks = defs.map((def) => {
|
|
3971
|
+
const command = def.command !== void 0 && def.command !== null && !def.command.startsWith("$") ? `$GEMINI_PROJECT_DIR/${def.command.replace(/^\.\//, "")}` : def.command;
|
|
3972
|
+
return {
|
|
3973
|
+
type: def.type ?? "command",
|
|
3974
|
+
...command !== void 0 && command !== null && { command },
|
|
3975
|
+
...def.timeout !== void 0 && def.timeout !== null && { timeout: def.timeout },
|
|
3976
|
+
...def.name !== void 0 && def.name !== null && { name: def.name },
|
|
3977
|
+
...def.description !== void 0 && def.description !== null && { description: def.description }
|
|
3978
|
+
};
|
|
3979
|
+
});
|
|
3980
|
+
entries.push(matcherKey ? { matcher: matcherKey, hooks } : { hooks });
|
|
3981
|
+
}
|
|
3982
|
+
gemini[geminiEventName] = entries;
|
|
3983
|
+
}
|
|
3984
|
+
return gemini;
|
|
3985
|
+
}
|
|
3986
|
+
var GeminiHookEntrySchema = z16.looseObject({
|
|
3987
|
+
type: z16.optional(z16.string()),
|
|
3988
|
+
command: z16.optional(z16.string()),
|
|
3989
|
+
timeout: z16.optional(z16.number()),
|
|
3990
|
+
name: z16.optional(z16.string()),
|
|
3991
|
+
description: z16.optional(z16.string())
|
|
3992
|
+
});
|
|
3993
|
+
var GeminiMatcherEntrySchema = z16.looseObject({
|
|
3994
|
+
matcher: z16.optional(z16.string()),
|
|
3995
|
+
hooks: z16.optional(z16.array(GeminiHookEntrySchema))
|
|
3996
|
+
});
|
|
3997
|
+
function geminiHooksToCanonical(geminiHooks) {
|
|
3998
|
+
if (geminiHooks === null || geminiHooks === void 0 || typeof geminiHooks !== "object") {
|
|
3999
|
+
return {};
|
|
4000
|
+
}
|
|
4001
|
+
const canonical = {};
|
|
4002
|
+
for (const [geminiEventName, matcherEntries] of Object.entries(geminiHooks)) {
|
|
4003
|
+
const eventName = GEMINICLI_TO_CANONICAL_EVENT_NAMES[geminiEventName] ?? geminiEventName;
|
|
4004
|
+
if (!Array.isArray(matcherEntries)) continue;
|
|
4005
|
+
const defs = [];
|
|
4006
|
+
for (const rawEntry of matcherEntries) {
|
|
4007
|
+
const parseResult = GeminiMatcherEntrySchema.safeParse(rawEntry);
|
|
4008
|
+
if (!parseResult.success) continue;
|
|
4009
|
+
const entry = parseResult.data;
|
|
4010
|
+
const hooks = entry.hooks ?? [];
|
|
4011
|
+
for (const h of hooks) {
|
|
4012
|
+
const cmd = h.command;
|
|
4013
|
+
const command = typeof cmd === "string" && cmd.startsWith("$GEMINI_PROJECT_DIR/") ? cmd.replace(/^\$GEMINI_PROJECT_DIR\/?/, "./") : cmd;
|
|
4014
|
+
const hookType = h.type === "command" || h.type === "prompt" ? h.type : "command";
|
|
4015
|
+
defs.push({
|
|
4016
|
+
type: hookType,
|
|
4017
|
+
...command !== void 0 && command !== null && { command },
|
|
4018
|
+
...h.timeout !== void 0 && h.timeout !== null && { timeout: h.timeout },
|
|
4019
|
+
...h.name !== void 0 && h.name !== null && { name: h.name },
|
|
4020
|
+
...h.description !== void 0 && h.description !== null && { description: h.description },
|
|
4021
|
+
...entry.matcher !== void 0 && entry.matcher !== null && entry.matcher !== "" && { matcher: entry.matcher }
|
|
4022
|
+
});
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
if (defs.length > 0) {
|
|
4026
|
+
canonical[eventName] = defs;
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
return canonical;
|
|
4030
|
+
}
|
|
4031
|
+
var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
4032
|
+
constructor(params) {
|
|
4033
|
+
super({
|
|
4034
|
+
...params,
|
|
4035
|
+
fileContent: params.fileContent ?? "{}"
|
|
4036
|
+
});
|
|
4037
|
+
}
|
|
4038
|
+
isDeletable() {
|
|
4039
|
+
return false;
|
|
4040
|
+
}
|
|
4041
|
+
static getSettablePaths(_options = {}) {
|
|
4042
|
+
return { relativeDirPath: ".gemini", relativeFilePath: "settings.json" };
|
|
4043
|
+
}
|
|
4044
|
+
static async fromFile({
|
|
4045
|
+
baseDir = process.cwd(),
|
|
4046
|
+
validate = true,
|
|
4047
|
+
global = false
|
|
4048
|
+
}) {
|
|
4049
|
+
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4050
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4051
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4052
|
+
return new _GeminicliHooks({
|
|
4053
|
+
baseDir,
|
|
4054
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4055
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4056
|
+
fileContent,
|
|
4057
|
+
validate
|
|
4058
|
+
});
|
|
4059
|
+
}
|
|
4060
|
+
static async fromRulesyncHooks({
|
|
4061
|
+
baseDir = process.cwd(),
|
|
4062
|
+
rulesyncHooks,
|
|
4063
|
+
validate = true,
|
|
4064
|
+
global = false
|
|
4065
|
+
}) {
|
|
4066
|
+
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4067
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4068
|
+
const existingContent = await readOrInitializeFileContent(
|
|
4069
|
+
filePath,
|
|
4070
|
+
JSON.stringify({}, null, 2)
|
|
4071
|
+
);
|
|
4072
|
+
let settings;
|
|
4073
|
+
try {
|
|
4074
|
+
settings = JSON.parse(existingContent);
|
|
4075
|
+
} catch (error) {
|
|
4076
|
+
throw new Error(
|
|
4077
|
+
`Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(error)}`,
|
|
4078
|
+
{ cause: error }
|
|
4079
|
+
);
|
|
4080
|
+
}
|
|
4081
|
+
const config = rulesyncHooks.getJson();
|
|
4082
|
+
const geminiHooks = canonicalToGeminicliHooks(config);
|
|
4083
|
+
const merged = { ...settings, hooks: geminiHooks };
|
|
4084
|
+
const fileContent = JSON.stringify(merged, null, 2);
|
|
4085
|
+
return new _GeminicliHooks({
|
|
4086
|
+
baseDir,
|
|
4087
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4088
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4089
|
+
fileContent,
|
|
4090
|
+
validate
|
|
4091
|
+
});
|
|
4092
|
+
}
|
|
4093
|
+
toRulesyncHooks() {
|
|
4094
|
+
let settings;
|
|
4095
|
+
try {
|
|
4096
|
+
settings = JSON.parse(this.getFileContent());
|
|
4097
|
+
} catch (error) {
|
|
4098
|
+
throw new Error(
|
|
4099
|
+
`Failed to parse Gemini CLI hooks content in ${join25(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4100
|
+
{
|
|
4101
|
+
cause: error
|
|
4102
|
+
}
|
|
4103
|
+
);
|
|
4104
|
+
}
|
|
4105
|
+
const hooks = geminiHooksToCanonical(settings.hooks);
|
|
4106
|
+
return this.toRulesyncHooksDefault({
|
|
4107
|
+
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
validate() {
|
|
4111
|
+
return { success: true, error: null };
|
|
4112
|
+
}
|
|
4113
|
+
static forDeletion({
|
|
4114
|
+
baseDir = process.cwd(),
|
|
4115
|
+
relativeDirPath,
|
|
4116
|
+
relativeFilePath
|
|
4117
|
+
}) {
|
|
4118
|
+
return new _GeminicliHooks({
|
|
4119
|
+
baseDir,
|
|
4120
|
+
relativeDirPath,
|
|
4121
|
+
relativeFilePath,
|
|
4122
|
+
fileContent: JSON.stringify({ hooks: {} }, null, 2),
|
|
4123
|
+
validate: false
|
|
4124
|
+
});
|
|
4125
|
+
}
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
// src/features/hooks/opencode-hooks.ts
|
|
4129
|
+
import { join as join26 } from "path";
|
|
3907
4130
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
3908
4131
|
function escapeForTemplateLiteral(command) {
|
|
3909
4132
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4001,7 +4224,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4001
4224
|
}
|
|
4002
4225
|
static getSettablePaths(options) {
|
|
4003
4226
|
return {
|
|
4004
|
-
relativeDirPath: options?.global ?
|
|
4227
|
+
relativeDirPath: options?.global ? join26(".config", "opencode", "plugins") : join26(".opencode", "plugins"),
|
|
4005
4228
|
relativeFilePath: "rulesync-hooks.js"
|
|
4006
4229
|
};
|
|
4007
4230
|
}
|
|
@@ -4012,7 +4235,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4012
4235
|
}) {
|
|
4013
4236
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4014
4237
|
const fileContent = await readFileContent(
|
|
4015
|
-
|
|
4238
|
+
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4016
4239
|
);
|
|
4017
4240
|
return new _OpencodeHooks({
|
|
4018
4241
|
baseDir,
|
|
@@ -4066,9 +4289,10 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4066
4289
|
"claudecode",
|
|
4067
4290
|
"copilot",
|
|
4068
4291
|
"opencode",
|
|
4069
|
-
"factorydroid"
|
|
4292
|
+
"factorydroid",
|
|
4293
|
+
"geminicli"
|
|
4070
4294
|
];
|
|
4071
|
-
var HooksProcessorToolTargetSchema =
|
|
4295
|
+
var HooksProcessorToolTargetSchema = z17.enum(hooksProcessorToolTargetTuple);
|
|
4072
4296
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
4073
4297
|
[
|
|
4074
4298
|
"cursor",
|
|
@@ -4139,6 +4363,16 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
|
4139
4363
|
supportedHookTypes: ["command", "prompt"],
|
|
4140
4364
|
supportsMatcher: true
|
|
4141
4365
|
}
|
|
4366
|
+
],
|
|
4367
|
+
[
|
|
4368
|
+
"geminicli",
|
|
4369
|
+
{
|
|
4370
|
+
class: GeminicliHooks,
|
|
4371
|
+
meta: { supportsProject: true, supportsGlobal: true, supportsImport: true },
|
|
4372
|
+
supportedEvents: GEMINICLI_HOOK_EVENTS,
|
|
4373
|
+
supportedHookTypes: ["command"],
|
|
4374
|
+
supportsMatcher: true
|
|
4375
|
+
}
|
|
4142
4376
|
]
|
|
4143
4377
|
]);
|
|
4144
4378
|
var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
|
|
@@ -4293,13 +4527,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4293
4527
|
};
|
|
4294
4528
|
|
|
4295
4529
|
// src/features/ignore/ignore-processor.ts
|
|
4296
|
-
import { z as
|
|
4530
|
+
import { z as z18 } from "zod/mini";
|
|
4297
4531
|
|
|
4298
4532
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4299
|
-
import { join as
|
|
4533
|
+
import { join as join28 } from "path";
|
|
4300
4534
|
|
|
4301
4535
|
// src/features/ignore/rulesync-ignore.ts
|
|
4302
|
-
import { join as
|
|
4536
|
+
import { join as join27 } from "path";
|
|
4303
4537
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4304
4538
|
validate() {
|
|
4305
4539
|
return { success: true, error: null };
|
|
@@ -4319,12 +4553,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4319
4553
|
static async fromFile() {
|
|
4320
4554
|
const baseDir = process.cwd();
|
|
4321
4555
|
const paths = this.getSettablePaths();
|
|
4322
|
-
const recommendedPath =
|
|
4556
|
+
const recommendedPath = join27(
|
|
4323
4557
|
baseDir,
|
|
4324
4558
|
paths.recommended.relativeDirPath,
|
|
4325
4559
|
paths.recommended.relativeFilePath
|
|
4326
4560
|
);
|
|
4327
|
-
const legacyPath =
|
|
4561
|
+
const legacyPath = join27(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4328
4562
|
if (await fileExists(recommendedPath)) {
|
|
4329
4563
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4330
4564
|
return new _RulesyncIgnore({
|
|
@@ -4440,7 +4674,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4440
4674
|
validate = true
|
|
4441
4675
|
}) {
|
|
4442
4676
|
const fileContent = await readFileContent(
|
|
4443
|
-
|
|
4677
|
+
join28(
|
|
4444
4678
|
baseDir,
|
|
4445
4679
|
this.getSettablePaths().relativeDirPath,
|
|
4446
4680
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4470,7 +4704,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4470
4704
|
};
|
|
4471
4705
|
|
|
4472
4706
|
// src/features/ignore/claudecode-ignore.ts
|
|
4473
|
-
import { join as
|
|
4707
|
+
import { join as join29 } from "path";
|
|
4474
4708
|
import { uniq } from "es-toolkit";
|
|
4475
4709
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4476
4710
|
constructor(params) {
|
|
@@ -4513,7 +4747,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4513
4747
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4514
4748
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4515
4749
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4516
|
-
const filePath =
|
|
4750
|
+
const filePath = join29(
|
|
4517
4751
|
baseDir,
|
|
4518
4752
|
this.getSettablePaths().relativeDirPath,
|
|
4519
4753
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4549,7 +4783,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4549
4783
|
validate = true
|
|
4550
4784
|
}) {
|
|
4551
4785
|
const fileContent = await readFileContent(
|
|
4552
|
-
|
|
4786
|
+
join29(
|
|
4553
4787
|
baseDir,
|
|
4554
4788
|
this.getSettablePaths().relativeDirPath,
|
|
4555
4789
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4579,7 +4813,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4579
4813
|
};
|
|
4580
4814
|
|
|
4581
4815
|
// src/features/ignore/cline-ignore.ts
|
|
4582
|
-
import { join as
|
|
4816
|
+
import { join as join30 } from "path";
|
|
4583
4817
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4584
4818
|
static getSettablePaths() {
|
|
4585
4819
|
return {
|
|
@@ -4616,7 +4850,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4616
4850
|
validate = true
|
|
4617
4851
|
}) {
|
|
4618
4852
|
const fileContent = await readFileContent(
|
|
4619
|
-
|
|
4853
|
+
join30(
|
|
4620
4854
|
baseDir,
|
|
4621
4855
|
this.getSettablePaths().relativeDirPath,
|
|
4622
4856
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4646,7 +4880,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4646
4880
|
};
|
|
4647
4881
|
|
|
4648
4882
|
// src/features/ignore/cursor-ignore.ts
|
|
4649
|
-
import { join as
|
|
4883
|
+
import { join as join31 } from "path";
|
|
4650
4884
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
4651
4885
|
static getSettablePaths() {
|
|
4652
4886
|
return {
|
|
@@ -4679,7 +4913,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4679
4913
|
validate = true
|
|
4680
4914
|
}) {
|
|
4681
4915
|
const fileContent = await readFileContent(
|
|
4682
|
-
|
|
4916
|
+
join31(
|
|
4683
4917
|
baseDir,
|
|
4684
4918
|
this.getSettablePaths().relativeDirPath,
|
|
4685
4919
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4709,7 +4943,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4709
4943
|
};
|
|
4710
4944
|
|
|
4711
4945
|
// src/features/ignore/geminicli-ignore.ts
|
|
4712
|
-
import { join as
|
|
4946
|
+
import { join as join32 } from "path";
|
|
4713
4947
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
4714
4948
|
static getSettablePaths() {
|
|
4715
4949
|
return {
|
|
@@ -4736,7 +4970,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4736
4970
|
validate = true
|
|
4737
4971
|
}) {
|
|
4738
4972
|
const fileContent = await readFileContent(
|
|
4739
|
-
|
|
4973
|
+
join32(
|
|
4740
4974
|
baseDir,
|
|
4741
4975
|
this.getSettablePaths().relativeDirPath,
|
|
4742
4976
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4766,7 +5000,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4766
5000
|
};
|
|
4767
5001
|
|
|
4768
5002
|
// src/features/ignore/goose-ignore.ts
|
|
4769
|
-
import { join as
|
|
5003
|
+
import { join as join33 } from "path";
|
|
4770
5004
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
4771
5005
|
static getSettablePaths() {
|
|
4772
5006
|
return {
|
|
@@ -4803,7 +5037,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4803
5037
|
validate = true
|
|
4804
5038
|
}) {
|
|
4805
5039
|
const fileContent = await readFileContent(
|
|
4806
|
-
|
|
5040
|
+
join33(
|
|
4807
5041
|
baseDir,
|
|
4808
5042
|
this.getSettablePaths().relativeDirPath,
|
|
4809
5043
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4833,7 +5067,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4833
5067
|
};
|
|
4834
5068
|
|
|
4835
5069
|
// src/features/ignore/junie-ignore.ts
|
|
4836
|
-
import { join as
|
|
5070
|
+
import { join as join34 } from "path";
|
|
4837
5071
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
4838
5072
|
static getSettablePaths() {
|
|
4839
5073
|
return {
|
|
@@ -4860,7 +5094,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4860
5094
|
validate = true
|
|
4861
5095
|
}) {
|
|
4862
5096
|
const fileContent = await readFileContent(
|
|
4863
|
-
|
|
5097
|
+
join34(
|
|
4864
5098
|
baseDir,
|
|
4865
5099
|
this.getSettablePaths().relativeDirPath,
|
|
4866
5100
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4890,7 +5124,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4890
5124
|
};
|
|
4891
5125
|
|
|
4892
5126
|
// src/features/ignore/kilo-ignore.ts
|
|
4893
|
-
import { join as
|
|
5127
|
+
import { join as join35 } from "path";
|
|
4894
5128
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
4895
5129
|
static getSettablePaths() {
|
|
4896
5130
|
return {
|
|
@@ -4927,7 +5161,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4927
5161
|
validate = true
|
|
4928
5162
|
}) {
|
|
4929
5163
|
const fileContent = await readFileContent(
|
|
4930
|
-
|
|
5164
|
+
join35(
|
|
4931
5165
|
baseDir,
|
|
4932
5166
|
this.getSettablePaths().relativeDirPath,
|
|
4933
5167
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4957,7 +5191,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4957
5191
|
};
|
|
4958
5192
|
|
|
4959
5193
|
// src/features/ignore/kiro-ignore.ts
|
|
4960
|
-
import { join as
|
|
5194
|
+
import { join as join36 } from "path";
|
|
4961
5195
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
4962
5196
|
static getSettablePaths() {
|
|
4963
5197
|
return {
|
|
@@ -4984,7 +5218,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4984
5218
|
validate = true
|
|
4985
5219
|
}) {
|
|
4986
5220
|
const fileContent = await readFileContent(
|
|
4987
|
-
|
|
5221
|
+
join36(
|
|
4988
5222
|
baseDir,
|
|
4989
5223
|
this.getSettablePaths().relativeDirPath,
|
|
4990
5224
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5014,7 +5248,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5014
5248
|
};
|
|
5015
5249
|
|
|
5016
5250
|
// src/features/ignore/qwencode-ignore.ts
|
|
5017
|
-
import { join as
|
|
5251
|
+
import { join as join37 } from "path";
|
|
5018
5252
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5019
5253
|
static getSettablePaths() {
|
|
5020
5254
|
return {
|
|
@@ -5041,7 +5275,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5041
5275
|
validate = true
|
|
5042
5276
|
}) {
|
|
5043
5277
|
const fileContent = await readFileContent(
|
|
5044
|
-
|
|
5278
|
+
join37(
|
|
5045
5279
|
baseDir,
|
|
5046
5280
|
this.getSettablePaths().relativeDirPath,
|
|
5047
5281
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5071,7 +5305,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5071
5305
|
};
|
|
5072
5306
|
|
|
5073
5307
|
// src/features/ignore/roo-ignore.ts
|
|
5074
|
-
import { join as
|
|
5308
|
+
import { join as join38 } from "path";
|
|
5075
5309
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5076
5310
|
static getSettablePaths() {
|
|
5077
5311
|
return {
|
|
@@ -5098,7 +5332,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5098
5332
|
validate = true
|
|
5099
5333
|
}) {
|
|
5100
5334
|
const fileContent = await readFileContent(
|
|
5101
|
-
|
|
5335
|
+
join38(
|
|
5102
5336
|
baseDir,
|
|
5103
5337
|
this.getSettablePaths().relativeDirPath,
|
|
5104
5338
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5128,7 +5362,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5128
5362
|
};
|
|
5129
5363
|
|
|
5130
5364
|
// src/features/ignore/windsurf-ignore.ts
|
|
5131
|
-
import { join as
|
|
5365
|
+
import { join as join39 } from "path";
|
|
5132
5366
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5133
5367
|
static getSettablePaths() {
|
|
5134
5368
|
return {
|
|
@@ -5155,7 +5389,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5155
5389
|
validate = true
|
|
5156
5390
|
}) {
|
|
5157
5391
|
const fileContent = await readFileContent(
|
|
5158
|
-
|
|
5392
|
+
join39(
|
|
5159
5393
|
baseDir,
|
|
5160
5394
|
this.getSettablePaths().relativeDirPath,
|
|
5161
5395
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5185,7 +5419,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5185
5419
|
};
|
|
5186
5420
|
|
|
5187
5421
|
// src/features/ignore/zed-ignore.ts
|
|
5188
|
-
import { join as
|
|
5422
|
+
import { join as join40 } from "path";
|
|
5189
5423
|
import { uniq as uniq2 } from "es-toolkit";
|
|
5190
5424
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5191
5425
|
constructor(params) {
|
|
@@ -5222,7 +5456,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5222
5456
|
}) {
|
|
5223
5457
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5224
5458
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5225
|
-
const filePath =
|
|
5459
|
+
const filePath = join40(
|
|
5226
5460
|
baseDir,
|
|
5227
5461
|
this.getSettablePaths().relativeDirPath,
|
|
5228
5462
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5249,7 +5483,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5249
5483
|
validate = true
|
|
5250
5484
|
}) {
|
|
5251
5485
|
const fileContent = await readFileContent(
|
|
5252
|
-
|
|
5486
|
+
join40(
|
|
5253
5487
|
baseDir,
|
|
5254
5488
|
this.getSettablePaths().relativeDirPath,
|
|
5255
5489
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5295,7 +5529,7 @@ var ignoreProcessorToolTargets = [
|
|
|
5295
5529
|
"windsurf",
|
|
5296
5530
|
"zed"
|
|
5297
5531
|
];
|
|
5298
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5532
|
+
var IgnoreProcessorToolTargetSchema = z18.enum(ignoreProcessorToolTargets);
|
|
5299
5533
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
5300
5534
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
5301
5535
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -5433,49 +5667,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5433
5667
|
};
|
|
5434
5668
|
|
|
5435
5669
|
// src/features/mcp/mcp-processor.ts
|
|
5436
|
-
import { z as
|
|
5670
|
+
import { z as z22 } from "zod/mini";
|
|
5437
5671
|
|
|
5438
5672
|
// src/features/mcp/claudecode-mcp.ts
|
|
5439
|
-
import { join as
|
|
5673
|
+
import { join as join42 } from "path";
|
|
5440
5674
|
|
|
5441
5675
|
// src/features/mcp/rulesync-mcp.ts
|
|
5442
|
-
import { join as
|
|
5676
|
+
import { join as join41 } from "path";
|
|
5443
5677
|
import { omit } from "es-toolkit/object";
|
|
5444
|
-
import { z as
|
|
5678
|
+
import { z as z20 } from "zod/mini";
|
|
5445
5679
|
|
|
5446
5680
|
// src/types/mcp.ts
|
|
5447
|
-
import { z as
|
|
5448
|
-
var McpServerSchema =
|
|
5449
|
-
type:
|
|
5450
|
-
command:
|
|
5451
|
-
args:
|
|
5452
|
-
url:
|
|
5453
|
-
httpUrl:
|
|
5454
|
-
env:
|
|
5455
|
-
disabled:
|
|
5456
|
-
networkTimeout:
|
|
5457
|
-
timeout:
|
|
5458
|
-
trust:
|
|
5459
|
-
cwd:
|
|
5460
|
-
transport:
|
|
5461
|
-
alwaysAllow:
|
|
5462
|
-
tools:
|
|
5463
|
-
kiroAutoApprove:
|
|
5464
|
-
kiroAutoBlock:
|
|
5465
|
-
headers:
|
|
5466
|
-
enabledTools:
|
|
5467
|
-
disabledTools:
|
|
5681
|
+
import { z as z19 } from "zod/mini";
|
|
5682
|
+
var McpServerSchema = z19.object({
|
|
5683
|
+
type: z19.optional(z19.enum(["stdio", "sse", "http"])),
|
|
5684
|
+
command: z19.optional(z19.union([z19.string(), z19.array(z19.string())])),
|
|
5685
|
+
args: z19.optional(z19.array(z19.string())),
|
|
5686
|
+
url: z19.optional(z19.string()),
|
|
5687
|
+
httpUrl: z19.optional(z19.string()),
|
|
5688
|
+
env: z19.optional(z19.record(z19.string(), z19.string())),
|
|
5689
|
+
disabled: z19.optional(z19.boolean()),
|
|
5690
|
+
networkTimeout: z19.optional(z19.number()),
|
|
5691
|
+
timeout: z19.optional(z19.number()),
|
|
5692
|
+
trust: z19.optional(z19.boolean()),
|
|
5693
|
+
cwd: z19.optional(z19.string()),
|
|
5694
|
+
transport: z19.optional(z19.enum(["stdio", "sse", "http"])),
|
|
5695
|
+
alwaysAllow: z19.optional(z19.array(z19.string())),
|
|
5696
|
+
tools: z19.optional(z19.array(z19.string())),
|
|
5697
|
+
kiroAutoApprove: z19.optional(z19.array(z19.string())),
|
|
5698
|
+
kiroAutoBlock: z19.optional(z19.array(z19.string())),
|
|
5699
|
+
headers: z19.optional(z19.record(z19.string(), z19.string())),
|
|
5700
|
+
enabledTools: z19.optional(z19.array(z19.string())),
|
|
5701
|
+
disabledTools: z19.optional(z19.array(z19.string()))
|
|
5468
5702
|
});
|
|
5469
|
-
var McpServersSchema =
|
|
5703
|
+
var McpServersSchema = z19.record(z19.string(), McpServerSchema);
|
|
5470
5704
|
|
|
5471
5705
|
// src/features/mcp/rulesync-mcp.ts
|
|
5472
|
-
var RulesyncMcpServerSchema =
|
|
5473
|
-
targets:
|
|
5474
|
-
description:
|
|
5475
|
-
exposed:
|
|
5706
|
+
var RulesyncMcpServerSchema = z20.extend(McpServerSchema, {
|
|
5707
|
+
targets: z20.optional(RulesyncTargetsSchema),
|
|
5708
|
+
description: z20.optional(z20.string()),
|
|
5709
|
+
exposed: z20.optional(z20.boolean())
|
|
5476
5710
|
});
|
|
5477
|
-
var RulesyncMcpConfigSchema =
|
|
5478
|
-
mcpServers:
|
|
5711
|
+
var RulesyncMcpConfigSchema = z20.object({
|
|
5712
|
+
mcpServers: z20.record(z20.string(), RulesyncMcpServerSchema)
|
|
5479
5713
|
});
|
|
5480
5714
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
5481
5715
|
json;
|
|
@@ -5511,12 +5745,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5511
5745
|
static async fromFile({ validate = true }) {
|
|
5512
5746
|
const baseDir = process.cwd();
|
|
5513
5747
|
const paths = this.getSettablePaths();
|
|
5514
|
-
const recommendedPath =
|
|
5748
|
+
const recommendedPath = join41(
|
|
5515
5749
|
baseDir,
|
|
5516
5750
|
paths.recommended.relativeDirPath,
|
|
5517
5751
|
paths.recommended.relativeFilePath
|
|
5518
5752
|
);
|
|
5519
|
-
const legacyPath =
|
|
5753
|
+
const legacyPath = join41(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5520
5754
|
if (await fileExists(recommendedPath)) {
|
|
5521
5755
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5522
5756
|
return new _RulesyncMcp({
|
|
@@ -5661,7 +5895,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5661
5895
|
global = false
|
|
5662
5896
|
}) {
|
|
5663
5897
|
const paths = this.getSettablePaths({ global });
|
|
5664
|
-
const fileContent = await readFileContentOrNull(
|
|
5898
|
+
const fileContent = await readFileContentOrNull(join42(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5665
5899
|
const json = JSON.parse(fileContent);
|
|
5666
5900
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5667
5901
|
return new _ClaudecodeMcp({
|
|
@@ -5680,7 +5914,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5680
5914
|
}) {
|
|
5681
5915
|
const paths = this.getSettablePaths({ global });
|
|
5682
5916
|
const fileContent = await readOrInitializeFileContent(
|
|
5683
|
-
|
|
5917
|
+
join42(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5684
5918
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5685
5919
|
);
|
|
5686
5920
|
const json = JSON.parse(fileContent);
|
|
@@ -5719,7 +5953,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5719
5953
|
};
|
|
5720
5954
|
|
|
5721
5955
|
// src/features/mcp/cline-mcp.ts
|
|
5722
|
-
import { join as
|
|
5956
|
+
import { join as join43 } from "path";
|
|
5723
5957
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
5724
5958
|
json;
|
|
5725
5959
|
constructor(params) {
|
|
@@ -5740,7 +5974,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5740
5974
|
validate = true
|
|
5741
5975
|
}) {
|
|
5742
5976
|
const fileContent = await readFileContent(
|
|
5743
|
-
|
|
5977
|
+
join43(
|
|
5744
5978
|
baseDir,
|
|
5745
5979
|
this.getSettablePaths().relativeDirPath,
|
|
5746
5980
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5789,7 +6023,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5789
6023
|
};
|
|
5790
6024
|
|
|
5791
6025
|
// src/features/mcp/codexcli-mcp.ts
|
|
5792
|
-
import { join as
|
|
6026
|
+
import { join as join44 } from "path";
|
|
5793
6027
|
import * as smolToml from "smol-toml";
|
|
5794
6028
|
function convertFromCodexFormat(codexMcp) {
|
|
5795
6029
|
const result = {};
|
|
@@ -5872,7 +6106,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5872
6106
|
global = false
|
|
5873
6107
|
}) {
|
|
5874
6108
|
const paths = this.getSettablePaths({ global });
|
|
5875
|
-
const fileContent = await readFileContentOrNull(
|
|
6109
|
+
const fileContent = await readFileContentOrNull(join44(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
5876
6110
|
return new _CodexcliMcp({
|
|
5877
6111
|
baseDir,
|
|
5878
6112
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -5888,7 +6122,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5888
6122
|
global = false
|
|
5889
6123
|
}) {
|
|
5890
6124
|
const paths = this.getSettablePaths({ global });
|
|
5891
|
-
const configTomlFilePath =
|
|
6125
|
+
const configTomlFilePath = join44(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5892
6126
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
5893
6127
|
configTomlFilePath,
|
|
5894
6128
|
smolToml.stringify({})
|
|
@@ -5945,7 +6179,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5945
6179
|
};
|
|
5946
6180
|
|
|
5947
6181
|
// src/features/mcp/copilot-mcp.ts
|
|
5948
|
-
import { join as
|
|
6182
|
+
import { join as join45 } from "path";
|
|
5949
6183
|
function convertToCopilotFormat(mcpServers) {
|
|
5950
6184
|
return { servers: mcpServers };
|
|
5951
6185
|
}
|
|
@@ -5972,7 +6206,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5972
6206
|
validate = true
|
|
5973
6207
|
}) {
|
|
5974
6208
|
const fileContent = await readFileContent(
|
|
5975
|
-
|
|
6209
|
+
join45(
|
|
5976
6210
|
baseDir,
|
|
5977
6211
|
this.getSettablePaths().relativeDirPath,
|
|
5978
6212
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6025,7 +6259,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6025
6259
|
};
|
|
6026
6260
|
|
|
6027
6261
|
// src/features/mcp/cursor-mcp.ts
|
|
6028
|
-
import { join as
|
|
6262
|
+
import { join as join46 } from "path";
|
|
6029
6263
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6030
6264
|
function isMcpServers(value) {
|
|
6031
6265
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6086,7 +6320,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6086
6320
|
validate = true
|
|
6087
6321
|
}) {
|
|
6088
6322
|
const fileContent = await readFileContent(
|
|
6089
|
-
|
|
6323
|
+
join46(
|
|
6090
6324
|
baseDir,
|
|
6091
6325
|
this.getSettablePaths().relativeDirPath,
|
|
6092
6326
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6154,7 +6388,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6154
6388
|
};
|
|
6155
6389
|
|
|
6156
6390
|
// src/features/mcp/factorydroid-mcp.ts
|
|
6157
|
-
import { join as
|
|
6391
|
+
import { join as join47 } from "path";
|
|
6158
6392
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
6159
6393
|
json;
|
|
6160
6394
|
constructor(params) {
|
|
@@ -6175,7 +6409,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6175
6409
|
validate = true
|
|
6176
6410
|
}) {
|
|
6177
6411
|
const fileContent = await readFileContent(
|
|
6178
|
-
|
|
6412
|
+
join47(
|
|
6179
6413
|
baseDir,
|
|
6180
6414
|
this.getSettablePaths().relativeDirPath,
|
|
6181
6415
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6235,7 +6469,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6235
6469
|
};
|
|
6236
6470
|
|
|
6237
6471
|
// src/features/mcp/geminicli-mcp.ts
|
|
6238
|
-
import { join as
|
|
6472
|
+
import { join as join48 } from "path";
|
|
6239
6473
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6240
6474
|
json;
|
|
6241
6475
|
constructor(params) {
|
|
@@ -6263,7 +6497,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6263
6497
|
global = false
|
|
6264
6498
|
}) {
|
|
6265
6499
|
const paths = this.getSettablePaths({ global });
|
|
6266
|
-
const fileContent = await readFileContentOrNull(
|
|
6500
|
+
const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6267
6501
|
const json = JSON.parse(fileContent);
|
|
6268
6502
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6269
6503
|
return new _GeminiCliMcp({
|
|
@@ -6282,7 +6516,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6282
6516
|
}) {
|
|
6283
6517
|
const paths = this.getSettablePaths({ global });
|
|
6284
6518
|
const fileContent = await readOrInitializeFileContent(
|
|
6285
|
-
|
|
6519
|
+
join48(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6286
6520
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6287
6521
|
);
|
|
6288
6522
|
const json = JSON.parse(fileContent);
|
|
@@ -6327,7 +6561,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6327
6561
|
};
|
|
6328
6562
|
|
|
6329
6563
|
// src/features/mcp/junie-mcp.ts
|
|
6330
|
-
import { join as
|
|
6564
|
+
import { join as join49 } from "path";
|
|
6331
6565
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6332
6566
|
json;
|
|
6333
6567
|
constructor(params) {
|
|
@@ -6339,7 +6573,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6339
6573
|
}
|
|
6340
6574
|
static getSettablePaths() {
|
|
6341
6575
|
return {
|
|
6342
|
-
relativeDirPath:
|
|
6576
|
+
relativeDirPath: join49(".junie", "mcp"),
|
|
6343
6577
|
relativeFilePath: "mcp.json"
|
|
6344
6578
|
};
|
|
6345
6579
|
}
|
|
@@ -6348,7 +6582,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6348
6582
|
validate = true
|
|
6349
6583
|
}) {
|
|
6350
6584
|
const fileContent = await readFileContent(
|
|
6351
|
-
|
|
6585
|
+
join49(
|
|
6352
6586
|
baseDir,
|
|
6353
6587
|
this.getSettablePaths().relativeDirPath,
|
|
6354
6588
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6397,7 +6631,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6397
6631
|
};
|
|
6398
6632
|
|
|
6399
6633
|
// src/features/mcp/kilo-mcp.ts
|
|
6400
|
-
import { join as
|
|
6634
|
+
import { join as join50 } from "path";
|
|
6401
6635
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6402
6636
|
json;
|
|
6403
6637
|
constructor(params) {
|
|
@@ -6418,7 +6652,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6418
6652
|
validate = true
|
|
6419
6653
|
}) {
|
|
6420
6654
|
const paths = this.getSettablePaths();
|
|
6421
|
-
const fileContent = await readFileContentOrNull(
|
|
6655
|
+
const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6422
6656
|
return new _KiloMcp({
|
|
6423
6657
|
baseDir,
|
|
6424
6658
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6466,7 +6700,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6466
6700
|
};
|
|
6467
6701
|
|
|
6468
6702
|
// src/features/mcp/kiro-mcp.ts
|
|
6469
|
-
import { join as
|
|
6703
|
+
import { join as join51 } from "path";
|
|
6470
6704
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6471
6705
|
json;
|
|
6472
6706
|
constructor(params) {
|
|
@@ -6478,7 +6712,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6478
6712
|
}
|
|
6479
6713
|
static getSettablePaths() {
|
|
6480
6714
|
return {
|
|
6481
|
-
relativeDirPath:
|
|
6715
|
+
relativeDirPath: join51(".kiro", "settings"),
|
|
6482
6716
|
relativeFilePath: "mcp.json"
|
|
6483
6717
|
};
|
|
6484
6718
|
}
|
|
@@ -6487,7 +6721,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6487
6721
|
validate = true
|
|
6488
6722
|
}) {
|
|
6489
6723
|
const paths = this.getSettablePaths();
|
|
6490
|
-
const fileContent = await readFileContentOrNull(
|
|
6724
|
+
const fileContent = await readFileContentOrNull(join51(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6491
6725
|
return new _KiroMcp({
|
|
6492
6726
|
baseDir,
|
|
6493
6727
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6535,30 +6769,30 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6535
6769
|
};
|
|
6536
6770
|
|
|
6537
6771
|
// src/features/mcp/opencode-mcp.ts
|
|
6538
|
-
import { join as
|
|
6772
|
+
import { join as join52 } from "path";
|
|
6539
6773
|
import { parse as parseJsonc2 } from "jsonc-parser";
|
|
6540
|
-
import { z as
|
|
6541
|
-
var OpencodeMcpLocalServerSchema =
|
|
6542
|
-
type:
|
|
6543
|
-
command:
|
|
6544
|
-
environment:
|
|
6545
|
-
enabled:
|
|
6546
|
-
cwd:
|
|
6774
|
+
import { z as z21 } from "zod/mini";
|
|
6775
|
+
var OpencodeMcpLocalServerSchema = z21.object({
|
|
6776
|
+
type: z21.literal("local"),
|
|
6777
|
+
command: z21.array(z21.string()),
|
|
6778
|
+
environment: z21.optional(z21.record(z21.string(), z21.string())),
|
|
6779
|
+
enabled: z21._default(z21.boolean(), true),
|
|
6780
|
+
cwd: z21.optional(z21.string())
|
|
6547
6781
|
});
|
|
6548
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6549
|
-
type:
|
|
6550
|
-
url:
|
|
6551
|
-
headers:
|
|
6552
|
-
enabled:
|
|
6782
|
+
var OpencodeMcpRemoteServerSchema = z21.object({
|
|
6783
|
+
type: z21.literal("remote"),
|
|
6784
|
+
url: z21.string(),
|
|
6785
|
+
headers: z21.optional(z21.record(z21.string(), z21.string())),
|
|
6786
|
+
enabled: z21._default(z21.boolean(), true)
|
|
6553
6787
|
});
|
|
6554
|
-
var OpencodeMcpServerSchema =
|
|
6788
|
+
var OpencodeMcpServerSchema = z21.union([
|
|
6555
6789
|
OpencodeMcpLocalServerSchema,
|
|
6556
6790
|
OpencodeMcpRemoteServerSchema
|
|
6557
6791
|
]);
|
|
6558
|
-
var OpencodeConfigSchema =
|
|
6559
|
-
$schema:
|
|
6560
|
-
mcp:
|
|
6561
|
-
tools:
|
|
6792
|
+
var OpencodeConfigSchema = z21.looseObject({
|
|
6793
|
+
$schema: z21.optional(z21.string()),
|
|
6794
|
+
mcp: z21.optional(z21.record(z21.string(), OpencodeMcpServerSchema)),
|
|
6795
|
+
tools: z21.optional(z21.record(z21.string(), z21.boolean()))
|
|
6562
6796
|
});
|
|
6563
6797
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6564
6798
|
return Object.fromEntries(
|
|
@@ -6676,7 +6910,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6676
6910
|
static getSettablePaths({ global } = {}) {
|
|
6677
6911
|
if (global) {
|
|
6678
6912
|
return {
|
|
6679
|
-
relativeDirPath:
|
|
6913
|
+
relativeDirPath: join52(".config", "opencode"),
|
|
6680
6914
|
relativeFilePath: "opencode.json"
|
|
6681
6915
|
};
|
|
6682
6916
|
}
|
|
@@ -6691,11 +6925,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6691
6925
|
global = false
|
|
6692
6926
|
}) {
|
|
6693
6927
|
const basePaths = this.getSettablePaths({ global });
|
|
6694
|
-
const jsonDir =
|
|
6928
|
+
const jsonDir = join52(baseDir, basePaths.relativeDirPath);
|
|
6695
6929
|
let fileContent = null;
|
|
6696
6930
|
let relativeFilePath = "opencode.jsonc";
|
|
6697
|
-
const jsoncPath =
|
|
6698
|
-
const jsonPath =
|
|
6931
|
+
const jsoncPath = join52(jsonDir, "opencode.jsonc");
|
|
6932
|
+
const jsonPath = join52(jsonDir, "opencode.json");
|
|
6699
6933
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
6700
6934
|
if (!fileContent) {
|
|
6701
6935
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -6721,11 +6955,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6721
6955
|
global = false
|
|
6722
6956
|
}) {
|
|
6723
6957
|
const basePaths = this.getSettablePaths({ global });
|
|
6724
|
-
const jsonDir =
|
|
6958
|
+
const jsonDir = join52(baseDir, basePaths.relativeDirPath);
|
|
6725
6959
|
let fileContent = null;
|
|
6726
6960
|
let relativeFilePath = "opencode.jsonc";
|
|
6727
|
-
const jsoncPath =
|
|
6728
|
-
const jsonPath =
|
|
6961
|
+
const jsoncPath = join52(jsonDir, "opencode.jsonc");
|
|
6962
|
+
const jsonPath = join52(jsonDir, "opencode.json");
|
|
6729
6963
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
6730
6964
|
if (!fileContent) {
|
|
6731
6965
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -6786,7 +7020,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6786
7020
|
};
|
|
6787
7021
|
|
|
6788
7022
|
// src/features/mcp/roo-mcp.ts
|
|
6789
|
-
import { join as
|
|
7023
|
+
import { join as join53 } from "path";
|
|
6790
7024
|
function isRooMcpServers(value) {
|
|
6791
7025
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
6792
7026
|
}
|
|
@@ -6838,7 +7072,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
6838
7072
|
validate = true
|
|
6839
7073
|
}) {
|
|
6840
7074
|
const fileContent = await readFileContent(
|
|
6841
|
-
|
|
7075
|
+
join53(
|
|
6842
7076
|
baseDir,
|
|
6843
7077
|
this.getSettablePaths().relativeDirPath,
|
|
6844
7078
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6909,7 +7143,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
6909
7143
|
"opencode",
|
|
6910
7144
|
"roo"
|
|
6911
7145
|
];
|
|
6912
|
-
var McpProcessorToolTargetSchema =
|
|
7146
|
+
var McpProcessorToolTargetSchema = z22.enum(mcpProcessorToolTargetTuple);
|
|
6913
7147
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
6914
7148
|
[
|
|
6915
7149
|
"claudecode",
|
|
@@ -7211,25 +7445,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7211
7445
|
};
|
|
7212
7446
|
|
|
7213
7447
|
// src/features/rules/rules-processor.ts
|
|
7214
|
-
import { basename as basename10, join as
|
|
7448
|
+
import { basename as basename10, join as join113, relative as relative5 } from "path";
|
|
7215
7449
|
import { encode } from "@toon-format/toon";
|
|
7216
|
-
import { z as
|
|
7450
|
+
import { z as z54 } from "zod/mini";
|
|
7217
7451
|
|
|
7218
7452
|
// src/constants/general.ts
|
|
7219
7453
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7220
7454
|
|
|
7221
7455
|
// src/features/skills/agentsmd-skill.ts
|
|
7222
|
-
import { join as
|
|
7456
|
+
import { join as join57 } from "path";
|
|
7223
7457
|
|
|
7224
7458
|
// src/features/skills/simulated-skill.ts
|
|
7225
|
-
import { join as
|
|
7226
|
-
import { z as
|
|
7459
|
+
import { join as join56 } from "path";
|
|
7460
|
+
import { z as z23 } from "zod/mini";
|
|
7227
7461
|
|
|
7228
7462
|
// src/features/skills/tool-skill.ts
|
|
7229
|
-
import { join as
|
|
7463
|
+
import { join as join55 } from "path";
|
|
7230
7464
|
|
|
7231
7465
|
// src/types/ai-dir.ts
|
|
7232
|
-
import path2, { basename as basename3, join as
|
|
7466
|
+
import path2, { basename as basename3, join as join54, relative as relative4, resolve as resolve4 } from "path";
|
|
7233
7467
|
var AiDir = class {
|
|
7234
7468
|
/**
|
|
7235
7469
|
* @example "."
|
|
@@ -7323,8 +7557,8 @@ var AiDir = class {
|
|
|
7323
7557
|
* @returns Array of files with their relative paths and buffers
|
|
7324
7558
|
*/
|
|
7325
7559
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7326
|
-
const dirPath =
|
|
7327
|
-
const glob =
|
|
7560
|
+
const dirPath = join54(baseDir, relativeDirPath, dirName);
|
|
7561
|
+
const glob = join54(dirPath, "**", "*");
|
|
7328
7562
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7329
7563
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
7330
7564
|
const files = await Promise.all(
|
|
@@ -7422,8 +7656,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7422
7656
|
}) {
|
|
7423
7657
|
const settablePaths = getSettablePaths({ global });
|
|
7424
7658
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7425
|
-
const skillDirPath =
|
|
7426
|
-
const skillFilePath =
|
|
7659
|
+
const skillDirPath = join55(baseDir, actualRelativeDirPath, dirName);
|
|
7660
|
+
const skillFilePath = join55(skillDirPath, SKILL_FILE_NAME);
|
|
7427
7661
|
if (!await fileExists(skillFilePath)) {
|
|
7428
7662
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7429
7663
|
}
|
|
@@ -7447,16 +7681,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7447
7681
|
}
|
|
7448
7682
|
requireMainFileFrontmatter() {
|
|
7449
7683
|
if (!this.mainFile?.frontmatter) {
|
|
7450
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
7684
|
+
throw new Error(`Frontmatter is not defined in ${join55(this.relativeDirPath, this.dirName)}`);
|
|
7451
7685
|
}
|
|
7452
7686
|
return this.mainFile.frontmatter;
|
|
7453
7687
|
}
|
|
7454
7688
|
};
|
|
7455
7689
|
|
|
7456
7690
|
// src/features/skills/simulated-skill.ts
|
|
7457
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7458
|
-
name:
|
|
7459
|
-
description:
|
|
7691
|
+
var SimulatedSkillFrontmatterSchema = z23.looseObject({
|
|
7692
|
+
name: z23.string(),
|
|
7693
|
+
description: z23.string()
|
|
7460
7694
|
});
|
|
7461
7695
|
var SimulatedSkill = class extends ToolSkill {
|
|
7462
7696
|
frontmatter;
|
|
@@ -7487,7 +7721,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7487
7721
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7488
7722
|
if (!result.success) {
|
|
7489
7723
|
throw new Error(
|
|
7490
|
-
`Invalid frontmatter in ${
|
|
7724
|
+
`Invalid frontmatter in ${join56(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7491
7725
|
);
|
|
7492
7726
|
}
|
|
7493
7727
|
}
|
|
@@ -7545,8 +7779,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7545
7779
|
}) {
|
|
7546
7780
|
const settablePaths = this.getSettablePaths();
|
|
7547
7781
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7548
|
-
const skillDirPath =
|
|
7549
|
-
const skillFilePath =
|
|
7782
|
+
const skillDirPath = join56(baseDir, actualRelativeDirPath, dirName);
|
|
7783
|
+
const skillFilePath = join56(skillDirPath, SKILL_FILE_NAME);
|
|
7550
7784
|
if (!await fileExists(skillFilePath)) {
|
|
7551
7785
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7552
7786
|
}
|
|
@@ -7623,7 +7857,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7623
7857
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7624
7858
|
}
|
|
7625
7859
|
return {
|
|
7626
|
-
relativeDirPath:
|
|
7860
|
+
relativeDirPath: join57(".agents", "skills")
|
|
7627
7861
|
};
|
|
7628
7862
|
}
|
|
7629
7863
|
static async fromDir(params) {
|
|
@@ -7650,11 +7884,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7650
7884
|
};
|
|
7651
7885
|
|
|
7652
7886
|
// src/features/skills/factorydroid-skill.ts
|
|
7653
|
-
import { join as
|
|
7887
|
+
import { join as join58 } from "path";
|
|
7654
7888
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7655
7889
|
static getSettablePaths(_options) {
|
|
7656
7890
|
return {
|
|
7657
|
-
relativeDirPath:
|
|
7891
|
+
relativeDirPath: join58(".factory", "skills")
|
|
7658
7892
|
};
|
|
7659
7893
|
}
|
|
7660
7894
|
static async fromDir(params) {
|
|
@@ -7681,11 +7915,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
7681
7915
|
};
|
|
7682
7916
|
|
|
7683
7917
|
// src/features/skills/skills-processor.ts
|
|
7684
|
-
import { basename as basename5, join as
|
|
7685
|
-
import { z as
|
|
7918
|
+
import { basename as basename5, join as join75 } from "path";
|
|
7919
|
+
import { z as z38 } from "zod/mini";
|
|
7686
7920
|
|
|
7687
7921
|
// src/types/dir-feature-processor.ts
|
|
7688
|
-
import { join as
|
|
7922
|
+
import { join as join59 } from "path";
|
|
7689
7923
|
var DirFeatureProcessor = class {
|
|
7690
7924
|
baseDir;
|
|
7691
7925
|
dryRun;
|
|
@@ -7716,7 +7950,7 @@ var DirFeatureProcessor = class {
|
|
|
7716
7950
|
const mainFile = aiDir.getMainFile();
|
|
7717
7951
|
let mainFileContent;
|
|
7718
7952
|
if (mainFile) {
|
|
7719
|
-
const mainFilePath =
|
|
7953
|
+
const mainFilePath = join59(dirPath, mainFile.name);
|
|
7720
7954
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
7721
7955
|
mainFileContent = addTrailingNewline(content);
|
|
7722
7956
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -7730,7 +7964,7 @@ var DirFeatureProcessor = class {
|
|
|
7730
7964
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
7731
7965
|
otherFileContents.push(contentWithNewline);
|
|
7732
7966
|
if (!dirHasChanges) {
|
|
7733
|
-
const filePath =
|
|
7967
|
+
const filePath = join59(dirPath, file.relativeFilePathToDirPath);
|
|
7734
7968
|
const existingContent = await readFileContentOrNull(filePath);
|
|
7735
7969
|
if (existingContent !== contentWithNewline) {
|
|
7736
7970
|
dirHasChanges = true;
|
|
@@ -7744,22 +7978,22 @@ var DirFeatureProcessor = class {
|
|
|
7744
7978
|
if (this.dryRun) {
|
|
7745
7979
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
7746
7980
|
if (mainFile) {
|
|
7747
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
7748
|
-
changedPaths.push(
|
|
7981
|
+
logger.info(`[DRY RUN] Would write: ${join59(dirPath, mainFile.name)}`);
|
|
7982
|
+
changedPaths.push(join59(relativeDir, mainFile.name));
|
|
7749
7983
|
}
|
|
7750
7984
|
for (const file of otherFiles) {
|
|
7751
|
-
logger.info(`[DRY RUN] Would write: ${
|
|
7752
|
-
changedPaths.push(
|
|
7985
|
+
logger.info(`[DRY RUN] Would write: ${join59(dirPath, file.relativeFilePathToDirPath)}`);
|
|
7986
|
+
changedPaths.push(join59(relativeDir, file.relativeFilePathToDirPath));
|
|
7753
7987
|
}
|
|
7754
7988
|
} else {
|
|
7755
7989
|
await ensureDir(dirPath);
|
|
7756
7990
|
if (mainFile && mainFileContent) {
|
|
7757
|
-
const mainFilePath =
|
|
7991
|
+
const mainFilePath = join59(dirPath, mainFile.name);
|
|
7758
7992
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
7759
|
-
changedPaths.push(
|
|
7993
|
+
changedPaths.push(join59(relativeDir, mainFile.name));
|
|
7760
7994
|
}
|
|
7761
7995
|
for (const [i, file] of otherFiles.entries()) {
|
|
7762
|
-
const filePath =
|
|
7996
|
+
const filePath = join59(dirPath, file.relativeFilePathToDirPath);
|
|
7763
7997
|
const content = otherFileContents[i];
|
|
7764
7998
|
if (content === void 0) {
|
|
7765
7999
|
throw new Error(
|
|
@@ -7767,7 +8001,7 @@ var DirFeatureProcessor = class {
|
|
|
7767
8001
|
);
|
|
7768
8002
|
}
|
|
7769
8003
|
await writeFileContent(filePath, content);
|
|
7770
|
-
changedPaths.push(
|
|
8004
|
+
changedPaths.push(join59(relativeDir, file.relativeFilePathToDirPath));
|
|
7771
8005
|
}
|
|
7772
8006
|
}
|
|
7773
8007
|
changedCount++;
|
|
@@ -7799,38 +8033,38 @@ var DirFeatureProcessor = class {
|
|
|
7799
8033
|
};
|
|
7800
8034
|
|
|
7801
8035
|
// src/features/skills/agentsskills-skill.ts
|
|
7802
|
-
import { join as
|
|
7803
|
-
import { z as
|
|
8036
|
+
import { join as join61 } from "path";
|
|
8037
|
+
import { z as z25 } from "zod/mini";
|
|
7804
8038
|
|
|
7805
8039
|
// src/features/skills/rulesync-skill.ts
|
|
7806
|
-
import { join as
|
|
7807
|
-
import { z as
|
|
7808
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
7809
|
-
name:
|
|
7810
|
-
description:
|
|
7811
|
-
targets:
|
|
7812
|
-
claudecode:
|
|
7813
|
-
|
|
7814
|
-
"allowed-tools":
|
|
8040
|
+
import { join as join60 } from "path";
|
|
8041
|
+
import { z as z24 } from "zod/mini";
|
|
8042
|
+
var RulesyncSkillFrontmatterSchemaInternal = z24.looseObject({
|
|
8043
|
+
name: z24.string(),
|
|
8044
|
+
description: z24.string(),
|
|
8045
|
+
targets: z24._default(RulesyncTargetsSchema, ["*"]),
|
|
8046
|
+
claudecode: z24.optional(
|
|
8047
|
+
z24.looseObject({
|
|
8048
|
+
"allowed-tools": z24.optional(z24.array(z24.string()))
|
|
7815
8049
|
})
|
|
7816
8050
|
),
|
|
7817
|
-
codexcli:
|
|
7818
|
-
|
|
7819
|
-
"short-description":
|
|
8051
|
+
codexcli: z24.optional(
|
|
8052
|
+
z24.looseObject({
|
|
8053
|
+
"short-description": z24.optional(z24.string())
|
|
7820
8054
|
})
|
|
7821
8055
|
),
|
|
7822
|
-
opencode:
|
|
7823
|
-
|
|
7824
|
-
"allowed-tools":
|
|
8056
|
+
opencode: z24.optional(
|
|
8057
|
+
z24.looseObject({
|
|
8058
|
+
"allowed-tools": z24.optional(z24.array(z24.string()))
|
|
7825
8059
|
})
|
|
7826
8060
|
),
|
|
7827
|
-
copilot:
|
|
7828
|
-
|
|
7829
|
-
license:
|
|
8061
|
+
copilot: z24.optional(
|
|
8062
|
+
z24.looseObject({
|
|
8063
|
+
license: z24.optional(z24.string())
|
|
7830
8064
|
})
|
|
7831
8065
|
),
|
|
7832
|
-
cline:
|
|
7833
|
-
roo:
|
|
8066
|
+
cline: z24.optional(z24.looseObject({})),
|
|
8067
|
+
roo: z24.optional(z24.looseObject({}))
|
|
7834
8068
|
});
|
|
7835
8069
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
7836
8070
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -7870,7 +8104,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7870
8104
|
}
|
|
7871
8105
|
getFrontmatter() {
|
|
7872
8106
|
if (!this.mainFile?.frontmatter) {
|
|
7873
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8107
|
+
throw new Error(`Frontmatter is not defined in ${join60(this.relativeDirPath, this.dirName)}`);
|
|
7874
8108
|
}
|
|
7875
8109
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7876
8110
|
return result;
|
|
@@ -7896,8 +8130,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7896
8130
|
dirName,
|
|
7897
8131
|
global = false
|
|
7898
8132
|
}) {
|
|
7899
|
-
const skillDirPath =
|
|
7900
|
-
const skillFilePath =
|
|
8133
|
+
const skillDirPath = join60(baseDir, relativeDirPath, dirName);
|
|
8134
|
+
const skillFilePath = join60(skillDirPath, SKILL_FILE_NAME);
|
|
7901
8135
|
if (!await fileExists(skillFilePath)) {
|
|
7902
8136
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7903
8137
|
}
|
|
@@ -7927,14 +8161,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7927
8161
|
};
|
|
7928
8162
|
|
|
7929
8163
|
// src/features/skills/agentsskills-skill.ts
|
|
7930
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
7931
|
-
name:
|
|
7932
|
-
description:
|
|
8164
|
+
var AgentsSkillsSkillFrontmatterSchema = z25.looseObject({
|
|
8165
|
+
name: z25.string(),
|
|
8166
|
+
description: z25.string()
|
|
7933
8167
|
});
|
|
7934
8168
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
7935
8169
|
constructor({
|
|
7936
8170
|
baseDir = process.cwd(),
|
|
7937
|
-
relativeDirPath =
|
|
8171
|
+
relativeDirPath = join61(".agents", "skills"),
|
|
7938
8172
|
dirName,
|
|
7939
8173
|
frontmatter,
|
|
7940
8174
|
body,
|
|
@@ -7966,7 +8200,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7966
8200
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
7967
8201
|
}
|
|
7968
8202
|
return {
|
|
7969
|
-
relativeDirPath:
|
|
8203
|
+
relativeDirPath: join61(".agents", "skills")
|
|
7970
8204
|
};
|
|
7971
8205
|
}
|
|
7972
8206
|
getFrontmatter() {
|
|
@@ -8045,9 +8279,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8045
8279
|
});
|
|
8046
8280
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8047
8281
|
if (!result.success) {
|
|
8048
|
-
const skillDirPath =
|
|
8282
|
+
const skillDirPath = join61(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8049
8283
|
throw new Error(
|
|
8050
|
-
`Invalid frontmatter in ${
|
|
8284
|
+
`Invalid frontmatter in ${join61(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8051
8285
|
);
|
|
8052
8286
|
}
|
|
8053
8287
|
return new _AgentsSkillsSkill({
|
|
@@ -8082,16 +8316,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8082
8316
|
};
|
|
8083
8317
|
|
|
8084
8318
|
// src/features/skills/antigravity-skill.ts
|
|
8085
|
-
import { join as
|
|
8086
|
-
import { z as
|
|
8087
|
-
var AntigravitySkillFrontmatterSchema =
|
|
8088
|
-
name:
|
|
8089
|
-
description:
|
|
8319
|
+
import { join as join62 } from "path";
|
|
8320
|
+
import { z as z26 } from "zod/mini";
|
|
8321
|
+
var AntigravitySkillFrontmatterSchema = z26.looseObject({
|
|
8322
|
+
name: z26.string(),
|
|
8323
|
+
description: z26.string()
|
|
8090
8324
|
});
|
|
8091
8325
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8092
8326
|
constructor({
|
|
8093
8327
|
baseDir = process.cwd(),
|
|
8094
|
-
relativeDirPath =
|
|
8328
|
+
relativeDirPath = join62(".agent", "skills"),
|
|
8095
8329
|
dirName,
|
|
8096
8330
|
frontmatter,
|
|
8097
8331
|
body,
|
|
@@ -8123,11 +8357,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8123
8357
|
} = {}) {
|
|
8124
8358
|
if (global) {
|
|
8125
8359
|
return {
|
|
8126
|
-
relativeDirPath:
|
|
8360
|
+
relativeDirPath: join62(".gemini", "antigravity", "skills")
|
|
8127
8361
|
};
|
|
8128
8362
|
}
|
|
8129
8363
|
return {
|
|
8130
|
-
relativeDirPath:
|
|
8364
|
+
relativeDirPath: join62(".agent", "skills")
|
|
8131
8365
|
};
|
|
8132
8366
|
}
|
|
8133
8367
|
getFrontmatter() {
|
|
@@ -8206,9 +8440,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8206
8440
|
});
|
|
8207
8441
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8208
8442
|
if (!result.success) {
|
|
8209
|
-
const skillDirPath =
|
|
8443
|
+
const skillDirPath = join62(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8210
8444
|
throw new Error(
|
|
8211
|
-
`Invalid frontmatter in ${
|
|
8445
|
+
`Invalid frontmatter in ${join62(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8212
8446
|
);
|
|
8213
8447
|
}
|
|
8214
8448
|
return new _AntigravitySkill({
|
|
@@ -8242,17 +8476,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8242
8476
|
};
|
|
8243
8477
|
|
|
8244
8478
|
// src/features/skills/claudecode-skill.ts
|
|
8245
|
-
import { join as
|
|
8246
|
-
import { z as
|
|
8247
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
8248
|
-
name:
|
|
8249
|
-
description:
|
|
8250
|
-
"allowed-tools":
|
|
8479
|
+
import { join as join63 } from "path";
|
|
8480
|
+
import { z as z27 } from "zod/mini";
|
|
8481
|
+
var ClaudecodeSkillFrontmatterSchema = z27.looseObject({
|
|
8482
|
+
name: z27.string(),
|
|
8483
|
+
description: z27.string(),
|
|
8484
|
+
"allowed-tools": z27.optional(z27.array(z27.string()))
|
|
8251
8485
|
});
|
|
8252
8486
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8253
8487
|
constructor({
|
|
8254
8488
|
baseDir = process.cwd(),
|
|
8255
|
-
relativeDirPath =
|
|
8489
|
+
relativeDirPath = join63(".claude", "skills"),
|
|
8256
8490
|
dirName,
|
|
8257
8491
|
frontmatter,
|
|
8258
8492
|
body,
|
|
@@ -8283,7 +8517,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8283
8517
|
global: _global = false
|
|
8284
8518
|
} = {}) {
|
|
8285
8519
|
return {
|
|
8286
|
-
relativeDirPath:
|
|
8520
|
+
relativeDirPath: join63(".claude", "skills")
|
|
8287
8521
|
};
|
|
8288
8522
|
}
|
|
8289
8523
|
getFrontmatter() {
|
|
@@ -8368,9 +8602,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8368
8602
|
});
|
|
8369
8603
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8370
8604
|
if (!result.success) {
|
|
8371
|
-
const skillDirPath =
|
|
8605
|
+
const skillDirPath = join63(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8372
8606
|
throw new Error(
|
|
8373
|
-
`Invalid frontmatter in ${
|
|
8607
|
+
`Invalid frontmatter in ${join63(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8374
8608
|
);
|
|
8375
8609
|
}
|
|
8376
8610
|
return new _ClaudecodeSkill({
|
|
@@ -8404,16 +8638,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8404
8638
|
};
|
|
8405
8639
|
|
|
8406
8640
|
// src/features/skills/cline-skill.ts
|
|
8407
|
-
import { join as
|
|
8408
|
-
import { z as
|
|
8409
|
-
var ClineSkillFrontmatterSchema =
|
|
8410
|
-
name:
|
|
8411
|
-
description:
|
|
8641
|
+
import { join as join64 } from "path";
|
|
8642
|
+
import { z as z28 } from "zod/mini";
|
|
8643
|
+
var ClineSkillFrontmatterSchema = z28.looseObject({
|
|
8644
|
+
name: z28.string(),
|
|
8645
|
+
description: z28.string()
|
|
8412
8646
|
});
|
|
8413
8647
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8414
8648
|
constructor({
|
|
8415
8649
|
baseDir = process.cwd(),
|
|
8416
|
-
relativeDirPath =
|
|
8650
|
+
relativeDirPath = join64(".cline", "skills"),
|
|
8417
8651
|
dirName,
|
|
8418
8652
|
frontmatter,
|
|
8419
8653
|
body,
|
|
@@ -8442,7 +8676,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8442
8676
|
}
|
|
8443
8677
|
static getSettablePaths(_options = {}) {
|
|
8444
8678
|
return {
|
|
8445
|
-
relativeDirPath:
|
|
8679
|
+
relativeDirPath: join64(".cline", "skills")
|
|
8446
8680
|
};
|
|
8447
8681
|
}
|
|
8448
8682
|
getFrontmatter() {
|
|
@@ -8529,13 +8763,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8529
8763
|
});
|
|
8530
8764
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8531
8765
|
if (!result.success) {
|
|
8532
|
-
const skillDirPath =
|
|
8766
|
+
const skillDirPath = join64(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8533
8767
|
throw new Error(
|
|
8534
|
-
`Invalid frontmatter in ${
|
|
8768
|
+
`Invalid frontmatter in ${join64(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8535
8769
|
);
|
|
8536
8770
|
}
|
|
8537
8771
|
if (result.data.name !== loaded.dirName) {
|
|
8538
|
-
const skillFilePath =
|
|
8772
|
+
const skillFilePath = join64(
|
|
8539
8773
|
loaded.baseDir,
|
|
8540
8774
|
loaded.relativeDirPath,
|
|
8541
8775
|
loaded.dirName,
|
|
@@ -8576,21 +8810,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8576
8810
|
};
|
|
8577
8811
|
|
|
8578
8812
|
// src/features/skills/codexcli-skill.ts
|
|
8579
|
-
import { join as
|
|
8580
|
-
import { z as
|
|
8581
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8582
|
-
name:
|
|
8583
|
-
description:
|
|
8584
|
-
metadata:
|
|
8585
|
-
|
|
8586
|
-
"short-description":
|
|
8813
|
+
import { join as join65 } from "path";
|
|
8814
|
+
import { z as z29 } from "zod/mini";
|
|
8815
|
+
var CodexCliSkillFrontmatterSchema = z29.looseObject({
|
|
8816
|
+
name: z29.string(),
|
|
8817
|
+
description: z29.string(),
|
|
8818
|
+
metadata: z29.optional(
|
|
8819
|
+
z29.looseObject({
|
|
8820
|
+
"short-description": z29.optional(z29.string())
|
|
8587
8821
|
})
|
|
8588
8822
|
)
|
|
8589
8823
|
});
|
|
8590
8824
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8591
8825
|
constructor({
|
|
8592
8826
|
baseDir = process.cwd(),
|
|
8593
|
-
relativeDirPath =
|
|
8827
|
+
relativeDirPath = join65(".codex", "skills"),
|
|
8594
8828
|
dirName,
|
|
8595
8829
|
frontmatter,
|
|
8596
8830
|
body,
|
|
@@ -8621,7 +8855,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8621
8855
|
global: _global = false
|
|
8622
8856
|
} = {}) {
|
|
8623
8857
|
return {
|
|
8624
|
-
relativeDirPath:
|
|
8858
|
+
relativeDirPath: join65(".codex", "skills")
|
|
8625
8859
|
};
|
|
8626
8860
|
}
|
|
8627
8861
|
getFrontmatter() {
|
|
@@ -8710,9 +8944,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8710
8944
|
});
|
|
8711
8945
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8712
8946
|
if (!result.success) {
|
|
8713
|
-
const skillDirPath =
|
|
8947
|
+
const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8714
8948
|
throw new Error(
|
|
8715
|
-
`Invalid frontmatter in ${
|
|
8949
|
+
`Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8716
8950
|
);
|
|
8717
8951
|
}
|
|
8718
8952
|
return new _CodexCliSkill({
|
|
@@ -8746,17 +8980,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8746
8980
|
};
|
|
8747
8981
|
|
|
8748
8982
|
// src/features/skills/copilot-skill.ts
|
|
8749
|
-
import { join as
|
|
8750
|
-
import { z as
|
|
8751
|
-
var CopilotSkillFrontmatterSchema =
|
|
8752
|
-
name:
|
|
8753
|
-
description:
|
|
8754
|
-
license:
|
|
8983
|
+
import { join as join66 } from "path";
|
|
8984
|
+
import { z as z30 } from "zod/mini";
|
|
8985
|
+
var CopilotSkillFrontmatterSchema = z30.looseObject({
|
|
8986
|
+
name: z30.string(),
|
|
8987
|
+
description: z30.string(),
|
|
8988
|
+
license: z30.optional(z30.string())
|
|
8755
8989
|
});
|
|
8756
8990
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
8757
8991
|
constructor({
|
|
8758
8992
|
baseDir = process.cwd(),
|
|
8759
|
-
relativeDirPath =
|
|
8993
|
+
relativeDirPath = join66(".github", "skills"),
|
|
8760
8994
|
dirName,
|
|
8761
8995
|
frontmatter,
|
|
8762
8996
|
body,
|
|
@@ -8788,7 +9022,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8788
9022
|
throw new Error("CopilotSkill does not support global mode.");
|
|
8789
9023
|
}
|
|
8790
9024
|
return {
|
|
8791
|
-
relativeDirPath:
|
|
9025
|
+
relativeDirPath: join66(".github", "skills")
|
|
8792
9026
|
};
|
|
8793
9027
|
}
|
|
8794
9028
|
getFrontmatter() {
|
|
@@ -8873,9 +9107,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8873
9107
|
});
|
|
8874
9108
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8875
9109
|
if (!result.success) {
|
|
8876
|
-
const skillDirPath =
|
|
9110
|
+
const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8877
9111
|
throw new Error(
|
|
8878
|
-
`Invalid frontmatter in ${
|
|
9112
|
+
`Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8879
9113
|
);
|
|
8880
9114
|
}
|
|
8881
9115
|
return new _CopilotSkill({
|
|
@@ -8910,16 +9144,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8910
9144
|
};
|
|
8911
9145
|
|
|
8912
9146
|
// src/features/skills/cursor-skill.ts
|
|
8913
|
-
import { join as
|
|
8914
|
-
import { z as
|
|
8915
|
-
var CursorSkillFrontmatterSchema =
|
|
8916
|
-
name:
|
|
8917
|
-
description:
|
|
9147
|
+
import { join as join67 } from "path";
|
|
9148
|
+
import { z as z31 } from "zod/mini";
|
|
9149
|
+
var CursorSkillFrontmatterSchema = z31.looseObject({
|
|
9150
|
+
name: z31.string(),
|
|
9151
|
+
description: z31.string()
|
|
8918
9152
|
});
|
|
8919
9153
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
8920
9154
|
constructor({
|
|
8921
9155
|
baseDir = process.cwd(),
|
|
8922
|
-
relativeDirPath =
|
|
9156
|
+
relativeDirPath = join67(".cursor", "skills"),
|
|
8923
9157
|
dirName,
|
|
8924
9158
|
frontmatter,
|
|
8925
9159
|
body,
|
|
@@ -8948,7 +9182,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8948
9182
|
}
|
|
8949
9183
|
static getSettablePaths(_options) {
|
|
8950
9184
|
return {
|
|
8951
|
-
relativeDirPath:
|
|
9185
|
+
relativeDirPath: join67(".cursor", "skills")
|
|
8952
9186
|
};
|
|
8953
9187
|
}
|
|
8954
9188
|
getFrontmatter() {
|
|
@@ -9027,9 +9261,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9027
9261
|
});
|
|
9028
9262
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9029
9263
|
if (!result.success) {
|
|
9030
|
-
const skillDirPath =
|
|
9264
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9031
9265
|
throw new Error(
|
|
9032
|
-
`Invalid frontmatter in ${
|
|
9266
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9033
9267
|
);
|
|
9034
9268
|
}
|
|
9035
9269
|
return new _CursorSkill({
|
|
@@ -9064,11 +9298,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9064
9298
|
};
|
|
9065
9299
|
|
|
9066
9300
|
// src/features/skills/geminicli-skill.ts
|
|
9067
|
-
import { join as
|
|
9068
|
-
import { z as
|
|
9069
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
9070
|
-
name:
|
|
9071
|
-
description:
|
|
9301
|
+
import { join as join68 } from "path";
|
|
9302
|
+
import { z as z32 } from "zod/mini";
|
|
9303
|
+
var GeminiCliSkillFrontmatterSchema = z32.looseObject({
|
|
9304
|
+
name: z32.string(),
|
|
9305
|
+
description: z32.string()
|
|
9072
9306
|
});
|
|
9073
9307
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9074
9308
|
constructor({
|
|
@@ -9104,7 +9338,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9104
9338
|
global: _global = false
|
|
9105
9339
|
} = {}) {
|
|
9106
9340
|
return {
|
|
9107
|
-
relativeDirPath:
|
|
9341
|
+
relativeDirPath: join68(".gemini", "skills")
|
|
9108
9342
|
};
|
|
9109
9343
|
}
|
|
9110
9344
|
getFrontmatter() {
|
|
@@ -9183,9 +9417,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9183
9417
|
});
|
|
9184
9418
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9185
9419
|
if (!result.success) {
|
|
9186
|
-
const skillDirPath =
|
|
9420
|
+
const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9187
9421
|
throw new Error(
|
|
9188
|
-
`Invalid frontmatter in ${
|
|
9422
|
+
`Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9189
9423
|
);
|
|
9190
9424
|
}
|
|
9191
9425
|
return new _GeminiCliSkill({
|
|
@@ -9220,16 +9454,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9220
9454
|
};
|
|
9221
9455
|
|
|
9222
9456
|
// src/features/skills/kilo-skill.ts
|
|
9223
|
-
import { join as
|
|
9224
|
-
import { z as
|
|
9225
|
-
var KiloSkillFrontmatterSchema =
|
|
9226
|
-
name:
|
|
9227
|
-
description:
|
|
9457
|
+
import { join as join69 } from "path";
|
|
9458
|
+
import { z as z33 } from "zod/mini";
|
|
9459
|
+
var KiloSkillFrontmatterSchema = z33.looseObject({
|
|
9460
|
+
name: z33.string(),
|
|
9461
|
+
description: z33.string()
|
|
9228
9462
|
});
|
|
9229
9463
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
9230
9464
|
constructor({
|
|
9231
9465
|
baseDir = process.cwd(),
|
|
9232
|
-
relativeDirPath =
|
|
9466
|
+
relativeDirPath = join69(".kilocode", "skills"),
|
|
9233
9467
|
dirName,
|
|
9234
9468
|
frontmatter,
|
|
9235
9469
|
body,
|
|
@@ -9260,7 +9494,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9260
9494
|
global: _global = false
|
|
9261
9495
|
} = {}) {
|
|
9262
9496
|
return {
|
|
9263
|
-
relativeDirPath:
|
|
9497
|
+
relativeDirPath: join69(".kilocode", "skills")
|
|
9264
9498
|
};
|
|
9265
9499
|
}
|
|
9266
9500
|
getFrontmatter() {
|
|
@@ -9347,13 +9581,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9347
9581
|
});
|
|
9348
9582
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9349
9583
|
if (!result.success) {
|
|
9350
|
-
const skillDirPath =
|
|
9584
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9351
9585
|
throw new Error(
|
|
9352
|
-
`Invalid frontmatter in ${
|
|
9586
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9353
9587
|
);
|
|
9354
9588
|
}
|
|
9355
9589
|
if (result.data.name !== loaded.dirName) {
|
|
9356
|
-
const skillFilePath =
|
|
9590
|
+
const skillFilePath = join69(
|
|
9357
9591
|
loaded.baseDir,
|
|
9358
9592
|
loaded.relativeDirPath,
|
|
9359
9593
|
loaded.dirName,
|
|
@@ -9394,16 +9628,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9394
9628
|
};
|
|
9395
9629
|
|
|
9396
9630
|
// src/features/skills/kiro-skill.ts
|
|
9397
|
-
import { join as
|
|
9398
|
-
import { z as
|
|
9399
|
-
var KiroSkillFrontmatterSchema =
|
|
9400
|
-
name:
|
|
9401
|
-
description:
|
|
9631
|
+
import { join as join70 } from "path";
|
|
9632
|
+
import { z as z34 } from "zod/mini";
|
|
9633
|
+
var KiroSkillFrontmatterSchema = z34.looseObject({
|
|
9634
|
+
name: z34.string(),
|
|
9635
|
+
description: z34.string()
|
|
9402
9636
|
});
|
|
9403
9637
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
9404
9638
|
constructor({
|
|
9405
9639
|
baseDir = process.cwd(),
|
|
9406
|
-
relativeDirPath =
|
|
9640
|
+
relativeDirPath = join70(".kiro", "skills"),
|
|
9407
9641
|
dirName,
|
|
9408
9642
|
frontmatter,
|
|
9409
9643
|
body,
|
|
@@ -9435,7 +9669,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9435
9669
|
throw new Error("KiroSkill does not support global mode.");
|
|
9436
9670
|
}
|
|
9437
9671
|
return {
|
|
9438
|
-
relativeDirPath:
|
|
9672
|
+
relativeDirPath: join70(".kiro", "skills")
|
|
9439
9673
|
};
|
|
9440
9674
|
}
|
|
9441
9675
|
getFrontmatter() {
|
|
@@ -9522,13 +9756,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9522
9756
|
});
|
|
9523
9757
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9524
9758
|
if (!result.success) {
|
|
9525
|
-
const skillDirPath =
|
|
9759
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9526
9760
|
throw new Error(
|
|
9527
|
-
`Invalid frontmatter in ${
|
|
9761
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9528
9762
|
);
|
|
9529
9763
|
}
|
|
9530
9764
|
if (result.data.name !== loaded.dirName) {
|
|
9531
|
-
const skillFilePath =
|
|
9765
|
+
const skillFilePath = join70(
|
|
9532
9766
|
loaded.baseDir,
|
|
9533
9767
|
loaded.relativeDirPath,
|
|
9534
9768
|
loaded.dirName,
|
|
@@ -9570,17 +9804,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9570
9804
|
};
|
|
9571
9805
|
|
|
9572
9806
|
// src/features/skills/opencode-skill.ts
|
|
9573
|
-
import { join as
|
|
9574
|
-
import { z as
|
|
9575
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
9576
|
-
name:
|
|
9577
|
-
description:
|
|
9578
|
-
"allowed-tools":
|
|
9807
|
+
import { join as join71 } from "path";
|
|
9808
|
+
import { z as z35 } from "zod/mini";
|
|
9809
|
+
var OpenCodeSkillFrontmatterSchema = z35.looseObject({
|
|
9810
|
+
name: z35.string(),
|
|
9811
|
+
description: z35.string(),
|
|
9812
|
+
"allowed-tools": z35.optional(z35.array(z35.string()))
|
|
9579
9813
|
});
|
|
9580
9814
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
9581
9815
|
constructor({
|
|
9582
9816
|
baseDir = process.cwd(),
|
|
9583
|
-
relativeDirPath =
|
|
9817
|
+
relativeDirPath = join71(".opencode", "skill"),
|
|
9584
9818
|
dirName,
|
|
9585
9819
|
frontmatter,
|
|
9586
9820
|
body,
|
|
@@ -9609,7 +9843,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9609
9843
|
}
|
|
9610
9844
|
static getSettablePaths({ global = false } = {}) {
|
|
9611
9845
|
return {
|
|
9612
|
-
relativeDirPath: global ?
|
|
9846
|
+
relativeDirPath: global ? join71(".config", "opencode", "skill") : join71(".opencode", "skill")
|
|
9613
9847
|
};
|
|
9614
9848
|
}
|
|
9615
9849
|
getFrontmatter() {
|
|
@@ -9694,9 +9928,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9694
9928
|
});
|
|
9695
9929
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9696
9930
|
if (!result.success) {
|
|
9697
|
-
const skillDirPath =
|
|
9931
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9698
9932
|
throw new Error(
|
|
9699
|
-
`Invalid frontmatter in ${
|
|
9933
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9700
9934
|
);
|
|
9701
9935
|
}
|
|
9702
9936
|
return new _OpenCodeSkill({
|
|
@@ -9730,16 +9964,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9730
9964
|
};
|
|
9731
9965
|
|
|
9732
9966
|
// src/features/skills/replit-skill.ts
|
|
9733
|
-
import { join as
|
|
9734
|
-
import { z as
|
|
9735
|
-
var ReplitSkillFrontmatterSchema =
|
|
9736
|
-
name:
|
|
9737
|
-
description:
|
|
9967
|
+
import { join as join72 } from "path";
|
|
9968
|
+
import { z as z36 } from "zod/mini";
|
|
9969
|
+
var ReplitSkillFrontmatterSchema = z36.looseObject({
|
|
9970
|
+
name: z36.string(),
|
|
9971
|
+
description: z36.string()
|
|
9738
9972
|
});
|
|
9739
9973
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
9740
9974
|
constructor({
|
|
9741
9975
|
baseDir = process.cwd(),
|
|
9742
|
-
relativeDirPath =
|
|
9976
|
+
relativeDirPath = join72(".agents", "skills"),
|
|
9743
9977
|
dirName,
|
|
9744
9978
|
frontmatter,
|
|
9745
9979
|
body,
|
|
@@ -9771,7 +10005,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9771
10005
|
throw new Error("ReplitSkill does not support global mode.");
|
|
9772
10006
|
}
|
|
9773
10007
|
return {
|
|
9774
|
-
relativeDirPath:
|
|
10008
|
+
relativeDirPath: join72(".agents", "skills")
|
|
9775
10009
|
};
|
|
9776
10010
|
}
|
|
9777
10011
|
getFrontmatter() {
|
|
@@ -9850,9 +10084,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9850
10084
|
});
|
|
9851
10085
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9852
10086
|
if (!result.success) {
|
|
9853
|
-
const skillDirPath =
|
|
10087
|
+
const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9854
10088
|
throw new Error(
|
|
9855
|
-
`Invalid frontmatter in ${
|
|
10089
|
+
`Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9856
10090
|
);
|
|
9857
10091
|
}
|
|
9858
10092
|
return new _ReplitSkill({
|
|
@@ -9887,16 +10121,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9887
10121
|
};
|
|
9888
10122
|
|
|
9889
10123
|
// src/features/skills/roo-skill.ts
|
|
9890
|
-
import { join as
|
|
9891
|
-
import { z as
|
|
9892
|
-
var RooSkillFrontmatterSchema =
|
|
9893
|
-
name:
|
|
9894
|
-
description:
|
|
10124
|
+
import { join as join73 } from "path";
|
|
10125
|
+
import { z as z37 } from "zod/mini";
|
|
10126
|
+
var RooSkillFrontmatterSchema = z37.looseObject({
|
|
10127
|
+
name: z37.string(),
|
|
10128
|
+
description: z37.string()
|
|
9895
10129
|
});
|
|
9896
10130
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
9897
10131
|
constructor({
|
|
9898
10132
|
baseDir = process.cwd(),
|
|
9899
|
-
relativeDirPath =
|
|
10133
|
+
relativeDirPath = join73(".roo", "skills"),
|
|
9900
10134
|
dirName,
|
|
9901
10135
|
frontmatter,
|
|
9902
10136
|
body,
|
|
@@ -9927,7 +10161,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9927
10161
|
global: _global = false
|
|
9928
10162
|
} = {}) {
|
|
9929
10163
|
return {
|
|
9930
|
-
relativeDirPath:
|
|
10164
|
+
relativeDirPath: join73(".roo", "skills")
|
|
9931
10165
|
};
|
|
9932
10166
|
}
|
|
9933
10167
|
getFrontmatter() {
|
|
@@ -10014,13 +10248,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10014
10248
|
});
|
|
10015
10249
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10016
10250
|
if (!result.success) {
|
|
10017
|
-
const skillDirPath =
|
|
10251
|
+
const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10018
10252
|
throw new Error(
|
|
10019
|
-
`Invalid frontmatter in ${
|
|
10253
|
+
`Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10020
10254
|
);
|
|
10021
10255
|
}
|
|
10022
10256
|
if (result.data.name !== loaded.dirName) {
|
|
10023
|
-
const skillFilePath =
|
|
10257
|
+
const skillFilePath = join73(
|
|
10024
10258
|
loaded.baseDir,
|
|
10025
10259
|
loaded.relativeDirPath,
|
|
10026
10260
|
loaded.dirName,
|
|
@@ -10061,14 +10295,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10061
10295
|
};
|
|
10062
10296
|
|
|
10063
10297
|
// src/features/skills/skills-utils.ts
|
|
10064
|
-
import { basename as basename4, join as
|
|
10298
|
+
import { basename as basename4, join as join74 } from "path";
|
|
10065
10299
|
async function getLocalSkillDirNames(baseDir) {
|
|
10066
|
-
const skillsDir =
|
|
10300
|
+
const skillsDir = join74(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10067
10301
|
const names = /* @__PURE__ */ new Set();
|
|
10068
10302
|
if (!await directoryExists(skillsDir)) {
|
|
10069
10303
|
return names;
|
|
10070
10304
|
}
|
|
10071
|
-
const dirPaths = await findFilesByGlobs(
|
|
10305
|
+
const dirPaths = await findFilesByGlobs(join74(skillsDir, "*"), { type: "dir" });
|
|
10072
10306
|
for (const dirPath of dirPaths) {
|
|
10073
10307
|
const name = basename4(dirPath);
|
|
10074
10308
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -10096,7 +10330,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10096
10330
|
"replit",
|
|
10097
10331
|
"roo"
|
|
10098
10332
|
];
|
|
10099
|
-
var SkillsProcessorToolTargetSchema =
|
|
10333
|
+
var SkillsProcessorToolTargetSchema = z38.enum(skillsProcessorToolTargetTuple);
|
|
10100
10334
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10101
10335
|
[
|
|
10102
10336
|
"agentsmd",
|
|
@@ -10297,10 +10531,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10297
10531
|
)
|
|
10298
10532
|
);
|
|
10299
10533
|
const localSkillNames = new Set(localDirNames);
|
|
10300
|
-
const curatedDirPath =
|
|
10534
|
+
const curatedDirPath = join75(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
10301
10535
|
let curatedSkills = [];
|
|
10302
10536
|
if (await directoryExists(curatedDirPath)) {
|
|
10303
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
10537
|
+
const curatedDirPaths = await findFilesByGlobs(join75(curatedDirPath, "*"), { type: "dir" });
|
|
10304
10538
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
10305
10539
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
10306
10540
|
if (localSkillNames.has(name)) {
|
|
@@ -10334,8 +10568,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10334
10568
|
async loadToolDirs() {
|
|
10335
10569
|
const factory = this.getFactory(this.toolTarget);
|
|
10336
10570
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10337
|
-
const skillsDirPath =
|
|
10338
|
-
const dirPaths = await findFilesByGlobs(
|
|
10571
|
+
const skillsDirPath = join75(this.baseDir, paths.relativeDirPath);
|
|
10572
|
+
const dirPaths = await findFilesByGlobs(join75(skillsDirPath, "*"), { type: "dir" });
|
|
10339
10573
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
10340
10574
|
const toolSkills = await Promise.all(
|
|
10341
10575
|
dirNames.map(
|
|
@@ -10352,8 +10586,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10352
10586
|
async loadToolDirsToDelete() {
|
|
10353
10587
|
const factory = this.getFactory(this.toolTarget);
|
|
10354
10588
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10355
|
-
const skillsDirPath =
|
|
10356
|
-
const dirPaths = await findFilesByGlobs(
|
|
10589
|
+
const skillsDirPath = join75(this.baseDir, paths.relativeDirPath);
|
|
10590
|
+
const dirPaths = await findFilesByGlobs(join75(skillsDirPath, "*"), { type: "dir" });
|
|
10357
10591
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
10358
10592
|
const toolSkills = dirNames.map(
|
|
10359
10593
|
(dirName) => factory.class.forDeletion({
|
|
@@ -10415,11 +10649,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10415
10649
|
};
|
|
10416
10650
|
|
|
10417
10651
|
// src/features/subagents/agentsmd-subagent.ts
|
|
10418
|
-
import { join as
|
|
10652
|
+
import { join as join77 } from "path";
|
|
10419
10653
|
|
|
10420
10654
|
// src/features/subagents/simulated-subagent.ts
|
|
10421
|
-
import { basename as basename6, join as
|
|
10422
|
-
import { z as
|
|
10655
|
+
import { basename as basename6, join as join76 } from "path";
|
|
10656
|
+
import { z as z39 } from "zod/mini";
|
|
10423
10657
|
|
|
10424
10658
|
// src/features/subagents/tool-subagent.ts
|
|
10425
10659
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -10471,9 +10705,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
10471
10705
|
};
|
|
10472
10706
|
|
|
10473
10707
|
// src/features/subagents/simulated-subagent.ts
|
|
10474
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
10475
|
-
name:
|
|
10476
|
-
description:
|
|
10708
|
+
var SimulatedSubagentFrontmatterSchema = z39.object({
|
|
10709
|
+
name: z39.string(),
|
|
10710
|
+
description: z39.string()
|
|
10477
10711
|
});
|
|
10478
10712
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
10479
10713
|
frontmatter;
|
|
@@ -10483,7 +10717,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10483
10717
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10484
10718
|
if (!result.success) {
|
|
10485
10719
|
throw new Error(
|
|
10486
|
-
`Invalid frontmatter in ${
|
|
10720
|
+
`Invalid frontmatter in ${join76(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10487
10721
|
);
|
|
10488
10722
|
}
|
|
10489
10723
|
}
|
|
@@ -10534,7 +10768,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10534
10768
|
return {
|
|
10535
10769
|
success: false,
|
|
10536
10770
|
error: new Error(
|
|
10537
|
-
`Invalid frontmatter in ${
|
|
10771
|
+
`Invalid frontmatter in ${join76(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10538
10772
|
)
|
|
10539
10773
|
};
|
|
10540
10774
|
}
|
|
@@ -10544,7 +10778,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10544
10778
|
relativeFilePath,
|
|
10545
10779
|
validate = true
|
|
10546
10780
|
}) {
|
|
10547
|
-
const filePath =
|
|
10781
|
+
const filePath = join76(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
10548
10782
|
const fileContent = await readFileContent(filePath);
|
|
10549
10783
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10550
10784
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10580,7 +10814,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10580
10814
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
10581
10815
|
static getSettablePaths() {
|
|
10582
10816
|
return {
|
|
10583
|
-
relativeDirPath:
|
|
10817
|
+
relativeDirPath: join77(".agents", "subagents")
|
|
10584
10818
|
};
|
|
10585
10819
|
}
|
|
10586
10820
|
static async fromFile(params) {
|
|
@@ -10603,11 +10837,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
10603
10837
|
};
|
|
10604
10838
|
|
|
10605
10839
|
// src/features/subagents/factorydroid-subagent.ts
|
|
10606
|
-
import { join as
|
|
10840
|
+
import { join as join78 } from "path";
|
|
10607
10841
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
10608
10842
|
static getSettablePaths(_options) {
|
|
10609
10843
|
return {
|
|
10610
|
-
relativeDirPath:
|
|
10844
|
+
relativeDirPath: join78(".factory", "droids")
|
|
10611
10845
|
};
|
|
10612
10846
|
}
|
|
10613
10847
|
static async fromFile(params) {
|
|
@@ -10630,11 +10864,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
10630
10864
|
};
|
|
10631
10865
|
|
|
10632
10866
|
// src/features/subagents/geminicli-subagent.ts
|
|
10633
|
-
import { join as
|
|
10867
|
+
import { join as join79 } from "path";
|
|
10634
10868
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
10635
10869
|
static getSettablePaths() {
|
|
10636
10870
|
return {
|
|
10637
|
-
relativeDirPath:
|
|
10871
|
+
relativeDirPath: join79(".gemini", "subagents")
|
|
10638
10872
|
};
|
|
10639
10873
|
}
|
|
10640
10874
|
static async fromFile(params) {
|
|
@@ -10657,11 +10891,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
10657
10891
|
};
|
|
10658
10892
|
|
|
10659
10893
|
// src/features/subagents/roo-subagent.ts
|
|
10660
|
-
import { join as
|
|
10894
|
+
import { join as join80 } from "path";
|
|
10661
10895
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
10662
10896
|
static getSettablePaths() {
|
|
10663
10897
|
return {
|
|
10664
|
-
relativeDirPath:
|
|
10898
|
+
relativeDirPath: join80(".roo", "subagents")
|
|
10665
10899
|
};
|
|
10666
10900
|
}
|
|
10667
10901
|
static async fromFile(params) {
|
|
@@ -10684,20 +10918,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
10684
10918
|
};
|
|
10685
10919
|
|
|
10686
10920
|
// src/features/subagents/subagents-processor.ts
|
|
10687
|
-
import { basename as basename9, join as
|
|
10688
|
-
import { z as
|
|
10921
|
+
import { basename as basename9, join as join88 } from "path";
|
|
10922
|
+
import { z as z47 } from "zod/mini";
|
|
10689
10923
|
|
|
10690
10924
|
// src/features/subagents/claudecode-subagent.ts
|
|
10691
|
-
import { join as
|
|
10692
|
-
import { z as
|
|
10925
|
+
import { join as join82 } from "path";
|
|
10926
|
+
import { z as z41 } from "zod/mini";
|
|
10693
10927
|
|
|
10694
10928
|
// src/features/subagents/rulesync-subagent.ts
|
|
10695
|
-
import { basename as basename7, join as
|
|
10696
|
-
import { z as
|
|
10697
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
10698
|
-
targets:
|
|
10699
|
-
name:
|
|
10700
|
-
description:
|
|
10929
|
+
import { basename as basename7, join as join81 } from "path";
|
|
10930
|
+
import { z as z40 } from "zod/mini";
|
|
10931
|
+
var RulesyncSubagentFrontmatterSchema = z40.looseObject({
|
|
10932
|
+
targets: z40._default(RulesyncTargetsSchema, ["*"]),
|
|
10933
|
+
name: z40.string(),
|
|
10934
|
+
description: z40.string()
|
|
10701
10935
|
});
|
|
10702
10936
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
10703
10937
|
frontmatter;
|
|
@@ -10706,7 +10940,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10706
10940
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10707
10941
|
if (!parseResult.success && rest.validate !== false) {
|
|
10708
10942
|
throw new Error(
|
|
10709
|
-
`Invalid frontmatter in ${
|
|
10943
|
+
`Invalid frontmatter in ${join81(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
10710
10944
|
);
|
|
10711
10945
|
}
|
|
10712
10946
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -10739,7 +10973,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10739
10973
|
return {
|
|
10740
10974
|
success: false,
|
|
10741
10975
|
error: new Error(
|
|
10742
|
-
`Invalid frontmatter in ${
|
|
10976
|
+
`Invalid frontmatter in ${join81(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10743
10977
|
)
|
|
10744
10978
|
};
|
|
10745
10979
|
}
|
|
@@ -10747,7 +10981,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10747
10981
|
static async fromFile({
|
|
10748
10982
|
relativeFilePath
|
|
10749
10983
|
}) {
|
|
10750
|
-
const filePath =
|
|
10984
|
+
const filePath = join81(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
10751
10985
|
const fileContent = await readFileContent(filePath);
|
|
10752
10986
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10753
10987
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10766,13 +11000,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10766
11000
|
};
|
|
10767
11001
|
|
|
10768
11002
|
// src/features/subagents/claudecode-subagent.ts
|
|
10769
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
10770
|
-
name:
|
|
10771
|
-
description:
|
|
10772
|
-
model:
|
|
10773
|
-
tools:
|
|
10774
|
-
permissionMode:
|
|
10775
|
-
skills:
|
|
11003
|
+
var ClaudecodeSubagentFrontmatterSchema = z41.looseObject({
|
|
11004
|
+
name: z41.string(),
|
|
11005
|
+
description: z41.string(),
|
|
11006
|
+
model: z41.optional(z41.string()),
|
|
11007
|
+
tools: z41.optional(z41.union([z41.string(), z41.array(z41.string())])),
|
|
11008
|
+
permissionMode: z41.optional(z41.string()),
|
|
11009
|
+
skills: z41.optional(z41.union([z41.string(), z41.array(z41.string())]))
|
|
10776
11010
|
});
|
|
10777
11011
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
10778
11012
|
frontmatter;
|
|
@@ -10782,7 +11016,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10782
11016
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10783
11017
|
if (!result.success) {
|
|
10784
11018
|
throw new Error(
|
|
10785
|
-
`Invalid frontmatter in ${
|
|
11019
|
+
`Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10786
11020
|
);
|
|
10787
11021
|
}
|
|
10788
11022
|
}
|
|
@@ -10794,7 +11028,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10794
11028
|
}
|
|
10795
11029
|
static getSettablePaths(_options = {}) {
|
|
10796
11030
|
return {
|
|
10797
|
-
relativeDirPath:
|
|
11031
|
+
relativeDirPath: join82(".claude", "agents")
|
|
10798
11032
|
};
|
|
10799
11033
|
}
|
|
10800
11034
|
getFrontmatter() {
|
|
@@ -10870,7 +11104,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10870
11104
|
return {
|
|
10871
11105
|
success: false,
|
|
10872
11106
|
error: new Error(
|
|
10873
|
-
`Invalid frontmatter in ${
|
|
11107
|
+
`Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10874
11108
|
)
|
|
10875
11109
|
};
|
|
10876
11110
|
}
|
|
@@ -10888,7 +11122,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10888
11122
|
global = false
|
|
10889
11123
|
}) {
|
|
10890
11124
|
const paths = this.getSettablePaths({ global });
|
|
10891
|
-
const filePath =
|
|
11125
|
+
const filePath = join82(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10892
11126
|
const fileContent = await readFileContent(filePath);
|
|
10893
11127
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10894
11128
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10923,16 +11157,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10923
11157
|
};
|
|
10924
11158
|
|
|
10925
11159
|
// src/features/subagents/codexcli-subagent.ts
|
|
10926
|
-
import { join as
|
|
11160
|
+
import { join as join83 } from "path";
|
|
10927
11161
|
import * as smolToml2 from "smol-toml";
|
|
10928
|
-
import { z as
|
|
10929
|
-
var CodexCliSubagentTomlSchema =
|
|
10930
|
-
name:
|
|
10931
|
-
description:
|
|
10932
|
-
developer_instructions:
|
|
10933
|
-
model:
|
|
10934
|
-
model_reasoning_effort:
|
|
10935
|
-
sandbox_mode:
|
|
11162
|
+
import { z as z42 } from "zod/mini";
|
|
11163
|
+
var CodexCliSubagentTomlSchema = z42.looseObject({
|
|
11164
|
+
name: z42.string(),
|
|
11165
|
+
description: z42.optional(z42.string()),
|
|
11166
|
+
developer_instructions: z42.optional(z42.string()),
|
|
11167
|
+
model: z42.optional(z42.string()),
|
|
11168
|
+
model_reasoning_effort: z42.optional(z42.string()),
|
|
11169
|
+
sandbox_mode: z42.optional(z42.string())
|
|
10936
11170
|
});
|
|
10937
11171
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
10938
11172
|
body;
|
|
@@ -10943,7 +11177,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10943
11177
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
10944
11178
|
} catch (error) {
|
|
10945
11179
|
throw new Error(
|
|
10946
|
-
`Invalid TOML in ${
|
|
11180
|
+
`Invalid TOML in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10947
11181
|
{ cause: error }
|
|
10948
11182
|
);
|
|
10949
11183
|
}
|
|
@@ -10955,7 +11189,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10955
11189
|
}
|
|
10956
11190
|
static getSettablePaths(_options = {}) {
|
|
10957
11191
|
return {
|
|
10958
|
-
relativeDirPath:
|
|
11192
|
+
relativeDirPath: join83(".codex", "agents")
|
|
10959
11193
|
};
|
|
10960
11194
|
}
|
|
10961
11195
|
getBody() {
|
|
@@ -10967,7 +11201,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10967
11201
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
10968
11202
|
} catch (error) {
|
|
10969
11203
|
throw new Error(
|
|
10970
|
-
`Failed to parse TOML in ${
|
|
11204
|
+
`Failed to parse TOML in ${join83(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10971
11205
|
{ cause: error }
|
|
10972
11206
|
);
|
|
10973
11207
|
}
|
|
@@ -11048,7 +11282,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11048
11282
|
global = false
|
|
11049
11283
|
}) {
|
|
11050
11284
|
const paths = this.getSettablePaths({ global });
|
|
11051
|
-
const filePath =
|
|
11285
|
+
const filePath = join83(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11052
11286
|
const fileContent = await readFileContent(filePath);
|
|
11053
11287
|
const subagent = new _CodexCliSubagent({
|
|
11054
11288
|
baseDir,
|
|
@@ -11086,13 +11320,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11086
11320
|
};
|
|
11087
11321
|
|
|
11088
11322
|
// src/features/subagents/copilot-subagent.ts
|
|
11089
|
-
import { join as
|
|
11090
|
-
import { z as
|
|
11323
|
+
import { join as join84 } from "path";
|
|
11324
|
+
import { z as z43 } from "zod/mini";
|
|
11091
11325
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11092
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11093
|
-
name:
|
|
11094
|
-
description:
|
|
11095
|
-
tools:
|
|
11326
|
+
var CopilotSubagentFrontmatterSchema = z43.looseObject({
|
|
11327
|
+
name: z43.string(),
|
|
11328
|
+
description: z43.string(),
|
|
11329
|
+
tools: z43.optional(z43.union([z43.string(), z43.array(z43.string())]))
|
|
11096
11330
|
});
|
|
11097
11331
|
var normalizeTools = (tools) => {
|
|
11098
11332
|
if (!tools) {
|
|
@@ -11112,7 +11346,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11112
11346
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11113
11347
|
if (!result.success) {
|
|
11114
11348
|
throw new Error(
|
|
11115
|
-
`Invalid frontmatter in ${
|
|
11349
|
+
`Invalid frontmatter in ${join84(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11116
11350
|
);
|
|
11117
11351
|
}
|
|
11118
11352
|
}
|
|
@@ -11124,7 +11358,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11124
11358
|
}
|
|
11125
11359
|
static getSettablePaths(_options = {}) {
|
|
11126
11360
|
return {
|
|
11127
|
-
relativeDirPath:
|
|
11361
|
+
relativeDirPath: join84(".github", "agents")
|
|
11128
11362
|
};
|
|
11129
11363
|
}
|
|
11130
11364
|
getFrontmatter() {
|
|
@@ -11198,7 +11432,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11198
11432
|
return {
|
|
11199
11433
|
success: false,
|
|
11200
11434
|
error: new Error(
|
|
11201
|
-
`Invalid frontmatter in ${
|
|
11435
|
+
`Invalid frontmatter in ${join84(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11202
11436
|
)
|
|
11203
11437
|
};
|
|
11204
11438
|
}
|
|
@@ -11216,7 +11450,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11216
11450
|
global = false
|
|
11217
11451
|
}) {
|
|
11218
11452
|
const paths = this.getSettablePaths({ global });
|
|
11219
|
-
const filePath =
|
|
11453
|
+
const filePath = join84(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11220
11454
|
const fileContent = await readFileContent(filePath);
|
|
11221
11455
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11222
11456
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11252,11 +11486,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11252
11486
|
};
|
|
11253
11487
|
|
|
11254
11488
|
// src/features/subagents/cursor-subagent.ts
|
|
11255
|
-
import { join as
|
|
11256
|
-
import { z as
|
|
11257
|
-
var CursorSubagentFrontmatterSchema =
|
|
11258
|
-
name:
|
|
11259
|
-
description:
|
|
11489
|
+
import { join as join85 } from "path";
|
|
11490
|
+
import { z as z44 } from "zod/mini";
|
|
11491
|
+
var CursorSubagentFrontmatterSchema = z44.looseObject({
|
|
11492
|
+
name: z44.string(),
|
|
11493
|
+
description: z44.string()
|
|
11260
11494
|
});
|
|
11261
11495
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
11262
11496
|
frontmatter;
|
|
@@ -11266,7 +11500,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11266
11500
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11267
11501
|
if (!result.success) {
|
|
11268
11502
|
throw new Error(
|
|
11269
|
-
`Invalid frontmatter in ${
|
|
11503
|
+
`Invalid frontmatter in ${join85(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11270
11504
|
);
|
|
11271
11505
|
}
|
|
11272
11506
|
}
|
|
@@ -11278,7 +11512,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11278
11512
|
}
|
|
11279
11513
|
static getSettablePaths(_options = {}) {
|
|
11280
11514
|
return {
|
|
11281
|
-
relativeDirPath:
|
|
11515
|
+
relativeDirPath: join85(".cursor", "agents")
|
|
11282
11516
|
};
|
|
11283
11517
|
}
|
|
11284
11518
|
getFrontmatter() {
|
|
@@ -11345,7 +11579,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11345
11579
|
return {
|
|
11346
11580
|
success: false,
|
|
11347
11581
|
error: new Error(
|
|
11348
|
-
`Invalid frontmatter in ${
|
|
11582
|
+
`Invalid frontmatter in ${join85(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11349
11583
|
)
|
|
11350
11584
|
};
|
|
11351
11585
|
}
|
|
@@ -11363,7 +11597,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11363
11597
|
global = false
|
|
11364
11598
|
}) {
|
|
11365
11599
|
const paths = this.getSettablePaths({ global });
|
|
11366
|
-
const filePath =
|
|
11600
|
+
const filePath = join85(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11367
11601
|
const fileContent = await readFileContent(filePath);
|
|
11368
11602
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11369
11603
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11399,23 +11633,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11399
11633
|
};
|
|
11400
11634
|
|
|
11401
11635
|
// src/features/subagents/kiro-subagent.ts
|
|
11402
|
-
import { join as
|
|
11403
|
-
import { z as
|
|
11404
|
-
var KiroCliSubagentJsonSchema =
|
|
11405
|
-
name:
|
|
11406
|
-
description:
|
|
11407
|
-
prompt:
|
|
11408
|
-
tools:
|
|
11409
|
-
toolAliases:
|
|
11410
|
-
toolSettings:
|
|
11411
|
-
toolSchema:
|
|
11412
|
-
hooks:
|
|
11413
|
-
model:
|
|
11414
|
-
mcpServers:
|
|
11415
|
-
useLegacyMcpJson:
|
|
11416
|
-
resources:
|
|
11417
|
-
allowedTools:
|
|
11418
|
-
includeMcpJson:
|
|
11636
|
+
import { join as join86 } from "path";
|
|
11637
|
+
import { z as z45 } from "zod/mini";
|
|
11638
|
+
var KiroCliSubagentJsonSchema = z45.looseObject({
|
|
11639
|
+
name: z45.string(),
|
|
11640
|
+
description: z45.optional(z45.nullable(z45.string())),
|
|
11641
|
+
prompt: z45.optional(z45.nullable(z45.string())),
|
|
11642
|
+
tools: z45.optional(z45.nullable(z45.array(z45.string()))),
|
|
11643
|
+
toolAliases: z45.optional(z45.nullable(z45.record(z45.string(), z45.string()))),
|
|
11644
|
+
toolSettings: z45.optional(z45.nullable(z45.unknown())),
|
|
11645
|
+
toolSchema: z45.optional(z45.nullable(z45.unknown())),
|
|
11646
|
+
hooks: z45.optional(z45.nullable(z45.record(z45.string(), z45.array(z45.unknown())))),
|
|
11647
|
+
model: z45.optional(z45.nullable(z45.string())),
|
|
11648
|
+
mcpServers: z45.optional(z45.nullable(z45.record(z45.string(), z45.unknown()))),
|
|
11649
|
+
useLegacyMcpJson: z45.optional(z45.nullable(z45.boolean())),
|
|
11650
|
+
resources: z45.optional(z45.nullable(z45.array(z45.string()))),
|
|
11651
|
+
allowedTools: z45.optional(z45.nullable(z45.array(z45.string()))),
|
|
11652
|
+
includeMcpJson: z45.optional(z45.nullable(z45.boolean()))
|
|
11419
11653
|
});
|
|
11420
11654
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
11421
11655
|
body;
|
|
@@ -11426,7 +11660,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11426
11660
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
11427
11661
|
} catch (error) {
|
|
11428
11662
|
throw new Error(
|
|
11429
|
-
`Invalid JSON in ${
|
|
11663
|
+
`Invalid JSON in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11430
11664
|
{ cause: error }
|
|
11431
11665
|
);
|
|
11432
11666
|
}
|
|
@@ -11438,7 +11672,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11438
11672
|
}
|
|
11439
11673
|
static getSettablePaths(_options = {}) {
|
|
11440
11674
|
return {
|
|
11441
|
-
relativeDirPath:
|
|
11675
|
+
relativeDirPath: join86(".kiro", "agents")
|
|
11442
11676
|
};
|
|
11443
11677
|
}
|
|
11444
11678
|
getBody() {
|
|
@@ -11450,7 +11684,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11450
11684
|
parsed = JSON.parse(this.body);
|
|
11451
11685
|
} catch (error) {
|
|
11452
11686
|
throw new Error(
|
|
11453
|
-
`Failed to parse JSON in ${
|
|
11687
|
+
`Failed to parse JSON in ${join86(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11454
11688
|
{ cause: error }
|
|
11455
11689
|
);
|
|
11456
11690
|
}
|
|
@@ -11531,7 +11765,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11531
11765
|
global = false
|
|
11532
11766
|
}) {
|
|
11533
11767
|
const paths = this.getSettablePaths({ global });
|
|
11534
|
-
const filePath =
|
|
11768
|
+
const filePath = join86(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11535
11769
|
const fileContent = await readFileContent(filePath);
|
|
11536
11770
|
const subagent = new _KiroSubagent({
|
|
11537
11771
|
baseDir,
|
|
@@ -11569,12 +11803,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11569
11803
|
};
|
|
11570
11804
|
|
|
11571
11805
|
// src/features/subagents/opencode-subagent.ts
|
|
11572
|
-
import { basename as basename8, join as
|
|
11573
|
-
import { z as
|
|
11574
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
11575
|
-
description:
|
|
11576
|
-
mode:
|
|
11577
|
-
name:
|
|
11806
|
+
import { basename as basename8, join as join87 } from "path";
|
|
11807
|
+
import { z as z46 } from "zod/mini";
|
|
11808
|
+
var OpenCodeSubagentFrontmatterSchema = z46.looseObject({
|
|
11809
|
+
description: z46.string(),
|
|
11810
|
+
mode: z46._default(z46.string(), "subagent"),
|
|
11811
|
+
name: z46.optional(z46.string())
|
|
11578
11812
|
});
|
|
11579
11813
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
11580
11814
|
frontmatter;
|
|
@@ -11584,7 +11818,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11584
11818
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11585
11819
|
if (!result.success) {
|
|
11586
11820
|
throw new Error(
|
|
11587
|
-
`Invalid frontmatter in ${
|
|
11821
|
+
`Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11588
11822
|
);
|
|
11589
11823
|
}
|
|
11590
11824
|
}
|
|
@@ -11598,7 +11832,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11598
11832
|
global = false
|
|
11599
11833
|
} = {}) {
|
|
11600
11834
|
return {
|
|
11601
|
-
relativeDirPath: global ?
|
|
11835
|
+
relativeDirPath: global ? join87(".config", "opencode", "agent") : join87(".opencode", "agent")
|
|
11602
11836
|
};
|
|
11603
11837
|
}
|
|
11604
11838
|
getFrontmatter() {
|
|
@@ -11636,7 +11870,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11636
11870
|
const opencodeFrontmatter = {
|
|
11637
11871
|
...opencodeSection,
|
|
11638
11872
|
description: rulesyncFrontmatter.description,
|
|
11639
|
-
mode: "subagent",
|
|
11873
|
+
mode: typeof opencodeSection.mode === "string" ? opencodeSection.mode : "subagent",
|
|
11640
11874
|
...rulesyncFrontmatter.name && { name: rulesyncFrontmatter.name }
|
|
11641
11875
|
};
|
|
11642
11876
|
const body = rulesyncSubagent.getBody();
|
|
@@ -11664,7 +11898,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11664
11898
|
return {
|
|
11665
11899
|
success: false,
|
|
11666
11900
|
error: new Error(
|
|
11667
|
-
`Invalid frontmatter in ${
|
|
11901
|
+
`Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11668
11902
|
)
|
|
11669
11903
|
};
|
|
11670
11904
|
}
|
|
@@ -11681,7 +11915,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11681
11915
|
global = false
|
|
11682
11916
|
}) {
|
|
11683
11917
|
const paths = this.getSettablePaths({ global });
|
|
11684
|
-
const filePath =
|
|
11918
|
+
const filePath = join87(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11685
11919
|
const fileContent = await readFileContent(filePath);
|
|
11686
11920
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11687
11921
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11730,7 +11964,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
11730
11964
|
"opencode",
|
|
11731
11965
|
"roo"
|
|
11732
11966
|
];
|
|
11733
|
-
var SubagentsProcessorToolTargetSchema =
|
|
11967
|
+
var SubagentsProcessorToolTargetSchema = z47.enum(subagentsProcessorToolTargetTuple);
|
|
11734
11968
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
11735
11969
|
[
|
|
11736
11970
|
"agentsmd",
|
|
@@ -11892,7 +12126,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11892
12126
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
11893
12127
|
*/
|
|
11894
12128
|
async loadRulesyncFiles() {
|
|
11895
|
-
const subagentsDir =
|
|
12129
|
+
const subagentsDir = join88(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
11896
12130
|
const dirExists = await directoryExists(subagentsDir);
|
|
11897
12131
|
if (!dirExists) {
|
|
11898
12132
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -11907,7 +12141,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11907
12141
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
11908
12142
|
const rulesyncSubagents = [];
|
|
11909
12143
|
for (const mdFile of mdFiles) {
|
|
11910
|
-
const filepath =
|
|
12144
|
+
const filepath = join88(subagentsDir, mdFile);
|
|
11911
12145
|
try {
|
|
11912
12146
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
11913
12147
|
relativeFilePath: mdFile,
|
|
@@ -11937,7 +12171,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11937
12171
|
const factory = this.getFactory(this.toolTarget);
|
|
11938
12172
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11939
12173
|
const subagentFilePaths = await findFilesByGlobs(
|
|
11940
|
-
|
|
12174
|
+
join88(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
11941
12175
|
);
|
|
11942
12176
|
if (forDeletion) {
|
|
11943
12177
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -12002,49 +12236,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12002
12236
|
};
|
|
12003
12237
|
|
|
12004
12238
|
// src/features/rules/agentsmd-rule.ts
|
|
12005
|
-
import { join as
|
|
12239
|
+
import { join as join91 } from "path";
|
|
12006
12240
|
|
|
12007
12241
|
// src/features/rules/tool-rule.ts
|
|
12008
|
-
import { join as
|
|
12242
|
+
import { join as join90 } from "path";
|
|
12009
12243
|
|
|
12010
12244
|
// src/features/rules/rulesync-rule.ts
|
|
12011
|
-
import { join as
|
|
12012
|
-
import { z as
|
|
12013
|
-
var RulesyncRuleFrontmatterSchema =
|
|
12014
|
-
root:
|
|
12015
|
-
localRoot:
|
|
12016
|
-
targets:
|
|
12017
|
-
description:
|
|
12018
|
-
globs:
|
|
12019
|
-
agentsmd:
|
|
12020
|
-
|
|
12245
|
+
import { join as join89 } from "path";
|
|
12246
|
+
import { z as z48 } from "zod/mini";
|
|
12247
|
+
var RulesyncRuleFrontmatterSchema = z48.object({
|
|
12248
|
+
root: z48.optional(z48.boolean()),
|
|
12249
|
+
localRoot: z48.optional(z48.boolean()),
|
|
12250
|
+
targets: z48._default(RulesyncTargetsSchema, ["*"]),
|
|
12251
|
+
description: z48.optional(z48.string()),
|
|
12252
|
+
globs: z48.optional(z48.array(z48.string())),
|
|
12253
|
+
agentsmd: z48.optional(
|
|
12254
|
+
z48.object({
|
|
12021
12255
|
// @example "path/to/subproject"
|
|
12022
|
-
subprojectPath:
|
|
12256
|
+
subprojectPath: z48.optional(z48.string())
|
|
12023
12257
|
})
|
|
12024
12258
|
),
|
|
12025
|
-
claudecode:
|
|
12026
|
-
|
|
12259
|
+
claudecode: z48.optional(
|
|
12260
|
+
z48.object({
|
|
12027
12261
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
12028
12262
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
12029
|
-
paths:
|
|
12263
|
+
paths: z48.optional(z48.array(z48.string()))
|
|
12030
12264
|
})
|
|
12031
12265
|
),
|
|
12032
|
-
cursor:
|
|
12033
|
-
|
|
12034
|
-
alwaysApply:
|
|
12035
|
-
description:
|
|
12036
|
-
globs:
|
|
12266
|
+
cursor: z48.optional(
|
|
12267
|
+
z48.object({
|
|
12268
|
+
alwaysApply: z48.optional(z48.boolean()),
|
|
12269
|
+
description: z48.optional(z48.string()),
|
|
12270
|
+
globs: z48.optional(z48.array(z48.string()))
|
|
12037
12271
|
})
|
|
12038
12272
|
),
|
|
12039
|
-
copilot:
|
|
12040
|
-
|
|
12041
|
-
excludeAgent:
|
|
12273
|
+
copilot: z48.optional(
|
|
12274
|
+
z48.object({
|
|
12275
|
+
excludeAgent: z48.optional(z48.union([z48.literal("code-review"), z48.literal("coding-agent")]))
|
|
12042
12276
|
})
|
|
12043
12277
|
),
|
|
12044
|
-
antigravity:
|
|
12045
|
-
|
|
12046
|
-
trigger:
|
|
12047
|
-
globs:
|
|
12278
|
+
antigravity: z48.optional(
|
|
12279
|
+
z48.looseObject({
|
|
12280
|
+
trigger: z48.optional(z48.string()),
|
|
12281
|
+
globs: z48.optional(z48.array(z48.string()))
|
|
12048
12282
|
})
|
|
12049
12283
|
)
|
|
12050
12284
|
});
|
|
@@ -12055,7 +12289,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12055
12289
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12056
12290
|
if (!parseResult.success && rest.validate !== false) {
|
|
12057
12291
|
throw new Error(
|
|
12058
|
-
`Invalid frontmatter in ${
|
|
12292
|
+
`Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
12059
12293
|
);
|
|
12060
12294
|
}
|
|
12061
12295
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -12090,7 +12324,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12090
12324
|
return {
|
|
12091
12325
|
success: false,
|
|
12092
12326
|
error: new Error(
|
|
12093
|
-
`Invalid frontmatter in ${
|
|
12327
|
+
`Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12094
12328
|
)
|
|
12095
12329
|
};
|
|
12096
12330
|
}
|
|
@@ -12099,7 +12333,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
12099
12333
|
relativeFilePath,
|
|
12100
12334
|
validate = true
|
|
12101
12335
|
}) {
|
|
12102
|
-
const filePath =
|
|
12336
|
+
const filePath = join89(
|
|
12103
12337
|
process.cwd(),
|
|
12104
12338
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
12105
12339
|
relativeFilePath
|
|
@@ -12201,7 +12435,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12201
12435
|
rulesyncRule,
|
|
12202
12436
|
validate = true,
|
|
12203
12437
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
12204
|
-
nonRootPath = { relativeDirPath:
|
|
12438
|
+
nonRootPath = { relativeDirPath: join90(".agents", "memories") }
|
|
12205
12439
|
}) {
|
|
12206
12440
|
const params = this.buildToolRuleParamsDefault({
|
|
12207
12441
|
baseDir,
|
|
@@ -12212,7 +12446,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12212
12446
|
});
|
|
12213
12447
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
12214
12448
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
12215
|
-
params.relativeDirPath =
|
|
12449
|
+
params.relativeDirPath = join90(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
12216
12450
|
params.relativeFilePath = "AGENTS.md";
|
|
12217
12451
|
}
|
|
12218
12452
|
return params;
|
|
@@ -12261,7 +12495,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12261
12495
|
}
|
|
12262
12496
|
};
|
|
12263
12497
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
12264
|
-
return excludeToolDir ? subDir :
|
|
12498
|
+
return excludeToolDir ? subDir : join90(toolDir, subDir);
|
|
12265
12499
|
}
|
|
12266
12500
|
|
|
12267
12501
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -12290,8 +12524,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12290
12524
|
validate = true
|
|
12291
12525
|
}) {
|
|
12292
12526
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
12293
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
12294
|
-
const fileContent = await readFileContent(
|
|
12527
|
+
const relativePath = isRoot ? "AGENTS.md" : join91(".agents", "memories", relativeFilePath);
|
|
12528
|
+
const fileContent = await readFileContent(join91(baseDir, relativePath));
|
|
12295
12529
|
return new _AgentsMdRule({
|
|
12296
12530
|
baseDir,
|
|
12297
12531
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -12346,21 +12580,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12346
12580
|
};
|
|
12347
12581
|
|
|
12348
12582
|
// src/features/rules/antigravity-rule.ts
|
|
12349
|
-
import { join as
|
|
12350
|
-
import { z as
|
|
12351
|
-
var AntigravityRuleFrontmatterSchema =
|
|
12352
|
-
trigger:
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12583
|
+
import { join as join92 } from "path";
|
|
12584
|
+
import { z as z49 } from "zod/mini";
|
|
12585
|
+
var AntigravityRuleFrontmatterSchema = z49.looseObject({
|
|
12586
|
+
trigger: z49.optional(
|
|
12587
|
+
z49.union([
|
|
12588
|
+
z49.literal("always_on"),
|
|
12589
|
+
z49.literal("glob"),
|
|
12590
|
+
z49.literal("manual"),
|
|
12591
|
+
z49.literal("model_decision"),
|
|
12592
|
+
z49.string()
|
|
12359
12593
|
// accepts any string for forward compatibility
|
|
12360
12594
|
])
|
|
12361
12595
|
),
|
|
12362
|
-
globs:
|
|
12363
|
-
description:
|
|
12596
|
+
globs: z49.optional(z49.string()),
|
|
12597
|
+
description: z49.optional(z49.string())
|
|
12364
12598
|
});
|
|
12365
12599
|
function parseGlobsString(globs) {
|
|
12366
12600
|
if (!globs) {
|
|
@@ -12505,7 +12739,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12505
12739
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12506
12740
|
if (!result.success) {
|
|
12507
12741
|
throw new Error(
|
|
12508
|
-
`Invalid frontmatter in ${
|
|
12742
|
+
`Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12509
12743
|
);
|
|
12510
12744
|
}
|
|
12511
12745
|
}
|
|
@@ -12529,7 +12763,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12529
12763
|
relativeFilePath,
|
|
12530
12764
|
validate = true
|
|
12531
12765
|
}) {
|
|
12532
|
-
const filePath =
|
|
12766
|
+
const filePath = join92(
|
|
12533
12767
|
baseDir,
|
|
12534
12768
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12535
12769
|
relativeFilePath
|
|
@@ -12670,7 +12904,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12670
12904
|
};
|
|
12671
12905
|
|
|
12672
12906
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
12673
|
-
import { join as
|
|
12907
|
+
import { join as join93 } from "path";
|
|
12674
12908
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
12675
12909
|
toRulesyncRule() {
|
|
12676
12910
|
const rulesyncFrontmatter = {
|
|
@@ -12731,8 +12965,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12731
12965
|
}) {
|
|
12732
12966
|
const settablePaths = this.getSettablePaths();
|
|
12733
12967
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
12734
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
12735
|
-
const fileContent = await readFileContent(
|
|
12968
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join93(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12969
|
+
const fileContent = await readFileContent(join93(baseDir, relativePath));
|
|
12736
12970
|
return new _AugmentcodeLegacyRule({
|
|
12737
12971
|
baseDir,
|
|
12738
12972
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -12761,7 +12995,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12761
12995
|
};
|
|
12762
12996
|
|
|
12763
12997
|
// src/features/rules/augmentcode-rule.ts
|
|
12764
|
-
import { join as
|
|
12998
|
+
import { join as join94 } from "path";
|
|
12765
12999
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
12766
13000
|
toRulesyncRule() {
|
|
12767
13001
|
return this.toRulesyncRuleDefault();
|
|
@@ -12792,7 +13026,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12792
13026
|
relativeFilePath,
|
|
12793
13027
|
validate = true
|
|
12794
13028
|
}) {
|
|
12795
|
-
const filePath =
|
|
13029
|
+
const filePath = join94(
|
|
12796
13030
|
baseDir,
|
|
12797
13031
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12798
13032
|
relativeFilePath
|
|
@@ -12832,7 +13066,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12832
13066
|
};
|
|
12833
13067
|
|
|
12834
13068
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
12835
|
-
import { join as
|
|
13069
|
+
import { join as join95 } from "path";
|
|
12836
13070
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
12837
13071
|
static getSettablePaths({
|
|
12838
13072
|
global,
|
|
@@ -12867,7 +13101,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12867
13101
|
if (isRoot) {
|
|
12868
13102
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12869
13103
|
const fileContent2 = await readFileContent(
|
|
12870
|
-
|
|
13104
|
+
join95(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12871
13105
|
);
|
|
12872
13106
|
return new _ClaudecodeLegacyRule({
|
|
12873
13107
|
baseDir,
|
|
@@ -12881,8 +13115,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12881
13115
|
if (!paths.nonRoot) {
|
|
12882
13116
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12883
13117
|
}
|
|
12884
|
-
const relativePath =
|
|
12885
|
-
const fileContent = await readFileContent(
|
|
13118
|
+
const relativePath = join95(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13119
|
+
const fileContent = await readFileContent(join95(baseDir, relativePath));
|
|
12886
13120
|
return new _ClaudecodeLegacyRule({
|
|
12887
13121
|
baseDir,
|
|
12888
13122
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12941,10 +13175,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12941
13175
|
};
|
|
12942
13176
|
|
|
12943
13177
|
// src/features/rules/claudecode-rule.ts
|
|
12944
|
-
import { join as
|
|
12945
|
-
import { z as
|
|
12946
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
12947
|
-
paths:
|
|
13178
|
+
import { join as join96 } from "path";
|
|
13179
|
+
import { z as z50 } from "zod/mini";
|
|
13180
|
+
var ClaudecodeRuleFrontmatterSchema = z50.object({
|
|
13181
|
+
paths: z50.optional(z50.array(z50.string()))
|
|
12948
13182
|
});
|
|
12949
13183
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
12950
13184
|
frontmatter;
|
|
@@ -12976,7 +13210,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12976
13210
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12977
13211
|
if (!result.success) {
|
|
12978
13212
|
throw new Error(
|
|
12979
|
-
`Invalid frontmatter in ${
|
|
13213
|
+
`Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12980
13214
|
);
|
|
12981
13215
|
}
|
|
12982
13216
|
}
|
|
@@ -13004,7 +13238,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13004
13238
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13005
13239
|
if (isRoot) {
|
|
13006
13240
|
const fileContent2 = await readFileContent(
|
|
13007
|
-
|
|
13241
|
+
join96(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
13008
13242
|
);
|
|
13009
13243
|
return new _ClaudecodeRule({
|
|
13010
13244
|
baseDir,
|
|
@@ -13019,16 +13253,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13019
13253
|
if (!paths.nonRoot) {
|
|
13020
13254
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13021
13255
|
}
|
|
13022
|
-
const relativePath =
|
|
13023
|
-
const fileContent = await readFileContent(
|
|
13256
|
+
const relativePath = join96(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13257
|
+
const fileContent = await readFileContent(join96(baseDir, relativePath));
|
|
13024
13258
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
13025
13259
|
fileContent,
|
|
13026
|
-
|
|
13260
|
+
join96(baseDir, relativePath)
|
|
13027
13261
|
);
|
|
13028
13262
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13029
13263
|
if (!result.success) {
|
|
13030
13264
|
throw new Error(
|
|
13031
|
-
`Invalid frontmatter in ${
|
|
13265
|
+
`Invalid frontmatter in ${join96(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
13032
13266
|
);
|
|
13033
13267
|
}
|
|
13034
13268
|
return new _ClaudecodeRule({
|
|
@@ -13135,7 +13369,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13135
13369
|
return {
|
|
13136
13370
|
success: false,
|
|
13137
13371
|
error: new Error(
|
|
13138
|
-
`Invalid frontmatter in ${
|
|
13372
|
+
`Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13139
13373
|
)
|
|
13140
13374
|
};
|
|
13141
13375
|
}
|
|
@@ -13155,10 +13389,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13155
13389
|
};
|
|
13156
13390
|
|
|
13157
13391
|
// src/features/rules/cline-rule.ts
|
|
13158
|
-
import { join as
|
|
13159
|
-
import { z as
|
|
13160
|
-
var ClineRuleFrontmatterSchema =
|
|
13161
|
-
description:
|
|
13392
|
+
import { join as join97 } from "path";
|
|
13393
|
+
import { z as z51 } from "zod/mini";
|
|
13394
|
+
var ClineRuleFrontmatterSchema = z51.object({
|
|
13395
|
+
description: z51.string()
|
|
13162
13396
|
});
|
|
13163
13397
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
13164
13398
|
static getSettablePaths(_options = {}) {
|
|
@@ -13201,7 +13435,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13201
13435
|
validate = true
|
|
13202
13436
|
}) {
|
|
13203
13437
|
const fileContent = await readFileContent(
|
|
13204
|
-
|
|
13438
|
+
join97(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13205
13439
|
);
|
|
13206
13440
|
return new _ClineRule({
|
|
13207
13441
|
baseDir,
|
|
@@ -13227,7 +13461,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
13227
13461
|
};
|
|
13228
13462
|
|
|
13229
13463
|
// src/features/rules/codexcli-rule.ts
|
|
13230
|
-
import { join as
|
|
13464
|
+
import { join as join98 } from "path";
|
|
13231
13465
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
13232
13466
|
static getSettablePaths({
|
|
13233
13467
|
global,
|
|
@@ -13262,7 +13496,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13262
13496
|
if (isRoot) {
|
|
13263
13497
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13264
13498
|
const fileContent2 = await readFileContent(
|
|
13265
|
-
|
|
13499
|
+
join98(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13266
13500
|
);
|
|
13267
13501
|
return new _CodexcliRule({
|
|
13268
13502
|
baseDir,
|
|
@@ -13276,8 +13510,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13276
13510
|
if (!paths.nonRoot) {
|
|
13277
13511
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13278
13512
|
}
|
|
13279
|
-
const relativePath =
|
|
13280
|
-
const fileContent = await readFileContent(
|
|
13513
|
+
const relativePath = join98(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13514
|
+
const fileContent = await readFileContent(join98(baseDir, relativePath));
|
|
13281
13515
|
return new _CodexcliRule({
|
|
13282
13516
|
baseDir,
|
|
13283
13517
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13336,12 +13570,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13336
13570
|
};
|
|
13337
13571
|
|
|
13338
13572
|
// src/features/rules/copilot-rule.ts
|
|
13339
|
-
import { join as
|
|
13340
|
-
import { z as
|
|
13341
|
-
var CopilotRuleFrontmatterSchema =
|
|
13342
|
-
description:
|
|
13343
|
-
applyTo:
|
|
13344
|
-
excludeAgent:
|
|
13573
|
+
import { join as join99 } from "path";
|
|
13574
|
+
import { z as z52 } from "zod/mini";
|
|
13575
|
+
var CopilotRuleFrontmatterSchema = z52.object({
|
|
13576
|
+
description: z52.optional(z52.string()),
|
|
13577
|
+
applyTo: z52.optional(z52.string()),
|
|
13578
|
+
excludeAgent: z52.optional(z52.union([z52.literal("code-review"), z52.literal("coding-agent")]))
|
|
13345
13579
|
});
|
|
13346
13580
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
13347
13581
|
frontmatter;
|
|
@@ -13370,7 +13604,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13370
13604
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13371
13605
|
if (!result.success) {
|
|
13372
13606
|
throw new Error(
|
|
13373
|
-
`Invalid frontmatter in ${
|
|
13607
|
+
`Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13374
13608
|
);
|
|
13375
13609
|
}
|
|
13376
13610
|
}
|
|
@@ -13460,8 +13694,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13460
13694
|
const paths = this.getSettablePaths({ global });
|
|
13461
13695
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13462
13696
|
if (isRoot) {
|
|
13463
|
-
const relativePath2 =
|
|
13464
|
-
const fileContent2 = await readFileContent(
|
|
13697
|
+
const relativePath2 = join99(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13698
|
+
const fileContent2 = await readFileContent(join99(baseDir, relativePath2));
|
|
13465
13699
|
return new _CopilotRule({
|
|
13466
13700
|
baseDir,
|
|
13467
13701
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13475,16 +13709,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13475
13709
|
if (!paths.nonRoot) {
|
|
13476
13710
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13477
13711
|
}
|
|
13478
|
-
const relativePath =
|
|
13479
|
-
const fileContent = await readFileContent(
|
|
13712
|
+
const relativePath = join99(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13713
|
+
const fileContent = await readFileContent(join99(baseDir, relativePath));
|
|
13480
13714
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
13481
13715
|
fileContent,
|
|
13482
|
-
|
|
13716
|
+
join99(baseDir, relativePath)
|
|
13483
13717
|
);
|
|
13484
13718
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13485
13719
|
if (!result.success) {
|
|
13486
13720
|
throw new Error(
|
|
13487
|
-
`Invalid frontmatter in ${
|
|
13721
|
+
`Invalid frontmatter in ${join99(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13488
13722
|
);
|
|
13489
13723
|
}
|
|
13490
13724
|
return new _CopilotRule({
|
|
@@ -13526,7 +13760,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13526
13760
|
return {
|
|
13527
13761
|
success: false,
|
|
13528
13762
|
error: new Error(
|
|
13529
|
-
`Invalid frontmatter in ${
|
|
13763
|
+
`Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13530
13764
|
)
|
|
13531
13765
|
};
|
|
13532
13766
|
}
|
|
@@ -13546,12 +13780,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13546
13780
|
};
|
|
13547
13781
|
|
|
13548
13782
|
// src/features/rules/cursor-rule.ts
|
|
13549
|
-
import { join as
|
|
13550
|
-
import { z as
|
|
13551
|
-
var CursorRuleFrontmatterSchema =
|
|
13552
|
-
description:
|
|
13553
|
-
globs:
|
|
13554
|
-
alwaysApply:
|
|
13783
|
+
import { join as join100 } from "path";
|
|
13784
|
+
import { z as z53 } from "zod/mini";
|
|
13785
|
+
var CursorRuleFrontmatterSchema = z53.object({
|
|
13786
|
+
description: z53.optional(z53.string()),
|
|
13787
|
+
globs: z53.optional(z53.string()),
|
|
13788
|
+
alwaysApply: z53.optional(z53.boolean())
|
|
13555
13789
|
});
|
|
13556
13790
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
13557
13791
|
frontmatter;
|
|
@@ -13568,7 +13802,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13568
13802
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13569
13803
|
if (!result.success) {
|
|
13570
13804
|
throw new Error(
|
|
13571
|
-
`Invalid frontmatter in ${
|
|
13805
|
+
`Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13572
13806
|
);
|
|
13573
13807
|
}
|
|
13574
13808
|
}
|
|
@@ -13684,7 +13918,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13684
13918
|
relativeFilePath,
|
|
13685
13919
|
validate = true
|
|
13686
13920
|
}) {
|
|
13687
|
-
const filePath =
|
|
13921
|
+
const filePath = join100(
|
|
13688
13922
|
baseDir,
|
|
13689
13923
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13690
13924
|
relativeFilePath
|
|
@@ -13694,7 +13928,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13694
13928
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13695
13929
|
if (!result.success) {
|
|
13696
13930
|
throw new Error(
|
|
13697
|
-
`Invalid frontmatter in ${
|
|
13931
|
+
`Invalid frontmatter in ${join100(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13698
13932
|
);
|
|
13699
13933
|
}
|
|
13700
13934
|
return new _CursorRule({
|
|
@@ -13731,7 +13965,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13731
13965
|
return {
|
|
13732
13966
|
success: false,
|
|
13733
13967
|
error: new Error(
|
|
13734
|
-
`Invalid frontmatter in ${
|
|
13968
|
+
`Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13735
13969
|
)
|
|
13736
13970
|
};
|
|
13737
13971
|
}
|
|
@@ -13751,7 +13985,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13751
13985
|
};
|
|
13752
13986
|
|
|
13753
13987
|
// src/features/rules/factorydroid-rule.ts
|
|
13754
|
-
import { join as
|
|
13988
|
+
import { join as join101 } from "path";
|
|
13755
13989
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
13756
13990
|
constructor({ fileContent, root, ...rest }) {
|
|
13757
13991
|
super({
|
|
@@ -13791,8 +14025,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13791
14025
|
const paths = this.getSettablePaths({ global });
|
|
13792
14026
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13793
14027
|
if (isRoot) {
|
|
13794
|
-
const relativePath2 =
|
|
13795
|
-
const fileContent2 = await readFileContent(
|
|
14028
|
+
const relativePath2 = join101(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
14029
|
+
const fileContent2 = await readFileContent(join101(baseDir, relativePath2));
|
|
13796
14030
|
return new _FactorydroidRule({
|
|
13797
14031
|
baseDir,
|
|
13798
14032
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13805,8 +14039,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13805
14039
|
if (!paths.nonRoot) {
|
|
13806
14040
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13807
14041
|
}
|
|
13808
|
-
const relativePath =
|
|
13809
|
-
const fileContent = await readFileContent(
|
|
14042
|
+
const relativePath = join101(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14043
|
+
const fileContent = await readFileContent(join101(baseDir, relativePath));
|
|
13810
14044
|
return new _FactorydroidRule({
|
|
13811
14045
|
baseDir,
|
|
13812
14046
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13865,7 +14099,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13865
14099
|
};
|
|
13866
14100
|
|
|
13867
14101
|
// src/features/rules/geminicli-rule.ts
|
|
13868
|
-
import { join as
|
|
14102
|
+
import { join as join102 } from "path";
|
|
13869
14103
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
13870
14104
|
static getSettablePaths({
|
|
13871
14105
|
global,
|
|
@@ -13900,7 +14134,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13900
14134
|
if (isRoot) {
|
|
13901
14135
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13902
14136
|
const fileContent2 = await readFileContent(
|
|
13903
|
-
|
|
14137
|
+
join102(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13904
14138
|
);
|
|
13905
14139
|
return new _GeminiCliRule({
|
|
13906
14140
|
baseDir,
|
|
@@ -13914,8 +14148,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13914
14148
|
if (!paths.nonRoot) {
|
|
13915
14149
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13916
14150
|
}
|
|
13917
|
-
const relativePath =
|
|
13918
|
-
const fileContent = await readFileContent(
|
|
14151
|
+
const relativePath = join102(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14152
|
+
const fileContent = await readFileContent(join102(baseDir, relativePath));
|
|
13919
14153
|
return new _GeminiCliRule({
|
|
13920
14154
|
baseDir,
|
|
13921
14155
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13974,7 +14208,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13974
14208
|
};
|
|
13975
14209
|
|
|
13976
14210
|
// src/features/rules/goose-rule.ts
|
|
13977
|
-
import { join as
|
|
14211
|
+
import { join as join103 } from "path";
|
|
13978
14212
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
13979
14213
|
static getSettablePaths({
|
|
13980
14214
|
global,
|
|
@@ -14009,7 +14243,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14009
14243
|
if (isRoot) {
|
|
14010
14244
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14011
14245
|
const fileContent2 = await readFileContent(
|
|
14012
|
-
|
|
14246
|
+
join103(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14013
14247
|
);
|
|
14014
14248
|
return new _GooseRule({
|
|
14015
14249
|
baseDir,
|
|
@@ -14023,8 +14257,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14023
14257
|
if (!paths.nonRoot) {
|
|
14024
14258
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14025
14259
|
}
|
|
14026
|
-
const relativePath =
|
|
14027
|
-
const fileContent = await readFileContent(
|
|
14260
|
+
const relativePath = join103(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14261
|
+
const fileContent = await readFileContent(join103(baseDir, relativePath));
|
|
14028
14262
|
return new _GooseRule({
|
|
14029
14263
|
baseDir,
|
|
14030
14264
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14083,7 +14317,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
14083
14317
|
};
|
|
14084
14318
|
|
|
14085
14319
|
// src/features/rules/junie-rule.ts
|
|
14086
|
-
import { join as
|
|
14320
|
+
import { join as join104 } from "path";
|
|
14087
14321
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
14088
14322
|
static getSettablePaths(_options = {}) {
|
|
14089
14323
|
return {
|
|
@@ -14102,8 +14336,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14102
14336
|
validate = true
|
|
14103
14337
|
}) {
|
|
14104
14338
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
14105
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
14106
|
-
const fileContent = await readFileContent(
|
|
14339
|
+
const relativePath = isRoot ? "guidelines.md" : join104(".junie", "memories", relativeFilePath);
|
|
14340
|
+
const fileContent = await readFileContent(join104(baseDir, relativePath));
|
|
14107
14341
|
return new _JunieRule({
|
|
14108
14342
|
baseDir,
|
|
14109
14343
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14158,7 +14392,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
14158
14392
|
};
|
|
14159
14393
|
|
|
14160
14394
|
// src/features/rules/kilo-rule.ts
|
|
14161
|
-
import { join as
|
|
14395
|
+
import { join as join105 } from "path";
|
|
14162
14396
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
14163
14397
|
static getSettablePaths(_options = {}) {
|
|
14164
14398
|
return {
|
|
@@ -14173,7 +14407,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14173
14407
|
validate = true
|
|
14174
14408
|
}) {
|
|
14175
14409
|
const fileContent = await readFileContent(
|
|
14176
|
-
|
|
14410
|
+
join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14177
14411
|
);
|
|
14178
14412
|
return new _KiloRule({
|
|
14179
14413
|
baseDir,
|
|
@@ -14225,7 +14459,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
14225
14459
|
};
|
|
14226
14460
|
|
|
14227
14461
|
// src/features/rules/kiro-rule.ts
|
|
14228
|
-
import { join as
|
|
14462
|
+
import { join as join106 } from "path";
|
|
14229
14463
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
14230
14464
|
static getSettablePaths(_options = {}) {
|
|
14231
14465
|
return {
|
|
@@ -14240,7 +14474,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14240
14474
|
validate = true
|
|
14241
14475
|
}) {
|
|
14242
14476
|
const fileContent = await readFileContent(
|
|
14243
|
-
|
|
14477
|
+
join106(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14244
14478
|
);
|
|
14245
14479
|
return new _KiroRule({
|
|
14246
14480
|
baseDir,
|
|
@@ -14294,7 +14528,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14294
14528
|
};
|
|
14295
14529
|
|
|
14296
14530
|
// src/features/rules/opencode-rule.ts
|
|
14297
|
-
import { join as
|
|
14531
|
+
import { join as join107 } from "path";
|
|
14298
14532
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
14299
14533
|
static getSettablePaths({
|
|
14300
14534
|
global,
|
|
@@ -14329,7 +14563,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14329
14563
|
if (isRoot) {
|
|
14330
14564
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14331
14565
|
const fileContent2 = await readFileContent(
|
|
14332
|
-
|
|
14566
|
+
join107(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14333
14567
|
);
|
|
14334
14568
|
return new _OpenCodeRule({
|
|
14335
14569
|
baseDir,
|
|
@@ -14343,8 +14577,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14343
14577
|
if (!paths.nonRoot) {
|
|
14344
14578
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14345
14579
|
}
|
|
14346
|
-
const relativePath =
|
|
14347
|
-
const fileContent = await readFileContent(
|
|
14580
|
+
const relativePath = join107(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14581
|
+
const fileContent = await readFileContent(join107(baseDir, relativePath));
|
|
14348
14582
|
return new _OpenCodeRule({
|
|
14349
14583
|
baseDir,
|
|
14350
14584
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14403,7 +14637,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14403
14637
|
};
|
|
14404
14638
|
|
|
14405
14639
|
// src/features/rules/qwencode-rule.ts
|
|
14406
|
-
import { join as
|
|
14640
|
+
import { join as join108 } from "path";
|
|
14407
14641
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
14408
14642
|
static getSettablePaths(_options = {}) {
|
|
14409
14643
|
return {
|
|
@@ -14422,8 +14656,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14422
14656
|
validate = true
|
|
14423
14657
|
}) {
|
|
14424
14658
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
14425
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
14426
|
-
const fileContent = await readFileContent(
|
|
14659
|
+
const relativePath = isRoot ? "QWEN.md" : join108(".qwen", "memories", relativeFilePath);
|
|
14660
|
+
const fileContent = await readFileContent(join108(baseDir, relativePath));
|
|
14427
14661
|
return new _QwencodeRule({
|
|
14428
14662
|
baseDir,
|
|
14429
14663
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14475,7 +14709,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14475
14709
|
};
|
|
14476
14710
|
|
|
14477
14711
|
// src/features/rules/replit-rule.ts
|
|
14478
|
-
import { join as
|
|
14712
|
+
import { join as join109 } from "path";
|
|
14479
14713
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
14480
14714
|
static getSettablePaths(_options = {}) {
|
|
14481
14715
|
return {
|
|
@@ -14497,7 +14731,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14497
14731
|
}
|
|
14498
14732
|
const relativePath = paths.root.relativeFilePath;
|
|
14499
14733
|
const fileContent = await readFileContent(
|
|
14500
|
-
|
|
14734
|
+
join109(baseDir, paths.root.relativeDirPath, relativePath)
|
|
14501
14735
|
);
|
|
14502
14736
|
return new _ReplitRule({
|
|
14503
14737
|
baseDir,
|
|
@@ -14563,7 +14797,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14563
14797
|
};
|
|
14564
14798
|
|
|
14565
14799
|
// src/features/rules/roo-rule.ts
|
|
14566
|
-
import { join as
|
|
14800
|
+
import { join as join110 } from "path";
|
|
14567
14801
|
var RooRule = class _RooRule extends ToolRule {
|
|
14568
14802
|
static getSettablePaths(_options = {}) {
|
|
14569
14803
|
return {
|
|
@@ -14578,7 +14812,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14578
14812
|
validate = true
|
|
14579
14813
|
}) {
|
|
14580
14814
|
const fileContent = await readFileContent(
|
|
14581
|
-
|
|
14815
|
+
join110(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14582
14816
|
);
|
|
14583
14817
|
return new _RooRule({
|
|
14584
14818
|
baseDir,
|
|
@@ -14647,7 +14881,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14647
14881
|
};
|
|
14648
14882
|
|
|
14649
14883
|
// src/features/rules/warp-rule.ts
|
|
14650
|
-
import { join as
|
|
14884
|
+
import { join as join111 } from "path";
|
|
14651
14885
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
14652
14886
|
constructor({ fileContent, root, ...rest }) {
|
|
14653
14887
|
super({
|
|
@@ -14673,8 +14907,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14673
14907
|
validate = true
|
|
14674
14908
|
}) {
|
|
14675
14909
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
14676
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
14677
|
-
const fileContent = await readFileContent(
|
|
14910
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join111(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
14911
|
+
const fileContent = await readFileContent(join111(baseDir, relativePath));
|
|
14678
14912
|
return new _WarpRule({
|
|
14679
14913
|
baseDir,
|
|
14680
14914
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -14729,7 +14963,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14729
14963
|
};
|
|
14730
14964
|
|
|
14731
14965
|
// src/features/rules/windsurf-rule.ts
|
|
14732
|
-
import { join as
|
|
14966
|
+
import { join as join112 } from "path";
|
|
14733
14967
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
14734
14968
|
static getSettablePaths(_options = {}) {
|
|
14735
14969
|
return {
|
|
@@ -14744,7 +14978,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
14744
14978
|
validate = true
|
|
14745
14979
|
}) {
|
|
14746
14980
|
const fileContent = await readFileContent(
|
|
14747
|
-
|
|
14981
|
+
join112(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14748
14982
|
);
|
|
14749
14983
|
return new _WindsurfRule({
|
|
14750
14984
|
baseDir,
|
|
@@ -14820,8 +15054,8 @@ var rulesProcessorToolTargets = [
|
|
|
14820
15054
|
"warp",
|
|
14821
15055
|
"windsurf"
|
|
14822
15056
|
];
|
|
14823
|
-
var RulesProcessorToolTargetSchema =
|
|
14824
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
15057
|
+
var RulesProcessorToolTargetSchema = z54.enum(rulesProcessorToolTargets);
|
|
15058
|
+
var formatRulePaths = (rules) => rules.map((r) => join113(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
14825
15059
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
14826
15060
|
[
|
|
14827
15061
|
"agentsmd",
|
|
@@ -15196,7 +15430,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15196
15430
|
}).relativeDirPath;
|
|
15197
15431
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
15198
15432
|
const frontmatter = skill.getFrontmatter();
|
|
15199
|
-
const relativePath =
|
|
15433
|
+
const relativePath = join113(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
15200
15434
|
return {
|
|
15201
15435
|
name: frontmatter.name,
|
|
15202
15436
|
description: frontmatter.description,
|
|
@@ -15309,8 +15543,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15309
15543
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
15310
15544
|
*/
|
|
15311
15545
|
async loadRulesyncFiles() {
|
|
15312
|
-
const rulesyncBaseDir =
|
|
15313
|
-
const files = await findFilesByGlobs(
|
|
15546
|
+
const rulesyncBaseDir = join113(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
15547
|
+
const files = await findFilesByGlobs(join113(rulesyncBaseDir, "**", "*.md"));
|
|
15314
15548
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
15315
15549
|
const rulesyncRules = await Promise.all(
|
|
15316
15550
|
files.map((file) => {
|
|
@@ -15377,7 +15611,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15377
15611
|
return [];
|
|
15378
15612
|
}
|
|
15379
15613
|
const rootFilePaths = await findFilesByGlobs(
|
|
15380
|
-
|
|
15614
|
+
join113(
|
|
15381
15615
|
this.baseDir,
|
|
15382
15616
|
settablePaths.root.relativeDirPath ?? ".",
|
|
15383
15617
|
settablePaths.root.relativeFilePath
|
|
@@ -15415,7 +15649,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15415
15649
|
return [];
|
|
15416
15650
|
}
|
|
15417
15651
|
const localRootFilePaths = await findFilesByGlobs(
|
|
15418
|
-
|
|
15652
|
+
join113(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
15419
15653
|
);
|
|
15420
15654
|
return localRootFilePaths.map(
|
|
15421
15655
|
(filePath) => factory.class.forDeletion({
|
|
@@ -15431,9 +15665,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15431
15665
|
if (!settablePaths.nonRoot) {
|
|
15432
15666
|
return [];
|
|
15433
15667
|
}
|
|
15434
|
-
const nonRootBaseDir =
|
|
15668
|
+
const nonRootBaseDir = join113(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
15435
15669
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
15436
|
-
|
|
15670
|
+
join113(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
15437
15671
|
);
|
|
15438
15672
|
if (forDeletion) {
|
|
15439
15673
|
return nonRootFilePaths.map((filePath) => {
|
|
@@ -15565,14 +15799,14 @@ s/<command> [arguments]
|
|
|
15565
15799
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
15566
15800
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
15567
15801
|
|
|
15568
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
15802
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join113(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
15569
15803
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
15570
15804
|
|
|
15571
15805
|
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.
|
|
15572
15806
|
|
|
15573
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
15807
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join113(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
15574
15808
|
|
|
15575
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
15809
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join113(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
15576
15810
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
15577
15811
|
const result = [
|
|
15578
15812
|
overview,
|
|
@@ -15644,7 +15878,7 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
15644
15878
|
return { count: totalCount, paths: [], hasDiff };
|
|
15645
15879
|
}
|
|
15646
15880
|
async function checkRulesyncDirExists(params) {
|
|
15647
|
-
return fileExists(
|
|
15881
|
+
return fileExists(join114(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
15648
15882
|
}
|
|
15649
15883
|
async function generate(params) {
|
|
15650
15884
|
const { config } = params;
|