rulesync 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-PEMFIVEG.js → chunk-HA3HGPC7.js} +841 -589
- package/dist/cli/index.cjs +1125 -873
- package/dist/cli/index.js +2 -2
- package/dist/index.cjs +866 -614
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -634,7 +634,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
// src/lib/generate.ts
|
|
637
|
-
var
|
|
637
|
+
var import_node_path114 = require("path");
|
|
638
638
|
var import_es_toolkit4 = require("es-toolkit");
|
|
639
639
|
|
|
640
640
|
// src/features/commands/commands-processor.ts
|
|
@@ -3019,7 +3019,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3019
3019
|
};
|
|
3020
3020
|
|
|
3021
3021
|
// src/features/hooks/hooks-processor.ts
|
|
3022
|
-
var
|
|
3022
|
+
var import_mini16 = require("zod/mini");
|
|
3023
3023
|
|
|
3024
3024
|
// src/types/hooks.ts
|
|
3025
3025
|
var import_mini14 = require("zod/mini");
|
|
@@ -3084,6 +3084,14 @@ var OPENCODE_HOOK_EVENTS = [
|
|
|
3084
3084
|
"afterShellExecution",
|
|
3085
3085
|
"permissionRequest"
|
|
3086
3086
|
];
|
|
3087
|
+
var COPILOT_HOOK_EVENTS = [
|
|
3088
|
+
"sessionStart",
|
|
3089
|
+
"sessionEnd",
|
|
3090
|
+
"afterSubmitPrompt",
|
|
3091
|
+
"preToolUse",
|
|
3092
|
+
"postToolUse",
|
|
3093
|
+
"afterError"
|
|
3094
|
+
];
|
|
3087
3095
|
var FACTORYDROID_HOOK_EVENTS = [
|
|
3088
3096
|
"sessionStart",
|
|
3089
3097
|
"sessionEnd",
|
|
@@ -3103,6 +3111,7 @@ var HooksConfigSchema = import_mini14.z.looseObject({
|
|
|
3103
3111
|
hooks: hooksRecordSchema,
|
|
3104
3112
|
cursor: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3105
3113
|
claudecode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3114
|
+
copilot: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3106
3115
|
opencode: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) })),
|
|
3107
3116
|
factorydroid: import_mini14.z.optional(import_mini14.z.looseObject({ hooks: import_mini14.z.optional(hooksRecordSchema) }))
|
|
3108
3117
|
});
|
|
@@ -3172,6 +3181,17 @@ var CANONICAL_TO_OPENCODE_EVENT_NAMES = {
|
|
|
3172
3181
|
afterShellExecution: "command.executed",
|
|
3173
3182
|
permissionRequest: "permission.asked"
|
|
3174
3183
|
};
|
|
3184
|
+
var CANONICAL_TO_COPILOT_EVENT_NAMES = {
|
|
3185
|
+
sessionStart: "sessionStart",
|
|
3186
|
+
sessionEnd: "sessionEnd",
|
|
3187
|
+
afterSubmitPrompt: "userPromptSubmitted",
|
|
3188
|
+
preToolUse: "preToolUse",
|
|
3189
|
+
postToolUse: "postToolUse",
|
|
3190
|
+
afterError: "errorOccurred"
|
|
3191
|
+
};
|
|
3192
|
+
var COPILOT_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
3193
|
+
Object.entries(CANONICAL_TO_COPILOT_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
3194
|
+
);
|
|
3175
3195
|
|
|
3176
3196
|
// src/features/hooks/claudecode-hooks.ts
|
|
3177
3197
|
var import_node_path22 = require("path");
|
|
@@ -3448,8 +3468,185 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
3448
3468
|
}
|
|
3449
3469
|
};
|
|
3450
3470
|
|
|
3451
|
-
// src/features/hooks/
|
|
3471
|
+
// src/features/hooks/copilot-hooks.ts
|
|
3452
3472
|
var import_node_path23 = require("path");
|
|
3473
|
+
var import_mini15 = require("zod/mini");
|
|
3474
|
+
var CopilotHookEntrySchema = import_mini15.z.looseObject({
|
|
3475
|
+
type: import_mini15.z.string(),
|
|
3476
|
+
bash: import_mini15.z.optional(import_mini15.z.string()),
|
|
3477
|
+
powershell: import_mini15.z.optional(import_mini15.z.string()),
|
|
3478
|
+
timeoutSec: import_mini15.z.optional(import_mini15.z.number())
|
|
3479
|
+
});
|
|
3480
|
+
function canonicalToCopilotHooks(config) {
|
|
3481
|
+
const isWindows = process.platform === "win32";
|
|
3482
|
+
const commandField = isWindows ? "powershell" : "bash";
|
|
3483
|
+
const supported = new Set(COPILOT_HOOK_EVENTS);
|
|
3484
|
+
const sharedConfigHooks = {};
|
|
3485
|
+
for (const [event, defs] of Object.entries(config.hooks)) {
|
|
3486
|
+
if (supported.has(event)) {
|
|
3487
|
+
sharedConfigHooks[event] = defs;
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
const effectiveHooks = {
|
|
3491
|
+
...sharedConfigHooks,
|
|
3492
|
+
...config.copilot?.hooks
|
|
3493
|
+
};
|
|
3494
|
+
const copilot = {};
|
|
3495
|
+
for (const [eventName, definitions] of Object.entries(effectiveHooks)) {
|
|
3496
|
+
const copilotEventName = CANONICAL_TO_COPILOT_EVENT_NAMES[eventName] ?? eventName;
|
|
3497
|
+
const entries = [];
|
|
3498
|
+
for (const def of definitions) {
|
|
3499
|
+
const hookType = def.type ?? "command";
|
|
3500
|
+
if (def.matcher) continue;
|
|
3501
|
+
if (hookType !== "command") continue;
|
|
3502
|
+
const command = def.command;
|
|
3503
|
+
const timeout = def.timeout;
|
|
3504
|
+
const rest = Object.fromEntries(
|
|
3505
|
+
Object.entries(def).filter(
|
|
3506
|
+
([k]) => !["type", "matcher", "command", "prompt", "timeout"].includes(k)
|
|
3507
|
+
)
|
|
3508
|
+
);
|
|
3509
|
+
entries.push({
|
|
3510
|
+
type: hookType,
|
|
3511
|
+
...command !== void 0 && command !== null && { [commandField]: command },
|
|
3512
|
+
...timeout !== void 0 && timeout !== null && { timeoutSec: timeout },
|
|
3513
|
+
...rest
|
|
3514
|
+
});
|
|
3515
|
+
}
|
|
3516
|
+
if (entries.length > 0) {
|
|
3517
|
+
copilot[copilotEventName] = entries;
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
return copilot;
|
|
3521
|
+
}
|
|
3522
|
+
function resolveImportCommand(entry) {
|
|
3523
|
+
const hasBash = typeof entry.bash === "string";
|
|
3524
|
+
const hasPowershell = typeof entry.powershell === "string";
|
|
3525
|
+
if (hasBash && hasPowershell) {
|
|
3526
|
+
const isWindows = process.platform === "win32";
|
|
3527
|
+
const chosen = isWindows ? "powershell" : "bash";
|
|
3528
|
+
const ignored = isWindows ? "bash" : "powershell";
|
|
3529
|
+
logger.warn(
|
|
3530
|
+
`Copilot hook has both bash and powershell commands; using ${chosen} and ignoring ${ignored} on this platform.`
|
|
3531
|
+
);
|
|
3532
|
+
return isWindows ? entry.powershell : entry.bash;
|
|
3533
|
+
} else if (hasBash) {
|
|
3534
|
+
return entry.bash;
|
|
3535
|
+
} else if (hasPowershell) {
|
|
3536
|
+
return entry.powershell;
|
|
3537
|
+
}
|
|
3538
|
+
return void 0;
|
|
3539
|
+
}
|
|
3540
|
+
function copilotHooksToCanonical(copilotHooks) {
|
|
3541
|
+
if (copilotHooks === null || copilotHooks === void 0 || typeof copilotHooks !== "object") {
|
|
3542
|
+
return {};
|
|
3543
|
+
}
|
|
3544
|
+
const canonical = {};
|
|
3545
|
+
for (const [copilotEventName, hookEntries] of Object.entries(copilotHooks)) {
|
|
3546
|
+
const eventName = COPILOT_TO_CANONICAL_EVENT_NAMES[copilotEventName] ?? copilotEventName;
|
|
3547
|
+
if (!Array.isArray(hookEntries)) continue;
|
|
3548
|
+
const defs = [];
|
|
3549
|
+
for (const rawEntry of hookEntries) {
|
|
3550
|
+
const parseResult = CopilotHookEntrySchema.safeParse(rawEntry);
|
|
3551
|
+
if (!parseResult.success) continue;
|
|
3552
|
+
const entry = parseResult.data;
|
|
3553
|
+
const command = resolveImportCommand(entry);
|
|
3554
|
+
const timeout = entry.timeoutSec;
|
|
3555
|
+
defs.push({
|
|
3556
|
+
type: "command",
|
|
3557
|
+
...command !== void 0 && { command },
|
|
3558
|
+
...timeout !== void 0 && { timeout }
|
|
3559
|
+
});
|
|
3560
|
+
}
|
|
3561
|
+
if (defs.length > 0) {
|
|
3562
|
+
canonical[eventName] = defs;
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
return canonical;
|
|
3566
|
+
}
|
|
3567
|
+
var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
3568
|
+
constructor(params) {
|
|
3569
|
+
super({
|
|
3570
|
+
...params,
|
|
3571
|
+
fileContent: params.fileContent ?? "{}"
|
|
3572
|
+
});
|
|
3573
|
+
}
|
|
3574
|
+
static getSettablePaths(_options = {}) {
|
|
3575
|
+
return {
|
|
3576
|
+
relativeDirPath: (0, import_node_path23.join)(".github", "hooks"),
|
|
3577
|
+
relativeFilePath: "copilot-hooks.json"
|
|
3578
|
+
};
|
|
3579
|
+
}
|
|
3580
|
+
static async fromFile({
|
|
3581
|
+
baseDir = process.cwd(),
|
|
3582
|
+
validate = true,
|
|
3583
|
+
global = false
|
|
3584
|
+
}) {
|
|
3585
|
+
const paths = _CopilotHooks.getSettablePaths({ global });
|
|
3586
|
+
const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3587
|
+
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3588
|
+
return new _CopilotHooks({
|
|
3589
|
+
baseDir,
|
|
3590
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3591
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3592
|
+
fileContent,
|
|
3593
|
+
validate
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3596
|
+
static async fromRulesyncHooks({
|
|
3597
|
+
baseDir = process.cwd(),
|
|
3598
|
+
rulesyncHooks,
|
|
3599
|
+
validate = true
|
|
3600
|
+
}) {
|
|
3601
|
+
const paths = _CopilotHooks.getSettablePaths();
|
|
3602
|
+
const config = rulesyncHooks.getJson();
|
|
3603
|
+
const copilotHooks = canonicalToCopilotHooks(config);
|
|
3604
|
+
const fileContent = JSON.stringify({ version: 1, hooks: copilotHooks }, null, 2);
|
|
3605
|
+
return new _CopilotHooks({
|
|
3606
|
+
baseDir,
|
|
3607
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3608
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3609
|
+
fileContent,
|
|
3610
|
+
validate
|
|
3611
|
+
});
|
|
3612
|
+
}
|
|
3613
|
+
toRulesyncHooks() {
|
|
3614
|
+
let parsed;
|
|
3615
|
+
try {
|
|
3616
|
+
parsed = JSON.parse(this.getFileContent());
|
|
3617
|
+
} catch (error) {
|
|
3618
|
+
throw new Error(
|
|
3619
|
+
`Failed to parse Copilot hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3620
|
+
{
|
|
3621
|
+
cause: error
|
|
3622
|
+
}
|
|
3623
|
+
);
|
|
3624
|
+
}
|
|
3625
|
+
const hooks = copilotHooksToCanonical(parsed.hooks);
|
|
3626
|
+
return this.toRulesyncHooksDefault({
|
|
3627
|
+
fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3630
|
+
validate() {
|
|
3631
|
+
return { success: true, error: null };
|
|
3632
|
+
}
|
|
3633
|
+
static forDeletion({
|
|
3634
|
+
baseDir = process.cwd(),
|
|
3635
|
+
relativeDirPath,
|
|
3636
|
+
relativeFilePath
|
|
3637
|
+
}) {
|
|
3638
|
+
return new _CopilotHooks({
|
|
3639
|
+
baseDir,
|
|
3640
|
+
relativeDirPath,
|
|
3641
|
+
relativeFilePath,
|
|
3642
|
+
fileContent: JSON.stringify({ hooks: {} }, null, 2),
|
|
3643
|
+
validate: false
|
|
3644
|
+
});
|
|
3645
|
+
}
|
|
3646
|
+
};
|
|
3647
|
+
|
|
3648
|
+
// src/features/hooks/cursor-hooks.ts
|
|
3649
|
+
var import_node_path24 = require("path");
|
|
3453
3650
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
3454
3651
|
constructor(params) {
|
|
3455
3652
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -3470,7 +3667,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3470
3667
|
}) {
|
|
3471
3668
|
const paths = _CursorHooks.getSettablePaths();
|
|
3472
3669
|
const fileContent = await readFileContent(
|
|
3473
|
-
(0,
|
|
3670
|
+
(0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3474
3671
|
);
|
|
3475
3672
|
return new _CursorHooks({
|
|
3476
3673
|
baseDir,
|
|
@@ -3550,7 +3747,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
3550
3747
|
};
|
|
3551
3748
|
|
|
3552
3749
|
// src/features/hooks/factorydroid-hooks.ts
|
|
3553
|
-
var
|
|
3750
|
+
var import_node_path25 = require("path");
|
|
3554
3751
|
function canonicalToFactorydroidHooks(config) {
|
|
3555
3752
|
const supported = new Set(FACTORYDROID_HOOK_EVENTS);
|
|
3556
3753
|
const sharedHooks = {};
|
|
@@ -3655,7 +3852,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3655
3852
|
global = false
|
|
3656
3853
|
}) {
|
|
3657
3854
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3658
|
-
const filePath = (0,
|
|
3855
|
+
const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3659
3856
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
3660
3857
|
return new _FactorydroidHooks({
|
|
3661
3858
|
baseDir,
|
|
@@ -3672,7 +3869,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3672
3869
|
global = false
|
|
3673
3870
|
}) {
|
|
3674
3871
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
3675
|
-
const filePath = (0,
|
|
3872
|
+
const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3676
3873
|
const existingContent = await readOrInitializeFileContent(
|
|
3677
3874
|
filePath,
|
|
3678
3875
|
JSON.stringify({}, null, 2)
|
|
@@ -3704,7 +3901,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3704
3901
|
settings = JSON.parse(this.getFileContent());
|
|
3705
3902
|
} catch (error) {
|
|
3706
3903
|
throw new Error(
|
|
3707
|
-
`Failed to parse Factory Droid hooks content in ${(0,
|
|
3904
|
+
`Failed to parse Factory Droid hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
3708
3905
|
{
|
|
3709
3906
|
cause: error
|
|
3710
3907
|
}
|
|
@@ -3734,7 +3931,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
3734
3931
|
};
|
|
3735
3932
|
|
|
3736
3933
|
// src/features/hooks/opencode-hooks.ts
|
|
3737
|
-
var
|
|
3934
|
+
var import_node_path26 = require("path");
|
|
3738
3935
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
3739
3936
|
function escapeForTemplateLiteral(command) {
|
|
3740
3937
|
return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
|
|
@@ -3832,7 +4029,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
3832
4029
|
}
|
|
3833
4030
|
static getSettablePaths(options) {
|
|
3834
4031
|
return {
|
|
3835
|
-
relativeDirPath: options?.global ? (0,
|
|
4032
|
+
relativeDirPath: options?.global ? (0, import_node_path26.join)(".config", "opencode", "plugins") : (0, import_node_path26.join)(".opencode", "plugins"),
|
|
3836
4033
|
relativeFilePath: "rulesync-hooks.js"
|
|
3837
4034
|
};
|
|
3838
4035
|
}
|
|
@@ -3843,7 +4040,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
3843
4040
|
}) {
|
|
3844
4041
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
3845
4042
|
const fileContent = await readFileContent(
|
|
3846
|
-
(0,
|
|
4043
|
+
(0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3847
4044
|
);
|
|
3848
4045
|
return new _OpencodeHooks({
|
|
3849
4046
|
baseDir,
|
|
@@ -3892,43 +4089,83 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
3892
4089
|
};
|
|
3893
4090
|
|
|
3894
4091
|
// src/features/hooks/hooks-processor.ts
|
|
3895
|
-
var hooksProcessorToolTargetTuple = [
|
|
3896
|
-
|
|
4092
|
+
var hooksProcessorToolTargetTuple = [
|
|
4093
|
+
"cursor",
|
|
4094
|
+
"claudecode",
|
|
4095
|
+
"copilot",
|
|
4096
|
+
"opencode",
|
|
4097
|
+
"factorydroid"
|
|
4098
|
+
];
|
|
4099
|
+
var HooksProcessorToolTargetSchema = import_mini16.z.enum(hooksProcessorToolTargetTuple);
|
|
3897
4100
|
var toolHooksFactories = /* @__PURE__ */ new Map([
|
|
3898
4101
|
[
|
|
3899
4102
|
"cursor",
|
|
3900
4103
|
{
|
|
3901
4104
|
class: CursorHooks,
|
|
3902
|
-
meta: {
|
|
4105
|
+
meta: {
|
|
4106
|
+
supportsProject: true,
|
|
4107
|
+
supportsGlobal: false,
|
|
4108
|
+
supportsImport: true
|
|
4109
|
+
},
|
|
3903
4110
|
supportedEvents: CURSOR_HOOK_EVENTS,
|
|
3904
|
-
supportedHookTypes: ["command", "prompt"]
|
|
4111
|
+
supportedHookTypes: ["command", "prompt"],
|
|
4112
|
+
supportsMatcher: true
|
|
3905
4113
|
}
|
|
3906
4114
|
],
|
|
3907
4115
|
[
|
|
3908
4116
|
"claudecode",
|
|
3909
4117
|
{
|
|
3910
4118
|
class: ClaudecodeHooks,
|
|
3911
|
-
meta: {
|
|
4119
|
+
meta: {
|
|
4120
|
+
supportsProject: true,
|
|
4121
|
+
supportsGlobal: true,
|
|
4122
|
+
supportsImport: true
|
|
4123
|
+
},
|
|
3912
4124
|
supportedEvents: CLAUDE_HOOK_EVENTS,
|
|
3913
|
-
supportedHookTypes: ["command", "prompt"]
|
|
4125
|
+
supportedHookTypes: ["command", "prompt"],
|
|
4126
|
+
supportsMatcher: true
|
|
4127
|
+
}
|
|
4128
|
+
],
|
|
4129
|
+
[
|
|
4130
|
+
"copilot",
|
|
4131
|
+
{
|
|
4132
|
+
class: CopilotHooks,
|
|
4133
|
+
meta: {
|
|
4134
|
+
supportsProject: true,
|
|
4135
|
+
supportsGlobal: false,
|
|
4136
|
+
supportsImport: true
|
|
4137
|
+
},
|
|
4138
|
+
supportedEvents: COPILOT_HOOK_EVENTS,
|
|
4139
|
+
supportedHookTypes: ["command"],
|
|
4140
|
+
supportsMatcher: false
|
|
3914
4141
|
}
|
|
3915
4142
|
],
|
|
3916
4143
|
[
|
|
3917
4144
|
"opencode",
|
|
3918
4145
|
{
|
|
3919
4146
|
class: OpencodeHooks,
|
|
3920
|
-
meta: {
|
|
4147
|
+
meta: {
|
|
4148
|
+
supportsProject: true,
|
|
4149
|
+
supportsGlobal: true,
|
|
4150
|
+
supportsImport: false
|
|
4151
|
+
},
|
|
3921
4152
|
supportedEvents: OPENCODE_HOOK_EVENTS,
|
|
3922
|
-
supportedHookTypes: ["command"]
|
|
4153
|
+
supportedHookTypes: ["command"],
|
|
4154
|
+
supportsMatcher: true
|
|
3923
4155
|
}
|
|
3924
4156
|
],
|
|
3925
4157
|
[
|
|
3926
4158
|
"factorydroid",
|
|
3927
4159
|
{
|
|
3928
4160
|
class: FactorydroidHooks,
|
|
3929
|
-
meta: {
|
|
4161
|
+
meta: {
|
|
4162
|
+
supportsProject: true,
|
|
4163
|
+
supportsGlobal: true,
|
|
4164
|
+
supportsImport: true
|
|
4165
|
+
},
|
|
3930
4166
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
3931
|
-
supportedHookTypes: ["command", "prompt"]
|
|
4167
|
+
supportedHookTypes: ["command", "prompt"],
|
|
4168
|
+
supportsMatcher: true
|
|
3932
4169
|
}
|
|
3933
4170
|
]
|
|
3934
4171
|
]);
|
|
@@ -4045,6 +4282,21 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4045
4282
|
);
|
|
4046
4283
|
}
|
|
4047
4284
|
}
|
|
4285
|
+
if (!factory.supportsMatcher) {
|
|
4286
|
+
const eventsWithMatcher = /* @__PURE__ */ new Set();
|
|
4287
|
+
for (const [event, defs] of Object.entries(effectiveHooks)) {
|
|
4288
|
+
for (const def of defs) {
|
|
4289
|
+
if (def.matcher) {
|
|
4290
|
+
eventsWithMatcher.add(event);
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
if (eventsWithMatcher.size > 0) {
|
|
4295
|
+
logger.warn(
|
|
4296
|
+
`Skipped matcher hook(s) for ${this.toolTarget} (not supported): ${Array.from(eventsWithMatcher).join(", ")}`
|
|
4297
|
+
);
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4048
4300
|
const toolHooks = await factory.class.fromRulesyncHooks({
|
|
4049
4301
|
baseDir: this.baseDir,
|
|
4050
4302
|
rulesyncHooks,
|
|
@@ -4069,13 +4321,13 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
4069
4321
|
};
|
|
4070
4322
|
|
|
4071
4323
|
// src/features/ignore/ignore-processor.ts
|
|
4072
|
-
var
|
|
4324
|
+
var import_mini17 = require("zod/mini");
|
|
4073
4325
|
|
|
4074
4326
|
// src/features/ignore/augmentcode-ignore.ts
|
|
4075
|
-
var
|
|
4327
|
+
var import_node_path28 = require("path");
|
|
4076
4328
|
|
|
4077
4329
|
// src/features/ignore/rulesync-ignore.ts
|
|
4078
|
-
var
|
|
4330
|
+
var import_node_path27 = require("path");
|
|
4079
4331
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
4080
4332
|
validate() {
|
|
4081
4333
|
return { success: true, error: null };
|
|
@@ -4095,12 +4347,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
4095
4347
|
static async fromFile() {
|
|
4096
4348
|
const baseDir = process.cwd();
|
|
4097
4349
|
const paths = this.getSettablePaths();
|
|
4098
|
-
const recommendedPath = (0,
|
|
4350
|
+
const recommendedPath = (0, import_node_path27.join)(
|
|
4099
4351
|
baseDir,
|
|
4100
4352
|
paths.recommended.relativeDirPath,
|
|
4101
4353
|
paths.recommended.relativeFilePath
|
|
4102
4354
|
);
|
|
4103
|
-
const legacyPath = (0,
|
|
4355
|
+
const legacyPath = (0, import_node_path27.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4104
4356
|
if (await fileExists(recommendedPath)) {
|
|
4105
4357
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4106
4358
|
return new _RulesyncIgnore({
|
|
@@ -4216,7 +4468,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4216
4468
|
validate = true
|
|
4217
4469
|
}) {
|
|
4218
4470
|
const fileContent = await readFileContent(
|
|
4219
|
-
(0,
|
|
4471
|
+
(0, import_node_path28.join)(
|
|
4220
4472
|
baseDir,
|
|
4221
4473
|
this.getSettablePaths().relativeDirPath,
|
|
4222
4474
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4246,7 +4498,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
4246
4498
|
};
|
|
4247
4499
|
|
|
4248
4500
|
// src/features/ignore/claudecode-ignore.ts
|
|
4249
|
-
var
|
|
4501
|
+
var import_node_path29 = require("path");
|
|
4250
4502
|
var import_es_toolkit2 = require("es-toolkit");
|
|
4251
4503
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
4252
4504
|
constructor(params) {
|
|
@@ -4289,7 +4541,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4289
4541
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4290
4542
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4291
4543
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
4292
|
-
const filePath = (0,
|
|
4544
|
+
const filePath = (0, import_node_path29.join)(
|
|
4293
4545
|
baseDir,
|
|
4294
4546
|
this.getSettablePaths().relativeDirPath,
|
|
4295
4547
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4325,7 +4577,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4325
4577
|
validate = true
|
|
4326
4578
|
}) {
|
|
4327
4579
|
const fileContent = await readFileContent(
|
|
4328
|
-
(0,
|
|
4580
|
+
(0, import_node_path29.join)(
|
|
4329
4581
|
baseDir,
|
|
4330
4582
|
this.getSettablePaths().relativeDirPath,
|
|
4331
4583
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4355,7 +4607,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
4355
4607
|
};
|
|
4356
4608
|
|
|
4357
4609
|
// src/features/ignore/cline-ignore.ts
|
|
4358
|
-
var
|
|
4610
|
+
var import_node_path30 = require("path");
|
|
4359
4611
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
4360
4612
|
static getSettablePaths() {
|
|
4361
4613
|
return {
|
|
@@ -4392,7 +4644,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4392
4644
|
validate = true
|
|
4393
4645
|
}) {
|
|
4394
4646
|
const fileContent = await readFileContent(
|
|
4395
|
-
(0,
|
|
4647
|
+
(0, import_node_path30.join)(
|
|
4396
4648
|
baseDir,
|
|
4397
4649
|
this.getSettablePaths().relativeDirPath,
|
|
4398
4650
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4422,7 +4674,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
4422
4674
|
};
|
|
4423
4675
|
|
|
4424
4676
|
// src/features/ignore/cursor-ignore.ts
|
|
4425
|
-
var
|
|
4677
|
+
var import_node_path31 = require("path");
|
|
4426
4678
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
4427
4679
|
static getSettablePaths() {
|
|
4428
4680
|
return {
|
|
@@ -4455,7 +4707,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4455
4707
|
validate = true
|
|
4456
4708
|
}) {
|
|
4457
4709
|
const fileContent = await readFileContent(
|
|
4458
|
-
(0,
|
|
4710
|
+
(0, import_node_path31.join)(
|
|
4459
4711
|
baseDir,
|
|
4460
4712
|
this.getSettablePaths().relativeDirPath,
|
|
4461
4713
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4485,7 +4737,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
4485
4737
|
};
|
|
4486
4738
|
|
|
4487
4739
|
// src/features/ignore/geminicli-ignore.ts
|
|
4488
|
-
var
|
|
4740
|
+
var import_node_path32 = require("path");
|
|
4489
4741
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
4490
4742
|
static getSettablePaths() {
|
|
4491
4743
|
return {
|
|
@@ -4512,7 +4764,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4512
4764
|
validate = true
|
|
4513
4765
|
}) {
|
|
4514
4766
|
const fileContent = await readFileContent(
|
|
4515
|
-
(0,
|
|
4767
|
+
(0, import_node_path32.join)(
|
|
4516
4768
|
baseDir,
|
|
4517
4769
|
this.getSettablePaths().relativeDirPath,
|
|
4518
4770
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4542,7 +4794,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
4542
4794
|
};
|
|
4543
4795
|
|
|
4544
4796
|
// src/features/ignore/goose-ignore.ts
|
|
4545
|
-
var
|
|
4797
|
+
var import_node_path33 = require("path");
|
|
4546
4798
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
4547
4799
|
static getSettablePaths() {
|
|
4548
4800
|
return {
|
|
@@ -4579,7 +4831,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4579
4831
|
validate = true
|
|
4580
4832
|
}) {
|
|
4581
4833
|
const fileContent = await readFileContent(
|
|
4582
|
-
(0,
|
|
4834
|
+
(0, import_node_path33.join)(
|
|
4583
4835
|
baseDir,
|
|
4584
4836
|
this.getSettablePaths().relativeDirPath,
|
|
4585
4837
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4609,7 +4861,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
4609
4861
|
};
|
|
4610
4862
|
|
|
4611
4863
|
// src/features/ignore/junie-ignore.ts
|
|
4612
|
-
var
|
|
4864
|
+
var import_node_path34 = require("path");
|
|
4613
4865
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
4614
4866
|
static getSettablePaths() {
|
|
4615
4867
|
return {
|
|
@@ -4636,7 +4888,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4636
4888
|
validate = true
|
|
4637
4889
|
}) {
|
|
4638
4890
|
const fileContent = await readFileContent(
|
|
4639
|
-
(0,
|
|
4891
|
+
(0, import_node_path34.join)(
|
|
4640
4892
|
baseDir,
|
|
4641
4893
|
this.getSettablePaths().relativeDirPath,
|
|
4642
4894
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4666,7 +4918,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
4666
4918
|
};
|
|
4667
4919
|
|
|
4668
4920
|
// src/features/ignore/kilo-ignore.ts
|
|
4669
|
-
var
|
|
4921
|
+
var import_node_path35 = require("path");
|
|
4670
4922
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
4671
4923
|
static getSettablePaths() {
|
|
4672
4924
|
return {
|
|
@@ -4703,7 +4955,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4703
4955
|
validate = true
|
|
4704
4956
|
}) {
|
|
4705
4957
|
const fileContent = await readFileContent(
|
|
4706
|
-
(0,
|
|
4958
|
+
(0, import_node_path35.join)(
|
|
4707
4959
|
baseDir,
|
|
4708
4960
|
this.getSettablePaths().relativeDirPath,
|
|
4709
4961
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4733,7 +4985,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
4733
4985
|
};
|
|
4734
4986
|
|
|
4735
4987
|
// src/features/ignore/kiro-ignore.ts
|
|
4736
|
-
var
|
|
4988
|
+
var import_node_path36 = require("path");
|
|
4737
4989
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
4738
4990
|
static getSettablePaths() {
|
|
4739
4991
|
return {
|
|
@@ -4760,7 +5012,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4760
5012
|
validate = true
|
|
4761
5013
|
}) {
|
|
4762
5014
|
const fileContent = await readFileContent(
|
|
4763
|
-
(0,
|
|
5015
|
+
(0, import_node_path36.join)(
|
|
4764
5016
|
baseDir,
|
|
4765
5017
|
this.getSettablePaths().relativeDirPath,
|
|
4766
5018
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4790,7 +5042,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
4790
5042
|
};
|
|
4791
5043
|
|
|
4792
5044
|
// src/features/ignore/qwencode-ignore.ts
|
|
4793
|
-
var
|
|
5045
|
+
var import_node_path37 = require("path");
|
|
4794
5046
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
4795
5047
|
static getSettablePaths() {
|
|
4796
5048
|
return {
|
|
@@ -4817,7 +5069,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4817
5069
|
validate = true
|
|
4818
5070
|
}) {
|
|
4819
5071
|
const fileContent = await readFileContent(
|
|
4820
|
-
(0,
|
|
5072
|
+
(0, import_node_path37.join)(
|
|
4821
5073
|
baseDir,
|
|
4822
5074
|
this.getSettablePaths().relativeDirPath,
|
|
4823
5075
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4847,7 +5099,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
4847
5099
|
};
|
|
4848
5100
|
|
|
4849
5101
|
// src/features/ignore/roo-ignore.ts
|
|
4850
|
-
var
|
|
5102
|
+
var import_node_path38 = require("path");
|
|
4851
5103
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
4852
5104
|
static getSettablePaths() {
|
|
4853
5105
|
return {
|
|
@@ -4874,7 +5126,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4874
5126
|
validate = true
|
|
4875
5127
|
}) {
|
|
4876
5128
|
const fileContent = await readFileContent(
|
|
4877
|
-
(0,
|
|
5129
|
+
(0, import_node_path38.join)(
|
|
4878
5130
|
baseDir,
|
|
4879
5131
|
this.getSettablePaths().relativeDirPath,
|
|
4880
5132
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4904,7 +5156,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
4904
5156
|
};
|
|
4905
5157
|
|
|
4906
5158
|
// src/features/ignore/windsurf-ignore.ts
|
|
4907
|
-
var
|
|
5159
|
+
var import_node_path39 = require("path");
|
|
4908
5160
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
4909
5161
|
static getSettablePaths() {
|
|
4910
5162
|
return {
|
|
@@ -4931,7 +5183,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4931
5183
|
validate = true
|
|
4932
5184
|
}) {
|
|
4933
5185
|
const fileContent = await readFileContent(
|
|
4934
|
-
(0,
|
|
5186
|
+
(0, import_node_path39.join)(
|
|
4935
5187
|
baseDir,
|
|
4936
5188
|
this.getSettablePaths().relativeDirPath,
|
|
4937
5189
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4961,7 +5213,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4961
5213
|
};
|
|
4962
5214
|
|
|
4963
5215
|
// src/features/ignore/zed-ignore.ts
|
|
4964
|
-
var
|
|
5216
|
+
var import_node_path40 = require("path");
|
|
4965
5217
|
var import_es_toolkit3 = require("es-toolkit");
|
|
4966
5218
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
4967
5219
|
constructor(params) {
|
|
@@ -4998,7 +5250,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4998
5250
|
}) {
|
|
4999
5251
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
5000
5252
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
5001
|
-
const filePath = (0,
|
|
5253
|
+
const filePath = (0, import_node_path40.join)(
|
|
5002
5254
|
baseDir,
|
|
5003
5255
|
this.getSettablePaths().relativeDirPath,
|
|
5004
5256
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5025,7 +5277,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
5025
5277
|
validate = true
|
|
5026
5278
|
}) {
|
|
5027
5279
|
const fileContent = await readFileContent(
|
|
5028
|
-
(0,
|
|
5280
|
+
(0, import_node_path40.join)(
|
|
5029
5281
|
baseDir,
|
|
5030
5282
|
this.getSettablePaths().relativeDirPath,
|
|
5031
5283
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5071,7 +5323,7 @@ var ignoreProcessorToolTargets = [
|
|
|
5071
5323
|
"windsurf",
|
|
5072
5324
|
"zed"
|
|
5073
5325
|
];
|
|
5074
|
-
var IgnoreProcessorToolTargetSchema =
|
|
5326
|
+
var IgnoreProcessorToolTargetSchema = import_mini17.z.enum(ignoreProcessorToolTargets);
|
|
5075
5327
|
var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
5076
5328
|
["augmentcode", { class: AugmentcodeIgnore }],
|
|
5077
5329
|
["claudecode", { class: ClaudecodeIgnore }],
|
|
@@ -5209,49 +5461,49 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
5209
5461
|
};
|
|
5210
5462
|
|
|
5211
5463
|
// src/features/mcp/mcp-processor.ts
|
|
5212
|
-
var
|
|
5464
|
+
var import_mini21 = require("zod/mini");
|
|
5213
5465
|
|
|
5214
5466
|
// src/features/mcp/claudecode-mcp.ts
|
|
5215
|
-
var
|
|
5467
|
+
var import_node_path42 = require("path");
|
|
5216
5468
|
|
|
5217
5469
|
// src/features/mcp/rulesync-mcp.ts
|
|
5218
|
-
var
|
|
5470
|
+
var import_node_path41 = require("path");
|
|
5219
5471
|
var import_object = require("es-toolkit/object");
|
|
5220
|
-
var
|
|
5472
|
+
var import_mini19 = require("zod/mini");
|
|
5221
5473
|
|
|
5222
5474
|
// src/types/mcp.ts
|
|
5223
|
-
var
|
|
5224
|
-
var McpServerSchema =
|
|
5225
|
-
type:
|
|
5226
|
-
command:
|
|
5227
|
-
args:
|
|
5228
|
-
url:
|
|
5229
|
-
httpUrl:
|
|
5230
|
-
env:
|
|
5231
|
-
disabled:
|
|
5232
|
-
networkTimeout:
|
|
5233
|
-
timeout:
|
|
5234
|
-
trust:
|
|
5235
|
-
cwd:
|
|
5236
|
-
transport:
|
|
5237
|
-
alwaysAllow:
|
|
5238
|
-
tools:
|
|
5239
|
-
kiroAutoApprove:
|
|
5240
|
-
kiroAutoBlock:
|
|
5241
|
-
headers:
|
|
5242
|
-
enabledTools:
|
|
5243
|
-
disabledTools:
|
|
5475
|
+
var import_mini18 = require("zod/mini");
|
|
5476
|
+
var McpServerSchema = import_mini18.z.object({
|
|
5477
|
+
type: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
|
|
5478
|
+
command: import_mini18.z.optional(import_mini18.z.union([import_mini18.z.string(), import_mini18.z.array(import_mini18.z.string())])),
|
|
5479
|
+
args: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5480
|
+
url: import_mini18.z.optional(import_mini18.z.string()),
|
|
5481
|
+
httpUrl: import_mini18.z.optional(import_mini18.z.string()),
|
|
5482
|
+
env: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
|
|
5483
|
+
disabled: import_mini18.z.optional(import_mini18.z.boolean()),
|
|
5484
|
+
networkTimeout: import_mini18.z.optional(import_mini18.z.number()),
|
|
5485
|
+
timeout: import_mini18.z.optional(import_mini18.z.number()),
|
|
5486
|
+
trust: import_mini18.z.optional(import_mini18.z.boolean()),
|
|
5487
|
+
cwd: import_mini18.z.optional(import_mini18.z.string()),
|
|
5488
|
+
transport: import_mini18.z.optional(import_mini18.z.enum(["stdio", "sse", "http"])),
|
|
5489
|
+
alwaysAllow: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5490
|
+
tools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5491
|
+
kiroAutoApprove: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5492
|
+
kiroAutoBlock: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5493
|
+
headers: import_mini18.z.optional(import_mini18.z.record(import_mini18.z.string(), import_mini18.z.string())),
|
|
5494
|
+
enabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
|
|
5495
|
+
disabledTools: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
|
|
5244
5496
|
});
|
|
5245
|
-
var McpServersSchema =
|
|
5497
|
+
var McpServersSchema = import_mini18.z.record(import_mini18.z.string(), McpServerSchema);
|
|
5246
5498
|
|
|
5247
5499
|
// src/features/mcp/rulesync-mcp.ts
|
|
5248
|
-
var RulesyncMcpServerSchema =
|
|
5249
|
-
targets:
|
|
5250
|
-
description:
|
|
5251
|
-
exposed:
|
|
5500
|
+
var RulesyncMcpServerSchema = import_mini19.z.extend(McpServerSchema, {
|
|
5501
|
+
targets: import_mini19.z.optional(RulesyncTargetsSchema),
|
|
5502
|
+
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
5503
|
+
exposed: import_mini19.z.optional(import_mini19.z.boolean())
|
|
5252
5504
|
});
|
|
5253
|
-
var RulesyncMcpConfigSchema =
|
|
5254
|
-
mcpServers:
|
|
5505
|
+
var RulesyncMcpConfigSchema = import_mini19.z.object({
|
|
5506
|
+
mcpServers: import_mini19.z.record(import_mini19.z.string(), RulesyncMcpServerSchema)
|
|
5255
5507
|
});
|
|
5256
5508
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
5257
5509
|
json;
|
|
@@ -5287,12 +5539,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
5287
5539
|
static async fromFile({ validate = true }) {
|
|
5288
5540
|
const baseDir = process.cwd();
|
|
5289
5541
|
const paths = this.getSettablePaths();
|
|
5290
|
-
const recommendedPath = (0,
|
|
5542
|
+
const recommendedPath = (0, import_node_path41.join)(
|
|
5291
5543
|
baseDir,
|
|
5292
5544
|
paths.recommended.relativeDirPath,
|
|
5293
5545
|
paths.recommended.relativeFilePath
|
|
5294
5546
|
);
|
|
5295
|
-
const legacyPath = (0,
|
|
5547
|
+
const legacyPath = (0, import_node_path41.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5296
5548
|
if (await fileExists(recommendedPath)) {
|
|
5297
5549
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5298
5550
|
return new _RulesyncMcp({
|
|
@@ -5437,7 +5689,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5437
5689
|
global = false
|
|
5438
5690
|
}) {
|
|
5439
5691
|
const paths = this.getSettablePaths({ global });
|
|
5440
|
-
const fileContent = await readFileContentOrNull((0,
|
|
5692
|
+
const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
5441
5693
|
const json = JSON.parse(fileContent);
|
|
5442
5694
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
5443
5695
|
return new _ClaudecodeMcp({
|
|
@@ -5456,7 +5708,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5456
5708
|
}) {
|
|
5457
5709
|
const paths = this.getSettablePaths({ global });
|
|
5458
5710
|
const fileContent = await readOrInitializeFileContent(
|
|
5459
|
-
(0,
|
|
5711
|
+
(0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5460
5712
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5461
5713
|
);
|
|
5462
5714
|
const json = JSON.parse(fileContent);
|
|
@@ -5495,7 +5747,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
5495
5747
|
};
|
|
5496
5748
|
|
|
5497
5749
|
// src/features/mcp/cline-mcp.ts
|
|
5498
|
-
var
|
|
5750
|
+
var import_node_path43 = require("path");
|
|
5499
5751
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
5500
5752
|
json;
|
|
5501
5753
|
constructor(params) {
|
|
@@ -5516,7 +5768,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5516
5768
|
validate = true
|
|
5517
5769
|
}) {
|
|
5518
5770
|
const fileContent = await readFileContent(
|
|
5519
|
-
(0,
|
|
5771
|
+
(0, import_node_path43.join)(
|
|
5520
5772
|
baseDir,
|
|
5521
5773
|
this.getSettablePaths().relativeDirPath,
|
|
5522
5774
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5565,7 +5817,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
5565
5817
|
};
|
|
5566
5818
|
|
|
5567
5819
|
// src/features/mcp/codexcli-mcp.ts
|
|
5568
|
-
var
|
|
5820
|
+
var import_node_path44 = require("path");
|
|
5569
5821
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
5570
5822
|
function convertFromCodexFormat(codexMcp) {
|
|
5571
5823
|
const result = {};
|
|
@@ -5648,7 +5900,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5648
5900
|
global = false
|
|
5649
5901
|
}) {
|
|
5650
5902
|
const paths = this.getSettablePaths({ global });
|
|
5651
|
-
const fileContent = await readFileContentOrNull((0,
|
|
5903
|
+
const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
|
|
5652
5904
|
return new _CodexcliMcp({
|
|
5653
5905
|
baseDir,
|
|
5654
5906
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -5664,7 +5916,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5664
5916
|
global = false
|
|
5665
5917
|
}) {
|
|
5666
5918
|
const paths = this.getSettablePaths({ global });
|
|
5667
|
-
const configTomlFilePath = (0,
|
|
5919
|
+
const configTomlFilePath = (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5668
5920
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
5669
5921
|
configTomlFilePath,
|
|
5670
5922
|
smolToml.stringify({})
|
|
@@ -5721,7 +5973,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
5721
5973
|
};
|
|
5722
5974
|
|
|
5723
5975
|
// src/features/mcp/copilot-mcp.ts
|
|
5724
|
-
var
|
|
5976
|
+
var import_node_path45 = require("path");
|
|
5725
5977
|
function convertToCopilotFormat(mcpServers) {
|
|
5726
5978
|
return { servers: mcpServers };
|
|
5727
5979
|
}
|
|
@@ -5748,7 +6000,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5748
6000
|
validate = true
|
|
5749
6001
|
}) {
|
|
5750
6002
|
const fileContent = await readFileContent(
|
|
5751
|
-
(0,
|
|
6003
|
+
(0, import_node_path45.join)(
|
|
5752
6004
|
baseDir,
|
|
5753
6005
|
this.getSettablePaths().relativeDirPath,
|
|
5754
6006
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5801,7 +6053,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
5801
6053
|
};
|
|
5802
6054
|
|
|
5803
6055
|
// src/features/mcp/cursor-mcp.ts
|
|
5804
|
-
var
|
|
6056
|
+
var import_node_path46 = require("path");
|
|
5805
6057
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
5806
6058
|
function isMcpServers(value) {
|
|
5807
6059
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -5862,7 +6114,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5862
6114
|
validate = true
|
|
5863
6115
|
}) {
|
|
5864
6116
|
const fileContent = await readFileContent(
|
|
5865
|
-
(0,
|
|
6117
|
+
(0, import_node_path46.join)(
|
|
5866
6118
|
baseDir,
|
|
5867
6119
|
this.getSettablePaths().relativeDirPath,
|
|
5868
6120
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5930,7 +6182,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5930
6182
|
};
|
|
5931
6183
|
|
|
5932
6184
|
// src/features/mcp/factorydroid-mcp.ts
|
|
5933
|
-
var
|
|
6185
|
+
var import_node_path47 = require("path");
|
|
5934
6186
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
5935
6187
|
json;
|
|
5936
6188
|
constructor(params) {
|
|
@@ -5951,7 +6203,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
5951
6203
|
validate = true
|
|
5952
6204
|
}) {
|
|
5953
6205
|
const fileContent = await readFileContent(
|
|
5954
|
-
(0,
|
|
6206
|
+
(0, import_node_path47.join)(
|
|
5955
6207
|
baseDir,
|
|
5956
6208
|
this.getSettablePaths().relativeDirPath,
|
|
5957
6209
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6011,7 +6263,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
6011
6263
|
};
|
|
6012
6264
|
|
|
6013
6265
|
// src/features/mcp/geminicli-mcp.ts
|
|
6014
|
-
var
|
|
6266
|
+
var import_node_path48 = require("path");
|
|
6015
6267
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
6016
6268
|
json;
|
|
6017
6269
|
constructor(params) {
|
|
@@ -6039,7 +6291,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6039
6291
|
global = false
|
|
6040
6292
|
}) {
|
|
6041
6293
|
const paths = this.getSettablePaths({ global });
|
|
6042
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6294
|
+
const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6043
6295
|
const json = JSON.parse(fileContent);
|
|
6044
6296
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
6045
6297
|
return new _GeminiCliMcp({
|
|
@@ -6058,7 +6310,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6058
6310
|
}) {
|
|
6059
6311
|
const paths = this.getSettablePaths({ global });
|
|
6060
6312
|
const fileContent = await readOrInitializeFileContent(
|
|
6061
|
-
(0,
|
|
6313
|
+
(0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6062
6314
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
6063
6315
|
);
|
|
6064
6316
|
const json = JSON.parse(fileContent);
|
|
@@ -6103,7 +6355,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
6103
6355
|
};
|
|
6104
6356
|
|
|
6105
6357
|
// src/features/mcp/junie-mcp.ts
|
|
6106
|
-
var
|
|
6358
|
+
var import_node_path49 = require("path");
|
|
6107
6359
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
6108
6360
|
json;
|
|
6109
6361
|
constructor(params) {
|
|
@@ -6115,7 +6367,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6115
6367
|
}
|
|
6116
6368
|
static getSettablePaths() {
|
|
6117
6369
|
return {
|
|
6118
|
-
relativeDirPath: (0,
|
|
6370
|
+
relativeDirPath: (0, import_node_path49.join)(".junie", "mcp"),
|
|
6119
6371
|
relativeFilePath: "mcp.json"
|
|
6120
6372
|
};
|
|
6121
6373
|
}
|
|
@@ -6124,7 +6376,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6124
6376
|
validate = true
|
|
6125
6377
|
}) {
|
|
6126
6378
|
const fileContent = await readFileContent(
|
|
6127
|
-
(0,
|
|
6379
|
+
(0, import_node_path49.join)(
|
|
6128
6380
|
baseDir,
|
|
6129
6381
|
this.getSettablePaths().relativeDirPath,
|
|
6130
6382
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6173,7 +6425,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
6173
6425
|
};
|
|
6174
6426
|
|
|
6175
6427
|
// src/features/mcp/kilo-mcp.ts
|
|
6176
|
-
var
|
|
6428
|
+
var import_node_path50 = require("path");
|
|
6177
6429
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
6178
6430
|
json;
|
|
6179
6431
|
constructor(params) {
|
|
@@ -6194,7 +6446,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6194
6446
|
validate = true
|
|
6195
6447
|
}) {
|
|
6196
6448
|
const paths = this.getSettablePaths();
|
|
6197
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6449
|
+
const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6198
6450
|
return new _KiloMcp({
|
|
6199
6451
|
baseDir,
|
|
6200
6452
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6242,7 +6494,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
6242
6494
|
};
|
|
6243
6495
|
|
|
6244
6496
|
// src/features/mcp/kiro-mcp.ts
|
|
6245
|
-
var
|
|
6497
|
+
var import_node_path51 = require("path");
|
|
6246
6498
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
6247
6499
|
json;
|
|
6248
6500
|
constructor(params) {
|
|
@@ -6254,7 +6506,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6254
6506
|
}
|
|
6255
6507
|
static getSettablePaths() {
|
|
6256
6508
|
return {
|
|
6257
|
-
relativeDirPath: (0,
|
|
6509
|
+
relativeDirPath: (0, import_node_path51.join)(".kiro", "settings"),
|
|
6258
6510
|
relativeFilePath: "mcp.json"
|
|
6259
6511
|
};
|
|
6260
6512
|
}
|
|
@@ -6263,7 +6515,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6263
6515
|
validate = true
|
|
6264
6516
|
}) {
|
|
6265
6517
|
const paths = this.getSettablePaths();
|
|
6266
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6518
|
+
const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
6267
6519
|
return new _KiroMcp({
|
|
6268
6520
|
baseDir,
|
|
6269
6521
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -6311,29 +6563,29 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
6311
6563
|
};
|
|
6312
6564
|
|
|
6313
6565
|
// src/features/mcp/opencode-mcp.ts
|
|
6314
|
-
var
|
|
6315
|
-
var
|
|
6316
|
-
var OpencodeMcpLocalServerSchema =
|
|
6317
|
-
type:
|
|
6318
|
-
command:
|
|
6319
|
-
environment:
|
|
6320
|
-
enabled:
|
|
6321
|
-
cwd:
|
|
6566
|
+
var import_node_path52 = require("path");
|
|
6567
|
+
var import_mini20 = require("zod/mini");
|
|
6568
|
+
var OpencodeMcpLocalServerSchema = import_mini20.z.object({
|
|
6569
|
+
type: import_mini20.z.literal("local"),
|
|
6570
|
+
command: import_mini20.z.array(import_mini20.z.string()),
|
|
6571
|
+
environment: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
|
|
6572
|
+
enabled: import_mini20.z._default(import_mini20.z.boolean(), true),
|
|
6573
|
+
cwd: import_mini20.z.optional(import_mini20.z.string())
|
|
6322
6574
|
});
|
|
6323
|
-
var OpencodeMcpRemoteServerSchema =
|
|
6324
|
-
type:
|
|
6325
|
-
url:
|
|
6326
|
-
headers:
|
|
6327
|
-
enabled:
|
|
6575
|
+
var OpencodeMcpRemoteServerSchema = import_mini20.z.object({
|
|
6576
|
+
type: import_mini20.z.literal("remote"),
|
|
6577
|
+
url: import_mini20.z.string(),
|
|
6578
|
+
headers: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.string())),
|
|
6579
|
+
enabled: import_mini20.z._default(import_mini20.z.boolean(), true)
|
|
6328
6580
|
});
|
|
6329
|
-
var OpencodeMcpServerSchema =
|
|
6581
|
+
var OpencodeMcpServerSchema = import_mini20.z.union([
|
|
6330
6582
|
OpencodeMcpLocalServerSchema,
|
|
6331
6583
|
OpencodeMcpRemoteServerSchema
|
|
6332
6584
|
]);
|
|
6333
|
-
var OpencodeConfigSchema =
|
|
6334
|
-
$schema:
|
|
6335
|
-
mcp:
|
|
6336
|
-
tools:
|
|
6585
|
+
var OpencodeConfigSchema = import_mini20.z.looseObject({
|
|
6586
|
+
$schema: import_mini20.z.optional(import_mini20.z.string()),
|
|
6587
|
+
mcp: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), OpencodeMcpServerSchema)),
|
|
6588
|
+
tools: import_mini20.z.optional(import_mini20.z.record(import_mini20.z.string(), import_mini20.z.boolean()))
|
|
6337
6589
|
});
|
|
6338
6590
|
function convertFromOpencodeFormat(opencodeMcp, tools) {
|
|
6339
6591
|
return Object.fromEntries(
|
|
@@ -6451,7 +6703,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6451
6703
|
static getSettablePaths({ global } = {}) {
|
|
6452
6704
|
if (global) {
|
|
6453
6705
|
return {
|
|
6454
|
-
relativeDirPath: (0,
|
|
6706
|
+
relativeDirPath: (0, import_node_path52.join)(".config", "opencode"),
|
|
6455
6707
|
relativeFilePath: "opencode.json"
|
|
6456
6708
|
};
|
|
6457
6709
|
}
|
|
@@ -6466,7 +6718,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6466
6718
|
global = false
|
|
6467
6719
|
}) {
|
|
6468
6720
|
const paths = this.getSettablePaths({ global });
|
|
6469
|
-
const fileContent = await readFileContentOrNull((0,
|
|
6721
|
+
const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcp":{}}';
|
|
6470
6722
|
const json = JSON.parse(fileContent);
|
|
6471
6723
|
const newJson = { ...json, mcp: json.mcp ?? {} };
|
|
6472
6724
|
return new _OpencodeMcp({
|
|
@@ -6485,7 +6737,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6485
6737
|
}) {
|
|
6486
6738
|
const paths = this.getSettablePaths({ global });
|
|
6487
6739
|
const fileContent = await readOrInitializeFileContent(
|
|
6488
|
-
(0,
|
|
6740
|
+
(0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
6489
6741
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
6490
6742
|
);
|
|
6491
6743
|
const json = JSON.parse(fileContent);
|
|
@@ -6538,7 +6790,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
6538
6790
|
};
|
|
6539
6791
|
|
|
6540
6792
|
// src/features/mcp/roo-mcp.ts
|
|
6541
|
-
var
|
|
6793
|
+
var import_node_path53 = require("path");
|
|
6542
6794
|
function isRooMcpServers(value) {
|
|
6543
6795
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
6544
6796
|
}
|
|
@@ -6590,7 +6842,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
6590
6842
|
validate = true
|
|
6591
6843
|
}) {
|
|
6592
6844
|
const fileContent = await readFileContent(
|
|
6593
|
-
(0,
|
|
6845
|
+
(0, import_node_path53.join)(
|
|
6594
6846
|
baseDir,
|
|
6595
6847
|
this.getSettablePaths().relativeDirPath,
|
|
6596
6848
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6661,7 +6913,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
6661
6913
|
"opencode",
|
|
6662
6914
|
"roo"
|
|
6663
6915
|
];
|
|
6664
|
-
var McpProcessorToolTargetSchema =
|
|
6916
|
+
var McpProcessorToolTargetSchema = import_mini21.z.enum(mcpProcessorToolTargetTuple);
|
|
6665
6917
|
var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
6666
6918
|
[
|
|
6667
6919
|
"claudecode",
|
|
@@ -6963,25 +7215,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
6963
7215
|
};
|
|
6964
7216
|
|
|
6965
7217
|
// src/features/rules/rules-processor.ts
|
|
6966
|
-
var
|
|
7218
|
+
var import_node_path113 = require("path");
|
|
6967
7219
|
var import_toon = require("@toon-format/toon");
|
|
6968
|
-
var
|
|
7220
|
+
var import_mini53 = require("zod/mini");
|
|
6969
7221
|
|
|
6970
7222
|
// src/constants/general.ts
|
|
6971
7223
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
6972
7224
|
|
|
6973
7225
|
// src/features/skills/agentsmd-skill.ts
|
|
6974
|
-
var
|
|
7226
|
+
var import_node_path57 = require("path");
|
|
6975
7227
|
|
|
6976
7228
|
// src/features/skills/simulated-skill.ts
|
|
6977
|
-
var
|
|
6978
|
-
var
|
|
7229
|
+
var import_node_path56 = require("path");
|
|
7230
|
+
var import_mini22 = require("zod/mini");
|
|
6979
7231
|
|
|
6980
7232
|
// src/features/skills/tool-skill.ts
|
|
6981
|
-
var
|
|
7233
|
+
var import_node_path55 = require("path");
|
|
6982
7234
|
|
|
6983
7235
|
// src/types/ai-dir.ts
|
|
6984
|
-
var
|
|
7236
|
+
var import_node_path54 = __toESM(require("path"), 1);
|
|
6985
7237
|
var AiDir = class {
|
|
6986
7238
|
/**
|
|
6987
7239
|
* @example "."
|
|
@@ -7015,7 +7267,7 @@ var AiDir = class {
|
|
|
7015
7267
|
otherFiles = [],
|
|
7016
7268
|
global = false
|
|
7017
7269
|
}) {
|
|
7018
|
-
if (dirName.includes(
|
|
7270
|
+
if (dirName.includes(import_node_path54.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
7019
7271
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
7020
7272
|
}
|
|
7021
7273
|
this.baseDir = baseDir;
|
|
@@ -7038,11 +7290,11 @@ var AiDir = class {
|
|
|
7038
7290
|
return this.dirName;
|
|
7039
7291
|
}
|
|
7040
7292
|
getDirPath() {
|
|
7041
|
-
const fullPath =
|
|
7042
|
-
const resolvedFull = (0,
|
|
7043
|
-
const resolvedBase = (0,
|
|
7044
|
-
const rel = (0,
|
|
7045
|
-
if (rel.startsWith("..") ||
|
|
7293
|
+
const fullPath = import_node_path54.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
7294
|
+
const resolvedFull = (0, import_node_path54.resolve)(fullPath);
|
|
7295
|
+
const resolvedBase = (0, import_node_path54.resolve)(this.baseDir);
|
|
7296
|
+
const rel = (0, import_node_path54.relative)(resolvedBase, resolvedFull);
|
|
7297
|
+
if (rel.startsWith("..") || import_node_path54.default.isAbsolute(rel)) {
|
|
7046
7298
|
throw new Error(
|
|
7047
7299
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
7048
7300
|
);
|
|
@@ -7056,7 +7308,7 @@ var AiDir = class {
|
|
|
7056
7308
|
return this.otherFiles;
|
|
7057
7309
|
}
|
|
7058
7310
|
getRelativePathFromCwd() {
|
|
7059
|
-
return
|
|
7311
|
+
return import_node_path54.default.join(this.relativeDirPath, this.dirName);
|
|
7060
7312
|
}
|
|
7061
7313
|
getGlobal() {
|
|
7062
7314
|
return this.global;
|
|
@@ -7075,15 +7327,15 @@ var AiDir = class {
|
|
|
7075
7327
|
* @returns Array of files with their relative paths and buffers
|
|
7076
7328
|
*/
|
|
7077
7329
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
7078
|
-
const dirPath = (0,
|
|
7079
|
-
const glob = (0,
|
|
7330
|
+
const dirPath = (0, import_node_path54.join)(baseDir, relativeDirPath, dirName);
|
|
7331
|
+
const glob = (0, import_node_path54.join)(dirPath, "**", "*");
|
|
7080
7332
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
7081
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
7333
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path54.basename)(filePath) !== excludeFileName);
|
|
7082
7334
|
const files = await Promise.all(
|
|
7083
7335
|
filteredPaths.map(async (filePath) => {
|
|
7084
7336
|
const fileBuffer = await readFileBuffer(filePath);
|
|
7085
7337
|
return {
|
|
7086
|
-
relativeFilePathToDirPath: (0,
|
|
7338
|
+
relativeFilePathToDirPath: (0, import_node_path54.relative)(dirPath, filePath),
|
|
7087
7339
|
fileBuffer
|
|
7088
7340
|
};
|
|
7089
7341
|
})
|
|
@@ -7174,8 +7426,8 @@ var ToolSkill = class extends AiDir {
|
|
|
7174
7426
|
}) {
|
|
7175
7427
|
const settablePaths = getSettablePaths({ global });
|
|
7176
7428
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7177
|
-
const skillDirPath = (0,
|
|
7178
|
-
const skillFilePath = (0,
|
|
7429
|
+
const skillDirPath = (0, import_node_path55.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7430
|
+
const skillFilePath = (0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7179
7431
|
if (!await fileExists(skillFilePath)) {
|
|
7180
7432
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7181
7433
|
}
|
|
@@ -7199,16 +7451,16 @@ var ToolSkill = class extends AiDir {
|
|
|
7199
7451
|
}
|
|
7200
7452
|
requireMainFileFrontmatter() {
|
|
7201
7453
|
if (!this.mainFile?.frontmatter) {
|
|
7202
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7454
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path55.join)(this.relativeDirPath, this.dirName)}`);
|
|
7203
7455
|
}
|
|
7204
7456
|
return this.mainFile.frontmatter;
|
|
7205
7457
|
}
|
|
7206
7458
|
};
|
|
7207
7459
|
|
|
7208
7460
|
// src/features/skills/simulated-skill.ts
|
|
7209
|
-
var SimulatedSkillFrontmatterSchema =
|
|
7210
|
-
name:
|
|
7211
|
-
description:
|
|
7461
|
+
var SimulatedSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
7462
|
+
name: import_mini22.z.string(),
|
|
7463
|
+
description: import_mini22.z.string()
|
|
7212
7464
|
});
|
|
7213
7465
|
var SimulatedSkill = class extends ToolSkill {
|
|
7214
7466
|
frontmatter;
|
|
@@ -7239,7 +7491,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7239
7491
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
7240
7492
|
if (!result.success) {
|
|
7241
7493
|
throw new Error(
|
|
7242
|
-
`Invalid frontmatter in ${(0,
|
|
7494
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
7243
7495
|
);
|
|
7244
7496
|
}
|
|
7245
7497
|
}
|
|
@@ -7297,8 +7549,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
7297
7549
|
}) {
|
|
7298
7550
|
const settablePaths = this.getSettablePaths();
|
|
7299
7551
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
7300
|
-
const skillDirPath = (0,
|
|
7301
|
-
const skillFilePath = (0,
|
|
7552
|
+
const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
|
|
7553
|
+
const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7302
7554
|
if (!await fileExists(skillFilePath)) {
|
|
7303
7555
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7304
7556
|
}
|
|
@@ -7375,7 +7627,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7375
7627
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
7376
7628
|
}
|
|
7377
7629
|
return {
|
|
7378
|
-
relativeDirPath: (0,
|
|
7630
|
+
relativeDirPath: (0, import_node_path57.join)(".agents", "skills")
|
|
7379
7631
|
};
|
|
7380
7632
|
}
|
|
7381
7633
|
static async fromDir(params) {
|
|
@@ -7402,11 +7654,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
7402
7654
|
};
|
|
7403
7655
|
|
|
7404
7656
|
// src/features/skills/factorydroid-skill.ts
|
|
7405
|
-
var
|
|
7657
|
+
var import_node_path58 = require("path");
|
|
7406
7658
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
7407
7659
|
static getSettablePaths(_options) {
|
|
7408
7660
|
return {
|
|
7409
|
-
relativeDirPath: (0,
|
|
7661
|
+
relativeDirPath: (0, import_node_path58.join)(".factory", "skills")
|
|
7410
7662
|
};
|
|
7411
7663
|
}
|
|
7412
7664
|
static async fromDir(params) {
|
|
@@ -7433,11 +7685,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
7433
7685
|
};
|
|
7434
7686
|
|
|
7435
7687
|
// src/features/skills/skills-processor.ts
|
|
7436
|
-
var
|
|
7437
|
-
var
|
|
7688
|
+
var import_node_path75 = require("path");
|
|
7689
|
+
var import_mini37 = require("zod/mini");
|
|
7438
7690
|
|
|
7439
7691
|
// src/types/dir-feature-processor.ts
|
|
7440
|
-
var
|
|
7692
|
+
var import_node_path59 = require("path");
|
|
7441
7693
|
var DirFeatureProcessor = class {
|
|
7442
7694
|
baseDir;
|
|
7443
7695
|
dryRun;
|
|
@@ -7468,7 +7720,7 @@ var DirFeatureProcessor = class {
|
|
|
7468
7720
|
const mainFile = aiDir.getMainFile();
|
|
7469
7721
|
let mainFileContent;
|
|
7470
7722
|
if (mainFile) {
|
|
7471
|
-
const mainFilePath = (0,
|
|
7723
|
+
const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
|
|
7472
7724
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
7473
7725
|
mainFileContent = addTrailingNewline(content);
|
|
7474
7726
|
const existingContent = await readFileContentOrNull(mainFilePath);
|
|
@@ -7482,7 +7734,7 @@ var DirFeatureProcessor = class {
|
|
|
7482
7734
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
7483
7735
|
otherFileContents.push(contentWithNewline);
|
|
7484
7736
|
if (!dirHasChanges) {
|
|
7485
|
-
const filePath = (0,
|
|
7737
|
+
const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7486
7738
|
const existingContent = await readFileContentOrNull(filePath);
|
|
7487
7739
|
if (existingContent !== contentWithNewline) {
|
|
7488
7740
|
dirHasChanges = true;
|
|
@@ -7496,22 +7748,22 @@ var DirFeatureProcessor = class {
|
|
|
7496
7748
|
if (this.dryRun) {
|
|
7497
7749
|
logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
7498
7750
|
if (mainFile) {
|
|
7499
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7500
|
-
changedPaths.push((0,
|
|
7751
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, mainFile.name)}`);
|
|
7752
|
+
changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
|
|
7501
7753
|
}
|
|
7502
7754
|
for (const file of otherFiles) {
|
|
7503
|
-
logger.info(`[DRY RUN] Would write: ${(0,
|
|
7504
|
-
changedPaths.push((0,
|
|
7755
|
+
logger.info(`[DRY RUN] Would write: ${(0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath)}`);
|
|
7756
|
+
changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7505
7757
|
}
|
|
7506
7758
|
} else {
|
|
7507
7759
|
await ensureDir(dirPath);
|
|
7508
7760
|
if (mainFile && mainFileContent) {
|
|
7509
|
-
const mainFilePath = (0,
|
|
7761
|
+
const mainFilePath = (0, import_node_path59.join)(dirPath, mainFile.name);
|
|
7510
7762
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
7511
|
-
changedPaths.push((0,
|
|
7763
|
+
changedPaths.push((0, import_node_path59.join)(relativeDir, mainFile.name));
|
|
7512
7764
|
}
|
|
7513
7765
|
for (const [i, file] of otherFiles.entries()) {
|
|
7514
|
-
const filePath = (0,
|
|
7766
|
+
const filePath = (0, import_node_path59.join)(dirPath, file.relativeFilePathToDirPath);
|
|
7515
7767
|
const content = otherFileContents[i];
|
|
7516
7768
|
if (content === void 0) {
|
|
7517
7769
|
throw new Error(
|
|
@@ -7519,7 +7771,7 @@ var DirFeatureProcessor = class {
|
|
|
7519
7771
|
);
|
|
7520
7772
|
}
|
|
7521
7773
|
await writeFileContent(filePath, content);
|
|
7522
|
-
changedPaths.push((0,
|
|
7774
|
+
changedPaths.push((0, import_node_path59.join)(relativeDir, file.relativeFilePathToDirPath));
|
|
7523
7775
|
}
|
|
7524
7776
|
}
|
|
7525
7777
|
changedCount++;
|
|
@@ -7551,38 +7803,38 @@ var DirFeatureProcessor = class {
|
|
|
7551
7803
|
};
|
|
7552
7804
|
|
|
7553
7805
|
// src/features/skills/agentsskills-skill.ts
|
|
7554
|
-
var
|
|
7555
|
-
var
|
|
7806
|
+
var import_node_path61 = require("path");
|
|
7807
|
+
var import_mini24 = require("zod/mini");
|
|
7556
7808
|
|
|
7557
7809
|
// src/features/skills/rulesync-skill.ts
|
|
7558
|
-
var
|
|
7559
|
-
var
|
|
7560
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
7561
|
-
name:
|
|
7562
|
-
description:
|
|
7563
|
-
targets:
|
|
7564
|
-
claudecode:
|
|
7565
|
-
|
|
7566
|
-
"allowed-tools":
|
|
7810
|
+
var import_node_path60 = require("path");
|
|
7811
|
+
var import_mini23 = require("zod/mini");
|
|
7812
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini23.z.looseObject({
|
|
7813
|
+
name: import_mini23.z.string(),
|
|
7814
|
+
description: import_mini23.z.string(),
|
|
7815
|
+
targets: import_mini23.z._default(RulesyncTargetsSchema, ["*"]),
|
|
7816
|
+
claudecode: import_mini23.z.optional(
|
|
7817
|
+
import_mini23.z.looseObject({
|
|
7818
|
+
"allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
|
|
7567
7819
|
})
|
|
7568
7820
|
),
|
|
7569
|
-
codexcli:
|
|
7570
|
-
|
|
7571
|
-
"short-description":
|
|
7821
|
+
codexcli: import_mini23.z.optional(
|
|
7822
|
+
import_mini23.z.looseObject({
|
|
7823
|
+
"short-description": import_mini23.z.optional(import_mini23.z.string())
|
|
7572
7824
|
})
|
|
7573
7825
|
),
|
|
7574
|
-
opencode:
|
|
7575
|
-
|
|
7576
|
-
"allowed-tools":
|
|
7826
|
+
opencode: import_mini23.z.optional(
|
|
7827
|
+
import_mini23.z.looseObject({
|
|
7828
|
+
"allowed-tools": import_mini23.z.optional(import_mini23.z.array(import_mini23.z.string()))
|
|
7577
7829
|
})
|
|
7578
7830
|
),
|
|
7579
|
-
copilot:
|
|
7580
|
-
|
|
7581
|
-
license:
|
|
7831
|
+
copilot: import_mini23.z.optional(
|
|
7832
|
+
import_mini23.z.looseObject({
|
|
7833
|
+
license: import_mini23.z.optional(import_mini23.z.string())
|
|
7582
7834
|
})
|
|
7583
7835
|
),
|
|
7584
|
-
cline:
|
|
7585
|
-
roo:
|
|
7836
|
+
cline: import_mini23.z.optional(import_mini23.z.looseObject({})),
|
|
7837
|
+
roo: import_mini23.z.optional(import_mini23.z.looseObject({}))
|
|
7586
7838
|
});
|
|
7587
7839
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
7588
7840
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -7622,7 +7874,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7622
7874
|
}
|
|
7623
7875
|
getFrontmatter() {
|
|
7624
7876
|
if (!this.mainFile?.frontmatter) {
|
|
7625
|
-
throw new Error(`Frontmatter is not defined in ${(0,
|
|
7877
|
+
throw new Error(`Frontmatter is not defined in ${(0, import_node_path60.join)(this.relativeDirPath, this.dirName)}`);
|
|
7626
7878
|
}
|
|
7627
7879
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
7628
7880
|
return result;
|
|
@@ -7648,8 +7900,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7648
7900
|
dirName,
|
|
7649
7901
|
global = false
|
|
7650
7902
|
}) {
|
|
7651
|
-
const skillDirPath = (0,
|
|
7652
|
-
const skillFilePath = (0,
|
|
7903
|
+
const skillDirPath = (0, import_node_path60.join)(baseDir, relativeDirPath, dirName);
|
|
7904
|
+
const skillFilePath = (0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME);
|
|
7653
7905
|
if (!await fileExists(skillFilePath)) {
|
|
7654
7906
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
7655
7907
|
}
|
|
@@ -7679,14 +7931,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
7679
7931
|
};
|
|
7680
7932
|
|
|
7681
7933
|
// src/features/skills/agentsskills-skill.ts
|
|
7682
|
-
var AgentsSkillsSkillFrontmatterSchema =
|
|
7683
|
-
name:
|
|
7684
|
-
description:
|
|
7934
|
+
var AgentsSkillsSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
7935
|
+
name: import_mini24.z.string(),
|
|
7936
|
+
description: import_mini24.z.string()
|
|
7685
7937
|
});
|
|
7686
7938
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
7687
7939
|
constructor({
|
|
7688
7940
|
baseDir = process.cwd(),
|
|
7689
|
-
relativeDirPath = (0,
|
|
7941
|
+
relativeDirPath = (0, import_node_path61.join)(".agents", "skills"),
|
|
7690
7942
|
dirName,
|
|
7691
7943
|
frontmatter,
|
|
7692
7944
|
body,
|
|
@@ -7718,7 +7970,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7718
7970
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
7719
7971
|
}
|
|
7720
7972
|
return {
|
|
7721
|
-
relativeDirPath: (0,
|
|
7973
|
+
relativeDirPath: (0, import_node_path61.join)(".agents", "skills")
|
|
7722
7974
|
};
|
|
7723
7975
|
}
|
|
7724
7976
|
getFrontmatter() {
|
|
@@ -7797,9 +8049,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7797
8049
|
});
|
|
7798
8050
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7799
8051
|
if (!result.success) {
|
|
7800
|
-
const skillDirPath = (0,
|
|
8052
|
+
const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7801
8053
|
throw new Error(
|
|
7802
|
-
`Invalid frontmatter in ${(0,
|
|
8054
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7803
8055
|
);
|
|
7804
8056
|
}
|
|
7805
8057
|
return new _AgentsSkillsSkill({
|
|
@@ -7834,16 +8086,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
7834
8086
|
};
|
|
7835
8087
|
|
|
7836
8088
|
// src/features/skills/antigravity-skill.ts
|
|
7837
|
-
var
|
|
7838
|
-
var
|
|
7839
|
-
var AntigravitySkillFrontmatterSchema =
|
|
7840
|
-
name:
|
|
7841
|
-
description:
|
|
8089
|
+
var import_node_path62 = require("path");
|
|
8090
|
+
var import_mini25 = require("zod/mini");
|
|
8091
|
+
var AntigravitySkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
8092
|
+
name: import_mini25.z.string(),
|
|
8093
|
+
description: import_mini25.z.string()
|
|
7842
8094
|
});
|
|
7843
8095
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
7844
8096
|
constructor({
|
|
7845
8097
|
baseDir = process.cwd(),
|
|
7846
|
-
relativeDirPath = (0,
|
|
8098
|
+
relativeDirPath = (0, import_node_path62.join)(".agent", "skills"),
|
|
7847
8099
|
dirName,
|
|
7848
8100
|
frontmatter,
|
|
7849
8101
|
body,
|
|
@@ -7875,11 +8127,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7875
8127
|
} = {}) {
|
|
7876
8128
|
if (global) {
|
|
7877
8129
|
return {
|
|
7878
|
-
relativeDirPath: (0,
|
|
8130
|
+
relativeDirPath: (0, import_node_path62.join)(".gemini", "antigravity", "skills")
|
|
7879
8131
|
};
|
|
7880
8132
|
}
|
|
7881
8133
|
return {
|
|
7882
|
-
relativeDirPath: (0,
|
|
8134
|
+
relativeDirPath: (0, import_node_path62.join)(".agent", "skills")
|
|
7883
8135
|
};
|
|
7884
8136
|
}
|
|
7885
8137
|
getFrontmatter() {
|
|
@@ -7958,9 +8210,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7958
8210
|
});
|
|
7959
8211
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7960
8212
|
if (!result.success) {
|
|
7961
|
-
const skillDirPath = (0,
|
|
8213
|
+
const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7962
8214
|
throw new Error(
|
|
7963
|
-
`Invalid frontmatter in ${(0,
|
|
8215
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7964
8216
|
);
|
|
7965
8217
|
}
|
|
7966
8218
|
return new _AntigravitySkill({
|
|
@@ -7994,17 +8246,17 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
7994
8246
|
};
|
|
7995
8247
|
|
|
7996
8248
|
// src/features/skills/claudecode-skill.ts
|
|
7997
|
-
var
|
|
7998
|
-
var
|
|
7999
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
8000
|
-
name:
|
|
8001
|
-
description:
|
|
8002
|
-
"allowed-tools":
|
|
8249
|
+
var import_node_path63 = require("path");
|
|
8250
|
+
var import_mini26 = require("zod/mini");
|
|
8251
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
8252
|
+
name: import_mini26.z.string(),
|
|
8253
|
+
description: import_mini26.z.string(),
|
|
8254
|
+
"allowed-tools": import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
|
|
8003
8255
|
});
|
|
8004
8256
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
8005
8257
|
constructor({
|
|
8006
8258
|
baseDir = process.cwd(),
|
|
8007
|
-
relativeDirPath = (0,
|
|
8259
|
+
relativeDirPath = (0, import_node_path63.join)(".claude", "skills"),
|
|
8008
8260
|
dirName,
|
|
8009
8261
|
frontmatter,
|
|
8010
8262
|
body,
|
|
@@ -8035,7 +8287,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8035
8287
|
global: _global = false
|
|
8036
8288
|
} = {}) {
|
|
8037
8289
|
return {
|
|
8038
|
-
relativeDirPath: (0,
|
|
8290
|
+
relativeDirPath: (0, import_node_path63.join)(".claude", "skills")
|
|
8039
8291
|
};
|
|
8040
8292
|
}
|
|
8041
8293
|
getFrontmatter() {
|
|
@@ -8120,9 +8372,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8120
8372
|
});
|
|
8121
8373
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8122
8374
|
if (!result.success) {
|
|
8123
|
-
const skillDirPath = (0,
|
|
8375
|
+
const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8124
8376
|
throw new Error(
|
|
8125
|
-
`Invalid frontmatter in ${(0,
|
|
8377
|
+
`Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8126
8378
|
);
|
|
8127
8379
|
}
|
|
8128
8380
|
return new _ClaudecodeSkill({
|
|
@@ -8156,16 +8408,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
8156
8408
|
};
|
|
8157
8409
|
|
|
8158
8410
|
// src/features/skills/cline-skill.ts
|
|
8159
|
-
var
|
|
8160
|
-
var
|
|
8161
|
-
var ClineSkillFrontmatterSchema =
|
|
8162
|
-
name:
|
|
8163
|
-
description:
|
|
8411
|
+
var import_node_path64 = require("path");
|
|
8412
|
+
var import_mini27 = require("zod/mini");
|
|
8413
|
+
var ClineSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
8414
|
+
name: import_mini27.z.string(),
|
|
8415
|
+
description: import_mini27.z.string()
|
|
8164
8416
|
});
|
|
8165
8417
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
8166
8418
|
constructor({
|
|
8167
8419
|
baseDir = process.cwd(),
|
|
8168
|
-
relativeDirPath = (0,
|
|
8420
|
+
relativeDirPath = (0, import_node_path64.join)(".cline", "skills"),
|
|
8169
8421
|
dirName,
|
|
8170
8422
|
frontmatter,
|
|
8171
8423
|
body,
|
|
@@ -8194,7 +8446,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8194
8446
|
}
|
|
8195
8447
|
static getSettablePaths(_options = {}) {
|
|
8196
8448
|
return {
|
|
8197
|
-
relativeDirPath: (0,
|
|
8449
|
+
relativeDirPath: (0, import_node_path64.join)(".cline", "skills")
|
|
8198
8450
|
};
|
|
8199
8451
|
}
|
|
8200
8452
|
getFrontmatter() {
|
|
@@ -8281,13 +8533,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8281
8533
|
});
|
|
8282
8534
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8283
8535
|
if (!result.success) {
|
|
8284
|
-
const skillDirPath = (0,
|
|
8536
|
+
const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8285
8537
|
throw new Error(
|
|
8286
|
-
`Invalid frontmatter in ${(0,
|
|
8538
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8287
8539
|
);
|
|
8288
8540
|
}
|
|
8289
8541
|
if (result.data.name !== loaded.dirName) {
|
|
8290
|
-
const skillFilePath = (0,
|
|
8542
|
+
const skillFilePath = (0, import_node_path64.join)(
|
|
8291
8543
|
loaded.baseDir,
|
|
8292
8544
|
loaded.relativeDirPath,
|
|
8293
8545
|
loaded.dirName,
|
|
@@ -8328,21 +8580,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
8328
8580
|
};
|
|
8329
8581
|
|
|
8330
8582
|
// src/features/skills/codexcli-skill.ts
|
|
8331
|
-
var
|
|
8332
|
-
var
|
|
8333
|
-
var CodexCliSkillFrontmatterSchema =
|
|
8334
|
-
name:
|
|
8335
|
-
description:
|
|
8336
|
-
metadata:
|
|
8337
|
-
|
|
8338
|
-
"short-description":
|
|
8583
|
+
var import_node_path65 = require("path");
|
|
8584
|
+
var import_mini28 = require("zod/mini");
|
|
8585
|
+
var CodexCliSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
8586
|
+
name: import_mini28.z.string(),
|
|
8587
|
+
description: import_mini28.z.string(),
|
|
8588
|
+
metadata: import_mini28.z.optional(
|
|
8589
|
+
import_mini28.z.looseObject({
|
|
8590
|
+
"short-description": import_mini28.z.optional(import_mini28.z.string())
|
|
8339
8591
|
})
|
|
8340
8592
|
)
|
|
8341
8593
|
});
|
|
8342
8594
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
8343
8595
|
constructor({
|
|
8344
8596
|
baseDir = process.cwd(),
|
|
8345
|
-
relativeDirPath = (0,
|
|
8597
|
+
relativeDirPath = (0, import_node_path65.join)(".codex", "skills"),
|
|
8346
8598
|
dirName,
|
|
8347
8599
|
frontmatter,
|
|
8348
8600
|
body,
|
|
@@ -8373,7 +8625,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8373
8625
|
global: _global = false
|
|
8374
8626
|
} = {}) {
|
|
8375
8627
|
return {
|
|
8376
|
-
relativeDirPath: (0,
|
|
8628
|
+
relativeDirPath: (0, import_node_path65.join)(".codex", "skills")
|
|
8377
8629
|
};
|
|
8378
8630
|
}
|
|
8379
8631
|
getFrontmatter() {
|
|
@@ -8462,9 +8714,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8462
8714
|
});
|
|
8463
8715
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8464
8716
|
if (!result.success) {
|
|
8465
|
-
const skillDirPath = (0,
|
|
8717
|
+
const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8466
8718
|
throw new Error(
|
|
8467
|
-
`Invalid frontmatter in ${(0,
|
|
8719
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8468
8720
|
);
|
|
8469
8721
|
}
|
|
8470
8722
|
return new _CodexCliSkill({
|
|
@@ -8498,17 +8750,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
8498
8750
|
};
|
|
8499
8751
|
|
|
8500
8752
|
// src/features/skills/copilot-skill.ts
|
|
8501
|
-
var
|
|
8502
|
-
var
|
|
8503
|
-
var CopilotSkillFrontmatterSchema =
|
|
8504
|
-
name:
|
|
8505
|
-
description:
|
|
8506
|
-
license:
|
|
8753
|
+
var import_node_path66 = require("path");
|
|
8754
|
+
var import_mini29 = require("zod/mini");
|
|
8755
|
+
var CopilotSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
8756
|
+
name: import_mini29.z.string(),
|
|
8757
|
+
description: import_mini29.z.string(),
|
|
8758
|
+
license: import_mini29.z.optional(import_mini29.z.string())
|
|
8507
8759
|
});
|
|
8508
8760
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
8509
8761
|
constructor({
|
|
8510
8762
|
baseDir = process.cwd(),
|
|
8511
|
-
relativeDirPath = (0,
|
|
8763
|
+
relativeDirPath = (0, import_node_path66.join)(".github", "skills"),
|
|
8512
8764
|
dirName,
|
|
8513
8765
|
frontmatter,
|
|
8514
8766
|
body,
|
|
@@ -8540,7 +8792,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8540
8792
|
throw new Error("CopilotSkill does not support global mode.");
|
|
8541
8793
|
}
|
|
8542
8794
|
return {
|
|
8543
|
-
relativeDirPath: (0,
|
|
8795
|
+
relativeDirPath: (0, import_node_path66.join)(".github", "skills")
|
|
8544
8796
|
};
|
|
8545
8797
|
}
|
|
8546
8798
|
getFrontmatter() {
|
|
@@ -8625,9 +8877,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8625
8877
|
});
|
|
8626
8878
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8627
8879
|
if (!result.success) {
|
|
8628
|
-
const skillDirPath = (0,
|
|
8880
|
+
const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8629
8881
|
throw new Error(
|
|
8630
|
-
`Invalid frontmatter in ${(0,
|
|
8882
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8631
8883
|
);
|
|
8632
8884
|
}
|
|
8633
8885
|
return new _CopilotSkill({
|
|
@@ -8662,16 +8914,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
8662
8914
|
};
|
|
8663
8915
|
|
|
8664
8916
|
// src/features/skills/cursor-skill.ts
|
|
8665
|
-
var
|
|
8666
|
-
var
|
|
8667
|
-
var CursorSkillFrontmatterSchema =
|
|
8668
|
-
name:
|
|
8669
|
-
description:
|
|
8917
|
+
var import_node_path67 = require("path");
|
|
8918
|
+
var import_mini30 = require("zod/mini");
|
|
8919
|
+
var CursorSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
8920
|
+
name: import_mini30.z.string(),
|
|
8921
|
+
description: import_mini30.z.string()
|
|
8670
8922
|
});
|
|
8671
8923
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
8672
8924
|
constructor({
|
|
8673
8925
|
baseDir = process.cwd(),
|
|
8674
|
-
relativeDirPath = (0,
|
|
8926
|
+
relativeDirPath = (0, import_node_path67.join)(".cursor", "skills"),
|
|
8675
8927
|
dirName,
|
|
8676
8928
|
frontmatter,
|
|
8677
8929
|
body,
|
|
@@ -8700,7 +8952,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8700
8952
|
}
|
|
8701
8953
|
static getSettablePaths(_options) {
|
|
8702
8954
|
return {
|
|
8703
|
-
relativeDirPath: (0,
|
|
8955
|
+
relativeDirPath: (0, import_node_path67.join)(".cursor", "skills")
|
|
8704
8956
|
};
|
|
8705
8957
|
}
|
|
8706
8958
|
getFrontmatter() {
|
|
@@ -8779,9 +9031,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8779
9031
|
});
|
|
8780
9032
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8781
9033
|
if (!result.success) {
|
|
8782
|
-
const skillDirPath = (0,
|
|
9034
|
+
const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8783
9035
|
throw new Error(
|
|
8784
|
-
`Invalid frontmatter in ${(0,
|
|
9036
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8785
9037
|
);
|
|
8786
9038
|
}
|
|
8787
9039
|
return new _CursorSkill({
|
|
@@ -8816,11 +9068,11 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
8816
9068
|
};
|
|
8817
9069
|
|
|
8818
9070
|
// src/features/skills/geminicli-skill.ts
|
|
8819
|
-
var
|
|
8820
|
-
var
|
|
8821
|
-
var GeminiCliSkillFrontmatterSchema =
|
|
8822
|
-
name:
|
|
8823
|
-
description:
|
|
9071
|
+
var import_node_path68 = require("path");
|
|
9072
|
+
var import_mini31 = require("zod/mini");
|
|
9073
|
+
var GeminiCliSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
9074
|
+
name: import_mini31.z.string(),
|
|
9075
|
+
description: import_mini31.z.string()
|
|
8824
9076
|
});
|
|
8825
9077
|
var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
8826
9078
|
constructor({
|
|
@@ -8856,7 +9108,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8856
9108
|
global: _global = false
|
|
8857
9109
|
} = {}) {
|
|
8858
9110
|
return {
|
|
8859
|
-
relativeDirPath: (0,
|
|
9111
|
+
relativeDirPath: (0, import_node_path68.join)(".gemini", "skills")
|
|
8860
9112
|
};
|
|
8861
9113
|
}
|
|
8862
9114
|
getFrontmatter() {
|
|
@@ -8935,9 +9187,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8935
9187
|
});
|
|
8936
9188
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8937
9189
|
if (!result.success) {
|
|
8938
|
-
const skillDirPath = (0,
|
|
9190
|
+
const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8939
9191
|
throw new Error(
|
|
8940
|
-
`Invalid frontmatter in ${(0,
|
|
9192
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8941
9193
|
);
|
|
8942
9194
|
}
|
|
8943
9195
|
return new _GeminiCliSkill({
|
|
@@ -8972,16 +9224,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
8972
9224
|
};
|
|
8973
9225
|
|
|
8974
9226
|
// src/features/skills/kilo-skill.ts
|
|
8975
|
-
var
|
|
8976
|
-
var
|
|
8977
|
-
var KiloSkillFrontmatterSchema =
|
|
8978
|
-
name:
|
|
8979
|
-
description:
|
|
9227
|
+
var import_node_path69 = require("path");
|
|
9228
|
+
var import_mini32 = require("zod/mini");
|
|
9229
|
+
var KiloSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
9230
|
+
name: import_mini32.z.string(),
|
|
9231
|
+
description: import_mini32.z.string()
|
|
8980
9232
|
});
|
|
8981
9233
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
8982
9234
|
constructor({
|
|
8983
9235
|
baseDir = process.cwd(),
|
|
8984
|
-
relativeDirPath = (0,
|
|
9236
|
+
relativeDirPath = (0, import_node_path69.join)(".kilocode", "skills"),
|
|
8985
9237
|
dirName,
|
|
8986
9238
|
frontmatter,
|
|
8987
9239
|
body,
|
|
@@ -9012,7 +9264,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9012
9264
|
global: _global = false
|
|
9013
9265
|
} = {}) {
|
|
9014
9266
|
return {
|
|
9015
|
-
relativeDirPath: (0,
|
|
9267
|
+
relativeDirPath: (0, import_node_path69.join)(".kilocode", "skills")
|
|
9016
9268
|
};
|
|
9017
9269
|
}
|
|
9018
9270
|
getFrontmatter() {
|
|
@@ -9099,13 +9351,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9099
9351
|
});
|
|
9100
9352
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9101
9353
|
if (!result.success) {
|
|
9102
|
-
const skillDirPath = (0,
|
|
9354
|
+
const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9103
9355
|
throw new Error(
|
|
9104
|
-
`Invalid frontmatter in ${(0,
|
|
9356
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9105
9357
|
);
|
|
9106
9358
|
}
|
|
9107
9359
|
if (result.data.name !== loaded.dirName) {
|
|
9108
|
-
const skillFilePath = (0,
|
|
9360
|
+
const skillFilePath = (0, import_node_path69.join)(
|
|
9109
9361
|
loaded.baseDir,
|
|
9110
9362
|
loaded.relativeDirPath,
|
|
9111
9363
|
loaded.dirName,
|
|
@@ -9146,16 +9398,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
9146
9398
|
};
|
|
9147
9399
|
|
|
9148
9400
|
// src/features/skills/kiro-skill.ts
|
|
9149
|
-
var
|
|
9150
|
-
var
|
|
9151
|
-
var KiroSkillFrontmatterSchema =
|
|
9152
|
-
name:
|
|
9153
|
-
description:
|
|
9401
|
+
var import_node_path70 = require("path");
|
|
9402
|
+
var import_mini33 = require("zod/mini");
|
|
9403
|
+
var KiroSkillFrontmatterSchema = import_mini33.z.looseObject({
|
|
9404
|
+
name: import_mini33.z.string(),
|
|
9405
|
+
description: import_mini33.z.string()
|
|
9154
9406
|
});
|
|
9155
9407
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
9156
9408
|
constructor({
|
|
9157
9409
|
baseDir = process.cwd(),
|
|
9158
|
-
relativeDirPath = (0,
|
|
9410
|
+
relativeDirPath = (0, import_node_path70.join)(".kiro", "skills"),
|
|
9159
9411
|
dirName,
|
|
9160
9412
|
frontmatter,
|
|
9161
9413
|
body,
|
|
@@ -9187,7 +9439,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9187
9439
|
throw new Error("KiroSkill does not support global mode.");
|
|
9188
9440
|
}
|
|
9189
9441
|
return {
|
|
9190
|
-
relativeDirPath: (0,
|
|
9442
|
+
relativeDirPath: (0, import_node_path70.join)(".kiro", "skills")
|
|
9191
9443
|
};
|
|
9192
9444
|
}
|
|
9193
9445
|
getFrontmatter() {
|
|
@@ -9274,13 +9526,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9274
9526
|
});
|
|
9275
9527
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9276
9528
|
if (!result.success) {
|
|
9277
|
-
const skillDirPath = (0,
|
|
9529
|
+
const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9278
9530
|
throw new Error(
|
|
9279
|
-
`Invalid frontmatter in ${(0,
|
|
9531
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9280
9532
|
);
|
|
9281
9533
|
}
|
|
9282
9534
|
if (result.data.name !== loaded.dirName) {
|
|
9283
|
-
const skillFilePath = (0,
|
|
9535
|
+
const skillFilePath = (0, import_node_path70.join)(
|
|
9284
9536
|
loaded.baseDir,
|
|
9285
9537
|
loaded.relativeDirPath,
|
|
9286
9538
|
loaded.dirName,
|
|
@@ -9322,17 +9574,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
9322
9574
|
};
|
|
9323
9575
|
|
|
9324
9576
|
// src/features/skills/opencode-skill.ts
|
|
9325
|
-
var
|
|
9326
|
-
var
|
|
9327
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
9328
|
-
name:
|
|
9329
|
-
description:
|
|
9330
|
-
"allowed-tools":
|
|
9577
|
+
var import_node_path71 = require("path");
|
|
9578
|
+
var import_mini34 = require("zod/mini");
|
|
9579
|
+
var OpenCodeSkillFrontmatterSchema = import_mini34.z.looseObject({
|
|
9580
|
+
name: import_mini34.z.string(),
|
|
9581
|
+
description: import_mini34.z.string(),
|
|
9582
|
+
"allowed-tools": import_mini34.z.optional(import_mini34.z.array(import_mini34.z.string()))
|
|
9331
9583
|
});
|
|
9332
9584
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
9333
9585
|
constructor({
|
|
9334
9586
|
baseDir = process.cwd(),
|
|
9335
|
-
relativeDirPath = (0,
|
|
9587
|
+
relativeDirPath = (0, import_node_path71.join)(".opencode", "skill"),
|
|
9336
9588
|
dirName,
|
|
9337
9589
|
frontmatter,
|
|
9338
9590
|
body,
|
|
@@ -9361,7 +9613,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9361
9613
|
}
|
|
9362
9614
|
static getSettablePaths({ global = false } = {}) {
|
|
9363
9615
|
return {
|
|
9364
|
-
relativeDirPath: global ? (0,
|
|
9616
|
+
relativeDirPath: global ? (0, import_node_path71.join)(".config", "opencode", "skill") : (0, import_node_path71.join)(".opencode", "skill")
|
|
9365
9617
|
};
|
|
9366
9618
|
}
|
|
9367
9619
|
getFrontmatter() {
|
|
@@ -9446,9 +9698,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9446
9698
|
});
|
|
9447
9699
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9448
9700
|
if (!result.success) {
|
|
9449
|
-
const skillDirPath = (0,
|
|
9701
|
+
const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9450
9702
|
throw new Error(
|
|
9451
|
-
`Invalid frontmatter in ${(0,
|
|
9703
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9452
9704
|
);
|
|
9453
9705
|
}
|
|
9454
9706
|
return new _OpenCodeSkill({
|
|
@@ -9482,16 +9734,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
9482
9734
|
};
|
|
9483
9735
|
|
|
9484
9736
|
// src/features/skills/replit-skill.ts
|
|
9485
|
-
var
|
|
9486
|
-
var
|
|
9487
|
-
var ReplitSkillFrontmatterSchema =
|
|
9488
|
-
name:
|
|
9489
|
-
description:
|
|
9737
|
+
var import_node_path72 = require("path");
|
|
9738
|
+
var import_mini35 = require("zod/mini");
|
|
9739
|
+
var ReplitSkillFrontmatterSchema = import_mini35.z.looseObject({
|
|
9740
|
+
name: import_mini35.z.string(),
|
|
9741
|
+
description: import_mini35.z.string()
|
|
9490
9742
|
});
|
|
9491
9743
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
9492
9744
|
constructor({
|
|
9493
9745
|
baseDir = process.cwd(),
|
|
9494
|
-
relativeDirPath = (0,
|
|
9746
|
+
relativeDirPath = (0, import_node_path72.join)(".agents", "skills"),
|
|
9495
9747
|
dirName,
|
|
9496
9748
|
frontmatter,
|
|
9497
9749
|
body,
|
|
@@ -9523,7 +9775,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9523
9775
|
throw new Error("ReplitSkill does not support global mode.");
|
|
9524
9776
|
}
|
|
9525
9777
|
return {
|
|
9526
|
-
relativeDirPath: (0,
|
|
9778
|
+
relativeDirPath: (0, import_node_path72.join)(".agents", "skills")
|
|
9527
9779
|
};
|
|
9528
9780
|
}
|
|
9529
9781
|
getFrontmatter() {
|
|
@@ -9602,9 +9854,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9602
9854
|
});
|
|
9603
9855
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9604
9856
|
if (!result.success) {
|
|
9605
|
-
const skillDirPath = (0,
|
|
9857
|
+
const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9606
9858
|
throw new Error(
|
|
9607
|
-
`Invalid frontmatter in ${(0,
|
|
9859
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9608
9860
|
);
|
|
9609
9861
|
}
|
|
9610
9862
|
return new _ReplitSkill({
|
|
@@ -9639,16 +9891,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
9639
9891
|
};
|
|
9640
9892
|
|
|
9641
9893
|
// src/features/skills/roo-skill.ts
|
|
9642
|
-
var
|
|
9643
|
-
var
|
|
9644
|
-
var RooSkillFrontmatterSchema =
|
|
9645
|
-
name:
|
|
9646
|
-
description:
|
|
9894
|
+
var import_node_path73 = require("path");
|
|
9895
|
+
var import_mini36 = require("zod/mini");
|
|
9896
|
+
var RooSkillFrontmatterSchema = import_mini36.z.looseObject({
|
|
9897
|
+
name: import_mini36.z.string(),
|
|
9898
|
+
description: import_mini36.z.string()
|
|
9647
9899
|
});
|
|
9648
9900
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
9649
9901
|
constructor({
|
|
9650
9902
|
baseDir = process.cwd(),
|
|
9651
|
-
relativeDirPath = (0,
|
|
9903
|
+
relativeDirPath = (0, import_node_path73.join)(".roo", "skills"),
|
|
9652
9904
|
dirName,
|
|
9653
9905
|
frontmatter,
|
|
9654
9906
|
body,
|
|
@@ -9679,7 +9931,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9679
9931
|
global: _global = false
|
|
9680
9932
|
} = {}) {
|
|
9681
9933
|
return {
|
|
9682
|
-
relativeDirPath: (0,
|
|
9934
|
+
relativeDirPath: (0, import_node_path73.join)(".roo", "skills")
|
|
9683
9935
|
};
|
|
9684
9936
|
}
|
|
9685
9937
|
getFrontmatter() {
|
|
@@ -9766,13 +10018,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9766
10018
|
});
|
|
9767
10019
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
9768
10020
|
if (!result.success) {
|
|
9769
|
-
const skillDirPath = (0,
|
|
10021
|
+
const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
9770
10022
|
throw new Error(
|
|
9771
|
-
`Invalid frontmatter in ${(0,
|
|
10023
|
+
`Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
9772
10024
|
);
|
|
9773
10025
|
}
|
|
9774
10026
|
if (result.data.name !== loaded.dirName) {
|
|
9775
|
-
const skillFilePath = (0,
|
|
10027
|
+
const skillFilePath = (0, import_node_path73.join)(
|
|
9776
10028
|
loaded.baseDir,
|
|
9777
10029
|
loaded.relativeDirPath,
|
|
9778
10030
|
loaded.dirName,
|
|
@@ -9813,17 +10065,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
9813
10065
|
};
|
|
9814
10066
|
|
|
9815
10067
|
// src/features/skills/skills-utils.ts
|
|
9816
|
-
var
|
|
10068
|
+
var import_node_path74 = require("path");
|
|
9817
10069
|
async function getLocalSkillDirNames(baseDir) {
|
|
9818
|
-
const skillsDir = (0,
|
|
10070
|
+
const skillsDir = (0, import_node_path74.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
9819
10071
|
const names = /* @__PURE__ */ new Set();
|
|
9820
10072
|
if (!await directoryExists(skillsDir)) {
|
|
9821
10073
|
return names;
|
|
9822
10074
|
}
|
|
9823
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10075
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path74.join)(skillsDir, "*"), { type: "dir" });
|
|
9824
10076
|
for (const dirPath of dirPaths) {
|
|
9825
|
-
const name = (0,
|
|
9826
|
-
if (name === (0,
|
|
10077
|
+
const name = (0, import_node_path74.basename)(dirPath);
|
|
10078
|
+
if (name === (0, import_node_path74.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
9827
10079
|
names.add(name);
|
|
9828
10080
|
}
|
|
9829
10081
|
return names;
|
|
@@ -9848,7 +10100,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
9848
10100
|
"replit",
|
|
9849
10101
|
"roo"
|
|
9850
10102
|
];
|
|
9851
|
-
var SkillsProcessorToolTargetSchema =
|
|
10103
|
+
var SkillsProcessorToolTargetSchema = import_mini37.z.enum(skillsProcessorToolTargetTuple);
|
|
9852
10104
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
9853
10105
|
[
|
|
9854
10106
|
"agentsmd",
|
|
@@ -10049,11 +10301,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10049
10301
|
)
|
|
10050
10302
|
);
|
|
10051
10303
|
const localSkillNames = new Set(localDirNames);
|
|
10052
|
-
const curatedDirPath = (0,
|
|
10304
|
+
const curatedDirPath = (0, import_node_path75.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
10053
10305
|
let curatedSkills = [];
|
|
10054
10306
|
if (await directoryExists(curatedDirPath)) {
|
|
10055
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
10056
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
10307
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path75.join)(curatedDirPath, "*"), { type: "dir" });
|
|
10308
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path75.basename)(path3));
|
|
10057
10309
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
10058
10310
|
if (localSkillNames.has(name)) {
|
|
10059
10311
|
logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -10086,9 +10338,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10086
10338
|
async loadToolDirs() {
|
|
10087
10339
|
const factory = this.getFactory(this.toolTarget);
|
|
10088
10340
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10089
|
-
const skillsDirPath = (0,
|
|
10090
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10091
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10341
|
+
const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
|
|
10342
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10343
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
|
|
10092
10344
|
const toolSkills = await Promise.all(
|
|
10093
10345
|
dirNames.map(
|
|
10094
10346
|
(dirName) => factory.class.fromDir({
|
|
@@ -10104,9 +10356,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10104
10356
|
async loadToolDirsToDelete() {
|
|
10105
10357
|
const factory = this.getFactory(this.toolTarget);
|
|
10106
10358
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
10107
|
-
const skillsDirPath = (0,
|
|
10108
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
10109
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
10359
|
+
const skillsDirPath = (0, import_node_path75.join)(this.baseDir, paths.relativeDirPath);
|
|
10360
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDirPath, "*"), { type: "dir" });
|
|
10361
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path75.basename)(path3));
|
|
10110
10362
|
const toolSkills = dirNames.map(
|
|
10111
10363
|
(dirName) => factory.class.forDeletion({
|
|
10112
10364
|
baseDir: this.baseDir,
|
|
@@ -10167,11 +10419,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
10167
10419
|
};
|
|
10168
10420
|
|
|
10169
10421
|
// src/features/subagents/agentsmd-subagent.ts
|
|
10170
|
-
var
|
|
10422
|
+
var import_node_path77 = require("path");
|
|
10171
10423
|
|
|
10172
10424
|
// src/features/subagents/simulated-subagent.ts
|
|
10173
|
-
var
|
|
10174
|
-
var
|
|
10425
|
+
var import_node_path76 = require("path");
|
|
10426
|
+
var import_mini38 = require("zod/mini");
|
|
10175
10427
|
|
|
10176
10428
|
// src/features/subagents/tool-subagent.ts
|
|
10177
10429
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -10223,9 +10475,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
10223
10475
|
};
|
|
10224
10476
|
|
|
10225
10477
|
// src/features/subagents/simulated-subagent.ts
|
|
10226
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
10227
|
-
name:
|
|
10228
|
-
description:
|
|
10478
|
+
var SimulatedSubagentFrontmatterSchema = import_mini38.z.object({
|
|
10479
|
+
name: import_mini38.z.string(),
|
|
10480
|
+
description: import_mini38.z.string()
|
|
10229
10481
|
});
|
|
10230
10482
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
10231
10483
|
frontmatter;
|
|
@@ -10235,7 +10487,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10235
10487
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10236
10488
|
if (!result.success) {
|
|
10237
10489
|
throw new Error(
|
|
10238
|
-
`Invalid frontmatter in ${(0,
|
|
10490
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10239
10491
|
);
|
|
10240
10492
|
}
|
|
10241
10493
|
}
|
|
@@ -10286,7 +10538,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10286
10538
|
return {
|
|
10287
10539
|
success: false,
|
|
10288
10540
|
error: new Error(
|
|
10289
|
-
`Invalid frontmatter in ${(0,
|
|
10541
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10290
10542
|
)
|
|
10291
10543
|
};
|
|
10292
10544
|
}
|
|
@@ -10296,7 +10548,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10296
10548
|
relativeFilePath,
|
|
10297
10549
|
validate = true
|
|
10298
10550
|
}) {
|
|
10299
|
-
const filePath = (0,
|
|
10551
|
+
const filePath = (0, import_node_path76.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
10300
10552
|
const fileContent = await readFileContent(filePath);
|
|
10301
10553
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10302
10554
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10306,7 +10558,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10306
10558
|
return {
|
|
10307
10559
|
baseDir,
|
|
10308
10560
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
10309
|
-
relativeFilePath: (0,
|
|
10561
|
+
relativeFilePath: (0, import_node_path76.basename)(relativeFilePath),
|
|
10310
10562
|
frontmatter: result.data,
|
|
10311
10563
|
body: content.trim(),
|
|
10312
10564
|
validate
|
|
@@ -10332,7 +10584,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
10332
10584
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
10333
10585
|
static getSettablePaths() {
|
|
10334
10586
|
return {
|
|
10335
|
-
relativeDirPath: (0,
|
|
10587
|
+
relativeDirPath: (0, import_node_path77.join)(".agents", "subagents")
|
|
10336
10588
|
};
|
|
10337
10589
|
}
|
|
10338
10590
|
static async fromFile(params) {
|
|
@@ -10355,11 +10607,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
10355
10607
|
};
|
|
10356
10608
|
|
|
10357
10609
|
// src/features/subagents/factorydroid-subagent.ts
|
|
10358
|
-
var
|
|
10610
|
+
var import_node_path78 = require("path");
|
|
10359
10611
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
10360
10612
|
static getSettablePaths(_options) {
|
|
10361
10613
|
return {
|
|
10362
|
-
relativeDirPath: (0,
|
|
10614
|
+
relativeDirPath: (0, import_node_path78.join)(".factory", "droids")
|
|
10363
10615
|
};
|
|
10364
10616
|
}
|
|
10365
10617
|
static async fromFile(params) {
|
|
@@ -10382,11 +10634,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
10382
10634
|
};
|
|
10383
10635
|
|
|
10384
10636
|
// src/features/subagents/geminicli-subagent.ts
|
|
10385
|
-
var
|
|
10637
|
+
var import_node_path79 = require("path");
|
|
10386
10638
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
10387
10639
|
static getSettablePaths() {
|
|
10388
10640
|
return {
|
|
10389
|
-
relativeDirPath: (0,
|
|
10641
|
+
relativeDirPath: (0, import_node_path79.join)(".gemini", "subagents")
|
|
10390
10642
|
};
|
|
10391
10643
|
}
|
|
10392
10644
|
static async fromFile(params) {
|
|
@@ -10409,11 +10661,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
10409
10661
|
};
|
|
10410
10662
|
|
|
10411
10663
|
// src/features/subagents/roo-subagent.ts
|
|
10412
|
-
var
|
|
10664
|
+
var import_node_path80 = require("path");
|
|
10413
10665
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
10414
10666
|
static getSettablePaths() {
|
|
10415
10667
|
return {
|
|
10416
|
-
relativeDirPath: (0,
|
|
10668
|
+
relativeDirPath: (0, import_node_path80.join)(".roo", "subagents")
|
|
10417
10669
|
};
|
|
10418
10670
|
}
|
|
10419
10671
|
static async fromFile(params) {
|
|
@@ -10436,20 +10688,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
10436
10688
|
};
|
|
10437
10689
|
|
|
10438
10690
|
// src/features/subagents/subagents-processor.ts
|
|
10439
|
-
var
|
|
10440
|
-
var
|
|
10691
|
+
var import_node_path88 = require("path");
|
|
10692
|
+
var import_mini46 = require("zod/mini");
|
|
10441
10693
|
|
|
10442
10694
|
// src/features/subagents/claudecode-subagent.ts
|
|
10443
|
-
var
|
|
10444
|
-
var
|
|
10695
|
+
var import_node_path82 = require("path");
|
|
10696
|
+
var import_mini40 = require("zod/mini");
|
|
10445
10697
|
|
|
10446
10698
|
// src/features/subagents/rulesync-subagent.ts
|
|
10447
|
-
var
|
|
10448
|
-
var
|
|
10449
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
10450
|
-
targets:
|
|
10451
|
-
name:
|
|
10452
|
-
description:
|
|
10699
|
+
var import_node_path81 = require("path");
|
|
10700
|
+
var import_mini39 = require("zod/mini");
|
|
10701
|
+
var RulesyncSubagentFrontmatterSchema = import_mini39.z.looseObject({
|
|
10702
|
+
targets: import_mini39.z._default(RulesyncTargetsSchema, ["*"]),
|
|
10703
|
+
name: import_mini39.z.string(),
|
|
10704
|
+
description: import_mini39.z.string()
|
|
10453
10705
|
});
|
|
10454
10706
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
10455
10707
|
frontmatter;
|
|
@@ -10458,7 +10710,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10458
10710
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10459
10711
|
if (!parseResult.success && rest.validate !== false) {
|
|
10460
10712
|
throw new Error(
|
|
10461
|
-
`Invalid frontmatter in ${(0,
|
|
10713
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
10462
10714
|
);
|
|
10463
10715
|
}
|
|
10464
10716
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -10491,7 +10743,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10491
10743
|
return {
|
|
10492
10744
|
success: false,
|
|
10493
10745
|
error: new Error(
|
|
10494
|
-
`Invalid frontmatter in ${(0,
|
|
10746
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10495
10747
|
)
|
|
10496
10748
|
};
|
|
10497
10749
|
}
|
|
@@ -10499,14 +10751,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10499
10751
|
static async fromFile({
|
|
10500
10752
|
relativeFilePath
|
|
10501
10753
|
}) {
|
|
10502
|
-
const filePath = (0,
|
|
10754
|
+
const filePath = (0, import_node_path81.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
10503
10755
|
const fileContent = await readFileContent(filePath);
|
|
10504
10756
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10505
10757
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10506
10758
|
if (!result.success) {
|
|
10507
10759
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
10508
10760
|
}
|
|
10509
|
-
const filename = (0,
|
|
10761
|
+
const filename = (0, import_node_path81.basename)(relativeFilePath);
|
|
10510
10762
|
return new _RulesyncSubagent({
|
|
10511
10763
|
baseDir: process.cwd(),
|
|
10512
10764
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -10518,13 +10770,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
10518
10770
|
};
|
|
10519
10771
|
|
|
10520
10772
|
// src/features/subagents/claudecode-subagent.ts
|
|
10521
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
10522
|
-
name:
|
|
10523
|
-
description:
|
|
10524
|
-
model:
|
|
10525
|
-
tools:
|
|
10526
|
-
permissionMode:
|
|
10527
|
-
skills:
|
|
10773
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini40.z.looseObject({
|
|
10774
|
+
name: import_mini40.z.string(),
|
|
10775
|
+
description: import_mini40.z.string(),
|
|
10776
|
+
model: import_mini40.z.optional(import_mini40.z.string()),
|
|
10777
|
+
tools: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())])),
|
|
10778
|
+
permissionMode: import_mini40.z.optional(import_mini40.z.string()),
|
|
10779
|
+
skills: import_mini40.z.optional(import_mini40.z.union([import_mini40.z.string(), import_mini40.z.array(import_mini40.z.string())]))
|
|
10528
10780
|
});
|
|
10529
10781
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
10530
10782
|
frontmatter;
|
|
@@ -10534,7 +10786,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10534
10786
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10535
10787
|
if (!result.success) {
|
|
10536
10788
|
throw new Error(
|
|
10537
|
-
`Invalid frontmatter in ${(0,
|
|
10789
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10538
10790
|
);
|
|
10539
10791
|
}
|
|
10540
10792
|
}
|
|
@@ -10546,7 +10798,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10546
10798
|
}
|
|
10547
10799
|
static getSettablePaths(_options = {}) {
|
|
10548
10800
|
return {
|
|
10549
|
-
relativeDirPath: (0,
|
|
10801
|
+
relativeDirPath: (0, import_node_path82.join)(".claude", "agents")
|
|
10550
10802
|
};
|
|
10551
10803
|
}
|
|
10552
10804
|
getFrontmatter() {
|
|
@@ -10622,7 +10874,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10622
10874
|
return {
|
|
10623
10875
|
success: false,
|
|
10624
10876
|
error: new Error(
|
|
10625
|
-
`Invalid frontmatter in ${(0,
|
|
10877
|
+
`Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10626
10878
|
)
|
|
10627
10879
|
};
|
|
10628
10880
|
}
|
|
@@ -10640,7 +10892,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10640
10892
|
global = false
|
|
10641
10893
|
}) {
|
|
10642
10894
|
const paths = this.getSettablePaths({ global });
|
|
10643
|
-
const filePath = (0,
|
|
10895
|
+
const filePath = (0, import_node_path82.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10644
10896
|
const fileContent = await readFileContent(filePath);
|
|
10645
10897
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10646
10898
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -10675,16 +10927,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
10675
10927
|
};
|
|
10676
10928
|
|
|
10677
10929
|
// src/features/subagents/codexcli-subagent.ts
|
|
10678
|
-
var
|
|
10930
|
+
var import_node_path83 = require("path");
|
|
10679
10931
|
var smolToml2 = __toESM(require("smol-toml"), 1);
|
|
10680
|
-
var
|
|
10681
|
-
var CodexCliSubagentTomlSchema =
|
|
10682
|
-
name:
|
|
10683
|
-
description:
|
|
10684
|
-
developer_instructions:
|
|
10685
|
-
model:
|
|
10686
|
-
model_reasoning_effort:
|
|
10687
|
-
sandbox_mode:
|
|
10932
|
+
var import_mini41 = require("zod/mini");
|
|
10933
|
+
var CodexCliSubagentTomlSchema = import_mini41.z.looseObject({
|
|
10934
|
+
name: import_mini41.z.string(),
|
|
10935
|
+
description: import_mini41.z.optional(import_mini41.z.string()),
|
|
10936
|
+
developer_instructions: import_mini41.z.optional(import_mini41.z.string()),
|
|
10937
|
+
model: import_mini41.z.optional(import_mini41.z.string()),
|
|
10938
|
+
model_reasoning_effort: import_mini41.z.optional(import_mini41.z.string()),
|
|
10939
|
+
sandbox_mode: import_mini41.z.optional(import_mini41.z.string())
|
|
10688
10940
|
});
|
|
10689
10941
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
10690
10942
|
body;
|
|
@@ -10695,7 +10947,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10695
10947
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
10696
10948
|
} catch (error) {
|
|
10697
10949
|
throw new Error(
|
|
10698
|
-
`Invalid TOML in ${(0,
|
|
10950
|
+
`Invalid TOML in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10699
10951
|
{ cause: error }
|
|
10700
10952
|
);
|
|
10701
10953
|
}
|
|
@@ -10707,7 +10959,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10707
10959
|
}
|
|
10708
10960
|
static getSettablePaths(_options = {}) {
|
|
10709
10961
|
return {
|
|
10710
|
-
relativeDirPath: (0,
|
|
10962
|
+
relativeDirPath: (0, import_node_path83.join)(".codex", "agents")
|
|
10711
10963
|
};
|
|
10712
10964
|
}
|
|
10713
10965
|
getBody() {
|
|
@@ -10719,7 +10971,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10719
10971
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
|
|
10720
10972
|
} catch (error) {
|
|
10721
10973
|
throw new Error(
|
|
10722
|
-
`Failed to parse TOML in ${(0,
|
|
10974
|
+
`Failed to parse TOML in ${(0, import_node_path83.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
10723
10975
|
{ cause: error }
|
|
10724
10976
|
);
|
|
10725
10977
|
}
|
|
@@ -10800,7 +11052,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10800
11052
|
global = false
|
|
10801
11053
|
}) {
|
|
10802
11054
|
const paths = this.getSettablePaths({ global });
|
|
10803
|
-
const filePath = (0,
|
|
11055
|
+
const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10804
11056
|
const fileContent = await readFileContent(filePath);
|
|
10805
11057
|
const subagent = new _CodexCliSubagent({
|
|
10806
11058
|
baseDir,
|
|
@@ -10838,13 +11090,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
10838
11090
|
};
|
|
10839
11091
|
|
|
10840
11092
|
// src/features/subagents/copilot-subagent.ts
|
|
10841
|
-
var
|
|
10842
|
-
var
|
|
11093
|
+
var import_node_path84 = require("path");
|
|
11094
|
+
var import_mini42 = require("zod/mini");
|
|
10843
11095
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
10844
|
-
var CopilotSubagentFrontmatterSchema =
|
|
10845
|
-
name:
|
|
10846
|
-
description:
|
|
10847
|
-
tools:
|
|
11096
|
+
var CopilotSubagentFrontmatterSchema = import_mini42.z.looseObject({
|
|
11097
|
+
name: import_mini42.z.string(),
|
|
11098
|
+
description: import_mini42.z.string(),
|
|
11099
|
+
tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
|
|
10848
11100
|
});
|
|
10849
11101
|
var normalizeTools = (tools) => {
|
|
10850
11102
|
if (!tools) {
|
|
@@ -10864,7 +11116,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10864
11116
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
10865
11117
|
if (!result.success) {
|
|
10866
11118
|
throw new Error(
|
|
10867
|
-
`Invalid frontmatter in ${(0,
|
|
11119
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10868
11120
|
);
|
|
10869
11121
|
}
|
|
10870
11122
|
}
|
|
@@ -10876,7 +11128,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10876
11128
|
}
|
|
10877
11129
|
static getSettablePaths(_options = {}) {
|
|
10878
11130
|
return {
|
|
10879
|
-
relativeDirPath: (0,
|
|
11131
|
+
relativeDirPath: (0, import_node_path84.join)(".github", "agents")
|
|
10880
11132
|
};
|
|
10881
11133
|
}
|
|
10882
11134
|
getFrontmatter() {
|
|
@@ -10950,7 +11202,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10950
11202
|
return {
|
|
10951
11203
|
success: false,
|
|
10952
11204
|
error: new Error(
|
|
10953
|
-
`Invalid frontmatter in ${(0,
|
|
11205
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10954
11206
|
)
|
|
10955
11207
|
};
|
|
10956
11208
|
}
|
|
@@ -10968,7 +11220,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
10968
11220
|
global = false
|
|
10969
11221
|
}) {
|
|
10970
11222
|
const paths = this.getSettablePaths({ global });
|
|
10971
|
-
const filePath = (0,
|
|
11223
|
+
const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
10972
11224
|
const fileContent = await readFileContent(filePath);
|
|
10973
11225
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
10974
11226
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11004,11 +11256,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
11004
11256
|
};
|
|
11005
11257
|
|
|
11006
11258
|
// src/features/subagents/cursor-subagent.ts
|
|
11007
|
-
var
|
|
11008
|
-
var
|
|
11009
|
-
var CursorSubagentFrontmatterSchema =
|
|
11010
|
-
name:
|
|
11011
|
-
description:
|
|
11259
|
+
var import_node_path85 = require("path");
|
|
11260
|
+
var import_mini43 = require("zod/mini");
|
|
11261
|
+
var CursorSubagentFrontmatterSchema = import_mini43.z.looseObject({
|
|
11262
|
+
name: import_mini43.z.string(),
|
|
11263
|
+
description: import_mini43.z.string()
|
|
11012
11264
|
});
|
|
11013
11265
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
11014
11266
|
frontmatter;
|
|
@@ -11018,7 +11270,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11018
11270
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11019
11271
|
if (!result.success) {
|
|
11020
11272
|
throw new Error(
|
|
11021
|
-
`Invalid frontmatter in ${(0,
|
|
11273
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11022
11274
|
);
|
|
11023
11275
|
}
|
|
11024
11276
|
}
|
|
@@ -11030,7 +11282,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11030
11282
|
}
|
|
11031
11283
|
static getSettablePaths(_options = {}) {
|
|
11032
11284
|
return {
|
|
11033
|
-
relativeDirPath: (0,
|
|
11285
|
+
relativeDirPath: (0, import_node_path85.join)(".cursor", "agents")
|
|
11034
11286
|
};
|
|
11035
11287
|
}
|
|
11036
11288
|
getFrontmatter() {
|
|
@@ -11097,7 +11349,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11097
11349
|
return {
|
|
11098
11350
|
success: false,
|
|
11099
11351
|
error: new Error(
|
|
11100
|
-
`Invalid frontmatter in ${(0,
|
|
11352
|
+
`Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11101
11353
|
)
|
|
11102
11354
|
};
|
|
11103
11355
|
}
|
|
@@ -11115,7 +11367,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11115
11367
|
global = false
|
|
11116
11368
|
}) {
|
|
11117
11369
|
const paths = this.getSettablePaths({ global });
|
|
11118
|
-
const filePath = (0,
|
|
11370
|
+
const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11119
11371
|
const fileContent = await readFileContent(filePath);
|
|
11120
11372
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11121
11373
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11151,23 +11403,23 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
11151
11403
|
};
|
|
11152
11404
|
|
|
11153
11405
|
// src/features/subagents/kiro-subagent.ts
|
|
11154
|
-
var
|
|
11155
|
-
var
|
|
11156
|
-
var KiroCliSubagentJsonSchema =
|
|
11157
|
-
name:
|
|
11158
|
-
description:
|
|
11159
|
-
prompt:
|
|
11160
|
-
tools:
|
|
11161
|
-
toolAliases:
|
|
11162
|
-
toolSettings:
|
|
11163
|
-
toolSchema:
|
|
11164
|
-
hooks:
|
|
11165
|
-
model:
|
|
11166
|
-
mcpServers:
|
|
11167
|
-
useLegacyMcpJson:
|
|
11168
|
-
resources:
|
|
11169
|
-
allowedTools:
|
|
11170
|
-
includeMcpJson:
|
|
11406
|
+
var import_node_path86 = require("path");
|
|
11407
|
+
var import_mini44 = require("zod/mini");
|
|
11408
|
+
var KiroCliSubagentJsonSchema = import_mini44.z.looseObject({
|
|
11409
|
+
name: import_mini44.z.string(),
|
|
11410
|
+
description: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
|
|
11411
|
+
prompt: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
|
|
11412
|
+
tools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
|
|
11413
|
+
toolAliases: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.string()))),
|
|
11414
|
+
toolSettings: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
|
|
11415
|
+
toolSchema: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.unknown())),
|
|
11416
|
+
hooks: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.array(import_mini44.z.unknown())))),
|
|
11417
|
+
model: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.string())),
|
|
11418
|
+
mcpServers: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.record(import_mini44.z.string(), import_mini44.z.unknown()))),
|
|
11419
|
+
useLegacyMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean())),
|
|
11420
|
+
resources: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
|
|
11421
|
+
allowedTools: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.array(import_mini44.z.string()))),
|
|
11422
|
+
includeMcpJson: import_mini44.z.optional(import_mini44.z.nullable(import_mini44.z.boolean()))
|
|
11171
11423
|
});
|
|
11172
11424
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
11173
11425
|
body;
|
|
@@ -11178,7 +11430,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11178
11430
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
11179
11431
|
} catch (error) {
|
|
11180
11432
|
throw new Error(
|
|
11181
|
-
`Invalid JSON in ${(0,
|
|
11433
|
+
`Invalid JSON in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11182
11434
|
{ cause: error }
|
|
11183
11435
|
);
|
|
11184
11436
|
}
|
|
@@ -11190,7 +11442,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11190
11442
|
}
|
|
11191
11443
|
static getSettablePaths(_options = {}) {
|
|
11192
11444
|
return {
|
|
11193
|
-
relativeDirPath: (0,
|
|
11445
|
+
relativeDirPath: (0, import_node_path86.join)(".kiro", "agents")
|
|
11194
11446
|
};
|
|
11195
11447
|
}
|
|
11196
11448
|
getBody() {
|
|
@@ -11202,7 +11454,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11202
11454
|
parsed = JSON.parse(this.body);
|
|
11203
11455
|
} catch (error) {
|
|
11204
11456
|
throw new Error(
|
|
11205
|
-
`Failed to parse JSON in ${(0,
|
|
11457
|
+
`Failed to parse JSON in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
11206
11458
|
{ cause: error }
|
|
11207
11459
|
);
|
|
11208
11460
|
}
|
|
@@ -11283,7 +11535,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11283
11535
|
global = false
|
|
11284
11536
|
}) {
|
|
11285
11537
|
const paths = this.getSettablePaths({ global });
|
|
11286
|
-
const filePath = (0,
|
|
11538
|
+
const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11287
11539
|
const fileContent = await readFileContent(filePath);
|
|
11288
11540
|
const subagent = new _KiroSubagent({
|
|
11289
11541
|
baseDir,
|
|
@@ -11321,12 +11573,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
11321
11573
|
};
|
|
11322
11574
|
|
|
11323
11575
|
// src/features/subagents/opencode-subagent.ts
|
|
11324
|
-
var
|
|
11325
|
-
var
|
|
11326
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
11327
|
-
description:
|
|
11328
|
-
mode:
|
|
11329
|
-
name:
|
|
11576
|
+
var import_node_path87 = require("path");
|
|
11577
|
+
var import_mini45 = require("zod/mini");
|
|
11578
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini45.z.looseObject({
|
|
11579
|
+
description: import_mini45.z.string(),
|
|
11580
|
+
mode: import_mini45.z._default(import_mini45.z.string(), "subagent"),
|
|
11581
|
+
name: import_mini45.z.optional(import_mini45.z.string())
|
|
11330
11582
|
});
|
|
11331
11583
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
11332
11584
|
frontmatter;
|
|
@@ -11336,7 +11588,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11336
11588
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
11337
11589
|
if (!result.success) {
|
|
11338
11590
|
throw new Error(
|
|
11339
|
-
`Invalid frontmatter in ${(0,
|
|
11591
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11340
11592
|
);
|
|
11341
11593
|
}
|
|
11342
11594
|
}
|
|
@@ -11350,7 +11602,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11350
11602
|
global = false
|
|
11351
11603
|
} = {}) {
|
|
11352
11604
|
return {
|
|
11353
|
-
relativeDirPath: global ? (0,
|
|
11605
|
+
relativeDirPath: global ? (0, import_node_path87.join)(".config", "opencode", "agent") : (0, import_node_path87.join)(".opencode", "agent")
|
|
11354
11606
|
};
|
|
11355
11607
|
}
|
|
11356
11608
|
getFrontmatter() {
|
|
@@ -11363,7 +11615,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11363
11615
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
11364
11616
|
const rulesyncFrontmatter = {
|
|
11365
11617
|
targets: ["*"],
|
|
11366
|
-
name: name ?? (0,
|
|
11618
|
+
name: name ?? (0, import_node_path87.basename)(this.getRelativeFilePath(), ".md"),
|
|
11367
11619
|
description,
|
|
11368
11620
|
opencode: { mode, ...opencodeSection }
|
|
11369
11621
|
};
|
|
@@ -11416,7 +11668,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11416
11668
|
return {
|
|
11417
11669
|
success: false,
|
|
11418
11670
|
error: new Error(
|
|
11419
|
-
`Invalid frontmatter in ${(0,
|
|
11671
|
+
`Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11420
11672
|
)
|
|
11421
11673
|
};
|
|
11422
11674
|
}
|
|
@@ -11433,7 +11685,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
11433
11685
|
global = false
|
|
11434
11686
|
}) {
|
|
11435
11687
|
const paths = this.getSettablePaths({ global });
|
|
11436
|
-
const filePath = (0,
|
|
11688
|
+
const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
11437
11689
|
const fileContent = await readFileContent(filePath);
|
|
11438
11690
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
11439
11691
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -11482,7 +11734,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
11482
11734
|
"opencode",
|
|
11483
11735
|
"roo"
|
|
11484
11736
|
];
|
|
11485
|
-
var SubagentsProcessorToolTargetSchema =
|
|
11737
|
+
var SubagentsProcessorToolTargetSchema = import_mini46.z.enum(subagentsProcessorToolTargetTuple);
|
|
11486
11738
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
11487
11739
|
[
|
|
11488
11740
|
"agentsmd",
|
|
@@ -11644,7 +11896,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11644
11896
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
11645
11897
|
*/
|
|
11646
11898
|
async loadRulesyncFiles() {
|
|
11647
|
-
const subagentsDir = (0,
|
|
11899
|
+
const subagentsDir = (0, import_node_path88.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
11648
11900
|
const dirExists = await directoryExists(subagentsDir);
|
|
11649
11901
|
if (!dirExists) {
|
|
11650
11902
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -11659,7 +11911,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11659
11911
|
logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
11660
11912
|
const rulesyncSubagents = [];
|
|
11661
11913
|
for (const mdFile of mdFiles) {
|
|
11662
|
-
const filepath = (0,
|
|
11914
|
+
const filepath = (0, import_node_path88.join)(subagentsDir, mdFile);
|
|
11663
11915
|
try {
|
|
11664
11916
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
11665
11917
|
relativeFilePath: mdFile,
|
|
@@ -11689,14 +11941,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11689
11941
|
const factory = this.getFactory(this.toolTarget);
|
|
11690
11942
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
11691
11943
|
const subagentFilePaths = await findFilesByGlobs(
|
|
11692
|
-
(0,
|
|
11944
|
+
(0, import_node_path88.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
11693
11945
|
);
|
|
11694
11946
|
if (forDeletion) {
|
|
11695
11947
|
const toolSubagents2 = subagentFilePaths.map(
|
|
11696
11948
|
(path3) => factory.class.forDeletion({
|
|
11697
11949
|
baseDir: this.baseDir,
|
|
11698
11950
|
relativeDirPath: paths.relativeDirPath,
|
|
11699
|
-
relativeFilePath: (0,
|
|
11951
|
+
relativeFilePath: (0, import_node_path88.basename)(path3),
|
|
11700
11952
|
global: this.global
|
|
11701
11953
|
})
|
|
11702
11954
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -11709,7 +11961,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11709
11961
|
subagentFilePaths.map(
|
|
11710
11962
|
(path3) => factory.class.fromFile({
|
|
11711
11963
|
baseDir: this.baseDir,
|
|
11712
|
-
relativeFilePath: (0,
|
|
11964
|
+
relativeFilePath: (0, import_node_path88.basename)(path3),
|
|
11713
11965
|
global: this.global
|
|
11714
11966
|
})
|
|
11715
11967
|
)
|
|
@@ -11754,49 +12006,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
11754
12006
|
};
|
|
11755
12007
|
|
|
11756
12008
|
// src/features/rules/agentsmd-rule.ts
|
|
11757
|
-
var
|
|
12009
|
+
var import_node_path91 = require("path");
|
|
11758
12010
|
|
|
11759
12011
|
// src/features/rules/tool-rule.ts
|
|
11760
|
-
var
|
|
12012
|
+
var import_node_path90 = require("path");
|
|
11761
12013
|
|
|
11762
12014
|
// src/features/rules/rulesync-rule.ts
|
|
11763
|
-
var
|
|
11764
|
-
var
|
|
11765
|
-
var RulesyncRuleFrontmatterSchema =
|
|
11766
|
-
root:
|
|
11767
|
-
localRoot:
|
|
11768
|
-
targets:
|
|
11769
|
-
description:
|
|
11770
|
-
globs:
|
|
11771
|
-
agentsmd:
|
|
11772
|
-
|
|
12015
|
+
var import_node_path89 = require("path");
|
|
12016
|
+
var import_mini47 = require("zod/mini");
|
|
12017
|
+
var RulesyncRuleFrontmatterSchema = import_mini47.z.object({
|
|
12018
|
+
root: import_mini47.z.optional(import_mini47.z.boolean()),
|
|
12019
|
+
localRoot: import_mini47.z.optional(import_mini47.z.boolean()),
|
|
12020
|
+
targets: import_mini47.z._default(RulesyncTargetsSchema, ["*"]),
|
|
12021
|
+
description: import_mini47.z.optional(import_mini47.z.string()),
|
|
12022
|
+
globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string())),
|
|
12023
|
+
agentsmd: import_mini47.z.optional(
|
|
12024
|
+
import_mini47.z.object({
|
|
11773
12025
|
// @example "path/to/subproject"
|
|
11774
|
-
subprojectPath:
|
|
12026
|
+
subprojectPath: import_mini47.z.optional(import_mini47.z.string())
|
|
11775
12027
|
})
|
|
11776
12028
|
),
|
|
11777
|
-
claudecode:
|
|
11778
|
-
|
|
12029
|
+
claudecode: import_mini47.z.optional(
|
|
12030
|
+
import_mini47.z.object({
|
|
11779
12031
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
11780
12032
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
11781
|
-
paths:
|
|
12033
|
+
paths: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
|
|
11782
12034
|
})
|
|
11783
12035
|
),
|
|
11784
|
-
cursor:
|
|
11785
|
-
|
|
11786
|
-
alwaysApply:
|
|
11787
|
-
description:
|
|
11788
|
-
globs:
|
|
12036
|
+
cursor: import_mini47.z.optional(
|
|
12037
|
+
import_mini47.z.object({
|
|
12038
|
+
alwaysApply: import_mini47.z.optional(import_mini47.z.boolean()),
|
|
12039
|
+
description: import_mini47.z.optional(import_mini47.z.string()),
|
|
12040
|
+
globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
|
|
11789
12041
|
})
|
|
11790
12042
|
),
|
|
11791
|
-
copilot:
|
|
11792
|
-
|
|
11793
|
-
excludeAgent:
|
|
12043
|
+
copilot: import_mini47.z.optional(
|
|
12044
|
+
import_mini47.z.object({
|
|
12045
|
+
excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
|
|
11794
12046
|
})
|
|
11795
12047
|
),
|
|
11796
|
-
antigravity:
|
|
11797
|
-
|
|
11798
|
-
trigger:
|
|
11799
|
-
globs:
|
|
12048
|
+
antigravity: import_mini47.z.optional(
|
|
12049
|
+
import_mini47.z.looseObject({
|
|
12050
|
+
trigger: import_mini47.z.optional(import_mini47.z.string()),
|
|
12051
|
+
globs: import_mini47.z.optional(import_mini47.z.array(import_mini47.z.string()))
|
|
11800
12052
|
})
|
|
11801
12053
|
)
|
|
11802
12054
|
});
|
|
@@ -11807,7 +12059,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11807
12059
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11808
12060
|
if (!parseResult.success && rest.validate !== false) {
|
|
11809
12061
|
throw new Error(
|
|
11810
|
-
`Invalid frontmatter in ${(0,
|
|
12062
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
11811
12063
|
);
|
|
11812
12064
|
}
|
|
11813
12065
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -11842,7 +12094,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11842
12094
|
return {
|
|
11843
12095
|
success: false,
|
|
11844
12096
|
error: new Error(
|
|
11845
|
-
`Invalid frontmatter in ${(0,
|
|
12097
|
+
`Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11846
12098
|
)
|
|
11847
12099
|
};
|
|
11848
12100
|
}
|
|
@@ -11851,7 +12103,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
11851
12103
|
relativeFilePath,
|
|
11852
12104
|
validate = true
|
|
11853
12105
|
}) {
|
|
11854
|
-
const filePath = (0,
|
|
12106
|
+
const filePath = (0, import_node_path89.join)(
|
|
11855
12107
|
process.cwd(),
|
|
11856
12108
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
11857
12109
|
relativeFilePath
|
|
@@ -11953,7 +12205,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11953
12205
|
rulesyncRule,
|
|
11954
12206
|
validate = true,
|
|
11955
12207
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
11956
|
-
nonRootPath = { relativeDirPath: (0,
|
|
12208
|
+
nonRootPath = { relativeDirPath: (0, import_node_path90.join)(".agents", "memories") }
|
|
11957
12209
|
}) {
|
|
11958
12210
|
const params = this.buildToolRuleParamsDefault({
|
|
11959
12211
|
baseDir,
|
|
@@ -11964,7 +12216,7 @@ var ToolRule = class extends ToolFile {
|
|
|
11964
12216
|
});
|
|
11965
12217
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
11966
12218
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
11967
|
-
params.relativeDirPath = (0,
|
|
12219
|
+
params.relativeDirPath = (0, import_node_path90.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
11968
12220
|
params.relativeFilePath = "AGENTS.md";
|
|
11969
12221
|
}
|
|
11970
12222
|
return params;
|
|
@@ -12013,7 +12265,7 @@ var ToolRule = class extends ToolFile {
|
|
|
12013
12265
|
}
|
|
12014
12266
|
};
|
|
12015
12267
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
12016
|
-
return excludeToolDir ? subDir : (0,
|
|
12268
|
+
return excludeToolDir ? subDir : (0, import_node_path90.join)(toolDir, subDir);
|
|
12017
12269
|
}
|
|
12018
12270
|
|
|
12019
12271
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -12042,8 +12294,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12042
12294
|
validate = true
|
|
12043
12295
|
}) {
|
|
12044
12296
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
12045
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
12046
|
-
const fileContent = await readFileContent((0,
|
|
12297
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path91.join)(".agents", "memories", relativeFilePath);
|
|
12298
|
+
const fileContent = await readFileContent((0, import_node_path91.join)(baseDir, relativePath));
|
|
12047
12299
|
return new _AgentsMdRule({
|
|
12048
12300
|
baseDir,
|
|
12049
12301
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -12098,21 +12350,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
12098
12350
|
};
|
|
12099
12351
|
|
|
12100
12352
|
// src/features/rules/antigravity-rule.ts
|
|
12101
|
-
var
|
|
12102
|
-
var
|
|
12103
|
-
var AntigravityRuleFrontmatterSchema =
|
|
12104
|
-
trigger:
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12353
|
+
var import_node_path92 = require("path");
|
|
12354
|
+
var import_mini48 = require("zod/mini");
|
|
12355
|
+
var AntigravityRuleFrontmatterSchema = import_mini48.z.looseObject({
|
|
12356
|
+
trigger: import_mini48.z.optional(
|
|
12357
|
+
import_mini48.z.union([
|
|
12358
|
+
import_mini48.z.literal("always_on"),
|
|
12359
|
+
import_mini48.z.literal("glob"),
|
|
12360
|
+
import_mini48.z.literal("manual"),
|
|
12361
|
+
import_mini48.z.literal("model_decision"),
|
|
12362
|
+
import_mini48.z.string()
|
|
12111
12363
|
// accepts any string for forward compatibility
|
|
12112
12364
|
])
|
|
12113
12365
|
),
|
|
12114
|
-
globs:
|
|
12115
|
-
description:
|
|
12366
|
+
globs: import_mini48.z.optional(import_mini48.z.string()),
|
|
12367
|
+
description: import_mini48.z.optional(import_mini48.z.string())
|
|
12116
12368
|
});
|
|
12117
12369
|
function parseGlobsString(globs) {
|
|
12118
12370
|
if (!globs) {
|
|
@@ -12257,7 +12509,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12257
12509
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12258
12510
|
if (!result.success) {
|
|
12259
12511
|
throw new Error(
|
|
12260
|
-
`Invalid frontmatter in ${(0,
|
|
12512
|
+
`Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12261
12513
|
);
|
|
12262
12514
|
}
|
|
12263
12515
|
}
|
|
@@ -12281,7 +12533,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12281
12533
|
relativeFilePath,
|
|
12282
12534
|
validate = true
|
|
12283
12535
|
}) {
|
|
12284
|
-
const filePath = (0,
|
|
12536
|
+
const filePath = (0, import_node_path92.join)(
|
|
12285
12537
|
baseDir,
|
|
12286
12538
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12287
12539
|
relativeFilePath
|
|
@@ -12422,7 +12674,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
12422
12674
|
};
|
|
12423
12675
|
|
|
12424
12676
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
12425
|
-
var
|
|
12677
|
+
var import_node_path93 = require("path");
|
|
12426
12678
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
12427
12679
|
toRulesyncRule() {
|
|
12428
12680
|
const rulesyncFrontmatter = {
|
|
@@ -12483,8 +12735,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12483
12735
|
}) {
|
|
12484
12736
|
const settablePaths = this.getSettablePaths();
|
|
12485
12737
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
12486
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
12487
|
-
const fileContent = await readFileContent((0,
|
|
12738
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path93.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12739
|
+
const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
|
|
12488
12740
|
return new _AugmentcodeLegacyRule({
|
|
12489
12741
|
baseDir,
|
|
12490
12742
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -12513,7 +12765,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
12513
12765
|
};
|
|
12514
12766
|
|
|
12515
12767
|
// src/features/rules/augmentcode-rule.ts
|
|
12516
|
-
var
|
|
12768
|
+
var import_node_path94 = require("path");
|
|
12517
12769
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
12518
12770
|
toRulesyncRule() {
|
|
12519
12771
|
return this.toRulesyncRuleDefault();
|
|
@@ -12544,7 +12796,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12544
12796
|
relativeFilePath,
|
|
12545
12797
|
validate = true
|
|
12546
12798
|
}) {
|
|
12547
|
-
const filePath = (0,
|
|
12799
|
+
const filePath = (0, import_node_path94.join)(
|
|
12548
12800
|
baseDir,
|
|
12549
12801
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
12550
12802
|
relativeFilePath
|
|
@@ -12584,7 +12836,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
12584
12836
|
};
|
|
12585
12837
|
|
|
12586
12838
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
12587
|
-
var
|
|
12839
|
+
var import_node_path95 = require("path");
|
|
12588
12840
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
12589
12841
|
static getSettablePaths({
|
|
12590
12842
|
global,
|
|
@@ -12619,7 +12871,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12619
12871
|
if (isRoot) {
|
|
12620
12872
|
const relativePath2 = paths.root.relativeFilePath;
|
|
12621
12873
|
const fileContent2 = await readFileContent(
|
|
12622
|
-
(0,
|
|
12874
|
+
(0, import_node_path95.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
12623
12875
|
);
|
|
12624
12876
|
return new _ClaudecodeLegacyRule({
|
|
12625
12877
|
baseDir,
|
|
@@ -12633,8 +12885,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12633
12885
|
if (!paths.nonRoot) {
|
|
12634
12886
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12635
12887
|
}
|
|
12636
|
-
const relativePath = (0,
|
|
12637
|
-
const fileContent = await readFileContent((0,
|
|
12888
|
+
const relativePath = (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
12889
|
+
const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
|
|
12638
12890
|
return new _ClaudecodeLegacyRule({
|
|
12639
12891
|
baseDir,
|
|
12640
12892
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -12693,10 +12945,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
12693
12945
|
};
|
|
12694
12946
|
|
|
12695
12947
|
// src/features/rules/claudecode-rule.ts
|
|
12696
|
-
var
|
|
12697
|
-
var
|
|
12698
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
12699
|
-
paths:
|
|
12948
|
+
var import_node_path96 = require("path");
|
|
12949
|
+
var import_mini49 = require("zod/mini");
|
|
12950
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini49.z.object({
|
|
12951
|
+
paths: import_mini49.z.optional(import_mini49.z.array(import_mini49.z.string()))
|
|
12700
12952
|
});
|
|
12701
12953
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
12702
12954
|
frontmatter;
|
|
@@ -12728,7 +12980,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12728
12980
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12729
12981
|
if (!result.success) {
|
|
12730
12982
|
throw new Error(
|
|
12731
|
-
`Invalid frontmatter in ${(0,
|
|
12983
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
12732
12984
|
);
|
|
12733
12985
|
}
|
|
12734
12986
|
}
|
|
@@ -12756,7 +13008,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12756
13008
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
12757
13009
|
if (isRoot) {
|
|
12758
13010
|
const fileContent2 = await readFileContent(
|
|
12759
|
-
(0,
|
|
13011
|
+
(0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
12760
13012
|
);
|
|
12761
13013
|
return new _ClaudecodeRule({
|
|
12762
13014
|
baseDir,
|
|
@@ -12771,16 +13023,16 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12771
13023
|
if (!paths.nonRoot) {
|
|
12772
13024
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
12773
13025
|
}
|
|
12774
|
-
const relativePath = (0,
|
|
12775
|
-
const fileContent = await readFileContent((0,
|
|
13026
|
+
const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13027
|
+
const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
|
|
12776
13028
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
12777
13029
|
fileContent,
|
|
12778
|
-
(0,
|
|
13030
|
+
(0, import_node_path96.join)(baseDir, relativePath)
|
|
12779
13031
|
);
|
|
12780
13032
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
12781
13033
|
if (!result.success) {
|
|
12782
13034
|
throw new Error(
|
|
12783
|
-
`Invalid frontmatter in ${(0,
|
|
13035
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
12784
13036
|
);
|
|
12785
13037
|
}
|
|
12786
13038
|
return new _ClaudecodeRule({
|
|
@@ -12887,7 +13139,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12887
13139
|
return {
|
|
12888
13140
|
success: false,
|
|
12889
13141
|
error: new Error(
|
|
12890
|
-
`Invalid frontmatter in ${(0,
|
|
13142
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
12891
13143
|
)
|
|
12892
13144
|
};
|
|
12893
13145
|
}
|
|
@@ -12907,10 +13159,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
12907
13159
|
};
|
|
12908
13160
|
|
|
12909
13161
|
// src/features/rules/cline-rule.ts
|
|
12910
|
-
var
|
|
12911
|
-
var
|
|
12912
|
-
var ClineRuleFrontmatterSchema =
|
|
12913
|
-
description:
|
|
13162
|
+
var import_node_path97 = require("path");
|
|
13163
|
+
var import_mini50 = require("zod/mini");
|
|
13164
|
+
var ClineRuleFrontmatterSchema = import_mini50.z.object({
|
|
13165
|
+
description: import_mini50.z.string()
|
|
12914
13166
|
});
|
|
12915
13167
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
12916
13168
|
static getSettablePaths(_options = {}) {
|
|
@@ -12953,7 +13205,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12953
13205
|
validate = true
|
|
12954
13206
|
}) {
|
|
12955
13207
|
const fileContent = await readFileContent(
|
|
12956
|
-
(0,
|
|
13208
|
+
(0, import_node_path97.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12957
13209
|
);
|
|
12958
13210
|
return new _ClineRule({
|
|
12959
13211
|
baseDir,
|
|
@@ -12979,7 +13231,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
12979
13231
|
};
|
|
12980
13232
|
|
|
12981
13233
|
// src/features/rules/codexcli-rule.ts
|
|
12982
|
-
var
|
|
13234
|
+
var import_node_path98 = require("path");
|
|
12983
13235
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
12984
13236
|
static getSettablePaths({
|
|
12985
13237
|
global,
|
|
@@ -13014,7 +13266,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13014
13266
|
if (isRoot) {
|
|
13015
13267
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13016
13268
|
const fileContent2 = await readFileContent(
|
|
13017
|
-
(0,
|
|
13269
|
+
(0, import_node_path98.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13018
13270
|
);
|
|
13019
13271
|
return new _CodexcliRule({
|
|
13020
13272
|
baseDir,
|
|
@@ -13028,8 +13280,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13028
13280
|
if (!paths.nonRoot) {
|
|
13029
13281
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13030
13282
|
}
|
|
13031
|
-
const relativePath = (0,
|
|
13032
|
-
const fileContent = await readFileContent((0,
|
|
13283
|
+
const relativePath = (0, import_node_path98.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13284
|
+
const fileContent = await readFileContent((0, import_node_path98.join)(baseDir, relativePath));
|
|
13033
13285
|
return new _CodexcliRule({
|
|
13034
13286
|
baseDir,
|
|
13035
13287
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13088,12 +13340,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
13088
13340
|
};
|
|
13089
13341
|
|
|
13090
13342
|
// src/features/rules/copilot-rule.ts
|
|
13091
|
-
var
|
|
13092
|
-
var
|
|
13093
|
-
var CopilotRuleFrontmatterSchema =
|
|
13094
|
-
description:
|
|
13095
|
-
applyTo:
|
|
13096
|
-
excludeAgent:
|
|
13343
|
+
var import_node_path99 = require("path");
|
|
13344
|
+
var import_mini51 = require("zod/mini");
|
|
13345
|
+
var CopilotRuleFrontmatterSchema = import_mini51.z.object({
|
|
13346
|
+
description: import_mini51.z.optional(import_mini51.z.string()),
|
|
13347
|
+
applyTo: import_mini51.z.optional(import_mini51.z.string()),
|
|
13348
|
+
excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
|
|
13097
13349
|
});
|
|
13098
13350
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
13099
13351
|
frontmatter;
|
|
@@ -13122,7 +13374,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13122
13374
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13123
13375
|
if (!result.success) {
|
|
13124
13376
|
throw new Error(
|
|
13125
|
-
`Invalid frontmatter in ${(0,
|
|
13377
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13126
13378
|
);
|
|
13127
13379
|
}
|
|
13128
13380
|
}
|
|
@@ -13212,8 +13464,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13212
13464
|
const paths = this.getSettablePaths({ global });
|
|
13213
13465
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13214
13466
|
if (isRoot) {
|
|
13215
|
-
const relativePath2 = (0,
|
|
13216
|
-
const fileContent2 = await readFileContent((0,
|
|
13467
|
+
const relativePath2 = (0, import_node_path99.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13468
|
+
const fileContent2 = await readFileContent((0, import_node_path99.join)(baseDir, relativePath2));
|
|
13217
13469
|
return new _CopilotRule({
|
|
13218
13470
|
baseDir,
|
|
13219
13471
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13227,16 +13479,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13227
13479
|
if (!paths.nonRoot) {
|
|
13228
13480
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13229
13481
|
}
|
|
13230
|
-
const relativePath = (0,
|
|
13231
|
-
const fileContent = await readFileContent((0,
|
|
13482
|
+
const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13483
|
+
const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
|
|
13232
13484
|
const { frontmatter, body: content } = parseFrontmatter(
|
|
13233
13485
|
fileContent,
|
|
13234
|
-
(0,
|
|
13486
|
+
(0, import_node_path99.join)(baseDir, relativePath)
|
|
13235
13487
|
);
|
|
13236
13488
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13237
13489
|
if (!result.success) {
|
|
13238
13490
|
throw new Error(
|
|
13239
|
-
`Invalid frontmatter in ${(0,
|
|
13491
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13240
13492
|
);
|
|
13241
13493
|
}
|
|
13242
13494
|
return new _CopilotRule({
|
|
@@ -13278,7 +13530,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13278
13530
|
return {
|
|
13279
13531
|
success: false,
|
|
13280
13532
|
error: new Error(
|
|
13281
|
-
`Invalid frontmatter in ${(0,
|
|
13533
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13282
13534
|
)
|
|
13283
13535
|
};
|
|
13284
13536
|
}
|
|
@@ -13298,12 +13550,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
13298
13550
|
};
|
|
13299
13551
|
|
|
13300
13552
|
// src/features/rules/cursor-rule.ts
|
|
13301
|
-
var
|
|
13302
|
-
var
|
|
13303
|
-
var CursorRuleFrontmatterSchema =
|
|
13304
|
-
description:
|
|
13305
|
-
globs:
|
|
13306
|
-
alwaysApply:
|
|
13553
|
+
var import_node_path100 = require("path");
|
|
13554
|
+
var import_mini52 = require("zod/mini");
|
|
13555
|
+
var CursorRuleFrontmatterSchema = import_mini52.z.object({
|
|
13556
|
+
description: import_mini52.z.optional(import_mini52.z.string()),
|
|
13557
|
+
globs: import_mini52.z.optional(import_mini52.z.string()),
|
|
13558
|
+
alwaysApply: import_mini52.z.optional(import_mini52.z.boolean())
|
|
13307
13559
|
});
|
|
13308
13560
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
13309
13561
|
frontmatter;
|
|
@@ -13320,7 +13572,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13320
13572
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13321
13573
|
if (!result.success) {
|
|
13322
13574
|
throw new Error(
|
|
13323
|
-
`Invalid frontmatter in ${(0,
|
|
13575
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
13324
13576
|
);
|
|
13325
13577
|
}
|
|
13326
13578
|
}
|
|
@@ -13436,7 +13688,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13436
13688
|
relativeFilePath,
|
|
13437
13689
|
validate = true
|
|
13438
13690
|
}) {
|
|
13439
|
-
const filePath = (0,
|
|
13691
|
+
const filePath = (0, import_node_path100.join)(
|
|
13440
13692
|
baseDir,
|
|
13441
13693
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
13442
13694
|
relativeFilePath
|
|
@@ -13446,7 +13698,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13446
13698
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
13447
13699
|
if (!result.success) {
|
|
13448
13700
|
throw new Error(
|
|
13449
|
-
`Invalid frontmatter in ${(0,
|
|
13701
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
13450
13702
|
);
|
|
13451
13703
|
}
|
|
13452
13704
|
return new _CursorRule({
|
|
@@ -13483,7 +13735,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13483
13735
|
return {
|
|
13484
13736
|
success: false,
|
|
13485
13737
|
error: new Error(
|
|
13486
|
-
`Invalid frontmatter in ${(0,
|
|
13738
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
13487
13739
|
)
|
|
13488
13740
|
};
|
|
13489
13741
|
}
|
|
@@ -13503,7 +13755,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
13503
13755
|
};
|
|
13504
13756
|
|
|
13505
13757
|
// src/features/rules/factorydroid-rule.ts
|
|
13506
|
-
var
|
|
13758
|
+
var import_node_path101 = require("path");
|
|
13507
13759
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
13508
13760
|
constructor({ fileContent, root, ...rest }) {
|
|
13509
13761
|
super({
|
|
@@ -13543,8 +13795,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13543
13795
|
const paths = this.getSettablePaths({ global });
|
|
13544
13796
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
13545
13797
|
if (isRoot) {
|
|
13546
|
-
const relativePath2 = (0,
|
|
13547
|
-
const fileContent2 = await readFileContent((0,
|
|
13798
|
+
const relativePath2 = (0, import_node_path101.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
13799
|
+
const fileContent2 = await readFileContent((0, import_node_path101.join)(baseDir, relativePath2));
|
|
13548
13800
|
return new _FactorydroidRule({
|
|
13549
13801
|
baseDir,
|
|
13550
13802
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -13557,8 +13809,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13557
13809
|
if (!paths.nonRoot) {
|
|
13558
13810
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13559
13811
|
}
|
|
13560
|
-
const relativePath = (0,
|
|
13561
|
-
const fileContent = await readFileContent((0,
|
|
13812
|
+
const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13813
|
+
const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
|
|
13562
13814
|
return new _FactorydroidRule({
|
|
13563
13815
|
baseDir,
|
|
13564
13816
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13617,7 +13869,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
13617
13869
|
};
|
|
13618
13870
|
|
|
13619
13871
|
// src/features/rules/geminicli-rule.ts
|
|
13620
|
-
var
|
|
13872
|
+
var import_node_path102 = require("path");
|
|
13621
13873
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
13622
13874
|
static getSettablePaths({
|
|
13623
13875
|
global,
|
|
@@ -13652,7 +13904,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13652
13904
|
if (isRoot) {
|
|
13653
13905
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13654
13906
|
const fileContent2 = await readFileContent(
|
|
13655
|
-
(0,
|
|
13907
|
+
(0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13656
13908
|
);
|
|
13657
13909
|
return new _GeminiCliRule({
|
|
13658
13910
|
baseDir,
|
|
@@ -13666,8 +13918,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13666
13918
|
if (!paths.nonRoot) {
|
|
13667
13919
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13668
13920
|
}
|
|
13669
|
-
const relativePath = (0,
|
|
13670
|
-
const fileContent = await readFileContent((0,
|
|
13921
|
+
const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
13922
|
+
const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
|
|
13671
13923
|
return new _GeminiCliRule({
|
|
13672
13924
|
baseDir,
|
|
13673
13925
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13726,7 +13978,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
13726
13978
|
};
|
|
13727
13979
|
|
|
13728
13980
|
// src/features/rules/goose-rule.ts
|
|
13729
|
-
var
|
|
13981
|
+
var import_node_path103 = require("path");
|
|
13730
13982
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
13731
13983
|
static getSettablePaths({
|
|
13732
13984
|
global,
|
|
@@ -13761,7 +14013,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13761
14013
|
if (isRoot) {
|
|
13762
14014
|
const relativePath2 = paths.root.relativeFilePath;
|
|
13763
14015
|
const fileContent2 = await readFileContent(
|
|
13764
|
-
(0,
|
|
14016
|
+
(0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
13765
14017
|
);
|
|
13766
14018
|
return new _GooseRule({
|
|
13767
14019
|
baseDir,
|
|
@@ -13775,8 +14027,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13775
14027
|
if (!paths.nonRoot) {
|
|
13776
14028
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
13777
14029
|
}
|
|
13778
|
-
const relativePath = (0,
|
|
13779
|
-
const fileContent = await readFileContent((0,
|
|
14030
|
+
const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14031
|
+
const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
|
|
13780
14032
|
return new _GooseRule({
|
|
13781
14033
|
baseDir,
|
|
13782
14034
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -13835,7 +14087,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
13835
14087
|
};
|
|
13836
14088
|
|
|
13837
14089
|
// src/features/rules/junie-rule.ts
|
|
13838
|
-
var
|
|
14090
|
+
var import_node_path104 = require("path");
|
|
13839
14091
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
13840
14092
|
static getSettablePaths(_options = {}) {
|
|
13841
14093
|
return {
|
|
@@ -13854,8 +14106,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13854
14106
|
validate = true
|
|
13855
14107
|
}) {
|
|
13856
14108
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
13857
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
13858
|
-
const fileContent = await readFileContent((0,
|
|
14109
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path104.join)(".junie", "memories", relativeFilePath);
|
|
14110
|
+
const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
|
|
13859
14111
|
return new _JunieRule({
|
|
13860
14112
|
baseDir,
|
|
13861
14113
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -13910,7 +14162,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
13910
14162
|
};
|
|
13911
14163
|
|
|
13912
14164
|
// src/features/rules/kilo-rule.ts
|
|
13913
|
-
var
|
|
14165
|
+
var import_node_path105 = require("path");
|
|
13914
14166
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
13915
14167
|
static getSettablePaths(_options = {}) {
|
|
13916
14168
|
return {
|
|
@@ -13925,7 +14177,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13925
14177
|
validate = true
|
|
13926
14178
|
}) {
|
|
13927
14179
|
const fileContent = await readFileContent(
|
|
13928
|
-
(0,
|
|
14180
|
+
(0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13929
14181
|
);
|
|
13930
14182
|
return new _KiloRule({
|
|
13931
14183
|
baseDir,
|
|
@@ -13977,7 +14229,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
13977
14229
|
};
|
|
13978
14230
|
|
|
13979
14231
|
// src/features/rules/kiro-rule.ts
|
|
13980
|
-
var
|
|
14232
|
+
var import_node_path106 = require("path");
|
|
13981
14233
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
13982
14234
|
static getSettablePaths(_options = {}) {
|
|
13983
14235
|
return {
|
|
@@ -13992,7 +14244,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
13992
14244
|
validate = true
|
|
13993
14245
|
}) {
|
|
13994
14246
|
const fileContent = await readFileContent(
|
|
13995
|
-
(0,
|
|
14247
|
+
(0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
13996
14248
|
);
|
|
13997
14249
|
return new _KiroRule({
|
|
13998
14250
|
baseDir,
|
|
@@ -14046,7 +14298,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
14046
14298
|
};
|
|
14047
14299
|
|
|
14048
14300
|
// src/features/rules/opencode-rule.ts
|
|
14049
|
-
var
|
|
14301
|
+
var import_node_path107 = require("path");
|
|
14050
14302
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
14051
14303
|
static getSettablePaths({
|
|
14052
14304
|
global,
|
|
@@ -14081,7 +14333,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14081
14333
|
if (isRoot) {
|
|
14082
14334
|
const relativePath2 = paths.root.relativeFilePath;
|
|
14083
14335
|
const fileContent2 = await readFileContent(
|
|
14084
|
-
(0,
|
|
14336
|
+
(0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
14085
14337
|
);
|
|
14086
14338
|
return new _OpenCodeRule({
|
|
14087
14339
|
baseDir,
|
|
@@ -14095,8 +14347,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14095
14347
|
if (!paths.nonRoot) {
|
|
14096
14348
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
14097
14349
|
}
|
|
14098
|
-
const relativePath = (0,
|
|
14099
|
-
const fileContent = await readFileContent((0,
|
|
14350
|
+
const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
14351
|
+
const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
|
|
14100
14352
|
return new _OpenCodeRule({
|
|
14101
14353
|
baseDir,
|
|
14102
14354
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -14155,7 +14407,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
14155
14407
|
};
|
|
14156
14408
|
|
|
14157
14409
|
// src/features/rules/qwencode-rule.ts
|
|
14158
|
-
var
|
|
14410
|
+
var import_node_path108 = require("path");
|
|
14159
14411
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
14160
14412
|
static getSettablePaths(_options = {}) {
|
|
14161
14413
|
return {
|
|
@@ -14174,8 +14426,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14174
14426
|
validate = true
|
|
14175
14427
|
}) {
|
|
14176
14428
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
14177
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
14178
|
-
const fileContent = await readFileContent((0,
|
|
14429
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path108.join)(".qwen", "memories", relativeFilePath);
|
|
14430
|
+
const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
|
|
14179
14431
|
return new _QwencodeRule({
|
|
14180
14432
|
baseDir,
|
|
14181
14433
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -14227,7 +14479,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
14227
14479
|
};
|
|
14228
14480
|
|
|
14229
14481
|
// src/features/rules/replit-rule.ts
|
|
14230
|
-
var
|
|
14482
|
+
var import_node_path109 = require("path");
|
|
14231
14483
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
14232
14484
|
static getSettablePaths(_options = {}) {
|
|
14233
14485
|
return {
|
|
@@ -14249,7 +14501,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14249
14501
|
}
|
|
14250
14502
|
const relativePath = paths.root.relativeFilePath;
|
|
14251
14503
|
const fileContent = await readFileContent(
|
|
14252
|
-
(0,
|
|
14504
|
+
(0, import_node_path109.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
14253
14505
|
);
|
|
14254
14506
|
return new _ReplitRule({
|
|
14255
14507
|
baseDir,
|
|
@@ -14315,7 +14567,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
14315
14567
|
};
|
|
14316
14568
|
|
|
14317
14569
|
// src/features/rules/roo-rule.ts
|
|
14318
|
-
var
|
|
14570
|
+
var import_node_path110 = require("path");
|
|
14319
14571
|
var RooRule = class _RooRule extends ToolRule {
|
|
14320
14572
|
static getSettablePaths(_options = {}) {
|
|
14321
14573
|
return {
|
|
@@ -14330,7 +14582,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14330
14582
|
validate = true
|
|
14331
14583
|
}) {
|
|
14332
14584
|
const fileContent = await readFileContent(
|
|
14333
|
-
(0,
|
|
14585
|
+
(0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14334
14586
|
);
|
|
14335
14587
|
return new _RooRule({
|
|
14336
14588
|
baseDir,
|
|
@@ -14399,7 +14651,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
14399
14651
|
};
|
|
14400
14652
|
|
|
14401
14653
|
// src/features/rules/warp-rule.ts
|
|
14402
|
-
var
|
|
14654
|
+
var import_node_path111 = require("path");
|
|
14403
14655
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
14404
14656
|
constructor({ fileContent, root, ...rest }) {
|
|
14405
14657
|
super({
|
|
@@ -14425,8 +14677,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14425
14677
|
validate = true
|
|
14426
14678
|
}) {
|
|
14427
14679
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
14428
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
14429
|
-
const fileContent = await readFileContent((0,
|
|
14680
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path111.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
14681
|
+
const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
|
|
14430
14682
|
return new _WarpRule({
|
|
14431
14683
|
baseDir,
|
|
14432
14684
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -14481,7 +14733,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
14481
14733
|
};
|
|
14482
14734
|
|
|
14483
14735
|
// src/features/rules/windsurf-rule.ts
|
|
14484
|
-
var
|
|
14736
|
+
var import_node_path112 = require("path");
|
|
14485
14737
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
14486
14738
|
static getSettablePaths(_options = {}) {
|
|
14487
14739
|
return {
|
|
@@ -14496,7 +14748,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
14496
14748
|
validate = true
|
|
14497
14749
|
}) {
|
|
14498
14750
|
const fileContent = await readFileContent(
|
|
14499
|
-
(0,
|
|
14751
|
+
(0, import_node_path112.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
14500
14752
|
);
|
|
14501
14753
|
return new _WindsurfRule({
|
|
14502
14754
|
baseDir,
|
|
@@ -14572,8 +14824,8 @@ var rulesProcessorToolTargets = [
|
|
|
14572
14824
|
"warp",
|
|
14573
14825
|
"windsurf"
|
|
14574
14826
|
];
|
|
14575
|
-
var RulesProcessorToolTargetSchema =
|
|
14576
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
14827
|
+
var RulesProcessorToolTargetSchema = import_mini53.z.enum(rulesProcessorToolTargets);
|
|
14828
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path113.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
14577
14829
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
14578
14830
|
[
|
|
14579
14831
|
"agentsmd",
|
|
@@ -14948,7 +15200,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
14948
15200
|
}).relativeDirPath;
|
|
14949
15201
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
14950
15202
|
const frontmatter = skill.getFrontmatter();
|
|
14951
|
-
const relativePath = (0,
|
|
15203
|
+
const relativePath = (0, import_node_path113.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
14952
15204
|
return {
|
|
14953
15205
|
name: frontmatter.name,
|
|
14954
15206
|
description: frontmatter.description,
|
|
@@ -15061,12 +15313,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15061
15313
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
15062
15314
|
*/
|
|
15063
15315
|
async loadRulesyncFiles() {
|
|
15064
|
-
const rulesyncBaseDir = (0,
|
|
15065
|
-
const files = await findFilesByGlobs((0,
|
|
15316
|
+
const rulesyncBaseDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
15317
|
+
const files = await findFilesByGlobs((0, import_node_path113.join)(rulesyncBaseDir, "**", "*.md"));
|
|
15066
15318
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
15067
15319
|
const rulesyncRules = await Promise.all(
|
|
15068
15320
|
files.map((file) => {
|
|
15069
|
-
const relativeFilePath = (0,
|
|
15321
|
+
const relativeFilePath = (0, import_node_path113.relative)(rulesyncBaseDir, file);
|
|
15070
15322
|
checkPathTraversal({
|
|
15071
15323
|
relativePath: relativeFilePath,
|
|
15072
15324
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -15129,7 +15381,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15129
15381
|
return [];
|
|
15130
15382
|
}
|
|
15131
15383
|
const rootFilePaths = await findFilesByGlobs(
|
|
15132
|
-
(0,
|
|
15384
|
+
(0, import_node_path113.join)(
|
|
15133
15385
|
this.baseDir,
|
|
15134
15386
|
settablePaths.root.relativeDirPath ?? ".",
|
|
15135
15387
|
settablePaths.root.relativeFilePath
|
|
@@ -15140,7 +15392,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15140
15392
|
(filePath) => factory.class.forDeletion({
|
|
15141
15393
|
baseDir: this.baseDir,
|
|
15142
15394
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
15143
|
-
relativeFilePath: (0,
|
|
15395
|
+
relativeFilePath: (0, import_node_path113.basename)(filePath),
|
|
15144
15396
|
global: this.global
|
|
15145
15397
|
})
|
|
15146
15398
|
).filter((rule) => rule.isDeletable());
|
|
@@ -15149,7 +15401,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15149
15401
|
rootFilePaths.map(
|
|
15150
15402
|
(filePath) => factory.class.fromFile({
|
|
15151
15403
|
baseDir: this.baseDir,
|
|
15152
|
-
relativeFilePath: (0,
|
|
15404
|
+
relativeFilePath: (0, import_node_path113.basename)(filePath),
|
|
15153
15405
|
global: this.global
|
|
15154
15406
|
})
|
|
15155
15407
|
)
|
|
@@ -15167,13 +15419,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15167
15419
|
return [];
|
|
15168
15420
|
}
|
|
15169
15421
|
const localRootFilePaths = await findFilesByGlobs(
|
|
15170
|
-
(0,
|
|
15422
|
+
(0, import_node_path113.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
15171
15423
|
);
|
|
15172
15424
|
return localRootFilePaths.map(
|
|
15173
15425
|
(filePath) => factory.class.forDeletion({
|
|
15174
15426
|
baseDir: this.baseDir,
|
|
15175
15427
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
15176
|
-
relativeFilePath: (0,
|
|
15428
|
+
relativeFilePath: (0, import_node_path113.basename)(filePath),
|
|
15177
15429
|
global: this.global
|
|
15178
15430
|
})
|
|
15179
15431
|
).filter((rule) => rule.isDeletable());
|
|
@@ -15183,13 +15435,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15183
15435
|
if (!settablePaths.nonRoot) {
|
|
15184
15436
|
return [];
|
|
15185
15437
|
}
|
|
15186
|
-
const nonRootBaseDir = (0,
|
|
15438
|
+
const nonRootBaseDir = (0, import_node_path113.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
15187
15439
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
15188
|
-
(0,
|
|
15440
|
+
(0, import_node_path113.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
15189
15441
|
);
|
|
15190
15442
|
if (forDeletion) {
|
|
15191
15443
|
return nonRootFilePaths.map((filePath) => {
|
|
15192
|
-
const relativeFilePath = (0,
|
|
15444
|
+
const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
|
|
15193
15445
|
checkPathTraversal({
|
|
15194
15446
|
relativePath: relativeFilePath,
|
|
15195
15447
|
intendedRootDir: nonRootBaseDir
|
|
@@ -15204,7 +15456,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
15204
15456
|
}
|
|
15205
15457
|
return await Promise.all(
|
|
15206
15458
|
nonRootFilePaths.map((filePath) => {
|
|
15207
|
-
const relativeFilePath = (0,
|
|
15459
|
+
const relativeFilePath = (0, import_node_path113.relative)(nonRootBaseDir, filePath);
|
|
15208
15460
|
checkPathTraversal({
|
|
15209
15461
|
relativePath: relativeFilePath,
|
|
15210
15462
|
intendedRootDir: nonRootBaseDir
|
|
@@ -15317,14 +15569,14 @@ s/<command> [arguments]
|
|
|
15317
15569
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
15318
15570
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
15319
15571
|
|
|
15320
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
15572
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
15321
15573
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
15322
15574
|
|
|
15323
15575
|
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.
|
|
15324
15576
|
|
|
15325
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
15577
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
15326
15578
|
|
|
15327
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
15579
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path113.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
15328
15580
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
15329
15581
|
const result = [
|
|
15330
15582
|
overview,
|
|
@@ -15396,7 +15648,7 @@ async function processEmptyFeatureGeneration(params) {
|
|
|
15396
15648
|
return { count: totalCount, paths: [], hasDiff };
|
|
15397
15649
|
}
|
|
15398
15650
|
async function checkRulesyncDirExists(params) {
|
|
15399
|
-
return fileExists((0,
|
|
15651
|
+
return fileExists((0, import_node_path114.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
15400
15652
|
}
|
|
15401
15653
|
async function generate(params) {
|
|
15402
15654
|
const { config } = params;
|