rulesync 8.10.0 → 8.12.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-643VJ2QM.js} +245 -15
- package/dist/cli/index.cjs +208 -95
- package/dist/cli/index.js +198 -317
- package/dist/index.cjs +270 -14
- 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
|
@@ -4056,7 +4056,8 @@ var CODEXCLI_HOOK_EVENTS = [
|
|
|
4056
4056
|
"preToolUse",
|
|
4057
4057
|
"postToolUse",
|
|
4058
4058
|
"beforeSubmitPrompt",
|
|
4059
|
-
"stop"
|
|
4059
|
+
"stop",
|
|
4060
|
+
"permissionRequest"
|
|
4060
4061
|
];
|
|
4061
4062
|
var hooksRecordSchema = import_mini17.z.record(import_mini17.z.string(), import_mini17.z.array(HookDefinitionSchema));
|
|
4062
4063
|
var HooksConfigSchema = import_mini17.z.looseObject({
|
|
@@ -4173,7 +4174,8 @@ var CANONICAL_TO_CODEXCLI_EVENT_NAMES = {
|
|
|
4173
4174
|
preToolUse: "PreToolUse",
|
|
4174
4175
|
postToolUse: "PostToolUse",
|
|
4175
4176
|
beforeSubmitPrompt: "UserPromptSubmit",
|
|
4176
|
-
stop: "Stop"
|
|
4177
|
+
stop: "Stop",
|
|
4178
|
+
permissionRequest: "PermissionRequest"
|
|
4177
4179
|
};
|
|
4178
4180
|
var CODEXCLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
|
|
4179
4181
|
Object.entries(CANONICAL_TO_CODEXCLI_EVENT_NAMES).map(([k, v]) => [v, k])
|
|
@@ -19258,9 +19260,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19258
19260
|
}
|
|
19259
19261
|
toRulesyncRule() {
|
|
19260
19262
|
let globs;
|
|
19261
|
-
if (this.
|
|
19262
|
-
globs = ["**/*"];
|
|
19263
|
-
} else if (this.frontmatter.applyTo) {
|
|
19263
|
+
if (this.frontmatter.applyTo) {
|
|
19264
19264
|
globs = this.frontmatter.applyTo.split(",").map((g) => g.trim());
|
|
19265
19265
|
}
|
|
19266
19266
|
const rulesyncFrontmatter = {
|
|
@@ -19301,7 +19301,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19301
19301
|
if (root) {
|
|
19302
19302
|
return new _CopilotRule({
|
|
19303
19303
|
baseDir,
|
|
19304
|
-
frontmatter:
|
|
19304
|
+
frontmatter: {},
|
|
19305
19305
|
body,
|
|
19306
19306
|
relativeDirPath: paths.root.relativeDirPath,
|
|
19307
19307
|
relativeFilePath: paths.root.relativeFilePath,
|
|
@@ -19327,12 +19327,14 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19327
19327
|
}
|
|
19328
19328
|
static async fromFile({
|
|
19329
19329
|
baseDir = process.cwd(),
|
|
19330
|
+
relativeDirPath,
|
|
19330
19331
|
relativeFilePath,
|
|
19331
19332
|
validate = true,
|
|
19332
19333
|
global = false
|
|
19333
19334
|
}) {
|
|
19334
19335
|
const paths = this.getSettablePaths({ global });
|
|
19335
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19336
|
+
const isRoot = relativeDirPath ? (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath) : relativeFilePath === paths.root.relativeFilePath;
|
|
19337
|
+
const resolvedRelativeDirPath = relativeDirPath ?? (isRoot ? paths.root.relativeDirPath : paths.nonRoot?.relativeDirPath ?? paths.root.relativeDirPath);
|
|
19336
19338
|
if (isRoot) {
|
|
19337
19339
|
const relativePath2 = (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19338
19340
|
const filePath2 = (0, import_node_path129.join)(baseDir, relativePath2);
|
|
@@ -19350,7 +19352,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19350
19352
|
if (!paths.nonRoot) {
|
|
19351
19353
|
throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
|
|
19352
19354
|
}
|
|
19353
|
-
const relativePath = (0, import_node_path129.join)(
|
|
19355
|
+
const relativePath = (0, import_node_path129.join)(resolvedRelativeDirPath, relativeFilePath);
|
|
19354
19356
|
const filePath = (0, import_node_path129.join)(baseDir, relativePath);
|
|
19355
19357
|
const fileContent = await readFileContent(filePath);
|
|
19356
19358
|
const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
|
|
@@ -19360,7 +19362,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19360
19362
|
}
|
|
19361
19363
|
return new _CopilotRule({
|
|
19362
19364
|
baseDir,
|
|
19363
|
-
relativeDirPath:
|
|
19365
|
+
relativeDirPath: resolvedRelativeDirPath,
|
|
19364
19366
|
relativeFilePath: relativeFilePath.endsWith(".instructions.md") ? relativeFilePath : relativeFilePath.replace(/\.md$/, ".instructions.md"),
|
|
19365
19367
|
frontmatter: result.data,
|
|
19366
19368
|
body: content.trim(),
|
|
@@ -19375,7 +19377,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
19375
19377
|
global = false
|
|
19376
19378
|
}) {
|
|
19377
19379
|
const paths = this.getSettablePaths({ global });
|
|
19378
|
-
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
19380
|
+
const isRoot = (0, import_node_path129.join)(relativeDirPath, relativeFilePath) === (0, import_node_path129.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
|
|
19379
19381
|
return new _CopilotRule({
|
|
19380
19382
|
baseDir,
|
|
19381
19383
|
relativeDirPath,
|
|
@@ -27345,7 +27347,7 @@ async function runGhInstall(logger5, options) {
|
|
|
27345
27347
|
var import_fastmcp = require("fastmcp");
|
|
27346
27348
|
|
|
27347
27349
|
// src/mcp/tools.ts
|
|
27348
|
-
var
|
|
27350
|
+
var import_mini92 = require("zod/mini");
|
|
27349
27351
|
|
|
27350
27352
|
// src/mcp/commands.ts
|
|
27351
27353
|
var import_node_path161 = require("path");
|
|
@@ -27534,16 +27536,118 @@ var commandTools = {
|
|
|
27534
27536
|
}
|
|
27535
27537
|
};
|
|
27536
27538
|
|
|
27537
|
-
// src/mcp/
|
|
27539
|
+
// src/mcp/convert.ts
|
|
27538
27540
|
var import_mini82 = require("zod/mini");
|
|
27539
|
-
var
|
|
27540
|
-
|
|
27541
|
+
var convertOptionsSchema = import_mini82.z.object({
|
|
27542
|
+
from: import_mini82.z.string(),
|
|
27543
|
+
to: import_mini82.z.array(import_mini82.z.string()),
|
|
27541
27544
|
features: import_mini82.z.optional(import_mini82.z.array(import_mini82.z.string())),
|
|
27542
|
-
delete: import_mini82.z.optional(import_mini82.z.boolean()),
|
|
27543
27545
|
global: import_mini82.z.optional(import_mini82.z.boolean()),
|
|
27544
|
-
|
|
27545
|
-
|
|
27546
|
-
|
|
27546
|
+
dryRun: import_mini82.z.optional(import_mini82.z.boolean())
|
|
27547
|
+
});
|
|
27548
|
+
function parseToolTarget2(value, label) {
|
|
27549
|
+
const result = ToolTargetSchema.safeParse(value);
|
|
27550
|
+
if (!result.success) {
|
|
27551
|
+
throw new Error(
|
|
27552
|
+
`Invalid ${label} tool '${value}'. Must be one of: ${ALL_TOOL_TARGETS.join(", ")}`
|
|
27553
|
+
);
|
|
27554
|
+
}
|
|
27555
|
+
return result.data;
|
|
27556
|
+
}
|
|
27557
|
+
async function executeConvert(options) {
|
|
27558
|
+
try {
|
|
27559
|
+
if (!options.from) {
|
|
27560
|
+
return {
|
|
27561
|
+
success: false,
|
|
27562
|
+
error: "from is required. Please specify a source tool to convert from."
|
|
27563
|
+
};
|
|
27564
|
+
}
|
|
27565
|
+
if (!options.to || options.to.length === 0) {
|
|
27566
|
+
return {
|
|
27567
|
+
success: false,
|
|
27568
|
+
error: "to is required and must not be empty. Please specify destination tools."
|
|
27569
|
+
};
|
|
27570
|
+
}
|
|
27571
|
+
const fromTool = parseToolTarget2(options.from, "source");
|
|
27572
|
+
const toToolsRaw = options.to.map((t) => parseToolTarget2(t, "destination"));
|
|
27573
|
+
const toTools = Array.from(new Set(toToolsRaw));
|
|
27574
|
+
if (toTools.includes(fromTool)) {
|
|
27575
|
+
return {
|
|
27576
|
+
success: false,
|
|
27577
|
+
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.`
|
|
27578
|
+
};
|
|
27579
|
+
}
|
|
27580
|
+
const config = await ConfigResolver.resolve({
|
|
27581
|
+
targets: [fromTool, ...toTools],
|
|
27582
|
+
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
27583
|
+
features: options.features ?? ["*"],
|
|
27584
|
+
global: options.global,
|
|
27585
|
+
dryRun: options.dryRun,
|
|
27586
|
+
// Always use default baseDirs (process.cwd()) and configPath
|
|
27587
|
+
// verbose and silent are meaningless in MCP context
|
|
27588
|
+
verbose: false,
|
|
27589
|
+
silent: true
|
|
27590
|
+
});
|
|
27591
|
+
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27592
|
+
const convertResult = await convertFromTool({ config, fromTool, toTools, logger: logger5 });
|
|
27593
|
+
return buildSuccessResponse({ convertResult, config, fromTool, toTools });
|
|
27594
|
+
} catch (error) {
|
|
27595
|
+
return {
|
|
27596
|
+
success: false,
|
|
27597
|
+
error: formatError(error)
|
|
27598
|
+
};
|
|
27599
|
+
}
|
|
27600
|
+
}
|
|
27601
|
+
function buildSuccessResponse(params) {
|
|
27602
|
+
const { convertResult, config, fromTool, toTools } = params;
|
|
27603
|
+
const totalCount = calculateTotalCount(convertResult);
|
|
27604
|
+
return {
|
|
27605
|
+
success: true,
|
|
27606
|
+
result: {
|
|
27607
|
+
rulesCount: convertResult.rulesCount,
|
|
27608
|
+
ignoreCount: convertResult.ignoreCount,
|
|
27609
|
+
mcpCount: convertResult.mcpCount,
|
|
27610
|
+
commandsCount: convertResult.commandsCount,
|
|
27611
|
+
subagentsCount: convertResult.subagentsCount,
|
|
27612
|
+
skillsCount: convertResult.skillsCount,
|
|
27613
|
+
hooksCount: convertResult.hooksCount,
|
|
27614
|
+
permissionsCount: convertResult.permissionsCount,
|
|
27615
|
+
totalCount
|
|
27616
|
+
},
|
|
27617
|
+
config: {
|
|
27618
|
+
from: fromTool,
|
|
27619
|
+
to: toTools,
|
|
27620
|
+
features: config.getFeatures(),
|
|
27621
|
+
global: config.getGlobal(),
|
|
27622
|
+
dryRun: config.isPreviewMode()
|
|
27623
|
+
}
|
|
27624
|
+
};
|
|
27625
|
+
}
|
|
27626
|
+
var convertToolSchemas = {
|
|
27627
|
+
executeConvert: convertOptionsSchema
|
|
27628
|
+
};
|
|
27629
|
+
var convertTools = {
|
|
27630
|
+
executeConvert: {
|
|
27631
|
+
name: "executeConvert",
|
|
27632
|
+
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).",
|
|
27633
|
+
parameters: convertToolSchemas.executeConvert,
|
|
27634
|
+
execute: async (options) => {
|
|
27635
|
+
const result = await executeConvert(options);
|
|
27636
|
+
return JSON.stringify(result, null, 2);
|
|
27637
|
+
}
|
|
27638
|
+
}
|
|
27639
|
+
};
|
|
27640
|
+
|
|
27641
|
+
// src/mcp/generate.ts
|
|
27642
|
+
var import_mini83 = require("zod/mini");
|
|
27643
|
+
var generateOptionsSchema = import_mini83.z.object({
|
|
27644
|
+
targets: import_mini83.z.optional(import_mini83.z.array(import_mini83.z.string())),
|
|
27645
|
+
features: import_mini83.z.optional(import_mini83.z.array(import_mini83.z.string())),
|
|
27646
|
+
delete: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27647
|
+
global: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27648
|
+
simulateCommands: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27649
|
+
simulateSubagents: import_mini83.z.optional(import_mini83.z.boolean()),
|
|
27650
|
+
simulateSkills: import_mini83.z.optional(import_mini83.z.boolean())
|
|
27547
27651
|
});
|
|
27548
27652
|
async function executeGenerate(options = {}) {
|
|
27549
27653
|
try {
|
|
@@ -27571,7 +27675,7 @@ async function executeGenerate(options = {}) {
|
|
|
27571
27675
|
});
|
|
27572
27676
|
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27573
27677
|
const generateResult = await generate({ config, logger: logger5 });
|
|
27574
|
-
return
|
|
27678
|
+
return buildSuccessResponse2({ generateResult, config });
|
|
27575
27679
|
} catch (error) {
|
|
27576
27680
|
return {
|
|
27577
27681
|
success: false,
|
|
@@ -27579,7 +27683,7 @@ async function executeGenerate(options = {}) {
|
|
|
27579
27683
|
};
|
|
27580
27684
|
}
|
|
27581
27685
|
}
|
|
27582
|
-
function
|
|
27686
|
+
function buildSuccessResponse2(params) {
|
|
27583
27687
|
const { generateResult, config } = params;
|
|
27584
27688
|
const totalCount = calculateTotalCount(generateResult);
|
|
27585
27689
|
return {
|
|
@@ -27623,7 +27727,7 @@ var generateTools = {
|
|
|
27623
27727
|
|
|
27624
27728
|
// src/mcp/hooks.ts
|
|
27625
27729
|
var import_node_path162 = require("path");
|
|
27626
|
-
var
|
|
27730
|
+
var import_mini84 = require("zod/mini");
|
|
27627
27731
|
var maxHooksSizeBytes = 1024 * 1024;
|
|
27628
27732
|
async function getHooksFile() {
|
|
27629
27733
|
try {
|
|
@@ -27712,11 +27816,11 @@ async function deleteHooksFile() {
|
|
|
27712
27816
|
}
|
|
27713
27817
|
}
|
|
27714
27818
|
var hooksToolSchemas = {
|
|
27715
|
-
getHooksFile:
|
|
27716
|
-
putHooksFile:
|
|
27717
|
-
content:
|
|
27819
|
+
getHooksFile: import_mini84.z.object({}),
|
|
27820
|
+
putHooksFile: import_mini84.z.object({
|
|
27821
|
+
content: import_mini84.z.string()
|
|
27718
27822
|
}),
|
|
27719
|
-
deleteHooksFile:
|
|
27823
|
+
deleteHooksFile: import_mini84.z.object({})
|
|
27720
27824
|
};
|
|
27721
27825
|
var hooksTools = {
|
|
27722
27826
|
getHooksFile: {
|
|
@@ -27750,7 +27854,7 @@ var hooksTools = {
|
|
|
27750
27854
|
|
|
27751
27855
|
// src/mcp/ignore.ts
|
|
27752
27856
|
var import_node_path163 = require("path");
|
|
27753
|
-
var
|
|
27857
|
+
var import_mini85 = require("zod/mini");
|
|
27754
27858
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
27755
27859
|
async function getIgnoreFile() {
|
|
27756
27860
|
const ignoreFilePath = (0, import_node_path163.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
@@ -27813,11 +27917,11 @@ async function deleteIgnoreFile() {
|
|
|
27813
27917
|
}
|
|
27814
27918
|
}
|
|
27815
27919
|
var ignoreToolSchemas = {
|
|
27816
|
-
getIgnoreFile:
|
|
27817
|
-
putIgnoreFile:
|
|
27818
|
-
content:
|
|
27920
|
+
getIgnoreFile: import_mini85.z.object({}),
|
|
27921
|
+
putIgnoreFile: import_mini85.z.object({
|
|
27922
|
+
content: import_mini85.z.string()
|
|
27819
27923
|
}),
|
|
27820
|
-
deleteIgnoreFile:
|
|
27924
|
+
deleteIgnoreFile: import_mini85.z.object({})
|
|
27821
27925
|
};
|
|
27822
27926
|
var ignoreTools = {
|
|
27823
27927
|
getIgnoreFile: {
|
|
@@ -27850,11 +27954,11 @@ var ignoreTools = {
|
|
|
27850
27954
|
};
|
|
27851
27955
|
|
|
27852
27956
|
// src/mcp/import.ts
|
|
27853
|
-
var
|
|
27854
|
-
var importOptionsSchema =
|
|
27855
|
-
target:
|
|
27856
|
-
features:
|
|
27857
|
-
global:
|
|
27957
|
+
var import_mini86 = require("zod/mini");
|
|
27958
|
+
var importOptionsSchema = import_mini86.z.object({
|
|
27959
|
+
target: import_mini86.z.string(),
|
|
27960
|
+
features: import_mini86.z.optional(import_mini86.z.array(import_mini86.z.string())),
|
|
27961
|
+
global: import_mini86.z.optional(import_mini86.z.boolean())
|
|
27858
27962
|
});
|
|
27859
27963
|
async function executeImport(options) {
|
|
27860
27964
|
try {
|
|
@@ -27878,7 +27982,7 @@ async function executeImport(options) {
|
|
|
27878
27982
|
const tool = config.getTargets()[0];
|
|
27879
27983
|
const logger5 = new ConsoleLogger({ verbose: false, silent: true });
|
|
27880
27984
|
const importResult = await importFromTool({ config, tool, logger: logger5 });
|
|
27881
|
-
return
|
|
27985
|
+
return buildSuccessResponse3({ importResult, config, tool });
|
|
27882
27986
|
} catch (error) {
|
|
27883
27987
|
return {
|
|
27884
27988
|
success: false,
|
|
@@ -27886,7 +27990,7 @@ async function executeImport(options) {
|
|
|
27886
27990
|
};
|
|
27887
27991
|
}
|
|
27888
27992
|
}
|
|
27889
|
-
function
|
|
27993
|
+
function buildSuccessResponse3(params) {
|
|
27890
27994
|
const { importResult, config, tool } = params;
|
|
27891
27995
|
const totalCount = calculateTotalCount(importResult);
|
|
27892
27996
|
return {
|
|
@@ -27926,7 +28030,7 @@ var importTools = {
|
|
|
27926
28030
|
|
|
27927
28031
|
// src/mcp/mcp.ts
|
|
27928
28032
|
var import_node_path164 = require("path");
|
|
27929
|
-
var
|
|
28033
|
+
var import_mini87 = require("zod/mini");
|
|
27930
28034
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
27931
28035
|
async function getMcpFile() {
|
|
27932
28036
|
try {
|
|
@@ -28024,11 +28128,11 @@ async function deleteMcpFile() {
|
|
|
28024
28128
|
}
|
|
28025
28129
|
}
|
|
28026
28130
|
var mcpToolSchemas = {
|
|
28027
|
-
getMcpFile:
|
|
28028
|
-
putMcpFile:
|
|
28029
|
-
content:
|
|
28131
|
+
getMcpFile: import_mini87.z.object({}),
|
|
28132
|
+
putMcpFile: import_mini87.z.object({
|
|
28133
|
+
content: import_mini87.z.string()
|
|
28030
28134
|
}),
|
|
28031
|
-
deleteMcpFile:
|
|
28135
|
+
deleteMcpFile: import_mini87.z.object({})
|
|
28032
28136
|
};
|
|
28033
28137
|
var mcpTools = {
|
|
28034
28138
|
getMcpFile: {
|
|
@@ -28062,7 +28166,7 @@ var mcpTools = {
|
|
|
28062
28166
|
|
|
28063
28167
|
// src/mcp/permissions.ts
|
|
28064
28168
|
var import_node_path165 = require("path");
|
|
28065
|
-
var
|
|
28169
|
+
var import_mini88 = require("zod/mini");
|
|
28066
28170
|
var maxPermissionsSizeBytes = 1024 * 1024;
|
|
28067
28171
|
async function getPermissionsFile() {
|
|
28068
28172
|
try {
|
|
@@ -28151,11 +28255,11 @@ async function deletePermissionsFile() {
|
|
|
28151
28255
|
}
|
|
28152
28256
|
}
|
|
28153
28257
|
var permissionsToolSchemas = {
|
|
28154
|
-
getPermissionsFile:
|
|
28155
|
-
putPermissionsFile:
|
|
28156
|
-
content:
|
|
28258
|
+
getPermissionsFile: import_mini88.z.object({}),
|
|
28259
|
+
putPermissionsFile: import_mini88.z.object({
|
|
28260
|
+
content: import_mini88.z.string()
|
|
28157
28261
|
}),
|
|
28158
|
-
deletePermissionsFile:
|
|
28262
|
+
deletePermissionsFile: import_mini88.z.object({})
|
|
28159
28263
|
};
|
|
28160
28264
|
var permissionsTools = {
|
|
28161
28265
|
getPermissionsFile: {
|
|
@@ -28189,7 +28293,7 @@ var permissionsTools = {
|
|
|
28189
28293
|
|
|
28190
28294
|
// src/mcp/rules.ts
|
|
28191
28295
|
var import_node_path166 = require("path");
|
|
28192
|
-
var
|
|
28296
|
+
var import_mini89 = require("zod/mini");
|
|
28193
28297
|
var logger2 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28194
28298
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
28195
28299
|
var maxRulesCount = 1e3;
|
|
@@ -28313,17 +28417,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
28313
28417
|
}
|
|
28314
28418
|
}
|
|
28315
28419
|
var ruleToolSchemas = {
|
|
28316
|
-
listRules:
|
|
28317
|
-
getRule:
|
|
28318
|
-
relativePathFromCwd:
|
|
28420
|
+
listRules: import_mini89.z.object({}),
|
|
28421
|
+
getRule: import_mini89.z.object({
|
|
28422
|
+
relativePathFromCwd: import_mini89.z.string()
|
|
28319
28423
|
}),
|
|
28320
|
-
putRule:
|
|
28321
|
-
relativePathFromCwd:
|
|
28424
|
+
putRule: import_mini89.z.object({
|
|
28425
|
+
relativePathFromCwd: import_mini89.z.string(),
|
|
28322
28426
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
28323
|
-
body:
|
|
28427
|
+
body: import_mini89.z.string()
|
|
28324
28428
|
}),
|
|
28325
|
-
deleteRule:
|
|
28326
|
-
relativePathFromCwd:
|
|
28429
|
+
deleteRule: import_mini89.z.object({
|
|
28430
|
+
relativePathFromCwd: import_mini89.z.string()
|
|
28327
28431
|
})
|
|
28328
28432
|
};
|
|
28329
28433
|
var ruleTools = {
|
|
@@ -28372,7 +28476,7 @@ var ruleTools = {
|
|
|
28372
28476
|
|
|
28373
28477
|
// src/mcp/skills.ts
|
|
28374
28478
|
var import_node_path167 = require("path");
|
|
28375
|
-
var
|
|
28479
|
+
var import_mini90 = require("zod/mini");
|
|
28376
28480
|
var logger3 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28377
28481
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
28378
28482
|
var maxSkillsCount = 1e3;
|
|
@@ -28545,23 +28649,23 @@ async function deleteSkill({
|
|
|
28545
28649
|
);
|
|
28546
28650
|
}
|
|
28547
28651
|
}
|
|
28548
|
-
var McpSkillFileSchema =
|
|
28549
|
-
name:
|
|
28550
|
-
body:
|
|
28652
|
+
var McpSkillFileSchema = import_mini90.z.object({
|
|
28653
|
+
name: import_mini90.z.string(),
|
|
28654
|
+
body: import_mini90.z.string()
|
|
28551
28655
|
});
|
|
28552
28656
|
var skillToolSchemas = {
|
|
28553
|
-
listSkills:
|
|
28554
|
-
getSkill:
|
|
28555
|
-
relativeDirPathFromCwd:
|
|
28657
|
+
listSkills: import_mini90.z.object({}),
|
|
28658
|
+
getSkill: import_mini90.z.object({
|
|
28659
|
+
relativeDirPathFromCwd: import_mini90.z.string()
|
|
28556
28660
|
}),
|
|
28557
|
-
putSkill:
|
|
28558
|
-
relativeDirPathFromCwd:
|
|
28661
|
+
putSkill: import_mini90.z.object({
|
|
28662
|
+
relativeDirPathFromCwd: import_mini90.z.string(),
|
|
28559
28663
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
28560
|
-
body:
|
|
28561
|
-
otherFiles:
|
|
28664
|
+
body: import_mini90.z.string(),
|
|
28665
|
+
otherFiles: import_mini90.z.optional(import_mini90.z.array(McpSkillFileSchema))
|
|
28562
28666
|
}),
|
|
28563
|
-
deleteSkill:
|
|
28564
|
-
relativeDirPathFromCwd:
|
|
28667
|
+
deleteSkill: import_mini90.z.object({
|
|
28668
|
+
relativeDirPathFromCwd: import_mini90.z.string()
|
|
28565
28669
|
})
|
|
28566
28670
|
};
|
|
28567
28671
|
var skillTools = {
|
|
@@ -28611,7 +28715,7 @@ var skillTools = {
|
|
|
28611
28715
|
|
|
28612
28716
|
// src/mcp/subagents.ts
|
|
28613
28717
|
var import_node_path168 = require("path");
|
|
28614
|
-
var
|
|
28718
|
+
var import_mini91 = require("zod/mini");
|
|
28615
28719
|
var logger4 = new ConsoleLogger({ verbose: false, silent: true });
|
|
28616
28720
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
28617
28721
|
var maxSubagentsCount = 1e3;
|
|
@@ -28740,17 +28844,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
28740
28844
|
}
|
|
28741
28845
|
}
|
|
28742
28846
|
var subagentToolSchemas = {
|
|
28743
|
-
listSubagents:
|
|
28744
|
-
getSubagent:
|
|
28745
|
-
relativePathFromCwd:
|
|
28847
|
+
listSubagents: import_mini91.z.object({}),
|
|
28848
|
+
getSubagent: import_mini91.z.object({
|
|
28849
|
+
relativePathFromCwd: import_mini91.z.string()
|
|
28746
28850
|
}),
|
|
28747
|
-
putSubagent:
|
|
28748
|
-
relativePathFromCwd:
|
|
28851
|
+
putSubagent: import_mini91.z.object({
|
|
28852
|
+
relativePathFromCwd: import_mini91.z.string(),
|
|
28749
28853
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
28750
|
-
body:
|
|
28854
|
+
body: import_mini91.z.string()
|
|
28751
28855
|
}),
|
|
28752
|
-
deleteSubagent:
|
|
28753
|
-
relativePathFromCwd:
|
|
28856
|
+
deleteSubagent: import_mini91.z.object({
|
|
28857
|
+
relativePathFromCwd: import_mini91.z.string()
|
|
28754
28858
|
})
|
|
28755
28859
|
};
|
|
28756
28860
|
var subagentTools = {
|
|
@@ -28798,7 +28902,7 @@ var subagentTools = {
|
|
|
28798
28902
|
};
|
|
28799
28903
|
|
|
28800
28904
|
// src/mcp/tools.ts
|
|
28801
|
-
var rulesyncFeatureSchema =
|
|
28905
|
+
var rulesyncFeatureSchema = import_mini92.z.enum([
|
|
28802
28906
|
"rule",
|
|
28803
28907
|
"command",
|
|
28804
28908
|
"subagent",
|
|
@@ -28808,23 +28912,25 @@ var rulesyncFeatureSchema = import_mini91.z.enum([
|
|
|
28808
28912
|
"permissions",
|
|
28809
28913
|
"hooks",
|
|
28810
28914
|
"generate",
|
|
28811
|
-
"import"
|
|
28915
|
+
"import",
|
|
28916
|
+
"convert"
|
|
28812
28917
|
]);
|
|
28813
|
-
var rulesyncOperationSchema =
|
|
28814
|
-
var skillFileSchema =
|
|
28815
|
-
name:
|
|
28816
|
-
body:
|
|
28918
|
+
var rulesyncOperationSchema = import_mini92.z.enum(["list", "get", "put", "delete", "run"]);
|
|
28919
|
+
var skillFileSchema = import_mini92.z.object({
|
|
28920
|
+
name: import_mini92.z.string(),
|
|
28921
|
+
body: import_mini92.z.string()
|
|
28817
28922
|
});
|
|
28818
|
-
var rulesyncToolSchema =
|
|
28923
|
+
var rulesyncToolSchema = import_mini92.z.object({
|
|
28819
28924
|
feature: rulesyncFeatureSchema,
|
|
28820
28925
|
operation: rulesyncOperationSchema,
|
|
28821
|
-
targetPathFromCwd:
|
|
28822
|
-
frontmatter:
|
|
28823
|
-
body:
|
|
28824
|
-
otherFiles:
|
|
28825
|
-
content:
|
|
28826
|
-
generateOptions:
|
|
28827
|
-
importOptions:
|
|
28926
|
+
targetPathFromCwd: import_mini92.z.optional(import_mini92.z.string()),
|
|
28927
|
+
frontmatter: import_mini92.z.optional(import_mini92.z.unknown()),
|
|
28928
|
+
body: import_mini92.z.optional(import_mini92.z.string()),
|
|
28929
|
+
otherFiles: import_mini92.z.optional(import_mini92.z.array(skillFileSchema)),
|
|
28930
|
+
content: import_mini92.z.optional(import_mini92.z.string()),
|
|
28931
|
+
generateOptions: import_mini92.z.optional(generateOptionsSchema),
|
|
28932
|
+
importOptions: import_mini92.z.optional(importOptionsSchema),
|
|
28933
|
+
convertOptions: import_mini92.z.optional(convertOptionsSchema)
|
|
28828
28934
|
});
|
|
28829
28935
|
var supportedOperationsByFeature = {
|
|
28830
28936
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -28836,7 +28942,8 @@ var supportedOperationsByFeature = {
|
|
|
28836
28942
|
permissions: ["get", "put", "delete"],
|
|
28837
28943
|
hooks: ["get", "put", "delete"],
|
|
28838
28944
|
generate: ["run"],
|
|
28839
|
-
import: ["run"]
|
|
28945
|
+
import: ["run"],
|
|
28946
|
+
convert: ["run"]
|
|
28840
28947
|
};
|
|
28841
28948
|
function assertSupported({
|
|
28842
28949
|
feature,
|
|
@@ -28884,7 +28991,7 @@ function ensureBody({ body, feature, operation }) {
|
|
|
28884
28991
|
}
|
|
28885
28992
|
var rulesyncTool = {
|
|
28886
28993
|
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.",
|
|
28994
|
+
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
28995
|
parameters: rulesyncToolSchema,
|
|
28889
28996
|
execute: async (args) => {
|
|
28890
28997
|
const parsed = rulesyncToolSchema.parse(args);
|
|
@@ -29034,6 +29141,12 @@ var rulesyncTool = {
|
|
|
29034
29141
|
}
|
|
29035
29142
|
return importTools.executeImport.execute(parsed.importOptions);
|
|
29036
29143
|
}
|
|
29144
|
+
case "convert": {
|
|
29145
|
+
if (!parsed.convertOptions) {
|
|
29146
|
+
throw new Error("convertOptions is required for convert feature");
|
|
29147
|
+
}
|
|
29148
|
+
return convertTools.executeConvert.execute(parsed.convertOptions);
|
|
29149
|
+
}
|
|
29037
29150
|
default: {
|
|
29038
29151
|
throw new Error(`Unknown feature: ${parsed.feature}`);
|
|
29039
29152
|
}
|
|
@@ -29487,7 +29600,7 @@ function wrapCommand({
|
|
|
29487
29600
|
}
|
|
29488
29601
|
|
|
29489
29602
|
// src/cli/index.ts
|
|
29490
|
-
var getVersion = () => "8.
|
|
29603
|
+
var getVersion = () => "8.12.0";
|
|
29491
29604
|
function wrapCommand2(name, errorCode, handler) {
|
|
29492
29605
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
29493
29606
|
}
|