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.
- package/CHANGELOG.md +70 -0
- package/README.md +1 -1
- package/dist/bin.js +595 -396
- package/dist/{chunk-7DAW2LFZ.js → chunk-5AV7OR3J.js} +371 -176
- package/dist/{chunk-WDJ3O3R4.js → chunk-5EYBTBFY.js} +24 -28
- package/dist/cli.cjs +595 -396
- package/dist/cli.d.cts +11 -9
- package/dist/cli.d.ts +11 -9
- package/dist/cli.js +14 -6
- package/dist/{generate-worker-D_mUjgXw.d.cts → generate-worker-BK4uJx7Z.d.cts} +17 -8
- package/dist/{generate-worker-D_mUjgXw.d.ts → generate-worker-BK4uJx7Z.d.ts} +17 -8
- package/dist/index.cjs +347 -169
- package/dist/index.d.cts +68 -23
- package/dist/index.d.ts +68 -23
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +453 -2694
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{types-Z471HW65.d.cts → types-BoWneA7n.d.cts} +35 -4
- package/dist/{types-Z471HW65.d.ts → types-BoWneA7n.d.ts} +35 -4
- package/docs/cli.md +29 -8
- package/docs/codebase-token-budget.md +12 -9
- package/docs/configuration.md +18 -2
- package/docs/how-to-context-budget.md +1 -1
- package/docs/mcp.md +3 -3
- package/docs/output.md +8 -5
- package/docs/stale-context-is-your-bug.md +8 -4
- package/docs/vs-code2prompt.md +1 -1
- package/docs/vs-gitingest.md +1 -1
- package/docs/vs-repomix.md +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GENERATOR_VERSION, anchorForPath, displayPath, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS,
|
|
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
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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: ${
|
|
753
|
-
`Would include ${plural(
|
|
754
|
-
`Would skip ${plural(
|
|
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 (
|
|
761
|
-
lines.push(`Warnings (${
|
|
762
|
-
for (const warning of
|
|
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:
|
|
768
|
-
skipped:
|
|
769
|
-
parts:
|
|
770
|
-
sourceBytes:
|
|
771
|
-
emittedBytes:
|
|
772
|
-
preset:
|
|
773
|
-
maxPartBytes:
|
|
774
|
-
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:
|
|
777
|
-
warningCount:
|
|
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
|
]
|