rulesync 3.23.3 → 3.23.5
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 +23 -17
- package/dist/index.js +23 -17
- 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
|
}
|
|
@@ -8007,10 +8011,11 @@ var import_node_path71 = require("path");
|
|
|
8007
8011
|
var import_mini27 = require("zod/mini");
|
|
8008
8012
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
8009
8013
|
async function getMcpFile() {
|
|
8014
|
+
const config = await ConfigResolver.resolve({});
|
|
8010
8015
|
try {
|
|
8011
8016
|
const rulesyncMcp = await RulesyncMcp.fromFile({
|
|
8012
8017
|
validate: true,
|
|
8013
|
-
modularMcp:
|
|
8018
|
+
modularMcp: config.getModularMcp()
|
|
8014
8019
|
});
|
|
8015
8020
|
const relativePathFromCwd = (0, import_node_path71.join)(
|
|
8016
8021
|
rulesyncMcp.getRelativeDirPath(),
|
|
@@ -8039,6 +8044,7 @@ async function putMcpFile({ content }) {
|
|
|
8039
8044
|
cause: error
|
|
8040
8045
|
});
|
|
8041
8046
|
}
|
|
8047
|
+
const config = await ConfigResolver.resolve({});
|
|
8042
8048
|
try {
|
|
8043
8049
|
const baseDir = process.cwd();
|
|
8044
8050
|
const paths = RulesyncMcp.getSettablePaths();
|
|
@@ -8051,7 +8057,7 @@ async function putMcpFile({ content }) {
|
|
|
8051
8057
|
relativeFilePath,
|
|
8052
8058
|
fileContent: content,
|
|
8053
8059
|
validate: true,
|
|
8054
|
-
modularMcp:
|
|
8060
|
+
modularMcp: config.getModularMcp()
|
|
8055
8061
|
});
|
|
8056
8062
|
await ensureDir((0, import_node_path71.join)(baseDir, relativeDirPath));
|
|
8057
8063
|
await writeFileContent(fullPath, content);
|
|
@@ -8522,7 +8528,7 @@ async function mcpCommand({ version }) {
|
|
|
8522
8528
|
}
|
|
8523
8529
|
|
|
8524
8530
|
// src/cli/index.ts
|
|
8525
|
-
var getVersion = () => "3.23.
|
|
8531
|
+
var getVersion = () => "3.23.5";
|
|
8526
8532
|
var main = async () => {
|
|
8527
8533
|
const program = new import_commander.Command();
|
|
8528
8534
|
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
|
}
|
|
@@ -7984,10 +7988,11 @@ import { join as join69 } from "path";
|
|
|
7984
7988
|
import { z as z27 } from "zod/mini";
|
|
7985
7989
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
7986
7990
|
async function getMcpFile() {
|
|
7991
|
+
const config = await ConfigResolver.resolve({});
|
|
7987
7992
|
try {
|
|
7988
7993
|
const rulesyncMcp = await RulesyncMcp.fromFile({
|
|
7989
7994
|
validate: true,
|
|
7990
|
-
modularMcp:
|
|
7995
|
+
modularMcp: config.getModularMcp()
|
|
7991
7996
|
});
|
|
7992
7997
|
const relativePathFromCwd = join69(
|
|
7993
7998
|
rulesyncMcp.getRelativeDirPath(),
|
|
@@ -8016,6 +8021,7 @@ async function putMcpFile({ content }) {
|
|
|
8016
8021
|
cause: error
|
|
8017
8022
|
});
|
|
8018
8023
|
}
|
|
8024
|
+
const config = await ConfigResolver.resolve({});
|
|
8019
8025
|
try {
|
|
8020
8026
|
const baseDir = process.cwd();
|
|
8021
8027
|
const paths = RulesyncMcp.getSettablePaths();
|
|
@@ -8028,7 +8034,7 @@ async function putMcpFile({ content }) {
|
|
|
8028
8034
|
relativeFilePath,
|
|
8029
8035
|
fileContent: content,
|
|
8030
8036
|
validate: true,
|
|
8031
|
-
modularMcp:
|
|
8037
|
+
modularMcp: config.getModularMcp()
|
|
8032
8038
|
});
|
|
8033
8039
|
await ensureDir(join69(baseDir, relativeDirPath));
|
|
8034
8040
|
await writeFileContent(fullPath, content);
|
|
@@ -8499,7 +8505,7 @@ async function mcpCommand({ version }) {
|
|
|
8499
8505
|
}
|
|
8500
8506
|
|
|
8501
8507
|
// src/cli/index.ts
|
|
8502
|
-
var getVersion = () => "3.23.
|
|
8508
|
+
var getVersion = () => "3.23.5";
|
|
8503
8509
|
var main = async () => {
|
|
8504
8510
|
const program = new Command();
|
|
8505
8511
|
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.5",
|
|
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",
|