rulesync 5.5.1 → 5.7.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 +10 -2
- package/dist/index.cjs +514 -335
- package/dist/index.js +492 -313
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5217,8 +5217,8 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
5217
5217
|
|
|
5218
5218
|
// src/features/rules/rules-processor.ts
|
|
5219
5219
|
import { encode } from "@toon-format/toon";
|
|
5220
|
-
import { basename as basename24, join as
|
|
5221
|
-
import { z as
|
|
5220
|
+
import { basename as basename24, join as join94 } from "path";
|
|
5221
|
+
import { z as z43 } from "zod/mini";
|
|
5222
5222
|
|
|
5223
5223
|
// src/constants/general.ts
|
|
5224
5224
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
@@ -7744,8 +7744,8 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
7744
7744
|
};
|
|
7745
7745
|
|
|
7746
7746
|
// src/features/subagents/subagents-processor.ts
|
|
7747
|
-
import { basename as basename21, join as
|
|
7748
|
-
import { z as
|
|
7747
|
+
import { basename as basename21, join as join71 } from "path";
|
|
7748
|
+
import { z as z36 } from "zod/mini";
|
|
7749
7749
|
|
|
7750
7750
|
// src/features/subagents/claudecode-subagent.ts
|
|
7751
7751
|
import { join as join67 } from "path";
|
|
@@ -7872,7 +7872,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7872
7872
|
...restFields
|
|
7873
7873
|
};
|
|
7874
7874
|
const rulesyncFrontmatter = {
|
|
7875
|
-
targets: ["
|
|
7875
|
+
targets: ["*"],
|
|
7876
7876
|
name,
|
|
7877
7877
|
description,
|
|
7878
7878
|
// Only include claudecode section if there are fields
|
|
@@ -8033,7 +8033,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
8033
8033
|
toRulesyncSubagent() {
|
|
8034
8034
|
const { name, description, tools, ...rest } = this.frontmatter;
|
|
8035
8035
|
const rulesyncFrontmatter = {
|
|
8036
|
-
targets: ["
|
|
8036
|
+
targets: ["*"],
|
|
8037
8037
|
name,
|
|
8038
8038
|
description,
|
|
8039
8039
|
copilot: {
|
|
@@ -8148,13 +8148,150 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
8148
8148
|
}
|
|
8149
8149
|
};
|
|
8150
8150
|
|
|
8151
|
-
// src/features/subagents/
|
|
8152
|
-
import {
|
|
8151
|
+
// src/features/subagents/kiro-subagent.ts
|
|
8152
|
+
import { join as join69 } from "path";
|
|
8153
8153
|
import { z as z34 } from "zod/mini";
|
|
8154
|
-
var
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8154
|
+
var KiroCliSubagentJsonSchema = z34.looseObject({
|
|
8155
|
+
name: z34.string(),
|
|
8156
|
+
description: z34.optional(z34.nullable(z34.string())),
|
|
8157
|
+
prompt: z34.optional(z34.nullable(z34.string())),
|
|
8158
|
+
tools: z34.optional(z34.nullable(z34.array(z34.string()))),
|
|
8159
|
+
toolAliases: z34.optional(z34.nullable(z34.record(z34.string(), z34.string()))),
|
|
8160
|
+
toolSettings: z34.optional(z34.nullable(z34.unknown())),
|
|
8161
|
+
toolSchema: z34.optional(z34.nullable(z34.unknown())),
|
|
8162
|
+
hooks: z34.optional(z34.nullable(z34.record(z34.string(), z34.array(z34.unknown())))),
|
|
8163
|
+
model: z34.optional(z34.nullable(z34.string())),
|
|
8164
|
+
mcpServers: z34.optional(z34.nullable(z34.record(z34.string(), z34.unknown()))),
|
|
8165
|
+
useLegacyMcpJson: z34.optional(z34.nullable(z34.boolean())),
|
|
8166
|
+
resources: z34.optional(z34.nullable(z34.array(z34.string()))),
|
|
8167
|
+
allowedTools: z34.optional(z34.nullable(z34.array(z34.string()))),
|
|
8168
|
+
includeMcpJson: z34.optional(z34.nullable(z34.boolean()))
|
|
8169
|
+
});
|
|
8170
|
+
var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
8171
|
+
body;
|
|
8172
|
+
constructor({ body, ...rest }) {
|
|
8173
|
+
super({
|
|
8174
|
+
...rest
|
|
8175
|
+
});
|
|
8176
|
+
this.body = body;
|
|
8177
|
+
}
|
|
8178
|
+
static getSettablePaths(_options = {}) {
|
|
8179
|
+
return {
|
|
8180
|
+
relativeDirPath: join69(".kiro", "agents")
|
|
8181
|
+
};
|
|
8182
|
+
}
|
|
8183
|
+
getBody() {
|
|
8184
|
+
return this.body;
|
|
8185
|
+
}
|
|
8186
|
+
toRulesyncSubagent() {
|
|
8187
|
+
const parsed = JSON.parse(this.body);
|
|
8188
|
+
const { name, description, prompt, ...restFields } = parsed;
|
|
8189
|
+
const kiroSection = {
|
|
8190
|
+
...restFields
|
|
8191
|
+
};
|
|
8192
|
+
const rulesyncFrontmatter = {
|
|
8193
|
+
targets: ["kiro"],
|
|
8194
|
+
name,
|
|
8195
|
+
description: description ?? "",
|
|
8196
|
+
// Only include kiro section if there are fields
|
|
8197
|
+
...Object.keys(kiroSection).length > 0 && { kiro: kiroSection }
|
|
8198
|
+
};
|
|
8199
|
+
return new RulesyncSubagent({
|
|
8200
|
+
baseDir: ".",
|
|
8201
|
+
frontmatter: rulesyncFrontmatter,
|
|
8202
|
+
body: prompt ?? "",
|
|
8203
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
8204
|
+
relativeFilePath: this.getRelativeFilePath().replace(/\.json$/, ".md"),
|
|
8205
|
+
validate: true
|
|
8206
|
+
});
|
|
8207
|
+
}
|
|
8208
|
+
static fromRulesyncSubagent({
|
|
8209
|
+
baseDir = process.cwd(),
|
|
8210
|
+
rulesyncSubagent,
|
|
8211
|
+
validate = true,
|
|
8212
|
+
global = false
|
|
8213
|
+
}) {
|
|
8214
|
+
const frontmatter = rulesyncSubagent.getFrontmatter();
|
|
8215
|
+
const kiroSection = frontmatter.kiro ?? {};
|
|
8216
|
+
const json = {
|
|
8217
|
+
name: frontmatter.name,
|
|
8218
|
+
description: frontmatter.description || null,
|
|
8219
|
+
prompt: rulesyncSubagent.getBody() || null,
|
|
8220
|
+
...kiroSection
|
|
8221
|
+
};
|
|
8222
|
+
const body = JSON.stringify(json, null, 2);
|
|
8223
|
+
const paths = this.getSettablePaths({ global });
|
|
8224
|
+
const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".json");
|
|
8225
|
+
return new _KiroSubagent({
|
|
8226
|
+
baseDir,
|
|
8227
|
+
body,
|
|
8228
|
+
relativeDirPath: paths.relativeDirPath,
|
|
8229
|
+
relativeFilePath,
|
|
8230
|
+
fileContent: body,
|
|
8231
|
+
validate,
|
|
8232
|
+
global
|
|
8233
|
+
});
|
|
8234
|
+
}
|
|
8235
|
+
validate() {
|
|
8236
|
+
try {
|
|
8237
|
+
const parsed = JSON.parse(this.body);
|
|
8238
|
+
KiroCliSubagentJsonSchema.parse(parsed);
|
|
8239
|
+
return { success: true, error: null };
|
|
8240
|
+
} catch (error) {
|
|
8241
|
+
return {
|
|
8242
|
+
success: false,
|
|
8243
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
8244
|
+
};
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
8248
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
8249
|
+
rulesyncSubagent,
|
|
8250
|
+
toolTarget: "kiro"
|
|
8251
|
+
});
|
|
8252
|
+
}
|
|
8253
|
+
static async fromFile({
|
|
8254
|
+
baseDir = process.cwd(),
|
|
8255
|
+
relativeFilePath,
|
|
8256
|
+
validate = true,
|
|
8257
|
+
global = false
|
|
8258
|
+
}) {
|
|
8259
|
+
const paths = this.getSettablePaths({ global });
|
|
8260
|
+
const filePath = join69(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
8261
|
+
const fileContent = await readFileContent(filePath);
|
|
8262
|
+
return new _KiroSubagent({
|
|
8263
|
+
baseDir,
|
|
8264
|
+
relativeDirPath: paths.relativeDirPath,
|
|
8265
|
+
relativeFilePath,
|
|
8266
|
+
body: fileContent.trim(),
|
|
8267
|
+
fileContent,
|
|
8268
|
+
validate,
|
|
8269
|
+
global
|
|
8270
|
+
});
|
|
8271
|
+
}
|
|
8272
|
+
static forDeletion({
|
|
8273
|
+
baseDir = process.cwd(),
|
|
8274
|
+
relativeDirPath,
|
|
8275
|
+
relativeFilePath
|
|
8276
|
+
}) {
|
|
8277
|
+
return new _KiroSubagent({
|
|
8278
|
+
baseDir,
|
|
8279
|
+
relativeDirPath,
|
|
8280
|
+
relativeFilePath,
|
|
8281
|
+
body: "",
|
|
8282
|
+
fileContent: "",
|
|
8283
|
+
validate: false
|
|
8284
|
+
});
|
|
8285
|
+
}
|
|
8286
|
+
};
|
|
8287
|
+
|
|
8288
|
+
// src/features/subagents/opencode-subagent.ts
|
|
8289
|
+
import { basename as basename20, join as join70 } from "path";
|
|
8290
|
+
import { z as z35 } from "zod/mini";
|
|
8291
|
+
var OpenCodeSubagentFrontmatterSchema = z35.looseObject({
|
|
8292
|
+
description: z35.string(),
|
|
8293
|
+
mode: z35.literal("subagent"),
|
|
8294
|
+
name: z35.optional(z35.string())
|
|
8158
8295
|
});
|
|
8159
8296
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
8160
8297
|
frontmatter;
|
|
@@ -8164,7 +8301,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8164
8301
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8165
8302
|
if (!result.success) {
|
|
8166
8303
|
throw new Error(
|
|
8167
|
-
`Invalid frontmatter in ${
|
|
8304
|
+
`Invalid frontmatter in ${join70(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8168
8305
|
);
|
|
8169
8306
|
}
|
|
8170
8307
|
}
|
|
@@ -8178,7 +8315,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8178
8315
|
global = false
|
|
8179
8316
|
} = {}) {
|
|
8180
8317
|
return {
|
|
8181
|
-
relativeDirPath: global ?
|
|
8318
|
+
relativeDirPath: global ? join70(".config", "opencode", "agent") : join70(".opencode", "agent")
|
|
8182
8319
|
};
|
|
8183
8320
|
}
|
|
8184
8321
|
getFrontmatter() {
|
|
@@ -8190,7 +8327,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8190
8327
|
toRulesyncSubagent() {
|
|
8191
8328
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
8192
8329
|
const rulesyncFrontmatter = {
|
|
8193
|
-
targets: ["
|
|
8330
|
+
targets: ["*"],
|
|
8194
8331
|
name: name ?? basename20(this.getRelativeFilePath(), ".md"),
|
|
8195
8332
|
description,
|
|
8196
8333
|
opencode: { mode, ...opencodeSection }
|
|
@@ -8244,7 +8381,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8244
8381
|
return {
|
|
8245
8382
|
success: false,
|
|
8246
8383
|
error: new Error(
|
|
8247
|
-
`Invalid frontmatter in ${
|
|
8384
|
+
`Invalid frontmatter in ${join70(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8248
8385
|
)
|
|
8249
8386
|
};
|
|
8250
8387
|
}
|
|
@@ -8261,7 +8398,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8261
8398
|
global = false
|
|
8262
8399
|
}) {
|
|
8263
8400
|
const paths = this.getSettablePaths({ global });
|
|
8264
|
-
const filePath =
|
|
8401
|
+
const filePath = join70(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
8265
8402
|
const fileContent = await readFileContent(filePath);
|
|
8266
8403
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8267
8404
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -8305,41 +8442,82 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
8305
8442
|
"copilot",
|
|
8306
8443
|
"cursor",
|
|
8307
8444
|
"geminicli",
|
|
8445
|
+
"kiro",
|
|
8308
8446
|
"opencode",
|
|
8309
8447
|
"roo"
|
|
8310
8448
|
];
|
|
8311
|
-
var SubagentsProcessorToolTargetSchema =
|
|
8449
|
+
var SubagentsProcessorToolTargetSchema = z36.enum(subagentsProcessorToolTargetTuple);
|
|
8312
8450
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
8313
8451
|
[
|
|
8314
8452
|
"agentsmd",
|
|
8315
|
-
{
|
|
8453
|
+
{
|
|
8454
|
+
class: AgentsmdSubagent,
|
|
8455
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
8456
|
+
}
|
|
8316
8457
|
],
|
|
8317
8458
|
[
|
|
8318
8459
|
"claudecode",
|
|
8319
|
-
{
|
|
8460
|
+
{
|
|
8461
|
+
class: ClaudecodeSubagent,
|
|
8462
|
+
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
8463
|
+
}
|
|
8320
8464
|
],
|
|
8321
8465
|
[
|
|
8322
8466
|
"claudecode-legacy",
|
|
8323
|
-
{
|
|
8467
|
+
{
|
|
8468
|
+
class: ClaudecodeSubagent,
|
|
8469
|
+
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
8470
|
+
}
|
|
8324
8471
|
],
|
|
8325
8472
|
[
|
|
8326
8473
|
"codexcli",
|
|
8327
|
-
{
|
|
8474
|
+
{
|
|
8475
|
+
class: CodexCliSubagent,
|
|
8476
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
8477
|
+
}
|
|
8328
8478
|
],
|
|
8329
8479
|
[
|
|
8330
8480
|
"copilot",
|
|
8331
|
-
{
|
|
8481
|
+
{
|
|
8482
|
+
class: CopilotSubagent,
|
|
8483
|
+
meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
|
|
8484
|
+
}
|
|
8485
|
+
],
|
|
8486
|
+
[
|
|
8487
|
+
"cursor",
|
|
8488
|
+
{
|
|
8489
|
+
class: CursorSubagent,
|
|
8490
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
8491
|
+
}
|
|
8332
8492
|
],
|
|
8333
|
-
["cursor", { class: CursorSubagent, meta: { supportsSimulated: true, supportsGlobal: false } }],
|
|
8334
8493
|
[
|
|
8335
8494
|
"geminicli",
|
|
8336
|
-
{
|
|
8495
|
+
{
|
|
8496
|
+
class: GeminiCliSubagent,
|
|
8497
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
8498
|
+
}
|
|
8499
|
+
],
|
|
8500
|
+
[
|
|
8501
|
+
"kiro",
|
|
8502
|
+
{
|
|
8503
|
+
class: KiroSubagent,
|
|
8504
|
+
meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.json" }
|
|
8505
|
+
}
|
|
8337
8506
|
],
|
|
8338
8507
|
[
|
|
8339
8508
|
"opencode",
|
|
8340
|
-
{
|
|
8509
|
+
{
|
|
8510
|
+
class: OpenCodeSubagent,
|
|
8511
|
+
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
8512
|
+
}
|
|
8341
8513
|
],
|
|
8342
|
-
[
|
|
8514
|
+
[
|
|
8515
|
+
"roo",
|
|
8516
|
+
{
|
|
8517
|
+
class: RooSubagent,
|
|
8518
|
+
meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
|
|
8519
|
+
}
|
|
8520
|
+
]
|
|
8343
8521
|
]);
|
|
8344
8522
|
var defaultGetFactory5 = (target) => {
|
|
8345
8523
|
const factory = toolSubagentFactories.get(target);
|
|
@@ -8422,7 +8600,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8422
8600
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
8423
8601
|
*/
|
|
8424
8602
|
async loadRulesyncFiles() {
|
|
8425
|
-
const subagentsDir =
|
|
8603
|
+
const subagentsDir = join71(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
8426
8604
|
const dirExists = await directoryExists(subagentsDir);
|
|
8427
8605
|
if (!dirExists) {
|
|
8428
8606
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -8437,7 +8615,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8437
8615
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
8438
8616
|
const rulesyncSubagents = [];
|
|
8439
8617
|
for (const mdFile of mdFiles) {
|
|
8440
|
-
const filepath =
|
|
8618
|
+
const filepath = join71(subagentsDir, mdFile);
|
|
8441
8619
|
try {
|
|
8442
8620
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
8443
8621
|
relativeFilePath: mdFile,
|
|
@@ -8467,7 +8645,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8467
8645
|
const factory = this.getFactory(this.toolTarget);
|
|
8468
8646
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
8469
8647
|
const subagentFilePaths = await findFilesByGlobs(
|
|
8470
|
-
|
|
8648
|
+
join71(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
8471
8649
|
);
|
|
8472
8650
|
if (forDeletion) {
|
|
8473
8651
|
const toolSubagents2 = subagentFilePaths.map(
|
|
@@ -8517,48 +8695,48 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8517
8695
|
};
|
|
8518
8696
|
|
|
8519
8697
|
// src/features/rules/agentsmd-rule.ts
|
|
8520
|
-
import { join as
|
|
8698
|
+
import { join as join74 } from "path";
|
|
8521
8699
|
|
|
8522
8700
|
// src/features/rules/tool-rule.ts
|
|
8523
|
-
import { join as
|
|
8701
|
+
import { join as join73 } from "path";
|
|
8524
8702
|
|
|
8525
8703
|
// src/features/rules/rulesync-rule.ts
|
|
8526
|
-
import { basename as basename22, join as
|
|
8527
|
-
import { z as
|
|
8528
|
-
var RulesyncRuleFrontmatterSchema =
|
|
8529
|
-
root:
|
|
8530
|
-
targets:
|
|
8531
|
-
description:
|
|
8532
|
-
globs:
|
|
8533
|
-
agentsmd:
|
|
8534
|
-
|
|
8704
|
+
import { basename as basename22, join as join72 } from "path";
|
|
8705
|
+
import { z as z37 } from "zod/mini";
|
|
8706
|
+
var RulesyncRuleFrontmatterSchema = z37.object({
|
|
8707
|
+
root: z37.optional(z37.optional(z37.boolean())),
|
|
8708
|
+
targets: z37.optional(RulesyncTargetsSchema),
|
|
8709
|
+
description: z37.optional(z37.string()),
|
|
8710
|
+
globs: z37.optional(z37.array(z37.string())),
|
|
8711
|
+
agentsmd: z37.optional(
|
|
8712
|
+
z37.object({
|
|
8535
8713
|
// @example "path/to/subproject"
|
|
8536
|
-
subprojectPath:
|
|
8714
|
+
subprojectPath: z37.optional(z37.string())
|
|
8537
8715
|
})
|
|
8538
8716
|
),
|
|
8539
|
-
claudecode:
|
|
8540
|
-
|
|
8717
|
+
claudecode: z37.optional(
|
|
8718
|
+
z37.object({
|
|
8541
8719
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
8542
8720
|
// @example "src/**/*.ts, tests/**/*.test.ts"
|
|
8543
|
-
paths:
|
|
8721
|
+
paths: z37.optional(z37.string())
|
|
8544
8722
|
})
|
|
8545
8723
|
),
|
|
8546
|
-
cursor:
|
|
8547
|
-
|
|
8548
|
-
alwaysApply:
|
|
8549
|
-
description:
|
|
8550
|
-
globs:
|
|
8724
|
+
cursor: z37.optional(
|
|
8725
|
+
z37.object({
|
|
8726
|
+
alwaysApply: z37.optional(z37.boolean()),
|
|
8727
|
+
description: z37.optional(z37.string()),
|
|
8728
|
+
globs: z37.optional(z37.array(z37.string()))
|
|
8551
8729
|
})
|
|
8552
8730
|
),
|
|
8553
|
-
copilot:
|
|
8554
|
-
|
|
8555
|
-
excludeAgent:
|
|
8731
|
+
copilot: z37.optional(
|
|
8732
|
+
z37.object({
|
|
8733
|
+
excludeAgent: z37.optional(z37.union([z37.literal("code-review"), z37.literal("coding-agent")]))
|
|
8556
8734
|
})
|
|
8557
8735
|
),
|
|
8558
|
-
antigravity:
|
|
8559
|
-
|
|
8560
|
-
trigger:
|
|
8561
|
-
globs:
|
|
8736
|
+
antigravity: z37.optional(
|
|
8737
|
+
z37.looseObject({
|
|
8738
|
+
trigger: z37.optional(z37.string()),
|
|
8739
|
+
globs: z37.optional(z37.array(z37.string()))
|
|
8562
8740
|
})
|
|
8563
8741
|
)
|
|
8564
8742
|
});
|
|
@@ -8570,7 +8748,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8570
8748
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8571
8749
|
if (!result.success) {
|
|
8572
8750
|
throw new Error(
|
|
8573
|
-
`Invalid frontmatter in ${
|
|
8751
|
+
`Invalid frontmatter in ${join72(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8574
8752
|
);
|
|
8575
8753
|
}
|
|
8576
8754
|
}
|
|
@@ -8605,7 +8783,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8605
8783
|
return {
|
|
8606
8784
|
success: false,
|
|
8607
8785
|
error: new Error(
|
|
8608
|
-
`Invalid frontmatter in ${
|
|
8786
|
+
`Invalid frontmatter in ${join72(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8609
8787
|
)
|
|
8610
8788
|
};
|
|
8611
8789
|
}
|
|
@@ -8614,12 +8792,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8614
8792
|
relativeFilePath,
|
|
8615
8793
|
validate = true
|
|
8616
8794
|
}) {
|
|
8617
|
-
const legacyPath =
|
|
8795
|
+
const legacyPath = join72(
|
|
8618
8796
|
process.cwd(),
|
|
8619
8797
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
8620
8798
|
relativeFilePath
|
|
8621
8799
|
);
|
|
8622
|
-
const recommendedPath =
|
|
8800
|
+
const recommendedPath = join72(
|
|
8623
8801
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
8624
8802
|
relativeFilePath
|
|
8625
8803
|
);
|
|
@@ -8654,7 +8832,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8654
8832
|
relativeFilePath,
|
|
8655
8833
|
validate = true
|
|
8656
8834
|
}) {
|
|
8657
|
-
const filePath =
|
|
8835
|
+
const filePath = join72(
|
|
8658
8836
|
process.cwd(),
|
|
8659
8837
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
8660
8838
|
relativeFilePath
|
|
@@ -8756,7 +8934,7 @@ var ToolRule = class extends ToolFile {
|
|
|
8756
8934
|
rulesyncRule,
|
|
8757
8935
|
validate = true,
|
|
8758
8936
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
8759
|
-
nonRootPath = { relativeDirPath:
|
|
8937
|
+
nonRootPath = { relativeDirPath: join73(".agents", "memories") }
|
|
8760
8938
|
}) {
|
|
8761
8939
|
const params = this.buildToolRuleParamsDefault({
|
|
8762
8940
|
baseDir,
|
|
@@ -8767,7 +8945,7 @@ var ToolRule = class extends ToolFile {
|
|
|
8767
8945
|
});
|
|
8768
8946
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
8769
8947
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
8770
|
-
params.relativeDirPath =
|
|
8948
|
+
params.relativeDirPath = join73(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
8771
8949
|
params.relativeFilePath = "AGENTS.md";
|
|
8772
8950
|
}
|
|
8773
8951
|
return params;
|
|
@@ -8832,7 +9010,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8832
9010
|
relativeFilePath: "AGENTS.md"
|
|
8833
9011
|
},
|
|
8834
9012
|
nonRoot: {
|
|
8835
|
-
relativeDirPath:
|
|
9013
|
+
relativeDirPath: join74(".agents", "memories")
|
|
8836
9014
|
}
|
|
8837
9015
|
};
|
|
8838
9016
|
}
|
|
@@ -8842,8 +9020,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8842
9020
|
validate = true
|
|
8843
9021
|
}) {
|
|
8844
9022
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
8845
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
8846
|
-
const fileContent = await readFileContent(
|
|
9023
|
+
const relativePath = isRoot ? "AGENTS.md" : join74(".agents", "memories", relativeFilePath);
|
|
9024
|
+
const fileContent = await readFileContent(join74(baseDir, relativePath));
|
|
8847
9025
|
return new _AgentsMdRule({
|
|
8848
9026
|
baseDir,
|
|
8849
9027
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -8898,21 +9076,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8898
9076
|
};
|
|
8899
9077
|
|
|
8900
9078
|
// src/features/rules/antigravity-rule.ts
|
|
8901
|
-
import { join as
|
|
8902
|
-
import { z as
|
|
8903
|
-
var AntigravityRuleFrontmatterSchema =
|
|
8904
|
-
trigger:
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
9079
|
+
import { join as join75 } from "path";
|
|
9080
|
+
import { z as z38 } from "zod/mini";
|
|
9081
|
+
var AntigravityRuleFrontmatterSchema = z38.looseObject({
|
|
9082
|
+
trigger: z38.optional(
|
|
9083
|
+
z38.union([
|
|
9084
|
+
z38.literal("always_on"),
|
|
9085
|
+
z38.literal("glob"),
|
|
9086
|
+
z38.literal("manual"),
|
|
9087
|
+
z38.literal("model_decision"),
|
|
9088
|
+
z38.string()
|
|
8911
9089
|
// accepts any string for forward compatibility
|
|
8912
9090
|
])
|
|
8913
9091
|
),
|
|
8914
|
-
globs:
|
|
8915
|
-
description:
|
|
9092
|
+
globs: z38.optional(z38.string()),
|
|
9093
|
+
description: z38.optional(z38.string())
|
|
8916
9094
|
});
|
|
8917
9095
|
function parseGlobsString(globs) {
|
|
8918
9096
|
if (!globs) {
|
|
@@ -9057,7 +9235,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
9057
9235
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9058
9236
|
if (!result.success) {
|
|
9059
9237
|
throw new Error(
|
|
9060
|
-
`Invalid frontmatter in ${
|
|
9238
|
+
`Invalid frontmatter in ${join75(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9061
9239
|
);
|
|
9062
9240
|
}
|
|
9063
9241
|
}
|
|
@@ -9072,7 +9250,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
9072
9250
|
static getSettablePaths() {
|
|
9073
9251
|
return {
|
|
9074
9252
|
nonRoot: {
|
|
9075
|
-
relativeDirPath:
|
|
9253
|
+
relativeDirPath: join75(".agent", "rules")
|
|
9076
9254
|
}
|
|
9077
9255
|
};
|
|
9078
9256
|
}
|
|
@@ -9081,7 +9259,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
9081
9259
|
relativeFilePath,
|
|
9082
9260
|
validate = true
|
|
9083
9261
|
}) {
|
|
9084
|
-
const filePath =
|
|
9262
|
+
const filePath = join75(
|
|
9085
9263
|
baseDir,
|
|
9086
9264
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
9087
9265
|
relativeFilePath
|
|
@@ -9222,7 +9400,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
9222
9400
|
};
|
|
9223
9401
|
|
|
9224
9402
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
9225
|
-
import { join as
|
|
9403
|
+
import { join as join76 } from "path";
|
|
9226
9404
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
9227
9405
|
toRulesyncRule() {
|
|
9228
9406
|
const rulesyncFrontmatter = {
|
|
@@ -9248,7 +9426,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9248
9426
|
relativeFilePath: ".augment-guidelines"
|
|
9249
9427
|
},
|
|
9250
9428
|
nonRoot: {
|
|
9251
|
-
relativeDirPath:
|
|
9429
|
+
relativeDirPath: join76(".augment", "rules")
|
|
9252
9430
|
}
|
|
9253
9431
|
};
|
|
9254
9432
|
}
|
|
@@ -9283,8 +9461,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9283
9461
|
}) {
|
|
9284
9462
|
const settablePaths = this.getSettablePaths();
|
|
9285
9463
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
9286
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
9287
|
-
const fileContent = await readFileContent(
|
|
9464
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join76(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9465
|
+
const fileContent = await readFileContent(join76(baseDir, relativePath));
|
|
9288
9466
|
return new _AugmentcodeLegacyRule({
|
|
9289
9467
|
baseDir,
|
|
9290
9468
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -9313,7 +9491,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9313
9491
|
};
|
|
9314
9492
|
|
|
9315
9493
|
// src/features/rules/augmentcode-rule.ts
|
|
9316
|
-
import { join as
|
|
9494
|
+
import { join as join77 } from "path";
|
|
9317
9495
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
9318
9496
|
toRulesyncRule() {
|
|
9319
9497
|
return this.toRulesyncRuleDefault();
|
|
@@ -9321,7 +9499,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9321
9499
|
static getSettablePaths() {
|
|
9322
9500
|
return {
|
|
9323
9501
|
nonRoot: {
|
|
9324
|
-
relativeDirPath:
|
|
9502
|
+
relativeDirPath: join77(".augment", "rules")
|
|
9325
9503
|
}
|
|
9326
9504
|
};
|
|
9327
9505
|
}
|
|
@@ -9345,7 +9523,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9345
9523
|
validate = true
|
|
9346
9524
|
}) {
|
|
9347
9525
|
const fileContent = await readFileContent(
|
|
9348
|
-
|
|
9526
|
+
join77(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9349
9527
|
);
|
|
9350
9528
|
const { body: content } = parseFrontmatter(fileContent);
|
|
9351
9529
|
return new _AugmentcodeRule({
|
|
@@ -9381,7 +9559,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9381
9559
|
};
|
|
9382
9560
|
|
|
9383
9561
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
9384
|
-
import { join as
|
|
9562
|
+
import { join as join78 } from "path";
|
|
9385
9563
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
9386
9564
|
static getSettablePaths({
|
|
9387
9565
|
global
|
|
@@ -9400,7 +9578,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9400
9578
|
relativeFilePath: "CLAUDE.md"
|
|
9401
9579
|
},
|
|
9402
9580
|
nonRoot: {
|
|
9403
|
-
relativeDirPath:
|
|
9581
|
+
relativeDirPath: join78(".claude", "memories")
|
|
9404
9582
|
}
|
|
9405
9583
|
};
|
|
9406
9584
|
}
|
|
@@ -9415,7 +9593,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9415
9593
|
if (isRoot) {
|
|
9416
9594
|
const relativePath2 = paths.root.relativeFilePath;
|
|
9417
9595
|
const fileContent2 = await readFileContent(
|
|
9418
|
-
|
|
9596
|
+
join78(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
9419
9597
|
);
|
|
9420
9598
|
return new _ClaudecodeLegacyRule({
|
|
9421
9599
|
baseDir,
|
|
@@ -9429,8 +9607,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9429
9607
|
if (!paths.nonRoot) {
|
|
9430
9608
|
throw new Error("nonRoot path is not set");
|
|
9431
9609
|
}
|
|
9432
|
-
const relativePath =
|
|
9433
|
-
const fileContent = await readFileContent(
|
|
9610
|
+
const relativePath = join78(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9611
|
+
const fileContent = await readFileContent(join78(baseDir, relativePath));
|
|
9434
9612
|
return new _ClaudecodeLegacyRule({
|
|
9435
9613
|
baseDir,
|
|
9436
9614
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -9489,10 +9667,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9489
9667
|
};
|
|
9490
9668
|
|
|
9491
9669
|
// src/features/rules/claudecode-rule.ts
|
|
9492
|
-
import { join as
|
|
9493
|
-
import { z as
|
|
9494
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
9495
|
-
paths:
|
|
9670
|
+
import { join as join79 } from "path";
|
|
9671
|
+
import { z as z39 } from "zod/mini";
|
|
9672
|
+
var ClaudecodeRuleFrontmatterSchema = z39.object({
|
|
9673
|
+
paths: z39.optional(z39.string())
|
|
9496
9674
|
});
|
|
9497
9675
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
9498
9676
|
frontmatter;
|
|
@@ -9514,7 +9692,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9514
9692
|
relativeFilePath: "CLAUDE.md"
|
|
9515
9693
|
},
|
|
9516
9694
|
nonRoot: {
|
|
9517
|
-
relativeDirPath:
|
|
9695
|
+
relativeDirPath: join79(".claude", "rules")
|
|
9518
9696
|
}
|
|
9519
9697
|
};
|
|
9520
9698
|
}
|
|
@@ -9523,7 +9701,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9523
9701
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9524
9702
|
if (!result.success) {
|
|
9525
9703
|
throw new Error(
|
|
9526
|
-
`Invalid frontmatter in ${
|
|
9704
|
+
`Invalid frontmatter in ${join79(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9527
9705
|
);
|
|
9528
9706
|
}
|
|
9529
9707
|
}
|
|
@@ -9551,7 +9729,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9551
9729
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
9552
9730
|
if (isRoot) {
|
|
9553
9731
|
const fileContent2 = await readFileContent(
|
|
9554
|
-
|
|
9732
|
+
join79(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
9555
9733
|
);
|
|
9556
9734
|
return new _ClaudecodeRule({
|
|
9557
9735
|
baseDir,
|
|
@@ -9566,13 +9744,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9566
9744
|
if (!paths.nonRoot) {
|
|
9567
9745
|
throw new Error("nonRoot path is not set");
|
|
9568
9746
|
}
|
|
9569
|
-
const relativePath =
|
|
9570
|
-
const fileContent = await readFileContent(
|
|
9747
|
+
const relativePath = join79(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9748
|
+
const fileContent = await readFileContent(join79(baseDir, relativePath));
|
|
9571
9749
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9572
9750
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9573
9751
|
if (!result.success) {
|
|
9574
9752
|
throw new Error(
|
|
9575
|
-
`Invalid frontmatter in ${
|
|
9753
|
+
`Invalid frontmatter in ${join79(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
9576
9754
|
);
|
|
9577
9755
|
}
|
|
9578
9756
|
return new _ClaudecodeRule({
|
|
@@ -9679,7 +9857,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9679
9857
|
return {
|
|
9680
9858
|
success: false,
|
|
9681
9859
|
error: new Error(
|
|
9682
|
-
`Invalid frontmatter in ${
|
|
9860
|
+
`Invalid frontmatter in ${join79(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9683
9861
|
)
|
|
9684
9862
|
};
|
|
9685
9863
|
}
|
|
@@ -9699,10 +9877,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9699
9877
|
};
|
|
9700
9878
|
|
|
9701
9879
|
// src/features/rules/cline-rule.ts
|
|
9702
|
-
import { join as
|
|
9703
|
-
import { z as
|
|
9704
|
-
var ClineRuleFrontmatterSchema =
|
|
9705
|
-
description:
|
|
9880
|
+
import { join as join80 } from "path";
|
|
9881
|
+
import { z as z40 } from "zod/mini";
|
|
9882
|
+
var ClineRuleFrontmatterSchema = z40.object({
|
|
9883
|
+
description: z40.string()
|
|
9706
9884
|
});
|
|
9707
9885
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
9708
9886
|
static getSettablePaths() {
|
|
@@ -9744,7 +9922,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
9744
9922
|
validate = true
|
|
9745
9923
|
}) {
|
|
9746
9924
|
const fileContent = await readFileContent(
|
|
9747
|
-
|
|
9925
|
+
join80(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9748
9926
|
);
|
|
9749
9927
|
return new _ClineRule({
|
|
9750
9928
|
baseDir,
|
|
@@ -9770,7 +9948,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
9770
9948
|
};
|
|
9771
9949
|
|
|
9772
9950
|
// src/features/rules/codexcli-rule.ts
|
|
9773
|
-
import { join as
|
|
9951
|
+
import { join as join81 } from "path";
|
|
9774
9952
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
9775
9953
|
static getSettablePaths({
|
|
9776
9954
|
global
|
|
@@ -9789,7 +9967,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9789
9967
|
relativeFilePath: "AGENTS.md"
|
|
9790
9968
|
},
|
|
9791
9969
|
nonRoot: {
|
|
9792
|
-
relativeDirPath:
|
|
9970
|
+
relativeDirPath: join81(".codex", "memories")
|
|
9793
9971
|
}
|
|
9794
9972
|
};
|
|
9795
9973
|
}
|
|
@@ -9804,7 +9982,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9804
9982
|
if (isRoot) {
|
|
9805
9983
|
const relativePath2 = paths.root.relativeFilePath;
|
|
9806
9984
|
const fileContent2 = await readFileContent(
|
|
9807
|
-
|
|
9985
|
+
join81(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
9808
9986
|
);
|
|
9809
9987
|
return new _CodexcliRule({
|
|
9810
9988
|
baseDir,
|
|
@@ -9818,8 +9996,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9818
9996
|
if (!paths.nonRoot) {
|
|
9819
9997
|
throw new Error("nonRoot path is not set");
|
|
9820
9998
|
}
|
|
9821
|
-
const relativePath =
|
|
9822
|
-
const fileContent = await readFileContent(
|
|
9999
|
+
const relativePath = join81(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
10000
|
+
const fileContent = await readFileContent(join81(baseDir, relativePath));
|
|
9823
10001
|
return new _CodexcliRule({
|
|
9824
10002
|
baseDir,
|
|
9825
10003
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -9878,12 +10056,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9878
10056
|
};
|
|
9879
10057
|
|
|
9880
10058
|
// src/features/rules/copilot-rule.ts
|
|
9881
|
-
import { join as
|
|
9882
|
-
import { z as
|
|
9883
|
-
var CopilotRuleFrontmatterSchema =
|
|
9884
|
-
description:
|
|
9885
|
-
applyTo:
|
|
9886
|
-
excludeAgent:
|
|
10059
|
+
import { join as join82 } from "path";
|
|
10060
|
+
import { z as z41 } from "zod/mini";
|
|
10061
|
+
var CopilotRuleFrontmatterSchema = z41.object({
|
|
10062
|
+
description: z41.optional(z41.string()),
|
|
10063
|
+
applyTo: z41.optional(z41.string()),
|
|
10064
|
+
excludeAgent: z41.optional(z41.union([z41.literal("code-review"), z41.literal("coding-agent")]))
|
|
9887
10065
|
});
|
|
9888
10066
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
9889
10067
|
frontmatter;
|
|
@@ -9895,7 +10073,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9895
10073
|
relativeFilePath: "copilot-instructions.md"
|
|
9896
10074
|
},
|
|
9897
10075
|
nonRoot: {
|
|
9898
|
-
relativeDirPath:
|
|
10076
|
+
relativeDirPath: join82(".github", "instructions")
|
|
9899
10077
|
}
|
|
9900
10078
|
};
|
|
9901
10079
|
}
|
|
@@ -9904,7 +10082,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9904
10082
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9905
10083
|
if (!result.success) {
|
|
9906
10084
|
throw new Error(
|
|
9907
|
-
`Invalid frontmatter in ${
|
|
10085
|
+
`Invalid frontmatter in ${join82(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9908
10086
|
);
|
|
9909
10087
|
}
|
|
9910
10088
|
}
|
|
@@ -9986,11 +10164,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9986
10164
|
validate = true
|
|
9987
10165
|
}) {
|
|
9988
10166
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
9989
|
-
const relativePath = isRoot ?
|
|
10167
|
+
const relativePath = isRoot ? join82(
|
|
9990
10168
|
this.getSettablePaths().root.relativeDirPath,
|
|
9991
10169
|
this.getSettablePaths().root.relativeFilePath
|
|
9992
|
-
) :
|
|
9993
|
-
const fileContent = await readFileContent(
|
|
10170
|
+
) : join82(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
10171
|
+
const fileContent = await readFileContent(join82(baseDir, relativePath));
|
|
9994
10172
|
if (isRoot) {
|
|
9995
10173
|
return new _CopilotRule({
|
|
9996
10174
|
baseDir,
|
|
@@ -10006,7 +10184,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
10006
10184
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10007
10185
|
if (!result.success) {
|
|
10008
10186
|
throw new Error(
|
|
10009
|
-
`Invalid frontmatter in ${
|
|
10187
|
+
`Invalid frontmatter in ${join82(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
10010
10188
|
);
|
|
10011
10189
|
}
|
|
10012
10190
|
return new _CopilotRule({
|
|
@@ -10046,7 +10224,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
10046
10224
|
return {
|
|
10047
10225
|
success: false,
|
|
10048
10226
|
error: new Error(
|
|
10049
|
-
`Invalid frontmatter in ${
|
|
10227
|
+
`Invalid frontmatter in ${join82(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10050
10228
|
)
|
|
10051
10229
|
};
|
|
10052
10230
|
}
|
|
@@ -10066,12 +10244,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
10066
10244
|
};
|
|
10067
10245
|
|
|
10068
10246
|
// src/features/rules/cursor-rule.ts
|
|
10069
|
-
import { basename as basename23, join as
|
|
10070
|
-
import { z as
|
|
10071
|
-
var CursorRuleFrontmatterSchema =
|
|
10072
|
-
description:
|
|
10073
|
-
globs:
|
|
10074
|
-
alwaysApply:
|
|
10247
|
+
import { basename as basename23, join as join83 } from "path";
|
|
10248
|
+
import { z as z42 } from "zod/mini";
|
|
10249
|
+
var CursorRuleFrontmatterSchema = z42.object({
|
|
10250
|
+
description: z42.optional(z42.string()),
|
|
10251
|
+
globs: z42.optional(z42.string()),
|
|
10252
|
+
alwaysApply: z42.optional(z42.boolean())
|
|
10075
10253
|
});
|
|
10076
10254
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
10077
10255
|
frontmatter;
|
|
@@ -10079,7 +10257,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10079
10257
|
static getSettablePaths() {
|
|
10080
10258
|
return {
|
|
10081
10259
|
nonRoot: {
|
|
10082
|
-
relativeDirPath:
|
|
10260
|
+
relativeDirPath: join83(".cursor", "rules")
|
|
10083
10261
|
}
|
|
10084
10262
|
};
|
|
10085
10263
|
}
|
|
@@ -10088,7 +10266,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10088
10266
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10089
10267
|
if (!result.success) {
|
|
10090
10268
|
throw new Error(
|
|
10091
|
-
`Invalid frontmatter in ${
|
|
10269
|
+
`Invalid frontmatter in ${join83(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10092
10270
|
);
|
|
10093
10271
|
}
|
|
10094
10272
|
}
|
|
@@ -10205,13 +10383,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10205
10383
|
validate = true
|
|
10206
10384
|
}) {
|
|
10207
10385
|
const fileContent = await readFileContent(
|
|
10208
|
-
|
|
10386
|
+
join83(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10209
10387
|
);
|
|
10210
10388
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
10211
10389
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10212
10390
|
if (!result.success) {
|
|
10213
10391
|
throw new Error(
|
|
10214
|
-
`Invalid frontmatter in ${
|
|
10392
|
+
`Invalid frontmatter in ${join83(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
10215
10393
|
);
|
|
10216
10394
|
}
|
|
10217
10395
|
return new _CursorRule({
|
|
@@ -10248,7 +10426,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10248
10426
|
return {
|
|
10249
10427
|
success: false,
|
|
10250
10428
|
error: new Error(
|
|
10251
|
-
`Invalid frontmatter in ${
|
|
10429
|
+
`Invalid frontmatter in ${join83(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10252
10430
|
)
|
|
10253
10431
|
};
|
|
10254
10432
|
}
|
|
@@ -10268,7 +10446,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10268
10446
|
};
|
|
10269
10447
|
|
|
10270
10448
|
// src/features/rules/geminicli-rule.ts
|
|
10271
|
-
import { join as
|
|
10449
|
+
import { join as join84 } from "path";
|
|
10272
10450
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
10273
10451
|
static getSettablePaths({
|
|
10274
10452
|
global
|
|
@@ -10287,7 +10465,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10287
10465
|
relativeFilePath: "GEMINI.md"
|
|
10288
10466
|
},
|
|
10289
10467
|
nonRoot: {
|
|
10290
|
-
relativeDirPath:
|
|
10468
|
+
relativeDirPath: join84(".gemini", "memories")
|
|
10291
10469
|
}
|
|
10292
10470
|
};
|
|
10293
10471
|
}
|
|
@@ -10302,7 +10480,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10302
10480
|
if (isRoot) {
|
|
10303
10481
|
const relativePath2 = paths.root.relativeFilePath;
|
|
10304
10482
|
const fileContent2 = await readFileContent(
|
|
10305
|
-
|
|
10483
|
+
join84(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
10306
10484
|
);
|
|
10307
10485
|
return new _GeminiCliRule({
|
|
10308
10486
|
baseDir,
|
|
@@ -10316,8 +10494,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10316
10494
|
if (!paths.nonRoot) {
|
|
10317
10495
|
throw new Error("nonRoot path is not set");
|
|
10318
10496
|
}
|
|
10319
|
-
const relativePath =
|
|
10320
|
-
const fileContent = await readFileContent(
|
|
10497
|
+
const relativePath = join84(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
10498
|
+
const fileContent = await readFileContent(join84(baseDir, relativePath));
|
|
10321
10499
|
return new _GeminiCliRule({
|
|
10322
10500
|
baseDir,
|
|
10323
10501
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -10376,7 +10554,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10376
10554
|
};
|
|
10377
10555
|
|
|
10378
10556
|
// src/features/rules/junie-rule.ts
|
|
10379
|
-
import { join as
|
|
10557
|
+
import { join as join85 } from "path";
|
|
10380
10558
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
10381
10559
|
static getSettablePaths() {
|
|
10382
10560
|
return {
|
|
@@ -10385,7 +10563,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10385
10563
|
relativeFilePath: "guidelines.md"
|
|
10386
10564
|
},
|
|
10387
10565
|
nonRoot: {
|
|
10388
|
-
relativeDirPath:
|
|
10566
|
+
relativeDirPath: join85(".junie", "memories")
|
|
10389
10567
|
}
|
|
10390
10568
|
};
|
|
10391
10569
|
}
|
|
@@ -10395,8 +10573,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10395
10573
|
validate = true
|
|
10396
10574
|
}) {
|
|
10397
10575
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
10398
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
10399
|
-
const fileContent = await readFileContent(
|
|
10576
|
+
const relativePath = isRoot ? "guidelines.md" : join85(".junie", "memories", relativeFilePath);
|
|
10577
|
+
const fileContent = await readFileContent(join85(baseDir, relativePath));
|
|
10400
10578
|
return new _JunieRule({
|
|
10401
10579
|
baseDir,
|
|
10402
10580
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10451,12 +10629,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10451
10629
|
};
|
|
10452
10630
|
|
|
10453
10631
|
// src/features/rules/kilo-rule.ts
|
|
10454
|
-
import { join as
|
|
10632
|
+
import { join as join86 } from "path";
|
|
10455
10633
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
10456
10634
|
static getSettablePaths(_options = {}) {
|
|
10457
10635
|
return {
|
|
10458
10636
|
nonRoot: {
|
|
10459
|
-
relativeDirPath:
|
|
10637
|
+
relativeDirPath: join86(".kilocode", "rules")
|
|
10460
10638
|
}
|
|
10461
10639
|
};
|
|
10462
10640
|
}
|
|
@@ -10466,7 +10644,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
10466
10644
|
validate = true
|
|
10467
10645
|
}) {
|
|
10468
10646
|
const fileContent = await readFileContent(
|
|
10469
|
-
|
|
10647
|
+
join86(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10470
10648
|
);
|
|
10471
10649
|
return new _KiloRule({
|
|
10472
10650
|
baseDir,
|
|
@@ -10518,12 +10696,12 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
10518
10696
|
};
|
|
10519
10697
|
|
|
10520
10698
|
// src/features/rules/kiro-rule.ts
|
|
10521
|
-
import { join as
|
|
10699
|
+
import { join as join87 } from "path";
|
|
10522
10700
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
10523
10701
|
static getSettablePaths() {
|
|
10524
10702
|
return {
|
|
10525
10703
|
nonRoot: {
|
|
10526
|
-
relativeDirPath:
|
|
10704
|
+
relativeDirPath: join87(".kiro", "steering")
|
|
10527
10705
|
}
|
|
10528
10706
|
};
|
|
10529
10707
|
}
|
|
@@ -10533,7 +10711,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
10533
10711
|
validate = true
|
|
10534
10712
|
}) {
|
|
10535
10713
|
const fileContent = await readFileContent(
|
|
10536
|
-
|
|
10714
|
+
join87(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10537
10715
|
);
|
|
10538
10716
|
return new _KiroRule({
|
|
10539
10717
|
baseDir,
|
|
@@ -10587,7 +10765,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
10587
10765
|
};
|
|
10588
10766
|
|
|
10589
10767
|
// src/features/rules/opencode-rule.ts
|
|
10590
|
-
import { join as
|
|
10768
|
+
import { join as join88 } from "path";
|
|
10591
10769
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
10592
10770
|
static getSettablePaths() {
|
|
10593
10771
|
return {
|
|
@@ -10596,7 +10774,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10596
10774
|
relativeFilePath: "AGENTS.md"
|
|
10597
10775
|
},
|
|
10598
10776
|
nonRoot: {
|
|
10599
|
-
relativeDirPath:
|
|
10777
|
+
relativeDirPath: join88(".opencode", "memories")
|
|
10600
10778
|
}
|
|
10601
10779
|
};
|
|
10602
10780
|
}
|
|
@@ -10606,8 +10784,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10606
10784
|
validate = true
|
|
10607
10785
|
}) {
|
|
10608
10786
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
10609
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
10610
|
-
const fileContent = await readFileContent(
|
|
10787
|
+
const relativePath = isRoot ? "AGENTS.md" : join88(".opencode", "memories", relativeFilePath);
|
|
10788
|
+
const fileContent = await readFileContent(join88(baseDir, relativePath));
|
|
10611
10789
|
return new _OpenCodeRule({
|
|
10612
10790
|
baseDir,
|
|
10613
10791
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10662,7 +10840,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10662
10840
|
};
|
|
10663
10841
|
|
|
10664
10842
|
// src/features/rules/qwencode-rule.ts
|
|
10665
|
-
import { join as
|
|
10843
|
+
import { join as join89 } from "path";
|
|
10666
10844
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
10667
10845
|
static getSettablePaths() {
|
|
10668
10846
|
return {
|
|
@@ -10671,7 +10849,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10671
10849
|
relativeFilePath: "QWEN.md"
|
|
10672
10850
|
},
|
|
10673
10851
|
nonRoot: {
|
|
10674
|
-
relativeDirPath:
|
|
10852
|
+
relativeDirPath: join89(".qwen", "memories")
|
|
10675
10853
|
}
|
|
10676
10854
|
};
|
|
10677
10855
|
}
|
|
@@ -10681,8 +10859,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10681
10859
|
validate = true
|
|
10682
10860
|
}) {
|
|
10683
10861
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
10684
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
10685
|
-
const fileContent = await readFileContent(
|
|
10862
|
+
const relativePath = isRoot ? "QWEN.md" : join89(".qwen", "memories", relativeFilePath);
|
|
10863
|
+
const fileContent = await readFileContent(join89(baseDir, relativePath));
|
|
10686
10864
|
return new _QwencodeRule({
|
|
10687
10865
|
baseDir,
|
|
10688
10866
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10734,7 +10912,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10734
10912
|
};
|
|
10735
10913
|
|
|
10736
10914
|
// src/features/rules/replit-rule.ts
|
|
10737
|
-
import { join as
|
|
10915
|
+
import { join as join90 } from "path";
|
|
10738
10916
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
10739
10917
|
static getSettablePaths() {
|
|
10740
10918
|
return {
|
|
@@ -10756,7 +10934,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
10756
10934
|
}
|
|
10757
10935
|
const relativePath = paths.root.relativeFilePath;
|
|
10758
10936
|
const fileContent = await readFileContent(
|
|
10759
|
-
|
|
10937
|
+
join90(baseDir, paths.root.relativeDirPath, relativePath)
|
|
10760
10938
|
);
|
|
10761
10939
|
return new _ReplitRule({
|
|
10762
10940
|
baseDir,
|
|
@@ -10822,12 +11000,12 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
10822
11000
|
};
|
|
10823
11001
|
|
|
10824
11002
|
// src/features/rules/roo-rule.ts
|
|
10825
|
-
import { join as
|
|
11003
|
+
import { join as join91 } from "path";
|
|
10826
11004
|
var RooRule = class _RooRule extends ToolRule {
|
|
10827
11005
|
static getSettablePaths() {
|
|
10828
11006
|
return {
|
|
10829
11007
|
nonRoot: {
|
|
10830
|
-
relativeDirPath:
|
|
11008
|
+
relativeDirPath: join91(".roo", "rules")
|
|
10831
11009
|
}
|
|
10832
11010
|
};
|
|
10833
11011
|
}
|
|
@@ -10837,7 +11015,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
10837
11015
|
validate = true
|
|
10838
11016
|
}) {
|
|
10839
11017
|
const fileContent = await readFileContent(
|
|
10840
|
-
|
|
11018
|
+
join91(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10841
11019
|
);
|
|
10842
11020
|
return new _RooRule({
|
|
10843
11021
|
baseDir,
|
|
@@ -10906,7 +11084,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
10906
11084
|
};
|
|
10907
11085
|
|
|
10908
11086
|
// src/features/rules/warp-rule.ts
|
|
10909
|
-
import { join as
|
|
11087
|
+
import { join as join92 } from "path";
|
|
10910
11088
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
10911
11089
|
constructor({ fileContent, root, ...rest }) {
|
|
10912
11090
|
super({
|
|
@@ -10922,7 +11100,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10922
11100
|
relativeFilePath: "WARP.md"
|
|
10923
11101
|
},
|
|
10924
11102
|
nonRoot: {
|
|
10925
|
-
relativeDirPath:
|
|
11103
|
+
relativeDirPath: join92(".warp", "memories")
|
|
10926
11104
|
}
|
|
10927
11105
|
};
|
|
10928
11106
|
}
|
|
@@ -10932,8 +11110,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10932
11110
|
validate = true
|
|
10933
11111
|
}) {
|
|
10934
11112
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
10935
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
10936
|
-
const fileContent = await readFileContent(
|
|
11113
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join92(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
11114
|
+
const fileContent = await readFileContent(join92(baseDir, relativePath));
|
|
10937
11115
|
return new _WarpRule({
|
|
10938
11116
|
baseDir,
|
|
10939
11117
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -10988,12 +11166,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10988
11166
|
};
|
|
10989
11167
|
|
|
10990
11168
|
// src/features/rules/windsurf-rule.ts
|
|
10991
|
-
import { join as
|
|
11169
|
+
import { join as join93 } from "path";
|
|
10992
11170
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
10993
11171
|
static getSettablePaths() {
|
|
10994
11172
|
return {
|
|
10995
11173
|
nonRoot: {
|
|
10996
|
-
relativeDirPath:
|
|
11174
|
+
relativeDirPath: join93(".windsurf", "rules")
|
|
10997
11175
|
}
|
|
10998
11176
|
};
|
|
10999
11177
|
}
|
|
@@ -11003,7 +11181,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
11003
11181
|
validate = true
|
|
11004
11182
|
}) {
|
|
11005
11183
|
const fileContent = await readFileContent(
|
|
11006
|
-
|
|
11184
|
+
join93(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
11007
11185
|
);
|
|
11008
11186
|
return new _WindsurfRule({
|
|
11009
11187
|
baseDir,
|
|
@@ -11077,7 +11255,7 @@ var rulesProcessorToolTargets = [
|
|
|
11077
11255
|
"warp",
|
|
11078
11256
|
"windsurf"
|
|
11079
11257
|
];
|
|
11080
|
-
var RulesProcessorToolTargetSchema =
|
|
11258
|
+
var RulesProcessorToolTargetSchema = z43.enum(rulesProcessorToolTargets);
|
|
11081
11259
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
11082
11260
|
[
|
|
11083
11261
|
"agentsmd",
|
|
@@ -11368,7 +11546,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11368
11546
|
}).relativeDirPath;
|
|
11369
11547
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
11370
11548
|
const frontmatter = skill.getFrontmatter();
|
|
11371
|
-
const relativePath =
|
|
11549
|
+
const relativePath = join94(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
11372
11550
|
return {
|
|
11373
11551
|
name: frontmatter.name,
|
|
11374
11552
|
description: frontmatter.description,
|
|
@@ -11435,7 +11613,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11435
11613
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
11436
11614
|
*/
|
|
11437
11615
|
async loadRulesyncFiles() {
|
|
11438
|
-
const files = await findFilesByGlobs(
|
|
11616
|
+
const files = await findFilesByGlobs(join94(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
11439
11617
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
11440
11618
|
const rulesyncRules = await Promise.all(
|
|
11441
11619
|
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: basename24(file) }))
|
|
@@ -11456,7 +11634,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11456
11634
|
return rulesyncRules;
|
|
11457
11635
|
}
|
|
11458
11636
|
async loadRulesyncFilesLegacy() {
|
|
11459
|
-
const legacyFiles = await findFilesByGlobs(
|
|
11637
|
+
const legacyFiles = await findFilesByGlobs(join94(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
11460
11638
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
11461
11639
|
return Promise.all(
|
|
11462
11640
|
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: basename24(file) }))
|
|
@@ -11477,7 +11655,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11477
11655
|
return [];
|
|
11478
11656
|
}
|
|
11479
11657
|
const rootFilePaths = await findFilesByGlobs(
|
|
11480
|
-
|
|
11658
|
+
join94(
|
|
11481
11659
|
this.baseDir,
|
|
11482
11660
|
settablePaths.root.relativeDirPath ?? ".",
|
|
11483
11661
|
settablePaths.root.relativeFilePath
|
|
@@ -11509,7 +11687,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11509
11687
|
return [];
|
|
11510
11688
|
}
|
|
11511
11689
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
11512
|
-
|
|
11690
|
+
join94(this.baseDir, settablePaths.nonRoot.relativeDirPath, `*.${factory.meta.extension}`)
|
|
11513
11691
|
);
|
|
11514
11692
|
if (forDeletion) {
|
|
11515
11693
|
return nonRootFilePaths.map(
|
|
@@ -11618,14 +11796,14 @@ s/<command> [arguments]
|
|
|
11618
11796
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
11619
11797
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
11620
11798
|
|
|
11621
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
11799
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join94(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
11622
11800
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
11623
11801
|
|
|
11624
11802
|
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.
|
|
11625
11803
|
|
|
11626
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
11804
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join94(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
11627
11805
|
|
|
11628
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
11806
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join94(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
11629
11807
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
11630
11808
|
const result = [
|
|
11631
11809
|
overview,
|
|
@@ -11907,7 +12085,7 @@ async function generateSkills(config) {
|
|
|
11907
12085
|
}
|
|
11908
12086
|
|
|
11909
12087
|
// src/cli/commands/gitignore.ts
|
|
11910
|
-
import { join as
|
|
12088
|
+
import { join as join95 } from "path";
|
|
11911
12089
|
var RULESYNC_HEADER = "# Generated by Rulesync";
|
|
11912
12090
|
var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
|
|
11913
12091
|
var RULESYNC_IGNORE_ENTRIES = [
|
|
@@ -11971,6 +12149,7 @@ var RULESYNC_IGNORE_ENTRIES = [
|
|
|
11971
12149
|
// Kiro
|
|
11972
12150
|
"**/.kiro/steering/",
|
|
11973
12151
|
"**/.kiro/prompts/",
|
|
12152
|
+
"**/.kiro/agents/",
|
|
11974
12153
|
"**/.kiro/settings/mcp.json",
|
|
11975
12154
|
"**/.aiignore",
|
|
11976
12155
|
// OpenCode
|
|
@@ -12046,7 +12225,7 @@ var removeExistingRulesyncEntries = (content) => {
|
|
|
12046
12225
|
return result;
|
|
12047
12226
|
};
|
|
12048
12227
|
var gitignoreCommand = async () => {
|
|
12049
|
-
const gitignorePath =
|
|
12228
|
+
const gitignorePath = join95(process.cwd(), ".gitignore");
|
|
12050
12229
|
let gitignoreContent = "";
|
|
12051
12230
|
if (await fileExists(gitignorePath)) {
|
|
12052
12231
|
gitignoreContent = await readFileContent(gitignorePath);
|
|
@@ -12245,7 +12424,7 @@ async function importSkills(config, tool) {
|
|
|
12245
12424
|
}
|
|
12246
12425
|
|
|
12247
12426
|
// src/cli/commands/init.ts
|
|
12248
|
-
import { join as
|
|
12427
|
+
import { join as join96 } from "path";
|
|
12249
12428
|
async function initCommand() {
|
|
12250
12429
|
logger.info("Initializing rulesync...");
|
|
12251
12430
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -12423,14 +12602,14 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
12423
12602
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
12424
12603
|
await ensureDir(skillPaths.relativeDirPath);
|
|
12425
12604
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
12426
|
-
const ruleFilepath =
|
|
12605
|
+
const ruleFilepath = join96(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
12427
12606
|
if (!await fileExists(ruleFilepath)) {
|
|
12428
12607
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
12429
12608
|
logger.success(`Created ${ruleFilepath}`);
|
|
12430
12609
|
} else {
|
|
12431
12610
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
12432
12611
|
}
|
|
12433
|
-
const mcpFilepath =
|
|
12612
|
+
const mcpFilepath = join96(
|
|
12434
12613
|
mcpPaths.recommended.relativeDirPath,
|
|
12435
12614
|
mcpPaths.recommended.relativeFilePath
|
|
12436
12615
|
);
|
|
@@ -12440,30 +12619,30 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
12440
12619
|
} else {
|
|
12441
12620
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
12442
12621
|
}
|
|
12443
|
-
const commandFilepath =
|
|
12622
|
+
const commandFilepath = join96(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
12444
12623
|
if (!await fileExists(commandFilepath)) {
|
|
12445
12624
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
12446
12625
|
logger.success(`Created ${commandFilepath}`);
|
|
12447
12626
|
} else {
|
|
12448
12627
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
12449
12628
|
}
|
|
12450
|
-
const subagentFilepath =
|
|
12629
|
+
const subagentFilepath = join96(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
12451
12630
|
if (!await fileExists(subagentFilepath)) {
|
|
12452
12631
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
12453
12632
|
logger.success(`Created ${subagentFilepath}`);
|
|
12454
12633
|
} else {
|
|
12455
12634
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
12456
12635
|
}
|
|
12457
|
-
const skillDirPath =
|
|
12636
|
+
const skillDirPath = join96(skillPaths.relativeDirPath, sampleSkillFile.dirName);
|
|
12458
12637
|
await ensureDir(skillDirPath);
|
|
12459
|
-
const skillFilepath =
|
|
12638
|
+
const skillFilepath = join96(skillDirPath, SKILL_FILE_NAME);
|
|
12460
12639
|
if (!await fileExists(skillFilepath)) {
|
|
12461
12640
|
await writeFileContent(skillFilepath, sampleSkillFile.content);
|
|
12462
12641
|
logger.success(`Created ${skillFilepath}`);
|
|
12463
12642
|
} else {
|
|
12464
12643
|
logger.info(`Skipped ${skillFilepath} (already exists)`);
|
|
12465
12644
|
}
|
|
12466
|
-
const ignoreFilepath =
|
|
12645
|
+
const ignoreFilepath = join96(
|
|
12467
12646
|
ignorePaths.recommended.relativeDirPath,
|
|
12468
12647
|
ignorePaths.recommended.relativeFilePath
|
|
12469
12648
|
);
|
|
@@ -12479,15 +12658,15 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
12479
12658
|
import { FastMCP } from "fastmcp";
|
|
12480
12659
|
|
|
12481
12660
|
// src/mcp/tools.ts
|
|
12482
|
-
import { z as
|
|
12661
|
+
import { z as z50 } from "zod/mini";
|
|
12483
12662
|
|
|
12484
12663
|
// src/mcp/commands.ts
|
|
12485
|
-
import { basename as basename25, join as
|
|
12486
|
-
import { z as
|
|
12664
|
+
import { basename as basename25, join as join97 } from "path";
|
|
12665
|
+
import { z as z44 } from "zod/mini";
|
|
12487
12666
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
12488
12667
|
var maxCommandsCount = 1e3;
|
|
12489
12668
|
async function listCommands() {
|
|
12490
|
-
const commandsDir =
|
|
12669
|
+
const commandsDir = join97(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
12491
12670
|
try {
|
|
12492
12671
|
const files = await listDirectoryFiles(commandsDir);
|
|
12493
12672
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -12499,7 +12678,7 @@ async function listCommands() {
|
|
|
12499
12678
|
});
|
|
12500
12679
|
const frontmatter = command.getFrontmatter();
|
|
12501
12680
|
return {
|
|
12502
|
-
relativePathFromCwd:
|
|
12681
|
+
relativePathFromCwd: join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
12503
12682
|
frontmatter
|
|
12504
12683
|
};
|
|
12505
12684
|
} catch (error) {
|
|
@@ -12525,7 +12704,7 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
12525
12704
|
relativeFilePath: filename
|
|
12526
12705
|
});
|
|
12527
12706
|
return {
|
|
12528
|
-
relativePathFromCwd:
|
|
12707
|
+
relativePathFromCwd: join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
12529
12708
|
frontmatter: command.getFrontmatter(),
|
|
12530
12709
|
body: command.getBody()
|
|
12531
12710
|
};
|
|
@@ -12554,7 +12733,7 @@ async function putCommand({
|
|
|
12554
12733
|
try {
|
|
12555
12734
|
const existingCommands = await listCommands();
|
|
12556
12735
|
const isUpdate = existingCommands.some(
|
|
12557
|
-
(command2) => command2.relativePathFromCwd ===
|
|
12736
|
+
(command2) => command2.relativePathFromCwd === join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
12558
12737
|
);
|
|
12559
12738
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
12560
12739
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -12569,11 +12748,11 @@ async function putCommand({
|
|
|
12569
12748
|
fileContent,
|
|
12570
12749
|
validate: true
|
|
12571
12750
|
});
|
|
12572
|
-
const commandsDir =
|
|
12751
|
+
const commandsDir = join97(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
12573
12752
|
await ensureDir(commandsDir);
|
|
12574
12753
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
12575
12754
|
return {
|
|
12576
|
-
relativePathFromCwd:
|
|
12755
|
+
relativePathFromCwd: join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
12577
12756
|
frontmatter: command.getFrontmatter(),
|
|
12578
12757
|
body: command.getBody()
|
|
12579
12758
|
};
|
|
@@ -12589,11 +12768,11 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
12589
12768
|
intendedRootDir: process.cwd()
|
|
12590
12769
|
});
|
|
12591
12770
|
const filename = basename25(relativePathFromCwd);
|
|
12592
|
-
const fullPath =
|
|
12771
|
+
const fullPath = join97(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
12593
12772
|
try {
|
|
12594
12773
|
await removeFile(fullPath);
|
|
12595
12774
|
return {
|
|
12596
|
-
relativePathFromCwd:
|
|
12775
|
+
relativePathFromCwd: join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
12597
12776
|
};
|
|
12598
12777
|
} catch (error) {
|
|
12599
12778
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -12602,23 +12781,23 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
12602
12781
|
}
|
|
12603
12782
|
}
|
|
12604
12783
|
var commandToolSchemas = {
|
|
12605
|
-
listCommands:
|
|
12606
|
-
getCommand:
|
|
12607
|
-
relativePathFromCwd:
|
|
12784
|
+
listCommands: z44.object({}),
|
|
12785
|
+
getCommand: z44.object({
|
|
12786
|
+
relativePathFromCwd: z44.string()
|
|
12608
12787
|
}),
|
|
12609
|
-
putCommand:
|
|
12610
|
-
relativePathFromCwd:
|
|
12788
|
+
putCommand: z44.object({
|
|
12789
|
+
relativePathFromCwd: z44.string(),
|
|
12611
12790
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
12612
|
-
body:
|
|
12791
|
+
body: z44.string()
|
|
12613
12792
|
}),
|
|
12614
|
-
deleteCommand:
|
|
12615
|
-
relativePathFromCwd:
|
|
12793
|
+
deleteCommand: z44.object({
|
|
12794
|
+
relativePathFromCwd: z44.string()
|
|
12616
12795
|
})
|
|
12617
12796
|
};
|
|
12618
12797
|
var commandTools = {
|
|
12619
12798
|
listCommands: {
|
|
12620
12799
|
name: "listCommands",
|
|
12621
|
-
description: `List all commands from ${
|
|
12800
|
+
description: `List all commands from ${join97(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
12622
12801
|
parameters: commandToolSchemas.listCommands,
|
|
12623
12802
|
execute: async () => {
|
|
12624
12803
|
const commands = await listCommands();
|
|
@@ -12660,11 +12839,11 @@ var commandTools = {
|
|
|
12660
12839
|
};
|
|
12661
12840
|
|
|
12662
12841
|
// src/mcp/ignore.ts
|
|
12663
|
-
import { join as
|
|
12664
|
-
import { z as
|
|
12842
|
+
import { join as join98 } from "path";
|
|
12843
|
+
import { z as z45 } from "zod/mini";
|
|
12665
12844
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
12666
12845
|
async function getIgnoreFile() {
|
|
12667
|
-
const ignoreFilePath =
|
|
12846
|
+
const ignoreFilePath = join98(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12668
12847
|
try {
|
|
12669
12848
|
const content = await readFileContent(ignoreFilePath);
|
|
12670
12849
|
return {
|
|
@@ -12678,7 +12857,7 @@ async function getIgnoreFile() {
|
|
|
12678
12857
|
}
|
|
12679
12858
|
}
|
|
12680
12859
|
async function putIgnoreFile({ content }) {
|
|
12681
|
-
const ignoreFilePath =
|
|
12860
|
+
const ignoreFilePath = join98(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12682
12861
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
12683
12862
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
12684
12863
|
throw new Error(
|
|
@@ -12699,8 +12878,8 @@ async function putIgnoreFile({ content }) {
|
|
|
12699
12878
|
}
|
|
12700
12879
|
}
|
|
12701
12880
|
async function deleteIgnoreFile() {
|
|
12702
|
-
const aiignorePath =
|
|
12703
|
-
const legacyIgnorePath =
|
|
12881
|
+
const aiignorePath = join98(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12882
|
+
const legacyIgnorePath = join98(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
12704
12883
|
try {
|
|
12705
12884
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
12706
12885
|
return {
|
|
@@ -12718,11 +12897,11 @@ async function deleteIgnoreFile() {
|
|
|
12718
12897
|
}
|
|
12719
12898
|
}
|
|
12720
12899
|
var ignoreToolSchemas = {
|
|
12721
|
-
getIgnoreFile:
|
|
12722
|
-
putIgnoreFile:
|
|
12723
|
-
content:
|
|
12900
|
+
getIgnoreFile: z45.object({}),
|
|
12901
|
+
putIgnoreFile: z45.object({
|
|
12902
|
+
content: z45.string()
|
|
12724
12903
|
}),
|
|
12725
|
-
deleteIgnoreFile:
|
|
12904
|
+
deleteIgnoreFile: z45.object({})
|
|
12726
12905
|
};
|
|
12727
12906
|
var ignoreTools = {
|
|
12728
12907
|
getIgnoreFile: {
|
|
@@ -12755,8 +12934,8 @@ var ignoreTools = {
|
|
|
12755
12934
|
};
|
|
12756
12935
|
|
|
12757
12936
|
// src/mcp/mcp.ts
|
|
12758
|
-
import { join as
|
|
12759
|
-
import { z as
|
|
12937
|
+
import { join as join99 } from "path";
|
|
12938
|
+
import { z as z46 } from "zod/mini";
|
|
12760
12939
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
12761
12940
|
async function getMcpFile() {
|
|
12762
12941
|
const config = await ConfigResolver.resolve({});
|
|
@@ -12765,7 +12944,7 @@ async function getMcpFile() {
|
|
|
12765
12944
|
validate: true,
|
|
12766
12945
|
modularMcp: config.getModularMcp()
|
|
12767
12946
|
});
|
|
12768
|
-
const relativePathFromCwd =
|
|
12947
|
+
const relativePathFromCwd = join99(
|
|
12769
12948
|
rulesyncMcp.getRelativeDirPath(),
|
|
12770
12949
|
rulesyncMcp.getRelativeFilePath()
|
|
12771
12950
|
);
|
|
@@ -12798,7 +12977,7 @@ async function putMcpFile({ content }) {
|
|
|
12798
12977
|
const paths = RulesyncMcp.getSettablePaths();
|
|
12799
12978
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
12800
12979
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
12801
|
-
const fullPath =
|
|
12980
|
+
const fullPath = join99(baseDir, relativeDirPath, relativeFilePath);
|
|
12802
12981
|
const rulesyncMcp = new RulesyncMcp({
|
|
12803
12982
|
baseDir,
|
|
12804
12983
|
relativeDirPath,
|
|
@@ -12807,9 +12986,9 @@ async function putMcpFile({ content }) {
|
|
|
12807
12986
|
validate: true,
|
|
12808
12987
|
modularMcp: config.getModularMcp()
|
|
12809
12988
|
});
|
|
12810
|
-
await ensureDir(
|
|
12989
|
+
await ensureDir(join99(baseDir, relativeDirPath));
|
|
12811
12990
|
await writeFileContent(fullPath, content);
|
|
12812
|
-
const relativePathFromCwd =
|
|
12991
|
+
const relativePathFromCwd = join99(relativeDirPath, relativeFilePath);
|
|
12813
12992
|
return {
|
|
12814
12993
|
relativePathFromCwd,
|
|
12815
12994
|
content: rulesyncMcp.getFileContent()
|
|
@@ -12824,15 +13003,15 @@ async function deleteMcpFile() {
|
|
|
12824
13003
|
try {
|
|
12825
13004
|
const baseDir = process.cwd();
|
|
12826
13005
|
const paths = RulesyncMcp.getSettablePaths();
|
|
12827
|
-
const recommendedPath =
|
|
13006
|
+
const recommendedPath = join99(
|
|
12828
13007
|
baseDir,
|
|
12829
13008
|
paths.recommended.relativeDirPath,
|
|
12830
13009
|
paths.recommended.relativeFilePath
|
|
12831
13010
|
);
|
|
12832
|
-
const legacyPath =
|
|
13011
|
+
const legacyPath = join99(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
12833
13012
|
await removeFile(recommendedPath);
|
|
12834
13013
|
await removeFile(legacyPath);
|
|
12835
|
-
const relativePathFromCwd =
|
|
13014
|
+
const relativePathFromCwd = join99(
|
|
12836
13015
|
paths.recommended.relativeDirPath,
|
|
12837
13016
|
paths.recommended.relativeFilePath
|
|
12838
13017
|
);
|
|
@@ -12846,11 +13025,11 @@ async function deleteMcpFile() {
|
|
|
12846
13025
|
}
|
|
12847
13026
|
}
|
|
12848
13027
|
var mcpToolSchemas = {
|
|
12849
|
-
getMcpFile:
|
|
12850
|
-
putMcpFile:
|
|
12851
|
-
content:
|
|
13028
|
+
getMcpFile: z46.object({}),
|
|
13029
|
+
putMcpFile: z46.object({
|
|
13030
|
+
content: z46.string()
|
|
12852
13031
|
}),
|
|
12853
|
-
deleteMcpFile:
|
|
13032
|
+
deleteMcpFile: z46.object({})
|
|
12854
13033
|
};
|
|
12855
13034
|
var mcpTools = {
|
|
12856
13035
|
getMcpFile: {
|
|
@@ -12883,12 +13062,12 @@ var mcpTools = {
|
|
|
12883
13062
|
};
|
|
12884
13063
|
|
|
12885
13064
|
// src/mcp/rules.ts
|
|
12886
|
-
import { basename as basename26, join as
|
|
12887
|
-
import { z as
|
|
13065
|
+
import { basename as basename26, join as join100 } from "path";
|
|
13066
|
+
import { z as z47 } from "zod/mini";
|
|
12888
13067
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
12889
13068
|
var maxRulesCount = 1e3;
|
|
12890
13069
|
async function listRules() {
|
|
12891
|
-
const rulesDir =
|
|
13070
|
+
const rulesDir = join100(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
12892
13071
|
try {
|
|
12893
13072
|
const files = await listDirectoryFiles(rulesDir);
|
|
12894
13073
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -12901,7 +13080,7 @@ async function listRules() {
|
|
|
12901
13080
|
});
|
|
12902
13081
|
const frontmatter = rule.getFrontmatter();
|
|
12903
13082
|
return {
|
|
12904
|
-
relativePathFromCwd:
|
|
13083
|
+
relativePathFromCwd: join100(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
12905
13084
|
frontmatter
|
|
12906
13085
|
};
|
|
12907
13086
|
} catch (error) {
|
|
@@ -12928,7 +13107,7 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
12928
13107
|
validate: true
|
|
12929
13108
|
});
|
|
12930
13109
|
return {
|
|
12931
|
-
relativePathFromCwd:
|
|
13110
|
+
relativePathFromCwd: join100(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
12932
13111
|
frontmatter: rule.getFrontmatter(),
|
|
12933
13112
|
body: rule.getBody()
|
|
12934
13113
|
};
|
|
@@ -12957,7 +13136,7 @@ async function putRule({
|
|
|
12957
13136
|
try {
|
|
12958
13137
|
const existingRules = await listRules();
|
|
12959
13138
|
const isUpdate = existingRules.some(
|
|
12960
|
-
(rule2) => rule2.relativePathFromCwd ===
|
|
13139
|
+
(rule2) => rule2.relativePathFromCwd === join100(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
12961
13140
|
);
|
|
12962
13141
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
12963
13142
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -12970,11 +13149,11 @@ async function putRule({
|
|
|
12970
13149
|
body,
|
|
12971
13150
|
validate: true
|
|
12972
13151
|
});
|
|
12973
|
-
const rulesDir =
|
|
13152
|
+
const rulesDir = join100(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
12974
13153
|
await ensureDir(rulesDir);
|
|
12975
13154
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
12976
13155
|
return {
|
|
12977
|
-
relativePathFromCwd:
|
|
13156
|
+
relativePathFromCwd: join100(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
12978
13157
|
frontmatter: rule.getFrontmatter(),
|
|
12979
13158
|
body: rule.getBody()
|
|
12980
13159
|
};
|
|
@@ -12990,11 +13169,11 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
12990
13169
|
intendedRootDir: process.cwd()
|
|
12991
13170
|
});
|
|
12992
13171
|
const filename = basename26(relativePathFromCwd);
|
|
12993
|
-
const fullPath =
|
|
13172
|
+
const fullPath = join100(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
12994
13173
|
try {
|
|
12995
13174
|
await removeFile(fullPath);
|
|
12996
13175
|
return {
|
|
12997
|
-
relativePathFromCwd:
|
|
13176
|
+
relativePathFromCwd: join100(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
12998
13177
|
};
|
|
12999
13178
|
} catch (error) {
|
|
13000
13179
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -13003,23 +13182,23 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
13003
13182
|
}
|
|
13004
13183
|
}
|
|
13005
13184
|
var ruleToolSchemas = {
|
|
13006
|
-
listRules:
|
|
13007
|
-
getRule:
|
|
13008
|
-
relativePathFromCwd:
|
|
13185
|
+
listRules: z47.object({}),
|
|
13186
|
+
getRule: z47.object({
|
|
13187
|
+
relativePathFromCwd: z47.string()
|
|
13009
13188
|
}),
|
|
13010
|
-
putRule:
|
|
13011
|
-
relativePathFromCwd:
|
|
13189
|
+
putRule: z47.object({
|
|
13190
|
+
relativePathFromCwd: z47.string(),
|
|
13012
13191
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
13013
|
-
body:
|
|
13192
|
+
body: z47.string()
|
|
13014
13193
|
}),
|
|
13015
|
-
deleteRule:
|
|
13016
|
-
relativePathFromCwd:
|
|
13194
|
+
deleteRule: z47.object({
|
|
13195
|
+
relativePathFromCwd: z47.string()
|
|
13017
13196
|
})
|
|
13018
13197
|
};
|
|
13019
13198
|
var ruleTools = {
|
|
13020
13199
|
listRules: {
|
|
13021
13200
|
name: "listRules",
|
|
13022
|
-
description: `List all rules from ${
|
|
13201
|
+
description: `List all rules from ${join100(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
13023
13202
|
parameters: ruleToolSchemas.listRules,
|
|
13024
13203
|
execute: async () => {
|
|
13025
13204
|
const rules = await listRules();
|
|
@@ -13061,8 +13240,8 @@ var ruleTools = {
|
|
|
13061
13240
|
};
|
|
13062
13241
|
|
|
13063
13242
|
// src/mcp/skills.ts
|
|
13064
|
-
import { basename as basename27, dirname as dirname2, join as
|
|
13065
|
-
import { z as
|
|
13243
|
+
import { basename as basename27, dirname as dirname2, join as join101 } from "path";
|
|
13244
|
+
import { z as z48 } from "zod/mini";
|
|
13066
13245
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
13067
13246
|
var maxSkillsCount = 1e3;
|
|
13068
13247
|
function aiDirFileToMcpSkillFile(file) {
|
|
@@ -13085,9 +13264,9 @@ function extractDirName(relativeDirPathFromCwd) {
|
|
|
13085
13264
|
return dirName;
|
|
13086
13265
|
}
|
|
13087
13266
|
async function listSkills() {
|
|
13088
|
-
const skillsDir =
|
|
13267
|
+
const skillsDir = join101(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
13089
13268
|
try {
|
|
13090
|
-
const skillDirPaths = await findFilesByGlobs(
|
|
13269
|
+
const skillDirPaths = await findFilesByGlobs(join101(skillsDir, "*"), { type: "dir" });
|
|
13091
13270
|
const skills = await Promise.all(
|
|
13092
13271
|
skillDirPaths.map(async (dirPath) => {
|
|
13093
13272
|
const dirName = basename27(dirPath);
|
|
@@ -13098,7 +13277,7 @@ async function listSkills() {
|
|
|
13098
13277
|
});
|
|
13099
13278
|
const frontmatter = skill.getFrontmatter();
|
|
13100
13279
|
return {
|
|
13101
|
-
relativeDirPathFromCwd:
|
|
13280
|
+
relativeDirPathFromCwd: join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
13102
13281
|
frontmatter
|
|
13103
13282
|
};
|
|
13104
13283
|
} catch (error) {
|
|
@@ -13124,7 +13303,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
|
|
|
13124
13303
|
dirName
|
|
13125
13304
|
});
|
|
13126
13305
|
return {
|
|
13127
|
-
relativeDirPathFromCwd:
|
|
13306
|
+
relativeDirPathFromCwd: join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
13128
13307
|
frontmatter: skill.getFrontmatter(),
|
|
13129
13308
|
body: skill.getBody(),
|
|
13130
13309
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -13158,7 +13337,7 @@ async function putSkill({
|
|
|
13158
13337
|
try {
|
|
13159
13338
|
const existingSkills = await listSkills();
|
|
13160
13339
|
const isUpdate = existingSkills.some(
|
|
13161
|
-
(skill2) => skill2.relativeDirPathFromCwd ===
|
|
13340
|
+
(skill2) => skill2.relativeDirPathFromCwd === join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
13162
13341
|
);
|
|
13163
13342
|
if (!isUpdate && existingSkills.length >= maxSkillsCount) {
|
|
13164
13343
|
throw new Error(`Maximum number of skills (${maxSkillsCount}) reached`);
|
|
@@ -13173,9 +13352,9 @@ async function putSkill({
|
|
|
13173
13352
|
otherFiles: aiDirFiles,
|
|
13174
13353
|
validate: true
|
|
13175
13354
|
});
|
|
13176
|
-
const skillDirPath =
|
|
13355
|
+
const skillDirPath = join101(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
13177
13356
|
await ensureDir(skillDirPath);
|
|
13178
|
-
const skillFilePath =
|
|
13357
|
+
const skillFilePath = join101(skillDirPath, SKILL_FILE_NAME);
|
|
13179
13358
|
const skillFileContent = stringifyFrontmatter(body, frontmatter);
|
|
13180
13359
|
await writeFileContent(skillFilePath, skillFileContent);
|
|
13181
13360
|
for (const file of otherFiles) {
|
|
@@ -13183,15 +13362,15 @@ async function putSkill({
|
|
|
13183
13362
|
relativePath: file.name,
|
|
13184
13363
|
intendedRootDir: skillDirPath
|
|
13185
13364
|
});
|
|
13186
|
-
const filePath =
|
|
13187
|
-
const fileDir =
|
|
13365
|
+
const filePath = join101(skillDirPath, file.name);
|
|
13366
|
+
const fileDir = join101(skillDirPath, dirname2(file.name));
|
|
13188
13367
|
if (fileDir !== skillDirPath) {
|
|
13189
13368
|
await ensureDir(fileDir);
|
|
13190
13369
|
}
|
|
13191
13370
|
await writeFileContent(filePath, file.body);
|
|
13192
13371
|
}
|
|
13193
13372
|
return {
|
|
13194
|
-
relativeDirPathFromCwd:
|
|
13373
|
+
relativeDirPathFromCwd: join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
13195
13374
|
frontmatter: skill.getFrontmatter(),
|
|
13196
13375
|
body: skill.getBody(),
|
|
13197
13376
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -13213,13 +13392,13 @@ async function deleteSkill({
|
|
|
13213
13392
|
intendedRootDir: process.cwd()
|
|
13214
13393
|
});
|
|
13215
13394
|
const dirName = extractDirName(relativeDirPathFromCwd);
|
|
13216
|
-
const skillDirPath =
|
|
13395
|
+
const skillDirPath = join101(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
13217
13396
|
try {
|
|
13218
13397
|
if (await directoryExists(skillDirPath)) {
|
|
13219
13398
|
await removeDirectory(skillDirPath);
|
|
13220
13399
|
}
|
|
13221
13400
|
return {
|
|
13222
|
-
relativeDirPathFromCwd:
|
|
13401
|
+
relativeDirPathFromCwd: join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
13223
13402
|
};
|
|
13224
13403
|
} catch (error) {
|
|
13225
13404
|
throw new Error(
|
|
@@ -13230,29 +13409,29 @@ async function deleteSkill({
|
|
|
13230
13409
|
);
|
|
13231
13410
|
}
|
|
13232
13411
|
}
|
|
13233
|
-
var McpSkillFileSchema =
|
|
13234
|
-
name:
|
|
13235
|
-
body:
|
|
13412
|
+
var McpSkillFileSchema = z48.object({
|
|
13413
|
+
name: z48.string(),
|
|
13414
|
+
body: z48.string()
|
|
13236
13415
|
});
|
|
13237
13416
|
var skillToolSchemas = {
|
|
13238
|
-
listSkills:
|
|
13239
|
-
getSkill:
|
|
13240
|
-
relativeDirPathFromCwd:
|
|
13417
|
+
listSkills: z48.object({}),
|
|
13418
|
+
getSkill: z48.object({
|
|
13419
|
+
relativeDirPathFromCwd: z48.string()
|
|
13241
13420
|
}),
|
|
13242
|
-
putSkill:
|
|
13243
|
-
relativeDirPathFromCwd:
|
|
13421
|
+
putSkill: z48.object({
|
|
13422
|
+
relativeDirPathFromCwd: z48.string(),
|
|
13244
13423
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
13245
|
-
body:
|
|
13246
|
-
otherFiles:
|
|
13424
|
+
body: z48.string(),
|
|
13425
|
+
otherFiles: z48.optional(z48.array(McpSkillFileSchema))
|
|
13247
13426
|
}),
|
|
13248
|
-
deleteSkill:
|
|
13249
|
-
relativeDirPathFromCwd:
|
|
13427
|
+
deleteSkill: z48.object({
|
|
13428
|
+
relativeDirPathFromCwd: z48.string()
|
|
13250
13429
|
})
|
|
13251
13430
|
};
|
|
13252
13431
|
var skillTools = {
|
|
13253
13432
|
listSkills: {
|
|
13254
13433
|
name: "listSkills",
|
|
13255
|
-
description: `List all skills from ${
|
|
13434
|
+
description: `List all skills from ${join101(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
|
|
13256
13435
|
parameters: skillToolSchemas.listSkills,
|
|
13257
13436
|
execute: async () => {
|
|
13258
13437
|
const skills = await listSkills();
|
|
@@ -13295,12 +13474,12 @@ var skillTools = {
|
|
|
13295
13474
|
};
|
|
13296
13475
|
|
|
13297
13476
|
// src/mcp/subagents.ts
|
|
13298
|
-
import { basename as basename28, join as
|
|
13299
|
-
import { z as
|
|
13477
|
+
import { basename as basename28, join as join102 } from "path";
|
|
13478
|
+
import { z as z49 } from "zod/mini";
|
|
13300
13479
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
13301
13480
|
var maxSubagentsCount = 1e3;
|
|
13302
13481
|
async function listSubagents() {
|
|
13303
|
-
const subagentsDir =
|
|
13482
|
+
const subagentsDir = join102(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
13304
13483
|
try {
|
|
13305
13484
|
const files = await listDirectoryFiles(subagentsDir);
|
|
13306
13485
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -13313,7 +13492,7 @@ async function listSubagents() {
|
|
|
13313
13492
|
});
|
|
13314
13493
|
const frontmatter = subagent.getFrontmatter();
|
|
13315
13494
|
return {
|
|
13316
|
-
relativePathFromCwd:
|
|
13495
|
+
relativePathFromCwd: join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
13317
13496
|
frontmatter
|
|
13318
13497
|
};
|
|
13319
13498
|
} catch (error) {
|
|
@@ -13342,7 +13521,7 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
13342
13521
|
validate: true
|
|
13343
13522
|
});
|
|
13344
13523
|
return {
|
|
13345
|
-
relativePathFromCwd:
|
|
13524
|
+
relativePathFromCwd: join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
13346
13525
|
frontmatter: subagent.getFrontmatter(),
|
|
13347
13526
|
body: subagent.getBody()
|
|
13348
13527
|
};
|
|
@@ -13371,7 +13550,7 @@ async function putSubagent({
|
|
|
13371
13550
|
try {
|
|
13372
13551
|
const existingSubagents = await listSubagents();
|
|
13373
13552
|
const isUpdate = existingSubagents.some(
|
|
13374
|
-
(subagent2) => subagent2.relativePathFromCwd ===
|
|
13553
|
+
(subagent2) => subagent2.relativePathFromCwd === join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
13375
13554
|
);
|
|
13376
13555
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
13377
13556
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -13384,11 +13563,11 @@ async function putSubagent({
|
|
|
13384
13563
|
body,
|
|
13385
13564
|
validate: true
|
|
13386
13565
|
});
|
|
13387
|
-
const subagentsDir =
|
|
13566
|
+
const subagentsDir = join102(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
13388
13567
|
await ensureDir(subagentsDir);
|
|
13389
13568
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
13390
13569
|
return {
|
|
13391
|
-
relativePathFromCwd:
|
|
13570
|
+
relativePathFromCwd: join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
13392
13571
|
frontmatter: subagent.getFrontmatter(),
|
|
13393
13572
|
body: subagent.getBody()
|
|
13394
13573
|
};
|
|
@@ -13404,11 +13583,11 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
13404
13583
|
intendedRootDir: process.cwd()
|
|
13405
13584
|
});
|
|
13406
13585
|
const filename = basename28(relativePathFromCwd);
|
|
13407
|
-
const fullPath =
|
|
13586
|
+
const fullPath = join102(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
13408
13587
|
try {
|
|
13409
13588
|
await removeFile(fullPath);
|
|
13410
13589
|
return {
|
|
13411
|
-
relativePathFromCwd:
|
|
13590
|
+
relativePathFromCwd: join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
13412
13591
|
};
|
|
13413
13592
|
} catch (error) {
|
|
13414
13593
|
throw new Error(
|
|
@@ -13420,23 +13599,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
13420
13599
|
}
|
|
13421
13600
|
}
|
|
13422
13601
|
var subagentToolSchemas = {
|
|
13423
|
-
listSubagents:
|
|
13424
|
-
getSubagent:
|
|
13425
|
-
relativePathFromCwd:
|
|
13602
|
+
listSubagents: z49.object({}),
|
|
13603
|
+
getSubagent: z49.object({
|
|
13604
|
+
relativePathFromCwd: z49.string()
|
|
13426
13605
|
}),
|
|
13427
|
-
putSubagent:
|
|
13428
|
-
relativePathFromCwd:
|
|
13606
|
+
putSubagent: z49.object({
|
|
13607
|
+
relativePathFromCwd: z49.string(),
|
|
13429
13608
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
13430
|
-
body:
|
|
13609
|
+
body: z49.string()
|
|
13431
13610
|
}),
|
|
13432
|
-
deleteSubagent:
|
|
13433
|
-
relativePathFromCwd:
|
|
13611
|
+
deleteSubagent: z49.object({
|
|
13612
|
+
relativePathFromCwd: z49.string()
|
|
13434
13613
|
})
|
|
13435
13614
|
};
|
|
13436
13615
|
var subagentTools = {
|
|
13437
13616
|
listSubagents: {
|
|
13438
13617
|
name: "listSubagents",
|
|
13439
|
-
description: `List all subagents from ${
|
|
13618
|
+
description: `List all subagents from ${join102(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
13440
13619
|
parameters: subagentToolSchemas.listSubagents,
|
|
13441
13620
|
execute: async () => {
|
|
13442
13621
|
const subagents = await listSubagents();
|
|
@@ -13478,20 +13657,20 @@ var subagentTools = {
|
|
|
13478
13657
|
};
|
|
13479
13658
|
|
|
13480
13659
|
// src/mcp/tools.ts
|
|
13481
|
-
var rulesyncFeatureSchema =
|
|
13482
|
-
var rulesyncOperationSchema =
|
|
13483
|
-
var skillFileSchema =
|
|
13484
|
-
name:
|
|
13485
|
-
body:
|
|
13660
|
+
var rulesyncFeatureSchema = z50.enum(["rule", "command", "subagent", "skill", "ignore", "mcp"]);
|
|
13661
|
+
var rulesyncOperationSchema = z50.enum(["list", "get", "put", "delete"]);
|
|
13662
|
+
var skillFileSchema = z50.object({
|
|
13663
|
+
name: z50.string(),
|
|
13664
|
+
body: z50.string()
|
|
13486
13665
|
});
|
|
13487
|
-
var rulesyncToolSchema =
|
|
13666
|
+
var rulesyncToolSchema = z50.object({
|
|
13488
13667
|
feature: rulesyncFeatureSchema,
|
|
13489
13668
|
operation: rulesyncOperationSchema,
|
|
13490
|
-
targetPathFromCwd:
|
|
13491
|
-
frontmatter:
|
|
13492
|
-
body:
|
|
13493
|
-
otherFiles:
|
|
13494
|
-
content:
|
|
13669
|
+
targetPathFromCwd: z50.optional(z50.string()),
|
|
13670
|
+
frontmatter: z50.optional(z50.unknown()),
|
|
13671
|
+
body: z50.optional(z50.string()),
|
|
13672
|
+
otherFiles: z50.optional(z50.array(skillFileSchema)),
|
|
13673
|
+
content: z50.optional(z50.string())
|
|
13495
13674
|
});
|
|
13496
13675
|
var supportedOperationsByFeature = {
|
|
13497
13676
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -13687,7 +13866,7 @@ async function mcpCommand({ version }) {
|
|
|
13687
13866
|
}
|
|
13688
13867
|
|
|
13689
13868
|
// src/cli/index.ts
|
|
13690
|
-
var getVersion = () => "5.
|
|
13869
|
+
var getVersion = () => "5.7.0";
|
|
13691
13870
|
var main = async () => {
|
|
13692
13871
|
const program = new Command();
|
|
13693
13872
|
const version = getVersion();
|