rulesync 7.28.0 → 8.0.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/cli/index.js CHANGED
@@ -62,6 +62,7 @@ import {
62
62
  getFileSize,
63
63
  getLocalSkillDirNames,
64
64
  importFromTool,
65
+ isFeatureValueEnabled,
65
66
  isSymlink,
66
67
  listDirectoryFiles,
67
68
  readFileContent,
@@ -71,7 +72,7 @@ import {
71
72
  stringifyFrontmatter,
72
73
  toPosixPath,
73
74
  writeFileContent
74
- } from "../chunk-AKHOQKVV.js";
75
+ } from "../chunk-GB6XLCGB.js";
75
76
 
76
77
  // src/cli/index.ts
77
78
  import { Command } from "commander";
@@ -1028,7 +1029,7 @@ async function fetchCommand(logger5, options) {
1028
1029
 
1029
1030
  // src/utils/result.ts
1030
1031
  function calculateTotalCount(result) {
1031
- return result.rulesCount + result.ignoreCount + result.mcpCount + result.commandsCount + result.subagentsCount + result.skillsCount + result.hooksCount;
1032
+ return result.rulesCount + result.ignoreCount + result.mcpCount + result.commandsCount + result.subagentsCount + result.skillsCount + result.hooksCount + result.permissionsCount;
1032
1033
  }
1033
1034
 
1034
1035
  // src/cli/commands/generate.ts
@@ -1089,6 +1090,7 @@ async function generateCommand(logger5, options) {
1089
1090
  subagents: { count: result.subagentsCount, paths: result.subagentsPaths },
1090
1091
  skills: { count: result.skillsCount, paths: result.skillsPaths },
1091
1092
  hooks: { count: result.hooksCount, paths: result.hooksPaths },
1093
+ permissions: { count: result.permissionsCount, paths: result.permissionsPaths },
1092
1094
  rules: { count: result.rulesCount, paths: result.rulesPaths }
1093
1095
  };
1094
1096
  const featureLabels = {
@@ -1098,7 +1100,8 @@ async function generateCommand(logger5, options) {
1098
1100
  commands: (count) => `${count === 1 ? "command" : "commands"}`,
1099
1101
  subagents: (count) => `${count === 1 ? "subagent" : "subagents"}`,
1100
1102
  skills: (count) => `${count === 1 ? "skill" : "skills"}`,
1101
- hooks: (count) => `${count === 1 ? "hooks file" : "hooks files"}`
1103
+ hooks: (count) => `${count === 1 ? "hooks file" : "hooks files"}`,
1104
+ permissions: (count) => `${count === 1 ? "permissions file" : "permissions files"}`
1102
1105
  };
1103
1106
  for (const [feature, data] of Object.entries(featureResults)) {
1104
1107
  logFeatureResult(logger5, {
@@ -1138,6 +1141,7 @@ async function generateCommand(logger5, options) {
1138
1141
  if (result.subagentsCount > 0) parts.push(`${result.subagentsCount} subagents`);
1139
1142
  if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
1140
1143
  if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
1144
+ if (result.permissionsCount > 0) parts.push(`${result.permissionsCount} permissions`);
1141
1145
  if (isPreview) {
1142
1146
  logger5.info(`${modePrefix} Would write ${totalGenerated} file(s) total (${parts.join(" + ")})`);
1143
1147
  } else {
@@ -1161,7 +1165,6 @@ var GITIGNORE_ENTRY_REGISTRY = [
1161
1165
  },
1162
1166
  { target: "common", feature: "general", entry: ".rulesync/rules/*.local.md" },
1163
1167
  { target: "common", feature: "general", entry: "rulesync.local.jsonc" },
1164
- { target: "common", feature: "general", entry: "!.rulesync/.aiignore" },
1165
1168
  // AGENTS.local.md is placed in common scope (not rovodev-only) so that
1166
1169
  // local rule files are always gitignored regardless of which targets are enabled.
1167
1170
  // This prevents accidental commits when a user disables the rovodev target.
@@ -1293,6 +1296,8 @@ var GITIGNORE_ENTRY_REGISTRY = [
1293
1296
  { target: "kiro", feature: "subagents", entry: "**/.kiro/agents/" },
1294
1297
  { target: "kiro", feature: "mcp", entry: "**/.kiro/settings/mcp.json" },
1295
1298
  { target: "kiro", feature: "ignore", entry: "**/.aiignore" },
1299
+ // Keep this after ignore entries like "**/.aiignore" so the exception remains effective.
1300
+ { target: "common", feature: "general", entry: "!.rulesync/.aiignore" },
1296
1301
  // OpenCode
1297
1302
  { target: "opencode", feature: "commands", entry: "**/.opencode/command/" },
1298
1303
  { target: "opencode", feature: "subagents", entry: "**/.opencode/agent/" },
@@ -1357,8 +1362,12 @@ var isFeatureSelectedForTarget = (feature, target, features) => {
1357
1362
  if (target === "common") return true;
1358
1363
  const targetFeatures = features[target];
1359
1364
  if (!targetFeatures) return true;
1360
- if (targetFeatures.includes("*")) return true;
1361
- return targetFeatures.includes(feature);
1365
+ if (Array.isArray(targetFeatures)) {
1366
+ if (targetFeatures.includes("*")) return true;
1367
+ return targetFeatures.includes(feature);
1368
+ }
1369
+ if (isFeatureValueEnabled(targetFeatures["*"])) return true;
1370
+ return isFeatureValueEnabled(targetFeatures[feature]);
1362
1371
  };
1363
1372
  var isFeatureSelected = (feature, target, features) => {
1364
1373
  return normalizeGitignoreEntryTargets(target).some(
@@ -1393,8 +1402,14 @@ var warnInvalidFeatures = (features, logger5) => {
1393
1402
  } else {
1394
1403
  for (const targetFeatures of Object.values(features)) {
1395
1404
  if (!targetFeatures) continue;
1396
- for (const feature of targetFeatures) {
1397
- warnOnce(feature);
1405
+ if (Array.isArray(targetFeatures)) {
1406
+ for (const feature of targetFeatures) {
1407
+ warnOnce(feature);
1408
+ }
1409
+ } else {
1410
+ for (const feature of Object.keys(targetFeatures)) {
1411
+ warnOnce(feature);
1412
+ }
1398
1413
  }
1399
1414
  }
1400
1415
  }
@@ -1552,7 +1567,8 @@ async function importCommand(logger5, options) {
1552
1567
  commands: { count: result.commandsCount },
1553
1568
  subagents: { count: result.subagentsCount },
1554
1569
  skills: { count: result.skillsCount },
1555
- hooks: { count: result.hooksCount }
1570
+ hooks: { count: result.hooksCount },
1571
+ permissions: { count: result.permissionsCount }
1556
1572
  });
1557
1573
  logger5.captureData("totalFiles", totalImported);
1558
1574
  }
@@ -1564,6 +1580,7 @@ async function importCommand(logger5, options) {
1564
1580
  if (result.subagentsCount > 0) parts.push(`${result.subagentsCount} subagents`);
1565
1581
  if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
1566
1582
  if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
1583
+ if (result.permissionsCount > 0) parts.push(`${result.permissionsCount} permissions`);
1567
1584
  logger5.success(`Imported ${totalImported} file(s) total (${parts.join(" + ")})`);
1568
1585
  }
1569
1586
 
@@ -2879,6 +2896,7 @@ function buildSuccessResponse(params) {
2879
2896
  subagentsCount: generateResult.subagentsCount,
2880
2897
  skillsCount: generateResult.skillsCount,
2881
2898
  hooksCount: generateResult.hooksCount,
2899
+ permissionsCount: generateResult.permissionsCount,
2882
2900
  totalCount
2883
2901
  },
2884
2902
  config: {
@@ -3058,6 +3076,7 @@ function buildSuccessResponse2(params) {
3058
3076
  subagentsCount: importResult.subagentsCount,
3059
3077
  skillsCount: importResult.skillsCount,
3060
3078
  hooksCount: importResult.hooksCount,
3079
+ permissionsCount: importResult.permissionsCount,
3061
3080
  totalCount
3062
3081
  },
3063
3082
  config: {
@@ -4461,7 +4480,7 @@ function wrapCommand({
4461
4480
  }
4462
4481
 
4463
4482
  // src/cli/index.ts
4464
- var getVersion = () => "7.28.0";
4483
+ var getVersion = () => "8.0.0";
4465
4484
  function wrapCommand2(name, errorCode, handler) {
4466
4485
  return wrapCommand({ name, errorCode, handler, getVersion });
4467
4486
  }