rulesync 0.78.0 → 0.79.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 +13 -3
- package/dist/index.cjs +102 -70
- package/dist/index.js +97 -65
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/rulesync)
|
|
5
5
|
[](https://www.npmjs.com/package/rulesync)
|
|
6
6
|
|
|
7
|
-
A Node.js CLI tool that automatically generates configuration files for various AI development tools from unified AI rule files. Features selective generation, comprehensive import/export capabilities, and supports
|
|
7
|
+
A Node.js CLI tool that automatically generates configuration files for various AI development tools from unified AI rule files. Features selective generation, comprehensive import/export capabilities, and supports major AI development tools with rules, commands, MCP, ignore files, and subagents. Uses the recommended `.rulesync/rules/*.md` structure, with full backward compatibility for legacy `.rulesync/*.md` layouts.
|
|
8
|
+
|
|
9
|
+
> [!NOTE]
|
|
10
|
+
> If you are interested in rulesync latest news, please follow the maintainer's X(Twitter) account:
|
|
11
|
+
> [@dyoshikawa1993](https://x.com/dyoshikawa1993)
|
|
8
12
|
|
|
9
13
|
## Installation
|
|
10
14
|
|
|
@@ -156,11 +160,17 @@ Example:
|
|
|
156
160
|
|
|
157
161
|
```md
|
|
158
162
|
---
|
|
159
|
-
root: true # true that is less than or equal to one file for overview such as AGENTS.md
|
|
163
|
+
root: true # true that is less than or equal to one file for overview such as `AGENTS.md`, false for details such as `.agents/memories/*.md`
|
|
160
164
|
targets: ["*"] # * = all, or specific tools
|
|
161
165
|
description: "rulesync project overview and development guidelines for unified AI rules management CLI tool"
|
|
162
166
|
globs: ["**/*"] # file patterns to match (e.g., ["*.md", "*.txt"])
|
|
163
|
-
|
|
167
|
+
agentsmd: # agentsmd and codexcli specific rules
|
|
168
|
+
# Support for using nested AGENTS.md files for subprojects in a large monorepo.
|
|
169
|
+
# This option is available only if root is false.
|
|
170
|
+
# If subprojectPath is provided, the file is located in `${subprojectPath}/AGENTS.md`.
|
|
171
|
+
# If subprojectPath is not provided and root is false, the file is located in `.agents/memories/*.md`.
|
|
172
|
+
subprojectPath: "path/to/subproject"
|
|
173
|
+
cursor: # cursor specific rules
|
|
164
174
|
alwaysApply: true
|
|
165
175
|
description: "rulesync project overview and development guidelines for unified AI rules management CLI tool"
|
|
166
176
|
globs: ["*"]
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/cli/index.ts
|
|
27
|
-
var
|
|
27
|
+
var import_node_path57 = require("path");
|
|
28
28
|
var import_node_url = require("url");
|
|
29
29
|
var import_commander = require("commander");
|
|
30
30
|
|
|
@@ -2803,7 +2803,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2803
2803
|
};
|
|
2804
2804
|
|
|
2805
2805
|
// src/rules/rules-processor.ts
|
|
2806
|
-
var
|
|
2806
|
+
var import_node_path54 = require("path");
|
|
2807
2807
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
2808
2808
|
var import_mini20 = require("zod/mini");
|
|
2809
2809
|
|
|
@@ -3503,6 +3503,9 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3503
3503
|
};
|
|
3504
3504
|
|
|
3505
3505
|
// src/rules/agentsmd-rule.ts
|
|
3506
|
+
var import_node_path37 = require("path");
|
|
3507
|
+
|
|
3508
|
+
// src/rules/tool-rule.ts
|
|
3506
3509
|
var import_node_path36 = require("path");
|
|
3507
3510
|
|
|
3508
3511
|
// src/rules/rulesync-rule.ts
|
|
@@ -3513,6 +3516,12 @@ var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
|
|
|
3513
3516
|
targets: import_mini16.z.optional(RulesyncTargetsSchema),
|
|
3514
3517
|
description: import_mini16.z.optional(import_mini16.z.string()),
|
|
3515
3518
|
globs: import_mini16.z.optional(import_mini16.z.array(import_mini16.z.string())),
|
|
3519
|
+
agentsmd: import_mini16.z.optional(
|
|
3520
|
+
import_mini16.z.object({
|
|
3521
|
+
// @example "path/to/subproject"
|
|
3522
|
+
subprojectPath: import_mini16.z.optional(import_mini16.z.string())
|
|
3523
|
+
})
|
|
3524
|
+
),
|
|
3516
3525
|
cursor: import_mini16.z.optional(
|
|
3517
3526
|
import_mini16.z.object({
|
|
3518
3527
|
alwaysApply: import_mini16.z.optional(import_mini16.z.boolean()),
|
|
@@ -3578,6 +3587,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3578
3587
|
targets: result.data.targets ?? ["*"],
|
|
3579
3588
|
description: result.data.description ?? "",
|
|
3580
3589
|
globs: result.data.globs ?? [],
|
|
3590
|
+
agentsmd: result.data.agentsmd,
|
|
3581
3591
|
cursor: result.data.cursor
|
|
3582
3592
|
};
|
|
3583
3593
|
const filename = (0, import_node_path35.basename)(filePath);
|
|
@@ -3606,6 +3616,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3606
3616
|
targets: result.data.targets ?? ["*"],
|
|
3607
3617
|
description: result.data.description ?? "",
|
|
3608
3618
|
globs: result.data.globs ?? [],
|
|
3619
|
+
agentsmd: result.data.agentsmd,
|
|
3609
3620
|
cursor: result.data.cursor
|
|
3610
3621
|
};
|
|
3611
3622
|
const filename = (0, import_node_path35.basename)(filePath);
|
|
@@ -3659,6 +3670,27 @@ var ToolRule = class extends ToolFile {
|
|
|
3659
3670
|
globs: rulesyncRule.getFrontmatter().globs
|
|
3660
3671
|
};
|
|
3661
3672
|
}
|
|
3673
|
+
static buildToolRuleParamsAgentsmd({
|
|
3674
|
+
baseDir = ".",
|
|
3675
|
+
rulesyncRule,
|
|
3676
|
+
validate = true,
|
|
3677
|
+
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
3678
|
+
nonRootPath = { relativeDirPath: ".agents/memories" }
|
|
3679
|
+
}) {
|
|
3680
|
+
const params = this.buildToolRuleParamsDefault({
|
|
3681
|
+
baseDir,
|
|
3682
|
+
rulesyncRule,
|
|
3683
|
+
validate,
|
|
3684
|
+
rootPath,
|
|
3685
|
+
nonRootPath
|
|
3686
|
+
});
|
|
3687
|
+
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3688
|
+
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3689
|
+
params.relativeDirPath = (0, import_node_path36.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3690
|
+
params.relativeFilePath = "AGENTS.md";
|
|
3691
|
+
}
|
|
3692
|
+
return params;
|
|
3693
|
+
}
|
|
3662
3694
|
toRulesyncRuleDefault() {
|
|
3663
3695
|
return new RulesyncRule({
|
|
3664
3696
|
baseDir: this.getBaseDir(),
|
|
@@ -3729,8 +3761,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3729
3761
|
validate = true
|
|
3730
3762
|
}) {
|
|
3731
3763
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3732
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
3733
|
-
const fileContent = await readFileContent((0,
|
|
3764
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path37.join)(".agents/memories", relativeFilePath);
|
|
3765
|
+
const fileContent = await readFileContent((0, import_node_path37.join)(baseDir, relativePath));
|
|
3734
3766
|
return new _AgentsMdRule({
|
|
3735
3767
|
baseDir,
|
|
3736
3768
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -3746,7 +3778,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3746
3778
|
validate = true
|
|
3747
3779
|
}) {
|
|
3748
3780
|
return new _AgentsMdRule(
|
|
3749
|
-
this.
|
|
3781
|
+
this.buildToolRuleParamsAgentsmd({
|
|
3750
3782
|
baseDir,
|
|
3751
3783
|
rulesyncRule,
|
|
3752
3784
|
validate,
|
|
@@ -3770,7 +3802,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3770
3802
|
};
|
|
3771
3803
|
|
|
3772
3804
|
// src/rules/amazonqcli-rule.ts
|
|
3773
|
-
var
|
|
3805
|
+
var import_node_path38 = require("path");
|
|
3774
3806
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
3775
3807
|
static getSettablePaths() {
|
|
3776
3808
|
return {
|
|
@@ -3785,7 +3817,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3785
3817
|
validate = true
|
|
3786
3818
|
}) {
|
|
3787
3819
|
const fileContent = await readFileContent(
|
|
3788
|
-
(0,
|
|
3820
|
+
(0, import_node_path38.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3789
3821
|
);
|
|
3790
3822
|
return new _AmazonQCliRule({
|
|
3791
3823
|
baseDir,
|
|
@@ -3825,7 +3857,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3825
3857
|
};
|
|
3826
3858
|
|
|
3827
3859
|
// src/rules/augmentcode-legacy-rule.ts
|
|
3828
|
-
var
|
|
3860
|
+
var import_node_path39 = require("path");
|
|
3829
3861
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
3830
3862
|
toRulesyncRule() {
|
|
3831
3863
|
const rulesyncFrontmatter = {
|
|
@@ -3885,8 +3917,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3885
3917
|
}) {
|
|
3886
3918
|
const settablePaths = this.getSettablePaths();
|
|
3887
3919
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
3888
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
3889
|
-
const fileContent = await readFileContent((0,
|
|
3920
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path39.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
3921
|
+
const fileContent = await readFileContent((0, import_node_path39.join)(baseDir, relativePath));
|
|
3890
3922
|
return new _AugmentcodeLegacyRule({
|
|
3891
3923
|
baseDir,
|
|
3892
3924
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -3899,7 +3931,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3899
3931
|
};
|
|
3900
3932
|
|
|
3901
3933
|
// src/rules/augmentcode-rule.ts
|
|
3902
|
-
var
|
|
3934
|
+
var import_node_path40 = require("path");
|
|
3903
3935
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
3904
3936
|
toRulesyncRule() {
|
|
3905
3937
|
return this.toRulesyncRuleDefault();
|
|
@@ -3931,7 +3963,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3931
3963
|
validate = true
|
|
3932
3964
|
}) {
|
|
3933
3965
|
const fileContent = await readFileContent(
|
|
3934
|
-
(0,
|
|
3966
|
+
(0, import_node_path40.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3935
3967
|
);
|
|
3936
3968
|
const { body: content } = parseFrontmatter(fileContent);
|
|
3937
3969
|
return new _AugmentcodeRule({
|
|
@@ -3954,7 +3986,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3954
3986
|
};
|
|
3955
3987
|
|
|
3956
3988
|
// src/rules/claudecode-rule.ts
|
|
3957
|
-
var
|
|
3989
|
+
var import_node_path41 = require("path");
|
|
3958
3990
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
3959
3991
|
static getSettablePaths() {
|
|
3960
3992
|
return {
|
|
@@ -3973,8 +4005,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
3973
4005
|
validate = true
|
|
3974
4006
|
}) {
|
|
3975
4007
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
3976
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
3977
|
-
const fileContent = await readFileContent((0,
|
|
4008
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path41.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4009
|
+
const fileContent = await readFileContent((0, import_node_path41.join)(baseDir, relativePath));
|
|
3978
4010
|
return new _ClaudecodeRule({
|
|
3979
4011
|
baseDir,
|
|
3980
4012
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4014,7 +4046,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4014
4046
|
};
|
|
4015
4047
|
|
|
4016
4048
|
// src/rules/cline-rule.ts
|
|
4017
|
-
var
|
|
4049
|
+
var import_node_path42 = require("path");
|
|
4018
4050
|
var import_mini17 = require("zod/mini");
|
|
4019
4051
|
var ClineRuleFrontmatterSchema = import_mini17.z.object({
|
|
4020
4052
|
description: import_mini17.z.string()
|
|
@@ -4059,7 +4091,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4059
4091
|
validate = true
|
|
4060
4092
|
}) {
|
|
4061
4093
|
const fileContent = await readFileContent(
|
|
4062
|
-
(0,
|
|
4094
|
+
(0, import_node_path42.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4063
4095
|
);
|
|
4064
4096
|
return new _ClineRule({
|
|
4065
4097
|
baseDir,
|
|
@@ -4072,7 +4104,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4072
4104
|
};
|
|
4073
4105
|
|
|
4074
4106
|
// src/rules/codexcli-rule.ts
|
|
4075
|
-
var
|
|
4107
|
+
var import_node_path43 = require("path");
|
|
4076
4108
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4077
4109
|
static getSettablePaths() {
|
|
4078
4110
|
return {
|
|
@@ -4091,8 +4123,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4091
4123
|
validate = true
|
|
4092
4124
|
}) {
|
|
4093
4125
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4094
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4095
|
-
const fileContent = await readFileContent((0,
|
|
4126
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path43.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4127
|
+
const fileContent = await readFileContent((0, import_node_path43.join)(baseDir, relativePath));
|
|
4096
4128
|
return new _CodexcliRule({
|
|
4097
4129
|
baseDir,
|
|
4098
4130
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4108,7 +4140,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4108
4140
|
validate = true
|
|
4109
4141
|
}) {
|
|
4110
4142
|
return new _CodexcliRule(
|
|
4111
|
-
this.
|
|
4143
|
+
this.buildToolRuleParamsAgentsmd({
|
|
4112
4144
|
baseDir,
|
|
4113
4145
|
rulesyncRule,
|
|
4114
4146
|
validate,
|
|
@@ -4132,7 +4164,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4132
4164
|
};
|
|
4133
4165
|
|
|
4134
4166
|
// src/rules/copilot-rule.ts
|
|
4135
|
-
var
|
|
4167
|
+
var import_node_path44 = require("path");
|
|
4136
4168
|
var import_mini18 = require("zod/mini");
|
|
4137
4169
|
var CopilotRuleFrontmatterSchema = import_mini18.z.object({
|
|
4138
4170
|
description: import_mini18.z.optional(import_mini18.z.string()),
|
|
@@ -4224,11 +4256,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4224
4256
|
validate = true
|
|
4225
4257
|
}) {
|
|
4226
4258
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4227
|
-
const relativePath = isRoot ? (0,
|
|
4259
|
+
const relativePath = isRoot ? (0, import_node_path44.join)(
|
|
4228
4260
|
this.getSettablePaths().root.relativeDirPath,
|
|
4229
4261
|
this.getSettablePaths().root.relativeFilePath
|
|
4230
|
-
) : (0,
|
|
4231
|
-
const fileContent = await readFileContent((0,
|
|
4262
|
+
) : (0, import_node_path44.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4263
|
+
const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
|
|
4232
4264
|
if (isRoot) {
|
|
4233
4265
|
return new _CopilotRule({
|
|
4234
4266
|
baseDir,
|
|
@@ -4247,7 +4279,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4247
4279
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4248
4280
|
if (!result.success) {
|
|
4249
4281
|
throw new Error(
|
|
4250
|
-
`Invalid frontmatter in ${(0,
|
|
4282
|
+
`Invalid frontmatter in ${(0, import_node_path44.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4251
4283
|
);
|
|
4252
4284
|
}
|
|
4253
4285
|
return new _CopilotRule({
|
|
@@ -4286,7 +4318,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4286
4318
|
};
|
|
4287
4319
|
|
|
4288
4320
|
// src/rules/cursor-rule.ts
|
|
4289
|
-
var
|
|
4321
|
+
var import_node_path45 = require("path");
|
|
4290
4322
|
var import_mini19 = require("zod/mini");
|
|
4291
4323
|
var CursorRuleFrontmatterSchema = import_mini19.z.object({
|
|
4292
4324
|
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
@@ -4416,19 +4448,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4416
4448
|
validate = true
|
|
4417
4449
|
}) {
|
|
4418
4450
|
const fileContent = await readFileContent(
|
|
4419
|
-
(0,
|
|
4451
|
+
(0, import_node_path45.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4420
4452
|
);
|
|
4421
4453
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4422
4454
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4423
4455
|
if (!result.success) {
|
|
4424
4456
|
throw new Error(
|
|
4425
|
-
`Invalid frontmatter in ${(0,
|
|
4457
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4426
4458
|
);
|
|
4427
4459
|
}
|
|
4428
4460
|
return new _CursorRule({
|
|
4429
4461
|
baseDir,
|
|
4430
4462
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
4431
|
-
relativeFilePath: (0,
|
|
4463
|
+
relativeFilePath: (0, import_node_path45.basename)(relativeFilePath),
|
|
4432
4464
|
frontmatter: result.data,
|
|
4433
4465
|
body: content.trim(),
|
|
4434
4466
|
validate
|
|
@@ -4460,7 +4492,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4460
4492
|
};
|
|
4461
4493
|
|
|
4462
4494
|
// src/rules/geminicli-rule.ts
|
|
4463
|
-
var
|
|
4495
|
+
var import_node_path46 = require("path");
|
|
4464
4496
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4465
4497
|
static getSettablePaths() {
|
|
4466
4498
|
return {
|
|
@@ -4479,8 +4511,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4479
4511
|
validate = true
|
|
4480
4512
|
}) {
|
|
4481
4513
|
const isRoot = relativeFilePath === "GEMINI.md";
|
|
4482
|
-
const relativePath = isRoot ? "GEMINI.md" : (0,
|
|
4483
|
-
const fileContent = await readFileContent((0,
|
|
4514
|
+
const relativePath = isRoot ? "GEMINI.md" : (0, import_node_path46.join)(".gemini/memories", relativeFilePath);
|
|
4515
|
+
const fileContent = await readFileContent((0, import_node_path46.join)(baseDir, relativePath));
|
|
4484
4516
|
return new _GeminiCliRule({
|
|
4485
4517
|
baseDir,
|
|
4486
4518
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4520,7 +4552,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4520
4552
|
};
|
|
4521
4553
|
|
|
4522
4554
|
// src/rules/junie-rule.ts
|
|
4523
|
-
var
|
|
4555
|
+
var import_node_path47 = require("path");
|
|
4524
4556
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4525
4557
|
static getSettablePaths() {
|
|
4526
4558
|
return {
|
|
@@ -4539,8 +4571,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4539
4571
|
validate = true
|
|
4540
4572
|
}) {
|
|
4541
4573
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4542
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
4543
|
-
const fileContent = await readFileContent((0,
|
|
4574
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path47.join)(".junie/memories", relativeFilePath);
|
|
4575
|
+
const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
|
|
4544
4576
|
return new _JunieRule({
|
|
4545
4577
|
baseDir,
|
|
4546
4578
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4580,7 +4612,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4580
4612
|
};
|
|
4581
4613
|
|
|
4582
4614
|
// src/rules/kiro-rule.ts
|
|
4583
|
-
var
|
|
4615
|
+
var import_node_path48 = require("path");
|
|
4584
4616
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4585
4617
|
static getSettablePaths() {
|
|
4586
4618
|
return {
|
|
@@ -4595,7 +4627,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4595
4627
|
validate = true
|
|
4596
4628
|
}) {
|
|
4597
4629
|
const fileContent = await readFileContent(
|
|
4598
|
-
(0,
|
|
4630
|
+
(0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4599
4631
|
);
|
|
4600
4632
|
return new _KiroRule({
|
|
4601
4633
|
baseDir,
|
|
@@ -4635,7 +4667,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4635
4667
|
};
|
|
4636
4668
|
|
|
4637
4669
|
// src/rules/opencode-rule.ts
|
|
4638
|
-
var
|
|
4670
|
+
var import_node_path49 = require("path");
|
|
4639
4671
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4640
4672
|
static getSettablePaths() {
|
|
4641
4673
|
return {
|
|
@@ -4654,8 +4686,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4654
4686
|
validate = true
|
|
4655
4687
|
}) {
|
|
4656
4688
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4657
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4658
|
-
const fileContent = await readFileContent((0,
|
|
4689
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path49.join)(".opencode/memories", relativeFilePath);
|
|
4690
|
+
const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
|
|
4659
4691
|
return new _OpenCodeRule({
|
|
4660
4692
|
baseDir,
|
|
4661
4693
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4695,7 +4727,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4695
4727
|
};
|
|
4696
4728
|
|
|
4697
4729
|
// src/rules/qwencode-rule.ts
|
|
4698
|
-
var
|
|
4730
|
+
var import_node_path50 = require("path");
|
|
4699
4731
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
4700
4732
|
static getSettablePaths() {
|
|
4701
4733
|
return {
|
|
@@ -4714,8 +4746,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4714
4746
|
validate = true
|
|
4715
4747
|
}) {
|
|
4716
4748
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
4717
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
4718
|
-
const fileContent = await readFileContent((0,
|
|
4749
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path50.join)(".qwen/memories", relativeFilePath);
|
|
4750
|
+
const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
|
|
4719
4751
|
return new _QwencodeRule({
|
|
4720
4752
|
baseDir,
|
|
4721
4753
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4752,7 +4784,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4752
4784
|
};
|
|
4753
4785
|
|
|
4754
4786
|
// src/rules/roo-rule.ts
|
|
4755
|
-
var
|
|
4787
|
+
var import_node_path51 = require("path");
|
|
4756
4788
|
var RooRule = class _RooRule extends ToolRule {
|
|
4757
4789
|
static getSettablePaths() {
|
|
4758
4790
|
return {
|
|
@@ -4767,7 +4799,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4767
4799
|
validate = true
|
|
4768
4800
|
}) {
|
|
4769
4801
|
const fileContent = await readFileContent(
|
|
4770
|
-
(0,
|
|
4802
|
+
(0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4771
4803
|
);
|
|
4772
4804
|
return new _RooRule({
|
|
4773
4805
|
baseDir,
|
|
@@ -4822,7 +4854,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4822
4854
|
};
|
|
4823
4855
|
|
|
4824
4856
|
// src/rules/warp-rule.ts
|
|
4825
|
-
var
|
|
4857
|
+
var import_node_path52 = require("path");
|
|
4826
4858
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
4827
4859
|
constructor({ fileContent, root, ...rest }) {
|
|
4828
4860
|
super({
|
|
@@ -4848,8 +4880,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4848
4880
|
validate = true
|
|
4849
4881
|
}) {
|
|
4850
4882
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
4851
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
4852
|
-
const fileContent = await readFileContent((0,
|
|
4883
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path52.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4884
|
+
const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
|
|
4853
4885
|
return new _WarpRule({
|
|
4854
4886
|
baseDir,
|
|
4855
4887
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -4889,7 +4921,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4889
4921
|
};
|
|
4890
4922
|
|
|
4891
4923
|
// src/rules/windsurf-rule.ts
|
|
4892
|
-
var
|
|
4924
|
+
var import_node_path53 = require("path");
|
|
4893
4925
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
4894
4926
|
static getSettablePaths() {
|
|
4895
4927
|
return {
|
|
@@ -4904,7 +4936,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
4904
4936
|
validate = true
|
|
4905
4937
|
}) {
|
|
4906
4938
|
const fileContent = await readFileContent(
|
|
4907
|
-
(0,
|
|
4939
|
+
(0, import_node_path53.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4908
4940
|
);
|
|
4909
4941
|
return new _WindsurfRule({
|
|
4910
4942
|
baseDir,
|
|
@@ -5283,17 +5315,17 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5283
5315
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5284
5316
|
*/
|
|
5285
5317
|
async loadRulesyncFiles() {
|
|
5286
|
-
const files = await findFilesByGlobs((0,
|
|
5318
|
+
const files = await findFilesByGlobs((0, import_node_path54.join)(RULESYNC_RULES_DIR, "*.md"));
|
|
5287
5319
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5288
5320
|
return Promise.all(
|
|
5289
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
5321
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path54.basename)(file) }))
|
|
5290
5322
|
);
|
|
5291
5323
|
}
|
|
5292
5324
|
async loadRulesyncFilesLegacy() {
|
|
5293
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
5325
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path54.join)(RULESYNC_RULES_DIR_LEGACY, "*.md"));
|
|
5294
5326
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5295
5327
|
return Promise.all(
|
|
5296
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
5328
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path54.basename)(file) }))
|
|
5297
5329
|
);
|
|
5298
5330
|
}
|
|
5299
5331
|
/**
|
|
@@ -5354,13 +5386,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5354
5386
|
return [];
|
|
5355
5387
|
}
|
|
5356
5388
|
const rootFilePaths = await findFilesByGlobs(
|
|
5357
|
-
(0,
|
|
5389
|
+
(0, import_node_path54.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5358
5390
|
);
|
|
5359
5391
|
return await Promise.all(
|
|
5360
5392
|
rootFilePaths.map(
|
|
5361
5393
|
(filePath) => root.fromFile({
|
|
5362
5394
|
baseDir: this.baseDir,
|
|
5363
|
-
relativeFilePath: (0,
|
|
5395
|
+
relativeFilePath: (0, import_node_path54.basename)(filePath)
|
|
5364
5396
|
})
|
|
5365
5397
|
)
|
|
5366
5398
|
);
|
|
@@ -5371,13 +5403,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5371
5403
|
return [];
|
|
5372
5404
|
}
|
|
5373
5405
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5374
|
-
(0,
|
|
5406
|
+
(0, import_node_path54.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5375
5407
|
);
|
|
5376
5408
|
return await Promise.all(
|
|
5377
5409
|
nonRootFilePaths.map(
|
|
5378
5410
|
(filePath) => nonRoot.fromFile({
|
|
5379
5411
|
baseDir: this.baseDir,
|
|
5380
|
-
relativeFilePath: (0,
|
|
5412
|
+
relativeFilePath: (0, import_node_path54.basename)(filePath)
|
|
5381
5413
|
})
|
|
5382
5414
|
)
|
|
5383
5415
|
);
|
|
@@ -5737,14 +5769,14 @@ s/<command> [arguments]
|
|
|
5737
5769
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
5738
5770
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
5739
5771
|
|
|
5740
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
5772
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path54.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.`;
|
|
5741
5773
|
const subagentsSection = `## Simulated Subagents
|
|
5742
5774
|
|
|
5743
5775
|
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.
|
|
5744
5776
|
|
|
5745
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
5777
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
5746
5778
|
|
|
5747
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
5779
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.`;
|
|
5748
5780
|
const result = [
|
|
5749
5781
|
overview,
|
|
5750
5782
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -5931,9 +5963,9 @@ async function generateCommand(options) {
|
|
|
5931
5963
|
}
|
|
5932
5964
|
|
|
5933
5965
|
// src/cli/commands/gitignore.ts
|
|
5934
|
-
var
|
|
5966
|
+
var import_node_path55 = require("path");
|
|
5935
5967
|
var gitignoreCommand = async () => {
|
|
5936
|
-
const gitignorePath = (0,
|
|
5968
|
+
const gitignorePath = (0, import_node_path55.join)(process.cwd(), ".gitignore");
|
|
5937
5969
|
const rulesFilesToIgnore = [
|
|
5938
5970
|
"# Generated by rulesync - AI tool configuration files",
|
|
5939
5971
|
"**/.amazonq/",
|
|
@@ -6123,7 +6155,7 @@ async function importCommand(options) {
|
|
|
6123
6155
|
}
|
|
6124
6156
|
|
|
6125
6157
|
// src/cli/commands/init.ts
|
|
6126
|
-
var
|
|
6158
|
+
var import_node_path56 = require("path");
|
|
6127
6159
|
async function initCommand() {
|
|
6128
6160
|
logger.info("Initializing rulesync...");
|
|
6129
6161
|
await ensureDir(RULESYNC_DIR);
|
|
@@ -6169,7 +6201,7 @@ globs: ["**/*"]
|
|
|
6169
6201
|
- Follow single responsibility principle
|
|
6170
6202
|
`
|
|
6171
6203
|
};
|
|
6172
|
-
const filepath = (0,
|
|
6204
|
+
const filepath = (0, import_node_path56.join)(RULESYNC_RULES_DIR, sampleFile.filename);
|
|
6173
6205
|
await ensureDir(RULESYNC_RULES_DIR);
|
|
6174
6206
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6175
6207
|
await ensureDir(RULESYNC_SUBAGENTS_DIR);
|
|
@@ -6188,15 +6220,15 @@ var getVersion = async () => {
|
|
|
6188
6220
|
let packageJsonPath;
|
|
6189
6221
|
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
6190
6222
|
const __filename = (0, import_node_url.fileURLToPath)(import_meta.url);
|
|
6191
|
-
const __dirname = (0,
|
|
6192
|
-
packageJsonPath = (0,
|
|
6223
|
+
const __dirname = (0, import_node_path57.join)(__filename, "..");
|
|
6224
|
+
packageJsonPath = (0, import_node_path57.join)(__dirname, "../../package.json");
|
|
6193
6225
|
} else {
|
|
6194
|
-
packageJsonPath = (0,
|
|
6226
|
+
packageJsonPath = (0, import_node_path57.join)(process.cwd(), "package.json");
|
|
6195
6227
|
}
|
|
6196
6228
|
const packageJson = await readJsonFile(packageJsonPath);
|
|
6197
6229
|
return packageJson.version;
|
|
6198
6230
|
} catch {
|
|
6199
|
-
return "0.
|
|
6231
|
+
return "0.79.0";
|
|
6200
6232
|
}
|
|
6201
6233
|
};
|
|
6202
6234
|
var main = async () => {
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli/index.ts
|
|
4
|
-
import { join as
|
|
4
|
+
import { join as join56 } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
|
|
@@ -2780,7 +2780,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2780
2780
|
};
|
|
2781
2781
|
|
|
2782
2782
|
// src/rules/rules-processor.ts
|
|
2783
|
-
import { basename as basename16, join as
|
|
2783
|
+
import { basename as basename16, join as join53 } from "path";
|
|
2784
2784
|
import { XMLBuilder } from "fast-xml-parser";
|
|
2785
2785
|
import { z as z20 } from "zod/mini";
|
|
2786
2786
|
|
|
@@ -3480,6 +3480,9 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3480
3480
|
};
|
|
3481
3481
|
|
|
3482
3482
|
// src/rules/agentsmd-rule.ts
|
|
3483
|
+
import { join as join36 } from "path";
|
|
3484
|
+
|
|
3485
|
+
// src/rules/tool-rule.ts
|
|
3483
3486
|
import { join as join35 } from "path";
|
|
3484
3487
|
|
|
3485
3488
|
// src/rules/rulesync-rule.ts
|
|
@@ -3490,6 +3493,12 @@ var RulesyncRuleFrontmatterSchema = z16.object({
|
|
|
3490
3493
|
targets: z16.optional(RulesyncTargetsSchema),
|
|
3491
3494
|
description: z16.optional(z16.string()),
|
|
3492
3495
|
globs: z16.optional(z16.array(z16.string())),
|
|
3496
|
+
agentsmd: z16.optional(
|
|
3497
|
+
z16.object({
|
|
3498
|
+
// @example "path/to/subproject"
|
|
3499
|
+
subprojectPath: z16.optional(z16.string())
|
|
3500
|
+
})
|
|
3501
|
+
),
|
|
3493
3502
|
cursor: z16.optional(
|
|
3494
3503
|
z16.object({
|
|
3495
3504
|
alwaysApply: z16.optional(z16.boolean()),
|
|
@@ -3555,6 +3564,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3555
3564
|
targets: result.data.targets ?? ["*"],
|
|
3556
3565
|
description: result.data.description ?? "",
|
|
3557
3566
|
globs: result.data.globs ?? [],
|
|
3567
|
+
agentsmd: result.data.agentsmd,
|
|
3558
3568
|
cursor: result.data.cursor
|
|
3559
3569
|
};
|
|
3560
3570
|
const filename = basename14(filePath);
|
|
@@ -3583,6 +3593,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3583
3593
|
targets: result.data.targets ?? ["*"],
|
|
3584
3594
|
description: result.data.description ?? "",
|
|
3585
3595
|
globs: result.data.globs ?? [],
|
|
3596
|
+
agentsmd: result.data.agentsmd,
|
|
3586
3597
|
cursor: result.data.cursor
|
|
3587
3598
|
};
|
|
3588
3599
|
const filename = basename14(filePath);
|
|
@@ -3636,6 +3647,27 @@ var ToolRule = class extends ToolFile {
|
|
|
3636
3647
|
globs: rulesyncRule.getFrontmatter().globs
|
|
3637
3648
|
};
|
|
3638
3649
|
}
|
|
3650
|
+
static buildToolRuleParamsAgentsmd({
|
|
3651
|
+
baseDir = ".",
|
|
3652
|
+
rulesyncRule,
|
|
3653
|
+
validate = true,
|
|
3654
|
+
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
3655
|
+
nonRootPath = { relativeDirPath: ".agents/memories" }
|
|
3656
|
+
}) {
|
|
3657
|
+
const params = this.buildToolRuleParamsDefault({
|
|
3658
|
+
baseDir,
|
|
3659
|
+
rulesyncRule,
|
|
3660
|
+
validate,
|
|
3661
|
+
rootPath,
|
|
3662
|
+
nonRootPath
|
|
3663
|
+
});
|
|
3664
|
+
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3665
|
+
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3666
|
+
params.relativeDirPath = join35(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3667
|
+
params.relativeFilePath = "AGENTS.md";
|
|
3668
|
+
}
|
|
3669
|
+
return params;
|
|
3670
|
+
}
|
|
3639
3671
|
toRulesyncRuleDefault() {
|
|
3640
3672
|
return new RulesyncRule({
|
|
3641
3673
|
baseDir: this.getBaseDir(),
|
|
@@ -3706,8 +3738,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3706
3738
|
validate = true
|
|
3707
3739
|
}) {
|
|
3708
3740
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3709
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
3710
|
-
const fileContent = await readFileContent(
|
|
3741
|
+
const relativePath = isRoot ? "AGENTS.md" : join36(".agents/memories", relativeFilePath);
|
|
3742
|
+
const fileContent = await readFileContent(join36(baseDir, relativePath));
|
|
3711
3743
|
return new _AgentsMdRule({
|
|
3712
3744
|
baseDir,
|
|
3713
3745
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -3723,7 +3755,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3723
3755
|
validate = true
|
|
3724
3756
|
}) {
|
|
3725
3757
|
return new _AgentsMdRule(
|
|
3726
|
-
this.
|
|
3758
|
+
this.buildToolRuleParamsAgentsmd({
|
|
3727
3759
|
baseDir,
|
|
3728
3760
|
rulesyncRule,
|
|
3729
3761
|
validate,
|
|
@@ -3747,7 +3779,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3747
3779
|
};
|
|
3748
3780
|
|
|
3749
3781
|
// src/rules/amazonqcli-rule.ts
|
|
3750
|
-
import { join as
|
|
3782
|
+
import { join as join37 } from "path";
|
|
3751
3783
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
3752
3784
|
static getSettablePaths() {
|
|
3753
3785
|
return {
|
|
@@ -3762,7 +3794,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3762
3794
|
validate = true
|
|
3763
3795
|
}) {
|
|
3764
3796
|
const fileContent = await readFileContent(
|
|
3765
|
-
|
|
3797
|
+
join37(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3766
3798
|
);
|
|
3767
3799
|
return new _AmazonQCliRule({
|
|
3768
3800
|
baseDir,
|
|
@@ -3802,7 +3834,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3802
3834
|
};
|
|
3803
3835
|
|
|
3804
3836
|
// src/rules/augmentcode-legacy-rule.ts
|
|
3805
|
-
import { join as
|
|
3837
|
+
import { join as join38 } from "path";
|
|
3806
3838
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
3807
3839
|
toRulesyncRule() {
|
|
3808
3840
|
const rulesyncFrontmatter = {
|
|
@@ -3862,8 +3894,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3862
3894
|
}) {
|
|
3863
3895
|
const settablePaths = this.getSettablePaths();
|
|
3864
3896
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
3865
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
3866
|
-
const fileContent = await readFileContent(
|
|
3897
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join38(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
3898
|
+
const fileContent = await readFileContent(join38(baseDir, relativePath));
|
|
3867
3899
|
return new _AugmentcodeLegacyRule({
|
|
3868
3900
|
baseDir,
|
|
3869
3901
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -3876,7 +3908,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3876
3908
|
};
|
|
3877
3909
|
|
|
3878
3910
|
// src/rules/augmentcode-rule.ts
|
|
3879
|
-
import { join as
|
|
3911
|
+
import { join as join39 } from "path";
|
|
3880
3912
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
3881
3913
|
toRulesyncRule() {
|
|
3882
3914
|
return this.toRulesyncRuleDefault();
|
|
@@ -3908,7 +3940,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3908
3940
|
validate = true
|
|
3909
3941
|
}) {
|
|
3910
3942
|
const fileContent = await readFileContent(
|
|
3911
|
-
|
|
3943
|
+
join39(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3912
3944
|
);
|
|
3913
3945
|
const { body: content } = parseFrontmatter(fileContent);
|
|
3914
3946
|
return new _AugmentcodeRule({
|
|
@@ -3931,7 +3963,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3931
3963
|
};
|
|
3932
3964
|
|
|
3933
3965
|
// src/rules/claudecode-rule.ts
|
|
3934
|
-
import { join as
|
|
3966
|
+
import { join as join40 } from "path";
|
|
3935
3967
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
3936
3968
|
static getSettablePaths() {
|
|
3937
3969
|
return {
|
|
@@ -3950,8 +3982,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
3950
3982
|
validate = true
|
|
3951
3983
|
}) {
|
|
3952
3984
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
3953
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
3954
|
-
const fileContent = await readFileContent(
|
|
3985
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join40(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
3986
|
+
const fileContent = await readFileContent(join40(baseDir, relativePath));
|
|
3955
3987
|
return new _ClaudecodeRule({
|
|
3956
3988
|
baseDir,
|
|
3957
3989
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -3991,7 +4023,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
3991
4023
|
};
|
|
3992
4024
|
|
|
3993
4025
|
// src/rules/cline-rule.ts
|
|
3994
|
-
import { join as
|
|
4026
|
+
import { join as join41 } from "path";
|
|
3995
4027
|
import { z as z17 } from "zod/mini";
|
|
3996
4028
|
var ClineRuleFrontmatterSchema = z17.object({
|
|
3997
4029
|
description: z17.string()
|
|
@@ -4036,7 +4068,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4036
4068
|
validate = true
|
|
4037
4069
|
}) {
|
|
4038
4070
|
const fileContent = await readFileContent(
|
|
4039
|
-
|
|
4071
|
+
join41(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4040
4072
|
);
|
|
4041
4073
|
return new _ClineRule({
|
|
4042
4074
|
baseDir,
|
|
@@ -4049,7 +4081,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4049
4081
|
};
|
|
4050
4082
|
|
|
4051
4083
|
// src/rules/codexcli-rule.ts
|
|
4052
|
-
import { join as
|
|
4084
|
+
import { join as join42 } from "path";
|
|
4053
4085
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4054
4086
|
static getSettablePaths() {
|
|
4055
4087
|
return {
|
|
@@ -4068,8 +4100,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4068
4100
|
validate = true
|
|
4069
4101
|
}) {
|
|
4070
4102
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4071
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4072
|
-
const fileContent = await readFileContent(
|
|
4103
|
+
const relativePath = isRoot ? "AGENTS.md" : join42(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4104
|
+
const fileContent = await readFileContent(join42(baseDir, relativePath));
|
|
4073
4105
|
return new _CodexcliRule({
|
|
4074
4106
|
baseDir,
|
|
4075
4107
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4085,7 +4117,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4085
4117
|
validate = true
|
|
4086
4118
|
}) {
|
|
4087
4119
|
return new _CodexcliRule(
|
|
4088
|
-
this.
|
|
4120
|
+
this.buildToolRuleParamsAgentsmd({
|
|
4089
4121
|
baseDir,
|
|
4090
4122
|
rulesyncRule,
|
|
4091
4123
|
validate,
|
|
@@ -4109,7 +4141,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4109
4141
|
};
|
|
4110
4142
|
|
|
4111
4143
|
// src/rules/copilot-rule.ts
|
|
4112
|
-
import { join as
|
|
4144
|
+
import { join as join43 } from "path";
|
|
4113
4145
|
import { z as z18 } from "zod/mini";
|
|
4114
4146
|
var CopilotRuleFrontmatterSchema = z18.object({
|
|
4115
4147
|
description: z18.optional(z18.string()),
|
|
@@ -4201,11 +4233,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4201
4233
|
validate = true
|
|
4202
4234
|
}) {
|
|
4203
4235
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4204
|
-
const relativePath = isRoot ?
|
|
4236
|
+
const relativePath = isRoot ? join43(
|
|
4205
4237
|
this.getSettablePaths().root.relativeDirPath,
|
|
4206
4238
|
this.getSettablePaths().root.relativeFilePath
|
|
4207
|
-
) :
|
|
4208
|
-
const fileContent = await readFileContent(
|
|
4239
|
+
) : join43(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4240
|
+
const fileContent = await readFileContent(join43(baseDir, relativePath));
|
|
4209
4241
|
if (isRoot) {
|
|
4210
4242
|
return new _CopilotRule({
|
|
4211
4243
|
baseDir,
|
|
@@ -4224,7 +4256,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4224
4256
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4225
4257
|
if (!result.success) {
|
|
4226
4258
|
throw new Error(
|
|
4227
|
-
`Invalid frontmatter in ${
|
|
4259
|
+
`Invalid frontmatter in ${join43(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4228
4260
|
);
|
|
4229
4261
|
}
|
|
4230
4262
|
return new _CopilotRule({
|
|
@@ -4263,7 +4295,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4263
4295
|
};
|
|
4264
4296
|
|
|
4265
4297
|
// src/rules/cursor-rule.ts
|
|
4266
|
-
import { basename as basename15, join as
|
|
4298
|
+
import { basename as basename15, join as join44 } from "path";
|
|
4267
4299
|
import { z as z19 } from "zod/mini";
|
|
4268
4300
|
var CursorRuleFrontmatterSchema = z19.object({
|
|
4269
4301
|
description: z19.optional(z19.string()),
|
|
@@ -4393,13 +4425,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4393
4425
|
validate = true
|
|
4394
4426
|
}) {
|
|
4395
4427
|
const fileContent = await readFileContent(
|
|
4396
|
-
|
|
4428
|
+
join44(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4397
4429
|
);
|
|
4398
4430
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4399
4431
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4400
4432
|
if (!result.success) {
|
|
4401
4433
|
throw new Error(
|
|
4402
|
-
`Invalid frontmatter in ${
|
|
4434
|
+
`Invalid frontmatter in ${join44(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4403
4435
|
);
|
|
4404
4436
|
}
|
|
4405
4437
|
return new _CursorRule({
|
|
@@ -4437,7 +4469,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4437
4469
|
};
|
|
4438
4470
|
|
|
4439
4471
|
// src/rules/geminicli-rule.ts
|
|
4440
|
-
import { join as
|
|
4472
|
+
import { join as join45 } from "path";
|
|
4441
4473
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4442
4474
|
static getSettablePaths() {
|
|
4443
4475
|
return {
|
|
@@ -4456,8 +4488,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4456
4488
|
validate = true
|
|
4457
4489
|
}) {
|
|
4458
4490
|
const isRoot = relativeFilePath === "GEMINI.md";
|
|
4459
|
-
const relativePath = isRoot ? "GEMINI.md" :
|
|
4460
|
-
const fileContent = await readFileContent(
|
|
4491
|
+
const relativePath = isRoot ? "GEMINI.md" : join45(".gemini/memories", relativeFilePath);
|
|
4492
|
+
const fileContent = await readFileContent(join45(baseDir, relativePath));
|
|
4461
4493
|
return new _GeminiCliRule({
|
|
4462
4494
|
baseDir,
|
|
4463
4495
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4497,7 +4529,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4497
4529
|
};
|
|
4498
4530
|
|
|
4499
4531
|
// src/rules/junie-rule.ts
|
|
4500
|
-
import { join as
|
|
4532
|
+
import { join as join46 } from "path";
|
|
4501
4533
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4502
4534
|
static getSettablePaths() {
|
|
4503
4535
|
return {
|
|
@@ -4516,8 +4548,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4516
4548
|
validate = true
|
|
4517
4549
|
}) {
|
|
4518
4550
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4519
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
4520
|
-
const fileContent = await readFileContent(
|
|
4551
|
+
const relativePath = isRoot ? "guidelines.md" : join46(".junie/memories", relativeFilePath);
|
|
4552
|
+
const fileContent = await readFileContent(join46(baseDir, relativePath));
|
|
4521
4553
|
return new _JunieRule({
|
|
4522
4554
|
baseDir,
|
|
4523
4555
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4557,7 +4589,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4557
4589
|
};
|
|
4558
4590
|
|
|
4559
4591
|
// src/rules/kiro-rule.ts
|
|
4560
|
-
import { join as
|
|
4592
|
+
import { join as join47 } from "path";
|
|
4561
4593
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4562
4594
|
static getSettablePaths() {
|
|
4563
4595
|
return {
|
|
@@ -4572,7 +4604,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4572
4604
|
validate = true
|
|
4573
4605
|
}) {
|
|
4574
4606
|
const fileContent = await readFileContent(
|
|
4575
|
-
|
|
4607
|
+
join47(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4576
4608
|
);
|
|
4577
4609
|
return new _KiroRule({
|
|
4578
4610
|
baseDir,
|
|
@@ -4612,7 +4644,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4612
4644
|
};
|
|
4613
4645
|
|
|
4614
4646
|
// src/rules/opencode-rule.ts
|
|
4615
|
-
import { join as
|
|
4647
|
+
import { join as join48 } from "path";
|
|
4616
4648
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4617
4649
|
static getSettablePaths() {
|
|
4618
4650
|
return {
|
|
@@ -4631,8 +4663,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4631
4663
|
validate = true
|
|
4632
4664
|
}) {
|
|
4633
4665
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4634
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4635
|
-
const fileContent = await readFileContent(
|
|
4666
|
+
const relativePath = isRoot ? "AGENTS.md" : join48(".opencode/memories", relativeFilePath);
|
|
4667
|
+
const fileContent = await readFileContent(join48(baseDir, relativePath));
|
|
4636
4668
|
return new _OpenCodeRule({
|
|
4637
4669
|
baseDir,
|
|
4638
4670
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4672,7 +4704,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4672
4704
|
};
|
|
4673
4705
|
|
|
4674
4706
|
// src/rules/qwencode-rule.ts
|
|
4675
|
-
import { join as
|
|
4707
|
+
import { join as join49 } from "path";
|
|
4676
4708
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
4677
4709
|
static getSettablePaths() {
|
|
4678
4710
|
return {
|
|
@@ -4691,8 +4723,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4691
4723
|
validate = true
|
|
4692
4724
|
}) {
|
|
4693
4725
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
4694
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
4695
|
-
const fileContent = await readFileContent(
|
|
4726
|
+
const relativePath = isRoot ? "QWEN.md" : join49(".qwen/memories", relativeFilePath);
|
|
4727
|
+
const fileContent = await readFileContent(join49(baseDir, relativePath));
|
|
4696
4728
|
return new _QwencodeRule({
|
|
4697
4729
|
baseDir,
|
|
4698
4730
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4729,7 +4761,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4729
4761
|
};
|
|
4730
4762
|
|
|
4731
4763
|
// src/rules/roo-rule.ts
|
|
4732
|
-
import { join as
|
|
4764
|
+
import { join as join50 } from "path";
|
|
4733
4765
|
var RooRule = class _RooRule extends ToolRule {
|
|
4734
4766
|
static getSettablePaths() {
|
|
4735
4767
|
return {
|
|
@@ -4744,7 +4776,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4744
4776
|
validate = true
|
|
4745
4777
|
}) {
|
|
4746
4778
|
const fileContent = await readFileContent(
|
|
4747
|
-
|
|
4779
|
+
join50(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4748
4780
|
);
|
|
4749
4781
|
return new _RooRule({
|
|
4750
4782
|
baseDir,
|
|
@@ -4799,7 +4831,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4799
4831
|
};
|
|
4800
4832
|
|
|
4801
4833
|
// src/rules/warp-rule.ts
|
|
4802
|
-
import { join as
|
|
4834
|
+
import { join as join51 } from "path";
|
|
4803
4835
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
4804
4836
|
constructor({ fileContent, root, ...rest }) {
|
|
4805
4837
|
super({
|
|
@@ -4825,8 +4857,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4825
4857
|
validate = true
|
|
4826
4858
|
}) {
|
|
4827
4859
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
4828
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
4829
|
-
const fileContent = await readFileContent(
|
|
4860
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join51(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4861
|
+
const fileContent = await readFileContent(join51(baseDir, relativePath));
|
|
4830
4862
|
return new _WarpRule({
|
|
4831
4863
|
baseDir,
|
|
4832
4864
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -4866,7 +4898,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4866
4898
|
};
|
|
4867
4899
|
|
|
4868
4900
|
// src/rules/windsurf-rule.ts
|
|
4869
|
-
import { join as
|
|
4901
|
+
import { join as join52 } from "path";
|
|
4870
4902
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
4871
4903
|
static getSettablePaths() {
|
|
4872
4904
|
return {
|
|
@@ -4881,7 +4913,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
4881
4913
|
validate = true
|
|
4882
4914
|
}) {
|
|
4883
4915
|
const fileContent = await readFileContent(
|
|
4884
|
-
|
|
4916
|
+
join52(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4885
4917
|
);
|
|
4886
4918
|
return new _WindsurfRule({
|
|
4887
4919
|
baseDir,
|
|
@@ -5260,14 +5292,14 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5260
5292
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5261
5293
|
*/
|
|
5262
5294
|
async loadRulesyncFiles() {
|
|
5263
|
-
const files = await findFilesByGlobs(
|
|
5295
|
+
const files = await findFilesByGlobs(join53(RULESYNC_RULES_DIR, "*.md"));
|
|
5264
5296
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5265
5297
|
return Promise.all(
|
|
5266
5298
|
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: basename16(file) }))
|
|
5267
5299
|
);
|
|
5268
5300
|
}
|
|
5269
5301
|
async loadRulesyncFilesLegacy() {
|
|
5270
|
-
const legacyFiles = await findFilesByGlobs(
|
|
5302
|
+
const legacyFiles = await findFilesByGlobs(join53(RULESYNC_RULES_DIR_LEGACY, "*.md"));
|
|
5271
5303
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5272
5304
|
return Promise.all(
|
|
5273
5305
|
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: basename16(file) }))
|
|
@@ -5331,7 +5363,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5331
5363
|
return [];
|
|
5332
5364
|
}
|
|
5333
5365
|
const rootFilePaths = await findFilesByGlobs(
|
|
5334
|
-
|
|
5366
|
+
join53(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5335
5367
|
);
|
|
5336
5368
|
return await Promise.all(
|
|
5337
5369
|
rootFilePaths.map(
|
|
@@ -5348,7 +5380,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5348
5380
|
return [];
|
|
5349
5381
|
}
|
|
5350
5382
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5351
|
-
|
|
5383
|
+
join53(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5352
5384
|
);
|
|
5353
5385
|
return await Promise.all(
|
|
5354
5386
|
nonRootFilePaths.map(
|
|
@@ -5714,14 +5746,14 @@ s/<command> [arguments]
|
|
|
5714
5746
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
5715
5747
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
5716
5748
|
|
|
5717
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
5749
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join53(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.`;
|
|
5718
5750
|
const subagentsSection = `## Simulated Subagents
|
|
5719
5751
|
|
|
5720
5752
|
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.
|
|
5721
5753
|
|
|
5722
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
5754
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join53(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
5723
5755
|
|
|
5724
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
5756
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join53(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.`;
|
|
5725
5757
|
const result = [
|
|
5726
5758
|
overview,
|
|
5727
5759
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -5908,9 +5940,9 @@ async function generateCommand(options) {
|
|
|
5908
5940
|
}
|
|
5909
5941
|
|
|
5910
5942
|
// src/cli/commands/gitignore.ts
|
|
5911
|
-
import { join as
|
|
5943
|
+
import { join as join54 } from "path";
|
|
5912
5944
|
var gitignoreCommand = async () => {
|
|
5913
|
-
const gitignorePath =
|
|
5945
|
+
const gitignorePath = join54(process.cwd(), ".gitignore");
|
|
5914
5946
|
const rulesFilesToIgnore = [
|
|
5915
5947
|
"# Generated by rulesync - AI tool configuration files",
|
|
5916
5948
|
"**/.amazonq/",
|
|
@@ -6100,7 +6132,7 @@ async function importCommand(options) {
|
|
|
6100
6132
|
}
|
|
6101
6133
|
|
|
6102
6134
|
// src/cli/commands/init.ts
|
|
6103
|
-
import { join as
|
|
6135
|
+
import { join as join55 } from "path";
|
|
6104
6136
|
async function initCommand() {
|
|
6105
6137
|
logger.info("Initializing rulesync...");
|
|
6106
6138
|
await ensureDir(RULESYNC_DIR);
|
|
@@ -6146,7 +6178,7 @@ globs: ["**/*"]
|
|
|
6146
6178
|
- Follow single responsibility principle
|
|
6147
6179
|
`
|
|
6148
6180
|
};
|
|
6149
|
-
const filepath =
|
|
6181
|
+
const filepath = join55(RULESYNC_RULES_DIR, sampleFile.filename);
|
|
6150
6182
|
await ensureDir(RULESYNC_RULES_DIR);
|
|
6151
6183
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6152
6184
|
await ensureDir(RULESYNC_SUBAGENTS_DIR);
|
|
@@ -6164,15 +6196,15 @@ var getVersion = async () => {
|
|
|
6164
6196
|
let packageJsonPath;
|
|
6165
6197
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
6166
6198
|
const __filename = fileURLToPath(import.meta.url);
|
|
6167
|
-
const __dirname =
|
|
6168
|
-
packageJsonPath =
|
|
6199
|
+
const __dirname = join56(__filename, "..");
|
|
6200
|
+
packageJsonPath = join56(__dirname, "../../package.json");
|
|
6169
6201
|
} else {
|
|
6170
|
-
packageJsonPath =
|
|
6202
|
+
packageJsonPath = join56(process.cwd(), "package.json");
|
|
6171
6203
|
}
|
|
6172
6204
|
const packageJson = await readJsonFile(packageJsonPath);
|
|
6173
6205
|
return packageJson.version;
|
|
6174
6206
|
} catch {
|
|
6175
|
-
return "0.
|
|
6207
|
+
return "0.79.0";
|
|
6176
6208
|
}
|
|
6177
6209
|
};
|
|
6178
6210
|
var main = async () => {
|