rulesync 7.22.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 +1 -0
- package/dist/{chunk-4WYBBN4I.js → chunk-GAWAOFCL.js} +1328 -627
- package/dist/cli/index.cjs +1595 -887
- package/dist/cli/index.js +9 -2
- package/dist/index.cjs +1351 -650
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -50,6 +50,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
50
50
|
"copilot",
|
|
51
51
|
"copilotcli",
|
|
52
52
|
"cursor",
|
|
53
|
+
"deepagents",
|
|
53
54
|
"factorydroid",
|
|
54
55
|
"geminicli",
|
|
55
56
|
"goose",
|
|
@@ -601,7 +602,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
601
602
|
}
|
|
602
603
|
|
|
603
604
|
// src/lib/generate.ts
|
|
604
|
-
import { join as
|
|
605
|
+
import { join as join123 } from "path";
|
|
605
606
|
import { intersection } from "es-toolkit";
|
|
606
607
|
|
|
607
608
|
// src/features/commands/commands-processor.ts
|
|
@@ -3285,6 +3286,15 @@ var FACTORYDROID_HOOK_EVENTS = [
|
|
|
3285
3286
|
"notification",
|
|
3286
3287
|
"setup"
|
|
3287
3288
|
];
|
|
3289
|
+
var DEEPAGENTS_HOOK_EVENTS = [
|
|
3290
|
+
"sessionStart",
|
|
3291
|
+
"sessionEnd",
|
|
3292
|
+
"beforeSubmitPrompt",
|
|
3293
|
+
"permissionRequest",
|
|
3294
|
+
"postToolUseFailure",
|
|
3295
|
+
"stop",
|
|
3296
|
+
"preCompact"
|
|
3297
|
+
];
|
|
3288
3298
|
var GEMINICLI_HOOK_EVENTS = [
|
|
3289
3299
|
"sessionStart",
|
|
3290
3300
|
"sessionEnd",
|
|
@@ -3307,7 +3317,8 @@ var HooksConfigSchema = z15.looseObject({
|
|
|
3307
3317
|
copilot: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3308
3318
|
opencode: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3309
3319
|
factorydroid: z15.optional(z15.looseObject({ hooks: z15.optional(hooksRecordSchema) })),
|
|
3310
|
-
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) }))
|
|
3311
3322
|
});
|
|
3312
3323
|
var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
|
|
3313
3324
|
sessionStart: "SessionStart",
|
|
@@ -3404,6 +3415,18 @@ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
|
|
|
3404
3415
|
var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3405
3416
|
Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3406
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
|
+
);
|
|
3407
3430
|
|
|
3408
3431
|
// src/features/hooks/claudecode-hooks.ts
|
|
3409
3432
|
import { join as join22 } from "path";
|
|
@@ -4006,8 +4029,145 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4006
4029
|
}
|
|
4007
4030
|
};
|
|
4008
4031
|
|
|
4009
|
-
// src/features/hooks/
|
|
4032
|
+
// src/features/hooks/deepagents-hooks.ts
|
|
4010
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";
|
|
4011
4171
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
4012
4172
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
4013
4173
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -4033,7 +4193,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4033
4193
|
global = false
|
|
4034
4194
|
}) {
|
|
4035
4195
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4036
|
-
const filePath =
|
|
4196
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4037
4197
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4038
4198
|
return new _FactorydroidHooks({
|
|
4039
4199
|
baseDir,
|
|
@@ -4051,7 +4211,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4051
4211
|
logger
|
|
4052
4212
|
}) {
|
|
4053
4213
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4054
|
-
const filePath =
|
|
4214
|
+
const filePath = join26(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4055
4215
|
const existingContent = await readOrInitializeFileContent(
|
|
4056
4216
|
filePath,
|
|
4057
4217
|
JSON.stringify({}, null, 2)
|
|
@@ -4088,7 +4248,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4088
4248
|
settings = JSON.parse(this.getFileContent());
|
|
4089
4249
|
} catch (error) {
|
|
4090
4250
|
throw new Error(
|
|
4091
|
-
`Failed to parse Factory Droid hooks content in ${
|
|
4251
|
+
`Failed to parse Factory Droid hooks content in ${join26(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4092
4252
|
{
|
|
4093
4253
|
cause: error
|
|
4094
4254
|
}
|
|
@@ -4121,7 +4281,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4121
4281
|
};
|
|
4122
4282
|
|
|
4123
4283
|
// src/features/hooks/geminicli-hooks.ts
|
|
4124
|
-
import { join as
|
|
4284
|
+
import { join as join27 } from "path";
|
|
4125
4285
|
import { z as z17 } from "zod/mini";
|
|
4126
4286
|
function canonicalToGeminicliHooks(config) {
|
|
4127
4287
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
@@ -4230,7 +4390,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4230
4390
|
global = false
|
|
4231
4391
|
}) {
|
|
4232
4392
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4233
|
-
const filePath =
|
|
4393
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4234
4394
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4235
4395
|
return new _GeminicliHooks({
|
|
4236
4396
|
baseDir,
|
|
@@ -4247,7 +4407,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4247
4407
|
global = false
|
|
4248
4408
|
}) {
|
|
4249
4409
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
4250
|
-
const filePath =
|
|
4410
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4251
4411
|
const existingContent = await readOrInitializeFileContent(
|
|
4252
4412
|
filePath,
|
|
4253
4413
|
JSON.stringify({}, null, 2)
|
|
@@ -4279,7 +4439,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4279
4439
|
settings = JSON.parse(this.getFileContent());
|
|
4280
4440
|
} catch (error) {
|
|
4281
4441
|
throw new Error(
|
|
4282
|
-
`Failed to parse Gemini CLI hooks content in ${
|
|
4442
|
+
`Failed to parse Gemini CLI hooks content in ${join27(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4283
4443
|
{
|
|
4284
4444
|
cause: error
|
|
4285
4445
|
}
|
|
@@ -4309,7 +4469,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
4309
4469
|
};
|
|
4310
4470
|
|
|
4311
4471
|
// src/features/hooks/opencode-hooks.ts
|
|
4312
|
-
import { join as
|
|
4472
|
+
import { join as join28 } from "path";
|
|
4313
4473
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
4314
4474
|
function escapeForTemplateLiteral(command) {
|
|
4315
4475
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -4407,7 +4567,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4407
4567
|
}
|
|
4408
4568
|
static getSettablePaths(options) {
|
|
4409
4569
|
return {
|
|
4410
|
-
relativeDirPath: options?.global ?
|
|
4570
|
+
relativeDirPath: options?.global ? join28(".config", "opencode", "plugins") : join28(".opencode", "plugins"),
|
|
4411
4571
|
relativeFilePath: "rulesync-hooks.js"
|
|
4412
4572
|
};
|
|
4413
4573
|
}
|
|
@@ -4418,7 +4578,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
4418
4578
|
}) {
|
|
4419
4579
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
4420
4580
|
const fileContent = await readFileContent(
|
|
4421
|
-
|
|
4581
|
+
join28(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4422
4582
|
);
|
|
4423
4583
|
return new _OpencodeHooks({
|
|
4424
4584
|
baseDir,
|
|
@@ -4473,7 +4633,8 @@ var hooksProcessorToolTargetTuple = [
|
|
|
4473
4633
|
"copilot",
|
|
4474
4634
|
"opencode",
|
|
4475
4635
|
"factorydroid",
|
|
4476
|
-
"geminicli"
|
|
4636
|
+
"geminicli",
|
|
4637
|
+
"deepagents"
|
|
4477
4638
|
];
|
|
4478
4639
|
var HooksProcessorToolTargetSchema = z18.enum(hooksProcessorToolTargetTuple);
|
|
4479
4640
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
@@ -4556,11 +4717,21 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
|
4556
4717
|
supportedHookTypes: ["command"],
|
|
4557
4718
|
supportsMatcher: true
|
|
4558
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
|
+
}
|
|
4559
4730
|
]
|
|
4560
4731
|
]);
|
|
4561
|
-
var hooksProcessorToolTargets = [...toolHooksFactories.
|
|
4732
|
+
var hooksProcessorToolTargets = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsProject).map(([t]) => t);
|
|
4562
4733
|
var hooksProcessorToolTargetsGlobal = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal).map(([t]) => t);
|
|
4563
|
-
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);
|
|
4564
4735
|
var hooksProcessorToolTargetsGlobalImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal && f.meta.supportsImport).map(([t]) => t);
|
|
4565
4736
|
var HooksProcessor = class extends FeatureProcessor {
|
|
4566
4737
|
toolTarget;
|
|
@@ -4714,10 +4885,10 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4714
4885
|
import { z as z19 } from "zod/mini";
|
|
4715
4886
|
|
|
4716
4887
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4717
|
-
import { join as
|
|
4888
|
+
import { join as join30 } from "path";
|
|
4718
4889
|
|
|
4719
4890
|
// src/features/ignore/rulesync-ignore.ts
|
|
4720
|
-
import { join as
|
|
4891
|
+
import { join as join29 } from "path";
|
|
4721
4892
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4722
4893
|
validate() {
|
|
4723
4894
|
return { success: true, error: null };
|
|
@@ -4737,12 +4908,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4737
4908
|
static async fromFile() {
|
|
4738
4909
|
const baseDir = process.cwd();
|
|
4739
4910
|
const paths = this.getSettablePaths();
|
|
4740
|
-
const recommendedPath =
|
|
4911
|
+
const recommendedPath = join29(
|
|
4741
4912
|
baseDir,
|
|
4742
4913
|
paths.recommended.relativeDirPath,
|
|
4743
4914
|
paths.recommended.relativeFilePath
|
|
4744
4915
|
);
|
|
4745
|
-
const legacyPath =
|
|
4916
|
+
const legacyPath = join29(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4746
4917
|
if (await fileExists(recommendedPath)) {
|
|
4747
4918
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4748
4919
|
return new _RulesyncIgnore({
|
|
@@ -4858,7 +5029,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4858
5029
|
validate = true
|
|
4859
5030
|
}) {
|
|
4860
5031
|
const fileContent = await readFileContent(
|
|
4861
|
-
|
|
5032
|
+
join30(
|
|
4862
5033
|
baseDir,
|
|
4863
5034
|
this.getSettablePaths().relativeDirPath,
|
|
4864
5035
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4888,7 +5059,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4888
5059
|
};
|
|
4889
5060
|
|
|
4890
5061
|
// src/features/ignore/claudecode-ignore.ts
|
|
4891
|
-
import { join as
|
|
5062
|
+
import { join as join31 } from "path";
|
|
4892
5063
|
import { uniq } from "es-toolkit";
|
|
4893
5064
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4894
5065
|
constructor(params) {
|
|
@@ -4931,7 +5102,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4931
5102
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4932
5103
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4933
5104
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4934
|
-
const filePath =
|
|
5105
|
+
const filePath = join31(
|
|
4935
5106
|
baseDir,
|
|
4936
5107
|
this.getSettablePaths().relativeDirPath,
|
|
4937
5108
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4967,7 +5138,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4967
5138
|
validate = true
|
|
4968
5139
|
}) {
|
|
4969
5140
|
const fileContent = await readFileContent(
|
|
4970
|
-
|
|
5141
|
+
join31(
|
|
4971
5142
|
baseDir,
|
|
4972
5143
|
this.getSettablePaths().relativeDirPath,
|
|
4973
5144
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4997,7 +5168,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4997
5168
|
};
|
|
4998
5169
|
|
|
4999
5170
|
// src/features/ignore/cline-ignore.ts
|
|
5000
|
-
import { join as
|
|
5171
|
+
import { join as join32 } from "path";
|
|
5001
5172
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
5002
5173
|
static getSettablePaths() {
|
|
5003
5174
|
return {
|
|
@@ -5034,7 +5205,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5034
5205
|
validate = true
|
|
5035
5206
|
}) {
|
|
5036
5207
|
const fileContent = await readFileContent(
|
|
5037
|
-
|
|
5208
|
+
join32(
|
|
5038
5209
|
baseDir,
|
|
5039
5210
|
this.getSettablePaths().relativeDirPath,
|
|
5040
5211
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5064,7 +5235,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
5064
5235
|
};
|
|
5065
5236
|
|
|
5066
5237
|
// src/features/ignore/cursor-ignore.ts
|
|
5067
|
-
import { join as
|
|
5238
|
+
import { join as join33 } from "path";
|
|
5068
5239
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
5069
5240
|
static getSettablePaths() {
|
|
5070
5241
|
return {
|
|
@@ -5097,7 +5268,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5097
5268
|
validate = true
|
|
5098
5269
|
}) {
|
|
5099
5270
|
const fileContent = await readFileContent(
|
|
5100
|
-
|
|
5271
|
+
join33(
|
|
5101
5272
|
baseDir,
|
|
5102
5273
|
this.getSettablePaths().relativeDirPath,
|
|
5103
5274
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5127,7 +5298,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
5127
5298
|
};
|
|
5128
5299
|
|
|
5129
5300
|
// src/features/ignore/geminicli-ignore.ts
|
|
5130
|
-
import { join as
|
|
5301
|
+
import { join as join34 } from "path";
|
|
5131
5302
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
5132
5303
|
static getSettablePaths() {
|
|
5133
5304
|
return {
|
|
@@ -5154,7 +5325,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5154
5325
|
validate = true
|
|
5155
5326
|
}) {
|
|
5156
5327
|
const fileContent = await readFileContent(
|
|
5157
|
-
|
|
5328
|
+
join34(
|
|
5158
5329
|
baseDir,
|
|
5159
5330
|
this.getSettablePaths().relativeDirPath,
|
|
5160
5331
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5184,7 +5355,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
5184
5355
|
};
|
|
5185
5356
|
|
|
5186
5357
|
// src/features/ignore/goose-ignore.ts
|
|
5187
|
-
import { join as
|
|
5358
|
+
import { join as join35 } from "path";
|
|
5188
5359
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
5189
5360
|
static getSettablePaths() {
|
|
5190
5361
|
return {
|
|
@@ -5221,7 +5392,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5221
5392
|
validate = true
|
|
5222
5393
|
}) {
|
|
5223
5394
|
const fileContent = await readFileContent(
|
|
5224
|
-
|
|
5395
|
+
join35(
|
|
5225
5396
|
baseDir,
|
|
5226
5397
|
this.getSettablePaths().relativeDirPath,
|
|
5227
5398
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5251,7 +5422,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
5251
5422
|
};
|
|
5252
5423
|
|
|
5253
5424
|
// src/features/ignore/junie-ignore.ts
|
|
5254
|
-
import { join as
|
|
5425
|
+
import { join as join36 } from "path";
|
|
5255
5426
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
5256
5427
|
static getSettablePaths() {
|
|
5257
5428
|
return {
|
|
@@ -5278,7 +5449,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5278
5449
|
validate = true
|
|
5279
5450
|
}) {
|
|
5280
5451
|
const fileContent = await readFileContent(
|
|
5281
|
-
|
|
5452
|
+
join36(
|
|
5282
5453
|
baseDir,
|
|
5283
5454
|
this.getSettablePaths().relativeDirPath,
|
|
5284
5455
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5308,7 +5479,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
5308
5479
|
};
|
|
5309
5480
|
|
|
5310
5481
|
// src/features/ignore/kilo-ignore.ts
|
|
5311
|
-
import { join as
|
|
5482
|
+
import { join as join37 } from "path";
|
|
5312
5483
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
5313
5484
|
static getSettablePaths() {
|
|
5314
5485
|
return {
|
|
@@ -5345,7 +5516,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5345
5516
|
validate = true
|
|
5346
5517
|
}) {
|
|
5347
5518
|
const fileContent = await readFileContent(
|
|
5348
|
-
|
|
5519
|
+
join37(
|
|
5349
5520
|
baseDir,
|
|
5350
5521
|
this.getSettablePaths().relativeDirPath,
|
|
5351
5522
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5375,7 +5546,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
5375
5546
|
};
|
|
5376
5547
|
|
|
5377
5548
|
// src/features/ignore/kiro-ignore.ts
|
|
5378
|
-
import { join as
|
|
5549
|
+
import { join as join38 } from "path";
|
|
5379
5550
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
5380
5551
|
static getSettablePaths() {
|
|
5381
5552
|
return {
|
|
@@ -5402,7 +5573,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5402
5573
|
validate = true
|
|
5403
5574
|
}) {
|
|
5404
5575
|
const fileContent = await readFileContent(
|
|
5405
|
-
|
|
5576
|
+
join38(
|
|
5406
5577
|
baseDir,
|
|
5407
5578
|
this.getSettablePaths().relativeDirPath,
|
|
5408
5579
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5432,7 +5603,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
5432
5603
|
};
|
|
5433
5604
|
|
|
5434
5605
|
// src/features/ignore/qwencode-ignore.ts
|
|
5435
|
-
import { join as
|
|
5606
|
+
import { join as join39 } from "path";
|
|
5436
5607
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
5437
5608
|
static getSettablePaths() {
|
|
5438
5609
|
return {
|
|
@@ -5459,7 +5630,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5459
5630
|
validate = true
|
|
5460
5631
|
}) {
|
|
5461
5632
|
const fileContent = await readFileContent(
|
|
5462
|
-
|
|
5633
|
+
join39(
|
|
5463
5634
|
baseDir,
|
|
5464
5635
|
this.getSettablePaths().relativeDirPath,
|
|
5465
5636
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5489,7 +5660,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
5489
5660
|
};
|
|
5490
5661
|
|
|
5491
5662
|
// src/features/ignore/roo-ignore.ts
|
|
5492
|
-
import { join as
|
|
5663
|
+
import { join as join40 } from "path";
|
|
5493
5664
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
5494
5665
|
static getSettablePaths() {
|
|
5495
5666
|
return {
|
|
@@ -5516,7 +5687,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5516
5687
|
validate = true
|
|
5517
5688
|
}) {
|
|
5518
5689
|
const fileContent = await readFileContent(
|
|
5519
|
-
|
|
5690
|
+
join40(
|
|
5520
5691
|
baseDir,
|
|
5521
5692
|
this.getSettablePaths().relativeDirPath,
|
|
5522
5693
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5546,7 +5717,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
5546
5717
|
};
|
|
5547
5718
|
|
|
5548
5719
|
// src/features/ignore/windsurf-ignore.ts
|
|
5549
|
-
import { join as
|
|
5720
|
+
import { join as join41 } from "path";
|
|
5550
5721
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
5551
5722
|
static getSettablePaths() {
|
|
5552
5723
|
return {
|
|
@@ -5573,7 +5744,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5573
5744
|
validate = true
|
|
5574
5745
|
}) {
|
|
5575
5746
|
const fileContent = await readFileContent(
|
|
5576
|
-
|
|
5747
|
+
join41(
|
|
5577
5748
|
baseDir,
|
|
5578
5749
|
this.getSettablePaths().relativeDirPath,
|
|
5579
5750
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5603,7 +5774,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
5603
5774
|
};
|
|
5604
5775
|
|
|
5605
5776
|
// src/features/ignore/zed-ignore.ts
|
|
5606
|
-
import { join as
|
|
5777
|
+
import { join as join42 } from "path";
|
|
5607
5778
|
import { uniq as uniq2 } from "es-toolkit";
|
|
5608
5779
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
5609
5780
|
constructor(params) {
|
|
@@ -5640,7 +5811,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5640
5811
|
}) {
|
|
5641
5812
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5642
5813
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5643
|
-
const filePath =
|
|
5814
|
+
const filePath = join42(
|
|
5644
5815
|
baseDir,
|
|
5645
5816
|
this.getSettablePaths().relativeDirPath,
|
|
5646
5817
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5667,7 +5838,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5667
5838
|
validate = true
|
|
5668
5839
|
}) {
|
|
5669
5840
|
const fileContent = await readFileContent(
|
|
5670
|
-
|
|
5841
|
+
join42(
|
|
5671
5842
|
baseDir,
|
|
5672
5843
|
this.getSettablePaths().relativeDirPath,
|
|
5673
5844
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5855,10 +6026,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5855
6026
|
import { z as z23 } from "zod/mini";
|
|
5856
6027
|
|
|
5857
6028
|
// src/features/mcp/claudecode-mcp.ts
|
|
5858
|
-
import { join as
|
|
6029
|
+
import { join as join44 } from "path";
|
|
5859
6030
|
|
|
5860
6031
|
// src/features/mcp/rulesync-mcp.ts
|
|
5861
|
-
import { join as
|
|
6032
|
+
import { join as join43 } from "path";
|
|
5862
6033
|
import { omit } from "es-toolkit/object";
|
|
5863
6034
|
import { z as z21 } from "zod/mini";
|
|
5864
6035
|
|
|
@@ -5937,12 +6108,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5937
6108
|
}) {
|
|
5938
6109
|
const baseDir = process.cwd();
|
|
5939
6110
|
const paths = this.getSettablePaths();
|
|
5940
|
-
const recommendedPath =
|
|
6111
|
+
const recommendedPath = join43(
|
|
5941
6112
|
baseDir,
|
|
5942
6113
|
paths.recommended.relativeDirPath,
|
|
5943
6114
|
paths.recommended.relativeFilePath
|
|
5944
6115
|
);
|
|
5945
|
-
const legacyPath =
|
|
6116
|
+
const legacyPath = join43(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5946
6117
|
if (await fileExists(recommendedPath)) {
|
|
5947
6118
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5948
6119
|
return new _RulesyncMcp({
|
|
@@ -6096,7 +6267,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6096
6267
|
global = false
|
|
6097
6268
|
}) {
|
|
6098
6269
|
const paths = this.getSettablePaths({ global });
|
|
6099
|
-
const fileContent = await readFileContentOrNull(
|
|
6270
|
+
const fileContent = await readFileContentOrNull(join44(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6100
6271
|
const json = JSON.parse(fileContent);
|
|
6101
6272
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6102
6273
|
return new _ClaudecodeMcp({
|
|
@@ -6115,7 +6286,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6115
6286
|
}) {
|
|
6116
6287
|
const paths = this.getSettablePaths({ global });
|
|
6117
6288
|
const fileContent = await readOrInitializeFileContent(
|
|
6118
|
-
|
|
6289
|
+
join44(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6119
6290
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6120
6291
|
);
|
|
6121
6292
|
const json = JSON.parse(fileContent);
|
|
@@ -6154,7 +6325,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6154
6325
|
};
|
|
6155
6326
|
|
|
6156
6327
|
// src/features/mcp/cline-mcp.ts
|
|
6157
|
-
import { join as
|
|
6328
|
+
import { join as join45 } from "path";
|
|
6158
6329
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
6159
6330
|
json;
|
|
6160
6331
|
constructor(params) {
|
|
@@ -6175,7 +6346,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6175
6346
|
validate = true
|
|
6176
6347
|
}) {
|
|
6177
6348
|
const fileContent = await readFileContent(
|
|
6178
|
-
|
|
6349
|
+
join45(
|
|
6179
6350
|
baseDir,
|
|
6180
6351
|
this.getSettablePaths().relativeDirPath,
|
|
6181
6352
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6224,7 +6395,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
6224
6395
|
};
|
|
6225
6396
|
|
|
6226
6397
|
// src/features/mcp/codexcli-mcp.ts
|
|
6227
|
-
import { join as
|
|
6398
|
+
import { join as join46 } from "path";
|
|
6228
6399
|
import * as smolToml from "smol-toml";
|
|
6229
6400
|
function convertFromCodexFormat(codexMcp) {
|
|
6230
6401
|
const result = {};
|
|
@@ -6307,7 +6478,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6307
6478
|
global = false
|
|
6308
6479
|
}) {
|
|
6309
6480
|
const paths = this.getSettablePaths({ global });
|
|
6310
|
-
const fileContent = await readFileContentOrNull(
|
|
6481
|
+
const fileContent = await readFileContentOrNull(join46(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
6311
6482
|
return new _CodexcliMcp({
|
|
6312
6483
|
baseDir,
|
|
6313
6484
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6323,7 +6494,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6323
6494
|
global = false
|
|
6324
6495
|
}) {
|
|
6325
6496
|
const paths = this.getSettablePaths({ global });
|
|
6326
|
-
const configTomlFilePath =
|
|
6497
|
+
const configTomlFilePath = join46(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6327
6498
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
6328
6499
|
configTomlFilePath,
|
|
6329
6500
|
smolToml.stringify({})
|
|
@@ -6377,7 +6548,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
6377
6548
|
};
|
|
6378
6549
|
|
|
6379
6550
|
// src/features/mcp/copilot-mcp.ts
|
|
6380
|
-
import { join as
|
|
6551
|
+
import { join as join47 } from "path";
|
|
6381
6552
|
function convertToCopilotFormat(mcpServers) {
|
|
6382
6553
|
return { servers: mcpServers };
|
|
6383
6554
|
}
|
|
@@ -6404,7 +6575,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6404
6575
|
validate = true
|
|
6405
6576
|
}) {
|
|
6406
6577
|
const fileContent = await readFileContent(
|
|
6407
|
-
|
|
6578
|
+
join47(
|
|
6408
6579
|
baseDir,
|
|
6409
6580
|
this.getSettablePaths().relativeDirPath,
|
|
6410
6581
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6457,7 +6628,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
6457
6628
|
};
|
|
6458
6629
|
|
|
6459
6630
|
// src/features/mcp/copilotcli-mcp.ts
|
|
6460
|
-
import { join as
|
|
6631
|
+
import { join as join48 } from "path";
|
|
6461
6632
|
function addTypeField(mcpServers) {
|
|
6462
6633
|
const result = {};
|
|
6463
6634
|
for (const [name, server] of Object.entries(mcpServers)) {
|
|
@@ -6532,7 +6703,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6532
6703
|
global = false
|
|
6533
6704
|
}) {
|
|
6534
6705
|
const paths = this.getSettablePaths({ global });
|
|
6535
|
-
const fileContent = await readFileContentOrNull(
|
|
6706
|
+
const fileContent = await readFileContentOrNull(join48(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6536
6707
|
const json = JSON.parse(fileContent);
|
|
6537
6708
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6538
6709
|
return new _CopilotcliMcp({
|
|
@@ -6552,7 +6723,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6552
6723
|
}) {
|
|
6553
6724
|
const paths = this.getSettablePaths({ global });
|
|
6554
6725
|
const fileContent = await readOrInitializeFileContent(
|
|
6555
|
-
|
|
6726
|
+
join48(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6556
6727
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6557
6728
|
);
|
|
6558
6729
|
const json = JSON.parse(fileContent);
|
|
@@ -6594,7 +6765,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
6594
6765
|
};
|
|
6595
6766
|
|
|
6596
6767
|
// src/features/mcp/cursor-mcp.ts
|
|
6597
|
-
import { join as
|
|
6768
|
+
import { join as join49 } from "path";
|
|
6598
6769
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
6599
6770
|
function isMcpServers(value) {
|
|
6600
6771
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -6644,7 +6815,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6644
6815
|
this.json = JSON.parse(this.fileContent);
|
|
6645
6816
|
} catch (error) {
|
|
6646
6817
|
throw new Error(
|
|
6647
|
-
`Failed to parse Cursor MCP config at ${
|
|
6818
|
+
`Failed to parse Cursor MCP config at ${join49(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
6648
6819
|
{ cause: error }
|
|
6649
6820
|
);
|
|
6650
6821
|
}
|
|
@@ -6670,14 +6841,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6670
6841
|
global = false
|
|
6671
6842
|
}) {
|
|
6672
6843
|
const paths = this.getSettablePaths({ global });
|
|
6673
|
-
const filePath =
|
|
6844
|
+
const filePath = join49(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6674
6845
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
6675
6846
|
let json;
|
|
6676
6847
|
try {
|
|
6677
6848
|
json = JSON.parse(fileContent);
|
|
6678
6849
|
} catch (error) {
|
|
6679
6850
|
throw new Error(
|
|
6680
|
-
`Failed to parse Cursor MCP config at ${
|
|
6851
|
+
`Failed to parse Cursor MCP config at ${join49(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6681
6852
|
{ cause: error }
|
|
6682
6853
|
);
|
|
6683
6854
|
}
|
|
@@ -6699,7 +6870,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6699
6870
|
}) {
|
|
6700
6871
|
const paths = this.getSettablePaths({ global });
|
|
6701
6872
|
const fileContent = await readOrInitializeFileContent(
|
|
6702
|
-
|
|
6873
|
+
join49(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6703
6874
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6704
6875
|
);
|
|
6705
6876
|
let json;
|
|
@@ -6707,7 +6878,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6707
6878
|
json = JSON.parse(fileContent);
|
|
6708
6879
|
} catch (error) {
|
|
6709
6880
|
throw new Error(
|
|
6710
|
-
`Failed to parse Cursor MCP config at ${
|
|
6881
|
+
`Failed to parse Cursor MCP config at ${join49(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
6711
6882
|
{ cause: error }
|
|
6712
6883
|
);
|
|
6713
6884
|
}
|
|
@@ -6755,62 +6926,68 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
6755
6926
|
}
|
|
6756
6927
|
};
|
|
6757
6928
|
|
|
6758
|
-
// src/features/mcp/
|
|
6759
|
-
import { join as
|
|
6760
|
-
var
|
|
6929
|
+
// src/features/mcp/deepagents-mcp.ts
|
|
6930
|
+
import { join as join50 } from "path";
|
|
6931
|
+
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
6761
6932
|
json;
|
|
6762
6933
|
constructor(params) {
|
|
6763
6934
|
super(params);
|
|
6764
|
-
this.json =
|
|
6935
|
+
this.json = JSON.parse(this.fileContent || "{}");
|
|
6765
6936
|
}
|
|
6766
6937
|
getJson() {
|
|
6767
6938
|
return this.json;
|
|
6768
6939
|
}
|
|
6769
|
-
|
|
6940
|
+
isDeletable() {
|
|
6941
|
+
return !this.global;
|
|
6942
|
+
}
|
|
6943
|
+
static getSettablePaths(_options = {}) {
|
|
6770
6944
|
return {
|
|
6771
|
-
relativeDirPath: ".
|
|
6772
|
-
relativeFilePath: "mcp.json"
|
|
6945
|
+
relativeDirPath: ".deepagents",
|
|
6946
|
+
relativeFilePath: ".mcp.json"
|
|
6773
6947
|
};
|
|
6774
6948
|
}
|
|
6775
6949
|
static async fromFile({
|
|
6776
6950
|
baseDir = process.cwd(),
|
|
6777
|
-
validate = true
|
|
6951
|
+
validate = true,
|
|
6952
|
+
global = false
|
|
6778
6953
|
}) {
|
|
6779
|
-
const
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
)
|
|
6785
|
-
);
|
|
6786
|
-
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({
|
|
6787
6959
|
baseDir,
|
|
6788
|
-
relativeDirPath:
|
|
6789
|
-
relativeFilePath:
|
|
6790
|
-
fileContent,
|
|
6960
|
+
relativeDirPath: paths.relativeDirPath,
|
|
6961
|
+
relativeFilePath: paths.relativeFilePath,
|
|
6962
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
6791
6963
|
validate
|
|
6792
6964
|
});
|
|
6793
6965
|
}
|
|
6794
|
-
static fromRulesyncMcp({
|
|
6966
|
+
static async fromRulesyncMcp({
|
|
6795
6967
|
baseDir = process.cwd(),
|
|
6796
6968
|
rulesyncMcp,
|
|
6797
|
-
validate = true
|
|
6969
|
+
validate = true,
|
|
6970
|
+
global = false
|
|
6798
6971
|
}) {
|
|
6799
|
-
const
|
|
6800
|
-
const
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
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({
|
|
6805
6980
|
baseDir,
|
|
6806
|
-
relativeDirPath:
|
|
6807
|
-
relativeFilePath:
|
|
6808
|
-
fileContent,
|
|
6981
|
+
relativeDirPath: paths.relativeDirPath,
|
|
6982
|
+
relativeFilePath: paths.relativeFilePath,
|
|
6983
|
+
fileContent: JSON.stringify(mcpJson, null, 2),
|
|
6809
6984
|
validate
|
|
6810
6985
|
});
|
|
6811
6986
|
}
|
|
6812
6987
|
toRulesyncMcp() {
|
|
6813
|
-
return this.toRulesyncMcpDefault(
|
|
6988
|
+
return this.toRulesyncMcpDefault({
|
|
6989
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
|
|
6990
|
+
});
|
|
6814
6991
|
}
|
|
6815
6992
|
validate() {
|
|
6816
6993
|
return { success: true, error: null };
|
|
@@ -6818,7 +6995,84 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6818
6995
|
static forDeletion({
|
|
6819
6996
|
baseDir = process.cwd(),
|
|
6820
6997
|
relativeDirPath,
|
|
6821
|
-
relativeFilePath
|
|
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() {
|
|
7070
|
+
return { success: true, error: null };
|
|
7071
|
+
}
|
|
7072
|
+
static forDeletion({
|
|
7073
|
+
baseDir = process.cwd(),
|
|
7074
|
+
relativeDirPath,
|
|
7075
|
+
relativeFilePath
|
|
6822
7076
|
}) {
|
|
6823
7077
|
return new _FactorydroidMcp({
|
|
6824
7078
|
baseDir,
|
|
@@ -6831,7 +7085,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6831
7085
|
};
|
|
6832
7086
|
|
|
6833
7087
|
// src/features/mcp/geminicli-mcp.ts
|
|
6834
|
-
import { join as
|
|
7088
|
+
import { join as join52 } from "path";
|
|
6835
7089
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6836
7090
|
json;
|
|
6837
7091
|
constructor(params) {
|
|
@@ -6859,7 +7113,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6859
7113
|
global = false
|
|
6860
7114
|
}) {
|
|
6861
7115
|
const paths = this.getSettablePaths({ global });
|
|
6862
|
-
const fileContent = await readFileContentOrNull(
|
|
7116
|
+
const fileContent = await readFileContentOrNull(join52(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6863
7117
|
const json = JSON.parse(fileContent);
|
|
6864
7118
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6865
7119
|
return new _GeminiCliMcp({
|
|
@@ -6878,7 +7132,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6878
7132
|
}) {
|
|
6879
7133
|
const paths = this.getSettablePaths({ global });
|
|
6880
7134
|
const fileContent = await readOrInitializeFileContent(
|
|
6881
|
-
|
|
7135
|
+
join52(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6882
7136
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6883
7137
|
);
|
|
6884
7138
|
const json = JSON.parse(fileContent);
|
|
@@ -6923,7 +7177,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6923
7177
|
};
|
|
6924
7178
|
|
|
6925
7179
|
// src/features/mcp/junie-mcp.ts
|
|
6926
|
-
import { join as
|
|
7180
|
+
import { join as join53 } from "path";
|
|
6927
7181
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6928
7182
|
json;
|
|
6929
7183
|
constructor(params) {
|
|
@@ -6935,7 +7189,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6935
7189
|
}
|
|
6936
7190
|
static getSettablePaths() {
|
|
6937
7191
|
return {
|
|
6938
|
-
relativeDirPath:
|
|
7192
|
+
relativeDirPath: join53(".junie", "mcp"),
|
|
6939
7193
|
relativeFilePath: "mcp.json"
|
|
6940
7194
|
};
|
|
6941
7195
|
}
|
|
@@ -6944,7 +7198,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6944
7198
|
validate = true
|
|
6945
7199
|
}) {
|
|
6946
7200
|
const fileContent = await readFileContent(
|
|
6947
|
-
|
|
7201
|
+
join53(
|
|
6948
7202
|
baseDir,
|
|
6949
7203
|
this.getSettablePaths().relativeDirPath,
|
|
6950
7204
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6993,7 +7247,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6993
7247
|
};
|
|
6994
7248
|
|
|
6995
7249
|
// src/features/mcp/kilo-mcp.ts
|
|
6996
|
-
import { join as
|
|
7250
|
+
import { join as join54 } from "path";
|
|
6997
7251
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6998
7252
|
json;
|
|
6999
7253
|
constructor(params) {
|
|
@@ -7014,7 +7268,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7014
7268
|
validate = true
|
|
7015
7269
|
}) {
|
|
7016
7270
|
const paths = this.getSettablePaths();
|
|
7017
|
-
const fileContent = await readFileContentOrNull(
|
|
7271
|
+
const fileContent = await readFileContentOrNull(join54(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7018
7272
|
return new _KiloMcp({
|
|
7019
7273
|
baseDir,
|
|
7020
7274
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7062,7 +7316,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
7062
7316
|
};
|
|
7063
7317
|
|
|
7064
7318
|
// src/features/mcp/kiro-mcp.ts
|
|
7065
|
-
import { join as
|
|
7319
|
+
import { join as join55 } from "path";
|
|
7066
7320
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
7067
7321
|
json;
|
|
7068
7322
|
constructor(params) {
|
|
@@ -7074,7 +7328,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7074
7328
|
}
|
|
7075
7329
|
static getSettablePaths() {
|
|
7076
7330
|
return {
|
|
7077
|
-
relativeDirPath:
|
|
7331
|
+
relativeDirPath: join55(".kiro", "settings"),
|
|
7078
7332
|
relativeFilePath: "mcp.json"
|
|
7079
7333
|
};
|
|
7080
7334
|
}
|
|
@@ -7083,7 +7337,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7083
7337
|
validate = true
|
|
7084
7338
|
}) {
|
|
7085
7339
|
const paths = this.getSettablePaths();
|
|
7086
|
-
const fileContent = await readFileContentOrNull(
|
|
7340
|
+
const fileContent = await readFileContentOrNull(join55(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7087
7341
|
return new _KiroMcp({
|
|
7088
7342
|
baseDir,
|
|
7089
7343
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7131,7 +7385,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
7131
7385
|
};
|
|
7132
7386
|
|
|
7133
7387
|
// src/features/mcp/opencode-mcp.ts
|
|
7134
|
-
import { join as
|
|
7388
|
+
import { join as join56 } from "path";
|
|
7135
7389
|
import { parse as parseJsonc2 } from "jsonc-parser";
|
|
7136
7390
|
import { z as z22 } from "zod/mini";
|
|
7137
7391
|
var OpencodeMcpLocalServerSchema = z22.object({
|
|
@@ -7272,7 +7526,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7272
7526
|
static getSettablePaths({ global } = {}) {
|
|
7273
7527
|
if (global) {
|
|
7274
7528
|
return {
|
|
7275
|
-
relativeDirPath:
|
|
7529
|
+
relativeDirPath: join56(".config", "opencode"),
|
|
7276
7530
|
relativeFilePath: "opencode.json"
|
|
7277
7531
|
};
|
|
7278
7532
|
}
|
|
@@ -7287,11 +7541,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7287
7541
|
global = false
|
|
7288
7542
|
}) {
|
|
7289
7543
|
const basePaths = this.getSettablePaths({ global });
|
|
7290
|
-
const jsonDir =
|
|
7544
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7291
7545
|
let fileContent = null;
|
|
7292
7546
|
let relativeFilePath = "opencode.jsonc";
|
|
7293
|
-
const jsoncPath =
|
|
7294
|
-
const jsonPath =
|
|
7547
|
+
const jsoncPath = join56(jsonDir, "opencode.jsonc");
|
|
7548
|
+
const jsonPath = join56(jsonDir, "opencode.json");
|
|
7295
7549
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7296
7550
|
if (!fileContent) {
|
|
7297
7551
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7317,11 +7571,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7317
7571
|
global = false
|
|
7318
7572
|
}) {
|
|
7319
7573
|
const basePaths = this.getSettablePaths({ global });
|
|
7320
|
-
const jsonDir =
|
|
7574
|
+
const jsonDir = join56(baseDir, basePaths.relativeDirPath);
|
|
7321
7575
|
let fileContent = null;
|
|
7322
7576
|
let relativeFilePath = "opencode.jsonc";
|
|
7323
|
-
const jsoncPath =
|
|
7324
|
-
const jsonPath =
|
|
7577
|
+
const jsoncPath = join56(jsonDir, "opencode.jsonc");
|
|
7578
|
+
const jsonPath = join56(jsonDir, "opencode.json");
|
|
7325
7579
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
7326
7580
|
if (!fileContent) {
|
|
7327
7581
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -7382,7 +7636,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
7382
7636
|
};
|
|
7383
7637
|
|
|
7384
7638
|
// src/features/mcp/roo-mcp.ts
|
|
7385
|
-
import { join as
|
|
7639
|
+
import { join as join57 } from "path";
|
|
7386
7640
|
function isRooMcpServers(value) {
|
|
7387
7641
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
7388
7642
|
}
|
|
@@ -7434,7 +7688,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
7434
7688
|
validate = true
|
|
7435
7689
|
}) {
|
|
7436
7690
|
const fileContent = await readFileContent(
|
|
7437
|
-
|
|
7691
|
+
join57(
|
|
7438
7692
|
baseDir,
|
|
7439
7693
|
this.getSettablePaths().relativeDirPath,
|
|
7440
7694
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7498,6 +7752,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
7498
7752
|
"copilot",
|
|
7499
7753
|
"copilotcli",
|
|
7500
7754
|
"cursor",
|
|
7755
|
+
"deepagents",
|
|
7501
7756
|
"factorydroid",
|
|
7502
7757
|
"geminicli",
|
|
7503
7758
|
"kilo",
|
|
@@ -7592,6 +7847,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
7592
7847
|
}
|
|
7593
7848
|
}
|
|
7594
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
|
+
],
|
|
7595
7862
|
[
|
|
7596
7863
|
"factorydroid",
|
|
7597
7864
|
{
|
|
@@ -7821,25 +8088,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
7821
8088
|
};
|
|
7822
8089
|
|
|
7823
8090
|
// src/features/rules/rules-processor.ts
|
|
7824
|
-
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";
|
|
7825
8092
|
import { encode } from "@toon-format/toon";
|
|
7826
|
-
import { z as
|
|
8093
|
+
import { z as z59 } from "zod/mini";
|
|
7827
8094
|
|
|
7828
8095
|
// src/constants/general.ts
|
|
7829
8096
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
7830
8097
|
|
|
7831
8098
|
// src/features/skills/agentsmd-skill.ts
|
|
7832
|
-
import { join as
|
|
8099
|
+
import { join as join61 } from "path";
|
|
7833
8100
|
|
|
7834
8101
|
// src/features/skills/simulated-skill.ts
|
|
7835
|
-
import { join as
|
|
8102
|
+
import { join as join60 } from "path";
|
|
7836
8103
|
import { z as z24 } from "zod/mini";
|
|
7837
8104
|
|
|
7838
8105
|
// src/features/skills/tool-skill.ts
|
|
7839
|
-
import { join as
|
|
8106
|
+
import { join as join59 } from "path";
|
|
7840
8107
|
|
|
7841
8108
|
// src/types/ai-dir.ts
|
|
7842
|
-
import path2, { basename as basename3, join as
|
|
8109
|
+
import path2, { basename as basename3, join as join58, relative as relative4, resolve as resolve4 } from "path";
|
|
7843
8110
|
var AiDir = class {
|
|
7844
8111
|
/**
|
|
7845
8112
|
* @example "."
|
|
@@ -7933,8 +8200,8 @@ var AiDir = class {
|
|
|
7933
8200
|
* @returns Array of files with their relative paths and buffers
|
|
7934
8201
|
*/
|
|
7935
8202
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7936
|
-
const dirPath =
|
|
7937
|
-
const glob =
|
|
8203
|
+
const dirPath = join58(baseDir, relativeDirPath, dirName);
|
|
8204
|
+
const glob = join58(dirPath, "**", "*");
|
|
7938
8205
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7939
8206
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
7940
8207
|
const files = await Promise.all(
|
|
@@ -8032,8 +8299,8 @@ var ToolSkill = class extends AiDir {
|
|
|
8032
8299
|
}) {
|
|
8033
8300
|
const settablePaths = getSettablePaths({ global });
|
|
8034
8301
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
8035
|
-
const skillDirPath =
|
|
8036
|
-
const skillFilePath =
|
|
8302
|
+
const skillDirPath = join59(baseDir, actualRelativeDirPath, dirName);
|
|
8303
|
+
const skillFilePath = join59(skillDirPath, SKILL_FILE_NAME);
|
|
8037
8304
|
if (!await fileExists(skillFilePath)) {
|
|
8038
8305
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8039
8306
|
}
|
|
@@ -8057,7 +8324,7 @@ var ToolSkill = class extends AiDir {
|
|
|
8057
8324
|
}
|
|
8058
8325
|
requireMainFileFrontmatter() {
|
|
8059
8326
|
if (!this.mainFile?.frontmatter) {
|
|
8060
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8327
|
+
throw new Error(`Frontmatter is not defined in ${join59(this.relativeDirPath, this.dirName)}`);
|
|
8061
8328
|
}
|
|
8062
8329
|
return this.mainFile.frontmatter;
|
|
8063
8330
|
}
|
|
@@ -8097,7 +8364,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
8097
8364
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
8098
8365
|
if (!result.success) {
|
|
8099
8366
|
throw new Error(
|
|
8100
|
-
`Invalid frontmatter in ${
|
|
8367
|
+
`Invalid frontmatter in ${join60(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
8101
8368
|
);
|
|
8102
8369
|
}
|
|
8103
8370
|
}
|
|
@@ -8156,8 +8423,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
8156
8423
|
}) {
|
|
8157
8424
|
const settablePaths = this.getSettablePaths();
|
|
8158
8425
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
8159
|
-
const skillDirPath =
|
|
8160
|
-
const skillFilePath =
|
|
8426
|
+
const skillDirPath = join60(baseDir, actualRelativeDirPath, dirName);
|
|
8427
|
+
const skillFilePath = join60(skillDirPath, SKILL_FILE_NAME);
|
|
8161
8428
|
if (!await fileExists(skillFilePath)) {
|
|
8162
8429
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8163
8430
|
}
|
|
@@ -8234,7 +8501,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
8234
8501
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
8235
8502
|
}
|
|
8236
8503
|
return {
|
|
8237
|
-
relativeDirPath:
|
|
8504
|
+
relativeDirPath: join61(".agents", "skills")
|
|
8238
8505
|
};
|
|
8239
8506
|
}
|
|
8240
8507
|
static async fromDir(params) {
|
|
@@ -8261,11 +8528,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
8261
8528
|
};
|
|
8262
8529
|
|
|
8263
8530
|
// src/features/skills/factorydroid-skill.ts
|
|
8264
|
-
import { join as
|
|
8531
|
+
import { join as join62 } from "path";
|
|
8265
8532
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
8266
8533
|
static getSettablePaths(_options) {
|
|
8267
8534
|
return {
|
|
8268
|
-
relativeDirPath:
|
|
8535
|
+
relativeDirPath: join62(".factory", "skills")
|
|
8269
8536
|
};
|
|
8270
8537
|
}
|
|
8271
8538
|
static async fromDir(params) {
|
|
@@ -8292,11 +8559,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
8292
8559
|
};
|
|
8293
8560
|
|
|
8294
8561
|
// src/features/skills/skills-processor.ts
|
|
8295
|
-
import { basename as basename5, join as
|
|
8296
|
-
import { z as
|
|
8562
|
+
import { basename as basename5, join as join81 } from "path";
|
|
8563
|
+
import { z as z41 } from "zod/mini";
|
|
8297
8564
|
|
|
8298
8565
|
// src/types/dir-feature-processor.ts
|
|
8299
|
-
import { join as
|
|
8566
|
+
import { join as join63 } from "path";
|
|
8300
8567
|
var DirFeatureProcessor = class {
|
|
8301
8568
|
baseDir;
|
|
8302
8569
|
dryRun;
|
|
@@ -8336,7 +8603,7 @@ var DirFeatureProcessor = class {
|
|
|
8336
8603
|
const mainFile = aiDir.getMainFile();
|
|
8337
8604
|
let mainFileContent;
|
|
8338
8605
|
if (mainFile) {
|
|
8339
|
-
const mainFilePath =
|
|
8606
|
+
const mainFilePath = join63(dirPath, mainFile.name);
|
|
8340
8607
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
8341
8608
|
avoidBlockScalars: this.avoidBlockScalars
|
|
8342
8609
|
});
|
|
@@ -8352,7 +8619,7 @@ var DirFeatureProcessor = class {
|
|
|
8352
8619
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
8353
8620
|
otherFileContents.push(contentWithNewline);
|
|
8354
8621
|
if (!dirHasChanges) {
|
|
8355
|
-
const filePath =
|
|
8622
|
+
const filePath = join63(dirPath, file.relativeFilePathToDirPath);
|
|
8356
8623
|
const existingContent = await readFileContentOrNull(filePath);
|
|
8357
8624
|
if (existingContent !== contentWithNewline) {
|
|
8358
8625
|
dirHasChanges = true;
|
|
@@ -8366,24 +8633,24 @@ var DirFeatureProcessor = class {
|
|
|
8366
8633
|
if (this.dryRun) {
|
|
8367
8634
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
8368
8635
|
if (mainFile) {
|
|
8369
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
8370
|
-
changedPaths.push(
|
|
8636
|
+
this.logger.info(`[DRY RUN] Would write: ${join63(dirPath, mainFile.name)}`);
|
|
8637
|
+
changedPaths.push(join63(relativeDir, mainFile.name));
|
|
8371
8638
|
}
|
|
8372
8639
|
for (const file of otherFiles) {
|
|
8373
8640
|
this.logger.info(
|
|
8374
|
-
`[DRY RUN] Would write: ${
|
|
8641
|
+
`[DRY RUN] Would write: ${join63(dirPath, file.relativeFilePathToDirPath)}`
|
|
8375
8642
|
);
|
|
8376
|
-
changedPaths.push(
|
|
8643
|
+
changedPaths.push(join63(relativeDir, file.relativeFilePathToDirPath));
|
|
8377
8644
|
}
|
|
8378
8645
|
} else {
|
|
8379
8646
|
await ensureDir(dirPath);
|
|
8380
8647
|
if (mainFile && mainFileContent) {
|
|
8381
|
-
const mainFilePath =
|
|
8648
|
+
const mainFilePath = join63(dirPath, mainFile.name);
|
|
8382
8649
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
8383
|
-
changedPaths.push(
|
|
8650
|
+
changedPaths.push(join63(relativeDir, mainFile.name));
|
|
8384
8651
|
}
|
|
8385
8652
|
for (const [i, file] of otherFiles.entries()) {
|
|
8386
|
-
const filePath =
|
|
8653
|
+
const filePath = join63(dirPath, file.relativeFilePathToDirPath);
|
|
8387
8654
|
const content = otherFileContents[i];
|
|
8388
8655
|
if (content === void 0) {
|
|
8389
8656
|
throw new Error(
|
|
@@ -8391,7 +8658,7 @@ var DirFeatureProcessor = class {
|
|
|
8391
8658
|
);
|
|
8392
8659
|
}
|
|
8393
8660
|
await writeFileContent(filePath, content);
|
|
8394
|
-
changedPaths.push(
|
|
8661
|
+
changedPaths.push(join63(relativeDir, file.relativeFilePathToDirPath));
|
|
8395
8662
|
}
|
|
8396
8663
|
}
|
|
8397
8664
|
changedCount++;
|
|
@@ -8423,11 +8690,11 @@ var DirFeatureProcessor = class {
|
|
|
8423
8690
|
};
|
|
8424
8691
|
|
|
8425
8692
|
// src/features/skills/agentsskills-skill.ts
|
|
8426
|
-
import { join as
|
|
8693
|
+
import { join as join65 } from "path";
|
|
8427
8694
|
import { z as z26 } from "zod/mini";
|
|
8428
8695
|
|
|
8429
8696
|
// src/features/skills/rulesync-skill.ts
|
|
8430
|
-
import { join as
|
|
8697
|
+
import { join as join64 } from "path";
|
|
8431
8698
|
import { z as z25 } from "zod/mini";
|
|
8432
8699
|
var RulesyncSkillFrontmatterSchemaInternal = z25.looseObject({
|
|
8433
8700
|
name: z25.string(),
|
|
@@ -8450,6 +8717,11 @@ var RulesyncSkillFrontmatterSchemaInternal = z25.looseObject({
|
|
|
8450
8717
|
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
8451
8718
|
})
|
|
8452
8719
|
),
|
|
8720
|
+
deepagents: z25.optional(
|
|
8721
|
+
z25.looseObject({
|
|
8722
|
+
"allowed-tools": z25.optional(z25.array(z25.string()))
|
|
8723
|
+
})
|
|
8724
|
+
),
|
|
8453
8725
|
copilot: z25.optional(
|
|
8454
8726
|
z25.looseObject({
|
|
8455
8727
|
license: z25.optional(z25.string())
|
|
@@ -8496,7 +8768,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8496
8768
|
}
|
|
8497
8769
|
getFrontmatter() {
|
|
8498
8770
|
if (!this.mainFile?.frontmatter) {
|
|
8499
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
8771
|
+
throw new Error(`Frontmatter is not defined in ${join64(this.relativeDirPath, this.dirName)}`);
|
|
8500
8772
|
}
|
|
8501
8773
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
8502
8774
|
return result;
|
|
@@ -8522,8 +8794,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
8522
8794
|
dirName,
|
|
8523
8795
|
global = false
|
|
8524
8796
|
}) {
|
|
8525
|
-
const skillDirPath =
|
|
8526
|
-
const skillFilePath =
|
|
8797
|
+
const skillDirPath = join64(baseDir, relativeDirPath, dirName);
|
|
8798
|
+
const skillFilePath = join64(skillDirPath, SKILL_FILE_NAME);
|
|
8527
8799
|
if (!await fileExists(skillFilePath)) {
|
|
8528
8800
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
8529
8801
|
}
|
|
@@ -8560,7 +8832,7 @@ var AgentsSkillsSkillFrontmatterSchema = z26.looseObject({
|
|
|
8560
8832
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
8561
8833
|
constructor({
|
|
8562
8834
|
baseDir = process.cwd(),
|
|
8563
|
-
relativeDirPath =
|
|
8835
|
+
relativeDirPath = join65(".agents", "skills"),
|
|
8564
8836
|
dirName,
|
|
8565
8837
|
frontmatter,
|
|
8566
8838
|
body,
|
|
@@ -8592,7 +8864,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8592
8864
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
8593
8865
|
}
|
|
8594
8866
|
return {
|
|
8595
|
-
relativeDirPath:
|
|
8867
|
+
relativeDirPath: join65(".agents", "skills")
|
|
8596
8868
|
};
|
|
8597
8869
|
}
|
|
8598
8870
|
getFrontmatter() {
|
|
@@ -8672,9 +8944,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8672
8944
|
});
|
|
8673
8945
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8674
8946
|
if (!result.success) {
|
|
8675
|
-
const skillDirPath =
|
|
8947
|
+
const skillDirPath = join65(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8676
8948
|
throw new Error(
|
|
8677
|
-
`Invalid frontmatter in ${
|
|
8949
|
+
`Invalid frontmatter in ${join65(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8678
8950
|
);
|
|
8679
8951
|
}
|
|
8680
8952
|
return new _AgentsSkillsSkill({
|
|
@@ -8709,7 +8981,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
8709
8981
|
};
|
|
8710
8982
|
|
|
8711
8983
|
// src/features/skills/antigravity-skill.ts
|
|
8712
|
-
import { join as
|
|
8984
|
+
import { join as join66 } from "path";
|
|
8713
8985
|
import { z as z27 } from "zod/mini";
|
|
8714
8986
|
var AntigravitySkillFrontmatterSchema = z27.looseObject({
|
|
8715
8987
|
name: z27.string(),
|
|
@@ -8718,7 +8990,7 @@ var AntigravitySkillFrontmatterSchema = z27.looseObject({
|
|
|
8718
8990
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
8719
8991
|
constructor({
|
|
8720
8992
|
baseDir = process.cwd(),
|
|
8721
|
-
relativeDirPath =
|
|
8993
|
+
relativeDirPath = join66(".agent", "skills"),
|
|
8722
8994
|
dirName,
|
|
8723
8995
|
frontmatter,
|
|
8724
8996
|
body,
|
|
@@ -8750,11 +9022,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8750
9022
|
} = {}) {
|
|
8751
9023
|
if (global) {
|
|
8752
9024
|
return {
|
|
8753
|
-
relativeDirPath:
|
|
9025
|
+
relativeDirPath: join66(".gemini", "antigravity", "skills")
|
|
8754
9026
|
};
|
|
8755
9027
|
}
|
|
8756
9028
|
return {
|
|
8757
|
-
relativeDirPath:
|
|
9029
|
+
relativeDirPath: join66(".agent", "skills")
|
|
8758
9030
|
};
|
|
8759
9031
|
}
|
|
8760
9032
|
getFrontmatter() {
|
|
@@ -8834,9 +9106,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8834
9106
|
});
|
|
8835
9107
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8836
9108
|
if (!result.success) {
|
|
8837
|
-
const skillDirPath =
|
|
9109
|
+
const skillDirPath = join66(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8838
9110
|
throw new Error(
|
|
8839
|
-
`Invalid frontmatter in ${
|
|
9111
|
+
`Invalid frontmatter in ${join66(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8840
9112
|
);
|
|
8841
9113
|
}
|
|
8842
9114
|
return new _AntigravitySkill({
|
|
@@ -8870,7 +9142,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
8870
9142
|
};
|
|
8871
9143
|
|
|
8872
9144
|
// src/features/skills/claudecode-skill.ts
|
|
8873
|
-
import { join as
|
|
9145
|
+
import { join as join67 } from "path";
|
|
8874
9146
|
import { z as z28 } from "zod/mini";
|
|
8875
9147
|
var ClaudecodeSkillFrontmatterSchema = z28.looseObject({
|
|
8876
9148
|
name: z28.string(),
|
|
@@ -8882,7 +9154,7 @@ var ClaudecodeSkillFrontmatterSchema = z28.looseObject({
|
|
|
8882
9154
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8883
9155
|
constructor({
|
|
8884
9156
|
baseDir = process.cwd(),
|
|
8885
|
-
relativeDirPath =
|
|
9157
|
+
relativeDirPath = join67(".claude", "skills"),
|
|
8886
9158
|
dirName,
|
|
8887
9159
|
frontmatter,
|
|
8888
9160
|
body,
|
|
@@ -8913,7 +9185,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8913
9185
|
global: _global = false
|
|
8914
9186
|
} = {}) {
|
|
8915
9187
|
return {
|
|
8916
|
-
relativeDirPath:
|
|
9188
|
+
relativeDirPath: join67(".claude", "skills")
|
|
8917
9189
|
};
|
|
8918
9190
|
}
|
|
8919
9191
|
getFrontmatter() {
|
|
@@ -9010,9 +9282,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
9010
9282
|
});
|
|
9011
9283
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9012
9284
|
if (!result.success) {
|
|
9013
|
-
const skillDirPath =
|
|
9285
|
+
const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9014
9286
|
throw new Error(
|
|
9015
|
-
`Invalid frontmatter in ${
|
|
9287
|
+
`Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9016
9288
|
);
|
|
9017
9289
|
}
|
|
9018
9290
|
return new _ClaudecodeSkill({
|
|
@@ -9046,7 +9318,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
9046
9318
|
};
|
|
9047
9319
|
|
|
9048
9320
|
// src/features/skills/cline-skill.ts
|
|
9049
|
-
import { join as
|
|
9321
|
+
import { join as join68 } from "path";
|
|
9050
9322
|
import { z as z29 } from "zod/mini";
|
|
9051
9323
|
var ClineSkillFrontmatterSchema = z29.looseObject({
|
|
9052
9324
|
name: z29.string(),
|
|
@@ -9055,7 +9327,7 @@ var ClineSkillFrontmatterSchema = z29.looseObject({
|
|
|
9055
9327
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
9056
9328
|
constructor({
|
|
9057
9329
|
baseDir = process.cwd(),
|
|
9058
|
-
relativeDirPath =
|
|
9330
|
+
relativeDirPath = join68(".cline", "skills"),
|
|
9059
9331
|
dirName,
|
|
9060
9332
|
frontmatter,
|
|
9061
9333
|
body,
|
|
@@ -9084,7 +9356,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9084
9356
|
}
|
|
9085
9357
|
static getSettablePaths(_options = {}) {
|
|
9086
9358
|
return {
|
|
9087
|
-
relativeDirPath:
|
|
9359
|
+
relativeDirPath: join68(".cline", "skills")
|
|
9088
9360
|
};
|
|
9089
9361
|
}
|
|
9090
9362
|
getFrontmatter() {
|
|
@@ -9172,13 +9444,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9172
9444
|
});
|
|
9173
9445
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9174
9446
|
if (!result.success) {
|
|
9175
|
-
const skillDirPath =
|
|
9447
|
+
const skillDirPath = join68(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9176
9448
|
throw new Error(
|
|
9177
|
-
`Invalid frontmatter in ${
|
|
9449
|
+
`Invalid frontmatter in ${join68(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9178
9450
|
);
|
|
9179
9451
|
}
|
|
9180
9452
|
if (result.data.name !== loaded.dirName) {
|
|
9181
|
-
const skillFilePath =
|
|
9453
|
+
const skillFilePath = join68(
|
|
9182
9454
|
loaded.baseDir,
|
|
9183
9455
|
loaded.relativeDirPath,
|
|
9184
9456
|
loaded.dirName,
|
|
@@ -9219,7 +9491,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
9219
9491
|
};
|
|
9220
9492
|
|
|
9221
9493
|
// src/features/skills/codexcli-skill.ts
|
|
9222
|
-
import { join as
|
|
9494
|
+
import { join as join69 } from "path";
|
|
9223
9495
|
import { z as z30 } from "zod/mini";
|
|
9224
9496
|
var CodexCliSkillFrontmatterSchema = z30.looseObject({
|
|
9225
9497
|
name: z30.string(),
|
|
@@ -9233,7 +9505,7 @@ var CodexCliSkillFrontmatterSchema = z30.looseObject({
|
|
|
9233
9505
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
9234
9506
|
constructor({
|
|
9235
9507
|
baseDir = process.cwd(),
|
|
9236
|
-
relativeDirPath =
|
|
9508
|
+
relativeDirPath = join69(".codex", "skills"),
|
|
9237
9509
|
dirName,
|
|
9238
9510
|
frontmatter,
|
|
9239
9511
|
body,
|
|
@@ -9264,7 +9536,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9264
9536
|
global: _global = false
|
|
9265
9537
|
} = {}) {
|
|
9266
9538
|
return {
|
|
9267
|
-
relativeDirPath:
|
|
9539
|
+
relativeDirPath: join69(".codex", "skills")
|
|
9268
9540
|
};
|
|
9269
9541
|
}
|
|
9270
9542
|
getFrontmatter() {
|
|
@@ -9354,9 +9626,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9354
9626
|
});
|
|
9355
9627
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9356
9628
|
if (!result.success) {
|
|
9357
|
-
const skillDirPath =
|
|
9629
|
+
const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9358
9630
|
throw new Error(
|
|
9359
|
-
`Invalid frontmatter in ${
|
|
9631
|
+
`Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9360
9632
|
);
|
|
9361
9633
|
}
|
|
9362
9634
|
return new _CodexCliSkill({
|
|
@@ -9390,7 +9662,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
9390
9662
|
};
|
|
9391
9663
|
|
|
9392
9664
|
// src/features/skills/copilot-skill.ts
|
|
9393
|
-
import { join as
|
|
9665
|
+
import { join as join70 } from "path";
|
|
9394
9666
|
import { z as z31 } from "zod/mini";
|
|
9395
9667
|
var CopilotSkillFrontmatterSchema = z31.looseObject({
|
|
9396
9668
|
name: z31.string(),
|
|
@@ -9400,7 +9672,7 @@ var CopilotSkillFrontmatterSchema = z31.looseObject({
|
|
|
9400
9672
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
9401
9673
|
constructor({
|
|
9402
9674
|
baseDir = process.cwd(),
|
|
9403
|
-
relativeDirPath =
|
|
9675
|
+
relativeDirPath = join70(".github", "skills"),
|
|
9404
9676
|
dirName,
|
|
9405
9677
|
frontmatter,
|
|
9406
9678
|
body,
|
|
@@ -9432,7 +9704,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9432
9704
|
throw new Error("CopilotSkill does not support global mode.");
|
|
9433
9705
|
}
|
|
9434
9706
|
return {
|
|
9435
|
-
relativeDirPath:
|
|
9707
|
+
relativeDirPath: join70(".github", "skills")
|
|
9436
9708
|
};
|
|
9437
9709
|
}
|
|
9438
9710
|
getFrontmatter() {
|
|
@@ -9518,9 +9790,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9518
9790
|
});
|
|
9519
9791
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9520
9792
|
if (!result.success) {
|
|
9521
|
-
const skillDirPath =
|
|
9793
|
+
const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9522
9794
|
throw new Error(
|
|
9523
|
-
`Invalid frontmatter in ${
|
|
9795
|
+
`Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9524
9796
|
);
|
|
9525
9797
|
}
|
|
9526
9798
|
return new _CopilotSkill({
|
|
@@ -9555,7 +9827,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
9555
9827
|
};
|
|
9556
9828
|
|
|
9557
9829
|
// src/features/skills/cursor-skill.ts
|
|
9558
|
-
import { join as
|
|
9830
|
+
import { join as join71 } from "path";
|
|
9559
9831
|
import { z as z32 } from "zod/mini";
|
|
9560
9832
|
var CursorSkillFrontmatterSchema = z32.looseObject({
|
|
9561
9833
|
name: z32.string(),
|
|
@@ -9564,7 +9836,7 @@ var CursorSkillFrontmatterSchema = z32.looseObject({
|
|
|
9564
9836
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
9565
9837
|
constructor({
|
|
9566
9838
|
baseDir = process.cwd(),
|
|
9567
|
-
relativeDirPath =
|
|
9839
|
+
relativeDirPath = join71(".cursor", "skills"),
|
|
9568
9840
|
dirName,
|
|
9569
9841
|
frontmatter,
|
|
9570
9842
|
body,
|
|
@@ -9593,7 +9865,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9593
9865
|
}
|
|
9594
9866
|
static getSettablePaths(_options) {
|
|
9595
9867
|
return {
|
|
9596
|
-
relativeDirPath:
|
|
9868
|
+
relativeDirPath: join71(".cursor", "skills")
|
|
9597
9869
|
};
|
|
9598
9870
|
}
|
|
9599
9871
|
getFrontmatter() {
|
|
@@ -9673,9 +9945,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9673
9945
|
});
|
|
9674
9946
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9675
9947
|
if (!result.success) {
|
|
9676
|
-
const skillDirPath =
|
|
9948
|
+
const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9677
9949
|
throw new Error(
|
|
9678
|
-
`Invalid frontmatter in ${
|
|
9950
|
+
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9679
9951
|
);
|
|
9680
9952
|
}
|
|
9681
9953
|
return new _CursorSkill({
|
|
@@ -9709,17 +9981,18 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
9709
9981
|
}
|
|
9710
9982
|
};
|
|
9711
9983
|
|
|
9712
|
-
// src/features/skills/
|
|
9713
|
-
import { join as
|
|
9984
|
+
// src/features/skills/deepagents-skill.ts
|
|
9985
|
+
import { join as join72 } from "path";
|
|
9714
9986
|
import { z as z33 } from "zod/mini";
|
|
9715
|
-
var
|
|
9987
|
+
var DeepagentsSkillFrontmatterSchema = z33.looseObject({
|
|
9716
9988
|
name: z33.string(),
|
|
9717
|
-
description: z33.string()
|
|
9989
|
+
description: z33.string(),
|
|
9990
|
+
"allowed-tools": z33.optional(z33.array(z33.string()))
|
|
9718
9991
|
});
|
|
9719
|
-
var
|
|
9992
|
+
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
9720
9993
|
constructor({
|
|
9721
9994
|
baseDir = process.cwd(),
|
|
9722
|
-
relativeDirPath =
|
|
9995
|
+
relativeDirPath = join72(".deepagents", "skills"),
|
|
9723
9996
|
dirName,
|
|
9724
9997
|
frontmatter,
|
|
9725
9998
|
body,
|
|
@@ -9746,28 +10019,29 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9746
10019
|
}
|
|
9747
10020
|
}
|
|
9748
10021
|
}
|
|
9749
|
-
static getSettablePaths({
|
|
9750
|
-
global
|
|
9751
|
-
|
|
10022
|
+
static getSettablePaths(options) {
|
|
10023
|
+
if (options?.global) {
|
|
10024
|
+
throw new Error("DeepagentsSkill does not support global mode.");
|
|
10025
|
+
}
|
|
9752
10026
|
return {
|
|
9753
|
-
relativeDirPath:
|
|
10027
|
+
relativeDirPath: join72(".deepagents", "skills")
|
|
9754
10028
|
};
|
|
9755
10029
|
}
|
|
9756
10030
|
getFrontmatter() {
|
|
9757
|
-
const result =
|
|
10031
|
+
const result = DeepagentsSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
9758
10032
|
return result;
|
|
9759
10033
|
}
|
|
9760
10034
|
getBody() {
|
|
9761
10035
|
return this.mainFile?.body ?? "";
|
|
9762
10036
|
}
|
|
9763
10037
|
validate() {
|
|
9764
|
-
if (this.mainFile
|
|
10038
|
+
if (!this.mainFile) {
|
|
9765
10039
|
return {
|
|
9766
10040
|
success: false,
|
|
9767
10041
|
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
9768
10042
|
};
|
|
9769
10043
|
}
|
|
9770
|
-
const result =
|
|
10044
|
+
const result = DeepagentsSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
9771
10045
|
if (!result.success) {
|
|
9772
10046
|
return {
|
|
9773
10047
|
success: false,
|
|
@@ -9783,7 +10057,10 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9783
10057
|
const rulesyncFrontmatter = {
|
|
9784
10058
|
name: frontmatter.name,
|
|
9785
10059
|
description: frontmatter.description,
|
|
9786
|
-
targets: ["*"]
|
|
10060
|
+
targets: ["*"],
|
|
10061
|
+
...frontmatter["allowed-tools"] && {
|
|
10062
|
+
deepagents: { "allowed-tools": frontmatter["allowed-tools"] }
|
|
10063
|
+
}
|
|
9787
10064
|
};
|
|
9788
10065
|
return new RulesyncSkill({
|
|
9789
10066
|
baseDir: this.baseDir,
|
|
@@ -9802,17 +10079,18 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9802
10079
|
validate = true,
|
|
9803
10080
|
global = false
|
|
9804
10081
|
}) {
|
|
9805
|
-
const settablePaths =
|
|
10082
|
+
const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
|
|
9806
10083
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
9807
|
-
const
|
|
10084
|
+
const deepagentsFrontmatter = {
|
|
9808
10085
|
name: rulesyncFrontmatter.name,
|
|
9809
|
-
description: rulesyncFrontmatter.description
|
|
10086
|
+
description: rulesyncFrontmatter.description,
|
|
10087
|
+
"allowed-tools": rulesyncFrontmatter.deepagents?.["allowed-tools"]
|
|
9810
10088
|
};
|
|
9811
|
-
return new
|
|
10089
|
+
return new _DeepagentsSkill({
|
|
9812
10090
|
baseDir,
|
|
9813
10091
|
relativeDirPath: settablePaths.relativeDirPath,
|
|
9814
10092
|
dirName: rulesyncSkill.getDirName(),
|
|
9815
|
-
frontmatter:
|
|
10093
|
+
frontmatter: deepagentsFrontmatter,
|
|
9816
10094
|
body: rulesyncSkill.getBody(),
|
|
9817
10095
|
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
9818
10096
|
validate,
|
|
@@ -9821,21 +10099,21 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9821
10099
|
}
|
|
9822
10100
|
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
9823
10101
|
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
9824
|
-
return targets.includes("*") || targets.includes("
|
|
10102
|
+
return targets.includes("*") || targets.includes("deepagents");
|
|
9825
10103
|
}
|
|
9826
10104
|
static async fromDir(params) {
|
|
9827
10105
|
const loaded = await this.loadSkillDirContent({
|
|
9828
10106
|
...params,
|
|
9829
|
-
getSettablePaths:
|
|
10107
|
+
getSettablePaths: _DeepagentsSkill.getSettablePaths
|
|
9830
10108
|
});
|
|
9831
|
-
const result =
|
|
10109
|
+
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9832
10110
|
if (!result.success) {
|
|
9833
|
-
const skillDirPath =
|
|
10111
|
+
const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9834
10112
|
throw new Error(
|
|
9835
|
-
`Invalid frontmatter in ${
|
|
10113
|
+
`Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9836
10114
|
);
|
|
9837
10115
|
}
|
|
9838
|
-
return new
|
|
10116
|
+
return new _DeepagentsSkill({
|
|
9839
10117
|
baseDir: loaded.baseDir,
|
|
9840
10118
|
relativeDirPath: loaded.relativeDirPath,
|
|
9841
10119
|
dirName: loaded.dirName,
|
|
@@ -9852,8 +10130,8 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9852
10130
|
dirName,
|
|
9853
10131
|
global = false
|
|
9854
10132
|
}) {
|
|
9855
|
-
const settablePaths =
|
|
9856
|
-
return new
|
|
10133
|
+
const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
|
|
10134
|
+
return new _DeepagentsSkill({
|
|
9857
10135
|
baseDir,
|
|
9858
10136
|
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
9859
10137
|
dirName,
|
|
@@ -9866,17 +10144,17 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
9866
10144
|
}
|
|
9867
10145
|
};
|
|
9868
10146
|
|
|
9869
|
-
// src/features/skills/
|
|
9870
|
-
import { join as
|
|
10147
|
+
// src/features/skills/geminicli-skill.ts
|
|
10148
|
+
import { join as join73 } from "path";
|
|
9871
10149
|
import { z as z34 } from "zod/mini";
|
|
9872
|
-
var
|
|
10150
|
+
var GeminiCliSkillFrontmatterSchema = z34.looseObject({
|
|
9873
10151
|
name: z34.string(),
|
|
9874
10152
|
description: z34.string()
|
|
9875
10153
|
});
|
|
9876
|
-
var
|
|
10154
|
+
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
9877
10155
|
constructor({
|
|
9878
10156
|
baseDir = process.cwd(),
|
|
9879
|
-
relativeDirPath =
|
|
10157
|
+
relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
|
|
9880
10158
|
dirName,
|
|
9881
10159
|
frontmatter,
|
|
9882
10160
|
body,
|
|
@@ -9903,29 +10181,28 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9903
10181
|
}
|
|
9904
10182
|
}
|
|
9905
10183
|
}
|
|
9906
|
-
static getSettablePaths(
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
}
|
|
10184
|
+
static getSettablePaths({
|
|
10185
|
+
global: _global = false
|
|
10186
|
+
} = {}) {
|
|
9910
10187
|
return {
|
|
9911
|
-
relativeDirPath:
|
|
10188
|
+
relativeDirPath: join73(".gemini", "skills")
|
|
9912
10189
|
};
|
|
9913
10190
|
}
|
|
9914
10191
|
getFrontmatter() {
|
|
9915
|
-
const result =
|
|
10192
|
+
const result = GeminiCliSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
9916
10193
|
return result;
|
|
9917
10194
|
}
|
|
9918
10195
|
getBody() {
|
|
9919
10196
|
return this.mainFile?.body ?? "";
|
|
9920
10197
|
}
|
|
9921
10198
|
validate() {
|
|
9922
|
-
if (
|
|
10199
|
+
if (this.mainFile === void 0) {
|
|
9923
10200
|
return {
|
|
9924
10201
|
success: false,
|
|
9925
10202
|
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
9926
10203
|
};
|
|
9927
10204
|
}
|
|
9928
|
-
const result =
|
|
10205
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
9929
10206
|
if (!result.success) {
|
|
9930
10207
|
return {
|
|
9931
10208
|
success: false,
|
|
@@ -9934,14 +10211,6 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9934
10211
|
)
|
|
9935
10212
|
};
|
|
9936
10213
|
}
|
|
9937
|
-
if (result.data.name !== this.getDirName()) {
|
|
9938
|
-
return {
|
|
9939
|
-
success: false,
|
|
9940
|
-
error: new Error(
|
|
9941
|
-
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
9942
|
-
)
|
|
9943
|
-
};
|
|
9944
|
-
}
|
|
9945
10214
|
return { success: true, error: null };
|
|
9946
10215
|
}
|
|
9947
10216
|
toRulesyncSkill() {
|
|
@@ -9963,21 +10232,22 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9963
10232
|
});
|
|
9964
10233
|
}
|
|
9965
10234
|
static fromRulesyncSkill({
|
|
10235
|
+
baseDir = process.cwd(),
|
|
9966
10236
|
rulesyncSkill,
|
|
9967
10237
|
validate = true,
|
|
9968
10238
|
global = false
|
|
9969
10239
|
}) {
|
|
9970
|
-
const settablePaths =
|
|
10240
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
9971
10241
|
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
9972
|
-
const
|
|
10242
|
+
const geminiCliFrontmatter = {
|
|
9973
10243
|
name: rulesyncFrontmatter.name,
|
|
9974
10244
|
description: rulesyncFrontmatter.description
|
|
9975
10245
|
};
|
|
9976
|
-
return new
|
|
9977
|
-
baseDir
|
|
10246
|
+
return new _GeminiCliSkill({
|
|
10247
|
+
baseDir,
|
|
9978
10248
|
relativeDirPath: settablePaths.relativeDirPath,
|
|
9979
|
-
dirName:
|
|
9980
|
-
frontmatter:
|
|
10249
|
+
dirName: rulesyncSkill.getDirName(),
|
|
10250
|
+
frontmatter: geminiCliFrontmatter,
|
|
9981
10251
|
body: rulesyncSkill.getBody(),
|
|
9982
10252
|
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
9983
10253
|
validate,
|
|
@@ -9986,32 +10256,21 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
9986
10256
|
}
|
|
9987
10257
|
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
9988
10258
|
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
9989
|
-
return targets.includes("*") || targets.includes("
|
|
10259
|
+
return targets.includes("*") || targets.includes("geminicli");
|
|
9990
10260
|
}
|
|
9991
10261
|
static async fromDir(params) {
|
|
9992
10262
|
const loaded = await this.loadSkillDirContent({
|
|
9993
10263
|
...params,
|
|
9994
|
-
getSettablePaths:
|
|
10264
|
+
getSettablePaths: _GeminiCliSkill.getSettablePaths
|
|
9995
10265
|
});
|
|
9996
|
-
const result =
|
|
10266
|
+
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9997
10267
|
if (!result.success) {
|
|
9998
|
-
const skillDirPath =
|
|
9999
|
-
throw new Error(
|
|
10000
|
-
`Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10001
|
-
);
|
|
10002
|
-
}
|
|
10003
|
-
if (result.data.name !== loaded.dirName) {
|
|
10004
|
-
const skillFilePath = join71(
|
|
10005
|
-
loaded.baseDir,
|
|
10006
|
-
loaded.relativeDirPath,
|
|
10007
|
-
loaded.dirName,
|
|
10008
|
-
SKILL_FILE_NAME
|
|
10009
|
-
);
|
|
10268
|
+
const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10010
10269
|
throw new Error(
|
|
10011
|
-
`
|
|
10270
|
+
`Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10012
10271
|
);
|
|
10013
10272
|
}
|
|
10014
|
-
return new
|
|
10273
|
+
return new _GeminiCliSkill({
|
|
10015
10274
|
baseDir: loaded.baseDir,
|
|
10016
10275
|
relativeDirPath: loaded.relativeDirPath,
|
|
10017
10276
|
dirName: loaded.dirName,
|
|
@@ -10028,8 +10287,8 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
10028
10287
|
dirName,
|
|
10029
10288
|
global = false
|
|
10030
10289
|
}) {
|
|
10031
|
-
const settablePaths =
|
|
10032
|
-
return new
|
|
10290
|
+
const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
|
|
10291
|
+
return new _GeminiCliSkill({
|
|
10033
10292
|
baseDir,
|
|
10034
10293
|
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
10035
10294
|
dirName,
|
|
@@ -10042,17 +10301,193 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
10042
10301
|
}
|
|
10043
10302
|
};
|
|
10044
10303
|
|
|
10045
|
-
// src/features/skills/
|
|
10046
|
-
import { join as
|
|
10304
|
+
// src/features/skills/junie-skill.ts
|
|
10305
|
+
import { join as join74 } from "path";
|
|
10047
10306
|
import { z as z35 } from "zod/mini";
|
|
10048
|
-
var
|
|
10307
|
+
var JunieSkillFrontmatterSchema = z35.looseObject({
|
|
10049
10308
|
name: z35.string(),
|
|
10050
10309
|
description: z35.string()
|
|
10051
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(
|
|
10446
|
+
`Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
|
|
10447
|
+
);
|
|
10448
|
+
}
|
|
10449
|
+
return new _JunieSkill({
|
|
10450
|
+
baseDir: loaded.baseDir,
|
|
10451
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
10452
|
+
dirName: loaded.dirName,
|
|
10453
|
+
frontmatter: result.data,
|
|
10454
|
+
body: loaded.body,
|
|
10455
|
+
otherFiles: loaded.otherFiles,
|
|
10456
|
+
validate: true,
|
|
10457
|
+
global: loaded.global
|
|
10458
|
+
});
|
|
10459
|
+
}
|
|
10460
|
+
static forDeletion({
|
|
10461
|
+
baseDir = process.cwd(),
|
|
10462
|
+
relativeDirPath,
|
|
10463
|
+
dirName,
|
|
10464
|
+
global = false
|
|
10465
|
+
}) {
|
|
10466
|
+
const settablePaths = _JunieSkill.getSettablePaths({ global });
|
|
10467
|
+
return new _JunieSkill({
|
|
10468
|
+
baseDir,
|
|
10469
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
10470
|
+
dirName,
|
|
10471
|
+
frontmatter: { name: "", description: "" },
|
|
10472
|
+
body: "",
|
|
10473
|
+
otherFiles: [],
|
|
10474
|
+
validate: false,
|
|
10475
|
+
global
|
|
10476
|
+
});
|
|
10477
|
+
}
|
|
10478
|
+
};
|
|
10479
|
+
|
|
10480
|
+
// src/features/skills/kilo-skill.ts
|
|
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()
|
|
10486
|
+
});
|
|
10052
10487
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
10053
10488
|
constructor({
|
|
10054
10489
|
baseDir = process.cwd(),
|
|
10055
|
-
relativeDirPath =
|
|
10490
|
+
relativeDirPath = join75(".kilocode", "skills"),
|
|
10056
10491
|
dirName,
|
|
10057
10492
|
frontmatter,
|
|
10058
10493
|
body,
|
|
@@ -10083,7 +10518,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10083
10518
|
global: _global = false
|
|
10084
10519
|
} = {}) {
|
|
10085
10520
|
return {
|
|
10086
|
-
relativeDirPath:
|
|
10521
|
+
relativeDirPath: join75(".kilocode", "skills")
|
|
10087
10522
|
};
|
|
10088
10523
|
}
|
|
10089
10524
|
getFrontmatter() {
|
|
@@ -10171,13 +10606,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10171
10606
|
});
|
|
10172
10607
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10173
10608
|
if (!result.success) {
|
|
10174
|
-
const skillDirPath =
|
|
10609
|
+
const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10175
10610
|
throw new Error(
|
|
10176
|
-
`Invalid frontmatter in ${
|
|
10611
|
+
`Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10177
10612
|
);
|
|
10178
10613
|
}
|
|
10179
10614
|
if (result.data.name !== loaded.dirName) {
|
|
10180
|
-
const skillFilePath =
|
|
10615
|
+
const skillFilePath = join75(
|
|
10181
10616
|
loaded.baseDir,
|
|
10182
10617
|
loaded.relativeDirPath,
|
|
10183
10618
|
loaded.dirName,
|
|
@@ -10218,16 +10653,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
10218
10653
|
};
|
|
10219
10654
|
|
|
10220
10655
|
// src/features/skills/kiro-skill.ts
|
|
10221
|
-
import { join as
|
|
10222
|
-
import { z as
|
|
10223
|
-
var KiroSkillFrontmatterSchema =
|
|
10224
|
-
name:
|
|
10225
|
-
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()
|
|
10226
10661
|
});
|
|
10227
10662
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
10228
10663
|
constructor({
|
|
10229
10664
|
baseDir = process.cwd(),
|
|
10230
|
-
relativeDirPath =
|
|
10665
|
+
relativeDirPath = join76(".kiro", "skills"),
|
|
10231
10666
|
dirName,
|
|
10232
10667
|
frontmatter,
|
|
10233
10668
|
body,
|
|
@@ -10259,7 +10694,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10259
10694
|
throw new Error("KiroSkill does not support global mode.");
|
|
10260
10695
|
}
|
|
10261
10696
|
return {
|
|
10262
|
-
relativeDirPath:
|
|
10697
|
+
relativeDirPath: join76(".kiro", "skills")
|
|
10263
10698
|
};
|
|
10264
10699
|
}
|
|
10265
10700
|
getFrontmatter() {
|
|
@@ -10347,13 +10782,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10347
10782
|
});
|
|
10348
10783
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10349
10784
|
if (!result.success) {
|
|
10350
|
-
const skillDirPath =
|
|
10785
|
+
const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10351
10786
|
throw new Error(
|
|
10352
|
-
`Invalid frontmatter in ${
|
|
10787
|
+
`Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10353
10788
|
);
|
|
10354
10789
|
}
|
|
10355
10790
|
if (result.data.name !== loaded.dirName) {
|
|
10356
|
-
const skillFilePath =
|
|
10791
|
+
const skillFilePath = join76(
|
|
10357
10792
|
loaded.baseDir,
|
|
10358
10793
|
loaded.relativeDirPath,
|
|
10359
10794
|
loaded.dirName,
|
|
@@ -10395,17 +10830,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
10395
10830
|
};
|
|
10396
10831
|
|
|
10397
10832
|
// src/features/skills/opencode-skill.ts
|
|
10398
|
-
import { join as
|
|
10399
|
-
import { z as
|
|
10400
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
10401
|
-
name:
|
|
10402
|
-
description:
|
|
10403
|
-
"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()))
|
|
10404
10839
|
});
|
|
10405
10840
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
10406
10841
|
constructor({
|
|
10407
10842
|
baseDir = process.cwd(),
|
|
10408
|
-
relativeDirPath =
|
|
10843
|
+
relativeDirPath = join77(".opencode", "skill"),
|
|
10409
10844
|
dirName,
|
|
10410
10845
|
frontmatter,
|
|
10411
10846
|
body,
|
|
@@ -10434,7 +10869,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10434
10869
|
}
|
|
10435
10870
|
static getSettablePaths({ global = false } = {}) {
|
|
10436
10871
|
return {
|
|
10437
|
-
relativeDirPath: global ?
|
|
10872
|
+
relativeDirPath: global ? join77(".config", "opencode", "skill") : join77(".opencode", "skill")
|
|
10438
10873
|
};
|
|
10439
10874
|
}
|
|
10440
10875
|
getFrontmatter() {
|
|
@@ -10520,9 +10955,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10520
10955
|
});
|
|
10521
10956
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10522
10957
|
if (!result.success) {
|
|
10523
|
-
const skillDirPath =
|
|
10958
|
+
const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10524
10959
|
throw new Error(
|
|
10525
|
-
`Invalid frontmatter in ${
|
|
10960
|
+
`Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10526
10961
|
);
|
|
10527
10962
|
}
|
|
10528
10963
|
return new _OpenCodeSkill({
|
|
@@ -10556,16 +10991,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
10556
10991
|
};
|
|
10557
10992
|
|
|
10558
10993
|
// src/features/skills/replit-skill.ts
|
|
10559
|
-
import { join as
|
|
10560
|
-
import { z as
|
|
10561
|
-
var ReplitSkillFrontmatterSchema =
|
|
10562
|
-
name:
|
|
10563
|
-
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()
|
|
10564
10999
|
});
|
|
10565
11000
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
10566
11001
|
constructor({
|
|
10567
11002
|
baseDir = process.cwd(),
|
|
10568
|
-
relativeDirPath =
|
|
11003
|
+
relativeDirPath = join78(".agents", "skills"),
|
|
10569
11004
|
dirName,
|
|
10570
11005
|
frontmatter,
|
|
10571
11006
|
body,
|
|
@@ -10597,7 +11032,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10597
11032
|
throw new Error("ReplitSkill does not support global mode.");
|
|
10598
11033
|
}
|
|
10599
11034
|
return {
|
|
10600
|
-
relativeDirPath:
|
|
11035
|
+
relativeDirPath: join78(".agents", "skills")
|
|
10601
11036
|
};
|
|
10602
11037
|
}
|
|
10603
11038
|
getFrontmatter() {
|
|
@@ -10677,9 +11112,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10677
11112
|
});
|
|
10678
11113
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10679
11114
|
if (!result.success) {
|
|
10680
|
-
const skillDirPath =
|
|
11115
|
+
const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10681
11116
|
throw new Error(
|
|
10682
|
-
`Invalid frontmatter in ${
|
|
11117
|
+
`Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10683
11118
|
);
|
|
10684
11119
|
}
|
|
10685
11120
|
return new _ReplitSkill({
|
|
@@ -10714,16 +11149,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
10714
11149
|
};
|
|
10715
11150
|
|
|
10716
11151
|
// src/features/skills/roo-skill.ts
|
|
10717
|
-
import { join as
|
|
10718
|
-
import { z as
|
|
10719
|
-
var RooSkillFrontmatterSchema =
|
|
10720
|
-
name:
|
|
10721
|
-
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()
|
|
10722
11157
|
});
|
|
10723
11158
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
10724
11159
|
constructor({
|
|
10725
11160
|
baseDir = process.cwd(),
|
|
10726
|
-
relativeDirPath =
|
|
11161
|
+
relativeDirPath = join79(".roo", "skills"),
|
|
10727
11162
|
dirName,
|
|
10728
11163
|
frontmatter,
|
|
10729
11164
|
body,
|
|
@@ -10754,7 +11189,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10754
11189
|
global: _global = false
|
|
10755
11190
|
} = {}) {
|
|
10756
11191
|
return {
|
|
10757
|
-
relativeDirPath:
|
|
11192
|
+
relativeDirPath: join79(".roo", "skills")
|
|
10758
11193
|
};
|
|
10759
11194
|
}
|
|
10760
11195
|
getFrontmatter() {
|
|
@@ -10842,13 +11277,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10842
11277
|
});
|
|
10843
11278
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10844
11279
|
if (!result.success) {
|
|
10845
|
-
const skillDirPath =
|
|
11280
|
+
const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10846
11281
|
throw new Error(
|
|
10847
|
-
`Invalid frontmatter in ${
|
|
11282
|
+
`Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10848
11283
|
);
|
|
10849
11284
|
}
|
|
10850
11285
|
if (result.data.name !== loaded.dirName) {
|
|
10851
|
-
const skillFilePath =
|
|
11286
|
+
const skillFilePath = join79(
|
|
10852
11287
|
loaded.baseDir,
|
|
10853
11288
|
loaded.relativeDirPath,
|
|
10854
11289
|
loaded.dirName,
|
|
@@ -10889,14 +11324,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
10889
11324
|
};
|
|
10890
11325
|
|
|
10891
11326
|
// src/features/skills/skills-utils.ts
|
|
10892
|
-
import { basename as basename4, join as
|
|
11327
|
+
import { basename as basename4, join as join80 } from "path";
|
|
10893
11328
|
async function getLocalSkillDirNames(baseDir) {
|
|
10894
|
-
const skillsDir =
|
|
11329
|
+
const skillsDir = join80(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
10895
11330
|
const names = /* @__PURE__ */ new Set();
|
|
10896
11331
|
if (!await directoryExists(skillsDir)) {
|
|
10897
11332
|
return names;
|
|
10898
11333
|
}
|
|
10899
|
-
const dirPaths = await findFilesByGlobs(
|
|
11334
|
+
const dirPaths = await findFilesByGlobs(join80(skillsDir, "*"), { type: "dir" });
|
|
10900
11335
|
for (const dirPath of dirPaths) {
|
|
10901
11336
|
const name = basename4(dirPath);
|
|
10902
11337
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -10916,6 +11351,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10916
11351
|
"codexcli",
|
|
10917
11352
|
"copilot",
|
|
10918
11353
|
"cursor",
|
|
11354
|
+
"deepagents",
|
|
10919
11355
|
"factorydroid",
|
|
10920
11356
|
"geminicli",
|
|
10921
11357
|
"junie",
|
|
@@ -10925,7 +11361,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
10925
11361
|
"replit",
|
|
10926
11362
|
"roo"
|
|
10927
11363
|
];
|
|
10928
|
-
var SkillsProcessorToolTargetSchema =
|
|
11364
|
+
var SkillsProcessorToolTargetSchema = z41.enum(skillsProcessorToolTargetTuple);
|
|
10929
11365
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
10930
11366
|
[
|
|
10931
11367
|
"agentsmd",
|
|
@@ -10990,6 +11426,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
10990
11426
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
10991
11427
|
}
|
|
10992
11428
|
],
|
|
11429
|
+
[
|
|
11430
|
+
"deepagents",
|
|
11431
|
+
{
|
|
11432
|
+
class: DeepagentsSkill,
|
|
11433
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: false }
|
|
11434
|
+
}
|
|
11435
|
+
],
|
|
10993
11436
|
[
|
|
10994
11437
|
"factorydroid",
|
|
10995
11438
|
{
|
|
@@ -11135,10 +11578,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11135
11578
|
)
|
|
11136
11579
|
);
|
|
11137
11580
|
const localSkillNames = new Set(localDirNames);
|
|
11138
|
-
const curatedDirPath =
|
|
11581
|
+
const curatedDirPath = join81(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
11139
11582
|
let curatedSkills = [];
|
|
11140
11583
|
if (await directoryExists(curatedDirPath)) {
|
|
11141
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
11584
|
+
const curatedDirPaths = await findFilesByGlobs(join81(curatedDirPath, "*"), { type: "dir" });
|
|
11142
11585
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
11143
11586
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
11144
11587
|
if (localSkillNames.has(name)) {
|
|
@@ -11172,8 +11615,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11172
11615
|
async loadToolDirs() {
|
|
11173
11616
|
const factory = this.getFactory(this.toolTarget);
|
|
11174
11617
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11175
|
-
const skillsDirPath =
|
|
11176
|
-
const dirPaths = await findFilesByGlobs(
|
|
11618
|
+
const skillsDirPath = join81(this.baseDir, paths.relativeDirPath);
|
|
11619
|
+
const dirPaths = await findFilesByGlobs(join81(skillsDirPath, "*"), { type: "dir" });
|
|
11177
11620
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
11178
11621
|
const toolSkills = await Promise.all(
|
|
11179
11622
|
dirNames.map(
|
|
@@ -11190,8 +11633,8 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11190
11633
|
async loadToolDirsToDelete() {
|
|
11191
11634
|
const factory = this.getFactory(this.toolTarget);
|
|
11192
11635
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11193
|
-
const skillsDirPath =
|
|
11194
|
-
const dirPaths = await findFilesByGlobs(
|
|
11636
|
+
const skillsDirPath = join81(this.baseDir, paths.relativeDirPath);
|
|
11637
|
+
const dirPaths = await findFilesByGlobs(join81(skillsDirPath, "*"), { type: "dir" });
|
|
11195
11638
|
const dirNames = dirPaths.map((path3) => basename5(path3));
|
|
11196
11639
|
const toolSkills = dirNames.map(
|
|
11197
11640
|
(dirName) => factory.class.forDeletion({
|
|
@@ -11253,11 +11696,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
11253
11696
|
};
|
|
11254
11697
|
|
|
11255
11698
|
// src/features/subagents/agentsmd-subagent.ts
|
|
11256
|
-
import { join as
|
|
11699
|
+
import { join as join83 } from "path";
|
|
11257
11700
|
|
|
11258
11701
|
// src/features/subagents/simulated-subagent.ts
|
|
11259
|
-
import { basename as basename6, join as
|
|
11260
|
-
import { z as
|
|
11702
|
+
import { basename as basename6, join as join82 } from "path";
|
|
11703
|
+
import { z as z42 } from "zod/mini";
|
|
11261
11704
|
|
|
11262
11705
|
// src/features/subagents/tool-subagent.ts
|
|
11263
11706
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -11309,9 +11752,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
11309
11752
|
};
|
|
11310
11753
|
|
|
11311
11754
|
// src/features/subagents/simulated-subagent.ts
|
|
11312
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
11313
|
-
name:
|
|
11314
|
-
description:
|
|
11755
|
+
var SimulatedSubagentFrontmatterSchema = z42.object({
|
|
11756
|
+
name: z42.string(),
|
|
11757
|
+
description: z42.optional(z42.string())
|
|
11315
11758
|
});
|
|
11316
11759
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
11317
11760
|
frontmatter;
|
|
@@ -11321,7 +11764,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11321
11764
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11322
11765
|
if (!result.success) {
|
|
11323
11766
|
throw new Error(
|
|
11324
|
-
`Invalid frontmatter in ${
|
|
11767
|
+
`Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11325
11768
|
);
|
|
11326
11769
|
}
|
|
11327
11770
|
}
|
|
@@ -11372,7 +11815,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11372
11815
|
return {
|
|
11373
11816
|
success: false,
|
|
11374
11817
|
error: new Error(
|
|
11375
|
-
`Invalid frontmatter in ${
|
|
11818
|
+
`Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11376
11819
|
)
|
|
11377
11820
|
};
|
|
11378
11821
|
}
|
|
@@ -11382,7 +11825,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11382
11825
|
relativeFilePath,
|
|
11383
11826
|
validate = true
|
|
11384
11827
|
}) {
|
|
11385
|
-
const filePath =
|
|
11828
|
+
const filePath = join82(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
11386
11829
|
const fileContent = await readFileContent(filePath);
|
|
11387
11830
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11388
11831
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11418,7 +11861,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
11418
11861
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
11419
11862
|
static getSettablePaths() {
|
|
11420
11863
|
return {
|
|
11421
|
-
relativeDirPath:
|
|
11864
|
+
relativeDirPath: join83(".agents", "subagents")
|
|
11422
11865
|
};
|
|
11423
11866
|
}
|
|
11424
11867
|
static async fromFile(params) {
|
|
@@ -11441,11 +11884,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
11441
11884
|
};
|
|
11442
11885
|
|
|
11443
11886
|
// src/features/subagents/factorydroid-subagent.ts
|
|
11444
|
-
import { join as
|
|
11887
|
+
import { join as join84 } from "path";
|
|
11445
11888
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
11446
11889
|
static getSettablePaths(_options) {
|
|
11447
11890
|
return {
|
|
11448
|
-
relativeDirPath:
|
|
11891
|
+
relativeDirPath: join84(".factory", "droids")
|
|
11449
11892
|
};
|
|
11450
11893
|
}
|
|
11451
11894
|
static async fromFile(params) {
|
|
@@ -11468,11 +11911,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
11468
11911
|
};
|
|
11469
11912
|
|
|
11470
11913
|
// src/features/subagents/geminicli-subagent.ts
|
|
11471
|
-
import { join as
|
|
11914
|
+
import { join as join85 } from "path";
|
|
11472
11915
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
11473
11916
|
static getSettablePaths() {
|
|
11474
11917
|
return {
|
|
11475
|
-
relativeDirPath:
|
|
11918
|
+
relativeDirPath: join85(".gemini", "subagents")
|
|
11476
11919
|
};
|
|
11477
11920
|
}
|
|
11478
11921
|
static async fromFile(params) {
|
|
@@ -11495,11 +11938,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
11495
11938
|
};
|
|
11496
11939
|
|
|
11497
11940
|
// src/features/subagents/roo-subagent.ts
|
|
11498
|
-
import { join as
|
|
11941
|
+
import { join as join86 } from "path";
|
|
11499
11942
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
11500
11943
|
static getSettablePaths() {
|
|
11501
11944
|
return {
|
|
11502
|
-
relativeDirPath:
|
|
11945
|
+
relativeDirPath: join86(".roo", "subagents")
|
|
11503
11946
|
};
|
|
11504
11947
|
}
|
|
11505
11948
|
static async fromFile(params) {
|
|
@@ -11522,20 +11965,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
11522
11965
|
};
|
|
11523
11966
|
|
|
11524
11967
|
// src/features/subagents/subagents-processor.ts
|
|
11525
|
-
import { basename as basename9, join as
|
|
11526
|
-
import { z as
|
|
11968
|
+
import { basename as basename9, join as join96 } from "path";
|
|
11969
|
+
import { z as z52 } from "zod/mini";
|
|
11527
11970
|
|
|
11528
11971
|
// src/features/subagents/claudecode-subagent.ts
|
|
11529
|
-
import { join as
|
|
11530
|
-
import { z as
|
|
11972
|
+
import { join as join88 } from "path";
|
|
11973
|
+
import { z as z44 } from "zod/mini";
|
|
11531
11974
|
|
|
11532
11975
|
// src/features/subagents/rulesync-subagent.ts
|
|
11533
|
-
import { basename as basename7, join as
|
|
11534
|
-
import { z as
|
|
11535
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
11536
|
-
targets:
|
|
11537
|
-
name:
|
|
11538
|
-
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())
|
|
11539
11982
|
});
|
|
11540
11983
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
11541
11984
|
frontmatter;
|
|
@@ -11544,7 +11987,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11544
11987
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11545
11988
|
if (!parseResult.success && rest.validate !== false) {
|
|
11546
11989
|
throw new Error(
|
|
11547
|
-
`Invalid frontmatter in ${
|
|
11990
|
+
`Invalid frontmatter in ${join87(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11548
11991
|
);
|
|
11549
11992
|
}
|
|
11550
11993
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -11577,7 +12020,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11577
12020
|
return {
|
|
11578
12021
|
success: false,
|
|
11579
12022
|
error: new Error(
|
|
11580
|
-
`Invalid frontmatter in ${
|
|
12023
|
+
`Invalid frontmatter in ${join87(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11581
12024
|
)
|
|
11582
12025
|
};
|
|
11583
12026
|
}
|
|
@@ -11585,7 +12028,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11585
12028
|
static async fromFile({
|
|
11586
12029
|
relativeFilePath
|
|
11587
12030
|
}) {
|
|
11588
|
-
const filePath =
|
|
12031
|
+
const filePath = join87(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
11589
12032
|
const fileContent = await readFileContent(filePath);
|
|
11590
12033
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11591
12034
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11604,13 +12047,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
11604
12047
|
};
|
|
11605
12048
|
|
|
11606
12049
|
// src/features/subagents/claudecode-subagent.ts
|
|
11607
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
11608
|
-
name:
|
|
11609
|
-
description:
|
|
11610
|
-
model:
|
|
11611
|
-
tools:
|
|
11612
|
-
permissionMode:
|
|
11613
|
-
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())]))
|
|
11614
12057
|
});
|
|
11615
12058
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
11616
12059
|
frontmatter;
|
|
@@ -11620,7 +12063,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11620
12063
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11621
12064
|
if (!result.success) {
|
|
11622
12065
|
throw new Error(
|
|
11623
|
-
`Invalid frontmatter in ${
|
|
12066
|
+
`Invalid frontmatter in ${join88(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11624
12067
|
);
|
|
11625
12068
|
}
|
|
11626
12069
|
}
|
|
@@ -11632,7 +12075,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11632
12075
|
}
|
|
11633
12076
|
static getSettablePaths(_options = {}) {
|
|
11634
12077
|
return {
|
|
11635
|
-
relativeDirPath:
|
|
12078
|
+
relativeDirPath: join88(".claude", "agents")
|
|
11636
12079
|
};
|
|
11637
12080
|
}
|
|
11638
12081
|
getFrontmatter() {
|
|
@@ -11711,7 +12154,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11711
12154
|
return {
|
|
11712
12155
|
success: false,
|
|
11713
12156
|
error: new Error(
|
|
11714
|
-
`Invalid frontmatter in ${
|
|
12157
|
+
`Invalid frontmatter in ${join88(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11715
12158
|
)
|
|
11716
12159
|
};
|
|
11717
12160
|
}
|
|
@@ -11729,7 +12172,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11729
12172
|
global = false
|
|
11730
12173
|
}) {
|
|
11731
12174
|
const paths = this.getSettablePaths({ global });
|
|
11732
|
-
const filePath =
|
|
12175
|
+
const filePath = join88(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11733
12176
|
const fileContent = await readFileContent(filePath);
|
|
11734
12177
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11735
12178
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11764,16 +12207,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
11764
12207
|
};
|
|
11765
12208
|
|
|
11766
12209
|
// src/features/subagents/codexcli-subagent.ts
|
|
11767
|
-
import { join as
|
|
12210
|
+
import { join as join89 } from "path";
|
|
11768
12211
|
import * as smolToml2 from "smol-toml";
|
|
11769
|
-
import { z as
|
|
11770
|
-
var CodexCliSubagentTomlSchema =
|
|
11771
|
-
name:
|
|
11772
|
-
description:
|
|
11773
|
-
developer_instructions:
|
|
11774
|
-
model:
|
|
11775
|
-
model_reasoning_effort:
|
|
11776
|
-
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())
|
|
11777
12220
|
});
|
|
11778
12221
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
11779
12222
|
body;
|
|
@@ -11784,7 +12227,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11784
12227
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
11785
12228
|
} catch (error) {
|
|
11786
12229
|
throw new Error(
|
|
11787
|
-
`Invalid TOML in ${
|
|
12230
|
+
`Invalid TOML in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11788
12231
|
{ cause: error }
|
|
11789
12232
|
);
|
|
11790
12233
|
}
|
|
@@ -11796,7 +12239,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11796
12239
|
}
|
|
11797
12240
|
static getSettablePaths(_options = {}) {
|
|
11798
12241
|
return {
|
|
11799
|
-
relativeDirPath:
|
|
12242
|
+
relativeDirPath: join89(".codex", "agents")
|
|
11800
12243
|
};
|
|
11801
12244
|
}
|
|
11802
12245
|
getBody() {
|
|
@@ -11808,7 +12251,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11808
12251
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
11809
12252
|
} catch (error) {
|
|
11810
12253
|
throw new Error(
|
|
11811
|
-
`Failed to parse TOML in ${
|
|
12254
|
+
`Failed to parse TOML in ${join89(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11812
12255
|
{ cause: error }
|
|
11813
12256
|
);
|
|
11814
12257
|
}
|
|
@@ -11889,7 +12332,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11889
12332
|
global = false
|
|
11890
12333
|
}) {
|
|
11891
12334
|
const paths = this.getSettablePaths({ global });
|
|
11892
|
-
const filePath =
|
|
12335
|
+
const filePath = join89(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11893
12336
|
const fileContent = await readFileContent(filePath);
|
|
11894
12337
|
const subagent = new _CodexCliSubagent({
|
|
11895
12338
|
baseDir,
|
|
@@ -11927,13 +12370,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
11927
12370
|
};
|
|
11928
12371
|
|
|
11929
12372
|
// src/features/subagents/copilot-subagent.ts
|
|
11930
|
-
import { join as
|
|
11931
|
-
import { z as
|
|
12373
|
+
import { join as join90 } from "path";
|
|
12374
|
+
import { z as z46 } from "zod/mini";
|
|
11932
12375
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
11933
|
-
var CopilotSubagentFrontmatterSchema =
|
|
11934
|
-
name:
|
|
11935
|
-
description:
|
|
11936
|
-
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())]))
|
|
11937
12380
|
});
|
|
11938
12381
|
var normalizeTools = (tools) => {
|
|
11939
12382
|
if (!tools) {
|
|
@@ -11953,7 +12396,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11953
12396
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11954
12397
|
if (!result.success) {
|
|
11955
12398
|
throw new Error(
|
|
11956
|
-
`Invalid frontmatter in ${
|
|
12399
|
+
`Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11957
12400
|
);
|
|
11958
12401
|
}
|
|
11959
12402
|
}
|
|
@@ -11965,7 +12408,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11965
12408
|
}
|
|
11966
12409
|
static getSettablePaths(_options = {}) {
|
|
11967
12410
|
return {
|
|
11968
|
-
relativeDirPath:
|
|
12411
|
+
relativeDirPath: join90(".github", "agents")
|
|
11969
12412
|
};
|
|
11970
12413
|
}
|
|
11971
12414
|
getFrontmatter() {
|
|
@@ -12011,15 +12454,162 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12011
12454
|
const copilotFrontmatter = {
|
|
12012
12455
|
name: rulesyncFrontmatter.name,
|
|
12013
12456
|
description: rulesyncFrontmatter.description,
|
|
12014
|
-
...copilotSection,
|
|
12015
|
-
...mergedTools.length > 0 && { tools: mergedTools }
|
|
12457
|
+
...copilotSection,
|
|
12458
|
+
...mergedTools.length > 0 && { tools: mergedTools }
|
|
12459
|
+
};
|
|
12460
|
+
const body = rulesyncSubagent.getBody();
|
|
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
|
|
12016
12606
|
};
|
|
12017
12607
|
const body = rulesyncSubagent.getBody();
|
|
12018
|
-
const fileContent = stringifyFrontmatter(body,
|
|
12608
|
+
const fileContent = stringifyFrontmatter(body, cursorFrontmatter, { avoidBlockScalars: true });
|
|
12019
12609
|
const paths = this.getSettablePaths({ global });
|
|
12020
|
-
return new
|
|
12610
|
+
return new _CursorSubagent({
|
|
12021
12611
|
baseDir,
|
|
12022
|
-
frontmatter:
|
|
12612
|
+
frontmatter: cursorFrontmatter,
|
|
12023
12613
|
body,
|
|
12024
12614
|
relativeDirPath: paths.relativeDirPath,
|
|
12025
12615
|
relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
|
|
@@ -12032,14 +12622,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12032
12622
|
if (!this.frontmatter) {
|
|
12033
12623
|
return { success: true, error: null };
|
|
12034
12624
|
}
|
|
12035
|
-
const result =
|
|
12625
|
+
const result = CursorSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
12036
12626
|
if (result.success) {
|
|
12037
12627
|
return { success: true, error: null };
|
|
12038
12628
|
} else {
|
|
12039
12629
|
return {
|
|
12040
12630
|
success: false,
|
|
12041
12631
|
error: new Error(
|
|
12042
|
-
`Invalid frontmatter in ${
|
|
12632
|
+
`Invalid frontmatter in ${join91(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12043
12633
|
)
|
|
12044
12634
|
};
|
|
12045
12635
|
}
|
|
@@ -12047,7 +12637,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12047
12637
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
12048
12638
|
return this.isTargetedByRulesyncSubagentDefault({
|
|
12049
12639
|
rulesyncSubagent,
|
|
12050
|
-
toolTarget: "
|
|
12640
|
+
toolTarget: "cursor"
|
|
12051
12641
|
});
|
|
12052
12642
|
}
|
|
12053
12643
|
static async fromFile({
|
|
@@ -12057,14 +12647,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12057
12647
|
global = false
|
|
12058
12648
|
}) {
|
|
12059
12649
|
const paths = this.getSettablePaths({ global });
|
|
12060
|
-
const filePath =
|
|
12650
|
+
const filePath = join91(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12061
12651
|
const fileContent = await readFileContent(filePath);
|
|
12062
12652
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12063
|
-
const result =
|
|
12653
|
+
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12064
12654
|
if (!result.success) {
|
|
12065
12655
|
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
12066
12656
|
}
|
|
12067
|
-
return new
|
|
12657
|
+
return new _CursorSubagent({
|
|
12068
12658
|
baseDir,
|
|
12069
12659
|
relativeDirPath: paths.relativeDirPath,
|
|
12070
12660
|
relativeFilePath,
|
|
@@ -12080,7 +12670,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12080
12670
|
relativeDirPath,
|
|
12081
12671
|
relativeFilePath
|
|
12082
12672
|
}) {
|
|
12083
|
-
return new
|
|
12673
|
+
return new _CursorSubagent({
|
|
12084
12674
|
baseDir,
|
|
12085
12675
|
relativeDirPath,
|
|
12086
12676
|
relativeFilePath,
|
|
@@ -12092,34 +12682,33 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
12092
12682
|
}
|
|
12093
12683
|
};
|
|
12094
12684
|
|
|
12095
|
-
// src/features/subagents/
|
|
12096
|
-
import { join as
|
|
12097
|
-
import { z as
|
|
12098
|
-
var
|
|
12099
|
-
name:
|
|
12100
|
-
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())
|
|
12101
12692
|
});
|
|
12102
|
-
var
|
|
12693
|
+
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
12103
12694
|
frontmatter;
|
|
12104
12695
|
body;
|
|
12105
12696
|
constructor({ frontmatter, body, ...rest }) {
|
|
12106
12697
|
if (rest.validate !== false) {
|
|
12107
|
-
const result =
|
|
12698
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12108
12699
|
if (!result.success) {
|
|
12109
12700
|
throw new Error(
|
|
12110
|
-
`Invalid frontmatter in ${
|
|
12701
|
+
`Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12111
12702
|
);
|
|
12112
12703
|
}
|
|
12113
12704
|
}
|
|
12114
|
-
super({
|
|
12115
|
-
...rest
|
|
12116
|
-
});
|
|
12705
|
+
super({ ...rest });
|
|
12117
12706
|
this.frontmatter = frontmatter;
|
|
12118
12707
|
this.body = body;
|
|
12119
12708
|
}
|
|
12120
12709
|
static getSettablePaths(_options = {}) {
|
|
12121
12710
|
return {
|
|
12122
|
-
relativeDirPath:
|
|
12711
|
+
relativeDirPath: join92(".deepagents", "agents")
|
|
12123
12712
|
};
|
|
12124
12713
|
}
|
|
12125
12714
|
getFrontmatter() {
|
|
@@ -12129,18 +12718,17 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12129
12718
|
return this.body;
|
|
12130
12719
|
}
|
|
12131
12720
|
toRulesyncSubagent() {
|
|
12132
|
-
const { name, description,
|
|
12721
|
+
const { name, description, model } = this.frontmatter;
|
|
12722
|
+
const deepagentsSection = {};
|
|
12723
|
+
if (model) deepagentsSection.model = model;
|
|
12133
12724
|
const rulesyncFrontmatter = {
|
|
12134
12725
|
targets: ["*"],
|
|
12135
12726
|
name,
|
|
12136
12727
|
description,
|
|
12137
|
-
|
|
12138
|
-
...rest
|
|
12139
|
-
}
|
|
12728
|
+
...Object.keys(deepagentsSection).length > 0 && { deepagents: deepagentsSection }
|
|
12140
12729
|
};
|
|
12141
12730
|
return new RulesyncSubagent({
|
|
12142
|
-
baseDir:
|
|
12143
|
-
// RulesyncSubagent baseDir is always the project root directory
|
|
12731
|
+
baseDir: this.getBaseDir(),
|
|
12144
12732
|
frontmatter: rulesyncFrontmatter,
|
|
12145
12733
|
body: this.body,
|
|
12146
12734
|
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
@@ -12155,38 +12743,47 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12155
12743
|
global = false
|
|
12156
12744
|
}) {
|
|
12157
12745
|
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
12158
|
-
const
|
|
12159
|
-
|
|
12746
|
+
const deepagentsSection = this.filterToolSpecificSection(rulesyncFrontmatter.deepagents ?? {}, [
|
|
12747
|
+
"name",
|
|
12748
|
+
"description"
|
|
12749
|
+
]);
|
|
12750
|
+
const rawFrontmatter = {
|
|
12160
12751
|
name: rulesyncFrontmatter.name,
|
|
12161
12752
|
description: rulesyncFrontmatter.description,
|
|
12162
|
-
...
|
|
12753
|
+
...deepagentsSection
|
|
12163
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;
|
|
12164
12762
|
const body = rulesyncSubagent.getBody();
|
|
12165
|
-
const fileContent = stringifyFrontmatter(body,
|
|
12763
|
+
const fileContent = stringifyFrontmatter(body, deepagentsFrontmatter);
|
|
12166
12764
|
const paths = this.getSettablePaths({ global });
|
|
12167
|
-
return new
|
|
12765
|
+
return new _DeepagentsSubagent({
|
|
12168
12766
|
baseDir,
|
|
12169
|
-
frontmatter:
|
|
12767
|
+
frontmatter: deepagentsFrontmatter,
|
|
12170
12768
|
body,
|
|
12171
12769
|
relativeDirPath: paths.relativeDirPath,
|
|
12172
12770
|
relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
|
|
12173
12771
|
fileContent,
|
|
12174
|
-
validate
|
|
12175
|
-
global
|
|
12772
|
+
validate
|
|
12176
12773
|
});
|
|
12177
12774
|
}
|
|
12178
12775
|
validate() {
|
|
12179
12776
|
if (!this.frontmatter) {
|
|
12180
12777
|
return { success: true, error: null };
|
|
12181
12778
|
}
|
|
12182
|
-
const result =
|
|
12779
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(this.frontmatter);
|
|
12183
12780
|
if (result.success) {
|
|
12184
12781
|
return { success: true, error: null };
|
|
12185
12782
|
} else {
|
|
12186
12783
|
return {
|
|
12187
12784
|
success: false,
|
|
12188
12785
|
error: new Error(
|
|
12189
|
-
`Invalid frontmatter in ${
|
|
12786
|
+
`Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12190
12787
|
)
|
|
12191
12788
|
};
|
|
12192
12789
|
}
|
|
@@ -12194,7 +12791,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12194
12791
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
12195
12792
|
return this.isTargetedByRulesyncSubagentDefault({
|
|
12196
12793
|
rulesyncSubagent,
|
|
12197
|
-
toolTarget: "
|
|
12794
|
+
toolTarget: "deepagents"
|
|
12198
12795
|
});
|
|
12199
12796
|
}
|
|
12200
12797
|
static async fromFile({
|
|
@@ -12204,22 +12801,21 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12204
12801
|
global = false
|
|
12205
12802
|
}) {
|
|
12206
12803
|
const paths = this.getSettablePaths({ global });
|
|
12207
|
-
const filePath =
|
|
12804
|
+
const filePath = join92(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12208
12805
|
const fileContent = await readFileContent(filePath);
|
|
12209
12806
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12210
|
-
const result =
|
|
12807
|
+
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12211
12808
|
if (!result.success) {
|
|
12212
12809
|
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
12213
12810
|
}
|
|
12214
|
-
return new
|
|
12811
|
+
return new _DeepagentsSubagent({
|
|
12215
12812
|
baseDir,
|
|
12216
12813
|
relativeDirPath: paths.relativeDirPath,
|
|
12217
12814
|
relativeFilePath,
|
|
12218
12815
|
frontmatter: result.data,
|
|
12219
12816
|
body: content.trim(),
|
|
12220
12817
|
fileContent,
|
|
12221
|
-
validate
|
|
12222
|
-
global
|
|
12818
|
+
validate
|
|
12223
12819
|
});
|
|
12224
12820
|
}
|
|
12225
12821
|
static forDeletion({
|
|
@@ -12227,7 +12823,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12227
12823
|
relativeDirPath,
|
|
12228
12824
|
relativeFilePath
|
|
12229
12825
|
}) {
|
|
12230
|
-
return new
|
|
12826
|
+
return new _DeepagentsSubagent({
|
|
12231
12827
|
baseDir,
|
|
12232
12828
|
relativeDirPath,
|
|
12233
12829
|
relativeFilePath,
|
|
@@ -12240,11 +12836,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
12240
12836
|
};
|
|
12241
12837
|
|
|
12242
12838
|
// src/features/subagents/junie-subagent.ts
|
|
12243
|
-
import { join as
|
|
12244
|
-
import { z as
|
|
12245
|
-
var JunieSubagentFrontmatterSchema =
|
|
12246
|
-
name:
|
|
12247
|
-
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()
|
|
12248
12844
|
});
|
|
12249
12845
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
12250
12846
|
frontmatter;
|
|
@@ -12254,7 +12850,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12254
12850
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12255
12851
|
if (!result.success) {
|
|
12256
12852
|
throw new Error(
|
|
12257
|
-
`Invalid frontmatter in ${
|
|
12853
|
+
`Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12258
12854
|
);
|
|
12259
12855
|
}
|
|
12260
12856
|
}
|
|
@@ -12269,7 +12865,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12269
12865
|
throw new Error("JunieSubagent does not support global mode.");
|
|
12270
12866
|
}
|
|
12271
12867
|
return {
|
|
12272
|
-
relativeDirPath:
|
|
12868
|
+
relativeDirPath: join93(".junie", "agents")
|
|
12273
12869
|
};
|
|
12274
12870
|
}
|
|
12275
12871
|
getFrontmatter() {
|
|
@@ -12345,7 +12941,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12345
12941
|
return {
|
|
12346
12942
|
success: false,
|
|
12347
12943
|
error: new Error(
|
|
12348
|
-
`Invalid frontmatter in ${
|
|
12944
|
+
`Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12349
12945
|
)
|
|
12350
12946
|
};
|
|
12351
12947
|
}
|
|
@@ -12363,7 +12959,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12363
12959
|
global = false
|
|
12364
12960
|
}) {
|
|
12365
12961
|
const paths = this.getSettablePaths({ global });
|
|
12366
|
-
const filePath =
|
|
12962
|
+
const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12367
12963
|
const fileContent = await readFileContent(filePath);
|
|
12368
12964
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12369
12965
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12398,23 +12994,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
12398
12994
|
};
|
|
12399
12995
|
|
|
12400
12996
|
// src/features/subagents/kiro-subagent.ts
|
|
12401
|
-
import { join as
|
|
12402
|
-
import { z as
|
|
12403
|
-
var KiroCliSubagentJsonSchema =
|
|
12404
|
-
name:
|
|
12405
|
-
description:
|
|
12406
|
-
prompt:
|
|
12407
|
-
tools:
|
|
12408
|
-
toolAliases:
|
|
12409
|
-
toolSettings:
|
|
12410
|
-
toolSchema:
|
|
12411
|
-
hooks:
|
|
12412
|
-
model:
|
|
12413
|
-
mcpServers:
|
|
12414
|
-
useLegacyMcpJson:
|
|
12415
|
-
resources:
|
|
12416
|
-
allowedTools:
|
|
12417
|
-
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()))
|
|
12418
13014
|
});
|
|
12419
13015
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
12420
13016
|
body;
|
|
@@ -12425,7 +13021,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12425
13021
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
12426
13022
|
} catch (error) {
|
|
12427
13023
|
throw new Error(
|
|
12428
|
-
`Invalid JSON in ${
|
|
13024
|
+
`Invalid JSON in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12429
13025
|
{ cause: error }
|
|
12430
13026
|
);
|
|
12431
13027
|
}
|
|
@@ -12437,7 +13033,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12437
13033
|
}
|
|
12438
13034
|
static getSettablePaths(_options = {}) {
|
|
12439
13035
|
return {
|
|
12440
|
-
relativeDirPath:
|
|
13036
|
+
relativeDirPath: join94(".kiro", "agents")
|
|
12441
13037
|
};
|
|
12442
13038
|
}
|
|
12443
13039
|
getBody() {
|
|
@@ -12449,7 +13045,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12449
13045
|
parsed = JSON.parse(this.body);
|
|
12450
13046
|
} catch (error) {
|
|
12451
13047
|
throw new Error(
|
|
12452
|
-
`Failed to parse JSON in ${
|
|
13048
|
+
`Failed to parse JSON in ${join94(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
12453
13049
|
{ cause: error }
|
|
12454
13050
|
);
|
|
12455
13051
|
}
|
|
@@ -12530,7 +13126,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12530
13126
|
global = false
|
|
12531
13127
|
}) {
|
|
12532
13128
|
const paths = this.getSettablePaths({ global });
|
|
12533
|
-
const filePath =
|
|
13129
|
+
const filePath = join94(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12534
13130
|
const fileContent = await readFileContent(filePath);
|
|
12535
13131
|
const subagent = new _KiroSubagent({
|
|
12536
13132
|
baseDir,
|
|
@@ -12568,12 +13164,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
12568
13164
|
};
|
|
12569
13165
|
|
|
12570
13166
|
// src/features/subagents/opencode-subagent.ts
|
|
12571
|
-
import { basename as basename8, join as
|
|
12572
|
-
import { z as
|
|
12573
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
12574
|
-
description:
|
|
12575
|
-
mode:
|
|
12576
|
-
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())
|
|
12577
13173
|
});
|
|
12578
13174
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
12579
13175
|
frontmatter;
|
|
@@ -12583,7 +13179,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12583
13179
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
12584
13180
|
if (!result.success) {
|
|
12585
13181
|
throw new Error(
|
|
12586
|
-
`Invalid frontmatter in ${
|
|
13182
|
+
`Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12587
13183
|
);
|
|
12588
13184
|
}
|
|
12589
13185
|
}
|
|
@@ -12597,7 +13193,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12597
13193
|
global = false
|
|
12598
13194
|
} = {}) {
|
|
12599
13195
|
return {
|
|
12600
|
-
relativeDirPath: global ?
|
|
13196
|
+
relativeDirPath: global ? join95(".config", "opencode", "agent") : join95(".opencode", "agent")
|
|
12601
13197
|
};
|
|
12602
13198
|
}
|
|
12603
13199
|
getFrontmatter() {
|
|
@@ -12663,7 +13259,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12663
13259
|
return {
|
|
12664
13260
|
success: false,
|
|
12665
13261
|
error: new Error(
|
|
12666
|
-
`Invalid frontmatter in ${
|
|
13262
|
+
`Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12667
13263
|
)
|
|
12668
13264
|
};
|
|
12669
13265
|
}
|
|
@@ -12680,7 +13276,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
12680
13276
|
global = false
|
|
12681
13277
|
}) {
|
|
12682
13278
|
const paths = this.getSettablePaths({ global });
|
|
12683
|
-
const filePath =
|
|
13279
|
+
const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
12684
13280
|
const fileContent = await readFileContent(filePath);
|
|
12685
13281
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
12686
13282
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -12723,6 +13319,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12723
13319
|
"codexcli",
|
|
12724
13320
|
"copilot",
|
|
12725
13321
|
"cursor",
|
|
13322
|
+
"deepagents",
|
|
12726
13323
|
"factorydroid",
|
|
12727
13324
|
"geminicli",
|
|
12728
13325
|
"junie",
|
|
@@ -12730,7 +13327,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
12730
13327
|
"opencode",
|
|
12731
13328
|
"roo"
|
|
12732
13329
|
];
|
|
12733
|
-
var SubagentsProcessorToolTargetSchema =
|
|
13330
|
+
var SubagentsProcessorToolTargetSchema = z52.enum(subagentsProcessorToolTargetTuple);
|
|
12734
13331
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
12735
13332
|
[
|
|
12736
13333
|
"agentsmd",
|
|
@@ -12774,6 +13371,13 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
12774
13371
|
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
12775
13372
|
}
|
|
12776
13373
|
],
|
|
13374
|
+
[
|
|
13375
|
+
"deepagents",
|
|
13376
|
+
{
|
|
13377
|
+
class: DeepagentsSubagent,
|
|
13378
|
+
meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
|
|
13379
|
+
}
|
|
13380
|
+
],
|
|
12777
13381
|
[
|
|
12778
13382
|
"factorydroid",
|
|
12779
13383
|
{
|
|
@@ -12900,7 +13504,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12900
13504
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
12901
13505
|
*/
|
|
12902
13506
|
async loadRulesyncFiles() {
|
|
12903
|
-
const subagentsDir =
|
|
13507
|
+
const subagentsDir = join96(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
12904
13508
|
const dirExists = await directoryExists(subagentsDir);
|
|
12905
13509
|
if (!dirExists) {
|
|
12906
13510
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -12915,7 +13519,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12915
13519
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
12916
13520
|
const rulesyncSubagents = [];
|
|
12917
13521
|
for (const mdFile of mdFiles) {
|
|
12918
|
-
const filepath =
|
|
13522
|
+
const filepath = join96(subagentsDir, mdFile);
|
|
12919
13523
|
try {
|
|
12920
13524
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
12921
13525
|
relativeFilePath: mdFile,
|
|
@@ -12945,7 +13549,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
12945
13549
|
const factory = this.getFactory(this.toolTarget);
|
|
12946
13550
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
12947
13551
|
const subagentFilePaths = await findFilesByGlobs(
|
|
12948
|
-
|
|
13552
|
+
join96(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
12949
13553
|
);
|
|
12950
13554
|
if (forDeletion) {
|
|
12951
13555
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -13012,49 +13616,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
13012
13616
|
};
|
|
13013
13617
|
|
|
13014
13618
|
// src/features/rules/agentsmd-rule.ts
|
|
13015
|
-
import { join as
|
|
13619
|
+
import { join as join99 } from "path";
|
|
13016
13620
|
|
|
13017
13621
|
// src/features/rules/tool-rule.ts
|
|
13018
|
-
import { join as
|
|
13622
|
+
import { join as join98 } from "path";
|
|
13019
13623
|
|
|
13020
13624
|
// src/features/rules/rulesync-rule.ts
|
|
13021
|
-
import { join as
|
|
13022
|
-
import { z as
|
|
13023
|
-
var RulesyncRuleFrontmatterSchema =
|
|
13024
|
-
root:
|
|
13025
|
-
localRoot:
|
|
13026
|
-
targets:
|
|
13027
|
-
description:
|
|
13028
|
-
globs:
|
|
13029
|
-
agentsmd:
|
|
13030
|
-
|
|
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({
|
|
13031
13635
|
// @example "path/to/subproject"
|
|
13032
|
-
subprojectPath:
|
|
13636
|
+
subprojectPath: z53.optional(z53.string())
|
|
13033
13637
|
})
|
|
13034
13638
|
),
|
|
13035
|
-
claudecode:
|
|
13036
|
-
|
|
13639
|
+
claudecode: z53.optional(
|
|
13640
|
+
z53.object({
|
|
13037
13641
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
13038
13642
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
13039
|
-
paths:
|
|
13643
|
+
paths: z53.optional(z53.array(z53.string()))
|
|
13040
13644
|
})
|
|
13041
13645
|
),
|
|
13042
|
-
cursor:
|
|
13043
|
-
|
|
13044
|
-
alwaysApply:
|
|
13045
|
-
description:
|
|
13046
|
-
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()))
|
|
13047
13651
|
})
|
|
13048
13652
|
),
|
|
13049
|
-
copilot:
|
|
13050
|
-
|
|
13051
|
-
excludeAgent:
|
|
13653
|
+
copilot: z53.optional(
|
|
13654
|
+
z53.object({
|
|
13655
|
+
excludeAgent: z53.optional(z53.union([z53.literal("code-review"), z53.literal("coding-agent")]))
|
|
13052
13656
|
})
|
|
13053
13657
|
),
|
|
13054
|
-
antigravity:
|
|
13055
|
-
|
|
13056
|
-
trigger:
|
|
13057
|
-
globs:
|
|
13658
|
+
antigravity: z53.optional(
|
|
13659
|
+
z53.looseObject({
|
|
13660
|
+
trigger: z53.optional(z53.string()),
|
|
13661
|
+
globs: z53.optional(z53.array(z53.string()))
|
|
13058
13662
|
})
|
|
13059
13663
|
)
|
|
13060
13664
|
});
|
|
@@ -13065,7 +13669,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13065
13669
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13066
13670
|
if (!parseResult.success && rest.validate !== false) {
|
|
13067
13671
|
throw new Error(
|
|
13068
|
-
`Invalid frontmatter in ${
|
|
13672
|
+
`Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
13069
13673
|
);
|
|
13070
13674
|
}
|
|
13071
13675
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -13100,7 +13704,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13100
13704
|
return {
|
|
13101
13705
|
success: false,
|
|
13102
13706
|
error: new Error(
|
|
13103
|
-
`Invalid frontmatter in ${
|
|
13707
|
+
`Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13104
13708
|
)
|
|
13105
13709
|
};
|
|
13106
13710
|
}
|
|
@@ -13109,7 +13713,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13109
13713
|
relativeFilePath,
|
|
13110
13714
|
validate = true
|
|
13111
13715
|
}) {
|
|
13112
|
-
const filePath =
|
|
13716
|
+
const filePath = join97(
|
|
13113
13717
|
process.cwd(),
|
|
13114
13718
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
13115
13719
|
relativeFilePath
|
|
@@ -13127,7 +13731,10 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
13127
13731
|
description: result.data.description,
|
|
13128
13732
|
globs: result.data.globs ?? [],
|
|
13129
13733
|
agentsmd: result.data.agentsmd,
|
|
13130
|
-
|
|
13734
|
+
claudecode: result.data.claudecode,
|
|
13735
|
+
cursor: result.data.cursor,
|
|
13736
|
+
copilot: result.data.copilot,
|
|
13737
|
+
antigravity: result.data.antigravity
|
|
13131
13738
|
};
|
|
13132
13739
|
return new _RulesyncRule({
|
|
13133
13740
|
baseDir: process.cwd(),
|
|
@@ -13211,7 +13818,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13211
13818
|
rulesyncRule,
|
|
13212
13819
|
validate = true,
|
|
13213
13820
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
13214
|
-
nonRootPath = { relativeDirPath:
|
|
13821
|
+
nonRootPath = { relativeDirPath: join98(".agents", "memories") }
|
|
13215
13822
|
}) {
|
|
13216
13823
|
const params = this.buildToolRuleParamsDefault({
|
|
13217
13824
|
baseDir,
|
|
@@ -13222,7 +13829,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13222
13829
|
});
|
|
13223
13830
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
13224
13831
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
13225
|
-
params.relativeDirPath =
|
|
13832
|
+
params.relativeDirPath = join98(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
13226
13833
|
params.relativeFilePath = "AGENTS.md";
|
|
13227
13834
|
}
|
|
13228
13835
|
return params;
|
|
@@ -13271,7 +13878,7 @@ var ToolRule = class extends ToolFile {
|
|
|
13271
13878
|
}
|
|
13272
13879
|
};
|
|
13273
13880
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
13274
|
-
return excludeToolDir ? subDir :
|
|
13881
|
+
return excludeToolDir ? subDir : join98(toolDir, subDir);
|
|
13275
13882
|
}
|
|
13276
13883
|
|
|
13277
13884
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -13300,8 +13907,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13300
13907
|
validate = true
|
|
13301
13908
|
}) {
|
|
13302
13909
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
13303
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
13304
|
-
const fileContent = await readFileContent(
|
|
13910
|
+
const relativePath = isRoot ? "AGENTS.md" : join99(".agents", "memories", relativeFilePath);
|
|
13911
|
+
const fileContent = await readFileContent(join99(baseDir, relativePath));
|
|
13305
13912
|
return new _AgentsMdRule({
|
|
13306
13913
|
baseDir,
|
|
13307
13914
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13356,21 +13963,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
13356
13963
|
};
|
|
13357
13964
|
|
|
13358
13965
|
// src/features/rules/antigravity-rule.ts
|
|
13359
|
-
import { join as
|
|
13360
|
-
import { z as
|
|
13361
|
-
var AntigravityRuleFrontmatterSchema =
|
|
13362
|
-
trigger:
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
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()
|
|
13369
13976
|
// accepts any string for forward compatibility
|
|
13370
13977
|
])
|
|
13371
13978
|
),
|
|
13372
|
-
globs:
|
|
13373
|
-
description:
|
|
13979
|
+
globs: z54.optional(z54.string()),
|
|
13980
|
+
description: z54.optional(z54.string())
|
|
13374
13981
|
});
|
|
13375
13982
|
function parseGlobsString(globs) {
|
|
13376
13983
|
if (!globs) {
|
|
@@ -13515,7 +14122,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13515
14122
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13516
14123
|
if (!result.success) {
|
|
13517
14124
|
throw new Error(
|
|
13518
|
-
`Invalid frontmatter in ${
|
|
14125
|
+
`Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13519
14126
|
);
|
|
13520
14127
|
}
|
|
13521
14128
|
}
|
|
@@ -13539,7 +14146,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13539
14146
|
relativeFilePath,
|
|
13540
14147
|
validate = true
|
|
13541
14148
|
}) {
|
|
13542
|
-
const filePath =
|
|
14149
|
+
const filePath = join100(
|
|
13543
14150
|
baseDir,
|
|
13544
14151
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13545
14152
|
relativeFilePath
|
|
@@ -13679,7 +14286,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
13679
14286
|
};
|
|
13680
14287
|
|
|
13681
14288
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
13682
|
-
import { join as
|
|
14289
|
+
import { join as join101 } from "path";
|
|
13683
14290
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
13684
14291
|
toRulesyncRule() {
|
|
13685
14292
|
const rulesyncFrontmatter = {
|
|
@@ -13739,8 +14346,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13739
14346
|
}) {
|
|
13740
14347
|
const settablePaths = this.getSettablePaths();
|
|
13741
14348
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
13742
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
13743
|
-
const fileContent = await readFileContent(
|
|
14349
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join101(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14350
|
+
const fileContent = await readFileContent(join101(baseDir, relativePath));
|
|
13744
14351
|
return new _AugmentcodeLegacyRule({
|
|
13745
14352
|
baseDir,
|
|
13746
14353
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -13769,7 +14376,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
13769
14376
|
};
|
|
13770
14377
|
|
|
13771
14378
|
// src/features/rules/augmentcode-rule.ts
|
|
13772
|
-
import { join as
|
|
14379
|
+
import { join as join102 } from "path";
|
|
13773
14380
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
13774
14381
|
toRulesyncRule() {
|
|
13775
14382
|
return this.toRulesyncRuleDefault();
|
|
@@ -13800,7 +14407,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13800
14407
|
relativeFilePath,
|
|
13801
14408
|
validate = true
|
|
13802
14409
|
}) {
|
|
13803
|
-
const filePath =
|
|
14410
|
+
const filePath = join102(
|
|
13804
14411
|
baseDir,
|
|
13805
14412
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13806
14413
|
relativeFilePath
|
|
@@ -13840,7 +14447,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
13840
14447
|
};
|
|
13841
14448
|
|
|
13842
14449
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
13843
|
-
import { join as
|
|
14450
|
+
import { join as join103 } from "path";
|
|
13844
14451
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
13845
14452
|
static getSettablePaths({
|
|
13846
14453
|
global,
|
|
@@ -13882,7 +14489,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13882
14489
|
if (isRoot) {
|
|
13883
14490
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
13884
14491
|
const fileContent2 = await readFileContent(
|
|
13885
|
-
|
|
14492
|
+
join103(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
13886
14493
|
);
|
|
13887
14494
|
return new _ClaudecodeLegacyRule({
|
|
13888
14495
|
baseDir,
|
|
@@ -13896,8 +14503,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13896
14503
|
if (!paths.nonRoot) {
|
|
13897
14504
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13898
14505
|
}
|
|
13899
|
-
const relativePath =
|
|
13900
|
-
const fileContent = await readFileContent(
|
|
14506
|
+
const relativePath = join103(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14507
|
+
const fileContent = await readFileContent(join103(baseDir, relativePath));
|
|
13901
14508
|
return new _ClaudecodeLegacyRule({
|
|
13902
14509
|
baseDir,
|
|
13903
14510
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13956,10 +14563,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
13956
14563
|
};
|
|
13957
14564
|
|
|
13958
14565
|
// src/features/rules/claudecode-rule.ts
|
|
13959
|
-
import { join as
|
|
13960
|
-
import { z as
|
|
13961
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
13962
|
-
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()))
|
|
13963
14570
|
});
|
|
13964
14571
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
13965
14572
|
frontmatter;
|
|
@@ -13997,7 +14604,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
13997
14604
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13998
14605
|
if (!result.success) {
|
|
13999
14606
|
throw new Error(
|
|
14000
|
-
`Invalid frontmatter in ${
|
|
14607
|
+
`Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14001
14608
|
);
|
|
14002
14609
|
}
|
|
14003
14610
|
}
|
|
@@ -14027,7 +14634,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14027
14634
|
if (isRoot) {
|
|
14028
14635
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
14029
14636
|
const fileContent2 = await readFileContent(
|
|
14030
|
-
|
|
14637
|
+
join104(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
14031
14638
|
);
|
|
14032
14639
|
return new _ClaudecodeRule({
|
|
14033
14640
|
baseDir,
|
|
@@ -14042,8 +14649,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14042
14649
|
if (!paths.nonRoot) {
|
|
14043
14650
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14044
14651
|
}
|
|
14045
|
-
const relativePath =
|
|
14046
|
-
const filePath =
|
|
14652
|
+
const relativePath = join104(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14653
|
+
const filePath = join104(baseDir, relativePath);
|
|
14047
14654
|
const fileContent = await readFileContent(filePath);
|
|
14048
14655
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14049
14656
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14154,7 +14761,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14154
14761
|
return {
|
|
14155
14762
|
success: false,
|
|
14156
14763
|
error: new Error(
|
|
14157
|
-
`Invalid frontmatter in ${
|
|
14764
|
+
`Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14158
14765
|
)
|
|
14159
14766
|
};
|
|
14160
14767
|
}
|
|
@@ -14174,10 +14781,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
14174
14781
|
};
|
|
14175
14782
|
|
|
14176
14783
|
// src/features/rules/cline-rule.ts
|
|
14177
|
-
import { join as
|
|
14178
|
-
import { z as
|
|
14179
|
-
var ClineRuleFrontmatterSchema =
|
|
14180
|
-
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()
|
|
14181
14788
|
});
|
|
14182
14789
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
14183
14790
|
static getSettablePaths(_options = {}) {
|
|
@@ -14220,7 +14827,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
14220
14827
|
validate = true
|
|
14221
14828
|
}) {
|
|
14222
14829
|
const fileContent = await readFileContent(
|
|
14223
|
-
|
|
14830
|
+
join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14224
14831
|
);
|
|
14225
14832
|
return new _ClineRule({
|
|
14226
14833
|
baseDir,
|
|
@@ -14246,7 +14853,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
14246
14853
|
};
|
|
14247
14854
|
|
|
14248
14855
|
// src/features/rules/codexcli-rule.ts
|
|
14249
|
-
import { join as
|
|
14856
|
+
import { join as join106 } from "path";
|
|
14250
14857
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
14251
14858
|
static getSettablePaths({
|
|
14252
14859
|
global,
|
|
@@ -14281,7 +14888,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14281
14888
|
if (isRoot) {
|
|
14282
14889
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14283
14890
|
const fileContent2 = await readFileContent(
|
|
14284
|
-
|
|
14891
|
+
join106(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14285
14892
|
);
|
|
14286
14893
|
return new _CodexcliRule({
|
|
14287
14894
|
baseDir,
|
|
@@ -14295,8 +14902,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14295
14902
|
if (!paths.nonRoot) {
|
|
14296
14903
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14297
14904
|
}
|
|
14298
|
-
const relativePath =
|
|
14299
|
-
const fileContent = await readFileContent(
|
|
14905
|
+
const relativePath = join106(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14906
|
+
const fileContent = await readFileContent(join106(baseDir, relativePath));
|
|
14300
14907
|
return new _CodexcliRule({
|
|
14301
14908
|
baseDir,
|
|
14302
14909
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14355,12 +14962,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
14355
14962
|
};
|
|
14356
14963
|
|
|
14357
14964
|
// src/features/rules/copilot-rule.ts
|
|
14358
|
-
import { join as
|
|
14359
|
-
import { z as
|
|
14360
|
-
var CopilotRuleFrontmatterSchema =
|
|
14361
|
-
description:
|
|
14362
|
-
applyTo:
|
|
14363
|
-
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")]))
|
|
14364
14971
|
});
|
|
14365
14972
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
14366
14973
|
frontmatter;
|
|
@@ -14392,7 +14999,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14392
14999
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14393
15000
|
if (!result.success) {
|
|
14394
15001
|
throw new Error(
|
|
14395
|
-
`Invalid frontmatter in ${
|
|
15002
|
+
`Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14396
15003
|
);
|
|
14397
15004
|
}
|
|
14398
15005
|
}
|
|
@@ -14482,8 +15089,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14482
15089
|
const paths = this.getSettablePaths({ global });
|
|
14483
15090
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14484
15091
|
if (isRoot) {
|
|
14485
|
-
const relativePath2 =
|
|
14486
|
-
const filePath2 =
|
|
15092
|
+
const relativePath2 = join107(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
15093
|
+
const filePath2 = join107(baseDir, relativePath2);
|
|
14487
15094
|
const fileContent2 = await readFileContent(filePath2);
|
|
14488
15095
|
return new _CopilotRule({
|
|
14489
15096
|
baseDir,
|
|
@@ -14498,8 +15105,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14498
15105
|
if (!paths.nonRoot) {
|
|
14499
15106
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14500
15107
|
}
|
|
14501
|
-
const relativePath =
|
|
14502
|
-
const filePath =
|
|
15108
|
+
const relativePath = join107(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15109
|
+
const filePath = join107(baseDir, relativePath);
|
|
14503
15110
|
const fileContent = await readFileContent(filePath);
|
|
14504
15111
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14505
15112
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14545,7 +15152,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14545
15152
|
return {
|
|
14546
15153
|
success: false,
|
|
14547
15154
|
error: new Error(
|
|
14548
|
-
`Invalid frontmatter in ${
|
|
15155
|
+
`Invalid frontmatter in ${join107(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14549
15156
|
)
|
|
14550
15157
|
};
|
|
14551
15158
|
}
|
|
@@ -14565,12 +15172,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
14565
15172
|
};
|
|
14566
15173
|
|
|
14567
15174
|
// src/features/rules/cursor-rule.ts
|
|
14568
|
-
import { join as
|
|
14569
|
-
import { z as
|
|
14570
|
-
var CursorRuleFrontmatterSchema =
|
|
14571
|
-
description:
|
|
14572
|
-
globs:
|
|
14573
|
-
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())
|
|
14574
15181
|
});
|
|
14575
15182
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
14576
15183
|
frontmatter;
|
|
@@ -14587,7 +15194,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14587
15194
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14588
15195
|
if (!result.success) {
|
|
14589
15196
|
throw new Error(
|
|
14590
|
-
`Invalid frontmatter in ${
|
|
15197
|
+
`Invalid frontmatter in ${join108(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14591
15198
|
);
|
|
14592
15199
|
}
|
|
14593
15200
|
}
|
|
@@ -14703,7 +15310,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14703
15310
|
relativeFilePath,
|
|
14704
15311
|
validate = true
|
|
14705
15312
|
}) {
|
|
14706
|
-
const filePath =
|
|
15313
|
+
const filePath = join108(
|
|
14707
15314
|
baseDir,
|
|
14708
15315
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
14709
15316
|
relativeFilePath
|
|
@@ -14713,7 +15320,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14713
15320
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
14714
15321
|
if (!result.success) {
|
|
14715
15322
|
throw new Error(
|
|
14716
|
-
`Invalid frontmatter in ${
|
|
15323
|
+
`Invalid frontmatter in ${join108(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
14717
15324
|
);
|
|
14718
15325
|
}
|
|
14719
15326
|
return new _CursorRule({
|
|
@@ -14750,7 +15357,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14750
15357
|
return {
|
|
14751
15358
|
success: false,
|
|
14752
15359
|
error: new Error(
|
|
14753
|
-
`Invalid frontmatter in ${
|
|
15360
|
+
`Invalid frontmatter in ${join108(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14754
15361
|
)
|
|
14755
15362
|
};
|
|
14756
15363
|
}
|
|
@@ -14769,8 +15376,90 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
14769
15376
|
}
|
|
14770
15377
|
};
|
|
14771
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
|
+
|
|
14772
15461
|
// src/features/rules/factorydroid-rule.ts
|
|
14773
|
-
import { join as
|
|
15462
|
+
import { join as join110 } from "path";
|
|
14774
15463
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
14775
15464
|
constructor({ fileContent, root, ...rest }) {
|
|
14776
15465
|
super({
|
|
@@ -14810,8 +15499,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14810
15499
|
const paths = this.getSettablePaths({ global });
|
|
14811
15500
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
14812
15501
|
if (isRoot) {
|
|
14813
|
-
const relativePath2 =
|
|
14814
|
-
const fileContent2 = await readFileContent(
|
|
15502
|
+
const relativePath2 = join110(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
15503
|
+
const fileContent2 = await readFileContent(join110(baseDir, relativePath2));
|
|
14815
15504
|
return new _FactorydroidRule({
|
|
14816
15505
|
baseDir,
|
|
14817
15506
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -14824,8 +15513,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14824
15513
|
if (!paths.nonRoot) {
|
|
14825
15514
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14826
15515
|
}
|
|
14827
|
-
const relativePath =
|
|
14828
|
-
const fileContent = await readFileContent(
|
|
15516
|
+
const relativePath = join110(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15517
|
+
const fileContent = await readFileContent(join110(baseDir, relativePath));
|
|
14829
15518
|
return new _FactorydroidRule({
|
|
14830
15519
|
baseDir,
|
|
14831
15520
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14884,7 +15573,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
14884
15573
|
};
|
|
14885
15574
|
|
|
14886
15575
|
// src/features/rules/geminicli-rule.ts
|
|
14887
|
-
import { join as
|
|
15576
|
+
import { join as join111 } from "path";
|
|
14888
15577
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
14889
15578
|
static getSettablePaths({
|
|
14890
15579
|
global,
|
|
@@ -14919,7 +15608,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14919
15608
|
if (isRoot) {
|
|
14920
15609
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14921
15610
|
const fileContent2 = await readFileContent(
|
|
14922
|
-
|
|
15611
|
+
join111(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14923
15612
|
);
|
|
14924
15613
|
return new _GeminiCliRule({
|
|
14925
15614
|
baseDir,
|
|
@@ -14933,8 +15622,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14933
15622
|
if (!paths.nonRoot) {
|
|
14934
15623
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14935
15624
|
}
|
|
14936
|
-
const relativePath =
|
|
14937
|
-
const fileContent = await readFileContent(
|
|
15625
|
+
const relativePath = join111(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15626
|
+
const fileContent = await readFileContent(join111(baseDir, relativePath));
|
|
14938
15627
|
return new _GeminiCliRule({
|
|
14939
15628
|
baseDir,
|
|
14940
15629
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14993,7 +15682,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
14993
15682
|
};
|
|
14994
15683
|
|
|
14995
15684
|
// src/features/rules/goose-rule.ts
|
|
14996
|
-
import { join as
|
|
15685
|
+
import { join as join112 } from "path";
|
|
14997
15686
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
14998
15687
|
static getSettablePaths({
|
|
14999
15688
|
global,
|
|
@@ -15028,7 +15717,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15028
15717
|
if (isRoot) {
|
|
15029
15718
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15030
15719
|
const fileContent2 = await readFileContent(
|
|
15031
|
-
|
|
15720
|
+
join112(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15032
15721
|
);
|
|
15033
15722
|
return new _GooseRule({
|
|
15034
15723
|
baseDir,
|
|
@@ -15042,8 +15731,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15042
15731
|
if (!paths.nonRoot) {
|
|
15043
15732
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15044
15733
|
}
|
|
15045
|
-
const relativePath =
|
|
15046
|
-
const fileContent = await readFileContent(
|
|
15734
|
+
const relativePath = join112(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
15735
|
+
const fileContent = await readFileContent(join112(baseDir, relativePath));
|
|
15047
15736
|
return new _GooseRule({
|
|
15048
15737
|
baseDir,
|
|
15049
15738
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15102,7 +15791,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
15102
15791
|
};
|
|
15103
15792
|
|
|
15104
15793
|
// src/features/rules/junie-rule.ts
|
|
15105
|
-
import { join as
|
|
15794
|
+
import { join as join113 } from "path";
|
|
15106
15795
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
15107
15796
|
static getSettablePaths(_options = {}) {
|
|
15108
15797
|
return {
|
|
@@ -15121,8 +15810,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
15121
15810
|
validate = true
|
|
15122
15811
|
}) {
|
|
15123
15812
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
15124
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
15125
|
-
const fileContent = await readFileContent(
|
|
15813
|
+
const relativePath = isRoot ? "guidelines.md" : join113(".junie", "memories", relativeFilePath);
|
|
15814
|
+
const fileContent = await readFileContent(join113(baseDir, relativePath));
|
|
15126
15815
|
return new _JunieRule({
|
|
15127
15816
|
baseDir,
|
|
15128
15817
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15177,7 +15866,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
15177
15866
|
};
|
|
15178
15867
|
|
|
15179
15868
|
// src/features/rules/kilo-rule.ts
|
|
15180
|
-
import { join as
|
|
15869
|
+
import { join as join114 } from "path";
|
|
15181
15870
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
15182
15871
|
static getSettablePaths(_options = {}) {
|
|
15183
15872
|
return {
|
|
@@ -15192,7 +15881,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
15192
15881
|
validate = true
|
|
15193
15882
|
}) {
|
|
15194
15883
|
const fileContent = await readFileContent(
|
|
15195
|
-
|
|
15884
|
+
join114(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15196
15885
|
);
|
|
15197
15886
|
return new _KiloRule({
|
|
15198
15887
|
baseDir,
|
|
@@ -15244,7 +15933,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
15244
15933
|
};
|
|
15245
15934
|
|
|
15246
15935
|
// src/features/rules/kiro-rule.ts
|
|
15247
|
-
import { join as
|
|
15936
|
+
import { join as join115 } from "path";
|
|
15248
15937
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
15249
15938
|
static getSettablePaths(_options = {}) {
|
|
15250
15939
|
return {
|
|
@@ -15259,7 +15948,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15259
15948
|
validate = true
|
|
15260
15949
|
}) {
|
|
15261
15950
|
const fileContent = await readFileContent(
|
|
15262
|
-
|
|
15951
|
+
join115(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15263
15952
|
);
|
|
15264
15953
|
return new _KiroRule({
|
|
15265
15954
|
baseDir,
|
|
@@ -15313,7 +16002,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
15313
16002
|
};
|
|
15314
16003
|
|
|
15315
16004
|
// src/features/rules/opencode-rule.ts
|
|
15316
|
-
import { join as
|
|
16005
|
+
import { join as join116 } from "path";
|
|
15317
16006
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
15318
16007
|
static getSettablePaths({
|
|
15319
16008
|
global,
|
|
@@ -15348,7 +16037,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15348
16037
|
if (isRoot) {
|
|
15349
16038
|
const relativePath2 = paths.root.relativeFilePath;
|
|
15350
16039
|
const fileContent2 = await readFileContent(
|
|
15351
|
-
|
|
16040
|
+
join116(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
15352
16041
|
);
|
|
15353
16042
|
return new _OpenCodeRule({
|
|
15354
16043
|
baseDir,
|
|
@@ -15362,8 +16051,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15362
16051
|
if (!paths.nonRoot) {
|
|
15363
16052
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
15364
16053
|
}
|
|
15365
|
-
const relativePath =
|
|
15366
|
-
const fileContent = await readFileContent(
|
|
16054
|
+
const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16055
|
+
const fileContent = await readFileContent(join116(baseDir, relativePath));
|
|
15367
16056
|
return new _OpenCodeRule({
|
|
15368
16057
|
baseDir,
|
|
15369
16058
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -15422,7 +16111,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
15422
16111
|
};
|
|
15423
16112
|
|
|
15424
16113
|
// src/features/rules/qwencode-rule.ts
|
|
15425
|
-
import { join as
|
|
16114
|
+
import { join as join117 } from "path";
|
|
15426
16115
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
15427
16116
|
static getSettablePaths(_options = {}) {
|
|
15428
16117
|
return {
|
|
@@ -15441,8 +16130,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15441
16130
|
validate = true
|
|
15442
16131
|
}) {
|
|
15443
16132
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
15444
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
15445
|
-
const fileContent = await readFileContent(
|
|
16133
|
+
const relativePath = isRoot ? "QWEN.md" : join117(".qwen", "memories", relativeFilePath);
|
|
16134
|
+
const fileContent = await readFileContent(join117(baseDir, relativePath));
|
|
15446
16135
|
return new _QwencodeRule({
|
|
15447
16136
|
baseDir,
|
|
15448
16137
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -15494,7 +16183,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
15494
16183
|
};
|
|
15495
16184
|
|
|
15496
16185
|
// src/features/rules/replit-rule.ts
|
|
15497
|
-
import { join as
|
|
16186
|
+
import { join as join118 } from "path";
|
|
15498
16187
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
15499
16188
|
static getSettablePaths(_options = {}) {
|
|
15500
16189
|
return {
|
|
@@ -15516,7 +16205,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15516
16205
|
}
|
|
15517
16206
|
const relativePath = paths.root.relativeFilePath;
|
|
15518
16207
|
const fileContent = await readFileContent(
|
|
15519
|
-
|
|
16208
|
+
join118(baseDir, paths.root.relativeDirPath, relativePath)
|
|
15520
16209
|
);
|
|
15521
16210
|
return new _ReplitRule({
|
|
15522
16211
|
baseDir,
|
|
@@ -15582,7 +16271,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
15582
16271
|
};
|
|
15583
16272
|
|
|
15584
16273
|
// src/features/rules/roo-rule.ts
|
|
15585
|
-
import { join as
|
|
16274
|
+
import { join as join119 } from "path";
|
|
15586
16275
|
var RooRule = class _RooRule extends ToolRule {
|
|
15587
16276
|
static getSettablePaths(_options = {}) {
|
|
15588
16277
|
return {
|
|
@@ -15597,7 +16286,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15597
16286
|
validate = true
|
|
15598
16287
|
}) {
|
|
15599
16288
|
const fileContent = await readFileContent(
|
|
15600
|
-
|
|
16289
|
+
join119(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15601
16290
|
);
|
|
15602
16291
|
return new _RooRule({
|
|
15603
16292
|
baseDir,
|
|
@@ -15666,7 +16355,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
15666
16355
|
};
|
|
15667
16356
|
|
|
15668
16357
|
// src/features/rules/warp-rule.ts
|
|
15669
|
-
import { join as
|
|
16358
|
+
import { join as join120 } from "path";
|
|
15670
16359
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
15671
16360
|
constructor({ fileContent, root, ...rest }) {
|
|
15672
16361
|
super({
|
|
@@ -15692,8 +16381,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15692
16381
|
validate = true
|
|
15693
16382
|
}) {
|
|
15694
16383
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
15695
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
15696
|
-
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));
|
|
15697
16386
|
return new _WarpRule({
|
|
15698
16387
|
baseDir,
|
|
15699
16388
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -15748,7 +16437,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
15748
16437
|
};
|
|
15749
16438
|
|
|
15750
16439
|
// src/features/rules/windsurf-rule.ts
|
|
15751
|
-
import { join as
|
|
16440
|
+
import { join as join121 } from "path";
|
|
15752
16441
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
15753
16442
|
static getSettablePaths(_options = {}) {
|
|
15754
16443
|
return {
|
|
@@ -15763,7 +16452,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
15763
16452
|
validate = true
|
|
15764
16453
|
}) {
|
|
15765
16454
|
const fileContent = await readFileContent(
|
|
15766
|
-
|
|
16455
|
+
join121(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
15767
16456
|
);
|
|
15768
16457
|
return new _WindsurfRule({
|
|
15769
16458
|
baseDir,
|
|
@@ -15826,6 +16515,7 @@ var rulesProcessorToolTargets = [
|
|
|
15826
16515
|
"codexcli",
|
|
15827
16516
|
"copilot",
|
|
15828
16517
|
"cursor",
|
|
16518
|
+
"deepagents",
|
|
15829
16519
|
"factorydroid",
|
|
15830
16520
|
"geminicli",
|
|
15831
16521
|
"goose",
|
|
@@ -15839,8 +16529,8 @@ var rulesProcessorToolTargets = [
|
|
|
15839
16529
|
"warp",
|
|
15840
16530
|
"windsurf"
|
|
15841
16531
|
];
|
|
15842
|
-
var RulesProcessorToolTargetSchema =
|
|
15843
|
-
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(", ");
|
|
15844
16534
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
15845
16535
|
[
|
|
15846
16536
|
"agentsmd",
|
|
@@ -15957,6 +16647,17 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
15957
16647
|
}
|
|
15958
16648
|
}
|
|
15959
16649
|
],
|
|
16650
|
+
[
|
|
16651
|
+
"deepagents",
|
|
16652
|
+
{
|
|
16653
|
+
class: DeepagentsRule,
|
|
16654
|
+
meta: {
|
|
16655
|
+
extension: "md",
|
|
16656
|
+
supportsGlobal: false,
|
|
16657
|
+
ruleDiscoveryMode: "auto"
|
|
16658
|
+
}
|
|
16659
|
+
}
|
|
16660
|
+
],
|
|
15960
16661
|
[
|
|
15961
16662
|
"factorydroid",
|
|
15962
16663
|
{
|
|
@@ -16216,7 +16917,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16216
16917
|
}).relativeDirPath;
|
|
16217
16918
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
16218
16919
|
const frontmatter = skill.getFrontmatter();
|
|
16219
|
-
const relativePath =
|
|
16920
|
+
const relativePath = join122(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
16220
16921
|
return {
|
|
16221
16922
|
name: frontmatter.name,
|
|
16222
16923
|
description: frontmatter.description,
|
|
@@ -16329,8 +17030,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16329
17030
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
16330
17031
|
*/
|
|
16331
17032
|
async loadRulesyncFiles() {
|
|
16332
|
-
const rulesyncBaseDir =
|
|
16333
|
-
const files = await findFilesByGlobs(
|
|
17033
|
+
const rulesyncBaseDir = join122(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
17034
|
+
const files = await findFilesByGlobs(join122(rulesyncBaseDir, "**", "*.md"));
|
|
16334
17035
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
16335
17036
|
const rulesyncRules = await Promise.all(
|
|
16336
17037
|
files.map((file) => {
|
|
@@ -16427,13 +17128,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16427
17128
|
return [];
|
|
16428
17129
|
}
|
|
16429
17130
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
16430
|
-
|
|
17131
|
+
join122(
|
|
16431
17132
|
this.baseDir,
|
|
16432
17133
|
settablePaths.root.relativeDirPath ?? ".",
|
|
16433
17134
|
settablePaths.root.relativeFilePath
|
|
16434
17135
|
),
|
|
16435
17136
|
settablePaths.alternativeRoots,
|
|
16436
|
-
(alt) =>
|
|
17137
|
+
(alt) => join122(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
16437
17138
|
);
|
|
16438
17139
|
if (forDeletion) {
|
|
16439
17140
|
return uniqueRootFilePaths.map((filePath) => {
|
|
@@ -16478,9 +17179,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16478
17179
|
return [];
|
|
16479
17180
|
}
|
|
16480
17181
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
16481
|
-
|
|
17182
|
+
join122(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
16482
17183
|
settablePaths.alternativeRoots,
|
|
16483
|
-
(alt) =>
|
|
17184
|
+
(alt) => join122(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
16484
17185
|
);
|
|
16485
17186
|
return uniqueLocalRootFilePaths.map((filePath) => {
|
|
16486
17187
|
const relativeDirPath = resolveRelativeDirPath(filePath);
|
|
@@ -16503,9 +17204,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
16503
17204
|
if (!settablePaths.nonRoot) {
|
|
16504
17205
|
return [];
|
|
16505
17206
|
}
|
|
16506
|
-
const nonRootBaseDir =
|
|
17207
|
+
const nonRootBaseDir = join122(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
16507
17208
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
16508
|
-
|
|
17209
|
+
join122(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
16509
17210
|
);
|
|
16510
17211
|
if (forDeletion) {
|
|
16511
17212
|
return nonRootFilePaths.map((filePath) => {
|
|
@@ -16637,14 +17338,14 @@ s/<command> [arguments]
|
|
|
16637
17338
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
16638
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.
|
|
16639
17340
|
|
|
16640
|
-
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.` : "";
|
|
16641
17342
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
16642
17343
|
|
|
16643
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.
|
|
16644
17345
|
|
|
16645
|
-
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.
|
|
16646
17347
|
|
|
16647
|
-
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.` : "";
|
|
16648
17349
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
16649
17350
|
const result = [
|
|
16650
17351
|
overview,
|
|
@@ -16736,7 +17437,7 @@ function warnUnsupportedTargets(params) {
|
|
|
16736
17437
|
}
|
|
16737
17438
|
}
|
|
16738
17439
|
async function checkRulesyncDirExists(params) {
|
|
16739
|
-
return fileExists(
|
|
17440
|
+
return fileExists(join123(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
16740
17441
|
}
|
|
16741
17442
|
async function generate(params) {
|
|
16742
17443
|
const { config, logger } = params;
|