rulesync 7.27.1 → 7.30.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-CJXBVA4E.js";
75
+ } from "../chunk-IGW5DFPU.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, {
@@ -1115,6 +1118,16 @@ async function generateCommand(logger5, options) {
1115
1118
  logger5.captureData("hasDiff", result.hasDiff);
1116
1119
  logger5.captureData("skills", result.skills ?? []);
1117
1120
  }
1121
+ if (check) {
1122
+ if (result.hasDiff) {
1123
+ throw new CLIError(
1124
+ "Files are not up to date. Run 'rulesync generate' to update.",
1125
+ ErrorCodes.GENERATION_FAILED
1126
+ );
1127
+ }
1128
+ logger5.success("\u2713 All files are up to date.");
1129
+ return;
1130
+ }
1118
1131
  if (totalGenerated === 0) {
1119
1132
  const enabledFeatures = features.join(", ");
1120
1133
  logger5.info(`\u2713 All files are up to date (${enabledFeatures})`);
@@ -1128,21 +1141,12 @@ async function generateCommand(logger5, options) {
1128
1141
  if (result.subagentsCount > 0) parts.push(`${result.subagentsCount} subagents`);
1129
1142
  if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
1130
1143
  if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
1144
+ if (result.permissionsCount > 0) parts.push(`${result.permissionsCount} permissions`);
1131
1145
  if (isPreview) {
1132
1146
  logger5.info(`${modePrefix} Would write ${totalGenerated} file(s) total (${parts.join(" + ")})`);
1133
1147
  } else {
1134
1148
  logger5.success(`\u{1F389} All done! Written ${totalGenerated} file(s) total (${parts.join(" + ")})`);
1135
1149
  }
1136
- if (check) {
1137
- if (result.hasDiff) {
1138
- throw new CLIError(
1139
- "Files are not up to date. Run 'rulesync generate' to update.",
1140
- ErrorCodes.GENERATION_FAILED
1141
- );
1142
- } else {
1143
- logger5.success("\u2713 All files are up to date.");
1144
- }
1145
- }
1146
1150
  }
1147
1151
 
1148
1152
  // src/cli/commands/gitignore.ts
@@ -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.
@@ -1204,6 +1207,7 @@ var GITIGNORE_ENTRY_REGISTRY = [
1204
1207
  { target: "codexcli", feature: "subagents", entry: "**/.codex/agents/" },
1205
1208
  { target: "codexcli", feature: "general", entry: "**/.codex/memories/" },
1206
1209
  { target: "codexcli", feature: "general", entry: "**/.codex/config.toml" },
1210
+ { target: "codexcli", feature: "hooks", entry: "**/.codex/hooks.json" },
1207
1211
  // Cursor
1208
1212
  { target: "cursor", feature: "rules", entry: "**/.cursor/" },
1209
1213
  { target: "cursor", feature: "ignore", entry: "**/.cursorignore" },
@@ -1292,6 +1296,8 @@ var GITIGNORE_ENTRY_REGISTRY = [
1292
1296
  { target: "kiro", feature: "subagents", entry: "**/.kiro/agents/" },
1293
1297
  { target: "kiro", feature: "mcp", entry: "**/.kiro/settings/mcp.json" },
1294
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" },
1295
1301
  // OpenCode
1296
1302
  { target: "opencode", feature: "commands", entry: "**/.opencode/command/" },
1297
1303
  { target: "opencode", feature: "subagents", entry: "**/.opencode/agent/" },
@@ -1356,8 +1362,12 @@ var isFeatureSelectedForTarget = (feature, target, features) => {
1356
1362
  if (target === "common") return true;
1357
1363
  const targetFeatures = features[target];
1358
1364
  if (!targetFeatures) return true;
1359
- if (targetFeatures.includes("*")) return true;
1360
- 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]);
1361
1371
  };
1362
1372
  var isFeatureSelected = (feature, target, features) => {
1363
1373
  return normalizeGitignoreEntryTargets(target).some(
@@ -1392,8 +1402,14 @@ var warnInvalidFeatures = (features, logger5) => {
1392
1402
  } else {
1393
1403
  for (const targetFeatures of Object.values(features)) {
1394
1404
  if (!targetFeatures) continue;
1395
- for (const feature of targetFeatures) {
1396
- 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
+ }
1397
1413
  }
1398
1414
  }
1399
1415
  }
@@ -1551,7 +1567,8 @@ async function importCommand(logger5, options) {
1551
1567
  commands: { count: result.commandsCount },
1552
1568
  subagents: { count: result.subagentsCount },
1553
1569
  skills: { count: result.skillsCount },
1554
- hooks: { count: result.hooksCount }
1570
+ hooks: { count: result.hooksCount },
1571
+ permissions: { count: result.permissionsCount }
1555
1572
  });
1556
1573
  logger5.captureData("totalFiles", totalImported);
1557
1574
  }
@@ -1563,6 +1580,7 @@ async function importCommand(logger5, options) {
1563
1580
  if (result.subagentsCount > 0) parts.push(`${result.subagentsCount} subagents`);
1564
1581
  if (result.skillsCount > 0) parts.push(`${result.skillsCount} skills`);
1565
1582
  if (result.hooksCount > 0) parts.push(`${result.hooksCount} hooks`);
1583
+ if (result.permissionsCount > 0) parts.push(`${result.permissionsCount} permissions`);
1566
1584
  logger5.success(`Imported ${totalImported} file(s) total (${parts.join(" + ")})`);
1567
1585
  }
1568
1586
 
@@ -2878,6 +2896,7 @@ function buildSuccessResponse(params) {
2878
2896
  subagentsCount: generateResult.subagentsCount,
2879
2897
  skillsCount: generateResult.skillsCount,
2880
2898
  hooksCount: generateResult.hooksCount,
2899
+ permissionsCount: generateResult.permissionsCount,
2881
2900
  totalCount
2882
2901
  },
2883
2902
  config: {
@@ -3057,6 +3076,7 @@ function buildSuccessResponse2(params) {
3057
3076
  subagentsCount: importResult.subagentsCount,
3058
3077
  skillsCount: importResult.skillsCount,
3059
3078
  hooksCount: importResult.hooksCount,
3079
+ permissionsCount: importResult.permissionsCount,
3060
3080
  totalCount
3061
3081
  },
3062
3082
  config: {
@@ -4460,7 +4480,7 @@ function wrapCommand({
4460
4480
  }
4461
4481
 
4462
4482
  // src/cli/index.ts
4463
- var getVersion = () => "7.27.1";
4483
+ var getVersion = () => "7.30.0";
4464
4484
  function wrapCommand2(name, errorCode, handler) {
4465
4485
  return wrapCommand({ name, errorCode, handler, getVersion });
4466
4486
  }