rulesync 3.5.1 → 3.6.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 +2 -1
- package/dist/index.cjs +201 -107
- package/dist/index.js +191 -97
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -926,12 +926,14 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
926
926
|
targets: ["*"],
|
|
927
927
|
description: this.frontmatter.description
|
|
928
928
|
};
|
|
929
|
+
const originalFilePath = this.relativeFilePath;
|
|
930
|
+
const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
|
|
929
931
|
return new RulesyncCommand({
|
|
930
932
|
baseDir: ".",
|
|
931
933
|
frontmatter: rulesyncFrontmatter,
|
|
932
934
|
body: this.body,
|
|
933
935
|
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
934
|
-
relativeFilePath
|
|
936
|
+
relativeFilePath,
|
|
935
937
|
fileContent: this.getFileContent(),
|
|
936
938
|
validate: true
|
|
937
939
|
});
|
|
@@ -3121,8 +3123,82 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3121
3123
|
}
|
|
3122
3124
|
};
|
|
3123
3125
|
|
|
3124
|
-
// src/mcp/
|
|
3126
|
+
// src/mcp/geminicli-mcp.ts
|
|
3125
3127
|
var import_node_path32 = require("path");
|
|
3128
|
+
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3129
|
+
json;
|
|
3130
|
+
constructor(params) {
|
|
3131
|
+
super(params);
|
|
3132
|
+
this.json = JSON.parse(this.fileContent || "{}");
|
|
3133
|
+
}
|
|
3134
|
+
getJson() {
|
|
3135
|
+
return this.json;
|
|
3136
|
+
}
|
|
3137
|
+
static getSettablePaths({ global } = {}) {
|
|
3138
|
+
if (global) {
|
|
3139
|
+
return {
|
|
3140
|
+
relativeDirPath: ".gemini",
|
|
3141
|
+
relativeFilePath: "settings.json"
|
|
3142
|
+
};
|
|
3143
|
+
}
|
|
3144
|
+
return {
|
|
3145
|
+
relativeDirPath: ".gemini",
|
|
3146
|
+
relativeFilePath: "settings.json"
|
|
3147
|
+
};
|
|
3148
|
+
}
|
|
3149
|
+
static async fromFile({
|
|
3150
|
+
baseDir = ".",
|
|
3151
|
+
validate = true,
|
|
3152
|
+
global = false
|
|
3153
|
+
}) {
|
|
3154
|
+
const paths = this.getSettablePaths({ global });
|
|
3155
|
+
const fileContent = await readOrInitializeFileContent(
|
|
3156
|
+
(0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3157
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3158
|
+
);
|
|
3159
|
+
const json = JSON.parse(fileContent);
|
|
3160
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
3161
|
+
return new _GeminiCliMcp({
|
|
3162
|
+
baseDir,
|
|
3163
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3164
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3165
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
3166
|
+
validate
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3169
|
+
static async fromRulesyncMcp({
|
|
3170
|
+
baseDir = ".",
|
|
3171
|
+
rulesyncMcp,
|
|
3172
|
+
validate = true,
|
|
3173
|
+
global = false
|
|
3174
|
+
}) {
|
|
3175
|
+
const paths = this.getSettablePaths({ global });
|
|
3176
|
+
const fileContent = await readOrInitializeFileContent(
|
|
3177
|
+
(0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3178
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3179
|
+
);
|
|
3180
|
+
const json = JSON.parse(fileContent);
|
|
3181
|
+
const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
|
|
3182
|
+
return new _GeminiCliMcp({
|
|
3183
|
+
baseDir,
|
|
3184
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3185
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3186
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
3187
|
+
validate
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
toRulesyncMcp() {
|
|
3191
|
+
return this.toRulesyncMcpDefault({
|
|
3192
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
|
|
3193
|
+
});
|
|
3194
|
+
}
|
|
3195
|
+
validate() {
|
|
3196
|
+
return { success: true, error: null };
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
|
|
3200
|
+
// src/mcp/roo-mcp.ts
|
|
3201
|
+
var import_node_path33 = require("path");
|
|
3126
3202
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
3127
3203
|
json;
|
|
3128
3204
|
constructor(params) {
|
|
@@ -3143,7 +3219,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
3143
3219
|
validate = true
|
|
3144
3220
|
}) {
|
|
3145
3221
|
const fileContent = await readFileContent(
|
|
3146
|
-
(0,
|
|
3222
|
+
(0, import_node_path33.join)(
|
|
3147
3223
|
baseDir,
|
|
3148
3224
|
this.getSettablePaths().relativeDirPath,
|
|
3149
3225
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3186,13 +3262,14 @@ var mcpProcessorToolTargets = [
|
|
|
3186
3262
|
"cline",
|
|
3187
3263
|
"copilot",
|
|
3188
3264
|
"cursor",
|
|
3265
|
+
"geminicli",
|
|
3189
3266
|
"roo"
|
|
3190
3267
|
];
|
|
3191
3268
|
var McpProcessorToolTargetSchema = import_mini12.z.enum(
|
|
3192
3269
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
3193
3270
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3194
3271
|
);
|
|
3195
|
-
var mcpProcessorToolTargetsGlobal = ["claudecode", "codexcli"];
|
|
3272
|
+
var mcpProcessorToolTargetsGlobal = ["claudecode", "codexcli", "geminicli"];
|
|
3196
3273
|
var McpProcessor = class extends FeatureProcessor {
|
|
3197
3274
|
toolTarget;
|
|
3198
3275
|
global;
|
|
@@ -3289,6 +3366,15 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3289
3366
|
})
|
|
3290
3367
|
];
|
|
3291
3368
|
}
|
|
3369
|
+
case "geminicli": {
|
|
3370
|
+
return [
|
|
3371
|
+
await GeminiCliMcp.fromFile({
|
|
3372
|
+
baseDir: this.baseDir,
|
|
3373
|
+
validate: true,
|
|
3374
|
+
global: this.global
|
|
3375
|
+
})
|
|
3376
|
+
];
|
|
3377
|
+
}
|
|
3292
3378
|
case "roo": {
|
|
3293
3379
|
return [
|
|
3294
3380
|
await RooMcp.fromFile({
|
|
@@ -3354,6 +3440,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3354
3440
|
rulesyncMcp: rulesyncMcp2,
|
|
3355
3441
|
global: this.global
|
|
3356
3442
|
});
|
|
3443
|
+
case "geminicli":
|
|
3444
|
+
return GeminiCliMcp.fromRulesyncMcp({
|
|
3445
|
+
baseDir: this.baseDir,
|
|
3446
|
+
rulesyncMcp: rulesyncMcp2,
|
|
3447
|
+
global: this.global
|
|
3448
|
+
});
|
|
3357
3449
|
case "roo":
|
|
3358
3450
|
return RooMcp.fromRulesyncMcp({
|
|
3359
3451
|
baseDir: this.baseDir,
|
|
@@ -3390,12 +3482,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3390
3482
|
};
|
|
3391
3483
|
|
|
3392
3484
|
// src/rules/rules-processor.ts
|
|
3393
|
-
var
|
|
3485
|
+
var import_node_path57 = require("path");
|
|
3394
3486
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3395
3487
|
var import_mini21 = require("zod/mini");
|
|
3396
3488
|
|
|
3397
3489
|
// src/subagents/simulated-subagent.ts
|
|
3398
|
-
var
|
|
3490
|
+
var import_node_path34 = require("path");
|
|
3399
3491
|
var import_mini13 = require("zod/mini");
|
|
3400
3492
|
|
|
3401
3493
|
// src/subagents/tool-subagent.ts
|
|
@@ -3443,7 +3535,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3443
3535
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3444
3536
|
if (!result.success) {
|
|
3445
3537
|
throw new Error(
|
|
3446
|
-
`Invalid frontmatter in ${(0,
|
|
3538
|
+
`Invalid frontmatter in ${(0, import_node_path34.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3447
3539
|
);
|
|
3448
3540
|
}
|
|
3449
3541
|
}
|
|
@@ -3494,7 +3586,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3494
3586
|
return {
|
|
3495
3587
|
success: false,
|
|
3496
3588
|
error: new Error(
|
|
3497
|
-
`Invalid frontmatter in ${(0,
|
|
3589
|
+
`Invalid frontmatter in ${(0, import_node_path34.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3498
3590
|
)
|
|
3499
3591
|
};
|
|
3500
3592
|
}
|
|
@@ -3504,7 +3596,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3504
3596
|
relativeFilePath,
|
|
3505
3597
|
validate = true
|
|
3506
3598
|
}) {
|
|
3507
|
-
const filePath = (0,
|
|
3599
|
+
const filePath = (0, import_node_path34.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
3508
3600
|
const fileContent = await readFileContent(filePath);
|
|
3509
3601
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3510
3602
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3514,7 +3606,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3514
3606
|
return {
|
|
3515
3607
|
baseDir,
|
|
3516
3608
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
3517
|
-
relativeFilePath: (0,
|
|
3609
|
+
relativeFilePath: (0, import_node_path34.basename)(relativeFilePath),
|
|
3518
3610
|
frontmatter: result.data,
|
|
3519
3611
|
body: content.trim(),
|
|
3520
3612
|
validate
|
|
@@ -3661,15 +3753,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3661
3753
|
};
|
|
3662
3754
|
|
|
3663
3755
|
// src/subagents/subagents-processor.ts
|
|
3664
|
-
var
|
|
3756
|
+
var import_node_path37 = require("path");
|
|
3665
3757
|
var import_mini16 = require("zod/mini");
|
|
3666
3758
|
|
|
3667
3759
|
// src/subagents/claudecode-subagent.ts
|
|
3668
|
-
var
|
|
3760
|
+
var import_node_path36 = require("path");
|
|
3669
3761
|
var import_mini15 = require("zod/mini");
|
|
3670
3762
|
|
|
3671
3763
|
// src/subagents/rulesync-subagent.ts
|
|
3672
|
-
var
|
|
3764
|
+
var import_node_path35 = require("path");
|
|
3673
3765
|
var import_mini14 = require("zod/mini");
|
|
3674
3766
|
var RulesyncSubagentModelSchema = import_mini14.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3675
3767
|
var RulesyncSubagentFrontmatterSchema = import_mini14.z.object({
|
|
@@ -3690,7 +3782,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3690
3782
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3691
3783
|
if (!result.success) {
|
|
3692
3784
|
throw new Error(
|
|
3693
|
-
`Invalid frontmatter in ${(0,
|
|
3785
|
+
`Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3694
3786
|
);
|
|
3695
3787
|
}
|
|
3696
3788
|
}
|
|
@@ -3722,7 +3814,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3722
3814
|
return {
|
|
3723
3815
|
success: false,
|
|
3724
3816
|
error: new Error(
|
|
3725
|
-
`Invalid frontmatter in ${(0,
|
|
3817
|
+
`Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3726
3818
|
)
|
|
3727
3819
|
};
|
|
3728
3820
|
}
|
|
@@ -3730,13 +3822,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3730
3822
|
static async fromFile({
|
|
3731
3823
|
relativeFilePath
|
|
3732
3824
|
}) {
|
|
3733
|
-
const fileContent = await readFileContent((0,
|
|
3825
|
+
const fileContent = await readFileContent((0, import_node_path35.join)(".rulesync/subagents", relativeFilePath));
|
|
3734
3826
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3735
3827
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3736
3828
|
if (!result.success) {
|
|
3737
3829
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
|
|
3738
3830
|
}
|
|
3739
|
-
const filename = (0,
|
|
3831
|
+
const filename = (0, import_node_path35.basename)(relativeFilePath);
|
|
3740
3832
|
return new _RulesyncSubagent({
|
|
3741
3833
|
baseDir: ".",
|
|
3742
3834
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -3762,7 +3854,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3762
3854
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3763
3855
|
if (!result.success) {
|
|
3764
3856
|
throw new Error(
|
|
3765
|
-
`Invalid frontmatter in ${(0,
|
|
3857
|
+
`Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3766
3858
|
);
|
|
3767
3859
|
}
|
|
3768
3860
|
}
|
|
@@ -3774,7 +3866,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3774
3866
|
}
|
|
3775
3867
|
static getSettablePaths(_options = {}) {
|
|
3776
3868
|
return {
|
|
3777
|
-
relativeDirPath: (0,
|
|
3869
|
+
relativeDirPath: (0, import_node_path36.join)(".claude", "agents")
|
|
3778
3870
|
};
|
|
3779
3871
|
}
|
|
3780
3872
|
getFrontmatter() {
|
|
@@ -3842,7 +3934,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3842
3934
|
return {
|
|
3843
3935
|
success: false,
|
|
3844
3936
|
error: new Error(
|
|
3845
|
-
`Invalid frontmatter in ${(0,
|
|
3937
|
+
`Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3846
3938
|
)
|
|
3847
3939
|
};
|
|
3848
3940
|
}
|
|
@@ -3860,7 +3952,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3860
3952
|
global = false
|
|
3861
3953
|
}) {
|
|
3862
3954
|
const paths = this.getSettablePaths({ global });
|
|
3863
|
-
const filePath = (0,
|
|
3955
|
+
const filePath = (0, import_node_path36.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3864
3956
|
const fileContent = await readFileContent(filePath);
|
|
3865
3957
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3866
3958
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4014,7 +4106,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4014
4106
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
4015
4107
|
*/
|
|
4016
4108
|
async loadRulesyncFiles() {
|
|
4017
|
-
const subagentsDir = (0,
|
|
4109
|
+
const subagentsDir = (0, import_node_path37.join)(RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
4018
4110
|
const dirExists = await directoryExists(subagentsDir);
|
|
4019
4111
|
if (!dirExists) {
|
|
4020
4112
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -4029,7 +4121,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4029
4121
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
4030
4122
|
const rulesyncSubagents = [];
|
|
4031
4123
|
for (const mdFile of mdFiles) {
|
|
4032
|
-
const filepath = (0,
|
|
4124
|
+
const filepath = (0, import_node_path37.join)(subagentsDir, mdFile);
|
|
4033
4125
|
try {
|
|
4034
4126
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
4035
4127
|
relativeFilePath: mdFile,
|
|
@@ -4148,8 +4240,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4148
4240
|
relativeDirPath,
|
|
4149
4241
|
fromFile
|
|
4150
4242
|
}) {
|
|
4151
|
-
const paths = await findFilesByGlobs((0,
|
|
4152
|
-
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0,
|
|
4243
|
+
const paths = await findFilesByGlobs((0, import_node_path37.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
4244
|
+
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path37.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
4153
4245
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
4154
4246
|
return subagents;
|
|
4155
4247
|
}
|
|
@@ -4176,13 +4268,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4176
4268
|
};
|
|
4177
4269
|
|
|
4178
4270
|
// src/rules/agentsmd-rule.ts
|
|
4179
|
-
var
|
|
4271
|
+
var import_node_path40 = require("path");
|
|
4180
4272
|
|
|
4181
4273
|
// src/rules/tool-rule.ts
|
|
4182
|
-
var
|
|
4274
|
+
var import_node_path39 = require("path");
|
|
4183
4275
|
|
|
4184
4276
|
// src/rules/rulesync-rule.ts
|
|
4185
|
-
var
|
|
4277
|
+
var import_node_path38 = require("path");
|
|
4186
4278
|
var import_mini17 = require("zod/mini");
|
|
4187
4279
|
var RulesyncRuleFrontmatterSchema = import_mini17.z.object({
|
|
4188
4280
|
root: import_mini17.z.optional(import_mini17.z.optional(import_mini17.z.boolean())),
|
|
@@ -4211,7 +4303,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4211
4303
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4212
4304
|
if (!result.success) {
|
|
4213
4305
|
throw new Error(
|
|
4214
|
-
`Invalid frontmatter in ${(0,
|
|
4306
|
+
`Invalid frontmatter in ${(0, import_node_path38.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4215
4307
|
);
|
|
4216
4308
|
}
|
|
4217
4309
|
}
|
|
@@ -4246,7 +4338,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4246
4338
|
return {
|
|
4247
4339
|
success: false,
|
|
4248
4340
|
error: new Error(
|
|
4249
|
-
`Invalid frontmatter in ${(0,
|
|
4341
|
+
`Invalid frontmatter in ${(0, import_node_path38.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
4250
4342
|
)
|
|
4251
4343
|
};
|
|
4252
4344
|
}
|
|
@@ -4255,7 +4347,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4255
4347
|
relativeFilePath,
|
|
4256
4348
|
validate = true
|
|
4257
4349
|
}) {
|
|
4258
|
-
const filePath = (0,
|
|
4350
|
+
const filePath = (0, import_node_path38.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
4259
4351
|
const fileContent = await readFileContent(filePath);
|
|
4260
4352
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4261
4353
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4270,7 +4362,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4270
4362
|
agentsmd: result.data.agentsmd,
|
|
4271
4363
|
cursor: result.data.cursor
|
|
4272
4364
|
};
|
|
4273
|
-
const filename = (0,
|
|
4365
|
+
const filename = (0, import_node_path38.basename)(filePath);
|
|
4274
4366
|
return new _RulesyncRule({
|
|
4275
4367
|
baseDir: ".",
|
|
4276
4368
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -4284,7 +4376,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4284
4376
|
relativeFilePath,
|
|
4285
4377
|
validate = true
|
|
4286
4378
|
}) {
|
|
4287
|
-
const filePath = (0,
|
|
4379
|
+
const filePath = (0, import_node_path38.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
4288
4380
|
const fileContent = await readFileContent(filePath);
|
|
4289
4381
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4290
4382
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4299,7 +4391,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4299
4391
|
agentsmd: result.data.agentsmd,
|
|
4300
4392
|
cursor: result.data.cursor
|
|
4301
4393
|
};
|
|
4302
|
-
const filename = (0,
|
|
4394
|
+
const filename = (0, import_node_path38.basename)(filePath);
|
|
4303
4395
|
return new _RulesyncRule({
|
|
4304
4396
|
baseDir: ".",
|
|
4305
4397
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -4385,7 +4477,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4385
4477
|
});
|
|
4386
4478
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
4387
4479
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
4388
|
-
params.relativeDirPath = (0,
|
|
4480
|
+
params.relativeDirPath = (0, import_node_path39.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
4389
4481
|
params.relativeFilePath = "AGENTS.md";
|
|
4390
4482
|
}
|
|
4391
4483
|
return params;
|
|
@@ -4461,8 +4553,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4461
4553
|
validate = true
|
|
4462
4554
|
}) {
|
|
4463
4555
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4464
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4465
|
-
const fileContent = await readFileContent((0,
|
|
4556
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path40.join)(".agents/memories", relativeFilePath);
|
|
4557
|
+
const fileContent = await readFileContent((0, import_node_path40.join)(baseDir, relativePath));
|
|
4466
4558
|
return new _AgentsMdRule({
|
|
4467
4559
|
baseDir,
|
|
4468
4560
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4502,7 +4594,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4502
4594
|
};
|
|
4503
4595
|
|
|
4504
4596
|
// src/rules/amazonqcli-rule.ts
|
|
4505
|
-
var
|
|
4597
|
+
var import_node_path41 = require("path");
|
|
4506
4598
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4507
4599
|
static getSettablePaths() {
|
|
4508
4600
|
return {
|
|
@@ -4517,7 +4609,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4517
4609
|
validate = true
|
|
4518
4610
|
}) {
|
|
4519
4611
|
const fileContent = await readFileContent(
|
|
4520
|
-
(0,
|
|
4612
|
+
(0, import_node_path41.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4521
4613
|
);
|
|
4522
4614
|
return new _AmazonQCliRule({
|
|
4523
4615
|
baseDir,
|
|
@@ -4557,7 +4649,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4557
4649
|
};
|
|
4558
4650
|
|
|
4559
4651
|
// src/rules/augmentcode-legacy-rule.ts
|
|
4560
|
-
var
|
|
4652
|
+
var import_node_path42 = require("path");
|
|
4561
4653
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4562
4654
|
toRulesyncRule() {
|
|
4563
4655
|
const rulesyncFrontmatter = {
|
|
@@ -4618,8 +4710,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4618
4710
|
}) {
|
|
4619
4711
|
const settablePaths = this.getSettablePaths();
|
|
4620
4712
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
4621
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
4622
|
-
const fileContent = await readFileContent((0,
|
|
4713
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path42.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4714
|
+
const fileContent = await readFileContent((0, import_node_path42.join)(baseDir, relativePath));
|
|
4623
4715
|
return new _AugmentcodeLegacyRule({
|
|
4624
4716
|
baseDir,
|
|
4625
4717
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -4632,7 +4724,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4632
4724
|
};
|
|
4633
4725
|
|
|
4634
4726
|
// src/rules/augmentcode-rule.ts
|
|
4635
|
-
var
|
|
4727
|
+
var import_node_path43 = require("path");
|
|
4636
4728
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
4637
4729
|
toRulesyncRule() {
|
|
4638
4730
|
return this.toRulesyncRuleDefault();
|
|
@@ -4664,7 +4756,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4664
4756
|
validate = true
|
|
4665
4757
|
}) {
|
|
4666
4758
|
const fileContent = await readFileContent(
|
|
4667
|
-
(0,
|
|
4759
|
+
(0, import_node_path43.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4668
4760
|
);
|
|
4669
4761
|
const { body: content } = parseFrontmatter(fileContent);
|
|
4670
4762
|
return new _AugmentcodeRule({
|
|
@@ -4687,7 +4779,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4687
4779
|
};
|
|
4688
4780
|
|
|
4689
4781
|
// src/rules/claudecode-rule.ts
|
|
4690
|
-
var
|
|
4782
|
+
var import_node_path44 = require("path");
|
|
4691
4783
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4692
4784
|
static getSettablePaths({
|
|
4693
4785
|
global
|
|
@@ -4706,7 +4798,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4706
4798
|
relativeFilePath: "CLAUDE.md"
|
|
4707
4799
|
},
|
|
4708
4800
|
nonRoot: {
|
|
4709
|
-
relativeDirPath: (0,
|
|
4801
|
+
relativeDirPath: (0, import_node_path44.join)(".claude", "memories")
|
|
4710
4802
|
}
|
|
4711
4803
|
};
|
|
4712
4804
|
}
|
|
@@ -4721,7 +4813,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4721
4813
|
if (isRoot) {
|
|
4722
4814
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4723
4815
|
const fileContent2 = await readFileContent(
|
|
4724
|
-
(0,
|
|
4816
|
+
(0, import_node_path44.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4725
4817
|
);
|
|
4726
4818
|
return new _ClaudecodeRule({
|
|
4727
4819
|
baseDir,
|
|
@@ -4735,8 +4827,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4735
4827
|
if (!paths.nonRoot) {
|
|
4736
4828
|
throw new Error("nonRoot path is not set");
|
|
4737
4829
|
}
|
|
4738
|
-
const relativePath = (0,
|
|
4739
|
-
const fileContent = await readFileContent((0,
|
|
4830
|
+
const relativePath = (0, import_node_path44.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4831
|
+
const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
|
|
4740
4832
|
return new _ClaudecodeRule({
|
|
4741
4833
|
baseDir,
|
|
4742
4834
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4778,7 +4870,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4778
4870
|
};
|
|
4779
4871
|
|
|
4780
4872
|
// src/rules/cline-rule.ts
|
|
4781
|
-
var
|
|
4873
|
+
var import_node_path45 = require("path");
|
|
4782
4874
|
var import_mini18 = require("zod/mini");
|
|
4783
4875
|
var ClineRuleFrontmatterSchema = import_mini18.z.object({
|
|
4784
4876
|
description: import_mini18.z.string()
|
|
@@ -4823,7 +4915,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4823
4915
|
validate = true
|
|
4824
4916
|
}) {
|
|
4825
4917
|
const fileContent = await readFileContent(
|
|
4826
|
-
(0,
|
|
4918
|
+
(0, import_node_path45.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4827
4919
|
);
|
|
4828
4920
|
return new _ClineRule({
|
|
4829
4921
|
baseDir,
|
|
@@ -4836,7 +4928,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4836
4928
|
};
|
|
4837
4929
|
|
|
4838
4930
|
// src/rules/codexcli-rule.ts
|
|
4839
|
-
var
|
|
4931
|
+
var import_node_path46 = require("path");
|
|
4840
4932
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4841
4933
|
static getSettablePaths({
|
|
4842
4934
|
global
|
|
@@ -4870,7 +4962,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4870
4962
|
if (isRoot) {
|
|
4871
4963
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4872
4964
|
const fileContent2 = await readFileContent(
|
|
4873
|
-
(0,
|
|
4965
|
+
(0, import_node_path46.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4874
4966
|
);
|
|
4875
4967
|
return new _CodexcliRule({
|
|
4876
4968
|
baseDir,
|
|
@@ -4884,8 +4976,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4884
4976
|
if (!paths.nonRoot) {
|
|
4885
4977
|
throw new Error("nonRoot path is not set");
|
|
4886
4978
|
}
|
|
4887
|
-
const relativePath = (0,
|
|
4888
|
-
const fileContent = await readFileContent((0,
|
|
4979
|
+
const relativePath = (0, import_node_path46.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4980
|
+
const fileContent = await readFileContent((0, import_node_path46.join)(baseDir, relativePath));
|
|
4889
4981
|
return new _CodexcliRule({
|
|
4890
4982
|
baseDir,
|
|
4891
4983
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4927,7 +5019,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4927
5019
|
};
|
|
4928
5020
|
|
|
4929
5021
|
// src/rules/copilot-rule.ts
|
|
4930
|
-
var
|
|
5022
|
+
var import_node_path47 = require("path");
|
|
4931
5023
|
var import_mini19 = require("zod/mini");
|
|
4932
5024
|
var CopilotRuleFrontmatterSchema = import_mini19.z.object({
|
|
4933
5025
|
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
@@ -4952,7 +5044,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4952
5044
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4953
5045
|
if (!result.success) {
|
|
4954
5046
|
throw new Error(
|
|
4955
|
-
`Invalid frontmatter in ${(0,
|
|
5047
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4956
5048
|
);
|
|
4957
5049
|
}
|
|
4958
5050
|
}
|
|
@@ -4971,12 +5063,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4971
5063
|
description: this.frontmatter.description,
|
|
4972
5064
|
globs: this.isRoot() ? ["**/*"] : []
|
|
4973
5065
|
};
|
|
5066
|
+
const originalFilePath = this.getRelativeFilePath();
|
|
5067
|
+
const relativeFilePath = originalFilePath.replace(/\.instructions\.md$/, ".md");
|
|
4974
5068
|
return new RulesyncRule({
|
|
4975
5069
|
baseDir: this.getBaseDir(),
|
|
4976
5070
|
frontmatter: rulesyncFrontmatter,
|
|
4977
5071
|
body: this.body,
|
|
4978
5072
|
relativeDirPath: ".rulesync/rules",
|
|
4979
|
-
relativeFilePath
|
|
5073
|
+
relativeFilePath,
|
|
4980
5074
|
validate: true
|
|
4981
5075
|
});
|
|
4982
5076
|
}
|
|
@@ -5022,11 +5116,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5022
5116
|
validate = true
|
|
5023
5117
|
}) {
|
|
5024
5118
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
5025
|
-
const relativePath = isRoot ? (0,
|
|
5119
|
+
const relativePath = isRoot ? (0, import_node_path47.join)(
|
|
5026
5120
|
this.getSettablePaths().root.relativeDirPath,
|
|
5027
5121
|
this.getSettablePaths().root.relativeFilePath
|
|
5028
|
-
) : (0,
|
|
5029
|
-
const fileContent = await readFileContent((0,
|
|
5122
|
+
) : (0, import_node_path47.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5123
|
+
const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
|
|
5030
5124
|
if (isRoot) {
|
|
5031
5125
|
return new _CopilotRule({
|
|
5032
5126
|
baseDir,
|
|
@@ -5045,7 +5139,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5045
5139
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5046
5140
|
if (!result.success) {
|
|
5047
5141
|
throw new Error(
|
|
5048
|
-
`Invalid frontmatter in ${(0,
|
|
5142
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
5049
5143
|
);
|
|
5050
5144
|
}
|
|
5051
5145
|
return new _CopilotRule({
|
|
@@ -5069,7 +5163,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5069
5163
|
return {
|
|
5070
5164
|
success: false,
|
|
5071
5165
|
error: new Error(
|
|
5072
|
-
`Invalid frontmatter in ${(0,
|
|
5166
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5073
5167
|
)
|
|
5074
5168
|
};
|
|
5075
5169
|
}
|
|
@@ -5089,7 +5183,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5089
5183
|
};
|
|
5090
5184
|
|
|
5091
5185
|
// src/rules/cursor-rule.ts
|
|
5092
|
-
var
|
|
5186
|
+
var import_node_path48 = require("path");
|
|
5093
5187
|
var import_mini20 = require("zod/mini");
|
|
5094
5188
|
var CursorRuleFrontmatterSchema = import_mini20.z.object({
|
|
5095
5189
|
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
@@ -5111,7 +5205,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5111
5205
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5112
5206
|
if (!result.success) {
|
|
5113
5207
|
throw new Error(
|
|
5114
|
-
`Invalid frontmatter in ${(0,
|
|
5208
|
+
`Invalid frontmatter in ${(0, import_node_path48.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
5115
5209
|
);
|
|
5116
5210
|
}
|
|
5117
5211
|
}
|
|
@@ -5218,19 +5312,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5218
5312
|
validate = true
|
|
5219
5313
|
}) {
|
|
5220
5314
|
const fileContent = await readFileContent(
|
|
5221
|
-
(0,
|
|
5315
|
+
(0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5222
5316
|
);
|
|
5223
5317
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
5224
5318
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5225
5319
|
if (!result.success) {
|
|
5226
5320
|
throw new Error(
|
|
5227
|
-
`Invalid frontmatter in ${(0,
|
|
5321
|
+
`Invalid frontmatter in ${(0, import_node_path48.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
5228
5322
|
);
|
|
5229
5323
|
}
|
|
5230
5324
|
return new _CursorRule({
|
|
5231
5325
|
baseDir,
|
|
5232
5326
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
5233
|
-
relativeFilePath: (0,
|
|
5327
|
+
relativeFilePath: (0, import_node_path48.basename)(relativeFilePath),
|
|
5234
5328
|
frontmatter: result.data,
|
|
5235
5329
|
body: content.trim(),
|
|
5236
5330
|
validate
|
|
@@ -5247,7 +5341,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5247
5341
|
return {
|
|
5248
5342
|
success: false,
|
|
5249
5343
|
error: new Error(
|
|
5250
|
-
`Invalid frontmatter in ${(0,
|
|
5344
|
+
`Invalid frontmatter in ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5251
5345
|
)
|
|
5252
5346
|
};
|
|
5253
5347
|
}
|
|
@@ -5267,7 +5361,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5267
5361
|
};
|
|
5268
5362
|
|
|
5269
5363
|
// src/rules/geminicli-rule.ts
|
|
5270
|
-
var
|
|
5364
|
+
var import_node_path49 = require("path");
|
|
5271
5365
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5272
5366
|
static getSettablePaths({
|
|
5273
5367
|
global
|
|
@@ -5301,7 +5395,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5301
5395
|
if (isRoot) {
|
|
5302
5396
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5303
5397
|
const fileContent2 = await readFileContent(
|
|
5304
|
-
(0,
|
|
5398
|
+
(0, import_node_path49.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5305
5399
|
);
|
|
5306
5400
|
return new _GeminiCliRule({
|
|
5307
5401
|
baseDir,
|
|
@@ -5315,8 +5409,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5315
5409
|
if (!paths.nonRoot) {
|
|
5316
5410
|
throw new Error("nonRoot path is not set");
|
|
5317
5411
|
}
|
|
5318
|
-
const relativePath = (0,
|
|
5319
|
-
const fileContent = await readFileContent((0,
|
|
5412
|
+
const relativePath = (0, import_node_path49.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5413
|
+
const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
|
|
5320
5414
|
return new _GeminiCliRule({
|
|
5321
5415
|
baseDir,
|
|
5322
5416
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5358,7 +5452,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5358
5452
|
};
|
|
5359
5453
|
|
|
5360
5454
|
// src/rules/junie-rule.ts
|
|
5361
|
-
var
|
|
5455
|
+
var import_node_path50 = require("path");
|
|
5362
5456
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
5363
5457
|
static getSettablePaths() {
|
|
5364
5458
|
return {
|
|
@@ -5377,8 +5471,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5377
5471
|
validate = true
|
|
5378
5472
|
}) {
|
|
5379
5473
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
5380
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
5381
|
-
const fileContent = await readFileContent((0,
|
|
5474
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path50.join)(".junie/memories", relativeFilePath);
|
|
5475
|
+
const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
|
|
5382
5476
|
return new _JunieRule({
|
|
5383
5477
|
baseDir,
|
|
5384
5478
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5418,7 +5512,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5418
5512
|
};
|
|
5419
5513
|
|
|
5420
5514
|
// src/rules/kiro-rule.ts
|
|
5421
|
-
var
|
|
5515
|
+
var import_node_path51 = require("path");
|
|
5422
5516
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
5423
5517
|
static getSettablePaths() {
|
|
5424
5518
|
return {
|
|
@@ -5433,7 +5527,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5433
5527
|
validate = true
|
|
5434
5528
|
}) {
|
|
5435
5529
|
const fileContent = await readFileContent(
|
|
5436
|
-
(0,
|
|
5530
|
+
(0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5437
5531
|
);
|
|
5438
5532
|
return new _KiroRule({
|
|
5439
5533
|
baseDir,
|
|
@@ -5473,7 +5567,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5473
5567
|
};
|
|
5474
5568
|
|
|
5475
5569
|
// src/rules/opencode-rule.ts
|
|
5476
|
-
var
|
|
5570
|
+
var import_node_path52 = require("path");
|
|
5477
5571
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
5478
5572
|
static getSettablePaths() {
|
|
5479
5573
|
return {
|
|
@@ -5492,8 +5586,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5492
5586
|
validate = true
|
|
5493
5587
|
}) {
|
|
5494
5588
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
5495
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
5496
|
-
const fileContent = await readFileContent((0,
|
|
5589
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path52.join)(".opencode/memories", relativeFilePath);
|
|
5590
|
+
const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
|
|
5497
5591
|
return new _OpenCodeRule({
|
|
5498
5592
|
baseDir,
|
|
5499
5593
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5533,7 +5627,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5533
5627
|
};
|
|
5534
5628
|
|
|
5535
5629
|
// src/rules/qwencode-rule.ts
|
|
5536
|
-
var
|
|
5630
|
+
var import_node_path53 = require("path");
|
|
5537
5631
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5538
5632
|
static getSettablePaths() {
|
|
5539
5633
|
return {
|
|
@@ -5552,8 +5646,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5552
5646
|
validate = true
|
|
5553
5647
|
}) {
|
|
5554
5648
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5555
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
5556
|
-
const fileContent = await readFileContent((0,
|
|
5649
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path53.join)(".qwen/memories", relativeFilePath);
|
|
5650
|
+
const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
|
|
5557
5651
|
return new _QwencodeRule({
|
|
5558
5652
|
baseDir,
|
|
5559
5653
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5590,7 +5684,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5590
5684
|
};
|
|
5591
5685
|
|
|
5592
5686
|
// src/rules/roo-rule.ts
|
|
5593
|
-
var
|
|
5687
|
+
var import_node_path54 = require("path");
|
|
5594
5688
|
var RooRule = class _RooRule extends ToolRule {
|
|
5595
5689
|
static getSettablePaths() {
|
|
5596
5690
|
return {
|
|
@@ -5605,7 +5699,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5605
5699
|
validate = true
|
|
5606
5700
|
}) {
|
|
5607
5701
|
const fileContent = await readFileContent(
|
|
5608
|
-
(0,
|
|
5702
|
+
(0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5609
5703
|
);
|
|
5610
5704
|
return new _RooRule({
|
|
5611
5705
|
baseDir,
|
|
@@ -5660,7 +5754,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5660
5754
|
};
|
|
5661
5755
|
|
|
5662
5756
|
// src/rules/warp-rule.ts
|
|
5663
|
-
var
|
|
5757
|
+
var import_node_path55 = require("path");
|
|
5664
5758
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
5665
5759
|
constructor({ fileContent, root, ...rest }) {
|
|
5666
5760
|
super({
|
|
@@ -5686,8 +5780,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5686
5780
|
validate = true
|
|
5687
5781
|
}) {
|
|
5688
5782
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
5689
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
5690
|
-
const fileContent = await readFileContent((0,
|
|
5783
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path55.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5784
|
+
const fileContent = await readFileContent((0, import_node_path55.join)(baseDir, relativePath));
|
|
5691
5785
|
return new _WarpRule({
|
|
5692
5786
|
baseDir,
|
|
5693
5787
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -5727,7 +5821,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5727
5821
|
};
|
|
5728
5822
|
|
|
5729
5823
|
// src/rules/windsurf-rule.ts
|
|
5730
|
-
var
|
|
5824
|
+
var import_node_path56 = require("path");
|
|
5731
5825
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
5732
5826
|
static getSettablePaths() {
|
|
5733
5827
|
return {
|
|
@@ -5742,7 +5836,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
5742
5836
|
validate = true
|
|
5743
5837
|
}) {
|
|
5744
5838
|
const fileContent = await readFileContent(
|
|
5745
|
-
(0,
|
|
5839
|
+
(0, import_node_path56.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5746
5840
|
);
|
|
5747
5841
|
return new _WindsurfRule({
|
|
5748
5842
|
baseDir,
|
|
@@ -6142,10 +6236,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6142
6236
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
6143
6237
|
*/
|
|
6144
6238
|
async loadRulesyncFiles() {
|
|
6145
|
-
const files = await findFilesByGlobs((0,
|
|
6239
|
+
const files = await findFilesByGlobs((0, import_node_path57.join)(".rulesync/rules", "*.md"));
|
|
6146
6240
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
6147
6241
|
const rulesyncRules = await Promise.all(
|
|
6148
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
6242
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path57.basename)(file) }))
|
|
6149
6243
|
);
|
|
6150
6244
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
6151
6245
|
if (rootRules.length > 1) {
|
|
@@ -6163,10 +6257,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6163
6257
|
return rulesyncRules;
|
|
6164
6258
|
}
|
|
6165
6259
|
async loadRulesyncFilesLegacy() {
|
|
6166
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
6260
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path57.join)(".rulesync", "*.md"));
|
|
6167
6261
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
6168
6262
|
return Promise.all(
|
|
6169
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
6263
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path57.basename)(file) }))
|
|
6170
6264
|
);
|
|
6171
6265
|
}
|
|
6172
6266
|
/**
|
|
@@ -6230,13 +6324,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6230
6324
|
return [];
|
|
6231
6325
|
}
|
|
6232
6326
|
const rootFilePaths = await findFilesByGlobs(
|
|
6233
|
-
(0,
|
|
6327
|
+
(0, import_node_path57.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
6234
6328
|
);
|
|
6235
6329
|
return await Promise.all(
|
|
6236
6330
|
rootFilePaths.map(
|
|
6237
6331
|
(filePath) => root.fromFile({
|
|
6238
6332
|
baseDir: this.baseDir,
|
|
6239
|
-
relativeFilePath: (0,
|
|
6333
|
+
relativeFilePath: (0, import_node_path57.basename)(filePath),
|
|
6240
6334
|
global: this.global
|
|
6241
6335
|
})
|
|
6242
6336
|
)
|
|
@@ -6248,13 +6342,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6248
6342
|
return [];
|
|
6249
6343
|
}
|
|
6250
6344
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
6251
|
-
(0,
|
|
6345
|
+
(0, import_node_path57.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
6252
6346
|
);
|
|
6253
6347
|
return await Promise.all(
|
|
6254
6348
|
nonRootFilePaths.map(
|
|
6255
6349
|
(filePath) => nonRoot.fromFile({
|
|
6256
6350
|
baseDir: this.baseDir,
|
|
6257
|
-
relativeFilePath: (0,
|
|
6351
|
+
relativeFilePath: (0, import_node_path57.basename)(filePath),
|
|
6258
6352
|
global: this.global
|
|
6259
6353
|
})
|
|
6260
6354
|
)
|
|
@@ -6624,14 +6718,14 @@ s/<command> [arguments]
|
|
|
6624
6718
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
6625
6719
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
6626
6720
|
|
|
6627
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
6721
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path57.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
6628
6722
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
6629
6723
|
|
|
6630
6724
|
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.
|
|
6631
6725
|
|
|
6632
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
6726
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path57.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
6633
6727
|
|
|
6634
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
6728
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path57.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
6635
6729
|
const result = [
|
|
6636
6730
|
overview,
|
|
6637
6731
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -6841,9 +6935,9 @@ async function generateSubagents(config) {
|
|
|
6841
6935
|
}
|
|
6842
6936
|
|
|
6843
6937
|
// src/cli/commands/gitignore.ts
|
|
6844
|
-
var
|
|
6938
|
+
var import_node_path58 = require("path");
|
|
6845
6939
|
var gitignoreCommand = async () => {
|
|
6846
|
-
const gitignorePath = (0,
|
|
6940
|
+
const gitignorePath = (0, import_node_path58.join)(process.cwd(), ".gitignore");
|
|
6847
6941
|
const rulesFilesToIgnore = [
|
|
6848
6942
|
"# Generated by rulesync - AI tool configuration files",
|
|
6849
6943
|
"**/.amazonq/",
|
|
@@ -7071,7 +7165,7 @@ async function importSubagents(config, tool) {
|
|
|
7071
7165
|
}
|
|
7072
7166
|
|
|
7073
7167
|
// src/cli/commands/init.ts
|
|
7074
|
-
var
|
|
7168
|
+
var import_node_path59 = require("path");
|
|
7075
7169
|
async function initCommand() {
|
|
7076
7170
|
logger.info("Initializing rulesync...");
|
|
7077
7171
|
await ensureDir(".rulesync");
|
|
@@ -7142,7 +7236,7 @@ globs: ["**/*"]
|
|
|
7142
7236
|
- Follow single responsibility principle
|
|
7143
7237
|
`
|
|
7144
7238
|
};
|
|
7145
|
-
const filepath = (0,
|
|
7239
|
+
const filepath = (0, import_node_path59.join)(".rulesync/rules", sampleFile.filename);
|
|
7146
7240
|
await ensureDir(".rulesync/rules");
|
|
7147
7241
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
7148
7242
|
await ensureDir(".rulesync/subagents");
|
|
@@ -7155,7 +7249,7 @@ globs: ["**/*"]
|
|
|
7155
7249
|
}
|
|
7156
7250
|
|
|
7157
7251
|
// src/cli/index.ts
|
|
7158
|
-
var getVersion = () => "3.
|
|
7252
|
+
var getVersion = () => "3.6.0";
|
|
7159
7253
|
var main = async () => {
|
|
7160
7254
|
const program = new import_commander.Command();
|
|
7161
7255
|
const version = getVersion();
|