codebase-snapshot 0.10.1 → 0.10.2

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.
@@ -1,4 +1,4 @@
1
- import { GENERATOR_VERSION, anchorForPath, displayPath, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateSnapshot, generateInWorker, validateSnapshot, buildImportResolver, resolveSpecifier, truncateToBytes, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-7DAW2LFZ.js';
1
+ import { GENERATOR_VERSION, anchorForPath, displayPath, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateInWorker, validateSnapshot, buildImportResolver, resolveSpecifier, truncateToBytes, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-5AV7OR3J.js';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
4
 
@@ -736,45 +736,38 @@ var planTool = {
736
736
  const prepared = await prepare(args, context, workspaceOverrides(args));
737
737
  if (!prepared.ok) return prepared.outcome;
738
738
  const workspace = prepared.workspace;
739
- let manifest;
740
- try {
741
- manifest = generateSnapshot(workspace.config, { dryRun: true });
742
- } catch (error) {
743
- return failure(error instanceof Error ? error.message : String(error));
744
- }
745
- const reasons = /* @__PURE__ */ new Map();
746
- for (const record of manifest.skipped) {
747
- reasons.set(record.reason, (reasons.get(record.reason) ?? 0) + 1);
748
- }
749
- const topReasons = [...reasons.entries()].sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : 1)).slice(0, 8).map(([reason, count]) => ({ reason, count }));
739
+ const result = await generateInWorker(workspace.root, workspace.cliOptions, { dryRun: true });
740
+ if (!result.ok) return failure(result.message);
741
+ const summary = result.summary;
742
+ const topReasons = summary.skipReasons;
750
743
  const lines = [
751
744
  "Dry run \u2014 nothing was written.",
752
- `Preset: ${manifest.config.preset}`,
753
- `Would include ${plural(manifest.counts.totalFiles, "file")} in ${plural(manifest.counts.partsCount, "part")} (${formatBytes(manifest.counts.totalSizeBytes)} of source, ${formatBytes(manifest.totals.totalContentBytes)} emitted).`,
754
- `Would skip ${plural(manifest.counts.skippedCount, "file")}.`
745
+ `Preset: ${summary.preset}`,
746
+ `Would include ${plural(summary.totalFiles, "file")} in ${plural(summary.partsCount, "part")} (${formatBytes(summary.totalSizeBytes)} of source, ${formatBytes(summary.totalContentBytes)} emitted).`,
747
+ `Would skip ${plural(summary.skippedCount, "file")}.`
755
748
  ];
756
749
  if (topReasons.length > 0) {
757
750
  lines.push("Top skip reasons:");
758
751
  for (const entry of topReasons) lines.push(` - ${entry.reason} (${entry.count})`);
759
752
  }
760
- if (manifest.warnings.length > 0) {
761
- lines.push(`Warnings (${manifest.warnings.length}):`);
762
- for (const warning of manifest.warnings.slice(0, 5)) lines.push(` - ${warning}`);
753
+ if (summary.warnings.length > 0) {
754
+ lines.push(`Warnings (${summary.warnings.length}):`);
755
+ for (const warning of summary.warnings.slice(0, 5)) lines.push(` - ${warning}`);
763
756
  }
764
757
  return {
765
758
  text: lines.join("\n"),
766
759
  structured: {
767
- files: manifest.counts.totalFiles,
768
- skipped: manifest.counts.skippedCount,
769
- parts: manifest.counts.partsCount,
770
- sourceBytes: manifest.counts.totalSizeBytes,
771
- emittedBytes: manifest.totals.totalContentBytes,
772
- preset: manifest.config.preset,
773
- maxPartBytes: manifest.budgets.maxPartBytes,
774
- layers: manifest.layers,
760
+ files: summary.totalFiles,
761
+ skipped: summary.skippedCount,
762
+ parts: summary.partsCount,
763
+ sourceBytes: summary.totalSizeBytes,
764
+ emittedBytes: summary.totalContentBytes,
765
+ preset: summary.preset,
766
+ maxPartBytes: workspace.config.maxPartBytes,
767
+ layers: summary.layers,
775
768
  skipReasons: topReasons,
776
- warnings: manifest.warnings.slice(0, 5),
777
- warningCount: manifest.warnings.length
769
+ warnings: summary.warnings.slice(0, 5),
770
+ warningCount: summary.warnings.length
778
771
  }
779
772
  };
780
773
  }
@@ -2125,6 +2118,7 @@ function buildAgentContract() {
2125
2118
  { key: "layers", type: "array", default: "preset layers", summary: "Custom layer rules (glob or RegExp)." },
2126
2119
  { key: "kinds", type: "array", default: "preset kinds", summary: "Custom kind rules." },
2127
2120
  { key: "secrets", type: "object", default: "{}", summary: "Custom secret patterns, or disable the defaults." },
2121
+ { key: "secretRules", type: "array", default: "[]", summary: "Full secret-rule list: the library spelling of secrets.customPatterns. The built-ins are prepended unless secrets.disableDefaultPatterns is set." },
2128
2122
  { key: "hooks", type: "object", default: "{}", summary: "afterGenerate(manifest) runs after a successful generate." }
2129
2123
  ]
2130
2124
  },
@@ -2141,6 +2135,8 @@ function buildAgentContract() {
2141
2135
  notes: [
2142
2136
  "Parts are ordered and budget-limited; a file that cannot fit one part is emitted as a head/tail preview, and every file not present in full is listed in manifest.json incomplete[] with the missing line ranges.",
2143
2137
  "manifest.json.files[] carries relativePath, layer, kind, language, part, inclusionMode, truncationReason, omittedRanges and hash; manifest.json.incomplete[] lists every file not present in full; `summary` is conditional \u2014 it is absent for languages with no structural summary, and `summaryOmitted: true` marks a summary dropped to fit the part budget; encoding appears when the file was not plain UTF-8.",
2138
+ "indexes.imports.byFile includes previewed files (their import specifiers are still extracted); such an entry carries `exportsOmitted: true` instead of pretending it exports nothing.",
2139
+ "validate re-checks manifest.incomplete[] against files[] and refuses a manifest whose two statements of what is missing disagree.",
2144
2140
  "manifest.skipped[] carries the path and the exact reason it was excluded.",
2145
2141
  `The output directory is replaced atomically; ${MIN_MAX_PART_BYTES} bytes is the smallest legal budget.`
2146
2142
  ]