rulesync 7.30.0 → 8.0.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 +2 -2
- package/dist/{chunk-IGW5DFPU.js → chunk-GB6XLCGB.js} +1026 -582
- package/dist/cli/index.cjs +665 -221
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +1051 -607
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -664,7 +664,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
664
664
|
}
|
|
665
665
|
|
|
666
666
|
// src/lib/generate.ts
|
|
667
|
-
var
|
|
667
|
+
var import_node_path139 = require("path");
|
|
668
668
|
var import_es_toolkit5 = require("es-toolkit");
|
|
669
669
|
|
|
670
670
|
// src/features/commands/commands-processor.ts
|
|
@@ -6838,7 +6838,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6838
6838
|
relativeDirPath: paths.relativeDirPath,
|
|
6839
6839
|
relativeFilePath: paths.relativeFilePath,
|
|
6840
6840
|
fileContent: JSON.stringify(newJson, null, 2),
|
|
6841
|
-
validate
|
|
6841
|
+
validate,
|
|
6842
|
+
global
|
|
6842
6843
|
});
|
|
6843
6844
|
}
|
|
6844
6845
|
static async fromRulesyncMcp({
|
|
@@ -6859,7 +6860,8 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
6859
6860
|
relativeDirPath: paths.relativeDirPath,
|
|
6860
6861
|
relativeFilePath: paths.relativeFilePath,
|
|
6861
6862
|
fileContent: JSON.stringify(mcpJson, null, 2),
|
|
6862
|
-
validate
|
|
6863
|
+
validate,
|
|
6864
|
+
global
|
|
6863
6865
|
});
|
|
6864
6866
|
}
|
|
6865
6867
|
toRulesyncMcp() {
|
|
@@ -8978,7 +8980,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
8978
8980
|
};
|
|
8979
8981
|
|
|
8980
8982
|
// src/features/permissions/permissions-processor.ts
|
|
8981
|
-
var
|
|
8983
|
+
var import_mini31 = require("zod/mini");
|
|
8982
8984
|
|
|
8983
8985
|
// src/features/permissions/claudecode-permissions.ts
|
|
8984
8986
|
var import_node_path65 = require("path");
|
|
@@ -9303,16 +9305,382 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
9303
9305
|
return { permission };
|
|
9304
9306
|
}
|
|
9305
9307
|
|
|
9306
|
-
// src/features/permissions/
|
|
9308
|
+
// src/features/permissions/codexcli-permissions.ts
|
|
9307
9309
|
var import_node_path66 = require("path");
|
|
9308
|
-
var
|
|
9310
|
+
var smolToml4 = __toESM(require("smol-toml"), 1);
|
|
9311
|
+
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
9312
|
+
var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
9313
|
+
static getSettablePaths(_options = {}) {
|
|
9314
|
+
return {
|
|
9315
|
+
relativeDirPath: ".codex",
|
|
9316
|
+
relativeFilePath: "config.toml"
|
|
9317
|
+
};
|
|
9318
|
+
}
|
|
9319
|
+
isDeletable() {
|
|
9320
|
+
return false;
|
|
9321
|
+
}
|
|
9322
|
+
static async fromFile({
|
|
9323
|
+
baseDir = process.cwd(),
|
|
9324
|
+
validate = true,
|
|
9325
|
+
global = false
|
|
9326
|
+
}) {
|
|
9327
|
+
const paths = this.getSettablePaths({ global });
|
|
9328
|
+
const filePath = (0, import_node_path66.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9329
|
+
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
9330
|
+
return new _CodexcliPermissions({
|
|
9331
|
+
baseDir,
|
|
9332
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9333
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9334
|
+
fileContent,
|
|
9335
|
+
validate
|
|
9336
|
+
});
|
|
9337
|
+
}
|
|
9338
|
+
static async fromRulesyncPermissions({
|
|
9339
|
+
baseDir = process.cwd(),
|
|
9340
|
+
rulesyncPermissions,
|
|
9341
|
+
validate = true,
|
|
9342
|
+
logger,
|
|
9343
|
+
global = false
|
|
9344
|
+
}) {
|
|
9345
|
+
const paths = this.getSettablePaths({ global });
|
|
9346
|
+
const filePath = (0, import_node_path66.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9347
|
+
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
9348
|
+
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
9349
|
+
const profile = convertRulesyncToCodexProfile({
|
|
9350
|
+
config: rulesyncPermissions.getJson(),
|
|
9351
|
+
logger
|
|
9352
|
+
});
|
|
9353
|
+
const permissionsTable = toMutableTable(parsed.permissions);
|
|
9354
|
+
permissionsTable[RULESYNC_PROFILE_NAME] = profile;
|
|
9355
|
+
parsed.permissions = permissionsTable;
|
|
9356
|
+
parsed.default_permissions = RULESYNC_PROFILE_NAME;
|
|
9357
|
+
return new _CodexcliPermissions({
|
|
9358
|
+
baseDir,
|
|
9359
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9360
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9361
|
+
fileContent: smolToml4.stringify(parsed),
|
|
9362
|
+
validate
|
|
9363
|
+
});
|
|
9364
|
+
}
|
|
9365
|
+
toRulesyncPermissions() {
|
|
9366
|
+
let parsed;
|
|
9367
|
+
try {
|
|
9368
|
+
parsed = smolToml4.parse(this.getFileContent());
|
|
9369
|
+
} catch (error) {
|
|
9370
|
+
throw new Error(
|
|
9371
|
+
`Failed to parse Codex CLI permissions content in ${(0, import_node_path66.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9372
|
+
{ cause: error }
|
|
9373
|
+
);
|
|
9374
|
+
}
|
|
9375
|
+
const table = toMutableTable(parsed);
|
|
9376
|
+
const defaultProfile = typeof table.default_permissions === "string" ? table.default_permissions : void 0;
|
|
9377
|
+
const permissionsTable = toMutableTable(table.permissions);
|
|
9378
|
+
const profile = toCodexProfile(permissionsTable[defaultProfile ?? RULESYNC_PROFILE_NAME]) ?? toCodexProfile(permissionsTable[RULESYNC_PROFILE_NAME]);
|
|
9379
|
+
const config = convertCodexProfileToRulesync(profile);
|
|
9380
|
+
return this.toRulesyncPermissionsDefault({
|
|
9381
|
+
fileContent: JSON.stringify(config, null, 2)
|
|
9382
|
+
});
|
|
9383
|
+
}
|
|
9384
|
+
validate() {
|
|
9385
|
+
return { success: true, error: null };
|
|
9386
|
+
}
|
|
9387
|
+
static forDeletion({
|
|
9388
|
+
baseDir = process.cwd(),
|
|
9389
|
+
relativeDirPath,
|
|
9390
|
+
relativeFilePath
|
|
9391
|
+
}) {
|
|
9392
|
+
return new _CodexcliPermissions({
|
|
9393
|
+
baseDir,
|
|
9394
|
+
relativeDirPath,
|
|
9395
|
+
relativeFilePath,
|
|
9396
|
+
fileContent: smolToml4.stringify({}),
|
|
9397
|
+
validate: false
|
|
9398
|
+
});
|
|
9399
|
+
}
|
|
9400
|
+
};
|
|
9401
|
+
function convertRulesyncToCodexProfile({
|
|
9402
|
+
config,
|
|
9403
|
+
logger
|
|
9404
|
+
}) {
|
|
9405
|
+
const filesystem = {};
|
|
9406
|
+
const domains = {};
|
|
9407
|
+
for (const [toolName, rules] of Object.entries(config.permission)) {
|
|
9408
|
+
if (toolName === "read") {
|
|
9409
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
9410
|
+
filesystem[pattern] = mapReadAction(action);
|
|
9411
|
+
}
|
|
9412
|
+
continue;
|
|
9413
|
+
}
|
|
9414
|
+
if (toolName === "edit" || toolName === "write") {
|
|
9415
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
9416
|
+
filesystem[pattern] = mapWriteAction(action);
|
|
9417
|
+
}
|
|
9418
|
+
continue;
|
|
9419
|
+
}
|
|
9420
|
+
if (toolName === "webfetch") {
|
|
9421
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
9422
|
+
if (action === "ask") {
|
|
9423
|
+
logger?.warn(
|
|
9424
|
+
`Codex CLI does not support "ask" for network domain permissions. Skipping webfetch rule: ${pattern}`
|
|
9425
|
+
);
|
|
9426
|
+
continue;
|
|
9427
|
+
}
|
|
9428
|
+
domains[pattern] = action;
|
|
9429
|
+
}
|
|
9430
|
+
continue;
|
|
9431
|
+
}
|
|
9432
|
+
logger?.warn(
|
|
9433
|
+
`Codex CLI permissions support only read/edit/write/webfetch categories. Skipping: ${toolName}`
|
|
9434
|
+
);
|
|
9435
|
+
}
|
|
9436
|
+
return {
|
|
9437
|
+
...Object.keys(filesystem).length > 0 ? { filesystem } : {},
|
|
9438
|
+
...Object.keys(domains).length > 0 ? { network: { domains } } : {}
|
|
9439
|
+
};
|
|
9440
|
+
}
|
|
9441
|
+
function convertCodexProfileToRulesync(profile) {
|
|
9442
|
+
const permission = {};
|
|
9443
|
+
if (profile?.filesystem) {
|
|
9444
|
+
permission.read = {};
|
|
9445
|
+
permission.edit = {};
|
|
9446
|
+
for (const [pattern, access] of Object.entries(profile.filesystem)) {
|
|
9447
|
+
if (access === "none") {
|
|
9448
|
+
permission.read[pattern] = "deny";
|
|
9449
|
+
permission.edit[pattern] = "deny";
|
|
9450
|
+
} else if (access === "read") {
|
|
9451
|
+
permission.read[pattern] = "allow";
|
|
9452
|
+
} else {
|
|
9453
|
+
permission.edit[pattern] = "allow";
|
|
9454
|
+
}
|
|
9455
|
+
}
|
|
9456
|
+
}
|
|
9457
|
+
if (profile?.network?.domains) {
|
|
9458
|
+
permission.webfetch = {};
|
|
9459
|
+
for (const [domain, value] of Object.entries(profile.network.domains)) {
|
|
9460
|
+
permission.webfetch[domain] = value;
|
|
9461
|
+
}
|
|
9462
|
+
}
|
|
9463
|
+
return { permission };
|
|
9464
|
+
}
|
|
9465
|
+
function toCodexProfile(value) {
|
|
9466
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
9467
|
+
const table = toMutableTable(value);
|
|
9468
|
+
const filesystem = toFilesystemRecord(table.filesystem);
|
|
9469
|
+
const networkRaw = toMutableTable(table.network);
|
|
9470
|
+
const domains = toDomainRecord(networkRaw.domains);
|
|
9471
|
+
return {
|
|
9472
|
+
...filesystem ? { filesystem } : {},
|
|
9473
|
+
...domains ? { network: { domains } } : {}
|
|
9474
|
+
};
|
|
9475
|
+
}
|
|
9476
|
+
function toMutableTable(value) {
|
|
9477
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
9478
|
+
return {};
|
|
9479
|
+
}
|
|
9480
|
+
return { ...value };
|
|
9481
|
+
}
|
|
9482
|
+
function toFilesystemRecord(value) {
|
|
9483
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
9484
|
+
const result = {};
|
|
9485
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
9486
|
+
if (typeof raw !== "string") continue;
|
|
9487
|
+
if (raw === "read" || raw === "write" || raw === "none") {
|
|
9488
|
+
result[key] = raw;
|
|
9489
|
+
}
|
|
9490
|
+
}
|
|
9491
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
9492
|
+
}
|
|
9493
|
+
function toDomainRecord(value) {
|
|
9494
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
9495
|
+
const result = {};
|
|
9496
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
9497
|
+
if (raw === "allow" || raw === "deny") {
|
|
9498
|
+
result[key] = raw;
|
|
9499
|
+
}
|
|
9500
|
+
}
|
|
9501
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
9502
|
+
}
|
|
9503
|
+
function mapReadAction(action) {
|
|
9504
|
+
return action === "allow" ? "read" : "none";
|
|
9505
|
+
}
|
|
9506
|
+
function mapWriteAction(action) {
|
|
9507
|
+
return action === "allow" ? "write" : "none";
|
|
9508
|
+
}
|
|
9509
|
+
|
|
9510
|
+
// src/features/permissions/geminicli-permissions.ts
|
|
9511
|
+
var import_node_path67 = require("path");
|
|
9309
9512
|
var import_mini29 = require("zod/mini");
|
|
9310
|
-
var
|
|
9311
|
-
import_mini29.z.
|
|
9312
|
-
|
|
9513
|
+
var GeminiCliSettingsSchema = import_mini29.z.looseObject({
|
|
9514
|
+
tools: import_mini29.z.optional(
|
|
9515
|
+
import_mini29.z.looseObject({
|
|
9516
|
+
allowed: import_mini29.z.optional(import_mini29.z.array(import_mini29.z.string())),
|
|
9517
|
+
exclude: import_mini29.z.optional(import_mini29.z.array(import_mini29.z.string()))
|
|
9518
|
+
})
|
|
9519
|
+
)
|
|
9520
|
+
});
|
|
9521
|
+
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
9522
|
+
bash: "run_shell_command",
|
|
9523
|
+
read: "read_file",
|
|
9524
|
+
edit: "replace",
|
|
9525
|
+
write: "write_file",
|
|
9526
|
+
webfetch: "web_fetch"
|
|
9527
|
+
};
|
|
9528
|
+
var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
9529
|
+
static getSettablePaths(_options = {}) {
|
|
9530
|
+
return {
|
|
9531
|
+
relativeDirPath: ".gemini",
|
|
9532
|
+
relativeFilePath: "settings.json"
|
|
9533
|
+
};
|
|
9534
|
+
}
|
|
9535
|
+
isDeletable() {
|
|
9536
|
+
return false;
|
|
9537
|
+
}
|
|
9538
|
+
static async fromFile({
|
|
9539
|
+
baseDir = process.cwd(),
|
|
9540
|
+
validate = true,
|
|
9541
|
+
global = false
|
|
9542
|
+
}) {
|
|
9543
|
+
const paths = this.getSettablePaths({ global });
|
|
9544
|
+
const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9545
|
+
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9546
|
+
return new _GeminicliPermissions({
|
|
9547
|
+
baseDir,
|
|
9548
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9549
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9550
|
+
fileContent,
|
|
9551
|
+
validate
|
|
9552
|
+
});
|
|
9553
|
+
}
|
|
9554
|
+
static async fromRulesyncPermissions({
|
|
9555
|
+
baseDir = process.cwd(),
|
|
9556
|
+
rulesyncPermissions,
|
|
9557
|
+
validate = true,
|
|
9558
|
+
logger,
|
|
9559
|
+
global = false
|
|
9560
|
+
}) {
|
|
9561
|
+
const paths = this.getSettablePaths({ global });
|
|
9562
|
+
const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9563
|
+
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
9564
|
+
const settingsResult = GeminiCliSettingsSchema.safeParse(JSON.parse(existingContent));
|
|
9565
|
+
if (!settingsResult.success) {
|
|
9566
|
+
throw new Error(
|
|
9567
|
+
`Failed to parse existing Gemini CLI settings at ${filePath}: ${formatError(settingsResult.error)}`
|
|
9568
|
+
);
|
|
9569
|
+
}
|
|
9570
|
+
const { allowed, exclude } = convertRulesyncToGeminicliTools({
|
|
9571
|
+
config: rulesyncPermissions.getJson(),
|
|
9572
|
+
logger
|
|
9573
|
+
});
|
|
9574
|
+
const merged = {
|
|
9575
|
+
...settingsResult.data,
|
|
9576
|
+
tools: {
|
|
9577
|
+
...settingsResult.data.tools,
|
|
9578
|
+
...allowed.length > 0 ? { allowed } : {},
|
|
9579
|
+
...exclude.length > 0 ? { exclude } : {}
|
|
9580
|
+
}
|
|
9581
|
+
};
|
|
9582
|
+
return new _GeminicliPermissions({
|
|
9583
|
+
baseDir,
|
|
9584
|
+
relativeDirPath: paths.relativeDirPath,
|
|
9585
|
+
relativeFilePath: paths.relativeFilePath,
|
|
9586
|
+
fileContent: JSON.stringify(merged, null, 2),
|
|
9587
|
+
validate
|
|
9588
|
+
});
|
|
9589
|
+
}
|
|
9590
|
+
toRulesyncPermissions() {
|
|
9591
|
+
let settings;
|
|
9592
|
+
try {
|
|
9593
|
+
const parsed = JSON.parse(this.getFileContent());
|
|
9594
|
+
settings = GeminiCliSettingsSchema.parse(parsed);
|
|
9595
|
+
} catch (error) {
|
|
9596
|
+
throw new Error(
|
|
9597
|
+
`Failed to parse Gemini CLI permissions content in ${(0, import_node_path67.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9598
|
+
{ cause: error }
|
|
9599
|
+
);
|
|
9600
|
+
}
|
|
9601
|
+
const permission = {};
|
|
9602
|
+
for (const toolEntry of settings.tools?.allowed ?? []) {
|
|
9603
|
+
const mapped = parseGeminicliToolEntry({ entry: toolEntry });
|
|
9604
|
+
const rules = permission[mapped.category] ??= {};
|
|
9605
|
+
rules[mapped.pattern] = "allow";
|
|
9606
|
+
}
|
|
9607
|
+
for (const toolEntry of settings.tools?.exclude ?? []) {
|
|
9608
|
+
const mapped = parseGeminicliToolEntry({ entry: toolEntry });
|
|
9609
|
+
const rules = permission[mapped.category] ??= {};
|
|
9610
|
+
rules[mapped.pattern] = "deny";
|
|
9611
|
+
}
|
|
9612
|
+
return this.toRulesyncPermissionsDefault({
|
|
9613
|
+
fileContent: JSON.stringify({ permission }, null, 2)
|
|
9614
|
+
});
|
|
9615
|
+
}
|
|
9616
|
+
validate() {
|
|
9617
|
+
return { success: true, error: null };
|
|
9618
|
+
}
|
|
9619
|
+
static forDeletion({
|
|
9620
|
+
baseDir = process.cwd(),
|
|
9621
|
+
relativeDirPath,
|
|
9622
|
+
relativeFilePath
|
|
9623
|
+
}) {
|
|
9624
|
+
return new _GeminicliPermissions({
|
|
9625
|
+
baseDir,
|
|
9626
|
+
relativeDirPath,
|
|
9627
|
+
relativeFilePath,
|
|
9628
|
+
fileContent: JSON.stringify({}, null, 2),
|
|
9629
|
+
validate: false
|
|
9630
|
+
});
|
|
9631
|
+
}
|
|
9632
|
+
};
|
|
9633
|
+
function convertRulesyncToGeminicliTools({
|
|
9634
|
+
config,
|
|
9635
|
+
logger
|
|
9636
|
+
}) {
|
|
9637
|
+
const allowed = [];
|
|
9638
|
+
const exclude = [];
|
|
9639
|
+
for (const [toolName, rules] of Object.entries(config.permission)) {
|
|
9640
|
+
const mappedToolName = RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName] ?? toolName;
|
|
9641
|
+
if (!RULESYNC_TO_GEMINICLI_TOOL_NAME[toolName]) {
|
|
9642
|
+
logger?.warn(`Gemini CLI permissions use direct tool names. Mapping as-is: ${toolName}`);
|
|
9643
|
+
}
|
|
9644
|
+
for (const [pattern, action] of Object.entries(rules)) {
|
|
9645
|
+
if (action === "ask") {
|
|
9646
|
+
logger?.warn(
|
|
9647
|
+
`Gemini CLI does not support explicit "ask" rules in settings. Skipping ${toolName}:${pattern}`
|
|
9648
|
+
);
|
|
9649
|
+
continue;
|
|
9650
|
+
}
|
|
9651
|
+
const geminiEntry = pattern === "*" ? mappedToolName : `${mappedToolName}(${pattern})`;
|
|
9652
|
+
if (action === "allow") {
|
|
9653
|
+
allowed.push(geminiEntry);
|
|
9654
|
+
} else {
|
|
9655
|
+
exclude.push(geminiEntry);
|
|
9656
|
+
}
|
|
9657
|
+
}
|
|
9658
|
+
}
|
|
9659
|
+
return { allowed, exclude };
|
|
9660
|
+
}
|
|
9661
|
+
function parseGeminicliToolEntry({ entry }) {
|
|
9662
|
+
const match = /^([^()]+?)(?:\((.*)\))?$/.exec(entry);
|
|
9663
|
+
if (!match) return { category: entry, pattern: "*" };
|
|
9664
|
+
const rawToolName = match[1]?.trim() ?? entry;
|
|
9665
|
+
const mappedCategory = Object.entries(RULESYNC_TO_GEMINICLI_TOOL_NAME).find(
|
|
9666
|
+
([, value]) => value === rawToolName
|
|
9667
|
+
)?.[0];
|
|
9668
|
+
return {
|
|
9669
|
+
category: mappedCategory ?? rawToolName,
|
|
9670
|
+
pattern: (match[2] ?? "*").trim()
|
|
9671
|
+
};
|
|
9672
|
+
}
|
|
9673
|
+
|
|
9674
|
+
// src/features/permissions/opencode-permissions.ts
|
|
9675
|
+
var import_node_path68 = require("path");
|
|
9676
|
+
var import_jsonc_parser5 = require("jsonc-parser");
|
|
9677
|
+
var import_mini30 = require("zod/mini");
|
|
9678
|
+
var OpencodePermissionSchema = import_mini30.z.union([
|
|
9679
|
+
import_mini30.z.enum(["allow", "ask", "deny"]),
|
|
9680
|
+
import_mini30.z.record(import_mini30.z.string(), import_mini30.z.enum(["allow", "ask", "deny"]))
|
|
9313
9681
|
]);
|
|
9314
|
-
var OpencodePermissionsConfigSchema =
|
|
9315
|
-
permission:
|
|
9682
|
+
var OpencodePermissionsConfigSchema = import_mini30.z.looseObject({
|
|
9683
|
+
permission: import_mini30.z.optional(import_mini30.z.record(import_mini30.z.string(), OpencodePermissionSchema))
|
|
9316
9684
|
});
|
|
9317
9685
|
var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
9318
9686
|
json;
|
|
@@ -9329,7 +9697,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9329
9697
|
static getSettablePaths({
|
|
9330
9698
|
global = false
|
|
9331
9699
|
} = {}) {
|
|
9332
|
-
return global ? { relativeDirPath: (0,
|
|
9700
|
+
return global ? { relativeDirPath: (0, import_node_path68.join)(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
9333
9701
|
}
|
|
9334
9702
|
static async fromFile({
|
|
9335
9703
|
baseDir = process.cwd(),
|
|
@@ -9337,9 +9705,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9337
9705
|
global = false
|
|
9338
9706
|
}) {
|
|
9339
9707
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9340
|
-
const jsonDir = (0,
|
|
9341
|
-
const jsoncPath = (0,
|
|
9342
|
-
const jsonPath = (0,
|
|
9708
|
+
const jsonDir = (0, import_node_path68.join)(baseDir, basePaths.relativeDirPath);
|
|
9709
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "opencode.jsonc");
|
|
9710
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "opencode.json");
|
|
9343
9711
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9344
9712
|
let relativeFilePath = "opencode.jsonc";
|
|
9345
9713
|
if (!fileContent) {
|
|
@@ -9364,9 +9732,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9364
9732
|
global = false
|
|
9365
9733
|
}) {
|
|
9366
9734
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
9367
|
-
const jsonDir = (0,
|
|
9368
|
-
const jsoncPath = (0,
|
|
9369
|
-
const jsonPath = (0,
|
|
9735
|
+
const jsonDir = (0, import_node_path68.join)(baseDir, basePaths.relativeDirPath);
|
|
9736
|
+
const jsoncPath = (0, import_node_path68.join)(jsonDir, "opencode.jsonc");
|
|
9737
|
+
const jsonPath = (0, import_node_path68.join)(jsonDir, "opencode.json");
|
|
9370
9738
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
9371
9739
|
let relativeFilePath = "opencode.jsonc";
|
|
9372
9740
|
if (!fileContent) {
|
|
@@ -9436,8 +9804,13 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
9436
9804
|
};
|
|
9437
9805
|
|
|
9438
9806
|
// src/features/permissions/permissions-processor.ts
|
|
9439
|
-
var permissionsProcessorToolTargetTuple = [
|
|
9440
|
-
|
|
9807
|
+
var permissionsProcessorToolTargetTuple = [
|
|
9808
|
+
"claudecode",
|
|
9809
|
+
"codexcli",
|
|
9810
|
+
"geminicli",
|
|
9811
|
+
"opencode"
|
|
9812
|
+
];
|
|
9813
|
+
var PermissionsProcessorToolTargetSchema = import_mini31.z.enum(permissionsProcessorToolTargetTuple);
|
|
9441
9814
|
var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
9442
9815
|
[
|
|
9443
9816
|
"claudecode",
|
|
@@ -9450,6 +9823,28 @@ var toolPermissionsFactories = /* @__PURE__ */ new Map([
|
|
|
9450
9823
|
}
|
|
9451
9824
|
}
|
|
9452
9825
|
],
|
|
9826
|
+
[
|
|
9827
|
+
"codexcli",
|
|
9828
|
+
{
|
|
9829
|
+
class: CodexcliPermissions,
|
|
9830
|
+
meta: {
|
|
9831
|
+
supportsProject: true,
|
|
9832
|
+
supportsGlobal: true,
|
|
9833
|
+
supportsImport: true
|
|
9834
|
+
}
|
|
9835
|
+
}
|
|
9836
|
+
],
|
|
9837
|
+
[
|
|
9838
|
+
"geminicli",
|
|
9839
|
+
{
|
|
9840
|
+
class: GeminicliPermissions,
|
|
9841
|
+
meta: {
|
|
9842
|
+
supportsProject: true,
|
|
9843
|
+
supportsGlobal: true,
|
|
9844
|
+
supportsImport: true
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9847
|
+
],
|
|
9453
9848
|
[
|
|
9454
9849
|
"opencode",
|
|
9455
9850
|
{
|
|
@@ -9560,25 +9955,25 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
9560
9955
|
};
|
|
9561
9956
|
|
|
9562
9957
|
// src/features/rules/rules-processor.ts
|
|
9563
|
-
var
|
|
9958
|
+
var import_node_path138 = require("path");
|
|
9564
9959
|
var import_toon = require("@toon-format/toon");
|
|
9565
|
-
var
|
|
9960
|
+
var import_mini70 = require("zod/mini");
|
|
9566
9961
|
|
|
9567
9962
|
// src/constants/general.ts
|
|
9568
9963
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
9569
9964
|
|
|
9570
9965
|
// src/features/skills/agentsmd-skill.ts
|
|
9571
|
-
var
|
|
9966
|
+
var import_node_path72 = require("path");
|
|
9572
9967
|
|
|
9573
9968
|
// src/features/skills/simulated-skill.ts
|
|
9574
|
-
var
|
|
9575
|
-
var
|
|
9969
|
+
var import_node_path71 = require("path");
|
|
9970
|
+
var import_mini32 = require("zod/mini");
|
|
9576
9971
|
|
|
9577
9972
|
// src/features/skills/tool-skill.ts
|
|
9578
|
-
var
|
|
9973
|
+
var import_node_path70 = require("path");
|
|
9579
9974
|
|
|
9580
9975
|
// src/types/ai-dir.ts
|
|
9581
|
-
var
|
|
9976
|
+
var import_node_path69 = __toESM(require("path"), 1);
|
|
9582
9977
|
var AiDir = class {
|
|
9583
9978
|
/**
|
|
9584
9979
|
* @example "."
|
|
@@ -9612,7 +10007,7 @@ var AiDir = class {
|
|
|
9612
10007
|
otherFiles = [],
|
|
9613
10008
|
global = false
|
|
9614
10009
|
}) {
|
|
9615
|
-
if (dirName.includes(
|
|
10010
|
+
if (dirName.includes(import_node_path69.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
9616
10011
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
9617
10012
|
}
|
|
9618
10013
|
this.baseDir = baseDir;
|
|
@@ -9635,11 +10030,11 @@ var AiDir = class {
|
|
|
9635
10030
|
return this.dirName;
|
|
9636
10031
|
}
|
|
9637
10032
|
getDirPath() {
|
|
9638
|
-
const fullPath =
|
|
9639
|
-
const resolvedFull = (0,
|
|
9640
|
-
const resolvedBase = (0,
|
|
9641
|
-
const rel = (0,
|
|
9642
|
-
if (rel.startsWith("..") ||
|
|
10033
|
+
const fullPath = import_node_path69.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
10034
|
+
const resolvedFull = (0, import_node_path69.resolve)(fullPath);
|
|
10035
|
+
const resolvedBase = (0, import_node_path69.resolve)(this.baseDir);
|
|
10036
|
+
const rel = (0, import_node_path69.relative)(resolvedBase, resolvedFull);
|
|
10037
|
+
if (rel.startsWith("..") || import_node_path69.default.isAbsolute(rel)) {
|
|
9643
10038
|
throw new Error(
|
|
9644
10039
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
9645
10040
|
);
|
|
@@ -9656,7 +10051,7 @@ var AiDir = class {
|
|
|
9656
10051
|
* Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
|
|
9657
10052
|
*/
|
|
9658
10053
|
getRelativePathFromCwd() {
|
|
9659
|
-
return toPosixPath(
|
|
10054
|
+
return toPosixPath(import_node_path69.default.join(this.relativeDirPath, this.dirName));
|
|
9660
10055
|
}
|
|
9661
10056
|
getGlobal() {
|
|
9662
10057
|
return this.global;
|
|
@@ -9675,15 +10070,15 @@ var AiDir = class {
|
|
|
9675
10070
|
* @returns Array of files with their relative paths and buffers
|
|
9676
10071
|
*/
|
|
9677
10072
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
9678
|
-
const dirPath = (0,
|
|
9679
|
-
const glob = (0,
|
|
10073
|
+
const dirPath = (0, import_node_path69.join)(baseDir, relativeDirPath, dirName);
|
|
10074
|
+
const glob = (0, import_node_path69.join)(dirPath, "**", "*");
|
|
9680
10075
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
9681
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
10076
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path69.basename)(filePath) !== excludeFileName);
|
|
9682
10077
|
const files = await Promise.all(
|
|
9683
10078
|
filteredPaths.map(async (filePath) => {
|
|
9684
10079
|
const fileBuffer = await readFileBuffer(filePath);
|
|
9685
10080
|
return {
|
|
9686
|
-
relativeFilePathToDirPath: (0,
|
|
10081
|
+
relativeFilePathToDirPath: (0, import_node_path69.relative)(dirPath, filePath),
|
|
9687
10082
|
fileBuffer
|
|
9688
10083
|
};
|
|
9689
10084
|
})
|
|
@@ -9777,8 +10172,8 @@ var ToolSkill = class extends AiDir {
|
|
|
9777
10172
|
}) {
|
|
9778
10173
|
const settablePaths = getSettablePaths({ global });
|
|
9779
10174
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
9780
|
-
const skillDirPath = (0,
|
|
9781
|
-
const skillFilePath = (0,
|
|
10175
|
+
const skillDirPath = (0, import_node_path70.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10176
|
+
const skillFilePath = (0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME);
|
|
9782
10177
|
if (!await fileExists(skillFilePath)) {
|
|
9783
10178
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
9784
10179
|
}
|
|
@@ -9802,16 +10197,16 @@ var ToolSkill = class extends AiDir {
|
|
|
9802
10197
|
}
|
|
9803
10198
|
requireMainFileFrontmatter() {
|
|
9804
10199
|
if (!this.mainFile?.frontmatter) {
|
|
9805
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10200
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path70.join)(this.relativeDirPath, this.dirName)}`);
|
|
9806
10201
|
}
|
|
9807
10202
|
return this.mainFile.frontmatter;
|
|
9808
10203
|
}
|
|
9809
10204
|
};
|
|
9810
10205
|
|
|
9811
10206
|
// src/features/skills/simulated-skill.ts
|
|
9812
|
-
var SimulatedSkillFrontmatterSchema =
|
|
9813
|
-
name:
|
|
9814
|
-
description:
|
|
10207
|
+
var SimulatedSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
10208
|
+
name: import_mini32.z.string(),
|
|
10209
|
+
description: import_mini32.z.string()
|
|
9815
10210
|
});
|
|
9816
10211
|
var SimulatedSkill = class extends ToolSkill {
|
|
9817
10212
|
frontmatter;
|
|
@@ -9842,7 +10237,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
9842
10237
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
9843
10238
|
if (!result.success) {
|
|
9844
10239
|
throw new Error(
|
|
9845
|
-
`Invalid frontmatter in ${(0,
|
|
10240
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
9846
10241
|
);
|
|
9847
10242
|
}
|
|
9848
10243
|
}
|
|
@@ -9901,8 +10296,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
9901
10296
|
}) {
|
|
9902
10297
|
const settablePaths = this.getSettablePaths();
|
|
9903
10298
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
9904
|
-
const skillDirPath = (0,
|
|
9905
|
-
const skillFilePath = (0,
|
|
10299
|
+
const skillDirPath = (0, import_node_path71.join)(baseDir, actualRelativeDirPath, dirName);
|
|
10300
|
+
const skillFilePath = (0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME);
|
|
9906
10301
|
if (!await fileExists(skillFilePath)) {
|
|
9907
10302
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
9908
10303
|
}
|
|
@@ -9979,7 +10374,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
9979
10374
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
9980
10375
|
}
|
|
9981
10376
|
return {
|
|
9982
|
-
relativeDirPath: (0,
|
|
10377
|
+
relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
|
|
9983
10378
|
};
|
|
9984
10379
|
}
|
|
9985
10380
|
static async fromDir(params) {
|
|
@@ -10006,11 +10401,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
10006
10401
|
};
|
|
10007
10402
|
|
|
10008
10403
|
// src/features/skills/factorydroid-skill.ts
|
|
10009
|
-
var
|
|
10404
|
+
var import_node_path73 = require("path");
|
|
10010
10405
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
10011
10406
|
static getSettablePaths(_options) {
|
|
10012
10407
|
return {
|
|
10013
|
-
relativeDirPath: (0,
|
|
10408
|
+
relativeDirPath: (0, import_node_path73.join)(".factory", "skills")
|
|
10014
10409
|
};
|
|
10015
10410
|
}
|
|
10016
10411
|
static async fromDir(params) {
|
|
@@ -10037,50 +10432,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
10037
10432
|
};
|
|
10038
10433
|
|
|
10039
10434
|
// src/features/skills/rovodev-skill.ts
|
|
10040
|
-
var
|
|
10041
|
-
var
|
|
10435
|
+
var import_node_path75 = require("path");
|
|
10436
|
+
var import_mini34 = require("zod/mini");
|
|
10042
10437
|
|
|
10043
10438
|
// src/features/skills/rulesync-skill.ts
|
|
10044
|
-
var
|
|
10045
|
-
var
|
|
10046
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
10047
|
-
name:
|
|
10048
|
-
description:
|
|
10049
|
-
targets:
|
|
10050
|
-
claudecode:
|
|
10051
|
-
|
|
10052
|
-
"allowed-tools":
|
|
10053
|
-
model:
|
|
10054
|
-
"disable-model-invocation":
|
|
10439
|
+
var import_node_path74 = require("path");
|
|
10440
|
+
var import_mini33 = require("zod/mini");
|
|
10441
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini33.z.looseObject({
|
|
10442
|
+
name: import_mini33.z.string(),
|
|
10443
|
+
description: import_mini33.z.string(),
|
|
10444
|
+
targets: import_mini33.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10445
|
+
claudecode: import_mini33.z.optional(
|
|
10446
|
+
import_mini33.z.looseObject({
|
|
10447
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string())),
|
|
10448
|
+
model: import_mini33.z.optional(import_mini33.z.string()),
|
|
10449
|
+
"disable-model-invocation": import_mini33.z.optional(import_mini33.z.boolean())
|
|
10055
10450
|
})
|
|
10056
10451
|
),
|
|
10057
|
-
codexcli:
|
|
10058
|
-
|
|
10059
|
-
"short-description":
|
|
10452
|
+
codexcli: import_mini33.z.optional(
|
|
10453
|
+
import_mini33.z.looseObject({
|
|
10454
|
+
"short-description": import_mini33.z.optional(import_mini33.z.string())
|
|
10060
10455
|
})
|
|
10061
10456
|
),
|
|
10062
|
-
opencode:
|
|
10063
|
-
|
|
10064
|
-
"allowed-tools":
|
|
10457
|
+
opencode: import_mini33.z.optional(
|
|
10458
|
+
import_mini33.z.looseObject({
|
|
10459
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10065
10460
|
})
|
|
10066
10461
|
),
|
|
10067
|
-
kilo:
|
|
10068
|
-
|
|
10069
|
-
"allowed-tools":
|
|
10462
|
+
kilo: import_mini33.z.optional(
|
|
10463
|
+
import_mini33.z.looseObject({
|
|
10464
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10070
10465
|
})
|
|
10071
10466
|
),
|
|
10072
|
-
deepagents:
|
|
10073
|
-
|
|
10074
|
-
"allowed-tools":
|
|
10467
|
+
deepagents: import_mini33.z.optional(
|
|
10468
|
+
import_mini33.z.looseObject({
|
|
10469
|
+
"allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
|
|
10075
10470
|
})
|
|
10076
10471
|
),
|
|
10077
|
-
copilot:
|
|
10078
|
-
|
|
10079
|
-
license:
|
|
10472
|
+
copilot: import_mini33.z.optional(
|
|
10473
|
+
import_mini33.z.looseObject({
|
|
10474
|
+
license: import_mini33.z.optional(import_mini33.z.string())
|
|
10080
10475
|
})
|
|
10081
10476
|
),
|
|
10082
|
-
cline:
|
|
10083
|
-
roo:
|
|
10477
|
+
cline: import_mini33.z.optional(import_mini33.z.looseObject({})),
|
|
10478
|
+
roo: import_mini33.z.optional(import_mini33.z.looseObject({}))
|
|
10084
10479
|
});
|
|
10085
10480
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
10086
10481
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -10120,7 +10515,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10120
10515
|
}
|
|
10121
10516
|
getFrontmatter() {
|
|
10122
10517
|
if (!this.mainFile?.frontmatter) {
|
|
10123
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
10518
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path74.join)(this.relativeDirPath, this.dirName)}`);
|
|
10124
10519
|
}
|
|
10125
10520
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
10126
10521
|
return result;
|
|
@@ -10146,8 +10541,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10146
10541
|
dirName,
|
|
10147
10542
|
global = false
|
|
10148
10543
|
}) {
|
|
10149
|
-
const skillDirPath = (0,
|
|
10150
|
-
const skillFilePath = (0,
|
|
10544
|
+
const skillDirPath = (0, import_node_path74.join)(baseDir, relativeDirPath, dirName);
|
|
10545
|
+
const skillFilePath = (0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME);
|
|
10151
10546
|
if (!await fileExists(skillFilePath)) {
|
|
10152
10547
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10153
10548
|
}
|
|
@@ -10177,14 +10572,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
10177
10572
|
};
|
|
10178
10573
|
|
|
10179
10574
|
// src/features/skills/rovodev-skill.ts
|
|
10180
|
-
var RovodevSkillFrontmatterSchema =
|
|
10181
|
-
name:
|
|
10182
|
-
description:
|
|
10575
|
+
var RovodevSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
10576
|
+
name: import_mini34.z.string(),
|
|
10577
|
+
description: import_mini34.z.string()
|
|
10183
10578
|
});
|
|
10184
10579
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
10185
10580
|
constructor({
|
|
10186
10581
|
baseDir = process.cwd(),
|
|
10187
|
-
relativeDirPath = (0,
|
|
10582
|
+
relativeDirPath = (0, import_node_path75.join)(".rovodev", "skills"),
|
|
10188
10583
|
dirName,
|
|
10189
10584
|
frontmatter,
|
|
10190
10585
|
body,
|
|
@@ -10213,8 +10608,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10213
10608
|
}
|
|
10214
10609
|
static getSettablePaths(_options) {
|
|
10215
10610
|
return {
|
|
10216
|
-
relativeDirPath: (0,
|
|
10217
|
-
alternativeSkillRoots: [(0,
|
|
10611
|
+
relativeDirPath: (0, import_node_path75.join)(".rovodev", "skills"),
|
|
10612
|
+
alternativeSkillRoots: [(0, import_node_path75.join)(".agents", "skills")]
|
|
10218
10613
|
};
|
|
10219
10614
|
}
|
|
10220
10615
|
getFrontmatter() {
|
|
@@ -10302,13 +10697,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10302
10697
|
});
|
|
10303
10698
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10304
10699
|
if (!result.success) {
|
|
10305
|
-
const skillDirPath = (0,
|
|
10700
|
+
const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10306
10701
|
throw new Error(
|
|
10307
|
-
`Invalid frontmatter in ${(0,
|
|
10702
|
+
`Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10308
10703
|
);
|
|
10309
10704
|
}
|
|
10310
10705
|
if (result.data.name !== loaded.dirName) {
|
|
10311
|
-
const skillFilePath = (0,
|
|
10706
|
+
const skillFilePath = (0, import_node_path75.join)(
|
|
10312
10707
|
loaded.baseDir,
|
|
10313
10708
|
loaded.relativeDirPath,
|
|
10314
10709
|
loaded.dirName,
|
|
@@ -10350,11 +10745,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
10350
10745
|
};
|
|
10351
10746
|
|
|
10352
10747
|
// src/features/skills/skills-processor.ts
|
|
10353
|
-
var
|
|
10354
|
-
var
|
|
10748
|
+
var import_node_path93 = require("path");
|
|
10749
|
+
var import_mini50 = require("zod/mini");
|
|
10355
10750
|
|
|
10356
10751
|
// src/types/dir-feature-processor.ts
|
|
10357
|
-
var
|
|
10752
|
+
var import_node_path76 = require("path");
|
|
10358
10753
|
var DirFeatureProcessor = class {
|
|
10359
10754
|
baseDir;
|
|
10360
10755
|
dryRun;
|
|
@@ -10394,7 +10789,7 @@ var DirFeatureProcessor = class {
|
|
|
10394
10789
|
const mainFile = aiDir.getMainFile();
|
|
10395
10790
|
let mainFileContent;
|
|
10396
10791
|
if (mainFile) {
|
|
10397
|
-
const mainFilePath = (0,
|
|
10792
|
+
const mainFilePath = (0, import_node_path76.join)(dirPath, mainFile.name);
|
|
10398
10793
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
10399
10794
|
avoidBlockScalars: this.avoidBlockScalars
|
|
10400
10795
|
});
|
|
@@ -10414,7 +10809,7 @@ var DirFeatureProcessor = class {
|
|
|
10414
10809
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
10415
10810
|
otherFileContents.push(contentWithNewline);
|
|
10416
10811
|
if (!dirHasChanges) {
|
|
10417
|
-
const filePath = (0,
|
|
10812
|
+
const filePath = (0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath);
|
|
10418
10813
|
const existingContent = await readFileContentOrNull(filePath);
|
|
10419
10814
|
if (!fileContentsEquivalent({
|
|
10420
10815
|
filePath,
|
|
@@ -10432,24 +10827,24 @@ var DirFeatureProcessor = class {
|
|
|
10432
10827
|
if (this.dryRun) {
|
|
10433
10828
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
10434
10829
|
if (mainFile) {
|
|
10435
|
-
this.logger.info(`[DRY RUN] Would write: ${(0,
|
|
10436
|
-
changedPaths.push((0,
|
|
10830
|
+
this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path76.join)(dirPath, mainFile.name)}`);
|
|
10831
|
+
changedPaths.push((0, import_node_path76.join)(relativeDir, mainFile.name));
|
|
10437
10832
|
}
|
|
10438
10833
|
for (const file of otherFiles) {
|
|
10439
10834
|
this.logger.info(
|
|
10440
|
-
`[DRY RUN] Would write: ${(0,
|
|
10835
|
+
`[DRY RUN] Would write: ${(0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath)}`
|
|
10441
10836
|
);
|
|
10442
|
-
changedPaths.push((0,
|
|
10837
|
+
changedPaths.push((0, import_node_path76.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
10443
10838
|
}
|
|
10444
10839
|
} else {
|
|
10445
10840
|
await ensureDir(dirPath);
|
|
10446
10841
|
if (mainFile && mainFileContent) {
|
|
10447
|
-
const mainFilePath = (0,
|
|
10842
|
+
const mainFilePath = (0, import_node_path76.join)(dirPath, mainFile.name);
|
|
10448
10843
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
10449
|
-
changedPaths.push((0,
|
|
10844
|
+
changedPaths.push((0, import_node_path76.join)(relativeDir, mainFile.name));
|
|
10450
10845
|
}
|
|
10451
10846
|
for (const [i, file] of otherFiles.entries()) {
|
|
10452
|
-
const filePath = (0,
|
|
10847
|
+
const filePath = (0, import_node_path76.join)(dirPath, file.relativeFilePathToDirPath);
|
|
10453
10848
|
const content = otherFileContents[i];
|
|
10454
10849
|
if (content === void 0) {
|
|
10455
10850
|
throw new Error(
|
|
@@ -10457,7 +10852,7 @@ var DirFeatureProcessor = class {
|
|
|
10457
10852
|
);
|
|
10458
10853
|
}
|
|
10459
10854
|
await writeFileContent(filePath, content);
|
|
10460
|
-
changedPaths.push((0,
|
|
10855
|
+
changedPaths.push((0, import_node_path76.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
10461
10856
|
}
|
|
10462
10857
|
}
|
|
10463
10858
|
changedCount++;
|
|
@@ -10489,16 +10884,16 @@ var DirFeatureProcessor = class {
|
|
|
10489
10884
|
};
|
|
10490
10885
|
|
|
10491
10886
|
// src/features/skills/agentsskills-skill.ts
|
|
10492
|
-
var
|
|
10493
|
-
var
|
|
10494
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
10495
|
-
name:
|
|
10496
|
-
description:
|
|
10887
|
+
var import_node_path77 = require("path");
|
|
10888
|
+
var import_mini35 = require("zod/mini");
|
|
10889
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
10890
|
+
name: import_mini35.z.string(),
|
|
10891
|
+
description: import_mini35.z.string()
|
|
10497
10892
|
});
|
|
10498
10893
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
10499
10894
|
constructor({
|
|
10500
10895
|
baseDir = process.cwd(),
|
|
10501
|
-
relativeDirPath = (0,
|
|
10896
|
+
relativeDirPath = (0, import_node_path77.join)(".agents", "skills"),
|
|
10502
10897
|
dirName,
|
|
10503
10898
|
frontmatter,
|
|
10504
10899
|
body,
|
|
@@ -10530,7 +10925,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
10530
10925
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
10531
10926
|
}
|
|
10532
10927
|
return {
|
|
10533
|
-
relativeDirPath: (0,
|
|
10928
|
+
relativeDirPath: (0, import_node_path77.join)(".agents", "skills")
|
|
10534
10929
|
};
|
|
10535
10930
|
}
|
|
10536
10931
|
getFrontmatter() {
|
|
@@ -10610,9 +11005,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
10610
11005
|
});
|
|
10611
11006
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10612
11007
|
if (!result.success) {
|
|
10613
|
-
const skillDirPath = (0,
|
|
11008
|
+
const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10614
11009
|
throw new Error(
|
|
10615
|
-
`Invalid frontmatter in ${(0,
|
|
11010
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10616
11011
|
);
|
|
10617
11012
|
}
|
|
10618
11013
|
return new _AgentsSkillsSkill({
|
|
@@ -10647,16 +11042,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
10647
11042
|
};
|
|
10648
11043
|
|
|
10649
11044
|
// src/features/skills/antigravity-skill.ts
|
|
10650
|
-
var
|
|
10651
|
-
var
|
|
10652
|
-
var AntigravitySkillFrontmatterSchema =
|
|
10653
|
-
name:
|
|
10654
|
-
description:
|
|
11045
|
+
var import_node_path78 = require("path");
|
|
11046
|
+
var import_mini36 = require("zod/mini");
|
|
11047
|
+
var AntigravitySkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
11048
|
+
name: import_mini36.z.string(),
|
|
11049
|
+
description: import_mini36.z.string()
|
|
10655
11050
|
});
|
|
10656
11051
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
10657
11052
|
constructor({
|
|
10658
11053
|
baseDir = process.cwd(),
|
|
10659
|
-
relativeDirPath = (0,
|
|
11054
|
+
relativeDirPath = (0, import_node_path78.join)(".agent", "skills"),
|
|
10660
11055
|
dirName,
|
|
10661
11056
|
frontmatter,
|
|
10662
11057
|
body,
|
|
@@ -10688,11 +11083,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
10688
11083
|
} = {}) {
|
|
10689
11084
|
if (global) {
|
|
10690
11085
|
return {
|
|
10691
|
-
relativeDirPath: (0,
|
|
11086
|
+
relativeDirPath: (0, import_node_path78.join)(".gemini", "antigravity", "skills")
|
|
10692
11087
|
};
|
|
10693
11088
|
}
|
|
10694
11089
|
return {
|
|
10695
|
-
relativeDirPath: (0,
|
|
11090
|
+
relativeDirPath: (0, import_node_path78.join)(".agent", "skills")
|
|
10696
11091
|
};
|
|
10697
11092
|
}
|
|
10698
11093
|
getFrontmatter() {
|
|
@@ -10772,9 +11167,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
10772
11167
|
});
|
|
10773
11168
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10774
11169
|
if (!result.success) {
|
|
10775
|
-
const skillDirPath = (0,
|
|
11170
|
+
const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10776
11171
|
throw new Error(
|
|
10777
|
-
`Invalid frontmatter in ${(0,
|
|
11172
|
+
`Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10778
11173
|
);
|
|
10779
11174
|
}
|
|
10780
11175
|
return new _AntigravitySkill({
|
|
@@ -10808,19 +11203,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
10808
11203
|
};
|
|
10809
11204
|
|
|
10810
11205
|
// src/features/skills/claudecode-skill.ts
|
|
10811
|
-
var
|
|
10812
|
-
var
|
|
10813
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
10814
|
-
name:
|
|
10815
|
-
description:
|
|
10816
|
-
"allowed-tools":
|
|
10817
|
-
model:
|
|
10818
|
-
"disable-model-invocation":
|
|
11206
|
+
var import_node_path79 = require("path");
|
|
11207
|
+
var import_mini37 = require("zod/mini");
|
|
11208
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini37.z.looseObject({
|
|
11209
|
+
name: import_mini37.z.string(),
|
|
11210
|
+
description: import_mini37.z.string(),
|
|
11211
|
+
"allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string())),
|
|
11212
|
+
model: import_mini37.z.optional(import_mini37.z.string()),
|
|
11213
|
+
"disable-model-invocation": import_mini37.z.optional(import_mini37.z.boolean())
|
|
10819
11214
|
});
|
|
10820
11215
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
10821
11216
|
constructor({
|
|
10822
11217
|
baseDir = process.cwd(),
|
|
10823
|
-
relativeDirPath = (0,
|
|
11218
|
+
relativeDirPath = (0, import_node_path79.join)(".claude", "skills"),
|
|
10824
11219
|
dirName,
|
|
10825
11220
|
frontmatter,
|
|
10826
11221
|
body,
|
|
@@ -10851,7 +11246,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
10851
11246
|
global: _global = false
|
|
10852
11247
|
} = {}) {
|
|
10853
11248
|
return {
|
|
10854
|
-
relativeDirPath: (0,
|
|
11249
|
+
relativeDirPath: (0, import_node_path79.join)(".claude", "skills")
|
|
10855
11250
|
};
|
|
10856
11251
|
}
|
|
10857
11252
|
getFrontmatter() {
|
|
@@ -10948,9 +11343,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
10948
11343
|
});
|
|
10949
11344
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
10950
11345
|
if (!result.success) {
|
|
10951
|
-
const skillDirPath = (0,
|
|
11346
|
+
const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
10952
11347
|
throw new Error(
|
|
10953
|
-
`Invalid frontmatter in ${(0,
|
|
11348
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
10954
11349
|
);
|
|
10955
11350
|
}
|
|
10956
11351
|
return new _ClaudecodeSkill({
|
|
@@ -10984,16 +11379,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
10984
11379
|
};
|
|
10985
11380
|
|
|
10986
11381
|
// src/features/skills/cline-skill.ts
|
|
10987
|
-
var
|
|
10988
|
-
var
|
|
10989
|
-
var ClineSkillFrontmatterSchema =
|
|
10990
|
-
name:
|
|
10991
|
-
description:
|
|
11382
|
+
var import_node_path80 = require("path");
|
|
11383
|
+
var import_mini38 = require("zod/mini");
|
|
11384
|
+
var ClineSkillFrontmatterSchema = import_mini38.z.looseObject({
|
|
11385
|
+
name: import_mini38.z.string(),
|
|
11386
|
+
description: import_mini38.z.string()
|
|
10992
11387
|
});
|
|
10993
11388
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
10994
11389
|
constructor({
|
|
10995
11390
|
baseDir = process.cwd(),
|
|
10996
|
-
relativeDirPath = (0,
|
|
11391
|
+
relativeDirPath = (0, import_node_path80.join)(".cline", "skills"),
|
|
10997
11392
|
dirName,
|
|
10998
11393
|
frontmatter,
|
|
10999
11394
|
body,
|
|
@@ -11022,7 +11417,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11022
11417
|
}
|
|
11023
11418
|
static getSettablePaths(_options = {}) {
|
|
11024
11419
|
return {
|
|
11025
|
-
relativeDirPath: (0,
|
|
11420
|
+
relativeDirPath: (0, import_node_path80.join)(".cline", "skills")
|
|
11026
11421
|
};
|
|
11027
11422
|
}
|
|
11028
11423
|
getFrontmatter() {
|
|
@@ -11110,13 +11505,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11110
11505
|
});
|
|
11111
11506
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11112
11507
|
if (!result.success) {
|
|
11113
|
-
const skillDirPath = (0,
|
|
11508
|
+
const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11114
11509
|
throw new Error(
|
|
11115
|
-
`Invalid frontmatter in ${(0,
|
|
11510
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11116
11511
|
);
|
|
11117
11512
|
}
|
|
11118
11513
|
if (result.data.name !== loaded.dirName) {
|
|
11119
|
-
const skillFilePath = (0,
|
|
11514
|
+
const skillFilePath = (0, import_node_path80.join)(
|
|
11120
11515
|
loaded.baseDir,
|
|
11121
11516
|
loaded.relativeDirPath,
|
|
11122
11517
|
loaded.dirName,
|
|
@@ -11157,21 +11552,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
11157
11552
|
};
|
|
11158
11553
|
|
|
11159
11554
|
// src/features/skills/codexcli-skill.ts
|
|
11160
|
-
var
|
|
11161
|
-
var
|
|
11162
|
-
var CodexCliSkillFrontmatterSchema =
|
|
11163
|
-
name:
|
|
11164
|
-
description:
|
|
11165
|
-
metadata:
|
|
11166
|
-
|
|
11167
|
-
"short-description":
|
|
11555
|
+
var import_node_path81 = require("path");
|
|
11556
|
+
var import_mini39 = require("zod/mini");
|
|
11557
|
+
var CodexCliSkillFrontmatterSchema = import_mini39.z.looseObject({
|
|
11558
|
+
name: import_mini39.z.string(),
|
|
11559
|
+
description: import_mini39.z.string(),
|
|
11560
|
+
metadata: import_mini39.z.optional(
|
|
11561
|
+
import_mini39.z.looseObject({
|
|
11562
|
+
"short-description": import_mini39.z.optional(import_mini39.z.string())
|
|
11168
11563
|
})
|
|
11169
11564
|
)
|
|
11170
11565
|
});
|
|
11171
11566
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
11172
11567
|
constructor({
|
|
11173
11568
|
baseDir = process.cwd(),
|
|
11174
|
-
relativeDirPath = (0,
|
|
11569
|
+
relativeDirPath = (0, import_node_path81.join)(".codex", "skills"),
|
|
11175
11570
|
dirName,
|
|
11176
11571
|
frontmatter,
|
|
11177
11572
|
body,
|
|
@@ -11202,7 +11597,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11202
11597
|
global: _global = false
|
|
11203
11598
|
} = {}) {
|
|
11204
11599
|
return {
|
|
11205
|
-
relativeDirPath: (0,
|
|
11600
|
+
relativeDirPath: (0, import_node_path81.join)(".codex", "skills")
|
|
11206
11601
|
};
|
|
11207
11602
|
}
|
|
11208
11603
|
getFrontmatter() {
|
|
@@ -11292,9 +11687,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11292
11687
|
});
|
|
11293
11688
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11294
11689
|
if (!result.success) {
|
|
11295
|
-
const skillDirPath = (0,
|
|
11690
|
+
const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11296
11691
|
throw new Error(
|
|
11297
|
-
`Invalid frontmatter in ${(0,
|
|
11692
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11298
11693
|
);
|
|
11299
11694
|
}
|
|
11300
11695
|
return new _CodexCliSkill({
|
|
@@ -11328,17 +11723,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
11328
11723
|
};
|
|
11329
11724
|
|
|
11330
11725
|
// src/features/skills/copilot-skill.ts
|
|
11331
|
-
var
|
|
11332
|
-
var
|
|
11333
|
-
var CopilotSkillFrontmatterSchema =
|
|
11334
|
-
name:
|
|
11335
|
-
description:
|
|
11336
|
-
license:
|
|
11726
|
+
var import_node_path82 = require("path");
|
|
11727
|
+
var import_mini40 = require("zod/mini");
|
|
11728
|
+
var CopilotSkillFrontmatterSchema = import_mini40.z.looseObject({
|
|
11729
|
+
name: import_mini40.z.string(),
|
|
11730
|
+
description: import_mini40.z.string(),
|
|
11731
|
+
license: import_mini40.z.optional(import_mini40.z.string())
|
|
11337
11732
|
});
|
|
11338
11733
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
11339
11734
|
constructor({
|
|
11340
11735
|
baseDir = process.cwd(),
|
|
11341
|
-
relativeDirPath = (0,
|
|
11736
|
+
relativeDirPath = (0, import_node_path82.join)(".github", "skills"),
|
|
11342
11737
|
dirName,
|
|
11343
11738
|
frontmatter,
|
|
11344
11739
|
body,
|
|
@@ -11370,7 +11765,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11370
11765
|
throw new Error("CopilotSkill does not support global mode.");
|
|
11371
11766
|
}
|
|
11372
11767
|
return {
|
|
11373
|
-
relativeDirPath: (0,
|
|
11768
|
+
relativeDirPath: (0, import_node_path82.join)(".github", "skills")
|
|
11374
11769
|
};
|
|
11375
11770
|
}
|
|
11376
11771
|
getFrontmatter() {
|
|
@@ -11456,9 +11851,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11456
11851
|
});
|
|
11457
11852
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11458
11853
|
if (!result.success) {
|
|
11459
|
-
const skillDirPath = (0,
|
|
11854
|
+
const skillDirPath = (0, import_node_path82.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11460
11855
|
throw new Error(
|
|
11461
|
-
`Invalid frontmatter in ${(0,
|
|
11856
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11462
11857
|
);
|
|
11463
11858
|
}
|
|
11464
11859
|
return new _CopilotSkill({
|
|
@@ -11493,16 +11888,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
11493
11888
|
};
|
|
11494
11889
|
|
|
11495
11890
|
// src/features/skills/cursor-skill.ts
|
|
11496
|
-
var
|
|
11497
|
-
var
|
|
11498
|
-
var CursorSkillFrontmatterSchema =
|
|
11499
|
-
name:
|
|
11500
|
-
description:
|
|
11891
|
+
var import_node_path83 = require("path");
|
|
11892
|
+
var import_mini41 = require("zod/mini");
|
|
11893
|
+
var CursorSkillFrontmatterSchema = import_mini41.z.looseObject({
|
|
11894
|
+
name: import_mini41.z.string(),
|
|
11895
|
+
description: import_mini41.z.string()
|
|
11501
11896
|
});
|
|
11502
11897
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
11503
11898
|
constructor({
|
|
11504
11899
|
baseDir = process.cwd(),
|
|
11505
|
-
relativeDirPath = (0,
|
|
11900
|
+
relativeDirPath = (0, import_node_path83.join)(".cursor", "skills"),
|
|
11506
11901
|
dirName,
|
|
11507
11902
|
frontmatter,
|
|
11508
11903
|
body,
|
|
@@ -11531,7 +11926,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
11531
11926
|
}
|
|
11532
11927
|
static getSettablePaths(_options) {
|
|
11533
11928
|
return {
|
|
11534
|
-
relativeDirPath: (0,
|
|
11929
|
+
relativeDirPath: (0, import_node_path83.join)(".cursor", "skills")
|
|
11535
11930
|
};
|
|
11536
11931
|
}
|
|
11537
11932
|
getFrontmatter() {
|
|
@@ -11611,9 +12006,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
11611
12006
|
});
|
|
11612
12007
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11613
12008
|
if (!result.success) {
|
|
11614
|
-
const skillDirPath = (0,
|
|
12009
|
+
const skillDirPath = (0, import_node_path83.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11615
12010
|
throw new Error(
|
|
11616
|
-
`Invalid frontmatter in ${(0,
|
|
12011
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11617
12012
|
);
|
|
11618
12013
|
}
|
|
11619
12014
|
return new _CursorSkill({
|
|
@@ -11648,17 +12043,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
11648
12043
|
};
|
|
11649
12044
|
|
|
11650
12045
|
// src/features/skills/deepagents-skill.ts
|
|
11651
|
-
var
|
|
11652
|
-
var
|
|
11653
|
-
var DeepagentsSkillFrontmatterSchema =
|
|
11654
|
-
name:
|
|
11655
|
-
description:
|
|
11656
|
-
"allowed-tools":
|
|
12046
|
+
var import_node_path84 = require("path");
|
|
12047
|
+
var import_mini42 = require("zod/mini");
|
|
12048
|
+
var DeepagentsSkillFrontmatterSchema = import_mini42.z.looseObject({
|
|
12049
|
+
name: import_mini42.z.string(),
|
|
12050
|
+
description: import_mini42.z.string(),
|
|
12051
|
+
"allowed-tools": import_mini42.z.optional(import_mini42.z.array(import_mini42.z.string()))
|
|
11657
12052
|
});
|
|
11658
12053
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
11659
12054
|
constructor({
|
|
11660
12055
|
baseDir = process.cwd(),
|
|
11661
|
-
relativeDirPath = (0,
|
|
12056
|
+
relativeDirPath = (0, import_node_path84.join)(".deepagents", "skills"),
|
|
11662
12057
|
dirName,
|
|
11663
12058
|
frontmatter,
|
|
11664
12059
|
body,
|
|
@@ -11687,7 +12082,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
11687
12082
|
}
|
|
11688
12083
|
static getSettablePaths(_options) {
|
|
11689
12084
|
return {
|
|
11690
|
-
relativeDirPath: (0,
|
|
12085
|
+
relativeDirPath: (0, import_node_path84.join)(".deepagents", "skills")
|
|
11691
12086
|
};
|
|
11692
12087
|
}
|
|
11693
12088
|
getFrontmatter() {
|
|
@@ -11773,9 +12168,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
11773
12168
|
});
|
|
11774
12169
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11775
12170
|
if (!result.success) {
|
|
11776
|
-
const skillDirPath = (0,
|
|
12171
|
+
const skillDirPath = (0, import_node_path84.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11777
12172
|
throw new Error(
|
|
11778
|
-
`Invalid frontmatter in ${(0,
|
|
12173
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11779
12174
|
);
|
|
11780
12175
|
}
|
|
11781
12176
|
return new _DeepagentsSkill({
|
|
@@ -11810,11 +12205,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
11810
12205
|
};
|
|
11811
12206
|
|
|
11812
12207
|
// src/features/skills/geminicli-skill.ts
|
|
11813
|
-
var
|
|
11814
|
-
var
|
|
11815
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
11816
|
-
name:
|
|
11817
|
-
description:
|
|
12208
|
+
var import_node_path85 = require("path");
|
|
12209
|
+
var import_mini43 = require("zod/mini");
|
|
12210
|
+
var GeminiCliSkillFrontmatterSchema = import_mini43.z.looseObject({
|
|
12211
|
+
name: import_mini43.z.string(),
|
|
12212
|
+
description: import_mini43.z.string()
|
|
11818
12213
|
});
|
|
11819
12214
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
11820
12215
|
constructor({
|
|
@@ -11850,7 +12245,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
11850
12245
|
global: _global = false
|
|
11851
12246
|
} = {}) {
|
|
11852
12247
|
return {
|
|
11853
|
-
relativeDirPath: (0,
|
|
12248
|
+
relativeDirPath: (0, import_node_path85.join)(".gemini", "skills")
|
|
11854
12249
|
};
|
|
11855
12250
|
}
|
|
11856
12251
|
getFrontmatter() {
|
|
@@ -11930,9 +12325,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
11930
12325
|
});
|
|
11931
12326
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11932
12327
|
if (!result.success) {
|
|
11933
|
-
const skillDirPath = (0,
|
|
12328
|
+
const skillDirPath = (0, import_node_path85.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11934
12329
|
throw new Error(
|
|
11935
|
-
`Invalid frontmatter in ${(0,
|
|
12330
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11936
12331
|
);
|
|
11937
12332
|
}
|
|
11938
12333
|
return new _GeminiCliSkill({
|
|
@@ -11967,16 +12362,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
11967
12362
|
};
|
|
11968
12363
|
|
|
11969
12364
|
// src/features/skills/junie-skill.ts
|
|
11970
|
-
var
|
|
11971
|
-
var
|
|
11972
|
-
var JunieSkillFrontmatterSchema =
|
|
11973
|
-
name:
|
|
11974
|
-
description:
|
|
12365
|
+
var import_node_path86 = require("path");
|
|
12366
|
+
var import_mini44 = require("zod/mini");
|
|
12367
|
+
var JunieSkillFrontmatterSchema = import_mini44.z.looseObject({
|
|
12368
|
+
name: import_mini44.z.string(),
|
|
12369
|
+
description: import_mini44.z.string()
|
|
11975
12370
|
});
|
|
11976
12371
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
11977
12372
|
constructor({
|
|
11978
12373
|
baseDir = process.cwd(),
|
|
11979
|
-
relativeDirPath = (0,
|
|
12374
|
+
relativeDirPath = (0, import_node_path86.join)(".junie", "skills"),
|
|
11980
12375
|
dirName,
|
|
11981
12376
|
frontmatter,
|
|
11982
12377
|
body,
|
|
@@ -12008,7 +12403,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12008
12403
|
throw new Error("JunieSkill does not support global mode.");
|
|
12009
12404
|
}
|
|
12010
12405
|
return {
|
|
12011
|
-
relativeDirPath: (0,
|
|
12406
|
+
relativeDirPath: (0, import_node_path86.join)(".junie", "skills")
|
|
12012
12407
|
};
|
|
12013
12408
|
}
|
|
12014
12409
|
getFrontmatter() {
|
|
@@ -12095,13 +12490,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12095
12490
|
});
|
|
12096
12491
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12097
12492
|
if (!result.success) {
|
|
12098
|
-
const skillDirPath = (0,
|
|
12493
|
+
const skillDirPath = (0, import_node_path86.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12099
12494
|
throw new Error(
|
|
12100
|
-
`Invalid frontmatter in ${(0,
|
|
12495
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12101
12496
|
);
|
|
12102
12497
|
}
|
|
12103
12498
|
if (result.data.name !== loaded.dirName) {
|
|
12104
|
-
const skillFilePath = (0,
|
|
12499
|
+
const skillFilePath = (0, import_node_path86.join)(
|
|
12105
12500
|
loaded.baseDir,
|
|
12106
12501
|
loaded.relativeDirPath,
|
|
12107
12502
|
loaded.dirName,
|
|
@@ -12143,17 +12538,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
12143
12538
|
};
|
|
12144
12539
|
|
|
12145
12540
|
// src/features/skills/kilo-skill.ts
|
|
12146
|
-
var
|
|
12147
|
-
var
|
|
12148
|
-
var KiloSkillFrontmatterSchema =
|
|
12149
|
-
name:
|
|
12150
|
-
description:
|
|
12151
|
-
"allowed-tools":
|
|
12541
|
+
var import_node_path87 = require("path");
|
|
12542
|
+
var import_mini45 = require("zod/mini");
|
|
12543
|
+
var KiloSkillFrontmatterSchema = import_mini45.z.looseObject({
|
|
12544
|
+
name: import_mini45.z.string(),
|
|
12545
|
+
description: import_mini45.z.string(),
|
|
12546
|
+
"allowed-tools": import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
|
|
12152
12547
|
});
|
|
12153
12548
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
12154
12549
|
constructor({
|
|
12155
12550
|
baseDir = process.cwd(),
|
|
12156
|
-
relativeDirPath = (0,
|
|
12551
|
+
relativeDirPath = (0, import_node_path87.join)(".kilo", "skills"),
|
|
12157
12552
|
dirName,
|
|
12158
12553
|
frontmatter,
|
|
12159
12554
|
body,
|
|
@@ -12182,7 +12577,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12182
12577
|
}
|
|
12183
12578
|
static getSettablePaths({ global = false } = {}) {
|
|
12184
12579
|
return {
|
|
12185
|
-
relativeDirPath: global ? (0,
|
|
12580
|
+
relativeDirPath: global ? (0, import_node_path87.join)(".config", "kilo", "skills") : (0, import_node_path87.join)(".kilo", "skills")
|
|
12186
12581
|
};
|
|
12187
12582
|
}
|
|
12188
12583
|
getFrontmatter() {
|
|
@@ -12268,9 +12663,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12268
12663
|
});
|
|
12269
12664
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12270
12665
|
if (!result.success) {
|
|
12271
|
-
const skillDirPath = (0,
|
|
12666
|
+
const skillDirPath = (0, import_node_path87.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12272
12667
|
throw new Error(
|
|
12273
|
-
`Invalid frontmatter in ${(0,
|
|
12668
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12274
12669
|
);
|
|
12275
12670
|
}
|
|
12276
12671
|
return new _KiloSkill({
|
|
@@ -12304,16 +12699,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
12304
12699
|
};
|
|
12305
12700
|
|
|
12306
12701
|
// src/features/skills/kiro-skill.ts
|
|
12307
|
-
var
|
|
12308
|
-
var
|
|
12309
|
-
var KiroSkillFrontmatterSchema =
|
|
12310
|
-
name:
|
|
12311
|
-
description:
|
|
12702
|
+
var import_node_path88 = require("path");
|
|
12703
|
+
var import_mini46 = require("zod/mini");
|
|
12704
|
+
var KiroSkillFrontmatterSchema = import_mini46.z.looseObject({
|
|
12705
|
+
name: import_mini46.z.string(),
|
|
12706
|
+
description: import_mini46.z.string()
|
|
12312
12707
|
});
|
|
12313
12708
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
12314
12709
|
constructor({
|
|
12315
12710
|
baseDir = process.cwd(),
|
|
12316
|
-
relativeDirPath = (0,
|
|
12711
|
+
relativeDirPath = (0, import_node_path88.join)(".kiro", "skills"),
|
|
12317
12712
|
dirName,
|
|
12318
12713
|
frontmatter,
|
|
12319
12714
|
body,
|
|
@@ -12345,7 +12740,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12345
12740
|
throw new Error("KiroSkill does not support global mode.");
|
|
12346
12741
|
}
|
|
12347
12742
|
return {
|
|
12348
|
-
relativeDirPath: (0,
|
|
12743
|
+
relativeDirPath: (0, import_node_path88.join)(".kiro", "skills")
|
|
12349
12744
|
};
|
|
12350
12745
|
}
|
|
12351
12746
|
getFrontmatter() {
|
|
@@ -12433,13 +12828,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12433
12828
|
});
|
|
12434
12829
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12435
12830
|
if (!result.success) {
|
|
12436
|
-
const skillDirPath = (0,
|
|
12831
|
+
const skillDirPath = (0, import_node_path88.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12437
12832
|
throw new Error(
|
|
12438
|
-
`Invalid frontmatter in ${(0,
|
|
12833
|
+
`Invalid frontmatter in ${(0, import_node_path88.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12439
12834
|
);
|
|
12440
12835
|
}
|
|
12441
12836
|
if (result.data.name !== loaded.dirName) {
|
|
12442
|
-
const skillFilePath = (0,
|
|
12837
|
+
const skillFilePath = (0, import_node_path88.join)(
|
|
12443
12838
|
loaded.baseDir,
|
|
12444
12839
|
loaded.relativeDirPath,
|
|
12445
12840
|
loaded.dirName,
|
|
@@ -12481,17 +12876,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
12481
12876
|
};
|
|
12482
12877
|
|
|
12483
12878
|
// src/features/skills/opencode-skill.ts
|
|
12484
|
-
var
|
|
12485
|
-
var
|
|
12486
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
12487
|
-
name:
|
|
12488
|
-
description:
|
|
12489
|
-
"allowed-tools":
|
|
12879
|
+
var import_node_path89 = require("path");
|
|
12880
|
+
var import_mini47 = require("zod/mini");
|
|
12881
|
+
var OpenCodeSkillFrontmatterSchema = import_mini47.z.looseObject({
|
|
12882
|
+
name: import_mini47.z.string(),
|
|
12883
|
+
description: import_mini47.z.string(),
|
|
12884
|
+
"allowed-tools": import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
|
|
12490
12885
|
});
|
|
12491
12886
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
12492
12887
|
constructor({
|
|
12493
12888
|
baseDir = process.cwd(),
|
|
12494
|
-
relativeDirPath = (0,
|
|
12889
|
+
relativeDirPath = (0, import_node_path89.join)(".opencode", "skill"),
|
|
12495
12890
|
dirName,
|
|
12496
12891
|
frontmatter,
|
|
12497
12892
|
body,
|
|
@@ -12520,7 +12915,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
12520
12915
|
}
|
|
12521
12916
|
static getSettablePaths({ global = false } = {}) {
|
|
12522
12917
|
return {
|
|
12523
|
-
relativeDirPath: global ? (0,
|
|
12918
|
+
relativeDirPath: global ? (0, import_node_path89.join)(".config", "opencode", "skill") : (0, import_node_path89.join)(".opencode", "skill")
|
|
12524
12919
|
};
|
|
12525
12920
|
}
|
|
12526
12921
|
getFrontmatter() {
|
|
@@ -12606,9 +13001,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
12606
13001
|
});
|
|
12607
13002
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12608
13003
|
if (!result.success) {
|
|
12609
|
-
const skillDirPath = (0,
|
|
13004
|
+
const skillDirPath = (0, import_node_path89.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12610
13005
|
throw new Error(
|
|
12611
|
-
`Invalid frontmatter in ${(0,
|
|
13006
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12612
13007
|
);
|
|
12613
13008
|
}
|
|
12614
13009
|
return new _OpenCodeSkill({
|
|
@@ -12642,16 +13037,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
12642
13037
|
};
|
|
12643
13038
|
|
|
12644
13039
|
// src/features/skills/replit-skill.ts
|
|
12645
|
-
var
|
|
12646
|
-
var
|
|
12647
|
-
var ReplitSkillFrontmatterSchema =
|
|
12648
|
-
name:
|
|
12649
|
-
description:
|
|
13040
|
+
var import_node_path90 = require("path");
|
|
13041
|
+
var import_mini48 = require("zod/mini");
|
|
13042
|
+
var ReplitSkillFrontmatterSchema = import_mini48.z.looseObject({
|
|
13043
|
+
name: import_mini48.z.string(),
|
|
13044
|
+
description: import_mini48.z.string()
|
|
12650
13045
|
});
|
|
12651
13046
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
12652
13047
|
constructor({
|
|
12653
13048
|
baseDir = process.cwd(),
|
|
12654
|
-
relativeDirPath = (0,
|
|
13049
|
+
relativeDirPath = (0, import_node_path90.join)(".agents", "skills"),
|
|
12655
13050
|
dirName,
|
|
12656
13051
|
frontmatter,
|
|
12657
13052
|
body,
|
|
@@ -12683,7 +13078,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
12683
13078
|
throw new Error("ReplitSkill does not support global mode.");
|
|
12684
13079
|
}
|
|
12685
13080
|
return {
|
|
12686
|
-
relativeDirPath: (0,
|
|
13081
|
+
relativeDirPath: (0, import_node_path90.join)(".agents", "skills")
|
|
12687
13082
|
};
|
|
12688
13083
|
}
|
|
12689
13084
|
getFrontmatter() {
|
|
@@ -12763,9 +13158,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
12763
13158
|
});
|
|
12764
13159
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12765
13160
|
if (!result.success) {
|
|
12766
|
-
const skillDirPath = (0,
|
|
13161
|
+
const skillDirPath = (0, import_node_path90.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12767
13162
|
throw new Error(
|
|
12768
|
-
`Invalid frontmatter in ${(0,
|
|
13163
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12769
13164
|
);
|
|
12770
13165
|
}
|
|
12771
13166
|
return new _ReplitSkill({
|
|
@@ -12800,16 +13195,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
12800
13195
|
};
|
|
12801
13196
|
|
|
12802
13197
|
// src/features/skills/roo-skill.ts
|
|
12803
|
-
var
|
|
12804
|
-
var
|
|
12805
|
-
var RooSkillFrontmatterSchema =
|
|
12806
|
-
name:
|
|
12807
|
-
description:
|
|
13198
|
+
var import_node_path91 = require("path");
|
|
13199
|
+
var import_mini49 = require("zod/mini");
|
|
13200
|
+
var RooSkillFrontmatterSchema = import_mini49.z.looseObject({
|
|
13201
|
+
name: import_mini49.z.string(),
|
|
13202
|
+
description: import_mini49.z.string()
|
|
12808
13203
|
});
|
|
12809
13204
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
12810
13205
|
constructor({
|
|
12811
13206
|
baseDir = process.cwd(),
|
|
12812
|
-
relativeDirPath = (0,
|
|
13207
|
+
relativeDirPath = (0, import_node_path91.join)(".roo", "skills"),
|
|
12813
13208
|
dirName,
|
|
12814
13209
|
frontmatter,
|
|
12815
13210
|
body,
|
|
@@ -12840,7 +13235,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
12840
13235
|
global: _global = false
|
|
12841
13236
|
} = {}) {
|
|
12842
13237
|
return {
|
|
12843
|
-
relativeDirPath: (0,
|
|
13238
|
+
relativeDirPath: (0, import_node_path91.join)(".roo", "skills")
|
|
12844
13239
|
};
|
|
12845
13240
|
}
|
|
12846
13241
|
getFrontmatter() {
|
|
@@ -12928,13 +13323,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
12928
13323
|
});
|
|
12929
13324
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12930
13325
|
if (!result.success) {
|
|
12931
|
-
const skillDirPath = (0,
|
|
13326
|
+
const skillDirPath = (0, import_node_path91.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12932
13327
|
throw new Error(
|
|
12933
|
-
`Invalid frontmatter in ${(0,
|
|
13328
|
+
`Invalid frontmatter in ${(0, import_node_path91.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12934
13329
|
);
|
|
12935
13330
|
}
|
|
12936
13331
|
if (result.data.name !== loaded.dirName) {
|
|
12937
|
-
const skillFilePath = (0,
|
|
13332
|
+
const skillFilePath = (0, import_node_path91.join)(
|
|
12938
13333
|
loaded.baseDir,
|
|
12939
13334
|
loaded.relativeDirPath,
|
|
12940
13335
|
loaded.dirName,
|
|
@@ -12975,17 +13370,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
12975
13370
|
};
|
|
12976
13371
|
|
|
12977
13372
|
// src/features/skills/skills-utils.ts
|
|
12978
|
-
var
|
|
13373
|
+
var import_node_path92 = require("path");
|
|
12979
13374
|
async function getLocalSkillDirNames(baseDir) {
|
|
12980
|
-
const skillsDir = (0,
|
|
13375
|
+
const skillsDir = (0, import_node_path92.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
12981
13376
|
const names = /* @__PURE__ */ new Set();
|
|
12982
13377
|
if (!await directoryExists(skillsDir)) {
|
|
12983
13378
|
return names;
|
|
12984
13379
|
}
|
|
12985
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
13380
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path92.join)(skillsDir, "*"), { type: "dir" });
|
|
12986
13381
|
for (const dirPath of dirPaths) {
|
|
12987
|
-
const name = (0,
|
|
12988
|
-
if (name === (0,
|
|
13382
|
+
const name = (0, import_node_path92.basename)(dirPath);
|
|
13383
|
+
if (name === (0, import_node_path92.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
12989
13384
|
names.add(name);
|
|
12990
13385
|
}
|
|
12991
13386
|
return names;
|
|
@@ -13013,7 +13408,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
13013
13408
|
"roo",
|
|
13014
13409
|
"rovodev"
|
|
13015
13410
|
];
|
|
13016
|
-
var SkillsProcessorToolTargetSchema =
|
|
13411
|
+
var SkillsProcessorToolTargetSchema = import_mini50.z.enum(skillsProcessorToolTargetTuple);
|
|
13017
13412
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
13018
13413
|
[
|
|
13019
13414
|
"agentsmd",
|
|
@@ -13237,11 +13632,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13237
13632
|
)
|
|
13238
13633
|
);
|
|
13239
13634
|
const localSkillNames = new Set(localDirNames);
|
|
13240
|
-
const curatedDirPath = (0,
|
|
13635
|
+
const curatedDirPath = (0, import_node_path93.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
13241
13636
|
let curatedSkills = [];
|
|
13242
13637
|
if (await directoryExists(curatedDirPath)) {
|
|
13243
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
13244
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
13638
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path93.join)(curatedDirPath, "*"), { type: "dir" });
|
|
13639
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path93.basename)(path3));
|
|
13245
13640
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
13246
13641
|
if (localSkillNames.has(name)) {
|
|
13247
13642
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -13278,13 +13673,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13278
13673
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
13279
13674
|
const loadEntries = [];
|
|
13280
13675
|
for (const root of roots) {
|
|
13281
|
-
const skillsDirPath = (0,
|
|
13676
|
+
const skillsDirPath = (0, import_node_path93.join)(this.baseDir, root);
|
|
13282
13677
|
if (!await directoryExists(skillsDirPath)) {
|
|
13283
13678
|
continue;
|
|
13284
13679
|
}
|
|
13285
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
13680
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13286
13681
|
for (const dirPath of dirPaths) {
|
|
13287
|
-
const dirName = (0,
|
|
13682
|
+
const dirName = (0, import_node_path93.basename)(dirPath);
|
|
13288
13683
|
if (seenDirNames.has(dirName)) {
|
|
13289
13684
|
continue;
|
|
13290
13685
|
}
|
|
@@ -13313,13 +13708,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13313
13708
|
const roots = toolSkillSearchRoots(paths);
|
|
13314
13709
|
const toolSkills = [];
|
|
13315
13710
|
for (const root of roots) {
|
|
13316
|
-
const skillsDirPath = (0,
|
|
13711
|
+
const skillsDirPath = (0, import_node_path93.join)(this.baseDir, root);
|
|
13317
13712
|
if (!await directoryExists(skillsDirPath)) {
|
|
13318
13713
|
continue;
|
|
13319
13714
|
}
|
|
13320
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
13715
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path93.join)(skillsDirPath, "*"), { type: "dir" });
|
|
13321
13716
|
for (const dirPath of dirPaths) {
|
|
13322
|
-
const dirName = (0,
|
|
13717
|
+
const dirName = (0, import_node_path93.basename)(dirPath);
|
|
13323
13718
|
const toolSkill = factory.class.forDeletion({
|
|
13324
13719
|
baseDir: this.baseDir,
|
|
13325
13720
|
relativeDirPath: root,
|
|
@@ -13381,11 +13776,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
13381
13776
|
};
|
|
13382
13777
|
|
|
13383
13778
|
// src/features/subagents/agentsmd-subagent.ts
|
|
13384
|
-
var
|
|
13779
|
+
var import_node_path95 = require("path");
|
|
13385
13780
|
|
|
13386
13781
|
// src/features/subagents/simulated-subagent.ts
|
|
13387
|
-
var
|
|
13388
|
-
var
|
|
13782
|
+
var import_node_path94 = require("path");
|
|
13783
|
+
var import_mini51 = require("zod/mini");
|
|
13389
13784
|
|
|
13390
13785
|
// src/features/subagents/tool-subagent.ts
|
|
13391
13786
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -13437,9 +13832,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
13437
13832
|
};
|
|
13438
13833
|
|
|
13439
13834
|
// src/features/subagents/simulated-subagent.ts
|
|
13440
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
13441
|
-
name:
|
|
13442
|
-
description:
|
|
13835
|
+
var SimulatedSubagentFrontmatterSchema = import_mini51.z.object({
|
|
13836
|
+
name: import_mini51.z.string(),
|
|
13837
|
+
description: import_mini51.z.optional(import_mini51.z.string())
|
|
13443
13838
|
});
|
|
13444
13839
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
13445
13840
|
frontmatter;
|
|
@@ -13449,7 +13844,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13449
13844
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13450
13845
|
if (!result.success) {
|
|
13451
13846
|
throw new Error(
|
|
13452
|
-
`Invalid frontmatter in ${(0,
|
|
13847
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13453
13848
|
);
|
|
13454
13849
|
}
|
|
13455
13850
|
}
|
|
@@ -13500,7 +13895,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13500
13895
|
return {
|
|
13501
13896
|
success: false,
|
|
13502
13897
|
error: new Error(
|
|
13503
|
-
`Invalid frontmatter in ${(0,
|
|
13898
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13504
13899
|
)
|
|
13505
13900
|
};
|
|
13506
13901
|
}
|
|
@@ -13510,7 +13905,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13510
13905
|
relativeFilePath,
|
|
13511
13906
|
validate = true
|
|
13512
13907
|
}) {
|
|
13513
|
-
const filePath = (0,
|
|
13908
|
+
const filePath = (0, import_node_path94.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
13514
13909
|
const fileContent = await readFileContent(filePath);
|
|
13515
13910
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13516
13911
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13520,7 +13915,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13520
13915
|
return {
|
|
13521
13916
|
baseDir,
|
|
13522
13917
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
13523
|
-
relativeFilePath: (0,
|
|
13918
|
+
relativeFilePath: (0, import_node_path94.basename)(relativeFilePath),
|
|
13524
13919
|
frontmatter: result.data,
|
|
13525
13920
|
body: content.trim(),
|
|
13526
13921
|
validate
|
|
@@ -13546,7 +13941,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
13546
13941
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
13547
13942
|
static getSettablePaths() {
|
|
13548
13943
|
return {
|
|
13549
|
-
relativeDirPath: (0,
|
|
13944
|
+
relativeDirPath: (0, import_node_path95.join)(".agents", "subagents")
|
|
13550
13945
|
};
|
|
13551
13946
|
}
|
|
13552
13947
|
static async fromFile(params) {
|
|
@@ -13569,11 +13964,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
13569
13964
|
};
|
|
13570
13965
|
|
|
13571
13966
|
// src/features/subagents/factorydroid-subagent.ts
|
|
13572
|
-
var
|
|
13967
|
+
var import_node_path96 = require("path");
|
|
13573
13968
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
13574
13969
|
static getSettablePaths(_options) {
|
|
13575
13970
|
return {
|
|
13576
|
-
relativeDirPath: (0,
|
|
13971
|
+
relativeDirPath: (0, import_node_path96.join)(".factory", "droids")
|
|
13577
13972
|
};
|
|
13578
13973
|
}
|
|
13579
13974
|
static async fromFile(params) {
|
|
@@ -13596,16 +13991,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
13596
13991
|
};
|
|
13597
13992
|
|
|
13598
13993
|
// src/features/subagents/geminicli-subagent.ts
|
|
13599
|
-
var
|
|
13600
|
-
var
|
|
13994
|
+
var import_node_path98 = require("path");
|
|
13995
|
+
var import_mini53 = require("zod/mini");
|
|
13601
13996
|
|
|
13602
13997
|
// src/features/subagents/rulesync-subagent.ts
|
|
13603
|
-
var
|
|
13604
|
-
var
|
|
13605
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
13606
|
-
targets:
|
|
13607
|
-
name:
|
|
13608
|
-
description:
|
|
13998
|
+
var import_node_path97 = require("path");
|
|
13999
|
+
var import_mini52 = require("zod/mini");
|
|
14000
|
+
var RulesyncSubagentFrontmatterSchema = import_mini52.z.looseObject({
|
|
14001
|
+
targets: import_mini52.z._default(RulesyncTargetsSchema, ["*"]),
|
|
14002
|
+
name: import_mini52.z.string(),
|
|
14003
|
+
description: import_mini52.z.optional(import_mini52.z.string())
|
|
13609
14004
|
});
|
|
13610
14005
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
13611
14006
|
frontmatter;
|
|
@@ -13614,7 +14009,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
13614
14009
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13615
14010
|
if (!parseResult.success && rest.validate !== false) {
|
|
13616
14011
|
throw new Error(
|
|
13617
|
-
`Invalid frontmatter in ${(0,
|
|
14012
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
13618
14013
|
);
|
|
13619
14014
|
}
|
|
13620
14015
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -13647,7 +14042,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
13647
14042
|
return {
|
|
13648
14043
|
success: false,
|
|
13649
14044
|
error: new Error(
|
|
13650
|
-
`Invalid frontmatter in ${(0,
|
|
14045
|
+
`Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13651
14046
|
)
|
|
13652
14047
|
};
|
|
13653
14048
|
}
|
|
@@ -13655,14 +14050,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
13655
14050
|
static async fromFile({
|
|
13656
14051
|
relativeFilePath
|
|
13657
14052
|
}) {
|
|
13658
|
-
const filePath = (0,
|
|
14053
|
+
const filePath = (0, import_node_path97.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
13659
14054
|
const fileContent = await readFileContent(filePath);
|
|
13660
14055
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13661
14056
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13662
14057
|
if (!result.success) {
|
|
13663
14058
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
13664
14059
|
}
|
|
13665
|
-
const filename = (0,
|
|
14060
|
+
const filename = (0, import_node_path97.basename)(relativeFilePath);
|
|
13666
14061
|
return new _RulesyncSubagent({
|
|
13667
14062
|
baseDir: process.cwd(),
|
|
13668
14063
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -13674,9 +14069,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
13674
14069
|
};
|
|
13675
14070
|
|
|
13676
14071
|
// src/features/subagents/geminicli-subagent.ts
|
|
13677
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
13678
|
-
name:
|
|
13679
|
-
description:
|
|
14072
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini53.z.looseObject({
|
|
14073
|
+
name: import_mini53.z.string(),
|
|
14074
|
+
description: import_mini53.z.optional(import_mini53.z.string())
|
|
13680
14075
|
});
|
|
13681
14076
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
13682
14077
|
frontmatter;
|
|
@@ -13686,7 +14081,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
13686
14081
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13687
14082
|
if (!result.success) {
|
|
13688
14083
|
throw new Error(
|
|
13689
|
-
`Invalid frontmatter in ${(0,
|
|
14084
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13690
14085
|
);
|
|
13691
14086
|
}
|
|
13692
14087
|
}
|
|
@@ -13699,7 +14094,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
13699
14094
|
}
|
|
13700
14095
|
static getSettablePaths(_options = {}) {
|
|
13701
14096
|
return {
|
|
13702
|
-
relativeDirPath: (0,
|
|
14097
|
+
relativeDirPath: (0, import_node_path98.join)(".gemini", "agents")
|
|
13703
14098
|
};
|
|
13704
14099
|
}
|
|
13705
14100
|
getFrontmatter() {
|
|
@@ -13767,7 +14162,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
13767
14162
|
return {
|
|
13768
14163
|
success: false,
|
|
13769
14164
|
error: new Error(
|
|
13770
|
-
`Invalid frontmatter in ${(0,
|
|
14165
|
+
`Invalid frontmatter in ${(0, import_node_path98.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13771
14166
|
)
|
|
13772
14167
|
};
|
|
13773
14168
|
}
|
|
@@ -13785,7 +14180,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
13785
14180
|
global = false
|
|
13786
14181
|
}) {
|
|
13787
14182
|
const paths = this.getSettablePaths({ global });
|
|
13788
|
-
const filePath = (0,
|
|
14183
|
+
const filePath = (0, import_node_path98.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13789
14184
|
const fileContent = await readFileContent(filePath);
|
|
13790
14185
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13791
14186
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13821,11 +14216,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
13821
14216
|
};
|
|
13822
14217
|
|
|
13823
14218
|
// src/features/subagents/roo-subagent.ts
|
|
13824
|
-
var
|
|
14219
|
+
var import_node_path99 = require("path");
|
|
13825
14220
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
13826
14221
|
static getSettablePaths() {
|
|
13827
14222
|
return {
|
|
13828
|
-
relativeDirPath: (0,
|
|
14223
|
+
relativeDirPath: (0, import_node_path99.join)(".roo", "subagents")
|
|
13829
14224
|
};
|
|
13830
14225
|
}
|
|
13831
14226
|
static async fromFile(params) {
|
|
@@ -13848,11 +14243,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
13848
14243
|
};
|
|
13849
14244
|
|
|
13850
14245
|
// src/features/subagents/rovodev-subagent.ts
|
|
13851
|
-
var
|
|
13852
|
-
var
|
|
13853
|
-
var RovodevSubagentFrontmatterSchema =
|
|
13854
|
-
name:
|
|
13855
|
-
description:
|
|
14246
|
+
var import_node_path100 = require("path");
|
|
14247
|
+
var import_mini54 = require("zod/mini");
|
|
14248
|
+
var RovodevSubagentFrontmatterSchema = import_mini54.z.looseObject({
|
|
14249
|
+
name: import_mini54.z.string(),
|
|
14250
|
+
description: import_mini54.z.optional(import_mini54.z.string())
|
|
13856
14251
|
});
|
|
13857
14252
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
13858
14253
|
frontmatter;
|
|
@@ -13862,7 +14257,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13862
14257
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
13863
14258
|
if (!result.success) {
|
|
13864
14259
|
throw new Error(
|
|
13865
|
-
`Invalid frontmatter in ${(0,
|
|
14260
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13866
14261
|
);
|
|
13867
14262
|
}
|
|
13868
14263
|
}
|
|
@@ -13874,7 +14269,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13874
14269
|
}
|
|
13875
14270
|
static getSettablePaths(_options = {}) {
|
|
13876
14271
|
return {
|
|
13877
|
-
relativeDirPath: (0,
|
|
14272
|
+
relativeDirPath: (0, import_node_path100.join)(".rovodev", "subagents")
|
|
13878
14273
|
};
|
|
13879
14274
|
}
|
|
13880
14275
|
getFrontmatter() {
|
|
@@ -13937,7 +14332,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13937
14332
|
return {
|
|
13938
14333
|
success: false,
|
|
13939
14334
|
error: new Error(
|
|
13940
|
-
`Invalid frontmatter in ${(0,
|
|
14335
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13941
14336
|
)
|
|
13942
14337
|
};
|
|
13943
14338
|
}
|
|
@@ -13954,7 +14349,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13954
14349
|
global = false
|
|
13955
14350
|
}) {
|
|
13956
14351
|
const paths = this.getSettablePaths({ global });
|
|
13957
|
-
const filePath = (0,
|
|
14352
|
+
const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
13958
14353
|
const fileContent = await readFileContent(filePath);
|
|
13959
14354
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
13960
14355
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -13993,19 +14388,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
13993
14388
|
};
|
|
13994
14389
|
|
|
13995
14390
|
// src/features/subagents/subagents-processor.ts
|
|
13996
|
-
var
|
|
13997
|
-
var
|
|
14391
|
+
var import_node_path111 = require("path");
|
|
14392
|
+
var import_mini63 = require("zod/mini");
|
|
13998
14393
|
|
|
13999
14394
|
// src/features/subagents/claudecode-subagent.ts
|
|
14000
|
-
var
|
|
14001
|
-
var
|
|
14002
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
14003
|
-
name:
|
|
14004
|
-
description:
|
|
14005
|
-
model:
|
|
14006
|
-
tools:
|
|
14007
|
-
permissionMode:
|
|
14008
|
-
skills:
|
|
14395
|
+
var import_node_path101 = require("path");
|
|
14396
|
+
var import_mini55 = require("zod/mini");
|
|
14397
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini55.z.looseObject({
|
|
14398
|
+
name: import_mini55.z.string(),
|
|
14399
|
+
description: import_mini55.z.optional(import_mini55.z.string()),
|
|
14400
|
+
model: import_mini55.z.optional(import_mini55.z.string()),
|
|
14401
|
+
tools: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.string(), import_mini55.z.array(import_mini55.z.string())])),
|
|
14402
|
+
permissionMode: import_mini55.z.optional(import_mini55.z.string()),
|
|
14403
|
+
skills: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.string(), import_mini55.z.array(import_mini55.z.string())]))
|
|
14009
14404
|
});
|
|
14010
14405
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
14011
14406
|
frontmatter;
|
|
@@ -14015,7 +14410,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14015
14410
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14016
14411
|
if (!result.success) {
|
|
14017
14412
|
throw new Error(
|
|
14018
|
-
`Invalid frontmatter in ${(0,
|
|
14413
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14019
14414
|
);
|
|
14020
14415
|
}
|
|
14021
14416
|
}
|
|
@@ -14027,7 +14422,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14027
14422
|
}
|
|
14028
14423
|
static getSettablePaths(_options = {}) {
|
|
14029
14424
|
return {
|
|
14030
|
-
relativeDirPath: (0,
|
|
14425
|
+
relativeDirPath: (0, import_node_path101.join)(".claude", "agents")
|
|
14031
14426
|
};
|
|
14032
14427
|
}
|
|
14033
14428
|
getFrontmatter() {
|
|
@@ -14106,7 +14501,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14106
14501
|
return {
|
|
14107
14502
|
success: false,
|
|
14108
14503
|
error: new Error(
|
|
14109
|
-
`Invalid frontmatter in ${(0,
|
|
14504
|
+
`Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14110
14505
|
)
|
|
14111
14506
|
};
|
|
14112
14507
|
}
|
|
@@ -14124,7 +14519,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14124
14519
|
global = false
|
|
14125
14520
|
}) {
|
|
14126
14521
|
const paths = this.getSettablePaths({ global });
|
|
14127
|
-
const filePath = (0,
|
|
14522
|
+
const filePath = (0, import_node_path101.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14128
14523
|
const fileContent = await readFileContent(filePath);
|
|
14129
14524
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14130
14525
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14159,27 +14554,27 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14159
14554
|
};
|
|
14160
14555
|
|
|
14161
14556
|
// src/features/subagents/codexcli-subagent.ts
|
|
14162
|
-
var
|
|
14163
|
-
var
|
|
14164
|
-
var
|
|
14165
|
-
var CodexCliSubagentTomlSchema =
|
|
14166
|
-
name:
|
|
14167
|
-
description:
|
|
14168
|
-
developer_instructions:
|
|
14169
|
-
model:
|
|
14170
|
-
model_reasoning_effort:
|
|
14171
|
-
sandbox_mode:
|
|
14557
|
+
var import_node_path102 = require("path");
|
|
14558
|
+
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
14559
|
+
var import_mini56 = require("zod/mini");
|
|
14560
|
+
var CodexCliSubagentTomlSchema = import_mini56.z.looseObject({
|
|
14561
|
+
name: import_mini56.z.string(),
|
|
14562
|
+
description: import_mini56.z.optional(import_mini56.z.string()),
|
|
14563
|
+
developer_instructions: import_mini56.z.optional(import_mini56.z.string()),
|
|
14564
|
+
model: import_mini56.z.optional(import_mini56.z.string()),
|
|
14565
|
+
model_reasoning_effort: import_mini56.z.optional(import_mini56.z.string()),
|
|
14566
|
+
sandbox_mode: import_mini56.z.optional(import_mini56.z.string())
|
|
14172
14567
|
});
|
|
14173
14568
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
14174
14569
|
body;
|
|
14175
14570
|
constructor({ body, ...rest }) {
|
|
14176
14571
|
if (rest.validate !== false) {
|
|
14177
14572
|
try {
|
|
14178
|
-
const parsed =
|
|
14573
|
+
const parsed = smolToml5.parse(body);
|
|
14179
14574
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14180
14575
|
} catch (error) {
|
|
14181
14576
|
throw new Error(
|
|
14182
|
-
`Invalid TOML in ${(0,
|
|
14577
|
+
`Invalid TOML in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14183
14578
|
{ cause: error }
|
|
14184
14579
|
);
|
|
14185
14580
|
}
|
|
@@ -14191,7 +14586,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14191
14586
|
}
|
|
14192
14587
|
static getSettablePaths(_options = {}) {
|
|
14193
14588
|
return {
|
|
14194
|
-
relativeDirPath: (0,
|
|
14589
|
+
relativeDirPath: (0, import_node_path102.join)(".codex", "agents")
|
|
14195
14590
|
};
|
|
14196
14591
|
}
|
|
14197
14592
|
getBody() {
|
|
@@ -14200,10 +14595,10 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14200
14595
|
toRulesyncSubagent() {
|
|
14201
14596
|
let parsed;
|
|
14202
14597
|
try {
|
|
14203
|
-
parsed = CodexCliSubagentTomlSchema.parse(
|
|
14598
|
+
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
14204
14599
|
} catch (error) {
|
|
14205
14600
|
throw new Error(
|
|
14206
|
-
`Failed to parse TOML in ${(0,
|
|
14601
|
+
`Failed to parse TOML in ${(0, import_node_path102.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14207
14602
|
{ cause: error }
|
|
14208
14603
|
);
|
|
14209
14604
|
}
|
|
@@ -14246,7 +14641,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14246
14641
|
...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
|
|
14247
14642
|
...codexcliSection
|
|
14248
14643
|
};
|
|
14249
|
-
const body =
|
|
14644
|
+
const body = smolToml5.stringify(tomlObj);
|
|
14250
14645
|
const paths = this.getSettablePaths({ global });
|
|
14251
14646
|
const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
|
|
14252
14647
|
return new _CodexCliSubagent({
|
|
@@ -14261,7 +14656,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14261
14656
|
}
|
|
14262
14657
|
validate() {
|
|
14263
14658
|
try {
|
|
14264
|
-
const parsed =
|
|
14659
|
+
const parsed = smolToml5.parse(this.body);
|
|
14265
14660
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14266
14661
|
return { success: true, error: null };
|
|
14267
14662
|
} catch (error) {
|
|
@@ -14284,7 +14679,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14284
14679
|
global = false
|
|
14285
14680
|
}) {
|
|
14286
14681
|
const paths = this.getSettablePaths({ global });
|
|
14287
|
-
const filePath = (0,
|
|
14682
|
+
const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14288
14683
|
const fileContent = await readFileContent(filePath);
|
|
14289
14684
|
const subagent = new _CodexCliSubagent({
|
|
14290
14685
|
baseDir,
|
|
@@ -14322,13 +14717,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14322
14717
|
};
|
|
14323
14718
|
|
|
14324
14719
|
// src/features/subagents/copilot-subagent.ts
|
|
14325
|
-
var
|
|
14326
|
-
var
|
|
14720
|
+
var import_node_path103 = require("path");
|
|
14721
|
+
var import_mini57 = require("zod/mini");
|
|
14327
14722
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
14328
|
-
var CopilotSubagentFrontmatterSchema =
|
|
14329
|
-
name:
|
|
14330
|
-
description:
|
|
14331
|
-
tools:
|
|
14723
|
+
var CopilotSubagentFrontmatterSchema = import_mini57.z.looseObject({
|
|
14724
|
+
name: import_mini57.z.string(),
|
|
14725
|
+
description: import_mini57.z.optional(import_mini57.z.string()),
|
|
14726
|
+
tools: import_mini57.z.optional(import_mini57.z.union([import_mini57.z.string(), import_mini57.z.array(import_mini57.z.string())]))
|
|
14332
14727
|
});
|
|
14333
14728
|
var normalizeTools = (tools) => {
|
|
14334
14729
|
if (!tools) {
|
|
@@ -14348,7 +14743,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14348
14743
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14349
14744
|
if (!result.success) {
|
|
14350
14745
|
throw new Error(
|
|
14351
|
-
`Invalid frontmatter in ${(0,
|
|
14746
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14352
14747
|
);
|
|
14353
14748
|
}
|
|
14354
14749
|
}
|
|
@@ -14360,7 +14755,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14360
14755
|
}
|
|
14361
14756
|
static getSettablePaths(_options = {}) {
|
|
14362
14757
|
return {
|
|
14363
|
-
relativeDirPath: (0,
|
|
14758
|
+
relativeDirPath: (0, import_node_path103.join)(".github", "agents")
|
|
14364
14759
|
};
|
|
14365
14760
|
}
|
|
14366
14761
|
getFrontmatter() {
|
|
@@ -14434,7 +14829,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14434
14829
|
return {
|
|
14435
14830
|
success: false,
|
|
14436
14831
|
error: new Error(
|
|
14437
|
-
`Invalid frontmatter in ${(0,
|
|
14832
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14438
14833
|
)
|
|
14439
14834
|
};
|
|
14440
14835
|
}
|
|
@@ -14452,7 +14847,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14452
14847
|
global = false
|
|
14453
14848
|
}) {
|
|
14454
14849
|
const paths = this.getSettablePaths({ global });
|
|
14455
|
-
const filePath = (0,
|
|
14850
|
+
const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14456
14851
|
const fileContent = await readFileContent(filePath);
|
|
14457
14852
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14458
14853
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14488,11 +14883,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
14488
14883
|
};
|
|
14489
14884
|
|
|
14490
14885
|
// src/features/subagents/cursor-subagent.ts
|
|
14491
|
-
var
|
|
14492
|
-
var
|
|
14493
|
-
var CursorSubagentFrontmatterSchema =
|
|
14494
|
-
name:
|
|
14495
|
-
description:
|
|
14886
|
+
var import_node_path104 = require("path");
|
|
14887
|
+
var import_mini58 = require("zod/mini");
|
|
14888
|
+
var CursorSubagentFrontmatterSchema = import_mini58.z.looseObject({
|
|
14889
|
+
name: import_mini58.z.string(),
|
|
14890
|
+
description: import_mini58.z.optional(import_mini58.z.string())
|
|
14496
14891
|
});
|
|
14497
14892
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
14498
14893
|
frontmatter;
|
|
@@ -14502,7 +14897,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14502
14897
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14503
14898
|
if (!result.success) {
|
|
14504
14899
|
throw new Error(
|
|
14505
|
-
`Invalid frontmatter in ${(0,
|
|
14900
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14506
14901
|
);
|
|
14507
14902
|
}
|
|
14508
14903
|
}
|
|
@@ -14514,7 +14909,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14514
14909
|
}
|
|
14515
14910
|
static getSettablePaths(_options = {}) {
|
|
14516
14911
|
return {
|
|
14517
|
-
relativeDirPath: (0,
|
|
14912
|
+
relativeDirPath: (0, import_node_path104.join)(".cursor", "agents")
|
|
14518
14913
|
};
|
|
14519
14914
|
}
|
|
14520
14915
|
getFrontmatter() {
|
|
@@ -14581,7 +14976,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14581
14976
|
return {
|
|
14582
14977
|
success: false,
|
|
14583
14978
|
error: new Error(
|
|
14584
|
-
`Invalid frontmatter in ${(0,
|
|
14979
|
+
`Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14585
14980
|
)
|
|
14586
14981
|
};
|
|
14587
14982
|
}
|
|
@@ -14599,7 +14994,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14599
14994
|
global = false
|
|
14600
14995
|
}) {
|
|
14601
14996
|
const paths = this.getSettablePaths({ global });
|
|
14602
|
-
const filePath = (0,
|
|
14997
|
+
const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14603
14998
|
const fileContent = await readFileContent(filePath);
|
|
14604
14999
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14605
15000
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14635,12 +15030,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
14635
15030
|
};
|
|
14636
15031
|
|
|
14637
15032
|
// src/features/subagents/deepagents-subagent.ts
|
|
14638
|
-
var
|
|
14639
|
-
var
|
|
14640
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
14641
|
-
name:
|
|
14642
|
-
description:
|
|
14643
|
-
model:
|
|
15033
|
+
var import_node_path105 = require("path");
|
|
15034
|
+
var import_mini59 = require("zod/mini");
|
|
15035
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15036
|
+
name: import_mini59.z.string(),
|
|
15037
|
+
description: import_mini59.z.optional(import_mini59.z.string()),
|
|
15038
|
+
model: import_mini59.z.optional(import_mini59.z.string())
|
|
14644
15039
|
});
|
|
14645
15040
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
14646
15041
|
frontmatter;
|
|
@@ -14650,7 +15045,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
14650
15045
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14651
15046
|
if (!result.success) {
|
|
14652
15047
|
throw new Error(
|
|
14653
|
-
`Invalid frontmatter in ${(0,
|
|
15048
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14654
15049
|
);
|
|
14655
15050
|
}
|
|
14656
15051
|
}
|
|
@@ -14660,7 +15055,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
14660
15055
|
}
|
|
14661
15056
|
static getSettablePaths(_options = {}) {
|
|
14662
15057
|
return {
|
|
14663
|
-
relativeDirPath: (0,
|
|
15058
|
+
relativeDirPath: (0, import_node_path105.join)(".deepagents", "agents")
|
|
14664
15059
|
};
|
|
14665
15060
|
}
|
|
14666
15061
|
getFrontmatter() {
|
|
@@ -14735,7 +15130,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
14735
15130
|
return {
|
|
14736
15131
|
success: false,
|
|
14737
15132
|
error: new Error(
|
|
14738
|
-
`Invalid frontmatter in ${(0,
|
|
15133
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14739
15134
|
)
|
|
14740
15135
|
};
|
|
14741
15136
|
}
|
|
@@ -14753,7 +15148,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
14753
15148
|
global = false
|
|
14754
15149
|
}) {
|
|
14755
15150
|
const paths = this.getSettablePaths({ global });
|
|
14756
|
-
const filePath = (0,
|
|
15151
|
+
const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14757
15152
|
const fileContent = await readFileContent(filePath);
|
|
14758
15153
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14759
15154
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14788,11 +15183,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
14788
15183
|
};
|
|
14789
15184
|
|
|
14790
15185
|
// src/features/subagents/junie-subagent.ts
|
|
14791
|
-
var
|
|
14792
|
-
var
|
|
14793
|
-
var JunieSubagentFrontmatterSchema =
|
|
14794
|
-
name:
|
|
14795
|
-
description:
|
|
15186
|
+
var import_node_path106 = require("path");
|
|
15187
|
+
var import_mini60 = require("zod/mini");
|
|
15188
|
+
var JunieSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15189
|
+
name: import_mini60.z.optional(import_mini60.z.string()),
|
|
15190
|
+
description: import_mini60.z.string()
|
|
14796
15191
|
});
|
|
14797
15192
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
14798
15193
|
frontmatter;
|
|
@@ -14802,7 +15197,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14802
15197
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14803
15198
|
if (!result.success) {
|
|
14804
15199
|
throw new Error(
|
|
14805
|
-
`Invalid frontmatter in ${(0,
|
|
15200
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14806
15201
|
);
|
|
14807
15202
|
}
|
|
14808
15203
|
}
|
|
@@ -14817,7 +15212,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14817
15212
|
throw new Error("JunieSubagent does not support global mode.");
|
|
14818
15213
|
}
|
|
14819
15214
|
return {
|
|
14820
|
-
relativeDirPath: (0,
|
|
15215
|
+
relativeDirPath: (0, import_node_path106.join)(".junie", "agents")
|
|
14821
15216
|
};
|
|
14822
15217
|
}
|
|
14823
15218
|
getFrontmatter() {
|
|
@@ -14893,7 +15288,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14893
15288
|
return {
|
|
14894
15289
|
success: false,
|
|
14895
15290
|
error: new Error(
|
|
14896
|
-
`Invalid frontmatter in ${(0,
|
|
15291
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14897
15292
|
)
|
|
14898
15293
|
};
|
|
14899
15294
|
}
|
|
@@ -14911,7 +15306,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14911
15306
|
global = false
|
|
14912
15307
|
}) {
|
|
14913
15308
|
const paths = this.getSettablePaths({ global });
|
|
14914
|
-
const filePath = (0,
|
|
15309
|
+
const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14915
15310
|
const fileContent = await readFileContent(filePath);
|
|
14916
15311
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14917
15312
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14946,15 +15341,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
14946
15341
|
};
|
|
14947
15342
|
|
|
14948
15343
|
// src/features/subagents/kilo-subagent.ts
|
|
14949
|
-
var
|
|
15344
|
+
var import_node_path108 = require("path");
|
|
14950
15345
|
|
|
14951
15346
|
// src/features/subagents/opencode-style-subagent.ts
|
|
14952
|
-
var
|
|
14953
|
-
var
|
|
14954
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
14955
|
-
description:
|
|
14956
|
-
mode:
|
|
14957
|
-
name:
|
|
15347
|
+
var import_node_path107 = require("path");
|
|
15348
|
+
var import_mini61 = require("zod/mini");
|
|
15349
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
15350
|
+
description: import_mini61.z.optional(import_mini61.z.string()),
|
|
15351
|
+
mode: import_mini61.z._default(import_mini61.z.string(), "subagent"),
|
|
15352
|
+
name: import_mini61.z.optional(import_mini61.z.string())
|
|
14958
15353
|
});
|
|
14959
15354
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
14960
15355
|
frontmatter;
|
|
@@ -14964,7 +15359,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14964
15359
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14965
15360
|
if (!result.success) {
|
|
14966
15361
|
throw new Error(
|
|
14967
|
-
`Invalid frontmatter in ${(0,
|
|
15362
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14968
15363
|
);
|
|
14969
15364
|
}
|
|
14970
15365
|
}
|
|
@@ -14984,7 +15379,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
14984
15379
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
14985
15380
|
const rulesyncFrontmatter = {
|
|
14986
15381
|
targets: ["*"],
|
|
14987
|
-
name: name ?? (0,
|
|
15382
|
+
name: name ?? (0, import_node_path107.basename)(this.getRelativeFilePath(), ".md"),
|
|
14988
15383
|
description,
|
|
14989
15384
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
14990
15385
|
};
|
|
@@ -15006,7 +15401,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15006
15401
|
return {
|
|
15007
15402
|
success: false,
|
|
15008
15403
|
error: new Error(
|
|
15009
|
-
`Invalid frontmatter in ${(0,
|
|
15404
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15010
15405
|
)
|
|
15011
15406
|
};
|
|
15012
15407
|
}
|
|
@@ -15022,7 +15417,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15022
15417
|
global = false
|
|
15023
15418
|
} = {}) {
|
|
15024
15419
|
return {
|
|
15025
|
-
relativeDirPath: global ? (0,
|
|
15420
|
+
relativeDirPath: global ? (0, import_node_path108.join)(".config", "kilo", "agent") : (0, import_node_path108.join)(".kilo", "agent")
|
|
15026
15421
|
};
|
|
15027
15422
|
}
|
|
15028
15423
|
static fromRulesyncSubagent({
|
|
@@ -15066,7 +15461,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15066
15461
|
global = false
|
|
15067
15462
|
}) {
|
|
15068
15463
|
const paths = this.getSettablePaths({ global });
|
|
15069
|
-
const filePath = (0,
|
|
15464
|
+
const filePath = (0, import_node_path108.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15070
15465
|
const fileContent = await readFileContent(filePath);
|
|
15071
15466
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15072
15467
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15102,23 +15497,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15102
15497
|
};
|
|
15103
15498
|
|
|
15104
15499
|
// src/features/subagents/kiro-subagent.ts
|
|
15105
|
-
var
|
|
15106
|
-
var
|
|
15107
|
-
var KiroCliSubagentJsonSchema =
|
|
15108
|
-
name:
|
|
15109
|
-
description:
|
|
15110
|
-
prompt:
|
|
15111
|
-
tools:
|
|
15112
|
-
toolAliases:
|
|
15113
|
-
toolSettings:
|
|
15114
|
-
toolSchema:
|
|
15115
|
-
hooks:
|
|
15116
|
-
model:
|
|
15117
|
-
mcpServers:
|
|
15118
|
-
useLegacyMcpJson:
|
|
15119
|
-
resources:
|
|
15120
|
-
allowedTools:
|
|
15121
|
-
includeMcpJson:
|
|
15500
|
+
var import_node_path109 = require("path");
|
|
15501
|
+
var import_mini62 = require("zod/mini");
|
|
15502
|
+
var KiroCliSubagentJsonSchema = import_mini62.z.looseObject({
|
|
15503
|
+
name: import_mini62.z.string(),
|
|
15504
|
+
description: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
|
|
15505
|
+
prompt: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
|
|
15506
|
+
tools: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
|
|
15507
|
+
toolAliases: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.string()))),
|
|
15508
|
+
toolSettings: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.unknown())),
|
|
15509
|
+
toolSchema: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.unknown())),
|
|
15510
|
+
hooks: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.array(import_mini62.z.unknown())))),
|
|
15511
|
+
model: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.string())),
|
|
15512
|
+
mcpServers: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.record(import_mini62.z.string(), import_mini62.z.unknown()))),
|
|
15513
|
+
useLegacyMcpJson: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.boolean())),
|
|
15514
|
+
resources: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
|
|
15515
|
+
allowedTools: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.array(import_mini62.z.string()))),
|
|
15516
|
+
includeMcpJson: import_mini62.z.optional(import_mini62.z.nullable(import_mini62.z.boolean()))
|
|
15122
15517
|
});
|
|
15123
15518
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15124
15519
|
body;
|
|
@@ -15129,7 +15524,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15129
15524
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15130
15525
|
} catch (error) {
|
|
15131
15526
|
throw new Error(
|
|
15132
|
-
`Invalid JSON in ${(0,
|
|
15527
|
+
`Invalid JSON in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15133
15528
|
{ cause: error }
|
|
15134
15529
|
);
|
|
15135
15530
|
}
|
|
@@ -15141,7 +15536,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15141
15536
|
}
|
|
15142
15537
|
static getSettablePaths(_options = {}) {
|
|
15143
15538
|
return {
|
|
15144
|
-
relativeDirPath: (0,
|
|
15539
|
+
relativeDirPath: (0, import_node_path109.join)(".kiro", "agents")
|
|
15145
15540
|
};
|
|
15146
15541
|
}
|
|
15147
15542
|
getBody() {
|
|
@@ -15153,7 +15548,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15153
15548
|
parsed = JSON.parse(this.body);
|
|
15154
15549
|
} catch (error) {
|
|
15155
15550
|
throw new Error(
|
|
15156
|
-
`Failed to parse JSON in ${(0,
|
|
15551
|
+
`Failed to parse JSON in ${(0, import_node_path109.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15157
15552
|
{ cause: error }
|
|
15158
15553
|
);
|
|
15159
15554
|
}
|
|
@@ -15234,7 +15629,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15234
15629
|
global = false
|
|
15235
15630
|
}) {
|
|
15236
15631
|
const paths = this.getSettablePaths({ global });
|
|
15237
|
-
const filePath = (0,
|
|
15632
|
+
const filePath = (0, import_node_path109.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15238
15633
|
const fileContent = await readFileContent(filePath);
|
|
15239
15634
|
const subagent = new _KiroSubagent({
|
|
15240
15635
|
baseDir,
|
|
@@ -15272,7 +15667,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15272
15667
|
};
|
|
15273
15668
|
|
|
15274
15669
|
// src/features/subagents/opencode-subagent.ts
|
|
15275
|
-
var
|
|
15670
|
+
var import_node_path110 = require("path");
|
|
15276
15671
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
15277
15672
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
15278
15673
|
getToolTarget() {
|
|
@@ -15282,7 +15677,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15282
15677
|
global = false
|
|
15283
15678
|
} = {}) {
|
|
15284
15679
|
return {
|
|
15285
|
-
relativeDirPath: global ? (0,
|
|
15680
|
+
relativeDirPath: global ? (0, import_node_path110.join)(".config", "opencode", "agent") : (0, import_node_path110.join)(".opencode", "agent")
|
|
15286
15681
|
};
|
|
15287
15682
|
}
|
|
15288
15683
|
static fromRulesyncSubagent({
|
|
@@ -15326,7 +15721,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
15326
15721
|
global = false
|
|
15327
15722
|
}) {
|
|
15328
15723
|
const paths = this.getSettablePaths({ global });
|
|
15329
|
-
const filePath = (0,
|
|
15724
|
+
const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15330
15725
|
const fileContent = await readFileContent(filePath);
|
|
15331
15726
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15332
15727
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15379,7 +15774,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
15379
15774
|
"roo",
|
|
15380
15775
|
"rovodev"
|
|
15381
15776
|
];
|
|
15382
|
-
var SubagentsProcessorToolTargetSchema =
|
|
15777
|
+
var SubagentsProcessorToolTargetSchema = import_mini63.z.enum(subagentsProcessorToolTargetTuple);
|
|
15383
15778
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
15384
15779
|
[
|
|
15385
15780
|
"agentsmd",
|
|
@@ -15570,7 +15965,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15570
15965
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
15571
15966
|
*/
|
|
15572
15967
|
async loadRulesyncFiles() {
|
|
15573
|
-
const subagentsDir = (0,
|
|
15968
|
+
const subagentsDir = (0, import_node_path111.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
15574
15969
|
const dirExists = await directoryExists(subagentsDir);
|
|
15575
15970
|
if (!dirExists) {
|
|
15576
15971
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -15585,7 +15980,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15585
15980
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
15586
15981
|
const rulesyncSubagents = [];
|
|
15587
15982
|
for (const mdFile of mdFiles) {
|
|
15588
|
-
const filepath = (0,
|
|
15983
|
+
const filepath = (0, import_node_path111.join)(subagentsDir, mdFile);
|
|
15589
15984
|
try {
|
|
15590
15985
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
15591
15986
|
relativeFilePath: mdFile,
|
|
@@ -15615,14 +16010,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15615
16010
|
const factory = this.getFactory(this.toolTarget);
|
|
15616
16011
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
15617
16012
|
const subagentFilePaths = await findFilesByGlobs(
|
|
15618
|
-
(0,
|
|
16013
|
+
(0, import_node_path111.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
15619
16014
|
);
|
|
15620
16015
|
if (forDeletion) {
|
|
15621
16016
|
const toolSubagents2 = subagentFilePaths.map(
|
|
15622
16017
|
(path3) => factory.class.forDeletion({
|
|
15623
16018
|
baseDir: this.baseDir,
|
|
15624
16019
|
relativeDirPath: paths.relativeDirPath,
|
|
15625
|
-
relativeFilePath: (0,
|
|
16020
|
+
relativeFilePath: (0, import_node_path111.basename)(path3),
|
|
15626
16021
|
global: this.global
|
|
15627
16022
|
})
|
|
15628
16023
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -15635,7 +16030,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15635
16030
|
subagentFilePaths.map(
|
|
15636
16031
|
(path3) => factory.class.fromFile({
|
|
15637
16032
|
baseDir: this.baseDir,
|
|
15638
|
-
relativeFilePath: (0,
|
|
16033
|
+
relativeFilePath: (0, import_node_path111.basename)(path3),
|
|
15639
16034
|
global: this.global
|
|
15640
16035
|
})
|
|
15641
16036
|
)
|
|
@@ -15682,49 +16077,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
15682
16077
|
};
|
|
15683
16078
|
|
|
15684
16079
|
// src/features/rules/agentsmd-rule.ts
|
|
15685
|
-
var
|
|
16080
|
+
var import_node_path114 = require("path");
|
|
15686
16081
|
|
|
15687
16082
|
// src/features/rules/tool-rule.ts
|
|
15688
|
-
var
|
|
16083
|
+
var import_node_path113 = require("path");
|
|
15689
16084
|
|
|
15690
16085
|
// src/features/rules/rulesync-rule.ts
|
|
15691
|
-
var
|
|
15692
|
-
var
|
|
15693
|
-
var RulesyncRuleFrontmatterSchema =
|
|
15694
|
-
root:
|
|
15695
|
-
localRoot:
|
|
15696
|
-
targets:
|
|
15697
|
-
description:
|
|
15698
|
-
globs:
|
|
15699
|
-
agentsmd:
|
|
15700
|
-
|
|
16086
|
+
var import_node_path112 = require("path");
|
|
16087
|
+
var import_mini64 = require("zod/mini");
|
|
16088
|
+
var RulesyncRuleFrontmatterSchema = import_mini64.z.object({
|
|
16089
|
+
root: import_mini64.z.optional(import_mini64.z.boolean()),
|
|
16090
|
+
localRoot: import_mini64.z.optional(import_mini64.z.boolean()),
|
|
16091
|
+
targets: import_mini64.z._default(RulesyncTargetsSchema, ["*"]),
|
|
16092
|
+
description: import_mini64.z.optional(import_mini64.z.string()),
|
|
16093
|
+
globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string())),
|
|
16094
|
+
agentsmd: import_mini64.z.optional(
|
|
16095
|
+
import_mini64.z.looseObject({
|
|
15701
16096
|
// @example "path/to/subproject"
|
|
15702
|
-
subprojectPath:
|
|
16097
|
+
subprojectPath: import_mini64.z.optional(import_mini64.z.string())
|
|
15703
16098
|
})
|
|
15704
16099
|
),
|
|
15705
|
-
claudecode:
|
|
15706
|
-
|
|
16100
|
+
claudecode: import_mini64.z.optional(
|
|
16101
|
+
import_mini64.z.looseObject({
|
|
15707
16102
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
15708
16103
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
15709
|
-
paths:
|
|
16104
|
+
paths: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
|
|
15710
16105
|
})
|
|
15711
16106
|
),
|
|
15712
|
-
cursor:
|
|
15713
|
-
|
|
15714
|
-
alwaysApply:
|
|
15715
|
-
description:
|
|
15716
|
-
globs:
|
|
16107
|
+
cursor: import_mini64.z.optional(
|
|
16108
|
+
import_mini64.z.looseObject({
|
|
16109
|
+
alwaysApply: import_mini64.z.optional(import_mini64.z.boolean()),
|
|
16110
|
+
description: import_mini64.z.optional(import_mini64.z.string()),
|
|
16111
|
+
globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
|
|
15717
16112
|
})
|
|
15718
16113
|
),
|
|
15719
|
-
copilot:
|
|
15720
|
-
|
|
15721
|
-
excludeAgent:
|
|
16114
|
+
copilot: import_mini64.z.optional(
|
|
16115
|
+
import_mini64.z.looseObject({
|
|
16116
|
+
excludeAgent: import_mini64.z.optional(import_mini64.z.union([import_mini64.z.literal("code-review"), import_mini64.z.literal("coding-agent")]))
|
|
15722
16117
|
})
|
|
15723
16118
|
),
|
|
15724
|
-
antigravity:
|
|
15725
|
-
|
|
15726
|
-
trigger:
|
|
15727
|
-
globs:
|
|
16119
|
+
antigravity: import_mini64.z.optional(
|
|
16120
|
+
import_mini64.z.looseObject({
|
|
16121
|
+
trigger: import_mini64.z.optional(import_mini64.z.string()),
|
|
16122
|
+
globs: import_mini64.z.optional(import_mini64.z.array(import_mini64.z.string()))
|
|
15728
16123
|
})
|
|
15729
16124
|
)
|
|
15730
16125
|
});
|
|
@@ -15735,7 +16130,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
15735
16130
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
15736
16131
|
if (!parseResult.success && rest.validate !== false) {
|
|
15737
16132
|
throw new Error(
|
|
15738
|
-
`Invalid frontmatter in ${(0,
|
|
16133
|
+
`Invalid frontmatter in ${(0, import_node_path112.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
15739
16134
|
);
|
|
15740
16135
|
}
|
|
15741
16136
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -15770,7 +16165,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
15770
16165
|
return {
|
|
15771
16166
|
success: false,
|
|
15772
16167
|
error: new Error(
|
|
15773
|
-
`Invalid frontmatter in ${(0,
|
|
16168
|
+
`Invalid frontmatter in ${(0, import_node_path112.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15774
16169
|
)
|
|
15775
16170
|
};
|
|
15776
16171
|
}
|
|
@@ -15779,7 +16174,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
15779
16174
|
relativeFilePath,
|
|
15780
16175
|
validate = true
|
|
15781
16176
|
}) {
|
|
15782
|
-
const filePath = (0,
|
|
16177
|
+
const filePath = (0, import_node_path112.join)(
|
|
15783
16178
|
process.cwd(),
|
|
15784
16179
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
15785
16180
|
relativeFilePath
|
|
@@ -15878,7 +16273,7 @@ var ToolRule = class extends ToolFile {
|
|
|
15878
16273
|
rulesyncRule,
|
|
15879
16274
|
validate = true,
|
|
15880
16275
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
15881
|
-
nonRootPath = { relativeDirPath: (0,
|
|
16276
|
+
nonRootPath = { relativeDirPath: (0, import_node_path113.join)(".agents", "memories") }
|
|
15882
16277
|
}) {
|
|
15883
16278
|
const params = this.buildToolRuleParamsDefault({
|
|
15884
16279
|
baseDir,
|
|
@@ -15889,7 +16284,7 @@ var ToolRule = class extends ToolFile {
|
|
|
15889
16284
|
});
|
|
15890
16285
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
15891
16286
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
15892
|
-
params.relativeDirPath = (0,
|
|
16287
|
+
params.relativeDirPath = (0, import_node_path113.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
15893
16288
|
params.relativeFilePath = "AGENTS.md";
|
|
15894
16289
|
}
|
|
15895
16290
|
return params;
|
|
@@ -15938,7 +16333,7 @@ var ToolRule = class extends ToolFile {
|
|
|
15938
16333
|
}
|
|
15939
16334
|
};
|
|
15940
16335
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
15941
|
-
return excludeToolDir ? subDir : (0,
|
|
16336
|
+
return excludeToolDir ? subDir : (0, import_node_path113.join)(toolDir, subDir);
|
|
15942
16337
|
}
|
|
15943
16338
|
|
|
15944
16339
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -15967,8 +16362,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
15967
16362
|
validate = true
|
|
15968
16363
|
}) {
|
|
15969
16364
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
15970
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
15971
|
-
const fileContent = await readFileContent((0,
|
|
16365
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path114.join)(".agents", "memories", relativeFilePath);
|
|
16366
|
+
const fileContent = await readFileContent((0, import_node_path114.join)(baseDir, relativePath));
|
|
15972
16367
|
return new _AgentsMdRule({
|
|
15973
16368
|
baseDir,
|
|
15974
16369
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16023,21 +16418,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16023
16418
|
};
|
|
16024
16419
|
|
|
16025
16420
|
// src/features/rules/antigravity-rule.ts
|
|
16026
|
-
var
|
|
16027
|
-
var
|
|
16028
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16029
|
-
trigger:
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16421
|
+
var import_node_path115 = require("path");
|
|
16422
|
+
var import_mini65 = require("zod/mini");
|
|
16423
|
+
var AntigravityRuleFrontmatterSchema = import_mini65.z.looseObject({
|
|
16424
|
+
trigger: import_mini65.z.optional(
|
|
16425
|
+
import_mini65.z.union([
|
|
16426
|
+
import_mini65.z.literal("always_on"),
|
|
16427
|
+
import_mini65.z.literal("glob"),
|
|
16428
|
+
import_mini65.z.literal("manual"),
|
|
16429
|
+
import_mini65.z.literal("model_decision"),
|
|
16430
|
+
import_mini65.z.string()
|
|
16036
16431
|
// accepts any string for forward compatibility
|
|
16037
16432
|
])
|
|
16038
16433
|
),
|
|
16039
|
-
globs:
|
|
16040
|
-
description:
|
|
16434
|
+
globs: import_mini65.z.optional(import_mini65.z.string()),
|
|
16435
|
+
description: import_mini65.z.optional(import_mini65.z.string())
|
|
16041
16436
|
});
|
|
16042
16437
|
function parseGlobsString(globs) {
|
|
16043
16438
|
if (!globs) {
|
|
@@ -16182,7 +16577,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16182
16577
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16183
16578
|
if (!result.success) {
|
|
16184
16579
|
throw new Error(
|
|
16185
|
-
`Invalid frontmatter in ${(0,
|
|
16580
|
+
`Invalid frontmatter in ${(0, import_node_path115.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16186
16581
|
);
|
|
16187
16582
|
}
|
|
16188
16583
|
}
|
|
@@ -16206,7 +16601,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16206
16601
|
relativeFilePath,
|
|
16207
16602
|
validate = true
|
|
16208
16603
|
}) {
|
|
16209
|
-
const filePath = (0,
|
|
16604
|
+
const filePath = (0, import_node_path115.join)(
|
|
16210
16605
|
baseDir,
|
|
16211
16606
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16212
16607
|
relativeFilePath
|
|
@@ -16346,7 +16741,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
16346
16741
|
};
|
|
16347
16742
|
|
|
16348
16743
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
16349
|
-
var
|
|
16744
|
+
var import_node_path116 = require("path");
|
|
16350
16745
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
16351
16746
|
toRulesyncRule() {
|
|
16352
16747
|
const rulesyncFrontmatter = {
|
|
@@ -16406,8 +16801,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16406
16801
|
}) {
|
|
16407
16802
|
const settablePaths = this.getSettablePaths();
|
|
16408
16803
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
16409
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
16410
|
-
const fileContent = await readFileContent((0,
|
|
16804
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path116.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16805
|
+
const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
|
|
16411
16806
|
return new _AugmentcodeLegacyRule({
|
|
16412
16807
|
baseDir,
|
|
16413
16808
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -16436,7 +16831,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
16436
16831
|
};
|
|
16437
16832
|
|
|
16438
16833
|
// src/features/rules/augmentcode-rule.ts
|
|
16439
|
-
var
|
|
16834
|
+
var import_node_path117 = require("path");
|
|
16440
16835
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
16441
16836
|
toRulesyncRule() {
|
|
16442
16837
|
return this.toRulesyncRuleDefault();
|
|
@@ -16467,7 +16862,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
16467
16862
|
relativeFilePath,
|
|
16468
16863
|
validate = true
|
|
16469
16864
|
}) {
|
|
16470
|
-
const filePath = (0,
|
|
16865
|
+
const filePath = (0, import_node_path117.join)(
|
|
16471
16866
|
baseDir,
|
|
16472
16867
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
16473
16868
|
relativeFilePath
|
|
@@ -16507,7 +16902,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
16507
16902
|
};
|
|
16508
16903
|
|
|
16509
16904
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
16510
|
-
var
|
|
16905
|
+
var import_node_path118 = require("path");
|
|
16511
16906
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
16512
16907
|
static getSettablePaths({
|
|
16513
16908
|
global,
|
|
@@ -16549,7 +16944,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
16549
16944
|
if (isRoot) {
|
|
16550
16945
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
16551
16946
|
const fileContent2 = await readFileContent(
|
|
16552
|
-
(0,
|
|
16947
|
+
(0, import_node_path118.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
16553
16948
|
);
|
|
16554
16949
|
return new _ClaudecodeLegacyRule({
|
|
16555
16950
|
baseDir,
|
|
@@ -16563,8 +16958,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
16563
16958
|
if (!paths.nonRoot) {
|
|
16564
16959
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16565
16960
|
}
|
|
16566
|
-
const relativePath = (0,
|
|
16567
|
-
const fileContent = await readFileContent((0,
|
|
16961
|
+
const relativePath = (0, import_node_path118.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
16962
|
+
const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
|
|
16568
16963
|
return new _ClaudecodeLegacyRule({
|
|
16569
16964
|
baseDir,
|
|
16570
16965
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -16623,10 +17018,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
16623
17018
|
};
|
|
16624
17019
|
|
|
16625
17020
|
// src/features/rules/claudecode-rule.ts
|
|
16626
|
-
var
|
|
16627
|
-
var
|
|
16628
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
16629
|
-
paths:
|
|
17021
|
+
var import_node_path119 = require("path");
|
|
17022
|
+
var import_mini66 = require("zod/mini");
|
|
17023
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini66.z.object({
|
|
17024
|
+
paths: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string()))
|
|
16630
17025
|
});
|
|
16631
17026
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
16632
17027
|
frontmatter;
|
|
@@ -16664,7 +17059,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
16664
17059
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16665
17060
|
if (!result.success) {
|
|
16666
17061
|
throw new Error(
|
|
16667
|
-
`Invalid frontmatter in ${(0,
|
|
17062
|
+
`Invalid frontmatter in ${(0, import_node_path119.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16668
17063
|
);
|
|
16669
17064
|
}
|
|
16670
17065
|
}
|
|
@@ -16694,7 +17089,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
16694
17089
|
if (isRoot) {
|
|
16695
17090
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
16696
17091
|
const fileContent2 = await readFileContent(
|
|
16697
|
-
(0,
|
|
17092
|
+
(0, import_node_path119.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
16698
17093
|
);
|
|
16699
17094
|
return new _ClaudecodeRule({
|
|
16700
17095
|
baseDir,
|
|
@@ -16709,8 +17104,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
16709
17104
|
if (!paths.nonRoot) {
|
|
16710
17105
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16711
17106
|
}
|
|
16712
|
-
const relativePath = (0,
|
|
16713
|
-
const filePath = (0,
|
|
17107
|
+
const relativePath = (0, import_node_path119.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17108
|
+
const filePath = (0, import_node_path119.join)(baseDir, relativePath);
|
|
16714
17109
|
const fileContent = await readFileContent(filePath);
|
|
16715
17110
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16716
17111
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16821,7 +17216,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
16821
17216
|
return {
|
|
16822
17217
|
success: false,
|
|
16823
17218
|
error: new Error(
|
|
16824
|
-
`Invalid frontmatter in ${(0,
|
|
17219
|
+
`Invalid frontmatter in ${(0, import_node_path119.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16825
17220
|
)
|
|
16826
17221
|
};
|
|
16827
17222
|
}
|
|
@@ -16841,10 +17236,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
16841
17236
|
};
|
|
16842
17237
|
|
|
16843
17238
|
// src/features/rules/cline-rule.ts
|
|
16844
|
-
var
|
|
16845
|
-
var
|
|
16846
|
-
var ClineRuleFrontmatterSchema =
|
|
16847
|
-
description:
|
|
17239
|
+
var import_node_path120 = require("path");
|
|
17240
|
+
var import_mini67 = require("zod/mini");
|
|
17241
|
+
var ClineRuleFrontmatterSchema = import_mini67.z.object({
|
|
17242
|
+
description: import_mini67.z.string()
|
|
16848
17243
|
});
|
|
16849
17244
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
16850
17245
|
static getSettablePaths(_options = {}) {
|
|
@@ -16887,7 +17282,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
16887
17282
|
validate = true
|
|
16888
17283
|
}) {
|
|
16889
17284
|
const fileContent = await readFileContent(
|
|
16890
|
-
(0,
|
|
17285
|
+
(0, import_node_path120.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
16891
17286
|
);
|
|
16892
17287
|
return new _ClineRule({
|
|
16893
17288
|
baseDir,
|
|
@@ -16913,7 +17308,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
16913
17308
|
};
|
|
16914
17309
|
|
|
16915
17310
|
// src/features/rules/codexcli-rule.ts
|
|
16916
|
-
var
|
|
17311
|
+
var import_node_path121 = require("path");
|
|
16917
17312
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
16918
17313
|
static getSettablePaths({
|
|
16919
17314
|
global,
|
|
@@ -16948,7 +17343,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
16948
17343
|
if (isRoot) {
|
|
16949
17344
|
const relativePath2 = paths.root.relativeFilePath;
|
|
16950
17345
|
const fileContent2 = await readFileContent(
|
|
16951
|
-
(0,
|
|
17346
|
+
(0, import_node_path121.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
16952
17347
|
);
|
|
16953
17348
|
return new _CodexcliRule({
|
|
16954
17349
|
baseDir,
|
|
@@ -16962,8 +17357,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
16962
17357
|
if (!paths.nonRoot) {
|
|
16963
17358
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
16964
17359
|
}
|
|
16965
|
-
const relativePath = (0,
|
|
16966
|
-
const fileContent = await readFileContent((0,
|
|
17360
|
+
const relativePath = (0, import_node_path121.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17361
|
+
const fileContent = await readFileContent((0, import_node_path121.join)(baseDir, relativePath));
|
|
16967
17362
|
return new _CodexcliRule({
|
|
16968
17363
|
baseDir,
|
|
16969
17364
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17022,12 +17417,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17022
17417
|
};
|
|
17023
17418
|
|
|
17024
17419
|
// src/features/rules/copilot-rule.ts
|
|
17025
|
-
var
|
|
17026
|
-
var
|
|
17027
|
-
var CopilotRuleFrontmatterSchema =
|
|
17028
|
-
description:
|
|
17029
|
-
applyTo:
|
|
17030
|
-
excludeAgent:
|
|
17420
|
+
var import_node_path122 = require("path");
|
|
17421
|
+
var import_mini68 = require("zod/mini");
|
|
17422
|
+
var CopilotRuleFrontmatterSchema = import_mini68.z.object({
|
|
17423
|
+
description: import_mini68.z.optional(import_mini68.z.string()),
|
|
17424
|
+
applyTo: import_mini68.z.optional(import_mini68.z.string()),
|
|
17425
|
+
excludeAgent: import_mini68.z.optional(import_mini68.z.union([import_mini68.z.literal("code-review"), import_mini68.z.literal("coding-agent")]))
|
|
17031
17426
|
});
|
|
17032
17427
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17033
17428
|
frontmatter;
|
|
@@ -17059,7 +17454,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17059
17454
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17060
17455
|
if (!result.success) {
|
|
17061
17456
|
throw new Error(
|
|
17062
|
-
`Invalid frontmatter in ${(0,
|
|
17457
|
+
`Invalid frontmatter in ${(0, import_node_path122.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17063
17458
|
);
|
|
17064
17459
|
}
|
|
17065
17460
|
}
|
|
@@ -17149,8 +17544,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17149
17544
|
const paths = this.getSettablePaths({ global });
|
|
17150
17545
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17151
17546
|
if (isRoot) {
|
|
17152
|
-
const relativePath2 = (0,
|
|
17153
|
-
const filePath2 = (0,
|
|
17547
|
+
const relativePath2 = (0, import_node_path122.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17548
|
+
const filePath2 = (0, import_node_path122.join)(baseDir, relativePath2);
|
|
17154
17549
|
const fileContent2 = await readFileContent(filePath2);
|
|
17155
17550
|
return new _CopilotRule({
|
|
17156
17551
|
baseDir,
|
|
@@ -17165,8 +17560,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17165
17560
|
if (!paths.nonRoot) {
|
|
17166
17561
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17167
17562
|
}
|
|
17168
|
-
const relativePath = (0,
|
|
17169
|
-
const filePath = (0,
|
|
17563
|
+
const relativePath = (0, import_node_path122.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17564
|
+
const filePath = (0, import_node_path122.join)(baseDir, relativePath);
|
|
17170
17565
|
const fileContent = await readFileContent(filePath);
|
|
17171
17566
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17172
17567
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17212,7 +17607,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17212
17607
|
return {
|
|
17213
17608
|
success: false,
|
|
17214
17609
|
error: new Error(
|
|
17215
|
-
`Invalid frontmatter in ${(0,
|
|
17610
|
+
`Invalid frontmatter in ${(0, import_node_path122.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17216
17611
|
)
|
|
17217
17612
|
};
|
|
17218
17613
|
}
|
|
@@ -17268,12 +17663,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
17268
17663
|
};
|
|
17269
17664
|
|
|
17270
17665
|
// src/features/rules/cursor-rule.ts
|
|
17271
|
-
var
|
|
17272
|
-
var
|
|
17273
|
-
var CursorRuleFrontmatterSchema =
|
|
17274
|
-
description:
|
|
17275
|
-
globs:
|
|
17276
|
-
alwaysApply:
|
|
17666
|
+
var import_node_path123 = require("path");
|
|
17667
|
+
var import_mini69 = require("zod/mini");
|
|
17668
|
+
var CursorRuleFrontmatterSchema = import_mini69.z.object({
|
|
17669
|
+
description: import_mini69.z.optional(import_mini69.z.string()),
|
|
17670
|
+
globs: import_mini69.z.optional(import_mini69.z.string()),
|
|
17671
|
+
alwaysApply: import_mini69.z.optional(import_mini69.z.boolean())
|
|
17277
17672
|
});
|
|
17278
17673
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
17279
17674
|
frontmatter;
|
|
@@ -17290,7 +17685,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17290
17685
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17291
17686
|
if (!result.success) {
|
|
17292
17687
|
throw new Error(
|
|
17293
|
-
`Invalid frontmatter in ${(0,
|
|
17688
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17294
17689
|
);
|
|
17295
17690
|
}
|
|
17296
17691
|
}
|
|
@@ -17406,7 +17801,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17406
17801
|
relativeFilePath,
|
|
17407
17802
|
validate = true
|
|
17408
17803
|
}) {
|
|
17409
|
-
const filePath = (0,
|
|
17804
|
+
const filePath = (0, import_node_path123.join)(
|
|
17410
17805
|
baseDir,
|
|
17411
17806
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17412
17807
|
relativeFilePath
|
|
@@ -17416,7 +17811,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17416
17811
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17417
17812
|
if (!result.success) {
|
|
17418
17813
|
throw new Error(
|
|
17419
|
-
`Invalid frontmatter in ${(0,
|
|
17814
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
17420
17815
|
);
|
|
17421
17816
|
}
|
|
17422
17817
|
return new _CursorRule({
|
|
@@ -17453,7 +17848,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17453
17848
|
return {
|
|
17454
17849
|
success: false,
|
|
17455
17850
|
error: new Error(
|
|
17456
|
-
`Invalid frontmatter in ${(0,
|
|
17851
|
+
`Invalid frontmatter in ${(0, import_node_path123.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17457
17852
|
)
|
|
17458
17853
|
};
|
|
17459
17854
|
}
|
|
@@ -17473,7 +17868,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
17473
17868
|
};
|
|
17474
17869
|
|
|
17475
17870
|
// src/features/rules/deepagents-rule.ts
|
|
17476
|
-
var
|
|
17871
|
+
var import_node_path124 = require("path");
|
|
17477
17872
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
17478
17873
|
constructor({ fileContent, root, ...rest }) {
|
|
17479
17874
|
super({
|
|
@@ -17500,8 +17895,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
17500
17895
|
}) {
|
|
17501
17896
|
const settablePaths = this.getSettablePaths();
|
|
17502
17897
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
17503
|
-
const relativePath = isRoot ? (0,
|
|
17504
|
-
const fileContent = await readFileContent((0,
|
|
17898
|
+
const relativePath = isRoot ? (0, import_node_path124.join)(".deepagents", "AGENTS.md") : (0, import_node_path124.join)(".deepagents", "memories", relativeFilePath);
|
|
17899
|
+
const fileContent = await readFileContent((0, import_node_path124.join)(baseDir, relativePath));
|
|
17505
17900
|
return new _DeepagentsRule({
|
|
17506
17901
|
baseDir,
|
|
17507
17902
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17556,7 +17951,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
17556
17951
|
};
|
|
17557
17952
|
|
|
17558
17953
|
// src/features/rules/factorydroid-rule.ts
|
|
17559
|
-
var
|
|
17954
|
+
var import_node_path125 = require("path");
|
|
17560
17955
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
17561
17956
|
constructor({ fileContent, root, ...rest }) {
|
|
17562
17957
|
super({
|
|
@@ -17596,8 +17991,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
17596
17991
|
const paths = this.getSettablePaths({ global });
|
|
17597
17992
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17598
17993
|
if (isRoot) {
|
|
17599
|
-
const relativePath2 = (0,
|
|
17600
|
-
const fileContent2 = await readFileContent((0,
|
|
17994
|
+
const relativePath2 = (0, import_node_path125.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
17995
|
+
const fileContent2 = await readFileContent((0, import_node_path125.join)(baseDir, relativePath2));
|
|
17601
17996
|
return new _FactorydroidRule({
|
|
17602
17997
|
baseDir,
|
|
17603
17998
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -17610,8 +18005,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
17610
18005
|
if (!paths.nonRoot) {
|
|
17611
18006
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17612
18007
|
}
|
|
17613
|
-
const relativePath = (0,
|
|
17614
|
-
const fileContent = await readFileContent((0,
|
|
18008
|
+
const relativePath = (0, import_node_path125.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18009
|
+
const fileContent = await readFileContent((0, import_node_path125.join)(baseDir, relativePath));
|
|
17615
18010
|
return new _FactorydroidRule({
|
|
17616
18011
|
baseDir,
|
|
17617
18012
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17670,7 +18065,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
17670
18065
|
};
|
|
17671
18066
|
|
|
17672
18067
|
// src/features/rules/geminicli-rule.ts
|
|
17673
|
-
var
|
|
18068
|
+
var import_node_path126 = require("path");
|
|
17674
18069
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
17675
18070
|
static getSettablePaths({
|
|
17676
18071
|
global,
|
|
@@ -17705,7 +18100,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
17705
18100
|
if (isRoot) {
|
|
17706
18101
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17707
18102
|
const fileContent2 = await readFileContent(
|
|
17708
|
-
(0,
|
|
18103
|
+
(0, import_node_path126.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17709
18104
|
);
|
|
17710
18105
|
return new _GeminiCliRule({
|
|
17711
18106
|
baseDir,
|
|
@@ -17719,8 +18114,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
17719
18114
|
if (!paths.nonRoot) {
|
|
17720
18115
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17721
18116
|
}
|
|
17722
|
-
const relativePath = (0,
|
|
17723
|
-
const fileContent = await readFileContent((0,
|
|
18117
|
+
const relativePath = (0, import_node_path126.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18118
|
+
const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
|
|
17724
18119
|
return new _GeminiCliRule({
|
|
17725
18120
|
baseDir,
|
|
17726
18121
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17779,7 +18174,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
17779
18174
|
};
|
|
17780
18175
|
|
|
17781
18176
|
// src/features/rules/goose-rule.ts
|
|
17782
|
-
var
|
|
18177
|
+
var import_node_path127 = require("path");
|
|
17783
18178
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
17784
18179
|
static getSettablePaths({
|
|
17785
18180
|
global,
|
|
@@ -17814,7 +18209,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
17814
18209
|
if (isRoot) {
|
|
17815
18210
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17816
18211
|
const fileContent2 = await readFileContent(
|
|
17817
|
-
(0,
|
|
18212
|
+
(0, import_node_path127.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17818
18213
|
);
|
|
17819
18214
|
return new _GooseRule({
|
|
17820
18215
|
baseDir,
|
|
@@ -17828,8 +18223,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
17828
18223
|
if (!paths.nonRoot) {
|
|
17829
18224
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17830
18225
|
}
|
|
17831
|
-
const relativePath = (0,
|
|
17832
|
-
const fileContent = await readFileContent((0,
|
|
18226
|
+
const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18227
|
+
const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
|
|
17833
18228
|
return new _GooseRule({
|
|
17834
18229
|
baseDir,
|
|
17835
18230
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17888,7 +18283,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
17888
18283
|
};
|
|
17889
18284
|
|
|
17890
18285
|
// src/features/rules/junie-rule.ts
|
|
17891
|
-
var
|
|
18286
|
+
var import_node_path128 = require("path");
|
|
17892
18287
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
17893
18288
|
static getSettablePaths(_options = {}) {
|
|
17894
18289
|
return {
|
|
@@ -17917,8 +18312,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
17917
18312
|
}) {
|
|
17918
18313
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
17919
18314
|
const settablePaths = this.getSettablePaths();
|
|
17920
|
-
const relativePath = isRoot ? (0,
|
|
17921
|
-
const fileContent = await readFileContent((0,
|
|
18315
|
+
const relativePath = isRoot ? (0, import_node_path128.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path128.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18316
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
|
|
17922
18317
|
return new _JunieRule({
|
|
17923
18318
|
baseDir,
|
|
17924
18319
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17973,7 +18368,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
17973
18368
|
};
|
|
17974
18369
|
|
|
17975
18370
|
// src/features/rules/kilo-rule.ts
|
|
17976
|
-
var
|
|
18371
|
+
var import_node_path129 = require("path");
|
|
17977
18372
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
17978
18373
|
static getSettablePaths({
|
|
17979
18374
|
global,
|
|
@@ -18008,7 +18403,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18008
18403
|
if (isRoot) {
|
|
18009
18404
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18010
18405
|
const fileContent2 = await readFileContent(
|
|
18011
|
-
(0,
|
|
18406
|
+
(0, import_node_path129.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18012
18407
|
);
|
|
18013
18408
|
return new _KiloRule({
|
|
18014
18409
|
baseDir,
|
|
@@ -18022,8 +18417,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18022
18417
|
if (!paths.nonRoot) {
|
|
18023
18418
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18024
18419
|
}
|
|
18025
|
-
const relativePath = (0,
|
|
18026
|
-
const fileContent = await readFileContent((0,
|
|
18420
|
+
const relativePath = (0, import_node_path129.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18421
|
+
const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
|
|
18027
18422
|
return new _KiloRule({
|
|
18028
18423
|
baseDir,
|
|
18029
18424
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18082,7 +18477,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18082
18477
|
};
|
|
18083
18478
|
|
|
18084
18479
|
// src/features/rules/kiro-rule.ts
|
|
18085
|
-
var
|
|
18480
|
+
var import_node_path130 = require("path");
|
|
18086
18481
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18087
18482
|
static getSettablePaths(_options = {}) {
|
|
18088
18483
|
return {
|
|
@@ -18097,7 +18492,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18097
18492
|
validate = true
|
|
18098
18493
|
}) {
|
|
18099
18494
|
const fileContent = await readFileContent(
|
|
18100
|
-
(0,
|
|
18495
|
+
(0, import_node_path130.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18101
18496
|
);
|
|
18102
18497
|
return new _KiroRule({
|
|
18103
18498
|
baseDir,
|
|
@@ -18151,7 +18546,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18151
18546
|
};
|
|
18152
18547
|
|
|
18153
18548
|
// src/features/rules/opencode-rule.ts
|
|
18154
|
-
var
|
|
18549
|
+
var import_node_path131 = require("path");
|
|
18155
18550
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18156
18551
|
static getSettablePaths({
|
|
18157
18552
|
global,
|
|
@@ -18186,7 +18581,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18186
18581
|
if (isRoot) {
|
|
18187
18582
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18188
18583
|
const fileContent2 = await readFileContent(
|
|
18189
|
-
(0,
|
|
18584
|
+
(0, import_node_path131.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18190
18585
|
);
|
|
18191
18586
|
return new _OpenCodeRule({
|
|
18192
18587
|
baseDir,
|
|
@@ -18200,8 +18595,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18200
18595
|
if (!paths.nonRoot) {
|
|
18201
18596
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18202
18597
|
}
|
|
18203
|
-
const relativePath = (0,
|
|
18204
|
-
const fileContent = await readFileContent((0,
|
|
18598
|
+
const relativePath = (0, import_node_path131.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18599
|
+
const fileContent = await readFileContent((0, import_node_path131.join)(baseDir, relativePath));
|
|
18205
18600
|
return new _OpenCodeRule({
|
|
18206
18601
|
baseDir,
|
|
18207
18602
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18260,7 +18655,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
18260
18655
|
};
|
|
18261
18656
|
|
|
18262
18657
|
// src/features/rules/qwencode-rule.ts
|
|
18263
|
-
var
|
|
18658
|
+
var import_node_path132 = require("path");
|
|
18264
18659
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
18265
18660
|
static getSettablePaths(_options = {}) {
|
|
18266
18661
|
return {
|
|
@@ -18279,8 +18674,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18279
18674
|
validate = true
|
|
18280
18675
|
}) {
|
|
18281
18676
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
18282
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
18283
|
-
const fileContent = await readFileContent((0,
|
|
18677
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path132.join)(".qwen", "memories", relativeFilePath);
|
|
18678
|
+
const fileContent = await readFileContent((0, import_node_path132.join)(baseDir, relativePath));
|
|
18284
18679
|
return new _QwencodeRule({
|
|
18285
18680
|
baseDir,
|
|
18286
18681
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -18332,7 +18727,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
18332
18727
|
};
|
|
18333
18728
|
|
|
18334
18729
|
// src/features/rules/replit-rule.ts
|
|
18335
|
-
var
|
|
18730
|
+
var import_node_path133 = require("path");
|
|
18336
18731
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
18337
18732
|
static getSettablePaths(_options = {}) {
|
|
18338
18733
|
return {
|
|
@@ -18354,7 +18749,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18354
18749
|
}
|
|
18355
18750
|
const relativePath = paths.root.relativeFilePath;
|
|
18356
18751
|
const fileContent = await readFileContent(
|
|
18357
|
-
(0,
|
|
18752
|
+
(0, import_node_path133.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
18358
18753
|
);
|
|
18359
18754
|
return new _ReplitRule({
|
|
18360
18755
|
baseDir,
|
|
@@ -18420,7 +18815,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
18420
18815
|
};
|
|
18421
18816
|
|
|
18422
18817
|
// src/features/rules/roo-rule.ts
|
|
18423
|
-
var
|
|
18818
|
+
var import_node_path134 = require("path");
|
|
18424
18819
|
var RooRule = class _RooRule extends ToolRule {
|
|
18425
18820
|
static getSettablePaths(_options = {}) {
|
|
18426
18821
|
return {
|
|
@@ -18435,7 +18830,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18435
18830
|
validate = true
|
|
18436
18831
|
}) {
|
|
18437
18832
|
const fileContent = await readFileContent(
|
|
18438
|
-
(0,
|
|
18833
|
+
(0, import_node_path134.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18439
18834
|
);
|
|
18440
18835
|
return new _RooRule({
|
|
18441
18836
|
baseDir,
|
|
@@ -18504,7 +18899,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
18504
18899
|
};
|
|
18505
18900
|
|
|
18506
18901
|
// src/features/rules/rovodev-rule.ts
|
|
18507
|
-
var
|
|
18902
|
+
var import_node_path135 = require("path");
|
|
18508
18903
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
18509
18904
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
18510
18905
|
/**
|
|
@@ -18548,7 +18943,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18548
18943
|
root: rovodevAgents,
|
|
18549
18944
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
18550
18945
|
nonRoot: {
|
|
18551
|
-
relativeDirPath: (0,
|
|
18946
|
+
relativeDirPath: (0, import_node_path135.join)(".rovodev", ".rulesync", "modular-rules")
|
|
18552
18947
|
}
|
|
18553
18948
|
};
|
|
18554
18949
|
}
|
|
@@ -18587,10 +18982,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18587
18982
|
}) {
|
|
18588
18983
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
18589
18984
|
throw new Error(
|
|
18590
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
18985
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
|
|
18591
18986
|
);
|
|
18592
18987
|
}
|
|
18593
|
-
const fileContent = await readFileContent((0,
|
|
18988
|
+
const fileContent = await readFileContent((0, import_node_path135.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
18594
18989
|
return new _RovodevRule({
|
|
18595
18990
|
baseDir,
|
|
18596
18991
|
relativeDirPath,
|
|
@@ -18610,10 +19005,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18610
19005
|
paths
|
|
18611
19006
|
}) {
|
|
18612
19007
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
18613
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
19008
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path135.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path135.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18614
19009
|
if (relativeFilePath !== "AGENTS.md") {
|
|
18615
19010
|
throw new Error(
|
|
18616
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19011
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
|
|
18617
19012
|
);
|
|
18618
19013
|
}
|
|
18619
19014
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -18621,10 +19016,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18621
19016
|
);
|
|
18622
19017
|
if (!allowed) {
|
|
18623
19018
|
throw new Error(
|
|
18624
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19019
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path135.join)(relativeDirPath, relativeFilePath)}`
|
|
18625
19020
|
);
|
|
18626
19021
|
}
|
|
18627
|
-
const fileContent = await readFileContent((0,
|
|
19022
|
+
const fileContent = await readFileContent((0, import_node_path135.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
18628
19023
|
return new _RovodevRule({
|
|
18629
19024
|
baseDir,
|
|
18630
19025
|
relativeDirPath,
|
|
@@ -18738,7 +19133,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
18738
19133
|
};
|
|
18739
19134
|
|
|
18740
19135
|
// src/features/rules/warp-rule.ts
|
|
18741
|
-
var
|
|
19136
|
+
var import_node_path136 = require("path");
|
|
18742
19137
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
18743
19138
|
constructor({ fileContent, root, ...rest }) {
|
|
18744
19139
|
super({
|
|
@@ -18764,8 +19159,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
18764
19159
|
validate = true
|
|
18765
19160
|
}) {
|
|
18766
19161
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
18767
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
18768
|
-
const fileContent = await readFileContent((0,
|
|
19162
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path136.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19163
|
+
const fileContent = await readFileContent((0, import_node_path136.join)(baseDir, relativePath));
|
|
18769
19164
|
return new _WarpRule({
|
|
18770
19165
|
baseDir,
|
|
18771
19166
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -18820,7 +19215,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
18820
19215
|
};
|
|
18821
19216
|
|
|
18822
19217
|
// src/features/rules/windsurf-rule.ts
|
|
18823
|
-
var
|
|
19218
|
+
var import_node_path137 = require("path");
|
|
18824
19219
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
18825
19220
|
static getSettablePaths(_options = {}) {
|
|
18826
19221
|
return {
|
|
@@ -18835,7 +19230,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
18835
19230
|
validate = true
|
|
18836
19231
|
}) {
|
|
18837
19232
|
const fileContent = await readFileContent(
|
|
18838
|
-
(0,
|
|
19233
|
+
(0, import_node_path137.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18839
19234
|
);
|
|
18840
19235
|
return new _WindsurfRule({
|
|
18841
19236
|
baseDir,
|
|
@@ -18850,14 +19245,21 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
18850
19245
|
rulesyncRule,
|
|
18851
19246
|
validate = true
|
|
18852
19247
|
}) {
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
|
|
19248
|
+
const toolRuleParams = this.buildToolRuleParamsDefault({
|
|
19249
|
+
baseDir,
|
|
19250
|
+
rulesyncRule,
|
|
19251
|
+
validate,
|
|
19252
|
+
nonRootPath: this.getSettablePaths().nonRoot
|
|
19253
|
+
});
|
|
19254
|
+
const windsurfFrontmatter = this.buildWindsurfFrontmatter({
|
|
19255
|
+
relativeFilePath: rulesyncRule.getRelativeFilePath(),
|
|
19256
|
+
description: rulesyncRule.getFrontmatter().description,
|
|
19257
|
+
globs: rulesyncRule.getFrontmatter().globs
|
|
19258
|
+
});
|
|
19259
|
+
return new _WindsurfRule({
|
|
19260
|
+
...toolRuleParams,
|
|
19261
|
+
fileContent: stringifyFrontmatter(rulesyncRule.getBody(), windsurfFrontmatter)
|
|
19262
|
+
});
|
|
18861
19263
|
}
|
|
18862
19264
|
toRulesyncRule() {
|
|
18863
19265
|
return this.toRulesyncRuleDefault();
|
|
@@ -18884,6 +19286,18 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
18884
19286
|
toolTarget: "windsurf"
|
|
18885
19287
|
});
|
|
18886
19288
|
}
|
|
19289
|
+
static buildWindsurfFrontmatter({
|
|
19290
|
+
relativeFilePath,
|
|
19291
|
+
description,
|
|
19292
|
+
globs
|
|
19293
|
+
}) {
|
|
19294
|
+
const hasSpecificGlobs = Boolean(globs && globs.length > 0 && !globs.includes("**/*"));
|
|
19295
|
+
return {
|
|
19296
|
+
title: description ?? relativeFilePath.replace(/\.md$/, ""),
|
|
19297
|
+
trigger: hasSpecificGlobs ? "glob" : "always_on",
|
|
19298
|
+
...hasSpecificGlobs && { globs }
|
|
19299
|
+
};
|
|
19300
|
+
}
|
|
18887
19301
|
};
|
|
18888
19302
|
|
|
18889
19303
|
// src/features/rules/rules-processor.ts
|
|
@@ -18914,8 +19328,30 @@ var rulesProcessorToolTargets = [
|
|
|
18914
19328
|
"warp",
|
|
18915
19329
|
"windsurf"
|
|
18916
19330
|
];
|
|
18917
|
-
var RulesProcessorToolTargetSchema =
|
|
18918
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
19331
|
+
var RulesProcessorToolTargetSchema = import_mini70.z.enum(rulesProcessorToolTargets);
|
|
19332
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path138.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19333
|
+
var RulesFeatureOptionsSchema = import_mini70.z.looseObject({
|
|
19334
|
+
ruleDiscoveryMode: import_mini70.z.optional(import_mini70.z.enum(["none", "explicit"]))
|
|
19335
|
+
});
|
|
19336
|
+
var resolveRuleDiscoveryMode = ({
|
|
19337
|
+
defaultMode,
|
|
19338
|
+
options
|
|
19339
|
+
}) => {
|
|
19340
|
+
if (defaultMode === "claudecode-legacy") {
|
|
19341
|
+
return defaultMode;
|
|
19342
|
+
}
|
|
19343
|
+
if (!options) return defaultMode;
|
|
19344
|
+
const parsed = RulesFeatureOptionsSchema.safeParse(options);
|
|
19345
|
+
if (!parsed.success) {
|
|
19346
|
+
throw new Error(
|
|
19347
|
+
`Invalid options for rules feature: ${parsed.error.message}. \`ruleDiscoveryMode\` must be either "none" or "explicit".`
|
|
19348
|
+
);
|
|
19349
|
+
}
|
|
19350
|
+
if (!parsed.data.ruleDiscoveryMode) {
|
|
19351
|
+
return defaultMode;
|
|
19352
|
+
}
|
|
19353
|
+
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19354
|
+
};
|
|
18919
19355
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
18920
19356
|
[
|
|
18921
19357
|
"agentsmd",
|
|
@@ -19230,6 +19666,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19230
19666
|
global;
|
|
19231
19667
|
getFactory;
|
|
19232
19668
|
skills;
|
|
19669
|
+
featureOptions;
|
|
19233
19670
|
constructor({
|
|
19234
19671
|
baseDir = process.cwd(),
|
|
19235
19672
|
toolTarget,
|
|
@@ -19239,6 +19676,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19239
19676
|
global = false,
|
|
19240
19677
|
getFactory = defaultGetFactory6,
|
|
19241
19678
|
skills,
|
|
19679
|
+
featureOptions,
|
|
19242
19680
|
dryRun = false,
|
|
19243
19681
|
logger
|
|
19244
19682
|
}) {
|
|
@@ -19256,6 +19694,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19256
19694
|
this.simulateSkills = simulateSkills;
|
|
19257
19695
|
this.getFactory = getFactory;
|
|
19258
19696
|
this.skills = skills;
|
|
19697
|
+
this.featureOptions = featureOptions;
|
|
19259
19698
|
}
|
|
19260
19699
|
async convertRulesyncFilesToToolFiles(rulesyncFiles) {
|
|
19261
19700
|
const rulesyncRules = rulesyncFiles.filter(
|
|
@@ -19343,7 +19782,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19343
19782
|
}).relativeDirPath;
|
|
19344
19783
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
19345
19784
|
const frontmatter = skill.getFrontmatter();
|
|
19346
|
-
const relativePath = (0,
|
|
19785
|
+
const relativePath = (0, import_node_path138.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
19347
19786
|
return {
|
|
19348
19787
|
name: frontmatter.name,
|
|
19349
19788
|
description: frontmatter.description,
|
|
@@ -19413,7 +19852,11 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19413
19852
|
* Generate reference section based on meta configuration.
|
|
19414
19853
|
*/
|
|
19415
19854
|
generateReferenceSectionFromMeta(meta, toolRules) {
|
|
19416
|
-
|
|
19855
|
+
const mode = resolveRuleDiscoveryMode({
|
|
19856
|
+
defaultMode: meta.ruleDiscoveryMode,
|
|
19857
|
+
options: this.featureOptions
|
|
19858
|
+
});
|
|
19859
|
+
switch (mode) {
|
|
19417
19860
|
case "toon":
|
|
19418
19861
|
return this.generateToonReferencesSection(toolRules);
|
|
19419
19862
|
case "claudecode-legacy":
|
|
@@ -19468,12 +19911,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19468
19911
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
19469
19912
|
*/
|
|
19470
19913
|
async loadRulesyncFiles() {
|
|
19471
|
-
const rulesyncBaseDir = (0,
|
|
19472
|
-
const files = await findFilesByGlobs((0,
|
|
19914
|
+
const rulesyncBaseDir = (0, import_node_path138.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
19915
|
+
const files = await findFilesByGlobs((0, import_node_path138.join)(rulesyncBaseDir, "**", "*.md"));
|
|
19473
19916
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
19474
19917
|
const rulesyncRules = await Promise.all(
|
|
19475
19918
|
files.map((file) => {
|
|
19476
|
-
const relativeFilePath = (0,
|
|
19919
|
+
const relativeFilePath = (0, import_node_path138.relative)(rulesyncBaseDir, file);
|
|
19477
19920
|
checkPathTraversal({
|
|
19478
19921
|
relativePath: relativeFilePath,
|
|
19479
19922
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -19548,7 +19991,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19548
19991
|
global: this.global
|
|
19549
19992
|
});
|
|
19550
19993
|
const resolveRelativeDirPath = (filePath) => {
|
|
19551
|
-
const dirName = (0,
|
|
19994
|
+
const dirName = (0, import_node_path138.dirname)((0, import_node_path138.relative)(this.baseDir, filePath));
|
|
19552
19995
|
return dirName === "" ? "." : dirName;
|
|
19553
19996
|
};
|
|
19554
19997
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -19556,7 +19999,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19556
19999
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
19557
20000
|
return filePaths.map((filePath) => {
|
|
19558
20001
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
19559
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
20002
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path138.relative)(effectiveBaseDir, filePath) : (0, import_node_path138.basename)(filePath);
|
|
19560
20003
|
checkPathTraversal({
|
|
19561
20004
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
19562
20005
|
intendedRootDir: effectiveBaseDir
|
|
@@ -19584,13 +20027,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19584
20027
|
return [];
|
|
19585
20028
|
}
|
|
19586
20029
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
19587
|
-
(0,
|
|
20030
|
+
(0, import_node_path138.join)(
|
|
19588
20031
|
this.baseDir,
|
|
19589
20032
|
settablePaths.root.relativeDirPath ?? ".",
|
|
19590
20033
|
settablePaths.root.relativeFilePath
|
|
19591
20034
|
),
|
|
19592
20035
|
settablePaths.alternativeRoots,
|
|
19593
|
-
(alt) => (0,
|
|
20036
|
+
(alt) => (0, import_node_path138.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
19594
20037
|
);
|
|
19595
20038
|
if (forDeletion) {
|
|
19596
20039
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -19604,7 +20047,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19604
20047
|
});
|
|
19605
20048
|
return factory.class.fromFile({
|
|
19606
20049
|
baseDir: this.baseDir,
|
|
19607
|
-
relativeFilePath: (0,
|
|
20050
|
+
relativeFilePath: (0, import_node_path138.basename)(filePath),
|
|
19608
20051
|
relativeDirPath,
|
|
19609
20052
|
global: this.global
|
|
19610
20053
|
});
|
|
@@ -19621,7 +20064,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19621
20064
|
return [];
|
|
19622
20065
|
}
|
|
19623
20066
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
19624
|
-
(0,
|
|
20067
|
+
(0, import_node_path138.join)(this.baseDir, "AGENTS.local.md")
|
|
19625
20068
|
);
|
|
19626
20069
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
19627
20070
|
}
|
|
@@ -19632,9 +20075,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19632
20075
|
return [];
|
|
19633
20076
|
}
|
|
19634
20077
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
19635
|
-
(0,
|
|
20078
|
+
(0, import_node_path138.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
19636
20079
|
settablePaths.alternativeRoots,
|
|
19637
|
-
(alt) => (0,
|
|
20080
|
+
(alt) => (0, import_node_path138.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
19638
20081
|
);
|
|
19639
20082
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
19640
20083
|
})();
|
|
@@ -19645,20 +20088,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19645
20088
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
19646
20089
|
return [];
|
|
19647
20090
|
}
|
|
19648
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
20091
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path138.join)(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
19649
20092
|
if (primaryPaths.length === 0) {
|
|
19650
20093
|
return [];
|
|
19651
20094
|
}
|
|
19652
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
20095
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path138.join)(this.baseDir, "AGENTS.md"));
|
|
19653
20096
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
19654
20097
|
})();
|
|
19655
20098
|
const nonRootToolRules = await (async () => {
|
|
19656
20099
|
if (!settablePaths.nonRoot) {
|
|
19657
20100
|
return [];
|
|
19658
20101
|
}
|
|
19659
|
-
const nonRootBaseDir = (0,
|
|
20102
|
+
const nonRootBaseDir = (0, import_node_path138.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
19660
20103
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
19661
|
-
(0,
|
|
20104
|
+
(0, import_node_path138.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
19662
20105
|
);
|
|
19663
20106
|
if (forDeletion) {
|
|
19664
20107
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -19668,18 +20111,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
19668
20111
|
}
|
|
19669
20112
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
19670
20113
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
19671
|
-
const relativeFilePath = (0,
|
|
20114
|
+
const relativeFilePath = (0, import_node_path138.relative)(nonRootBaseDir, filePath);
|
|
19672
20115
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
19673
20116
|
if (!ok) {
|
|
19674
20117
|
this.logger.warn(
|
|
19675
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
20118
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path138.join)(modularRootRelative, relativeFilePath)}`
|
|
19676
20119
|
);
|
|
19677
20120
|
}
|
|
19678
20121
|
return ok;
|
|
19679
20122
|
}) : nonRootFilePaths;
|
|
19680
20123
|
return await Promise.all(
|
|
19681
20124
|
nonRootPathsForImport.map((filePath) => {
|
|
19682
|
-
const relativeFilePath = (0,
|
|
20125
|
+
const relativeFilePath = (0, import_node_path138.relative)(nonRootBaseDir, filePath);
|
|
19683
20126
|
checkPathTraversal({
|
|
19684
20127
|
relativePath: relativeFilePath,
|
|
19685
20128
|
intendedRootDir: nonRootBaseDir
|
|
@@ -19798,14 +20241,14 @@ s/<command> [arguments]
|
|
|
19798
20241
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
19799
20242
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
19800
20243
|
|
|
19801
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
20244
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path138.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
19802
20245
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
19803
20246
|
|
|
19804
20247
|
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.
|
|
19805
20248
|
|
|
19806
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
20249
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path138.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
19807
20250
|
|
|
19808
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
20251
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path138.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
19809
20252
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
19810
20253
|
const result = [
|
|
19811
20254
|
overview,
|
|
@@ -19905,7 +20348,7 @@ function warnUnsupportedTargets(params) {
|
|
|
19905
20348
|
}
|
|
19906
20349
|
}
|
|
19907
20350
|
async function checkRulesyncDirExists(params) {
|
|
19908
|
-
return fileExists((0,
|
|
20351
|
+
return fileExists((0, import_node_path139.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
19909
20352
|
}
|
|
19910
20353
|
async function generate(params) {
|
|
19911
20354
|
const { config, logger } = params;
|
|
@@ -19960,6 +20403,7 @@ async function generateRulesCore(params) {
|
|
|
19960
20403
|
simulateSubagents: config.getSimulateSubagents(),
|
|
19961
20404
|
simulateSkills: config.getSimulateSkills(),
|
|
19962
20405
|
skills,
|
|
20406
|
+
featureOptions: config.getFeatureOptions(toolTarget, "rules"),
|
|
19963
20407
|
dryRun: config.isPreviewMode(),
|
|
19964
20408
|
logger
|
|
19965
20409
|
});
|