rulesync 8.4.0 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-MMBSR2RA.js → chunk-Q5FDY7NL.js} +548 -333
- package/dist/cli/index.cjs +1019 -704
- package/dist/cli/index.js +127 -25
- package/dist/index.cjs +561 -347
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -30,8 +30,13 @@ var ALL_FEATURES = [
|
|
|
30
30
|
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
31
31
|
var FeatureSchema = z.enum(ALL_FEATURES);
|
|
32
32
|
var FeaturesSchema = z.array(FeatureSchema);
|
|
33
|
+
var GitignoreDestinationSchema = z.enum(["gitignore", "gitattributes"]);
|
|
33
34
|
var FeatureOptionsSchema = z.record(z.string(), z.unknown());
|
|
34
|
-
var FeatureValueSchema = z.union([
|
|
35
|
+
var FeatureValueSchema = z.union([
|
|
36
|
+
z.boolean(),
|
|
37
|
+
FeatureOptionsSchema,
|
|
38
|
+
GitignoreDestinationSchema
|
|
39
|
+
]);
|
|
35
40
|
var PerFeatureConfigSchema = z.record(z.string(), FeatureValueSchema);
|
|
36
41
|
var PerTargetFeaturesValueSchema = z.union([
|
|
37
42
|
z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
@@ -327,6 +332,7 @@ function hasControlCharacters(value) {
|
|
|
327
332
|
}
|
|
328
333
|
|
|
329
334
|
// src/config/config.ts
|
|
335
|
+
var GITIGNORE_DESTINATION_KEY = "gitignoreDestination";
|
|
330
336
|
var SourceEntrySchema = z3.object({
|
|
331
337
|
source: z3.string().check(minLength(1, "source must be a non-empty string")),
|
|
332
338
|
skills: optional(z3.array(z3.string())),
|
|
@@ -358,6 +364,7 @@ var ConfigParamsSchema = z3.object({
|
|
|
358
364
|
simulateSubagents: optional(z3.boolean()),
|
|
359
365
|
simulateSkills: optional(z3.boolean()),
|
|
360
366
|
gitignoreTargetsOnly: optional(z3.boolean()),
|
|
367
|
+
gitignoreDestination: optional(GitignoreDestinationSchema),
|
|
361
368
|
dryRun: optional(z3.boolean()),
|
|
362
369
|
check: optional(z3.boolean()),
|
|
363
370
|
// Declarative skill sources
|
|
@@ -418,6 +425,7 @@ var Config = class _Config {
|
|
|
418
425
|
simulateSubagents;
|
|
419
426
|
simulateSkills;
|
|
420
427
|
gitignoreTargetsOnly;
|
|
428
|
+
gitignoreDestination;
|
|
421
429
|
dryRun;
|
|
422
430
|
check;
|
|
423
431
|
sources;
|
|
@@ -433,6 +441,7 @@ var Config = class _Config {
|
|
|
433
441
|
simulateSubagents,
|
|
434
442
|
simulateSkills,
|
|
435
443
|
gitignoreTargetsOnly,
|
|
444
|
+
gitignoreDestination,
|
|
436
445
|
dryRun,
|
|
437
446
|
check,
|
|
438
447
|
sources
|
|
@@ -458,6 +467,7 @@ var Config = class _Config {
|
|
|
458
467
|
this.simulateSubagents = simulateSubagents ?? false;
|
|
459
468
|
this.simulateSkills = simulateSkills ?? false;
|
|
460
469
|
this.gitignoreTargetsOnly = gitignoreTargetsOnly ?? true;
|
|
470
|
+
this.gitignoreDestination = gitignoreDestination ?? "gitignore";
|
|
461
471
|
this.dryRun = dryRun ?? false;
|
|
462
472
|
this.check = check ?? false;
|
|
463
473
|
this.sources = sources ?? [];
|
|
@@ -615,6 +625,36 @@ var Config = class _Config {
|
|
|
615
625
|
}
|
|
616
626
|
return void 0;
|
|
617
627
|
}
|
|
628
|
+
getGitignoreDestination(target, feature) {
|
|
629
|
+
const rootLevel = this.gitignoreDestination;
|
|
630
|
+
if (!isRulesyncConfigTargetsObject(this.targets)) {
|
|
631
|
+
return rootLevel;
|
|
632
|
+
}
|
|
633
|
+
const targetValue = this.targets[target];
|
|
634
|
+
if (!targetValue || Array.isArray(targetValue)) {
|
|
635
|
+
return rootLevel;
|
|
636
|
+
}
|
|
637
|
+
const perFeature = targetValue;
|
|
638
|
+
const toolLevel = _Config.parseGitignoreDestination(perFeature[GITIGNORE_DESTINATION_KEY]);
|
|
639
|
+
if (feature) {
|
|
640
|
+
const featureValue = perFeature[feature];
|
|
641
|
+
if (featureValue && typeof featureValue === "object" && !Array.isArray(featureValue)) {
|
|
642
|
+
const featureLevel = _Config.parseGitignoreDestination(
|
|
643
|
+
featureValue[GITIGNORE_DESTINATION_KEY]
|
|
644
|
+
);
|
|
645
|
+
if (featureLevel) {
|
|
646
|
+
return featureLevel;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return toolLevel ?? rootLevel;
|
|
651
|
+
}
|
|
652
|
+
static parseGitignoreDestination(value) {
|
|
653
|
+
if (value === "gitignore" || value === "gitattributes") {
|
|
654
|
+
return value;
|
|
655
|
+
}
|
|
656
|
+
return void 0;
|
|
657
|
+
}
|
|
618
658
|
/**
|
|
619
659
|
* Check if per-target features configuration is being used.
|
|
620
660
|
*/
|
|
@@ -695,6 +735,7 @@ var getDefaults = () => ({
|
|
|
695
735
|
simulateSubagents: false,
|
|
696
736
|
simulateSkills: false,
|
|
697
737
|
gitignoreTargetsOnly: true,
|
|
738
|
+
gitignoreDestination: "gitignore",
|
|
698
739
|
dryRun: false,
|
|
699
740
|
check: false,
|
|
700
741
|
sources: []
|
|
@@ -726,6 +767,7 @@ var mergeConfigs = (baseConfig, localConfig) => {
|
|
|
726
767
|
simulateSubagents: localConfig.simulateSubagents ?? baseConfig.simulateSubagents,
|
|
727
768
|
simulateSkills: localConfig.simulateSkills ?? baseConfig.simulateSkills,
|
|
728
769
|
gitignoreTargetsOnly: localConfig.gitignoreTargetsOnly ?? baseConfig.gitignoreTargetsOnly,
|
|
770
|
+
gitignoreDestination: localConfig.gitignoreDestination ?? baseConfig.gitignoreDestination,
|
|
729
771
|
dryRun: localConfig.dryRun ?? baseConfig.dryRun,
|
|
730
772
|
check: localConfig.check ?? baseConfig.check,
|
|
731
773
|
sources: localConfig.sources ?? baseConfig.sources
|
|
@@ -746,7 +788,8 @@ var ConfigResolver = class {
|
|
|
746
788
|
simulateSkills,
|
|
747
789
|
gitignoreTargetsOnly,
|
|
748
790
|
dryRun,
|
|
749
|
-
check
|
|
791
|
+
check,
|
|
792
|
+
gitignoreDestination
|
|
750
793
|
}) {
|
|
751
794
|
const validatedConfigPath = resolvePath(configPath, process.cwd());
|
|
752
795
|
const baseConfig = await loadConfigFromFile(validatedConfigPath);
|
|
@@ -795,6 +838,7 @@ var ConfigResolver = class {
|
|
|
795
838
|
simulateSubagents: resolvedSimulateSubagents,
|
|
796
839
|
simulateSkills: resolvedSimulateSkills,
|
|
797
840
|
gitignoreTargetsOnly: resolvedGitignoreTargetsOnly,
|
|
841
|
+
gitignoreDestination: gitignoreDestination ?? configByFile.gitignoreDestination ?? getDefaults().gitignoreDestination,
|
|
798
842
|
dryRun: dryRun ?? configByFile.dryRun ?? getDefaults().dryRun,
|
|
799
843
|
check: check ?? configByFile.check ?? getDefaults().check,
|
|
800
844
|
sources: configByFile.sources ?? getDefaults().sources
|
|
@@ -817,7 +861,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
817
861
|
}
|
|
818
862
|
|
|
819
863
|
// src/lib/generate.ts
|
|
820
|
-
import { join as
|
|
864
|
+
import { join as join138 } from "path";
|
|
821
865
|
import { intersection } from "es-toolkit";
|
|
822
866
|
|
|
823
867
|
// src/features/commands/commands-processor.ts
|
|
@@ -10368,9 +10412,9 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10368
10412
|
};
|
|
10369
10413
|
|
|
10370
10414
|
// src/features/rules/rules-processor.ts
|
|
10371
|
-
import { basename as basename10, dirname as dirname3, join as
|
|
10415
|
+
import { basename as basename10, dirname as dirname3, join as join137, relative as relative5 } from "path";
|
|
10372
10416
|
import { encode } from "@toon-format/toon";
|
|
10373
|
-
import { z as
|
|
10417
|
+
import { z as z72 } from "zod/mini";
|
|
10374
10418
|
|
|
10375
10419
|
// src/constants/general.ts
|
|
10376
10420
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -11158,8 +11202,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11158
11202
|
};
|
|
11159
11203
|
|
|
11160
11204
|
// src/features/skills/skills-processor.ts
|
|
11161
|
-
import { basename as basename5, join as
|
|
11162
|
-
import { z as
|
|
11205
|
+
import { basename as basename5, join as join92 } from "path";
|
|
11206
|
+
import { z as z52 } from "zod/mini";
|
|
11163
11207
|
|
|
11164
11208
|
// src/types/dir-feature-processor.ts
|
|
11165
11209
|
import { join as join74 } from "path";
|
|
@@ -13799,6 +13843,166 @@ async function getLocalSkillDirNames(baseDir) {
|
|
|
13799
13843
|
return names;
|
|
13800
13844
|
}
|
|
13801
13845
|
|
|
13846
|
+
// src/features/skills/windsurf-skill.ts
|
|
13847
|
+
import { join as join91 } from "path";
|
|
13848
|
+
import { z as z51 } from "zod/mini";
|
|
13849
|
+
var WindsurfSkillFrontmatterSchema = z51.looseObject({
|
|
13850
|
+
name: z51.string(),
|
|
13851
|
+
description: z51.string()
|
|
13852
|
+
});
|
|
13853
|
+
var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
13854
|
+
constructor({
|
|
13855
|
+
baseDir = process.cwd(),
|
|
13856
|
+
relativeDirPath = _WindsurfSkill.getSettablePaths().relativeDirPath,
|
|
13857
|
+
dirName,
|
|
13858
|
+
frontmatter,
|
|
13859
|
+
body,
|
|
13860
|
+
otherFiles = [],
|
|
13861
|
+
validate = true,
|
|
13862
|
+
global = false
|
|
13863
|
+
}) {
|
|
13864
|
+
super({
|
|
13865
|
+
baseDir,
|
|
13866
|
+
relativeDirPath,
|
|
13867
|
+
dirName,
|
|
13868
|
+
mainFile: {
|
|
13869
|
+
name: SKILL_FILE_NAME,
|
|
13870
|
+
body,
|
|
13871
|
+
frontmatter: { ...frontmatter }
|
|
13872
|
+
},
|
|
13873
|
+
otherFiles,
|
|
13874
|
+
global
|
|
13875
|
+
});
|
|
13876
|
+
if (validate) {
|
|
13877
|
+
const result = this.validate();
|
|
13878
|
+
if (!result.success) {
|
|
13879
|
+
throw result.error;
|
|
13880
|
+
}
|
|
13881
|
+
}
|
|
13882
|
+
}
|
|
13883
|
+
static getSettablePaths({ global = false } = {}) {
|
|
13884
|
+
if (global) {
|
|
13885
|
+
return {
|
|
13886
|
+
relativeDirPath: join91(".codeium", "windsurf", "skills")
|
|
13887
|
+
};
|
|
13888
|
+
}
|
|
13889
|
+
return {
|
|
13890
|
+
relativeDirPath: join91(".windsurf", "skills")
|
|
13891
|
+
};
|
|
13892
|
+
}
|
|
13893
|
+
getFrontmatter() {
|
|
13894
|
+
const result = WindsurfSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
13895
|
+
return result;
|
|
13896
|
+
}
|
|
13897
|
+
getBody() {
|
|
13898
|
+
return this.mainFile?.body ?? "";
|
|
13899
|
+
}
|
|
13900
|
+
validate() {
|
|
13901
|
+
if (!this.mainFile) {
|
|
13902
|
+
return {
|
|
13903
|
+
success: false,
|
|
13904
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
13905
|
+
};
|
|
13906
|
+
}
|
|
13907
|
+
const result = WindsurfSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
13908
|
+
if (!result.success) {
|
|
13909
|
+
return {
|
|
13910
|
+
success: false,
|
|
13911
|
+
error: new Error(
|
|
13912
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
13913
|
+
)
|
|
13914
|
+
};
|
|
13915
|
+
}
|
|
13916
|
+
return { success: true, error: null };
|
|
13917
|
+
}
|
|
13918
|
+
toRulesyncSkill() {
|
|
13919
|
+
const frontmatter = this.getFrontmatter();
|
|
13920
|
+
const rulesyncFrontmatter = {
|
|
13921
|
+
name: frontmatter.name,
|
|
13922
|
+
description: frontmatter.description,
|
|
13923
|
+
targets: ["*"]
|
|
13924
|
+
};
|
|
13925
|
+
return new RulesyncSkill({
|
|
13926
|
+
baseDir: this.baseDir,
|
|
13927
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
13928
|
+
dirName: this.getDirName(),
|
|
13929
|
+
frontmatter: rulesyncFrontmatter,
|
|
13930
|
+
body: this.getBody(),
|
|
13931
|
+
otherFiles: this.getOtherFiles(),
|
|
13932
|
+
validate: true,
|
|
13933
|
+
global: this.global
|
|
13934
|
+
});
|
|
13935
|
+
}
|
|
13936
|
+
static fromRulesyncSkill({
|
|
13937
|
+
baseDir = process.cwd(),
|
|
13938
|
+
rulesyncSkill,
|
|
13939
|
+
validate = true,
|
|
13940
|
+
global = false
|
|
13941
|
+
}) {
|
|
13942
|
+
const settablePaths = _WindsurfSkill.getSettablePaths({ global });
|
|
13943
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
13944
|
+
const windsurfFrontmatter = {
|
|
13945
|
+
name: rulesyncFrontmatter.name,
|
|
13946
|
+
description: rulesyncFrontmatter.description
|
|
13947
|
+
};
|
|
13948
|
+
return new _WindsurfSkill({
|
|
13949
|
+
baseDir,
|
|
13950
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
13951
|
+
dirName: rulesyncSkill.getDirName(),
|
|
13952
|
+
frontmatter: windsurfFrontmatter,
|
|
13953
|
+
body: rulesyncSkill.getBody(),
|
|
13954
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
13955
|
+
validate,
|
|
13956
|
+
global
|
|
13957
|
+
});
|
|
13958
|
+
}
|
|
13959
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
13960
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
13961
|
+
return targets.includes("*") || targets.includes("windsurf");
|
|
13962
|
+
}
|
|
13963
|
+
static async fromDir(params) {
|
|
13964
|
+
const loaded = await this.loadSkillDirContent({
|
|
13965
|
+
...params,
|
|
13966
|
+
getSettablePaths: _WindsurfSkill.getSettablePaths
|
|
13967
|
+
});
|
|
13968
|
+
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13969
|
+
if (!result.success) {
|
|
13970
|
+
const skillDirPath = join91(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13971
|
+
throw new Error(
|
|
13972
|
+
`Invalid frontmatter in ${join91(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13973
|
+
);
|
|
13974
|
+
}
|
|
13975
|
+
return new _WindsurfSkill({
|
|
13976
|
+
baseDir: loaded.baseDir,
|
|
13977
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
13978
|
+
dirName: loaded.dirName,
|
|
13979
|
+
frontmatter: result.data,
|
|
13980
|
+
body: loaded.body,
|
|
13981
|
+
otherFiles: loaded.otherFiles,
|
|
13982
|
+
validate: true,
|
|
13983
|
+
global: loaded.global
|
|
13984
|
+
});
|
|
13985
|
+
}
|
|
13986
|
+
static forDeletion({
|
|
13987
|
+
baseDir = process.cwd(),
|
|
13988
|
+
relativeDirPath,
|
|
13989
|
+
dirName,
|
|
13990
|
+
global = false
|
|
13991
|
+
}) {
|
|
13992
|
+
const settablePaths = _WindsurfSkill.getSettablePaths({ global });
|
|
13993
|
+
return new _WindsurfSkill({
|
|
13994
|
+
baseDir,
|
|
13995
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
13996
|
+
dirName,
|
|
13997
|
+
frontmatter: { name: "", description: "" },
|
|
13998
|
+
body: "",
|
|
13999
|
+
otherFiles: [],
|
|
14000
|
+
validate: false,
|
|
14001
|
+
global
|
|
14002
|
+
});
|
|
14003
|
+
}
|
|
14004
|
+
};
|
|
14005
|
+
|
|
13802
14006
|
// src/features/skills/skills-processor.ts
|
|
13803
14007
|
var skillsProcessorToolTargetTuple = [
|
|
13804
14008
|
"agentsmd",
|
|
@@ -13819,9 +14023,10 @@ var skillsProcessorToolTargetTuple = [
|
|
|
13819
14023
|
"opencode",
|
|
13820
14024
|
"replit",
|
|
13821
14025
|
"roo",
|
|
13822
|
-
"rovodev"
|
|
14026
|
+
"rovodev",
|
|
14027
|
+
"windsurf"
|
|
13823
14028
|
];
|
|
13824
|
-
var SkillsProcessorToolTargetSchema =
|
|
14029
|
+
var SkillsProcessorToolTargetSchema = z52.enum(skillsProcessorToolTargetTuple);
|
|
13825
14030
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
13826
14031
|
[
|
|
13827
14032
|
"agentsmd",
|
|
@@ -13955,6 +14160,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
13955
14160
|
class: RovodevSkill,
|
|
13956
14161
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
13957
14162
|
}
|
|
14163
|
+
],
|
|
14164
|
+
[
|
|
14165
|
+
"windsurf",
|
|
14166
|
+
{
|
|
14167
|
+
class: WindsurfSkill,
|
|
14168
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
14169
|
+
}
|
|
13958
14170
|
]
|
|
13959
14171
|
]);
|
|
13960
14172
|
var defaultGetFactory4 = (target) => {
|
|
@@ -14045,10 +14257,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14045
14257
|
)
|
|
14046
14258
|
);
|
|
14047
14259
|
const localSkillNames = new Set(localDirNames);
|
|
14048
|
-
const curatedDirPath =
|
|
14260
|
+
const curatedDirPath = join92(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
14049
14261
|
let curatedSkills = [];
|
|
14050
14262
|
if (await directoryExists(curatedDirPath)) {
|
|
14051
|
-
const curatedDirPaths = await findFilesByGlobs(
|
|
14263
|
+
const curatedDirPaths = await findFilesByGlobs(join92(curatedDirPath, "*"), { type: "dir" });
|
|
14052
14264
|
const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
|
|
14053
14265
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
14054
14266
|
if (localSkillNames.has(name)) {
|
|
@@ -14086,11 +14298,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14086
14298
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
14087
14299
|
const loadEntries = [];
|
|
14088
14300
|
for (const root of roots) {
|
|
14089
|
-
const skillsDirPath =
|
|
14301
|
+
const skillsDirPath = join92(this.baseDir, root);
|
|
14090
14302
|
if (!await directoryExists(skillsDirPath)) {
|
|
14091
14303
|
continue;
|
|
14092
14304
|
}
|
|
14093
|
-
const dirPaths = await findFilesByGlobs(
|
|
14305
|
+
const dirPaths = await findFilesByGlobs(join92(skillsDirPath, "*"), { type: "dir" });
|
|
14094
14306
|
for (const dirPath of dirPaths) {
|
|
14095
14307
|
const dirName = basename5(dirPath);
|
|
14096
14308
|
if (seenDirNames.has(dirName)) {
|
|
@@ -14121,11 +14333,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14121
14333
|
const roots = toolSkillSearchRoots(paths);
|
|
14122
14334
|
const toolSkills = [];
|
|
14123
14335
|
for (const root of roots) {
|
|
14124
|
-
const skillsDirPath =
|
|
14336
|
+
const skillsDirPath = join92(this.baseDir, root);
|
|
14125
14337
|
if (!await directoryExists(skillsDirPath)) {
|
|
14126
14338
|
continue;
|
|
14127
14339
|
}
|
|
14128
|
-
const dirPaths = await findFilesByGlobs(
|
|
14340
|
+
const dirPaths = await findFilesByGlobs(join92(skillsDirPath, "*"), { type: "dir" });
|
|
14129
14341
|
for (const dirPath of dirPaths) {
|
|
14130
14342
|
const dirName = basename5(dirPath);
|
|
14131
14343
|
const toolSkill = factory.class.forDeletion({
|
|
@@ -14189,11 +14401,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14189
14401
|
};
|
|
14190
14402
|
|
|
14191
14403
|
// src/features/subagents/agentsmd-subagent.ts
|
|
14192
|
-
import { join as
|
|
14404
|
+
import { join as join94 } from "path";
|
|
14193
14405
|
|
|
14194
14406
|
// src/features/subagents/simulated-subagent.ts
|
|
14195
|
-
import { basename as basename6, join as
|
|
14196
|
-
import { z as
|
|
14407
|
+
import { basename as basename6, join as join93 } from "path";
|
|
14408
|
+
import { z as z53 } from "zod/mini";
|
|
14197
14409
|
|
|
14198
14410
|
// src/features/subagents/tool-subagent.ts
|
|
14199
14411
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -14245,9 +14457,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
14245
14457
|
};
|
|
14246
14458
|
|
|
14247
14459
|
// src/features/subagents/simulated-subagent.ts
|
|
14248
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
14249
|
-
name:
|
|
14250
|
-
description:
|
|
14460
|
+
var SimulatedSubagentFrontmatterSchema = z53.object({
|
|
14461
|
+
name: z53.string(),
|
|
14462
|
+
description: z53.optional(z53.string())
|
|
14251
14463
|
});
|
|
14252
14464
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
14253
14465
|
frontmatter;
|
|
@@ -14257,7 +14469,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14257
14469
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14258
14470
|
if (!result.success) {
|
|
14259
14471
|
throw new Error(
|
|
14260
|
-
`Invalid frontmatter in ${
|
|
14472
|
+
`Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14261
14473
|
);
|
|
14262
14474
|
}
|
|
14263
14475
|
}
|
|
@@ -14308,7 +14520,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14308
14520
|
return {
|
|
14309
14521
|
success: false,
|
|
14310
14522
|
error: new Error(
|
|
14311
|
-
`Invalid frontmatter in ${
|
|
14523
|
+
`Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14312
14524
|
)
|
|
14313
14525
|
};
|
|
14314
14526
|
}
|
|
@@ -14318,7 +14530,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14318
14530
|
relativeFilePath,
|
|
14319
14531
|
validate = true
|
|
14320
14532
|
}) {
|
|
14321
|
-
const filePath =
|
|
14533
|
+
const filePath = join93(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
14322
14534
|
const fileContent = await readFileContent(filePath);
|
|
14323
14535
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14324
14536
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14354,7 +14566,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14354
14566
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
14355
14567
|
static getSettablePaths() {
|
|
14356
14568
|
return {
|
|
14357
|
-
relativeDirPath:
|
|
14569
|
+
relativeDirPath: join94(".agents", "subagents")
|
|
14358
14570
|
};
|
|
14359
14571
|
}
|
|
14360
14572
|
static async fromFile(params) {
|
|
@@ -14377,11 +14589,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
14377
14589
|
};
|
|
14378
14590
|
|
|
14379
14591
|
// src/features/subagents/factorydroid-subagent.ts
|
|
14380
|
-
import { join as
|
|
14592
|
+
import { join as join95 } from "path";
|
|
14381
14593
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
14382
14594
|
static getSettablePaths(_options) {
|
|
14383
14595
|
return {
|
|
14384
|
-
relativeDirPath:
|
|
14596
|
+
relativeDirPath: join95(".factory", "droids")
|
|
14385
14597
|
};
|
|
14386
14598
|
}
|
|
14387
14599
|
static async fromFile(params) {
|
|
@@ -14404,16 +14616,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14404
14616
|
};
|
|
14405
14617
|
|
|
14406
14618
|
// src/features/subagents/geminicli-subagent.ts
|
|
14407
|
-
import { join as
|
|
14408
|
-
import { z as
|
|
14619
|
+
import { join as join97 } from "path";
|
|
14620
|
+
import { z as z55 } from "zod/mini";
|
|
14409
14621
|
|
|
14410
14622
|
// src/features/subagents/rulesync-subagent.ts
|
|
14411
|
-
import { basename as basename7, join as
|
|
14412
|
-
import { z as
|
|
14413
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
14414
|
-
targets:
|
|
14415
|
-
name:
|
|
14416
|
-
description:
|
|
14623
|
+
import { basename as basename7, join as join96 } from "path";
|
|
14624
|
+
import { z as z54 } from "zod/mini";
|
|
14625
|
+
var RulesyncSubagentFrontmatterSchema = z54.looseObject({
|
|
14626
|
+
targets: z54._default(RulesyncTargetsSchema, ["*"]),
|
|
14627
|
+
name: z54.string(),
|
|
14628
|
+
description: z54.optional(z54.string())
|
|
14417
14629
|
});
|
|
14418
14630
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14419
14631
|
frontmatter;
|
|
@@ -14422,7 +14634,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14422
14634
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14423
14635
|
if (!parseResult.success && rest.validate !== false) {
|
|
14424
14636
|
throw new Error(
|
|
14425
|
-
`Invalid frontmatter in ${
|
|
14637
|
+
`Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14426
14638
|
);
|
|
14427
14639
|
}
|
|
14428
14640
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -14455,7 +14667,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14455
14667
|
return {
|
|
14456
14668
|
success: false,
|
|
14457
14669
|
error: new Error(
|
|
14458
|
-
`Invalid frontmatter in ${
|
|
14670
|
+
`Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14459
14671
|
)
|
|
14460
14672
|
};
|
|
14461
14673
|
}
|
|
@@ -14463,7 +14675,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14463
14675
|
static async fromFile({
|
|
14464
14676
|
relativeFilePath
|
|
14465
14677
|
}) {
|
|
14466
|
-
const filePath =
|
|
14678
|
+
const filePath = join96(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
14467
14679
|
const fileContent = await readFileContent(filePath);
|
|
14468
14680
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14469
14681
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14482,9 +14694,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14482
14694
|
};
|
|
14483
14695
|
|
|
14484
14696
|
// src/features/subagents/geminicli-subagent.ts
|
|
14485
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
14486
|
-
name:
|
|
14487
|
-
description:
|
|
14697
|
+
var GeminiCliSubagentFrontmatterSchema = z55.looseObject({
|
|
14698
|
+
name: z55.string(),
|
|
14699
|
+
description: z55.optional(z55.string())
|
|
14488
14700
|
});
|
|
14489
14701
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
14490
14702
|
frontmatter;
|
|
@@ -14494,7 +14706,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14494
14706
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14495
14707
|
if (!result.success) {
|
|
14496
14708
|
throw new Error(
|
|
14497
|
-
`Invalid frontmatter in ${
|
|
14709
|
+
`Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14498
14710
|
);
|
|
14499
14711
|
}
|
|
14500
14712
|
}
|
|
@@ -14507,7 +14719,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14507
14719
|
}
|
|
14508
14720
|
static getSettablePaths(_options = {}) {
|
|
14509
14721
|
return {
|
|
14510
|
-
relativeDirPath:
|
|
14722
|
+
relativeDirPath: join97(".gemini", "agents")
|
|
14511
14723
|
};
|
|
14512
14724
|
}
|
|
14513
14725
|
getFrontmatter() {
|
|
@@ -14575,7 +14787,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14575
14787
|
return {
|
|
14576
14788
|
success: false,
|
|
14577
14789
|
error: new Error(
|
|
14578
|
-
`Invalid frontmatter in ${
|
|
14790
|
+
`Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14579
14791
|
)
|
|
14580
14792
|
};
|
|
14581
14793
|
}
|
|
@@ -14593,7 +14805,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14593
14805
|
global = false
|
|
14594
14806
|
}) {
|
|
14595
14807
|
const paths = this.getSettablePaths({ global });
|
|
14596
|
-
const filePath =
|
|
14808
|
+
const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14597
14809
|
const fileContent = await readFileContent(filePath);
|
|
14598
14810
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14599
14811
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14629,11 +14841,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14629
14841
|
};
|
|
14630
14842
|
|
|
14631
14843
|
// src/features/subagents/roo-subagent.ts
|
|
14632
|
-
import { join as
|
|
14844
|
+
import { join as join98 } from "path";
|
|
14633
14845
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
14634
14846
|
static getSettablePaths() {
|
|
14635
14847
|
return {
|
|
14636
|
-
relativeDirPath:
|
|
14848
|
+
relativeDirPath: join98(".roo", "subagents")
|
|
14637
14849
|
};
|
|
14638
14850
|
}
|
|
14639
14851
|
static async fromFile(params) {
|
|
@@ -14656,11 +14868,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
14656
14868
|
};
|
|
14657
14869
|
|
|
14658
14870
|
// src/features/subagents/rovodev-subagent.ts
|
|
14659
|
-
import { join as
|
|
14660
|
-
import { z as
|
|
14661
|
-
var RovodevSubagentFrontmatterSchema =
|
|
14662
|
-
name:
|
|
14663
|
-
description:
|
|
14871
|
+
import { join as join99 } from "path";
|
|
14872
|
+
import { z as z56 } from "zod/mini";
|
|
14873
|
+
var RovodevSubagentFrontmatterSchema = z56.looseObject({
|
|
14874
|
+
name: z56.string(),
|
|
14875
|
+
description: z56.optional(z56.string())
|
|
14664
14876
|
});
|
|
14665
14877
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
14666
14878
|
frontmatter;
|
|
@@ -14670,7 +14882,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14670
14882
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14671
14883
|
if (!result.success) {
|
|
14672
14884
|
throw new Error(
|
|
14673
|
-
`Invalid frontmatter in ${
|
|
14885
|
+
`Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14674
14886
|
);
|
|
14675
14887
|
}
|
|
14676
14888
|
}
|
|
@@ -14682,7 +14894,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14682
14894
|
}
|
|
14683
14895
|
static getSettablePaths(_options = {}) {
|
|
14684
14896
|
return {
|
|
14685
|
-
relativeDirPath:
|
|
14897
|
+
relativeDirPath: join99(".rovodev", "subagents")
|
|
14686
14898
|
};
|
|
14687
14899
|
}
|
|
14688
14900
|
getFrontmatter() {
|
|
@@ -14745,7 +14957,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14745
14957
|
return {
|
|
14746
14958
|
success: false,
|
|
14747
14959
|
error: new Error(
|
|
14748
|
-
`Invalid frontmatter in ${
|
|
14960
|
+
`Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14749
14961
|
)
|
|
14750
14962
|
};
|
|
14751
14963
|
}
|
|
@@ -14762,7 +14974,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14762
14974
|
global = false
|
|
14763
14975
|
}) {
|
|
14764
14976
|
const paths = this.getSettablePaths({ global });
|
|
14765
|
-
const filePath =
|
|
14977
|
+
const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14766
14978
|
const fileContent = await readFileContent(filePath);
|
|
14767
14979
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14768
14980
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14801,19 +15013,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14801
15013
|
};
|
|
14802
15014
|
|
|
14803
15015
|
// src/features/subagents/subagents-processor.ts
|
|
14804
|
-
import { basename as basename9, join as
|
|
14805
|
-
import { z as
|
|
15016
|
+
import { basename as basename9, join as join110 } from "path";
|
|
15017
|
+
import { z as z65 } from "zod/mini";
|
|
14806
15018
|
|
|
14807
15019
|
// src/features/subagents/claudecode-subagent.ts
|
|
14808
|
-
import { join as
|
|
14809
|
-
import { z as
|
|
14810
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
14811
|
-
name:
|
|
14812
|
-
description:
|
|
14813
|
-
model:
|
|
14814
|
-
tools:
|
|
14815
|
-
permissionMode:
|
|
14816
|
-
skills:
|
|
15020
|
+
import { join as join100 } from "path";
|
|
15021
|
+
import { z as z57 } from "zod/mini";
|
|
15022
|
+
var ClaudecodeSubagentFrontmatterSchema = z57.looseObject({
|
|
15023
|
+
name: z57.string(),
|
|
15024
|
+
description: z57.optional(z57.string()),
|
|
15025
|
+
model: z57.optional(z57.string()),
|
|
15026
|
+
tools: z57.optional(z57.union([z57.string(), z57.array(z57.string())])),
|
|
15027
|
+
permissionMode: z57.optional(z57.string()),
|
|
15028
|
+
skills: z57.optional(z57.union([z57.string(), z57.array(z57.string())]))
|
|
14817
15029
|
});
|
|
14818
15030
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
14819
15031
|
frontmatter;
|
|
@@ -14823,7 +15035,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14823
15035
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14824
15036
|
if (!result.success) {
|
|
14825
15037
|
throw new Error(
|
|
14826
|
-
`Invalid frontmatter in ${
|
|
15038
|
+
`Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14827
15039
|
);
|
|
14828
15040
|
}
|
|
14829
15041
|
}
|
|
@@ -14835,7 +15047,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14835
15047
|
}
|
|
14836
15048
|
static getSettablePaths(_options = {}) {
|
|
14837
15049
|
return {
|
|
14838
|
-
relativeDirPath:
|
|
15050
|
+
relativeDirPath: join100(".claude", "agents")
|
|
14839
15051
|
};
|
|
14840
15052
|
}
|
|
14841
15053
|
getFrontmatter() {
|
|
@@ -14914,7 +15126,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14914
15126
|
return {
|
|
14915
15127
|
success: false,
|
|
14916
15128
|
error: new Error(
|
|
14917
|
-
`Invalid frontmatter in ${
|
|
15129
|
+
`Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14918
15130
|
)
|
|
14919
15131
|
};
|
|
14920
15132
|
}
|
|
@@ -14932,7 +15144,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14932
15144
|
global = false
|
|
14933
15145
|
}) {
|
|
14934
15146
|
const paths = this.getSettablePaths({ global });
|
|
14935
|
-
const filePath =
|
|
15147
|
+
const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14936
15148
|
const fileContent = await readFileContent(filePath);
|
|
14937
15149
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14938
15150
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14967,16 +15179,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14967
15179
|
};
|
|
14968
15180
|
|
|
14969
15181
|
// src/features/subagents/codexcli-subagent.ts
|
|
14970
|
-
import { join as
|
|
15182
|
+
import { join as join101 } from "path";
|
|
14971
15183
|
import * as smolToml5 from "smol-toml";
|
|
14972
|
-
import { z as
|
|
14973
|
-
var CodexCliSubagentTomlSchema =
|
|
14974
|
-
name:
|
|
14975
|
-
description:
|
|
14976
|
-
developer_instructions:
|
|
14977
|
-
model:
|
|
14978
|
-
model_reasoning_effort:
|
|
14979
|
-
sandbox_mode:
|
|
15184
|
+
import { z as z58 } from "zod/mini";
|
|
15185
|
+
var CodexCliSubagentTomlSchema = z58.looseObject({
|
|
15186
|
+
name: z58.string(),
|
|
15187
|
+
description: z58.optional(z58.string()),
|
|
15188
|
+
developer_instructions: z58.optional(z58.string()),
|
|
15189
|
+
model: z58.optional(z58.string()),
|
|
15190
|
+
model_reasoning_effort: z58.optional(z58.string()),
|
|
15191
|
+
sandbox_mode: z58.optional(z58.string())
|
|
14980
15192
|
});
|
|
14981
15193
|
function stringifyCodexCliSubagentToml(tomlObj) {
|
|
14982
15194
|
const { developer_instructions, ...restFields } = tomlObj;
|
|
@@ -14998,7 +15210,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14998
15210
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14999
15211
|
} catch (error) {
|
|
15000
15212
|
throw new Error(
|
|
15001
|
-
`Invalid TOML in ${
|
|
15213
|
+
`Invalid TOML in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15002
15214
|
{ cause: error }
|
|
15003
15215
|
);
|
|
15004
15216
|
}
|
|
@@ -15010,7 +15222,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15010
15222
|
}
|
|
15011
15223
|
static getSettablePaths(_options = {}) {
|
|
15012
15224
|
return {
|
|
15013
|
-
relativeDirPath:
|
|
15225
|
+
relativeDirPath: join101(".codex", "agents")
|
|
15014
15226
|
};
|
|
15015
15227
|
}
|
|
15016
15228
|
getBody() {
|
|
@@ -15022,7 +15234,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15022
15234
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
15023
15235
|
} catch (error) {
|
|
15024
15236
|
throw new Error(
|
|
15025
|
-
`Failed to parse TOML in ${
|
|
15237
|
+
`Failed to parse TOML in ${join101(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15026
15238
|
{ cause: error }
|
|
15027
15239
|
);
|
|
15028
15240
|
}
|
|
@@ -15103,7 +15315,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15103
15315
|
global = false
|
|
15104
15316
|
}) {
|
|
15105
15317
|
const paths = this.getSettablePaths({ global });
|
|
15106
|
-
const filePath =
|
|
15318
|
+
const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15107
15319
|
const fileContent = await readFileContent(filePath);
|
|
15108
15320
|
const subagent = new _CodexCliSubagent({
|
|
15109
15321
|
baseDir,
|
|
@@ -15141,13 +15353,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15141
15353
|
};
|
|
15142
15354
|
|
|
15143
15355
|
// src/features/subagents/copilot-subagent.ts
|
|
15144
|
-
import { join as
|
|
15145
|
-
import { z as
|
|
15356
|
+
import { join as join102 } from "path";
|
|
15357
|
+
import { z as z59 } from "zod/mini";
|
|
15146
15358
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
15147
|
-
var CopilotSubagentFrontmatterSchema =
|
|
15148
|
-
name:
|
|
15149
|
-
description:
|
|
15150
|
-
tools:
|
|
15359
|
+
var CopilotSubagentFrontmatterSchema = z59.looseObject({
|
|
15360
|
+
name: z59.string(),
|
|
15361
|
+
description: z59.optional(z59.string()),
|
|
15362
|
+
tools: z59.optional(z59.union([z59.string(), z59.array(z59.string())]))
|
|
15151
15363
|
});
|
|
15152
15364
|
var normalizeTools = (tools) => {
|
|
15153
15365
|
if (!tools) {
|
|
@@ -15167,7 +15379,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15167
15379
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15168
15380
|
if (!result.success) {
|
|
15169
15381
|
throw new Error(
|
|
15170
|
-
`Invalid frontmatter in ${
|
|
15382
|
+
`Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15171
15383
|
);
|
|
15172
15384
|
}
|
|
15173
15385
|
}
|
|
@@ -15179,7 +15391,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15179
15391
|
}
|
|
15180
15392
|
static getSettablePaths(_options = {}) {
|
|
15181
15393
|
return {
|
|
15182
|
-
relativeDirPath:
|
|
15394
|
+
relativeDirPath: join102(".github", "agents")
|
|
15183
15395
|
};
|
|
15184
15396
|
}
|
|
15185
15397
|
getFrontmatter() {
|
|
@@ -15257,7 +15469,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15257
15469
|
return {
|
|
15258
15470
|
success: false,
|
|
15259
15471
|
error: new Error(
|
|
15260
|
-
`Invalid frontmatter in ${
|
|
15472
|
+
`Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15261
15473
|
)
|
|
15262
15474
|
};
|
|
15263
15475
|
}
|
|
@@ -15275,7 +15487,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15275
15487
|
global = false
|
|
15276
15488
|
}) {
|
|
15277
15489
|
const paths = this.getSettablePaths({ global });
|
|
15278
|
-
const filePath =
|
|
15490
|
+
const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15279
15491
|
const fileContent = await readFileContent(filePath);
|
|
15280
15492
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15281
15493
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15311,11 +15523,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15311
15523
|
};
|
|
15312
15524
|
|
|
15313
15525
|
// src/features/subagents/cursor-subagent.ts
|
|
15314
|
-
import { join as
|
|
15315
|
-
import { z as
|
|
15316
|
-
var CursorSubagentFrontmatterSchema =
|
|
15317
|
-
name:
|
|
15318
|
-
description:
|
|
15526
|
+
import { join as join103 } from "path";
|
|
15527
|
+
import { z as z60 } from "zod/mini";
|
|
15528
|
+
var CursorSubagentFrontmatterSchema = z60.looseObject({
|
|
15529
|
+
name: z60.string(),
|
|
15530
|
+
description: z60.optional(z60.string())
|
|
15319
15531
|
});
|
|
15320
15532
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
15321
15533
|
frontmatter;
|
|
@@ -15325,7 +15537,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15325
15537
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15326
15538
|
if (!result.success) {
|
|
15327
15539
|
throw new Error(
|
|
15328
|
-
`Invalid frontmatter in ${
|
|
15540
|
+
`Invalid frontmatter in ${join103(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15329
15541
|
);
|
|
15330
15542
|
}
|
|
15331
15543
|
}
|
|
@@ -15337,7 +15549,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15337
15549
|
}
|
|
15338
15550
|
static getSettablePaths(_options = {}) {
|
|
15339
15551
|
return {
|
|
15340
|
-
relativeDirPath:
|
|
15552
|
+
relativeDirPath: join103(".cursor", "agents")
|
|
15341
15553
|
};
|
|
15342
15554
|
}
|
|
15343
15555
|
getFrontmatter() {
|
|
@@ -15404,7 +15616,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15404
15616
|
return {
|
|
15405
15617
|
success: false,
|
|
15406
15618
|
error: new Error(
|
|
15407
|
-
`Invalid frontmatter in ${
|
|
15619
|
+
`Invalid frontmatter in ${join103(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15408
15620
|
)
|
|
15409
15621
|
};
|
|
15410
15622
|
}
|
|
@@ -15422,7 +15634,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15422
15634
|
global = false
|
|
15423
15635
|
}) {
|
|
15424
15636
|
const paths = this.getSettablePaths({ global });
|
|
15425
|
-
const filePath =
|
|
15637
|
+
const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15426
15638
|
const fileContent = await readFileContent(filePath);
|
|
15427
15639
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15428
15640
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15458,12 +15670,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15458
15670
|
};
|
|
15459
15671
|
|
|
15460
15672
|
// src/features/subagents/deepagents-subagent.ts
|
|
15461
|
-
import { join as
|
|
15462
|
-
import { z as
|
|
15463
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15464
|
-
name:
|
|
15465
|
-
description:
|
|
15466
|
-
model:
|
|
15673
|
+
import { join as join104 } from "path";
|
|
15674
|
+
import { z as z61 } from "zod/mini";
|
|
15675
|
+
var DeepagentsSubagentFrontmatterSchema = z61.looseObject({
|
|
15676
|
+
name: z61.string(),
|
|
15677
|
+
description: z61.optional(z61.string()),
|
|
15678
|
+
model: z61.optional(z61.string())
|
|
15467
15679
|
});
|
|
15468
15680
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15469
15681
|
frontmatter;
|
|
@@ -15473,7 +15685,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15473
15685
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15474
15686
|
if (!result.success) {
|
|
15475
15687
|
throw new Error(
|
|
15476
|
-
`Invalid frontmatter in ${
|
|
15688
|
+
`Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15477
15689
|
);
|
|
15478
15690
|
}
|
|
15479
15691
|
}
|
|
@@ -15483,7 +15695,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15483
15695
|
}
|
|
15484
15696
|
static getSettablePaths(_options = {}) {
|
|
15485
15697
|
return {
|
|
15486
|
-
relativeDirPath:
|
|
15698
|
+
relativeDirPath: join104(".deepagents", "agents")
|
|
15487
15699
|
};
|
|
15488
15700
|
}
|
|
15489
15701
|
getFrontmatter() {
|
|
@@ -15558,7 +15770,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15558
15770
|
return {
|
|
15559
15771
|
success: false,
|
|
15560
15772
|
error: new Error(
|
|
15561
|
-
`Invalid frontmatter in ${
|
|
15773
|
+
`Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15562
15774
|
)
|
|
15563
15775
|
};
|
|
15564
15776
|
}
|
|
@@ -15576,7 +15788,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15576
15788
|
global = false
|
|
15577
15789
|
}) {
|
|
15578
15790
|
const paths = this.getSettablePaths({ global });
|
|
15579
|
-
const filePath =
|
|
15791
|
+
const filePath = join104(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15580
15792
|
const fileContent = await readFileContent(filePath);
|
|
15581
15793
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15582
15794
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15611,11 +15823,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15611
15823
|
};
|
|
15612
15824
|
|
|
15613
15825
|
// src/features/subagents/junie-subagent.ts
|
|
15614
|
-
import { join as
|
|
15615
|
-
import { z as
|
|
15616
|
-
var JunieSubagentFrontmatterSchema =
|
|
15617
|
-
name:
|
|
15618
|
-
description:
|
|
15826
|
+
import { join as join105 } from "path";
|
|
15827
|
+
import { z as z62 } from "zod/mini";
|
|
15828
|
+
var JunieSubagentFrontmatterSchema = z62.looseObject({
|
|
15829
|
+
name: z62.optional(z62.string()),
|
|
15830
|
+
description: z62.string()
|
|
15619
15831
|
});
|
|
15620
15832
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15621
15833
|
frontmatter;
|
|
@@ -15625,7 +15837,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15625
15837
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15626
15838
|
if (!result.success) {
|
|
15627
15839
|
throw new Error(
|
|
15628
|
-
`Invalid frontmatter in ${
|
|
15840
|
+
`Invalid frontmatter in ${join105(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15629
15841
|
);
|
|
15630
15842
|
}
|
|
15631
15843
|
}
|
|
@@ -15640,7 +15852,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15640
15852
|
throw new Error("JunieSubagent does not support global mode.");
|
|
15641
15853
|
}
|
|
15642
15854
|
return {
|
|
15643
|
-
relativeDirPath:
|
|
15855
|
+
relativeDirPath: join105(".junie", "agents")
|
|
15644
15856
|
};
|
|
15645
15857
|
}
|
|
15646
15858
|
getFrontmatter() {
|
|
@@ -15716,7 +15928,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15716
15928
|
return {
|
|
15717
15929
|
success: false,
|
|
15718
15930
|
error: new Error(
|
|
15719
|
-
`Invalid frontmatter in ${
|
|
15931
|
+
`Invalid frontmatter in ${join105(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15720
15932
|
)
|
|
15721
15933
|
};
|
|
15722
15934
|
}
|
|
@@ -15734,7 +15946,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15734
15946
|
global = false
|
|
15735
15947
|
}) {
|
|
15736
15948
|
const paths = this.getSettablePaths({ global });
|
|
15737
|
-
const filePath =
|
|
15949
|
+
const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15738
15950
|
const fileContent = await readFileContent(filePath);
|
|
15739
15951
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15740
15952
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15769,15 +15981,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15769
15981
|
};
|
|
15770
15982
|
|
|
15771
15983
|
// src/features/subagents/kilo-subagent.ts
|
|
15772
|
-
import { join as
|
|
15984
|
+
import { join as join107 } from "path";
|
|
15773
15985
|
|
|
15774
15986
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15775
|
-
import { basename as basename8, join as
|
|
15776
|
-
import { z as
|
|
15777
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15778
|
-
description:
|
|
15779
|
-
mode:
|
|
15780
|
-
name:
|
|
15987
|
+
import { basename as basename8, join as join106 } from "path";
|
|
15988
|
+
import { z as z63 } from "zod/mini";
|
|
15989
|
+
var OpenCodeStyleSubagentFrontmatterSchema = z63.looseObject({
|
|
15990
|
+
description: z63.optional(z63.string()),
|
|
15991
|
+
mode: z63._default(z63.string(), "subagent"),
|
|
15992
|
+
name: z63.optional(z63.string())
|
|
15781
15993
|
});
|
|
15782
15994
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
15783
15995
|
frontmatter;
|
|
@@ -15787,7 +15999,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15787
15999
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15788
16000
|
if (!result.success) {
|
|
15789
16001
|
throw new Error(
|
|
15790
|
-
`Invalid frontmatter in ${
|
|
16002
|
+
`Invalid frontmatter in ${join106(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15791
16003
|
);
|
|
15792
16004
|
}
|
|
15793
16005
|
}
|
|
@@ -15829,7 +16041,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15829
16041
|
return {
|
|
15830
16042
|
success: false,
|
|
15831
16043
|
error: new Error(
|
|
15832
|
-
`Invalid frontmatter in ${
|
|
16044
|
+
`Invalid frontmatter in ${join106(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15833
16045
|
)
|
|
15834
16046
|
};
|
|
15835
16047
|
}
|
|
@@ -15845,7 +16057,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15845
16057
|
global = false
|
|
15846
16058
|
} = {}) {
|
|
15847
16059
|
return {
|
|
15848
|
-
relativeDirPath: global ?
|
|
16060
|
+
relativeDirPath: global ? join107(".config", "kilo", "agent") : join107(".kilo", "agent")
|
|
15849
16061
|
};
|
|
15850
16062
|
}
|
|
15851
16063
|
static fromRulesyncSubagent({
|
|
@@ -15889,7 +16101,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15889
16101
|
global = false
|
|
15890
16102
|
}) {
|
|
15891
16103
|
const paths = this.getSettablePaths({ global });
|
|
15892
|
-
const filePath =
|
|
16104
|
+
const filePath = join107(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15893
16105
|
const fileContent = await readFileContent(filePath);
|
|
15894
16106
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15895
16107
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15925,23 +16137,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15925
16137
|
};
|
|
15926
16138
|
|
|
15927
16139
|
// src/features/subagents/kiro-subagent.ts
|
|
15928
|
-
import { join as
|
|
15929
|
-
import { z as
|
|
15930
|
-
var KiroCliSubagentJsonSchema =
|
|
15931
|
-
name:
|
|
15932
|
-
description:
|
|
15933
|
-
prompt:
|
|
15934
|
-
tools:
|
|
15935
|
-
toolAliases:
|
|
15936
|
-
toolSettings:
|
|
15937
|
-
toolSchema:
|
|
15938
|
-
hooks:
|
|
15939
|
-
model:
|
|
15940
|
-
mcpServers:
|
|
15941
|
-
useLegacyMcpJson:
|
|
15942
|
-
resources:
|
|
15943
|
-
allowedTools:
|
|
15944
|
-
includeMcpJson:
|
|
16140
|
+
import { join as join108 } from "path";
|
|
16141
|
+
import { z as z64 } from "zod/mini";
|
|
16142
|
+
var KiroCliSubagentJsonSchema = z64.looseObject({
|
|
16143
|
+
name: z64.string(),
|
|
16144
|
+
description: z64.optional(z64.nullable(z64.string())),
|
|
16145
|
+
prompt: z64.optional(z64.nullable(z64.string())),
|
|
16146
|
+
tools: z64.optional(z64.nullable(z64.array(z64.string()))),
|
|
16147
|
+
toolAliases: z64.optional(z64.nullable(z64.record(z64.string(), z64.string()))),
|
|
16148
|
+
toolSettings: z64.optional(z64.nullable(z64.unknown())),
|
|
16149
|
+
toolSchema: z64.optional(z64.nullable(z64.unknown())),
|
|
16150
|
+
hooks: z64.optional(z64.nullable(z64.record(z64.string(), z64.array(z64.unknown())))),
|
|
16151
|
+
model: z64.optional(z64.nullable(z64.string())),
|
|
16152
|
+
mcpServers: z64.optional(z64.nullable(z64.record(z64.string(), z64.unknown()))),
|
|
16153
|
+
useLegacyMcpJson: z64.optional(z64.nullable(z64.boolean())),
|
|
16154
|
+
resources: z64.optional(z64.nullable(z64.array(z64.string()))),
|
|
16155
|
+
allowedTools: z64.optional(z64.nullable(z64.array(z64.string()))),
|
|
16156
|
+
includeMcpJson: z64.optional(z64.nullable(z64.boolean()))
|
|
15945
16157
|
});
|
|
15946
16158
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15947
16159
|
body;
|
|
@@ -15952,7 +16164,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15952
16164
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15953
16165
|
} catch (error) {
|
|
15954
16166
|
throw new Error(
|
|
15955
|
-
`Invalid JSON in ${
|
|
16167
|
+
`Invalid JSON in ${join108(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15956
16168
|
{ cause: error }
|
|
15957
16169
|
);
|
|
15958
16170
|
}
|
|
@@ -15964,7 +16176,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15964
16176
|
}
|
|
15965
16177
|
static getSettablePaths(_options = {}) {
|
|
15966
16178
|
return {
|
|
15967
|
-
relativeDirPath:
|
|
16179
|
+
relativeDirPath: join108(".kiro", "agents")
|
|
15968
16180
|
};
|
|
15969
16181
|
}
|
|
15970
16182
|
getBody() {
|
|
@@ -15976,7 +16188,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15976
16188
|
parsed = JSON.parse(this.body);
|
|
15977
16189
|
} catch (error) {
|
|
15978
16190
|
throw new Error(
|
|
15979
|
-
`Failed to parse JSON in ${
|
|
16191
|
+
`Failed to parse JSON in ${join108(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15980
16192
|
{ cause: error }
|
|
15981
16193
|
);
|
|
15982
16194
|
}
|
|
@@ -16057,7 +16269,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16057
16269
|
global = false
|
|
16058
16270
|
}) {
|
|
16059
16271
|
const paths = this.getSettablePaths({ global });
|
|
16060
|
-
const filePath =
|
|
16272
|
+
const filePath = join108(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16061
16273
|
const fileContent = await readFileContent(filePath);
|
|
16062
16274
|
const subagent = new _KiroSubagent({
|
|
16063
16275
|
baseDir,
|
|
@@ -16095,7 +16307,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16095
16307
|
};
|
|
16096
16308
|
|
|
16097
16309
|
// src/features/subagents/opencode-subagent.ts
|
|
16098
|
-
import { join as
|
|
16310
|
+
import { join as join109 } from "path";
|
|
16099
16311
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
16100
16312
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
16101
16313
|
getToolTarget() {
|
|
@@ -16105,7 +16317,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16105
16317
|
global = false
|
|
16106
16318
|
} = {}) {
|
|
16107
16319
|
return {
|
|
16108
|
-
relativeDirPath: global ?
|
|
16320
|
+
relativeDirPath: global ? join109(".config", "opencode", "agent") : join109(".opencode", "agent")
|
|
16109
16321
|
};
|
|
16110
16322
|
}
|
|
16111
16323
|
static fromRulesyncSubagent({
|
|
@@ -16149,7 +16361,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16149
16361
|
global = false
|
|
16150
16362
|
}) {
|
|
16151
16363
|
const paths = this.getSettablePaths({ global });
|
|
16152
|
-
const filePath =
|
|
16364
|
+
const filePath = join109(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16153
16365
|
const fileContent = await readFileContent(filePath);
|
|
16154
16366
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16155
16367
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16202,7 +16414,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
16202
16414
|
"roo",
|
|
16203
16415
|
"rovodev"
|
|
16204
16416
|
];
|
|
16205
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16417
|
+
var SubagentsProcessorToolTargetSchema = z65.enum(subagentsProcessorToolTargetTuple);
|
|
16206
16418
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
16207
16419
|
[
|
|
16208
16420
|
"agentsmd",
|
|
@@ -16393,7 +16605,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16393
16605
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
16394
16606
|
*/
|
|
16395
16607
|
async loadRulesyncFiles() {
|
|
16396
|
-
const subagentsDir =
|
|
16608
|
+
const subagentsDir = join110(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
16397
16609
|
const dirExists = await directoryExists(subagentsDir);
|
|
16398
16610
|
if (!dirExists) {
|
|
16399
16611
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -16408,7 +16620,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16408
16620
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
16409
16621
|
const rulesyncSubagents = [];
|
|
16410
16622
|
for (const mdFile of mdFiles) {
|
|
16411
|
-
const filepath =
|
|
16623
|
+
const filepath = join110(subagentsDir, mdFile);
|
|
16412
16624
|
try {
|
|
16413
16625
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16414
16626
|
relativeFilePath: mdFile,
|
|
@@ -16438,7 +16650,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16438
16650
|
const factory = this.getFactory(this.toolTarget);
|
|
16439
16651
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
16440
16652
|
const subagentFilePaths = await findFilesByGlobs(
|
|
16441
|
-
|
|
16653
|
+
join110(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
16442
16654
|
);
|
|
16443
16655
|
if (forDeletion) {
|
|
16444
16656
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -16505,49 +16717,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16505
16717
|
};
|
|
16506
16718
|
|
|
16507
16719
|
// src/features/rules/agentsmd-rule.ts
|
|
16508
|
-
import { join as
|
|
16720
|
+
import { join as join113 } from "path";
|
|
16509
16721
|
|
|
16510
16722
|
// src/features/rules/tool-rule.ts
|
|
16511
|
-
import { join as
|
|
16723
|
+
import { join as join112 } from "path";
|
|
16512
16724
|
|
|
16513
16725
|
// src/features/rules/rulesync-rule.ts
|
|
16514
|
-
import { join as
|
|
16515
|
-
import { z as
|
|
16516
|
-
var RulesyncRuleFrontmatterSchema =
|
|
16517
|
-
root:
|
|
16518
|
-
localRoot:
|
|
16519
|
-
targets:
|
|
16520
|
-
description:
|
|
16521
|
-
globs:
|
|
16522
|
-
agentsmd:
|
|
16523
|
-
|
|
16726
|
+
import { join as join111 } from "path";
|
|
16727
|
+
import { z as z66 } from "zod/mini";
|
|
16728
|
+
var RulesyncRuleFrontmatterSchema = z66.object({
|
|
16729
|
+
root: z66.optional(z66.boolean()),
|
|
16730
|
+
localRoot: z66.optional(z66.boolean()),
|
|
16731
|
+
targets: z66._default(RulesyncTargetsSchema, ["*"]),
|
|
16732
|
+
description: z66.optional(z66.string()),
|
|
16733
|
+
globs: z66.optional(z66.array(z66.string())),
|
|
16734
|
+
agentsmd: z66.optional(
|
|
16735
|
+
z66.looseObject({
|
|
16524
16736
|
// @example "path/to/subproject"
|
|
16525
|
-
subprojectPath:
|
|
16737
|
+
subprojectPath: z66.optional(z66.string())
|
|
16526
16738
|
})
|
|
16527
16739
|
),
|
|
16528
|
-
claudecode:
|
|
16529
|
-
|
|
16740
|
+
claudecode: z66.optional(
|
|
16741
|
+
z66.looseObject({
|
|
16530
16742
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16531
16743
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16532
|
-
paths:
|
|
16744
|
+
paths: z66.optional(z66.array(z66.string()))
|
|
16533
16745
|
})
|
|
16534
16746
|
),
|
|
16535
|
-
cursor:
|
|
16536
|
-
|
|
16537
|
-
alwaysApply:
|
|
16538
|
-
description:
|
|
16539
|
-
globs:
|
|
16747
|
+
cursor: z66.optional(
|
|
16748
|
+
z66.looseObject({
|
|
16749
|
+
alwaysApply: z66.optional(z66.boolean()),
|
|
16750
|
+
description: z66.optional(z66.string()),
|
|
16751
|
+
globs: z66.optional(z66.array(z66.string()))
|
|
16540
16752
|
})
|
|
16541
16753
|
),
|
|
16542
|
-
copilot:
|
|
16543
|
-
|
|
16544
|
-
excludeAgent:
|
|
16754
|
+
copilot: z66.optional(
|
|
16755
|
+
z66.looseObject({
|
|
16756
|
+
excludeAgent: z66.optional(z66.union([z66.literal("code-review"), z66.literal("coding-agent")]))
|
|
16545
16757
|
})
|
|
16546
16758
|
),
|
|
16547
|
-
antigravity:
|
|
16548
|
-
|
|
16549
|
-
trigger:
|
|
16550
|
-
globs:
|
|
16759
|
+
antigravity: z66.optional(
|
|
16760
|
+
z66.looseObject({
|
|
16761
|
+
trigger: z66.optional(z66.string()),
|
|
16762
|
+
globs: z66.optional(z66.array(z66.string()))
|
|
16551
16763
|
})
|
|
16552
16764
|
)
|
|
16553
16765
|
});
|
|
@@ -16558,7 +16770,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16558
16770
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16559
16771
|
if (!parseResult.success && rest.validate !== false) {
|
|
16560
16772
|
throw new Error(
|
|
16561
|
-
`Invalid frontmatter in ${
|
|
16773
|
+
`Invalid frontmatter in ${join111(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16562
16774
|
);
|
|
16563
16775
|
}
|
|
16564
16776
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -16593,7 +16805,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16593
16805
|
return {
|
|
16594
16806
|
success: false,
|
|
16595
16807
|
error: new Error(
|
|
16596
|
-
`Invalid frontmatter in ${
|
|
16808
|
+
`Invalid frontmatter in ${join111(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16597
16809
|
)
|
|
16598
16810
|
};
|
|
16599
16811
|
}
|
|
@@ -16602,7 +16814,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16602
16814
|
relativeFilePath,
|
|
16603
16815
|
validate = true
|
|
16604
16816
|
}) {
|
|
16605
|
-
const filePath =
|
|
16817
|
+
const filePath = join111(
|
|
16606
16818
|
process.cwd(),
|
|
16607
16819
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
16608
16820
|
relativeFilePath
|
|
@@ -16701,7 +16913,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16701
16913
|
rulesyncRule,
|
|
16702
16914
|
validate = true,
|
|
16703
16915
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
16704
|
-
nonRootPath = { relativeDirPath:
|
|
16916
|
+
nonRootPath = { relativeDirPath: join112(".agents", "memories") }
|
|
16705
16917
|
}) {
|
|
16706
16918
|
const params = this.buildToolRuleParamsDefault({
|
|
16707
16919
|
baseDir,
|
|
@@ -16712,7 +16924,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16712
16924
|
});
|
|
16713
16925
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
16714
16926
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
16715
|
-
params.relativeDirPath =
|
|
16927
|
+
params.relativeDirPath = join112(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
16716
16928
|
params.relativeFilePath = "AGENTS.md";
|
|
16717
16929
|
}
|
|
16718
16930
|
return params;
|
|
@@ -16761,7 +16973,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16761
16973
|
}
|
|
16762
16974
|
};
|
|
16763
16975
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
16764
|
-
return excludeToolDir ? subDir :
|
|
16976
|
+
return excludeToolDir ? subDir : join112(toolDir, subDir);
|
|
16765
16977
|
}
|
|
16766
16978
|
|
|
16767
16979
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -16790,8 +17002,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16790
17002
|
validate = true
|
|
16791
17003
|
}) {
|
|
16792
17004
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16793
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
16794
|
-
const fileContent = await readFileContent(
|
|
17005
|
+
const relativePath = isRoot ? "AGENTS.md" : join113(".agents", "memories", relativeFilePath);
|
|
17006
|
+
const fileContent = await readFileContent(join113(baseDir, relativePath));
|
|
16795
17007
|
return new _AgentsMdRule({
|
|
16796
17008
|
baseDir,
|
|
16797
17009
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16846,21 +17058,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16846
17058
|
};
|
|
16847
17059
|
|
|
16848
17060
|
// src/features/rules/antigravity-rule.ts
|
|
16849
|
-
import { join as
|
|
16850
|
-
import { z as
|
|
16851
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16852
|
-
trigger:
|
|
16853
|
-
|
|
16854
|
-
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
17061
|
+
import { join as join114 } from "path";
|
|
17062
|
+
import { z as z67 } from "zod/mini";
|
|
17063
|
+
var AntigravityRuleFrontmatterSchema = z67.looseObject({
|
|
17064
|
+
trigger: z67.optional(
|
|
17065
|
+
z67.union([
|
|
17066
|
+
z67.literal("always_on"),
|
|
17067
|
+
z67.literal("glob"),
|
|
17068
|
+
z67.literal("manual"),
|
|
17069
|
+
z67.literal("model_decision"),
|
|
17070
|
+
z67.string()
|
|
16859
17071
|
// accepts any string for forward compatibility
|
|
16860
17072
|
])
|
|
16861
17073
|
),
|
|
16862
|
-
globs:
|
|
16863
|
-
description:
|
|
17074
|
+
globs: z67.optional(z67.string()),
|
|
17075
|
+
description: z67.optional(z67.string())
|
|
16864
17076
|
});
|
|
16865
17077
|
function parseGlobsString(globs) {
|
|
16866
17078
|
if (!globs) {
|
|
@@ -17005,7 +17217,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17005
17217
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17006
17218
|
if (!result.success) {
|
|
17007
17219
|
throw new Error(
|
|
17008
|
-
`Invalid frontmatter in ${
|
|
17220
|
+
`Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17009
17221
|
);
|
|
17010
17222
|
}
|
|
17011
17223
|
}
|
|
@@ -17029,7 +17241,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17029
17241
|
relativeFilePath,
|
|
17030
17242
|
validate = true
|
|
17031
17243
|
}) {
|
|
17032
|
-
const filePath =
|
|
17244
|
+
const filePath = join114(
|
|
17033
17245
|
baseDir,
|
|
17034
17246
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17035
17247
|
relativeFilePath
|
|
@@ -17169,7 +17381,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17169
17381
|
};
|
|
17170
17382
|
|
|
17171
17383
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
17172
|
-
import { join as
|
|
17384
|
+
import { join as join115 } from "path";
|
|
17173
17385
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
17174
17386
|
toRulesyncRule() {
|
|
17175
17387
|
const rulesyncFrontmatter = {
|
|
@@ -17229,8 +17441,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17229
17441
|
}) {
|
|
17230
17442
|
const settablePaths = this.getSettablePaths();
|
|
17231
17443
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
17232
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
17233
|
-
const fileContent = await readFileContent(
|
|
17444
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join115(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17445
|
+
const fileContent = await readFileContent(join115(baseDir, relativePath));
|
|
17234
17446
|
return new _AugmentcodeLegacyRule({
|
|
17235
17447
|
baseDir,
|
|
17236
17448
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17259,7 +17471,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17259
17471
|
};
|
|
17260
17472
|
|
|
17261
17473
|
// src/features/rules/augmentcode-rule.ts
|
|
17262
|
-
import { join as
|
|
17474
|
+
import { join as join116 } from "path";
|
|
17263
17475
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
17264
17476
|
toRulesyncRule() {
|
|
17265
17477
|
return this.toRulesyncRuleDefault();
|
|
@@ -17290,7 +17502,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17290
17502
|
relativeFilePath,
|
|
17291
17503
|
validate = true
|
|
17292
17504
|
}) {
|
|
17293
|
-
const filePath =
|
|
17505
|
+
const filePath = join116(
|
|
17294
17506
|
baseDir,
|
|
17295
17507
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17296
17508
|
relativeFilePath
|
|
@@ -17330,7 +17542,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17330
17542
|
};
|
|
17331
17543
|
|
|
17332
17544
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
17333
|
-
import { join as
|
|
17545
|
+
import { join as join117 } from "path";
|
|
17334
17546
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
17335
17547
|
static getSettablePaths({
|
|
17336
17548
|
global,
|
|
@@ -17372,7 +17584,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17372
17584
|
if (isRoot) {
|
|
17373
17585
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17374
17586
|
const fileContent2 = await readFileContent(
|
|
17375
|
-
|
|
17587
|
+
join117(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17376
17588
|
);
|
|
17377
17589
|
return new _ClaudecodeLegacyRule({
|
|
17378
17590
|
baseDir,
|
|
@@ -17386,8 +17598,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17386
17598
|
if (!paths.nonRoot) {
|
|
17387
17599
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17388
17600
|
}
|
|
17389
|
-
const relativePath =
|
|
17390
|
-
const fileContent = await readFileContent(
|
|
17601
|
+
const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17602
|
+
const fileContent = await readFileContent(join117(baseDir, relativePath));
|
|
17391
17603
|
return new _ClaudecodeLegacyRule({
|
|
17392
17604
|
baseDir,
|
|
17393
17605
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17446,10 +17658,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17446
17658
|
};
|
|
17447
17659
|
|
|
17448
17660
|
// src/features/rules/claudecode-rule.ts
|
|
17449
|
-
import { join as
|
|
17450
|
-
import { z as
|
|
17451
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17452
|
-
paths:
|
|
17661
|
+
import { join as join118 } from "path";
|
|
17662
|
+
import { z as z68 } from "zod/mini";
|
|
17663
|
+
var ClaudecodeRuleFrontmatterSchema = z68.object({
|
|
17664
|
+
paths: z68.optional(z68.array(z68.string()))
|
|
17453
17665
|
});
|
|
17454
17666
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17455
17667
|
frontmatter;
|
|
@@ -17487,7 +17699,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17487
17699
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17488
17700
|
if (!result.success) {
|
|
17489
17701
|
throw new Error(
|
|
17490
|
-
`Invalid frontmatter in ${
|
|
17702
|
+
`Invalid frontmatter in ${join118(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17491
17703
|
);
|
|
17492
17704
|
}
|
|
17493
17705
|
}
|
|
@@ -17517,7 +17729,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17517
17729
|
if (isRoot) {
|
|
17518
17730
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17519
17731
|
const fileContent2 = await readFileContent(
|
|
17520
|
-
|
|
17732
|
+
join118(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17521
17733
|
);
|
|
17522
17734
|
return new _ClaudecodeRule({
|
|
17523
17735
|
baseDir,
|
|
@@ -17532,8 +17744,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17532
17744
|
if (!paths.nonRoot) {
|
|
17533
17745
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17534
17746
|
}
|
|
17535
|
-
const relativePath =
|
|
17536
|
-
const filePath =
|
|
17747
|
+
const relativePath = join118(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17748
|
+
const filePath = join118(baseDir, relativePath);
|
|
17537
17749
|
const fileContent = await readFileContent(filePath);
|
|
17538
17750
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17539
17751
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17644,7 +17856,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17644
17856
|
return {
|
|
17645
17857
|
success: false,
|
|
17646
17858
|
error: new Error(
|
|
17647
|
-
`Invalid frontmatter in ${
|
|
17859
|
+
`Invalid frontmatter in ${join118(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17648
17860
|
)
|
|
17649
17861
|
};
|
|
17650
17862
|
}
|
|
@@ -17664,10 +17876,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17664
17876
|
};
|
|
17665
17877
|
|
|
17666
17878
|
// src/features/rules/cline-rule.ts
|
|
17667
|
-
import { join as
|
|
17668
|
-
import { z as
|
|
17669
|
-
var ClineRuleFrontmatterSchema =
|
|
17670
|
-
description:
|
|
17879
|
+
import { join as join119 } from "path";
|
|
17880
|
+
import { z as z69 } from "zod/mini";
|
|
17881
|
+
var ClineRuleFrontmatterSchema = z69.object({
|
|
17882
|
+
description: z69.string()
|
|
17671
17883
|
});
|
|
17672
17884
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17673
17885
|
static getSettablePaths(_options = {}) {
|
|
@@ -17710,7 +17922,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17710
17922
|
validate = true
|
|
17711
17923
|
}) {
|
|
17712
17924
|
const fileContent = await readFileContent(
|
|
17713
|
-
|
|
17925
|
+
join119(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17714
17926
|
);
|
|
17715
17927
|
return new _ClineRule({
|
|
17716
17928
|
baseDir,
|
|
@@ -17736,7 +17948,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17736
17948
|
};
|
|
17737
17949
|
|
|
17738
17950
|
// src/features/rules/codexcli-rule.ts
|
|
17739
|
-
import { join as
|
|
17951
|
+
import { join as join120 } from "path";
|
|
17740
17952
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
17741
17953
|
static getSettablePaths({
|
|
17742
17954
|
global,
|
|
@@ -17771,7 +17983,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17771
17983
|
if (isRoot) {
|
|
17772
17984
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17773
17985
|
const fileContent2 = await readFileContent(
|
|
17774
|
-
|
|
17986
|
+
join120(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17775
17987
|
);
|
|
17776
17988
|
return new _CodexcliRule({
|
|
17777
17989
|
baseDir,
|
|
@@ -17785,8 +17997,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17785
17997
|
if (!paths.nonRoot) {
|
|
17786
17998
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17787
17999
|
}
|
|
17788
|
-
const relativePath =
|
|
17789
|
-
const fileContent = await readFileContent(
|
|
18000
|
+
const relativePath = join120(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18001
|
+
const fileContent = await readFileContent(join120(baseDir, relativePath));
|
|
17790
18002
|
return new _CodexcliRule({
|
|
17791
18003
|
baseDir,
|
|
17792
18004
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17845,12 +18057,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17845
18057
|
};
|
|
17846
18058
|
|
|
17847
18059
|
// src/features/rules/copilot-rule.ts
|
|
17848
|
-
import { join as
|
|
17849
|
-
import { z as
|
|
17850
|
-
var CopilotRuleFrontmatterSchema =
|
|
17851
|
-
description:
|
|
17852
|
-
applyTo:
|
|
17853
|
-
excludeAgent:
|
|
18060
|
+
import { join as join121 } from "path";
|
|
18061
|
+
import { z as z70 } from "zod/mini";
|
|
18062
|
+
var CopilotRuleFrontmatterSchema = z70.object({
|
|
18063
|
+
description: z70.optional(z70.string()),
|
|
18064
|
+
applyTo: z70.optional(z70.string()),
|
|
18065
|
+
excludeAgent: z70.optional(z70.union([z70.literal("code-review"), z70.literal("coding-agent")]))
|
|
17854
18066
|
});
|
|
17855
18067
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17856
18068
|
frontmatter;
|
|
@@ -17882,7 +18094,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17882
18094
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17883
18095
|
if (!result.success) {
|
|
17884
18096
|
throw new Error(
|
|
17885
|
-
`Invalid frontmatter in ${
|
|
18097
|
+
`Invalid frontmatter in ${join121(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17886
18098
|
);
|
|
17887
18099
|
}
|
|
17888
18100
|
}
|
|
@@ -17972,8 +18184,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17972
18184
|
const paths = this.getSettablePaths({ global });
|
|
17973
18185
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17974
18186
|
if (isRoot) {
|
|
17975
|
-
const relativePath2 =
|
|
17976
|
-
const filePath2 =
|
|
18187
|
+
const relativePath2 = join121(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18188
|
+
const filePath2 = join121(baseDir, relativePath2);
|
|
17977
18189
|
const fileContent2 = await readFileContent(filePath2);
|
|
17978
18190
|
return new _CopilotRule({
|
|
17979
18191
|
baseDir,
|
|
@@ -17988,8 +18200,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17988
18200
|
if (!paths.nonRoot) {
|
|
17989
18201
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17990
18202
|
}
|
|
17991
|
-
const relativePath =
|
|
17992
|
-
const filePath =
|
|
18203
|
+
const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18204
|
+
const filePath = join121(baseDir, relativePath);
|
|
17993
18205
|
const fileContent = await readFileContent(filePath);
|
|
17994
18206
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17995
18207
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18035,7 +18247,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18035
18247
|
return {
|
|
18036
18248
|
success: false,
|
|
18037
18249
|
error: new Error(
|
|
18038
|
-
`Invalid frontmatter in ${
|
|
18250
|
+
`Invalid frontmatter in ${join121(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18039
18251
|
)
|
|
18040
18252
|
};
|
|
18041
18253
|
}
|
|
@@ -18091,12 +18303,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
18091
18303
|
};
|
|
18092
18304
|
|
|
18093
18305
|
// src/features/rules/cursor-rule.ts
|
|
18094
|
-
import { join as
|
|
18095
|
-
import { z as
|
|
18096
|
-
var CursorRuleFrontmatterSchema =
|
|
18097
|
-
description:
|
|
18098
|
-
globs:
|
|
18099
|
-
alwaysApply:
|
|
18306
|
+
import { join as join122 } from "path";
|
|
18307
|
+
import { z as z71 } from "zod/mini";
|
|
18308
|
+
var CursorRuleFrontmatterSchema = z71.object({
|
|
18309
|
+
description: z71.optional(z71.string()),
|
|
18310
|
+
globs: z71.optional(z71.string()),
|
|
18311
|
+
alwaysApply: z71.optional(z71.boolean())
|
|
18100
18312
|
});
|
|
18101
18313
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
18102
18314
|
frontmatter;
|
|
@@ -18113,7 +18325,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18113
18325
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18114
18326
|
if (!result.success) {
|
|
18115
18327
|
throw new Error(
|
|
18116
|
-
`Invalid frontmatter in ${
|
|
18328
|
+
`Invalid frontmatter in ${join122(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18117
18329
|
);
|
|
18118
18330
|
}
|
|
18119
18331
|
}
|
|
@@ -18229,7 +18441,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18229
18441
|
relativeFilePath,
|
|
18230
18442
|
validate = true
|
|
18231
18443
|
}) {
|
|
18232
|
-
const filePath =
|
|
18444
|
+
const filePath = join122(
|
|
18233
18445
|
baseDir,
|
|
18234
18446
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
18235
18447
|
relativeFilePath
|
|
@@ -18239,7 +18451,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18239
18451
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18240
18452
|
if (!result.success) {
|
|
18241
18453
|
throw new Error(
|
|
18242
|
-
`Invalid frontmatter in ${
|
|
18454
|
+
`Invalid frontmatter in ${join122(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
18243
18455
|
);
|
|
18244
18456
|
}
|
|
18245
18457
|
return new _CursorRule({
|
|
@@ -18276,7 +18488,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18276
18488
|
return {
|
|
18277
18489
|
success: false,
|
|
18278
18490
|
error: new Error(
|
|
18279
|
-
`Invalid frontmatter in ${
|
|
18491
|
+
`Invalid frontmatter in ${join122(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18280
18492
|
)
|
|
18281
18493
|
};
|
|
18282
18494
|
}
|
|
@@ -18296,7 +18508,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18296
18508
|
};
|
|
18297
18509
|
|
|
18298
18510
|
// src/features/rules/deepagents-rule.ts
|
|
18299
|
-
import { join as
|
|
18511
|
+
import { join as join123 } from "path";
|
|
18300
18512
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
18301
18513
|
constructor({ fileContent, root, ...rest }) {
|
|
18302
18514
|
super({
|
|
@@ -18323,8 +18535,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18323
18535
|
}) {
|
|
18324
18536
|
const settablePaths = this.getSettablePaths();
|
|
18325
18537
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18326
|
-
const relativePath = isRoot ?
|
|
18327
|
-
const fileContent = await readFileContent(
|
|
18538
|
+
const relativePath = isRoot ? join123(".deepagents", "AGENTS.md") : join123(".deepagents", "memories", relativeFilePath);
|
|
18539
|
+
const fileContent = await readFileContent(join123(baseDir, relativePath));
|
|
18328
18540
|
return new _DeepagentsRule({
|
|
18329
18541
|
baseDir,
|
|
18330
18542
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18379,7 +18591,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18379
18591
|
};
|
|
18380
18592
|
|
|
18381
18593
|
// src/features/rules/factorydroid-rule.ts
|
|
18382
|
-
import { join as
|
|
18594
|
+
import { join as join124 } from "path";
|
|
18383
18595
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
18384
18596
|
constructor({ fileContent, root, ...rest }) {
|
|
18385
18597
|
super({
|
|
@@ -18419,8 +18631,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18419
18631
|
const paths = this.getSettablePaths({ global });
|
|
18420
18632
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18421
18633
|
if (isRoot) {
|
|
18422
|
-
const relativePath2 =
|
|
18423
|
-
const fileContent2 = await readFileContent(
|
|
18634
|
+
const relativePath2 = join124(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18635
|
+
const fileContent2 = await readFileContent(join124(baseDir, relativePath2));
|
|
18424
18636
|
return new _FactorydroidRule({
|
|
18425
18637
|
baseDir,
|
|
18426
18638
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -18433,8 +18645,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18433
18645
|
if (!paths.nonRoot) {
|
|
18434
18646
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18435
18647
|
}
|
|
18436
|
-
const relativePath =
|
|
18437
|
-
const fileContent = await readFileContent(
|
|
18648
|
+
const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18649
|
+
const fileContent = await readFileContent(join124(baseDir, relativePath));
|
|
18438
18650
|
return new _FactorydroidRule({
|
|
18439
18651
|
baseDir,
|
|
18440
18652
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18493,7 +18705,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18493
18705
|
};
|
|
18494
18706
|
|
|
18495
18707
|
// src/features/rules/geminicli-rule.ts
|
|
18496
|
-
import { join as
|
|
18708
|
+
import { join as join125 } from "path";
|
|
18497
18709
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
18498
18710
|
static getSettablePaths({
|
|
18499
18711
|
global,
|
|
@@ -18528,7 +18740,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18528
18740
|
if (isRoot) {
|
|
18529
18741
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18530
18742
|
const fileContent2 = await readFileContent(
|
|
18531
|
-
|
|
18743
|
+
join125(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18532
18744
|
);
|
|
18533
18745
|
return new _GeminiCliRule({
|
|
18534
18746
|
baseDir,
|
|
@@ -18542,8 +18754,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18542
18754
|
if (!paths.nonRoot) {
|
|
18543
18755
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18544
18756
|
}
|
|
18545
|
-
const relativePath =
|
|
18546
|
-
const fileContent = await readFileContent(
|
|
18757
|
+
const relativePath = join125(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18758
|
+
const fileContent = await readFileContent(join125(baseDir, relativePath));
|
|
18547
18759
|
return new _GeminiCliRule({
|
|
18548
18760
|
baseDir,
|
|
18549
18761
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18602,7 +18814,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18602
18814
|
};
|
|
18603
18815
|
|
|
18604
18816
|
// src/features/rules/goose-rule.ts
|
|
18605
|
-
import { join as
|
|
18817
|
+
import { join as join126 } from "path";
|
|
18606
18818
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
18607
18819
|
static getSettablePaths({
|
|
18608
18820
|
global,
|
|
@@ -18637,7 +18849,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18637
18849
|
if (isRoot) {
|
|
18638
18850
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18639
18851
|
const fileContent2 = await readFileContent(
|
|
18640
|
-
|
|
18852
|
+
join126(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18641
18853
|
);
|
|
18642
18854
|
return new _GooseRule({
|
|
18643
18855
|
baseDir,
|
|
@@ -18651,8 +18863,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18651
18863
|
if (!paths.nonRoot) {
|
|
18652
18864
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18653
18865
|
}
|
|
18654
|
-
const relativePath =
|
|
18655
|
-
const fileContent = await readFileContent(
|
|
18866
|
+
const relativePath = join126(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18867
|
+
const fileContent = await readFileContent(join126(baseDir, relativePath));
|
|
18656
18868
|
return new _GooseRule({
|
|
18657
18869
|
baseDir,
|
|
18658
18870
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18711,7 +18923,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18711
18923
|
};
|
|
18712
18924
|
|
|
18713
18925
|
// src/features/rules/junie-rule.ts
|
|
18714
|
-
import { join as
|
|
18926
|
+
import { join as join127 } from "path";
|
|
18715
18927
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
18716
18928
|
static getSettablePaths(_options = {}) {
|
|
18717
18929
|
return {
|
|
@@ -18740,8 +18952,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18740
18952
|
}) {
|
|
18741
18953
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
18742
18954
|
const settablePaths = this.getSettablePaths();
|
|
18743
|
-
const relativePath = isRoot ?
|
|
18744
|
-
const fileContent = await readFileContent(
|
|
18955
|
+
const relativePath = isRoot ? join127(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join127(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18956
|
+
const fileContent = await readFileContent(join127(baseDir, relativePath));
|
|
18745
18957
|
return new _JunieRule({
|
|
18746
18958
|
baseDir,
|
|
18747
18959
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18796,7 +19008,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18796
19008
|
};
|
|
18797
19009
|
|
|
18798
19010
|
// src/features/rules/kilo-rule.ts
|
|
18799
|
-
import { join as
|
|
19011
|
+
import { join as join128 } from "path";
|
|
18800
19012
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
18801
19013
|
static getSettablePaths({
|
|
18802
19014
|
global,
|
|
@@ -18831,7 +19043,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18831
19043
|
if (isRoot) {
|
|
18832
19044
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18833
19045
|
const fileContent2 = await readFileContent(
|
|
18834
|
-
|
|
19046
|
+
join128(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18835
19047
|
);
|
|
18836
19048
|
return new _KiloRule({
|
|
18837
19049
|
baseDir,
|
|
@@ -18845,8 +19057,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18845
19057
|
if (!paths.nonRoot) {
|
|
18846
19058
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18847
19059
|
}
|
|
18848
|
-
const relativePath =
|
|
18849
|
-
const fileContent = await readFileContent(
|
|
19060
|
+
const relativePath = join128(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19061
|
+
const fileContent = await readFileContent(join128(baseDir, relativePath));
|
|
18850
19062
|
return new _KiloRule({
|
|
18851
19063
|
baseDir,
|
|
18852
19064
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18905,7 +19117,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18905
19117
|
};
|
|
18906
19118
|
|
|
18907
19119
|
// src/features/rules/kiro-rule.ts
|
|
18908
|
-
import { join as
|
|
19120
|
+
import { join as join129 } from "path";
|
|
18909
19121
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18910
19122
|
static getSettablePaths(_options = {}) {
|
|
18911
19123
|
return {
|
|
@@ -18920,7 +19132,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18920
19132
|
validate = true
|
|
18921
19133
|
}) {
|
|
18922
19134
|
const fileContent = await readFileContent(
|
|
18923
|
-
|
|
19135
|
+
join129(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18924
19136
|
);
|
|
18925
19137
|
return new _KiroRule({
|
|
18926
19138
|
baseDir,
|
|
@@ -18974,7 +19186,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18974
19186
|
};
|
|
18975
19187
|
|
|
18976
19188
|
// src/features/rules/opencode-rule.ts
|
|
18977
|
-
import { join as
|
|
19189
|
+
import { join as join130 } from "path";
|
|
18978
19190
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18979
19191
|
static getSettablePaths({
|
|
18980
19192
|
global,
|
|
@@ -19009,7 +19221,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19009
19221
|
if (isRoot) {
|
|
19010
19222
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19011
19223
|
const fileContent2 = await readFileContent(
|
|
19012
|
-
|
|
19224
|
+
join130(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19013
19225
|
);
|
|
19014
19226
|
return new _OpenCodeRule({
|
|
19015
19227
|
baseDir,
|
|
@@ -19023,8 +19235,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19023
19235
|
if (!paths.nonRoot) {
|
|
19024
19236
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19025
19237
|
}
|
|
19026
|
-
const relativePath =
|
|
19027
|
-
const fileContent = await readFileContent(
|
|
19238
|
+
const relativePath = join130(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19239
|
+
const fileContent = await readFileContent(join130(baseDir, relativePath));
|
|
19028
19240
|
return new _OpenCodeRule({
|
|
19029
19241
|
baseDir,
|
|
19030
19242
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19083,7 +19295,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19083
19295
|
};
|
|
19084
19296
|
|
|
19085
19297
|
// src/features/rules/qwencode-rule.ts
|
|
19086
|
-
import { join as
|
|
19298
|
+
import { join as join131 } from "path";
|
|
19087
19299
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
19088
19300
|
static getSettablePaths(_options = {}) {
|
|
19089
19301
|
return {
|
|
@@ -19102,8 +19314,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19102
19314
|
validate = true
|
|
19103
19315
|
}) {
|
|
19104
19316
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
19105
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
19106
|
-
const fileContent = await readFileContent(
|
|
19317
|
+
const relativePath = isRoot ? "QWEN.md" : join131(".qwen", "memories", relativeFilePath);
|
|
19318
|
+
const fileContent = await readFileContent(join131(baseDir, relativePath));
|
|
19107
19319
|
return new _QwencodeRule({
|
|
19108
19320
|
baseDir,
|
|
19109
19321
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -19155,7 +19367,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19155
19367
|
};
|
|
19156
19368
|
|
|
19157
19369
|
// src/features/rules/replit-rule.ts
|
|
19158
|
-
import { join as
|
|
19370
|
+
import { join as join132 } from "path";
|
|
19159
19371
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
19160
19372
|
static getSettablePaths(_options = {}) {
|
|
19161
19373
|
return {
|
|
@@ -19177,7 +19389,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19177
19389
|
}
|
|
19178
19390
|
const relativePath = paths.root.relativeFilePath;
|
|
19179
19391
|
const fileContent = await readFileContent(
|
|
19180
|
-
|
|
19392
|
+
join132(baseDir, paths.root.relativeDirPath, relativePath)
|
|
19181
19393
|
);
|
|
19182
19394
|
return new _ReplitRule({
|
|
19183
19395
|
baseDir,
|
|
@@ -19243,7 +19455,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19243
19455
|
};
|
|
19244
19456
|
|
|
19245
19457
|
// src/features/rules/roo-rule.ts
|
|
19246
|
-
import { join as
|
|
19458
|
+
import { join as join133 } from "path";
|
|
19247
19459
|
var RooRule = class _RooRule extends ToolRule {
|
|
19248
19460
|
static getSettablePaths(_options = {}) {
|
|
19249
19461
|
return {
|
|
@@ -19258,7 +19470,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19258
19470
|
validate = true
|
|
19259
19471
|
}) {
|
|
19260
19472
|
const fileContent = await readFileContent(
|
|
19261
|
-
|
|
19473
|
+
join133(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19262
19474
|
);
|
|
19263
19475
|
return new _RooRule({
|
|
19264
19476
|
baseDir,
|
|
@@ -19327,7 +19539,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19327
19539
|
};
|
|
19328
19540
|
|
|
19329
19541
|
// src/features/rules/rovodev-rule.ts
|
|
19330
|
-
import { join as
|
|
19542
|
+
import { join as join134 } from "path";
|
|
19331
19543
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
19332
19544
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
19333
19545
|
/**
|
|
@@ -19371,7 +19583,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19371
19583
|
root: rovodevAgents,
|
|
19372
19584
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
19373
19585
|
nonRoot: {
|
|
19374
|
-
relativeDirPath:
|
|
19586
|
+
relativeDirPath: join134(".rovodev", ".rulesync", "modular-rules")
|
|
19375
19587
|
}
|
|
19376
19588
|
};
|
|
19377
19589
|
}
|
|
@@ -19410,10 +19622,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19410
19622
|
}) {
|
|
19411
19623
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19412
19624
|
throw new Error(
|
|
19413
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${
|
|
19625
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join134(relativeDirPath, relativeFilePath)}`
|
|
19414
19626
|
);
|
|
19415
19627
|
}
|
|
19416
|
-
const fileContent = await readFileContent(
|
|
19628
|
+
const fileContent = await readFileContent(join134(baseDir, relativeDirPath, relativeFilePath));
|
|
19417
19629
|
return new _RovodevRule({
|
|
19418
19630
|
baseDir,
|
|
19419
19631
|
relativeDirPath,
|
|
@@ -19433,10 +19645,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19433
19645
|
paths
|
|
19434
19646
|
}) {
|
|
19435
19647
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19436
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${
|
|
19648
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join134(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join134(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19437
19649
|
if (relativeFilePath !== "AGENTS.md") {
|
|
19438
19650
|
throw new Error(
|
|
19439
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
19651
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join134(relativeDirPath, relativeFilePath)}`
|
|
19440
19652
|
);
|
|
19441
19653
|
}
|
|
19442
19654
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -19444,10 +19656,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19444
19656
|
);
|
|
19445
19657
|
if (!allowed) {
|
|
19446
19658
|
throw new Error(
|
|
19447
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${
|
|
19659
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join134(relativeDirPath, relativeFilePath)}`
|
|
19448
19660
|
);
|
|
19449
19661
|
}
|
|
19450
|
-
const fileContent = await readFileContent(
|
|
19662
|
+
const fileContent = await readFileContent(join134(baseDir, relativeDirPath, relativeFilePath));
|
|
19451
19663
|
return new _RovodevRule({
|
|
19452
19664
|
baseDir,
|
|
19453
19665
|
relativeDirPath,
|
|
@@ -19561,7 +19773,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19561
19773
|
};
|
|
19562
19774
|
|
|
19563
19775
|
// src/features/rules/warp-rule.ts
|
|
19564
|
-
import { join as
|
|
19776
|
+
import { join as join135 } from "path";
|
|
19565
19777
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
19566
19778
|
constructor({ fileContent, root, ...rest }) {
|
|
19567
19779
|
super({
|
|
@@ -19587,8 +19799,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19587
19799
|
validate = true
|
|
19588
19800
|
}) {
|
|
19589
19801
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
19590
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
19591
|
-
const fileContent = await readFileContent(
|
|
19802
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join135(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19803
|
+
const fileContent = await readFileContent(join135(baseDir, relativePath));
|
|
19592
19804
|
return new _WarpRule({
|
|
19593
19805
|
baseDir,
|
|
19594
19806
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -19643,7 +19855,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19643
19855
|
};
|
|
19644
19856
|
|
|
19645
19857
|
// src/features/rules/windsurf-rule.ts
|
|
19646
|
-
import { join as
|
|
19858
|
+
import { join as join136 } from "path";
|
|
19647
19859
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
19648
19860
|
static getSettablePaths(_options = {}) {
|
|
19649
19861
|
return {
|
|
@@ -19658,7 +19870,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
19658
19870
|
validate = true
|
|
19659
19871
|
}) {
|
|
19660
19872
|
const fileContent = await readFileContent(
|
|
19661
|
-
|
|
19873
|
+
join136(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19662
19874
|
);
|
|
19663
19875
|
return new _WindsurfRule({
|
|
19664
19876
|
baseDir,
|
|
@@ -19756,11 +19968,11 @@ var rulesProcessorToolTargets = [
|
|
|
19756
19968
|
"warp",
|
|
19757
19969
|
"windsurf"
|
|
19758
19970
|
];
|
|
19759
|
-
var RulesProcessorToolTargetSchema =
|
|
19760
|
-
var formatRulePaths = (rules) => rules.map((r) =>
|
|
19761
|
-
var RulesFeatureOptionsSchema =
|
|
19762
|
-
ruleDiscoveryMode:
|
|
19763
|
-
includeLocalRoot:
|
|
19971
|
+
var RulesProcessorToolTargetSchema = z72.enum(rulesProcessorToolTargets);
|
|
19972
|
+
var formatRulePaths = (rules) => rules.map((r) => join137(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19973
|
+
var RulesFeatureOptionsSchema = z72.looseObject({
|
|
19974
|
+
ruleDiscoveryMode: z72.optional(z72.enum(["none", "explicit"])),
|
|
19975
|
+
includeLocalRoot: z72.optional(z72.boolean())
|
|
19764
19976
|
});
|
|
19765
19977
|
var resolveRuleDiscoveryMode = ({
|
|
19766
19978
|
defaultMode,
|
|
@@ -19781,8 +19993,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
19781
19993
|
}
|
|
19782
19994
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19783
19995
|
};
|
|
19784
|
-
var IncludeLocalRootSchema =
|
|
19785
|
-
includeLocalRoot:
|
|
19996
|
+
var IncludeLocalRootSchema = z72.looseObject({
|
|
19997
|
+
includeLocalRoot: z72.optional(z72.boolean())
|
|
19786
19998
|
});
|
|
19787
19999
|
var resolveIncludeLocalRoot = (options) => {
|
|
19788
20000
|
if (!options) return true;
|
|
@@ -20088,6 +20300,8 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
20088
20300
|
extension: "md",
|
|
20089
20301
|
supportsGlobal: false,
|
|
20090
20302
|
ruleDiscoveryMode: "auto"
|
|
20303
|
+
// No additionalConventions.skills needed: Windsurf Cascade auto-discovers
|
|
20304
|
+
// skills from .windsurf/skills/ and ~/.codeium/windsurf/skills/ directories.
|
|
20091
20305
|
}
|
|
20092
20306
|
}
|
|
20093
20307
|
]
|
|
@@ -20225,7 +20439,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20225
20439
|
}).relativeDirPath;
|
|
20226
20440
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
20227
20441
|
const frontmatter = skill.getFrontmatter();
|
|
20228
|
-
const relativePath =
|
|
20442
|
+
const relativePath = join137(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
20229
20443
|
return {
|
|
20230
20444
|
name: frontmatter.name,
|
|
20231
20445
|
description: frontmatter.description,
|
|
@@ -20354,8 +20568,8 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20354
20568
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
20355
20569
|
*/
|
|
20356
20570
|
async loadRulesyncFiles() {
|
|
20357
|
-
const rulesyncBaseDir =
|
|
20358
|
-
const files = await findFilesByGlobs(
|
|
20571
|
+
const rulesyncBaseDir = join137(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
20572
|
+
const files = await findFilesByGlobs(join137(rulesyncBaseDir, "**", "*.md"));
|
|
20359
20573
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
20360
20574
|
const rulesyncRules = await Promise.all(
|
|
20361
20575
|
files.map((file) => {
|
|
@@ -20470,13 +20684,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20470
20684
|
return [];
|
|
20471
20685
|
}
|
|
20472
20686
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
20473
|
-
|
|
20687
|
+
join137(
|
|
20474
20688
|
this.baseDir,
|
|
20475
20689
|
settablePaths.root.relativeDirPath ?? ".",
|
|
20476
20690
|
settablePaths.root.relativeFilePath
|
|
20477
20691
|
),
|
|
20478
20692
|
settablePaths.alternativeRoots,
|
|
20479
|
-
(alt) =>
|
|
20693
|
+
(alt) => join137(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
20480
20694
|
);
|
|
20481
20695
|
if (forDeletion) {
|
|
20482
20696
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -20507,7 +20721,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20507
20721
|
return [];
|
|
20508
20722
|
}
|
|
20509
20723
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
20510
|
-
|
|
20724
|
+
join137(this.baseDir, "AGENTS.local.md")
|
|
20511
20725
|
);
|
|
20512
20726
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
20513
20727
|
}
|
|
@@ -20518,9 +20732,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20518
20732
|
return [];
|
|
20519
20733
|
}
|
|
20520
20734
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
20521
|
-
|
|
20735
|
+
join137(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
20522
20736
|
settablePaths.alternativeRoots,
|
|
20523
|
-
(alt) =>
|
|
20737
|
+
(alt) => join137(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
20524
20738
|
);
|
|
20525
20739
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
20526
20740
|
})();
|
|
@@ -20531,20 +20745,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20531
20745
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
20532
20746
|
return [];
|
|
20533
20747
|
}
|
|
20534
|
-
const primaryPaths = await findFilesByGlobs(
|
|
20748
|
+
const primaryPaths = await findFilesByGlobs(join137(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
20535
20749
|
if (primaryPaths.length === 0) {
|
|
20536
20750
|
return [];
|
|
20537
20751
|
}
|
|
20538
|
-
const mirrorPaths = await findFilesByGlobs(
|
|
20752
|
+
const mirrorPaths = await findFilesByGlobs(join137(this.baseDir, "AGENTS.md"));
|
|
20539
20753
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
20540
20754
|
})();
|
|
20541
20755
|
const nonRootToolRules = await (async () => {
|
|
20542
20756
|
if (!settablePaths.nonRoot) {
|
|
20543
20757
|
return [];
|
|
20544
20758
|
}
|
|
20545
|
-
const nonRootBaseDir =
|
|
20759
|
+
const nonRootBaseDir = join137(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
20546
20760
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
20547
|
-
|
|
20761
|
+
join137(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
20548
20762
|
);
|
|
20549
20763
|
if (forDeletion) {
|
|
20550
20764
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -20558,7 +20772,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20558
20772
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
20559
20773
|
if (!ok) {
|
|
20560
20774
|
this.logger.warn(
|
|
20561
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${
|
|
20775
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${join137(modularRootRelative, relativeFilePath)}`
|
|
20562
20776
|
);
|
|
20563
20777
|
}
|
|
20564
20778
|
return ok;
|
|
@@ -20684,14 +20898,14 @@ s/<command> [arguments]
|
|
|
20684
20898
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
20685
20899
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
20686
20900
|
|
|
20687
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
20901
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join137(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
20688
20902
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
20689
20903
|
|
|
20690
20904
|
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.
|
|
20691
20905
|
|
|
20692
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
20906
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join137(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
20693
20907
|
|
|
20694
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
20908
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join137(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
20695
20909
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
20696
20910
|
const result = [
|
|
20697
20911
|
overview,
|
|
@@ -20791,7 +21005,7 @@ function warnUnsupportedTargets(params) {
|
|
|
20791
21005
|
}
|
|
20792
21006
|
}
|
|
20793
21007
|
async function checkRulesyncDirExists(params) {
|
|
20794
|
-
return fileExists(
|
|
21008
|
+
return fileExists(join138(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
20795
21009
|
}
|
|
20796
21010
|
async function generate(params) {
|
|
20797
21011
|
const { config, logger } = params;
|
|
@@ -21617,6 +21831,7 @@ export {
|
|
|
21617
21831
|
ALL_TOOL_TARGETS,
|
|
21618
21832
|
ALL_TOOL_TARGETS_WITH_WILDCARD,
|
|
21619
21833
|
findControlCharacter,
|
|
21834
|
+
GITIGNORE_DESTINATION_KEY,
|
|
21620
21835
|
ConfigResolver,
|
|
21621
21836
|
stringifyFrontmatter,
|
|
21622
21837
|
RulesyncCommandFrontmatterSchema,
|