@sixsevenai/ai-dlc-installer 1.4.2 → 1.4.4

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.js CHANGED
@@ -1059,6 +1059,8 @@ var INSTALL_CATEGORIES = [
1059
1059
  { id: "commands/git", pathPrefix: "commands/git/", label: "Commands: Git", hint: "Git workflow commands" },
1060
1060
  { id: "commands/spec", pathPrefix: "commands/spec/", label: "Commands: Spec", hint: "Specification commands" },
1061
1061
  { id: "commands/task", pathPrefix: "commands/task/", label: "Commands: Task", hint: "Task management commands" },
1062
+ { id: "commands/dba", pathPrefix: "commands/dba/", label: "Commands: DBA", hint: "Database administration commands" },
1063
+ { id: "commands/it-ops", pathPrefix: "commands/it-ops/", label: "Commands: IT Ops", hint: "IT operations commands" },
1062
1064
  { id: "commands/worktree", pathPrefix: "commands/worktree/", label: "Commands: Worktree", hint: "Worktree management commands" },
1063
1065
  { id: "skills", pathPrefix: "skills/", label: "Skills", hint: "Reusable skill definitions" },
1064
1066
  { id: "templates", pathPrefix: "templates/", label: "Templates", hint: "Project templates" },
@@ -1067,6 +1069,9 @@ var INSTALL_CATEGORIES = [
1067
1069
  { id: "ai-dlc", pathPrefix: "ai-dlc/", label: "AI-DLC Core", hint: "Core AI-DLC framework files" },
1068
1070
  { id: "memory", pathPrefix: "memory/", label: "Memory", hint: "Memory templates" }
1069
1071
  ];
1072
+ var PROTECTED_FILES = /* @__PURE__ */ new Set([
1073
+ "memory/spec/constitution.md"
1074
+ ]);
1070
1075
  function filterMappingsByCategories(mappings, categories) {
1071
1076
  const prefixes = INSTALL_CATEGORIES.filter((cat) => categories.includes(cat.id)).map((cat) => cat.pathPrefix);
1072
1077
  if (prefixes.length === 0) {
@@ -1077,6 +1082,18 @@ function filterMappingsByCategories(mappings, categories) {
1077
1082
  return prefixes.some((prefix) => normalised.startsWith(prefix));
1078
1083
  });
1079
1084
  }
1085
+ function filterProtectedFiles(mappings, existingTargetFiles, protectedPaths = PROTECTED_FILES) {
1086
+ const skipped = [];
1087
+ const filtered = mappings.filter((mapping) => {
1088
+ const normalised = mapping.relativePath.replace(/\\/g, "/");
1089
+ if (protectedPaths.has(normalised) && existingTargetFiles.has(normalised)) {
1090
+ skipped.push(normalised);
1091
+ return false;
1092
+ }
1093
+ return true;
1094
+ });
1095
+ return { filtered, skipped };
1096
+ }
1080
1097
  function resolveCategories(overwriteFlags) {
1081
1098
  const validIds = INSTALL_CATEGORIES.map((cat) => cat.id);
1082
1099
  const unknown = overwriteFlags.filter((flag) => !validIds.includes(flag));
@@ -1105,6 +1122,10 @@ function renderSummary(summary, nextSteps, theme, categoryInfo) {
1105
1122
  lines.push(...renderComponentCounts(summary.componentCounts, theme));
1106
1123
  lines.push("");
1107
1124
  }
1125
+ if (summary.protectedFilesPreserved && summary.protectedFilesPreserved.length > 0) {
1126
+ lines.push(...renderProtectedFiles(summary.protectedFilesPreserved, theme));
1127
+ lines.push("");
1128
+ }
1108
1129
  lines.push(...renderFileStatistics(summary, theme));
1109
1130
  lines.push("");
1110
1131
  lines.push(` Total time: ${theme.bold(summary.totalDuration.formatted)}`);
@@ -1197,6 +1218,15 @@ function renderInstalledCategories(categoryInfo, theme) {
1197
1218
  }
1198
1219
  return lines;
1199
1220
  }
1221
+ function renderProtectedFiles(protectedPaths, theme) {
1222
+ const bullet = theme.symbolSet.bullet;
1223
+ const lines = [];
1224
+ lines.push(` ${theme.bold(theme.colorize("Protected files preserved:", "header"))}`);
1225
+ for (const filePath of protectedPaths) {
1226
+ lines.push(` ${bullet} ${theme.colorize(filePath, "accent")} (not overwritten)`);
1227
+ }
1228
+ return lines;
1229
+ }
1200
1230
  function renderFileStatistics(summary, theme) {
1201
1231
  const lines = [];
1202
1232
  lines.push(` ${theme.bold(theme.colorize("File statistics:", "header"))}`);
@@ -3616,7 +3646,8 @@ function createInitialContext(sourceDirectory) {
3616
3646
  validationReport: null,
3617
3647
  fileMappings: [],
3618
3648
  overwriteMode: null,
3619
- selectedCategories: []
3649
+ selectedCategories: [],
3650
+ protectedFilesSkipped: []
3620
3651
  };
3621
3652
  }
3622
3653
  function buildTerminalCapabilities(env) {
@@ -4354,6 +4385,20 @@ async function executeInstallFiles(ctx, options, theme) {
4354
4385
  );
4355
4386
  }
4356
4387
  }
4388
+ if (ctx.conflictReport) {
4389
+ const existingSet = new Set(
4390
+ ctx.conflictReport.existingFiles.map((p) => p.replace(/\\/g, "/"))
4391
+ );
4392
+ const { filtered: protectedFiltered, skipped: protectedSkipped } = filterProtectedFiles(ctx.fileMappings, existingSet);
4393
+ if (protectedSkipped.length > 0) {
4394
+ ctx.fileMappings = protectedFiltered;
4395
+ ctx.protectedFilesSkipped = protectedSkipped;
4396
+ verboseLog(
4397
+ options.verbose,
4398
+ `Protected files preserved (not overwritten): ${protectedSkipped.join(", ")}`
4399
+ );
4400
+ }
4401
+ }
4357
4402
  if (options.dryRun) {
4358
4403
  return {
4359
4404
  data: { dryRun: true, fileCount: ctx.fileMappings.length },
@@ -4535,7 +4580,8 @@ async function executeShowSummary(ctx, options, theme) {
4535
4580
  totalFilesCopied: ctx.installationResult?.copiedCount ?? 0,
4536
4581
  totalFilesSkipped: ctx.installationResult?.skippedCount ?? 0,
4537
4582
  totalFilesFailed: ctx.installationResult?.errors.length ?? 0,
4538
- installerVersion: INSTALLER_VERSION
4583
+ installerVersion: INSTALLER_VERSION,
4584
+ protectedFilesPreserved: ctx.protectedFilesSkipped.length > 0 ? ctx.protectedFilesSkipped : void 0
4539
4585
  };
4540
4586
  const nextSteps = getDefaultNextSteps(summary.success);
4541
4587
  if (theme && !options.quiet) {