rulesync 8.7.0 → 8.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{chunk-QGQQJNZD.js → chunk-XIMWQREW.js} +1036 -498
- package/dist/cli/index.cjs +1297 -742
- package/dist/cli/index.js +22 -5
- package/dist/index.cjs +1051 -513
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
79
79
|
"replit",
|
|
80
80
|
"roo",
|
|
81
81
|
"rovodev",
|
|
82
|
+
"takt",
|
|
82
83
|
"warp",
|
|
83
84
|
"windsurf",
|
|
84
85
|
"zed"
|
|
@@ -1037,11 +1038,11 @@ var JsonLogger = class extends BaseLogger {
|
|
|
1037
1038
|
};
|
|
1038
1039
|
|
|
1039
1040
|
// src/lib/generate.ts
|
|
1040
|
-
import { join as
|
|
1041
|
+
import { join as join142 } from "path";
|
|
1041
1042
|
import { intersection } from "es-toolkit";
|
|
1042
1043
|
|
|
1043
1044
|
// src/features/commands/commands-processor.ts
|
|
1044
|
-
import { basename as basename2, join as
|
|
1045
|
+
import { basename as basename2, join as join21, relative as relative3 } from "path";
|
|
1045
1046
|
import { z as z15 } from "zod/mini";
|
|
1046
1047
|
|
|
1047
1048
|
// src/utils/content-equivalence.ts
|
|
@@ -1665,7 +1666,12 @@ var RulesyncFile = class extends AiFile {
|
|
|
1665
1666
|
// src/features/commands/rulesync-command.ts
|
|
1666
1667
|
var RulesyncCommandFrontmatterSchema = z5.looseObject({
|
|
1667
1668
|
targets: z5._default(RulesyncTargetsSchema, ["*"]),
|
|
1668
|
-
description: z5.optional(z5.string())
|
|
1669
|
+
description: z5.optional(z5.string()),
|
|
1670
|
+
takt: z5.optional(
|
|
1671
|
+
z5.looseObject({
|
|
1672
|
+
name: z5.optional(z5.string())
|
|
1673
|
+
})
|
|
1674
|
+
)
|
|
1669
1675
|
});
|
|
1670
1676
|
var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
1671
1677
|
frontmatter;
|
|
@@ -3372,6 +3378,124 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
3372
3378
|
}
|
|
3373
3379
|
};
|
|
3374
3380
|
|
|
3381
|
+
// src/features/commands/takt-command.ts
|
|
3382
|
+
import { join as join20 } from "path";
|
|
3383
|
+
|
|
3384
|
+
// src/features/takt-shared.ts
|
|
3385
|
+
var TAKT_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/u;
|
|
3386
|
+
function assertSafeTaktName({
|
|
3387
|
+
name,
|
|
3388
|
+
featureLabel,
|
|
3389
|
+
sourceLabel
|
|
3390
|
+
}) {
|
|
3391
|
+
if (!TAKT_NAME_PATTERN.test(name) || name === "." || name === ".." || name.split(/[.]/u).some((segment) => segment === "..")) {
|
|
3392
|
+
throw new Error(
|
|
3393
|
+
`Invalid takt.name "${name}" for ${featureLabel} "${sourceLabel}": filename stems may not contain path separators or ".." segments.`
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
// src/features/commands/takt-command.ts
|
|
3399
|
+
var DEFAULT_TAKT_COMMAND_DIR = "instructions";
|
|
3400
|
+
var TaktCommand = class _TaktCommand extends ToolCommand {
|
|
3401
|
+
body;
|
|
3402
|
+
constructor({ body, ...rest }) {
|
|
3403
|
+
super({
|
|
3404
|
+
...rest,
|
|
3405
|
+
fileContent: body
|
|
3406
|
+
});
|
|
3407
|
+
this.body = body;
|
|
3408
|
+
}
|
|
3409
|
+
static getSettablePaths(_options = {}) {
|
|
3410
|
+
return {
|
|
3411
|
+
relativeDirPath: join20(".takt", "facets", DEFAULT_TAKT_COMMAND_DIR)
|
|
3412
|
+
};
|
|
3413
|
+
}
|
|
3414
|
+
getBody() {
|
|
3415
|
+
return this.body;
|
|
3416
|
+
}
|
|
3417
|
+
getFrontmatter() {
|
|
3418
|
+
return {};
|
|
3419
|
+
}
|
|
3420
|
+
toRulesyncCommand() {
|
|
3421
|
+
const rulesyncFrontmatter = {
|
|
3422
|
+
targets: ["*"]
|
|
3423
|
+
};
|
|
3424
|
+
return new RulesyncCommand({
|
|
3425
|
+
baseDir: ".",
|
|
3426
|
+
frontmatter: rulesyncFrontmatter,
|
|
3427
|
+
body: this.body,
|
|
3428
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
3429
|
+
relativeFilePath: this.relativeFilePath,
|
|
3430
|
+
fileContent: this.body,
|
|
3431
|
+
validate: true
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
static fromRulesyncCommand({
|
|
3435
|
+
baseDir = process.cwd(),
|
|
3436
|
+
rulesyncCommand,
|
|
3437
|
+
validate = true,
|
|
3438
|
+
global = false
|
|
3439
|
+
}) {
|
|
3440
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
3441
|
+
const taktSection = rulesyncFrontmatter.takt;
|
|
3442
|
+
const sourceLabel = rulesyncCommand.getRelativeFilePath();
|
|
3443
|
+
const overrideName = typeof taktSection?.name === "string" ? taktSection.name : void 0;
|
|
3444
|
+
const sourceStem = rulesyncCommand.getRelativeFilePath().replace(/\.md$/u, "");
|
|
3445
|
+
const stem = overrideName ?? sourceStem;
|
|
3446
|
+
assertSafeTaktName({ name: stem, featureLabel: "command", sourceLabel });
|
|
3447
|
+
const relativeFilePath = `${stem}.md`;
|
|
3448
|
+
const paths = this.getSettablePaths({ global });
|
|
3449
|
+
return new _TaktCommand({
|
|
3450
|
+
baseDir,
|
|
3451
|
+
body: rulesyncCommand.getBody(),
|
|
3452
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3453
|
+
relativeFilePath,
|
|
3454
|
+
validate
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
validate() {
|
|
3458
|
+
return { success: true, error: null };
|
|
3459
|
+
}
|
|
3460
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
3461
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
3462
|
+
rulesyncCommand,
|
|
3463
|
+
toolTarget: "takt"
|
|
3464
|
+
});
|
|
3465
|
+
}
|
|
3466
|
+
static async fromFile({
|
|
3467
|
+
baseDir = process.cwd(),
|
|
3468
|
+
relativeFilePath,
|
|
3469
|
+
validate = true,
|
|
3470
|
+
global = false
|
|
3471
|
+
}) {
|
|
3472
|
+
const paths = this.getSettablePaths({ global });
|
|
3473
|
+
const filePath = join20(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3474
|
+
const fileContent = await readFileContent(filePath);
|
|
3475
|
+
const { body } = parseFrontmatter(fileContent, filePath);
|
|
3476
|
+
return new _TaktCommand({
|
|
3477
|
+
baseDir,
|
|
3478
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3479
|
+
relativeFilePath,
|
|
3480
|
+
body: body.trim(),
|
|
3481
|
+
validate
|
|
3482
|
+
});
|
|
3483
|
+
}
|
|
3484
|
+
static forDeletion({
|
|
3485
|
+
baseDir = process.cwd(),
|
|
3486
|
+
relativeDirPath,
|
|
3487
|
+
relativeFilePath
|
|
3488
|
+
}) {
|
|
3489
|
+
return new _TaktCommand({
|
|
3490
|
+
baseDir,
|
|
3491
|
+
relativeDirPath,
|
|
3492
|
+
relativeFilePath,
|
|
3493
|
+
body: "",
|
|
3494
|
+
validate: false
|
|
3495
|
+
});
|
|
3496
|
+
}
|
|
3497
|
+
};
|
|
3498
|
+
|
|
3375
3499
|
// src/features/commands/commands-processor.ts
|
|
3376
3500
|
var commandsProcessorToolTargetTuple = [
|
|
3377
3501
|
"agentsmd",
|
|
@@ -3388,7 +3512,8 @@ var commandsProcessorToolTargetTuple = [
|
|
|
3388
3512
|
"kilo",
|
|
3389
3513
|
"kiro",
|
|
3390
3514
|
"opencode",
|
|
3391
|
-
"roo"
|
|
3515
|
+
"roo",
|
|
3516
|
+
"takt"
|
|
3392
3517
|
];
|
|
3393
3518
|
var CommandsProcessorToolTargetSchema = z15.enum(commandsProcessorToolTargetTuple);
|
|
3394
3519
|
var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
@@ -3586,6 +3711,19 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
3586
3711
|
supportsSubdirectory: true
|
|
3587
3712
|
}
|
|
3588
3713
|
}
|
|
3714
|
+
],
|
|
3715
|
+
[
|
|
3716
|
+
"takt",
|
|
3717
|
+
{
|
|
3718
|
+
class: TaktCommand,
|
|
3719
|
+
meta: {
|
|
3720
|
+
extension: "md",
|
|
3721
|
+
supportsProject: true,
|
|
3722
|
+
supportsGlobal: true,
|
|
3723
|
+
isSimulated: false,
|
|
3724
|
+
supportsSubdirectory: false
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3589
3727
|
]
|
|
3590
3728
|
]);
|
|
3591
3729
|
var defaultGetFactory = (target) => {
|
|
@@ -3689,10 +3827,10 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3689
3827
|
*/
|
|
3690
3828
|
async loadRulesyncFiles() {
|
|
3691
3829
|
const basePath = RulesyncCommand.getSettablePaths().relativeDirPath;
|
|
3692
|
-
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
3830
|
+
const rulesyncCommandPaths = await findFilesByGlobs(join21(basePath, "**", "*.md"));
|
|
3693
3831
|
const rulesyncCommands = await Promise.all(
|
|
3694
3832
|
rulesyncCommandPaths.map(
|
|
3695
|
-
(
|
|
3833
|
+
(path4) => RulesyncCommand.fromFile({ relativeFilePath: this.safeRelativePath(basePath, path4) })
|
|
3696
3834
|
)
|
|
3697
3835
|
);
|
|
3698
3836
|
this.logger.debug(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -3707,15 +3845,15 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3707
3845
|
} = {}) {
|
|
3708
3846
|
const factory = this.getFactory(this.toolTarget);
|
|
3709
3847
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
3710
|
-
const baseDirFull =
|
|
3711
|
-
const globPattern = factory.meta.supportsSubdirectory ?
|
|
3848
|
+
const baseDirFull = join21(this.baseDir, paths.relativeDirPath);
|
|
3849
|
+
const globPattern = factory.meta.supportsSubdirectory ? join21(baseDirFull, "**", `*.${factory.meta.extension}`) : join21(baseDirFull, `*.${factory.meta.extension}`);
|
|
3712
3850
|
const commandFilePaths = await findFilesByGlobs(globPattern);
|
|
3713
3851
|
if (forDeletion) {
|
|
3714
3852
|
const toolCommands2 = commandFilePaths.map(
|
|
3715
|
-
(
|
|
3853
|
+
(path4) => factory.class.forDeletion({
|
|
3716
3854
|
baseDir: this.baseDir,
|
|
3717
3855
|
relativeDirPath: paths.relativeDirPath,
|
|
3718
|
-
relativeFilePath: this.safeRelativePath(baseDirFull,
|
|
3856
|
+
relativeFilePath: this.safeRelativePath(baseDirFull, path4),
|
|
3719
3857
|
global: this.global
|
|
3720
3858
|
})
|
|
3721
3859
|
).filter((cmd) => cmd.isDeletable());
|
|
@@ -3726,9 +3864,9 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
3726
3864
|
}
|
|
3727
3865
|
const toolCommands = await Promise.all(
|
|
3728
3866
|
commandFilePaths.map(
|
|
3729
|
-
(
|
|
3867
|
+
(path4) => factory.class.fromFile({
|
|
3730
3868
|
baseDir: this.baseDir,
|
|
3731
|
-
relativeFilePath: this.safeRelativePath(baseDirFull,
|
|
3869
|
+
relativeFilePath: this.safeRelativePath(baseDirFull, path4),
|
|
3732
3870
|
global: this.global
|
|
3733
3871
|
})
|
|
3734
3872
|
)
|
|
@@ -4029,7 +4167,7 @@ var DEEPAGENTS_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
|
4029
4167
|
);
|
|
4030
4168
|
|
|
4031
4169
|
// src/features/hooks/claudecode-hooks.ts
|
|
4032
|
-
import { join as
|
|
4170
|
+
import { join as join23 } from "path";
|
|
4033
4171
|
|
|
4034
4172
|
// src/features/hooks/tool-hooks-converter.ts
|
|
4035
4173
|
function isToolMatcherEntry(x) {
|
|
@@ -4159,7 +4297,7 @@ var ToolFile = class extends AiFile {
|
|
|
4159
4297
|
};
|
|
4160
4298
|
|
|
4161
4299
|
// src/features/hooks/rulesync-hooks.ts
|
|
4162
|
-
import { join as
|
|
4300
|
+
import { join as join22 } from "path";
|
|
4163
4301
|
var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
4164
4302
|
json;
|
|
4165
4303
|
constructor(params) {
|
|
@@ -4190,7 +4328,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
|
4190
4328
|
validate = true
|
|
4191
4329
|
}) {
|
|
4192
4330
|
const paths = _RulesyncHooks.getSettablePaths();
|
|
4193
|
-
const filePath =
|
|
4331
|
+
const filePath = join22(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4194
4332
|
if (!await fileExists(filePath)) {
|
|
4195
4333
|
throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
|
|
4196
4334
|
}
|
|
@@ -4275,7 +4413,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
4275
4413
|
global = false
|
|
4276
4414
|
}) {
|
|
4277
4415
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
4278
|
-
const filePath =
|
|
4416
|
+
const filePath = join23(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4279
4417
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4280
4418
|
return new _ClaudecodeHooks({
|
|
4281
4419
|
baseDir,
|
|
@@ -4293,7 +4431,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
4293
4431
|
logger
|
|
4294
4432
|
}) {
|
|
4295
4433
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
4296
|
-
const filePath =
|
|
4434
|
+
const filePath = join23(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4297
4435
|
const existingContent = await readOrInitializeFileContent(
|
|
4298
4436
|
filePath,
|
|
4299
4437
|
JSON.stringify({}, null, 2)
|
|
@@ -4330,7 +4468,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
4330
4468
|
settings = JSON.parse(this.getFileContent());
|
|
4331
4469
|
} catch (error) {
|
|
4332
4470
|
throw new Error(
|
|
4333
|
-
`Failed to parse Claude hooks content in ${
|
|
4471
|
+
`Failed to parse Claude hooks content in ${join23(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4334
4472
|
{
|
|
4335
4473
|
cause: error
|
|
4336
4474
|
}
|
|
@@ -4363,7 +4501,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
4363
4501
|
};
|
|
4364
4502
|
|
|
4365
4503
|
// src/features/hooks/codexcli-hooks.ts
|
|
4366
|
-
import { join as
|
|
4504
|
+
import { join as join24 } from "path";
|
|
4367
4505
|
import * as smolToml2 from "smol-toml";
|
|
4368
4506
|
var CODEXCLI_CONVERTER_CONFIG = {
|
|
4369
4507
|
supportedEvents: CODEXCLI_HOOK_EVENTS,
|
|
@@ -4374,7 +4512,7 @@ var CODEXCLI_CONVERTER_CONFIG = {
|
|
|
4374
4512
|
passthroughFields: ["name", "description"]
|
|
4375
4513
|
};
|
|
4376
4514
|
async function buildCodexConfigTomlContent({ baseDir }) {
|
|
4377
|
-
const configPath =
|
|
4515
|
+
const configPath = join24(baseDir, ".codex", "config.toml");
|
|
4378
4516
|
const existingContent = await readFileContentOrNull(configPath) ?? smolToml2.stringify({});
|
|
4379
4517
|
let configToml;
|
|
4380
4518
|
try {
|
|
@@ -4423,7 +4561,7 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4423
4561
|
global = false
|
|
4424
4562
|
}) {
|
|
4425
4563
|
const paths = _CodexcliHooks.getSettablePaths({ global });
|
|
4426
|
-
const filePath =
|
|
4564
|
+
const filePath = join24(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4427
4565
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4428
4566
|
return new _CodexcliHooks({
|
|
4429
4567
|
baseDir,
|
|
@@ -4461,7 +4599,7 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4461
4599
|
parsed = JSON.parse(this.getFileContent());
|
|
4462
4600
|
} catch (error) {
|
|
4463
4601
|
throw new Error(
|
|
4464
|
-
`Failed to parse Codex CLI hooks content in ${
|
|
4602
|
+
`Failed to parse Codex CLI hooks content in ${join24(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4465
4603
|
{
|
|
4466
4604
|
cause: error
|
|
4467
4605
|
}
|
|
@@ -4499,7 +4637,7 @@ var CodexcliHooks = class _CodexcliHooks extends ToolHooks {
|
|
|
4499
4637
|
};
|
|
4500
4638
|
|
|
4501
4639
|
// src/features/hooks/copilot-hooks.ts
|
|
4502
|
-
import { join as
|
|
4640
|
+
import { join as join25 } from "path";
|
|
4503
4641
|
import { z as z17 } from "zod/mini";
|
|
4504
4642
|
var CopilotHookEntrySchema = z17.looseObject({
|
|
4505
4643
|
type: z17.string(),
|
|
@@ -4602,7 +4740,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4602
4740
|
}
|
|
4603
4741
|
static getSettablePaths(_options = {}) {
|
|
4604
4742
|
return {
|
|
4605
|
-
relativeDirPath:
|
|
4743
|
+
relativeDirPath: join25(".github", "hooks"),
|
|
4606
4744
|
relativeFilePath: "copilot-hooks.json"
|
|
4607
4745
|
};
|
|
4608
4746
|
}
|
|
@@ -4612,7 +4750,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4612
4750
|
global = false
|
|
4613
4751
|
}) {
|
|
4614
4752
|
const paths = _CopilotHooks.getSettablePaths({ global });
|
|
4615
|
-
const filePath =
|
|
4753
|
+
const filePath = join25(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4616
4754
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4617
4755
|
return new _CopilotHooks({
|
|
4618
4756
|
baseDir,
|
|
@@ -4645,7 +4783,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4645
4783
|
parsed = JSON.parse(this.getFileContent());
|
|
4646
4784
|
} catch (error) {
|
|
4647
4785
|
throw new Error(
|
|
4648
|
-
`Failed to parse Copilot hooks content in ${
|
|
4786
|
+
`Failed to parse Copilot hooks content in ${join25(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4649
4787
|
{
|
|
4650
4788
|
cause: error
|
|
4651
4789
|
}
|
|
@@ -4675,7 +4813,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
|
|
|
4675
4813
|
};
|
|
4676
4814
|
|
|
4677
4815
|
// src/features/hooks/cursor-hooks.ts
|
|
4678
|
-
import { join as
|
|
4816
|
+
import { join as join26 } from "path";
|
|
4679
4817
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
4680
4818
|
constructor(params) {
|
|
4681
4819
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -4696,7 +4834,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4696
4834
|
}) {
|
|
4697
4835
|
const paths = _CursorHooks.getSettablePaths();
|
|
4698
4836
|
const fileContent = await readFileContent(
|
|
4699
|
-
|
|
4837
|
+
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4700
4838
|
);
|
|
4701
4839
|
return new _CursorHooks({
|
|
4702
4840
|
baseDir,
|
|
@@ -4783,7 +4921,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
4783
4921
|
};
|
|
4784
4922
|
|
|
4785
4923
|
// src/features/hooks/deepagents-hooks.ts
|
|
4786
|
-
import { join as
|
|
4924
|
+
import { join as join27 } from "path";
|
|
4787
4925
|
function isDeepagentsHooksFile(val) {
|
|
4788
4926
|
if (typeof val !== "object" || val === null || !("hooks" in val)) return false;
|
|
4789
4927
|
return Array.isArray(val.hooks);
|
|
@@ -4858,7 +4996,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4858
4996
|
global = false
|
|
4859
4997
|
}) {
|
|
4860
4998
|
const paths = _DeepagentsHooks.getSettablePaths({ global });
|
|
4861
|
-
const filePath =
|
|
4999
|
+
const filePath = join27(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4862
5000
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({ hooks: [] }, null, 2);
|
|
4863
5001
|
return new _DeepagentsHooks({
|
|
4864
5002
|
baseDir,
|
|
@@ -4892,7 +5030,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4892
5030
|
parsed = JSON.parse(this.getFileContent());
|
|
4893
5031
|
} catch (error) {
|
|
4894
5032
|
throw new Error(
|
|
4895
|
-
`Failed to parse deepagents hooks content in ${
|
|
5033
|
+
`Failed to parse deepagents hooks content in ${join27(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
4896
5034
|
{ cause: error }
|
|
4897
5035
|
);
|
|
4898
5036
|
}
|
|
@@ -4921,7 +5059,7 @@ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
|
|
|
4921
5059
|
};
|
|
4922
5060
|
|
|
4923
5061
|
// src/features/hooks/factorydroid-hooks.ts
|
|
4924
|
-
import { join as
|
|
5062
|
+
import { join as join28 } from "path";
|
|
4925
5063
|
var FACTORYDROID_CONVERTER_CONFIG = {
|
|
4926
5064
|
supportedEvents: FACTORYDROID_HOOK_EVENTS,
|
|
4927
5065
|
canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
|
|
@@ -4947,7 +5085,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4947
5085
|
global = false
|
|
4948
5086
|
}) {
|
|
4949
5087
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4950
|
-
const filePath =
|
|
5088
|
+
const filePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4951
5089
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
4952
5090
|
return new _FactorydroidHooks({
|
|
4953
5091
|
baseDir,
|
|
@@ -4965,7 +5103,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
4965
5103
|
logger
|
|
4966
5104
|
}) {
|
|
4967
5105
|
const paths = _FactorydroidHooks.getSettablePaths({ global });
|
|
4968
|
-
const filePath =
|
|
5106
|
+
const filePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4969
5107
|
const existingContent = await readOrInitializeFileContent(
|
|
4970
5108
|
filePath,
|
|
4971
5109
|
JSON.stringify({}, null, 2)
|
|
@@ -5002,7 +5140,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
5002
5140
|
settings = JSON.parse(this.getFileContent());
|
|
5003
5141
|
} catch (error) {
|
|
5004
5142
|
throw new Error(
|
|
5005
|
-
`Failed to parse Factory Droid hooks content in ${
|
|
5143
|
+
`Failed to parse Factory Droid hooks content in ${join28(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
5006
5144
|
{
|
|
5007
5145
|
cause: error
|
|
5008
5146
|
}
|
|
@@ -5035,7 +5173,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
|
|
|
5035
5173
|
};
|
|
5036
5174
|
|
|
5037
5175
|
// src/features/hooks/geminicli-hooks.ts
|
|
5038
|
-
import { join as
|
|
5176
|
+
import { join as join29 } from "path";
|
|
5039
5177
|
import { z as z18 } from "zod/mini";
|
|
5040
5178
|
function canonicalToGeminicliHooks(config) {
|
|
5041
5179
|
const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
|
|
@@ -5144,7 +5282,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
5144
5282
|
global = false
|
|
5145
5283
|
}) {
|
|
5146
5284
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
5147
|
-
const filePath =
|
|
5285
|
+
const filePath = join29(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5148
5286
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
|
|
5149
5287
|
return new _GeminicliHooks({
|
|
5150
5288
|
baseDir,
|
|
@@ -5161,7 +5299,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
5161
5299
|
global = false
|
|
5162
5300
|
}) {
|
|
5163
5301
|
const paths = _GeminicliHooks.getSettablePaths({ global });
|
|
5164
|
-
const filePath =
|
|
5302
|
+
const filePath = join29(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
5165
5303
|
const existingContent = await readOrInitializeFileContent(
|
|
5166
5304
|
filePath,
|
|
5167
5305
|
JSON.stringify({}, null, 2)
|
|
@@ -5193,7 +5331,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
5193
5331
|
settings = JSON.parse(this.getFileContent());
|
|
5194
5332
|
} catch (error) {
|
|
5195
5333
|
throw new Error(
|
|
5196
|
-
`Failed to parse Gemini CLI hooks content in ${
|
|
5334
|
+
`Failed to parse Gemini CLI hooks content in ${join29(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
5197
5335
|
{
|
|
5198
5336
|
cause: error
|
|
5199
5337
|
}
|
|
@@ -5223,7 +5361,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
|
|
|
5223
5361
|
};
|
|
5224
5362
|
|
|
5225
5363
|
// src/features/hooks/kilo-hooks.ts
|
|
5226
|
-
import { join as
|
|
5364
|
+
import { join as join30 } from "path";
|
|
5227
5365
|
|
|
5228
5366
|
// src/features/hooks/opencode-style-generator.ts
|
|
5229
5367
|
var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
|
|
@@ -5322,7 +5460,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
5322
5460
|
}
|
|
5323
5461
|
static getSettablePaths(options) {
|
|
5324
5462
|
return {
|
|
5325
|
-
relativeDirPath: options?.global ?
|
|
5463
|
+
relativeDirPath: options?.global ? join30(".config", "kilo", "plugins") : join30(".kilo", "plugins"),
|
|
5326
5464
|
relativeFilePath: "rulesync-hooks.js"
|
|
5327
5465
|
};
|
|
5328
5466
|
}
|
|
@@ -5333,7 +5471,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
5333
5471
|
}) {
|
|
5334
5472
|
const paths = _KiloHooks.getSettablePaths({ global });
|
|
5335
5473
|
const fileContent = await readFileContent(
|
|
5336
|
-
|
|
5474
|
+
join30(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
5337
5475
|
);
|
|
5338
5476
|
return new _KiloHooks({
|
|
5339
5477
|
baseDir,
|
|
@@ -5387,7 +5525,7 @@ var KiloHooks = class _KiloHooks extends ToolHooks {
|
|
|
5387
5525
|
};
|
|
5388
5526
|
|
|
5389
5527
|
// src/features/hooks/opencode-hooks.ts
|
|
5390
|
-
import { join as
|
|
5528
|
+
import { join as join31 } from "path";
|
|
5391
5529
|
var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
5392
5530
|
constructor(params) {
|
|
5393
5531
|
super({
|
|
@@ -5397,7 +5535,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
5397
5535
|
}
|
|
5398
5536
|
static getSettablePaths(options) {
|
|
5399
5537
|
return {
|
|
5400
|
-
relativeDirPath: options?.global ?
|
|
5538
|
+
relativeDirPath: options?.global ? join31(".config", "opencode", "plugins") : join31(".opencode", "plugins"),
|
|
5401
5539
|
relativeFilePath: "rulesync-hooks.js"
|
|
5402
5540
|
};
|
|
5403
5541
|
}
|
|
@@ -5408,7 +5546,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
|
|
|
5408
5546
|
}) {
|
|
5409
5547
|
const paths = _OpencodeHooks.getSettablePaths({ global });
|
|
5410
5548
|
const fileContent = await readFileContent(
|
|
5411
|
-
|
|
5549
|
+
join31(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
5412
5550
|
);
|
|
5413
5551
|
return new _OpencodeHooks({
|
|
5414
5552
|
baseDir,
|
|
@@ -5760,10 +5898,10 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
5760
5898
|
import { z as z21 } from "zod/mini";
|
|
5761
5899
|
|
|
5762
5900
|
// src/features/ignore/augmentcode-ignore.ts
|
|
5763
|
-
import { join as
|
|
5901
|
+
import { join as join33 } from "path";
|
|
5764
5902
|
|
|
5765
5903
|
// src/features/ignore/rulesync-ignore.ts
|
|
5766
|
-
import { join as
|
|
5904
|
+
import { join as join32 } from "path";
|
|
5767
5905
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
5768
5906
|
validate() {
|
|
5769
5907
|
return { success: true, error: null };
|
|
@@ -5783,12 +5921,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
5783
5921
|
static async fromFile() {
|
|
5784
5922
|
const baseDir = process.cwd();
|
|
5785
5923
|
const paths = this.getSettablePaths();
|
|
5786
|
-
const recommendedPath =
|
|
5924
|
+
const recommendedPath = join32(
|
|
5787
5925
|
baseDir,
|
|
5788
5926
|
paths.recommended.relativeDirPath,
|
|
5789
5927
|
paths.recommended.relativeFilePath
|
|
5790
5928
|
);
|
|
5791
|
-
const legacyPath =
|
|
5929
|
+
const legacyPath = join32(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
5792
5930
|
if (await fileExists(recommendedPath)) {
|
|
5793
5931
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
5794
5932
|
return new _RulesyncIgnore({
|
|
@@ -5904,7 +6042,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
5904
6042
|
validate = true
|
|
5905
6043
|
}) {
|
|
5906
6044
|
const fileContent = await readFileContent(
|
|
5907
|
-
|
|
6045
|
+
join33(
|
|
5908
6046
|
baseDir,
|
|
5909
6047
|
this.getSettablePaths().relativeDirPath,
|
|
5910
6048
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5934,7 +6072,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
5934
6072
|
};
|
|
5935
6073
|
|
|
5936
6074
|
// src/features/ignore/claudecode-ignore.ts
|
|
5937
|
-
import { join as
|
|
6075
|
+
import { join as join34 } from "path";
|
|
5938
6076
|
import { uniq } from "es-toolkit";
|
|
5939
6077
|
import { z as z20 } from "zod/mini";
|
|
5940
6078
|
var SHARED_SETTINGS_FILE = "settings.json";
|
|
@@ -6005,7 +6143,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
6005
6143
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
6006
6144
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
6007
6145
|
const paths = this.getSettablePaths({ options });
|
|
6008
|
-
const filePath =
|
|
6146
|
+
const filePath = join34(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6009
6147
|
const exists = await fileExists(filePath);
|
|
6010
6148
|
const existingFileContent = exists ? await readFileContent(filePath) : "{}";
|
|
6011
6149
|
const existingJsonValue = JSON.parse(existingFileContent);
|
|
@@ -6039,7 +6177,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
6039
6177
|
}) {
|
|
6040
6178
|
const fileMode = resolveFileMode(options);
|
|
6041
6179
|
const paths = this.getSettablePaths({ options });
|
|
6042
|
-
const filePath =
|
|
6180
|
+
const filePath = join34(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
6043
6181
|
const exists = await fileExists(filePath);
|
|
6044
6182
|
if (!exists && fileMode === "shared") {
|
|
6045
6183
|
throw new Error(`File not found: ${filePath}`);
|
|
@@ -6069,7 +6207,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
6069
6207
|
};
|
|
6070
6208
|
|
|
6071
6209
|
// src/features/ignore/cline-ignore.ts
|
|
6072
|
-
import { join as
|
|
6210
|
+
import { join as join35 } from "path";
|
|
6073
6211
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
6074
6212
|
static getSettablePaths() {
|
|
6075
6213
|
return {
|
|
@@ -6106,7 +6244,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
6106
6244
|
validate = true
|
|
6107
6245
|
}) {
|
|
6108
6246
|
const fileContent = await readFileContent(
|
|
6109
|
-
|
|
6247
|
+
join35(
|
|
6110
6248
|
baseDir,
|
|
6111
6249
|
this.getSettablePaths().relativeDirPath,
|
|
6112
6250
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6136,7 +6274,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
6136
6274
|
};
|
|
6137
6275
|
|
|
6138
6276
|
// src/features/ignore/cursor-ignore.ts
|
|
6139
|
-
import { join as
|
|
6277
|
+
import { join as join36 } from "path";
|
|
6140
6278
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
6141
6279
|
static getSettablePaths() {
|
|
6142
6280
|
return {
|
|
@@ -6169,7 +6307,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
6169
6307
|
validate = true
|
|
6170
6308
|
}) {
|
|
6171
6309
|
const fileContent = await readFileContent(
|
|
6172
|
-
|
|
6310
|
+
join36(
|
|
6173
6311
|
baseDir,
|
|
6174
6312
|
this.getSettablePaths().relativeDirPath,
|
|
6175
6313
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6199,7 +6337,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
6199
6337
|
};
|
|
6200
6338
|
|
|
6201
6339
|
// src/features/ignore/geminicli-ignore.ts
|
|
6202
|
-
import { join as
|
|
6340
|
+
import { join as join37 } from "path";
|
|
6203
6341
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
6204
6342
|
static getSettablePaths() {
|
|
6205
6343
|
return {
|
|
@@ -6226,7 +6364,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
6226
6364
|
validate = true
|
|
6227
6365
|
}) {
|
|
6228
6366
|
const fileContent = await readFileContent(
|
|
6229
|
-
|
|
6367
|
+
join37(
|
|
6230
6368
|
baseDir,
|
|
6231
6369
|
this.getSettablePaths().relativeDirPath,
|
|
6232
6370
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6256,7 +6394,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
6256
6394
|
};
|
|
6257
6395
|
|
|
6258
6396
|
// src/features/ignore/goose-ignore.ts
|
|
6259
|
-
import { join as
|
|
6397
|
+
import { join as join38 } from "path";
|
|
6260
6398
|
var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
6261
6399
|
static getSettablePaths() {
|
|
6262
6400
|
return {
|
|
@@ -6293,7 +6431,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
6293
6431
|
validate = true
|
|
6294
6432
|
}) {
|
|
6295
6433
|
const fileContent = await readFileContent(
|
|
6296
|
-
|
|
6434
|
+
join38(
|
|
6297
6435
|
baseDir,
|
|
6298
6436
|
this.getSettablePaths().relativeDirPath,
|
|
6299
6437
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6323,7 +6461,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
|
|
|
6323
6461
|
};
|
|
6324
6462
|
|
|
6325
6463
|
// src/features/ignore/junie-ignore.ts
|
|
6326
|
-
import { join as
|
|
6464
|
+
import { join as join39 } from "path";
|
|
6327
6465
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
6328
6466
|
static getSettablePaths() {
|
|
6329
6467
|
return {
|
|
@@ -6350,7 +6488,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
6350
6488
|
validate = true
|
|
6351
6489
|
}) {
|
|
6352
6490
|
const fileContent = await readFileContent(
|
|
6353
|
-
|
|
6491
|
+
join39(
|
|
6354
6492
|
baseDir,
|
|
6355
6493
|
this.getSettablePaths().relativeDirPath,
|
|
6356
6494
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6380,7 +6518,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
6380
6518
|
};
|
|
6381
6519
|
|
|
6382
6520
|
// src/features/ignore/kilo-ignore.ts
|
|
6383
|
-
import { join as
|
|
6521
|
+
import { join as join40 } from "path";
|
|
6384
6522
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
6385
6523
|
static getSettablePaths() {
|
|
6386
6524
|
return {
|
|
@@ -6417,7 +6555,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
6417
6555
|
validate = true
|
|
6418
6556
|
}) {
|
|
6419
6557
|
const fileContent = await readFileContent(
|
|
6420
|
-
|
|
6558
|
+
join40(
|
|
6421
6559
|
baseDir,
|
|
6422
6560
|
this.getSettablePaths().relativeDirPath,
|
|
6423
6561
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6447,7 +6585,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
6447
6585
|
};
|
|
6448
6586
|
|
|
6449
6587
|
// src/features/ignore/kiro-ignore.ts
|
|
6450
|
-
import { join as
|
|
6588
|
+
import { join as join41 } from "path";
|
|
6451
6589
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
6452
6590
|
static getSettablePaths() {
|
|
6453
6591
|
return {
|
|
@@ -6474,7 +6612,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
6474
6612
|
validate = true
|
|
6475
6613
|
}) {
|
|
6476
6614
|
const fileContent = await readFileContent(
|
|
6477
|
-
|
|
6615
|
+
join41(
|
|
6478
6616
|
baseDir,
|
|
6479
6617
|
this.getSettablePaths().relativeDirPath,
|
|
6480
6618
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6504,7 +6642,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
6504
6642
|
};
|
|
6505
6643
|
|
|
6506
6644
|
// src/features/ignore/qwencode-ignore.ts
|
|
6507
|
-
import { join as
|
|
6645
|
+
import { join as join42 } from "path";
|
|
6508
6646
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
6509
6647
|
static getSettablePaths() {
|
|
6510
6648
|
return {
|
|
@@ -6531,7 +6669,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
6531
6669
|
validate = true
|
|
6532
6670
|
}) {
|
|
6533
6671
|
const fileContent = await readFileContent(
|
|
6534
|
-
|
|
6672
|
+
join42(
|
|
6535
6673
|
baseDir,
|
|
6536
6674
|
this.getSettablePaths().relativeDirPath,
|
|
6537
6675
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6561,7 +6699,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
6561
6699
|
};
|
|
6562
6700
|
|
|
6563
6701
|
// src/features/ignore/roo-ignore.ts
|
|
6564
|
-
import { join as
|
|
6702
|
+
import { join as join43 } from "path";
|
|
6565
6703
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
6566
6704
|
static getSettablePaths() {
|
|
6567
6705
|
return {
|
|
@@ -6588,7 +6726,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
6588
6726
|
validate = true
|
|
6589
6727
|
}) {
|
|
6590
6728
|
const fileContent = await readFileContent(
|
|
6591
|
-
|
|
6729
|
+
join43(
|
|
6592
6730
|
baseDir,
|
|
6593
6731
|
this.getSettablePaths().relativeDirPath,
|
|
6594
6732
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6618,7 +6756,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
6618
6756
|
};
|
|
6619
6757
|
|
|
6620
6758
|
// src/features/ignore/windsurf-ignore.ts
|
|
6621
|
-
import { join as
|
|
6759
|
+
import { join as join44 } from "path";
|
|
6622
6760
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
6623
6761
|
static getSettablePaths() {
|
|
6624
6762
|
return {
|
|
@@ -6645,7 +6783,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
6645
6783
|
validate = true
|
|
6646
6784
|
}) {
|
|
6647
6785
|
const fileContent = await readFileContent(
|
|
6648
|
-
|
|
6786
|
+
join44(
|
|
6649
6787
|
baseDir,
|
|
6650
6788
|
this.getSettablePaths().relativeDirPath,
|
|
6651
6789
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6675,7 +6813,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
6675
6813
|
};
|
|
6676
6814
|
|
|
6677
6815
|
// src/features/ignore/zed-ignore.ts
|
|
6678
|
-
import { join as
|
|
6816
|
+
import { join as join45 } from "path";
|
|
6679
6817
|
import { uniq as uniq2 } from "es-toolkit";
|
|
6680
6818
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
6681
6819
|
constructor(params) {
|
|
@@ -6712,7 +6850,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
6712
6850
|
}) {
|
|
6713
6851
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
6714
6852
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
6715
|
-
const filePath =
|
|
6853
|
+
const filePath = join45(
|
|
6716
6854
|
baseDir,
|
|
6717
6855
|
this.getSettablePaths().relativeDirPath,
|
|
6718
6856
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6739,7 +6877,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
6739
6877
|
validate = true
|
|
6740
6878
|
}) {
|
|
6741
6879
|
const fileContent = await readFileContent(
|
|
6742
|
-
|
|
6880
|
+
join45(
|
|
6743
6881
|
baseDir,
|
|
6744
6882
|
this.getSettablePaths().relativeDirPath,
|
|
6745
6883
|
this.getSettablePaths().relativeFilePath
|
|
@@ -6931,10 +7069,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
6931
7069
|
import { z as z26 } from "zod/mini";
|
|
6932
7070
|
|
|
6933
7071
|
// src/features/mcp/claudecode-mcp.ts
|
|
6934
|
-
import { join as
|
|
7072
|
+
import { join as join47 } from "path";
|
|
6935
7073
|
|
|
6936
7074
|
// src/features/mcp/rulesync-mcp.ts
|
|
6937
|
-
import { join as
|
|
7075
|
+
import { join as join46 } from "path";
|
|
6938
7076
|
import { omit } from "es-toolkit/object";
|
|
6939
7077
|
import { z as z23 } from "zod/mini";
|
|
6940
7078
|
|
|
@@ -7016,12 +7154,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
7016
7154
|
}) {
|
|
7017
7155
|
const baseDir = process.cwd();
|
|
7018
7156
|
const paths = this.getSettablePaths();
|
|
7019
|
-
const recommendedPath =
|
|
7157
|
+
const recommendedPath = join46(
|
|
7020
7158
|
baseDir,
|
|
7021
7159
|
paths.recommended.relativeDirPath,
|
|
7022
7160
|
paths.recommended.relativeFilePath
|
|
7023
7161
|
);
|
|
7024
|
-
const legacyPath =
|
|
7162
|
+
const legacyPath = join46(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
7025
7163
|
if (await fileExists(recommendedPath)) {
|
|
7026
7164
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
7027
7165
|
return new _RulesyncMcp({
|
|
@@ -7175,7 +7313,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7175
7313
|
global = false
|
|
7176
7314
|
}) {
|
|
7177
7315
|
const paths = this.getSettablePaths({ global });
|
|
7178
|
-
const fileContent = await readFileContentOrNull(
|
|
7316
|
+
const fileContent = await readFileContentOrNull(join47(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7179
7317
|
const json = JSON.parse(fileContent);
|
|
7180
7318
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7181
7319
|
return new _ClaudecodeMcp({
|
|
@@ -7195,7 +7333,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7195
7333
|
}) {
|
|
7196
7334
|
const paths = this.getSettablePaths({ global });
|
|
7197
7335
|
const fileContent = await readOrInitializeFileContent(
|
|
7198
|
-
|
|
7336
|
+
join47(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7199
7337
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7200
7338
|
);
|
|
7201
7339
|
const json = JSON.parse(fileContent);
|
|
@@ -7235,7 +7373,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
7235
7373
|
};
|
|
7236
7374
|
|
|
7237
7375
|
// src/features/mcp/cline-mcp.ts
|
|
7238
|
-
import { join as
|
|
7376
|
+
import { join as join48 } from "path";
|
|
7239
7377
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
7240
7378
|
json;
|
|
7241
7379
|
constructor(params) {
|
|
@@ -7256,7 +7394,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
7256
7394
|
validate = true
|
|
7257
7395
|
}) {
|
|
7258
7396
|
const fileContent = await readFileContent(
|
|
7259
|
-
|
|
7397
|
+
join48(
|
|
7260
7398
|
baseDir,
|
|
7261
7399
|
this.getSettablePaths().relativeDirPath,
|
|
7262
7400
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7305,7 +7443,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
7305
7443
|
};
|
|
7306
7444
|
|
|
7307
7445
|
// src/features/mcp/codexcli-mcp.ts
|
|
7308
|
-
import { join as
|
|
7446
|
+
import { join as join49 } from "path";
|
|
7309
7447
|
import * as smolToml3 from "smol-toml";
|
|
7310
7448
|
function convertFromCodexFormat(codexMcp) {
|
|
7311
7449
|
const result = {};
|
|
@@ -7388,7 +7526,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
7388
7526
|
global = false
|
|
7389
7527
|
}) {
|
|
7390
7528
|
const paths = this.getSettablePaths({ global });
|
|
7391
|
-
const fileContent = await readFileContentOrNull(
|
|
7529
|
+
const fileContent = await readFileContentOrNull(join49(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml3.stringify({});
|
|
7392
7530
|
return new _CodexcliMcp({
|
|
7393
7531
|
baseDir,
|
|
7394
7532
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -7404,7 +7542,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
7404
7542
|
global = false
|
|
7405
7543
|
}) {
|
|
7406
7544
|
const paths = this.getSettablePaths({ global });
|
|
7407
|
-
const configTomlFilePath =
|
|
7545
|
+
const configTomlFilePath = join49(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
7408
7546
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
7409
7547
|
configTomlFilePath,
|
|
7410
7548
|
smolToml3.stringify({})
|
|
@@ -7458,7 +7596,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
7458
7596
|
};
|
|
7459
7597
|
|
|
7460
7598
|
// src/features/mcp/copilot-mcp.ts
|
|
7461
|
-
import { join as
|
|
7599
|
+
import { join as join50 } from "path";
|
|
7462
7600
|
function convertToCopilotFormat(mcpServers) {
|
|
7463
7601
|
return { servers: mcpServers };
|
|
7464
7602
|
}
|
|
@@ -7485,7 +7623,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
7485
7623
|
validate = true
|
|
7486
7624
|
}) {
|
|
7487
7625
|
const fileContent = await readFileContent(
|
|
7488
|
-
|
|
7626
|
+
join50(
|
|
7489
7627
|
baseDir,
|
|
7490
7628
|
this.getSettablePaths().relativeDirPath,
|
|
7491
7629
|
this.getSettablePaths().relativeFilePath
|
|
@@ -7538,7 +7676,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
7538
7676
|
};
|
|
7539
7677
|
|
|
7540
7678
|
// src/features/mcp/copilotcli-mcp.ts
|
|
7541
|
-
import { join as
|
|
7679
|
+
import { join as join51 } from "path";
|
|
7542
7680
|
var isRemoteServerType = (type) => {
|
|
7543
7681
|
return type === "http" || type === "sse";
|
|
7544
7682
|
};
|
|
@@ -7636,7 +7774,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
7636
7774
|
global = false
|
|
7637
7775
|
}) {
|
|
7638
7776
|
const paths = this.getSettablePaths({ global });
|
|
7639
|
-
const fileContent = await readFileContentOrNull(
|
|
7777
|
+
const fileContent = await readFileContentOrNull(join51(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7640
7778
|
const json = JSON.parse(fileContent);
|
|
7641
7779
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7642
7780
|
return new _CopilotcliMcp({
|
|
@@ -7656,7 +7794,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
7656
7794
|
}) {
|
|
7657
7795
|
const paths = this.getSettablePaths({ global });
|
|
7658
7796
|
const fileContent = await readOrInitializeFileContent(
|
|
7659
|
-
|
|
7797
|
+
join51(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7660
7798
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7661
7799
|
);
|
|
7662
7800
|
const json = JSON.parse(fileContent);
|
|
@@ -7698,7 +7836,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
|
|
|
7698
7836
|
};
|
|
7699
7837
|
|
|
7700
7838
|
// src/features/mcp/cursor-mcp.ts
|
|
7701
|
-
import { join as
|
|
7839
|
+
import { join as join52 } from "path";
|
|
7702
7840
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
7703
7841
|
function convertEnvFromCursorFormat(mcpServers) {
|
|
7704
7842
|
return Object.fromEntries(
|
|
@@ -7745,7 +7883,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7745
7883
|
this.json = JSON.parse(this.fileContent);
|
|
7746
7884
|
} catch (error) {
|
|
7747
7885
|
throw new Error(
|
|
7748
|
-
`Failed to parse Cursor MCP config at ${
|
|
7886
|
+
`Failed to parse Cursor MCP config at ${join52(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
|
|
7749
7887
|
{ cause: error }
|
|
7750
7888
|
);
|
|
7751
7889
|
}
|
|
@@ -7771,14 +7909,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7771
7909
|
global = false
|
|
7772
7910
|
}) {
|
|
7773
7911
|
const paths = this.getSettablePaths({ global });
|
|
7774
|
-
const filePath =
|
|
7912
|
+
const filePath = join52(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
7775
7913
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
7776
7914
|
let json;
|
|
7777
7915
|
try {
|
|
7778
7916
|
json = JSON.parse(fileContent);
|
|
7779
7917
|
} catch (error) {
|
|
7780
7918
|
throw new Error(
|
|
7781
|
-
`Failed to parse Cursor MCP config at ${
|
|
7919
|
+
`Failed to parse Cursor MCP config at ${join52(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
7782
7920
|
{ cause: error }
|
|
7783
7921
|
);
|
|
7784
7922
|
}
|
|
@@ -7800,7 +7938,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7800
7938
|
}) {
|
|
7801
7939
|
const paths = this.getSettablePaths({ global });
|
|
7802
7940
|
const fileContent = await readOrInitializeFileContent(
|
|
7803
|
-
|
|
7941
|
+
join52(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7804
7942
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7805
7943
|
);
|
|
7806
7944
|
let json;
|
|
@@ -7808,7 +7946,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7808
7946
|
json = JSON.parse(fileContent);
|
|
7809
7947
|
} catch (error) {
|
|
7810
7948
|
throw new Error(
|
|
7811
|
-
`Failed to parse Cursor MCP config at ${
|
|
7949
|
+
`Failed to parse Cursor MCP config at ${join52(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
|
|
7812
7950
|
{ cause: error }
|
|
7813
7951
|
);
|
|
7814
7952
|
}
|
|
@@ -7857,7 +7995,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
7857
7995
|
};
|
|
7858
7996
|
|
|
7859
7997
|
// src/features/mcp/deepagents-mcp.ts
|
|
7860
|
-
import { join as
|
|
7998
|
+
import { join as join53 } from "path";
|
|
7861
7999
|
var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
7862
8000
|
json;
|
|
7863
8001
|
constructor(params) {
|
|
@@ -7882,7 +8020,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7882
8020
|
global = false
|
|
7883
8021
|
}) {
|
|
7884
8022
|
const paths = this.getSettablePaths({ global });
|
|
7885
|
-
const fileContent = await readFileContentOrNull(
|
|
8023
|
+
const fileContent = await readFileContentOrNull(join53(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
7886
8024
|
const json = JSON.parse(fileContent);
|
|
7887
8025
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
7888
8026
|
return new _DeepagentsMcp({
|
|
@@ -7901,7 +8039,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7901
8039
|
}) {
|
|
7902
8040
|
const paths = this.getSettablePaths({ global });
|
|
7903
8041
|
const fileContent = await readOrInitializeFileContent(
|
|
7904
|
-
|
|
8042
|
+
join53(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
7905
8043
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
7906
8044
|
);
|
|
7907
8045
|
const json = JSON.parse(fileContent);
|
|
@@ -7940,7 +8078,7 @@ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
|
|
|
7940
8078
|
};
|
|
7941
8079
|
|
|
7942
8080
|
// src/features/mcp/factorydroid-mcp.ts
|
|
7943
|
-
import { join as
|
|
8081
|
+
import { join as join54 } from "path";
|
|
7944
8082
|
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
7945
8083
|
json;
|
|
7946
8084
|
constructor(params) {
|
|
@@ -7961,7 +8099,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
7961
8099
|
validate = true
|
|
7962
8100
|
}) {
|
|
7963
8101
|
const fileContent = await readFileContent(
|
|
7964
|
-
|
|
8102
|
+
join54(
|
|
7965
8103
|
baseDir,
|
|
7966
8104
|
this.getSettablePaths().relativeDirPath,
|
|
7967
8105
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8015,7 +8153,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
|
8015
8153
|
};
|
|
8016
8154
|
|
|
8017
8155
|
// src/features/mcp/geminicli-mcp.ts
|
|
8018
|
-
import { join as
|
|
8156
|
+
import { join as join55 } from "path";
|
|
8019
8157
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
8020
8158
|
json;
|
|
8021
8159
|
constructor(params) {
|
|
@@ -8043,7 +8181,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
8043
8181
|
global = false
|
|
8044
8182
|
}) {
|
|
8045
8183
|
const paths = this.getSettablePaths({ global });
|
|
8046
|
-
const fileContent = await readFileContentOrNull(
|
|
8184
|
+
const fileContent = await readFileContentOrNull(join55(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
8047
8185
|
const json = JSON.parse(fileContent);
|
|
8048
8186
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
8049
8187
|
return new _GeminiCliMcp({
|
|
@@ -8062,7 +8200,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
8062
8200
|
}) {
|
|
8063
8201
|
const paths = this.getSettablePaths({ global });
|
|
8064
8202
|
const fileContent = await readOrInitializeFileContent(
|
|
8065
|
-
|
|
8203
|
+
join55(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
8066
8204
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8067
8205
|
);
|
|
8068
8206
|
const json = JSON.parse(fileContent);
|
|
@@ -8107,7 +8245,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
8107
8245
|
};
|
|
8108
8246
|
|
|
8109
8247
|
// src/features/mcp/junie-mcp.ts
|
|
8110
|
-
import { join as
|
|
8248
|
+
import { join as join56 } from "path";
|
|
8111
8249
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
8112
8250
|
json;
|
|
8113
8251
|
constructor(params) {
|
|
@@ -8119,7 +8257,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
8119
8257
|
}
|
|
8120
8258
|
static getSettablePaths() {
|
|
8121
8259
|
return {
|
|
8122
|
-
relativeDirPath:
|
|
8260
|
+
relativeDirPath: join56(".junie", "mcp"),
|
|
8123
8261
|
relativeFilePath: "mcp.json"
|
|
8124
8262
|
};
|
|
8125
8263
|
}
|
|
@@ -8128,7 +8266,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
8128
8266
|
validate = true
|
|
8129
8267
|
}) {
|
|
8130
8268
|
const fileContent = await readFileContent(
|
|
8131
|
-
|
|
8269
|
+
join56(
|
|
8132
8270
|
baseDir,
|
|
8133
8271
|
this.getSettablePaths().relativeDirPath,
|
|
8134
8272
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8177,7 +8315,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
8177
8315
|
};
|
|
8178
8316
|
|
|
8179
8317
|
// src/features/mcp/kilo-mcp.ts
|
|
8180
|
-
import { join as
|
|
8318
|
+
import { join as join57 } from "path";
|
|
8181
8319
|
import { parse as parseJsonc3 } from "jsonc-parser";
|
|
8182
8320
|
import { z as z24 } from "zod/mini";
|
|
8183
8321
|
var KiloMcpLocalServerSchema = z24.object({
|
|
@@ -8315,7 +8453,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
8315
8453
|
static getSettablePaths({ global } = {}) {
|
|
8316
8454
|
if (global) {
|
|
8317
8455
|
return {
|
|
8318
|
-
relativeDirPath:
|
|
8456
|
+
relativeDirPath: join57(".config", "kilo"),
|
|
8319
8457
|
relativeFilePath: "kilo.json"
|
|
8320
8458
|
};
|
|
8321
8459
|
}
|
|
@@ -8330,11 +8468,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
8330
8468
|
global = false
|
|
8331
8469
|
}) {
|
|
8332
8470
|
const basePaths = this.getSettablePaths({ global });
|
|
8333
|
-
const jsonDir =
|
|
8471
|
+
const jsonDir = join57(baseDir, basePaths.relativeDirPath);
|
|
8334
8472
|
let fileContent = null;
|
|
8335
8473
|
let relativeFilePath = "kilo.jsonc";
|
|
8336
|
-
const jsoncPath =
|
|
8337
|
-
const jsonPath =
|
|
8474
|
+
const jsoncPath = join57(jsonDir, "kilo.jsonc");
|
|
8475
|
+
const jsonPath = join57(jsonDir, "kilo.json");
|
|
8338
8476
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
8339
8477
|
if (!fileContent) {
|
|
8340
8478
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8360,11 +8498,11 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
8360
8498
|
global = false
|
|
8361
8499
|
}) {
|
|
8362
8500
|
const basePaths = this.getSettablePaths({ global });
|
|
8363
|
-
const jsonDir =
|
|
8501
|
+
const jsonDir = join57(baseDir, basePaths.relativeDirPath);
|
|
8364
8502
|
let fileContent = null;
|
|
8365
8503
|
let relativeFilePath = "kilo.jsonc";
|
|
8366
|
-
const jsoncPath =
|
|
8367
|
-
const jsonPath =
|
|
8504
|
+
const jsoncPath = join57(jsonDir, "kilo.jsonc");
|
|
8505
|
+
const jsonPath = join57(jsonDir, "kilo.json");
|
|
8368
8506
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
8369
8507
|
if (!fileContent) {
|
|
8370
8508
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8423,7 +8561,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
8423
8561
|
};
|
|
8424
8562
|
|
|
8425
8563
|
// src/features/mcp/kiro-mcp.ts
|
|
8426
|
-
import { join as
|
|
8564
|
+
import { join as join58 } from "path";
|
|
8427
8565
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
8428
8566
|
json;
|
|
8429
8567
|
constructor(params) {
|
|
@@ -8435,7 +8573,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
8435
8573
|
}
|
|
8436
8574
|
static getSettablePaths() {
|
|
8437
8575
|
return {
|
|
8438
|
-
relativeDirPath:
|
|
8576
|
+
relativeDirPath: join58(".kiro", "settings"),
|
|
8439
8577
|
relativeFilePath: "mcp.json"
|
|
8440
8578
|
};
|
|
8441
8579
|
}
|
|
@@ -8444,7 +8582,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
8444
8582
|
validate = true
|
|
8445
8583
|
}) {
|
|
8446
8584
|
const paths = this.getSettablePaths();
|
|
8447
|
-
const fileContent = await readFileContentOrNull(
|
|
8585
|
+
const fileContent = await readFileContentOrNull(join58(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
|
|
8448
8586
|
return new _KiroMcp({
|
|
8449
8587
|
baseDir,
|
|
8450
8588
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -8492,7 +8630,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
8492
8630
|
};
|
|
8493
8631
|
|
|
8494
8632
|
// src/features/mcp/opencode-mcp.ts
|
|
8495
|
-
import { join as
|
|
8633
|
+
import { join as join59 } from "path";
|
|
8496
8634
|
import { parse as parseJsonc4 } from "jsonc-parser";
|
|
8497
8635
|
import { z as z25 } from "zod/mini";
|
|
8498
8636
|
var OpencodeMcpLocalServerSchema = z25.object({
|
|
@@ -8633,7 +8771,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8633
8771
|
static getSettablePaths({ global } = {}) {
|
|
8634
8772
|
if (global) {
|
|
8635
8773
|
return {
|
|
8636
|
-
relativeDirPath:
|
|
8774
|
+
relativeDirPath: join59(".config", "opencode"),
|
|
8637
8775
|
relativeFilePath: "opencode.json"
|
|
8638
8776
|
};
|
|
8639
8777
|
}
|
|
@@ -8648,11 +8786,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8648
8786
|
global = false
|
|
8649
8787
|
}) {
|
|
8650
8788
|
const basePaths = this.getSettablePaths({ global });
|
|
8651
|
-
const jsonDir =
|
|
8789
|
+
const jsonDir = join59(baseDir, basePaths.relativeDirPath);
|
|
8652
8790
|
let fileContent = null;
|
|
8653
8791
|
let relativeFilePath = "opencode.jsonc";
|
|
8654
|
-
const jsoncPath =
|
|
8655
|
-
const jsonPath =
|
|
8792
|
+
const jsoncPath = join59(jsonDir, "opencode.jsonc");
|
|
8793
|
+
const jsonPath = join59(jsonDir, "opencode.json");
|
|
8656
8794
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
8657
8795
|
if (!fileContent) {
|
|
8658
8796
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8678,11 +8816,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8678
8816
|
global = false
|
|
8679
8817
|
}) {
|
|
8680
8818
|
const basePaths = this.getSettablePaths({ global });
|
|
8681
|
-
const jsonDir =
|
|
8819
|
+
const jsonDir = join59(baseDir, basePaths.relativeDirPath);
|
|
8682
8820
|
let fileContent = null;
|
|
8683
8821
|
let relativeFilePath = "opencode.jsonc";
|
|
8684
|
-
const jsoncPath =
|
|
8685
|
-
const jsonPath =
|
|
8822
|
+
const jsoncPath = join59(jsonDir, "opencode.jsonc");
|
|
8823
|
+
const jsonPath = join59(jsonDir, "opencode.json");
|
|
8686
8824
|
fileContent = await readFileContentOrNull(jsoncPath);
|
|
8687
8825
|
if (!fileContent) {
|
|
8688
8826
|
fileContent = await readFileContentOrNull(jsonPath);
|
|
@@ -8743,7 +8881,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
8743
8881
|
};
|
|
8744
8882
|
|
|
8745
8883
|
// src/features/mcp/roo-mcp.ts
|
|
8746
|
-
import { join as
|
|
8884
|
+
import { join as join60 } from "path";
|
|
8747
8885
|
function convertToRooFormat(mcpServers) {
|
|
8748
8886
|
return Object.fromEntries(
|
|
8749
8887
|
Object.entries(mcpServers).map(([serverName, serverConfig]) => {
|
|
@@ -8795,7 +8933,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
8795
8933
|
validate = true
|
|
8796
8934
|
}) {
|
|
8797
8935
|
const fileContent = await readFileContent(
|
|
8798
|
-
|
|
8936
|
+
join60(
|
|
8799
8937
|
baseDir,
|
|
8800
8938
|
this.getSettablePaths().relativeDirPath,
|
|
8801
8939
|
this.getSettablePaths().relativeFilePath
|
|
@@ -8850,9 +8988,9 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
8850
8988
|
};
|
|
8851
8989
|
|
|
8852
8990
|
// src/features/mcp/rovodev-mcp.ts
|
|
8853
|
-
import { join as
|
|
8991
|
+
import { join as join61 } from "path";
|
|
8854
8992
|
function parseRovodevMcpJson(fileContent, relativeDirPath, relativeFilePath) {
|
|
8855
|
-
const configPath =
|
|
8993
|
+
const configPath = join61(relativeDirPath, relativeFilePath);
|
|
8856
8994
|
let parsed;
|
|
8857
8995
|
try {
|
|
8858
8996
|
parsed = JSON.parse(fileContent);
|
|
@@ -8901,7 +9039,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
8901
9039
|
throw new Error("Rovodev MCP is global-only; use --global to sync ~/.rovodev/mcp.json");
|
|
8902
9040
|
}
|
|
8903
9041
|
const paths = this.getSettablePaths({ global });
|
|
8904
|
-
const filePath =
|
|
9042
|
+
const filePath = join61(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
8905
9043
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
|
|
8906
9044
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
8907
9045
|
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
@@ -8925,7 +9063,7 @@ var RovodevMcp = class _RovodevMcp extends ToolMcp {
|
|
|
8925
9063
|
}
|
|
8926
9064
|
const paths = this.getSettablePaths({ global });
|
|
8927
9065
|
const fileContent = await readOrInitializeFileContent(
|
|
8928
|
-
|
|
9066
|
+
join61(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
8929
9067
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
8930
9068
|
);
|
|
8931
9069
|
const json = parseRovodevMcpJson(fileContent, paths.relativeDirPath, paths.relativeFilePath);
|
|
@@ -9328,11 +9466,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
9328
9466
|
import { z as z31 } from "zod/mini";
|
|
9329
9467
|
|
|
9330
9468
|
// src/features/permissions/claudecode-permissions.ts
|
|
9331
|
-
import { join as
|
|
9469
|
+
import { join as join63 } from "path";
|
|
9332
9470
|
import { uniq as uniq3 } from "es-toolkit";
|
|
9333
9471
|
|
|
9334
9472
|
// src/features/permissions/rulesync-permissions.ts
|
|
9335
|
-
import { join as
|
|
9473
|
+
import { join as join62 } from "path";
|
|
9336
9474
|
|
|
9337
9475
|
// src/types/permissions.ts
|
|
9338
9476
|
import { z as z27 } from "zod/mini";
|
|
@@ -9377,7 +9515,7 @@ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
|
|
|
9377
9515
|
validate = true
|
|
9378
9516
|
}) {
|
|
9379
9517
|
const paths = _RulesyncPermissions.getSettablePaths();
|
|
9380
|
-
const filePath =
|
|
9518
|
+
const filePath = join62(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9381
9519
|
if (!await fileExists(filePath)) {
|
|
9382
9520
|
throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
|
|
9383
9521
|
}
|
|
@@ -9485,7 +9623,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
9485
9623
|
validate = true
|
|
9486
9624
|
}) {
|
|
9487
9625
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
9488
|
-
const filePath =
|
|
9626
|
+
const filePath = join63(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9489
9627
|
const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
|
|
9490
9628
|
return new _ClaudecodePermissions({
|
|
9491
9629
|
baseDir,
|
|
@@ -9501,7 +9639,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
9501
9639
|
logger
|
|
9502
9640
|
}) {
|
|
9503
9641
|
const paths = _ClaudecodePermissions.getSettablePaths();
|
|
9504
|
-
const filePath =
|
|
9642
|
+
const filePath = join63(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9505
9643
|
const existingContent = await readOrInitializeFileContent(
|
|
9506
9644
|
filePath,
|
|
9507
9645
|
JSON.stringify({}, null, 2)
|
|
@@ -9578,7 +9716,7 @@ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions
|
|
|
9578
9716
|
settings = JSON.parse(this.getFileContent());
|
|
9579
9717
|
} catch (error) {
|
|
9580
9718
|
throw new Error(
|
|
9581
|
-
`Failed to parse Claude permissions content in ${
|
|
9719
|
+
`Failed to parse Claude permissions content in ${join63(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9582
9720
|
{ cause: error }
|
|
9583
9721
|
);
|
|
9584
9722
|
}
|
|
@@ -9651,7 +9789,7 @@ function convertClaudeToRulesyncPermissions(params) {
|
|
|
9651
9789
|
}
|
|
9652
9790
|
|
|
9653
9791
|
// src/features/permissions/codexcli-permissions.ts
|
|
9654
|
-
import { join as
|
|
9792
|
+
import { join as join64 } from "path";
|
|
9655
9793
|
import * as smolToml4 from "smol-toml";
|
|
9656
9794
|
var RULESYNC_PROFILE_NAME = "rulesync";
|
|
9657
9795
|
var RULESYNC_BASH_RULES_FILE_NAME = "rulesync.rules";
|
|
@@ -9671,7 +9809,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
9671
9809
|
global = false
|
|
9672
9810
|
}) {
|
|
9673
9811
|
const paths = this.getSettablePaths({ global });
|
|
9674
|
-
const filePath =
|
|
9812
|
+
const filePath = join64(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9675
9813
|
const fileContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
9676
9814
|
return new _CodexcliPermissions({
|
|
9677
9815
|
baseDir,
|
|
@@ -9689,7 +9827,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
9689
9827
|
global = false
|
|
9690
9828
|
}) {
|
|
9691
9829
|
const paths = this.getSettablePaths({ global });
|
|
9692
|
-
const filePath =
|
|
9830
|
+
const filePath = join64(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9693
9831
|
const existingContent = await readFileContentOrNull(filePath) ?? smolToml4.stringify({});
|
|
9694
9832
|
const parsed = toMutableTable(smolToml4.parse(existingContent));
|
|
9695
9833
|
const profile = convertRulesyncToCodexProfile({
|
|
@@ -9714,7 +9852,7 @@ var CodexcliPermissions = class _CodexcliPermissions extends ToolPermissions {
|
|
|
9714
9852
|
parsed = smolToml4.parse(this.getFileContent());
|
|
9715
9853
|
} catch (error) {
|
|
9716
9854
|
throw new Error(
|
|
9717
|
-
`Failed to parse Codex CLI permissions content in ${
|
|
9855
|
+
`Failed to parse Codex CLI permissions content in ${join64(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9718
9856
|
{ cause: error }
|
|
9719
9857
|
);
|
|
9720
9858
|
}
|
|
@@ -9755,7 +9893,7 @@ function createCodexcliBashRulesFile({
|
|
|
9755
9893
|
}) {
|
|
9756
9894
|
return new CodexcliRulesFile({
|
|
9757
9895
|
baseDir,
|
|
9758
|
-
relativeDirPath:
|
|
9896
|
+
relativeDirPath: join64(".codex", "rules"),
|
|
9759
9897
|
relativeFilePath: RULESYNC_BASH_RULES_FILE_NAME,
|
|
9760
9898
|
fileContent: buildCodexBashRulesContent(config)
|
|
9761
9899
|
});
|
|
@@ -9910,10 +10048,10 @@ function mapBashActionToDecision(action) {
|
|
|
9910
10048
|
}
|
|
9911
10049
|
|
|
9912
10050
|
// src/features/permissions/geminicli-permissions.ts
|
|
9913
|
-
import { join as
|
|
10051
|
+
import { join as join65 } from "path";
|
|
9914
10052
|
import * as smolToml5 from "smol-toml";
|
|
9915
10053
|
import { z as z28 } from "zod/mini";
|
|
9916
|
-
var GEMINICLI_POLICY_RELATIVE_DIR_PATH =
|
|
10054
|
+
var GEMINICLI_POLICY_RELATIVE_DIR_PATH = join65(".gemini", "policies");
|
|
9917
10055
|
var GEMINICLI_POLICY_FILE_NAME = "rulesync.toml";
|
|
9918
10056
|
var RULESYNC_TO_GEMINICLI_TOOL_NAME = {
|
|
9919
10057
|
bash: "run_shell_command",
|
|
@@ -9954,7 +10092,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
9954
10092
|
global = false
|
|
9955
10093
|
}) {
|
|
9956
10094
|
const paths = this.getSettablePaths({ global });
|
|
9957
|
-
const filePath =
|
|
10095
|
+
const filePath = join65(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
9958
10096
|
const fileContent = await readFileContentOrNull(filePath) ?? "";
|
|
9959
10097
|
return new _GeminicliPermissions({
|
|
9960
10098
|
baseDir,
|
|
@@ -9990,7 +10128,7 @@ var GeminicliPermissions = class _GeminicliPermissions extends ToolPermissions {
|
|
|
9990
10128
|
parsed = smolToml5.parse(fileContent);
|
|
9991
10129
|
} catch (error) {
|
|
9992
10130
|
throw new Error(
|
|
9993
|
-
`Failed to parse Gemini CLI policy TOML in ${
|
|
10131
|
+
`Failed to parse Gemini CLI policy TOML in ${join65(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
9994
10132
|
{ cause: error }
|
|
9995
10133
|
);
|
|
9996
10134
|
}
|
|
@@ -10282,7 +10420,7 @@ function extractPattern(rule) {
|
|
|
10282
10420
|
}
|
|
10283
10421
|
|
|
10284
10422
|
// src/features/permissions/kiro-permissions.ts
|
|
10285
|
-
import { join as
|
|
10423
|
+
import { join as join66 } from "path";
|
|
10286
10424
|
import { z as z29 } from "zod/mini";
|
|
10287
10425
|
var KiroAgentSchema = z29.looseObject({
|
|
10288
10426
|
allowedTools: z29.optional(z29.array(z29.string())),
|
|
@@ -10292,7 +10430,7 @@ var UnknownRecordSchema = z29.record(z29.string(), z29.unknown());
|
|
|
10292
10430
|
var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
10293
10431
|
static getSettablePaths(_options = {}) {
|
|
10294
10432
|
return {
|
|
10295
|
-
relativeDirPath:
|
|
10433
|
+
relativeDirPath: join66(".kiro", "agents"),
|
|
10296
10434
|
relativeFilePath: "default.json"
|
|
10297
10435
|
};
|
|
10298
10436
|
}
|
|
@@ -10304,7 +10442,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
10304
10442
|
validate = true
|
|
10305
10443
|
}) {
|
|
10306
10444
|
const paths = this.getSettablePaths();
|
|
10307
|
-
const filePath =
|
|
10445
|
+
const filePath = join66(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
10308
10446
|
const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
10309
10447
|
return new _KiroPermissions({
|
|
10310
10448
|
baseDir,
|
|
@@ -10321,7 +10459,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
10321
10459
|
logger
|
|
10322
10460
|
}) {
|
|
10323
10461
|
const paths = this.getSettablePaths();
|
|
10324
|
-
const filePath =
|
|
10462
|
+
const filePath = join66(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
10325
10463
|
const existingContent = await readFileContentOrNull(filePath) ?? JSON.stringify({}, null, 2);
|
|
10326
10464
|
const parsedResult = KiroAgentSchema.safeParse(JSON.parse(existingContent));
|
|
10327
10465
|
if (!parsedResult.success) {
|
|
@@ -10345,7 +10483,7 @@ var KiroPermissions = class _KiroPermissions extends ToolPermissions {
|
|
|
10345
10483
|
parsed = KiroAgentSchema.parse(JSON.parse(this.getFileContent()));
|
|
10346
10484
|
} catch (error) {
|
|
10347
10485
|
throw new Error(
|
|
10348
|
-
`Failed to parse Kiro permissions content in ${
|
|
10486
|
+
`Failed to parse Kiro permissions content in ${join66(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
|
|
10349
10487
|
{ cause: error }
|
|
10350
10488
|
);
|
|
10351
10489
|
}
|
|
@@ -10470,7 +10608,7 @@ function asStringArray(value) {
|
|
|
10470
10608
|
}
|
|
10471
10609
|
|
|
10472
10610
|
// src/features/permissions/opencode-permissions.ts
|
|
10473
|
-
import { join as
|
|
10611
|
+
import { join as join67 } from "path";
|
|
10474
10612
|
import { parse as parseJsonc5 } from "jsonc-parser";
|
|
10475
10613
|
import { z as z30 } from "zod/mini";
|
|
10476
10614
|
var OpencodePermissionSchema = z30.union([
|
|
@@ -10495,7 +10633,7 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
10495
10633
|
static getSettablePaths({
|
|
10496
10634
|
global = false
|
|
10497
10635
|
} = {}) {
|
|
10498
|
-
return global ? { relativeDirPath:
|
|
10636
|
+
return global ? { relativeDirPath: join67(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
|
|
10499
10637
|
}
|
|
10500
10638
|
static async fromFile({
|
|
10501
10639
|
baseDir = process.cwd(),
|
|
@@ -10503,9 +10641,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
10503
10641
|
global = false
|
|
10504
10642
|
}) {
|
|
10505
10643
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
10506
|
-
const jsonDir =
|
|
10507
|
-
const jsoncPath =
|
|
10508
|
-
const jsonPath =
|
|
10644
|
+
const jsonDir = join67(baseDir, basePaths.relativeDirPath);
|
|
10645
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10646
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10509
10647
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
10510
10648
|
let relativeFilePath = "opencode.jsonc";
|
|
10511
10649
|
if (!fileContent) {
|
|
@@ -10530,9 +10668,9 @@ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
|
|
|
10530
10668
|
global = false
|
|
10531
10669
|
}) {
|
|
10532
10670
|
const basePaths = _OpencodePermissions.getSettablePaths({ global });
|
|
10533
|
-
const jsonDir =
|
|
10534
|
-
const jsoncPath =
|
|
10535
|
-
const jsonPath =
|
|
10671
|
+
const jsonDir = join67(baseDir, basePaths.relativeDirPath);
|
|
10672
|
+
const jsoncPath = join67(jsonDir, "opencode.jsonc");
|
|
10673
|
+
const jsonPath = join67(jsonDir, "opencode.json");
|
|
10536
10674
|
let fileContent = await readFileContentOrNull(jsoncPath);
|
|
10537
10675
|
let relativeFilePath = "opencode.jsonc";
|
|
10538
10676
|
if (!fileContent) {
|
|
@@ -10772,7 +10910,7 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10772
10910
|
};
|
|
10773
10911
|
|
|
10774
10912
|
// src/features/rules/rules-processor.ts
|
|
10775
|
-
import { basename as basename10, dirname as dirname3, join as
|
|
10913
|
+
import { basename as basename10, dirname as dirname3, join as join141, relative as relative6 } from "path";
|
|
10776
10914
|
import { encode } from "@toon-format/toon";
|
|
10777
10915
|
import { z as z71 } from "zod/mini";
|
|
10778
10916
|
|
|
@@ -10780,17 +10918,17 @@ import { z as z71 } from "zod/mini";
|
|
|
10780
10918
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
10781
10919
|
|
|
10782
10920
|
// src/features/skills/agentsmd-skill.ts
|
|
10783
|
-
import { join as
|
|
10921
|
+
import { join as join71 } from "path";
|
|
10784
10922
|
|
|
10785
10923
|
// src/features/skills/simulated-skill.ts
|
|
10786
|
-
import { join as
|
|
10924
|
+
import { join as join70 } from "path";
|
|
10787
10925
|
import { z as z32 } from "zod/mini";
|
|
10788
10926
|
|
|
10789
10927
|
// src/features/skills/tool-skill.ts
|
|
10790
|
-
import { join as
|
|
10928
|
+
import { join as join69 } from "path";
|
|
10791
10929
|
|
|
10792
10930
|
// src/types/ai-dir.ts
|
|
10793
|
-
import path2, { basename as basename3, join as
|
|
10931
|
+
import path2, { basename as basename3, join as join68, relative as relative4, resolve as resolve4 } from "path";
|
|
10794
10932
|
var AiDir = class {
|
|
10795
10933
|
/**
|
|
10796
10934
|
* @example "."
|
|
@@ -10887,8 +11025,8 @@ var AiDir = class {
|
|
|
10887
11025
|
* @returns Array of files with their relative paths and buffers
|
|
10888
11026
|
*/
|
|
10889
11027
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
10890
|
-
const dirPath =
|
|
10891
|
-
const glob =
|
|
11028
|
+
const dirPath = join68(baseDir, relativeDirPath, dirName);
|
|
11029
|
+
const glob = join68(dirPath, "**", "*");
|
|
10892
11030
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
10893
11031
|
const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
|
|
10894
11032
|
const files = await Promise.all(
|
|
@@ -10989,8 +11127,8 @@ var ToolSkill = class extends AiDir {
|
|
|
10989
11127
|
}) {
|
|
10990
11128
|
const settablePaths = getSettablePaths({ global });
|
|
10991
11129
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
10992
|
-
const skillDirPath =
|
|
10993
|
-
const skillFilePath =
|
|
11130
|
+
const skillDirPath = join69(baseDir, actualRelativeDirPath, dirName);
|
|
11131
|
+
const skillFilePath = join69(skillDirPath, SKILL_FILE_NAME);
|
|
10994
11132
|
if (!await fileExists(skillFilePath)) {
|
|
10995
11133
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
10996
11134
|
}
|
|
@@ -11014,7 +11152,7 @@ var ToolSkill = class extends AiDir {
|
|
|
11014
11152
|
}
|
|
11015
11153
|
requireMainFileFrontmatter() {
|
|
11016
11154
|
if (!this.mainFile?.frontmatter) {
|
|
11017
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
11155
|
+
throw new Error(`Frontmatter is not defined in ${join69(this.relativeDirPath, this.dirName)}`);
|
|
11018
11156
|
}
|
|
11019
11157
|
return this.mainFile.frontmatter;
|
|
11020
11158
|
}
|
|
@@ -11054,7 +11192,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
11054
11192
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
11055
11193
|
if (!result.success) {
|
|
11056
11194
|
throw new Error(
|
|
11057
|
-
`Invalid frontmatter in ${
|
|
11195
|
+
`Invalid frontmatter in ${join70(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
11058
11196
|
);
|
|
11059
11197
|
}
|
|
11060
11198
|
}
|
|
@@ -11113,8 +11251,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
11113
11251
|
}) {
|
|
11114
11252
|
const settablePaths = this.getSettablePaths();
|
|
11115
11253
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
11116
|
-
const skillDirPath =
|
|
11117
|
-
const skillFilePath =
|
|
11254
|
+
const skillDirPath = join70(baseDir, actualRelativeDirPath, dirName);
|
|
11255
|
+
const skillFilePath = join70(skillDirPath, SKILL_FILE_NAME);
|
|
11118
11256
|
if (!await fileExists(skillFilePath)) {
|
|
11119
11257
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
11120
11258
|
}
|
|
@@ -11191,7 +11329,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
11191
11329
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
11192
11330
|
}
|
|
11193
11331
|
return {
|
|
11194
|
-
relativeDirPath:
|
|
11332
|
+
relativeDirPath: join71(".agents", "skills")
|
|
11195
11333
|
};
|
|
11196
11334
|
}
|
|
11197
11335
|
static async fromDir(params) {
|
|
@@ -11218,11 +11356,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
11218
11356
|
};
|
|
11219
11357
|
|
|
11220
11358
|
// src/features/skills/factorydroid-skill.ts
|
|
11221
|
-
import { join as
|
|
11359
|
+
import { join as join72 } from "path";
|
|
11222
11360
|
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
11223
11361
|
static getSettablePaths(_options) {
|
|
11224
11362
|
return {
|
|
11225
|
-
relativeDirPath:
|
|
11363
|
+
relativeDirPath: join72(".factory", "skills")
|
|
11226
11364
|
};
|
|
11227
11365
|
}
|
|
11228
11366
|
static async fromDir(params) {
|
|
@@ -11249,11 +11387,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
|
11249
11387
|
};
|
|
11250
11388
|
|
|
11251
11389
|
// src/features/skills/rovodev-skill.ts
|
|
11252
|
-
import { join as
|
|
11390
|
+
import { join as join74 } from "path";
|
|
11253
11391
|
import { z as z34 } from "zod/mini";
|
|
11254
11392
|
|
|
11255
11393
|
// src/features/skills/rulesync-skill.ts
|
|
11256
|
-
import { join as
|
|
11394
|
+
import { join as join73 } from "path";
|
|
11257
11395
|
import { z as z33 } from "zod/mini";
|
|
11258
11396
|
var RulesyncSkillFrontmatterSchemaInternal = z33.looseObject({
|
|
11259
11397
|
name: z33.string(),
|
|
@@ -11292,7 +11430,13 @@ var RulesyncSkillFrontmatterSchemaInternal = z33.looseObject({
|
|
|
11292
11430
|
})
|
|
11293
11431
|
),
|
|
11294
11432
|
cline: z33.optional(z33.looseObject({})),
|
|
11295
|
-
roo: z33.optional(z33.looseObject({}))
|
|
11433
|
+
roo: z33.optional(z33.looseObject({})),
|
|
11434
|
+
takt: z33.optional(
|
|
11435
|
+
z33.looseObject({
|
|
11436
|
+
// Rename the emitted file stem (e.g. "test-skill.md" → "{name}.md").
|
|
11437
|
+
name: z33.optional(z33.string())
|
|
11438
|
+
})
|
|
11439
|
+
)
|
|
11296
11440
|
});
|
|
11297
11441
|
var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
|
|
11298
11442
|
var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
@@ -11332,7 +11476,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
11332
11476
|
}
|
|
11333
11477
|
getFrontmatter() {
|
|
11334
11478
|
if (!this.mainFile?.frontmatter) {
|
|
11335
|
-
throw new Error(`Frontmatter is not defined in ${
|
|
11479
|
+
throw new Error(`Frontmatter is not defined in ${join73(this.relativeDirPath, this.dirName)}`);
|
|
11336
11480
|
}
|
|
11337
11481
|
const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
11338
11482
|
return result;
|
|
@@ -11358,8 +11502,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
11358
11502
|
dirName,
|
|
11359
11503
|
global = false
|
|
11360
11504
|
}) {
|
|
11361
|
-
const skillDirPath =
|
|
11362
|
-
const skillFilePath =
|
|
11505
|
+
const skillDirPath = join73(baseDir, relativeDirPath, dirName);
|
|
11506
|
+
const skillFilePath = join73(skillDirPath, SKILL_FILE_NAME);
|
|
11363
11507
|
if (!await fileExists(skillFilePath)) {
|
|
11364
11508
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
11365
11509
|
}
|
|
@@ -11396,7 +11540,7 @@ var RovodevSkillFrontmatterSchema = z34.looseObject({
|
|
|
11396
11540
|
var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
11397
11541
|
constructor({
|
|
11398
11542
|
baseDir = process.cwd(),
|
|
11399
|
-
relativeDirPath =
|
|
11543
|
+
relativeDirPath = join74(".rovodev", "skills"),
|
|
11400
11544
|
dirName,
|
|
11401
11545
|
frontmatter,
|
|
11402
11546
|
body,
|
|
@@ -11425,8 +11569,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11425
11569
|
}
|
|
11426
11570
|
static getSettablePaths(_options) {
|
|
11427
11571
|
return {
|
|
11428
|
-
relativeDirPath:
|
|
11429
|
-
alternativeSkillRoots: [
|
|
11572
|
+
relativeDirPath: join74(".rovodev", "skills"),
|
|
11573
|
+
alternativeSkillRoots: [join74(".agents", "skills")]
|
|
11430
11574
|
};
|
|
11431
11575
|
}
|
|
11432
11576
|
getFrontmatter() {
|
|
@@ -11514,13 +11658,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11514
11658
|
});
|
|
11515
11659
|
const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11516
11660
|
if (!result.success) {
|
|
11517
|
-
const skillDirPath =
|
|
11661
|
+
const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11518
11662
|
throw new Error(
|
|
11519
|
-
`Invalid frontmatter in ${
|
|
11663
|
+
`Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11520
11664
|
);
|
|
11521
11665
|
}
|
|
11522
11666
|
if (result.data.name !== loaded.dirName) {
|
|
11523
|
-
const skillFilePath =
|
|
11667
|
+
const skillFilePath = join74(
|
|
11524
11668
|
loaded.baseDir,
|
|
11525
11669
|
loaded.relativeDirPath,
|
|
11526
11670
|
loaded.dirName,
|
|
@@ -11562,11 +11706,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11562
11706
|
};
|
|
11563
11707
|
|
|
11564
11708
|
// src/features/skills/skills-processor.ts
|
|
11565
|
-
import { basename as basename5, join as
|
|
11709
|
+
import { basename as basename5, join as join94 } from "path";
|
|
11566
11710
|
import { z as z51 } from "zod/mini";
|
|
11567
11711
|
|
|
11568
11712
|
// src/types/dir-feature-processor.ts
|
|
11569
|
-
import { join as
|
|
11713
|
+
import { join as join75 } from "path";
|
|
11570
11714
|
var DirFeatureProcessor = class {
|
|
11571
11715
|
baseDir;
|
|
11572
11716
|
dryRun;
|
|
@@ -11606,7 +11750,7 @@ var DirFeatureProcessor = class {
|
|
|
11606
11750
|
const mainFile = aiDir.getMainFile();
|
|
11607
11751
|
let mainFileContent;
|
|
11608
11752
|
if (mainFile) {
|
|
11609
|
-
const mainFilePath =
|
|
11753
|
+
const mainFilePath = join75(dirPath, mainFile.name);
|
|
11610
11754
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
|
|
11611
11755
|
avoidBlockScalars: this.avoidBlockScalars
|
|
11612
11756
|
});
|
|
@@ -11626,7 +11770,7 @@ var DirFeatureProcessor = class {
|
|
|
11626
11770
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
11627
11771
|
otherFileContents.push(contentWithNewline);
|
|
11628
11772
|
if (!dirHasChanges) {
|
|
11629
|
-
const filePath =
|
|
11773
|
+
const filePath = join75(dirPath, file.relativeFilePathToDirPath);
|
|
11630
11774
|
const existingContent = await readFileContentOrNull(filePath);
|
|
11631
11775
|
if (!fileContentsEquivalent({
|
|
11632
11776
|
filePath,
|
|
@@ -11644,24 +11788,24 @@ var DirFeatureProcessor = class {
|
|
|
11644
11788
|
if (this.dryRun) {
|
|
11645
11789
|
this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
|
|
11646
11790
|
if (mainFile) {
|
|
11647
|
-
this.logger.info(`[DRY RUN] Would write: ${
|
|
11648
|
-
changedPaths.push(
|
|
11791
|
+
this.logger.info(`[DRY RUN] Would write: ${join75(dirPath, mainFile.name)}`);
|
|
11792
|
+
changedPaths.push(join75(relativeDir, mainFile.name));
|
|
11649
11793
|
}
|
|
11650
11794
|
for (const file of otherFiles) {
|
|
11651
11795
|
this.logger.info(
|
|
11652
|
-
`[DRY RUN] Would write: ${
|
|
11796
|
+
`[DRY RUN] Would write: ${join75(dirPath, file.relativeFilePathToDirPath)}`
|
|
11653
11797
|
);
|
|
11654
|
-
changedPaths.push(
|
|
11798
|
+
changedPaths.push(join75(relativeDir, file.relativeFilePathToDirPath));
|
|
11655
11799
|
}
|
|
11656
11800
|
} else {
|
|
11657
11801
|
await ensureDir(dirPath);
|
|
11658
11802
|
if (mainFile && mainFileContent) {
|
|
11659
|
-
const mainFilePath =
|
|
11803
|
+
const mainFilePath = join75(dirPath, mainFile.name);
|
|
11660
11804
|
await writeFileContent(mainFilePath, mainFileContent);
|
|
11661
|
-
changedPaths.push(
|
|
11805
|
+
changedPaths.push(join75(relativeDir, mainFile.name));
|
|
11662
11806
|
}
|
|
11663
11807
|
for (const [i, file] of otherFiles.entries()) {
|
|
11664
|
-
const filePath =
|
|
11808
|
+
const filePath = join75(dirPath, file.relativeFilePathToDirPath);
|
|
11665
11809
|
const content = otherFileContents[i];
|
|
11666
11810
|
if (content === void 0) {
|
|
11667
11811
|
throw new Error(
|
|
@@ -11669,7 +11813,7 @@ var DirFeatureProcessor = class {
|
|
|
11669
11813
|
);
|
|
11670
11814
|
}
|
|
11671
11815
|
await writeFileContent(filePath, content);
|
|
11672
|
-
changedPaths.push(
|
|
11816
|
+
changedPaths.push(join75(relativeDir, file.relativeFilePathToDirPath));
|
|
11673
11817
|
}
|
|
11674
11818
|
}
|
|
11675
11819
|
changedCount++;
|
|
@@ -11701,7 +11845,7 @@ var DirFeatureProcessor = class {
|
|
|
11701
11845
|
};
|
|
11702
11846
|
|
|
11703
11847
|
// src/features/skills/agentsskills-skill.ts
|
|
11704
|
-
import { join as
|
|
11848
|
+
import { join as join76 } from "path";
|
|
11705
11849
|
import { z as z35 } from "zod/mini";
|
|
11706
11850
|
var AgentsSkillsSkillFrontmatterSchema = z35.looseObject({
|
|
11707
11851
|
name: z35.string(),
|
|
@@ -11710,7 +11854,7 @@ var AgentsSkillsSkillFrontmatterSchema = z35.looseObject({
|
|
|
11710
11854
|
var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
11711
11855
|
constructor({
|
|
11712
11856
|
baseDir = process.cwd(),
|
|
11713
|
-
relativeDirPath =
|
|
11857
|
+
relativeDirPath = join76(".agents", "skills"),
|
|
11714
11858
|
dirName,
|
|
11715
11859
|
frontmatter,
|
|
11716
11860
|
body,
|
|
@@ -11742,7 +11886,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11742
11886
|
throw new Error("AgentsSkillsSkill does not support global mode.");
|
|
11743
11887
|
}
|
|
11744
11888
|
return {
|
|
11745
|
-
relativeDirPath:
|
|
11889
|
+
relativeDirPath: join76(".agents", "skills")
|
|
11746
11890
|
};
|
|
11747
11891
|
}
|
|
11748
11892
|
getFrontmatter() {
|
|
@@ -11822,9 +11966,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11822
11966
|
});
|
|
11823
11967
|
const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11824
11968
|
if (!result.success) {
|
|
11825
|
-
const skillDirPath =
|
|
11969
|
+
const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11826
11970
|
throw new Error(
|
|
11827
|
-
`Invalid frontmatter in ${
|
|
11971
|
+
`Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11828
11972
|
);
|
|
11829
11973
|
}
|
|
11830
11974
|
return new _AgentsSkillsSkill({
|
|
@@ -11859,7 +12003,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
|
|
|
11859
12003
|
};
|
|
11860
12004
|
|
|
11861
12005
|
// src/features/skills/antigravity-skill.ts
|
|
11862
|
-
import { join as
|
|
12006
|
+
import { join as join77 } from "path";
|
|
11863
12007
|
import { z as z36 } from "zod/mini";
|
|
11864
12008
|
var AntigravitySkillFrontmatterSchema = z36.looseObject({
|
|
11865
12009
|
name: z36.string(),
|
|
@@ -11868,7 +12012,7 @@ var AntigravitySkillFrontmatterSchema = z36.looseObject({
|
|
|
11868
12012
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
11869
12013
|
constructor({
|
|
11870
12014
|
baseDir = process.cwd(),
|
|
11871
|
-
relativeDirPath =
|
|
12015
|
+
relativeDirPath = join77(".agent", "skills"),
|
|
11872
12016
|
dirName,
|
|
11873
12017
|
frontmatter,
|
|
11874
12018
|
body,
|
|
@@ -11900,11 +12044,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11900
12044
|
} = {}) {
|
|
11901
12045
|
if (global) {
|
|
11902
12046
|
return {
|
|
11903
|
-
relativeDirPath:
|
|
12047
|
+
relativeDirPath: join77(".gemini", "antigravity", "skills")
|
|
11904
12048
|
};
|
|
11905
12049
|
}
|
|
11906
12050
|
return {
|
|
11907
|
-
relativeDirPath:
|
|
12051
|
+
relativeDirPath: join77(".agent", "skills")
|
|
11908
12052
|
};
|
|
11909
12053
|
}
|
|
11910
12054
|
getFrontmatter() {
|
|
@@ -11984,9 +12128,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
11984
12128
|
});
|
|
11985
12129
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
11986
12130
|
if (!result.success) {
|
|
11987
|
-
const skillDirPath =
|
|
12131
|
+
const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
11988
12132
|
throw new Error(
|
|
11989
|
-
`Invalid frontmatter in ${
|
|
12133
|
+
`Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
11990
12134
|
);
|
|
11991
12135
|
}
|
|
11992
12136
|
return new _AntigravitySkill({
|
|
@@ -12020,7 +12164,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
12020
12164
|
};
|
|
12021
12165
|
|
|
12022
12166
|
// src/features/skills/claudecode-skill.ts
|
|
12023
|
-
import { join as
|
|
12167
|
+
import { join as join78 } from "path";
|
|
12024
12168
|
import { z as z37 } from "zod/mini";
|
|
12025
12169
|
var ClaudecodeSkillFrontmatterSchema = z37.looseObject({
|
|
12026
12170
|
name: z37.string(),
|
|
@@ -12032,7 +12176,7 @@ var ClaudecodeSkillFrontmatterSchema = z37.looseObject({
|
|
|
12032
12176
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
12033
12177
|
constructor({
|
|
12034
12178
|
baseDir = process.cwd(),
|
|
12035
|
-
relativeDirPath =
|
|
12179
|
+
relativeDirPath = join78(".claude", "skills"),
|
|
12036
12180
|
dirName,
|
|
12037
12181
|
frontmatter,
|
|
12038
12182
|
body,
|
|
@@ -12063,7 +12207,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
12063
12207
|
global: _global = false
|
|
12064
12208
|
} = {}) {
|
|
12065
12209
|
return {
|
|
12066
|
-
relativeDirPath:
|
|
12210
|
+
relativeDirPath: join78(".claude", "skills")
|
|
12067
12211
|
};
|
|
12068
12212
|
}
|
|
12069
12213
|
getFrontmatter() {
|
|
@@ -12160,9 +12304,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
12160
12304
|
});
|
|
12161
12305
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12162
12306
|
if (!result.success) {
|
|
12163
|
-
const skillDirPath =
|
|
12307
|
+
const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12164
12308
|
throw new Error(
|
|
12165
|
-
`Invalid frontmatter in ${
|
|
12309
|
+
`Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12166
12310
|
);
|
|
12167
12311
|
}
|
|
12168
12312
|
return new _ClaudecodeSkill({
|
|
@@ -12196,7 +12340,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
12196
12340
|
};
|
|
12197
12341
|
|
|
12198
12342
|
// src/features/skills/cline-skill.ts
|
|
12199
|
-
import { join as
|
|
12343
|
+
import { join as join79 } from "path";
|
|
12200
12344
|
import { z as z38 } from "zod/mini";
|
|
12201
12345
|
var ClineSkillFrontmatterSchema = z38.looseObject({
|
|
12202
12346
|
name: z38.string(),
|
|
@@ -12205,7 +12349,7 @@ var ClineSkillFrontmatterSchema = z38.looseObject({
|
|
|
12205
12349
|
var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
12206
12350
|
constructor({
|
|
12207
12351
|
baseDir = process.cwd(),
|
|
12208
|
-
relativeDirPath =
|
|
12352
|
+
relativeDirPath = join79(".cline", "skills"),
|
|
12209
12353
|
dirName,
|
|
12210
12354
|
frontmatter,
|
|
12211
12355
|
body,
|
|
@@ -12234,7 +12378,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
12234
12378
|
}
|
|
12235
12379
|
static getSettablePaths(_options = {}) {
|
|
12236
12380
|
return {
|
|
12237
|
-
relativeDirPath:
|
|
12381
|
+
relativeDirPath: join79(".cline", "skills")
|
|
12238
12382
|
};
|
|
12239
12383
|
}
|
|
12240
12384
|
getFrontmatter() {
|
|
@@ -12322,13 +12466,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
12322
12466
|
});
|
|
12323
12467
|
const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12324
12468
|
if (!result.success) {
|
|
12325
|
-
const skillDirPath =
|
|
12469
|
+
const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12326
12470
|
throw new Error(
|
|
12327
|
-
`Invalid frontmatter in ${
|
|
12471
|
+
`Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12328
12472
|
);
|
|
12329
12473
|
}
|
|
12330
12474
|
if (result.data.name !== loaded.dirName) {
|
|
12331
|
-
const skillFilePath =
|
|
12475
|
+
const skillFilePath = join79(
|
|
12332
12476
|
loaded.baseDir,
|
|
12333
12477
|
loaded.relativeDirPath,
|
|
12334
12478
|
loaded.dirName,
|
|
@@ -12369,7 +12513,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
|
|
|
12369
12513
|
};
|
|
12370
12514
|
|
|
12371
12515
|
// src/features/skills/codexcli-skill.ts
|
|
12372
|
-
import { join as
|
|
12516
|
+
import { join as join80 } from "path";
|
|
12373
12517
|
import { z as z39 } from "zod/mini";
|
|
12374
12518
|
var CodexCliSkillFrontmatterSchema = z39.looseObject({
|
|
12375
12519
|
name: z39.string(),
|
|
@@ -12383,7 +12527,7 @@ var CodexCliSkillFrontmatterSchema = z39.looseObject({
|
|
|
12383
12527
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
12384
12528
|
constructor({
|
|
12385
12529
|
baseDir = process.cwd(),
|
|
12386
|
-
relativeDirPath =
|
|
12530
|
+
relativeDirPath = join80(".codex", "skills"),
|
|
12387
12531
|
dirName,
|
|
12388
12532
|
frontmatter,
|
|
12389
12533
|
body,
|
|
@@ -12414,7 +12558,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
12414
12558
|
global: _global = false
|
|
12415
12559
|
} = {}) {
|
|
12416
12560
|
return {
|
|
12417
|
-
relativeDirPath:
|
|
12561
|
+
relativeDirPath: join80(".codex", "skills")
|
|
12418
12562
|
};
|
|
12419
12563
|
}
|
|
12420
12564
|
getFrontmatter() {
|
|
@@ -12504,9 +12648,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
12504
12648
|
});
|
|
12505
12649
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12506
12650
|
if (!result.success) {
|
|
12507
|
-
const skillDirPath =
|
|
12651
|
+
const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12508
12652
|
throw new Error(
|
|
12509
|
-
`Invalid frontmatter in ${
|
|
12653
|
+
`Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12510
12654
|
);
|
|
12511
12655
|
}
|
|
12512
12656
|
return new _CodexCliSkill({
|
|
@@ -12540,7 +12684,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
12540
12684
|
};
|
|
12541
12685
|
|
|
12542
12686
|
// src/features/skills/copilot-skill.ts
|
|
12543
|
-
import { join as
|
|
12687
|
+
import { join as join81 } from "path";
|
|
12544
12688
|
import { z as z40 } from "zod/mini";
|
|
12545
12689
|
var CopilotSkillFrontmatterSchema = z40.looseObject({
|
|
12546
12690
|
name: z40.string(),
|
|
@@ -12550,7 +12694,7 @@ var CopilotSkillFrontmatterSchema = z40.looseObject({
|
|
|
12550
12694
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
12551
12695
|
constructor({
|
|
12552
12696
|
baseDir = process.cwd(),
|
|
12553
|
-
relativeDirPath =
|
|
12697
|
+
relativeDirPath = join81(".github", "skills"),
|
|
12554
12698
|
dirName,
|
|
12555
12699
|
frontmatter,
|
|
12556
12700
|
body,
|
|
@@ -12582,7 +12726,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12582
12726
|
throw new Error("CopilotSkill does not support global mode.");
|
|
12583
12727
|
}
|
|
12584
12728
|
return {
|
|
12585
|
-
relativeDirPath:
|
|
12729
|
+
relativeDirPath: join81(".github", "skills")
|
|
12586
12730
|
};
|
|
12587
12731
|
}
|
|
12588
12732
|
getFrontmatter() {
|
|
@@ -12668,9 +12812,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12668
12812
|
});
|
|
12669
12813
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12670
12814
|
if (!result.success) {
|
|
12671
|
-
const skillDirPath =
|
|
12815
|
+
const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12672
12816
|
throw new Error(
|
|
12673
|
-
`Invalid frontmatter in ${
|
|
12817
|
+
`Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12674
12818
|
);
|
|
12675
12819
|
}
|
|
12676
12820
|
return new _CopilotSkill({
|
|
@@ -12705,7 +12849,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
12705
12849
|
};
|
|
12706
12850
|
|
|
12707
12851
|
// src/features/skills/cursor-skill.ts
|
|
12708
|
-
import { join as
|
|
12852
|
+
import { join as join82 } from "path";
|
|
12709
12853
|
import { z as z41 } from "zod/mini";
|
|
12710
12854
|
var CursorSkillFrontmatterSchema = z41.looseObject({
|
|
12711
12855
|
name: z41.string(),
|
|
@@ -12714,7 +12858,7 @@ var CursorSkillFrontmatterSchema = z41.looseObject({
|
|
|
12714
12858
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
12715
12859
|
constructor({
|
|
12716
12860
|
baseDir = process.cwd(),
|
|
12717
|
-
relativeDirPath =
|
|
12861
|
+
relativeDirPath = join82(".cursor", "skills"),
|
|
12718
12862
|
dirName,
|
|
12719
12863
|
frontmatter,
|
|
12720
12864
|
body,
|
|
@@ -12743,7 +12887,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12743
12887
|
}
|
|
12744
12888
|
static getSettablePaths(_options) {
|
|
12745
12889
|
return {
|
|
12746
|
-
relativeDirPath:
|
|
12890
|
+
relativeDirPath: join82(".cursor", "skills")
|
|
12747
12891
|
};
|
|
12748
12892
|
}
|
|
12749
12893
|
getFrontmatter() {
|
|
@@ -12823,9 +12967,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12823
12967
|
});
|
|
12824
12968
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12825
12969
|
if (!result.success) {
|
|
12826
|
-
const skillDirPath =
|
|
12970
|
+
const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12827
12971
|
throw new Error(
|
|
12828
|
-
`Invalid frontmatter in ${
|
|
12972
|
+
`Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12829
12973
|
);
|
|
12830
12974
|
}
|
|
12831
12975
|
return new _CursorSkill({
|
|
@@ -12860,7 +13004,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
12860
13004
|
};
|
|
12861
13005
|
|
|
12862
13006
|
// src/features/skills/deepagents-skill.ts
|
|
12863
|
-
import { join as
|
|
13007
|
+
import { join as join83 } from "path";
|
|
12864
13008
|
import { z as z42 } from "zod/mini";
|
|
12865
13009
|
var DeepagentsSkillFrontmatterSchema = z42.looseObject({
|
|
12866
13010
|
name: z42.string(),
|
|
@@ -12870,7 +13014,7 @@ var DeepagentsSkillFrontmatterSchema = z42.looseObject({
|
|
|
12870
13014
|
var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
12871
13015
|
constructor({
|
|
12872
13016
|
baseDir = process.cwd(),
|
|
12873
|
-
relativeDirPath =
|
|
13017
|
+
relativeDirPath = join83(".deepagents", "skills"),
|
|
12874
13018
|
dirName,
|
|
12875
13019
|
frontmatter,
|
|
12876
13020
|
body,
|
|
@@ -12899,7 +13043,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12899
13043
|
}
|
|
12900
13044
|
static getSettablePaths(_options) {
|
|
12901
13045
|
return {
|
|
12902
|
-
relativeDirPath:
|
|
13046
|
+
relativeDirPath: join83(".deepagents", "skills")
|
|
12903
13047
|
};
|
|
12904
13048
|
}
|
|
12905
13049
|
getFrontmatter() {
|
|
@@ -12985,9 +13129,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
12985
13129
|
});
|
|
12986
13130
|
const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
12987
13131
|
if (!result.success) {
|
|
12988
|
-
const skillDirPath =
|
|
13132
|
+
const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
12989
13133
|
throw new Error(
|
|
12990
|
-
`Invalid frontmatter in ${
|
|
13134
|
+
`Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
12991
13135
|
);
|
|
12992
13136
|
}
|
|
12993
13137
|
return new _DeepagentsSkill({
|
|
@@ -13022,7 +13166,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
|
|
|
13022
13166
|
};
|
|
13023
13167
|
|
|
13024
13168
|
// src/features/skills/geminicli-skill.ts
|
|
13025
|
-
import { join as
|
|
13169
|
+
import { join as join84 } from "path";
|
|
13026
13170
|
import { z as z43 } from "zod/mini";
|
|
13027
13171
|
var GeminiCliSkillFrontmatterSchema = z43.looseObject({
|
|
13028
13172
|
name: z43.string(),
|
|
@@ -13062,7 +13206,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
13062
13206
|
global: _global = false
|
|
13063
13207
|
} = {}) {
|
|
13064
13208
|
return {
|
|
13065
|
-
relativeDirPath:
|
|
13209
|
+
relativeDirPath: join84(".gemini", "skills")
|
|
13066
13210
|
};
|
|
13067
13211
|
}
|
|
13068
13212
|
getFrontmatter() {
|
|
@@ -13142,9 +13286,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
13142
13286
|
});
|
|
13143
13287
|
const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13144
13288
|
if (!result.success) {
|
|
13145
|
-
const skillDirPath =
|
|
13289
|
+
const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13146
13290
|
throw new Error(
|
|
13147
|
-
`Invalid frontmatter in ${
|
|
13291
|
+
`Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13148
13292
|
);
|
|
13149
13293
|
}
|
|
13150
13294
|
return new _GeminiCliSkill({
|
|
@@ -13179,7 +13323,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
|
|
|
13179
13323
|
};
|
|
13180
13324
|
|
|
13181
13325
|
// src/features/skills/junie-skill.ts
|
|
13182
|
-
import { join as
|
|
13326
|
+
import { join as join85 } from "path";
|
|
13183
13327
|
import { z as z44 } from "zod/mini";
|
|
13184
13328
|
var JunieSkillFrontmatterSchema = z44.looseObject({
|
|
13185
13329
|
name: z44.string(),
|
|
@@ -13188,7 +13332,7 @@ var JunieSkillFrontmatterSchema = z44.looseObject({
|
|
|
13188
13332
|
var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
13189
13333
|
constructor({
|
|
13190
13334
|
baseDir = process.cwd(),
|
|
13191
|
-
relativeDirPath =
|
|
13335
|
+
relativeDirPath = join85(".junie", "skills"),
|
|
13192
13336
|
dirName,
|
|
13193
13337
|
frontmatter,
|
|
13194
13338
|
body,
|
|
@@ -13220,7 +13364,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
13220
13364
|
throw new Error("JunieSkill does not support global mode.");
|
|
13221
13365
|
}
|
|
13222
13366
|
return {
|
|
13223
|
-
relativeDirPath:
|
|
13367
|
+
relativeDirPath: join85(".junie", "skills")
|
|
13224
13368
|
};
|
|
13225
13369
|
}
|
|
13226
13370
|
getFrontmatter() {
|
|
@@ -13307,13 +13451,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
13307
13451
|
});
|
|
13308
13452
|
const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13309
13453
|
if (!result.success) {
|
|
13310
|
-
const skillDirPath =
|
|
13454
|
+
const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13311
13455
|
throw new Error(
|
|
13312
|
-
`Invalid frontmatter in ${
|
|
13456
|
+
`Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13313
13457
|
);
|
|
13314
13458
|
}
|
|
13315
13459
|
if (result.data.name !== loaded.dirName) {
|
|
13316
|
-
const skillFilePath =
|
|
13460
|
+
const skillFilePath = join85(
|
|
13317
13461
|
loaded.baseDir,
|
|
13318
13462
|
loaded.relativeDirPath,
|
|
13319
13463
|
loaded.dirName,
|
|
@@ -13355,7 +13499,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
|
|
|
13355
13499
|
};
|
|
13356
13500
|
|
|
13357
13501
|
// src/features/skills/kilo-skill.ts
|
|
13358
|
-
import { join as
|
|
13502
|
+
import { join as join86 } from "path";
|
|
13359
13503
|
import { z as z45 } from "zod/mini";
|
|
13360
13504
|
var KiloSkillFrontmatterSchema = z45.looseObject({
|
|
13361
13505
|
name: z45.string(),
|
|
@@ -13365,7 +13509,7 @@ var KiloSkillFrontmatterSchema = z45.looseObject({
|
|
|
13365
13509
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
13366
13510
|
constructor({
|
|
13367
13511
|
baseDir = process.cwd(),
|
|
13368
|
-
relativeDirPath =
|
|
13512
|
+
relativeDirPath = join86(".kilo", "skills"),
|
|
13369
13513
|
dirName,
|
|
13370
13514
|
frontmatter,
|
|
13371
13515
|
body,
|
|
@@ -13394,7 +13538,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
13394
13538
|
}
|
|
13395
13539
|
static getSettablePaths({ global = false } = {}) {
|
|
13396
13540
|
return {
|
|
13397
|
-
relativeDirPath: global ?
|
|
13541
|
+
relativeDirPath: global ? join86(".config", "kilo", "skills") : join86(".kilo", "skills")
|
|
13398
13542
|
};
|
|
13399
13543
|
}
|
|
13400
13544
|
getFrontmatter() {
|
|
@@ -13480,9 +13624,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
13480
13624
|
});
|
|
13481
13625
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13482
13626
|
if (!result.success) {
|
|
13483
|
-
const skillDirPath =
|
|
13627
|
+
const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13484
13628
|
throw new Error(
|
|
13485
|
-
`Invalid frontmatter in ${
|
|
13629
|
+
`Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13486
13630
|
);
|
|
13487
13631
|
}
|
|
13488
13632
|
return new _KiloSkill({
|
|
@@ -13516,7 +13660,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
13516
13660
|
};
|
|
13517
13661
|
|
|
13518
13662
|
// src/features/skills/kiro-skill.ts
|
|
13519
|
-
import { join as
|
|
13663
|
+
import { join as join87 } from "path";
|
|
13520
13664
|
import { z as z46 } from "zod/mini";
|
|
13521
13665
|
var KiroSkillFrontmatterSchema = z46.looseObject({
|
|
13522
13666
|
name: z46.string(),
|
|
@@ -13525,7 +13669,7 @@ var KiroSkillFrontmatterSchema = z46.looseObject({
|
|
|
13525
13669
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
13526
13670
|
constructor({
|
|
13527
13671
|
baseDir = process.cwd(),
|
|
13528
|
-
relativeDirPath =
|
|
13672
|
+
relativeDirPath = join87(".kiro", "skills"),
|
|
13529
13673
|
dirName,
|
|
13530
13674
|
frontmatter,
|
|
13531
13675
|
body,
|
|
@@ -13557,7 +13701,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
13557
13701
|
throw new Error("KiroSkill does not support global mode.");
|
|
13558
13702
|
}
|
|
13559
13703
|
return {
|
|
13560
|
-
relativeDirPath:
|
|
13704
|
+
relativeDirPath: join87(".kiro", "skills")
|
|
13561
13705
|
};
|
|
13562
13706
|
}
|
|
13563
13707
|
getFrontmatter() {
|
|
@@ -13645,13 +13789,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
13645
13789
|
});
|
|
13646
13790
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13647
13791
|
if (!result.success) {
|
|
13648
|
-
const skillDirPath =
|
|
13792
|
+
const skillDirPath = join87(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13649
13793
|
throw new Error(
|
|
13650
|
-
`Invalid frontmatter in ${
|
|
13794
|
+
`Invalid frontmatter in ${join87(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13651
13795
|
);
|
|
13652
13796
|
}
|
|
13653
13797
|
if (result.data.name !== loaded.dirName) {
|
|
13654
|
-
const skillFilePath =
|
|
13798
|
+
const skillFilePath = join87(
|
|
13655
13799
|
loaded.baseDir,
|
|
13656
13800
|
loaded.relativeDirPath,
|
|
13657
13801
|
loaded.dirName,
|
|
@@ -13693,7 +13837,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
13693
13837
|
};
|
|
13694
13838
|
|
|
13695
13839
|
// src/features/skills/opencode-skill.ts
|
|
13696
|
-
import { join as
|
|
13840
|
+
import { join as join88 } from "path";
|
|
13697
13841
|
import { z as z47 } from "zod/mini";
|
|
13698
13842
|
var OpenCodeSkillFrontmatterSchema = z47.looseObject({
|
|
13699
13843
|
name: z47.string(),
|
|
@@ -13703,7 +13847,7 @@ var OpenCodeSkillFrontmatterSchema = z47.looseObject({
|
|
|
13703
13847
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
13704
13848
|
constructor({
|
|
13705
13849
|
baseDir = process.cwd(),
|
|
13706
|
-
relativeDirPath =
|
|
13850
|
+
relativeDirPath = join88(".opencode", "skill"),
|
|
13707
13851
|
dirName,
|
|
13708
13852
|
frontmatter,
|
|
13709
13853
|
body,
|
|
@@ -13732,7 +13876,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13732
13876
|
}
|
|
13733
13877
|
static getSettablePaths({ global = false } = {}) {
|
|
13734
13878
|
return {
|
|
13735
|
-
relativeDirPath: global ?
|
|
13879
|
+
relativeDirPath: global ? join88(".config", "opencode", "skill") : join88(".opencode", "skill")
|
|
13736
13880
|
};
|
|
13737
13881
|
}
|
|
13738
13882
|
getFrontmatter() {
|
|
@@ -13818,9 +13962,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13818
13962
|
});
|
|
13819
13963
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13820
13964
|
if (!result.success) {
|
|
13821
|
-
const skillDirPath =
|
|
13965
|
+
const skillDirPath = join88(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13822
13966
|
throw new Error(
|
|
13823
|
-
`Invalid frontmatter in ${
|
|
13967
|
+
`Invalid frontmatter in ${join88(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13824
13968
|
);
|
|
13825
13969
|
}
|
|
13826
13970
|
return new _OpenCodeSkill({
|
|
@@ -13854,7 +13998,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
13854
13998
|
};
|
|
13855
13999
|
|
|
13856
14000
|
// src/features/skills/replit-skill.ts
|
|
13857
|
-
import { join as
|
|
14001
|
+
import { join as join89 } from "path";
|
|
13858
14002
|
import { z as z48 } from "zod/mini";
|
|
13859
14003
|
var ReplitSkillFrontmatterSchema = z48.looseObject({
|
|
13860
14004
|
name: z48.string(),
|
|
@@ -13863,7 +14007,7 @@ var ReplitSkillFrontmatterSchema = z48.looseObject({
|
|
|
13863
14007
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
13864
14008
|
constructor({
|
|
13865
14009
|
baseDir = process.cwd(),
|
|
13866
|
-
relativeDirPath =
|
|
14010
|
+
relativeDirPath = join89(".agents", "skills"),
|
|
13867
14011
|
dirName,
|
|
13868
14012
|
frontmatter,
|
|
13869
14013
|
body,
|
|
@@ -13895,7 +14039,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13895
14039
|
throw new Error("ReplitSkill does not support global mode.");
|
|
13896
14040
|
}
|
|
13897
14041
|
return {
|
|
13898
|
-
relativeDirPath:
|
|
14042
|
+
relativeDirPath: join89(".agents", "skills")
|
|
13899
14043
|
};
|
|
13900
14044
|
}
|
|
13901
14045
|
getFrontmatter() {
|
|
@@ -13975,9 +14119,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
13975
14119
|
});
|
|
13976
14120
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13977
14121
|
if (!result.success) {
|
|
13978
|
-
const skillDirPath =
|
|
14122
|
+
const skillDirPath = join89(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13979
14123
|
throw new Error(
|
|
13980
|
-
`Invalid frontmatter in ${
|
|
14124
|
+
`Invalid frontmatter in ${join89(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13981
14125
|
);
|
|
13982
14126
|
}
|
|
13983
14127
|
return new _ReplitSkill({
|
|
@@ -14012,7 +14156,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
14012
14156
|
};
|
|
14013
14157
|
|
|
14014
14158
|
// src/features/skills/roo-skill.ts
|
|
14015
|
-
import { join as
|
|
14159
|
+
import { join as join90 } from "path";
|
|
14016
14160
|
import { z as z49 } from "zod/mini";
|
|
14017
14161
|
var RooSkillFrontmatterSchema = z49.looseObject({
|
|
14018
14162
|
name: z49.string(),
|
|
@@ -14021,7 +14165,7 @@ var RooSkillFrontmatterSchema = z49.looseObject({
|
|
|
14021
14165
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
14022
14166
|
constructor({
|
|
14023
14167
|
baseDir = process.cwd(),
|
|
14024
|
-
relativeDirPath =
|
|
14168
|
+
relativeDirPath = join90(".roo", "skills"),
|
|
14025
14169
|
dirName,
|
|
14026
14170
|
frontmatter,
|
|
14027
14171
|
body,
|
|
@@ -14052,7 +14196,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
14052
14196
|
global: _global = false
|
|
14053
14197
|
} = {}) {
|
|
14054
14198
|
return {
|
|
14055
|
-
relativeDirPath:
|
|
14199
|
+
relativeDirPath: join90(".roo", "skills")
|
|
14056
14200
|
};
|
|
14057
14201
|
}
|
|
14058
14202
|
getFrontmatter() {
|
|
@@ -14140,13 +14284,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
14140
14284
|
});
|
|
14141
14285
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14142
14286
|
if (!result.success) {
|
|
14143
|
-
const skillDirPath =
|
|
14287
|
+
const skillDirPath = join90(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
14144
14288
|
throw new Error(
|
|
14145
|
-
`Invalid frontmatter in ${
|
|
14289
|
+
`Invalid frontmatter in ${join90(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14146
14290
|
);
|
|
14147
14291
|
}
|
|
14148
14292
|
if (result.data.name !== loaded.dirName) {
|
|
14149
|
-
const skillFilePath =
|
|
14293
|
+
const skillFilePath = join90(
|
|
14150
14294
|
loaded.baseDir,
|
|
14151
14295
|
loaded.relativeDirPath,
|
|
14152
14296
|
loaded.dirName,
|
|
@@ -14187,14 +14331,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
14187
14331
|
};
|
|
14188
14332
|
|
|
14189
14333
|
// src/features/skills/skills-utils.ts
|
|
14190
|
-
import { basename as basename4, join as
|
|
14334
|
+
import { basename as basename4, join as join91 } from "path";
|
|
14191
14335
|
async function getLocalSkillDirNames(baseDir) {
|
|
14192
|
-
const skillsDir =
|
|
14336
|
+
const skillsDir = join91(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
14193
14337
|
const names = /* @__PURE__ */ new Set();
|
|
14194
14338
|
if (!await directoryExists(skillsDir)) {
|
|
14195
14339
|
return names;
|
|
14196
14340
|
}
|
|
14197
|
-
const dirPaths = await findFilesByGlobs(
|
|
14341
|
+
const dirPaths = await findFilesByGlobs(join91(skillsDir, "*"), { type: "dir" });
|
|
14198
14342
|
for (const dirPath of dirPaths) {
|
|
14199
14343
|
const name = basename4(dirPath);
|
|
14200
14344
|
if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
|
|
@@ -14203,8 +14347,147 @@ async function getLocalSkillDirNames(baseDir) {
|
|
|
14203
14347
|
return names;
|
|
14204
14348
|
}
|
|
14205
14349
|
|
|
14350
|
+
// src/features/skills/takt-skill.ts
|
|
14351
|
+
import path3, { join as join92, relative as relative5, resolve as resolve5 } from "path";
|
|
14352
|
+
var DEFAULT_TAKT_SKILL_DIR = "knowledge";
|
|
14353
|
+
var TaktSkill = class _TaktSkill extends ToolSkill {
|
|
14354
|
+
fileName;
|
|
14355
|
+
constructor({
|
|
14356
|
+
baseDir = process.cwd(),
|
|
14357
|
+
relativeDirPath,
|
|
14358
|
+
dirName,
|
|
14359
|
+
fileName,
|
|
14360
|
+
body,
|
|
14361
|
+
otherFiles = [],
|
|
14362
|
+
validate = true,
|
|
14363
|
+
global = false
|
|
14364
|
+
}) {
|
|
14365
|
+
super({
|
|
14366
|
+
baseDir,
|
|
14367
|
+
relativeDirPath,
|
|
14368
|
+
dirName,
|
|
14369
|
+
mainFile: {
|
|
14370
|
+
name: fileName,
|
|
14371
|
+
body,
|
|
14372
|
+
// Frontmatter is intentionally undefined — TAKT files are plain Markdown.
|
|
14373
|
+
frontmatter: void 0
|
|
14374
|
+
},
|
|
14375
|
+
otherFiles,
|
|
14376
|
+
global
|
|
14377
|
+
});
|
|
14378
|
+
this.fileName = fileName;
|
|
14379
|
+
if (validate) {
|
|
14380
|
+
const result = this.validate();
|
|
14381
|
+
if (!result.success) {
|
|
14382
|
+
throw result.error;
|
|
14383
|
+
}
|
|
14384
|
+
}
|
|
14385
|
+
}
|
|
14386
|
+
static getSettablePaths(_options = {}) {
|
|
14387
|
+
return {
|
|
14388
|
+
relativeDirPath: join92(".takt", "facets", DEFAULT_TAKT_SKILL_DIR)
|
|
14389
|
+
};
|
|
14390
|
+
}
|
|
14391
|
+
/**
|
|
14392
|
+
* Override: TAKT skills emit a single flat file under `relativeDirPath`,
|
|
14393
|
+
* not a nested directory keyed by `dirName`. Drop `dirName` from the path.
|
|
14394
|
+
*
|
|
14395
|
+
* Preserves the same path-traversal guard as `AiDir.getDirPath` so a
|
|
14396
|
+
* malicious `relativeDirPath` cannot escape `baseDir`.
|
|
14397
|
+
*/
|
|
14398
|
+
getDirPath() {
|
|
14399
|
+
const fullPath = join92(this.baseDir, this.relativeDirPath);
|
|
14400
|
+
const resolvedFull = resolve5(fullPath);
|
|
14401
|
+
const resolvedBase = resolve5(this.baseDir);
|
|
14402
|
+
const rel = relative5(resolvedBase, resolvedFull);
|
|
14403
|
+
if (rel.startsWith("..") || path3.isAbsolute(rel)) {
|
|
14404
|
+
throw new Error(
|
|
14405
|
+
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}"`
|
|
14406
|
+
);
|
|
14407
|
+
}
|
|
14408
|
+
return fullPath;
|
|
14409
|
+
}
|
|
14410
|
+
getRelativePathFromCwd() {
|
|
14411
|
+
return toPosixPath(this.relativeDirPath);
|
|
14412
|
+
}
|
|
14413
|
+
getBody() {
|
|
14414
|
+
return this.mainFile?.body ?? "";
|
|
14415
|
+
}
|
|
14416
|
+
getFileName() {
|
|
14417
|
+
return this.fileName;
|
|
14418
|
+
}
|
|
14419
|
+
validate() {
|
|
14420
|
+
return { success: true, error: null };
|
|
14421
|
+
}
|
|
14422
|
+
toRulesyncSkill() {
|
|
14423
|
+
throw new Error(
|
|
14424
|
+
"Importing existing TAKT facet files into rulesync is not supported: TAKT files are plain Markdown and the original skill metadata cannot be recovered."
|
|
14425
|
+
);
|
|
14426
|
+
}
|
|
14427
|
+
static fromRulesyncSkill({
|
|
14428
|
+
baseDir = process.cwd(),
|
|
14429
|
+
rulesyncSkill,
|
|
14430
|
+
validate = true,
|
|
14431
|
+
global = false
|
|
14432
|
+
}) {
|
|
14433
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
14434
|
+
const taktSection = rulesyncFrontmatter.takt;
|
|
14435
|
+
const sourceLabel = rulesyncSkill.getDirName();
|
|
14436
|
+
const overrideName = typeof taktSection?.name === "string" ? taktSection.name : void 0;
|
|
14437
|
+
const stem = overrideName ?? rulesyncSkill.getDirName();
|
|
14438
|
+
assertSafeTaktName({ name: stem, featureLabel: "skill", sourceLabel });
|
|
14439
|
+
const fileName = `${stem}.md`;
|
|
14440
|
+
const relativeDirPath = join92(".takt", "facets", DEFAULT_TAKT_SKILL_DIR);
|
|
14441
|
+
return new _TaktSkill({
|
|
14442
|
+
baseDir,
|
|
14443
|
+
relativeDirPath,
|
|
14444
|
+
dirName: stem,
|
|
14445
|
+
fileName,
|
|
14446
|
+
body: rulesyncSkill.getBody(),
|
|
14447
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
14448
|
+
validate,
|
|
14449
|
+
global
|
|
14450
|
+
});
|
|
14451
|
+
}
|
|
14452
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
14453
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
14454
|
+
return targets.includes("*") || targets.includes("takt");
|
|
14455
|
+
}
|
|
14456
|
+
/**
|
|
14457
|
+
* Importing existing TAKT facet files into rulesync is not supported.
|
|
14458
|
+
*
|
|
14459
|
+
* TAKT emits flat plain-Markdown files (no `SKILL.md` directory layout, no
|
|
14460
|
+
* frontmatter). The reverse import would have to invent a skill name and
|
|
14461
|
+
* description out of the file stem alone, which silently produces a stub
|
|
14462
|
+
* that round-trips badly. Throwing makes the limitation explicit at the
|
|
14463
|
+
* call site rather than letting bad data sneak through.
|
|
14464
|
+
*/
|
|
14465
|
+
static async fromDir(_params) {
|
|
14466
|
+
throw new Error(
|
|
14467
|
+
"Importing existing TAKT facet files into rulesync is not supported: TAKT files are plain Markdown and the original skill metadata cannot be recovered."
|
|
14468
|
+
);
|
|
14469
|
+
}
|
|
14470
|
+
static forDeletion({
|
|
14471
|
+
baseDir = process.cwd(),
|
|
14472
|
+
relativeDirPath,
|
|
14473
|
+
dirName,
|
|
14474
|
+
global = false
|
|
14475
|
+
}) {
|
|
14476
|
+
return new _TaktSkill({
|
|
14477
|
+
baseDir,
|
|
14478
|
+
relativeDirPath,
|
|
14479
|
+
dirName,
|
|
14480
|
+
fileName: `${dirName}.md`,
|
|
14481
|
+
body: "",
|
|
14482
|
+
otherFiles: [],
|
|
14483
|
+
validate: false,
|
|
14484
|
+
global
|
|
14485
|
+
});
|
|
14486
|
+
}
|
|
14487
|
+
};
|
|
14488
|
+
|
|
14206
14489
|
// src/features/skills/windsurf-skill.ts
|
|
14207
|
-
import { join as
|
|
14490
|
+
import { join as join93 } from "path";
|
|
14208
14491
|
import { z as z50 } from "zod/mini";
|
|
14209
14492
|
var WindsurfSkillFrontmatterSchema = z50.looseObject({
|
|
14210
14493
|
name: z50.string(),
|
|
@@ -14243,11 +14526,11 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
14243
14526
|
static getSettablePaths({ global = false } = {}) {
|
|
14244
14527
|
if (global) {
|
|
14245
14528
|
return {
|
|
14246
|
-
relativeDirPath:
|
|
14529
|
+
relativeDirPath: join93(".codeium", "windsurf", "skills")
|
|
14247
14530
|
};
|
|
14248
14531
|
}
|
|
14249
14532
|
return {
|
|
14250
|
-
relativeDirPath:
|
|
14533
|
+
relativeDirPath: join93(".windsurf", "skills")
|
|
14251
14534
|
};
|
|
14252
14535
|
}
|
|
14253
14536
|
getFrontmatter() {
|
|
@@ -14327,9 +14610,9 @@ var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
|
14327
14610
|
});
|
|
14328
14611
|
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
14329
14612
|
if (!result.success) {
|
|
14330
|
-
const skillDirPath =
|
|
14613
|
+
const skillDirPath = join93(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
14331
14614
|
throw new Error(
|
|
14332
|
-
`Invalid frontmatter in ${
|
|
14615
|
+
`Invalid frontmatter in ${join93(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
14333
14616
|
);
|
|
14334
14617
|
}
|
|
14335
14618
|
return new _WindsurfSkill({
|
|
@@ -14384,6 +14667,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
14384
14667
|
"replit",
|
|
14385
14668
|
"roo",
|
|
14386
14669
|
"rovodev",
|
|
14670
|
+
"takt",
|
|
14387
14671
|
"windsurf"
|
|
14388
14672
|
];
|
|
14389
14673
|
var SkillsProcessorToolTargetSchema = z51.enum(skillsProcessorToolTargetTuple);
|
|
@@ -14521,6 +14805,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
14521
14805
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
14522
14806
|
}
|
|
14523
14807
|
],
|
|
14808
|
+
[
|
|
14809
|
+
"takt",
|
|
14810
|
+
{
|
|
14811
|
+
class: TaktSkill,
|
|
14812
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
14813
|
+
}
|
|
14814
|
+
],
|
|
14524
14815
|
[
|
|
14525
14816
|
"windsurf",
|
|
14526
14817
|
{
|
|
@@ -14617,11 +14908,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14617
14908
|
)
|
|
14618
14909
|
);
|
|
14619
14910
|
const localSkillNames = new Set(localDirNames);
|
|
14620
|
-
const curatedDirPath =
|
|
14911
|
+
const curatedDirPath = join94(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
14621
14912
|
let curatedSkills = [];
|
|
14622
14913
|
if (await directoryExists(curatedDirPath)) {
|
|
14623
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
14624
|
-
const curatedDirNames = curatedDirPaths.map((
|
|
14914
|
+
const curatedDirPaths = await findFilesByGlobs(join94(curatedDirPath, "*"), { type: "dir" });
|
|
14915
|
+
const curatedDirNames = curatedDirPaths.map((path4) => basename5(path4));
|
|
14625
14916
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
14626
14917
|
if (localSkillNames.has(name)) {
|
|
14627
14918
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -14658,11 +14949,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14658
14949
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
14659
14950
|
const loadEntries = [];
|
|
14660
14951
|
for (const root of roots) {
|
|
14661
|
-
const skillsDirPath =
|
|
14952
|
+
const skillsDirPath = join94(this.baseDir, root);
|
|
14662
14953
|
if (!await directoryExists(skillsDirPath)) {
|
|
14663
14954
|
continue;
|
|
14664
14955
|
}
|
|
14665
|
-
const dirPaths = await findFilesByGlobs(
|
|
14956
|
+
const dirPaths = await findFilesByGlobs(join94(skillsDirPath, "*"), { type: "dir" });
|
|
14666
14957
|
for (const dirPath of dirPaths) {
|
|
14667
14958
|
const dirName = basename5(dirPath);
|
|
14668
14959
|
if (seenDirNames.has(dirName)) {
|
|
@@ -14693,11 +14984,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14693
14984
|
const roots = toolSkillSearchRoots(paths);
|
|
14694
14985
|
const toolSkills = [];
|
|
14695
14986
|
for (const root of roots) {
|
|
14696
|
-
const skillsDirPath =
|
|
14987
|
+
const skillsDirPath = join94(this.baseDir, root);
|
|
14697
14988
|
if (!await directoryExists(skillsDirPath)) {
|
|
14698
14989
|
continue;
|
|
14699
14990
|
}
|
|
14700
|
-
const dirPaths = await findFilesByGlobs(
|
|
14991
|
+
const dirPaths = await findFilesByGlobs(join94(skillsDirPath, "*"), { type: "dir" });
|
|
14701
14992
|
for (const dirPath of dirPaths) {
|
|
14702
14993
|
const dirName = basename5(dirPath);
|
|
14703
14994
|
const toolSkill = factory.class.forDeletion({
|
|
@@ -14761,10 +15052,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14761
15052
|
};
|
|
14762
15053
|
|
|
14763
15054
|
// src/features/subagents/agentsmd-subagent.ts
|
|
14764
|
-
import { join as
|
|
15055
|
+
import { join as join96 } from "path";
|
|
14765
15056
|
|
|
14766
15057
|
// src/features/subagents/simulated-subagent.ts
|
|
14767
|
-
import { basename as basename6, join as
|
|
15058
|
+
import { basename as basename6, join as join95 } from "path";
|
|
14768
15059
|
import { z as z52 } from "zod/mini";
|
|
14769
15060
|
|
|
14770
15061
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -14829,7 +15120,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14829
15120
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14830
15121
|
if (!result.success) {
|
|
14831
15122
|
throw new Error(
|
|
14832
|
-
`Invalid frontmatter in ${
|
|
15123
|
+
`Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14833
15124
|
);
|
|
14834
15125
|
}
|
|
14835
15126
|
}
|
|
@@ -14880,7 +15171,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14880
15171
|
return {
|
|
14881
15172
|
success: false,
|
|
14882
15173
|
error: new Error(
|
|
14883
|
-
`Invalid frontmatter in ${
|
|
15174
|
+
`Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14884
15175
|
)
|
|
14885
15176
|
};
|
|
14886
15177
|
}
|
|
@@ -14890,7 +15181,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14890
15181
|
relativeFilePath,
|
|
14891
15182
|
validate = true
|
|
14892
15183
|
}) {
|
|
14893
|
-
const filePath =
|
|
15184
|
+
const filePath = join95(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
14894
15185
|
const fileContent = await readFileContent(filePath);
|
|
14895
15186
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14896
15187
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14926,7 +15217,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14926
15217
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
14927
15218
|
static getSettablePaths() {
|
|
14928
15219
|
return {
|
|
14929
|
-
relativeDirPath:
|
|
15220
|
+
relativeDirPath: join96(".agents", "subagents")
|
|
14930
15221
|
};
|
|
14931
15222
|
}
|
|
14932
15223
|
static async fromFile(params) {
|
|
@@ -14949,11 +15240,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
14949
15240
|
};
|
|
14950
15241
|
|
|
14951
15242
|
// src/features/subagents/factorydroid-subagent.ts
|
|
14952
|
-
import { join as
|
|
15243
|
+
import { join as join97 } from "path";
|
|
14953
15244
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
14954
15245
|
static getSettablePaths(_options) {
|
|
14955
15246
|
return {
|
|
14956
|
-
relativeDirPath:
|
|
15247
|
+
relativeDirPath: join97(".factory", "droids")
|
|
14957
15248
|
};
|
|
14958
15249
|
}
|
|
14959
15250
|
static async fromFile(params) {
|
|
@@ -14976,16 +15267,21 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14976
15267
|
};
|
|
14977
15268
|
|
|
14978
15269
|
// src/features/subagents/geminicli-subagent.ts
|
|
14979
|
-
import { join as
|
|
15270
|
+
import { join as join99 } from "path";
|
|
14980
15271
|
import { z as z54 } from "zod/mini";
|
|
14981
15272
|
|
|
14982
15273
|
// src/features/subagents/rulesync-subagent.ts
|
|
14983
|
-
import { basename as basename7, join as
|
|
15274
|
+
import { basename as basename7, join as join98 } from "path";
|
|
14984
15275
|
import { z as z53 } from "zod/mini";
|
|
14985
15276
|
var RulesyncSubagentFrontmatterSchema = z53.looseObject({
|
|
14986
15277
|
targets: z53._default(RulesyncTargetsSchema, ["*"]),
|
|
14987
15278
|
name: z53.string(),
|
|
14988
|
-
description: z53.optional(z53.string())
|
|
15279
|
+
description: z53.optional(z53.string()),
|
|
15280
|
+
takt: z53.optional(
|
|
15281
|
+
z53.looseObject({
|
|
15282
|
+
name: z53.optional(z53.string())
|
|
15283
|
+
})
|
|
15284
|
+
)
|
|
14989
15285
|
});
|
|
14990
15286
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14991
15287
|
frontmatter;
|
|
@@ -14994,7 +15290,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14994
15290
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14995
15291
|
if (!parseResult.success && rest.validate !== false) {
|
|
14996
15292
|
throw new Error(
|
|
14997
|
-
`Invalid frontmatter in ${
|
|
15293
|
+
`Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14998
15294
|
);
|
|
14999
15295
|
}
|
|
15000
15296
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -15027,7 +15323,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
15027
15323
|
return {
|
|
15028
15324
|
success: false,
|
|
15029
15325
|
error: new Error(
|
|
15030
|
-
`Invalid frontmatter in ${
|
|
15326
|
+
`Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15031
15327
|
)
|
|
15032
15328
|
};
|
|
15033
15329
|
}
|
|
@@ -15035,7 +15331,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
15035
15331
|
static async fromFile({
|
|
15036
15332
|
relativeFilePath
|
|
15037
15333
|
}) {
|
|
15038
|
-
const filePath =
|
|
15334
|
+
const filePath = join98(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
15039
15335
|
const fileContent = await readFileContent(filePath);
|
|
15040
15336
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15041
15337
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15066,7 +15362,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
15066
15362
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15067
15363
|
if (!result.success) {
|
|
15068
15364
|
throw new Error(
|
|
15069
|
-
`Invalid frontmatter in ${
|
|
15365
|
+
`Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15070
15366
|
);
|
|
15071
15367
|
}
|
|
15072
15368
|
}
|
|
@@ -15079,7 +15375,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
15079
15375
|
}
|
|
15080
15376
|
static getSettablePaths(_options = {}) {
|
|
15081
15377
|
return {
|
|
15082
|
-
relativeDirPath:
|
|
15378
|
+
relativeDirPath: join99(".gemini", "agents")
|
|
15083
15379
|
};
|
|
15084
15380
|
}
|
|
15085
15381
|
getFrontmatter() {
|
|
@@ -15147,7 +15443,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
15147
15443
|
return {
|
|
15148
15444
|
success: false,
|
|
15149
15445
|
error: new Error(
|
|
15150
|
-
`Invalid frontmatter in ${
|
|
15446
|
+
`Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15151
15447
|
)
|
|
15152
15448
|
};
|
|
15153
15449
|
}
|
|
@@ -15165,7 +15461,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
15165
15461
|
global = false
|
|
15166
15462
|
}) {
|
|
15167
15463
|
const paths = this.getSettablePaths({ global });
|
|
15168
|
-
const filePath =
|
|
15464
|
+
const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15169
15465
|
const fileContent = await readFileContent(filePath);
|
|
15170
15466
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15171
15467
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15201,11 +15497,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
15201
15497
|
};
|
|
15202
15498
|
|
|
15203
15499
|
// src/features/subagents/roo-subagent.ts
|
|
15204
|
-
import { join as
|
|
15500
|
+
import { join as join100 } from "path";
|
|
15205
15501
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
15206
15502
|
static getSettablePaths() {
|
|
15207
15503
|
return {
|
|
15208
|
-
relativeDirPath:
|
|
15504
|
+
relativeDirPath: join100(".roo", "subagents")
|
|
15209
15505
|
};
|
|
15210
15506
|
}
|
|
15211
15507
|
static async fromFile(params) {
|
|
@@ -15228,7 +15524,7 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
15228
15524
|
};
|
|
15229
15525
|
|
|
15230
15526
|
// src/features/subagents/rovodev-subagent.ts
|
|
15231
|
-
import { join as
|
|
15527
|
+
import { join as join101 } from "path";
|
|
15232
15528
|
import { z as z55 } from "zod/mini";
|
|
15233
15529
|
var RovodevSubagentFrontmatterSchema = z55.looseObject({
|
|
15234
15530
|
name: z55.string(),
|
|
@@ -15242,7 +15538,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15242
15538
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15243
15539
|
if (!result.success) {
|
|
15244
15540
|
throw new Error(
|
|
15245
|
-
`Invalid frontmatter in ${
|
|
15541
|
+
`Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15246
15542
|
);
|
|
15247
15543
|
}
|
|
15248
15544
|
}
|
|
@@ -15254,7 +15550,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15254
15550
|
}
|
|
15255
15551
|
static getSettablePaths(_options = {}) {
|
|
15256
15552
|
return {
|
|
15257
|
-
relativeDirPath:
|
|
15553
|
+
relativeDirPath: join101(".rovodev", "subagents")
|
|
15258
15554
|
};
|
|
15259
15555
|
}
|
|
15260
15556
|
getFrontmatter() {
|
|
@@ -15317,7 +15613,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15317
15613
|
return {
|
|
15318
15614
|
success: false,
|
|
15319
15615
|
error: new Error(
|
|
15320
|
-
`Invalid frontmatter in ${
|
|
15616
|
+
`Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15321
15617
|
)
|
|
15322
15618
|
};
|
|
15323
15619
|
}
|
|
@@ -15334,7 +15630,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15334
15630
|
global = false
|
|
15335
15631
|
}) {
|
|
15336
15632
|
const paths = this.getSettablePaths({ global });
|
|
15337
|
-
const filePath =
|
|
15633
|
+
const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15338
15634
|
const fileContent = await readFileContent(filePath);
|
|
15339
15635
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15340
15636
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15373,11 +15669,11 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
15373
15669
|
};
|
|
15374
15670
|
|
|
15375
15671
|
// src/features/subagents/subagents-processor.ts
|
|
15376
|
-
import { basename as basename9, join as
|
|
15672
|
+
import { basename as basename9, join as join113 } from "path";
|
|
15377
15673
|
import { z as z64 } from "zod/mini";
|
|
15378
15674
|
|
|
15379
15675
|
// src/features/subagents/claudecode-subagent.ts
|
|
15380
|
-
import { join as
|
|
15676
|
+
import { join as join102 } from "path";
|
|
15381
15677
|
import { z as z56 } from "zod/mini";
|
|
15382
15678
|
var ClaudecodeSubagentFrontmatterSchema = z56.looseObject({
|
|
15383
15679
|
name: z56.string(),
|
|
@@ -15395,7 +15691,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15395
15691
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15396
15692
|
if (!result.success) {
|
|
15397
15693
|
throw new Error(
|
|
15398
|
-
`Invalid frontmatter in ${
|
|
15694
|
+
`Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15399
15695
|
);
|
|
15400
15696
|
}
|
|
15401
15697
|
}
|
|
@@ -15407,7 +15703,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15407
15703
|
}
|
|
15408
15704
|
static getSettablePaths(_options = {}) {
|
|
15409
15705
|
return {
|
|
15410
|
-
relativeDirPath:
|
|
15706
|
+
relativeDirPath: join102(".claude", "agents")
|
|
15411
15707
|
};
|
|
15412
15708
|
}
|
|
15413
15709
|
getFrontmatter() {
|
|
@@ -15486,7 +15782,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15486
15782
|
return {
|
|
15487
15783
|
success: false,
|
|
15488
15784
|
error: new Error(
|
|
15489
|
-
`Invalid frontmatter in ${
|
|
15785
|
+
`Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15490
15786
|
)
|
|
15491
15787
|
};
|
|
15492
15788
|
}
|
|
@@ -15504,7 +15800,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15504
15800
|
global = false
|
|
15505
15801
|
}) {
|
|
15506
15802
|
const paths = this.getSettablePaths({ global });
|
|
15507
|
-
const filePath =
|
|
15803
|
+
const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15508
15804
|
const fileContent = await readFileContent(filePath);
|
|
15509
15805
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15510
15806
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15539,7 +15835,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
15539
15835
|
};
|
|
15540
15836
|
|
|
15541
15837
|
// src/features/subagents/codexcli-subagent.ts
|
|
15542
|
-
import { join as
|
|
15838
|
+
import { join as join103 } from "path";
|
|
15543
15839
|
import * as smolToml6 from "smol-toml";
|
|
15544
15840
|
import { z as z57 } from "zod/mini";
|
|
15545
15841
|
var CodexCliSubagentTomlSchema = z57.looseObject({
|
|
@@ -15570,7 +15866,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15570
15866
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
15571
15867
|
} catch (error) {
|
|
15572
15868
|
throw new Error(
|
|
15573
|
-
`Invalid TOML in ${
|
|
15869
|
+
`Invalid TOML in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15574
15870
|
{ cause: error }
|
|
15575
15871
|
);
|
|
15576
15872
|
}
|
|
@@ -15582,7 +15878,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15582
15878
|
}
|
|
15583
15879
|
static getSettablePaths(_options = {}) {
|
|
15584
15880
|
return {
|
|
15585
|
-
relativeDirPath:
|
|
15881
|
+
relativeDirPath: join103(".codex", "agents")
|
|
15586
15882
|
};
|
|
15587
15883
|
}
|
|
15588
15884
|
getBody() {
|
|
@@ -15594,7 +15890,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15594
15890
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml6.parse(this.body));
|
|
15595
15891
|
} catch (error) {
|
|
15596
15892
|
throw new Error(
|
|
15597
|
-
`Failed to parse TOML in ${
|
|
15893
|
+
`Failed to parse TOML in ${join103(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15598
15894
|
{ cause: error }
|
|
15599
15895
|
);
|
|
15600
15896
|
}
|
|
@@ -15675,7 +15971,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15675
15971
|
global = false
|
|
15676
15972
|
}) {
|
|
15677
15973
|
const paths = this.getSettablePaths({ global });
|
|
15678
|
-
const filePath =
|
|
15974
|
+
const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15679
15975
|
const fileContent = await readFileContent(filePath);
|
|
15680
15976
|
const subagent = new _CodexCliSubagent({
|
|
15681
15977
|
baseDir,
|
|
@@ -15713,7 +16009,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15713
16009
|
};
|
|
15714
16010
|
|
|
15715
16011
|
// src/features/subagents/copilot-subagent.ts
|
|
15716
|
-
import { join as
|
|
16012
|
+
import { join as join104 } from "path";
|
|
15717
16013
|
import { z as z58 } from "zod/mini";
|
|
15718
16014
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
15719
16015
|
var CopilotSubagentFrontmatterSchema = z58.looseObject({
|
|
@@ -15754,7 +16050,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15754
16050
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15755
16051
|
if (!result.success) {
|
|
15756
16052
|
throw new Error(
|
|
15757
|
-
`Invalid frontmatter in ${
|
|
16053
|
+
`Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15758
16054
|
);
|
|
15759
16055
|
}
|
|
15760
16056
|
}
|
|
@@ -15766,7 +16062,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15766
16062
|
}
|
|
15767
16063
|
static getSettablePaths(_options = {}) {
|
|
15768
16064
|
return {
|
|
15769
|
-
relativeDirPath:
|
|
16065
|
+
relativeDirPath: join104(".github", "agents")
|
|
15770
16066
|
};
|
|
15771
16067
|
}
|
|
15772
16068
|
getFrontmatter() {
|
|
@@ -15840,7 +16136,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15840
16136
|
return {
|
|
15841
16137
|
success: false,
|
|
15842
16138
|
error: new Error(
|
|
15843
|
-
`Invalid frontmatter in ${
|
|
16139
|
+
`Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15844
16140
|
)
|
|
15845
16141
|
};
|
|
15846
16142
|
}
|
|
@@ -15858,7 +16154,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15858
16154
|
global = false
|
|
15859
16155
|
}) {
|
|
15860
16156
|
const paths = this.getSettablePaths({ global });
|
|
15861
|
-
const filePath =
|
|
16157
|
+
const filePath = join104(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15862
16158
|
const fileContent = await readFileContent(filePath);
|
|
15863
16159
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15864
16160
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15894,7 +16190,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15894
16190
|
};
|
|
15895
16191
|
|
|
15896
16192
|
// src/features/subagents/cursor-subagent.ts
|
|
15897
|
-
import { join as
|
|
16193
|
+
import { join as join105 } from "path";
|
|
15898
16194
|
import { z as z59 } from "zod/mini";
|
|
15899
16195
|
var CursorSubagentFrontmatterSchema = z59.looseObject({
|
|
15900
16196
|
name: z59.string(),
|
|
@@ -15908,7 +16204,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15908
16204
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15909
16205
|
if (!result.success) {
|
|
15910
16206
|
throw new Error(
|
|
15911
|
-
`Invalid frontmatter in ${
|
|
16207
|
+
`Invalid frontmatter in ${join105(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15912
16208
|
);
|
|
15913
16209
|
}
|
|
15914
16210
|
}
|
|
@@ -15920,7 +16216,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15920
16216
|
}
|
|
15921
16217
|
static getSettablePaths(_options = {}) {
|
|
15922
16218
|
return {
|
|
15923
|
-
relativeDirPath:
|
|
16219
|
+
relativeDirPath: join105(".cursor", "agents")
|
|
15924
16220
|
};
|
|
15925
16221
|
}
|
|
15926
16222
|
getFrontmatter() {
|
|
@@ -15987,7 +16283,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15987
16283
|
return {
|
|
15988
16284
|
success: false,
|
|
15989
16285
|
error: new Error(
|
|
15990
|
-
`Invalid frontmatter in ${
|
|
16286
|
+
`Invalid frontmatter in ${join105(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15991
16287
|
)
|
|
15992
16288
|
};
|
|
15993
16289
|
}
|
|
@@ -16005,7 +16301,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
16005
16301
|
global = false
|
|
16006
16302
|
}) {
|
|
16007
16303
|
const paths = this.getSettablePaths({ global });
|
|
16008
|
-
const filePath =
|
|
16304
|
+
const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16009
16305
|
const fileContent = await readFileContent(filePath);
|
|
16010
16306
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16011
16307
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16041,7 +16337,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
16041
16337
|
};
|
|
16042
16338
|
|
|
16043
16339
|
// src/features/subagents/deepagents-subagent.ts
|
|
16044
|
-
import { join as
|
|
16340
|
+
import { join as join106 } from "path";
|
|
16045
16341
|
import { z as z60 } from "zod/mini";
|
|
16046
16342
|
var DeepagentsSubagentFrontmatterSchema = z60.looseObject({
|
|
16047
16343
|
name: z60.string(),
|
|
@@ -16056,7 +16352,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
16056
16352
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16057
16353
|
if (!result.success) {
|
|
16058
16354
|
throw new Error(
|
|
16059
|
-
`Invalid frontmatter in ${
|
|
16355
|
+
`Invalid frontmatter in ${join106(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16060
16356
|
);
|
|
16061
16357
|
}
|
|
16062
16358
|
}
|
|
@@ -16066,7 +16362,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
16066
16362
|
}
|
|
16067
16363
|
static getSettablePaths(_options = {}) {
|
|
16068
16364
|
return {
|
|
16069
|
-
relativeDirPath:
|
|
16365
|
+
relativeDirPath: join106(".deepagents", "agents")
|
|
16070
16366
|
};
|
|
16071
16367
|
}
|
|
16072
16368
|
getFrontmatter() {
|
|
@@ -16141,7 +16437,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
16141
16437
|
return {
|
|
16142
16438
|
success: false,
|
|
16143
16439
|
error: new Error(
|
|
16144
|
-
`Invalid frontmatter in ${
|
|
16440
|
+
`Invalid frontmatter in ${join106(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16145
16441
|
)
|
|
16146
16442
|
};
|
|
16147
16443
|
}
|
|
@@ -16159,7 +16455,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
16159
16455
|
global = false
|
|
16160
16456
|
}) {
|
|
16161
16457
|
const paths = this.getSettablePaths({ global });
|
|
16162
|
-
const filePath =
|
|
16458
|
+
const filePath = join106(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16163
16459
|
const fileContent = await readFileContent(filePath);
|
|
16164
16460
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16165
16461
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16194,7 +16490,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
16194
16490
|
};
|
|
16195
16491
|
|
|
16196
16492
|
// src/features/subagents/junie-subagent.ts
|
|
16197
|
-
import { join as
|
|
16493
|
+
import { join as join107 } from "path";
|
|
16198
16494
|
import { z as z61 } from "zod/mini";
|
|
16199
16495
|
var JunieSubagentFrontmatterSchema = z61.looseObject({
|
|
16200
16496
|
name: z61.optional(z61.string()),
|
|
@@ -16208,7 +16504,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
16208
16504
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16209
16505
|
if (!result.success) {
|
|
16210
16506
|
throw new Error(
|
|
16211
|
-
`Invalid frontmatter in ${
|
|
16507
|
+
`Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16212
16508
|
);
|
|
16213
16509
|
}
|
|
16214
16510
|
}
|
|
@@ -16223,7 +16519,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
16223
16519
|
throw new Error("JunieSubagent does not support global mode.");
|
|
16224
16520
|
}
|
|
16225
16521
|
return {
|
|
16226
|
-
relativeDirPath:
|
|
16522
|
+
relativeDirPath: join107(".junie", "agents")
|
|
16227
16523
|
};
|
|
16228
16524
|
}
|
|
16229
16525
|
getFrontmatter() {
|
|
@@ -16299,7 +16595,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
16299
16595
|
return {
|
|
16300
16596
|
success: false,
|
|
16301
16597
|
error: new Error(
|
|
16302
|
-
`Invalid frontmatter in ${
|
|
16598
|
+
`Invalid frontmatter in ${join107(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16303
16599
|
)
|
|
16304
16600
|
};
|
|
16305
16601
|
}
|
|
@@ -16317,7 +16613,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
16317
16613
|
global = false
|
|
16318
16614
|
}) {
|
|
16319
16615
|
const paths = this.getSettablePaths({ global });
|
|
16320
|
-
const filePath =
|
|
16616
|
+
const filePath = join107(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16321
16617
|
const fileContent = await readFileContent(filePath);
|
|
16322
16618
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16323
16619
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16352,10 +16648,10 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
16352
16648
|
};
|
|
16353
16649
|
|
|
16354
16650
|
// src/features/subagents/kilo-subagent.ts
|
|
16355
|
-
import { join as
|
|
16651
|
+
import { join as join109 } from "path";
|
|
16356
16652
|
|
|
16357
16653
|
// src/features/subagents/opencode-style-subagent.ts
|
|
16358
|
-
import { basename as basename8, join as
|
|
16654
|
+
import { basename as basename8, join as join108 } from "path";
|
|
16359
16655
|
import { z as z62 } from "zod/mini";
|
|
16360
16656
|
var OpenCodeStyleSubagentFrontmatterSchema = z62.looseObject({
|
|
16361
16657
|
description: z62.optional(z62.string()),
|
|
@@ -16370,7 +16666,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
16370
16666
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
16371
16667
|
if (!result.success) {
|
|
16372
16668
|
throw new Error(
|
|
16373
|
-
`Invalid frontmatter in ${
|
|
16669
|
+
`Invalid frontmatter in ${join108(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
16374
16670
|
);
|
|
16375
16671
|
}
|
|
16376
16672
|
}
|
|
@@ -16412,7 +16708,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
16412
16708
|
return {
|
|
16413
16709
|
success: false,
|
|
16414
16710
|
error: new Error(
|
|
16415
|
-
`Invalid frontmatter in ${
|
|
16711
|
+
`Invalid frontmatter in ${join108(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16416
16712
|
)
|
|
16417
16713
|
};
|
|
16418
16714
|
}
|
|
@@ -16428,7 +16724,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
16428
16724
|
global = false
|
|
16429
16725
|
} = {}) {
|
|
16430
16726
|
return {
|
|
16431
|
-
relativeDirPath: global ?
|
|
16727
|
+
relativeDirPath: global ? join109(".config", "kilo", "agent") : join109(".kilo", "agent")
|
|
16432
16728
|
};
|
|
16433
16729
|
}
|
|
16434
16730
|
static fromRulesyncSubagent({
|
|
@@ -16472,7 +16768,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
16472
16768
|
global = false
|
|
16473
16769
|
}) {
|
|
16474
16770
|
const paths = this.getSettablePaths({ global });
|
|
16475
|
-
const filePath =
|
|
16771
|
+
const filePath = join109(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16476
16772
|
const fileContent = await readFileContent(filePath);
|
|
16477
16773
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16478
16774
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16508,7 +16804,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
16508
16804
|
};
|
|
16509
16805
|
|
|
16510
16806
|
// src/features/subagents/kiro-subagent.ts
|
|
16511
|
-
import { join as
|
|
16807
|
+
import { join as join110 } from "path";
|
|
16512
16808
|
import { z as z63 } from "zod/mini";
|
|
16513
16809
|
var KiroCliSubagentJsonSchema = z63.looseObject({
|
|
16514
16810
|
name: z63.string(),
|
|
@@ -16535,7 +16831,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16535
16831
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
16536
16832
|
} catch (error) {
|
|
16537
16833
|
throw new Error(
|
|
16538
|
-
`Invalid JSON in ${
|
|
16834
|
+
`Invalid JSON in ${join110(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
16539
16835
|
{ cause: error }
|
|
16540
16836
|
);
|
|
16541
16837
|
}
|
|
@@ -16547,7 +16843,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16547
16843
|
}
|
|
16548
16844
|
static getSettablePaths(_options = {}) {
|
|
16549
16845
|
return {
|
|
16550
|
-
relativeDirPath:
|
|
16846
|
+
relativeDirPath: join110(".kiro", "agents")
|
|
16551
16847
|
};
|
|
16552
16848
|
}
|
|
16553
16849
|
getBody() {
|
|
@@ -16559,7 +16855,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16559
16855
|
parsed = JSON.parse(this.body);
|
|
16560
16856
|
} catch (error) {
|
|
16561
16857
|
throw new Error(
|
|
16562
|
-
`Failed to parse JSON in ${
|
|
16858
|
+
`Failed to parse JSON in ${join110(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
16563
16859
|
{ cause: error }
|
|
16564
16860
|
);
|
|
16565
16861
|
}
|
|
@@ -16640,7 +16936,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16640
16936
|
global = false
|
|
16641
16937
|
}) {
|
|
16642
16938
|
const paths = this.getSettablePaths({ global });
|
|
16643
|
-
const filePath =
|
|
16939
|
+
const filePath = join110(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16644
16940
|
const fileContent = await readFileContent(filePath);
|
|
16645
16941
|
const subagent = new _KiroSubagent({
|
|
16646
16942
|
baseDir,
|
|
@@ -16678,7 +16974,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16678
16974
|
};
|
|
16679
16975
|
|
|
16680
16976
|
// src/features/subagents/opencode-subagent.ts
|
|
16681
|
-
import { join as
|
|
16977
|
+
import { join as join111 } from "path";
|
|
16682
16978
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
16683
16979
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
16684
16980
|
getToolTarget() {
|
|
@@ -16688,7 +16984,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16688
16984
|
global = false
|
|
16689
16985
|
} = {}) {
|
|
16690
16986
|
return {
|
|
16691
|
-
relativeDirPath: global ?
|
|
16987
|
+
relativeDirPath: global ? join111(".config", "opencode", "agent") : join111(".opencode", "agent")
|
|
16692
16988
|
};
|
|
16693
16989
|
}
|
|
16694
16990
|
static fromRulesyncSubagent({
|
|
@@ -16732,7 +17028,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16732
17028
|
global = false
|
|
16733
17029
|
}) {
|
|
16734
17030
|
const paths = this.getSettablePaths({ global });
|
|
16735
|
-
const filePath =
|
|
17031
|
+
const filePath = join111(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16736
17032
|
const fileContent = await readFileContent(filePath);
|
|
16737
17033
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16738
17034
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16767,10 +17063,113 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16767
17063
|
}
|
|
16768
17064
|
};
|
|
16769
17065
|
|
|
16770
|
-
// src/features/subagents/
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
17066
|
+
// src/features/subagents/takt-subagent.ts
|
|
17067
|
+
import { join as join112 } from "path";
|
|
17068
|
+
var DEFAULT_TAKT_SUBAGENT_DIR = "personas";
|
|
17069
|
+
var TaktSubagent = class _TaktSubagent extends ToolSubagent {
|
|
17070
|
+
body;
|
|
17071
|
+
constructor({ body, ...rest }) {
|
|
17072
|
+
super({
|
|
17073
|
+
...rest
|
|
17074
|
+
});
|
|
17075
|
+
this.body = body;
|
|
17076
|
+
}
|
|
17077
|
+
static getSettablePaths(_options = {}) {
|
|
17078
|
+
return {
|
|
17079
|
+
relativeDirPath: join112(".takt", "facets", DEFAULT_TAKT_SUBAGENT_DIR)
|
|
17080
|
+
};
|
|
17081
|
+
}
|
|
17082
|
+
getBody() {
|
|
17083
|
+
return this.body;
|
|
17084
|
+
}
|
|
17085
|
+
toRulesyncSubagent() {
|
|
17086
|
+
const stem = this.getRelativeFilePath().replace(/\.md$/u, "");
|
|
17087
|
+
const rulesyncFrontmatter = {
|
|
17088
|
+
targets: ["*"],
|
|
17089
|
+
name: stem
|
|
17090
|
+
};
|
|
17091
|
+
return new RulesyncSubagent({
|
|
17092
|
+
baseDir: ".",
|
|
17093
|
+
frontmatter: rulesyncFrontmatter,
|
|
17094
|
+
body: this.body,
|
|
17095
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
17096
|
+
relativeFilePath: this.getRelativeFilePath(),
|
|
17097
|
+
validate: true
|
|
17098
|
+
});
|
|
17099
|
+
}
|
|
17100
|
+
static fromRulesyncSubagent({
|
|
17101
|
+
baseDir = process.cwd(),
|
|
17102
|
+
rulesyncSubagent,
|
|
17103
|
+
validate = true,
|
|
17104
|
+
global = false
|
|
17105
|
+
}) {
|
|
17106
|
+
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
17107
|
+
const taktSection = rulesyncFrontmatter.takt;
|
|
17108
|
+
const sourceLabel = rulesyncSubagent.getRelativeFilePath();
|
|
17109
|
+
const overrideName = typeof taktSection?.name === "string" ? taktSection.name : void 0;
|
|
17110
|
+
const sourceStem = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/u, "");
|
|
17111
|
+
const stem = overrideName ?? sourceStem;
|
|
17112
|
+
assertSafeTaktName({ name: stem, featureLabel: "subagent", sourceLabel });
|
|
17113
|
+
const relativeFilePath = `${stem}.md`;
|
|
17114
|
+
const paths = this.getSettablePaths({ global });
|
|
17115
|
+
const body = rulesyncSubagent.getBody();
|
|
17116
|
+
return new _TaktSubagent({
|
|
17117
|
+
baseDir,
|
|
17118
|
+
body,
|
|
17119
|
+
relativeDirPath: paths.relativeDirPath,
|
|
17120
|
+
relativeFilePath,
|
|
17121
|
+
fileContent: body,
|
|
17122
|
+
validate
|
|
17123
|
+
});
|
|
17124
|
+
}
|
|
17125
|
+
validate() {
|
|
17126
|
+
return { success: true, error: null };
|
|
17127
|
+
}
|
|
17128
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
17129
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
17130
|
+
rulesyncSubagent,
|
|
17131
|
+
toolTarget: "takt"
|
|
17132
|
+
});
|
|
17133
|
+
}
|
|
17134
|
+
static async fromFile({
|
|
17135
|
+
baseDir = process.cwd(),
|
|
17136
|
+
relativeFilePath,
|
|
17137
|
+
validate = true,
|
|
17138
|
+
global = false
|
|
17139
|
+
}) {
|
|
17140
|
+
const paths = this.getSettablePaths({ global });
|
|
17141
|
+
const filePath = join112(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
17142
|
+
const fileContent = await readFileContent(filePath);
|
|
17143
|
+
const { body } = parseFrontmatter(fileContent, filePath);
|
|
17144
|
+
return new _TaktSubagent({
|
|
17145
|
+
baseDir,
|
|
17146
|
+
relativeDirPath: paths.relativeDirPath,
|
|
17147
|
+
relativeFilePath,
|
|
17148
|
+
body: body.trim(),
|
|
17149
|
+
fileContent,
|
|
17150
|
+
validate
|
|
17151
|
+
});
|
|
17152
|
+
}
|
|
17153
|
+
static forDeletion({
|
|
17154
|
+
baseDir = process.cwd(),
|
|
17155
|
+
relativeDirPath,
|
|
17156
|
+
relativeFilePath
|
|
17157
|
+
}) {
|
|
17158
|
+
return new _TaktSubagent({
|
|
17159
|
+
baseDir,
|
|
17160
|
+
relativeDirPath,
|
|
17161
|
+
relativeFilePath,
|
|
17162
|
+
body: "",
|
|
17163
|
+
fileContent: "",
|
|
17164
|
+
validate: false
|
|
17165
|
+
});
|
|
17166
|
+
}
|
|
17167
|
+
};
|
|
17168
|
+
|
|
17169
|
+
// src/features/subagents/subagents-processor.ts
|
|
17170
|
+
var subagentsProcessorToolTargetTuple = [
|
|
17171
|
+
"kilo",
|
|
17172
|
+
"agentsmd",
|
|
16774
17173
|
"claudecode",
|
|
16775
17174
|
"claudecode-legacy",
|
|
16776
17175
|
"codexcli",
|
|
@@ -16783,7 +17182,8 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
16783
17182
|
"kiro",
|
|
16784
17183
|
"opencode",
|
|
16785
17184
|
"roo",
|
|
16786
|
-
"rovodev"
|
|
17185
|
+
"rovodev",
|
|
17186
|
+
"takt"
|
|
16787
17187
|
];
|
|
16788
17188
|
var SubagentsProcessorToolTargetSchema = z64.enum(subagentsProcessorToolTargetTuple);
|
|
16789
17189
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
@@ -16891,6 +17291,13 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
16891
17291
|
class: RovodevSubagent,
|
|
16892
17292
|
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
16893
17293
|
}
|
|
17294
|
+
],
|
|
17295
|
+
[
|
|
17296
|
+
"takt",
|
|
17297
|
+
{
|
|
17298
|
+
class: TaktSubagent,
|
|
17299
|
+
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
17300
|
+
}
|
|
16894
17301
|
]
|
|
16895
17302
|
]);
|
|
16896
17303
|
var defaultGetFactory5 = (target) => {
|
|
@@ -16976,7 +17383,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16976
17383
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
16977
17384
|
*/
|
|
16978
17385
|
async loadRulesyncFiles() {
|
|
16979
|
-
const subagentsDir =
|
|
17386
|
+
const subagentsDir = join113(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
16980
17387
|
const dirExists = await directoryExists(subagentsDir);
|
|
16981
17388
|
if (!dirExists) {
|
|
16982
17389
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -16991,7 +17398,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16991
17398
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
16992
17399
|
const rulesyncSubagents = [];
|
|
16993
17400
|
for (const mdFile of mdFiles) {
|
|
16994
|
-
const filepath =
|
|
17401
|
+
const filepath = join113(subagentsDir, mdFile);
|
|
16995
17402
|
try {
|
|
16996
17403
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16997
17404
|
relativeFilePath: mdFile,
|
|
@@ -17021,14 +17428,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
17021
17428
|
const factory = this.getFactory(this.toolTarget);
|
|
17022
17429
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
17023
17430
|
const subagentFilePaths = await findFilesByGlobs(
|
|
17024
|
-
|
|
17431
|
+
join113(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
17025
17432
|
);
|
|
17026
17433
|
if (forDeletion) {
|
|
17027
17434
|
const toolSubagents2 = subagentFilePaths.map(
|
|
17028
|
-
(
|
|
17435
|
+
(path4) => factory.class.forDeletion({
|
|
17029
17436
|
baseDir: this.baseDir,
|
|
17030
17437
|
relativeDirPath: paths.relativeDirPath,
|
|
17031
|
-
relativeFilePath: basename9(
|
|
17438
|
+
relativeFilePath: basename9(path4),
|
|
17032
17439
|
global: this.global
|
|
17033
17440
|
})
|
|
17034
17441
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -17039,9 +17446,9 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
17039
17446
|
}
|
|
17040
17447
|
const toolSubagents = await Promise.all(
|
|
17041
17448
|
subagentFilePaths.map(
|
|
17042
|
-
(
|
|
17449
|
+
(path4) => factory.class.fromFile({
|
|
17043
17450
|
baseDir: this.baseDir,
|
|
17044
|
-
relativeFilePath: basename9(
|
|
17451
|
+
relativeFilePath: basename9(path4),
|
|
17045
17452
|
global: this.global
|
|
17046
17453
|
})
|
|
17047
17454
|
)
|
|
@@ -17088,13 +17495,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
17088
17495
|
};
|
|
17089
17496
|
|
|
17090
17497
|
// src/features/rules/agentsmd-rule.ts
|
|
17091
|
-
import { join as
|
|
17498
|
+
import { join as join116 } from "path";
|
|
17092
17499
|
|
|
17093
17500
|
// src/features/rules/tool-rule.ts
|
|
17094
|
-
import { join as
|
|
17501
|
+
import { join as join115 } from "path";
|
|
17095
17502
|
|
|
17096
17503
|
// src/features/rules/rulesync-rule.ts
|
|
17097
|
-
import { join as
|
|
17504
|
+
import { join as join114 } from "path";
|
|
17098
17505
|
import { z as z65 } from "zod/mini";
|
|
17099
17506
|
var RulesyncRuleFrontmatterSchema = z65.object({
|
|
17100
17507
|
root: z65.optional(z65.boolean()),
|
|
@@ -17132,6 +17539,12 @@ var RulesyncRuleFrontmatterSchema = z65.object({
|
|
|
17132
17539
|
trigger: z65.optional(z65.string()),
|
|
17133
17540
|
globs: z65.optional(z65.array(z65.string()))
|
|
17134
17541
|
})
|
|
17542
|
+
),
|
|
17543
|
+
takt: z65.optional(
|
|
17544
|
+
z65.looseObject({
|
|
17545
|
+
// Rename the emitted file stem (e.g. "coder.md" → "{name}.md").
|
|
17546
|
+
name: z65.optional(z65.string())
|
|
17547
|
+
})
|
|
17135
17548
|
)
|
|
17136
17549
|
});
|
|
17137
17550
|
var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
@@ -17141,7 +17554,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
17141
17554
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17142
17555
|
if (!parseResult.success && rest.validate !== false) {
|
|
17143
17556
|
throw new Error(
|
|
17144
|
-
`Invalid frontmatter in ${
|
|
17557
|
+
`Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
17145
17558
|
);
|
|
17146
17559
|
}
|
|
17147
17560
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -17176,7 +17589,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
17176
17589
|
return {
|
|
17177
17590
|
success: false,
|
|
17178
17591
|
error: new Error(
|
|
17179
|
-
`Invalid frontmatter in ${
|
|
17592
|
+
`Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17180
17593
|
)
|
|
17181
17594
|
};
|
|
17182
17595
|
}
|
|
@@ -17185,7 +17598,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
17185
17598
|
relativeFilePath,
|
|
17186
17599
|
validate = true
|
|
17187
17600
|
}) {
|
|
17188
|
-
const filePath =
|
|
17601
|
+
const filePath = join114(
|
|
17189
17602
|
process.cwd(),
|
|
17190
17603
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
17191
17604
|
relativeFilePath
|
|
@@ -17284,7 +17697,7 @@ var ToolRule = class extends ToolFile {
|
|
|
17284
17697
|
rulesyncRule,
|
|
17285
17698
|
validate = true,
|
|
17286
17699
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
17287
|
-
nonRootPath = { relativeDirPath:
|
|
17700
|
+
nonRootPath = { relativeDirPath: join115(".agents", "memories") }
|
|
17288
17701
|
}) {
|
|
17289
17702
|
const params = this.buildToolRuleParamsDefault({
|
|
17290
17703
|
baseDir,
|
|
@@ -17295,7 +17708,7 @@ var ToolRule = class extends ToolFile {
|
|
|
17295
17708
|
});
|
|
17296
17709
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
17297
17710
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
17298
|
-
params.relativeDirPath =
|
|
17711
|
+
params.relativeDirPath = join115(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
17299
17712
|
params.relativeFilePath = "AGENTS.md";
|
|
17300
17713
|
}
|
|
17301
17714
|
return params;
|
|
@@ -17344,7 +17757,7 @@ var ToolRule = class extends ToolFile {
|
|
|
17344
17757
|
}
|
|
17345
17758
|
};
|
|
17346
17759
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
17347
|
-
return excludeToolDir ? subDir :
|
|
17760
|
+
return excludeToolDir ? subDir : join115(toolDir, subDir);
|
|
17348
17761
|
}
|
|
17349
17762
|
|
|
17350
17763
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -17373,8 +17786,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
17373
17786
|
validate = true
|
|
17374
17787
|
}) {
|
|
17375
17788
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
17376
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
17377
|
-
const fileContent = await readFileContent(
|
|
17789
|
+
const relativePath = isRoot ? "AGENTS.md" : join116(".agents", "memories", relativeFilePath);
|
|
17790
|
+
const fileContent = await readFileContent(join116(baseDir, relativePath));
|
|
17378
17791
|
return new _AgentsMdRule({
|
|
17379
17792
|
baseDir,
|
|
17380
17793
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -17429,7 +17842,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
17429
17842
|
};
|
|
17430
17843
|
|
|
17431
17844
|
// src/features/rules/antigravity-rule.ts
|
|
17432
|
-
import { join as
|
|
17845
|
+
import { join as join117 } from "path";
|
|
17433
17846
|
import { z as z66 } from "zod/mini";
|
|
17434
17847
|
var AntigravityRuleFrontmatterSchema = z66.looseObject({
|
|
17435
17848
|
trigger: z66.optional(
|
|
@@ -17588,7 +18001,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17588
18001
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17589
18002
|
if (!result.success) {
|
|
17590
18003
|
throw new Error(
|
|
17591
|
-
`Invalid frontmatter in ${
|
|
18004
|
+
`Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17592
18005
|
);
|
|
17593
18006
|
}
|
|
17594
18007
|
}
|
|
@@ -17612,7 +18025,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17612
18025
|
relativeFilePath,
|
|
17613
18026
|
validate = true
|
|
17614
18027
|
}) {
|
|
17615
|
-
const filePath =
|
|
18028
|
+
const filePath = join117(
|
|
17616
18029
|
baseDir,
|
|
17617
18030
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17618
18031
|
relativeFilePath
|
|
@@ -17752,7 +18165,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17752
18165
|
};
|
|
17753
18166
|
|
|
17754
18167
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
17755
|
-
import { join as
|
|
18168
|
+
import { join as join118 } from "path";
|
|
17756
18169
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
17757
18170
|
toRulesyncRule() {
|
|
17758
18171
|
const rulesyncFrontmatter = {
|
|
@@ -17812,8 +18225,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17812
18225
|
}) {
|
|
17813
18226
|
const settablePaths = this.getSettablePaths();
|
|
17814
18227
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
17815
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
17816
|
-
const fileContent = await readFileContent(
|
|
18228
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join118(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18229
|
+
const fileContent = await readFileContent(join118(baseDir, relativePath));
|
|
17817
18230
|
return new _AugmentcodeLegacyRule({
|
|
17818
18231
|
baseDir,
|
|
17819
18232
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17842,7 +18255,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17842
18255
|
};
|
|
17843
18256
|
|
|
17844
18257
|
// src/features/rules/augmentcode-rule.ts
|
|
17845
|
-
import { join as
|
|
18258
|
+
import { join as join119 } from "path";
|
|
17846
18259
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
17847
18260
|
toRulesyncRule() {
|
|
17848
18261
|
return this.toRulesyncRuleDefault();
|
|
@@ -17873,7 +18286,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17873
18286
|
relativeFilePath,
|
|
17874
18287
|
validate = true
|
|
17875
18288
|
}) {
|
|
17876
|
-
const filePath =
|
|
18289
|
+
const filePath = join119(
|
|
17877
18290
|
baseDir,
|
|
17878
18291
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17879
18292
|
relativeFilePath
|
|
@@ -17913,7 +18326,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17913
18326
|
};
|
|
17914
18327
|
|
|
17915
18328
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
17916
|
-
import { join as
|
|
18329
|
+
import { join as join120 } from "path";
|
|
17917
18330
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
17918
18331
|
static getSettablePaths({
|
|
17919
18332
|
global,
|
|
@@ -17955,7 +18368,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17955
18368
|
if (isRoot) {
|
|
17956
18369
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17957
18370
|
const fileContent2 = await readFileContent(
|
|
17958
|
-
|
|
18371
|
+
join120(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17959
18372
|
);
|
|
17960
18373
|
return new _ClaudecodeLegacyRule({
|
|
17961
18374
|
baseDir,
|
|
@@ -17969,8 +18382,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17969
18382
|
if (!paths.nonRoot) {
|
|
17970
18383
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17971
18384
|
}
|
|
17972
|
-
const relativePath =
|
|
17973
|
-
const fileContent = await readFileContent(
|
|
18385
|
+
const relativePath = join120(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18386
|
+
const fileContent = await readFileContent(join120(baseDir, relativePath));
|
|
17974
18387
|
return new _ClaudecodeLegacyRule({
|
|
17975
18388
|
baseDir,
|
|
17976
18389
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18029,7 +18442,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
18029
18442
|
};
|
|
18030
18443
|
|
|
18031
18444
|
// src/features/rules/claudecode-rule.ts
|
|
18032
|
-
import { join as
|
|
18445
|
+
import { join as join121 } from "path";
|
|
18033
18446
|
import { z as z67 } from "zod/mini";
|
|
18034
18447
|
var ClaudecodeRuleFrontmatterSchema = z67.object({
|
|
18035
18448
|
paths: z67.optional(z67.array(z67.string()))
|
|
@@ -18070,7 +18483,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
18070
18483
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18071
18484
|
if (!result.success) {
|
|
18072
18485
|
throw new Error(
|
|
18073
|
-
`Invalid frontmatter in ${
|
|
18486
|
+
`Invalid frontmatter in ${join121(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18074
18487
|
);
|
|
18075
18488
|
}
|
|
18076
18489
|
}
|
|
@@ -18100,7 +18513,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
18100
18513
|
if (isRoot) {
|
|
18101
18514
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
18102
18515
|
const fileContent2 = await readFileContent(
|
|
18103
|
-
|
|
18516
|
+
join121(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
18104
18517
|
);
|
|
18105
18518
|
return new _ClaudecodeRule({
|
|
18106
18519
|
baseDir,
|
|
@@ -18115,8 +18528,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
18115
18528
|
if (!paths.nonRoot) {
|
|
18116
18529
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18117
18530
|
}
|
|
18118
|
-
const relativePath =
|
|
18119
|
-
const filePath =
|
|
18531
|
+
const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18532
|
+
const filePath = join121(baseDir, relativePath);
|
|
18120
18533
|
const fileContent = await readFileContent(filePath);
|
|
18121
18534
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
18122
18535
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18227,7 +18640,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
18227
18640
|
return {
|
|
18228
18641
|
success: false,
|
|
18229
18642
|
error: new Error(
|
|
18230
|
-
`Invalid frontmatter in ${
|
|
18643
|
+
`Invalid frontmatter in ${join121(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18231
18644
|
)
|
|
18232
18645
|
};
|
|
18233
18646
|
}
|
|
@@ -18247,7 +18660,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
18247
18660
|
};
|
|
18248
18661
|
|
|
18249
18662
|
// src/features/rules/cline-rule.ts
|
|
18250
|
-
import { join as
|
|
18663
|
+
import { join as join122 } from "path";
|
|
18251
18664
|
import { z as z68 } from "zod/mini";
|
|
18252
18665
|
var ClineRuleFrontmatterSchema = z68.object({
|
|
18253
18666
|
description: z68.string()
|
|
@@ -18293,7 +18706,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
18293
18706
|
validate = true
|
|
18294
18707
|
}) {
|
|
18295
18708
|
const fileContent = await readFileContent(
|
|
18296
|
-
|
|
18709
|
+
join122(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18297
18710
|
);
|
|
18298
18711
|
return new _ClineRule({
|
|
18299
18712
|
baseDir,
|
|
@@ -18319,7 +18732,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
18319
18732
|
};
|
|
18320
18733
|
|
|
18321
18734
|
// src/features/rules/codexcli-rule.ts
|
|
18322
|
-
import { join as
|
|
18735
|
+
import { join as join123 } from "path";
|
|
18323
18736
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
18324
18737
|
static getSettablePaths({
|
|
18325
18738
|
global,
|
|
@@ -18354,7 +18767,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
18354
18767
|
if (isRoot) {
|
|
18355
18768
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18356
18769
|
const fileContent2 = await readFileContent(
|
|
18357
|
-
|
|
18770
|
+
join123(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18358
18771
|
);
|
|
18359
18772
|
return new _CodexcliRule({
|
|
18360
18773
|
baseDir,
|
|
@@ -18368,8 +18781,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
18368
18781
|
if (!paths.nonRoot) {
|
|
18369
18782
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18370
18783
|
}
|
|
18371
|
-
const relativePath =
|
|
18372
|
-
const fileContent = await readFileContent(
|
|
18784
|
+
const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18785
|
+
const fileContent = await readFileContent(join123(baseDir, relativePath));
|
|
18373
18786
|
return new _CodexcliRule({
|
|
18374
18787
|
baseDir,
|
|
18375
18788
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18428,7 +18841,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
18428
18841
|
};
|
|
18429
18842
|
|
|
18430
18843
|
// src/features/rules/copilot-rule.ts
|
|
18431
|
-
import { join as
|
|
18844
|
+
import { join as join124 } from "path";
|
|
18432
18845
|
import { z as z69 } from "zod/mini";
|
|
18433
18846
|
var CopilotRuleFrontmatterSchema = z69.object({
|
|
18434
18847
|
description: z69.optional(z69.string()),
|
|
@@ -18465,7 +18878,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18465
18878
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18466
18879
|
if (!result.success) {
|
|
18467
18880
|
throw new Error(
|
|
18468
|
-
`Invalid frontmatter in ${
|
|
18881
|
+
`Invalid frontmatter in ${join124(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18469
18882
|
);
|
|
18470
18883
|
}
|
|
18471
18884
|
}
|
|
@@ -18555,8 +18968,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18555
18968
|
const paths = this.getSettablePaths({ global });
|
|
18556
18969
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18557
18970
|
if (isRoot) {
|
|
18558
|
-
const relativePath2 =
|
|
18559
|
-
const filePath2 =
|
|
18971
|
+
const relativePath2 = join124(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18972
|
+
const filePath2 = join124(baseDir, relativePath2);
|
|
18560
18973
|
const fileContent2 = await readFileContent(filePath2);
|
|
18561
18974
|
return new _CopilotRule({
|
|
18562
18975
|
baseDir,
|
|
@@ -18571,8 +18984,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18571
18984
|
if (!paths.nonRoot) {
|
|
18572
18985
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18573
18986
|
}
|
|
18574
|
-
const relativePath =
|
|
18575
|
-
const filePath =
|
|
18987
|
+
const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18988
|
+
const filePath = join124(baseDir, relativePath);
|
|
18576
18989
|
const fileContent = await readFileContent(filePath);
|
|
18577
18990
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
18578
18991
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18618,7 +19031,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18618
19031
|
return {
|
|
18619
19032
|
success: false,
|
|
18620
19033
|
error: new Error(
|
|
18621
|
-
`Invalid frontmatter in ${
|
|
19034
|
+
`Invalid frontmatter in ${join124(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18622
19035
|
)
|
|
18623
19036
|
};
|
|
18624
19037
|
}
|
|
@@ -18674,7 +19087,7 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
18674
19087
|
};
|
|
18675
19088
|
|
|
18676
19089
|
// src/features/rules/cursor-rule.ts
|
|
18677
|
-
import { join as
|
|
19090
|
+
import { join as join125 } from "path";
|
|
18678
19091
|
import { z as z70 } from "zod/mini";
|
|
18679
19092
|
var CursorRuleFrontmatterSchema = z70.object({
|
|
18680
19093
|
description: z70.optional(z70.string()),
|
|
@@ -18696,7 +19109,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18696
19109
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18697
19110
|
if (!result.success) {
|
|
18698
19111
|
throw new Error(
|
|
18699
|
-
`Invalid frontmatter in ${
|
|
19112
|
+
`Invalid frontmatter in ${join125(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18700
19113
|
);
|
|
18701
19114
|
}
|
|
18702
19115
|
}
|
|
@@ -18812,7 +19225,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18812
19225
|
relativeFilePath,
|
|
18813
19226
|
validate = true
|
|
18814
19227
|
}) {
|
|
18815
|
-
const filePath =
|
|
19228
|
+
const filePath = join125(
|
|
18816
19229
|
baseDir,
|
|
18817
19230
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
18818
19231
|
relativeFilePath
|
|
@@ -18822,7 +19235,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18822
19235
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18823
19236
|
if (!result.success) {
|
|
18824
19237
|
throw new Error(
|
|
18825
|
-
`Invalid frontmatter in ${
|
|
19238
|
+
`Invalid frontmatter in ${join125(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
18826
19239
|
);
|
|
18827
19240
|
}
|
|
18828
19241
|
return new _CursorRule({
|
|
@@ -18859,7 +19272,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18859
19272
|
return {
|
|
18860
19273
|
success: false,
|
|
18861
19274
|
error: new Error(
|
|
18862
|
-
`Invalid frontmatter in ${
|
|
19275
|
+
`Invalid frontmatter in ${join125(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18863
19276
|
)
|
|
18864
19277
|
};
|
|
18865
19278
|
}
|
|
@@ -18879,7 +19292,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18879
19292
|
};
|
|
18880
19293
|
|
|
18881
19294
|
// src/features/rules/deepagents-rule.ts
|
|
18882
|
-
import { join as
|
|
19295
|
+
import { join as join126 } from "path";
|
|
18883
19296
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
18884
19297
|
constructor({ fileContent, root, ...rest }) {
|
|
18885
19298
|
super({
|
|
@@ -18906,8 +19319,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18906
19319
|
}) {
|
|
18907
19320
|
const settablePaths = this.getSettablePaths();
|
|
18908
19321
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18909
|
-
const relativePath = isRoot ?
|
|
18910
|
-
const fileContent = await readFileContent(
|
|
19322
|
+
const relativePath = isRoot ? join126(".deepagents", "AGENTS.md") : join126(".deepagents", "memories", relativeFilePath);
|
|
19323
|
+
const fileContent = await readFileContent(join126(baseDir, relativePath));
|
|
18911
19324
|
return new _DeepagentsRule({
|
|
18912
19325
|
baseDir,
|
|
18913
19326
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18962,7 +19375,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18962
19375
|
};
|
|
18963
19376
|
|
|
18964
19377
|
// src/features/rules/factorydroid-rule.ts
|
|
18965
|
-
import { join as
|
|
19378
|
+
import { join as join127 } from "path";
|
|
18966
19379
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
18967
19380
|
constructor({ fileContent, root, ...rest }) {
|
|
18968
19381
|
super({
|
|
@@ -19002,8 +19415,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
19002
19415
|
const paths = this.getSettablePaths({ global });
|
|
19003
19416
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19004
19417
|
if (isRoot) {
|
|
19005
|
-
const relativePath2 =
|
|
19006
|
-
const fileContent2 = await readFileContent(
|
|
19418
|
+
const relativePath2 = join127(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19419
|
+
const fileContent2 = await readFileContent(join127(baseDir, relativePath2));
|
|
19007
19420
|
return new _FactorydroidRule({
|
|
19008
19421
|
baseDir,
|
|
19009
19422
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -19016,8 +19429,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
19016
19429
|
if (!paths.nonRoot) {
|
|
19017
19430
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19018
19431
|
}
|
|
19019
|
-
const relativePath =
|
|
19020
|
-
const fileContent = await readFileContent(
|
|
19432
|
+
const relativePath = join127(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19433
|
+
const fileContent = await readFileContent(join127(baseDir, relativePath));
|
|
19021
19434
|
return new _FactorydroidRule({
|
|
19022
19435
|
baseDir,
|
|
19023
19436
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19076,7 +19489,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
19076
19489
|
};
|
|
19077
19490
|
|
|
19078
19491
|
// src/features/rules/geminicli-rule.ts
|
|
19079
|
-
import { join as
|
|
19492
|
+
import { join as join128 } from "path";
|
|
19080
19493
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
19081
19494
|
static getSettablePaths({
|
|
19082
19495
|
global,
|
|
@@ -19111,7 +19524,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
19111
19524
|
if (isRoot) {
|
|
19112
19525
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19113
19526
|
const fileContent2 = await readFileContent(
|
|
19114
|
-
|
|
19527
|
+
join128(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19115
19528
|
);
|
|
19116
19529
|
return new _GeminiCliRule({
|
|
19117
19530
|
baseDir,
|
|
@@ -19125,8 +19538,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
19125
19538
|
if (!paths.nonRoot) {
|
|
19126
19539
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19127
19540
|
}
|
|
19128
|
-
const relativePath =
|
|
19129
|
-
const fileContent = await readFileContent(
|
|
19541
|
+
const relativePath = join128(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19542
|
+
const fileContent = await readFileContent(join128(baseDir, relativePath));
|
|
19130
19543
|
return new _GeminiCliRule({
|
|
19131
19544
|
baseDir,
|
|
19132
19545
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19185,7 +19598,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
19185
19598
|
};
|
|
19186
19599
|
|
|
19187
19600
|
// src/features/rules/goose-rule.ts
|
|
19188
|
-
import { join as
|
|
19601
|
+
import { join as join129 } from "path";
|
|
19189
19602
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
19190
19603
|
static getSettablePaths({
|
|
19191
19604
|
global,
|
|
@@ -19220,7 +19633,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
19220
19633
|
if (isRoot) {
|
|
19221
19634
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19222
19635
|
const fileContent2 = await readFileContent(
|
|
19223
|
-
|
|
19636
|
+
join129(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19224
19637
|
);
|
|
19225
19638
|
return new _GooseRule({
|
|
19226
19639
|
baseDir,
|
|
@@ -19234,8 +19647,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
19234
19647
|
if (!paths.nonRoot) {
|
|
19235
19648
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19236
19649
|
}
|
|
19237
|
-
const relativePath =
|
|
19238
|
-
const fileContent = await readFileContent(
|
|
19650
|
+
const relativePath = join129(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19651
|
+
const fileContent = await readFileContent(join129(baseDir, relativePath));
|
|
19239
19652
|
return new _GooseRule({
|
|
19240
19653
|
baseDir,
|
|
19241
19654
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19294,7 +19707,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
19294
19707
|
};
|
|
19295
19708
|
|
|
19296
19709
|
// src/features/rules/junie-rule.ts
|
|
19297
|
-
import { join as
|
|
19710
|
+
import { join as join130 } from "path";
|
|
19298
19711
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
19299
19712
|
static getSettablePaths(_options = {}) {
|
|
19300
19713
|
return {
|
|
@@ -19323,8 +19736,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
19323
19736
|
}) {
|
|
19324
19737
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
19325
19738
|
const settablePaths = this.getSettablePaths();
|
|
19326
|
-
const relativePath = isRoot ?
|
|
19327
|
-
const fileContent = await readFileContent(
|
|
19739
|
+
const relativePath = isRoot ? join130(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join130(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19740
|
+
const fileContent = await readFileContent(join130(baseDir, relativePath));
|
|
19328
19741
|
return new _JunieRule({
|
|
19329
19742
|
baseDir,
|
|
19330
19743
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -19379,7 +19792,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
19379
19792
|
};
|
|
19380
19793
|
|
|
19381
19794
|
// src/features/rules/kilo-rule.ts
|
|
19382
|
-
import { join as
|
|
19795
|
+
import { join as join131 } from "path";
|
|
19383
19796
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
19384
19797
|
static getSettablePaths({
|
|
19385
19798
|
global,
|
|
@@ -19414,7 +19827,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
19414
19827
|
if (isRoot) {
|
|
19415
19828
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19416
19829
|
const fileContent2 = await readFileContent(
|
|
19417
|
-
|
|
19830
|
+
join131(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19418
19831
|
);
|
|
19419
19832
|
return new _KiloRule({
|
|
19420
19833
|
baseDir,
|
|
@@ -19428,8 +19841,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
19428
19841
|
if (!paths.nonRoot) {
|
|
19429
19842
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19430
19843
|
}
|
|
19431
|
-
const relativePath =
|
|
19432
|
-
const fileContent = await readFileContent(
|
|
19844
|
+
const relativePath = join131(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19845
|
+
const fileContent = await readFileContent(join131(baseDir, relativePath));
|
|
19433
19846
|
return new _KiloRule({
|
|
19434
19847
|
baseDir,
|
|
19435
19848
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19488,7 +19901,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
19488
19901
|
};
|
|
19489
19902
|
|
|
19490
19903
|
// src/features/rules/kiro-rule.ts
|
|
19491
|
-
import { join as
|
|
19904
|
+
import { join as join132 } from "path";
|
|
19492
19905
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
19493
19906
|
static getSettablePaths(_options = {}) {
|
|
19494
19907
|
return {
|
|
@@ -19503,7 +19916,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
19503
19916
|
validate = true
|
|
19504
19917
|
}) {
|
|
19505
19918
|
const fileContent = await readFileContent(
|
|
19506
|
-
|
|
19919
|
+
join132(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19507
19920
|
);
|
|
19508
19921
|
return new _KiroRule({
|
|
19509
19922
|
baseDir,
|
|
@@ -19557,7 +19970,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
19557
19970
|
};
|
|
19558
19971
|
|
|
19559
19972
|
// src/features/rules/opencode-rule.ts
|
|
19560
|
-
import { join as
|
|
19973
|
+
import { join as join133 } from "path";
|
|
19561
19974
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
19562
19975
|
static getSettablePaths({
|
|
19563
19976
|
global,
|
|
@@ -19592,7 +20005,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19592
20005
|
if (isRoot) {
|
|
19593
20006
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19594
20007
|
const fileContent2 = await readFileContent(
|
|
19595
|
-
|
|
20008
|
+
join133(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19596
20009
|
);
|
|
19597
20010
|
return new _OpenCodeRule({
|
|
19598
20011
|
baseDir,
|
|
@@ -19606,8 +20019,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19606
20019
|
if (!paths.nonRoot) {
|
|
19607
20020
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19608
20021
|
}
|
|
19609
|
-
const relativePath =
|
|
19610
|
-
const fileContent = await readFileContent(
|
|
20022
|
+
const relativePath = join133(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
20023
|
+
const fileContent = await readFileContent(join133(baseDir, relativePath));
|
|
19611
20024
|
return new _OpenCodeRule({
|
|
19612
20025
|
baseDir,
|
|
19613
20026
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19666,7 +20079,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19666
20079
|
};
|
|
19667
20080
|
|
|
19668
20081
|
// src/features/rules/qwencode-rule.ts
|
|
19669
|
-
import { join as
|
|
20082
|
+
import { join as join134 } from "path";
|
|
19670
20083
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
19671
20084
|
static getSettablePaths(_options = {}) {
|
|
19672
20085
|
return {
|
|
@@ -19685,8 +20098,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19685
20098
|
validate = true
|
|
19686
20099
|
}) {
|
|
19687
20100
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
19688
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
19689
|
-
const fileContent = await readFileContent(
|
|
20101
|
+
const relativePath = isRoot ? "QWEN.md" : join134(".qwen", "memories", relativeFilePath);
|
|
20102
|
+
const fileContent = await readFileContent(join134(baseDir, relativePath));
|
|
19690
20103
|
return new _QwencodeRule({
|
|
19691
20104
|
baseDir,
|
|
19692
20105
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -19738,7 +20151,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19738
20151
|
};
|
|
19739
20152
|
|
|
19740
20153
|
// src/features/rules/replit-rule.ts
|
|
19741
|
-
import { join as
|
|
20154
|
+
import { join as join135 } from "path";
|
|
19742
20155
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
19743
20156
|
static getSettablePaths(_options = {}) {
|
|
19744
20157
|
return {
|
|
@@ -19760,7 +20173,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19760
20173
|
}
|
|
19761
20174
|
const relativePath = paths.root.relativeFilePath;
|
|
19762
20175
|
const fileContent = await readFileContent(
|
|
19763
|
-
|
|
20176
|
+
join135(baseDir, paths.root.relativeDirPath, relativePath)
|
|
19764
20177
|
);
|
|
19765
20178
|
return new _ReplitRule({
|
|
19766
20179
|
baseDir,
|
|
@@ -19826,7 +20239,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19826
20239
|
};
|
|
19827
20240
|
|
|
19828
20241
|
// src/features/rules/roo-rule.ts
|
|
19829
|
-
import { join as
|
|
20242
|
+
import { join as join136 } from "path";
|
|
19830
20243
|
var RooRule = class _RooRule extends ToolRule {
|
|
19831
20244
|
static getSettablePaths(_options = {}) {
|
|
19832
20245
|
return {
|
|
@@ -19841,7 +20254,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19841
20254
|
validate = true
|
|
19842
20255
|
}) {
|
|
19843
20256
|
const fileContent = await readFileContent(
|
|
19844
|
-
|
|
20257
|
+
join136(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19845
20258
|
);
|
|
19846
20259
|
return new _RooRule({
|
|
19847
20260
|
baseDir,
|
|
@@ -19910,7 +20323,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19910
20323
|
};
|
|
19911
20324
|
|
|
19912
20325
|
// src/features/rules/rovodev-rule.ts
|
|
19913
|
-
import { join as
|
|
20326
|
+
import { join as join137 } from "path";
|
|
19914
20327
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
19915
20328
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
19916
20329
|
/**
|
|
@@ -19954,7 +20367,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19954
20367
|
root: rovodevAgents,
|
|
19955
20368
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
19956
20369
|
nonRoot: {
|
|
19957
|
-
relativeDirPath:
|
|
20370
|
+
relativeDirPath: join137(".rovodev", ".rulesync", "modular-rules")
|
|
19958
20371
|
}
|
|
19959
20372
|
};
|
|
19960
20373
|
}
|
|
@@ -19993,10 +20406,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19993
20406
|
}) {
|
|
19994
20407
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19995
20408
|
throw new Error(
|
|
19996
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${
|
|
20409
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join137(relativeDirPath, relativeFilePath)}`
|
|
19997
20410
|
);
|
|
19998
20411
|
}
|
|
19999
|
-
const fileContent = await readFileContent(
|
|
20412
|
+
const fileContent = await readFileContent(join137(baseDir, relativeDirPath, relativeFilePath));
|
|
20000
20413
|
return new _RovodevRule({
|
|
20001
20414
|
baseDir,
|
|
20002
20415
|
relativeDirPath,
|
|
@@ -20016,10 +20429,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
20016
20429
|
paths
|
|
20017
20430
|
}) {
|
|
20018
20431
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
20019
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${
|
|
20432
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join137(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join137(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
20020
20433
|
if (relativeFilePath !== "AGENTS.md") {
|
|
20021
20434
|
throw new Error(
|
|
20022
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
20435
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join137(relativeDirPath, relativeFilePath)}`
|
|
20023
20436
|
);
|
|
20024
20437
|
}
|
|
20025
20438
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -20027,10 +20440,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
20027
20440
|
);
|
|
20028
20441
|
if (!allowed) {
|
|
20029
20442
|
throw new Error(
|
|
20030
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
20443
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join137(relativeDirPath, relativeFilePath)}`
|
|
20031
20444
|
);
|
|
20032
20445
|
}
|
|
20033
|
-
const fileContent = await readFileContent(
|
|
20446
|
+
const fileContent = await readFileContent(join137(baseDir, relativeDirPath, relativeFilePath));
|
|
20034
20447
|
return new _RovodevRule({
|
|
20035
20448
|
baseDir,
|
|
20036
20449
|
relativeDirPath,
|
|
@@ -20143,8 +20556,114 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
20143
20556
|
}
|
|
20144
20557
|
};
|
|
20145
20558
|
|
|
20559
|
+
// src/features/rules/takt-rule.ts
|
|
20560
|
+
import { join as join138 } from "path";
|
|
20561
|
+
var DEFAULT_TAKT_RULE_DIR = "policies";
|
|
20562
|
+
var TaktRule = class _TaktRule extends ToolRule {
|
|
20563
|
+
static getSettablePaths({
|
|
20564
|
+
global,
|
|
20565
|
+
excludeToolDir
|
|
20566
|
+
} = {}) {
|
|
20567
|
+
if (global) {
|
|
20568
|
+
return {
|
|
20569
|
+
root: {
|
|
20570
|
+
relativeDirPath: buildToolPath(
|
|
20571
|
+
".takt",
|
|
20572
|
+
join138("facets", DEFAULT_TAKT_RULE_DIR),
|
|
20573
|
+
excludeToolDir
|
|
20574
|
+
),
|
|
20575
|
+
relativeFilePath: "overview.md"
|
|
20576
|
+
}
|
|
20577
|
+
};
|
|
20578
|
+
}
|
|
20579
|
+
return {
|
|
20580
|
+
nonRoot: {
|
|
20581
|
+
relativeDirPath: buildToolPath(
|
|
20582
|
+
".takt",
|
|
20583
|
+
join138("facets", DEFAULT_TAKT_RULE_DIR),
|
|
20584
|
+
excludeToolDir
|
|
20585
|
+
)
|
|
20586
|
+
}
|
|
20587
|
+
};
|
|
20588
|
+
}
|
|
20589
|
+
constructor({ body, ...rest }) {
|
|
20590
|
+
super({
|
|
20591
|
+
...rest,
|
|
20592
|
+
fileContent: body
|
|
20593
|
+
});
|
|
20594
|
+
}
|
|
20595
|
+
static async fromFile({
|
|
20596
|
+
baseDir = process.cwd(),
|
|
20597
|
+
relativeFilePath,
|
|
20598
|
+
validate = true,
|
|
20599
|
+
relativeDirPath: overrideDirPath
|
|
20600
|
+
}) {
|
|
20601
|
+
const dirPath = overrideDirPath ?? join138(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
20602
|
+
const filePath = join138(baseDir, dirPath, relativeFilePath);
|
|
20603
|
+
const fileContent = await readFileContent(filePath);
|
|
20604
|
+
const { body } = parseFrontmatter(fileContent, filePath);
|
|
20605
|
+
return new _TaktRule({
|
|
20606
|
+
baseDir,
|
|
20607
|
+
relativeDirPath: dirPath,
|
|
20608
|
+
relativeFilePath,
|
|
20609
|
+
body: body.trim(),
|
|
20610
|
+
validate,
|
|
20611
|
+
root: false
|
|
20612
|
+
});
|
|
20613
|
+
}
|
|
20614
|
+
static forDeletion({
|
|
20615
|
+
baseDir = process.cwd(),
|
|
20616
|
+
relativeDirPath,
|
|
20617
|
+
relativeFilePath
|
|
20618
|
+
}) {
|
|
20619
|
+
return new _TaktRule({
|
|
20620
|
+
baseDir,
|
|
20621
|
+
relativeDirPath,
|
|
20622
|
+
relativeFilePath,
|
|
20623
|
+
body: "",
|
|
20624
|
+
validate: false,
|
|
20625
|
+
root: false
|
|
20626
|
+
});
|
|
20627
|
+
}
|
|
20628
|
+
static fromRulesyncRule({
|
|
20629
|
+
baseDir = process.cwd(),
|
|
20630
|
+
rulesyncRule,
|
|
20631
|
+
validate = true
|
|
20632
|
+
}) {
|
|
20633
|
+
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
20634
|
+
const taktSection = rulesyncFrontmatter.takt;
|
|
20635
|
+
const sourceLabel = rulesyncRule.getRelativeFilePath();
|
|
20636
|
+
const overrideName = typeof taktSection?.name === "string" ? taktSection.name : void 0;
|
|
20637
|
+
const sourceStem = rulesyncRule.getRelativeFilePath().replace(/\.md$/u, "");
|
|
20638
|
+
const stem = overrideName ?? sourceStem;
|
|
20639
|
+
assertSafeTaktName({ name: stem, featureLabel: "rule", sourceLabel });
|
|
20640
|
+
const relativeFilePath = `${stem}.md`;
|
|
20641
|
+
const relativeDirPath = join138(".takt", "facets", DEFAULT_TAKT_RULE_DIR);
|
|
20642
|
+
return new _TaktRule({
|
|
20643
|
+
baseDir,
|
|
20644
|
+
relativeDirPath,
|
|
20645
|
+
relativeFilePath,
|
|
20646
|
+
body: rulesyncRule.getBody(),
|
|
20647
|
+
validate,
|
|
20648
|
+
root: false
|
|
20649
|
+
});
|
|
20650
|
+
}
|
|
20651
|
+
toRulesyncRule() {
|
|
20652
|
+
return this.toRulesyncRuleDefault();
|
|
20653
|
+
}
|
|
20654
|
+
validate() {
|
|
20655
|
+
return { success: true, error: null };
|
|
20656
|
+
}
|
|
20657
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
20658
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
20659
|
+
rulesyncRule,
|
|
20660
|
+
toolTarget: "takt"
|
|
20661
|
+
});
|
|
20662
|
+
}
|
|
20663
|
+
};
|
|
20664
|
+
|
|
20146
20665
|
// src/features/rules/warp-rule.ts
|
|
20147
|
-
import { join as
|
|
20666
|
+
import { join as join139 } from "path";
|
|
20148
20667
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
20149
20668
|
constructor({ fileContent, root, ...rest }) {
|
|
20150
20669
|
super({
|
|
@@ -20170,8 +20689,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
20170
20689
|
validate = true
|
|
20171
20690
|
}) {
|
|
20172
20691
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
20173
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
20174
|
-
const fileContent = await readFileContent(
|
|
20692
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join139(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
20693
|
+
const fileContent = await readFileContent(join139(baseDir, relativePath));
|
|
20175
20694
|
return new _WarpRule({
|
|
20176
20695
|
baseDir,
|
|
20177
20696
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -20226,7 +20745,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
20226
20745
|
};
|
|
20227
20746
|
|
|
20228
20747
|
// src/features/rules/windsurf-rule.ts
|
|
20229
|
-
import { join as
|
|
20748
|
+
import { join as join140 } from "path";
|
|
20230
20749
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
20231
20750
|
static getSettablePaths(_options = {}) {
|
|
20232
20751
|
return {
|
|
@@ -20241,7 +20760,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
20241
20760
|
validate = true
|
|
20242
20761
|
}) {
|
|
20243
20762
|
const fileContent = await readFileContent(
|
|
20244
|
-
|
|
20763
|
+
join140(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
20245
20764
|
);
|
|
20246
20765
|
return new _WindsurfRule({
|
|
20247
20766
|
baseDir,
|
|
@@ -20336,11 +20855,12 @@ var rulesProcessorToolTargets = [
|
|
|
20336
20855
|
"replit",
|
|
20337
20856
|
"roo",
|
|
20338
20857
|
"rovodev",
|
|
20858
|
+
"takt",
|
|
20339
20859
|
"warp",
|
|
20340
20860
|
"windsurf"
|
|
20341
20861
|
];
|
|
20342
20862
|
var RulesProcessorToolTargetSchema = z71.enum(rulesProcessorToolTargets);
|
|
20343
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
20863
|
+
var formatRulePaths = (rules) => rules.map((r) => join141(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
20344
20864
|
var RulesFeatureOptionsSchema = z71.looseObject({
|
|
20345
20865
|
ruleDiscoveryMode: z71.optional(z71.enum(["none", "explicit"])),
|
|
20346
20866
|
includeLocalRoot: z71.optional(z71.boolean())
|
|
@@ -20652,6 +21172,20 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
20652
21172
|
}
|
|
20653
21173
|
}
|
|
20654
21174
|
],
|
|
21175
|
+
[
|
|
21176
|
+
"takt",
|
|
21177
|
+
{
|
|
21178
|
+
class: TaktRule,
|
|
21179
|
+
meta: {
|
|
21180
|
+
extension: "md",
|
|
21181
|
+
supportsGlobal: true,
|
|
21182
|
+
ruleDiscoveryMode: "auto"
|
|
21183
|
+
// No `additionalConventions` here: TAKT does not synthesize a root
|
|
21184
|
+
// overview rule (TaktRule.fromRulesyncRule always emits non-root files),
|
|
21185
|
+
// so the conventions block would never be rendered anywhere.
|
|
21186
|
+
}
|
|
21187
|
+
}
|
|
21188
|
+
],
|
|
20655
21189
|
[
|
|
20656
21190
|
"warp",
|
|
20657
21191
|
{
|
|
@@ -20810,7 +21344,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20810
21344
|
}).relativeDirPath;
|
|
20811
21345
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
20812
21346
|
const frontmatter = skill.getFrontmatter();
|
|
20813
|
-
const relativePath =
|
|
21347
|
+
const relativePath = join141(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
20814
21348
|
return {
|
|
20815
21349
|
name: frontmatter.name,
|
|
20816
21350
|
description: frontmatter.description,
|
|
@@ -20939,12 +21473,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20939
21473
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
20940
21474
|
*/
|
|
20941
21475
|
async loadRulesyncFiles() {
|
|
20942
|
-
const rulesyncBaseDir =
|
|
20943
|
-
const files = await findFilesByGlobs(
|
|
21476
|
+
const rulesyncBaseDir = join141(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
21477
|
+
const files = await findFilesByGlobs(join141(rulesyncBaseDir, "**", "*.md"));
|
|
20944
21478
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
20945
21479
|
const rulesyncRules = await Promise.all(
|
|
20946
21480
|
files.map((file) => {
|
|
20947
|
-
const relativeFilePath =
|
|
21481
|
+
const relativeFilePath = relative6(rulesyncBaseDir, file);
|
|
20948
21482
|
checkPathTraversal({
|
|
20949
21483
|
relativePath: relativeFilePath,
|
|
20950
21484
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -21019,7 +21553,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21019
21553
|
global: this.global
|
|
21020
21554
|
});
|
|
21021
21555
|
const resolveRelativeDirPath = (filePath) => {
|
|
21022
|
-
const dirName = dirname3(
|
|
21556
|
+
const dirName = dirname3(relative6(this.baseDir, filePath));
|
|
21023
21557
|
return dirName === "" ? "." : dirName;
|
|
21024
21558
|
};
|
|
21025
21559
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -21027,7 +21561,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21027
21561
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
21028
21562
|
return filePaths.map((filePath) => {
|
|
21029
21563
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
21030
|
-
const relativeFilePath = isNonRoot ?
|
|
21564
|
+
const relativeFilePath = isNonRoot ? relative6(effectiveBaseDir, filePath) : basename10(filePath);
|
|
21031
21565
|
checkPathTraversal({
|
|
21032
21566
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
21033
21567
|
intendedRootDir: effectiveBaseDir
|
|
@@ -21055,13 +21589,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21055
21589
|
return [];
|
|
21056
21590
|
}
|
|
21057
21591
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
21058
|
-
|
|
21592
|
+
join141(
|
|
21059
21593
|
this.baseDir,
|
|
21060
21594
|
settablePaths.root.relativeDirPath ?? ".",
|
|
21061
21595
|
settablePaths.root.relativeFilePath
|
|
21062
21596
|
),
|
|
21063
21597
|
settablePaths.alternativeRoots,
|
|
21064
|
-
(alt) =>
|
|
21598
|
+
(alt) => join141(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
21065
21599
|
);
|
|
21066
21600
|
if (forDeletion) {
|
|
21067
21601
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -21092,7 +21626,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21092
21626
|
return [];
|
|
21093
21627
|
}
|
|
21094
21628
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
21095
|
-
|
|
21629
|
+
join141(this.baseDir, "AGENTS.local.md")
|
|
21096
21630
|
);
|
|
21097
21631
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
21098
21632
|
}
|
|
@@ -21103,9 +21637,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21103
21637
|
return [];
|
|
21104
21638
|
}
|
|
21105
21639
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
21106
|
-
|
|
21640
|
+
join141(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
21107
21641
|
settablePaths.alternativeRoots,
|
|
21108
|
-
(alt) =>
|
|
21642
|
+
(alt) => join141(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
21109
21643
|
);
|
|
21110
21644
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
21111
21645
|
})();
|
|
@@ -21116,20 +21650,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21116
21650
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
21117
21651
|
return [];
|
|
21118
21652
|
}
|
|
21119
|
-
const primaryPaths = await findFilesByGlobs(
|
|
21653
|
+
const primaryPaths = await findFilesByGlobs(join141(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
21120
21654
|
if (primaryPaths.length === 0) {
|
|
21121
21655
|
return [];
|
|
21122
21656
|
}
|
|
21123
|
-
const mirrorPaths = await findFilesByGlobs(
|
|
21657
|
+
const mirrorPaths = await findFilesByGlobs(join141(this.baseDir, "AGENTS.md"));
|
|
21124
21658
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
21125
21659
|
})();
|
|
21126
21660
|
const nonRootToolRules = await (async () => {
|
|
21127
21661
|
if (!settablePaths.nonRoot) {
|
|
21128
21662
|
return [];
|
|
21129
21663
|
}
|
|
21130
|
-
const nonRootBaseDir =
|
|
21664
|
+
const nonRootBaseDir = join141(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
21131
21665
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
21132
|
-
|
|
21666
|
+
join141(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
21133
21667
|
);
|
|
21134
21668
|
if (forDeletion) {
|
|
21135
21669
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -21139,18 +21673,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
21139
21673
|
}
|
|
21140
21674
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
21141
21675
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
21142
|
-
const relativeFilePath =
|
|
21676
|
+
const relativeFilePath = relative6(nonRootBaseDir, filePath);
|
|
21143
21677
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
21144
21678
|
if (!ok) {
|
|
21145
21679
|
this.logger.warn(
|
|
21146
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${
|
|
21680
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${join141(modularRootRelative, relativeFilePath)}`
|
|
21147
21681
|
);
|
|
21148
21682
|
}
|
|
21149
21683
|
return ok;
|
|
21150
21684
|
}) : nonRootFilePaths;
|
|
21151
21685
|
return await Promise.all(
|
|
21152
21686
|
nonRootPathsForImport.map((filePath) => {
|
|
21153
|
-
const relativeFilePath =
|
|
21687
|
+
const relativeFilePath = relative6(nonRootBaseDir, filePath);
|
|
21154
21688
|
checkPathTraversal({
|
|
21155
21689
|
relativePath: relativeFilePath,
|
|
21156
21690
|
intendedRootDir: nonRootBaseDir
|
|
@@ -21269,14 +21803,14 @@ s/<command> [arguments]
|
|
|
21269
21803
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
21270
21804
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
21271
21805
|
|
|
21272
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
21806
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join141(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
21273
21807
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
21274
21808
|
|
|
21275
21809
|
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.
|
|
21276
21810
|
|
|
21277
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
21811
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join141(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
21278
21812
|
|
|
21279
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
21813
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join141(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
21280
21814
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
21281
21815
|
const result = [
|
|
21282
21816
|
overview,
|
|
@@ -21376,7 +21910,7 @@ function warnUnsupportedTargets(params) {
|
|
|
21376
21910
|
}
|
|
21377
21911
|
}
|
|
21378
21912
|
async function checkRulesyncDirExists(params) {
|
|
21379
|
-
return fileExists(
|
|
21913
|
+
return fileExists(join142(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
21380
21914
|
}
|
|
21381
21915
|
async function generate(params) {
|
|
21382
21916
|
const { config, logger } = params;
|
|
@@ -21551,7 +22085,11 @@ async function generateCommandsCore(params) {
|
|
|
21551
22085
|
logger
|
|
21552
22086
|
});
|
|
21553
22087
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
21554
|
-
const result = await processFeatureWithRulesyncFiles({
|
|
22088
|
+
const result = await processFeatureWithRulesyncFiles({
|
|
22089
|
+
config,
|
|
22090
|
+
processor,
|
|
22091
|
+
rulesyncFiles
|
|
22092
|
+
});
|
|
21555
22093
|
totalCount += result.count;
|
|
21556
22094
|
allPaths.push(...result.paths);
|
|
21557
22095
|
if (result.hasDiff) hasDiff = true;
|