rulesync 7.21.0 → 7.23.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 +3 -2
- package/dist/{chunk-UYWCICY6.js → chunk-GAWAOFCL.js} +1352 -629
- package/dist/cli/index.cjs +1622 -892
- package/dist/cli/index.js +12 -3
- package/dist/index.cjs +1374 -653
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +1 -1
- package/package.json +21 -17
|
@@ -24,7 +24,8 @@ var ALL_FEATURES = [
|
|
|
24
24
|
"subagents",
|
|
25
25
|
"commands",
|
|
26
26
|
"skills",
|
|
27
|
-
"hooks"
|
|
27
|
+
"hooks",
|
|
28
|
+
"permissions"
|
|
28
29
|
];
|
|
29
30
|
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
30
31
|
var FeatureSchema = z.enum(ALL_FEATURES);
|
|
@@ -49,6 +50,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
49
50
|
"copilot",
|
|
50
51
|
"copilotcli",
|
|
51
52
|
"cursor",
|
|
53
|
+
"deepagents",
|
|
52
54
|
"factorydroid",
|
|
53
55
|
"geminicli",
|
|
54
56
|
"goose",
|
|
@@ -82,6 +84,10 @@ var RULESYNC_COMMANDS_RELATIVE_DIR_PATH = join(RULESYNC_RELATIVE_DIR_PATH, "comm
|
|
|
82
84
|
var RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH = join(RULESYNC_RELATIVE_DIR_PATH, "subagents");
|
|
83
85
|
var RULESYNC_MCP_RELATIVE_FILE_PATH = join(RULESYNC_RELATIVE_DIR_PATH, "mcp.json");
|
|
84
86
|
var RULESYNC_HOOKS_RELATIVE_FILE_PATH = join(RULESYNC_RELATIVE_DIR_PATH, "hooks.json");
|
|
87
|
+
var RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH = join(
|
|
88
|
+
RULESYNC_RELATIVE_DIR_PATH,
|
|
89
|
+
"permissions.json"
|
|
90
|
+
);
|
|
85
91
|
var RULESYNC_AIIGNORE_FILE_NAME = ".aiignore";
|
|
86
92
|
var RULESYNC_AIIGNORE_RELATIVE_FILE_PATH = join(RULESYNC_RELATIVE_DIR_PATH, ".aiignore");
|
|
87
93
|
var RULESYNC_IGNORE_RELATIVE_FILE_PATH = ".rulesyncignore";
|
|
@@ -94,6 +100,7 @@ var RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = join(
|
|
|
94
100
|
var RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH = "rulesync.lock";
|
|
95
101
|
var RULESYNC_MCP_FILE_NAME = "mcp.json";
|
|
96
102
|
var RULESYNC_HOOKS_FILE_NAME = "hooks.json";
|
|
103
|
+
var RULESYNC_PERMISSIONS_FILE_NAME = "permissions.json";
|
|
97
104
|
var RULESYNC_CONFIG_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/config-schema.json";
|
|
98
105
|
var RULESYNC_MCP_SCHEMA_URL = "https://github.com/dyoshikawa/rulesync/releases/latest/download/mcp-schema.json";
|
|
99
106
|
var MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
@@ -595,7 +602,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
595
602
|
}
|
|
596
603
|
|
|
597
604
|
// src/lib/generate.ts
|
|
598
|
-
import { join as
|
|
605
|
+
import { join as join123 } from "path";
|
|
599
606
|
import { intersection } from "es-toolkit";
|
|
600
607
|
|
|
601
608
|
// src/features/commands/commands-processor.ts
|
|
@@ -2917,7 +2924,7 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2917
2924
|
meta: {
|
|
2918
2925
|
extension: "md",
|
|
2919
2926
|
supportsProject: true,
|
|
2920
|
-
supportsGlobal:
|
|
2927
|
+
supportsGlobal: false,
|
|
2921
2928
|
isSimulated: true,
|
|
2922
2929
|
supportsSubdirectory: false
|
|
2923
2930
|
}
|
|
@@ -3279,6 +3286,15 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
3279
3286
|
"notification",
|
|
3280
3287
|
"setup"
|
|
3281
3288
|
];
|
|
3289
|
+
var DEEPAGENTS_HOOK_EVENTS = [
|
|
3290
|
+
"sessionStart",
|
|
3291
|
+
"sessionEnd",
|
|
3292
|
+
"beforeSubmitPrompt",
|
|
3293
|
+
"permissionRequest",
|
|
3294
|
+
"postToolUseFailure",
|
|
3295
|
+
"stop",
|
|
3296
|
+
"preCompact"
|
|
3297
|
+
];
|
|
3282
3298
|
var GEMINICLI_HOOK_EVENTS = [
|
|
3283
3299
|
"sessionStart",
|
|
3284
3300
|
"sessionEnd",
|
|
@@ -3301,7 +3317,8 @@ var HooksConfigSchema = z15.looseObject({
|
|
|
3301
3317
|
copilot: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3302
3318
|
opencode: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3303
3319
|
factorydroid: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3304
|
-
geminicli: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) }))
|
|
3320
|
+
geminicli: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3321
|
+
deepagents: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) }))
|
|
3305
3322
|
});
|
|
3306
3323
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3307
3324
|
sessionStart: "SessionStart",
|
|
@@ -3398,6 +3415,18 @@ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
|
|
|
3398
3415
|
var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3399
3416
|
Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3400
3417
|
);
|
|
3418
|
+
var CANONICAL_TO_DEEPAGENTS_EVENT_NAMES = {
|
|
3419
|
+
sessionStart: "session.start",
|
|
3420
|
+
sessionEnd: "session.end",
|
|
3421
|
+
beforeSubmitPrompt: "user.prompt",
|
|
3422
|
+
permissionRequest: "permission.request",
|
|
3423
|
+
postToolUseFailure: "tool.error",
|
|
3424
|
+
stop: "task.complete",
|
|
3425
|
+
preCompact: "context.compact"
|
|
3426
|
+
};
|
|
3427
|
+
var DEEPAGENTS_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3428
|
+
Object.entries(CANONICAL_TO_DEEPAGENTS_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3429
|
+
);
|
|
3401
3430
|
|
|
3402
3431
|
// src/features/hooks/claudecode-hooks.ts
|
|
3403
3432
|
import { join as join22 } from "path";
|
|
@@ -4000,8 +4029,145 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4000
4029
|
}
|
|
4001
4030
|
};
|
|
4002
4031
|
|
|
4003
|
-
// src/features/hooks/
|
|
4032
|
+
// src/features/hooks/deepagents-hooks.ts
|
|
4004
4033
|
import { join as join25 } from "path";
|
|
4034
|
+
function isDeepagentsHooksFile(val) {
|
|
4035
|
+
if (typeof val !== "object" || val === null || !("hooks" in val)) return false;
|
|
4036
|
+
return Array.isArray(val.hooks);
|
|
4037
|
+
}
|
|
4038
|
+
function canonicalToDeepagentsHooks(config) {
|
|
4039
|
+
const supported = new Set(DEEPAGENTS_HOOK_EVENTS);
|
|
4040
|
+
const effectiveHooks = {
|
|
4041
|
+
...config.hooks,
|
|
4042
|
+
...config.deepagents?.hooks
|
|
4043
|
+
};
|
|
4044
|
+
const entries = [];
|
|
4045
|
+
for (const [canonicalEvent, definitions] of Object.entries(effectiveHooks)) {
|
|
4046
|
+
if (!supported.has(canonicalEvent)) continue;
|
|
4047
|
+
const deepagentsEvent = CANONICAL_TO_DEEPAGENTS_EVENT_NAMES[canonicalEvent];
|
|
4048
|
+
if (!deepagentsEvent) continue;
|
|
4049
|
+
for (const def of definitions) {
|
|
4050
|
+
if (def.type === "prompt") continue;
|
|
4051
|
+
if (!def.command) continue;
|
|
4052
|
+
if (def.matcher) continue;
|
|
4053
|
+
entries.push({
|
|
4054
|
+
command: ["bash", "-c", def.command],
|
|
4055
|
+
events: [deepagentsEvent]
|
|
4056
|
+
});
|
|
4057
|
+
}
|
|
4058
|
+
}
|
|
4059
|
+
return entries;
|
|
4060
|
+
}
|
|
4061
|
+
function deepagentsToCanonicalHooks(hooksEntries) {
|
|
4062
|
+
const canonical = {};
|
|
4063
|
+
for (const entry of hooksEntries) {
|
|
4064
|
+
if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
|
|
4065
|
+
let command;
|
|
4066
|
+
if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
|
|
4067
|
+
command = entry.command[2] ?? "";
|
|
4068
|
+
} else {
|
|
4069
|
+
command = entry.command.join(" ");
|
|
4070
|
+
}
|
|
4071
|
+
const events = entry.events ?? [];
|
|
4072
|
+
for (const deepagentsEvent of events) {
|
|
4073
|
+
const canonicalEvent = DEEPAGENTS_TO_CANONICAL_EVENT_NAMES[deepagentsEvent];
|
|
4074
|
+
if (!canonicalEvent) continue;
|
|
4075
|
+
const existing = canonical[canonicalEvent];
|
|
4076
|
+
if (existing) {
|
|
4077
|
+
existing.push({ type: "command", command });
|
|
4078
|
+
} else {
|
|
4079
|
+
canonical[canonicalEvent] = [{ type: "command", command }];
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4083
|
+
return canonical;
|
|
4084
|
+
}
|
|
4085
|
+
var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
4086
|
+
constructor(params) {
|
|
4087
|
+
super({
|
|
4088
|
+
...params,
|
|
4089
|
+
fileContent: params.fileContent ?? JSON.stringify({ hooks: [] }, null, 2)
|
|
4090
|
+
});
|
|
4091
|
+
}
|
|
4092
|
+
isDeletable() {
|
|
4093
|
+
return true;
|
|
4094
|
+
}
|
|
4095
|
+
static getSettablePaths(_options = {}) {
|
|
4096
|
+
return {
|
|
4097
|
+
relativeDirPath: ".deepagents",
|
|
4098
|
+
relativeFilePath: "hooks.json"
|
|
4099
|
+
};
|
|
4100
|
+
}
|
|
4101
|
+
static async fromFile({
|
|
4102
|
+
baseDir = process.cwd(),
|
|
4103
|
+
validate = true,
|
|
4104
|
+
global = false
|
|
4105
|
+
}) {
|
|
4106
|
+
const paths = _DeepagentsHooks.getSettablePaths({ global });
|
|
4107
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4108
|
+
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({ hooks: [] }, null, 2);
|
|
4109
|
+
return new _DeepagentsHooks({
|
|
4110
|
+
baseDir,
|
|
4111
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4112
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4113
|
+
fileContent,
|
|
4114
|
+
validate
|
|
4115
|
+
});
|
|
4116
|
+
}
|
|
4117
|
+
static fromRulesyncHooks({
|
|
4118
|
+
baseDir = process.cwd(),
|
|
4119
|
+
rulesyncHooks,
|
|
4120
|
+
validate = true,
|
|
4121
|
+
global = false
|
|
4122
|
+
}) {
|
|
4123
|
+
const config = rulesyncHooks.getJson();
|
|
4124
|
+
const hooks = canonicalToDeepagentsHooks(config);
|
|
4125
|
+
const fileContent = JSON.stringify({ hooks }, null, 2);
|
|
4126
|
+
const paths = _DeepagentsHooks.getSettablePaths({ global });
|
|
4127
|
+
return new _DeepagentsHooks({
|
|
4128
|
+
baseDir,
|
|
4129
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4130
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4131
|
+
fileContent,
|
|
4132
|
+
validate
|
|
4133
|
+
});
|
|
4134
|
+
}
|
|
4135
|
+
toRulesyncHooks() {
|
|
4136
|
+
let parsed;
|
|
4137
|
+
try {
|
|
4138
|
+
parsed = JSON.parse(this.getFileContent());
|
|
4139
|
+
} catch (error) {
|
|
4140
|
+
throw new Error(
|
|
4141
|
+
`Failed to parse deepagents hooks content in ${join25(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4142
|
+
{ cause: error }
|
|
4143
|
+
);
|
|
4144
|
+
}
|
|
4145
|
+
const hooksEntries = isDeepagentsHooksFile(parsed) ? parsed.hooks : [];
|
|
4146
|
+
const hooks = deepagentsToCanonicalHooks(hooksEntries);
|
|
4147
|
+
return this.toRulesyncHooksDefault({
|
|
4148
|
+
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
4149
|
+
});
|
|
4150
|
+
}
|
|
4151
|
+
validate() {
|
|
4152
|
+
return { success: true, error: null };
|
|
4153
|
+
}
|
|
4154
|
+
static forDeletion({
|
|
4155
|
+
baseDir = process.cwd(),
|
|
4156
|
+
relativeDirPath,
|
|
4157
|
+
relativeFilePath
|
|
4158
|
+
}) {
|
|
4159
|
+
return new _DeepagentsHooks({
|
|
4160
|
+
baseDir,
|
|
4161
|
+
relativeDirPath,
|
|
4162
|
+
relativeFilePath,
|
|
4163
|
+
fileContent: JSON.stringify({ hooks: [] }, null, 2),
|
|
4164
|
+
validate: false
|
|
4165
|
+
});
|
|
4166
|
+
}
|
|
4167
|
+
};
|
|
4168
|
+
|
|
4169
|
+
// src/features/hooks/factorydroid-hooks.ts
|
|
4170
|
+
import { join as join26 } from "path";
|
|
4005
4171
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
4006
4172
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
4007
4173
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -4027,7 +4193,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4027
4193
|
global = false
|
|
4028
4194
|
}) {
|
|
4029
4195
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4030
|
-
const filePath =
|
|
4196
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4031
4197
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4032
4198
|
return new _FactorydroidHooks({
|
|
4033
4199
|
baseDir,
|
|
@@ -4045,7 +4211,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4045
4211
|
logger
|
|
4046
4212
|
}) {
|
|
4047
4213
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4048
|
-
const filePath =
|
|
4214
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4049
4215
|
const existingContent = await readOrInitializeFileContent(
|
|
4050
4216
|
filePath,
|
|
4051
4217
|
JSON.stringify({}, null, 2)
|
|
@@ -4082,7 +4248,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4082
4248
|
settings = JSON.parse(this.getFileContent());
|
|
4083
4249
|
} catch (error) {
|
|
4084
4250
|
throw new Error(
|
|
4085
|
-
`Failed to parse Factory Droid hooks content in ${
|
|
4251
|
+
`Failed to parse Factory Droid hooks content in ${join26(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4086
4252
|
{
|
|
4087
4253
|
cause: error
|
|
4088
4254
|
}
|
|
@@ -4115,7 +4281,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4115
4281
|
};
|
|
4116
4282
|
|
|
4117
4283
|
// src/features/hooks/geminicli-hooks.ts
|
|
4118
|
-
import { join as
|
|
4284
|
+
import { join as join27 } from "path";
|
|
4119
4285
|
import { z as z17 } from "zod/mini";
|
|
4120
4286
|
function canonicalToGeminicliHooks(config) {
|
|
4121
4287
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
@@ -4224,7 +4390,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4224
4390
|
global = false
|
|
4225
4391
|
}) {
|
|
4226
4392
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4227
|
-
const filePath =
|
|
4393
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4228
4394
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4229
4395
|
return new _GeminicliHooks({
|
|
4230
4396
|
baseDir,
|
|
@@ -4241,7 +4407,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4241
4407
|
global = false
|
|
4242
4408
|
}) {
|
|
4243
4409
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4244
|
-
const filePath =
|
|
4410
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4245
4411
|
const existingContent = await readOrInitializeFileContent(
|
|
4246
4412
|
filePath,
|
|
4247
4413
|
JSON.stringify({}, null, 2)
|
|
@@ -4273,7 +4439,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4273
4439
|
settings = JSON.parse(this.getFileContent());
|
|
4274
4440
|
} catch (error) {
|
|
4275
4441
|
throw new Error(
|
|
4276
|
-
`Failed to parse Gemini CLI hooks content in ${
|
|
4442
|
+
`Failed to parse Gemini CLI hooks content in ${join27(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4277
4443
|
{
|
|
4278
4444
|
cause: error
|
|
4279
4445
|
}
|
|
@@ -4303,7 +4469,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4303
4469
|
};
|
|
4304
4470
|
|
|
4305
4471
|
// src/features/hooks/opencode-hooks.ts
|
|
4306
|
-
import { join as
|
|
4472
|
+
import { join as join28 } from "path";
|
|
4307
4473
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
4308
4474
|
function escapeForTemplateLiteral(command) {
|
|
4309
4475
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4401,7 +4567,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4401
4567
|
}
|
|
4402
4568
|
static getSettablePaths(options) {
|
|
4403
4569
|
return {
|
|
4404
|
-
relativeDirPath: options?.global ?
|
|
4570
|
+
relativeDirPath: options?.global ? join28(".config", "opencode", "plugins") : join28(".opencode", "plugins"),
|
|
4405
4571
|
relativeFilePath: "rulesync-hooks.js"
|
|
4406
4572
|
};
|
|
4407
4573
|
}
|
|
@@ -4412,7 +4578,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4412
4578
|
}) {
|
|
4413
4579
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4414
4580
|
const fileContent = await readFileContent(
|
|
4415
|
-
|
|
4581
|
+
join28(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4416
4582
|
);
|
|
4417
4583
|
return new _OpencodeHooks({
|
|
4418
4584
|
baseDir,
|
|
@@ -4467,7 +4633,8 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4467
4633
|
"copilot",
|
|
4468
4634
|
"opencode",
|
|
4469
4635
|
"factorydroid",
|
|
4470
|
-
"geminicli"
|
|
4636
|
+
"geminicli",
|
|
4637
|
+
"deepagents"
|
|
4471
4638
|
];
|
|
4472
4639
|
var HooksProcessorToolTargetSchema = z18.enum(hooksProcessorToolTargetTuple);
|
|
4473
4640
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
@@ -4550,11 +4717,21 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
|
4550
4717
|
supportedHookTypes: ["command"],
|
|
4551
4718
|
supportsMatcher: true
|
|
4552
4719
|
}
|
|
4720
|
+
],
|
|
4721
|
+
[
|
|
4722
|
+
"deepagents",
|
|
4723
|
+
{
|
|
4724
|
+
class: DeepagentsHooks,
|
|
4725
|
+
meta: { supportsProject: false, supportsGlobal: true, supportsImport: true },
|
|
4726
|
+
supportedEvents: DEEPAGENTS_HOOK_EVENTS,
|
|
4727
|
+
supportedHookTypes: ["command"],
|
|
4728
|
+
supportsMatcher: false
|
|
4729
|
+
}
|
|
4553
4730
|
]
|
|
4554
4731
|
]);
|
|
4555
|
-
var hooksProcessorToolTargets = [...toolHooksFactories.
|
|
4732
|
+
var hooksProcessorToolTargets = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsProject).map(([t]) => t);
|
|
4556
4733
|
var hooksProcessorToolTargetsGlobal = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal).map(([t]) => t);
|
|
4557
|
-
var hooksProcessorToolTargetsImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsImport).map(([t]) => t);
|
|
4734
|
+
var hooksProcessorToolTargetsImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsProject && f.meta.supportsImport).map(([t]) => t);
|
|
4558
4735
|
var hooksProcessorToolTargetsGlobalImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal && f.meta.supportsImport).map(([t]) => t);
|
|
4559
4736
|
var HooksProcessor = class extends FeatureProcessor {
|
|
4560
4737
|
toolTarget;
|
|
@@ -4708,10 +4885,10 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4708
4885
|
import { z as z19 } from "zod/mini";
|
|
4709
4886
|
|
|
4710
4887
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4711
|
-
import { join as
|
|
4888
|
+
import { join as join30 } from "path";
|
|
4712
4889
|
|
|
4713
4890
|
// src/features/ignore/rulesync-ignore.ts
|
|
4714
|
-
import { join as
|
|
4891
|
+
import { join as join29 } from "path";
|
|
4715
4892
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4716
4893
|
validate() {
|
|
4717
4894
|
return { success: true, error: null };
|
|
@@ -4731,12 +4908,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4731
4908
|
static async fromFile() {
|
|
4732
4909
|
const baseDir = process.cwd();
|
|
4733
4910
|
const paths = this.getSettablePaths();
|
|
4734
|
-
const recommendedPath =
|
|
4911
|
+
const recommendedPath = join29(
|
|
4735
4912
|
baseDir,
|
|
4736
4913
|
paths.recommended.relativeDirPath,
|
|
4737
4914
|
paths.recommended.relativeFilePath
|
|
4738
4915
|
);
|
|
4739
|
-
const legacyPath =
|
|
4916
|
+
const legacyPath = join29(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4740
4917
|
if (await fileExists(recommendedPath)) {
|
|
4741
4918
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4742
4919
|
return new _RulesyncIgnore({
|
|
@@ -4852,7 +5029,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4852
5029
|
validate = true
|
|
4853
5030
|
}) {
|
|
4854
5031
|
const fileContent = await readFileContent(
|
|
4855
|
-
|
|
5032
|
+
join30(
|
|
4856
5033
|
baseDir,
|
|
4857
5034
|
this.getSettablePaths().relativeDirPath,
|
|
4858
5035
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4882,7 +5059,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4882
5059
|
};
|
|
4883
5060
|
|
|
4884
5061
|
// src/features/ignore/claudecode-ignore.ts
|
|
4885
|
-
import { join as
|
|
5062
|
+
import { join as join31 } from "path";
|
|
4886
5063
|
import { uniq } from "es-toolkit";
|
|
4887
5064
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4888
5065
|
constructor(params) {
|
|
@@ -4925,7 +5102,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4925
5102
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4926
5103
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4927
5104
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4928
|
-
const filePath =
|
|
5105
|
+
const filePath = join31(
|
|
4929
5106
|
baseDir,
|
|
4930
5107
|
this.getSettablePaths().relativeDirPath,
|
|
4931
5108
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4961,7 +5138,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4961
5138
|
validate = true
|
|
4962
5139
|
}) {
|
|
4963
5140
|
const fileContent = await readFileContent(
|
|
4964
|
-
|
|
5141
|
+
join31(
|
|
4965
5142
|
baseDir,
|
|
4966
5143
|
this.getSettablePaths().relativeDirPath,
|
|
4967
5144
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4991,7 +5168,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4991
5168
|
};
|
|
4992
5169
|
|
|
4993
5170
|
// src/features/ignore/cline-ignore.ts
|
|
4994
|
-
import { join as
|
|
5171
|
+
import { join as join32 } from "path";
|
|
4995
5172
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4996
5173
|
static getSettablePaths() {
|
|
4997
5174
|
return {
|
|
@@ -5028,7 +5205,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5028
5205
|
validate = true
|
|
5029
5206
|
}) {
|
|
5030
5207
|
const fileContent = await readFileContent(
|
|
5031
|
-
|
|
5208
|
+
join32(
|
|
5032
5209
|
baseDir,
|
|
5033
5210
|
this.getSettablePaths().relativeDirPath,
|
|
5034
5211
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5058,7 +5235,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5058
5235
|
};
|
|
5059
5236
|
|
|
5060
5237
|
// src/features/ignore/cursor-ignore.ts
|
|
5061
|
-
import { join as
|
|
5238
|
+
import { join as join33 } from "path";
|
|
5062
5239
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
5063
5240
|
static getSettablePaths() {
|
|
5064
5241
|
return {
|
|
@@ -5091,7 +5268,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5091
5268
|
validate = true
|
|
5092
5269
|
}) {
|
|
5093
5270
|
const fileContent = await readFileContent(
|
|
5094
|
-
|
|
5271
|
+
join33(
|
|
5095
5272
|
baseDir,
|
|
5096
5273
|
this.getSettablePaths().relativeDirPath,
|
|
5097
5274
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5121,7 +5298,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5121
5298
|
};
|
|
5122
5299
|
|
|
5123
5300
|
// src/features/ignore/geminicli-ignore.ts
|
|
5124
|
-
import { join as
|
|
5301
|
+
import { join as join34 } from "path";
|
|
5125
5302
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
5126
5303
|
static getSettablePaths() {
|
|
5127
5304
|
return {
|
|
@@ -5148,7 +5325,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5148
5325
|
validate = true
|
|
5149
5326
|
}) {
|
|
5150
5327
|
const fileContent = await readFileContent(
|
|
5151
|
-
|
|
5328
|
+
join34(
|
|
5152
5329
|
baseDir,
|
|
5153
5330
|
this.getSettablePaths().relativeDirPath,
|
|
5154
5331
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5178,7 +5355,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5178
5355
|
};
|
|
5179
5356
|
|
|
5180
5357
|
// src/features/ignore/goose-ignore.ts
|
|
5181
|
-
import { join as
|
|
5358
|
+
import { join as join35 } from "path";
|
|
5182
5359
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
5183
5360
|
static getSettablePaths() {
|
|
5184
5361
|
return {
|
|
@@ -5215,7 +5392,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5215
5392
|
validate = true
|
|
5216
5393
|
}) {
|
|
5217
5394
|
const fileContent = await readFileContent(
|
|
5218
|
-
|
|
5395
|
+
join35(
|
|
5219
5396
|
baseDir,
|
|
5220
5397
|
this.getSettablePaths().relativeDirPath,
|
|
5221
5398
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5245,7 +5422,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5245
5422
|
};
|
|
5246
5423
|
|
|
5247
5424
|
// src/features/ignore/junie-ignore.ts
|
|
5248
|
-
import { join as
|
|
5425
|
+
import { join as join36 } from "path";
|
|
5249
5426
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
5250
5427
|
static getSettablePaths() {
|
|
5251
5428
|
return {
|
|
@@ -5272,7 +5449,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5272
5449
|
validate = true
|
|
5273
5450
|
}) {
|
|
5274
5451
|
const fileContent = await readFileContent(
|
|
5275
|
-
|
|
5452
|
+
join36(
|
|
5276
5453
|
baseDir,
|
|
5277
5454
|
this.getSettablePaths().relativeDirPath,
|
|
5278
5455
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5302,7 +5479,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5302
5479
|
};
|
|
5303
5480
|
|
|
5304
5481
|
// src/features/ignore/kilo-ignore.ts
|
|
5305
|
-
import { join as
|
|
5482
|
+
import { join as join37 } from "path";
|
|
5306
5483
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
5307
5484
|
static getSettablePaths() {
|
|
5308
5485
|
return {
|
|
@@ -5339,7 +5516,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5339
5516
|
validate = true
|
|
5340
5517
|
}) {
|
|
5341
5518
|
const fileContent = await readFileContent(
|
|
5342
|
-
|
|
5519
|
+
join37(
|
|
5343
5520
|
baseDir,
|
|
5344
5521
|
this.getSettablePaths().relativeDirPath,
|
|
5345
5522
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5369,7 +5546,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5369
5546
|
};
|
|
5370
5547
|
|
|
5371
5548
|
// src/features/ignore/kiro-ignore.ts
|
|
5372
|
-
import { join as
|
|
5549
|
+
import { join as join38 } from "path";
|
|
5373
5550
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
5374
5551
|
static getSettablePaths() {
|
|
5375
5552
|
return {
|
|
@@ -5396,7 +5573,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5396
5573
|
validate = true
|
|
5397
5574
|
}) {
|
|
5398
5575
|
const fileContent = await readFileContent(
|
|
5399
|
-
|
|
5576
|
+
join38(
|
|
5400
5577
|
baseDir,
|
|
5401
5578
|
this.getSettablePaths().relativeDirPath,
|
|
5402
5579
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5426,7 +5603,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5426
5603
|
};
|
|
5427
5604
|
|
|
5428
5605
|
// src/features/ignore/qwencode-ignore.ts
|
|
5429
|
-
import { join as
|
|
5606
|
+
import { join as join39 } from "path";
|
|
5430
5607
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5431
5608
|
static getSettablePaths() {
|
|
5432
5609
|
return {
|
|
@@ -5453,7 +5630,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5453
5630
|
validate = true
|
|
5454
5631
|
}) {
|
|
5455
5632
|
const fileContent = await readFileContent(
|
|
5456
|
-
|
|
5633
|
+
join39(
|
|
5457
5634
|
baseDir,
|
|
5458
5635
|
this.getSettablePaths().relativeDirPath,
|
|
5459
5636
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5483,7 +5660,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5483
5660
|
};
|
|
5484
5661
|
|
|
5485
5662
|
// src/features/ignore/roo-ignore.ts
|
|
5486
|
-
import { join as
|
|
5663
|
+
import { join as join40 } from "path";
|
|
5487
5664
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5488
5665
|
static getSettablePaths() {
|
|
5489
5666
|
return {
|
|
@@ -5510,7 +5687,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5510
5687
|
validate = true
|
|
5511
5688
|
}) {
|
|
5512
5689
|
const fileContent = await readFileContent(
|
|
5513
|
-
|
|
5690
|
+
join40(
|
|
5514
5691
|
baseDir,
|
|
5515
5692
|
this.getSettablePaths().relativeDirPath,
|
|
5516
5693
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5540,7 +5717,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5540
5717
|
};
|
|
5541
5718
|
|
|
5542
5719
|
// src/features/ignore/windsurf-ignore.ts
|
|
5543
|
-
import { join as
|
|
5720
|
+
import { join as join41 } from "path";
|
|
5544
5721
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5545
5722
|
static getSettablePaths() {
|
|
5546
5723
|
return {
|
|
@@ -5567,7 +5744,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5567
5744
|
validate = true
|
|
5568
5745
|
}) {
|
|
5569
5746
|
const fileContent = await readFileContent(
|
|
5570
|
-
|
|
5747
|
+
join41(
|
|
5571
5748
|
baseDir,
|
|
5572
5749
|
this.getSettablePaths().relativeDirPath,
|
|
5573
5750
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5597,7 +5774,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5597
5774
|
};
|
|
5598
5775
|
|
|
5599
5776
|
// src/features/ignore/zed-ignore.ts
|
|
5600
|
-
import { join as
|
|
5777
|
+
import { join as join42 } from "path";
|
|
5601
5778
|
import { uniq as uniq2 } from "es-toolkit";
|
|
5602
5779
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5603
5780
|
constructor(params) {
|
|
@@ -5634,7 +5811,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5634
5811
|
}) {
|
|
5635
5812
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5636
5813
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5637
|
-
const filePath =
|
|
5814
|
+
const filePath = join42(
|
|
5638
5815
|
baseDir,
|
|
5639
5816
|
this.getSettablePaths().relativeDirPath,
|
|
5640
5817
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5661,7 +5838,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5661
5838
|
validate = true
|
|
5662
5839
|
}) {
|
|
5663
5840
|
const fileContent = await readFileContent(
|
|
5664
|
-
|
|
5841
|
+
join42(
|
|
5665
5842
|
baseDir,
|
|
5666
5843
|
this.getSettablePaths().relativeDirPath,
|
|
5667
5844
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5849,10 +6026,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5849
6026
|
import { z as z23 } from "zod/mini";
|
|
5850
6027
|
|
|
5851
6028
|
// src/features/mcp/claudecode-mcp.ts
|
|
5852
|
-
import { join as
|
|
6029
|
+
import { join as join44 } from "path";
|
|
5853
6030
|
|
|
5854
6031
|
// src/features/mcp/rulesync-mcp.ts
|
|
5855
|
-
import { join as
|
|
6032
|
+
import { join as join43 } from "path";
|
|
5856
6033
|
import { omit } from "es-toolkit/object";
|
|
5857
6034
|
import { z as z21 } from "zod/mini";
|
|
5858
6035
|
|
|
@@ -5931,12 +6108,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5931
6108
|
}) {
|
|
5932
6109
|
const baseDir = process.cwd();
|
|
5933
6110
|
const paths = this.getSettablePaths();
|
|
5934
|
-
const recommendedPath =
|
|
6111
|
+
const recommendedPath = join43(
|
|
5935
6112
|
baseDir,
|
|
5936
6113
|
paths.recommended.relativeDirPath,
|
|
5937
6114
|
paths.recommended.relativeFilePath
|
|
5938
6115
|
);
|
|
5939
|
-
const legacyPath =
|
|
6116
|
+
const legacyPath = join43(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5940
6117
|
if (await fileExists(recommendedPath)) {
|
|
5941
6118
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5942
6119
|
return new _RulesyncMcp({
|
|
@@ -6090,7 +6267,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6090
6267
|
global = false
|
|
6091
6268
|
}) {
|
|
6092
6269
|
const paths = this.getSettablePaths({ global });
|
|
6093
|
-
const fileContent = await readFileContentOrNull(
|
|
6270
|
+
const fileContent = await readFileContentOrNull(join44(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6094
6271
|
const json = JSON.parse(fileContent);
|
|
6095
6272
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6096
6273
|
return new _ClaudecodeMcp({
|
|
@@ -6109,7 +6286,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6109
6286
|
}) {
|
|
6110
6287
|
const paths = this.getSettablePaths({ global });
|
|
6111
6288
|
const fileContent = await readOrInitializeFileContent(
|
|
6112
|
-
|
|
6289
|
+
join44(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6113
6290
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6114
6291
|
);
|
|
6115
6292
|
const json = JSON.parse(fileContent);
|
|
@@ -6148,7 +6325,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6148
6325
|
};
|
|
6149
6326
|
|
|
6150
6327
|
// src/features/mcp/cline-mcp.ts
|
|
6151
|
-
import { join as
|
|
6328
|
+
import { join as join45 } from "path";
|
|
6152
6329
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
6153
6330
|
json;
|
|
6154
6331
|
constructor(params) {
|
|
@@ -6169,7 +6346,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6169
6346
|
validate = true
|
|
6170
6347
|
}) {
|
|
6171
6348
|
const fileContent = await readFileContent(
|
|
6172
|
-
|
|
6349
|
+
join45(
|
|
6173
6350
|
baseDir,
|
|
6174
6351
|
this.getSettablePaths().relativeDirPath,
|
|
6175
6352
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6218,7 +6395,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6218
6395
|
};
|
|
6219
6396
|
|
|
6220
6397
|
// src/features/mcp/codexcli-mcp.ts
|
|
6221
|
-
import { join as
|
|
6398
|
+
import { join as join46 } from "path";
|
|
6222
6399
|
import * as smolToml from "smol-toml";
|
|
6223
6400
|
function convertFromCodexFormat(codexMcp) {
|
|
6224
6401
|
const result = {};
|
|
@@ -6301,7 +6478,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6301
6478
|
global = false
|
|
6302
6479
|
}) {
|
|
6303
6480
|
const paths = this.getSettablePaths({ global });
|
|
6304
|
-
const fileContent = await readFileContentOrNull(
|
|
6481
|
+
const fileContent = await readFileContentOrNull(join46(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
6305
6482
|
return new _CodexcliMcp({
|
|
6306
6483
|
baseDir,
|
|
6307
6484
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6317,7 +6494,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6317
6494
|
global = false
|
|
6318
6495
|
}) {
|
|
6319
6496
|
const paths = this.getSettablePaths({ global });
|
|
6320
|
-
const configTomlFilePath =
|
|
6497
|
+
const configTomlFilePath = join46(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6321
6498
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
6322
6499
|
configTomlFilePath,
|
|
6323
6500
|
smolToml.stringify({})
|
|
@@ -6371,7 +6548,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6371
6548
|
};
|
|
6372
6549
|
|
|
6373
6550
|
// src/features/mcp/copilot-mcp.ts
|
|
6374
|
-
import { join as
|
|
6551
|
+
import { join as join47 } from "path";
|
|
6375
6552
|
function convertToCopilotFormat(mcpServers) {
|
|
6376
6553
|
return { servers: mcpServers };
|
|
6377
6554
|
}
|
|
@@ -6398,7 +6575,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6398
6575
|
validate = true
|
|
6399
6576
|
}) {
|
|
6400
6577
|
const fileContent = await readFileContent(
|
|
6401
|
-
|
|
6578
|
+
join47(
|
|
6402
6579
|
baseDir,
|
|
6403
6580
|
this.getSettablePaths().relativeDirPath,
|
|
6404
6581
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6451,7 +6628,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6451
6628
|
};
|
|
6452
6629
|
|
|
6453
6630
|
// src/features/mcp/copilotcli-mcp.ts
|
|
6454
|
-
import { join as
|
|
6631
|
+
import { join as join48 } from "path";
|
|
6455
6632
|
function addTypeField(mcpServers) {
|
|
6456
6633
|
const result = {};
|
|
6457
6634
|
for (const [name, server] of Object.entries(mcpServers)) {
|
|
@@ -6526,7 +6703,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6526
6703
|
global = false
|
|
6527
6704
|
}) {
|
|
6528
6705
|
const paths = this.getSettablePaths({ global });
|
|
6529
|
-
const fileContent = await readFileContentOrNull(
|
|
6706
|
+
const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6530
6707
|
const json = JSON.parse(fileContent);
|
|
6531
6708
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6532
6709
|
return new _CopilotcliMcp({
|
|
@@ -6546,7 +6723,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6546
6723
|
}) {
|
|
6547
6724
|
const paths = this.getSettablePaths({ global });
|
|
6548
6725
|
const fileContent = await readOrInitializeFileContent(
|
|
6549
|
-
|
|
6726
|
+
join48(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6550
6727
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6551
6728
|
);
|
|
6552
6729
|
const json = JSON.parse(fileContent);
|
|
@@ -6588,7 +6765,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6588
6765
|
};
|
|
6589
6766
|
|
|
6590
6767
|
// src/features/mcp/cursor-mcp.ts
|
|
6591
|
-
import { join as
|
|
6768
|
+
import { join as join49 } from "path";
|
|
6592
6769
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6593
6770
|
function isMcpServers(value) {
|
|
6594
6771
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6638,7 +6815,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6638
6815
|
this.json = JSON.parse(this.fileContent);
|
|
6639
6816
|
} catch (error) {
|
|
6640
6817
|
throw new Error(
|
|
6641
|
-
`Failed to parse Cursor MCP config at ${
|
|
6818
|
+
`Failed to parse Cursor MCP config at ${join49(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
6642
6819
|
{ cause: error }
|
|
6643
6820
|
);
|
|
6644
6821
|
}
|
|
@@ -6664,14 +6841,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6664
6841
|
global = false
|
|
6665
6842
|
}) {
|
|
6666
6843
|
const paths = this.getSettablePaths({ global });
|
|
6667
|
-
const filePath =
|
|
6844
|
+
const filePath = join49(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6668
6845
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
6669
6846
|
let json;
|
|
6670
6847
|
try {
|
|
6671
6848
|
json = JSON.parse(fileContent);
|
|
6672
6849
|
} catch (error) {
|
|
6673
6850
|
throw new Error(
|
|
6674
|
-
`Failed to parse Cursor MCP config at ${
|
|
6851
|
+
`Failed to parse Cursor MCP config at ${join49(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6675
6852
|
{ cause: error }
|
|
6676
6853
|
);
|
|
6677
6854
|
}
|
|
@@ -6693,7 +6870,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6693
6870
|
}) {
|
|
6694
6871
|
const paths = this.getSettablePaths({ global });
|
|
6695
6872
|
const fileContent = await readOrInitializeFileContent(
|
|
6696
|
-
|
|
6873
|
+
join49(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6697
6874
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6698
6875
|
);
|
|
6699
6876
|
let json;
|
|
@@ -6701,7 +6878,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6701
6878
|
json = JSON.parse(fileContent);
|
|
6702
6879
|
} catch (error) {
|
|
6703
6880
|
throw new Error(
|
|
6704
|
-
`Failed to parse Cursor MCP config at ${
|
|
6881
|
+
`Failed to parse Cursor MCP config at ${join49(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6705
6882
|
{ cause: error }
|
|
6706
6883
|
);
|
|
6707
6884
|
}
|
|
@@ -6749,64 +6926,147 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6749
6926
|
}
|
|
6750
6927
|
};
|
|
6751
6928
|
|
|
6752
|
-
// src/features/mcp/
|
|
6753
|
-
import { join as
|
|
6754
|
-
var
|
|
6929
|
+
// src/features/mcp/deepagents-mcp.ts
|
|
6930
|
+
import { join as join50 } from "path";
|
|
6931
|
+
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
6755
6932
|
json;
|
|
6756
6933
|
constructor(params) {
|
|
6757
6934
|
super(params);
|
|
6758
|
-
this.json =
|
|
6935
|
+
this.json = JSON.parse(this.fileContent || "{}");
|
|
6759
6936
|
}
|
|
6760
6937
|
getJson() {
|
|
6761
6938
|
return this.json;
|
|
6762
6939
|
}
|
|
6763
|
-
|
|
6940
|
+
isDeletable() {
|
|
6941
|
+
return !this.global;
|
|
6942
|
+
}
|
|
6943
|
+
static getSettablePaths(_options = {}) {
|
|
6764
6944
|
return {
|
|
6765
|
-
relativeDirPath: ".
|
|
6766
|
-
relativeFilePath: "mcp.json"
|
|
6945
|
+
relativeDirPath: ".deepagents",
|
|
6946
|
+
relativeFilePath: ".mcp.json"
|
|
6767
6947
|
};
|
|
6768
6948
|
}
|
|
6769
6949
|
static async fromFile({
|
|
6770
6950
|
baseDir = process.cwd(),
|
|
6771
|
-
validate = true
|
|
6951
|
+
validate = true,
|
|
6952
|
+
global = false
|
|
6772
6953
|
}) {
|
|
6773
|
-
const
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
)
|
|
6779
|
-
);
|
|
6780
|
-
return new _FactorydroidMcp({
|
|
6954
|
+
const paths = this.getSettablePaths({ global });
|
|
6955
|
+
const fileContent = await readFileContentOrNull(join50(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6956
|
+
const json = JSON.parse(fileContent);
|
|
6957
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6958
|
+
return new _DeepagentsMcp({
|
|
6781
6959
|
baseDir,
|
|
6782
|
-
relativeDirPath:
|
|
6783
|
-
relativeFilePath:
|
|
6784
|
-
fileContent,
|
|
6960
|
+
relativeDirPath: paths.relativeDirPath,
|
|
6961
|
+
relativeFilePath: paths.relativeFilePath,
|
|
6962
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
6785
6963
|
validate
|
|
6786
6964
|
});
|
|
6787
6965
|
}
|
|
6788
|
-
static fromRulesyncMcp({
|
|
6966
|
+
static async fromRulesyncMcp({
|
|
6789
6967
|
baseDir = process.cwd(),
|
|
6790
6968
|
rulesyncMcp,
|
|
6791
|
-
validate = true
|
|
6969
|
+
validate = true,
|
|
6970
|
+
global = false
|
|
6792
6971
|
}) {
|
|
6793
|
-
const
|
|
6794
|
-
const
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6972
|
+
const paths = this.getSettablePaths({ global });
|
|
6973
|
+
const fileContent = await readOrInitializeFileContent(
|
|
6974
|
+
join50(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6975
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6976
|
+
);
|
|
6977
|
+
const json = JSON.parse(fileContent);
|
|
6978
|
+
const mcpJson = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
|
|
6979
|
+
return new _DeepagentsMcp({
|
|
6799
6980
|
baseDir,
|
|
6800
|
-
relativeDirPath:
|
|
6801
|
-
relativeFilePath:
|
|
6802
|
-
fileContent,
|
|
6981
|
+
relativeDirPath: paths.relativeDirPath,
|
|
6982
|
+
relativeFilePath: paths.relativeFilePath,
|
|
6983
|
+
fileContent: JSON.stringify(mcpJson, null, 2),
|
|
6803
6984
|
validate
|
|
6804
6985
|
});
|
|
6805
6986
|
}
|
|
6806
6987
|
toRulesyncMcp() {
|
|
6807
|
-
return this.toRulesyncMcpDefault(
|
|
6808
|
-
|
|
6809
|
-
|
|
6988
|
+
return this.toRulesyncMcpDefault({
|
|
6989
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
|
|
6990
|
+
});
|
|
6991
|
+
}
|
|
6992
|
+
validate() {
|
|
6993
|
+
return { success: true, error: null };
|
|
6994
|
+
}
|
|
6995
|
+
static forDeletion({
|
|
6996
|
+
baseDir = process.cwd(),
|
|
6997
|
+
relativeDirPath,
|
|
6998
|
+
relativeFilePath,
|
|
6999
|
+
global = false
|
|
7000
|
+
}) {
|
|
7001
|
+
return new _DeepagentsMcp({
|
|
7002
|
+
baseDir,
|
|
7003
|
+
relativeDirPath,
|
|
7004
|
+
relativeFilePath,
|
|
7005
|
+
fileContent: "{}",
|
|
7006
|
+
validate: false,
|
|
7007
|
+
global
|
|
7008
|
+
});
|
|
7009
|
+
}
|
|
7010
|
+
};
|
|
7011
|
+
|
|
7012
|
+
// src/features/mcp/factorydroid-mcp.ts
|
|
7013
|
+
import { join as join51 } from "path";
|
|
7014
|
+
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
7015
|
+
json;
|
|
7016
|
+
constructor(params) {
|
|
7017
|
+
super(params);
|
|
7018
|
+
this.json = this.fileContent !== void 0 ? JSON.parse(this.fileContent) : {};
|
|
7019
|
+
}
|
|
7020
|
+
getJson() {
|
|
7021
|
+
return this.json;
|
|
7022
|
+
}
|
|
7023
|
+
static getSettablePaths() {
|
|
7024
|
+
return {
|
|
7025
|
+
relativeDirPath: ".factory",
|
|
7026
|
+
relativeFilePath: "mcp.json"
|
|
7027
|
+
};
|
|
7028
|
+
}
|
|
7029
|
+
static async fromFile({
|
|
7030
|
+
baseDir = process.cwd(),
|
|
7031
|
+
validate = true
|
|
7032
|
+
}) {
|
|
7033
|
+
const fileContent = await readFileContent(
|
|
7034
|
+
join51(
|
|
7035
|
+
baseDir,
|
|
7036
|
+
this.getSettablePaths().relativeDirPath,
|
|
7037
|
+
this.getSettablePaths().relativeFilePath
|
|
7038
|
+
)
|
|
7039
|
+
);
|
|
7040
|
+
return new _FactorydroidMcp({
|
|
7041
|
+
baseDir,
|
|
7042
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
7043
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
7044
|
+
fileContent,
|
|
7045
|
+
validate
|
|
7046
|
+
});
|
|
7047
|
+
}
|
|
7048
|
+
static fromRulesyncMcp({
|
|
7049
|
+
baseDir = process.cwd(),
|
|
7050
|
+
rulesyncMcp,
|
|
7051
|
+
validate = true
|
|
7052
|
+
}) {
|
|
7053
|
+
const json = rulesyncMcp.getJson();
|
|
7054
|
+
const factorydroidConfig = {
|
|
7055
|
+
mcpServers: json.mcpServers || {}
|
|
7056
|
+
};
|
|
7057
|
+
const fileContent = JSON.stringify(factorydroidConfig, null, 2);
|
|
7058
|
+
return new _FactorydroidMcp({
|
|
7059
|
+
baseDir,
|
|
7060
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
7061
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
7062
|
+
fileContent,
|
|
7063
|
+
validate
|
|
7064
|
+
});
|
|
7065
|
+
}
|
|
7066
|
+
toRulesyncMcp() {
|
|
7067
|
+
return this.toRulesyncMcpDefault();
|
|
7068
|
+
}
|
|
7069
|
+
validate() {
|
|
6810
7070
|
return { success: true, error: null };
|
|
6811
7071
|
}
|
|
6812
7072
|
static forDeletion({
|
|
@@ -6825,7 +7085,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6825
7085
|
};
|
|
6826
7086
|
|
|
6827
7087
|
// src/features/mcp/geminicli-mcp.ts
|
|
6828
|
-
import { join as
|
|
7088
|
+
import { join as join52 } from "path";
|
|
6829
7089
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6830
7090
|
json;
|
|
6831
7091
|
constructor(params) {
|
|
@@ -6853,7 +7113,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6853
7113
|
global = false
|
|
6854
7114
|
}) {
|
|
6855
7115
|
const paths = this.getSettablePaths({ global });
|
|
6856
|
-
const fileContent = await readFileContentOrNull(
|
|
7116
|
+
const fileContent = await readFileContentOrNull(join52(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6857
7117
|
const json = JSON.parse(fileContent);
|
|
6858
7118
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6859
7119
|
return new _GeminiCliMcp({
|
|
@@ -6872,7 +7132,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6872
7132
|
}) {
|
|
6873
7133
|
const paths = this.getSettablePaths({ global });
|
|
6874
7134
|
const fileContent = await readOrInitializeFileContent(
|
|
6875
|
-
|
|
7135
|
+
join52(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6876
7136
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6877
7137
|
);
|
|
6878
7138
|
const json = JSON.parse(fileContent);
|
|
@@ -6917,7 +7177,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6917
7177
|
};
|
|
6918
7178
|
|
|
6919
7179
|
// src/features/mcp/junie-mcp.ts
|
|
6920
|
-
import { join as
|
|
7180
|
+
import { join as join53 } from "path";
|
|
6921
7181
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6922
7182
|
json;
|
|
6923
7183
|
constructor(params) {
|
|
@@ -6929,7 +7189,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6929
7189
|
}
|
|
6930
7190
|
static getSettablePaths() {
|
|
6931
7191
|
return {
|
|
6932
|
-
relativeDirPath:
|
|
7192
|
+
relativeDirPath: join53(".junie", "mcp"),
|
|
6933
7193
|
relativeFilePath: "mcp.json"
|
|
6934
7194
|
};
|
|
6935
7195
|
}
|
|
@@ -6938,7 +7198,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6938
7198
|
validate = true
|
|
6939
7199
|
}) {
|
|
6940
7200
|
const fileContent = await readFileContent(
|
|
6941
|
-
|
|
7201
|
+
join53(
|
|
6942
7202
|
baseDir,
|
|
6943
7203
|
this.getSettablePaths().relativeDirPath,
|
|
6944
7204
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6987,7 +7247,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6987
7247
|
};
|
|
6988
7248
|
|
|
6989
7249
|
// src/features/mcp/kilo-mcp.ts
|
|
6990
|
-
import { join as
|
|
7250
|
+
import { join as join54 } from "path";
|
|
6991
7251
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6992
7252
|
json;
|
|
6993
7253
|
constructor(params) {
|
|
@@ -7008,7 +7268,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7008
7268
|
validate = true
|
|
7009
7269
|
}) {
|
|
7010
7270
|
const paths = this.getSettablePaths();
|
|
7011
|
-
const fileContent = await readFileContentOrNull(
|
|
7271
|
+
const fileContent = await readFileContentOrNull(join54(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7012
7272
|
return new _KiloMcp({
|
|
7013
7273
|
baseDir,
|
|
7014
7274
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7056,7 +7316,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7056
7316
|
};
|
|
7057
7317
|
|
|
7058
7318
|
// src/features/mcp/kiro-mcp.ts
|
|
7059
|
-
import { join as
|
|
7319
|
+
import { join as join55 } from "path";
|
|
7060
7320
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
7061
7321
|
json;
|
|
7062
7322
|
constructor(params) {
|
|
@@ -7068,7 +7328,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7068
7328
|
}
|
|
7069
7329
|
static getSettablePaths() {
|
|
7070
7330
|
return {
|
|
7071
|
-
relativeDirPath:
|
|
7331
|
+
relativeDirPath: join55(".kiro", "settings"),
|
|
7072
7332
|
relativeFilePath: "mcp.json"
|
|
7073
7333
|
};
|
|
7074
7334
|
}
|
|
@@ -7077,7 +7337,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7077
7337
|
validate = true
|
|
7078
7338
|
}) {
|
|
7079
7339
|
const paths = this.getSettablePaths();
|
|
7080
|
-
const fileContent = await readFileContentOrNull(
|
|
7340
|
+
const fileContent = await readFileContentOrNull(join55(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7081
7341
|
return new _KiroMcp({
|
|
7082
7342
|
baseDir,
|
|
7083
7343
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7125,7 +7385,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7125
7385
|
};
|
|
7126
7386
|
|
|
7127
7387
|
// src/features/mcp/opencode-mcp.ts
|
|
7128
|
-
import { join as
|
|
7388
|
+
import { join as join56 } from "path";
|
|
7129
7389
|
import { parse as parseJsonc2 } from "jsonc-parser";
|
|
7130
7390
|
import { z as z22 } from "zod/mini";
|
|
7131
7391
|
var OpencodeMcpLocalServerSchema = z22.object({
|
|
@@ -7266,7 +7526,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7266
7526
|
static getSettablePaths({ global } = {}) {
|
|
7267
7527
|
if (global) {
|
|
7268
7528
|
return {
|
|
7269
|
-
relativeDirPath:
|
|
7529
|
+
relativeDirPath: join56(".config", "opencode"),
|
|
7270
7530
|
relativeFilePath: "opencode.json"
|
|
7271
7531
|
};
|
|
7272
7532
|
}
|
|
@@ -7281,11 +7541,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7281
7541
|
global = false
|
|
7282
7542
|
}) {
|
|
7283
7543
|
const basePaths = this.getSettablePaths({ global });
|
|
7284
|
-
const jsonDir =
|
|
7544
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7285
7545
|
let fileContent = null;
|
|
7286
7546
|
let relativeFilePath = "opencode.jsonc";
|
|
7287
|
-
const jsoncPath =
|
|
7288
|
-
const jsonPath =
|
|
7547
|
+
const jsoncPath = join56(jsonDir, "opencode.jsonc");
|
|
7548
|
+
const jsonPath = join56(jsonDir, "opencode.json");
|
|
7289
7549
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7290
7550
|
if (!fileContent) {
|
|
7291
7551
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7311,11 +7571,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7311
7571
|
global = false
|
|
7312
7572
|
}) {
|
|
7313
7573
|
const basePaths = this.getSettablePaths({ global });
|
|
7314
|
-
const jsonDir =
|
|
7574
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7315
7575
|
let fileContent = null;
|
|
7316
7576
|
let relativeFilePath = "opencode.jsonc";
|
|
7317
|
-
const jsoncPath =
|
|
7318
|
-
const jsonPath =
|
|
7577
|
+
const jsoncPath = join56(jsonDir, "opencode.jsonc");
|
|
7578
|
+
const jsonPath = join56(jsonDir, "opencode.json");
|
|
7319
7579
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7320
7580
|
if (!fileContent) {
|
|
7321
7581
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7376,7 +7636,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7376
7636
|
};
|
|
7377
7637
|
|
|
7378
7638
|
// src/features/mcp/roo-mcp.ts
|
|
7379
|
-
import { join as
|
|
7639
|
+
import { join as join57 } from "path";
|
|
7380
7640
|
function isRooMcpServers(value) {
|
|
7381
7641
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
7382
7642
|
}
|
|
@@ -7428,7 +7688,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
7428
7688
|
validate = true
|
|
7429
7689
|
}) {
|
|
7430
7690
|
const fileContent = await readFileContent(
|
|
7431
|
-
|
|
7691
|
+
join57(
|
|
7432
7692
|
baseDir,
|
|
7433
7693
|
this.getSettablePaths().relativeDirPath,
|
|
7434
7694
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7492,6 +7752,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
7492
7752
|
"copilot",
|
|
7493
7753
|
"copilotcli",
|
|
7494
7754
|
"cursor",
|
|
7755
|
+
"deepagents",
|
|
7495
7756
|
"factorydroid",
|
|
7496
7757
|
"geminicli",
|
|
7497
7758
|
"kilo",
|
|
@@ -7586,6 +7847,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
7586
7847
|
}
|
|
7587
7848
|
}
|
|
7588
7849
|
],
|
|
7850
|
+
[
|
|
7851
|
+
"deepagents",
|
|
7852
|
+
{
|
|
7853
|
+
class: DeepagentsMcp,
|
|
7854
|
+
meta: {
|
|
7855
|
+
supportsProject: true,
|
|
7856
|
+
supportsGlobal: true,
|
|
7857
|
+
supportsEnabledTools: false,
|
|
7858
|
+
supportsDisabledTools: false
|
|
7859
|
+
}
|
|
7860
|
+
}
|
|
7861
|
+
],
|
|
7589
7862
|
[
|
|
7590
7863
|
"factorydroid",
|
|
7591
7864
|
{
|
|
@@ -7815,25 +8088,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7815
8088
|
};
|
|
7816
8089
|
|
|
7817
8090
|
// src/features/rules/rules-processor.ts
|
|
7818
|
-
import { basename as basename10, dirname as dirname3, join as
|
|
8091
|
+
import { basename as basename10, dirname as dirname3, join as join122, relative as relative5 } from "path";
|
|
7819
8092
|
import { encode } from "@toon-format/toon";
|
|
7820
|
-
import { z as
|
|
8093
|
+
import { z as z59 } from "zod/mini";
|
|
7821
8094
|
|
|
7822
8095
|
// src/constants/general.ts
|
|
7823
8096
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7824
8097
|
|
|
7825
8098
|
// src/features/skills/agentsmd-skill.ts
|
|
7826
|
-
import { join as
|
|
8099
|
+
import { join as join61 } from "path";
|
|
7827
8100
|
|
|
7828
8101
|
// src/features/skills/simulated-skill.ts
|
|
7829
|
-
import { join as
|
|
8102
|
+
import { join as join60 } from "path";
|
|
7830
8103
|
import { z as z24 } from "zod/mini";
|
|
7831
8104
|
|
|
7832
8105
|
// src/features/skills/tool-skill.ts
|
|
7833
|
-
import { join as
|
|
8106
|
+
import { join as join59 } from "path";
|
|
7834
8107
|
|
|
7835
8108
|
// src/types/ai-dir.ts
|
|
7836
|
-
import path2, { basename as basename3, join as
|
|
8109
|
+
import path2, { basename as basename3, join as join58, relative as relative4, resolve as resolve4 } from "path";
|
|
7837
8110
|
var AiDir = class {
|
|
7838
8111
|
/**
|
|
7839
8112
|
* @example "."
|
|
@@ -7927,8 +8200,8 @@ var AiDir = class {
|
|
|
7927
8200
|
* @returns Array of files with their relative paths and buffers
|
|
7928
8201
|
*/
|
|
7929
8202
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7930
|
-
const dirPath =
|
|
7931
|
-
const glob =
|
|
8203
|
+
const dirPath = join58(baseDir, relativeDirPath, dirName);
|
|
8204
|
+
const glob = join58(dirPath, "**", "*");
|
|
7932
8205
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7933
8206
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
7934
8207
|
const files = await Promise.all(
|
|
@@ -8026,8 +8299,8 @@ var ToolSkill = class extends AiDir {
|
|
|
8026
8299
|
}) {
|
|
8027
8300
|
const settablePaths = getSettablePaths({ global });
|
|
8028
8301
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
8029
|
-
const skillDirPath =
|
|
8030
|
-
const skillFilePath =
|
|
8302
|
+
const skillDirPath = join59(baseDir, actualRelativeDirPath, dirName);
|
|
8303
|
+
const skillFilePath = join59(skillDirPath, SKILL_FILE_NAME);
|
|
8031
8304
|
if (!await fileExists(skillFilePath)) {
|
|
8032
8305
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8033
8306
|
}
|
|
@@ -8051,7 +8324,7 @@ var ToolSkill = class extends AiDir {
|
|
|
8051
8324
|
}
|
|
8052
8325
|
requireMainFileFrontmatter() {
|
|
8053
8326
|
if (!this.mainFile?.frontmatter) {
|
|
8054
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8327
|
+
throw new Error(`Frontmatter is not defined in ${join59(this.relativeDirPath, this.dirName)}`);
|
|
8055
8328
|
}
|
|
8056
8329
|
return this.mainFile.frontmatter;
|
|
8057
8330
|
}
|
|
@@ -8091,7 +8364,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
8091
8364
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
8092
8365
|
if (!result.success) {
|
|
8093
8366
|
throw new Error(
|
|
8094
|
-
`Invalid frontmatter in ${
|
|
8367
|
+
`Invalid frontmatter in ${join60(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
8095
8368
|
);
|
|
8096
8369
|
}
|
|
8097
8370
|
}
|
|
@@ -8150,8 +8423,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
8150
8423
|
}) {
|
|
8151
8424
|
const settablePaths = this.getSettablePaths();
|
|
8152
8425
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
8153
|
-
const skillDirPath =
|
|
8154
|
-
const skillFilePath =
|
|
8426
|
+
const skillDirPath = join60(baseDir, actualRelativeDirPath, dirName);
|
|
8427
|
+
const skillFilePath = join60(skillDirPath, SKILL_FILE_NAME);
|
|
8155
8428
|
if (!await fileExists(skillFilePath)) {
|
|
8156
8429
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8157
8430
|
}
|
|
@@ -8228,7 +8501,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
8228
8501
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
8229
8502
|
}
|
|
8230
8503
|
return {
|
|
8231
|
-
relativeDirPath:
|
|
8504
|
+
relativeDirPath: join61(".agents", "skills")
|
|
8232
8505
|
};
|
|
8233
8506
|
}
|
|
8234
8507
|
static async fromDir(params) {
|
|
@@ -8255,11 +8528,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
8255
8528
|
};
|
|
8256
8529
|
|
|
8257
8530
|
// src/features/skills/factorydroid-skill.ts
|
|
8258
|
-
import { join as
|
|
8531
|
+
import { join as join62 } from "path";
|
|
8259
8532
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
8260
8533
|
static getSettablePaths(_options) {
|
|
8261
8534
|
return {
|
|
8262
|
-
relativeDirPath:
|
|
8535
|
+
relativeDirPath: join62(".factory", "skills")
|
|
8263
8536
|
};
|
|
8264
8537
|
}
|
|
8265
8538
|
static async fromDir(params) {
|
|
@@ -8286,11 +8559,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
8286
8559
|
};
|
|
8287
8560
|
|
|
8288
8561
|
// src/features/skills/skills-processor.ts
|
|
8289
|
-
import { basename as basename5, join as
|
|
8290
|
-
import { z as
|
|
8562
|
+
import { basename as basename5, join as join81 } from "path";
|
|
8563
|
+
import { z as z41 } from "zod/mini";
|
|
8291
8564
|
|
|
8292
8565
|
// src/types/dir-feature-processor.ts
|
|
8293
|
-
import { join as
|
|
8566
|
+
import { join as join63 } from "path";
|
|
8294
8567
|
var DirFeatureProcessor = class {
|
|
8295
8568
|
baseDir;
|
|
8296
8569
|
dryRun;
|
|
@@ -8330,7 +8603,7 @@ var DirFeatureProcessor = class {
|
|
|
8330
8603
|
const mainFile = aiDir.getMainFile();
|
|
8331
8604
|
let mainFileContent;
|
|
8332
8605
|
if (mainFile) {
|
|
8333
|
-
const mainFilePath =
|
|
8606
|
+
const mainFilePath = join63(dirPath, mainFile.name);
|
|
8334
8607
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
8335
8608
|
avoidBlockScalars: this.avoidBlockScalars
|
|
8336
8609
|
});
|
|
@@ -8346,7 +8619,7 @@ var DirFeatureProcessor = class {
|
|
|
8346
8619
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
8347
8620
|
otherFileContents.push(contentWithNewline);
|
|
8348
8621
|
if (!dirHasChanges) {
|
|
8349
|
-
const filePath =
|
|
8622
|
+
const filePath = join63(dirPath, file.relativeFilePathToDirPath);
|
|
8350
8623
|
const existingContent = await readFileContentOrNull(filePath);
|
|
8351
8624
|
if (existingContent !== contentWithNewline) {
|
|
8352
8625
|
dirHasChanges = true;
|
|
@@ -8360,24 +8633,24 @@ var DirFeatureProcessor = class {
|
|
|
8360
8633
|
if (this.dryRun) {
|
|
8361
8634
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
8362
8635
|
if (mainFile) {
|
|
8363
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
8364
|
-
changedPaths.push(
|
|
8636
|
+
this.logger.info(`[DRY RUN] Would write: ${join63(dirPath, mainFile.name)}`);
|
|
8637
|
+
changedPaths.push(join63(relativeDir, mainFile.name));
|
|
8365
8638
|
}
|
|
8366
8639
|
for (const file of otherFiles) {
|
|
8367
8640
|
this.logger.info(
|
|
8368
|
-
`[DRY RUN] Would write: ${
|
|
8641
|
+
`[DRY RUN] Would write: ${join63(dirPath, file.relativeFilePathToDirPath)}`
|
|
8369
8642
|
);
|
|
8370
|
-
changedPaths.push(
|
|
8643
|
+
changedPaths.push(join63(relativeDir, file.relativeFilePathToDirPath));
|
|
8371
8644
|
}
|
|
8372
8645
|
} else {
|
|
8373
8646
|
await ensureDir(dirPath);
|
|
8374
8647
|
if (mainFile && mainFileContent) {
|
|
8375
|
-
const mainFilePath =
|
|
8648
|
+
const mainFilePath = join63(dirPath, mainFile.name);
|
|
8376
8649
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
8377
|
-
changedPaths.push(
|
|
8650
|
+
changedPaths.push(join63(relativeDir, mainFile.name));
|
|
8378
8651
|
}
|
|
8379
8652
|
for (const [i, file] of otherFiles.entries()) {
|
|
8380
|
-
const filePath =
|
|
8653
|
+
const filePath = join63(dirPath, file.relativeFilePathToDirPath);
|
|
8381
8654
|
const content = otherFileContents[i];
|
|
8382
8655
|
if (content === void 0) {
|
|
8383
8656
|
throw new Error(
|
|
@@ -8385,7 +8658,7 @@ var DirFeatureProcessor = class {
|
|
|
8385
8658
|
);
|
|
8386
8659
|
}
|
|
8387
8660
|
await writeFileContent(filePath, content);
|
|
8388
|
-
changedPaths.push(
|
|
8661
|
+
changedPaths.push(join63(relativeDir, file.relativeFilePathToDirPath));
|
|
8389
8662
|
}
|
|
8390
8663
|
}
|
|
8391
8664
|
changedCount++;
|
|
@@ -8417,11 +8690,11 @@ var DirFeatureProcessor = class {
|
|
|
8417
8690
|
};
|
|
8418
8691
|
|
|
8419
8692
|
// src/features/skills/agentsskills-skill.ts
|
|
8420
|
-
import { join as
|
|
8693
|
+
import { join as join65 } from "path";
|
|
8421
8694
|
import { z as z26 } from "zod/mini";
|
|
8422
8695
|
|
|
8423
8696
|
// src/features/skills/rulesync-skill.ts
|
|
8424
|
-
import { join as
|
|
8697
|
+
import { join as join64 } from "path";
|
|
8425
8698
|
import { z as z25 } from "zod/mini";
|
|
8426
8699
|
var RulesyncSkillFrontmatterSchemaInternal = z25.looseObject({
|
|
8427
8700
|
name: z25.string(),
|
|
@@ -8444,6 +8717,11 @@ var RulesyncSkillFrontmatterSchemaInternal = z25.looseObject({
|
|
|
8444
8717
|
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
8445
8718
|
})
|
|
8446
8719
|
),
|
|
8720
|
+
deepagents: z25.optional(
|
|
8721
|
+
z25.looseObject({
|
|
8722
|
+
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
8723
|
+
})
|
|
8724
|
+
),
|
|
8447
8725
|
copilot: z25.optional(
|
|
8448
8726
|
z25.looseObject({
|
|
8449
8727
|
license: z25.optional(z25.string())
|
|
@@ -8490,7 +8768,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8490
8768
|
}
|
|
8491
8769
|
getFrontmatter() {
|
|
8492
8770
|
if (!this.mainFile?.frontmatter) {
|
|
8493
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8771
|
+
throw new Error(`Frontmatter is not defined in ${join64(this.relativeDirPath, this.dirName)}`);
|
|
8494
8772
|
}
|
|
8495
8773
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
8496
8774
|
return result;
|
|
@@ -8516,8 +8794,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8516
8794
|
dirName,
|
|
8517
8795
|
global = false
|
|
8518
8796
|
}) {
|
|
8519
|
-
const skillDirPath =
|
|
8520
|
-
const skillFilePath =
|
|
8797
|
+
const skillDirPath = join64(baseDir, relativeDirPath, dirName);
|
|
8798
|
+
const skillFilePath = join64(skillDirPath, SKILL_FILE_NAME);
|
|
8521
8799
|
if (!await fileExists(skillFilePath)) {
|
|
8522
8800
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8523
8801
|
}
|
|
@@ -8554,7 +8832,7 @@ var AgentsSkillsSkillFrontmatterSchema = z26.looseObject({
|
|
|
8554
8832
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
8555
8833
|
constructor({
|
|
8556
8834
|
baseDir = process.cwd(),
|
|
8557
|
-
relativeDirPath =
|
|
8835
|
+
relativeDirPath = join65(".agents", "skills"),
|
|
8558
8836
|
dirName,
|
|
8559
8837
|
frontmatter,
|
|
8560
8838
|
body,
|
|
@@ -8586,7 +8864,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8586
8864
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
8587
8865
|
}
|
|
8588
8866
|
return {
|
|
8589
|
-
relativeDirPath:
|
|
8867
|
+
relativeDirPath: join65(".agents", "skills")
|
|
8590
8868
|
};
|
|
8591
8869
|
}
|
|
8592
8870
|
getFrontmatter() {
|
|
@@ -8666,9 +8944,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8666
8944
|
});
|
|
8667
8945
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8668
8946
|
if (!result.success) {
|
|
8669
|
-
const skillDirPath =
|
|
8947
|
+
const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8670
8948
|
throw new Error(
|
|
8671
|
-
`Invalid frontmatter in ${
|
|
8949
|
+
`Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8672
8950
|
);
|
|
8673
8951
|
}
|
|
8674
8952
|
return new _AgentsSkillsSkill({
|
|
@@ -8703,7 +8981,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8703
8981
|
};
|
|
8704
8982
|
|
|
8705
8983
|
// src/features/skills/antigravity-skill.ts
|
|
8706
|
-
import { join as
|
|
8984
|
+
import { join as join66 } from "path";
|
|
8707
8985
|
import { z as z27 } from "zod/mini";
|
|
8708
8986
|
var AntigravitySkillFrontmatterSchema = z27.looseObject({
|
|
8709
8987
|
name: z27.string(),
|
|
@@ -8712,7 +8990,7 @@ var AntigravitySkillFrontmatterSchema = z27.looseObject({
|
|
|
8712
8990
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8713
8991
|
constructor({
|
|
8714
8992
|
baseDir = process.cwd(),
|
|
8715
|
-
relativeDirPath =
|
|
8993
|
+
relativeDirPath = join66(".agent", "skills"),
|
|
8716
8994
|
dirName,
|
|
8717
8995
|
frontmatter,
|
|
8718
8996
|
body,
|
|
@@ -8744,11 +9022,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8744
9022
|
} = {}) {
|
|
8745
9023
|
if (global) {
|
|
8746
9024
|
return {
|
|
8747
|
-
relativeDirPath:
|
|
9025
|
+
relativeDirPath: join66(".gemini", "antigravity", "skills")
|
|
8748
9026
|
};
|
|
8749
9027
|
}
|
|
8750
9028
|
return {
|
|
8751
|
-
relativeDirPath:
|
|
9029
|
+
relativeDirPath: join66(".agent", "skills")
|
|
8752
9030
|
};
|
|
8753
9031
|
}
|
|
8754
9032
|
getFrontmatter() {
|
|
@@ -8828,9 +9106,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8828
9106
|
});
|
|
8829
9107
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8830
9108
|
if (!result.success) {
|
|
8831
|
-
const skillDirPath =
|
|
9109
|
+
const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8832
9110
|
throw new Error(
|
|
8833
|
-
`Invalid frontmatter in ${
|
|
9111
|
+
`Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8834
9112
|
);
|
|
8835
9113
|
}
|
|
8836
9114
|
return new _AntigravitySkill({
|
|
@@ -8864,7 +9142,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8864
9142
|
};
|
|
8865
9143
|
|
|
8866
9144
|
// src/features/skills/claudecode-skill.ts
|
|
8867
|
-
import { join as
|
|
9145
|
+
import { join as join67 } from "path";
|
|
8868
9146
|
import { z as z28 } from "zod/mini";
|
|
8869
9147
|
var ClaudecodeSkillFrontmatterSchema = z28.looseObject({
|
|
8870
9148
|
name: z28.string(),
|
|
@@ -8876,7 +9154,7 @@ var ClaudecodeSkillFrontmatterSchema = z28.looseObject({
|
|
|
8876
9154
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8877
9155
|
constructor({
|
|
8878
9156
|
baseDir = process.cwd(),
|
|
8879
|
-
relativeDirPath =
|
|
9157
|
+
relativeDirPath = join67(".claude", "skills"),
|
|
8880
9158
|
dirName,
|
|
8881
9159
|
frontmatter,
|
|
8882
9160
|
body,
|
|
@@ -8907,7 +9185,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8907
9185
|
global: _global = false
|
|
8908
9186
|
} = {}) {
|
|
8909
9187
|
return {
|
|
8910
|
-
relativeDirPath:
|
|
9188
|
+
relativeDirPath: join67(".claude", "skills")
|
|
8911
9189
|
};
|
|
8912
9190
|
}
|
|
8913
9191
|
getFrontmatter() {
|
|
@@ -9004,9 +9282,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
9004
9282
|
});
|
|
9005
9283
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9006
9284
|
if (!result.success) {
|
|
9007
|
-
const skillDirPath =
|
|
9285
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9008
9286
|
throw new Error(
|
|
9009
|
-
`Invalid frontmatter in ${
|
|
9287
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9010
9288
|
);
|
|
9011
9289
|
}
|
|
9012
9290
|
return new _ClaudecodeSkill({
|
|
@@ -9040,7 +9318,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
9040
9318
|
};
|
|
9041
9319
|
|
|
9042
9320
|
// src/features/skills/cline-skill.ts
|
|
9043
|
-
import { join as
|
|
9321
|
+
import { join as join68 } from "path";
|
|
9044
9322
|
import { z as z29 } from "zod/mini";
|
|
9045
9323
|
var ClineSkillFrontmatterSchema = z29.looseObject({
|
|
9046
9324
|
name: z29.string(),
|
|
@@ -9049,7 +9327,7 @@ var ClineSkillFrontmatterSchema = z29.looseObject({
|
|
|
9049
9327
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
9050
9328
|
constructor({
|
|
9051
9329
|
baseDir = process.cwd(),
|
|
9052
|
-
relativeDirPath =
|
|
9330
|
+
relativeDirPath = join68(".cline", "skills"),
|
|
9053
9331
|
dirName,
|
|
9054
9332
|
frontmatter,
|
|
9055
9333
|
body,
|
|
@@ -9078,7 +9356,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9078
9356
|
}
|
|
9079
9357
|
static getSettablePaths(_options = {}) {
|
|
9080
9358
|
return {
|
|
9081
|
-
relativeDirPath:
|
|
9359
|
+
relativeDirPath: join68(".cline", "skills")
|
|
9082
9360
|
};
|
|
9083
9361
|
}
|
|
9084
9362
|
getFrontmatter() {
|
|
@@ -9166,13 +9444,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9166
9444
|
});
|
|
9167
9445
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9168
9446
|
if (!result.success) {
|
|
9169
|
-
const skillDirPath =
|
|
9447
|
+
const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9170
9448
|
throw new Error(
|
|
9171
|
-
`Invalid frontmatter in ${
|
|
9449
|
+
`Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9172
9450
|
);
|
|
9173
9451
|
}
|
|
9174
9452
|
if (result.data.name !== loaded.dirName) {
|
|
9175
|
-
const skillFilePath =
|
|
9453
|
+
const skillFilePath = join68(
|
|
9176
9454
|
loaded.baseDir,
|
|
9177
9455
|
loaded.relativeDirPath,
|
|
9178
9456
|
loaded.dirName,
|
|
@@ -9213,7 +9491,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9213
9491
|
};
|
|
9214
9492
|
|
|
9215
9493
|
// src/features/skills/codexcli-skill.ts
|
|
9216
|
-
import { join as
|
|
9494
|
+
import { join as join69 } from "path";
|
|
9217
9495
|
import { z as z30 } from "zod/mini";
|
|
9218
9496
|
var CodexCliSkillFrontmatterSchema = z30.looseObject({
|
|
9219
9497
|
name: z30.string(),
|
|
@@ -9227,7 +9505,7 @@ var CodexCliSkillFrontmatterSchema = z30.looseObject({
|
|
|
9227
9505
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
9228
9506
|
constructor({
|
|
9229
9507
|
baseDir = process.cwd(),
|
|
9230
|
-
relativeDirPath =
|
|
9508
|
+
relativeDirPath = join69(".codex", "skills"),
|
|
9231
9509
|
dirName,
|
|
9232
9510
|
frontmatter,
|
|
9233
9511
|
body,
|
|
@@ -9258,7 +9536,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9258
9536
|
global: _global = false
|
|
9259
9537
|
} = {}) {
|
|
9260
9538
|
return {
|
|
9261
|
-
relativeDirPath:
|
|
9539
|
+
relativeDirPath: join69(".codex", "skills")
|
|
9262
9540
|
};
|
|
9263
9541
|
}
|
|
9264
9542
|
getFrontmatter() {
|
|
@@ -9348,9 +9626,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9348
9626
|
});
|
|
9349
9627
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9350
9628
|
if (!result.success) {
|
|
9351
|
-
const skillDirPath =
|
|
9629
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9352
9630
|
throw new Error(
|
|
9353
|
-
`Invalid frontmatter in ${
|
|
9631
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9354
9632
|
);
|
|
9355
9633
|
}
|
|
9356
9634
|
return new _CodexCliSkill({
|
|
@@ -9384,7 +9662,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9384
9662
|
};
|
|
9385
9663
|
|
|
9386
9664
|
// src/features/skills/copilot-skill.ts
|
|
9387
|
-
import { join as
|
|
9665
|
+
import { join as join70 } from "path";
|
|
9388
9666
|
import { z as z31 } from "zod/mini";
|
|
9389
9667
|
var CopilotSkillFrontmatterSchema = z31.looseObject({
|
|
9390
9668
|
name: z31.string(),
|
|
@@ -9394,7 +9672,7 @@ var CopilotSkillFrontmatterSchema = z31.looseObject({
|
|
|
9394
9672
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
9395
9673
|
constructor({
|
|
9396
9674
|
baseDir = process.cwd(),
|
|
9397
|
-
relativeDirPath =
|
|
9675
|
+
relativeDirPath = join70(".github", "skills"),
|
|
9398
9676
|
dirName,
|
|
9399
9677
|
frontmatter,
|
|
9400
9678
|
body,
|
|
@@ -9426,7 +9704,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9426
9704
|
throw new Error("CopilotSkill does not support global mode.");
|
|
9427
9705
|
}
|
|
9428
9706
|
return {
|
|
9429
|
-
relativeDirPath:
|
|
9707
|
+
relativeDirPath: join70(".github", "skills")
|
|
9430
9708
|
};
|
|
9431
9709
|
}
|
|
9432
9710
|
getFrontmatter() {
|
|
@@ -9512,9 +9790,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9512
9790
|
});
|
|
9513
9791
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9514
9792
|
if (!result.success) {
|
|
9515
|
-
const skillDirPath =
|
|
9793
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9516
9794
|
throw new Error(
|
|
9517
|
-
`Invalid frontmatter in ${
|
|
9795
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9518
9796
|
);
|
|
9519
9797
|
}
|
|
9520
9798
|
return new _CopilotSkill({
|
|
@@ -9549,7 +9827,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9549
9827
|
};
|
|
9550
9828
|
|
|
9551
9829
|
// src/features/skills/cursor-skill.ts
|
|
9552
|
-
import { join as
|
|
9830
|
+
import { join as join71 } from "path";
|
|
9553
9831
|
import { z as z32 } from "zod/mini";
|
|
9554
9832
|
var CursorSkillFrontmatterSchema = z32.looseObject({
|
|
9555
9833
|
name: z32.string(),
|
|
@@ -9558,7 +9836,7 @@ var CursorSkillFrontmatterSchema = z32.looseObject({
|
|
|
9558
9836
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
9559
9837
|
constructor({
|
|
9560
9838
|
baseDir = process.cwd(),
|
|
9561
|
-
relativeDirPath =
|
|
9839
|
+
relativeDirPath = join71(".cursor", "skills"),
|
|
9562
9840
|
dirName,
|
|
9563
9841
|
frontmatter,
|
|
9564
9842
|
body,
|
|
@@ -9587,7 +9865,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9587
9865
|
}
|
|
9588
9866
|
static getSettablePaths(_options) {
|
|
9589
9867
|
return {
|
|
9590
|
-
relativeDirPath:
|
|
9868
|
+
relativeDirPath: join71(".cursor", "skills")
|
|
9591
9869
|
};
|
|
9592
9870
|
}
|
|
9593
9871
|
getFrontmatter() {
|
|
@@ -9667,9 +9945,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9667
9945
|
});
|
|
9668
9946
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9669
9947
|
if (!result.success) {
|
|
9670
|
-
const skillDirPath =
|
|
9948
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9671
9949
|
throw new Error(
|
|
9672
|
-
`Invalid frontmatter in ${
|
|
9950
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9673
9951
|
);
|
|
9674
9952
|
}
|
|
9675
9953
|
return new _CursorSkill({
|
|
@@ -9703,17 +9981,18 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9703
9981
|
}
|
|
9704
9982
|
};
|
|
9705
9983
|
|
|
9706
|
-
// src/features/skills/
|
|
9707
|
-
import { join as
|
|
9984
|
+
// src/features/skills/deepagents-skill.ts
|
|
9985
|
+
import { join as join72 } from "path";
|
|
9708
9986
|
import { z as z33 } from "zod/mini";
|
|
9709
|
-
var
|
|
9987
|
+
var DeepagentsSkillFrontmatterSchema = z33.looseObject({
|
|
9710
9988
|
name: z33.string(),
|
|
9711
|
-
description: z33.string()
|
|
9989
|
+
description: z33.string(),
|
|
9990
|
+
"allowed-tools": z33.optional(z33.array(z33.string()))
|
|
9712
9991
|
});
|
|
9713
|
-
var
|
|
9992
|
+
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
9714
9993
|
constructor({
|
|
9715
9994
|
baseDir = process.cwd(),
|
|
9716
|
-
relativeDirPath =
|
|
9995
|
+
relativeDirPath = join72(".deepagents", "skills"),
|
|
9717
9996
|
dirName,
|
|
9718
9997
|
frontmatter,
|
|
9719
9998
|
body,
|
|
@@ -9740,28 +10019,29 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9740
10019
|
}
|
|
9741
10020
|
}
|
|
9742
10021
|
}
|
|
9743
|
-
static getSettablePaths({
|
|
9744
|
-
global
|
|
9745
|
-
|
|
10022
|
+
static getSettablePaths(options) {
|
|
10023
|
+
if (options?.global) {
|
|
10024
|
+
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10025
|
+
}
|
|
9746
10026
|
return {
|
|
9747
|
-
relativeDirPath:
|
|
10027
|
+
relativeDirPath: join72(".deepagents", "skills")
|
|
9748
10028
|
};
|
|
9749
10029
|
}
|
|
9750
10030
|
getFrontmatter() {
|
|
9751
|
-
const result =
|
|
10031
|
+
const result = DeepagentsSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
9752
10032
|
return result;
|
|
9753
10033
|
}
|
|
9754
10034
|
getBody() {
|
|
9755
10035
|
return this.mainFile?.body ?? "";
|
|
9756
10036
|
}
|
|
9757
10037
|
validate() {
|
|
9758
|
-
if (this.mainFile
|
|
10038
|
+
if (!this.mainFile) {
|
|
9759
10039
|
return {
|
|
9760
10040
|
success: false,
|
|
9761
10041
|
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
9762
10042
|
};
|
|
9763
10043
|
}
|
|
9764
|
-
const result =
|
|
10044
|
+
const result = DeepagentsSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
9765
10045
|
if (!result.success) {
|
|
9766
10046
|
return {
|
|
9767
10047
|
success: false,
|
|
@@ -9777,7 +10057,10 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9777
10057
|
const rulesyncFrontmatter = {
|
|
9778
10058
|
name: frontmatter.name,
|
|
9779
10059
|
description: frontmatter.description,
|
|
9780
|
-
targets: ["*"]
|
|
10060
|
+
targets: ["*"],
|
|
10061
|
+
...frontmatter["allowed-tools"] && {
|
|
10062
|
+
deepagents: { "allowed-tools": frontmatter["allowed-tools"] }
|
|
10063
|
+
}
|
|
9781
10064
|
};
|
|
9782
10065
|
return new RulesyncSkill({
|
|
9783
10066
|
baseDir: this.baseDir,
|
|
@@ -9796,17 +10079,18 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9796
10079
|
validate = true,
|
|
9797
10080
|
global = false
|
|
9798
10081
|
}) {
|
|
9799
|
-
const settablePaths =
|
|
10082
|
+
const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
|
|
9800
10083
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
9801
|
-
const
|
|
10084
|
+
const deepagentsFrontmatter = {
|
|
9802
10085
|
name: rulesyncFrontmatter.name,
|
|
9803
|
-
description: rulesyncFrontmatter.description
|
|
10086
|
+
description: rulesyncFrontmatter.description,
|
|
10087
|
+
"allowed-tools": rulesyncFrontmatter.deepagents?.["allowed-tools"]
|
|
9804
10088
|
};
|
|
9805
|
-
return new
|
|
10089
|
+
return new _DeepagentsSkill({
|
|
9806
10090
|
baseDir,
|
|
9807
10091
|
relativeDirPath: settablePaths.relativeDirPath,
|
|
9808
10092
|
dirName: rulesyncSkill.getDirName(),
|
|
9809
|
-
frontmatter:
|
|
10093
|
+
frontmatter: deepagentsFrontmatter,
|
|
9810
10094
|
body: rulesyncSkill.getBody(),
|
|
9811
10095
|
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
9812
10096
|
validate,
|
|
@@ -9815,21 +10099,21 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9815
10099
|
}
|
|
9816
10100
|
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
9817
10101
|
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
9818
|
-
return targets.includes("*") || targets.includes("
|
|
10102
|
+
return targets.includes("*") || targets.includes("deepagents");
|
|
9819
10103
|
}
|
|
9820
10104
|
static async fromDir(params) {
|
|
9821
10105
|
const loaded = await this.loadSkillDirContent({
|
|
9822
10106
|
...params,
|
|
9823
|
-
getSettablePaths:
|
|
10107
|
+
getSettablePaths: _DeepagentsSkill.getSettablePaths
|
|
9824
10108
|
});
|
|
9825
|
-
const result =
|
|
10109
|
+
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9826
10110
|
if (!result.success) {
|
|
9827
|
-
const skillDirPath =
|
|
10111
|
+
const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9828
10112
|
throw new Error(
|
|
9829
|
-
`Invalid frontmatter in ${
|
|
10113
|
+
`Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9830
10114
|
);
|
|
9831
10115
|
}
|
|
9832
|
-
return new
|
|
10116
|
+
return new _DeepagentsSkill({
|
|
9833
10117
|
baseDir: loaded.baseDir,
|
|
9834
10118
|
relativeDirPath: loaded.relativeDirPath,
|
|
9835
10119
|
dirName: loaded.dirName,
|
|
@@ -9846,8 +10130,8 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9846
10130
|
dirName,
|
|
9847
10131
|
global = false
|
|
9848
10132
|
}) {
|
|
9849
|
-
const settablePaths =
|
|
9850
|
-
return new
|
|
10133
|
+
const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
|
|
10134
|
+
return new _DeepagentsSkill({
|
|
9851
10135
|
baseDir,
|
|
9852
10136
|
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
9853
10137
|
dirName,
|
|
@@ -9860,17 +10144,17 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9860
10144
|
}
|
|
9861
10145
|
};
|
|
9862
10146
|
|
|
9863
|
-
// src/features/skills/
|
|
9864
|
-
import { join as
|
|
10147
|
+
// src/features/skills/geminicli-skill.ts
|
|
10148
|
+
import { join as join73 } from "path";
|
|
9865
10149
|
import { z as z34 } from "zod/mini";
|
|
9866
|
-
var
|
|
10150
|
+
var GeminiCliSkillFrontmatterSchema = z34.looseObject({
|
|
9867
10151
|
name: z34.string(),
|
|
9868
10152
|
description: z34.string()
|
|
9869
10153
|
});
|
|
9870
|
-
var
|
|
10154
|
+
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9871
10155
|
constructor({
|
|
9872
10156
|
baseDir = process.cwd(),
|
|
9873
|
-
relativeDirPath =
|
|
10157
|
+
relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
|
|
9874
10158
|
dirName,
|
|
9875
10159
|
frontmatter,
|
|
9876
10160
|
body,
|
|
@@ -9897,29 +10181,28 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9897
10181
|
}
|
|
9898
10182
|
}
|
|
9899
10183
|
}
|
|
9900
|
-
static getSettablePaths(
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
}
|
|
10184
|
+
static getSettablePaths({
|
|
10185
|
+
global: _global = false
|
|
10186
|
+
} = {}) {
|
|
9904
10187
|
return {
|
|
9905
|
-
relativeDirPath:
|
|
10188
|
+
relativeDirPath: join73(".gemini", "skills")
|
|
9906
10189
|
};
|
|
9907
10190
|
}
|
|
9908
10191
|
getFrontmatter() {
|
|
9909
|
-
const result =
|
|
10192
|
+
const result = GeminiCliSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
9910
10193
|
return result;
|
|
9911
10194
|
}
|
|
9912
10195
|
getBody() {
|
|
9913
10196
|
return this.mainFile?.body ?? "";
|
|
9914
10197
|
}
|
|
9915
10198
|
validate() {
|
|
9916
|
-
if (
|
|
10199
|
+
if (this.mainFile === void 0) {
|
|
9917
10200
|
return {
|
|
9918
10201
|
success: false,
|
|
9919
10202
|
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
9920
10203
|
};
|
|
9921
10204
|
}
|
|
9922
|
-
const result =
|
|
10205
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
9923
10206
|
if (!result.success) {
|
|
9924
10207
|
return {
|
|
9925
10208
|
success: false,
|
|
@@ -9928,14 +10211,6 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9928
10211
|
)
|
|
9929
10212
|
};
|
|
9930
10213
|
}
|
|
9931
|
-
if (result.data.name !== this.getDirName()) {
|
|
9932
|
-
return {
|
|
9933
|
-
success: false,
|
|
9934
|
-
error: new Error(
|
|
9935
|
-
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
9936
|
-
)
|
|
9937
|
-
};
|
|
9938
|
-
}
|
|
9939
10214
|
return { success: true, error: null };
|
|
9940
10215
|
}
|
|
9941
10216
|
toRulesyncSkill() {
|
|
@@ -9957,21 +10232,22 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9957
10232
|
});
|
|
9958
10233
|
}
|
|
9959
10234
|
static fromRulesyncSkill({
|
|
10235
|
+
baseDir = process.cwd(),
|
|
9960
10236
|
rulesyncSkill,
|
|
9961
10237
|
validate = true,
|
|
9962
10238
|
global = false
|
|
9963
10239
|
}) {
|
|
9964
|
-
const settablePaths =
|
|
10240
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
9965
10241
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
9966
|
-
const
|
|
10242
|
+
const geminiCliFrontmatter = {
|
|
9967
10243
|
name: rulesyncFrontmatter.name,
|
|
9968
10244
|
description: rulesyncFrontmatter.description
|
|
9969
10245
|
};
|
|
9970
|
-
return new
|
|
9971
|
-
baseDir
|
|
10246
|
+
return new _GeminiCliSkill({
|
|
10247
|
+
baseDir,
|
|
9972
10248
|
relativeDirPath: settablePaths.relativeDirPath,
|
|
9973
|
-
dirName:
|
|
9974
|
-
frontmatter:
|
|
10249
|
+
dirName: rulesyncSkill.getDirName(),
|
|
10250
|
+
frontmatter: geminiCliFrontmatter,
|
|
9975
10251
|
body: rulesyncSkill.getBody(),
|
|
9976
10252
|
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
9977
10253
|
validate,
|
|
@@ -9980,28 +10256,193 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9980
10256
|
}
|
|
9981
10257
|
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
9982
10258
|
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
9983
|
-
return targets.includes("*") || targets.includes("
|
|
10259
|
+
return targets.includes("*") || targets.includes("geminicli");
|
|
9984
10260
|
}
|
|
9985
10261
|
static async fromDir(params) {
|
|
9986
10262
|
const loaded = await this.loadSkillDirContent({
|
|
9987
10263
|
...params,
|
|
9988
|
-
getSettablePaths:
|
|
10264
|
+
getSettablePaths: _GeminiCliSkill.getSettablePaths
|
|
9989
10265
|
});
|
|
9990
|
-
const result =
|
|
10266
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9991
10267
|
if (!result.success) {
|
|
9992
|
-
const skillDirPath =
|
|
10268
|
+
const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9993
10269
|
throw new Error(
|
|
9994
|
-
`Invalid frontmatter in ${
|
|
10270
|
+
`Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9995
10271
|
);
|
|
9996
10272
|
}
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10273
|
+
return new _GeminiCliSkill({
|
|
10274
|
+
baseDir: loaded.baseDir,
|
|
10275
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
10276
|
+
dirName: loaded.dirName,
|
|
10277
|
+
frontmatter: result.data,
|
|
10278
|
+
body: loaded.body,
|
|
10279
|
+
otherFiles: loaded.otherFiles,
|
|
10280
|
+
validate: true,
|
|
10281
|
+
global: loaded.global
|
|
10282
|
+
});
|
|
10283
|
+
}
|
|
10284
|
+
static forDeletion({
|
|
10285
|
+
baseDir = process.cwd(),
|
|
10286
|
+
relativeDirPath,
|
|
10287
|
+
dirName,
|
|
10288
|
+
global = false
|
|
10289
|
+
}) {
|
|
10290
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
10291
|
+
return new _GeminiCliSkill({
|
|
10292
|
+
baseDir,
|
|
10293
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
10294
|
+
dirName,
|
|
10295
|
+
frontmatter: { name: "", description: "" },
|
|
10296
|
+
body: "",
|
|
10297
|
+
otherFiles: [],
|
|
10298
|
+
validate: false,
|
|
10299
|
+
global
|
|
10300
|
+
});
|
|
10301
|
+
}
|
|
10302
|
+
};
|
|
10303
|
+
|
|
10304
|
+
// src/features/skills/junie-skill.ts
|
|
10305
|
+
import { join as join74 } from "path";
|
|
10306
|
+
import { z as z35 } from "zod/mini";
|
|
10307
|
+
var JunieSkillFrontmatterSchema = z35.looseObject({
|
|
10308
|
+
name: z35.string(),
|
|
10309
|
+
description: z35.string()
|
|
10310
|
+
});
|
|
10311
|
+
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
10312
|
+
constructor({
|
|
10313
|
+
baseDir = process.cwd(),
|
|
10314
|
+
relativeDirPath = join74(".junie", "skills"),
|
|
10315
|
+
dirName,
|
|
10316
|
+
frontmatter,
|
|
10317
|
+
body,
|
|
10318
|
+
otherFiles = [],
|
|
10319
|
+
validate = true,
|
|
10320
|
+
global = false
|
|
10321
|
+
}) {
|
|
10322
|
+
super({
|
|
10323
|
+
baseDir,
|
|
10324
|
+
relativeDirPath,
|
|
10325
|
+
dirName,
|
|
10326
|
+
mainFile: {
|
|
10327
|
+
name: SKILL_FILE_NAME,
|
|
10328
|
+
body,
|
|
10329
|
+
frontmatter: { ...frontmatter }
|
|
10330
|
+
},
|
|
10331
|
+
otherFiles,
|
|
10332
|
+
global
|
|
10333
|
+
});
|
|
10334
|
+
if (validate) {
|
|
10335
|
+
const result = this.validate();
|
|
10336
|
+
if (!result.success) {
|
|
10337
|
+
throw result.error;
|
|
10338
|
+
}
|
|
10339
|
+
}
|
|
10340
|
+
}
|
|
10341
|
+
static getSettablePaths(options) {
|
|
10342
|
+
if (options?.global) {
|
|
10343
|
+
throw new Error("JunieSkill does not support global mode.");
|
|
10344
|
+
}
|
|
10345
|
+
return {
|
|
10346
|
+
relativeDirPath: join74(".junie", "skills")
|
|
10347
|
+
};
|
|
10348
|
+
}
|
|
10349
|
+
getFrontmatter() {
|
|
10350
|
+
const result = JunieSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
10351
|
+
return result;
|
|
10352
|
+
}
|
|
10353
|
+
getBody() {
|
|
10354
|
+
return this.mainFile?.body ?? "";
|
|
10355
|
+
}
|
|
10356
|
+
validate() {
|
|
10357
|
+
if (!this.mainFile) {
|
|
10358
|
+
return {
|
|
10359
|
+
success: false,
|
|
10360
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
10361
|
+
};
|
|
10362
|
+
}
|
|
10363
|
+
const result = JunieSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
10364
|
+
if (!result.success) {
|
|
10365
|
+
return {
|
|
10366
|
+
success: false,
|
|
10367
|
+
error: new Error(
|
|
10368
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
10369
|
+
)
|
|
10370
|
+
};
|
|
10371
|
+
}
|
|
10372
|
+
if (result.data.name !== this.getDirName()) {
|
|
10373
|
+
return {
|
|
10374
|
+
success: false,
|
|
10375
|
+
error: new Error(
|
|
10376
|
+
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
10377
|
+
)
|
|
10378
|
+
};
|
|
10379
|
+
}
|
|
10380
|
+
return { success: true, error: null };
|
|
10381
|
+
}
|
|
10382
|
+
toRulesyncSkill() {
|
|
10383
|
+
const frontmatter = this.getFrontmatter();
|
|
10384
|
+
const rulesyncFrontmatter = {
|
|
10385
|
+
name: frontmatter.name,
|
|
10386
|
+
description: frontmatter.description,
|
|
10387
|
+
targets: ["*"]
|
|
10388
|
+
};
|
|
10389
|
+
return new RulesyncSkill({
|
|
10390
|
+
baseDir: this.baseDir,
|
|
10391
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
10392
|
+
dirName: this.getDirName(),
|
|
10393
|
+
frontmatter: rulesyncFrontmatter,
|
|
10394
|
+
body: this.getBody(),
|
|
10395
|
+
otherFiles: this.getOtherFiles(),
|
|
10396
|
+
validate: true,
|
|
10397
|
+
global: this.global
|
|
10398
|
+
});
|
|
10399
|
+
}
|
|
10400
|
+
static fromRulesyncSkill({
|
|
10401
|
+
rulesyncSkill,
|
|
10402
|
+
validate = true,
|
|
10403
|
+
global = false
|
|
10404
|
+
}) {
|
|
10405
|
+
const settablePaths = _JunieSkill.getSettablePaths({ global });
|
|
10406
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
10407
|
+
const junieFrontmatter = {
|
|
10408
|
+
name: rulesyncFrontmatter.name,
|
|
10409
|
+
description: rulesyncFrontmatter.description
|
|
10410
|
+
};
|
|
10411
|
+
return new _JunieSkill({
|
|
10412
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
10413
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
10414
|
+
dirName: junieFrontmatter.name,
|
|
10415
|
+
frontmatter: junieFrontmatter,
|
|
10416
|
+
body: rulesyncSkill.getBody(),
|
|
10417
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
10418
|
+
validate,
|
|
10419
|
+
global
|
|
10420
|
+
});
|
|
10421
|
+
}
|
|
10422
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
10423
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
10424
|
+
return targets.includes("*") || targets.includes("junie");
|
|
10425
|
+
}
|
|
10426
|
+
static async fromDir(params) {
|
|
10427
|
+
const loaded = await this.loadSkillDirContent({
|
|
10428
|
+
...params,
|
|
10429
|
+
getSettablePaths: _JunieSkill.getSettablePaths
|
|
10430
|
+
});
|
|
10431
|
+
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10432
|
+
if (!result.success) {
|
|
10433
|
+
const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10434
|
+
throw new Error(
|
|
10435
|
+
`Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10436
|
+
);
|
|
10437
|
+
}
|
|
10438
|
+
if (result.data.name !== loaded.dirName) {
|
|
10439
|
+
const skillFilePath = join74(
|
|
10440
|
+
loaded.baseDir,
|
|
10441
|
+
loaded.relativeDirPath,
|
|
10442
|
+
loaded.dirName,
|
|
10443
|
+
SKILL_FILE_NAME
|
|
10444
|
+
);
|
|
10445
|
+
throw new Error(
|
|
10005
10446
|
`Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
|
|
10006
10447
|
);
|
|
10007
10448
|
}
|
|
@@ -10037,16 +10478,16 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
10037
10478
|
};
|
|
10038
10479
|
|
|
10039
10480
|
// src/features/skills/kilo-skill.ts
|
|
10040
|
-
import { join as
|
|
10041
|
-
import { z as
|
|
10042
|
-
var KiloSkillFrontmatterSchema =
|
|
10043
|
-
name:
|
|
10044
|
-
description:
|
|
10481
|
+
import { join as join75 } from "path";
|
|
10482
|
+
import { z as z36 } from "zod/mini";
|
|
10483
|
+
var KiloSkillFrontmatterSchema = z36.looseObject({
|
|
10484
|
+
name: z36.string(),
|
|
10485
|
+
description: z36.string()
|
|
10045
10486
|
});
|
|
10046
10487
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
10047
10488
|
constructor({
|
|
10048
10489
|
baseDir = process.cwd(),
|
|
10049
|
-
relativeDirPath =
|
|
10490
|
+
relativeDirPath = join75(".kilocode", "skills"),
|
|
10050
10491
|
dirName,
|
|
10051
10492
|
frontmatter,
|
|
10052
10493
|
body,
|
|
@@ -10077,7 +10518,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10077
10518
|
global: _global = false
|
|
10078
10519
|
} = {}) {
|
|
10079
10520
|
return {
|
|
10080
|
-
relativeDirPath:
|
|
10521
|
+
relativeDirPath: join75(".kilocode", "skills")
|
|
10081
10522
|
};
|
|
10082
10523
|
}
|
|
10083
10524
|
getFrontmatter() {
|
|
@@ -10165,13 +10606,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10165
10606
|
});
|
|
10166
10607
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10167
10608
|
if (!result.success) {
|
|
10168
|
-
const skillDirPath =
|
|
10609
|
+
const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10169
10610
|
throw new Error(
|
|
10170
|
-
`Invalid frontmatter in ${
|
|
10611
|
+
`Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10171
10612
|
);
|
|
10172
10613
|
}
|
|
10173
10614
|
if (result.data.name !== loaded.dirName) {
|
|
10174
|
-
const skillFilePath =
|
|
10615
|
+
const skillFilePath = join75(
|
|
10175
10616
|
loaded.baseDir,
|
|
10176
10617
|
loaded.relativeDirPath,
|
|
10177
10618
|
loaded.dirName,
|
|
@@ -10212,16 +10653,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10212
10653
|
};
|
|
10213
10654
|
|
|
10214
10655
|
// src/features/skills/kiro-skill.ts
|
|
10215
|
-
import { join as
|
|
10216
|
-
import { z as
|
|
10217
|
-
var KiroSkillFrontmatterSchema =
|
|
10218
|
-
name:
|
|
10219
|
-
description:
|
|
10656
|
+
import { join as join76 } from "path";
|
|
10657
|
+
import { z as z37 } from "zod/mini";
|
|
10658
|
+
var KiroSkillFrontmatterSchema = z37.looseObject({
|
|
10659
|
+
name: z37.string(),
|
|
10660
|
+
description: z37.string()
|
|
10220
10661
|
});
|
|
10221
10662
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
10222
10663
|
constructor({
|
|
10223
10664
|
baseDir = process.cwd(),
|
|
10224
|
-
relativeDirPath =
|
|
10665
|
+
relativeDirPath = join76(".kiro", "skills"),
|
|
10225
10666
|
dirName,
|
|
10226
10667
|
frontmatter,
|
|
10227
10668
|
body,
|
|
@@ -10253,7 +10694,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10253
10694
|
throw new Error("KiroSkill does not support global mode.");
|
|
10254
10695
|
}
|
|
10255
10696
|
return {
|
|
10256
|
-
relativeDirPath:
|
|
10697
|
+
relativeDirPath: join76(".kiro", "skills")
|
|
10257
10698
|
};
|
|
10258
10699
|
}
|
|
10259
10700
|
getFrontmatter() {
|
|
@@ -10341,13 +10782,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10341
10782
|
});
|
|
10342
10783
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10343
10784
|
if (!result.success) {
|
|
10344
|
-
const skillDirPath =
|
|
10785
|
+
const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10345
10786
|
throw new Error(
|
|
10346
|
-
`Invalid frontmatter in ${
|
|
10787
|
+
`Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10347
10788
|
);
|
|
10348
10789
|
}
|
|
10349
10790
|
if (result.data.name !== loaded.dirName) {
|
|
10350
|
-
const skillFilePath =
|
|
10791
|
+
const skillFilePath = join76(
|
|
10351
10792
|
loaded.baseDir,
|
|
10352
10793
|
loaded.relativeDirPath,
|
|
10353
10794
|
loaded.dirName,
|
|
@@ -10389,17 +10830,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10389
10830
|
};
|
|
10390
10831
|
|
|
10391
10832
|
// src/features/skills/opencode-skill.ts
|
|
10392
|
-
import { join as
|
|
10393
|
-
import { z as
|
|
10394
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
10395
|
-
name:
|
|
10396
|
-
description:
|
|
10397
|
-
"allowed-tools":
|
|
10833
|
+
import { join as join77 } from "path";
|
|
10834
|
+
import { z as z38 } from "zod/mini";
|
|
10835
|
+
var OpenCodeSkillFrontmatterSchema = z38.looseObject({
|
|
10836
|
+
name: z38.string(),
|
|
10837
|
+
description: z38.string(),
|
|
10838
|
+
"allowed-tools": z38.optional(z38.array(z38.string()))
|
|
10398
10839
|
});
|
|
10399
10840
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
10400
10841
|
constructor({
|
|
10401
10842
|
baseDir = process.cwd(),
|
|
10402
|
-
relativeDirPath =
|
|
10843
|
+
relativeDirPath = join77(".opencode", "skill"),
|
|
10403
10844
|
dirName,
|
|
10404
10845
|
frontmatter,
|
|
10405
10846
|
body,
|
|
@@ -10428,7 +10869,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10428
10869
|
}
|
|
10429
10870
|
static getSettablePaths({ global = false } = {}) {
|
|
10430
10871
|
return {
|
|
10431
|
-
relativeDirPath: global ?
|
|
10872
|
+
relativeDirPath: global ? join77(".config", "opencode", "skill") : join77(".opencode", "skill")
|
|
10432
10873
|
};
|
|
10433
10874
|
}
|
|
10434
10875
|
getFrontmatter() {
|
|
@@ -10514,9 +10955,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10514
10955
|
});
|
|
10515
10956
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10516
10957
|
if (!result.success) {
|
|
10517
|
-
const skillDirPath =
|
|
10958
|
+
const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10518
10959
|
throw new Error(
|
|
10519
|
-
`Invalid frontmatter in ${
|
|
10960
|
+
`Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10520
10961
|
);
|
|
10521
10962
|
}
|
|
10522
10963
|
return new _OpenCodeSkill({
|
|
@@ -10550,16 +10991,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10550
10991
|
};
|
|
10551
10992
|
|
|
10552
10993
|
// src/features/skills/replit-skill.ts
|
|
10553
|
-
import { join as
|
|
10554
|
-
import { z as
|
|
10555
|
-
var ReplitSkillFrontmatterSchema =
|
|
10556
|
-
name:
|
|
10557
|
-
description:
|
|
10994
|
+
import { join as join78 } from "path";
|
|
10995
|
+
import { z as z39 } from "zod/mini";
|
|
10996
|
+
var ReplitSkillFrontmatterSchema = z39.looseObject({
|
|
10997
|
+
name: z39.string(),
|
|
10998
|
+
description: z39.string()
|
|
10558
10999
|
});
|
|
10559
11000
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
10560
11001
|
constructor({
|
|
10561
11002
|
baseDir = process.cwd(),
|
|
10562
|
-
relativeDirPath =
|
|
11003
|
+
relativeDirPath = join78(".agents", "skills"),
|
|
10563
11004
|
dirName,
|
|
10564
11005
|
frontmatter,
|
|
10565
11006
|
body,
|
|
@@ -10591,7 +11032,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10591
11032
|
throw new Error("ReplitSkill does not support global mode.");
|
|
10592
11033
|
}
|
|
10593
11034
|
return {
|
|
10594
|
-
relativeDirPath:
|
|
11035
|
+
relativeDirPath: join78(".agents", "skills")
|
|
10595
11036
|
};
|
|
10596
11037
|
}
|
|
10597
11038
|
getFrontmatter() {
|
|
@@ -10671,9 +11112,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10671
11112
|
});
|
|
10672
11113
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10673
11114
|
if (!result.success) {
|
|
10674
|
-
const skillDirPath =
|
|
11115
|
+
const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10675
11116
|
throw new Error(
|
|
10676
|
-
`Invalid frontmatter in ${
|
|
11117
|
+
`Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10677
11118
|
);
|
|
10678
11119
|
}
|
|
10679
11120
|
return new _ReplitSkill({
|
|
@@ -10708,16 +11149,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10708
11149
|
};
|
|
10709
11150
|
|
|
10710
11151
|
// src/features/skills/roo-skill.ts
|
|
10711
|
-
import { join as
|
|
10712
|
-
import { z as
|
|
10713
|
-
var RooSkillFrontmatterSchema =
|
|
10714
|
-
name:
|
|
10715
|
-
description:
|
|
11152
|
+
import { join as join79 } from "path";
|
|
11153
|
+
import { z as z40 } from "zod/mini";
|
|
11154
|
+
var RooSkillFrontmatterSchema = z40.looseObject({
|
|
11155
|
+
name: z40.string(),
|
|
11156
|
+
description: z40.string()
|
|
10716
11157
|
});
|
|
10717
11158
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
10718
11159
|
constructor({
|
|
10719
11160
|
baseDir = process.cwd(),
|
|
10720
|
-
relativeDirPath =
|
|
11161
|
+
relativeDirPath = join79(".roo", "skills"),
|
|
10721
11162
|
dirName,
|
|
10722
11163
|
frontmatter,
|
|
10723
11164
|
body,
|
|
@@ -10748,7 +11189,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10748
11189
|
global: _global = false
|
|
10749
11190
|
} = {}) {
|
|
10750
11191
|
return {
|
|
10751
|
-
relativeDirPath:
|
|
11192
|
+
relativeDirPath: join79(".roo", "skills")
|
|
10752
11193
|
};
|
|
10753
11194
|
}
|
|
10754
11195
|
getFrontmatter() {
|
|
@@ -10836,13 +11277,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10836
11277
|
});
|
|
10837
11278
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10838
11279
|
if (!result.success) {
|
|
10839
|
-
const skillDirPath =
|
|
11280
|
+
const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10840
11281
|
throw new Error(
|
|
10841
|
-
`Invalid frontmatter in ${
|
|
11282
|
+
`Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10842
11283
|
);
|
|
10843
11284
|
}
|
|
10844
11285
|
if (result.data.name !== loaded.dirName) {
|
|
10845
|
-
const skillFilePath =
|
|
11286
|
+
const skillFilePath = join79(
|
|
10846
11287
|
loaded.baseDir,
|
|
10847
11288
|
loaded.relativeDirPath,
|
|
10848
11289
|
loaded.dirName,
|
|
@@ -10883,14 +11324,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10883
11324
|
};
|
|
10884
11325
|
|
|
10885
11326
|
// src/features/skills/skills-utils.ts
|
|
10886
|
-
import { basename as basename4, join as
|
|
11327
|
+
import { basename as basename4, join as join80 } from "path";
|
|
10887
11328
|
async function getLocalSkillDirNames(baseDir) {
|
|
10888
|
-
const skillsDir =
|
|
11329
|
+
const skillsDir = join80(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10889
11330
|
const names = /* @__PURE__ */ new Set();
|
|
10890
11331
|
if (!await directoryExists(skillsDir)) {
|
|
10891
11332
|
return names;
|
|
10892
11333
|
}
|
|
10893
|
-
const dirPaths = await findFilesByGlobs(
|
|
11334
|
+
const dirPaths = await findFilesByGlobs(join80(skillsDir, "*"), { type: "dir" });
|
|
10894
11335
|
for (const dirPath of dirPaths) {
|
|
10895
11336
|
const name = basename4(dirPath);
|
|
10896
11337
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -10910,6 +11351,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10910
11351
|
"codexcli",
|
|
10911
11352
|
"copilot",
|
|
10912
11353
|
"cursor",
|
|
11354
|
+
"deepagents",
|
|
10913
11355
|
"factorydroid",
|
|
10914
11356
|
"geminicli",
|
|
10915
11357
|
"junie",
|
|
@@ -10919,7 +11361,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10919
11361
|
"replit",
|
|
10920
11362
|
"roo"
|
|
10921
11363
|
];
|
|
10922
|
-
var SkillsProcessorToolTargetSchema =
|
|
11364
|
+
var SkillsProcessorToolTargetSchema = z41.enum(skillsProcessorToolTargetTuple);
|
|
10923
11365
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10924
11366
|
[
|
|
10925
11367
|
"agentsmd",
|
|
@@ -10984,11 +11426,18 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
10984
11426
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
10985
11427
|
}
|
|
10986
11428
|
],
|
|
11429
|
+
[
|
|
11430
|
+
"deepagents",
|
|
11431
|
+
{
|
|
11432
|
+
class: DeepagentsSkill,
|
|
11433
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: false }
|
|
11434
|
+
}
|
|
11435
|
+
],
|
|
10987
11436
|
[
|
|
10988
11437
|
"factorydroid",
|
|
10989
11438
|
{
|
|
10990
11439
|
class: FactorydroidSkill,
|
|
10991
|
-
meta: { supportsProject: true, supportsSimulated: true, supportsGlobal:
|
|
11440
|
+
meta: { supportsProject: true, supportsSimulated: true, supportsGlobal: false }
|
|
10992
11441
|
}
|
|
10993
11442
|
],
|
|
10994
11443
|
[
|
|
@@ -11129,10 +11578,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11129
11578
|
)
|
|
11130
11579
|
);
|
|
11131
11580
|
const localSkillNames = new Set(localDirNames);
|
|
11132
|
-
const curatedDirPath =
|
|
11581
|
+
const curatedDirPath = join81(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
11133
11582
|
let curatedSkills = [];
|
|
11134
11583
|
if (await directoryExists(curatedDirPath)) {
|
|
11135
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
11584
|
+
const curatedDirPaths = await findFilesByGlobs(join81(curatedDirPath, "*"), { type: "dir" });
|
|
11136
11585
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
11137
11586
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
11138
11587
|
if (localSkillNames.has(name)) {
|
|
@@ -11166,8 +11615,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11166
11615
|
async loadToolDirs() {
|
|
11167
11616
|
const factory = this.getFactory(this.toolTarget);
|
|
11168
11617
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11169
|
-
const skillsDirPath =
|
|
11170
|
-
const dirPaths = await findFilesByGlobs(
|
|
11618
|
+
const skillsDirPath = join81(this.baseDir, paths.relativeDirPath);
|
|
11619
|
+
const dirPaths = await findFilesByGlobs(join81(skillsDirPath, "*"), { type: "dir" });
|
|
11171
11620
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
11172
11621
|
const toolSkills = await Promise.all(
|
|
11173
11622
|
dirNames.map(
|
|
@@ -11184,8 +11633,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11184
11633
|
async loadToolDirsToDelete() {
|
|
11185
11634
|
const factory = this.getFactory(this.toolTarget);
|
|
11186
11635
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11187
|
-
const skillsDirPath =
|
|
11188
|
-
const dirPaths = await findFilesByGlobs(
|
|
11636
|
+
const skillsDirPath = join81(this.baseDir, paths.relativeDirPath);
|
|
11637
|
+
const dirPaths = await findFilesByGlobs(join81(skillsDirPath, "*"), { type: "dir" });
|
|
11189
11638
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
11190
11639
|
const toolSkills = dirNames.map(
|
|
11191
11640
|
(dirName) => factory.class.forDeletion({
|
|
@@ -11247,11 +11696,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11247
11696
|
};
|
|
11248
11697
|
|
|
11249
11698
|
// src/features/subagents/agentsmd-subagent.ts
|
|
11250
|
-
import { join as
|
|
11699
|
+
import { join as join83 } from "path";
|
|
11251
11700
|
|
|
11252
11701
|
// src/features/subagents/simulated-subagent.ts
|
|
11253
|
-
import { basename as basename6, join as
|
|
11254
|
-
import { z as
|
|
11702
|
+
import { basename as basename6, join as join82 } from "path";
|
|
11703
|
+
import { z as z42 } from "zod/mini";
|
|
11255
11704
|
|
|
11256
11705
|
// src/features/subagents/tool-subagent.ts
|
|
11257
11706
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -11303,9 +11752,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
11303
11752
|
};
|
|
11304
11753
|
|
|
11305
11754
|
// src/features/subagents/simulated-subagent.ts
|
|
11306
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
11307
|
-
name:
|
|
11308
|
-
description:
|
|
11755
|
+
var SimulatedSubagentFrontmatterSchema = z42.object({
|
|
11756
|
+
name: z42.string(),
|
|
11757
|
+
description: z42.optional(z42.string())
|
|
11309
11758
|
});
|
|
11310
11759
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
11311
11760
|
frontmatter;
|
|
@@ -11315,7 +11764,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11315
11764
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11316
11765
|
if (!result.success) {
|
|
11317
11766
|
throw new Error(
|
|
11318
|
-
`Invalid frontmatter in ${
|
|
11767
|
+
`Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11319
11768
|
);
|
|
11320
11769
|
}
|
|
11321
11770
|
}
|
|
@@ -11366,7 +11815,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11366
11815
|
return {
|
|
11367
11816
|
success: false,
|
|
11368
11817
|
error: new Error(
|
|
11369
|
-
`Invalid frontmatter in ${
|
|
11818
|
+
`Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11370
11819
|
)
|
|
11371
11820
|
};
|
|
11372
11821
|
}
|
|
@@ -11376,7 +11825,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11376
11825
|
relativeFilePath,
|
|
11377
11826
|
validate = true
|
|
11378
11827
|
}) {
|
|
11379
|
-
const filePath =
|
|
11828
|
+
const filePath = join82(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
11380
11829
|
const fileContent = await readFileContent(filePath);
|
|
11381
11830
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11382
11831
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11412,7 +11861,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11412
11861
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
11413
11862
|
static getSettablePaths() {
|
|
11414
11863
|
return {
|
|
11415
|
-
relativeDirPath:
|
|
11864
|
+
relativeDirPath: join83(".agents", "subagents")
|
|
11416
11865
|
};
|
|
11417
11866
|
}
|
|
11418
11867
|
static async fromFile(params) {
|
|
@@ -11435,11 +11884,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
11435
11884
|
};
|
|
11436
11885
|
|
|
11437
11886
|
// src/features/subagents/factorydroid-subagent.ts
|
|
11438
|
-
import { join as
|
|
11887
|
+
import { join as join84 } from "path";
|
|
11439
11888
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
11440
11889
|
static getSettablePaths(_options) {
|
|
11441
11890
|
return {
|
|
11442
|
-
relativeDirPath:
|
|
11891
|
+
relativeDirPath: join84(".factory", "droids")
|
|
11443
11892
|
};
|
|
11444
11893
|
}
|
|
11445
11894
|
static async fromFile(params) {
|
|
@@ -11462,11 +11911,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
11462
11911
|
};
|
|
11463
11912
|
|
|
11464
11913
|
// src/features/subagents/geminicli-subagent.ts
|
|
11465
|
-
import { join as
|
|
11914
|
+
import { join as join85 } from "path";
|
|
11466
11915
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
11467
11916
|
static getSettablePaths() {
|
|
11468
11917
|
return {
|
|
11469
|
-
relativeDirPath:
|
|
11918
|
+
relativeDirPath: join85(".gemini", "subagents")
|
|
11470
11919
|
};
|
|
11471
11920
|
}
|
|
11472
11921
|
static async fromFile(params) {
|
|
@@ -11489,11 +11938,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
11489
11938
|
};
|
|
11490
11939
|
|
|
11491
11940
|
// src/features/subagents/roo-subagent.ts
|
|
11492
|
-
import { join as
|
|
11941
|
+
import { join as join86 } from "path";
|
|
11493
11942
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
11494
11943
|
static getSettablePaths() {
|
|
11495
11944
|
return {
|
|
11496
|
-
relativeDirPath:
|
|
11945
|
+
relativeDirPath: join86(".roo", "subagents")
|
|
11497
11946
|
};
|
|
11498
11947
|
}
|
|
11499
11948
|
static async fromFile(params) {
|
|
@@ -11516,20 +11965,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
11516
11965
|
};
|
|
11517
11966
|
|
|
11518
11967
|
// src/features/subagents/subagents-processor.ts
|
|
11519
|
-
import { basename as basename9, join as
|
|
11520
|
-
import { z as
|
|
11968
|
+
import { basename as basename9, join as join96 } from "path";
|
|
11969
|
+
import { z as z52 } from "zod/mini";
|
|
11521
11970
|
|
|
11522
11971
|
// src/features/subagents/claudecode-subagent.ts
|
|
11523
|
-
import { join as
|
|
11524
|
-
import { z as
|
|
11972
|
+
import { join as join88 } from "path";
|
|
11973
|
+
import { z as z44 } from "zod/mini";
|
|
11525
11974
|
|
|
11526
11975
|
// src/features/subagents/rulesync-subagent.ts
|
|
11527
|
-
import { basename as basename7, join as
|
|
11528
|
-
import { z as
|
|
11529
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
11530
|
-
targets:
|
|
11531
|
-
name:
|
|
11532
|
-
description:
|
|
11976
|
+
import { basename as basename7, join as join87 } from "path";
|
|
11977
|
+
import { z as z43 } from "zod/mini";
|
|
11978
|
+
var RulesyncSubagentFrontmatterSchema = z43.looseObject({
|
|
11979
|
+
targets: z43._default(RulesyncTargetsSchema, ["*"]),
|
|
11980
|
+
name: z43.string(),
|
|
11981
|
+
description: z43.optional(z43.string())
|
|
11533
11982
|
});
|
|
11534
11983
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
11535
11984
|
frontmatter;
|
|
@@ -11538,7 +11987,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11538
11987
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11539
11988
|
if (!parseResult.success && rest.validate !== false) {
|
|
11540
11989
|
throw new Error(
|
|
11541
|
-
`Invalid frontmatter in ${
|
|
11990
|
+
`Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11542
11991
|
);
|
|
11543
11992
|
}
|
|
11544
11993
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -11571,7 +12020,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11571
12020
|
return {
|
|
11572
12021
|
success: false,
|
|
11573
12022
|
error: new Error(
|
|
11574
|
-
`Invalid frontmatter in ${
|
|
12023
|
+
`Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11575
12024
|
)
|
|
11576
12025
|
};
|
|
11577
12026
|
}
|
|
@@ -11579,7 +12028,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11579
12028
|
static async fromFile({
|
|
11580
12029
|
relativeFilePath
|
|
11581
12030
|
}) {
|
|
11582
|
-
const filePath =
|
|
12031
|
+
const filePath = join87(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
11583
12032
|
const fileContent = await readFileContent(filePath);
|
|
11584
12033
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11585
12034
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11598,13 +12047,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11598
12047
|
};
|
|
11599
12048
|
|
|
11600
12049
|
// src/features/subagents/claudecode-subagent.ts
|
|
11601
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
11602
|
-
name:
|
|
11603
|
-
description:
|
|
11604
|
-
model:
|
|
11605
|
-
tools:
|
|
11606
|
-
permissionMode:
|
|
11607
|
-
skills:
|
|
12050
|
+
var ClaudecodeSubagentFrontmatterSchema = z44.looseObject({
|
|
12051
|
+
name: z44.string(),
|
|
12052
|
+
description: z44.optional(z44.string()),
|
|
12053
|
+
model: z44.optional(z44.string()),
|
|
12054
|
+
tools: z44.optional(z44.union([z44.string(), z44.array(z44.string())])),
|
|
12055
|
+
permissionMode: z44.optional(z44.string()),
|
|
12056
|
+
skills: z44.optional(z44.union([z44.string(), z44.array(z44.string())]))
|
|
11608
12057
|
});
|
|
11609
12058
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
11610
12059
|
frontmatter;
|
|
@@ -11614,7 +12063,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11614
12063
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11615
12064
|
if (!result.success) {
|
|
11616
12065
|
throw new Error(
|
|
11617
|
-
`Invalid frontmatter in ${
|
|
12066
|
+
`Invalid frontmatter in ${join88(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11618
12067
|
);
|
|
11619
12068
|
}
|
|
11620
12069
|
}
|
|
@@ -11626,7 +12075,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11626
12075
|
}
|
|
11627
12076
|
static getSettablePaths(_options = {}) {
|
|
11628
12077
|
return {
|
|
11629
|
-
relativeDirPath:
|
|
12078
|
+
relativeDirPath: join88(".claude", "agents")
|
|
11630
12079
|
};
|
|
11631
12080
|
}
|
|
11632
12081
|
getFrontmatter() {
|
|
@@ -11705,7 +12154,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11705
12154
|
return {
|
|
11706
12155
|
success: false,
|
|
11707
12156
|
error: new Error(
|
|
11708
|
-
`Invalid frontmatter in ${
|
|
12157
|
+
`Invalid frontmatter in ${join88(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11709
12158
|
)
|
|
11710
12159
|
};
|
|
11711
12160
|
}
|
|
@@ -11723,7 +12172,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11723
12172
|
global = false
|
|
11724
12173
|
}) {
|
|
11725
12174
|
const paths = this.getSettablePaths({ global });
|
|
11726
|
-
const filePath =
|
|
12175
|
+
const filePath = join88(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11727
12176
|
const fileContent = await readFileContent(filePath);
|
|
11728
12177
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11729
12178
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11758,16 +12207,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11758
12207
|
};
|
|
11759
12208
|
|
|
11760
12209
|
// src/features/subagents/codexcli-subagent.ts
|
|
11761
|
-
import { join as
|
|
12210
|
+
import { join as join89 } from "path";
|
|
11762
12211
|
import * as smolToml2 from "smol-toml";
|
|
11763
|
-
import { z as
|
|
11764
|
-
var CodexCliSubagentTomlSchema =
|
|
11765
|
-
name:
|
|
11766
|
-
description:
|
|
11767
|
-
developer_instructions:
|
|
11768
|
-
model:
|
|
11769
|
-
model_reasoning_effort:
|
|
11770
|
-
sandbox_mode:
|
|
12212
|
+
import { z as z45 } from "zod/mini";
|
|
12213
|
+
var CodexCliSubagentTomlSchema = z45.looseObject({
|
|
12214
|
+
name: z45.string(),
|
|
12215
|
+
description: z45.optional(z45.string()),
|
|
12216
|
+
developer_instructions: z45.optional(z45.string()),
|
|
12217
|
+
model: z45.optional(z45.string()),
|
|
12218
|
+
model_reasoning_effort: z45.optional(z45.string()),
|
|
12219
|
+
sandbox_mode: z45.optional(z45.string())
|
|
11771
12220
|
});
|
|
11772
12221
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
11773
12222
|
body;
|
|
@@ -11778,7 +12227,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11778
12227
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
11779
12228
|
} catch (error) {
|
|
11780
12229
|
throw new Error(
|
|
11781
|
-
`Invalid TOML in ${
|
|
12230
|
+
`Invalid TOML in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11782
12231
|
{ cause: error }
|
|
11783
12232
|
);
|
|
11784
12233
|
}
|
|
@@ -11790,7 +12239,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11790
12239
|
}
|
|
11791
12240
|
static getSettablePaths(_options = {}) {
|
|
11792
12241
|
return {
|
|
11793
|
-
relativeDirPath:
|
|
12242
|
+
relativeDirPath: join89(".codex", "agents")
|
|
11794
12243
|
};
|
|
11795
12244
|
}
|
|
11796
12245
|
getBody() {
|
|
@@ -11802,7 +12251,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11802
12251
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
11803
12252
|
} catch (error) {
|
|
11804
12253
|
throw new Error(
|
|
11805
|
-
`Failed to parse TOML in ${
|
|
12254
|
+
`Failed to parse TOML in ${join89(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11806
12255
|
{ cause: error }
|
|
11807
12256
|
);
|
|
11808
12257
|
}
|
|
@@ -11883,7 +12332,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11883
12332
|
global = false
|
|
11884
12333
|
}) {
|
|
11885
12334
|
const paths = this.getSettablePaths({ global });
|
|
11886
|
-
const filePath =
|
|
12335
|
+
const filePath = join89(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11887
12336
|
const fileContent = await readFileContent(filePath);
|
|
11888
12337
|
const subagent = new _CodexCliSubagent({
|
|
11889
12338
|
baseDir,
|
|
@@ -11921,13 +12370,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11921
12370
|
};
|
|
11922
12371
|
|
|
11923
12372
|
// src/features/subagents/copilot-subagent.ts
|
|
11924
|
-
import { join as
|
|
11925
|
-
import { z as
|
|
12373
|
+
import { join as join90 } from "path";
|
|
12374
|
+
import { z as z46 } from "zod/mini";
|
|
11926
12375
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11927
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11928
|
-
name:
|
|
11929
|
-
description:
|
|
11930
|
-
tools:
|
|
12376
|
+
var CopilotSubagentFrontmatterSchema = z46.looseObject({
|
|
12377
|
+
name: z46.string(),
|
|
12378
|
+
description: z46.optional(z46.string()),
|
|
12379
|
+
tools: z46.optional(z46.union([z46.string(), z46.array(z46.string())]))
|
|
11931
12380
|
});
|
|
11932
12381
|
var normalizeTools = (tools) => {
|
|
11933
12382
|
if (!tools) {
|
|
@@ -11947,7 +12396,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11947
12396
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11948
12397
|
if (!result.success) {
|
|
11949
12398
|
throw new Error(
|
|
11950
|
-
`Invalid frontmatter in ${
|
|
12399
|
+
`Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11951
12400
|
);
|
|
11952
12401
|
}
|
|
11953
12402
|
}
|
|
@@ -11959,7 +12408,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11959
12408
|
}
|
|
11960
12409
|
static getSettablePaths(_options = {}) {
|
|
11961
12410
|
return {
|
|
11962
|
-
relativeDirPath:
|
|
12411
|
+
relativeDirPath: join90(".github", "agents")
|
|
11963
12412
|
};
|
|
11964
12413
|
}
|
|
11965
12414
|
getFrontmatter() {
|
|
@@ -12009,11 +12458,158 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12009
12458
|
...mergedTools.length > 0 && { tools: mergedTools }
|
|
12010
12459
|
};
|
|
12011
12460
|
const body = rulesyncSubagent.getBody();
|
|
12012
|
-
const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
|
|
12461
|
+
const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
|
|
12462
|
+
const paths = this.getSettablePaths({ global });
|
|
12463
|
+
return new _CopilotSubagent({
|
|
12464
|
+
baseDir,
|
|
12465
|
+
frontmatter: copilotFrontmatter,
|
|
12466
|
+
body,
|
|
12467
|
+
relativeDirPath: paths.relativeDirPath,
|
|
12468
|
+
relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
|
|
12469
|
+
fileContent,
|
|
12470
|
+
validate,
|
|
12471
|
+
global
|
|
12472
|
+
});
|
|
12473
|
+
}
|
|
12474
|
+
validate() {
|
|
12475
|
+
if (!this.frontmatter) {
|
|
12476
|
+
return { success: true, error: null };
|
|
12477
|
+
}
|
|
12478
|
+
const result = CopilotSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
12479
|
+
if (result.success) {
|
|
12480
|
+
return { success: true, error: null };
|
|
12481
|
+
} else {
|
|
12482
|
+
return {
|
|
12483
|
+
success: false,
|
|
12484
|
+
error: new Error(
|
|
12485
|
+
`Invalid frontmatter in ${join90(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12486
|
+
)
|
|
12487
|
+
};
|
|
12488
|
+
}
|
|
12489
|
+
}
|
|
12490
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
12491
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
12492
|
+
rulesyncSubagent,
|
|
12493
|
+
toolTarget: "copilot"
|
|
12494
|
+
});
|
|
12495
|
+
}
|
|
12496
|
+
static async fromFile({
|
|
12497
|
+
baseDir = process.cwd(),
|
|
12498
|
+
relativeFilePath,
|
|
12499
|
+
validate = true,
|
|
12500
|
+
global = false
|
|
12501
|
+
}) {
|
|
12502
|
+
const paths = this.getSettablePaths({ global });
|
|
12503
|
+
const filePath = join90(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12504
|
+
const fileContent = await readFileContent(filePath);
|
|
12505
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12506
|
+
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12507
|
+
if (!result.success) {
|
|
12508
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
12509
|
+
}
|
|
12510
|
+
return new _CopilotSubagent({
|
|
12511
|
+
baseDir,
|
|
12512
|
+
relativeDirPath: paths.relativeDirPath,
|
|
12513
|
+
relativeFilePath,
|
|
12514
|
+
frontmatter: result.data,
|
|
12515
|
+
body: content.trim(),
|
|
12516
|
+
fileContent,
|
|
12517
|
+
validate,
|
|
12518
|
+
global
|
|
12519
|
+
});
|
|
12520
|
+
}
|
|
12521
|
+
static forDeletion({
|
|
12522
|
+
baseDir = process.cwd(),
|
|
12523
|
+
relativeDirPath,
|
|
12524
|
+
relativeFilePath
|
|
12525
|
+
}) {
|
|
12526
|
+
return new _CopilotSubagent({
|
|
12527
|
+
baseDir,
|
|
12528
|
+
relativeDirPath,
|
|
12529
|
+
relativeFilePath,
|
|
12530
|
+
frontmatter: { name: "", description: "" },
|
|
12531
|
+
body: "",
|
|
12532
|
+
fileContent: "",
|
|
12533
|
+
validate: false
|
|
12534
|
+
});
|
|
12535
|
+
}
|
|
12536
|
+
};
|
|
12537
|
+
|
|
12538
|
+
// src/features/subagents/cursor-subagent.ts
|
|
12539
|
+
import { join as join91 } from "path";
|
|
12540
|
+
import { z as z47 } from "zod/mini";
|
|
12541
|
+
var CursorSubagentFrontmatterSchema = z47.looseObject({
|
|
12542
|
+
name: z47.string(),
|
|
12543
|
+
description: z47.optional(z47.string())
|
|
12544
|
+
});
|
|
12545
|
+
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
12546
|
+
frontmatter;
|
|
12547
|
+
body;
|
|
12548
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
12549
|
+
if (rest.validate !== false) {
|
|
12550
|
+
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12551
|
+
if (!result.success) {
|
|
12552
|
+
throw new Error(
|
|
12553
|
+
`Invalid frontmatter in ${join91(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12554
|
+
);
|
|
12555
|
+
}
|
|
12556
|
+
}
|
|
12557
|
+
super({
|
|
12558
|
+
...rest
|
|
12559
|
+
});
|
|
12560
|
+
this.frontmatter = frontmatter;
|
|
12561
|
+
this.body = body;
|
|
12562
|
+
}
|
|
12563
|
+
static getSettablePaths(_options = {}) {
|
|
12564
|
+
return {
|
|
12565
|
+
relativeDirPath: join91(".cursor", "agents")
|
|
12566
|
+
};
|
|
12567
|
+
}
|
|
12568
|
+
getFrontmatter() {
|
|
12569
|
+
return this.frontmatter;
|
|
12570
|
+
}
|
|
12571
|
+
getBody() {
|
|
12572
|
+
return this.body;
|
|
12573
|
+
}
|
|
12574
|
+
toRulesyncSubagent() {
|
|
12575
|
+
const { name, description, ...rest } = this.frontmatter;
|
|
12576
|
+
const rulesyncFrontmatter = {
|
|
12577
|
+
targets: ["*"],
|
|
12578
|
+
name,
|
|
12579
|
+
description,
|
|
12580
|
+
cursor: {
|
|
12581
|
+
...rest
|
|
12582
|
+
}
|
|
12583
|
+
};
|
|
12584
|
+
return new RulesyncSubagent({
|
|
12585
|
+
baseDir: ".",
|
|
12586
|
+
// RulesyncSubagent baseDir is always the project root directory
|
|
12587
|
+
frontmatter: rulesyncFrontmatter,
|
|
12588
|
+
body: this.body,
|
|
12589
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
12590
|
+
relativeFilePath: this.getRelativeFilePath(),
|
|
12591
|
+
validate: true
|
|
12592
|
+
});
|
|
12593
|
+
}
|
|
12594
|
+
static fromRulesyncSubagent({
|
|
12595
|
+
baseDir = process.cwd(),
|
|
12596
|
+
rulesyncSubagent,
|
|
12597
|
+
validate = true,
|
|
12598
|
+
global = false
|
|
12599
|
+
}) {
|
|
12600
|
+
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
12601
|
+
const cursorSection = rulesyncFrontmatter.cursor ?? {};
|
|
12602
|
+
const cursorFrontmatter = {
|
|
12603
|
+
name: rulesyncFrontmatter.name,
|
|
12604
|
+
description: rulesyncFrontmatter.description,
|
|
12605
|
+
...cursorSection
|
|
12606
|
+
};
|
|
12607
|
+
const body = rulesyncSubagent.getBody();
|
|
12608
|
+
const fileContent = stringifyFrontmatter(body, cursorFrontmatter, { avoidBlockScalars: true });
|
|
12013
12609
|
const paths = this.getSettablePaths({ global });
|
|
12014
|
-
return new
|
|
12610
|
+
return new _CursorSubagent({
|
|
12015
12611
|
baseDir,
|
|
12016
|
-
frontmatter:
|
|
12612
|
+
frontmatter: cursorFrontmatter,
|
|
12017
12613
|
body,
|
|
12018
12614
|
relativeDirPath: paths.relativeDirPath,
|
|
12019
12615
|
relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
|
|
@@ -12026,14 +12622,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12026
12622
|
if (!this.frontmatter) {
|
|
12027
12623
|
return { success: true, error: null };
|
|
12028
12624
|
}
|
|
12029
|
-
const result =
|
|
12625
|
+
const result = CursorSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
12030
12626
|
if (result.success) {
|
|
12031
12627
|
return { success: true, error: null };
|
|
12032
12628
|
} else {
|
|
12033
12629
|
return {
|
|
12034
12630
|
success: false,
|
|
12035
12631
|
error: new Error(
|
|
12036
|
-
`Invalid frontmatter in ${
|
|
12632
|
+
`Invalid frontmatter in ${join91(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12037
12633
|
)
|
|
12038
12634
|
};
|
|
12039
12635
|
}
|
|
@@ -12041,7 +12637,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12041
12637
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
12042
12638
|
return this.isTargetedByRulesyncSubagentDefault({
|
|
12043
12639
|
rulesyncSubagent,
|
|
12044
|
-
toolTarget: "
|
|
12640
|
+
toolTarget: "cursor"
|
|
12045
12641
|
});
|
|
12046
12642
|
}
|
|
12047
12643
|
static async fromFile({
|
|
@@ -12051,14 +12647,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12051
12647
|
global = false
|
|
12052
12648
|
}) {
|
|
12053
12649
|
const paths = this.getSettablePaths({ global });
|
|
12054
|
-
const filePath =
|
|
12650
|
+
const filePath = join91(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12055
12651
|
const fileContent = await readFileContent(filePath);
|
|
12056
12652
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12057
|
-
const result =
|
|
12653
|
+
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12058
12654
|
if (!result.success) {
|
|
12059
12655
|
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
12060
12656
|
}
|
|
12061
|
-
return new
|
|
12657
|
+
return new _CursorSubagent({
|
|
12062
12658
|
baseDir,
|
|
12063
12659
|
relativeDirPath: paths.relativeDirPath,
|
|
12064
12660
|
relativeFilePath,
|
|
@@ -12074,7 +12670,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12074
12670
|
relativeDirPath,
|
|
12075
12671
|
relativeFilePath
|
|
12076
12672
|
}) {
|
|
12077
|
-
return new
|
|
12673
|
+
return new _CursorSubagent({
|
|
12078
12674
|
baseDir,
|
|
12079
12675
|
relativeDirPath,
|
|
12080
12676
|
relativeFilePath,
|
|
@@ -12086,34 +12682,33 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12086
12682
|
}
|
|
12087
12683
|
};
|
|
12088
12684
|
|
|
12089
|
-
// src/features/subagents/
|
|
12090
|
-
import { join as
|
|
12091
|
-
import { z as
|
|
12092
|
-
var
|
|
12093
|
-
name:
|
|
12094
|
-
description:
|
|
12685
|
+
// src/features/subagents/deepagents-subagent.ts
|
|
12686
|
+
import { join as join92 } from "path";
|
|
12687
|
+
import { z as z48 } from "zod/mini";
|
|
12688
|
+
var DeepagentsSubagentFrontmatterSchema = z48.looseObject({
|
|
12689
|
+
name: z48.string(),
|
|
12690
|
+
description: z48.optional(z48.string()),
|
|
12691
|
+
model: z48.optional(z48.string())
|
|
12095
12692
|
});
|
|
12096
|
-
var
|
|
12693
|
+
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
12097
12694
|
frontmatter;
|
|
12098
12695
|
body;
|
|
12099
12696
|
constructor({ frontmatter, body, ...rest }) {
|
|
12100
12697
|
if (rest.validate !== false) {
|
|
12101
|
-
const result =
|
|
12698
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12102
12699
|
if (!result.success) {
|
|
12103
12700
|
throw new Error(
|
|
12104
|
-
`Invalid frontmatter in ${
|
|
12701
|
+
`Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12105
12702
|
);
|
|
12106
12703
|
}
|
|
12107
12704
|
}
|
|
12108
|
-
super({
|
|
12109
|
-
...rest
|
|
12110
|
-
});
|
|
12705
|
+
super({ ...rest });
|
|
12111
12706
|
this.frontmatter = frontmatter;
|
|
12112
12707
|
this.body = body;
|
|
12113
12708
|
}
|
|
12114
12709
|
static getSettablePaths(_options = {}) {
|
|
12115
12710
|
return {
|
|
12116
|
-
relativeDirPath:
|
|
12711
|
+
relativeDirPath: join92(".deepagents", "agents")
|
|
12117
12712
|
};
|
|
12118
12713
|
}
|
|
12119
12714
|
getFrontmatter() {
|
|
@@ -12123,18 +12718,17 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12123
12718
|
return this.body;
|
|
12124
12719
|
}
|
|
12125
12720
|
toRulesyncSubagent() {
|
|
12126
|
-
const { name, description,
|
|
12721
|
+
const { name, description, model } = this.frontmatter;
|
|
12722
|
+
const deepagentsSection = {};
|
|
12723
|
+
if (model) deepagentsSection.model = model;
|
|
12127
12724
|
const rulesyncFrontmatter = {
|
|
12128
12725
|
targets: ["*"],
|
|
12129
12726
|
name,
|
|
12130
12727
|
description,
|
|
12131
|
-
|
|
12132
|
-
...rest
|
|
12133
|
-
}
|
|
12728
|
+
...Object.keys(deepagentsSection).length > 0 && { deepagents: deepagentsSection }
|
|
12134
12729
|
};
|
|
12135
12730
|
return new RulesyncSubagent({
|
|
12136
|
-
baseDir:
|
|
12137
|
-
// RulesyncSubagent baseDir is always the project root directory
|
|
12731
|
+
baseDir: this.getBaseDir(),
|
|
12138
12732
|
frontmatter: rulesyncFrontmatter,
|
|
12139
12733
|
body: this.body,
|
|
12140
12734
|
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
@@ -12149,38 +12743,47 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12149
12743
|
global = false
|
|
12150
12744
|
}) {
|
|
12151
12745
|
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
12152
|
-
const
|
|
12153
|
-
|
|
12746
|
+
const deepagentsSection = this.filterToolSpecificSection(rulesyncFrontmatter.deepagents ?? {}, [
|
|
12747
|
+
"name",
|
|
12748
|
+
"description"
|
|
12749
|
+
]);
|
|
12750
|
+
const rawFrontmatter = {
|
|
12154
12751
|
name: rulesyncFrontmatter.name,
|
|
12155
12752
|
description: rulesyncFrontmatter.description,
|
|
12156
|
-
...
|
|
12753
|
+
...deepagentsSection
|
|
12157
12754
|
};
|
|
12755
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(rawFrontmatter);
|
|
12756
|
+
if (!result.success) {
|
|
12757
|
+
throw new Error(
|
|
12758
|
+
`Invalid deepagents subagent frontmatter in ${rulesyncSubagent.getRelativeFilePath()}: ${formatError(result.error)}`
|
|
12759
|
+
);
|
|
12760
|
+
}
|
|
12761
|
+
const deepagentsFrontmatter = result.data;
|
|
12158
12762
|
const body = rulesyncSubagent.getBody();
|
|
12159
|
-
const fileContent = stringifyFrontmatter(body,
|
|
12763
|
+
const fileContent = stringifyFrontmatter(body, deepagentsFrontmatter);
|
|
12160
12764
|
const paths = this.getSettablePaths({ global });
|
|
12161
|
-
return new
|
|
12765
|
+
return new _DeepagentsSubagent({
|
|
12162
12766
|
baseDir,
|
|
12163
|
-
frontmatter:
|
|
12767
|
+
frontmatter: deepagentsFrontmatter,
|
|
12164
12768
|
body,
|
|
12165
12769
|
relativeDirPath: paths.relativeDirPath,
|
|
12166
12770
|
relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
|
|
12167
12771
|
fileContent,
|
|
12168
|
-
validate
|
|
12169
|
-
global
|
|
12772
|
+
validate
|
|
12170
12773
|
});
|
|
12171
12774
|
}
|
|
12172
12775
|
validate() {
|
|
12173
12776
|
if (!this.frontmatter) {
|
|
12174
12777
|
return { success: true, error: null };
|
|
12175
12778
|
}
|
|
12176
|
-
const result =
|
|
12779
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
12177
12780
|
if (result.success) {
|
|
12178
12781
|
return { success: true, error: null };
|
|
12179
12782
|
} else {
|
|
12180
12783
|
return {
|
|
12181
12784
|
success: false,
|
|
12182
12785
|
error: new Error(
|
|
12183
|
-
`Invalid frontmatter in ${
|
|
12786
|
+
`Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12184
12787
|
)
|
|
12185
12788
|
};
|
|
12186
12789
|
}
|
|
@@ -12188,7 +12791,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12188
12791
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
12189
12792
|
return this.isTargetedByRulesyncSubagentDefault({
|
|
12190
12793
|
rulesyncSubagent,
|
|
12191
|
-
toolTarget: "
|
|
12794
|
+
toolTarget: "deepagents"
|
|
12192
12795
|
});
|
|
12193
12796
|
}
|
|
12194
12797
|
static async fromFile({
|
|
@@ -12198,22 +12801,21 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12198
12801
|
global = false
|
|
12199
12802
|
}) {
|
|
12200
12803
|
const paths = this.getSettablePaths({ global });
|
|
12201
|
-
const filePath =
|
|
12804
|
+
const filePath = join92(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12202
12805
|
const fileContent = await readFileContent(filePath);
|
|
12203
12806
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12204
|
-
const result =
|
|
12807
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12205
12808
|
if (!result.success) {
|
|
12206
12809
|
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
12207
12810
|
}
|
|
12208
|
-
return new
|
|
12811
|
+
return new _DeepagentsSubagent({
|
|
12209
12812
|
baseDir,
|
|
12210
12813
|
relativeDirPath: paths.relativeDirPath,
|
|
12211
12814
|
relativeFilePath,
|
|
12212
12815
|
frontmatter: result.data,
|
|
12213
12816
|
body: content.trim(),
|
|
12214
12817
|
fileContent,
|
|
12215
|
-
validate
|
|
12216
|
-
global
|
|
12818
|
+
validate
|
|
12217
12819
|
});
|
|
12218
12820
|
}
|
|
12219
12821
|
static forDeletion({
|
|
@@ -12221,7 +12823,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12221
12823
|
relativeDirPath,
|
|
12222
12824
|
relativeFilePath
|
|
12223
12825
|
}) {
|
|
12224
|
-
return new
|
|
12826
|
+
return new _DeepagentsSubagent({
|
|
12225
12827
|
baseDir,
|
|
12226
12828
|
relativeDirPath,
|
|
12227
12829
|
relativeFilePath,
|
|
@@ -12234,11 +12836,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12234
12836
|
};
|
|
12235
12837
|
|
|
12236
12838
|
// src/features/subagents/junie-subagent.ts
|
|
12237
|
-
import { join as
|
|
12238
|
-
import { z as
|
|
12239
|
-
var JunieSubagentFrontmatterSchema =
|
|
12240
|
-
name:
|
|
12241
|
-
description:
|
|
12839
|
+
import { join as join93 } from "path";
|
|
12840
|
+
import { z as z49 } from "zod/mini";
|
|
12841
|
+
var JunieSubagentFrontmatterSchema = z49.looseObject({
|
|
12842
|
+
name: z49.optional(z49.string()),
|
|
12843
|
+
description: z49.string()
|
|
12242
12844
|
});
|
|
12243
12845
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
12244
12846
|
frontmatter;
|
|
@@ -12248,7 +12850,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12248
12850
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12249
12851
|
if (!result.success) {
|
|
12250
12852
|
throw new Error(
|
|
12251
|
-
`Invalid frontmatter in ${
|
|
12853
|
+
`Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12252
12854
|
);
|
|
12253
12855
|
}
|
|
12254
12856
|
}
|
|
@@ -12263,7 +12865,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12263
12865
|
throw new Error("JunieSubagent does not support global mode.");
|
|
12264
12866
|
}
|
|
12265
12867
|
return {
|
|
12266
|
-
relativeDirPath:
|
|
12868
|
+
relativeDirPath: join93(".junie", "agents")
|
|
12267
12869
|
};
|
|
12268
12870
|
}
|
|
12269
12871
|
getFrontmatter() {
|
|
@@ -12339,7 +12941,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12339
12941
|
return {
|
|
12340
12942
|
success: false,
|
|
12341
12943
|
error: new Error(
|
|
12342
|
-
`Invalid frontmatter in ${
|
|
12944
|
+
`Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12343
12945
|
)
|
|
12344
12946
|
};
|
|
12345
12947
|
}
|
|
@@ -12357,7 +12959,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12357
12959
|
global = false
|
|
12358
12960
|
}) {
|
|
12359
12961
|
const paths = this.getSettablePaths({ global });
|
|
12360
|
-
const filePath =
|
|
12962
|
+
const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12361
12963
|
const fileContent = await readFileContent(filePath);
|
|
12362
12964
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12363
12965
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12392,23 +12994,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12392
12994
|
};
|
|
12393
12995
|
|
|
12394
12996
|
// src/features/subagents/kiro-subagent.ts
|
|
12395
|
-
import { join as
|
|
12396
|
-
import { z as
|
|
12397
|
-
var KiroCliSubagentJsonSchema =
|
|
12398
|
-
name:
|
|
12399
|
-
description:
|
|
12400
|
-
prompt:
|
|
12401
|
-
tools:
|
|
12402
|
-
toolAliases:
|
|
12403
|
-
toolSettings:
|
|
12404
|
-
toolSchema:
|
|
12405
|
-
hooks:
|
|
12406
|
-
model:
|
|
12407
|
-
mcpServers:
|
|
12408
|
-
useLegacyMcpJson:
|
|
12409
|
-
resources:
|
|
12410
|
-
allowedTools:
|
|
12411
|
-
includeMcpJson:
|
|
12997
|
+
import { join as join94 } from "path";
|
|
12998
|
+
import { z as z50 } from "zod/mini";
|
|
12999
|
+
var KiroCliSubagentJsonSchema = z50.looseObject({
|
|
13000
|
+
name: z50.string(),
|
|
13001
|
+
description: z50.optional(z50.nullable(z50.string())),
|
|
13002
|
+
prompt: z50.optional(z50.nullable(z50.string())),
|
|
13003
|
+
tools: z50.optional(z50.nullable(z50.array(z50.string()))),
|
|
13004
|
+
toolAliases: z50.optional(z50.nullable(z50.record(z50.string(), z50.string()))),
|
|
13005
|
+
toolSettings: z50.optional(z50.nullable(z50.unknown())),
|
|
13006
|
+
toolSchema: z50.optional(z50.nullable(z50.unknown())),
|
|
13007
|
+
hooks: z50.optional(z50.nullable(z50.record(z50.string(), z50.array(z50.unknown())))),
|
|
13008
|
+
model: z50.optional(z50.nullable(z50.string())),
|
|
13009
|
+
mcpServers: z50.optional(z50.nullable(z50.record(z50.string(), z50.unknown()))),
|
|
13010
|
+
useLegacyMcpJson: z50.optional(z50.nullable(z50.boolean())),
|
|
13011
|
+
resources: z50.optional(z50.nullable(z50.array(z50.string()))),
|
|
13012
|
+
allowedTools: z50.optional(z50.nullable(z50.array(z50.string()))),
|
|
13013
|
+
includeMcpJson: z50.optional(z50.nullable(z50.boolean()))
|
|
12412
13014
|
});
|
|
12413
13015
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
12414
13016
|
body;
|
|
@@ -12419,7 +13021,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12419
13021
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
12420
13022
|
} catch (error) {
|
|
12421
13023
|
throw new Error(
|
|
12422
|
-
`Invalid JSON in ${
|
|
13024
|
+
`Invalid JSON in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12423
13025
|
{ cause: error }
|
|
12424
13026
|
);
|
|
12425
13027
|
}
|
|
@@ -12431,7 +13033,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12431
13033
|
}
|
|
12432
13034
|
static getSettablePaths(_options = {}) {
|
|
12433
13035
|
return {
|
|
12434
|
-
relativeDirPath:
|
|
13036
|
+
relativeDirPath: join94(".kiro", "agents")
|
|
12435
13037
|
};
|
|
12436
13038
|
}
|
|
12437
13039
|
getBody() {
|
|
@@ -12443,7 +13045,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12443
13045
|
parsed = JSON.parse(this.body);
|
|
12444
13046
|
} catch (error) {
|
|
12445
13047
|
throw new Error(
|
|
12446
|
-
`Failed to parse JSON in ${
|
|
13048
|
+
`Failed to parse JSON in ${join94(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12447
13049
|
{ cause: error }
|
|
12448
13050
|
);
|
|
12449
13051
|
}
|
|
@@ -12524,7 +13126,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12524
13126
|
global = false
|
|
12525
13127
|
}) {
|
|
12526
13128
|
const paths = this.getSettablePaths({ global });
|
|
12527
|
-
const filePath =
|
|
13129
|
+
const filePath = join94(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12528
13130
|
const fileContent = await readFileContent(filePath);
|
|
12529
13131
|
const subagent = new _KiroSubagent({
|
|
12530
13132
|
baseDir,
|
|
@@ -12562,12 +13164,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12562
13164
|
};
|
|
12563
13165
|
|
|
12564
13166
|
// src/features/subagents/opencode-subagent.ts
|
|
12565
|
-
import { basename as basename8, join as
|
|
12566
|
-
import { z as
|
|
12567
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
12568
|
-
description:
|
|
12569
|
-
mode:
|
|
12570
|
-
name:
|
|
13167
|
+
import { basename as basename8, join as join95 } from "path";
|
|
13168
|
+
import { z as z51 } from "zod/mini";
|
|
13169
|
+
var OpenCodeSubagentFrontmatterSchema = z51.looseObject({
|
|
13170
|
+
description: z51.optional(z51.string()),
|
|
13171
|
+
mode: z51._default(z51.string(), "subagent"),
|
|
13172
|
+
name: z51.optional(z51.string())
|
|
12571
13173
|
});
|
|
12572
13174
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
12573
13175
|
frontmatter;
|
|
@@ -12577,7 +13179,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12577
13179
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12578
13180
|
if (!result.success) {
|
|
12579
13181
|
throw new Error(
|
|
12580
|
-
`Invalid frontmatter in ${
|
|
13182
|
+
`Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12581
13183
|
);
|
|
12582
13184
|
}
|
|
12583
13185
|
}
|
|
@@ -12591,7 +13193,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12591
13193
|
global = false
|
|
12592
13194
|
} = {}) {
|
|
12593
13195
|
return {
|
|
12594
|
-
relativeDirPath: global ?
|
|
13196
|
+
relativeDirPath: global ? join95(".config", "opencode", "agent") : join95(".opencode", "agent")
|
|
12595
13197
|
};
|
|
12596
13198
|
}
|
|
12597
13199
|
getFrontmatter() {
|
|
@@ -12657,7 +13259,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12657
13259
|
return {
|
|
12658
13260
|
success: false,
|
|
12659
13261
|
error: new Error(
|
|
12660
|
-
`Invalid frontmatter in ${
|
|
13262
|
+
`Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12661
13263
|
)
|
|
12662
13264
|
};
|
|
12663
13265
|
}
|
|
@@ -12674,7 +13276,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12674
13276
|
global = false
|
|
12675
13277
|
}) {
|
|
12676
13278
|
const paths = this.getSettablePaths({ global });
|
|
12677
|
-
const filePath =
|
|
13279
|
+
const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12678
13280
|
const fileContent = await readFileContent(filePath);
|
|
12679
13281
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12680
13282
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12717,6 +13319,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12717
13319
|
"codexcli",
|
|
12718
13320
|
"copilot",
|
|
12719
13321
|
"cursor",
|
|
13322
|
+
"deepagents",
|
|
12720
13323
|
"factorydroid",
|
|
12721
13324
|
"geminicli",
|
|
12722
13325
|
"junie",
|
|
@@ -12724,7 +13327,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12724
13327
|
"opencode",
|
|
12725
13328
|
"roo"
|
|
12726
13329
|
];
|
|
12727
|
-
var SubagentsProcessorToolTargetSchema =
|
|
13330
|
+
var SubagentsProcessorToolTargetSchema = z52.enum(subagentsProcessorToolTargetTuple);
|
|
12728
13331
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
12729
13332
|
[
|
|
12730
13333
|
"agentsmd",
|
|
@@ -12751,7 +13354,7 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
12751
13354
|
"codexcli",
|
|
12752
13355
|
{
|
|
12753
13356
|
class: CodexCliSubagent,
|
|
12754
|
-
meta: { supportsSimulated: false, supportsGlobal:
|
|
13357
|
+
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.toml" }
|
|
12755
13358
|
}
|
|
12756
13359
|
],
|
|
12757
13360
|
[
|
|
@@ -12768,11 +13371,18 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
12768
13371
|
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
12769
13372
|
}
|
|
12770
13373
|
],
|
|
13374
|
+
[
|
|
13375
|
+
"deepagents",
|
|
13376
|
+
{
|
|
13377
|
+
class: DeepagentsSubagent,
|
|
13378
|
+
meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
|
|
13379
|
+
}
|
|
13380
|
+
],
|
|
12771
13381
|
[
|
|
12772
13382
|
"factorydroid",
|
|
12773
13383
|
{
|
|
12774
13384
|
class: FactorydroidSubagent,
|
|
12775
|
-
meta: { supportsSimulated: true, supportsGlobal:
|
|
13385
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
12776
13386
|
}
|
|
12777
13387
|
],
|
|
12778
13388
|
[
|
|
@@ -12894,7 +13504,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12894
13504
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
12895
13505
|
*/
|
|
12896
13506
|
async loadRulesyncFiles() {
|
|
12897
|
-
const subagentsDir =
|
|
13507
|
+
const subagentsDir = join96(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
12898
13508
|
const dirExists = await directoryExists(subagentsDir);
|
|
12899
13509
|
if (!dirExists) {
|
|
12900
13510
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -12909,7 +13519,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12909
13519
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
12910
13520
|
const rulesyncSubagents = [];
|
|
12911
13521
|
for (const mdFile of mdFiles) {
|
|
12912
|
-
const filepath =
|
|
13522
|
+
const filepath = join96(subagentsDir, mdFile);
|
|
12913
13523
|
try {
|
|
12914
13524
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
12915
13525
|
relativeFilePath: mdFile,
|
|
@@ -12939,7 +13549,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12939
13549
|
const factory = this.getFactory(this.toolTarget);
|
|
12940
13550
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
12941
13551
|
const subagentFilePaths = await findFilesByGlobs(
|
|
12942
|
-
|
|
13552
|
+
join96(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
12943
13553
|
);
|
|
12944
13554
|
if (forDeletion) {
|
|
12945
13555
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -13006,49 +13616,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
13006
13616
|
};
|
|
13007
13617
|
|
|
13008
13618
|
// src/features/rules/agentsmd-rule.ts
|
|
13009
|
-
import { join as
|
|
13619
|
+
import { join as join99 } from "path";
|
|
13010
13620
|
|
|
13011
13621
|
// src/features/rules/tool-rule.ts
|
|
13012
|
-
import { join as
|
|
13622
|
+
import { join as join98 } from "path";
|
|
13013
13623
|
|
|
13014
13624
|
// src/features/rules/rulesync-rule.ts
|
|
13015
|
-
import { join as
|
|
13016
|
-
import { z as
|
|
13017
|
-
var RulesyncRuleFrontmatterSchema =
|
|
13018
|
-
root:
|
|
13019
|
-
localRoot:
|
|
13020
|
-
targets:
|
|
13021
|
-
description:
|
|
13022
|
-
globs:
|
|
13023
|
-
agentsmd:
|
|
13024
|
-
|
|
13625
|
+
import { join as join97 } from "path";
|
|
13626
|
+
import { z as z53 } from "zod/mini";
|
|
13627
|
+
var RulesyncRuleFrontmatterSchema = z53.object({
|
|
13628
|
+
root: z53.optional(z53.boolean()),
|
|
13629
|
+
localRoot: z53.optional(z53.boolean()),
|
|
13630
|
+
targets: z53._default(RulesyncTargetsSchema, ["*"]),
|
|
13631
|
+
description: z53.optional(z53.string()),
|
|
13632
|
+
globs: z53.optional(z53.array(z53.string())),
|
|
13633
|
+
agentsmd: z53.optional(
|
|
13634
|
+
z53.object({
|
|
13025
13635
|
// @example "path/to/subproject"
|
|
13026
|
-
subprojectPath:
|
|
13636
|
+
subprojectPath: z53.optional(z53.string())
|
|
13027
13637
|
})
|
|
13028
13638
|
),
|
|
13029
|
-
claudecode:
|
|
13030
|
-
|
|
13639
|
+
claudecode: z53.optional(
|
|
13640
|
+
z53.object({
|
|
13031
13641
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
13032
13642
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
13033
|
-
paths:
|
|
13643
|
+
paths: z53.optional(z53.array(z53.string()))
|
|
13034
13644
|
})
|
|
13035
13645
|
),
|
|
13036
|
-
cursor:
|
|
13037
|
-
|
|
13038
|
-
alwaysApply:
|
|
13039
|
-
description:
|
|
13040
|
-
globs:
|
|
13646
|
+
cursor: z53.optional(
|
|
13647
|
+
z53.object({
|
|
13648
|
+
alwaysApply: z53.optional(z53.boolean()),
|
|
13649
|
+
description: z53.optional(z53.string()),
|
|
13650
|
+
globs: z53.optional(z53.array(z53.string()))
|
|
13041
13651
|
})
|
|
13042
13652
|
),
|
|
13043
|
-
copilot:
|
|
13044
|
-
|
|
13045
|
-
excludeAgent:
|
|
13653
|
+
copilot: z53.optional(
|
|
13654
|
+
z53.object({
|
|
13655
|
+
excludeAgent: z53.optional(z53.union([z53.literal("code-review"), z53.literal("coding-agent")]))
|
|
13046
13656
|
})
|
|
13047
13657
|
),
|
|
13048
|
-
antigravity:
|
|
13049
|
-
|
|
13050
|
-
trigger:
|
|
13051
|
-
globs:
|
|
13658
|
+
antigravity: z53.optional(
|
|
13659
|
+
z53.looseObject({
|
|
13660
|
+
trigger: z53.optional(z53.string()),
|
|
13661
|
+
globs: z53.optional(z53.array(z53.string()))
|
|
13052
13662
|
})
|
|
13053
13663
|
)
|
|
13054
13664
|
});
|
|
@@ -13059,7 +13669,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13059
13669
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13060
13670
|
if (!parseResult.success && rest.validate !== false) {
|
|
13061
13671
|
throw new Error(
|
|
13062
|
-
`Invalid frontmatter in ${
|
|
13672
|
+
`Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
13063
13673
|
);
|
|
13064
13674
|
}
|
|
13065
13675
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -13094,7 +13704,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13094
13704
|
return {
|
|
13095
13705
|
success: false,
|
|
13096
13706
|
error: new Error(
|
|
13097
|
-
`Invalid frontmatter in ${
|
|
13707
|
+
`Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13098
13708
|
)
|
|
13099
13709
|
};
|
|
13100
13710
|
}
|
|
@@ -13103,7 +13713,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13103
13713
|
relativeFilePath,
|
|
13104
13714
|
validate = true
|
|
13105
13715
|
}) {
|
|
13106
|
-
const filePath =
|
|
13716
|
+
const filePath = join97(
|
|
13107
13717
|
process.cwd(),
|
|
13108
13718
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
13109
13719
|
relativeFilePath
|
|
@@ -13121,7 +13731,10 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13121
13731
|
description: result.data.description,
|
|
13122
13732
|
globs: result.data.globs ?? [],
|
|
13123
13733
|
agentsmd: result.data.agentsmd,
|
|
13124
|
-
|
|
13734
|
+
claudecode: result.data.claudecode,
|
|
13735
|
+
cursor: result.data.cursor,
|
|
13736
|
+
copilot: result.data.copilot,
|
|
13737
|
+
antigravity: result.data.antigravity
|
|
13125
13738
|
};
|
|
13126
13739
|
return new _RulesyncRule({
|
|
13127
13740
|
baseDir: process.cwd(),
|
|
@@ -13205,7 +13818,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13205
13818
|
rulesyncRule,
|
|
13206
13819
|
validate = true,
|
|
13207
13820
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
13208
|
-
nonRootPath = { relativeDirPath:
|
|
13821
|
+
nonRootPath = { relativeDirPath: join98(".agents", "memories") }
|
|
13209
13822
|
}) {
|
|
13210
13823
|
const params = this.buildToolRuleParamsDefault({
|
|
13211
13824
|
baseDir,
|
|
@@ -13216,7 +13829,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13216
13829
|
});
|
|
13217
13830
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
13218
13831
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
13219
|
-
params.relativeDirPath =
|
|
13832
|
+
params.relativeDirPath = join98(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
13220
13833
|
params.relativeFilePath = "AGENTS.md";
|
|
13221
13834
|
}
|
|
13222
13835
|
return params;
|
|
@@ -13265,7 +13878,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13265
13878
|
}
|
|
13266
13879
|
};
|
|
13267
13880
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
13268
|
-
return excludeToolDir ? subDir :
|
|
13881
|
+
return excludeToolDir ? subDir : join98(toolDir, subDir);
|
|
13269
13882
|
}
|
|
13270
13883
|
|
|
13271
13884
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -13294,8 +13907,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13294
13907
|
validate = true
|
|
13295
13908
|
}) {
|
|
13296
13909
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
13297
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
13298
|
-
const fileContent = await readFileContent(
|
|
13910
|
+
const relativePath = isRoot ? "AGENTS.md" : join99(".agents", "memories", relativeFilePath);
|
|
13911
|
+
const fileContent = await readFileContent(join99(baseDir, relativePath));
|
|
13299
13912
|
return new _AgentsMdRule({
|
|
13300
13913
|
baseDir,
|
|
13301
13914
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13350,21 +13963,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13350
13963
|
};
|
|
13351
13964
|
|
|
13352
13965
|
// src/features/rules/antigravity-rule.ts
|
|
13353
|
-
import { join as
|
|
13354
|
-
import { z as
|
|
13355
|
-
var AntigravityRuleFrontmatterSchema =
|
|
13356
|
-
trigger:
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13966
|
+
import { join as join100 } from "path";
|
|
13967
|
+
import { z as z54 } from "zod/mini";
|
|
13968
|
+
var AntigravityRuleFrontmatterSchema = z54.looseObject({
|
|
13969
|
+
trigger: z54.optional(
|
|
13970
|
+
z54.union([
|
|
13971
|
+
z54.literal("always_on"),
|
|
13972
|
+
z54.literal("glob"),
|
|
13973
|
+
z54.literal("manual"),
|
|
13974
|
+
z54.literal("model_decision"),
|
|
13975
|
+
z54.string()
|
|
13363
13976
|
// accepts any string for forward compatibility
|
|
13364
13977
|
])
|
|
13365
13978
|
),
|
|
13366
|
-
globs:
|
|
13367
|
-
description:
|
|
13979
|
+
globs: z54.optional(z54.string()),
|
|
13980
|
+
description: z54.optional(z54.string())
|
|
13368
13981
|
});
|
|
13369
13982
|
function parseGlobsString(globs) {
|
|
13370
13983
|
if (!globs) {
|
|
@@ -13509,7 +14122,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13509
14122
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13510
14123
|
if (!result.success) {
|
|
13511
14124
|
throw new Error(
|
|
13512
|
-
`Invalid frontmatter in ${
|
|
14125
|
+
`Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13513
14126
|
);
|
|
13514
14127
|
}
|
|
13515
14128
|
}
|
|
@@ -13533,7 +14146,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13533
14146
|
relativeFilePath,
|
|
13534
14147
|
validate = true
|
|
13535
14148
|
}) {
|
|
13536
|
-
const filePath =
|
|
14149
|
+
const filePath = join100(
|
|
13537
14150
|
baseDir,
|
|
13538
14151
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13539
14152
|
relativeFilePath
|
|
@@ -13673,7 +14286,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13673
14286
|
};
|
|
13674
14287
|
|
|
13675
14288
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
13676
|
-
import { join as
|
|
14289
|
+
import { join as join101 } from "path";
|
|
13677
14290
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
13678
14291
|
toRulesyncRule() {
|
|
13679
14292
|
const rulesyncFrontmatter = {
|
|
@@ -13733,8 +14346,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13733
14346
|
}) {
|
|
13734
14347
|
const settablePaths = this.getSettablePaths();
|
|
13735
14348
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
13736
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
13737
|
-
const fileContent = await readFileContent(
|
|
14349
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join101(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14350
|
+
const fileContent = await readFileContent(join101(baseDir, relativePath));
|
|
13738
14351
|
return new _AugmentcodeLegacyRule({
|
|
13739
14352
|
baseDir,
|
|
13740
14353
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -13763,7 +14376,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13763
14376
|
};
|
|
13764
14377
|
|
|
13765
14378
|
// src/features/rules/augmentcode-rule.ts
|
|
13766
|
-
import { join as
|
|
14379
|
+
import { join as join102 } from "path";
|
|
13767
14380
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
13768
14381
|
toRulesyncRule() {
|
|
13769
14382
|
return this.toRulesyncRuleDefault();
|
|
@@ -13794,7 +14407,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13794
14407
|
relativeFilePath,
|
|
13795
14408
|
validate = true
|
|
13796
14409
|
}) {
|
|
13797
|
-
const filePath =
|
|
14410
|
+
const filePath = join102(
|
|
13798
14411
|
baseDir,
|
|
13799
14412
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13800
14413
|
relativeFilePath
|
|
@@ -13834,7 +14447,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13834
14447
|
};
|
|
13835
14448
|
|
|
13836
14449
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
13837
|
-
import { join as
|
|
14450
|
+
import { join as join103 } from "path";
|
|
13838
14451
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
13839
14452
|
static getSettablePaths({
|
|
13840
14453
|
global,
|
|
@@ -13876,7 +14489,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13876
14489
|
if (isRoot) {
|
|
13877
14490
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13878
14491
|
const fileContent2 = await readFileContent(
|
|
13879
|
-
|
|
14492
|
+
join103(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13880
14493
|
);
|
|
13881
14494
|
return new _ClaudecodeLegacyRule({
|
|
13882
14495
|
baseDir,
|
|
@@ -13890,8 +14503,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13890
14503
|
if (!paths.nonRoot) {
|
|
13891
14504
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13892
14505
|
}
|
|
13893
|
-
const relativePath =
|
|
13894
|
-
const fileContent = await readFileContent(
|
|
14506
|
+
const relativePath = join103(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14507
|
+
const fileContent = await readFileContent(join103(baseDir, relativePath));
|
|
13895
14508
|
return new _ClaudecodeLegacyRule({
|
|
13896
14509
|
baseDir,
|
|
13897
14510
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13950,10 +14563,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13950
14563
|
};
|
|
13951
14564
|
|
|
13952
14565
|
// src/features/rules/claudecode-rule.ts
|
|
13953
|
-
import { join as
|
|
13954
|
-
import { z as
|
|
13955
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
13956
|
-
paths:
|
|
14566
|
+
import { join as join104 } from "path";
|
|
14567
|
+
import { z as z55 } from "zod/mini";
|
|
14568
|
+
var ClaudecodeRuleFrontmatterSchema = z55.object({
|
|
14569
|
+
paths: z55.optional(z55.array(z55.string()))
|
|
13957
14570
|
});
|
|
13958
14571
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
13959
14572
|
frontmatter;
|
|
@@ -13991,7 +14604,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13991
14604
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13992
14605
|
if (!result.success) {
|
|
13993
14606
|
throw new Error(
|
|
13994
|
-
`Invalid frontmatter in ${
|
|
14607
|
+
`Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13995
14608
|
);
|
|
13996
14609
|
}
|
|
13997
14610
|
}
|
|
@@ -14021,7 +14634,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14021
14634
|
if (isRoot) {
|
|
14022
14635
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
14023
14636
|
const fileContent2 = await readFileContent(
|
|
14024
|
-
|
|
14637
|
+
join104(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
14025
14638
|
);
|
|
14026
14639
|
return new _ClaudecodeRule({
|
|
14027
14640
|
baseDir,
|
|
@@ -14036,8 +14649,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14036
14649
|
if (!paths.nonRoot) {
|
|
14037
14650
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14038
14651
|
}
|
|
14039
|
-
const relativePath =
|
|
14040
|
-
const filePath =
|
|
14652
|
+
const relativePath = join104(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14653
|
+
const filePath = join104(baseDir, relativePath);
|
|
14041
14654
|
const fileContent = await readFileContent(filePath);
|
|
14042
14655
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14043
14656
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14148,7 +14761,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14148
14761
|
return {
|
|
14149
14762
|
success: false,
|
|
14150
14763
|
error: new Error(
|
|
14151
|
-
`Invalid frontmatter in ${
|
|
14764
|
+
`Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14152
14765
|
)
|
|
14153
14766
|
};
|
|
14154
14767
|
}
|
|
@@ -14168,10 +14781,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14168
14781
|
};
|
|
14169
14782
|
|
|
14170
14783
|
// src/features/rules/cline-rule.ts
|
|
14171
|
-
import { join as
|
|
14172
|
-
import { z as
|
|
14173
|
-
var ClineRuleFrontmatterSchema =
|
|
14174
|
-
description:
|
|
14784
|
+
import { join as join105 } from "path";
|
|
14785
|
+
import { z as z56 } from "zod/mini";
|
|
14786
|
+
var ClineRuleFrontmatterSchema = z56.object({
|
|
14787
|
+
description: z56.string()
|
|
14175
14788
|
});
|
|
14176
14789
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
14177
14790
|
static getSettablePaths(_options = {}) {
|
|
@@ -14214,7 +14827,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
14214
14827
|
validate = true
|
|
14215
14828
|
}) {
|
|
14216
14829
|
const fileContent = await readFileContent(
|
|
14217
|
-
|
|
14830
|
+
join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14218
14831
|
);
|
|
14219
14832
|
return new _ClineRule({
|
|
14220
14833
|
baseDir,
|
|
@@ -14240,7 +14853,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
14240
14853
|
};
|
|
14241
14854
|
|
|
14242
14855
|
// src/features/rules/codexcli-rule.ts
|
|
14243
|
-
import { join as
|
|
14856
|
+
import { join as join106 } from "path";
|
|
14244
14857
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
14245
14858
|
static getSettablePaths({
|
|
14246
14859
|
global,
|
|
@@ -14275,7 +14888,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14275
14888
|
if (isRoot) {
|
|
14276
14889
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14277
14890
|
const fileContent2 = await readFileContent(
|
|
14278
|
-
|
|
14891
|
+
join106(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14279
14892
|
);
|
|
14280
14893
|
return new _CodexcliRule({
|
|
14281
14894
|
baseDir,
|
|
@@ -14289,8 +14902,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14289
14902
|
if (!paths.nonRoot) {
|
|
14290
14903
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14291
14904
|
}
|
|
14292
|
-
const relativePath =
|
|
14293
|
-
const fileContent = await readFileContent(
|
|
14905
|
+
const relativePath = join106(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14906
|
+
const fileContent = await readFileContent(join106(baseDir, relativePath));
|
|
14294
14907
|
return new _CodexcliRule({
|
|
14295
14908
|
baseDir,
|
|
14296
14909
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14349,12 +14962,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14349
14962
|
};
|
|
14350
14963
|
|
|
14351
14964
|
// src/features/rules/copilot-rule.ts
|
|
14352
|
-
import { join as
|
|
14353
|
-
import { z as
|
|
14354
|
-
var CopilotRuleFrontmatterSchema =
|
|
14355
|
-
description:
|
|
14356
|
-
applyTo:
|
|
14357
|
-
excludeAgent:
|
|
14965
|
+
import { join as join107 } from "path";
|
|
14966
|
+
import { z as z57 } from "zod/mini";
|
|
14967
|
+
var CopilotRuleFrontmatterSchema = z57.object({
|
|
14968
|
+
description: z57.optional(z57.string()),
|
|
14969
|
+
applyTo: z57.optional(z57.string()),
|
|
14970
|
+
excludeAgent: z57.optional(z57.union([z57.literal("code-review"), z57.literal("coding-agent")]))
|
|
14358
14971
|
});
|
|
14359
14972
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
14360
14973
|
frontmatter;
|
|
@@ -14386,7 +14999,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14386
14999
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14387
15000
|
if (!result.success) {
|
|
14388
15001
|
throw new Error(
|
|
14389
|
-
`Invalid frontmatter in ${
|
|
15002
|
+
`Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14390
15003
|
);
|
|
14391
15004
|
}
|
|
14392
15005
|
}
|
|
@@ -14476,8 +15089,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14476
15089
|
const paths = this.getSettablePaths({ global });
|
|
14477
15090
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14478
15091
|
if (isRoot) {
|
|
14479
|
-
const relativePath2 =
|
|
14480
|
-
const filePath2 =
|
|
15092
|
+
const relativePath2 = join107(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
15093
|
+
const filePath2 = join107(baseDir, relativePath2);
|
|
14481
15094
|
const fileContent2 = await readFileContent(filePath2);
|
|
14482
15095
|
return new _CopilotRule({
|
|
14483
15096
|
baseDir,
|
|
@@ -14492,8 +15105,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14492
15105
|
if (!paths.nonRoot) {
|
|
14493
15106
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14494
15107
|
}
|
|
14495
|
-
const relativePath =
|
|
14496
|
-
const filePath =
|
|
15108
|
+
const relativePath = join107(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15109
|
+
const filePath = join107(baseDir, relativePath);
|
|
14497
15110
|
const fileContent = await readFileContent(filePath);
|
|
14498
15111
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14499
15112
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14539,7 +15152,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14539
15152
|
return {
|
|
14540
15153
|
success: false,
|
|
14541
15154
|
error: new Error(
|
|
14542
|
-
`Invalid frontmatter in ${
|
|
15155
|
+
`Invalid frontmatter in ${join107(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14543
15156
|
)
|
|
14544
15157
|
};
|
|
14545
15158
|
}
|
|
@@ -14559,12 +15172,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14559
15172
|
};
|
|
14560
15173
|
|
|
14561
15174
|
// src/features/rules/cursor-rule.ts
|
|
14562
|
-
import { join as
|
|
14563
|
-
import { z as
|
|
14564
|
-
var CursorRuleFrontmatterSchema =
|
|
14565
|
-
description:
|
|
14566
|
-
globs:
|
|
14567
|
-
alwaysApply:
|
|
15175
|
+
import { join as join108 } from "path";
|
|
15176
|
+
import { z as z58 } from "zod/mini";
|
|
15177
|
+
var CursorRuleFrontmatterSchema = z58.object({
|
|
15178
|
+
description: z58.optional(z58.string()),
|
|
15179
|
+
globs: z58.optional(z58.string()),
|
|
15180
|
+
alwaysApply: z58.optional(z58.boolean())
|
|
14568
15181
|
});
|
|
14569
15182
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
14570
15183
|
frontmatter;
|
|
@@ -14581,7 +15194,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14581
15194
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14582
15195
|
if (!result.success) {
|
|
14583
15196
|
throw new Error(
|
|
14584
|
-
`Invalid frontmatter in ${
|
|
15197
|
+
`Invalid frontmatter in ${join108(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14585
15198
|
);
|
|
14586
15199
|
}
|
|
14587
15200
|
}
|
|
@@ -14697,7 +15310,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14697
15310
|
relativeFilePath,
|
|
14698
15311
|
validate = true
|
|
14699
15312
|
}) {
|
|
14700
|
-
const filePath =
|
|
15313
|
+
const filePath = join108(
|
|
14701
15314
|
baseDir,
|
|
14702
15315
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
14703
15316
|
relativeFilePath
|
|
@@ -14707,7 +15320,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14707
15320
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14708
15321
|
if (!result.success) {
|
|
14709
15322
|
throw new Error(
|
|
14710
|
-
`Invalid frontmatter in ${
|
|
15323
|
+
`Invalid frontmatter in ${join108(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
14711
15324
|
);
|
|
14712
15325
|
}
|
|
14713
15326
|
return new _CursorRule({
|
|
@@ -14744,7 +15357,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14744
15357
|
return {
|
|
14745
15358
|
success: false,
|
|
14746
15359
|
error: new Error(
|
|
14747
|
-
`Invalid frontmatter in ${
|
|
15360
|
+
`Invalid frontmatter in ${join108(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14748
15361
|
)
|
|
14749
15362
|
};
|
|
14750
15363
|
}
|
|
@@ -14763,8 +15376,90 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14763
15376
|
}
|
|
14764
15377
|
};
|
|
14765
15378
|
|
|
15379
|
+
// src/features/rules/deepagents-rule.ts
|
|
15380
|
+
import { join as join109 } from "path";
|
|
15381
|
+
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
15382
|
+
constructor({ fileContent, root, ...rest }) {
|
|
15383
|
+
super({
|
|
15384
|
+
...rest,
|
|
15385
|
+
fileContent,
|
|
15386
|
+
root: root ?? false
|
|
15387
|
+
});
|
|
15388
|
+
}
|
|
15389
|
+
static getSettablePaths(_options = {}) {
|
|
15390
|
+
return {
|
|
15391
|
+
root: {
|
|
15392
|
+
relativeDirPath: ".deepagents",
|
|
15393
|
+
relativeFilePath: "AGENTS.md"
|
|
15394
|
+
},
|
|
15395
|
+
nonRoot: {
|
|
15396
|
+
relativeDirPath: buildToolPath(".deepagents", "memories", _options.excludeToolDir)
|
|
15397
|
+
}
|
|
15398
|
+
};
|
|
15399
|
+
}
|
|
15400
|
+
static async fromFile({
|
|
15401
|
+
baseDir = process.cwd(),
|
|
15402
|
+
relativeFilePath,
|
|
15403
|
+
validate = true
|
|
15404
|
+
}) {
|
|
15405
|
+
const isRoot = relativeFilePath === "AGENTS.md";
|
|
15406
|
+
const relativePath = isRoot ? join109(".deepagents", "AGENTS.md") : join109(".deepagents", "memories", relativeFilePath);
|
|
15407
|
+
const fileContent = await readFileContent(join109(baseDir, relativePath));
|
|
15408
|
+
return new _DeepagentsRule({
|
|
15409
|
+
baseDir,
|
|
15410
|
+
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
15411
|
+
relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
|
|
15412
|
+
fileContent,
|
|
15413
|
+
validate,
|
|
15414
|
+
root: isRoot
|
|
15415
|
+
});
|
|
15416
|
+
}
|
|
15417
|
+
static forDeletion({
|
|
15418
|
+
baseDir = process.cwd(),
|
|
15419
|
+
relativeDirPath,
|
|
15420
|
+
relativeFilePath
|
|
15421
|
+
}) {
|
|
15422
|
+
const isRoot = relativeFilePath === "AGENTS.md" && relativeDirPath === ".deepagents";
|
|
15423
|
+
return new _DeepagentsRule({
|
|
15424
|
+
baseDir,
|
|
15425
|
+
relativeDirPath,
|
|
15426
|
+
relativeFilePath,
|
|
15427
|
+
fileContent: "",
|
|
15428
|
+
validate: false,
|
|
15429
|
+
root: isRoot
|
|
15430
|
+
});
|
|
15431
|
+
}
|
|
15432
|
+
static fromRulesyncRule({
|
|
15433
|
+
baseDir = process.cwd(),
|
|
15434
|
+
rulesyncRule,
|
|
15435
|
+
validate = true
|
|
15436
|
+
}) {
|
|
15437
|
+
return new _DeepagentsRule(
|
|
15438
|
+
this.buildToolRuleParamsAgentsmd({
|
|
15439
|
+
baseDir,
|
|
15440
|
+
rulesyncRule,
|
|
15441
|
+
validate,
|
|
15442
|
+
rootPath: this.getSettablePaths().root,
|
|
15443
|
+
nonRootPath: this.getSettablePaths().nonRoot
|
|
15444
|
+
})
|
|
15445
|
+
);
|
|
15446
|
+
}
|
|
15447
|
+
toRulesyncRule() {
|
|
15448
|
+
return this.toRulesyncRuleDefault();
|
|
15449
|
+
}
|
|
15450
|
+
validate() {
|
|
15451
|
+
return { success: true, error: null };
|
|
15452
|
+
}
|
|
15453
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
15454
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
15455
|
+
rulesyncRule,
|
|
15456
|
+
toolTarget: "deepagents"
|
|
15457
|
+
});
|
|
15458
|
+
}
|
|
15459
|
+
};
|
|
15460
|
+
|
|
14766
15461
|
// src/features/rules/factorydroid-rule.ts
|
|
14767
|
-
import { join as
|
|
15462
|
+
import { join as join110 } from "path";
|
|
14768
15463
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
14769
15464
|
constructor({ fileContent, root, ...rest }) {
|
|
14770
15465
|
super({
|
|
@@ -14804,8 +15499,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14804
15499
|
const paths = this.getSettablePaths({ global });
|
|
14805
15500
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14806
15501
|
if (isRoot) {
|
|
14807
|
-
const relativePath2 =
|
|
14808
|
-
const fileContent2 = await readFileContent(
|
|
15502
|
+
const relativePath2 = join110(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
15503
|
+
const fileContent2 = await readFileContent(join110(baseDir, relativePath2));
|
|
14809
15504
|
return new _FactorydroidRule({
|
|
14810
15505
|
baseDir,
|
|
14811
15506
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -14818,8 +15513,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14818
15513
|
if (!paths.nonRoot) {
|
|
14819
15514
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14820
15515
|
}
|
|
14821
|
-
const relativePath =
|
|
14822
|
-
const fileContent = await readFileContent(
|
|
15516
|
+
const relativePath = join110(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15517
|
+
const fileContent = await readFileContent(join110(baseDir, relativePath));
|
|
14823
15518
|
return new _FactorydroidRule({
|
|
14824
15519
|
baseDir,
|
|
14825
15520
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14878,7 +15573,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14878
15573
|
};
|
|
14879
15574
|
|
|
14880
15575
|
// src/features/rules/geminicli-rule.ts
|
|
14881
|
-
import { join as
|
|
15576
|
+
import { join as join111 } from "path";
|
|
14882
15577
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
14883
15578
|
static getSettablePaths({
|
|
14884
15579
|
global,
|
|
@@ -14913,7 +15608,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14913
15608
|
if (isRoot) {
|
|
14914
15609
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14915
15610
|
const fileContent2 = await readFileContent(
|
|
14916
|
-
|
|
15611
|
+
join111(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14917
15612
|
);
|
|
14918
15613
|
return new _GeminiCliRule({
|
|
14919
15614
|
baseDir,
|
|
@@ -14927,8 +15622,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14927
15622
|
if (!paths.nonRoot) {
|
|
14928
15623
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14929
15624
|
}
|
|
14930
|
-
const relativePath =
|
|
14931
|
-
const fileContent = await readFileContent(
|
|
15625
|
+
const relativePath = join111(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15626
|
+
const fileContent = await readFileContent(join111(baseDir, relativePath));
|
|
14932
15627
|
return new _GeminiCliRule({
|
|
14933
15628
|
baseDir,
|
|
14934
15629
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14987,7 +15682,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14987
15682
|
};
|
|
14988
15683
|
|
|
14989
15684
|
// src/features/rules/goose-rule.ts
|
|
14990
|
-
import { join as
|
|
15685
|
+
import { join as join112 } from "path";
|
|
14991
15686
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
14992
15687
|
static getSettablePaths({
|
|
14993
15688
|
global,
|
|
@@ -15022,7 +15717,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15022
15717
|
if (isRoot) {
|
|
15023
15718
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15024
15719
|
const fileContent2 = await readFileContent(
|
|
15025
|
-
|
|
15720
|
+
join112(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15026
15721
|
);
|
|
15027
15722
|
return new _GooseRule({
|
|
15028
15723
|
baseDir,
|
|
@@ -15036,8 +15731,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15036
15731
|
if (!paths.nonRoot) {
|
|
15037
15732
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15038
15733
|
}
|
|
15039
|
-
const relativePath =
|
|
15040
|
-
const fileContent = await readFileContent(
|
|
15734
|
+
const relativePath = join112(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15735
|
+
const fileContent = await readFileContent(join112(baseDir, relativePath));
|
|
15041
15736
|
return new _GooseRule({
|
|
15042
15737
|
baseDir,
|
|
15043
15738
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15096,7 +15791,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15096
15791
|
};
|
|
15097
15792
|
|
|
15098
15793
|
// src/features/rules/junie-rule.ts
|
|
15099
|
-
import { join as
|
|
15794
|
+
import { join as join113 } from "path";
|
|
15100
15795
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
15101
15796
|
static getSettablePaths(_options = {}) {
|
|
15102
15797
|
return {
|
|
@@ -15115,8 +15810,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
15115
15810
|
validate = true
|
|
15116
15811
|
}) {
|
|
15117
15812
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
15118
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
15119
|
-
const fileContent = await readFileContent(
|
|
15813
|
+
const relativePath = isRoot ? "guidelines.md" : join113(".junie", "memories", relativeFilePath);
|
|
15814
|
+
const fileContent = await readFileContent(join113(baseDir, relativePath));
|
|
15120
15815
|
return new _JunieRule({
|
|
15121
15816
|
baseDir,
|
|
15122
15817
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15171,7 +15866,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
15171
15866
|
};
|
|
15172
15867
|
|
|
15173
15868
|
// src/features/rules/kilo-rule.ts
|
|
15174
|
-
import { join as
|
|
15869
|
+
import { join as join114 } from "path";
|
|
15175
15870
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
15176
15871
|
static getSettablePaths(_options = {}) {
|
|
15177
15872
|
return {
|
|
@@ -15186,7 +15881,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
15186
15881
|
validate = true
|
|
15187
15882
|
}) {
|
|
15188
15883
|
const fileContent = await readFileContent(
|
|
15189
|
-
|
|
15884
|
+
join114(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15190
15885
|
);
|
|
15191
15886
|
return new _KiloRule({
|
|
15192
15887
|
baseDir,
|
|
@@ -15238,7 +15933,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
15238
15933
|
};
|
|
15239
15934
|
|
|
15240
15935
|
// src/features/rules/kiro-rule.ts
|
|
15241
|
-
import { join as
|
|
15936
|
+
import { join as join115 } from "path";
|
|
15242
15937
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
15243
15938
|
static getSettablePaths(_options = {}) {
|
|
15244
15939
|
return {
|
|
@@ -15253,7 +15948,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15253
15948
|
validate = true
|
|
15254
15949
|
}) {
|
|
15255
15950
|
const fileContent = await readFileContent(
|
|
15256
|
-
|
|
15951
|
+
join115(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15257
15952
|
);
|
|
15258
15953
|
return new _KiroRule({
|
|
15259
15954
|
baseDir,
|
|
@@ -15307,7 +16002,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15307
16002
|
};
|
|
15308
16003
|
|
|
15309
16004
|
// src/features/rules/opencode-rule.ts
|
|
15310
|
-
import { join as
|
|
16005
|
+
import { join as join116 } from "path";
|
|
15311
16006
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
15312
16007
|
static getSettablePaths({
|
|
15313
16008
|
global,
|
|
@@ -15342,7 +16037,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15342
16037
|
if (isRoot) {
|
|
15343
16038
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15344
16039
|
const fileContent2 = await readFileContent(
|
|
15345
|
-
|
|
16040
|
+
join116(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15346
16041
|
);
|
|
15347
16042
|
return new _OpenCodeRule({
|
|
15348
16043
|
baseDir,
|
|
@@ -15356,8 +16051,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15356
16051
|
if (!paths.nonRoot) {
|
|
15357
16052
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15358
16053
|
}
|
|
15359
|
-
const relativePath =
|
|
15360
|
-
const fileContent = await readFileContent(
|
|
16054
|
+
const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16055
|
+
const fileContent = await readFileContent(join116(baseDir, relativePath));
|
|
15361
16056
|
return new _OpenCodeRule({
|
|
15362
16057
|
baseDir,
|
|
15363
16058
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15416,7 +16111,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15416
16111
|
};
|
|
15417
16112
|
|
|
15418
16113
|
// src/features/rules/qwencode-rule.ts
|
|
15419
|
-
import { join as
|
|
16114
|
+
import { join as join117 } from "path";
|
|
15420
16115
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
15421
16116
|
static getSettablePaths(_options = {}) {
|
|
15422
16117
|
return {
|
|
@@ -15435,8 +16130,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15435
16130
|
validate = true
|
|
15436
16131
|
}) {
|
|
15437
16132
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
15438
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
15439
|
-
const fileContent = await readFileContent(
|
|
16133
|
+
const relativePath = isRoot ? "QWEN.md" : join117(".qwen", "memories", relativeFilePath);
|
|
16134
|
+
const fileContent = await readFileContent(join117(baseDir, relativePath));
|
|
15440
16135
|
return new _QwencodeRule({
|
|
15441
16136
|
baseDir,
|
|
15442
16137
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15488,7 +16183,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15488
16183
|
};
|
|
15489
16184
|
|
|
15490
16185
|
// src/features/rules/replit-rule.ts
|
|
15491
|
-
import { join as
|
|
16186
|
+
import { join as join118 } from "path";
|
|
15492
16187
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
15493
16188
|
static getSettablePaths(_options = {}) {
|
|
15494
16189
|
return {
|
|
@@ -15510,7 +16205,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15510
16205
|
}
|
|
15511
16206
|
const relativePath = paths.root.relativeFilePath;
|
|
15512
16207
|
const fileContent = await readFileContent(
|
|
15513
|
-
|
|
16208
|
+
join118(baseDir, paths.root.relativeDirPath, relativePath)
|
|
15514
16209
|
);
|
|
15515
16210
|
return new _ReplitRule({
|
|
15516
16211
|
baseDir,
|
|
@@ -15576,7 +16271,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15576
16271
|
};
|
|
15577
16272
|
|
|
15578
16273
|
// src/features/rules/roo-rule.ts
|
|
15579
|
-
import { join as
|
|
16274
|
+
import { join as join119 } from "path";
|
|
15580
16275
|
var RooRule = class _RooRule extends ToolRule {
|
|
15581
16276
|
static getSettablePaths(_options = {}) {
|
|
15582
16277
|
return {
|
|
@@ -15591,7 +16286,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15591
16286
|
validate = true
|
|
15592
16287
|
}) {
|
|
15593
16288
|
const fileContent = await readFileContent(
|
|
15594
|
-
|
|
16289
|
+
join119(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15595
16290
|
);
|
|
15596
16291
|
return new _RooRule({
|
|
15597
16292
|
baseDir,
|
|
@@ -15660,7 +16355,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15660
16355
|
};
|
|
15661
16356
|
|
|
15662
16357
|
// src/features/rules/warp-rule.ts
|
|
15663
|
-
import { join as
|
|
16358
|
+
import { join as join120 } from "path";
|
|
15664
16359
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
15665
16360
|
constructor({ fileContent, root, ...rest }) {
|
|
15666
16361
|
super({
|
|
@@ -15686,8 +16381,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15686
16381
|
validate = true
|
|
15687
16382
|
}) {
|
|
15688
16383
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
15689
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
15690
|
-
const fileContent = await readFileContent(
|
|
16384
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join120(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
16385
|
+
const fileContent = await readFileContent(join120(baseDir, relativePath));
|
|
15691
16386
|
return new _WarpRule({
|
|
15692
16387
|
baseDir,
|
|
15693
16388
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -15742,7 +16437,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15742
16437
|
};
|
|
15743
16438
|
|
|
15744
16439
|
// src/features/rules/windsurf-rule.ts
|
|
15745
|
-
import { join as
|
|
16440
|
+
import { join as join121 } from "path";
|
|
15746
16441
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
15747
16442
|
static getSettablePaths(_options = {}) {
|
|
15748
16443
|
return {
|
|
@@ -15757,7 +16452,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
15757
16452
|
validate = true
|
|
15758
16453
|
}) {
|
|
15759
16454
|
const fileContent = await readFileContent(
|
|
15760
|
-
|
|
16455
|
+
join121(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15761
16456
|
);
|
|
15762
16457
|
return new _WindsurfRule({
|
|
15763
16458
|
baseDir,
|
|
@@ -15820,6 +16515,7 @@ var rulesProcessorToolTargets = [
|
|
|
15820
16515
|
"codexcli",
|
|
15821
16516
|
"copilot",
|
|
15822
16517
|
"cursor",
|
|
16518
|
+
"deepagents",
|
|
15823
16519
|
"factorydroid",
|
|
15824
16520
|
"geminicli",
|
|
15825
16521
|
"goose",
|
|
@@ -15833,8 +16529,8 @@ var rulesProcessorToolTargets = [
|
|
|
15833
16529
|
"warp",
|
|
15834
16530
|
"windsurf"
|
|
15835
16531
|
];
|
|
15836
|
-
var RulesProcessorToolTargetSchema =
|
|
15837
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
16532
|
+
var RulesProcessorToolTargetSchema = z59.enum(rulesProcessorToolTargets);
|
|
16533
|
+
var formatRulePaths = (rules) => rules.map((r) => join122(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
15838
16534
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
15839
16535
|
[
|
|
15840
16536
|
"agentsmd",
|
|
@@ -15951,6 +16647,17 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
15951
16647
|
}
|
|
15952
16648
|
}
|
|
15953
16649
|
],
|
|
16650
|
+
[
|
|
16651
|
+
"deepagents",
|
|
16652
|
+
{
|
|
16653
|
+
class: DeepagentsRule,
|
|
16654
|
+
meta: {
|
|
16655
|
+
extension: "md",
|
|
16656
|
+
supportsGlobal: false,
|
|
16657
|
+
ruleDiscoveryMode: "auto"
|
|
16658
|
+
}
|
|
16659
|
+
}
|
|
16660
|
+
],
|
|
15954
16661
|
[
|
|
15955
16662
|
"factorydroid",
|
|
15956
16663
|
{
|
|
@@ -16210,7 +16917,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16210
16917
|
}).relativeDirPath;
|
|
16211
16918
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
16212
16919
|
const frontmatter = skill.getFrontmatter();
|
|
16213
|
-
const relativePath =
|
|
16920
|
+
const relativePath = join122(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
16214
16921
|
return {
|
|
16215
16922
|
name: frontmatter.name,
|
|
16216
16923
|
description: frontmatter.description,
|
|
@@ -16323,8 +17030,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16323
17030
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
16324
17031
|
*/
|
|
16325
17032
|
async loadRulesyncFiles() {
|
|
16326
|
-
const rulesyncBaseDir =
|
|
16327
|
-
const files = await findFilesByGlobs(
|
|
17033
|
+
const rulesyncBaseDir = join122(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
17034
|
+
const files = await findFilesByGlobs(join122(rulesyncBaseDir, "**", "*.md"));
|
|
16328
17035
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
16329
17036
|
const rulesyncRules = await Promise.all(
|
|
16330
17037
|
files.map((file) => {
|
|
@@ -16421,13 +17128,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16421
17128
|
return [];
|
|
16422
17129
|
}
|
|
16423
17130
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
16424
|
-
|
|
17131
|
+
join122(
|
|
16425
17132
|
this.baseDir,
|
|
16426
17133
|
settablePaths.root.relativeDirPath ?? ".",
|
|
16427
17134
|
settablePaths.root.relativeFilePath
|
|
16428
17135
|
),
|
|
16429
17136
|
settablePaths.alternativeRoots,
|
|
16430
|
-
(alt) =>
|
|
17137
|
+
(alt) => join122(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
16431
17138
|
);
|
|
16432
17139
|
if (forDeletion) {
|
|
16433
17140
|
return uniqueRootFilePaths.map((filePath) => {
|
|
@@ -16472,9 +17179,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16472
17179
|
return [];
|
|
16473
17180
|
}
|
|
16474
17181
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
16475
|
-
|
|
17182
|
+
join122(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
16476
17183
|
settablePaths.alternativeRoots,
|
|
16477
|
-
(alt) =>
|
|
17184
|
+
(alt) => join122(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
16478
17185
|
);
|
|
16479
17186
|
return uniqueLocalRootFilePaths.map((filePath) => {
|
|
16480
17187
|
const relativeDirPath = resolveRelativeDirPath(filePath);
|
|
@@ -16497,9 +17204,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16497
17204
|
if (!settablePaths.nonRoot) {
|
|
16498
17205
|
return [];
|
|
16499
17206
|
}
|
|
16500
|
-
const nonRootBaseDir =
|
|
17207
|
+
const nonRootBaseDir = join122(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
16501
17208
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
16502
|
-
|
|
17209
|
+
join122(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
16503
17210
|
);
|
|
16504
17211
|
if (forDeletion) {
|
|
16505
17212
|
return nonRootFilePaths.map((filePath) => {
|
|
@@ -16631,14 +17338,14 @@ s/<command> [arguments]
|
|
|
16631
17338
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
16632
17339
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
16633
17340
|
|
|
16634
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
17341
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join122(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
16635
17342
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
16636
17343
|
|
|
16637
17344
|
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.
|
|
16638
17345
|
|
|
16639
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
17346
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join122(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
16640
17347
|
|
|
16641
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
17348
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join122(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
16642
17349
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
16643
17350
|
const result = [
|
|
16644
17351
|
overview,
|
|
@@ -16709,16 +17416,28 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
16709
17416
|
}
|
|
16710
17417
|
return { count: totalCount, paths: [], hasDiff };
|
|
16711
17418
|
}
|
|
17419
|
+
var SIMULATE_OPTION_MAP = {
|
|
17420
|
+
commands: "--simulate-commands",
|
|
17421
|
+
subagents: "--simulate-subagents",
|
|
17422
|
+
skills: "--simulate-skills"
|
|
17423
|
+
};
|
|
16712
17424
|
function warnUnsupportedTargets(params) {
|
|
16713
|
-
const { config, supportedTargets, featureName, logger } = params;
|
|
17425
|
+
const { config, supportedTargets, simulatedTargets = [], featureName, logger } = params;
|
|
16714
17426
|
for (const target of config.getTargets()) {
|
|
16715
17427
|
if (!supportedTargets.includes(target) && config.getFeatures(target).includes(featureName)) {
|
|
16716
|
-
|
|
17428
|
+
const simulateOption = SIMULATE_OPTION_MAP[featureName];
|
|
17429
|
+
if (simulateOption && simulatedTargets.includes(target)) {
|
|
17430
|
+
logger.warn(
|
|
17431
|
+
`Target '${target}' only supports simulated '${featureName}'. Use '${simulateOption}' to enable it. Skipping.`
|
|
17432
|
+
);
|
|
17433
|
+
} else {
|
|
17434
|
+
logger.warn(`Target '${target}' does not support the feature '${featureName}'. Skipping.`);
|
|
17435
|
+
}
|
|
16717
17436
|
}
|
|
16718
17437
|
}
|
|
16719
17438
|
}
|
|
16720
17439
|
async function checkRulesyncDirExists(params) {
|
|
16721
|
-
return fileExists(
|
|
17440
|
+
return fileExists(join123(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
16722
17441
|
}
|
|
16723
17442
|
async function generate(params) {
|
|
16724
17443
|
const { config, logger } = params;
|
|
@@ -16894,6 +17613,7 @@ async function generateCommandsCore(params) {
|
|
|
16894
17613
|
warnUnsupportedTargets({
|
|
16895
17614
|
config,
|
|
16896
17615
|
supportedTargets: supportedCommandsTargets,
|
|
17616
|
+
simulatedTargets: CommandsProcessor.getToolTargetsSimulated(),
|
|
16897
17617
|
featureName: "commands",
|
|
16898
17618
|
logger
|
|
16899
17619
|
});
|
|
@@ -16936,6 +17656,7 @@ async function generateSubagentsCore(params) {
|
|
|
16936
17656
|
warnUnsupportedTargets({
|
|
16937
17657
|
config,
|
|
16938
17658
|
supportedTargets: supportedSubagentsTargets,
|
|
17659
|
+
simulatedTargets: SubagentsProcessor.getToolTargetsSimulated(),
|
|
16939
17660
|
featureName: "subagents",
|
|
16940
17661
|
logger
|
|
16941
17662
|
});
|
|
@@ -16979,6 +17700,7 @@ async function generateSkillsCore(params) {
|
|
|
16979
17700
|
warnUnsupportedTargets({
|
|
16980
17701
|
config,
|
|
16981
17702
|
supportedTargets: supportedSkillsTargets,
|
|
17703
|
+
simulatedTargets: SkillsProcessor.getToolTargetsSimulated(),
|
|
16982
17704
|
featureName: "skills",
|
|
16983
17705
|
logger
|
|
16984
17706
|
});
|
|
@@ -17474,6 +18196,7 @@ export {
|
|
|
17474
18196
|
RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH,
|
|
17475
18197
|
RULESYNC_MCP_FILE_NAME,
|
|
17476
18198
|
RULESYNC_HOOKS_FILE_NAME,
|
|
18199
|
+
RULESYNC_PERMISSIONS_FILE_NAME,
|
|
17477
18200
|
RULESYNC_CONFIG_SCHEMA_URL,
|
|
17478
18201
|
RULESYNC_MCP_SCHEMA_URL,
|
|
17479
18202
|
MAX_FILE_SIZE,
|