rulesync 3.12.7 → 3.12.8
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/dist/index.cjs +142 -134
- package/dist/index.js +133 -125
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -525,7 +525,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
525
525
|
var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
526
526
|
static getSettablePaths() {
|
|
527
527
|
return {
|
|
528
|
-
relativeDirPath: ".agents
|
|
528
|
+
relativeDirPath: join3(".agents", "commands")
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
531
|
static fromRulesyncCommand({
|
|
@@ -640,7 +640,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
640
640
|
}
|
|
641
641
|
static getSettablePaths() {
|
|
642
642
|
return {
|
|
643
|
-
relativeDirPath: ".rulesync
|
|
643
|
+
relativeDirPath: join4(".rulesync", "commands")
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
646
|
getFrontmatter() {
|
|
@@ -1209,7 +1209,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1209
1209
|
body;
|
|
1210
1210
|
static getSettablePaths() {
|
|
1211
1211
|
return {
|
|
1212
|
-
relativeDirPath: ".roo
|
|
1212
|
+
relativeDirPath: join10(".roo", "commands")
|
|
1213
1213
|
};
|
|
1214
1214
|
}
|
|
1215
1215
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -3753,10 +3753,13 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3753
3753
|
};
|
|
3754
3754
|
|
|
3755
3755
|
// src/rules/rules-processor.ts
|
|
3756
|
-
import { basename as basename17, join as
|
|
3756
|
+
import { basename as basename17, join as join63 } from "path";
|
|
3757
3757
|
import { XMLBuilder } from "fast-xml-parser";
|
|
3758
3758
|
import { z as z21 } from "zod/mini";
|
|
3759
3759
|
|
|
3760
|
+
// src/subagents/agentsmd-subagent.ts
|
|
3761
|
+
import { join as join35 } from "path";
|
|
3762
|
+
|
|
3760
3763
|
// src/subagents/simulated-subagent.ts
|
|
3761
3764
|
import { basename as basename12, join as join34 } from "path";
|
|
3762
3765
|
import { z as z13 } from "zod/mini";
|
|
@@ -3889,7 +3892,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3889
3892
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
3890
3893
|
static getSettablePaths() {
|
|
3891
3894
|
return {
|
|
3892
|
-
relativeDirPath: ".agents
|
|
3895
|
+
relativeDirPath: join35(".agents", "subagents")
|
|
3893
3896
|
};
|
|
3894
3897
|
}
|
|
3895
3898
|
static async fromFile(params) {
|
|
@@ -3909,10 +3912,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
3909
3912
|
};
|
|
3910
3913
|
|
|
3911
3914
|
// src/subagents/codexcli-subagent.ts
|
|
3915
|
+
import { join as join36 } from "path";
|
|
3912
3916
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
3913
3917
|
static getSettablePaths() {
|
|
3914
3918
|
return {
|
|
3915
|
-
relativeDirPath: ".codex
|
|
3919
|
+
relativeDirPath: join36(".codex", "subagents")
|
|
3916
3920
|
};
|
|
3917
3921
|
}
|
|
3918
3922
|
static async fromFile(params) {
|
|
@@ -3932,10 +3936,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
3932
3936
|
};
|
|
3933
3937
|
|
|
3934
3938
|
// src/subagents/copilot-subagent.ts
|
|
3939
|
+
import { join as join37 } from "path";
|
|
3935
3940
|
var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
3936
3941
|
static getSettablePaths() {
|
|
3937
3942
|
return {
|
|
3938
|
-
relativeDirPath: ".github
|
|
3943
|
+
relativeDirPath: join37(".github", "subagents")
|
|
3939
3944
|
};
|
|
3940
3945
|
}
|
|
3941
3946
|
static async fromFile(params) {
|
|
@@ -3955,10 +3960,11 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
|
3955
3960
|
};
|
|
3956
3961
|
|
|
3957
3962
|
// src/subagents/cursor-subagent.ts
|
|
3963
|
+
import { join as join38 } from "path";
|
|
3958
3964
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
3959
3965
|
static getSettablePaths() {
|
|
3960
3966
|
return {
|
|
3961
|
-
relativeDirPath: ".cursor
|
|
3967
|
+
relativeDirPath: join38(".cursor", "subagents")
|
|
3962
3968
|
};
|
|
3963
3969
|
}
|
|
3964
3970
|
static async fromFile(params) {
|
|
@@ -3978,10 +3984,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
3978
3984
|
};
|
|
3979
3985
|
|
|
3980
3986
|
// src/subagents/geminicli-subagent.ts
|
|
3987
|
+
import { join as join39 } from "path";
|
|
3981
3988
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
3982
3989
|
static getSettablePaths() {
|
|
3983
3990
|
return {
|
|
3984
|
-
relativeDirPath: ".gemini
|
|
3991
|
+
relativeDirPath: join39(".gemini", "subagents")
|
|
3985
3992
|
};
|
|
3986
3993
|
}
|
|
3987
3994
|
static async fromFile(params) {
|
|
@@ -4001,10 +4008,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
4001
4008
|
};
|
|
4002
4009
|
|
|
4003
4010
|
// src/subagents/roo-subagent.ts
|
|
4011
|
+
import { join as join40 } from "path";
|
|
4004
4012
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
4005
4013
|
static getSettablePaths() {
|
|
4006
4014
|
return {
|
|
4007
|
-
relativeDirPath: ".roo
|
|
4015
|
+
relativeDirPath: join40(".roo", "subagents")
|
|
4008
4016
|
};
|
|
4009
4017
|
}
|
|
4010
4018
|
static async fromFile(params) {
|
|
@@ -4024,15 +4032,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
4024
4032
|
};
|
|
4025
4033
|
|
|
4026
4034
|
// src/subagents/subagents-processor.ts
|
|
4027
|
-
import { basename as basename14, join as
|
|
4035
|
+
import { basename as basename14, join as join43 } from "path";
|
|
4028
4036
|
import { z as z16 } from "zod/mini";
|
|
4029
4037
|
|
|
4030
4038
|
// src/subagents/claudecode-subagent.ts
|
|
4031
|
-
import { join as
|
|
4039
|
+
import { join as join42 } from "path";
|
|
4032
4040
|
import { z as z15 } from "zod/mini";
|
|
4033
4041
|
|
|
4034
4042
|
// src/subagents/rulesync-subagent.ts
|
|
4035
|
-
import { basename as basename13, join as
|
|
4043
|
+
import { basename as basename13, join as join41 } from "path";
|
|
4036
4044
|
import { z as z14 } from "zod/mini";
|
|
4037
4045
|
var RulesyncSubagentModelSchema = z14.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
4038
4046
|
var RulesyncSubagentFrontmatterSchema = z14.object({
|
|
@@ -4053,7 +4061,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4053
4061
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4054
4062
|
if (!result.success) {
|
|
4055
4063
|
throw new Error(
|
|
4056
|
-
`Invalid frontmatter in ${
|
|
4064
|
+
`Invalid frontmatter in ${join41(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4057
4065
|
);
|
|
4058
4066
|
}
|
|
4059
4067
|
}
|
|
@@ -4065,7 +4073,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4065
4073
|
}
|
|
4066
4074
|
static getSettablePaths() {
|
|
4067
4075
|
return {
|
|
4068
|
-
relativeDirPath: ".rulesync
|
|
4076
|
+
relativeDirPath: join41(".rulesync", "subagents")
|
|
4069
4077
|
};
|
|
4070
4078
|
}
|
|
4071
4079
|
getFrontmatter() {
|
|
@@ -4085,7 +4093,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4085
4093
|
return {
|
|
4086
4094
|
success: false,
|
|
4087
4095
|
error: new Error(
|
|
4088
|
-
`Invalid frontmatter in ${
|
|
4096
|
+
`Invalid frontmatter in ${join41(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4089
4097
|
)
|
|
4090
4098
|
};
|
|
4091
4099
|
}
|
|
@@ -4093,7 +4101,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4093
4101
|
static async fromFile({
|
|
4094
4102
|
relativeFilePath
|
|
4095
4103
|
}) {
|
|
4096
|
-
const fileContent = await readFileContent(
|
|
4104
|
+
const fileContent = await readFileContent(join41(".rulesync", "subagents", relativeFilePath));
|
|
4097
4105
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4098
4106
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4099
4107
|
if (!result.success) {
|
|
@@ -4125,7 +4133,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4125
4133
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4126
4134
|
if (!result.success) {
|
|
4127
4135
|
throw new Error(
|
|
4128
|
-
`Invalid frontmatter in ${
|
|
4136
|
+
`Invalid frontmatter in ${join42(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4129
4137
|
);
|
|
4130
4138
|
}
|
|
4131
4139
|
}
|
|
@@ -4137,7 +4145,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4137
4145
|
}
|
|
4138
4146
|
static getSettablePaths(_options = {}) {
|
|
4139
4147
|
return {
|
|
4140
|
-
relativeDirPath:
|
|
4148
|
+
relativeDirPath: join42(".claude", "agents")
|
|
4141
4149
|
};
|
|
4142
4150
|
}
|
|
4143
4151
|
getFrontmatter() {
|
|
@@ -4163,7 +4171,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4163
4171
|
// RulesyncCommand baseDir is always the project root directory
|
|
4164
4172
|
frontmatter: rulesyncFrontmatter,
|
|
4165
4173
|
body: this.body,
|
|
4166
|
-
relativeDirPath: ".rulesync
|
|
4174
|
+
relativeDirPath: join42(".rulesync", "subagents"),
|
|
4167
4175
|
relativeFilePath: this.getRelativeFilePath(),
|
|
4168
4176
|
fileContent,
|
|
4169
4177
|
validate: true
|
|
@@ -4205,7 +4213,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4205
4213
|
return {
|
|
4206
4214
|
success: false,
|
|
4207
4215
|
error: new Error(
|
|
4208
|
-
`Invalid frontmatter in ${
|
|
4216
|
+
`Invalid frontmatter in ${join42(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4209
4217
|
)
|
|
4210
4218
|
};
|
|
4211
4219
|
}
|
|
@@ -4223,7 +4231,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4223
4231
|
global = false
|
|
4224
4232
|
}) {
|
|
4225
4233
|
const paths = this.getSettablePaths({ global });
|
|
4226
|
-
const filePath =
|
|
4234
|
+
const filePath = join42(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
4227
4235
|
const fileContent = await readFileContent(filePath);
|
|
4228
4236
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4229
4237
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4377,7 +4385,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4377
4385
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
4378
4386
|
*/
|
|
4379
4387
|
async loadRulesyncFiles() {
|
|
4380
|
-
const subagentsDir =
|
|
4388
|
+
const subagentsDir = join43(RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
4381
4389
|
const dirExists = await directoryExists(subagentsDir);
|
|
4382
4390
|
if (!dirExists) {
|
|
4383
4391
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -4392,7 +4400,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4392
4400
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
4393
4401
|
const rulesyncSubagents = [];
|
|
4394
4402
|
for (const mdFile of mdFiles) {
|
|
4395
|
-
const filepath =
|
|
4403
|
+
const filepath = join43(subagentsDir, mdFile);
|
|
4396
4404
|
try {
|
|
4397
4405
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
4398
4406
|
relativeFilePath: mdFile,
|
|
@@ -4511,7 +4519,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4511
4519
|
relativeDirPath,
|
|
4512
4520
|
fromFile
|
|
4513
4521
|
}) {
|
|
4514
|
-
const paths = await findFilesByGlobs(
|
|
4522
|
+
const paths = await findFilesByGlobs(join43(this.baseDir, relativeDirPath, "*.md"));
|
|
4515
4523
|
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile(basename14(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
4516
4524
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
4517
4525
|
return subagents;
|
|
@@ -4539,13 +4547,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4539
4547
|
};
|
|
4540
4548
|
|
|
4541
4549
|
// src/rules/agentsmd-rule.ts
|
|
4542
|
-
import { join as
|
|
4550
|
+
import { join as join46 } from "path";
|
|
4543
4551
|
|
|
4544
4552
|
// src/rules/tool-rule.ts
|
|
4545
|
-
import { join as
|
|
4553
|
+
import { join as join45 } from "path";
|
|
4546
4554
|
|
|
4547
4555
|
// src/rules/rulesync-rule.ts
|
|
4548
|
-
import { basename as basename15, join as
|
|
4556
|
+
import { basename as basename15, join as join44 } from "path";
|
|
4549
4557
|
import { z as z17 } from "zod/mini";
|
|
4550
4558
|
var RulesyncRuleFrontmatterSchema = z17.object({
|
|
4551
4559
|
root: z17.optional(z17.optional(z17.boolean())),
|
|
@@ -4574,7 +4582,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4574
4582
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4575
4583
|
if (!result.success) {
|
|
4576
4584
|
throw new Error(
|
|
4577
|
-
`Invalid frontmatter in ${
|
|
4585
|
+
`Invalid frontmatter in ${join44(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4578
4586
|
);
|
|
4579
4587
|
}
|
|
4580
4588
|
}
|
|
@@ -4588,7 +4596,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4588
4596
|
static getSettablePaths() {
|
|
4589
4597
|
return {
|
|
4590
4598
|
recommended: {
|
|
4591
|
-
relativeDirPath: ".rulesync
|
|
4599
|
+
relativeDirPath: join44(".rulesync", "rules")
|
|
4592
4600
|
},
|
|
4593
4601
|
legacy: {
|
|
4594
4602
|
relativeDirPath: ".rulesync"
|
|
@@ -4609,7 +4617,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4609
4617
|
return {
|
|
4610
4618
|
success: false,
|
|
4611
4619
|
error: new Error(
|
|
4612
|
-
`Invalid frontmatter in ${
|
|
4620
|
+
`Invalid frontmatter in ${join44(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4613
4621
|
)
|
|
4614
4622
|
};
|
|
4615
4623
|
}
|
|
@@ -4618,8 +4626,8 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4618
4626
|
relativeFilePath,
|
|
4619
4627
|
validate = true
|
|
4620
4628
|
}) {
|
|
4621
|
-
const legacyPath =
|
|
4622
|
-
const recommendedPath =
|
|
4629
|
+
const legacyPath = join44(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
4630
|
+
const recommendedPath = join44(
|
|
4623
4631
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
4624
4632
|
relativeFilePath
|
|
4625
4633
|
);
|
|
@@ -4652,7 +4660,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4652
4660
|
relativeFilePath,
|
|
4653
4661
|
validate = true
|
|
4654
4662
|
}) {
|
|
4655
|
-
const filePath =
|
|
4663
|
+
const filePath = join44(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
4656
4664
|
const fileContent = await readFileContent(filePath);
|
|
4657
4665
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4658
4666
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4742,7 +4750,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4742
4750
|
rulesyncRule,
|
|
4743
4751
|
validate = true,
|
|
4744
4752
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
4745
|
-
nonRootPath = { relativeDirPath: ".agents
|
|
4753
|
+
nonRootPath = { relativeDirPath: join45(".agents", "memories") }
|
|
4746
4754
|
}) {
|
|
4747
4755
|
const params = this.buildToolRuleParamsDefault({
|
|
4748
4756
|
baseDir,
|
|
@@ -4753,7 +4761,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4753
4761
|
});
|
|
4754
4762
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
4755
4763
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
4756
|
-
params.relativeDirPath =
|
|
4764
|
+
params.relativeDirPath = join45(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
4757
4765
|
params.relativeFilePath = "AGENTS.md";
|
|
4758
4766
|
}
|
|
4759
4767
|
return params;
|
|
@@ -4762,7 +4770,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4762
4770
|
return new RulesyncRule({
|
|
4763
4771
|
baseDir: ".",
|
|
4764
4772
|
// RulesyncRule baseDir is always the project root directory
|
|
4765
|
-
relativeDirPath: ".rulesync
|
|
4773
|
+
relativeDirPath: join45(".rulesync", "rules"),
|
|
4766
4774
|
relativeFilePath: this.getRelativeFilePath(),
|
|
4767
4775
|
frontmatter: {
|
|
4768
4776
|
root: this.isRoot(),
|
|
@@ -4819,7 +4827,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4819
4827
|
relativeFilePath: "AGENTS.md"
|
|
4820
4828
|
},
|
|
4821
4829
|
nonRoot: {
|
|
4822
|
-
relativeDirPath: ".agents
|
|
4830
|
+
relativeDirPath: join46(".agents", "memories")
|
|
4823
4831
|
}
|
|
4824
4832
|
};
|
|
4825
4833
|
}
|
|
@@ -4829,8 +4837,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4829
4837
|
validate = true
|
|
4830
4838
|
}) {
|
|
4831
4839
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4832
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4833
|
-
const fileContent = await readFileContent(
|
|
4840
|
+
const relativePath = isRoot ? "AGENTS.md" : join46(".agents", "memories", relativeFilePath);
|
|
4841
|
+
const fileContent = await readFileContent(join46(baseDir, relativePath));
|
|
4834
4842
|
return new _AgentsMdRule({
|
|
4835
4843
|
baseDir,
|
|
4836
4844
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4870,12 +4878,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4870
4878
|
};
|
|
4871
4879
|
|
|
4872
4880
|
// src/rules/amazonqcli-rule.ts
|
|
4873
|
-
import { join as
|
|
4881
|
+
import { join as join47 } from "path";
|
|
4874
4882
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4875
4883
|
static getSettablePaths() {
|
|
4876
4884
|
return {
|
|
4877
4885
|
nonRoot: {
|
|
4878
|
-
relativeDirPath: ".amazonq
|
|
4886
|
+
relativeDirPath: join47(".amazonq", "rules")
|
|
4879
4887
|
}
|
|
4880
4888
|
};
|
|
4881
4889
|
}
|
|
@@ -4885,7 +4893,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4885
4893
|
validate = true
|
|
4886
4894
|
}) {
|
|
4887
4895
|
const fileContent = await readFileContent(
|
|
4888
|
-
|
|
4896
|
+
join47(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4889
4897
|
);
|
|
4890
4898
|
return new _AmazonQCliRule({
|
|
4891
4899
|
baseDir,
|
|
@@ -4925,7 +4933,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4925
4933
|
};
|
|
4926
4934
|
|
|
4927
4935
|
// src/rules/augmentcode-legacy-rule.ts
|
|
4928
|
-
import { join as
|
|
4936
|
+
import { join as join48 } from "path";
|
|
4929
4937
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4930
4938
|
toRulesyncRule() {
|
|
4931
4939
|
const rulesyncFrontmatter = {
|
|
@@ -4939,7 +4947,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4939
4947
|
// RulesyncRule baseDir is always the project root directory
|
|
4940
4948
|
frontmatter: rulesyncFrontmatter,
|
|
4941
4949
|
body: this.getFileContent(),
|
|
4942
|
-
relativeDirPath: ".rulesync
|
|
4950
|
+
relativeDirPath: join48(".rulesync", "rules"),
|
|
4943
4951
|
relativeFilePath: this.getRelativeFilePath(),
|
|
4944
4952
|
validate: true
|
|
4945
4953
|
});
|
|
@@ -4951,7 +4959,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4951
4959
|
relativeFilePath: ".augment-guidelines"
|
|
4952
4960
|
},
|
|
4953
4961
|
nonRoot: {
|
|
4954
|
-
relativeDirPath: ".augment
|
|
4962
|
+
relativeDirPath: join48(".augment", "rules")
|
|
4955
4963
|
}
|
|
4956
4964
|
};
|
|
4957
4965
|
}
|
|
@@ -4986,8 +4994,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4986
4994
|
}) {
|
|
4987
4995
|
const settablePaths = this.getSettablePaths();
|
|
4988
4996
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
4989
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
4990
|
-
const fileContent = await readFileContent(
|
|
4997
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join48(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4998
|
+
const fileContent = await readFileContent(join48(baseDir, relativePath));
|
|
4991
4999
|
return new _AugmentcodeLegacyRule({
|
|
4992
5000
|
baseDir,
|
|
4993
5001
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -5000,7 +5008,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
5000
5008
|
};
|
|
5001
5009
|
|
|
5002
5010
|
// src/rules/augmentcode-rule.ts
|
|
5003
|
-
import { join as
|
|
5011
|
+
import { join as join49 } from "path";
|
|
5004
5012
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
5005
5013
|
toRulesyncRule() {
|
|
5006
5014
|
return this.toRulesyncRuleDefault();
|
|
@@ -5008,7 +5016,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5008
5016
|
static getSettablePaths() {
|
|
5009
5017
|
return {
|
|
5010
5018
|
nonRoot: {
|
|
5011
|
-
relativeDirPath: ".augment
|
|
5019
|
+
relativeDirPath: join49(".augment", "rules")
|
|
5012
5020
|
}
|
|
5013
5021
|
};
|
|
5014
5022
|
}
|
|
@@ -5032,7 +5040,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5032
5040
|
validate = true
|
|
5033
5041
|
}) {
|
|
5034
5042
|
const fileContent = await readFileContent(
|
|
5035
|
-
|
|
5043
|
+
join49(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5036
5044
|
);
|
|
5037
5045
|
const { body: content } = parseFrontmatter(fileContent);
|
|
5038
5046
|
return new _AugmentcodeRule({
|
|
@@ -5055,7 +5063,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5055
5063
|
};
|
|
5056
5064
|
|
|
5057
5065
|
// src/rules/claudecode-rule.ts
|
|
5058
|
-
import { join as
|
|
5066
|
+
import { join as join50 } from "path";
|
|
5059
5067
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
5060
5068
|
static getSettablePaths({
|
|
5061
5069
|
global
|
|
@@ -5074,7 +5082,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5074
5082
|
relativeFilePath: "CLAUDE.md"
|
|
5075
5083
|
},
|
|
5076
5084
|
nonRoot: {
|
|
5077
|
-
relativeDirPath:
|
|
5085
|
+
relativeDirPath: join50(".claude", "memories")
|
|
5078
5086
|
}
|
|
5079
5087
|
};
|
|
5080
5088
|
}
|
|
@@ -5089,7 +5097,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5089
5097
|
if (isRoot) {
|
|
5090
5098
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5091
5099
|
const fileContent2 = await readFileContent(
|
|
5092
|
-
|
|
5100
|
+
join50(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5093
5101
|
);
|
|
5094
5102
|
return new _ClaudecodeRule({
|
|
5095
5103
|
baseDir,
|
|
@@ -5103,8 +5111,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5103
5111
|
if (!paths.nonRoot) {
|
|
5104
5112
|
throw new Error("nonRoot path is not set");
|
|
5105
5113
|
}
|
|
5106
|
-
const relativePath =
|
|
5107
|
-
const fileContent = await readFileContent(
|
|
5114
|
+
const relativePath = join50(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5115
|
+
const fileContent = await readFileContent(join50(baseDir, relativePath));
|
|
5108
5116
|
return new _ClaudecodeRule({
|
|
5109
5117
|
baseDir,
|
|
5110
5118
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5146,7 +5154,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5146
5154
|
};
|
|
5147
5155
|
|
|
5148
5156
|
// src/rules/cline-rule.ts
|
|
5149
|
-
import { join as
|
|
5157
|
+
import { join as join51 } from "path";
|
|
5150
5158
|
import { z as z18 } from "zod/mini";
|
|
5151
5159
|
var ClineRuleFrontmatterSchema = z18.object({
|
|
5152
5160
|
description: z18.string()
|
|
@@ -5191,7 +5199,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
5191
5199
|
validate = true
|
|
5192
5200
|
}) {
|
|
5193
5201
|
const fileContent = await readFileContent(
|
|
5194
|
-
|
|
5202
|
+
join51(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5195
5203
|
);
|
|
5196
5204
|
return new _ClineRule({
|
|
5197
5205
|
baseDir,
|
|
@@ -5204,7 +5212,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
5204
5212
|
};
|
|
5205
5213
|
|
|
5206
5214
|
// src/rules/codexcli-rule.ts
|
|
5207
|
-
import { join as
|
|
5215
|
+
import { join as join52 } from "path";
|
|
5208
5216
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
5209
5217
|
static getSettablePaths({
|
|
5210
5218
|
global
|
|
@@ -5223,7 +5231,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5223
5231
|
relativeFilePath: "AGENTS.md"
|
|
5224
5232
|
},
|
|
5225
5233
|
nonRoot: {
|
|
5226
|
-
relativeDirPath: ".codex
|
|
5234
|
+
relativeDirPath: join52(".codex", "memories")
|
|
5227
5235
|
}
|
|
5228
5236
|
};
|
|
5229
5237
|
}
|
|
@@ -5238,7 +5246,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5238
5246
|
if (isRoot) {
|
|
5239
5247
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5240
5248
|
const fileContent2 = await readFileContent(
|
|
5241
|
-
|
|
5249
|
+
join52(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5242
5250
|
);
|
|
5243
5251
|
return new _CodexcliRule({
|
|
5244
5252
|
baseDir,
|
|
@@ -5252,8 +5260,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5252
5260
|
if (!paths.nonRoot) {
|
|
5253
5261
|
throw new Error("nonRoot path is not set");
|
|
5254
5262
|
}
|
|
5255
|
-
const relativePath =
|
|
5256
|
-
const fileContent = await readFileContent(
|
|
5263
|
+
const relativePath = join52(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5264
|
+
const fileContent = await readFileContent(join52(baseDir, relativePath));
|
|
5257
5265
|
return new _CodexcliRule({
|
|
5258
5266
|
baseDir,
|
|
5259
5267
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5295,7 +5303,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5295
5303
|
};
|
|
5296
5304
|
|
|
5297
5305
|
// src/rules/copilot-rule.ts
|
|
5298
|
-
import { join as
|
|
5306
|
+
import { join as join53 } from "path";
|
|
5299
5307
|
import { z as z19 } from "zod/mini";
|
|
5300
5308
|
var CopilotRuleFrontmatterSchema = z19.object({
|
|
5301
5309
|
description: z19.optional(z19.string()),
|
|
@@ -5311,7 +5319,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5311
5319
|
relativeFilePath: "copilot-instructions.md"
|
|
5312
5320
|
},
|
|
5313
5321
|
nonRoot: {
|
|
5314
|
-
relativeDirPath: ".github
|
|
5322
|
+
relativeDirPath: join53(".github", "instructions")
|
|
5315
5323
|
}
|
|
5316
5324
|
};
|
|
5317
5325
|
}
|
|
@@ -5320,7 +5328,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5320
5328
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5321
5329
|
if (!result.success) {
|
|
5322
5330
|
throw new Error(
|
|
5323
|
-
`Invalid frontmatter in ${
|
|
5331
|
+
`Invalid frontmatter in ${join53(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5324
5332
|
);
|
|
5325
5333
|
}
|
|
5326
5334
|
}
|
|
@@ -5345,7 +5353,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5345
5353
|
baseDir: this.getBaseDir(),
|
|
5346
5354
|
frontmatter: rulesyncFrontmatter,
|
|
5347
5355
|
body: this.body,
|
|
5348
|
-
relativeDirPath: ".rulesync
|
|
5356
|
+
relativeDirPath: join53(".rulesync", "rules"),
|
|
5349
5357
|
relativeFilePath,
|
|
5350
5358
|
validate: true
|
|
5351
5359
|
});
|
|
@@ -5392,11 +5400,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5392
5400
|
validate = true
|
|
5393
5401
|
}) {
|
|
5394
5402
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
5395
|
-
const relativePath = isRoot ?
|
|
5403
|
+
const relativePath = isRoot ? join53(
|
|
5396
5404
|
this.getSettablePaths().root.relativeDirPath,
|
|
5397
5405
|
this.getSettablePaths().root.relativeFilePath
|
|
5398
|
-
) :
|
|
5399
|
-
const fileContent = await readFileContent(
|
|
5406
|
+
) : join53(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5407
|
+
const fileContent = await readFileContent(join53(baseDir, relativePath));
|
|
5400
5408
|
if (isRoot) {
|
|
5401
5409
|
return new _CopilotRule({
|
|
5402
5410
|
baseDir,
|
|
@@ -5415,7 +5423,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5415
5423
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5416
5424
|
if (!result.success) {
|
|
5417
5425
|
throw new Error(
|
|
5418
|
-
`Invalid frontmatter in ${
|
|
5426
|
+
`Invalid frontmatter in ${join53(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
5419
5427
|
);
|
|
5420
5428
|
}
|
|
5421
5429
|
return new _CopilotRule({
|
|
@@ -5439,7 +5447,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5439
5447
|
return {
|
|
5440
5448
|
success: false,
|
|
5441
5449
|
error: new Error(
|
|
5442
|
-
`Invalid frontmatter in ${
|
|
5450
|
+
`Invalid frontmatter in ${join53(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5443
5451
|
)
|
|
5444
5452
|
};
|
|
5445
5453
|
}
|
|
@@ -5459,7 +5467,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5459
5467
|
};
|
|
5460
5468
|
|
|
5461
5469
|
// src/rules/cursor-rule.ts
|
|
5462
|
-
import { basename as basename16, join as
|
|
5470
|
+
import { basename as basename16, join as join54 } from "path";
|
|
5463
5471
|
import { z as z20 } from "zod/mini";
|
|
5464
5472
|
var CursorRuleFrontmatterSchema = z20.object({
|
|
5465
5473
|
description: z20.optional(z20.string()),
|
|
@@ -5472,7 +5480,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5472
5480
|
static getSettablePaths() {
|
|
5473
5481
|
return {
|
|
5474
5482
|
nonRoot: {
|
|
5475
|
-
relativeDirPath: ".cursor
|
|
5483
|
+
relativeDirPath: join54(".cursor", "rules")
|
|
5476
5484
|
}
|
|
5477
5485
|
};
|
|
5478
5486
|
}
|
|
@@ -5481,7 +5489,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5481
5489
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5482
5490
|
if (!result.success) {
|
|
5483
5491
|
throw new Error(
|
|
5484
|
-
`Invalid frontmatter in ${
|
|
5492
|
+
`Invalid frontmatter in ${join54(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5485
5493
|
);
|
|
5486
5494
|
}
|
|
5487
5495
|
}
|
|
@@ -5553,7 +5561,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5553
5561
|
return new RulesyncRule({
|
|
5554
5562
|
frontmatter: rulesyncFrontmatter,
|
|
5555
5563
|
body: this.body,
|
|
5556
|
-
relativeDirPath: ".rulesync
|
|
5564
|
+
relativeDirPath: join54(".rulesync", "rules"),
|
|
5557
5565
|
relativeFilePath: this.relativeFilePath.replace(/\.mdc$/, ".md"),
|
|
5558
5566
|
validate: true
|
|
5559
5567
|
});
|
|
@@ -5598,13 +5606,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5598
5606
|
validate = true
|
|
5599
5607
|
}) {
|
|
5600
5608
|
const fileContent = await readFileContent(
|
|
5601
|
-
|
|
5609
|
+
join54(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5602
5610
|
);
|
|
5603
5611
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
5604
5612
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5605
5613
|
if (!result.success) {
|
|
5606
5614
|
throw new Error(
|
|
5607
|
-
`Invalid frontmatter in ${
|
|
5615
|
+
`Invalid frontmatter in ${join54(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
5608
5616
|
);
|
|
5609
5617
|
}
|
|
5610
5618
|
return new _CursorRule({
|
|
@@ -5627,7 +5635,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5627
5635
|
return {
|
|
5628
5636
|
success: false,
|
|
5629
5637
|
error: new Error(
|
|
5630
|
-
`Invalid frontmatter in ${
|
|
5638
|
+
`Invalid frontmatter in ${join54(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5631
5639
|
)
|
|
5632
5640
|
};
|
|
5633
5641
|
}
|
|
@@ -5647,7 +5655,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5647
5655
|
};
|
|
5648
5656
|
|
|
5649
5657
|
// src/rules/geminicli-rule.ts
|
|
5650
|
-
import { join as
|
|
5658
|
+
import { join as join55 } from "path";
|
|
5651
5659
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5652
5660
|
static getSettablePaths({
|
|
5653
5661
|
global
|
|
@@ -5666,7 +5674,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5666
5674
|
relativeFilePath: "GEMINI.md"
|
|
5667
5675
|
},
|
|
5668
5676
|
nonRoot: {
|
|
5669
|
-
relativeDirPath: ".gemini
|
|
5677
|
+
relativeDirPath: join55(".gemini", "memories")
|
|
5670
5678
|
}
|
|
5671
5679
|
};
|
|
5672
5680
|
}
|
|
@@ -5681,7 +5689,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5681
5689
|
if (isRoot) {
|
|
5682
5690
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5683
5691
|
const fileContent2 = await readFileContent(
|
|
5684
|
-
|
|
5692
|
+
join55(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5685
5693
|
);
|
|
5686
5694
|
return new _GeminiCliRule({
|
|
5687
5695
|
baseDir,
|
|
@@ -5695,8 +5703,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5695
5703
|
if (!paths.nonRoot) {
|
|
5696
5704
|
throw new Error("nonRoot path is not set");
|
|
5697
5705
|
}
|
|
5698
|
-
const relativePath =
|
|
5699
|
-
const fileContent = await readFileContent(
|
|
5706
|
+
const relativePath = join55(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5707
|
+
const fileContent = await readFileContent(join55(baseDir, relativePath));
|
|
5700
5708
|
return new _GeminiCliRule({
|
|
5701
5709
|
baseDir,
|
|
5702
5710
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5738,7 +5746,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5738
5746
|
};
|
|
5739
5747
|
|
|
5740
5748
|
// src/rules/junie-rule.ts
|
|
5741
|
-
import { join as
|
|
5749
|
+
import { join as join56 } from "path";
|
|
5742
5750
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
5743
5751
|
static getSettablePaths() {
|
|
5744
5752
|
return {
|
|
@@ -5747,7 +5755,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5747
5755
|
relativeFilePath: "guidelines.md"
|
|
5748
5756
|
},
|
|
5749
5757
|
nonRoot: {
|
|
5750
|
-
relativeDirPath: ".junie
|
|
5758
|
+
relativeDirPath: join56(".junie", "memories")
|
|
5751
5759
|
}
|
|
5752
5760
|
};
|
|
5753
5761
|
}
|
|
@@ -5757,8 +5765,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5757
5765
|
validate = true
|
|
5758
5766
|
}) {
|
|
5759
5767
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
5760
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
5761
|
-
const fileContent = await readFileContent(
|
|
5768
|
+
const relativePath = isRoot ? "guidelines.md" : join56(".junie", "memories", relativeFilePath);
|
|
5769
|
+
const fileContent = await readFileContent(join56(baseDir, relativePath));
|
|
5762
5770
|
return new _JunieRule({
|
|
5763
5771
|
baseDir,
|
|
5764
5772
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5798,12 +5806,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5798
5806
|
};
|
|
5799
5807
|
|
|
5800
5808
|
// src/rules/kiro-rule.ts
|
|
5801
|
-
import { join as
|
|
5809
|
+
import { join as join57 } from "path";
|
|
5802
5810
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
5803
5811
|
static getSettablePaths() {
|
|
5804
5812
|
return {
|
|
5805
5813
|
nonRoot: {
|
|
5806
|
-
relativeDirPath: ".kiro
|
|
5814
|
+
relativeDirPath: join57(".kiro", "steering")
|
|
5807
5815
|
}
|
|
5808
5816
|
};
|
|
5809
5817
|
}
|
|
@@ -5813,7 +5821,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5813
5821
|
validate = true
|
|
5814
5822
|
}) {
|
|
5815
5823
|
const fileContent = await readFileContent(
|
|
5816
|
-
|
|
5824
|
+
join57(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5817
5825
|
);
|
|
5818
5826
|
return new _KiroRule({
|
|
5819
5827
|
baseDir,
|
|
@@ -5853,7 +5861,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5853
5861
|
};
|
|
5854
5862
|
|
|
5855
5863
|
// src/rules/opencode-rule.ts
|
|
5856
|
-
import { join as
|
|
5864
|
+
import { join as join58 } from "path";
|
|
5857
5865
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
5858
5866
|
static getSettablePaths() {
|
|
5859
5867
|
return {
|
|
@@ -5862,7 +5870,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5862
5870
|
relativeFilePath: "AGENTS.md"
|
|
5863
5871
|
},
|
|
5864
5872
|
nonRoot: {
|
|
5865
|
-
relativeDirPath: ".opencode
|
|
5873
|
+
relativeDirPath: join58(".opencode", "memories")
|
|
5866
5874
|
}
|
|
5867
5875
|
};
|
|
5868
5876
|
}
|
|
@@ -5872,8 +5880,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5872
5880
|
validate = true
|
|
5873
5881
|
}) {
|
|
5874
5882
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
5875
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
5876
|
-
const fileContent = await readFileContent(
|
|
5883
|
+
const relativePath = isRoot ? "AGENTS.md" : join58(".opencode", "memories", relativeFilePath);
|
|
5884
|
+
const fileContent = await readFileContent(join58(baseDir, relativePath));
|
|
5877
5885
|
return new _OpenCodeRule({
|
|
5878
5886
|
baseDir,
|
|
5879
5887
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5913,7 +5921,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5913
5921
|
};
|
|
5914
5922
|
|
|
5915
5923
|
// src/rules/qwencode-rule.ts
|
|
5916
|
-
import { join as
|
|
5924
|
+
import { join as join59 } from "path";
|
|
5917
5925
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5918
5926
|
static getSettablePaths() {
|
|
5919
5927
|
return {
|
|
@@ -5922,7 +5930,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5922
5930
|
relativeFilePath: "QWEN.md"
|
|
5923
5931
|
},
|
|
5924
5932
|
nonRoot: {
|
|
5925
|
-
relativeDirPath: ".qwen
|
|
5933
|
+
relativeDirPath: join59(".qwen", "memories")
|
|
5926
5934
|
}
|
|
5927
5935
|
};
|
|
5928
5936
|
}
|
|
@@ -5932,8 +5940,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5932
5940
|
validate = true
|
|
5933
5941
|
}) {
|
|
5934
5942
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5935
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
5936
|
-
const fileContent = await readFileContent(
|
|
5943
|
+
const relativePath = isRoot ? "QWEN.md" : join59(".qwen", "memories", relativeFilePath);
|
|
5944
|
+
const fileContent = await readFileContent(join59(baseDir, relativePath));
|
|
5937
5945
|
return new _QwencodeRule({
|
|
5938
5946
|
baseDir,
|
|
5939
5947
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5970,12 +5978,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5970
5978
|
};
|
|
5971
5979
|
|
|
5972
5980
|
// src/rules/roo-rule.ts
|
|
5973
|
-
import { join as
|
|
5981
|
+
import { join as join60 } from "path";
|
|
5974
5982
|
var RooRule = class _RooRule extends ToolRule {
|
|
5975
5983
|
static getSettablePaths() {
|
|
5976
5984
|
return {
|
|
5977
5985
|
nonRoot: {
|
|
5978
|
-
relativeDirPath: ".roo
|
|
5986
|
+
relativeDirPath: join60(".roo", "rules")
|
|
5979
5987
|
}
|
|
5980
5988
|
};
|
|
5981
5989
|
}
|
|
@@ -5985,7 +5993,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5985
5993
|
validate = true
|
|
5986
5994
|
}) {
|
|
5987
5995
|
const fileContent = await readFileContent(
|
|
5988
|
-
|
|
5996
|
+
join60(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5989
5997
|
);
|
|
5990
5998
|
return new _RooRule({
|
|
5991
5999
|
baseDir,
|
|
@@ -6040,7 +6048,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
6040
6048
|
};
|
|
6041
6049
|
|
|
6042
6050
|
// src/rules/warp-rule.ts
|
|
6043
|
-
import { join as
|
|
6051
|
+
import { join as join61 } from "path";
|
|
6044
6052
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
6045
6053
|
constructor({ fileContent, root, ...rest }) {
|
|
6046
6054
|
super({
|
|
@@ -6056,7 +6064,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6056
6064
|
relativeFilePath: "WARP.md"
|
|
6057
6065
|
},
|
|
6058
6066
|
nonRoot: {
|
|
6059
|
-
relativeDirPath: ".warp
|
|
6067
|
+
relativeDirPath: join61(".warp", "memories")
|
|
6060
6068
|
}
|
|
6061
6069
|
};
|
|
6062
6070
|
}
|
|
@@ -6066,8 +6074,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6066
6074
|
validate = true
|
|
6067
6075
|
}) {
|
|
6068
6076
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
6069
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
6070
|
-
const fileContent = await readFileContent(
|
|
6077
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join61(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
6078
|
+
const fileContent = await readFileContent(join61(baseDir, relativePath));
|
|
6071
6079
|
return new _WarpRule({
|
|
6072
6080
|
baseDir,
|
|
6073
6081
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -6107,12 +6115,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6107
6115
|
};
|
|
6108
6116
|
|
|
6109
6117
|
// src/rules/windsurf-rule.ts
|
|
6110
|
-
import { join as
|
|
6118
|
+
import { join as join62 } from "path";
|
|
6111
6119
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
6112
6120
|
static getSettablePaths() {
|
|
6113
6121
|
return {
|
|
6114
6122
|
nonRoot: {
|
|
6115
|
-
relativeDirPath: ".windsurf
|
|
6123
|
+
relativeDirPath: join62(".windsurf", "rules")
|
|
6116
6124
|
}
|
|
6117
6125
|
};
|
|
6118
6126
|
}
|
|
@@ -6122,7 +6130,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
6122
6130
|
validate = true
|
|
6123
6131
|
}) {
|
|
6124
6132
|
const fileContent = await readFileContent(
|
|
6125
|
-
|
|
6133
|
+
join62(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6126
6134
|
);
|
|
6127
6135
|
return new _WindsurfRule({
|
|
6128
6136
|
baseDir,
|
|
@@ -6522,7 +6530,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6522
6530
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
6523
6531
|
*/
|
|
6524
6532
|
async loadRulesyncFiles() {
|
|
6525
|
-
const files = await findFilesByGlobs(
|
|
6533
|
+
const files = await findFilesByGlobs(join63(".rulesync", "rules", "*.md"));
|
|
6526
6534
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
6527
6535
|
const rulesyncRules = await Promise.all(
|
|
6528
6536
|
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: basename17(file) }))
|
|
@@ -6543,7 +6551,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6543
6551
|
return rulesyncRules;
|
|
6544
6552
|
}
|
|
6545
6553
|
async loadRulesyncFilesLegacy() {
|
|
6546
|
-
const legacyFiles = await findFilesByGlobs(
|
|
6554
|
+
const legacyFiles = await findFilesByGlobs(join63(".rulesync", "*.md"));
|
|
6547
6555
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
6548
6556
|
return Promise.all(
|
|
6549
6557
|
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: basename17(file) }))
|
|
@@ -6610,7 +6618,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6610
6618
|
return [];
|
|
6611
6619
|
}
|
|
6612
6620
|
const rootFilePaths = await findFilesByGlobs(
|
|
6613
|
-
|
|
6621
|
+
join63(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
6614
6622
|
);
|
|
6615
6623
|
return await Promise.all(
|
|
6616
6624
|
rootFilePaths.map(
|
|
@@ -6628,7 +6636,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6628
6636
|
return [];
|
|
6629
6637
|
}
|
|
6630
6638
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
6631
|
-
|
|
6639
|
+
join63(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
6632
6640
|
);
|
|
6633
6641
|
return await Promise.all(
|
|
6634
6642
|
nonRootFilePaths.map(
|
|
@@ -7004,14 +7012,14 @@ s/<command> [arguments]
|
|
|
7004
7012
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
7005
7013
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
7006
7014
|
|
|
7007
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
7015
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join63(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
7008
7016
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
7009
7017
|
|
|
7010
7018
|
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.
|
|
7011
7019
|
|
|
7012
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
7020
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join63(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
7013
7021
|
|
|
7014
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
7022
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join63(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
7015
7023
|
const result = [
|
|
7016
7024
|
overview,
|
|
7017
7025
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -7225,9 +7233,9 @@ async function generateSubagents(config) {
|
|
|
7225
7233
|
}
|
|
7226
7234
|
|
|
7227
7235
|
// src/cli/commands/gitignore.ts
|
|
7228
|
-
import { join as
|
|
7236
|
+
import { join as join64 } from "path";
|
|
7229
7237
|
var gitignoreCommand = async () => {
|
|
7230
|
-
const gitignorePath =
|
|
7238
|
+
const gitignorePath = join64(process.cwd(), ".gitignore");
|
|
7231
7239
|
const rulesFilesToIgnore = [
|
|
7232
7240
|
"# Generated by rulesync - AI tool configuration files",
|
|
7233
7241
|
// AGENTS.md
|
|
@@ -7468,7 +7476,7 @@ async function importSubagents(config, tool) {
|
|
|
7468
7476
|
}
|
|
7469
7477
|
|
|
7470
7478
|
// src/cli/commands/init.ts
|
|
7471
|
-
import { join as
|
|
7479
|
+
import { join as join65 } from "path";
|
|
7472
7480
|
async function initCommand() {
|
|
7473
7481
|
logger.info("Initializing rulesync...");
|
|
7474
7482
|
await ensureDir(".rulesync");
|
|
@@ -7629,14 +7637,14 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7629
7637
|
await ensureDir(commandPaths.relativeDirPath);
|
|
7630
7638
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
7631
7639
|
await ensureDir(ignorePaths.relativeDirPath);
|
|
7632
|
-
const ruleFilepath =
|
|
7640
|
+
const ruleFilepath = join65(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
7633
7641
|
if (!await fileExists(ruleFilepath)) {
|
|
7634
7642
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
7635
7643
|
logger.success(`Created ${ruleFilepath}`);
|
|
7636
7644
|
} else {
|
|
7637
7645
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
7638
7646
|
}
|
|
7639
|
-
const mcpFilepath =
|
|
7647
|
+
const mcpFilepath = join65(
|
|
7640
7648
|
mcpPaths.recommended.relativeDirPath,
|
|
7641
7649
|
mcpPaths.recommended.relativeFilePath
|
|
7642
7650
|
);
|
|
@@ -7646,21 +7654,21 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7646
7654
|
} else {
|
|
7647
7655
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
7648
7656
|
}
|
|
7649
|
-
const commandFilepath =
|
|
7657
|
+
const commandFilepath = join65(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
7650
7658
|
if (!await fileExists(commandFilepath)) {
|
|
7651
7659
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
7652
7660
|
logger.success(`Created ${commandFilepath}`);
|
|
7653
7661
|
} else {
|
|
7654
7662
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
7655
7663
|
}
|
|
7656
|
-
const subagentFilepath =
|
|
7664
|
+
const subagentFilepath = join65(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
7657
7665
|
if (!await fileExists(subagentFilepath)) {
|
|
7658
7666
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
7659
7667
|
logger.success(`Created ${subagentFilepath}`);
|
|
7660
7668
|
} else {
|
|
7661
7669
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
7662
7670
|
}
|
|
7663
|
-
const ignoreFilepath =
|
|
7671
|
+
const ignoreFilepath = join65(ignorePaths.relativeDirPath, ignorePaths.relativeFilePath);
|
|
7664
7672
|
if (!await fileExists(ignoreFilepath)) {
|
|
7665
7673
|
await writeFileContent(ignoreFilepath, sampleIgnoreFile.content);
|
|
7666
7674
|
logger.success(`Created ${ignoreFilepath}`);
|
|
@@ -7670,7 +7678,7 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7670
7678
|
}
|
|
7671
7679
|
|
|
7672
7680
|
// src/cli/index.ts
|
|
7673
|
-
var getVersion = () => "3.12.
|
|
7681
|
+
var getVersion = () => "3.12.8";
|
|
7674
7682
|
var main = async () => {
|
|
7675
7683
|
const program = new Command();
|
|
7676
7684
|
const version = getVersion();
|