rulesync 3.23.3 → 3.23.6
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/index.cjs +36 -24
- package/dist/index.js +36 -24
- package/package.json +1 -6
package/dist/index.cjs
CHANGED
|
@@ -186,8 +186,12 @@ async function listDirectoryFiles(dir) {
|
|
|
186
186
|
return [];
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
async function findFilesByGlobs(globs) {
|
|
190
|
-
|
|
189
|
+
async function findFilesByGlobs(globs, options = {}) {
|
|
190
|
+
const items = (0, import_node_fs.globSync)(globs, { withFileTypes: true });
|
|
191
|
+
if (!options.fileOnly) {
|
|
192
|
+
return items.map((item) => (0, import_node_path.join)(item.parentPath, item.name));
|
|
193
|
+
}
|
|
194
|
+
return items.filter((item) => item.isFile()).map((item) => (0, import_node_path.join)(item.parentPath, item.name));
|
|
191
195
|
}
|
|
192
196
|
async function removeFile(filepath) {
|
|
193
197
|
logger.debug(`Removing file: ${filepath}`);
|
|
@@ -343,7 +347,7 @@ var Config = class {
|
|
|
343
347
|
};
|
|
344
348
|
|
|
345
349
|
// src/config/config-resolver.ts
|
|
346
|
-
var
|
|
350
|
+
var getDefaults = () => ({
|
|
347
351
|
targets: ["agentsmd"],
|
|
348
352
|
features: ["rules"],
|
|
349
353
|
verbose: false,
|
|
@@ -357,7 +361,7 @@ var defaults = {
|
|
|
357
361
|
experimentalGlobal: false,
|
|
358
362
|
experimentalSimulateCommands: false,
|
|
359
363
|
experimentalSimulateSubagents: false
|
|
360
|
-
};
|
|
364
|
+
});
|
|
361
365
|
var ConfigResolver = class {
|
|
362
366
|
static async resolve({
|
|
363
367
|
targets,
|
|
@@ -365,7 +369,7 @@ var ConfigResolver = class {
|
|
|
365
369
|
verbose,
|
|
366
370
|
delete: isDelete,
|
|
367
371
|
baseDirs,
|
|
368
|
-
configPath =
|
|
372
|
+
configPath = getDefaults().configPath,
|
|
369
373
|
global,
|
|
370
374
|
simulatedCommands,
|
|
371
375
|
simulatedSubagents,
|
|
@@ -398,22 +402,22 @@ var ConfigResolver = class {
|
|
|
398
402
|
if (deprecatedSubagents !== void 0) {
|
|
399
403
|
warnDeprecatedOptions({ experimentalSimulateSubagents: deprecatedSubagents });
|
|
400
404
|
}
|
|
401
|
-
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ??
|
|
402
|
-
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ??
|
|
403
|
-
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ??
|
|
405
|
+
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ?? getDefaults().global;
|
|
406
|
+
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ?? getDefaults().simulatedCommands;
|
|
407
|
+
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ?? getDefaults().simulatedSubagents;
|
|
404
408
|
const configParams = {
|
|
405
|
-
targets: targets ?? configByFile.targets ??
|
|
406
|
-
features: features ?? configByFile.features ??
|
|
407
|
-
verbose: verbose ?? configByFile.verbose ??
|
|
408
|
-
delete: isDelete ?? configByFile.delete ??
|
|
409
|
+
targets: targets ?? configByFile.targets ?? getDefaults().targets,
|
|
410
|
+
features: features ?? configByFile.features ?? getDefaults().features,
|
|
411
|
+
verbose: verbose ?? configByFile.verbose ?? getDefaults().verbose,
|
|
412
|
+
delete: isDelete ?? configByFile.delete ?? getDefaults().delete,
|
|
409
413
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
410
|
-
baseDirs: baseDirs ?? configByFile.baseDirs ??
|
|
414
|
+
baseDirs: baseDirs ?? configByFile.baseDirs ?? getDefaults().baseDirs,
|
|
411
415
|
global: resolvedGlobal
|
|
412
416
|
}),
|
|
413
417
|
global: resolvedGlobal,
|
|
414
418
|
simulatedCommands: resolvedSimulatedCommands,
|
|
415
419
|
simulatedSubagents: resolvedSimulatedSubagents,
|
|
416
|
-
modularMcp: modularMcp ?? configByFile.modularMcp ??
|
|
420
|
+
modularMcp: modularMcp ?? configByFile.modularMcp ?? getDefaults().modularMcp
|
|
417
421
|
};
|
|
418
422
|
return new Config(configParams);
|
|
419
423
|
}
|
|
@@ -2570,7 +2574,12 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2570
2574
|
const toolIgnores = await this.loadToolIgnores();
|
|
2571
2575
|
return toolIgnores;
|
|
2572
2576
|
} catch (error) {
|
|
2573
|
-
|
|
2577
|
+
const errorMessage = `Failed to load tool files: ${formatError(error)}`;
|
|
2578
|
+
if (error instanceof Error && error.message.includes("no such file or directory")) {
|
|
2579
|
+
logger.debug(errorMessage);
|
|
2580
|
+
} else {
|
|
2581
|
+
logger.error(errorMessage);
|
|
2582
|
+
}
|
|
2574
2583
|
return [];
|
|
2575
2584
|
}
|
|
2576
2585
|
}
|
|
@@ -3591,9 +3600,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3591
3600
|
try {
|
|
3592
3601
|
return [await RulesyncMcp.fromFile({ modularMcp: this.modularMcp })];
|
|
3593
3602
|
} catch (error) {
|
|
3594
|
-
logger.error(
|
|
3595
|
-
`Failed to load MCP files for tool target: ${this.toolTarget}: ${formatError(error)}`
|
|
3596
|
-
);
|
|
3603
|
+
logger.error(`Failed to load a Rulesync MCP file: ${formatError(error)}`);
|
|
3597
3604
|
return [];
|
|
3598
3605
|
}
|
|
3599
3606
|
}
|
|
@@ -3687,9 +3694,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3687
3694
|
logger.info(`Successfully loaded ${toolMcps.length} ${this.toolTarget} MCP files`);
|
|
3688
3695
|
return toolMcps;
|
|
3689
3696
|
} catch (error) {
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3697
|
+
const errorMessage = `Failed to load MCP files for tool target: ${this.toolTarget}: ${formatError(error)}`;
|
|
3698
|
+
if (error instanceof Error && error.message.includes("no such file or directory")) {
|
|
3699
|
+
logger.debug(errorMessage);
|
|
3700
|
+
} else {
|
|
3701
|
+
logger.error(errorMessage);
|
|
3702
|
+
}
|
|
3693
3703
|
return [];
|
|
3694
3704
|
}
|
|
3695
3705
|
}
|
|
@@ -8007,10 +8017,11 @@ var import_node_path71 = require("path");
|
|
|
8007
8017
|
var import_mini27 = require("zod/mini");
|
|
8008
8018
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
8009
8019
|
async function getMcpFile() {
|
|
8020
|
+
const config = await ConfigResolver.resolve({});
|
|
8010
8021
|
try {
|
|
8011
8022
|
const rulesyncMcp = await RulesyncMcp.fromFile({
|
|
8012
8023
|
validate: true,
|
|
8013
|
-
modularMcp:
|
|
8024
|
+
modularMcp: config.getModularMcp()
|
|
8014
8025
|
});
|
|
8015
8026
|
const relativePathFromCwd = (0, import_node_path71.join)(
|
|
8016
8027
|
rulesyncMcp.getRelativeDirPath(),
|
|
@@ -8039,6 +8050,7 @@ async function putMcpFile({ content }) {
|
|
|
8039
8050
|
cause: error
|
|
8040
8051
|
});
|
|
8041
8052
|
}
|
|
8053
|
+
const config = await ConfigResolver.resolve({});
|
|
8042
8054
|
try {
|
|
8043
8055
|
const baseDir = process.cwd();
|
|
8044
8056
|
const paths = RulesyncMcp.getSettablePaths();
|
|
@@ -8051,7 +8063,7 @@ async function putMcpFile({ content }) {
|
|
|
8051
8063
|
relativeFilePath,
|
|
8052
8064
|
fileContent: content,
|
|
8053
8065
|
validate: true,
|
|
8054
|
-
modularMcp:
|
|
8066
|
+
modularMcp: config.getModularMcp()
|
|
8055
8067
|
});
|
|
8056
8068
|
await ensureDir((0, import_node_path71.join)(baseDir, relativeDirPath));
|
|
8057
8069
|
await writeFileContent(fullPath, content);
|
|
@@ -8522,7 +8534,7 @@ async function mcpCommand({ version }) {
|
|
|
8522
8534
|
}
|
|
8523
8535
|
|
|
8524
8536
|
// src/cli/index.ts
|
|
8525
|
-
var getVersion = () => "3.23.
|
|
8537
|
+
var getVersion = () => "3.23.6";
|
|
8526
8538
|
var main = async () => {
|
|
8527
8539
|
const program = new import_commander.Command();
|
|
8528
8540
|
const version = getVersion();
|
package/dist/index.js
CHANGED
|
@@ -163,8 +163,12 @@ async function listDirectoryFiles(dir) {
|
|
|
163
163
|
return [];
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
async function findFilesByGlobs(globs) {
|
|
167
|
-
|
|
166
|
+
async function findFilesByGlobs(globs, options = {}) {
|
|
167
|
+
const items = globSync(globs, { withFileTypes: true });
|
|
168
|
+
if (!options.fileOnly) {
|
|
169
|
+
return items.map((item) => join(item.parentPath, item.name));
|
|
170
|
+
}
|
|
171
|
+
return items.filter((item) => item.isFile()).map((item) => join(item.parentPath, item.name));
|
|
168
172
|
}
|
|
169
173
|
async function removeFile(filepath) {
|
|
170
174
|
logger.debug(`Removing file: ${filepath}`);
|
|
@@ -320,7 +324,7 @@ var Config = class {
|
|
|
320
324
|
};
|
|
321
325
|
|
|
322
326
|
// src/config/config-resolver.ts
|
|
323
|
-
var
|
|
327
|
+
var getDefaults = () => ({
|
|
324
328
|
targets: ["agentsmd"],
|
|
325
329
|
features: ["rules"],
|
|
326
330
|
verbose: false,
|
|
@@ -334,7 +338,7 @@ var defaults = {
|
|
|
334
338
|
experimentalGlobal: false,
|
|
335
339
|
experimentalSimulateCommands: false,
|
|
336
340
|
experimentalSimulateSubagents: false
|
|
337
|
-
};
|
|
341
|
+
});
|
|
338
342
|
var ConfigResolver = class {
|
|
339
343
|
static async resolve({
|
|
340
344
|
targets,
|
|
@@ -342,7 +346,7 @@ var ConfigResolver = class {
|
|
|
342
346
|
verbose,
|
|
343
347
|
delete: isDelete,
|
|
344
348
|
baseDirs,
|
|
345
|
-
configPath =
|
|
349
|
+
configPath = getDefaults().configPath,
|
|
346
350
|
global,
|
|
347
351
|
simulatedCommands,
|
|
348
352
|
simulatedSubagents,
|
|
@@ -375,22 +379,22 @@ var ConfigResolver = class {
|
|
|
375
379
|
if (deprecatedSubagents !== void 0) {
|
|
376
380
|
warnDeprecatedOptions({ experimentalSimulateSubagents: deprecatedSubagents });
|
|
377
381
|
}
|
|
378
|
-
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ??
|
|
379
|
-
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ??
|
|
380
|
-
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ??
|
|
382
|
+
const resolvedGlobal = global ?? configByFile.global ?? experimentalGlobal ?? configByFile.experimentalGlobal ?? getDefaults().global;
|
|
383
|
+
const resolvedSimulatedCommands = simulatedCommands ?? configByFile.simulatedCommands ?? experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands ?? getDefaults().simulatedCommands;
|
|
384
|
+
const resolvedSimulatedSubagents = simulatedSubagents ?? configByFile.simulatedSubagents ?? experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents ?? getDefaults().simulatedSubagents;
|
|
381
385
|
const configParams = {
|
|
382
|
-
targets: targets ?? configByFile.targets ??
|
|
383
|
-
features: features ?? configByFile.features ??
|
|
384
|
-
verbose: verbose ?? configByFile.verbose ??
|
|
385
|
-
delete: isDelete ?? configByFile.delete ??
|
|
386
|
+
targets: targets ?? configByFile.targets ?? getDefaults().targets,
|
|
387
|
+
features: features ?? configByFile.features ?? getDefaults().features,
|
|
388
|
+
verbose: verbose ?? configByFile.verbose ?? getDefaults().verbose,
|
|
389
|
+
delete: isDelete ?? configByFile.delete ?? getDefaults().delete,
|
|
386
390
|
baseDirs: getBaseDirsInLightOfGlobal({
|
|
387
|
-
baseDirs: baseDirs ?? configByFile.baseDirs ??
|
|
391
|
+
baseDirs: baseDirs ?? configByFile.baseDirs ?? getDefaults().baseDirs,
|
|
388
392
|
global: resolvedGlobal
|
|
389
393
|
}),
|
|
390
394
|
global: resolvedGlobal,
|
|
391
395
|
simulatedCommands: resolvedSimulatedCommands,
|
|
392
396
|
simulatedSubagents: resolvedSimulatedSubagents,
|
|
393
|
-
modularMcp: modularMcp ?? configByFile.modularMcp ??
|
|
397
|
+
modularMcp: modularMcp ?? configByFile.modularMcp ?? getDefaults().modularMcp
|
|
394
398
|
};
|
|
395
399
|
return new Config(configParams);
|
|
396
400
|
}
|
|
@@ -2547,7 +2551,12 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2547
2551
|
const toolIgnores = await this.loadToolIgnores();
|
|
2548
2552
|
return toolIgnores;
|
|
2549
2553
|
} catch (error) {
|
|
2550
|
-
|
|
2554
|
+
const errorMessage = `Failed to load tool files: ${formatError(error)}`;
|
|
2555
|
+
if (error instanceof Error && error.message.includes("no such file or directory")) {
|
|
2556
|
+
logger.debug(errorMessage);
|
|
2557
|
+
} else {
|
|
2558
|
+
logger.error(errorMessage);
|
|
2559
|
+
}
|
|
2551
2560
|
return [];
|
|
2552
2561
|
}
|
|
2553
2562
|
}
|
|
@@ -3568,9 +3577,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3568
3577
|
try {
|
|
3569
3578
|
return [await RulesyncMcp.fromFile({ modularMcp: this.modularMcp })];
|
|
3570
3579
|
} catch (error) {
|
|
3571
|
-
logger.error(
|
|
3572
|
-
`Failed to load MCP files for tool target: ${this.toolTarget}: ${formatError(error)}`
|
|
3573
|
-
);
|
|
3580
|
+
logger.error(`Failed to load a Rulesync MCP file: ${formatError(error)}`);
|
|
3574
3581
|
return [];
|
|
3575
3582
|
}
|
|
3576
3583
|
}
|
|
@@ -3664,9 +3671,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3664
3671
|
logger.info(`Successfully loaded ${toolMcps.length} ${this.toolTarget} MCP files`);
|
|
3665
3672
|
return toolMcps;
|
|
3666
3673
|
} catch (error) {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3674
|
+
const errorMessage = `Failed to load MCP files for tool target: ${this.toolTarget}: ${formatError(error)}`;
|
|
3675
|
+
if (error instanceof Error && error.message.includes("no such file or directory")) {
|
|
3676
|
+
logger.debug(errorMessage);
|
|
3677
|
+
} else {
|
|
3678
|
+
logger.error(errorMessage);
|
|
3679
|
+
}
|
|
3670
3680
|
return [];
|
|
3671
3681
|
}
|
|
3672
3682
|
}
|
|
@@ -7984,10 +7994,11 @@ import { join as join69 } from "path";
|
|
|
7984
7994
|
import { z as z27 } from "zod/mini";
|
|
7985
7995
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
7986
7996
|
async function getMcpFile() {
|
|
7997
|
+
const config = await ConfigResolver.resolve({});
|
|
7987
7998
|
try {
|
|
7988
7999
|
const rulesyncMcp = await RulesyncMcp.fromFile({
|
|
7989
8000
|
validate: true,
|
|
7990
|
-
modularMcp:
|
|
8001
|
+
modularMcp: config.getModularMcp()
|
|
7991
8002
|
});
|
|
7992
8003
|
const relativePathFromCwd = join69(
|
|
7993
8004
|
rulesyncMcp.getRelativeDirPath(),
|
|
@@ -8016,6 +8027,7 @@ async function putMcpFile({ content }) {
|
|
|
8016
8027
|
cause: error
|
|
8017
8028
|
});
|
|
8018
8029
|
}
|
|
8030
|
+
const config = await ConfigResolver.resolve({});
|
|
8019
8031
|
try {
|
|
8020
8032
|
const baseDir = process.cwd();
|
|
8021
8033
|
const paths = RulesyncMcp.getSettablePaths();
|
|
@@ -8028,7 +8040,7 @@ async function putMcpFile({ content }) {
|
|
|
8028
8040
|
relativeFilePath,
|
|
8029
8041
|
fileContent: content,
|
|
8030
8042
|
validate: true,
|
|
8031
|
-
modularMcp:
|
|
8043
|
+
modularMcp: config.getModularMcp()
|
|
8032
8044
|
});
|
|
8033
8045
|
await ensureDir(join69(baseDir, relativeDirPath));
|
|
8034
8046
|
await writeFileContent(fullPath, content);
|
|
@@ -8499,7 +8511,7 @@ async function mcpCommand({ version }) {
|
|
|
8499
8511
|
}
|
|
8500
8512
|
|
|
8501
8513
|
// src/cli/index.ts
|
|
8502
|
-
var getVersion = () => "3.23.
|
|
8514
|
+
var getVersion = () => "3.23.6";
|
|
8503
8515
|
var main = async () => {
|
|
8504
8516
|
const program = new Command();
|
|
8505
8517
|
const version = getVersion();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulesync",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.6",
|
|
4
4
|
"description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "1.21.2",
|
|
40
|
-
"chokidar": "4.0.3",
|
|
41
40
|
"commander": "14.0.2",
|
|
42
41
|
"consola": "3.4.2",
|
|
43
42
|
"es-toolkit": "1.41.0",
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
"gray-matter": "4.0.3",
|
|
47
46
|
"js-yaml": "4.1.1",
|
|
48
47
|
"jsonc-parser": "3.3.1",
|
|
49
|
-
"micromatch": "4.0.8",
|
|
50
48
|
"smol-toml": "1.5.2",
|
|
51
49
|
"zod": "4.1.12"
|
|
52
50
|
},
|
|
@@ -57,7 +55,6 @@
|
|
|
57
55
|
"@secretlint/secretlint-rule-preset-recommend": "11.2.5",
|
|
58
56
|
"@tsconfig/node24": "24.0.2",
|
|
59
57
|
"@types/js-yaml": "4.0.9",
|
|
60
|
-
"@types/micromatch": "4.0.10",
|
|
61
58
|
"@types/node": "24.10.1",
|
|
62
59
|
"@typescript/native-preview": "7.0.0-dev.20251114.1",
|
|
63
60
|
"@vitest/coverage-v8": "4.0.9",
|
|
@@ -70,9 +67,7 @@
|
|
|
70
67
|
"eslint-plugin-zod-import": "0.3.0",
|
|
71
68
|
"knip": "5.69.1",
|
|
72
69
|
"lint-staged": "16.2.6",
|
|
73
|
-
"o3-search-mcp": "0.0.9",
|
|
74
70
|
"oxlint": "1.28.0",
|
|
75
|
-
"p-queue": "9.0.0",
|
|
76
71
|
"secretlint": "11.2.5",
|
|
77
72
|
"simple-git-hooks": "2.13.1",
|
|
78
73
|
"sort-package-json": "3.4.0",
|