rulesync 8.3.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-RVBJT5ST.js → chunk-Q5FDY7NL.js} +560 -334
- package/dist/cli/index.cjs +1031 -705
- package/dist/cli/index.js +127 -25
- package/dist/index.cjs +573 -348
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -259,8 +259,13 @@ var ALL_FEATURES = [
|
|
|
259
259
|
var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
|
|
260
260
|
var FeatureSchema = import_mini.z.enum(ALL_FEATURES);
|
|
261
261
|
var FeaturesSchema = import_mini.z.array(FeatureSchema);
|
|
262
|
+
var GitignoreDestinationSchema = import_mini.z.enum(["gitignore", "gitattributes"]);
|
|
262
263
|
var FeatureOptionsSchema = import_mini.z.record(import_mini.z.string(), import_mini.z.unknown());
|
|
263
|
-
var FeatureValueSchema = import_mini.z.union([
|
|
264
|
+
var FeatureValueSchema = import_mini.z.union([
|
|
265
|
+
import_mini.z.boolean(),
|
|
266
|
+
FeatureOptionsSchema,
|
|
267
|
+
GitignoreDestinationSchema
|
|
268
|
+
]);
|
|
264
269
|
var PerFeatureConfigSchema = import_mini.z.record(import_mini.z.string(), FeatureValueSchema);
|
|
265
270
|
var PerTargetFeaturesValueSchema = import_mini.z.union([
|
|
266
271
|
import_mini.z.array(import_mini.z.enum(ALL_FEATURES_WITH_WILDCARD)),
|
|
@@ -335,6 +340,7 @@ function hasControlCharacters(value) {
|
|
|
335
340
|
}
|
|
336
341
|
|
|
337
342
|
// src/config/config.ts
|
|
343
|
+
var GITIGNORE_DESTINATION_KEY = "gitignoreDestination";
|
|
338
344
|
var SourceEntrySchema = import_mini3.z.object({
|
|
339
345
|
source: import_mini3.z.string().check((0, import_mini3.minLength)(1, "source must be a non-empty string")),
|
|
340
346
|
skills: (0, import_mini3.optional)(import_mini3.z.array(import_mini3.z.string())),
|
|
@@ -366,6 +372,7 @@ var ConfigParamsSchema = import_mini3.z.object({
|
|
|
366
372
|
simulateSubagents: (0, import_mini3.optional)(import_mini3.z.boolean()),
|
|
367
373
|
simulateSkills: (0, import_mini3.optional)(import_mini3.z.boolean()),
|
|
368
374
|
gitignoreTargetsOnly: (0, import_mini3.optional)(import_mini3.z.boolean()),
|
|
375
|
+
gitignoreDestination: (0, import_mini3.optional)(GitignoreDestinationSchema),
|
|
369
376
|
dryRun: (0, import_mini3.optional)(import_mini3.z.boolean()),
|
|
370
377
|
check: (0, import_mini3.optional)(import_mini3.z.boolean()),
|
|
371
378
|
// Declarative skill sources
|
|
@@ -426,6 +433,7 @@ var Config = class _Config {
|
|
|
426
433
|
simulateSubagents;
|
|
427
434
|
simulateSkills;
|
|
428
435
|
gitignoreTargetsOnly;
|
|
436
|
+
gitignoreDestination;
|
|
429
437
|
dryRun;
|
|
430
438
|
check;
|
|
431
439
|
sources;
|
|
@@ -441,6 +449,7 @@ var Config = class _Config {
|
|
|
441
449
|
simulateSubagents,
|
|
442
450
|
simulateSkills,
|
|
443
451
|
gitignoreTargetsOnly,
|
|
452
|
+
gitignoreDestination,
|
|
444
453
|
dryRun,
|
|
445
454
|
check,
|
|
446
455
|
sources
|
|
@@ -466,6 +475,7 @@ var Config = class _Config {
|
|
|
466
475
|
this.simulateSubagents = simulateSubagents ?? false;
|
|
467
476
|
this.simulateSkills = simulateSkills ?? false;
|
|
468
477
|
this.gitignoreTargetsOnly = gitignoreTargetsOnly ?? true;
|
|
478
|
+
this.gitignoreDestination = gitignoreDestination ?? "gitignore";
|
|
469
479
|
this.dryRun = dryRun ?? false;
|
|
470
480
|
this.check = check ?? false;
|
|
471
481
|
this.sources = sources ?? [];
|
|
@@ -623,6 +633,36 @@ var Config = class _Config {
|
|
|
623
633
|
}
|
|
624
634
|
return void 0;
|
|
625
635
|
}
|
|
636
|
+
getGitignoreDestination(target, feature) {
|
|
637
|
+
const rootLevel = this.gitignoreDestination;
|
|
638
|
+
if (!isRulesyncConfigTargetsObject(this.targets)) {
|
|
639
|
+
return rootLevel;
|
|
640
|
+
}
|
|
641
|
+
const targetValue = this.targets[target];
|
|
642
|
+
if (!targetValue || Array.isArray(targetValue)) {
|
|
643
|
+
return rootLevel;
|
|
644
|
+
}
|
|
645
|
+
const perFeature = targetValue;
|
|
646
|
+
const toolLevel = _Config.parseGitignoreDestination(perFeature[GITIGNORE_DESTINATION_KEY]);
|
|
647
|
+
if (feature) {
|
|
648
|
+
const featureValue = perFeature[feature];
|
|
649
|
+
if (featureValue && typeof featureValue === "object" && !Array.isArray(featureValue)) {
|
|
650
|
+
const featureLevel = _Config.parseGitignoreDestination(
|
|
651
|
+
featureValue[GITIGNORE_DESTINATION_KEY]
|
|
652
|
+
);
|
|
653
|
+
if (featureLevel) {
|
|
654
|
+
return featureLevel;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return toolLevel ?? rootLevel;
|
|
659
|
+
}
|
|
660
|
+
static parseGitignoreDestination(value) {
|
|
661
|
+
if (value === "gitignore" || value === "gitattributes") {
|
|
662
|
+
return value;
|
|
663
|
+
}
|
|
664
|
+
return void 0;
|
|
665
|
+
}
|
|
626
666
|
/**
|
|
627
667
|
* Check if per-target features configuration is being used.
|
|
628
668
|
*/
|
|
@@ -703,6 +743,7 @@ var getDefaults = () => ({
|
|
|
703
743
|
simulateSubagents: false,
|
|
704
744
|
simulateSkills: false,
|
|
705
745
|
gitignoreTargetsOnly: true,
|
|
746
|
+
gitignoreDestination: "gitignore",
|
|
706
747
|
dryRun: false,
|
|
707
748
|
check: false,
|
|
708
749
|
sources: []
|
|
@@ -734,6 +775,7 @@ var mergeConfigs = (baseConfig, localConfig) => {
|
|
|
734
775
|
simulateSubagents: localConfig.simulateSubagents ?? baseConfig.simulateSubagents,
|
|
735
776
|
simulateSkills: localConfig.simulateSkills ?? baseConfig.simulateSkills,
|
|
736
777
|
gitignoreTargetsOnly: localConfig.gitignoreTargetsOnly ?? baseConfig.gitignoreTargetsOnly,
|
|
778
|
+
gitignoreDestination: localConfig.gitignoreDestination ?? baseConfig.gitignoreDestination,
|
|
737
779
|
dryRun: localConfig.dryRun ?? baseConfig.dryRun,
|
|
738
780
|
check: localConfig.check ?? baseConfig.check,
|
|
739
781
|
sources: localConfig.sources ?? baseConfig.sources
|
|
@@ -754,7 +796,8 @@ var ConfigResolver = class {
|
|
|
754
796
|
simulateSkills,
|
|
755
797
|
gitignoreTargetsOnly,
|
|
756
798
|
dryRun,
|
|
757
|
-
check
|
|
799
|
+
check,
|
|
800
|
+
gitignoreDestination
|
|
758
801
|
}) {
|
|
759
802
|
const validatedConfigPath = resolvePath(configPath, process.cwd());
|
|
760
803
|
const baseConfig = await loadConfigFromFile(validatedConfigPath);
|
|
@@ -803,6 +846,7 @@ var ConfigResolver = class {
|
|
|
803
846
|
simulateSubagents: resolvedSimulateSubagents,
|
|
804
847
|
simulateSkills: resolvedSimulateSkills,
|
|
805
848
|
gitignoreTargetsOnly: resolvedGitignoreTargetsOnly,
|
|
849
|
+
gitignoreDestination: gitignoreDestination ?? configByFile.gitignoreDestination ?? getDefaults().gitignoreDestination,
|
|
806
850
|
dryRun: dryRun ?? configByFile.dryRun ?? getDefaults().dryRun,
|
|
807
851
|
check: check ?? configByFile.check ?? getDefaults().check,
|
|
808
852
|
sources: configByFile.sources ?? getDefaults().sources
|
|
@@ -825,7 +869,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
825
869
|
}
|
|
826
870
|
|
|
827
871
|
// src/lib/generate.ts
|
|
828
|
-
var
|
|
872
|
+
var import_node_path141 = require("path");
|
|
829
873
|
var import_es_toolkit5 = require("es-toolkit");
|
|
830
874
|
|
|
831
875
|
// src/features/commands/commands-processor.ts
|
|
@@ -10376,9 +10420,9 @@ var PermissionsProcessor = class extends FeatureProcessor {
|
|
|
10376
10420
|
};
|
|
10377
10421
|
|
|
10378
10422
|
// src/features/rules/rules-processor.ts
|
|
10379
|
-
var
|
|
10423
|
+
var import_node_path140 = require("path");
|
|
10380
10424
|
var import_toon = require("@toon-format/toon");
|
|
10381
|
-
var
|
|
10425
|
+
var import_mini72 = require("zod/mini");
|
|
10382
10426
|
|
|
10383
10427
|
// src/constants/general.ts
|
|
10384
10428
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -11166,8 +11210,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
|
|
|
11166
11210
|
};
|
|
11167
11211
|
|
|
11168
11212
|
// src/features/skills/skills-processor.ts
|
|
11169
|
-
var
|
|
11170
|
-
var
|
|
11213
|
+
var import_node_path95 = require("path");
|
|
11214
|
+
var import_mini52 = require("zod/mini");
|
|
11171
11215
|
|
|
11172
11216
|
// src/types/dir-feature-processor.ts
|
|
11173
11217
|
var import_node_path77 = require("path");
|
|
@@ -13807,6 +13851,166 @@ async function getLocalSkillDirNames(baseDir) {
|
|
|
13807
13851
|
return names;
|
|
13808
13852
|
}
|
|
13809
13853
|
|
|
13854
|
+
// src/features/skills/windsurf-skill.ts
|
|
13855
|
+
var import_node_path94 = require("path");
|
|
13856
|
+
var import_mini51 = require("zod/mini");
|
|
13857
|
+
var WindsurfSkillFrontmatterSchema = import_mini51.z.looseObject({
|
|
13858
|
+
name: import_mini51.z.string(),
|
|
13859
|
+
description: import_mini51.z.string()
|
|
13860
|
+
});
|
|
13861
|
+
var WindsurfSkill = class _WindsurfSkill extends ToolSkill {
|
|
13862
|
+
constructor({
|
|
13863
|
+
baseDir = process.cwd(),
|
|
13864
|
+
relativeDirPath = _WindsurfSkill.getSettablePaths().relativeDirPath,
|
|
13865
|
+
dirName,
|
|
13866
|
+
frontmatter,
|
|
13867
|
+
body,
|
|
13868
|
+
otherFiles = [],
|
|
13869
|
+
validate = true,
|
|
13870
|
+
global = false
|
|
13871
|
+
}) {
|
|
13872
|
+
super({
|
|
13873
|
+
baseDir,
|
|
13874
|
+
relativeDirPath,
|
|
13875
|
+
dirName,
|
|
13876
|
+
mainFile: {
|
|
13877
|
+
name: SKILL_FILE_NAME,
|
|
13878
|
+
body,
|
|
13879
|
+
frontmatter: { ...frontmatter }
|
|
13880
|
+
},
|
|
13881
|
+
otherFiles,
|
|
13882
|
+
global
|
|
13883
|
+
});
|
|
13884
|
+
if (validate) {
|
|
13885
|
+
const result = this.validate();
|
|
13886
|
+
if (!result.success) {
|
|
13887
|
+
throw result.error;
|
|
13888
|
+
}
|
|
13889
|
+
}
|
|
13890
|
+
}
|
|
13891
|
+
static getSettablePaths({ global = false } = {}) {
|
|
13892
|
+
if (global) {
|
|
13893
|
+
return {
|
|
13894
|
+
relativeDirPath: (0, import_node_path94.join)(".codeium", "windsurf", "skills")
|
|
13895
|
+
};
|
|
13896
|
+
}
|
|
13897
|
+
return {
|
|
13898
|
+
relativeDirPath: (0, import_node_path94.join)(".windsurf", "skills")
|
|
13899
|
+
};
|
|
13900
|
+
}
|
|
13901
|
+
getFrontmatter() {
|
|
13902
|
+
const result = WindsurfSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
|
|
13903
|
+
return result;
|
|
13904
|
+
}
|
|
13905
|
+
getBody() {
|
|
13906
|
+
return this.mainFile?.body ?? "";
|
|
13907
|
+
}
|
|
13908
|
+
validate() {
|
|
13909
|
+
if (!this.mainFile) {
|
|
13910
|
+
return {
|
|
13911
|
+
success: false,
|
|
13912
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
13913
|
+
};
|
|
13914
|
+
}
|
|
13915
|
+
const result = WindsurfSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
13916
|
+
if (!result.success) {
|
|
13917
|
+
return {
|
|
13918
|
+
success: false,
|
|
13919
|
+
error: new Error(
|
|
13920
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
13921
|
+
)
|
|
13922
|
+
};
|
|
13923
|
+
}
|
|
13924
|
+
return { success: true, error: null };
|
|
13925
|
+
}
|
|
13926
|
+
toRulesyncSkill() {
|
|
13927
|
+
const frontmatter = this.getFrontmatter();
|
|
13928
|
+
const rulesyncFrontmatter = {
|
|
13929
|
+
name: frontmatter.name,
|
|
13930
|
+
description: frontmatter.description,
|
|
13931
|
+
targets: ["*"]
|
|
13932
|
+
};
|
|
13933
|
+
return new RulesyncSkill({
|
|
13934
|
+
baseDir: this.baseDir,
|
|
13935
|
+
relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
|
|
13936
|
+
dirName: this.getDirName(),
|
|
13937
|
+
frontmatter: rulesyncFrontmatter,
|
|
13938
|
+
body: this.getBody(),
|
|
13939
|
+
otherFiles: this.getOtherFiles(),
|
|
13940
|
+
validate: true,
|
|
13941
|
+
global: this.global
|
|
13942
|
+
});
|
|
13943
|
+
}
|
|
13944
|
+
static fromRulesyncSkill({
|
|
13945
|
+
baseDir = process.cwd(),
|
|
13946
|
+
rulesyncSkill,
|
|
13947
|
+
validate = true,
|
|
13948
|
+
global = false
|
|
13949
|
+
}) {
|
|
13950
|
+
const settablePaths = _WindsurfSkill.getSettablePaths({ global });
|
|
13951
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
13952
|
+
const windsurfFrontmatter = {
|
|
13953
|
+
name: rulesyncFrontmatter.name,
|
|
13954
|
+
description: rulesyncFrontmatter.description
|
|
13955
|
+
};
|
|
13956
|
+
return new _WindsurfSkill({
|
|
13957
|
+
baseDir,
|
|
13958
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
13959
|
+
dirName: rulesyncSkill.getDirName(),
|
|
13960
|
+
frontmatter: windsurfFrontmatter,
|
|
13961
|
+
body: rulesyncSkill.getBody(),
|
|
13962
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
13963
|
+
validate,
|
|
13964
|
+
global
|
|
13965
|
+
});
|
|
13966
|
+
}
|
|
13967
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
13968
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
13969
|
+
return targets.includes("*") || targets.includes("windsurf");
|
|
13970
|
+
}
|
|
13971
|
+
static async fromDir(params) {
|
|
13972
|
+
const loaded = await this.loadSkillDirContent({
|
|
13973
|
+
...params,
|
|
13974
|
+
getSettablePaths: _WindsurfSkill.getSettablePaths
|
|
13975
|
+
});
|
|
13976
|
+
const result = WindsurfSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
13977
|
+
if (!result.success) {
|
|
13978
|
+
const skillDirPath = (0, import_node_path94.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
13979
|
+
throw new Error(
|
|
13980
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
13981
|
+
);
|
|
13982
|
+
}
|
|
13983
|
+
return new _WindsurfSkill({
|
|
13984
|
+
baseDir: loaded.baseDir,
|
|
13985
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
13986
|
+
dirName: loaded.dirName,
|
|
13987
|
+
frontmatter: result.data,
|
|
13988
|
+
body: loaded.body,
|
|
13989
|
+
otherFiles: loaded.otherFiles,
|
|
13990
|
+
validate: true,
|
|
13991
|
+
global: loaded.global
|
|
13992
|
+
});
|
|
13993
|
+
}
|
|
13994
|
+
static forDeletion({
|
|
13995
|
+
baseDir = process.cwd(),
|
|
13996
|
+
relativeDirPath,
|
|
13997
|
+
dirName,
|
|
13998
|
+
global = false
|
|
13999
|
+
}) {
|
|
14000
|
+
const settablePaths = _WindsurfSkill.getSettablePaths({ global });
|
|
14001
|
+
return new _WindsurfSkill({
|
|
14002
|
+
baseDir,
|
|
14003
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
14004
|
+
dirName,
|
|
14005
|
+
frontmatter: { name: "", description: "" },
|
|
14006
|
+
body: "",
|
|
14007
|
+
otherFiles: [],
|
|
14008
|
+
validate: false,
|
|
14009
|
+
global
|
|
14010
|
+
});
|
|
14011
|
+
}
|
|
14012
|
+
};
|
|
14013
|
+
|
|
13810
14014
|
// src/features/skills/skills-processor.ts
|
|
13811
14015
|
var skillsProcessorToolTargetTuple = [
|
|
13812
14016
|
"agentsmd",
|
|
@@ -13827,9 +14031,10 @@ var skillsProcessorToolTargetTuple = [
|
|
|
13827
14031
|
"opencode",
|
|
13828
14032
|
"replit",
|
|
13829
14033
|
"roo",
|
|
13830
|
-
"rovodev"
|
|
14034
|
+
"rovodev",
|
|
14035
|
+
"windsurf"
|
|
13831
14036
|
];
|
|
13832
|
-
var SkillsProcessorToolTargetSchema =
|
|
14037
|
+
var SkillsProcessorToolTargetSchema = import_mini52.z.enum(skillsProcessorToolTargetTuple);
|
|
13833
14038
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
13834
14039
|
[
|
|
13835
14040
|
"agentsmd",
|
|
@@ -13963,6 +14168,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
13963
14168
|
class: RovodevSkill,
|
|
13964
14169
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
13965
14170
|
}
|
|
14171
|
+
],
|
|
14172
|
+
[
|
|
14173
|
+
"windsurf",
|
|
14174
|
+
{
|
|
14175
|
+
class: WindsurfSkill,
|
|
14176
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
14177
|
+
}
|
|
13966
14178
|
]
|
|
13967
14179
|
]);
|
|
13968
14180
|
var defaultGetFactory4 = (target) => {
|
|
@@ -14053,11 +14265,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14053
14265
|
)
|
|
14054
14266
|
);
|
|
14055
14267
|
const localSkillNames = new Set(localDirNames);
|
|
14056
|
-
const curatedDirPath = (0,
|
|
14268
|
+
const curatedDirPath = (0, import_node_path95.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
|
|
14057
14269
|
let curatedSkills = [];
|
|
14058
14270
|
if (await directoryExists(curatedDirPath)) {
|
|
14059
|
-
const curatedDirPaths = await findFilesByGlobs((0,
|
|
14060
|
-
const curatedDirNames = curatedDirPaths.map((path3) => (0,
|
|
14271
|
+
const curatedDirPaths = await findFilesByGlobs((0, import_node_path95.join)(curatedDirPath, "*"), { type: "dir" });
|
|
14272
|
+
const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path95.basename)(path3));
|
|
14061
14273
|
const nonConflicting = curatedDirNames.filter((name) => {
|
|
14062
14274
|
if (localSkillNames.has(name)) {
|
|
14063
14275
|
this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
|
|
@@ -14094,13 +14306,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14094
14306
|
const seenDirNames = /* @__PURE__ */ new Set();
|
|
14095
14307
|
const loadEntries = [];
|
|
14096
14308
|
for (const root of roots) {
|
|
14097
|
-
const skillsDirPath = (0,
|
|
14309
|
+
const skillsDirPath = (0, import_node_path95.join)(this.baseDir, root);
|
|
14098
14310
|
if (!await directoryExists(skillsDirPath)) {
|
|
14099
14311
|
continue;
|
|
14100
14312
|
}
|
|
14101
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14313
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path95.join)(skillsDirPath, "*"), { type: "dir" });
|
|
14102
14314
|
for (const dirPath of dirPaths) {
|
|
14103
|
-
const dirName = (0,
|
|
14315
|
+
const dirName = (0, import_node_path95.basename)(dirPath);
|
|
14104
14316
|
if (seenDirNames.has(dirName)) {
|
|
14105
14317
|
continue;
|
|
14106
14318
|
}
|
|
@@ -14129,13 +14341,13 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14129
14341
|
const roots = toolSkillSearchRoots(paths);
|
|
14130
14342
|
const toolSkills = [];
|
|
14131
14343
|
for (const root of roots) {
|
|
14132
|
-
const skillsDirPath = (0,
|
|
14344
|
+
const skillsDirPath = (0, import_node_path95.join)(this.baseDir, root);
|
|
14133
14345
|
if (!await directoryExists(skillsDirPath)) {
|
|
14134
14346
|
continue;
|
|
14135
14347
|
}
|
|
14136
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
14348
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path95.join)(skillsDirPath, "*"), { type: "dir" });
|
|
14137
14349
|
for (const dirPath of dirPaths) {
|
|
14138
|
-
const dirName = (0,
|
|
14350
|
+
const dirName = (0, import_node_path95.basename)(dirPath);
|
|
14139
14351
|
const toolSkill = factory.class.forDeletion({
|
|
14140
14352
|
baseDir: this.baseDir,
|
|
14141
14353
|
relativeDirPath: root,
|
|
@@ -14197,11 +14409,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
14197
14409
|
};
|
|
14198
14410
|
|
|
14199
14411
|
// src/features/subagents/agentsmd-subagent.ts
|
|
14200
|
-
var
|
|
14412
|
+
var import_node_path97 = require("path");
|
|
14201
14413
|
|
|
14202
14414
|
// src/features/subagents/simulated-subagent.ts
|
|
14203
|
-
var
|
|
14204
|
-
var
|
|
14415
|
+
var import_node_path96 = require("path");
|
|
14416
|
+
var import_mini53 = require("zod/mini");
|
|
14205
14417
|
|
|
14206
14418
|
// src/features/subagents/tool-subagent.ts
|
|
14207
14419
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -14253,9 +14465,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
14253
14465
|
};
|
|
14254
14466
|
|
|
14255
14467
|
// src/features/subagents/simulated-subagent.ts
|
|
14256
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
14257
|
-
name:
|
|
14258
|
-
description:
|
|
14468
|
+
var SimulatedSubagentFrontmatterSchema = import_mini53.z.object({
|
|
14469
|
+
name: import_mini53.z.string(),
|
|
14470
|
+
description: import_mini53.z.optional(import_mini53.z.string())
|
|
14259
14471
|
});
|
|
14260
14472
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
14261
14473
|
frontmatter;
|
|
@@ -14265,7 +14477,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14265
14477
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14266
14478
|
if (!result.success) {
|
|
14267
14479
|
throw new Error(
|
|
14268
|
-
`Invalid frontmatter in ${(0,
|
|
14480
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14269
14481
|
);
|
|
14270
14482
|
}
|
|
14271
14483
|
}
|
|
@@ -14316,7 +14528,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14316
14528
|
return {
|
|
14317
14529
|
success: false,
|
|
14318
14530
|
error: new Error(
|
|
14319
|
-
`Invalid frontmatter in ${(0,
|
|
14531
|
+
`Invalid frontmatter in ${(0, import_node_path96.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14320
14532
|
)
|
|
14321
14533
|
};
|
|
14322
14534
|
}
|
|
@@ -14326,7 +14538,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14326
14538
|
relativeFilePath,
|
|
14327
14539
|
validate = true
|
|
14328
14540
|
}) {
|
|
14329
|
-
const filePath = (0,
|
|
14541
|
+
const filePath = (0, import_node_path96.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
14330
14542
|
const fileContent = await readFileContent(filePath);
|
|
14331
14543
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14332
14544
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14336,7 +14548,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14336
14548
|
return {
|
|
14337
14549
|
baseDir,
|
|
14338
14550
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
14339
|
-
relativeFilePath: (0,
|
|
14551
|
+
relativeFilePath: (0, import_node_path96.basename)(relativeFilePath),
|
|
14340
14552
|
frontmatter: result.data,
|
|
14341
14553
|
body: content.trim(),
|
|
14342
14554
|
validate
|
|
@@ -14362,7 +14574,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
14362
14574
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
14363
14575
|
static getSettablePaths() {
|
|
14364
14576
|
return {
|
|
14365
|
-
relativeDirPath: (0,
|
|
14577
|
+
relativeDirPath: (0, import_node_path97.join)(".agents", "subagents")
|
|
14366
14578
|
};
|
|
14367
14579
|
}
|
|
14368
14580
|
static async fromFile(params) {
|
|
@@ -14385,11 +14597,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
14385
14597
|
};
|
|
14386
14598
|
|
|
14387
14599
|
// src/features/subagents/factorydroid-subagent.ts
|
|
14388
|
-
var
|
|
14600
|
+
var import_node_path98 = require("path");
|
|
14389
14601
|
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
14390
14602
|
static getSettablePaths(_options) {
|
|
14391
14603
|
return {
|
|
14392
|
-
relativeDirPath: (0,
|
|
14604
|
+
relativeDirPath: (0, import_node_path98.join)(".factory", "droids")
|
|
14393
14605
|
};
|
|
14394
14606
|
}
|
|
14395
14607
|
static async fromFile(params) {
|
|
@@ -14412,16 +14624,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
|
|
|
14412
14624
|
};
|
|
14413
14625
|
|
|
14414
14626
|
// src/features/subagents/geminicli-subagent.ts
|
|
14415
|
-
var
|
|
14416
|
-
var
|
|
14627
|
+
var import_node_path100 = require("path");
|
|
14628
|
+
var import_mini55 = require("zod/mini");
|
|
14417
14629
|
|
|
14418
14630
|
// src/features/subagents/rulesync-subagent.ts
|
|
14419
|
-
var
|
|
14420
|
-
var
|
|
14421
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
14422
|
-
targets:
|
|
14423
|
-
name:
|
|
14424
|
-
description:
|
|
14631
|
+
var import_node_path99 = require("path");
|
|
14632
|
+
var import_mini54 = require("zod/mini");
|
|
14633
|
+
var RulesyncSubagentFrontmatterSchema = import_mini54.z.looseObject({
|
|
14634
|
+
targets: import_mini54.z._default(RulesyncTargetsSchema, ["*"]),
|
|
14635
|
+
name: import_mini54.z.string(),
|
|
14636
|
+
description: import_mini54.z.optional(import_mini54.z.string())
|
|
14425
14637
|
});
|
|
14426
14638
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
14427
14639
|
frontmatter;
|
|
@@ -14430,7 +14642,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14430
14642
|
const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14431
14643
|
if (!parseResult.success && rest.validate !== false) {
|
|
14432
14644
|
throw new Error(
|
|
14433
|
-
`Invalid frontmatter in ${(0,
|
|
14645
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
14434
14646
|
);
|
|
14435
14647
|
}
|
|
14436
14648
|
const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
|
|
@@ -14463,7 +14675,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14463
14675
|
return {
|
|
14464
14676
|
success: false,
|
|
14465
14677
|
error: new Error(
|
|
14466
|
-
`Invalid frontmatter in ${(0,
|
|
14678
|
+
`Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14467
14679
|
)
|
|
14468
14680
|
};
|
|
14469
14681
|
}
|
|
@@ -14471,14 +14683,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14471
14683
|
static async fromFile({
|
|
14472
14684
|
relativeFilePath
|
|
14473
14685
|
}) {
|
|
14474
|
-
const filePath = (0,
|
|
14686
|
+
const filePath = (0, import_node_path99.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
|
|
14475
14687
|
const fileContent = await readFileContent(filePath);
|
|
14476
14688
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14477
14689
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14478
14690
|
if (!result.success) {
|
|
14479
14691
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
14480
14692
|
}
|
|
14481
|
-
const filename = (0,
|
|
14693
|
+
const filename = (0, import_node_path99.basename)(relativeFilePath);
|
|
14482
14694
|
return new _RulesyncSubagent({
|
|
14483
14695
|
baseDir: process.cwd(),
|
|
14484
14696
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -14490,9 +14702,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
14490
14702
|
};
|
|
14491
14703
|
|
|
14492
14704
|
// src/features/subagents/geminicli-subagent.ts
|
|
14493
|
-
var GeminiCliSubagentFrontmatterSchema =
|
|
14494
|
-
name:
|
|
14495
|
-
description:
|
|
14705
|
+
var GeminiCliSubagentFrontmatterSchema = import_mini55.z.looseObject({
|
|
14706
|
+
name: import_mini55.z.string(),
|
|
14707
|
+
description: import_mini55.z.optional(import_mini55.z.string())
|
|
14496
14708
|
});
|
|
14497
14709
|
var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
14498
14710
|
frontmatter;
|
|
@@ -14502,7 +14714,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14502
14714
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14503
14715
|
if (!result.success) {
|
|
14504
14716
|
throw new Error(
|
|
14505
|
-
`Invalid frontmatter in ${(0,
|
|
14717
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14506
14718
|
);
|
|
14507
14719
|
}
|
|
14508
14720
|
}
|
|
@@ -14515,7 +14727,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14515
14727
|
}
|
|
14516
14728
|
static getSettablePaths(_options = {}) {
|
|
14517
14729
|
return {
|
|
14518
|
-
relativeDirPath: (0,
|
|
14730
|
+
relativeDirPath: (0, import_node_path100.join)(".gemini", "agents")
|
|
14519
14731
|
};
|
|
14520
14732
|
}
|
|
14521
14733
|
getFrontmatter() {
|
|
@@ -14583,7 +14795,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14583
14795
|
return {
|
|
14584
14796
|
success: false,
|
|
14585
14797
|
error: new Error(
|
|
14586
|
-
`Invalid frontmatter in ${(0,
|
|
14798
|
+
`Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14587
14799
|
)
|
|
14588
14800
|
};
|
|
14589
14801
|
}
|
|
@@ -14601,7 +14813,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14601
14813
|
global = false
|
|
14602
14814
|
}) {
|
|
14603
14815
|
const paths = this.getSettablePaths({ global });
|
|
14604
|
-
const filePath = (0,
|
|
14816
|
+
const filePath = (0, import_node_path100.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14605
14817
|
const fileContent = await readFileContent(filePath);
|
|
14606
14818
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14607
14819
|
const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14637,11 +14849,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
|
|
|
14637
14849
|
};
|
|
14638
14850
|
|
|
14639
14851
|
// src/features/subagents/roo-subagent.ts
|
|
14640
|
-
var
|
|
14852
|
+
var import_node_path101 = require("path");
|
|
14641
14853
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
14642
14854
|
static getSettablePaths() {
|
|
14643
14855
|
return {
|
|
14644
|
-
relativeDirPath: (0,
|
|
14856
|
+
relativeDirPath: (0, import_node_path101.join)(".roo", "subagents")
|
|
14645
14857
|
};
|
|
14646
14858
|
}
|
|
14647
14859
|
static async fromFile(params) {
|
|
@@ -14664,11 +14876,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
14664
14876
|
};
|
|
14665
14877
|
|
|
14666
14878
|
// src/features/subagents/rovodev-subagent.ts
|
|
14667
|
-
var
|
|
14668
|
-
var
|
|
14669
|
-
var RovodevSubagentFrontmatterSchema =
|
|
14670
|
-
name:
|
|
14671
|
-
description:
|
|
14879
|
+
var import_node_path102 = require("path");
|
|
14880
|
+
var import_mini56 = require("zod/mini");
|
|
14881
|
+
var RovodevSubagentFrontmatterSchema = import_mini56.z.looseObject({
|
|
14882
|
+
name: import_mini56.z.string(),
|
|
14883
|
+
description: import_mini56.z.optional(import_mini56.z.string())
|
|
14672
14884
|
});
|
|
14673
14885
|
var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
14674
14886
|
frontmatter;
|
|
@@ -14678,7 +14890,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14678
14890
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14679
14891
|
if (!result.success) {
|
|
14680
14892
|
throw new Error(
|
|
14681
|
-
`Invalid frontmatter in ${(0,
|
|
14893
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14682
14894
|
);
|
|
14683
14895
|
}
|
|
14684
14896
|
}
|
|
@@ -14690,7 +14902,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14690
14902
|
}
|
|
14691
14903
|
static getSettablePaths(_options = {}) {
|
|
14692
14904
|
return {
|
|
14693
|
-
relativeDirPath: (0,
|
|
14905
|
+
relativeDirPath: (0, import_node_path102.join)(".rovodev", "subagents")
|
|
14694
14906
|
};
|
|
14695
14907
|
}
|
|
14696
14908
|
getFrontmatter() {
|
|
@@ -14753,7 +14965,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14753
14965
|
return {
|
|
14754
14966
|
success: false,
|
|
14755
14967
|
error: new Error(
|
|
14756
|
-
`Invalid frontmatter in ${(0,
|
|
14968
|
+
`Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14757
14969
|
)
|
|
14758
14970
|
};
|
|
14759
14971
|
}
|
|
@@ -14770,7 +14982,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14770
14982
|
global = false
|
|
14771
14983
|
}) {
|
|
14772
14984
|
const paths = this.getSettablePaths({ global });
|
|
14773
|
-
const filePath = (0,
|
|
14985
|
+
const filePath = (0, import_node_path102.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14774
14986
|
const fileContent = await readFileContent(filePath);
|
|
14775
14987
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14776
14988
|
const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14809,19 +15021,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
|
|
|
14809
15021
|
};
|
|
14810
15022
|
|
|
14811
15023
|
// src/features/subagents/subagents-processor.ts
|
|
14812
|
-
var
|
|
14813
|
-
var
|
|
15024
|
+
var import_node_path113 = require("path");
|
|
15025
|
+
var import_mini65 = require("zod/mini");
|
|
14814
15026
|
|
|
14815
15027
|
// src/features/subagents/claudecode-subagent.ts
|
|
14816
|
-
var
|
|
14817
|
-
var
|
|
14818
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
14819
|
-
name:
|
|
14820
|
-
description:
|
|
14821
|
-
model:
|
|
14822
|
-
tools:
|
|
14823
|
-
permissionMode:
|
|
14824
|
-
skills:
|
|
15028
|
+
var import_node_path103 = require("path");
|
|
15029
|
+
var import_mini57 = require("zod/mini");
|
|
15030
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini57.z.looseObject({
|
|
15031
|
+
name: import_mini57.z.string(),
|
|
15032
|
+
description: import_mini57.z.optional(import_mini57.z.string()),
|
|
15033
|
+
model: import_mini57.z.optional(import_mini57.z.string()),
|
|
15034
|
+
tools: import_mini57.z.optional(import_mini57.z.union([import_mini57.z.string(), import_mini57.z.array(import_mini57.z.string())])),
|
|
15035
|
+
permissionMode: import_mini57.z.optional(import_mini57.z.string()),
|
|
15036
|
+
skills: import_mini57.z.optional(import_mini57.z.union([import_mini57.z.string(), import_mini57.z.array(import_mini57.z.string())]))
|
|
14825
15037
|
});
|
|
14826
15038
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
14827
15039
|
frontmatter;
|
|
@@ -14831,7 +15043,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14831
15043
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
14832
15044
|
if (!result.success) {
|
|
14833
15045
|
throw new Error(
|
|
14834
|
-
`Invalid frontmatter in ${(0,
|
|
15046
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
14835
15047
|
);
|
|
14836
15048
|
}
|
|
14837
15049
|
}
|
|
@@ -14843,7 +15055,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14843
15055
|
}
|
|
14844
15056
|
static getSettablePaths(_options = {}) {
|
|
14845
15057
|
return {
|
|
14846
|
-
relativeDirPath: (0,
|
|
15058
|
+
relativeDirPath: (0, import_node_path103.join)(".claude", "agents")
|
|
14847
15059
|
};
|
|
14848
15060
|
}
|
|
14849
15061
|
getFrontmatter() {
|
|
@@ -14922,7 +15134,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14922
15134
|
return {
|
|
14923
15135
|
success: false,
|
|
14924
15136
|
error: new Error(
|
|
14925
|
-
`Invalid frontmatter in ${(0,
|
|
15137
|
+
`Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
14926
15138
|
)
|
|
14927
15139
|
};
|
|
14928
15140
|
}
|
|
@@ -14940,7 +15152,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14940
15152
|
global = false
|
|
14941
15153
|
}) {
|
|
14942
15154
|
const paths = this.getSettablePaths({ global });
|
|
14943
|
-
const filePath = (0,
|
|
15155
|
+
const filePath = (0, import_node_path103.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
14944
15156
|
const fileContent = await readFileContent(filePath);
|
|
14945
15157
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
14946
15158
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -14975,17 +15187,28 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
14975
15187
|
};
|
|
14976
15188
|
|
|
14977
15189
|
// src/features/subagents/codexcli-subagent.ts
|
|
14978
|
-
var
|
|
15190
|
+
var import_node_path104 = require("path");
|
|
14979
15191
|
var smolToml5 = __toESM(require("smol-toml"), 1);
|
|
14980
|
-
var
|
|
14981
|
-
var CodexCliSubagentTomlSchema =
|
|
14982
|
-
name:
|
|
14983
|
-
description:
|
|
14984
|
-
developer_instructions:
|
|
14985
|
-
model:
|
|
14986
|
-
model_reasoning_effort:
|
|
14987
|
-
sandbox_mode:
|
|
15192
|
+
var import_mini58 = require("zod/mini");
|
|
15193
|
+
var CodexCliSubagentTomlSchema = import_mini58.z.looseObject({
|
|
15194
|
+
name: import_mini58.z.string(),
|
|
15195
|
+
description: import_mini58.z.optional(import_mini58.z.string()),
|
|
15196
|
+
developer_instructions: import_mini58.z.optional(import_mini58.z.string()),
|
|
15197
|
+
model: import_mini58.z.optional(import_mini58.z.string()),
|
|
15198
|
+
model_reasoning_effort: import_mini58.z.optional(import_mini58.z.string()),
|
|
15199
|
+
sandbox_mode: import_mini58.z.optional(import_mini58.z.string())
|
|
14988
15200
|
});
|
|
15201
|
+
function stringifyCodexCliSubagentToml(tomlObj) {
|
|
15202
|
+
const { developer_instructions, ...restFields } = tomlObj;
|
|
15203
|
+
const restToml = smolToml5.stringify(restFields).trimEnd();
|
|
15204
|
+
if (developer_instructions === void 0) {
|
|
15205
|
+
return restToml;
|
|
15206
|
+
}
|
|
15207
|
+
const developerInstructionsToml = developer_instructions.includes("\n") ? developer_instructions.includes("'''") ? smolToml5.stringify({ developer_instructions }).trimEnd() : `developer_instructions = '''
|
|
15208
|
+
${developer_instructions}
|
|
15209
|
+
'''` : smolToml5.stringify({ developer_instructions }).trimEnd();
|
|
15210
|
+
return [restToml, developerInstructionsToml].filter((value) => value.length > 0).join("\n");
|
|
15211
|
+
}
|
|
14989
15212
|
var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
14990
15213
|
body;
|
|
14991
15214
|
constructor({ body, ...rest }) {
|
|
@@ -14995,7 +15218,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
14995
15218
|
CodexCliSubagentTomlSchema.parse(parsed);
|
|
14996
15219
|
} catch (error) {
|
|
14997
15220
|
throw new Error(
|
|
14998
|
-
`Invalid TOML in ${(0,
|
|
15221
|
+
`Invalid TOML in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
14999
15222
|
{ cause: error }
|
|
15000
15223
|
);
|
|
15001
15224
|
}
|
|
@@ -15007,7 +15230,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15007
15230
|
}
|
|
15008
15231
|
static getSettablePaths(_options = {}) {
|
|
15009
15232
|
return {
|
|
15010
|
-
relativeDirPath: (0,
|
|
15233
|
+
relativeDirPath: (0, import_node_path104.join)(".codex", "agents")
|
|
15011
15234
|
};
|
|
15012
15235
|
}
|
|
15013
15236
|
getBody() {
|
|
@@ -15019,7 +15242,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15019
15242
|
parsed = CodexCliSubagentTomlSchema.parse(smolToml5.parse(this.body));
|
|
15020
15243
|
} catch (error) {
|
|
15021
15244
|
throw new Error(
|
|
15022
|
-
`Failed to parse TOML in ${(0,
|
|
15245
|
+
`Failed to parse TOML in ${(0, import_node_path104.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15023
15246
|
{ cause: error }
|
|
15024
15247
|
);
|
|
15025
15248
|
}
|
|
@@ -15062,7 +15285,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15062
15285
|
...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
|
|
15063
15286
|
...codexcliSection
|
|
15064
15287
|
};
|
|
15065
|
-
const body =
|
|
15288
|
+
const body = stringifyCodexCliSubagentToml(tomlObj);
|
|
15066
15289
|
const paths = this.getSettablePaths({ global });
|
|
15067
15290
|
const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
|
|
15068
15291
|
return new _CodexCliSubagent({
|
|
@@ -15100,7 +15323,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15100
15323
|
global = false
|
|
15101
15324
|
}) {
|
|
15102
15325
|
const paths = this.getSettablePaths({ global });
|
|
15103
|
-
const filePath = (0,
|
|
15326
|
+
const filePath = (0, import_node_path104.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15104
15327
|
const fileContent = await readFileContent(filePath);
|
|
15105
15328
|
const subagent = new _CodexCliSubagent({
|
|
15106
15329
|
baseDir,
|
|
@@ -15138,13 +15361,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
|
|
|
15138
15361
|
};
|
|
15139
15362
|
|
|
15140
15363
|
// src/features/subagents/copilot-subagent.ts
|
|
15141
|
-
var
|
|
15142
|
-
var
|
|
15364
|
+
var import_node_path105 = require("path");
|
|
15365
|
+
var import_mini59 = require("zod/mini");
|
|
15143
15366
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
15144
|
-
var CopilotSubagentFrontmatterSchema =
|
|
15145
|
-
name:
|
|
15146
|
-
description:
|
|
15147
|
-
tools:
|
|
15367
|
+
var CopilotSubagentFrontmatterSchema = import_mini59.z.looseObject({
|
|
15368
|
+
name: import_mini59.z.string(),
|
|
15369
|
+
description: import_mini59.z.optional(import_mini59.z.string()),
|
|
15370
|
+
tools: import_mini59.z.optional(import_mini59.z.union([import_mini59.z.string(), import_mini59.z.array(import_mini59.z.string())]))
|
|
15148
15371
|
});
|
|
15149
15372
|
var normalizeTools = (tools) => {
|
|
15150
15373
|
if (!tools) {
|
|
@@ -15164,7 +15387,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15164
15387
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15165
15388
|
if (!result.success) {
|
|
15166
15389
|
throw new Error(
|
|
15167
|
-
`Invalid frontmatter in ${(0,
|
|
15390
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15168
15391
|
);
|
|
15169
15392
|
}
|
|
15170
15393
|
}
|
|
@@ -15176,7 +15399,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15176
15399
|
}
|
|
15177
15400
|
static getSettablePaths(_options = {}) {
|
|
15178
15401
|
return {
|
|
15179
|
-
relativeDirPath: (0,
|
|
15402
|
+
relativeDirPath: (0, import_node_path105.join)(".github", "agents")
|
|
15180
15403
|
};
|
|
15181
15404
|
}
|
|
15182
15405
|
getFrontmatter() {
|
|
@@ -15254,7 +15477,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15254
15477
|
return {
|
|
15255
15478
|
success: false,
|
|
15256
15479
|
error: new Error(
|
|
15257
|
-
`Invalid frontmatter in ${(0,
|
|
15480
|
+
`Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15258
15481
|
)
|
|
15259
15482
|
};
|
|
15260
15483
|
}
|
|
@@ -15272,7 +15495,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15272
15495
|
global = false
|
|
15273
15496
|
}) {
|
|
15274
15497
|
const paths = this.getSettablePaths({ global });
|
|
15275
|
-
const filePath = (0,
|
|
15498
|
+
const filePath = (0, import_node_path105.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15276
15499
|
const fileContent = await readFileContent(filePath);
|
|
15277
15500
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15278
15501
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15308,11 +15531,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
15308
15531
|
};
|
|
15309
15532
|
|
|
15310
15533
|
// src/features/subagents/cursor-subagent.ts
|
|
15311
|
-
var
|
|
15312
|
-
var
|
|
15313
|
-
var CursorSubagentFrontmatterSchema =
|
|
15314
|
-
name:
|
|
15315
|
-
description:
|
|
15534
|
+
var import_node_path106 = require("path");
|
|
15535
|
+
var import_mini60 = require("zod/mini");
|
|
15536
|
+
var CursorSubagentFrontmatterSchema = import_mini60.z.looseObject({
|
|
15537
|
+
name: import_mini60.z.string(),
|
|
15538
|
+
description: import_mini60.z.optional(import_mini60.z.string())
|
|
15316
15539
|
});
|
|
15317
15540
|
var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
15318
15541
|
frontmatter;
|
|
@@ -15322,7 +15545,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15322
15545
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15323
15546
|
if (!result.success) {
|
|
15324
15547
|
throw new Error(
|
|
15325
|
-
`Invalid frontmatter in ${(0,
|
|
15548
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15326
15549
|
);
|
|
15327
15550
|
}
|
|
15328
15551
|
}
|
|
@@ -15334,7 +15557,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15334
15557
|
}
|
|
15335
15558
|
static getSettablePaths(_options = {}) {
|
|
15336
15559
|
return {
|
|
15337
|
-
relativeDirPath: (0,
|
|
15560
|
+
relativeDirPath: (0, import_node_path106.join)(".cursor", "agents")
|
|
15338
15561
|
};
|
|
15339
15562
|
}
|
|
15340
15563
|
getFrontmatter() {
|
|
@@ -15401,7 +15624,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15401
15624
|
return {
|
|
15402
15625
|
success: false,
|
|
15403
15626
|
error: new Error(
|
|
15404
|
-
`Invalid frontmatter in ${(0,
|
|
15627
|
+
`Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15405
15628
|
)
|
|
15406
15629
|
};
|
|
15407
15630
|
}
|
|
@@ -15419,7 +15642,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15419
15642
|
global = false
|
|
15420
15643
|
}) {
|
|
15421
15644
|
const paths = this.getSettablePaths({ global });
|
|
15422
|
-
const filePath = (0,
|
|
15645
|
+
const filePath = (0, import_node_path106.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15423
15646
|
const fileContent = await readFileContent(filePath);
|
|
15424
15647
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15425
15648
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15455,12 +15678,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
15455
15678
|
};
|
|
15456
15679
|
|
|
15457
15680
|
// src/features/subagents/deepagents-subagent.ts
|
|
15458
|
-
var
|
|
15459
|
-
var
|
|
15460
|
-
var DeepagentsSubagentFrontmatterSchema =
|
|
15461
|
-
name:
|
|
15462
|
-
description:
|
|
15463
|
-
model:
|
|
15681
|
+
var import_node_path107 = require("path");
|
|
15682
|
+
var import_mini61 = require("zod/mini");
|
|
15683
|
+
var DeepagentsSubagentFrontmatterSchema = import_mini61.z.looseObject({
|
|
15684
|
+
name: import_mini61.z.string(),
|
|
15685
|
+
description: import_mini61.z.optional(import_mini61.z.string()),
|
|
15686
|
+
model: import_mini61.z.optional(import_mini61.z.string())
|
|
15464
15687
|
});
|
|
15465
15688
|
var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
15466
15689
|
frontmatter;
|
|
@@ -15470,7 +15693,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15470
15693
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15471
15694
|
if (!result.success) {
|
|
15472
15695
|
throw new Error(
|
|
15473
|
-
`Invalid frontmatter in ${(0,
|
|
15696
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15474
15697
|
);
|
|
15475
15698
|
}
|
|
15476
15699
|
}
|
|
@@ -15480,7 +15703,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15480
15703
|
}
|
|
15481
15704
|
static getSettablePaths(_options = {}) {
|
|
15482
15705
|
return {
|
|
15483
|
-
relativeDirPath: (0,
|
|
15706
|
+
relativeDirPath: (0, import_node_path107.join)(".deepagents", "agents")
|
|
15484
15707
|
};
|
|
15485
15708
|
}
|
|
15486
15709
|
getFrontmatter() {
|
|
@@ -15555,7 +15778,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15555
15778
|
return {
|
|
15556
15779
|
success: false,
|
|
15557
15780
|
error: new Error(
|
|
15558
|
-
`Invalid frontmatter in ${(0,
|
|
15781
|
+
`Invalid frontmatter in ${(0, import_node_path107.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15559
15782
|
)
|
|
15560
15783
|
};
|
|
15561
15784
|
}
|
|
@@ -15573,7 +15796,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15573
15796
|
global = false
|
|
15574
15797
|
}) {
|
|
15575
15798
|
const paths = this.getSettablePaths({ global });
|
|
15576
|
-
const filePath = (0,
|
|
15799
|
+
const filePath = (0, import_node_path107.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15577
15800
|
const fileContent = await readFileContent(filePath);
|
|
15578
15801
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15579
15802
|
const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15608,11 +15831,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
|
|
|
15608
15831
|
};
|
|
15609
15832
|
|
|
15610
15833
|
// src/features/subagents/junie-subagent.ts
|
|
15611
|
-
var
|
|
15612
|
-
var
|
|
15613
|
-
var JunieSubagentFrontmatterSchema =
|
|
15614
|
-
name:
|
|
15615
|
-
description:
|
|
15834
|
+
var import_node_path108 = require("path");
|
|
15835
|
+
var import_mini62 = require("zod/mini");
|
|
15836
|
+
var JunieSubagentFrontmatterSchema = import_mini62.z.looseObject({
|
|
15837
|
+
name: import_mini62.z.optional(import_mini62.z.string()),
|
|
15838
|
+
description: import_mini62.z.string()
|
|
15616
15839
|
});
|
|
15617
15840
|
var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
15618
15841
|
frontmatter;
|
|
@@ -15622,7 +15845,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15622
15845
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15623
15846
|
if (!result.success) {
|
|
15624
15847
|
throw new Error(
|
|
15625
|
-
`Invalid frontmatter in ${(0,
|
|
15848
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15626
15849
|
);
|
|
15627
15850
|
}
|
|
15628
15851
|
}
|
|
@@ -15637,7 +15860,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15637
15860
|
throw new Error("JunieSubagent does not support global mode.");
|
|
15638
15861
|
}
|
|
15639
15862
|
return {
|
|
15640
|
-
relativeDirPath: (0,
|
|
15863
|
+
relativeDirPath: (0, import_node_path108.join)(".junie", "agents")
|
|
15641
15864
|
};
|
|
15642
15865
|
}
|
|
15643
15866
|
getFrontmatter() {
|
|
@@ -15713,7 +15936,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15713
15936
|
return {
|
|
15714
15937
|
success: false,
|
|
15715
15938
|
error: new Error(
|
|
15716
|
-
`Invalid frontmatter in ${(0,
|
|
15939
|
+
`Invalid frontmatter in ${(0, import_node_path108.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15717
15940
|
)
|
|
15718
15941
|
};
|
|
15719
15942
|
}
|
|
@@ -15731,7 +15954,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15731
15954
|
global = false
|
|
15732
15955
|
}) {
|
|
15733
15956
|
const paths = this.getSettablePaths({ global });
|
|
15734
|
-
const filePath = (0,
|
|
15957
|
+
const filePath = (0, import_node_path108.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15735
15958
|
const fileContent = await readFileContent(filePath);
|
|
15736
15959
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15737
15960
|
const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15766,15 +15989,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
|
|
|
15766
15989
|
};
|
|
15767
15990
|
|
|
15768
15991
|
// src/features/subagents/kilo-subagent.ts
|
|
15769
|
-
var
|
|
15992
|
+
var import_node_path110 = require("path");
|
|
15770
15993
|
|
|
15771
15994
|
// src/features/subagents/opencode-style-subagent.ts
|
|
15772
|
-
var
|
|
15773
|
-
var
|
|
15774
|
-
var OpenCodeStyleSubagentFrontmatterSchema =
|
|
15775
|
-
description:
|
|
15776
|
-
mode:
|
|
15777
|
-
name:
|
|
15995
|
+
var import_node_path109 = require("path");
|
|
15996
|
+
var import_mini63 = require("zod/mini");
|
|
15997
|
+
var OpenCodeStyleSubagentFrontmatterSchema = import_mini63.z.looseObject({
|
|
15998
|
+
description: import_mini63.z.optional(import_mini63.z.string()),
|
|
15999
|
+
mode: import_mini63.z._default(import_mini63.z.string(), "subagent"),
|
|
16000
|
+
name: import_mini63.z.optional(import_mini63.z.string())
|
|
15778
16001
|
});
|
|
15779
16002
|
var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
15780
16003
|
frontmatter;
|
|
@@ -15784,7 +16007,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15784
16007
|
const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
15785
16008
|
if (!result.success) {
|
|
15786
16009
|
throw new Error(
|
|
15787
|
-
`Invalid frontmatter in ${(0,
|
|
16010
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
15788
16011
|
);
|
|
15789
16012
|
}
|
|
15790
16013
|
}
|
|
@@ -15804,7 +16027,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15804
16027
|
const { description, mode, name, ...toolSection } = this.frontmatter;
|
|
15805
16028
|
const rulesyncFrontmatter = {
|
|
15806
16029
|
targets: ["*"],
|
|
15807
|
-
name: name ?? (0,
|
|
16030
|
+
name: name ?? (0, import_node_path109.basename)(this.getRelativeFilePath(), ".md"),
|
|
15808
16031
|
description,
|
|
15809
16032
|
[this.getToolTarget()]: { mode, ...toolSection }
|
|
15810
16033
|
};
|
|
@@ -15826,7 +16049,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
|
|
|
15826
16049
|
return {
|
|
15827
16050
|
success: false,
|
|
15828
16051
|
error: new Error(
|
|
15829
|
-
`Invalid frontmatter in ${(0,
|
|
16052
|
+
`Invalid frontmatter in ${(0, import_node_path109.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
15830
16053
|
)
|
|
15831
16054
|
};
|
|
15832
16055
|
}
|
|
@@ -15842,7 +16065,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15842
16065
|
global = false
|
|
15843
16066
|
} = {}) {
|
|
15844
16067
|
return {
|
|
15845
|
-
relativeDirPath: global ? (0,
|
|
16068
|
+
relativeDirPath: global ? (0, import_node_path110.join)(".config", "kilo", "agent") : (0, import_node_path110.join)(".kilo", "agent")
|
|
15846
16069
|
};
|
|
15847
16070
|
}
|
|
15848
16071
|
static fromRulesyncSubagent({
|
|
@@ -15886,7 +16109,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15886
16109
|
global = false
|
|
15887
16110
|
}) {
|
|
15888
16111
|
const paths = this.getSettablePaths({ global });
|
|
15889
|
-
const filePath = (0,
|
|
16112
|
+
const filePath = (0, import_node_path110.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
15890
16113
|
const fileContent = await readFileContent(filePath);
|
|
15891
16114
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
15892
16115
|
const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -15922,23 +16145,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
|
|
|
15922
16145
|
};
|
|
15923
16146
|
|
|
15924
16147
|
// src/features/subagents/kiro-subagent.ts
|
|
15925
|
-
var
|
|
15926
|
-
var
|
|
15927
|
-
var KiroCliSubagentJsonSchema =
|
|
15928
|
-
name:
|
|
15929
|
-
description:
|
|
15930
|
-
prompt:
|
|
15931
|
-
tools:
|
|
15932
|
-
toolAliases:
|
|
15933
|
-
toolSettings:
|
|
15934
|
-
toolSchema:
|
|
15935
|
-
hooks:
|
|
15936
|
-
model:
|
|
15937
|
-
mcpServers:
|
|
15938
|
-
useLegacyMcpJson:
|
|
15939
|
-
resources:
|
|
15940
|
-
allowedTools:
|
|
15941
|
-
includeMcpJson:
|
|
16148
|
+
var import_node_path111 = require("path");
|
|
16149
|
+
var import_mini64 = require("zod/mini");
|
|
16150
|
+
var KiroCliSubagentJsonSchema = import_mini64.z.looseObject({
|
|
16151
|
+
name: import_mini64.z.string(),
|
|
16152
|
+
description: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.string())),
|
|
16153
|
+
prompt: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.string())),
|
|
16154
|
+
tools: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.array(import_mini64.z.string()))),
|
|
16155
|
+
toolAliases: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.record(import_mini64.z.string(), import_mini64.z.string()))),
|
|
16156
|
+
toolSettings: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.unknown())),
|
|
16157
|
+
toolSchema: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.unknown())),
|
|
16158
|
+
hooks: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.record(import_mini64.z.string(), import_mini64.z.array(import_mini64.z.unknown())))),
|
|
16159
|
+
model: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.string())),
|
|
16160
|
+
mcpServers: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.record(import_mini64.z.string(), import_mini64.z.unknown()))),
|
|
16161
|
+
useLegacyMcpJson: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.boolean())),
|
|
16162
|
+
resources: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.array(import_mini64.z.string()))),
|
|
16163
|
+
allowedTools: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.array(import_mini64.z.string()))),
|
|
16164
|
+
includeMcpJson: import_mini64.z.optional(import_mini64.z.nullable(import_mini64.z.boolean()))
|
|
15942
16165
|
});
|
|
15943
16166
|
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
15944
16167
|
body;
|
|
@@ -15949,7 +16172,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15949
16172
|
KiroCliSubagentJsonSchema.parse(parsed);
|
|
15950
16173
|
} catch (error) {
|
|
15951
16174
|
throw new Error(
|
|
15952
|
-
`Invalid JSON in ${(0,
|
|
16175
|
+
`Invalid JSON in ${(0, import_node_path111.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15953
16176
|
{ cause: error }
|
|
15954
16177
|
);
|
|
15955
16178
|
}
|
|
@@ -15961,7 +16184,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15961
16184
|
}
|
|
15962
16185
|
static getSettablePaths(_options = {}) {
|
|
15963
16186
|
return {
|
|
15964
|
-
relativeDirPath: (0,
|
|
16187
|
+
relativeDirPath: (0, import_node_path111.join)(".kiro", "agents")
|
|
15965
16188
|
};
|
|
15966
16189
|
}
|
|
15967
16190
|
getBody() {
|
|
@@ -15973,7 +16196,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
15973
16196
|
parsed = JSON.parse(this.body);
|
|
15974
16197
|
} catch (error) {
|
|
15975
16198
|
throw new Error(
|
|
15976
|
-
`Failed to parse JSON in ${(0,
|
|
16199
|
+
`Failed to parse JSON in ${(0, import_node_path111.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
|
|
15977
16200
|
{ cause: error }
|
|
15978
16201
|
);
|
|
15979
16202
|
}
|
|
@@ -16054,7 +16277,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16054
16277
|
global = false
|
|
16055
16278
|
}) {
|
|
16056
16279
|
const paths = this.getSettablePaths({ global });
|
|
16057
|
-
const filePath = (0,
|
|
16280
|
+
const filePath = (0, import_node_path111.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16058
16281
|
const fileContent = await readFileContent(filePath);
|
|
16059
16282
|
const subagent = new _KiroSubagent({
|
|
16060
16283
|
baseDir,
|
|
@@ -16092,7 +16315,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
16092
16315
|
};
|
|
16093
16316
|
|
|
16094
16317
|
// src/features/subagents/opencode-subagent.ts
|
|
16095
|
-
var
|
|
16318
|
+
var import_node_path112 = require("path");
|
|
16096
16319
|
var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
|
|
16097
16320
|
var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
16098
16321
|
getToolTarget() {
|
|
@@ -16102,7 +16325,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16102
16325
|
global = false
|
|
16103
16326
|
} = {}) {
|
|
16104
16327
|
return {
|
|
16105
|
-
relativeDirPath: global ? (0,
|
|
16328
|
+
relativeDirPath: global ? (0, import_node_path112.join)(".config", "opencode", "agent") : (0, import_node_path112.join)(".opencode", "agent")
|
|
16106
16329
|
};
|
|
16107
16330
|
}
|
|
16108
16331
|
static fromRulesyncSubagent({
|
|
@@ -16146,7 +16369,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
|
|
|
16146
16369
|
global = false
|
|
16147
16370
|
}) {
|
|
16148
16371
|
const paths = this.getSettablePaths({ global });
|
|
16149
|
-
const filePath = (0,
|
|
16372
|
+
const filePath = (0, import_node_path112.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
16150
16373
|
const fileContent = await readFileContent(filePath);
|
|
16151
16374
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
16152
16375
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -16199,7 +16422,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
16199
16422
|
"roo",
|
|
16200
16423
|
"rovodev"
|
|
16201
16424
|
];
|
|
16202
|
-
var SubagentsProcessorToolTargetSchema =
|
|
16425
|
+
var SubagentsProcessorToolTargetSchema = import_mini65.z.enum(subagentsProcessorToolTargetTuple);
|
|
16203
16426
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
16204
16427
|
[
|
|
16205
16428
|
"agentsmd",
|
|
@@ -16390,7 +16613,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16390
16613
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
16391
16614
|
*/
|
|
16392
16615
|
async loadRulesyncFiles() {
|
|
16393
|
-
const subagentsDir = (0,
|
|
16616
|
+
const subagentsDir = (0, import_node_path113.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
16394
16617
|
const dirExists = await directoryExists(subagentsDir);
|
|
16395
16618
|
if (!dirExists) {
|
|
16396
16619
|
this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -16405,7 +16628,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16405
16628
|
this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
16406
16629
|
const rulesyncSubagents = [];
|
|
16407
16630
|
for (const mdFile of mdFiles) {
|
|
16408
|
-
const filepath = (0,
|
|
16631
|
+
const filepath = (0, import_node_path113.join)(subagentsDir, mdFile);
|
|
16409
16632
|
try {
|
|
16410
16633
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
16411
16634
|
relativeFilePath: mdFile,
|
|
@@ -16435,14 +16658,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16435
16658
|
const factory = this.getFactory(this.toolTarget);
|
|
16436
16659
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
16437
16660
|
const subagentFilePaths = await findFilesByGlobs(
|
|
16438
|
-
(0,
|
|
16661
|
+
(0, import_node_path113.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
16439
16662
|
);
|
|
16440
16663
|
if (forDeletion) {
|
|
16441
16664
|
const toolSubagents2 = subagentFilePaths.map(
|
|
16442
16665
|
(path3) => factory.class.forDeletion({
|
|
16443
16666
|
baseDir: this.baseDir,
|
|
16444
16667
|
relativeDirPath: paths.relativeDirPath,
|
|
16445
|
-
relativeFilePath: (0,
|
|
16668
|
+
relativeFilePath: (0, import_node_path113.basename)(path3),
|
|
16446
16669
|
global: this.global
|
|
16447
16670
|
})
|
|
16448
16671
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -16455,7 +16678,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16455
16678
|
subagentFilePaths.map(
|
|
16456
16679
|
(path3) => factory.class.fromFile({
|
|
16457
16680
|
baseDir: this.baseDir,
|
|
16458
|
-
relativeFilePath: (0,
|
|
16681
|
+
relativeFilePath: (0, import_node_path113.basename)(path3),
|
|
16459
16682
|
global: this.global
|
|
16460
16683
|
})
|
|
16461
16684
|
)
|
|
@@ -16502,49 +16725,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
16502
16725
|
};
|
|
16503
16726
|
|
|
16504
16727
|
// src/features/rules/agentsmd-rule.ts
|
|
16505
|
-
var
|
|
16728
|
+
var import_node_path116 = require("path");
|
|
16506
16729
|
|
|
16507
16730
|
// src/features/rules/tool-rule.ts
|
|
16508
|
-
var
|
|
16731
|
+
var import_node_path115 = require("path");
|
|
16509
16732
|
|
|
16510
16733
|
// src/features/rules/rulesync-rule.ts
|
|
16511
|
-
var
|
|
16512
|
-
var
|
|
16513
|
-
var RulesyncRuleFrontmatterSchema =
|
|
16514
|
-
root:
|
|
16515
|
-
localRoot:
|
|
16516
|
-
targets:
|
|
16517
|
-
description:
|
|
16518
|
-
globs:
|
|
16519
|
-
agentsmd:
|
|
16520
|
-
|
|
16734
|
+
var import_node_path114 = require("path");
|
|
16735
|
+
var import_mini66 = require("zod/mini");
|
|
16736
|
+
var RulesyncRuleFrontmatterSchema = import_mini66.z.object({
|
|
16737
|
+
root: import_mini66.z.optional(import_mini66.z.boolean()),
|
|
16738
|
+
localRoot: import_mini66.z.optional(import_mini66.z.boolean()),
|
|
16739
|
+
targets: import_mini66.z._default(RulesyncTargetsSchema, ["*"]),
|
|
16740
|
+
description: import_mini66.z.optional(import_mini66.z.string()),
|
|
16741
|
+
globs: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string())),
|
|
16742
|
+
agentsmd: import_mini66.z.optional(
|
|
16743
|
+
import_mini66.z.looseObject({
|
|
16521
16744
|
// @example "path/to/subproject"
|
|
16522
|
-
subprojectPath:
|
|
16745
|
+
subprojectPath: import_mini66.z.optional(import_mini66.z.string())
|
|
16523
16746
|
})
|
|
16524
16747
|
),
|
|
16525
|
-
claudecode:
|
|
16526
|
-
|
|
16748
|
+
claudecode: import_mini66.z.optional(
|
|
16749
|
+
import_mini66.z.looseObject({
|
|
16527
16750
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
16528
16751
|
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
16529
|
-
paths:
|
|
16752
|
+
paths: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string()))
|
|
16530
16753
|
})
|
|
16531
16754
|
),
|
|
16532
|
-
cursor:
|
|
16533
|
-
|
|
16534
|
-
alwaysApply:
|
|
16535
|
-
description:
|
|
16536
|
-
globs:
|
|
16755
|
+
cursor: import_mini66.z.optional(
|
|
16756
|
+
import_mini66.z.looseObject({
|
|
16757
|
+
alwaysApply: import_mini66.z.optional(import_mini66.z.boolean()),
|
|
16758
|
+
description: import_mini66.z.optional(import_mini66.z.string()),
|
|
16759
|
+
globs: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string()))
|
|
16537
16760
|
})
|
|
16538
16761
|
),
|
|
16539
|
-
copilot:
|
|
16540
|
-
|
|
16541
|
-
excludeAgent:
|
|
16762
|
+
copilot: import_mini66.z.optional(
|
|
16763
|
+
import_mini66.z.looseObject({
|
|
16764
|
+
excludeAgent: import_mini66.z.optional(import_mini66.z.union([import_mini66.z.literal("code-review"), import_mini66.z.literal("coding-agent")]))
|
|
16542
16765
|
})
|
|
16543
16766
|
),
|
|
16544
|
-
antigravity:
|
|
16545
|
-
|
|
16546
|
-
trigger:
|
|
16547
|
-
globs:
|
|
16767
|
+
antigravity: import_mini66.z.optional(
|
|
16768
|
+
import_mini66.z.looseObject({
|
|
16769
|
+
trigger: import_mini66.z.optional(import_mini66.z.string()),
|
|
16770
|
+
globs: import_mini66.z.optional(import_mini66.z.array(import_mini66.z.string()))
|
|
16548
16771
|
})
|
|
16549
16772
|
)
|
|
16550
16773
|
});
|
|
@@ -16555,7 +16778,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16555
16778
|
const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
16556
16779
|
if (!parseResult.success && rest.validate !== false) {
|
|
16557
16780
|
throw new Error(
|
|
16558
|
-
`Invalid frontmatter in ${(0,
|
|
16781
|
+
`Invalid frontmatter in ${(0, import_node_path114.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
|
|
16559
16782
|
);
|
|
16560
16783
|
}
|
|
16561
16784
|
const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
|
|
@@ -16590,7 +16813,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16590
16813
|
return {
|
|
16591
16814
|
success: false,
|
|
16592
16815
|
error: new Error(
|
|
16593
|
-
`Invalid frontmatter in ${(0,
|
|
16816
|
+
`Invalid frontmatter in ${(0, import_node_path114.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
16594
16817
|
)
|
|
16595
16818
|
};
|
|
16596
16819
|
}
|
|
@@ -16599,7 +16822,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
16599
16822
|
relativeFilePath,
|
|
16600
16823
|
validate = true
|
|
16601
16824
|
}) {
|
|
16602
|
-
const filePath = (0,
|
|
16825
|
+
const filePath = (0, import_node_path114.join)(
|
|
16603
16826
|
process.cwd(),
|
|
16604
16827
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
16605
16828
|
relativeFilePath
|
|
@@ -16698,7 +16921,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16698
16921
|
rulesyncRule,
|
|
16699
16922
|
validate = true,
|
|
16700
16923
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
16701
|
-
nonRootPath = { relativeDirPath: (0,
|
|
16924
|
+
nonRootPath = { relativeDirPath: (0, import_node_path115.join)(".agents", "memories") }
|
|
16702
16925
|
}) {
|
|
16703
16926
|
const params = this.buildToolRuleParamsDefault({
|
|
16704
16927
|
baseDir,
|
|
@@ -16709,7 +16932,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16709
16932
|
});
|
|
16710
16933
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
16711
16934
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
16712
|
-
params.relativeDirPath = (0,
|
|
16935
|
+
params.relativeDirPath = (0, import_node_path115.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
16713
16936
|
params.relativeFilePath = "AGENTS.md";
|
|
16714
16937
|
}
|
|
16715
16938
|
return params;
|
|
@@ -16758,7 +16981,7 @@ var ToolRule = class extends ToolFile {
|
|
|
16758
16981
|
}
|
|
16759
16982
|
};
|
|
16760
16983
|
function buildToolPath(toolDir, subDir, excludeToolDir) {
|
|
16761
|
-
return excludeToolDir ? subDir : (0,
|
|
16984
|
+
return excludeToolDir ? subDir : (0, import_node_path115.join)(toolDir, subDir);
|
|
16762
16985
|
}
|
|
16763
16986
|
|
|
16764
16987
|
// src/features/rules/agentsmd-rule.ts
|
|
@@ -16787,8 +17010,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16787
17010
|
validate = true
|
|
16788
17011
|
}) {
|
|
16789
17012
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
16790
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
16791
|
-
const fileContent = await readFileContent((0,
|
|
17013
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path116.join)(".agents", "memories", relativeFilePath);
|
|
17014
|
+
const fileContent = await readFileContent((0, import_node_path116.join)(baseDir, relativePath));
|
|
16792
17015
|
return new _AgentsMdRule({
|
|
16793
17016
|
baseDir,
|
|
16794
17017
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -16843,21 +17066,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
16843
17066
|
};
|
|
16844
17067
|
|
|
16845
17068
|
// src/features/rules/antigravity-rule.ts
|
|
16846
|
-
var
|
|
16847
|
-
var
|
|
16848
|
-
var AntigravityRuleFrontmatterSchema =
|
|
16849
|
-
trigger:
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
|
|
16855
|
-
|
|
17069
|
+
var import_node_path117 = require("path");
|
|
17070
|
+
var import_mini67 = require("zod/mini");
|
|
17071
|
+
var AntigravityRuleFrontmatterSchema = import_mini67.z.looseObject({
|
|
17072
|
+
trigger: import_mini67.z.optional(
|
|
17073
|
+
import_mini67.z.union([
|
|
17074
|
+
import_mini67.z.literal("always_on"),
|
|
17075
|
+
import_mini67.z.literal("glob"),
|
|
17076
|
+
import_mini67.z.literal("manual"),
|
|
17077
|
+
import_mini67.z.literal("model_decision"),
|
|
17078
|
+
import_mini67.z.string()
|
|
16856
17079
|
// accepts any string for forward compatibility
|
|
16857
17080
|
])
|
|
16858
17081
|
),
|
|
16859
|
-
globs:
|
|
16860
|
-
description:
|
|
17082
|
+
globs: import_mini67.z.optional(import_mini67.z.string()),
|
|
17083
|
+
description: import_mini67.z.optional(import_mini67.z.string())
|
|
16861
17084
|
});
|
|
16862
17085
|
function parseGlobsString(globs) {
|
|
16863
17086
|
if (!globs) {
|
|
@@ -17002,7 +17225,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17002
17225
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17003
17226
|
if (!result.success) {
|
|
17004
17227
|
throw new Error(
|
|
17005
|
-
`Invalid frontmatter in ${(0,
|
|
17228
|
+
`Invalid frontmatter in ${(0, import_node_path117.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17006
17229
|
);
|
|
17007
17230
|
}
|
|
17008
17231
|
}
|
|
@@ -17026,7 +17249,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17026
17249
|
relativeFilePath,
|
|
17027
17250
|
validate = true
|
|
17028
17251
|
}) {
|
|
17029
|
-
const filePath = (0,
|
|
17252
|
+
const filePath = (0, import_node_path117.join)(
|
|
17030
17253
|
baseDir,
|
|
17031
17254
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17032
17255
|
relativeFilePath
|
|
@@ -17166,7 +17389,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
17166
17389
|
};
|
|
17167
17390
|
|
|
17168
17391
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
17169
|
-
var
|
|
17392
|
+
var import_node_path118 = require("path");
|
|
17170
17393
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
17171
17394
|
toRulesyncRule() {
|
|
17172
17395
|
const rulesyncFrontmatter = {
|
|
@@ -17226,8 +17449,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17226
17449
|
}) {
|
|
17227
17450
|
const settablePaths = this.getSettablePaths();
|
|
17228
17451
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
17229
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
17230
|
-
const fileContent = await readFileContent((0,
|
|
17452
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path118.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17453
|
+
const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
|
|
17231
17454
|
return new _AugmentcodeLegacyRule({
|
|
17232
17455
|
baseDir,
|
|
17233
17456
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -17256,7 +17479,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
17256
17479
|
};
|
|
17257
17480
|
|
|
17258
17481
|
// src/features/rules/augmentcode-rule.ts
|
|
17259
|
-
var
|
|
17482
|
+
var import_node_path119 = require("path");
|
|
17260
17483
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
17261
17484
|
toRulesyncRule() {
|
|
17262
17485
|
return this.toRulesyncRuleDefault();
|
|
@@ -17287,7 +17510,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17287
17510
|
relativeFilePath,
|
|
17288
17511
|
validate = true
|
|
17289
17512
|
}) {
|
|
17290
|
-
const filePath = (0,
|
|
17513
|
+
const filePath = (0, import_node_path119.join)(
|
|
17291
17514
|
baseDir,
|
|
17292
17515
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
17293
17516
|
relativeFilePath
|
|
@@ -17327,7 +17550,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
17327
17550
|
};
|
|
17328
17551
|
|
|
17329
17552
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
17330
|
-
var
|
|
17553
|
+
var import_node_path120 = require("path");
|
|
17331
17554
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
17332
17555
|
static getSettablePaths({
|
|
17333
17556
|
global,
|
|
@@ -17369,7 +17592,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17369
17592
|
if (isRoot) {
|
|
17370
17593
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17371
17594
|
const fileContent2 = await readFileContent(
|
|
17372
|
-
(0,
|
|
17595
|
+
(0, import_node_path120.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17373
17596
|
);
|
|
17374
17597
|
return new _ClaudecodeLegacyRule({
|
|
17375
17598
|
baseDir,
|
|
@@ -17383,8 +17606,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17383
17606
|
if (!paths.nonRoot) {
|
|
17384
17607
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17385
17608
|
}
|
|
17386
|
-
const relativePath = (0,
|
|
17387
|
-
const fileContent = await readFileContent((0,
|
|
17609
|
+
const relativePath = (0, import_node_path120.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17610
|
+
const fileContent = await readFileContent((0, import_node_path120.join)(baseDir, relativePath));
|
|
17388
17611
|
return new _ClaudecodeLegacyRule({
|
|
17389
17612
|
baseDir,
|
|
17390
17613
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17443,10 +17666,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
17443
17666
|
};
|
|
17444
17667
|
|
|
17445
17668
|
// src/features/rules/claudecode-rule.ts
|
|
17446
|
-
var
|
|
17447
|
-
var
|
|
17448
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
17449
|
-
paths:
|
|
17669
|
+
var import_node_path121 = require("path");
|
|
17670
|
+
var import_mini68 = require("zod/mini");
|
|
17671
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini68.z.object({
|
|
17672
|
+
paths: import_mini68.z.optional(import_mini68.z.array(import_mini68.z.string()))
|
|
17450
17673
|
});
|
|
17451
17674
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
17452
17675
|
frontmatter;
|
|
@@ -17484,7 +17707,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17484
17707
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17485
17708
|
if (!result.success) {
|
|
17486
17709
|
throw new Error(
|
|
17487
|
-
`Invalid frontmatter in ${(0,
|
|
17710
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17488
17711
|
);
|
|
17489
17712
|
}
|
|
17490
17713
|
}
|
|
@@ -17514,7 +17737,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17514
17737
|
if (isRoot) {
|
|
17515
17738
|
const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
17516
17739
|
const fileContent2 = await readFileContent(
|
|
17517
|
-
(0,
|
|
17740
|
+
(0, import_node_path121.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
|
|
17518
17741
|
);
|
|
17519
17742
|
return new _ClaudecodeRule({
|
|
17520
17743
|
baseDir,
|
|
@@ -17529,8 +17752,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17529
17752
|
if (!paths.nonRoot) {
|
|
17530
17753
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17531
17754
|
}
|
|
17532
|
-
const relativePath = (0,
|
|
17533
|
-
const filePath = (0,
|
|
17755
|
+
const relativePath = (0, import_node_path121.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
17756
|
+
const filePath = (0, import_node_path121.join)(baseDir, relativePath);
|
|
17534
17757
|
const fileContent = await readFileContent(filePath);
|
|
17535
17758
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17536
17759
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -17641,7 +17864,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17641
17864
|
return {
|
|
17642
17865
|
success: false,
|
|
17643
17866
|
error: new Error(
|
|
17644
|
-
`Invalid frontmatter in ${(0,
|
|
17867
|
+
`Invalid frontmatter in ${(0, import_node_path121.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
17645
17868
|
)
|
|
17646
17869
|
};
|
|
17647
17870
|
}
|
|
@@ -17661,10 +17884,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
17661
17884
|
};
|
|
17662
17885
|
|
|
17663
17886
|
// src/features/rules/cline-rule.ts
|
|
17664
|
-
var
|
|
17665
|
-
var
|
|
17666
|
-
var ClineRuleFrontmatterSchema =
|
|
17667
|
-
description:
|
|
17887
|
+
var import_node_path122 = require("path");
|
|
17888
|
+
var import_mini69 = require("zod/mini");
|
|
17889
|
+
var ClineRuleFrontmatterSchema = import_mini69.z.object({
|
|
17890
|
+
description: import_mini69.z.string()
|
|
17668
17891
|
});
|
|
17669
17892
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
17670
17893
|
static getSettablePaths(_options = {}) {
|
|
@@ -17707,7 +17930,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17707
17930
|
validate = true
|
|
17708
17931
|
}) {
|
|
17709
17932
|
const fileContent = await readFileContent(
|
|
17710
|
-
(0,
|
|
17933
|
+
(0, import_node_path122.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
17711
17934
|
);
|
|
17712
17935
|
return new _ClineRule({
|
|
17713
17936
|
baseDir,
|
|
@@ -17733,7 +17956,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
17733
17956
|
};
|
|
17734
17957
|
|
|
17735
17958
|
// src/features/rules/codexcli-rule.ts
|
|
17736
|
-
var
|
|
17959
|
+
var import_node_path123 = require("path");
|
|
17737
17960
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
17738
17961
|
static getSettablePaths({
|
|
17739
17962
|
global,
|
|
@@ -17768,7 +17991,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17768
17991
|
if (isRoot) {
|
|
17769
17992
|
const relativePath2 = paths.root.relativeFilePath;
|
|
17770
17993
|
const fileContent2 = await readFileContent(
|
|
17771
|
-
(0,
|
|
17994
|
+
(0, import_node_path123.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
17772
17995
|
);
|
|
17773
17996
|
return new _CodexcliRule({
|
|
17774
17997
|
baseDir,
|
|
@@ -17782,8 +18005,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17782
18005
|
if (!paths.nonRoot) {
|
|
17783
18006
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17784
18007
|
}
|
|
17785
|
-
const relativePath = (0,
|
|
17786
|
-
const fileContent = await readFileContent((0,
|
|
18008
|
+
const relativePath = (0, import_node_path123.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18009
|
+
const fileContent = await readFileContent((0, import_node_path123.join)(baseDir, relativePath));
|
|
17787
18010
|
return new _CodexcliRule({
|
|
17788
18011
|
baseDir,
|
|
17789
18012
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -17842,12 +18065,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
17842
18065
|
};
|
|
17843
18066
|
|
|
17844
18067
|
// src/features/rules/copilot-rule.ts
|
|
17845
|
-
var
|
|
17846
|
-
var
|
|
17847
|
-
var CopilotRuleFrontmatterSchema =
|
|
17848
|
-
description:
|
|
17849
|
-
applyTo:
|
|
17850
|
-
excludeAgent:
|
|
18068
|
+
var import_node_path124 = require("path");
|
|
18069
|
+
var import_mini70 = require("zod/mini");
|
|
18070
|
+
var CopilotRuleFrontmatterSchema = import_mini70.z.object({
|
|
18071
|
+
description: import_mini70.z.optional(import_mini70.z.string()),
|
|
18072
|
+
applyTo: import_mini70.z.optional(import_mini70.z.string()),
|
|
18073
|
+
excludeAgent: import_mini70.z.optional(import_mini70.z.union([import_mini70.z.literal("code-review"), import_mini70.z.literal("coding-agent")]))
|
|
17851
18074
|
});
|
|
17852
18075
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
17853
18076
|
frontmatter;
|
|
@@ -17879,7 +18102,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17879
18102
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
17880
18103
|
if (!result.success) {
|
|
17881
18104
|
throw new Error(
|
|
17882
|
-
`Invalid frontmatter in ${(0,
|
|
18105
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
17883
18106
|
);
|
|
17884
18107
|
}
|
|
17885
18108
|
}
|
|
@@ -17969,8 +18192,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17969
18192
|
const paths = this.getSettablePaths({ global });
|
|
17970
18193
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
17971
18194
|
if (isRoot) {
|
|
17972
|
-
const relativePath2 = (0,
|
|
17973
|
-
const filePath2 = (0,
|
|
18195
|
+
const relativePath2 = (0, import_node_path124.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18196
|
+
const filePath2 = (0, import_node_path124.join)(baseDir, relativePath2);
|
|
17974
18197
|
const fileContent2 = await readFileContent(filePath2);
|
|
17975
18198
|
return new _CopilotRule({
|
|
17976
18199
|
baseDir,
|
|
@@ -17985,8 +18208,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
17985
18208
|
if (!paths.nonRoot) {
|
|
17986
18209
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
17987
18210
|
}
|
|
17988
|
-
const relativePath = (0,
|
|
17989
|
-
const filePath = (0,
|
|
18211
|
+
const relativePath = (0, import_node_path124.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18212
|
+
const filePath = (0, import_node_path124.join)(baseDir, relativePath);
|
|
17990
18213
|
const fileContent = await readFileContent(filePath);
|
|
17991
18214
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
17992
18215
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -18032,7 +18255,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
18032
18255
|
return {
|
|
18033
18256
|
success: false,
|
|
18034
18257
|
error: new Error(
|
|
18035
|
-
`Invalid frontmatter in ${(0,
|
|
18258
|
+
`Invalid frontmatter in ${(0, import_node_path124.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18036
18259
|
)
|
|
18037
18260
|
};
|
|
18038
18261
|
}
|
|
@@ -18088,12 +18311,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
|
|
|
18088
18311
|
};
|
|
18089
18312
|
|
|
18090
18313
|
// src/features/rules/cursor-rule.ts
|
|
18091
|
-
var
|
|
18092
|
-
var
|
|
18093
|
-
var CursorRuleFrontmatterSchema =
|
|
18094
|
-
description:
|
|
18095
|
-
globs:
|
|
18096
|
-
alwaysApply:
|
|
18314
|
+
var import_node_path125 = require("path");
|
|
18315
|
+
var import_mini71 = require("zod/mini");
|
|
18316
|
+
var CursorRuleFrontmatterSchema = import_mini71.z.object({
|
|
18317
|
+
description: import_mini71.z.optional(import_mini71.z.string()),
|
|
18318
|
+
globs: import_mini71.z.optional(import_mini71.z.string()),
|
|
18319
|
+
alwaysApply: import_mini71.z.optional(import_mini71.z.boolean())
|
|
18097
18320
|
});
|
|
18098
18321
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
18099
18322
|
frontmatter;
|
|
@@ -18110,7 +18333,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18110
18333
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18111
18334
|
if (!result.success) {
|
|
18112
18335
|
throw new Error(
|
|
18113
|
-
`Invalid frontmatter in ${(0,
|
|
18336
|
+
`Invalid frontmatter in ${(0, import_node_path125.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
18114
18337
|
);
|
|
18115
18338
|
}
|
|
18116
18339
|
}
|
|
@@ -18226,7 +18449,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18226
18449
|
relativeFilePath,
|
|
18227
18450
|
validate = true
|
|
18228
18451
|
}) {
|
|
18229
|
-
const filePath = (0,
|
|
18452
|
+
const filePath = (0, import_node_path125.join)(
|
|
18230
18453
|
baseDir,
|
|
18231
18454
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
18232
18455
|
relativeFilePath
|
|
@@ -18236,7 +18459,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18236
18459
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
18237
18460
|
if (!result.success) {
|
|
18238
18461
|
throw new Error(
|
|
18239
|
-
`Invalid frontmatter in ${(0,
|
|
18462
|
+
`Invalid frontmatter in ${(0, import_node_path125.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
18240
18463
|
);
|
|
18241
18464
|
}
|
|
18242
18465
|
return new _CursorRule({
|
|
@@ -18273,7 +18496,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18273
18496
|
return {
|
|
18274
18497
|
success: false,
|
|
18275
18498
|
error: new Error(
|
|
18276
|
-
`Invalid frontmatter in ${(0,
|
|
18499
|
+
`Invalid frontmatter in ${(0, import_node_path125.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
18277
18500
|
)
|
|
18278
18501
|
};
|
|
18279
18502
|
}
|
|
@@ -18293,7 +18516,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
18293
18516
|
};
|
|
18294
18517
|
|
|
18295
18518
|
// src/features/rules/deepagents-rule.ts
|
|
18296
|
-
var
|
|
18519
|
+
var import_node_path126 = require("path");
|
|
18297
18520
|
var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
18298
18521
|
constructor({ fileContent, root, ...rest }) {
|
|
18299
18522
|
super({
|
|
@@ -18320,8 +18543,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18320
18543
|
}) {
|
|
18321
18544
|
const settablePaths = this.getSettablePaths();
|
|
18322
18545
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
18323
|
-
const relativePath = isRoot ? (0,
|
|
18324
|
-
const fileContent = await readFileContent((0,
|
|
18546
|
+
const relativePath = isRoot ? (0, import_node_path126.join)(".deepagents", "AGENTS.md") : (0, import_node_path126.join)(".deepagents", "memories", relativeFilePath);
|
|
18547
|
+
const fileContent = await readFileContent((0, import_node_path126.join)(baseDir, relativePath));
|
|
18325
18548
|
return new _DeepagentsRule({
|
|
18326
18549
|
baseDir,
|
|
18327
18550
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18376,7 +18599,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
|
|
|
18376
18599
|
};
|
|
18377
18600
|
|
|
18378
18601
|
// src/features/rules/factorydroid-rule.ts
|
|
18379
|
-
var
|
|
18602
|
+
var import_node_path127 = require("path");
|
|
18380
18603
|
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
18381
18604
|
constructor({ fileContent, root, ...rest }) {
|
|
18382
18605
|
super({
|
|
@@ -18416,8 +18639,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18416
18639
|
const paths = this.getSettablePaths({ global });
|
|
18417
18640
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
18418
18641
|
if (isRoot) {
|
|
18419
|
-
const relativePath2 = (0,
|
|
18420
|
-
const fileContent2 = await readFileContent((0,
|
|
18642
|
+
const relativePath2 = (0, import_node_path127.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
18643
|
+
const fileContent2 = await readFileContent((0, import_node_path127.join)(baseDir, relativePath2));
|
|
18421
18644
|
return new _FactorydroidRule({
|
|
18422
18645
|
baseDir,
|
|
18423
18646
|
relativeDirPath: paths.root.relativeDirPath,
|
|
@@ -18430,8 +18653,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18430
18653
|
if (!paths.nonRoot) {
|
|
18431
18654
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18432
18655
|
}
|
|
18433
|
-
const relativePath = (0,
|
|
18434
|
-
const fileContent = await readFileContent((0,
|
|
18656
|
+
const relativePath = (0, import_node_path127.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18657
|
+
const fileContent = await readFileContent((0, import_node_path127.join)(baseDir, relativePath));
|
|
18435
18658
|
return new _FactorydroidRule({
|
|
18436
18659
|
baseDir,
|
|
18437
18660
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18490,7 +18713,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
|
18490
18713
|
};
|
|
18491
18714
|
|
|
18492
18715
|
// src/features/rules/geminicli-rule.ts
|
|
18493
|
-
var
|
|
18716
|
+
var import_node_path128 = require("path");
|
|
18494
18717
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
18495
18718
|
static getSettablePaths({
|
|
18496
18719
|
global,
|
|
@@ -18525,7 +18748,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18525
18748
|
if (isRoot) {
|
|
18526
18749
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18527
18750
|
const fileContent2 = await readFileContent(
|
|
18528
|
-
(0,
|
|
18751
|
+
(0, import_node_path128.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18529
18752
|
);
|
|
18530
18753
|
return new _GeminiCliRule({
|
|
18531
18754
|
baseDir,
|
|
@@ -18539,8 +18762,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18539
18762
|
if (!paths.nonRoot) {
|
|
18540
18763
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18541
18764
|
}
|
|
18542
|
-
const relativePath = (0,
|
|
18543
|
-
const fileContent = await readFileContent((0,
|
|
18765
|
+
const relativePath = (0, import_node_path128.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18766
|
+
const fileContent = await readFileContent((0, import_node_path128.join)(baseDir, relativePath));
|
|
18544
18767
|
return new _GeminiCliRule({
|
|
18545
18768
|
baseDir,
|
|
18546
18769
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18599,7 +18822,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
18599
18822
|
};
|
|
18600
18823
|
|
|
18601
18824
|
// src/features/rules/goose-rule.ts
|
|
18602
|
-
var
|
|
18825
|
+
var import_node_path129 = require("path");
|
|
18603
18826
|
var GooseRule = class _GooseRule extends ToolRule {
|
|
18604
18827
|
static getSettablePaths({
|
|
18605
18828
|
global,
|
|
@@ -18634,7 +18857,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18634
18857
|
if (isRoot) {
|
|
18635
18858
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18636
18859
|
const fileContent2 = await readFileContent(
|
|
18637
|
-
(0,
|
|
18860
|
+
(0, import_node_path129.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18638
18861
|
);
|
|
18639
18862
|
return new _GooseRule({
|
|
18640
18863
|
baseDir,
|
|
@@ -18648,8 +18871,8 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18648
18871
|
if (!paths.nonRoot) {
|
|
18649
18872
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18650
18873
|
}
|
|
18651
|
-
const relativePath = (0,
|
|
18652
|
-
const fileContent = await readFileContent((0,
|
|
18874
|
+
const relativePath = (0, import_node_path129.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18875
|
+
const fileContent = await readFileContent((0, import_node_path129.join)(baseDir, relativePath));
|
|
18653
18876
|
return new _GooseRule({
|
|
18654
18877
|
baseDir,
|
|
18655
18878
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18708,7 +18931,7 @@ var GooseRule = class _GooseRule extends ToolRule {
|
|
|
18708
18931
|
};
|
|
18709
18932
|
|
|
18710
18933
|
// src/features/rules/junie-rule.ts
|
|
18711
|
-
var
|
|
18934
|
+
var import_node_path130 = require("path");
|
|
18712
18935
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
18713
18936
|
static getSettablePaths(_options = {}) {
|
|
18714
18937
|
return {
|
|
@@ -18737,8 +18960,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18737
18960
|
}) {
|
|
18738
18961
|
const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
|
|
18739
18962
|
const settablePaths = this.getSettablePaths();
|
|
18740
|
-
const relativePath = isRoot ? (0,
|
|
18741
|
-
const fileContent = await readFileContent((0,
|
|
18963
|
+
const relativePath = isRoot ? (0, import_node_path130.join)(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : (0, import_node_path130.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
18964
|
+
const fileContent = await readFileContent((0, import_node_path130.join)(baseDir, relativePath));
|
|
18742
18965
|
return new _JunieRule({
|
|
18743
18966
|
baseDir,
|
|
18744
18967
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -18793,7 +19016,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
18793
19016
|
};
|
|
18794
19017
|
|
|
18795
19018
|
// src/features/rules/kilo-rule.ts
|
|
18796
|
-
var
|
|
19019
|
+
var import_node_path131 = require("path");
|
|
18797
19020
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
18798
19021
|
static getSettablePaths({
|
|
18799
19022
|
global,
|
|
@@ -18828,7 +19051,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18828
19051
|
if (isRoot) {
|
|
18829
19052
|
const relativePath2 = paths.root.relativeFilePath;
|
|
18830
19053
|
const fileContent2 = await readFileContent(
|
|
18831
|
-
(0,
|
|
19054
|
+
(0, import_node_path131.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
18832
19055
|
);
|
|
18833
19056
|
return new _KiloRule({
|
|
18834
19057
|
baseDir,
|
|
@@ -18842,8 +19065,8 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18842
19065
|
if (!paths.nonRoot) {
|
|
18843
19066
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
18844
19067
|
}
|
|
18845
|
-
const relativePath = (0,
|
|
18846
|
-
const fileContent = await readFileContent((0,
|
|
19068
|
+
const relativePath = (0, import_node_path131.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19069
|
+
const fileContent = await readFileContent((0, import_node_path131.join)(baseDir, relativePath));
|
|
18847
19070
|
return new _KiloRule({
|
|
18848
19071
|
baseDir,
|
|
18849
19072
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -18902,7 +19125,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
18902
19125
|
};
|
|
18903
19126
|
|
|
18904
19127
|
// src/features/rules/kiro-rule.ts
|
|
18905
|
-
var
|
|
19128
|
+
var import_node_path132 = require("path");
|
|
18906
19129
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
18907
19130
|
static getSettablePaths(_options = {}) {
|
|
18908
19131
|
return {
|
|
@@ -18917,7 +19140,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18917
19140
|
validate = true
|
|
18918
19141
|
}) {
|
|
18919
19142
|
const fileContent = await readFileContent(
|
|
18920
|
-
(0,
|
|
19143
|
+
(0, import_node_path132.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
18921
19144
|
);
|
|
18922
19145
|
return new _KiroRule({
|
|
18923
19146
|
baseDir,
|
|
@@ -18971,7 +19194,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
18971
19194
|
};
|
|
18972
19195
|
|
|
18973
19196
|
// src/features/rules/opencode-rule.ts
|
|
18974
|
-
var
|
|
19197
|
+
var import_node_path133 = require("path");
|
|
18975
19198
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
18976
19199
|
static getSettablePaths({
|
|
18977
19200
|
global,
|
|
@@ -19006,7 +19229,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19006
19229
|
if (isRoot) {
|
|
19007
19230
|
const relativePath2 = paths.root.relativeFilePath;
|
|
19008
19231
|
const fileContent2 = await readFileContent(
|
|
19009
|
-
(0,
|
|
19232
|
+
(0, import_node_path133.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
19010
19233
|
);
|
|
19011
19234
|
return new _OpenCodeRule({
|
|
19012
19235
|
baseDir,
|
|
@@ -19020,8 +19243,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19020
19243
|
if (!paths.nonRoot) {
|
|
19021
19244
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19022
19245
|
}
|
|
19023
|
-
const relativePath = (0,
|
|
19024
|
-
const fileContent = await readFileContent((0,
|
|
19246
|
+
const relativePath = (0, import_node_path133.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
19247
|
+
const fileContent = await readFileContent((0, import_node_path133.join)(baseDir, relativePath));
|
|
19025
19248
|
return new _OpenCodeRule({
|
|
19026
19249
|
baseDir,
|
|
19027
19250
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -19080,7 +19303,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
19080
19303
|
};
|
|
19081
19304
|
|
|
19082
19305
|
// src/features/rules/qwencode-rule.ts
|
|
19083
|
-
var
|
|
19306
|
+
var import_node_path134 = require("path");
|
|
19084
19307
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
19085
19308
|
static getSettablePaths(_options = {}) {
|
|
19086
19309
|
return {
|
|
@@ -19099,8 +19322,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19099
19322
|
validate = true
|
|
19100
19323
|
}) {
|
|
19101
19324
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
19102
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
19103
|
-
const fileContent = await readFileContent((0,
|
|
19325
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path134.join)(".qwen", "memories", relativeFilePath);
|
|
19326
|
+
const fileContent = await readFileContent((0, import_node_path134.join)(baseDir, relativePath));
|
|
19104
19327
|
return new _QwencodeRule({
|
|
19105
19328
|
baseDir,
|
|
19106
19329
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -19152,7 +19375,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
19152
19375
|
};
|
|
19153
19376
|
|
|
19154
19377
|
// src/features/rules/replit-rule.ts
|
|
19155
|
-
var
|
|
19378
|
+
var import_node_path135 = require("path");
|
|
19156
19379
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
19157
19380
|
static getSettablePaths(_options = {}) {
|
|
19158
19381
|
return {
|
|
@@ -19174,7 +19397,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19174
19397
|
}
|
|
19175
19398
|
const relativePath = paths.root.relativeFilePath;
|
|
19176
19399
|
const fileContent = await readFileContent(
|
|
19177
|
-
(0,
|
|
19400
|
+
(0, import_node_path135.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
19178
19401
|
);
|
|
19179
19402
|
return new _ReplitRule({
|
|
19180
19403
|
baseDir,
|
|
@@ -19240,7 +19463,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
19240
19463
|
};
|
|
19241
19464
|
|
|
19242
19465
|
// src/features/rules/roo-rule.ts
|
|
19243
|
-
var
|
|
19466
|
+
var import_node_path136 = require("path");
|
|
19244
19467
|
var RooRule = class _RooRule extends ToolRule {
|
|
19245
19468
|
static getSettablePaths(_options = {}) {
|
|
19246
19469
|
return {
|
|
@@ -19255,7 +19478,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19255
19478
|
validate = true
|
|
19256
19479
|
}) {
|
|
19257
19480
|
const fileContent = await readFileContent(
|
|
19258
|
-
(0,
|
|
19481
|
+
(0, import_node_path136.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19259
19482
|
);
|
|
19260
19483
|
return new _RooRule({
|
|
19261
19484
|
baseDir,
|
|
@@ -19324,7 +19547,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
19324
19547
|
};
|
|
19325
19548
|
|
|
19326
19549
|
// src/features/rules/rovodev-rule.ts
|
|
19327
|
-
var
|
|
19550
|
+
var import_node_path137 = require("path");
|
|
19328
19551
|
var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
|
|
19329
19552
|
var RovodevRule = class _RovodevRule extends ToolRule {
|
|
19330
19553
|
/**
|
|
@@ -19368,7 +19591,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19368
19591
|
root: rovodevAgents,
|
|
19369
19592
|
alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
|
|
19370
19593
|
nonRoot: {
|
|
19371
|
-
relativeDirPath: (0,
|
|
19594
|
+
relativeDirPath: (0, import_node_path137.join)(".rovodev", ".rulesync", "modular-rules")
|
|
19372
19595
|
}
|
|
19373
19596
|
};
|
|
19374
19597
|
}
|
|
@@ -19407,10 +19630,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19407
19630
|
}) {
|
|
19408
19631
|
if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
|
|
19409
19632
|
throw new Error(
|
|
19410
|
-
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0,
|
|
19633
|
+
`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${(0, import_node_path137.join)(relativeDirPath, relativeFilePath)}`
|
|
19411
19634
|
);
|
|
19412
19635
|
}
|
|
19413
|
-
const fileContent = await readFileContent((0,
|
|
19636
|
+
const fileContent = await readFileContent((0, import_node_path137.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19414
19637
|
return new _RovodevRule({
|
|
19415
19638
|
baseDir,
|
|
19416
19639
|
relativeDirPath,
|
|
@@ -19430,10 +19653,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19430
19653
|
paths
|
|
19431
19654
|
}) {
|
|
19432
19655
|
const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
|
|
19433
|
-
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0,
|
|
19656
|
+
const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${(0, import_node_path137.join)(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : (0, import_node_path137.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19434
19657
|
if (relativeFilePath !== "AGENTS.md") {
|
|
19435
19658
|
throw new Error(
|
|
19436
|
-
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19659
|
+
`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path137.join)(relativeDirPath, relativeFilePath)}`
|
|
19437
19660
|
);
|
|
19438
19661
|
}
|
|
19439
19662
|
const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
|
|
@@ -19441,10 +19664,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19441
19664
|
);
|
|
19442
19665
|
if (!allowed) {
|
|
19443
19666
|
throw new Error(
|
|
19444
|
-
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0,
|
|
19667
|
+
`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${(0, import_node_path137.join)(relativeDirPath, relativeFilePath)}`
|
|
19445
19668
|
);
|
|
19446
19669
|
}
|
|
19447
|
-
const fileContent = await readFileContent((0,
|
|
19670
|
+
const fileContent = await readFileContent((0, import_node_path137.join)(baseDir, relativeDirPath, relativeFilePath));
|
|
19448
19671
|
return new _RovodevRule({
|
|
19449
19672
|
baseDir,
|
|
19450
19673
|
relativeDirPath,
|
|
@@ -19558,7 +19781,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
|
|
|
19558
19781
|
};
|
|
19559
19782
|
|
|
19560
19783
|
// src/features/rules/warp-rule.ts
|
|
19561
|
-
var
|
|
19784
|
+
var import_node_path138 = require("path");
|
|
19562
19785
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
19563
19786
|
constructor({ fileContent, root, ...rest }) {
|
|
19564
19787
|
super({
|
|
@@ -19584,8 +19807,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19584
19807
|
validate = true
|
|
19585
19808
|
}) {
|
|
19586
19809
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
19587
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
19588
|
-
const fileContent = await readFileContent((0,
|
|
19810
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path138.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
19811
|
+
const fileContent = await readFileContent((0, import_node_path138.join)(baseDir, relativePath));
|
|
19589
19812
|
return new _WarpRule({
|
|
19590
19813
|
baseDir,
|
|
19591
19814
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -19640,7 +19863,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
19640
19863
|
};
|
|
19641
19864
|
|
|
19642
19865
|
// src/features/rules/windsurf-rule.ts
|
|
19643
|
-
var
|
|
19866
|
+
var import_node_path139 = require("path");
|
|
19644
19867
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
19645
19868
|
static getSettablePaths(_options = {}) {
|
|
19646
19869
|
return {
|
|
@@ -19655,7 +19878,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
19655
19878
|
validate = true
|
|
19656
19879
|
}) {
|
|
19657
19880
|
const fileContent = await readFileContent(
|
|
19658
|
-
(0,
|
|
19881
|
+
(0, import_node_path139.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
19659
19882
|
);
|
|
19660
19883
|
return new _WindsurfRule({
|
|
19661
19884
|
baseDir,
|
|
@@ -19753,11 +19976,11 @@ var rulesProcessorToolTargets = [
|
|
|
19753
19976
|
"warp",
|
|
19754
19977
|
"windsurf"
|
|
19755
19978
|
];
|
|
19756
|
-
var RulesProcessorToolTargetSchema =
|
|
19757
|
-
var formatRulePaths = (rules) => rules.map((r) => (0,
|
|
19758
|
-
var RulesFeatureOptionsSchema =
|
|
19759
|
-
ruleDiscoveryMode:
|
|
19760
|
-
includeLocalRoot:
|
|
19979
|
+
var RulesProcessorToolTargetSchema = import_mini72.z.enum(rulesProcessorToolTargets);
|
|
19980
|
+
var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path140.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
|
|
19981
|
+
var RulesFeatureOptionsSchema = import_mini72.z.looseObject({
|
|
19982
|
+
ruleDiscoveryMode: import_mini72.z.optional(import_mini72.z.enum(["none", "explicit"])),
|
|
19983
|
+
includeLocalRoot: import_mini72.z.optional(import_mini72.z.boolean())
|
|
19761
19984
|
});
|
|
19762
19985
|
var resolveRuleDiscoveryMode = ({
|
|
19763
19986
|
defaultMode,
|
|
@@ -19778,8 +20001,8 @@ var resolveRuleDiscoveryMode = ({
|
|
|
19778
20001
|
}
|
|
19779
20002
|
return parsed.data.ruleDiscoveryMode === "none" ? "auto" : "toon";
|
|
19780
20003
|
};
|
|
19781
|
-
var IncludeLocalRootSchema =
|
|
19782
|
-
includeLocalRoot:
|
|
20004
|
+
var IncludeLocalRootSchema = import_mini72.z.looseObject({
|
|
20005
|
+
includeLocalRoot: import_mini72.z.optional(import_mini72.z.boolean())
|
|
19783
20006
|
});
|
|
19784
20007
|
var resolveIncludeLocalRoot = (options) => {
|
|
19785
20008
|
if (!options) return true;
|
|
@@ -20085,6 +20308,8 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
20085
20308
|
extension: "md",
|
|
20086
20309
|
supportsGlobal: false,
|
|
20087
20310
|
ruleDiscoveryMode: "auto"
|
|
20311
|
+
// No additionalConventions.skills needed: Windsurf Cascade auto-discovers
|
|
20312
|
+
// skills from .windsurf/skills/ and ~/.codeium/windsurf/skills/ directories.
|
|
20088
20313
|
}
|
|
20089
20314
|
}
|
|
20090
20315
|
]
|
|
@@ -20222,7 +20447,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20222
20447
|
}).relativeDirPath;
|
|
20223
20448
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
20224
20449
|
const frontmatter = skill.getFrontmatter();
|
|
20225
|
-
const relativePath = (0,
|
|
20450
|
+
const relativePath = (0, import_node_path140.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
20226
20451
|
return {
|
|
20227
20452
|
name: frontmatter.name,
|
|
20228
20453
|
description: frontmatter.description,
|
|
@@ -20351,12 +20576,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20351
20576
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
20352
20577
|
*/
|
|
20353
20578
|
async loadRulesyncFiles() {
|
|
20354
|
-
const rulesyncBaseDir = (0,
|
|
20355
|
-
const files = await findFilesByGlobs((0,
|
|
20579
|
+
const rulesyncBaseDir = (0, import_node_path140.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
20580
|
+
const files = await findFilesByGlobs((0, import_node_path140.join)(rulesyncBaseDir, "**", "*.md"));
|
|
20356
20581
|
this.logger.debug(`Found ${files.length} rulesync files`);
|
|
20357
20582
|
const rulesyncRules = await Promise.all(
|
|
20358
20583
|
files.map((file) => {
|
|
20359
|
-
const relativeFilePath = (0,
|
|
20584
|
+
const relativeFilePath = (0, import_node_path140.relative)(rulesyncBaseDir, file);
|
|
20360
20585
|
checkPathTraversal({
|
|
20361
20586
|
relativePath: relativeFilePath,
|
|
20362
20587
|
intendedRootDir: rulesyncBaseDir
|
|
@@ -20431,7 +20656,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20431
20656
|
global: this.global
|
|
20432
20657
|
});
|
|
20433
20658
|
const resolveRelativeDirPath = (filePath) => {
|
|
20434
|
-
const dirName = (0,
|
|
20659
|
+
const dirName = (0, import_node_path140.dirname)((0, import_node_path140.relative)(this.baseDir, filePath));
|
|
20435
20660
|
return dirName === "" ? "." : dirName;
|
|
20436
20661
|
};
|
|
20437
20662
|
const buildDeletionRulesFromPaths = (filePaths, opts) => {
|
|
@@ -20439,7 +20664,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20439
20664
|
const effectiveBaseDir = isNonRoot ? opts.baseDirOverride : this.baseDir;
|
|
20440
20665
|
return filePaths.map((filePath) => {
|
|
20441
20666
|
const relativeDirPath = isNonRoot ? opts.relativeDirPathOverride : resolveRelativeDirPath(filePath);
|
|
20442
|
-
const relativeFilePath = isNonRoot ? (0,
|
|
20667
|
+
const relativeFilePath = isNonRoot ? (0, import_node_path140.relative)(effectiveBaseDir, filePath) : (0, import_node_path140.basename)(filePath);
|
|
20443
20668
|
checkPathTraversal({
|
|
20444
20669
|
relativePath: isNonRoot ? relativeFilePath : relativeDirPath,
|
|
20445
20670
|
intendedRootDir: effectiveBaseDir
|
|
@@ -20467,13 +20692,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20467
20692
|
return [];
|
|
20468
20693
|
}
|
|
20469
20694
|
const uniqueRootFilePaths = await findFilesWithFallback(
|
|
20470
|
-
(0,
|
|
20695
|
+
(0, import_node_path140.join)(
|
|
20471
20696
|
this.baseDir,
|
|
20472
20697
|
settablePaths.root.relativeDirPath ?? ".",
|
|
20473
20698
|
settablePaths.root.relativeFilePath
|
|
20474
20699
|
),
|
|
20475
20700
|
settablePaths.alternativeRoots,
|
|
20476
|
-
(alt) => (0,
|
|
20701
|
+
(alt) => (0, import_node_path140.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
|
|
20477
20702
|
);
|
|
20478
20703
|
if (forDeletion) {
|
|
20479
20704
|
return buildDeletionRulesFromPaths(uniqueRootFilePaths);
|
|
@@ -20487,7 +20712,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20487
20712
|
});
|
|
20488
20713
|
return factory.class.fromFile({
|
|
20489
20714
|
baseDir: this.baseDir,
|
|
20490
|
-
relativeFilePath: (0,
|
|
20715
|
+
relativeFilePath: (0, import_node_path140.basename)(filePath),
|
|
20491
20716
|
relativeDirPath,
|
|
20492
20717
|
global: this.global
|
|
20493
20718
|
});
|
|
@@ -20504,7 +20729,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20504
20729
|
return [];
|
|
20505
20730
|
}
|
|
20506
20731
|
const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
|
|
20507
|
-
(0,
|
|
20732
|
+
(0, import_node_path140.join)(this.baseDir, "AGENTS.local.md")
|
|
20508
20733
|
);
|
|
20509
20734
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
|
|
20510
20735
|
}
|
|
@@ -20515,9 +20740,9 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20515
20740
|
return [];
|
|
20516
20741
|
}
|
|
20517
20742
|
const uniqueLocalRootFilePaths = await findFilesWithFallback(
|
|
20518
|
-
(0,
|
|
20743
|
+
(0, import_node_path140.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
|
|
20519
20744
|
settablePaths.alternativeRoots,
|
|
20520
|
-
(alt) => (0,
|
|
20745
|
+
(alt) => (0, import_node_path140.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
|
|
20521
20746
|
);
|
|
20522
20747
|
return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
|
|
20523
20748
|
})();
|
|
@@ -20528,20 +20753,20 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20528
20753
|
if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
|
|
20529
20754
|
return [];
|
|
20530
20755
|
}
|
|
20531
|
-
const primaryPaths = await findFilesByGlobs((0,
|
|
20756
|
+
const primaryPaths = await findFilesByGlobs((0, import_node_path140.join)(this.baseDir, ".rovodev", "AGENTS.md"));
|
|
20532
20757
|
if (primaryPaths.length === 0) {
|
|
20533
20758
|
return [];
|
|
20534
20759
|
}
|
|
20535
|
-
const mirrorPaths = await findFilesByGlobs((0,
|
|
20760
|
+
const mirrorPaths = await findFilesByGlobs((0, import_node_path140.join)(this.baseDir, "AGENTS.md"));
|
|
20536
20761
|
return buildDeletionRulesFromPaths(mirrorPaths);
|
|
20537
20762
|
})();
|
|
20538
20763
|
const nonRootToolRules = await (async () => {
|
|
20539
20764
|
if (!settablePaths.nonRoot) {
|
|
20540
20765
|
return [];
|
|
20541
20766
|
}
|
|
20542
|
-
const nonRootBaseDir = (0,
|
|
20767
|
+
const nonRootBaseDir = (0, import_node_path140.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
20543
20768
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
20544
|
-
(0,
|
|
20769
|
+
(0, import_node_path140.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
20545
20770
|
);
|
|
20546
20771
|
if (forDeletion) {
|
|
20547
20772
|
return buildDeletionRulesFromPaths(nonRootFilePaths, {
|
|
@@ -20551,18 +20776,18 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
20551
20776
|
}
|
|
20552
20777
|
const modularRootRelative = settablePaths.nonRoot.relativeDirPath;
|
|
20553
20778
|
const nonRootPathsForImport = this.toolTarget === "rovodev" ? nonRootFilePaths.filter((filePath) => {
|
|
20554
|
-
const relativeFilePath = (0,
|
|
20779
|
+
const relativeFilePath = (0, import_node_path140.relative)(nonRootBaseDir, filePath);
|
|
20555
20780
|
const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
|
|
20556
20781
|
if (!ok) {
|
|
20557
20782
|
this.logger.warn(
|
|
20558
|
-
`Skipping reserved Rovodev path under modular-rules (import): ${(0,
|
|
20783
|
+
`Skipping reserved Rovodev path under modular-rules (import): ${(0, import_node_path140.join)(modularRootRelative, relativeFilePath)}`
|
|
20559
20784
|
);
|
|
20560
20785
|
}
|
|
20561
20786
|
return ok;
|
|
20562
20787
|
}) : nonRootFilePaths;
|
|
20563
20788
|
return await Promise.all(
|
|
20564
20789
|
nonRootPathsForImport.map((filePath) => {
|
|
20565
|
-
const relativeFilePath = (0,
|
|
20790
|
+
const relativeFilePath = (0, import_node_path140.relative)(nonRootBaseDir, filePath);
|
|
20566
20791
|
checkPathTraversal({
|
|
20567
20792
|
relativePath: relativeFilePath,
|
|
20568
20793
|
intendedRootDir: nonRootBaseDir
|
|
@@ -20681,14 +20906,14 @@ s/<command> [arguments]
|
|
|
20681
20906
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
20682
20907
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
20683
20908
|
|
|
20684
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
20909
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path140.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
20685
20910
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
20686
20911
|
|
|
20687
20912
|
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.
|
|
20688
20913
|
|
|
20689
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
20914
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path140.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
20690
20915
|
|
|
20691
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
20916
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path140.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
20692
20917
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
20693
20918
|
const result = [
|
|
20694
20919
|
overview,
|
|
@@ -20788,7 +21013,7 @@ function warnUnsupportedTargets(params) {
|
|
|
20788
21013
|
}
|
|
20789
21014
|
}
|
|
20790
21015
|
async function checkRulesyncDirExists(params) {
|
|
20791
|
-
return fileExists((0,
|
|
21016
|
+
return fileExists((0, import_node_path141.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
20792
21017
|
}
|
|
20793
21018
|
async function generate(params) {
|
|
20794
21019
|
const { config, logger } = params;
|