rulesync 8.10.0 → 8.11.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/dist/{chunk-RMITDFVW.js → chunk-ZX2YPC22.js} +234 -8
- package/dist/cli/index.cjs +197 -88
- package/dist/cli/index.js +198 -317
- package/dist/index.cjs +259 -7
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +27 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -19258,9 +19258,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19258
19258
|
}
|
|
19259
19259
|
toRulesyncRule() {
|
|
19260
19260
|
let globs;
|
|
19261
|
-
if (this.
|
|
19262
|
-
globs = ["**/*"];
|
|
19263
|
-
} else if (this.frontmatter.applyTo) {
|
|
19261
|
+
if (this.frontmatter.applyTo) {
|
|
19264
19262
|
globs = this.frontmatter.applyTo.split(",").map((g) => g.trim());
|
|
19265
19263
|
}
|
|
19266
19264
|
const rulesyncFrontmatter = {
|
|
@@ -27345,7 +27343,7 @@ async function runGhInstall(logger5, options) {
|
|
|
27345
27343
|
var import_fastmcp = require("fastmcp");
|
|
27346
27344
|
|
|
27347
27345
|
// src/mcp/tools.ts
|
|
27348
|
-
var
|
|
27346
|
+
var import_mini92 = require("zod/mini");
|
|
27349
27347
|
|
|
27350
27348
|
// src/mcp/commands.ts
|
|
27351
27349
|
var import_node_path161 = require("path");
|
|
@@ -27534,16 +27532,118 @@ var commandTools = {
|
|
|
27534
27532
|
}
|
|
27535
27533
|
};
|
|
27536
27534
|
|
|
27537
|
-
// src/mcp/
|
|
27535
|
+
// src/mcp/convert.ts
|
|
27538
27536
|
var import_mini82 = require("zod/mini");
|
|
27539
|
-
var
|
|
27540
|
-
|
|
27537
|
+
var convertOptionsSchema = import_mini82.z.object({
|
|
27538
|
+
from: import_mini82.z.string(),
|
|
27539
|
+
to: import_mini82.z.array(import_mini82.z.string()),
|
|
27541
27540
|
features: import_mini82.z.optional(import_mini82.z.array(import_mini82.z.string())),
|
|
27542
|
-
delete: import_mini82.z.optional(import_mini82.z.boolean()),
|
|
27543
27541
|
global: import_mini82.z.optional(import_mini82.z.boolean()),
|
|
27544
|
-
|
|
27545
|
-
|
|
27546
|
-
|
|
27542
|
+
dryRun: import_mini82.z.optional(import_mini82.z.boolean())
|
|
27543
|
+
});
|
|
27544
|
+
function parseToolTarget2(value, label) {
|
|
27545
|
+
const result = ToolTargetSchema.safeParse(value);
|
|
27546
|
+
if (!result.success) {
|
|
27547
|
+
throw new Error(
|
|
27548
|
+
`Invalid ${label} tool '${value}'. Must be one of: ${ALL_TOOL_TARGETS.join(", ")}`
|
|
27549
|
+
);
|
|
27550
|
+
}
|
|
27551
|
+
return result.data;
|
|
27552
|
+
}
|
|
27553
|
+
async function executeConvert(options) {
|
|
27554
|
+
try {
|
|
27555
|
+
if (!options.from) {
|
|
27556
|
+
return {
|
|
27557
|
+
success: false,
|
|
27558
|
+
error: "from is required. Please specify a source tool to convert from."
|
|
27559
|
+
};
|
|
27560
|
+
}
|
|
27561
|
+
if (!options.to || options.to.length === 0) {
|
|
27562
|
+
return {
|
|
27563
|
+
success: false,
|
|
27564
|
+
error: "to is required and must not be empty. Please specify destination tools."
|
|
27565
|
+
};
|
|
27566
|
+
}
|
|
27567
|
+
const fromTool = parseToolTarget2(options.from, "source");
|
|
27568
|
+
const toToolsRaw = options.to.map((t) => parseToolTarget2(t, "destination"));
|
|
27569
|
+
const toTools = Array.from(new Set(toToolsRaw));
|
|
27570
|
+
if (toTools.includes(fromTool)) {
|
|
27571
|
+
return {
|
|
27572
|
+
success: false,
|
|
27573
|
+
error: `Destination tools must not include the source tool '${fromTool}'. Converting a tool onto itself is likely a mistake and may cause lossy round-trips.`
|
|
27574
|
+
};
|
|
27575
|
+
}
|
|
27576
|
+
const config = await ConfigResolver.resolve({
|
|
27577
|
+
targets: [fromTool, ...toTools],
|
|
27578
|
+
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
27579
|
+
features: options.features ?? ["*"],
|
|
27580
|
+
global: options.global,
|
|
27581
|
+
dryRun: options.dryRun,
|
|
27582
|
+
// Always use default baseDirs (process.cwd()) and configPath
|
|
27583
|
+
// verbose and silent are meaningless in MCP context
|
|
27584
|
+
verbose: false,
|
|
27585
|
+
silent: true
|
|
27586
|
+
});
|
|
27587
|
+
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27588
|
+
const convertResult = await convertFromTool({ config, fromTool, toTools, logger: logger5 });
|
|
27589
|
+
return buildSuccessResponse({ convertResult, config, fromTool, toTools });
|
|
27590
|
+
} catch (error) {
|
|
27591
|
+
return {
|
|
27592
|
+
success: false,
|
|
27593
|
+
error: formatError(error)
|
|
27594
|
+
};
|
|
27595
|
+
}
|
|
27596
|
+
}
|
|
27597
|
+
function buildSuccessResponse(params) {
|
|
27598
|
+
const { convertResult, config, fromTool, toTools } = params;
|
|
27599
|
+
const totalCount = calculateTotalCount(convertResult);
|
|
27600
|
+
return {
|
|
27601
|
+
success: true,
|
|
27602
|
+
result: {
|
|
27603
|
+
rulesCount: convertResult.rulesCount,
|
|
27604
|
+
ignoreCount: convertResult.ignoreCount,
|
|
27605
|
+
mcpCount: convertResult.mcpCount,
|
|
27606
|
+
commandsCount: convertResult.commandsCount,
|
|
27607
|
+
subagentsCount: convertResult.subagentsCount,
|
|
27608
|
+
skillsCount: convertResult.skillsCount,
|
|
27609
|
+
hooksCount: convertResult.hooksCount,
|
|
27610
|
+
permissionsCount: convertResult.permissionsCount,
|
|
27611
|
+
totalCount
|
|
27612
|
+
},
|
|
27613
|
+
config: {
|
|
27614
|
+
from: fromTool,
|
|
27615
|
+
to: toTools,
|
|
27616
|
+
features: config.getFeatures(),
|
|
27617
|
+
global: config.getGlobal(),
|
|
27618
|
+
dryRun: config.isPreviewMode()
|
|
27619
|
+
}
|
|
27620
|
+
};
|
|
27621
|
+
}
|
|
27622
|
+
var convertToolSchemas = {
|
|
27623
|
+
executeConvert: convertOptionsSchema
|
|
27624
|
+
};
|
|
27625
|
+
var convertTools = {
|
|
27626
|
+
executeConvert: {
|
|
27627
|
+
name: "executeConvert",
|
|
27628
|
+
description: "Execute the rulesync convert command to convert configuration files between AI tools without writing intermediate .rulesync/ files. Requires a source tool (from) and one or more destination tools (to).",
|
|
27629
|
+
parameters: convertToolSchemas.executeConvert,
|
|
27630
|
+
execute: async (options) => {
|
|
27631
|
+
const result = await executeConvert(options);
|
|
27632
|
+
return JSON.stringify(result, null, 2);
|
|
27633
|
+
}
|
|
27634
|
+
}
|
|
27635
|
+
};
|
|
27636
|
+
|
|
27637
|
+
// src/mcp/generate.ts
|
|
27638
|
+
var import_mini83 = require("zod/mini");
|
|
27639
|
+
var generateOptionsSchema = import_mini83.z.object({
|
|
27640
|
+
targets: import_mini83.z.optional(import_mini83.z.array(import_mini83.z.string())),
|
|
27641
|
+
features: import_mini83.z.optional(import_mini83.z.array(import_mini83.z.string())),
|
|
27642
|
+
delete: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27643
|
+
global: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27644
|
+
simulateCommands: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27645
|
+
simulateSubagents: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27646
|
+
simulateSkills: import_mini83.z.optional(import_mini83.z.boolean())
|
|
27547
27647
|
});
|
|
27548
27648
|
async function executeGenerate(options = {}) {
|
|
27549
27649
|
try {
|
|
@@ -27571,7 +27671,7 @@ async function executeGenerate(options = {}) {
|
|
|
27571
27671
|
});
|
|
27572
27672
|
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27573
27673
|
const generateResult = await generate({ config, logger: logger5 });
|
|
27574
|
-
return
|
|
27674
|
+
return buildSuccessResponse2({ generateResult, config });
|
|
27575
27675
|
} catch (error) {
|
|
27576
27676
|
return {
|
|
27577
27677
|
success: false,
|
|
@@ -27579,7 +27679,7 @@ async function executeGenerate(options = {}) {
|
|
|
27579
27679
|
};
|
|
27580
27680
|
}
|
|
27581
27681
|
}
|
|
27582
|
-
function
|
|
27682
|
+
function buildSuccessResponse2(params) {
|
|
27583
27683
|
const { generateResult, config } = params;
|
|
27584
27684
|
const totalCount = calculateTotalCount(generateResult);
|
|
27585
27685
|
return {
|
|
@@ -27623,7 +27723,7 @@ var generateTools = {
|
|
|
27623
27723
|
|
|
27624
27724
|
// src/mcp/hooks.ts
|
|
27625
27725
|
var import_node_path162 = require("path");
|
|
27626
|
-
var
|
|
27726
|
+
var import_mini84 = require("zod/mini");
|
|
27627
27727
|
var maxHooksSizeBytes = 1024 * 1024;
|
|
27628
27728
|
async function getHooksFile() {
|
|
27629
27729
|
try {
|
|
@@ -27712,11 +27812,11 @@ async function deleteHooksFile() {
|
|
|
27712
27812
|
}
|
|
27713
27813
|
}
|
|
27714
27814
|
var hooksToolSchemas = {
|
|
27715
|
-
getHooksFile:
|
|
27716
|
-
putHooksFile:
|
|
27717
|
-
content:
|
|
27815
|
+
getHooksFile: import_mini84.z.object({}),
|
|
27816
|
+
putHooksFile: import_mini84.z.object({
|
|
27817
|
+
content: import_mini84.z.string()
|
|
27718
27818
|
}),
|
|
27719
|
-
deleteHooksFile:
|
|
27819
|
+
deleteHooksFile: import_mini84.z.object({})
|
|
27720
27820
|
};
|
|
27721
27821
|
var hooksTools = {
|
|
27722
27822
|
getHooksFile: {
|
|
@@ -27750,7 +27850,7 @@ var hooksTools = {
|
|
|
27750
27850
|
|
|
27751
27851
|
// src/mcp/ignore.ts
|
|
27752
27852
|
var import_node_path163 = require("path");
|
|
27753
|
-
var
|
|
27853
|
+
var import_mini85 = require("zod/mini");
|
|
27754
27854
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
27755
27855
|
async function getIgnoreFile() {
|
|
27756
27856
|
const ignoreFilePath = (0, import_node_path163.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
@@ -27813,11 +27913,11 @@ async function deleteIgnoreFile() {
|
|
|
27813
27913
|
}
|
|
27814
27914
|
}
|
|
27815
27915
|
var ignoreToolSchemas = {
|
|
27816
|
-
getIgnoreFile:
|
|
27817
|
-
putIgnoreFile:
|
|
27818
|
-
content:
|
|
27916
|
+
getIgnoreFile: import_mini85.z.object({}),
|
|
27917
|
+
putIgnoreFile: import_mini85.z.object({
|
|
27918
|
+
content: import_mini85.z.string()
|
|
27819
27919
|
}),
|
|
27820
|
-
deleteIgnoreFile:
|
|
27920
|
+
deleteIgnoreFile: import_mini85.z.object({})
|
|
27821
27921
|
};
|
|
27822
27922
|
var ignoreTools = {
|
|
27823
27923
|
getIgnoreFile: {
|
|
@@ -27850,11 +27950,11 @@ var ignoreTools = {
|
|
|
27850
27950
|
};
|
|
27851
27951
|
|
|
27852
27952
|
// src/mcp/import.ts
|
|
27853
|
-
var
|
|
27854
|
-
var importOptionsSchema =
|
|
27855
|
-
target:
|
|
27856
|
-
features:
|
|
27857
|
-
global:
|
|
27953
|
+
var import_mini86 = require("zod/mini");
|
|
27954
|
+
var importOptionsSchema = import_mini86.z.object({
|
|
27955
|
+
target: import_mini86.z.string(),
|
|
27956
|
+
features: import_mini86.z.optional(import_mini86.z.array(import_mini86.z.string())),
|
|
27957
|
+
global: import_mini86.z.optional(import_mini86.z.boolean())
|
|
27858
27958
|
});
|
|
27859
27959
|
async function executeImport(options) {
|
|
27860
27960
|
try {
|
|
@@ -27878,7 +27978,7 @@ async function executeImport(options) {
|
|
|
27878
27978
|
const tool = config.getTargets()[0];
|
|
27879
27979
|
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27880
27980
|
const importResult = await importFromTool({ config, tool, logger: logger5 });
|
|
27881
|
-
return
|
|
27981
|
+
return buildSuccessResponse3({ importResult, config, tool });
|
|
27882
27982
|
} catch (error) {
|
|
27883
27983
|
return {
|
|
27884
27984
|
success: false,
|
|
@@ -27886,7 +27986,7 @@ async function executeImport(options) {
|
|
|
27886
27986
|
};
|
|
27887
27987
|
}
|
|
27888
27988
|
}
|
|
27889
|
-
function
|
|
27989
|
+
function buildSuccessResponse3(params) {
|
|
27890
27990
|
const { importResult, config, tool } = params;
|
|
27891
27991
|
const totalCount = calculateTotalCount(importResult);
|
|
27892
27992
|
return {
|
|
@@ -27926,7 +28026,7 @@ var importTools = {
|
|
|
27926
28026
|
|
|
27927
28027
|
// src/mcp/mcp.ts
|
|
27928
28028
|
var import_node_path164 = require("path");
|
|
27929
|
-
var
|
|
28029
|
+
var import_mini87 = require("zod/mini");
|
|
27930
28030
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
27931
28031
|
async function getMcpFile() {
|
|
27932
28032
|
try {
|
|
@@ -28024,11 +28124,11 @@ async function deleteMcpFile() {
|
|
|
28024
28124
|
}
|
|
28025
28125
|
}
|
|
28026
28126
|
var mcpToolSchemas = {
|
|
28027
|
-
getMcpFile:
|
|
28028
|
-
putMcpFile:
|
|
28029
|
-
content:
|
|
28127
|
+
getMcpFile: import_mini87.z.object({}),
|
|
28128
|
+
putMcpFile: import_mini87.z.object({
|
|
28129
|
+
content: import_mini87.z.string()
|
|
28030
28130
|
}),
|
|
28031
|
-
deleteMcpFile:
|
|
28131
|
+
deleteMcpFile: import_mini87.z.object({})
|
|
28032
28132
|
};
|
|
28033
28133
|
var mcpTools = {
|
|
28034
28134
|
getMcpFile: {
|
|
@@ -28062,7 +28162,7 @@ var mcpTools = {
|
|
|
28062
28162
|
|
|
28063
28163
|
// src/mcp/permissions.ts
|
|
28064
28164
|
var import_node_path165 = require("path");
|
|
28065
|
-
var
|
|
28165
|
+
var import_mini88 = require("zod/mini");
|
|
28066
28166
|
var maxPermissionsSizeBytes = 1024 * 1024;
|
|
28067
28167
|
async function getPermissionsFile() {
|
|
28068
28168
|
try {
|
|
@@ -28151,11 +28251,11 @@ async function deletePermissionsFile() {
|
|
|
28151
28251
|
}
|
|
28152
28252
|
}
|
|
28153
28253
|
var permissionsToolSchemas = {
|
|
28154
|
-
getPermissionsFile:
|
|
28155
|
-
putPermissionsFile:
|
|
28156
|
-
content:
|
|
28254
|
+
getPermissionsFile: import_mini88.z.object({}),
|
|
28255
|
+
putPermissionsFile: import_mini88.z.object({
|
|
28256
|
+
content: import_mini88.z.string()
|
|
28157
28257
|
}),
|
|
28158
|
-
deletePermissionsFile:
|
|
28258
|
+
deletePermissionsFile: import_mini88.z.object({})
|
|
28159
28259
|
};
|
|
28160
28260
|
var permissionsTools = {
|
|
28161
28261
|
getPermissionsFile: {
|
|
@@ -28189,7 +28289,7 @@ var permissionsTools = {
|
|
|
28189
28289
|
|
|
28190
28290
|
// src/mcp/rules.ts
|
|
28191
28291
|
var import_node_path166 = require("path");
|
|
28192
|
-
var
|
|
28292
|
+
var import_mini89 = require("zod/mini");
|
|
28193
28293
|
var logger2 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28194
28294
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
28195
28295
|
var maxRulesCount = 1e3;
|
|
@@ -28313,17 +28413,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
28313
28413
|
}
|
|
28314
28414
|
}
|
|
28315
28415
|
var ruleToolSchemas = {
|
|
28316
|
-
listRules:
|
|
28317
|
-
getRule:
|
|
28318
|
-
relativePathFromCwd:
|
|
28416
|
+
listRules: import_mini89.z.object({}),
|
|
28417
|
+
getRule: import_mini89.z.object({
|
|
28418
|
+
relativePathFromCwd: import_mini89.z.string()
|
|
28319
28419
|
}),
|
|
28320
|
-
putRule:
|
|
28321
|
-
relativePathFromCwd:
|
|
28420
|
+
putRule: import_mini89.z.object({
|
|
28421
|
+
relativePathFromCwd: import_mini89.z.string(),
|
|
28322
28422
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
28323
|
-
body:
|
|
28423
|
+
body: import_mini89.z.string()
|
|
28324
28424
|
}),
|
|
28325
|
-
deleteRule:
|
|
28326
|
-
relativePathFromCwd:
|
|
28425
|
+
deleteRule: import_mini89.z.object({
|
|
28426
|
+
relativePathFromCwd: import_mini89.z.string()
|
|
28327
28427
|
})
|
|
28328
28428
|
};
|
|
28329
28429
|
var ruleTools = {
|
|
@@ -28372,7 +28472,7 @@ var ruleTools = {
|
|
|
28372
28472
|
|
|
28373
28473
|
// src/mcp/skills.ts
|
|
28374
28474
|
var import_node_path167 = require("path");
|
|
28375
|
-
var
|
|
28475
|
+
var import_mini90 = require("zod/mini");
|
|
28376
28476
|
var logger3 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28377
28477
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
28378
28478
|
var maxSkillsCount = 1e3;
|
|
@@ -28545,23 +28645,23 @@ async function deleteSkill({
|
|
|
28545
28645
|
);
|
|
28546
28646
|
}
|
|
28547
28647
|
}
|
|
28548
|
-
var McpSkillFileSchema =
|
|
28549
|
-
name:
|
|
28550
|
-
body:
|
|
28648
|
+
var McpSkillFileSchema = import_mini90.z.object({
|
|
28649
|
+
name: import_mini90.z.string(),
|
|
28650
|
+
body: import_mini90.z.string()
|
|
28551
28651
|
});
|
|
28552
28652
|
var skillToolSchemas = {
|
|
28553
|
-
listSkills:
|
|
28554
|
-
getSkill:
|
|
28555
|
-
relativeDirPathFromCwd:
|
|
28653
|
+
listSkills: import_mini90.z.object({}),
|
|
28654
|
+
getSkill: import_mini90.z.object({
|
|
28655
|
+
relativeDirPathFromCwd: import_mini90.z.string()
|
|
28556
28656
|
}),
|
|
28557
|
-
putSkill:
|
|
28558
|
-
relativeDirPathFromCwd:
|
|
28657
|
+
putSkill: import_mini90.z.object({
|
|
28658
|
+
relativeDirPathFromCwd: import_mini90.z.string(),
|
|
28559
28659
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
28560
|
-
body:
|
|
28561
|
-
otherFiles:
|
|
28660
|
+
body: import_mini90.z.string(),
|
|
28661
|
+
otherFiles: import_mini90.z.optional(import_mini90.z.array(McpSkillFileSchema))
|
|
28562
28662
|
}),
|
|
28563
|
-
deleteSkill:
|
|
28564
|
-
relativeDirPathFromCwd:
|
|
28663
|
+
deleteSkill: import_mini90.z.object({
|
|
28664
|
+
relativeDirPathFromCwd: import_mini90.z.string()
|
|
28565
28665
|
})
|
|
28566
28666
|
};
|
|
28567
28667
|
var skillTools = {
|
|
@@ -28611,7 +28711,7 @@ var skillTools = {
|
|
|
28611
28711
|
|
|
28612
28712
|
// src/mcp/subagents.ts
|
|
28613
28713
|
var import_node_path168 = require("path");
|
|
28614
|
-
var
|
|
28714
|
+
var import_mini91 = require("zod/mini");
|
|
28615
28715
|
var logger4 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28616
28716
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
28617
28717
|
var maxSubagentsCount = 1e3;
|
|
@@ -28740,17 +28840,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
28740
28840
|
}
|
|
28741
28841
|
}
|
|
28742
28842
|
var subagentToolSchemas = {
|
|
28743
|
-
listSubagents:
|
|
28744
|
-
getSubagent:
|
|
28745
|
-
relativePathFromCwd:
|
|
28843
|
+
listSubagents: import_mini91.z.object({}),
|
|
28844
|
+
getSubagent: import_mini91.z.object({
|
|
28845
|
+
relativePathFromCwd: import_mini91.z.string()
|
|
28746
28846
|
}),
|
|
28747
|
-
putSubagent:
|
|
28748
|
-
relativePathFromCwd:
|
|
28847
|
+
putSubagent: import_mini91.z.object({
|
|
28848
|
+
relativePathFromCwd: import_mini91.z.string(),
|
|
28749
28849
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
28750
|
-
body:
|
|
28850
|
+
body: import_mini91.z.string()
|
|
28751
28851
|
}),
|
|
28752
|
-
deleteSubagent:
|
|
28753
|
-
relativePathFromCwd:
|
|
28852
|
+
deleteSubagent: import_mini91.z.object({
|
|
28853
|
+
relativePathFromCwd: import_mini91.z.string()
|
|
28754
28854
|
})
|
|
28755
28855
|
};
|
|
28756
28856
|
var subagentTools = {
|
|
@@ -28798,7 +28898,7 @@ var subagentTools = {
|
|
|
28798
28898
|
};
|
|
28799
28899
|
|
|
28800
28900
|
// src/mcp/tools.ts
|
|
28801
|
-
var rulesyncFeatureSchema =
|
|
28901
|
+
var rulesyncFeatureSchema = import_mini92.z.enum([
|
|
28802
28902
|
"rule",
|
|
28803
28903
|
"command",
|
|
28804
28904
|
"subagent",
|
|
@@ -28808,23 +28908,25 @@ var rulesyncFeatureSchema = import_mini91.z.enum([
|
|
|
28808
28908
|
"permissions",
|
|
28809
28909
|
"hooks",
|
|
28810
28910
|
"generate",
|
|
28811
|
-
"import"
|
|
28911
|
+
"import",
|
|
28912
|
+
"convert"
|
|
28812
28913
|
]);
|
|
28813
|
-
var rulesyncOperationSchema =
|
|
28814
|
-
var skillFileSchema =
|
|
28815
|
-
name:
|
|
28816
|
-
body:
|
|
28914
|
+
var rulesyncOperationSchema = import_mini92.z.enum(["list", "get", "put", "delete", "run"]);
|
|
28915
|
+
var skillFileSchema = import_mini92.z.object({
|
|
28916
|
+
name: import_mini92.z.string(),
|
|
28917
|
+
body: import_mini92.z.string()
|
|
28817
28918
|
});
|
|
28818
|
-
var rulesyncToolSchema =
|
|
28919
|
+
var rulesyncToolSchema = import_mini92.z.object({
|
|
28819
28920
|
feature: rulesyncFeatureSchema,
|
|
28820
28921
|
operation: rulesyncOperationSchema,
|
|
28821
|
-
targetPathFromCwd:
|
|
28822
|
-
frontmatter:
|
|
28823
|
-
body:
|
|
28824
|
-
otherFiles:
|
|
28825
|
-
content:
|
|
28826
|
-
generateOptions:
|
|
28827
|
-
importOptions:
|
|
28922
|
+
targetPathFromCwd: import_mini92.z.optional(import_mini92.z.string()),
|
|
28923
|
+
frontmatter: import_mini92.z.optional(import_mini92.z.unknown()),
|
|
28924
|
+
body: import_mini92.z.optional(import_mini92.z.string()),
|
|
28925
|
+
otherFiles: import_mini92.z.optional(import_mini92.z.array(skillFileSchema)),
|
|
28926
|
+
content: import_mini92.z.optional(import_mini92.z.string()),
|
|
28927
|
+
generateOptions: import_mini92.z.optional(generateOptionsSchema),
|
|
28928
|
+
importOptions: import_mini92.z.optional(importOptionsSchema),
|
|
28929
|
+
convertOptions: import_mini92.z.optional(convertOptionsSchema)
|
|
28828
28930
|
});
|
|
28829
28931
|
var supportedOperationsByFeature = {
|
|
28830
28932
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -28836,7 +28938,8 @@ var supportedOperationsByFeature = {
|
|
|
28836
28938
|
permissions: ["get", "put", "delete"],
|
|
28837
28939
|
hooks: ["get", "put", "delete"],
|
|
28838
28940
|
generate: ["run"],
|
|
28839
|
-
import: ["run"]
|
|
28941
|
+
import: ["run"],
|
|
28942
|
+
convert: ["run"]
|
|
28840
28943
|
};
|
|
28841
28944
|
function assertSupported({
|
|
28842
28945
|
feature,
|
|
@@ -28884,7 +28987,7 @@ function ensureBody({ body, feature, operation }) {
|
|
|
28884
28987
|
}
|
|
28885
28988
|
var rulesyncTool = {
|
|
28886
28989
|
name: "rulesyncTool",
|
|
28887
|
-
description: "Manage Rulesync files through a single MCP tool. Features: rule/command/subagent/skill support list/get/put/delete; ignore/mcp/permissions/hooks support get/put/delete only; generate supports run only; import supports run only. Parameters: list requires no targetPathFromCwd (lists all items); get/delete require targetPathFromCwd; put requires targetPathFromCwd, frontmatter, and body (or content for ignore/mcp/permissions/hooks); generate/run uses generateOptions to configure generation; import/run uses importOptions to configure import.",
|
|
28990
|
+
description: "Manage Rulesync files through a single MCP tool. Features: rule/command/subagent/skill support list/get/put/delete; ignore/mcp/permissions/hooks support get/put/delete only; generate supports run only; import supports run only; convert supports run only. Parameters: list requires no targetPathFromCwd (lists all items); get/delete require targetPathFromCwd; put requires targetPathFromCwd, frontmatter, and body (or content for ignore/mcp/permissions/hooks); generate/run uses generateOptions to configure generation; import/run uses importOptions to configure import; convert/run uses convertOptions to configure conversion.",
|
|
28888
28991
|
parameters: rulesyncToolSchema,
|
|
28889
28992
|
execute: async (args) => {
|
|
28890
28993
|
const parsed = rulesyncToolSchema.parse(args);
|
|
@@ -29034,6 +29137,12 @@ var rulesyncTool = {
|
|
|
29034
29137
|
}
|
|
29035
29138
|
return importTools.executeImport.execute(parsed.importOptions);
|
|
29036
29139
|
}
|
|
29140
|
+
case "convert": {
|
|
29141
|
+
if (!parsed.convertOptions) {
|
|
29142
|
+
throw new Error("convertOptions is required for convert feature");
|
|
29143
|
+
}
|
|
29144
|
+
return convertTools.executeConvert.execute(parsed.convertOptions);
|
|
29145
|
+
}
|
|
29037
29146
|
default: {
|
|
29038
29147
|
throw new Error(`Unknown feature: ${parsed.feature}`);
|
|
29039
29148
|
}
|
|
@@ -29487,7 +29596,7 @@ function wrapCommand({
|
|
|
29487
29596
|
}
|
|
29488
29597
|
|
|
29489
29598
|
// src/cli/index.ts
|
|
29490
|
-
var getVersion = () => "8.
|
|
29599
|
+
var getVersion = () => "8.11.0";
|
|
29491
29600
|
function wrapCommand2(name, errorCode, handler) {
|
|
29492
29601
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
29493
29602
|
}
|