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.js
CHANGED
|
@@ -903,12 +903,14 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
903
903
|
targets: ["*"],
|
|
904
904
|
description: this.frontmatter.description
|
|
905
905
|
};
|
|
906
|
+
const originalFilePath = this.relativeFilePath;
|
|
907
|
+
const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
|
|
906
908
|
return new RulesyncCommand({
|
|
907
909
|
baseDir: ".",
|
|
908
910
|
frontmatter: rulesyncFrontmatter,
|
|
909
911
|
body: this.body,
|
|
910
912
|
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
911
|
-
relativeFilePath
|
|
913
|
+
relativeFilePath,
|
|
912
914
|
fileContent: this.getFileContent(),
|
|
913
915
|
validate: true
|
|
914
916
|
});
|
|
@@ -3098,8 +3100,82 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3098
3100
|
}
|
|
3099
3101
|
};
|
|
3100
3102
|
|
|
3101
|
-
// src/mcp/
|
|
3103
|
+
// src/mcp/geminicli-mcp.ts
|
|
3102
3104
|
import { join as join31 } from "path";
|
|
3105
|
+
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3106
|
+
json;
|
|
3107
|
+
constructor(params) {
|
|
3108
|
+
super(params);
|
|
3109
|
+
this.json = JSON.parse(this.fileContent || "{}");
|
|
3110
|
+
}
|
|
3111
|
+
getJson() {
|
|
3112
|
+
return this.json;
|
|
3113
|
+
}
|
|
3114
|
+
static getSettablePaths({ global } = {}) {
|
|
3115
|
+
if (global) {
|
|
3116
|
+
return {
|
|
3117
|
+
relativeDirPath: ".gemini",
|
|
3118
|
+
relativeFilePath: "settings.json"
|
|
3119
|
+
};
|
|
3120
|
+
}
|
|
3121
|
+
return {
|
|
3122
|
+
relativeDirPath: ".gemini",
|
|
3123
|
+
relativeFilePath: "settings.json"
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
static async fromFile({
|
|
3127
|
+
baseDir = ".",
|
|
3128
|
+
validate = true,
|
|
3129
|
+
global = false
|
|
3130
|
+
}) {
|
|
3131
|
+
const paths = this.getSettablePaths({ global });
|
|
3132
|
+
const fileContent = await readOrInitializeFileContent(
|
|
3133
|
+
join31(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3134
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3135
|
+
);
|
|
3136
|
+
const json = JSON.parse(fileContent);
|
|
3137
|
+
const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
|
|
3138
|
+
return new _GeminiCliMcp({
|
|
3139
|
+
baseDir,
|
|
3140
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3141
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3142
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
3143
|
+
validate
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
static async fromRulesyncMcp({
|
|
3147
|
+
baseDir = ".",
|
|
3148
|
+
rulesyncMcp,
|
|
3149
|
+
validate = true,
|
|
3150
|
+
global = false
|
|
3151
|
+
}) {
|
|
3152
|
+
const paths = this.getSettablePaths({ global });
|
|
3153
|
+
const fileContent = await readOrInitializeFileContent(
|
|
3154
|
+
join31(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3155
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3156
|
+
);
|
|
3157
|
+
const json = JSON.parse(fileContent);
|
|
3158
|
+
const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
|
|
3159
|
+
return new _GeminiCliMcp({
|
|
3160
|
+
baseDir,
|
|
3161
|
+
relativeDirPath: paths.relativeDirPath,
|
|
3162
|
+
relativeFilePath: paths.relativeFilePath,
|
|
3163
|
+
fileContent: JSON.stringify(newJson, null, 2),
|
|
3164
|
+
validate
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
toRulesyncMcp() {
|
|
3168
|
+
return this.toRulesyncMcpDefault({
|
|
3169
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
validate() {
|
|
3173
|
+
return { success: true, error: null };
|
|
3174
|
+
}
|
|
3175
|
+
};
|
|
3176
|
+
|
|
3177
|
+
// src/mcp/roo-mcp.ts
|
|
3178
|
+
import { join as join32 } from "path";
|
|
3103
3179
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
3104
3180
|
json;
|
|
3105
3181
|
constructor(params) {
|
|
@@ -3120,7 +3196,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
3120
3196
|
validate = true
|
|
3121
3197
|
}) {
|
|
3122
3198
|
const fileContent = await readFileContent(
|
|
3123
|
-
|
|
3199
|
+
join32(
|
|
3124
3200
|
baseDir,
|
|
3125
3201
|
this.getSettablePaths().relativeDirPath,
|
|
3126
3202
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3163,13 +3239,14 @@ var mcpProcessorToolTargets = [
|
|
|
3163
3239
|
"cline",
|
|
3164
3240
|
"copilot",
|
|
3165
3241
|
"cursor",
|
|
3242
|
+
"geminicli",
|
|
3166
3243
|
"roo"
|
|
3167
3244
|
];
|
|
3168
3245
|
var McpProcessorToolTargetSchema = z12.enum(
|
|
3169
3246
|
// 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
|
|
3170
3247
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3171
3248
|
);
|
|
3172
|
-
var mcpProcessorToolTargetsGlobal = ["claudecode", "codexcli"];
|
|
3249
|
+
var mcpProcessorToolTargetsGlobal = ["claudecode", "codexcli", "geminicli"];
|
|
3173
3250
|
var McpProcessor = class extends FeatureProcessor {
|
|
3174
3251
|
toolTarget;
|
|
3175
3252
|
global;
|
|
@@ -3266,6 +3343,15 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3266
3343
|
})
|
|
3267
3344
|
];
|
|
3268
3345
|
}
|
|
3346
|
+
case "geminicli": {
|
|
3347
|
+
return [
|
|
3348
|
+
await GeminiCliMcp.fromFile({
|
|
3349
|
+
baseDir: this.baseDir,
|
|
3350
|
+
validate: true,
|
|
3351
|
+
global: this.global
|
|
3352
|
+
})
|
|
3353
|
+
];
|
|
3354
|
+
}
|
|
3269
3355
|
case "roo": {
|
|
3270
3356
|
return [
|
|
3271
3357
|
await RooMcp.fromFile({
|
|
@@ -3331,6 +3417,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3331
3417
|
rulesyncMcp: rulesyncMcp2,
|
|
3332
3418
|
global: this.global
|
|
3333
3419
|
});
|
|
3420
|
+
case "geminicli":
|
|
3421
|
+
return GeminiCliMcp.fromRulesyncMcp({
|
|
3422
|
+
baseDir: this.baseDir,
|
|
3423
|
+
rulesyncMcp: rulesyncMcp2,
|
|
3424
|
+
global: this.global
|
|
3425
|
+
});
|
|
3334
3426
|
case "roo":
|
|
3335
3427
|
return RooMcp.fromRulesyncMcp({
|
|
3336
3428
|
baseDir: this.baseDir,
|
|
@@ -3367,12 +3459,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3367
3459
|
};
|
|
3368
3460
|
|
|
3369
3461
|
// src/rules/rules-processor.ts
|
|
3370
|
-
import { basename as basename17, join as
|
|
3462
|
+
import { basename as basename17, join as join56 } from "path";
|
|
3371
3463
|
import { XMLBuilder } from "fast-xml-parser";
|
|
3372
3464
|
import { z as z21 } from "zod/mini";
|
|
3373
3465
|
|
|
3374
3466
|
// src/subagents/simulated-subagent.ts
|
|
3375
|
-
import { basename as basename12, join as
|
|
3467
|
+
import { basename as basename12, join as join33 } from "path";
|
|
3376
3468
|
import { z as z13 } from "zod/mini";
|
|
3377
3469
|
|
|
3378
3470
|
// src/subagents/tool-subagent.ts
|
|
@@ -3420,7 +3512,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3420
3512
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3421
3513
|
if (!result.success) {
|
|
3422
3514
|
throw new Error(
|
|
3423
|
-
`Invalid frontmatter in ${
|
|
3515
|
+
`Invalid frontmatter in ${join33(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3424
3516
|
);
|
|
3425
3517
|
}
|
|
3426
3518
|
}
|
|
@@ -3471,7 +3563,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3471
3563
|
return {
|
|
3472
3564
|
success: false,
|
|
3473
3565
|
error: new Error(
|
|
3474
|
-
`Invalid frontmatter in ${
|
|
3566
|
+
`Invalid frontmatter in ${join33(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3475
3567
|
)
|
|
3476
3568
|
};
|
|
3477
3569
|
}
|
|
@@ -3481,7 +3573,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3481
3573
|
relativeFilePath,
|
|
3482
3574
|
validate = true
|
|
3483
3575
|
}) {
|
|
3484
|
-
const filePath =
|
|
3576
|
+
const filePath = join33(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
3485
3577
|
const fileContent = await readFileContent(filePath);
|
|
3486
3578
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3487
3579
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3638,15 +3730,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3638
3730
|
};
|
|
3639
3731
|
|
|
3640
3732
|
// src/subagents/subagents-processor.ts
|
|
3641
|
-
import { basename as basename14, join as
|
|
3733
|
+
import { basename as basename14, join as join36 } from "path";
|
|
3642
3734
|
import { z as z16 } from "zod/mini";
|
|
3643
3735
|
|
|
3644
3736
|
// src/subagents/claudecode-subagent.ts
|
|
3645
|
-
import { join as
|
|
3737
|
+
import { join as join35 } from "path";
|
|
3646
3738
|
import { z as z15 } from "zod/mini";
|
|
3647
3739
|
|
|
3648
3740
|
// src/subagents/rulesync-subagent.ts
|
|
3649
|
-
import { basename as basename13, join as
|
|
3741
|
+
import { basename as basename13, join as join34 } from "path";
|
|
3650
3742
|
import { z as z14 } from "zod/mini";
|
|
3651
3743
|
var RulesyncSubagentModelSchema = z14.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3652
3744
|
var RulesyncSubagentFrontmatterSchema = z14.object({
|
|
@@ -3667,7 +3759,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3667
3759
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3668
3760
|
if (!result.success) {
|
|
3669
3761
|
throw new Error(
|
|
3670
|
-
`Invalid frontmatter in ${
|
|
3762
|
+
`Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3671
3763
|
);
|
|
3672
3764
|
}
|
|
3673
3765
|
}
|
|
@@ -3699,7 +3791,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3699
3791
|
return {
|
|
3700
3792
|
success: false,
|
|
3701
3793
|
error: new Error(
|
|
3702
|
-
`Invalid frontmatter in ${
|
|
3794
|
+
`Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3703
3795
|
)
|
|
3704
3796
|
};
|
|
3705
3797
|
}
|
|
@@ -3707,7 +3799,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3707
3799
|
static async fromFile({
|
|
3708
3800
|
relativeFilePath
|
|
3709
3801
|
}) {
|
|
3710
|
-
const fileContent = await readFileContent(
|
|
3802
|
+
const fileContent = await readFileContent(join34(".rulesync/subagents", relativeFilePath));
|
|
3711
3803
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3712
3804
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3713
3805
|
if (!result.success) {
|
|
@@ -3739,7 +3831,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3739
3831
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3740
3832
|
if (!result.success) {
|
|
3741
3833
|
throw new Error(
|
|
3742
|
-
`Invalid frontmatter in ${
|
|
3834
|
+
`Invalid frontmatter in ${join35(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
3743
3835
|
);
|
|
3744
3836
|
}
|
|
3745
3837
|
}
|
|
@@ -3751,7 +3843,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3751
3843
|
}
|
|
3752
3844
|
static getSettablePaths(_options = {}) {
|
|
3753
3845
|
return {
|
|
3754
|
-
relativeDirPath:
|
|
3846
|
+
relativeDirPath: join35(".claude", "agents")
|
|
3755
3847
|
};
|
|
3756
3848
|
}
|
|
3757
3849
|
getFrontmatter() {
|
|
@@ -3819,7 +3911,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3819
3911
|
return {
|
|
3820
3912
|
success: false,
|
|
3821
3913
|
error: new Error(
|
|
3822
|
-
`Invalid frontmatter in ${
|
|
3914
|
+
`Invalid frontmatter in ${join35(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
3823
3915
|
)
|
|
3824
3916
|
};
|
|
3825
3917
|
}
|
|
@@ -3837,7 +3929,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3837
3929
|
global = false
|
|
3838
3930
|
}) {
|
|
3839
3931
|
const paths = this.getSettablePaths({ global });
|
|
3840
|
-
const filePath =
|
|
3932
|
+
const filePath = join35(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3841
3933
|
const fileContent = await readFileContent(filePath);
|
|
3842
3934
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3843
3935
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3991,7 +4083,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3991
4083
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
3992
4084
|
*/
|
|
3993
4085
|
async loadRulesyncFiles() {
|
|
3994
|
-
const subagentsDir =
|
|
4086
|
+
const subagentsDir = join36(RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
3995
4087
|
const dirExists = await directoryExists(subagentsDir);
|
|
3996
4088
|
if (!dirExists) {
|
|
3997
4089
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -4006,7 +4098,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4006
4098
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
4007
4099
|
const rulesyncSubagents = [];
|
|
4008
4100
|
for (const mdFile of mdFiles) {
|
|
4009
|
-
const filepath =
|
|
4101
|
+
const filepath = join36(subagentsDir, mdFile);
|
|
4010
4102
|
try {
|
|
4011
4103
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
4012
4104
|
relativeFilePath: mdFile,
|
|
@@ -4125,7 +4217,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4125
4217
|
relativeDirPath,
|
|
4126
4218
|
fromFile
|
|
4127
4219
|
}) {
|
|
4128
|
-
const paths = await findFilesByGlobs(
|
|
4220
|
+
const paths = await findFilesByGlobs(join36(this.baseDir, relativeDirPath, "*.md"));
|
|
4129
4221
|
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile(basename14(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
4130
4222
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
4131
4223
|
return subagents;
|
|
@@ -4153,13 +4245,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4153
4245
|
};
|
|
4154
4246
|
|
|
4155
4247
|
// src/rules/agentsmd-rule.ts
|
|
4156
|
-
import { join as
|
|
4248
|
+
import { join as join39 } from "path";
|
|
4157
4249
|
|
|
4158
4250
|
// src/rules/tool-rule.ts
|
|
4159
|
-
import { join as
|
|
4251
|
+
import { join as join38 } from "path";
|
|
4160
4252
|
|
|
4161
4253
|
// src/rules/rulesync-rule.ts
|
|
4162
|
-
import { basename as basename15, join as
|
|
4254
|
+
import { basename as basename15, join as join37 } from "path";
|
|
4163
4255
|
import { z as z17 } from "zod/mini";
|
|
4164
4256
|
var RulesyncRuleFrontmatterSchema = z17.object({
|
|
4165
4257
|
root: z17.optional(z17.optional(z17.boolean())),
|
|
@@ -4188,7 +4280,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4188
4280
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4189
4281
|
if (!result.success) {
|
|
4190
4282
|
throw new Error(
|
|
4191
|
-
`Invalid frontmatter in ${
|
|
4283
|
+
`Invalid frontmatter in ${join37(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4192
4284
|
);
|
|
4193
4285
|
}
|
|
4194
4286
|
}
|
|
@@ -4223,7 +4315,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4223
4315
|
return {
|
|
4224
4316
|
success: false,
|
|
4225
4317
|
error: new Error(
|
|
4226
|
-
`Invalid frontmatter in ${
|
|
4318
|
+
`Invalid frontmatter in ${join37(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
4227
4319
|
)
|
|
4228
4320
|
};
|
|
4229
4321
|
}
|
|
@@ -4232,7 +4324,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4232
4324
|
relativeFilePath,
|
|
4233
4325
|
validate = true
|
|
4234
4326
|
}) {
|
|
4235
|
-
const filePath =
|
|
4327
|
+
const filePath = join37(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
4236
4328
|
const fileContent = await readFileContent(filePath);
|
|
4237
4329
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4238
4330
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4261,7 +4353,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4261
4353
|
relativeFilePath,
|
|
4262
4354
|
validate = true
|
|
4263
4355
|
}) {
|
|
4264
|
-
const filePath =
|
|
4356
|
+
const filePath = join37(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
4265
4357
|
const fileContent = await readFileContent(filePath);
|
|
4266
4358
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4267
4359
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4362,7 +4454,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4362
4454
|
});
|
|
4363
4455
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
4364
4456
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
4365
|
-
params.relativeDirPath =
|
|
4457
|
+
params.relativeDirPath = join38(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
4366
4458
|
params.relativeFilePath = "AGENTS.md";
|
|
4367
4459
|
}
|
|
4368
4460
|
return params;
|
|
@@ -4438,8 +4530,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4438
4530
|
validate = true
|
|
4439
4531
|
}) {
|
|
4440
4532
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4441
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4442
|
-
const fileContent = await readFileContent(
|
|
4533
|
+
const relativePath = isRoot ? "AGENTS.md" : join39(".agents/memories", relativeFilePath);
|
|
4534
|
+
const fileContent = await readFileContent(join39(baseDir, relativePath));
|
|
4443
4535
|
return new _AgentsMdRule({
|
|
4444
4536
|
baseDir,
|
|
4445
4537
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4479,7 +4571,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4479
4571
|
};
|
|
4480
4572
|
|
|
4481
4573
|
// src/rules/amazonqcli-rule.ts
|
|
4482
|
-
import { join as
|
|
4574
|
+
import { join as join40 } from "path";
|
|
4483
4575
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4484
4576
|
static getSettablePaths() {
|
|
4485
4577
|
return {
|
|
@@ -4494,7 +4586,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4494
4586
|
validate = true
|
|
4495
4587
|
}) {
|
|
4496
4588
|
const fileContent = await readFileContent(
|
|
4497
|
-
|
|
4589
|
+
join40(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4498
4590
|
);
|
|
4499
4591
|
return new _AmazonQCliRule({
|
|
4500
4592
|
baseDir,
|
|
@@ -4534,7 +4626,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4534
4626
|
};
|
|
4535
4627
|
|
|
4536
4628
|
// src/rules/augmentcode-legacy-rule.ts
|
|
4537
|
-
import { join as
|
|
4629
|
+
import { join as join41 } from "path";
|
|
4538
4630
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4539
4631
|
toRulesyncRule() {
|
|
4540
4632
|
const rulesyncFrontmatter = {
|
|
@@ -4595,8 +4687,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4595
4687
|
}) {
|
|
4596
4688
|
const settablePaths = this.getSettablePaths();
|
|
4597
4689
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
4598
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
4599
|
-
const fileContent = await readFileContent(
|
|
4690
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join41(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4691
|
+
const fileContent = await readFileContent(join41(baseDir, relativePath));
|
|
4600
4692
|
return new _AugmentcodeLegacyRule({
|
|
4601
4693
|
baseDir,
|
|
4602
4694
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -4609,7 +4701,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4609
4701
|
};
|
|
4610
4702
|
|
|
4611
4703
|
// src/rules/augmentcode-rule.ts
|
|
4612
|
-
import { join as
|
|
4704
|
+
import { join as join42 } from "path";
|
|
4613
4705
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
4614
4706
|
toRulesyncRule() {
|
|
4615
4707
|
return this.toRulesyncRuleDefault();
|
|
@@ -4641,7 +4733,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4641
4733
|
validate = true
|
|
4642
4734
|
}) {
|
|
4643
4735
|
const fileContent = await readFileContent(
|
|
4644
|
-
|
|
4736
|
+
join42(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4645
4737
|
);
|
|
4646
4738
|
const { body: content } = parseFrontmatter(fileContent);
|
|
4647
4739
|
return new _AugmentcodeRule({
|
|
@@ -4664,7 +4756,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4664
4756
|
};
|
|
4665
4757
|
|
|
4666
4758
|
// src/rules/claudecode-rule.ts
|
|
4667
|
-
import { join as
|
|
4759
|
+
import { join as join43 } from "path";
|
|
4668
4760
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4669
4761
|
static getSettablePaths({
|
|
4670
4762
|
global
|
|
@@ -4683,7 +4775,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4683
4775
|
relativeFilePath: "CLAUDE.md"
|
|
4684
4776
|
},
|
|
4685
4777
|
nonRoot: {
|
|
4686
|
-
relativeDirPath:
|
|
4778
|
+
relativeDirPath: join43(".claude", "memories")
|
|
4687
4779
|
}
|
|
4688
4780
|
};
|
|
4689
4781
|
}
|
|
@@ -4698,7 +4790,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4698
4790
|
if (isRoot) {
|
|
4699
4791
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4700
4792
|
const fileContent2 = await readFileContent(
|
|
4701
|
-
|
|
4793
|
+
join43(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4702
4794
|
);
|
|
4703
4795
|
return new _ClaudecodeRule({
|
|
4704
4796
|
baseDir,
|
|
@@ -4712,8 +4804,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4712
4804
|
if (!paths.nonRoot) {
|
|
4713
4805
|
throw new Error("nonRoot path is not set");
|
|
4714
4806
|
}
|
|
4715
|
-
const relativePath =
|
|
4716
|
-
const fileContent = await readFileContent(
|
|
4807
|
+
const relativePath = join43(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4808
|
+
const fileContent = await readFileContent(join43(baseDir, relativePath));
|
|
4717
4809
|
return new _ClaudecodeRule({
|
|
4718
4810
|
baseDir,
|
|
4719
4811
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4755,7 +4847,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4755
4847
|
};
|
|
4756
4848
|
|
|
4757
4849
|
// src/rules/cline-rule.ts
|
|
4758
|
-
import { join as
|
|
4850
|
+
import { join as join44 } from "path";
|
|
4759
4851
|
import { z as z18 } from "zod/mini";
|
|
4760
4852
|
var ClineRuleFrontmatterSchema = z18.object({
|
|
4761
4853
|
description: z18.string()
|
|
@@ -4800,7 +4892,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4800
4892
|
validate = true
|
|
4801
4893
|
}) {
|
|
4802
4894
|
const fileContent = await readFileContent(
|
|
4803
|
-
|
|
4895
|
+
join44(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4804
4896
|
);
|
|
4805
4897
|
return new _ClineRule({
|
|
4806
4898
|
baseDir,
|
|
@@ -4813,7 +4905,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4813
4905
|
};
|
|
4814
4906
|
|
|
4815
4907
|
// src/rules/codexcli-rule.ts
|
|
4816
|
-
import { join as
|
|
4908
|
+
import { join as join45 } from "path";
|
|
4817
4909
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4818
4910
|
static getSettablePaths({
|
|
4819
4911
|
global
|
|
@@ -4847,7 +4939,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4847
4939
|
if (isRoot) {
|
|
4848
4940
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4849
4941
|
const fileContent2 = await readFileContent(
|
|
4850
|
-
|
|
4942
|
+
join45(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4851
4943
|
);
|
|
4852
4944
|
return new _CodexcliRule({
|
|
4853
4945
|
baseDir,
|
|
@@ -4861,8 +4953,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4861
4953
|
if (!paths.nonRoot) {
|
|
4862
4954
|
throw new Error("nonRoot path is not set");
|
|
4863
4955
|
}
|
|
4864
|
-
const relativePath =
|
|
4865
|
-
const fileContent = await readFileContent(
|
|
4956
|
+
const relativePath = join45(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4957
|
+
const fileContent = await readFileContent(join45(baseDir, relativePath));
|
|
4866
4958
|
return new _CodexcliRule({
|
|
4867
4959
|
baseDir,
|
|
4868
4960
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4904,7 +4996,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4904
4996
|
};
|
|
4905
4997
|
|
|
4906
4998
|
// src/rules/copilot-rule.ts
|
|
4907
|
-
import { join as
|
|
4999
|
+
import { join as join46 } from "path";
|
|
4908
5000
|
import { z as z19 } from "zod/mini";
|
|
4909
5001
|
var CopilotRuleFrontmatterSchema = z19.object({
|
|
4910
5002
|
description: z19.optional(z19.string()),
|
|
@@ -4929,7 +5021,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4929
5021
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4930
5022
|
if (!result.success) {
|
|
4931
5023
|
throw new Error(
|
|
4932
|
-
`Invalid frontmatter in ${
|
|
5024
|
+
`Invalid frontmatter in ${join46(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
4933
5025
|
);
|
|
4934
5026
|
}
|
|
4935
5027
|
}
|
|
@@ -4948,12 +5040,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4948
5040
|
description: this.frontmatter.description,
|
|
4949
5041
|
globs: this.isRoot() ? ["**/*"] : []
|
|
4950
5042
|
};
|
|
5043
|
+
const originalFilePath = this.getRelativeFilePath();
|
|
5044
|
+
const relativeFilePath = originalFilePath.replace(/\.instructions\.md$/, ".md");
|
|
4951
5045
|
return new RulesyncRule({
|
|
4952
5046
|
baseDir: this.getBaseDir(),
|
|
4953
5047
|
frontmatter: rulesyncFrontmatter,
|
|
4954
5048
|
body: this.body,
|
|
4955
5049
|
relativeDirPath: ".rulesync/rules",
|
|
4956
|
-
relativeFilePath
|
|
5050
|
+
relativeFilePath,
|
|
4957
5051
|
validate: true
|
|
4958
5052
|
});
|
|
4959
5053
|
}
|
|
@@ -4999,11 +5093,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4999
5093
|
validate = true
|
|
5000
5094
|
}) {
|
|
5001
5095
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
5002
|
-
const relativePath = isRoot ?
|
|
5096
|
+
const relativePath = isRoot ? join46(
|
|
5003
5097
|
this.getSettablePaths().root.relativeDirPath,
|
|
5004
5098
|
this.getSettablePaths().root.relativeFilePath
|
|
5005
|
-
) :
|
|
5006
|
-
const fileContent = await readFileContent(
|
|
5099
|
+
) : join46(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5100
|
+
const fileContent = await readFileContent(join46(baseDir, relativePath));
|
|
5007
5101
|
if (isRoot) {
|
|
5008
5102
|
return new _CopilotRule({
|
|
5009
5103
|
baseDir,
|
|
@@ -5022,7 +5116,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5022
5116
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5023
5117
|
if (!result.success) {
|
|
5024
5118
|
throw new Error(
|
|
5025
|
-
`Invalid frontmatter in ${
|
|
5119
|
+
`Invalid frontmatter in ${join46(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
5026
5120
|
);
|
|
5027
5121
|
}
|
|
5028
5122
|
return new _CopilotRule({
|
|
@@ -5046,7 +5140,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5046
5140
|
return {
|
|
5047
5141
|
success: false,
|
|
5048
5142
|
error: new Error(
|
|
5049
|
-
`Invalid frontmatter in ${
|
|
5143
|
+
`Invalid frontmatter in ${join46(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5050
5144
|
)
|
|
5051
5145
|
};
|
|
5052
5146
|
}
|
|
@@ -5066,7 +5160,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5066
5160
|
};
|
|
5067
5161
|
|
|
5068
5162
|
// src/rules/cursor-rule.ts
|
|
5069
|
-
import { basename as basename16, join as
|
|
5163
|
+
import { basename as basename16, join as join47 } from "path";
|
|
5070
5164
|
import { z as z20 } from "zod/mini";
|
|
5071
5165
|
var CursorRuleFrontmatterSchema = z20.object({
|
|
5072
5166
|
description: z20.optional(z20.string()),
|
|
@@ -5088,7 +5182,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5088
5182
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5089
5183
|
if (!result.success) {
|
|
5090
5184
|
throw new Error(
|
|
5091
|
-
`Invalid frontmatter in ${
|
|
5185
|
+
`Invalid frontmatter in ${join47(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
5092
5186
|
);
|
|
5093
5187
|
}
|
|
5094
5188
|
}
|
|
@@ -5195,13 +5289,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5195
5289
|
validate = true
|
|
5196
5290
|
}) {
|
|
5197
5291
|
const fileContent = await readFileContent(
|
|
5198
|
-
|
|
5292
|
+
join47(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5199
5293
|
);
|
|
5200
5294
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
5201
5295
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5202
5296
|
if (!result.success) {
|
|
5203
5297
|
throw new Error(
|
|
5204
|
-
`Invalid frontmatter in ${
|
|
5298
|
+
`Invalid frontmatter in ${join47(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
5205
5299
|
);
|
|
5206
5300
|
}
|
|
5207
5301
|
return new _CursorRule({
|
|
@@ -5224,7 +5318,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5224
5318
|
return {
|
|
5225
5319
|
success: false,
|
|
5226
5320
|
error: new Error(
|
|
5227
|
-
`Invalid frontmatter in ${
|
|
5321
|
+
`Invalid frontmatter in ${join47(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
5228
5322
|
)
|
|
5229
5323
|
};
|
|
5230
5324
|
}
|
|
@@ -5244,7 +5338,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5244
5338
|
};
|
|
5245
5339
|
|
|
5246
5340
|
// src/rules/geminicli-rule.ts
|
|
5247
|
-
import { join as
|
|
5341
|
+
import { join as join48 } from "path";
|
|
5248
5342
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5249
5343
|
static getSettablePaths({
|
|
5250
5344
|
global
|
|
@@ -5278,7 +5372,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5278
5372
|
if (isRoot) {
|
|
5279
5373
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5280
5374
|
const fileContent2 = await readFileContent(
|
|
5281
|
-
|
|
5375
|
+
join48(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5282
5376
|
);
|
|
5283
5377
|
return new _GeminiCliRule({
|
|
5284
5378
|
baseDir,
|
|
@@ -5292,8 +5386,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5292
5386
|
if (!paths.nonRoot) {
|
|
5293
5387
|
throw new Error("nonRoot path is not set");
|
|
5294
5388
|
}
|
|
5295
|
-
const relativePath =
|
|
5296
|
-
const fileContent = await readFileContent(
|
|
5389
|
+
const relativePath = join48(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5390
|
+
const fileContent = await readFileContent(join48(baseDir, relativePath));
|
|
5297
5391
|
return new _GeminiCliRule({
|
|
5298
5392
|
baseDir,
|
|
5299
5393
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5335,7 +5429,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5335
5429
|
};
|
|
5336
5430
|
|
|
5337
5431
|
// src/rules/junie-rule.ts
|
|
5338
|
-
import { join as
|
|
5432
|
+
import { join as join49 } from "path";
|
|
5339
5433
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
5340
5434
|
static getSettablePaths() {
|
|
5341
5435
|
return {
|
|
@@ -5354,8 +5448,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5354
5448
|
validate = true
|
|
5355
5449
|
}) {
|
|
5356
5450
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
5357
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
5358
|
-
const fileContent = await readFileContent(
|
|
5451
|
+
const relativePath = isRoot ? "guidelines.md" : join49(".junie/memories", relativeFilePath);
|
|
5452
|
+
const fileContent = await readFileContent(join49(baseDir, relativePath));
|
|
5359
5453
|
return new _JunieRule({
|
|
5360
5454
|
baseDir,
|
|
5361
5455
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5395,7 +5489,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5395
5489
|
};
|
|
5396
5490
|
|
|
5397
5491
|
// src/rules/kiro-rule.ts
|
|
5398
|
-
import { join as
|
|
5492
|
+
import { join as join50 } from "path";
|
|
5399
5493
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
5400
5494
|
static getSettablePaths() {
|
|
5401
5495
|
return {
|
|
@@ -5410,7 +5504,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5410
5504
|
validate = true
|
|
5411
5505
|
}) {
|
|
5412
5506
|
const fileContent = await readFileContent(
|
|
5413
|
-
|
|
5507
|
+
join50(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5414
5508
|
);
|
|
5415
5509
|
return new _KiroRule({
|
|
5416
5510
|
baseDir,
|
|
@@ -5450,7 +5544,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5450
5544
|
};
|
|
5451
5545
|
|
|
5452
5546
|
// src/rules/opencode-rule.ts
|
|
5453
|
-
import { join as
|
|
5547
|
+
import { join as join51 } from "path";
|
|
5454
5548
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
5455
5549
|
static getSettablePaths() {
|
|
5456
5550
|
return {
|
|
@@ -5469,8 +5563,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5469
5563
|
validate = true
|
|
5470
5564
|
}) {
|
|
5471
5565
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
5472
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
5473
|
-
const fileContent = await readFileContent(
|
|
5566
|
+
const relativePath = isRoot ? "AGENTS.md" : join51(".opencode/memories", relativeFilePath);
|
|
5567
|
+
const fileContent = await readFileContent(join51(baseDir, relativePath));
|
|
5474
5568
|
return new _OpenCodeRule({
|
|
5475
5569
|
baseDir,
|
|
5476
5570
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5510,7 +5604,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5510
5604
|
};
|
|
5511
5605
|
|
|
5512
5606
|
// src/rules/qwencode-rule.ts
|
|
5513
|
-
import { join as
|
|
5607
|
+
import { join as join52 } from "path";
|
|
5514
5608
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5515
5609
|
static getSettablePaths() {
|
|
5516
5610
|
return {
|
|
@@ -5529,8 +5623,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5529
5623
|
validate = true
|
|
5530
5624
|
}) {
|
|
5531
5625
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5532
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
5533
|
-
const fileContent = await readFileContent(
|
|
5626
|
+
const relativePath = isRoot ? "QWEN.md" : join52(".qwen/memories", relativeFilePath);
|
|
5627
|
+
const fileContent = await readFileContent(join52(baseDir, relativePath));
|
|
5534
5628
|
return new _QwencodeRule({
|
|
5535
5629
|
baseDir,
|
|
5536
5630
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5567,7 +5661,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5567
5661
|
};
|
|
5568
5662
|
|
|
5569
5663
|
// src/rules/roo-rule.ts
|
|
5570
|
-
import { join as
|
|
5664
|
+
import { join as join53 } from "path";
|
|
5571
5665
|
var RooRule = class _RooRule extends ToolRule {
|
|
5572
5666
|
static getSettablePaths() {
|
|
5573
5667
|
return {
|
|
@@ -5582,7 +5676,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5582
5676
|
validate = true
|
|
5583
5677
|
}) {
|
|
5584
5678
|
const fileContent = await readFileContent(
|
|
5585
|
-
|
|
5679
|
+
join53(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5586
5680
|
);
|
|
5587
5681
|
return new _RooRule({
|
|
5588
5682
|
baseDir,
|
|
@@ -5637,7 +5731,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5637
5731
|
};
|
|
5638
5732
|
|
|
5639
5733
|
// src/rules/warp-rule.ts
|
|
5640
|
-
import { join as
|
|
5734
|
+
import { join as join54 } from "path";
|
|
5641
5735
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
5642
5736
|
constructor({ fileContent, root, ...rest }) {
|
|
5643
5737
|
super({
|
|
@@ -5663,8 +5757,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5663
5757
|
validate = true
|
|
5664
5758
|
}) {
|
|
5665
5759
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
5666
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
5667
|
-
const fileContent = await readFileContent(
|
|
5760
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join54(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5761
|
+
const fileContent = await readFileContent(join54(baseDir, relativePath));
|
|
5668
5762
|
return new _WarpRule({
|
|
5669
5763
|
baseDir,
|
|
5670
5764
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -5704,7 +5798,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5704
5798
|
};
|
|
5705
5799
|
|
|
5706
5800
|
// src/rules/windsurf-rule.ts
|
|
5707
|
-
import { join as
|
|
5801
|
+
import { join as join55 } from "path";
|
|
5708
5802
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
5709
5803
|
static getSettablePaths() {
|
|
5710
5804
|
return {
|
|
@@ -5719,7 +5813,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
5719
5813
|
validate = true
|
|
5720
5814
|
}) {
|
|
5721
5815
|
const fileContent = await readFileContent(
|
|
5722
|
-
|
|
5816
|
+
join55(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5723
5817
|
);
|
|
5724
5818
|
return new _WindsurfRule({
|
|
5725
5819
|
baseDir,
|
|
@@ -6119,7 +6213,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6119
6213
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
6120
6214
|
*/
|
|
6121
6215
|
async loadRulesyncFiles() {
|
|
6122
|
-
const files = await findFilesByGlobs(
|
|
6216
|
+
const files = await findFilesByGlobs(join56(".rulesync/rules", "*.md"));
|
|
6123
6217
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
6124
6218
|
const rulesyncRules = await Promise.all(
|
|
6125
6219
|
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: basename17(file) }))
|
|
@@ -6140,7 +6234,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6140
6234
|
return rulesyncRules;
|
|
6141
6235
|
}
|
|
6142
6236
|
async loadRulesyncFilesLegacy() {
|
|
6143
|
-
const legacyFiles = await findFilesByGlobs(
|
|
6237
|
+
const legacyFiles = await findFilesByGlobs(join56(".rulesync", "*.md"));
|
|
6144
6238
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
6145
6239
|
return Promise.all(
|
|
6146
6240
|
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: basename17(file) }))
|
|
@@ -6207,7 +6301,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6207
6301
|
return [];
|
|
6208
6302
|
}
|
|
6209
6303
|
const rootFilePaths = await findFilesByGlobs(
|
|
6210
|
-
|
|
6304
|
+
join56(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
6211
6305
|
);
|
|
6212
6306
|
return await Promise.all(
|
|
6213
6307
|
rootFilePaths.map(
|
|
@@ -6225,7 +6319,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6225
6319
|
return [];
|
|
6226
6320
|
}
|
|
6227
6321
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
6228
|
-
|
|
6322
|
+
join56(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
6229
6323
|
);
|
|
6230
6324
|
return await Promise.all(
|
|
6231
6325
|
nonRootFilePaths.map(
|
|
@@ -6601,14 +6695,14 @@ s/<command> [arguments]
|
|
|
6601
6695
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
6602
6696
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
6603
6697
|
|
|
6604
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
6698
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join56(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
6605
6699
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
6606
6700
|
|
|
6607
6701
|
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.
|
|
6608
6702
|
|
|
6609
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
6703
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join56(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
6610
6704
|
|
|
6611
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
6705
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join56(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
6612
6706
|
const result = [
|
|
6613
6707
|
overview,
|
|
6614
6708
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -6818,9 +6912,9 @@ async function generateSubagents(config) {
|
|
|
6818
6912
|
}
|
|
6819
6913
|
|
|
6820
6914
|
// src/cli/commands/gitignore.ts
|
|
6821
|
-
import { join as
|
|
6915
|
+
import { join as join57 } from "path";
|
|
6822
6916
|
var gitignoreCommand = async () => {
|
|
6823
|
-
const gitignorePath =
|
|
6917
|
+
const gitignorePath = join57(process.cwd(), ".gitignore");
|
|
6824
6918
|
const rulesFilesToIgnore = [
|
|
6825
6919
|
"# Generated by rulesync - AI tool configuration files",
|
|
6826
6920
|
"**/.amazonq/",
|
|
@@ -7048,7 +7142,7 @@ async function importSubagents(config, tool) {
|
|
|
7048
7142
|
}
|
|
7049
7143
|
|
|
7050
7144
|
// src/cli/commands/init.ts
|
|
7051
|
-
import { join as
|
|
7145
|
+
import { join as join58 } from "path";
|
|
7052
7146
|
async function initCommand() {
|
|
7053
7147
|
logger.info("Initializing rulesync...");
|
|
7054
7148
|
await ensureDir(".rulesync");
|
|
@@ -7119,7 +7213,7 @@ globs: ["**/*"]
|
|
|
7119
7213
|
- Follow single responsibility principle
|
|
7120
7214
|
`
|
|
7121
7215
|
};
|
|
7122
|
-
const filepath =
|
|
7216
|
+
const filepath = join58(".rulesync/rules", sampleFile.filename);
|
|
7123
7217
|
await ensureDir(".rulesync/rules");
|
|
7124
7218
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
7125
7219
|
await ensureDir(".rulesync/subagents");
|
|
@@ -7132,7 +7226,7 @@ globs: ["**/*"]
|
|
|
7132
7226
|
}
|
|
7133
7227
|
|
|
7134
7228
|
// src/cli/index.ts
|
|
7135
|
-
var getVersion = () => "3.
|
|
7229
|
+
var getVersion = () => "3.6.0";
|
|
7136
7230
|
var main = async () => {
|
|
7137
7231
|
const program = new Command();
|
|
7138
7232
|
const version = getVersion();
|