@ankurhalder/codebase-snapshot 2.2.0 → 3.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/README.md +6 -5
- package/dist/bin.js +14 -14
- package/dist/{chunk-5I564BGX.js → chunk-5B4UVQLR.js} +3 -3
- package/dist/cli.cjs +14 -14
- package/dist/cli.js +14 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/agent.md +1 -1
- package/docs/configuration.md +4 -4
- package/docs/install.md +29 -26
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -54,9 +54,9 @@ npx @ankurhalder/codebase-snapshot init --preset react-vite --max-part-bytes 120
|
|
|
54
54
|
- **TypeScript AST extraction** — directives, imports, exports (including `export *` and anonymous
|
|
55
55
|
defaults), functions, classes, interfaces, types, enums, components, hooks, and route handlers.
|
|
56
56
|
- **Structured summaries** — JSON key shapes and Markdown headings, computed from redacted text.
|
|
57
|
-
- **Built for AI agents** — `
|
|
57
|
+
- **Built for AI agents** — `codebase-snapshot describe --format json` returns a machine-readable
|
|
58
58
|
contract (workflow, every option and default, exit codes, presets, safety rules), and
|
|
59
|
-
`
|
|
59
|
+
`codebase-snapshot skill --install` writes the bundled agent skill into `AGENTS.md`,
|
|
60
60
|
`.claude/skills/` and `.cursor/rules/` so a zero-context agent discovers the tool
|
|
61
61
|
automatically. See [docs/agent.md](docs/agent.md).
|
|
62
62
|
- **Zero-config presets** — auto-detects Next.js, Vite, Node/Express/Nest, and plain TypeScript.
|
|
@@ -122,8 +122,9 @@ npx @ankurhalder/codebase-snapshot@latest generate # write ./snapshot/
|
|
|
122
122
|
npx @ankurhalder/codebase-snapshot@latest validate # exit 0 = matches disk
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
The bare form works too — `npx @ankurhalder/codebase-snapshot generate` — because the
|
|
126
|
+
package ships exactly one executable, which is what lets npm resolve it. Pin `@latest`
|
|
127
|
+
(or `@3`) when you need the same build on every machine.
|
|
127
128
|
|
|
128
129
|
Details, including the contract schema and the skill's install targets, are in
|
|
129
130
|
[docs/agent.md](docs/agent.md).
|
|
@@ -134,7 +135,7 @@ Details, including the contract schema and the skill's install targets, are in
|
|
|
134
135
|
|
|
135
136
|
```bash
|
|
136
137
|
codebase-snapshot [command] [options]
|
|
137
|
-
|
|
138
|
+
codebase-snapshot [command] [options]
|
|
138
139
|
```
|
|
139
140
|
|
|
140
141
|
Every option accepts both `--opt value` and `--opt=value`. Human-readable progress goes to **stderr**;
|
package/dist/bin.js
CHANGED
|
@@ -4576,7 +4576,7 @@ function validateSnapshot(configInput) {
|
|
|
4576
4576
|
|
|
4577
4577
|
// src/index.ts
|
|
4578
4578
|
var GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
4579
|
-
var GENERATOR_VERSION = "
|
|
4579
|
+
var GENERATOR_VERSION = "3.0.0";
|
|
4580
4580
|
var SCHEMA_VERSION = "3.0.0";
|
|
4581
4581
|
function sha256Hex2(input) {
|
|
4582
4582
|
return crypto3.createHash("sha256").update(input).digest("hex");
|
|
@@ -5237,11 +5237,12 @@ function buildAgentContract() {
|
|
|
5237
5237
|
requires: { node: ">=18.0.0", dependencies: ["typescript"] },
|
|
5238
5238
|
invocation: {
|
|
5239
5239
|
oneShot: `npx ${PACKAGE_NAME}@latest`,
|
|
5240
|
-
installed: "npx
|
|
5241
|
-
bins: ["
|
|
5240
|
+
installed: "npx codebase-snapshot",
|
|
5241
|
+
bins: ["codebase-snapshot"],
|
|
5242
5242
|
notes: [
|
|
5243
|
-
`
|
|
5244
|
-
"
|
|
5243
|
+
`The bare package name also works: npx ${PACKAGE_NAME} <command>.`,
|
|
5244
|
+
"Pin @latest (or @2) when you need the exact same version on every machine.",
|
|
5245
|
+
"This package exposes exactly one executable on purpose: npm cannot infer which one to run for a scoped package that ships several.",
|
|
5245
5246
|
"Human progress goes to stderr. With --format json the payload on stdout is pure JSON."
|
|
5246
5247
|
]
|
|
5247
5248
|
},
|
|
@@ -5251,7 +5252,7 @@ function buildAgentContract() {
|
|
|
5251
5252
|
id: "verify",
|
|
5252
5253
|
run: `npx ${PACKAGE_NAME}@latest --version`,
|
|
5253
5254
|
expect: "prints v2.x.x on stdout and exits 0",
|
|
5254
|
-
notes: "If it prints nothing,
|
|
5255
|
+
notes: "If it prints nothing, clear the npm cache and retry, or use `npx -p <pkg> codebase-snapshot`."
|
|
5255
5256
|
},
|
|
5256
5257
|
{
|
|
5257
5258
|
step: 2,
|
|
@@ -5564,8 +5565,8 @@ function buildAgentContract() {
|
|
|
5564
5565
|
troubleshooting: [
|
|
5565
5566
|
{
|
|
5566
5567
|
symptom: "Command prints nothing and exits 0",
|
|
5567
|
-
cause: "
|
|
5568
|
-
fix: `
|
|
5568
|
+
cause: "The executable was not found: an offline or partially populated npm cache, or an npm proxy serving an incomplete manifest.",
|
|
5569
|
+
fix: `Clear the npx cache (npm cache clean --force), then run npx ${PACKAGE_NAME}@latest <command>.`
|
|
5569
5570
|
},
|
|
5570
5571
|
{
|
|
5571
5572
|
symptom: "Exit 1 with 'Refusing to replace outDir'",
|
|
@@ -5621,10 +5622,10 @@ another model, and reading files one by one would not fit in context.
|
|
|
5621
5622
|
This tool is a Node CLI. It needs **Node.js 18 or newer**. You do not need to install it
|
|
5622
5623
|
globally, and you do not need to clone anything.
|
|
5623
5624
|
|
|
5624
|
-
**
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
the
|
|
5625
|
+
**Pin the tag** \u2014 \`npx ${PACKAGE_NAME2}@latest <command>\` \u2014 when you need the same version on
|
|
5626
|
+
every machine. The bare package name works too: this package ships exactly one executable,
|
|
5627
|
+
which is what lets npm pick it. If a command exits 0 printing nothing, the executable was
|
|
5628
|
+
not resolved \u2014 clear the npm cache and retry; do not assume the repository is broken.
|
|
5628
5629
|
|
|
5629
5630
|
## Step by step
|
|
5630
5631
|
|
|
@@ -5833,7 +5834,6 @@ Production-grade LLM codebase snapshot generator, auditor, and AST partitioner
|
|
|
5833
5834
|
|
|
5834
5835
|
Usage:
|
|
5835
5836
|
codebase-snapshot [command] [options]
|
|
5836
|
-
snap [command] [options]
|
|
5837
5837
|
|
|
5838
5838
|
Commands:
|
|
5839
5839
|
generate (default) Generate a complete partitioned codebase snapshot
|
|
@@ -6020,7 +6020,7 @@ function parseCliArgs(argv) {
|
|
|
6020
6020
|
if (values.force === true) initOnly.push("--force");
|
|
6021
6021
|
if (initOnly.length > 0) {
|
|
6022
6022
|
throw new UsageError(
|
|
6023
|
-
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`
|
|
6023
|
+
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`codebase-snapshot init\` to generate one).`
|
|
6024
6024
|
);
|
|
6025
6025
|
}
|
|
6026
6026
|
}
|
|
@@ -4536,7 +4536,7 @@ async function runInit(options) {
|
|
|
4536
4536
|
|
|
4537
4537
|
// src/index.ts
|
|
4538
4538
|
var GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
4539
|
-
var GENERATOR_VERSION = "
|
|
4539
|
+
var GENERATOR_VERSION = "3.0.0";
|
|
4540
4540
|
var SCHEMA_VERSION = "3.0.0";
|
|
4541
4541
|
function sha256Hex2(input) {
|
|
4542
4542
|
return crypto.createHash("sha256").update(input).digest("hex");
|
|
@@ -5113,5 +5113,5 @@ async function generateSnapshotAsync(configInput, options) {
|
|
|
5113
5113
|
}
|
|
5114
5114
|
|
|
5115
5115
|
export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countLines, defineConfig, detectLanguage, detectPreset, explainPath, fenceForContent, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renderMinimalConfig, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, unknownPresetMessage, validateSnapshot };
|
|
5116
|
-
//# sourceMappingURL=chunk-
|
|
5117
|
-
//# sourceMappingURL=chunk-
|
|
5116
|
+
//# sourceMappingURL=chunk-5B4UVQLR.js.map
|
|
5117
|
+
//# sourceMappingURL=chunk-5B4UVQLR.js.map
|
package/dist/cli.cjs
CHANGED
|
@@ -4555,7 +4555,7 @@ function validateSnapshot(configInput) {
|
|
|
4555
4555
|
|
|
4556
4556
|
// src/index.ts
|
|
4557
4557
|
var GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
4558
|
-
var GENERATOR_VERSION = "
|
|
4558
|
+
var GENERATOR_VERSION = "3.0.0";
|
|
4559
4559
|
var SCHEMA_VERSION = "3.0.0";
|
|
4560
4560
|
function sha256Hex2(input) {
|
|
4561
4561
|
return crypto__namespace.createHash("sha256").update(input).digest("hex");
|
|
@@ -5216,11 +5216,12 @@ function buildAgentContract() {
|
|
|
5216
5216
|
requires: { node: ">=18.0.0", dependencies: ["typescript"] },
|
|
5217
5217
|
invocation: {
|
|
5218
5218
|
oneShot: `npx ${PACKAGE_NAME}@latest`,
|
|
5219
|
-
installed: "npx
|
|
5220
|
-
bins: ["
|
|
5219
|
+
installed: "npx codebase-snapshot",
|
|
5220
|
+
bins: ["codebase-snapshot"],
|
|
5221
5221
|
notes: [
|
|
5222
|
-
`
|
|
5223
|
-
"
|
|
5222
|
+
`The bare package name also works: npx ${PACKAGE_NAME} <command>.`,
|
|
5223
|
+
"Pin @latest (or @2) when you need the exact same version on every machine.",
|
|
5224
|
+
"This package exposes exactly one executable on purpose: npm cannot infer which one to run for a scoped package that ships several.",
|
|
5224
5225
|
"Human progress goes to stderr. With --format json the payload on stdout is pure JSON."
|
|
5225
5226
|
]
|
|
5226
5227
|
},
|
|
@@ -5230,7 +5231,7 @@ function buildAgentContract() {
|
|
|
5230
5231
|
id: "verify",
|
|
5231
5232
|
run: `npx ${PACKAGE_NAME}@latest --version`,
|
|
5232
5233
|
expect: "prints v2.x.x on stdout and exits 0",
|
|
5233
|
-
notes: "If it prints nothing,
|
|
5234
|
+
notes: "If it prints nothing, clear the npm cache and retry, or use `npx -p <pkg> codebase-snapshot`."
|
|
5234
5235
|
},
|
|
5235
5236
|
{
|
|
5236
5237
|
step: 2,
|
|
@@ -5543,8 +5544,8 @@ function buildAgentContract() {
|
|
|
5543
5544
|
troubleshooting: [
|
|
5544
5545
|
{
|
|
5545
5546
|
symptom: "Command prints nothing and exits 0",
|
|
5546
|
-
cause: "
|
|
5547
|
-
fix: `
|
|
5547
|
+
cause: "The executable was not found: an offline or partially populated npm cache, or an npm proxy serving an incomplete manifest.",
|
|
5548
|
+
fix: `Clear the npx cache (npm cache clean --force), then run npx ${PACKAGE_NAME}@latest <command>.`
|
|
5548
5549
|
},
|
|
5549
5550
|
{
|
|
5550
5551
|
symptom: "Exit 1 with 'Refusing to replace outDir'",
|
|
@@ -5596,10 +5597,10 @@ another model, and reading files one by one would not fit in context.
|
|
|
5596
5597
|
This tool is a Node CLI. It needs **Node.js 18 or newer**. You do not need to install it
|
|
5597
5598
|
globally, and you do not need to clone anything.
|
|
5598
5599
|
|
|
5599
|
-
**
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
the
|
|
5600
|
+
**Pin the tag** \u2014 \`npx ${PACKAGE_NAME2}@latest <command>\` \u2014 when you need the same version on
|
|
5601
|
+
every machine. The bare package name works too: this package ships exactly one executable,
|
|
5602
|
+
which is what lets npm pick it. If a command exits 0 printing nothing, the executable was
|
|
5603
|
+
not resolved \u2014 clear the npm cache and retry; do not assume the repository is broken.
|
|
5603
5604
|
|
|
5604
5605
|
## Step by step
|
|
5605
5606
|
|
|
@@ -5808,7 +5809,6 @@ Production-grade LLM codebase snapshot generator, auditor, and AST partitioner
|
|
|
5808
5809
|
|
|
5809
5810
|
Usage:
|
|
5810
5811
|
codebase-snapshot [command] [options]
|
|
5811
|
-
snap [command] [options]
|
|
5812
5812
|
|
|
5813
5813
|
Commands:
|
|
5814
5814
|
generate (default) Generate a complete partitioned codebase snapshot
|
|
@@ -6007,7 +6007,7 @@ function parseCliArgs(argv) {
|
|
|
6007
6007
|
if (values.force === true) initOnly.push("--force");
|
|
6008
6008
|
if (initOnly.length > 0) {
|
|
6009
6009
|
throw new UsageError(
|
|
6010
|
-
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`
|
|
6010
|
+
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`codebase-snapshot init\` to generate one).`
|
|
6011
6011
|
);
|
|
6012
6012
|
}
|
|
6013
6013
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseByteSize, GENERATOR_VERSION, ARTIFACT_NAMES, getPreset, unknownPresetMessage, MIN_MAX_PART_BYTES, loadConfigFileDetailed, resolveConfig, validateSnapshot, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, GENERATOR_NAME, runInit, PromptCancelled, SCHEMA_VERSION, PRESETS, renderExplainText } from './chunk-
|
|
1
|
+
import { parseByteSize, GENERATOR_VERSION, ARTIFACT_NAMES, getPreset, unknownPresetMessage, MIN_MAX_PART_BYTES, loadConfigFileDetailed, resolveConfig, validateSnapshot, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, GENERATOR_NAME, runInit, PromptCancelled, SCHEMA_VERSION, PRESETS, renderExplainText } from './chunk-5B4UVQLR.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path2 from 'path';
|
|
4
4
|
import { parseArgs } from 'util';
|
|
@@ -91,11 +91,12 @@ function buildAgentContract() {
|
|
|
91
91
|
requires: { node: ">=18.0.0", dependencies: ["typescript"] },
|
|
92
92
|
invocation: {
|
|
93
93
|
oneShot: `npx ${PACKAGE_NAME}@latest`,
|
|
94
|
-
installed: "npx
|
|
95
|
-
bins: ["
|
|
94
|
+
installed: "npx codebase-snapshot",
|
|
95
|
+
bins: ["codebase-snapshot"],
|
|
96
96
|
notes: [
|
|
97
|
-
`
|
|
98
|
-
"
|
|
97
|
+
`The bare package name also works: npx ${PACKAGE_NAME} <command>.`,
|
|
98
|
+
"Pin @latest (or @2) when you need the exact same version on every machine.",
|
|
99
|
+
"This package exposes exactly one executable on purpose: npm cannot infer which one to run for a scoped package that ships several.",
|
|
99
100
|
"Human progress goes to stderr. With --format json the payload on stdout is pure JSON."
|
|
100
101
|
]
|
|
101
102
|
},
|
|
@@ -105,7 +106,7 @@ function buildAgentContract() {
|
|
|
105
106
|
id: "verify",
|
|
106
107
|
run: `npx ${PACKAGE_NAME}@latest --version`,
|
|
107
108
|
expect: "prints v2.x.x on stdout and exits 0",
|
|
108
|
-
notes: "If it prints nothing,
|
|
109
|
+
notes: "If it prints nothing, clear the npm cache and retry, or use `npx -p <pkg> codebase-snapshot`."
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
112
|
step: 2,
|
|
@@ -418,8 +419,8 @@ function buildAgentContract() {
|
|
|
418
419
|
troubleshooting: [
|
|
419
420
|
{
|
|
420
421
|
symptom: "Command prints nothing and exits 0",
|
|
421
|
-
cause: "
|
|
422
|
-
fix: `
|
|
422
|
+
cause: "The executable was not found: an offline or partially populated npm cache, or an npm proxy serving an incomplete manifest.",
|
|
423
|
+
fix: `Clear the npx cache (npm cache clean --force), then run npx ${PACKAGE_NAME}@latest <command>.`
|
|
423
424
|
},
|
|
424
425
|
{
|
|
425
426
|
symptom: "Exit 1 with 'Refusing to replace outDir'",
|
|
@@ -471,10 +472,10 @@ another model, and reading files one by one would not fit in context.
|
|
|
471
472
|
This tool is a Node CLI. It needs **Node.js 18 or newer**. You do not need to install it
|
|
472
473
|
globally, and you do not need to clone anything.
|
|
473
474
|
|
|
474
|
-
**
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
the
|
|
475
|
+
**Pin the tag** \u2014 \`npx ${PACKAGE_NAME2}@latest <command>\` \u2014 when you need the same version on
|
|
476
|
+
every machine. The bare package name works too: this package ships exactly one executable,
|
|
477
|
+
which is what lets npm pick it. If a command exits 0 printing nothing, the executable was
|
|
478
|
+
not resolved \u2014 clear the npm cache and retry; do not assume the repository is broken.
|
|
478
479
|
|
|
479
480
|
## Step by step
|
|
480
481
|
|
|
@@ -683,7 +684,6 @@ Production-grade LLM codebase snapshot generator, auditor, and AST partitioner
|
|
|
683
684
|
|
|
684
685
|
Usage:
|
|
685
686
|
codebase-snapshot [command] [options]
|
|
686
|
-
snap [command] [options]
|
|
687
687
|
|
|
688
688
|
Commands:
|
|
689
689
|
generate (default) Generate a complete partitioned codebase snapshot
|
|
@@ -882,7 +882,7 @@ function parseCliArgs(argv) {
|
|
|
882
882
|
if (values.force === true) initOnly.push("--force");
|
|
883
883
|
if (initOnly.length > 0) {
|
|
884
884
|
throw new UsageError(
|
|
885
|
-
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`
|
|
885
|
+
`${initOnly.join(", ")} ${initOnly.length === 1 ? "is" : "are"} only valid with \`init\`. To scope \`${command}\`, set include/excludePatterns/preset in snapshot.config.ts (or run \`codebase-snapshot init\` to generate one).`
|
|
886
886
|
);
|
|
887
887
|
}
|
|
888
888
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -4565,7 +4565,7 @@ async function runInit(options) {
|
|
|
4565
4565
|
|
|
4566
4566
|
// src/index.ts
|
|
4567
4567
|
var GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
4568
|
-
var GENERATOR_VERSION = "
|
|
4568
|
+
var GENERATOR_VERSION = "3.0.0";
|
|
4569
4569
|
var SCHEMA_VERSION = "3.0.0";
|
|
4570
4570
|
function sha256Hex2(input) {
|
|
4571
4571
|
return crypto__namespace.createHash("sha256").update(input).digest("hex");
|
package/dist/index.d.cts
CHANGED
|
@@ -497,7 +497,7 @@ declare function matchesExclude(relativePath: string, pattern: string): boolean;
|
|
|
497
497
|
declare function collectFiles(cwd: string, options?: CollectOptions): CollectResult;
|
|
498
498
|
|
|
499
499
|
declare const GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
500
|
-
declare const GENERATOR_VERSION = "
|
|
500
|
+
declare const GENERATOR_VERSION = "3.0.0";
|
|
501
501
|
declare const SCHEMA_VERSION = "3.0.0";
|
|
502
502
|
interface GenerateOptions {
|
|
503
503
|
/** Compute the full manifest but write nothing to disk. */
|
package/dist/index.d.ts
CHANGED
|
@@ -497,7 +497,7 @@ declare function matchesExclude(relativePath: string, pattern: string): boolean;
|
|
|
497
497
|
declare function collectFiles(cwd: string, options?: CollectOptions): CollectResult;
|
|
498
498
|
|
|
499
499
|
declare const GENERATOR_NAME = "@ankurhalder/codebase-snapshot";
|
|
500
|
-
declare const GENERATOR_VERSION = "
|
|
500
|
+
declare const GENERATOR_VERSION = "3.0.0";
|
|
501
501
|
declare const SCHEMA_VERSION = "3.0.0";
|
|
502
502
|
interface GenerateOptions {
|
|
503
503
|
/** Compute the full manifest but write nothing to disk. */
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countLines, defineConfig, detectLanguage, detectPreset, explainPath, fenceForContent, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renderMinimalConfig, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot } from './chunk-
|
|
1
|
+
export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countLines, defineConfig, detectLanguage, detectPreset, explainPath, fenceForContent, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renderMinimalConfig, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot } from './chunk-5B4UVQLR.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/docs/agent.md
CHANGED
|
@@ -60,7 +60,7 @@ between `<!-- codebase-snapshot:skill:start -->` and
|
|
|
60
60
|
`<!-- codebase-snapshot:skill:end -->`, so an `AGENTS.md` that already documents your
|
|
61
61
|
conventions keeps them. `--format json` reports what was created, updated or unchanged.
|
|
62
62
|
|
|
63
|
-
`
|
|
63
|
+
`codebase-snapshot init` prints a reminder about this; it never installs the skill on its own.
|
|
64
64
|
|
|
65
65
|
## Why both a contract and a skill
|
|
66
66
|
|
package/docs/configuration.md
CHANGED
|
@@ -256,7 +256,7 @@ marker written before any artifact, not by the set of filenames present, so
|
|
|
256
256
|
custom artifacts never look like someone else's data.
|
|
257
257
|
|
|
258
258
|
Note that a hook runs in the **process** working directory, so with
|
|
259
|
-
`
|
|
259
|
+
`codebase-snapshot --cwd elsewhere` a relative path resolves against your shell's directory,
|
|
260
260
|
not the target repo. Use the absolute paths on `manifest` (or resolve against
|
|
261
261
|
`outDir` yourself) when passing `--cwd`.
|
|
262
262
|
|
|
@@ -276,7 +276,7 @@ not the target repo. Use the absolute paths on `manifest` (or resolve against
|
|
|
276
276
|
## `explain`
|
|
277
277
|
|
|
278
278
|
```
|
|
279
|
-
$
|
|
279
|
+
$ codebase-snapshot explain src/app/page.tsx
|
|
280
280
|
|
|
281
281
|
src/app/page.tsx
|
|
282
282
|
|
|
@@ -293,7 +293,7 @@ src/app/page.tsx
|
|
|
293
293
|
Excluded paths say why:
|
|
294
294
|
|
|
295
295
|
```
|
|
296
|
-
$
|
|
296
|
+
$ codebase-snapshot explain .env
|
|
297
297
|
|
|
298
298
|
.env
|
|
299
299
|
|
|
@@ -308,7 +308,7 @@ same data as an object.
|
|
|
308
308
|
## `diff`
|
|
309
309
|
|
|
310
310
|
```
|
|
311
|
-
$
|
|
311
|
+
$ codebase-snapshot diff old-snapshot new-snapshot
|
|
312
312
|
|
|
313
313
|
before 2026-11-03T10:00:00.000Z 812 file(s), 4 part(s)
|
|
314
314
|
after 2026-11-03T11:30:00.000Z 820 file(s), 4 part(s)
|
package/docs/install.md
CHANGED
|
@@ -12,24 +12,27 @@ Requires **Node.js 18 or newer**.
|
|
|
12
12
|
npx @ankurhalder/codebase-snapshot generate
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
resolved the bare spec to a placeholder manifest that carries no executable — npm creates
|
|
17
|
-
a `0.0.0-stage` placeholder version during staged publishing, and some npm builds pick it
|
|
18
|
-
when no version is given. Pin the version or the tag and it works:
|
|
15
|
+
Pin the version when you need the same build on every machine:
|
|
19
16
|
|
|
20
17
|
```bash
|
|
21
18
|
npx @ankurhalder/codebase-snapshot@latest generate
|
|
22
|
-
npx @ankurhalder/codebase-snapshot@
|
|
19
|
+
npx @ankurhalder/codebase-snapshot@3 generate
|
|
23
20
|
```
|
|
24
21
|
|
|
22
|
+
The bare form works because this package ships **exactly one executable**
|
|
23
|
+
(`codebase-snapshot`). That is deliberate: npm resolves which binary to run by matching the
|
|
24
|
+
typed command against the package's `bin` keys, and no key can contain an `@scope/`, so a
|
|
25
|
+
scoped package with several executables cannot be run by its bare name. If a command ever
|
|
26
|
+
exits with no output, clear the npm cache and retry — see troubleshooting.
|
|
27
|
+
|
|
25
28
|
`npx -p @ankurhalder/codebase-snapshot codebase-snapshot generate`, `pnpm dlx`,
|
|
26
|
-
`yarn dlx` and `bunx` are
|
|
27
|
-
|
|
29
|
+
`yarn dlx` and `bunx` are equivalent. A normal `npm install -D` followed by
|
|
30
|
+
`npx codebase-snapshot` is the more reproducible choice for a project.
|
|
28
31
|
|
|
29
32
|
Equivalent one-liners for other clients:
|
|
30
33
|
|
|
31
34
|
```bash
|
|
32
|
-
yarn dlx -p @ankurhalder/codebase-snapshot
|
|
35
|
+
yarn dlx -p @ankurhalder/codebase-snapshot codebase-snapshot generate # yarn Berry
|
|
33
36
|
yarn global add @ankurhalder/codebase-snapshot # yarn classic (installs globally)
|
|
34
37
|
pnpm dlx @ankurhalder/codebase-snapshot generate
|
|
35
38
|
bunx @ankurhalder/codebase-snapshot generate
|
|
@@ -47,13 +50,13 @@ bun add -d @ankurhalder/codebase-snapshot
|
|
|
47
50
|
Then run it through your client so it resolves from the project's `node_modules`:
|
|
48
51
|
|
|
49
52
|
```bash
|
|
50
|
-
npx
|
|
51
|
-
yarn
|
|
52
|
-
pnpm exec
|
|
53
|
-
bun run
|
|
53
|
+
npx codebase-snapshot generate
|
|
54
|
+
yarn codebase-snapshot generate
|
|
55
|
+
pnpm exec codebase-snapshot generate
|
|
56
|
+
bun run codebase-snapshot generate
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
Both `
|
|
59
|
+
Both `codebase-snapshot` and `codebase-snapshot` are exposed as binaries — pick whichever you prefer.
|
|
57
60
|
|
|
58
61
|
Adding it to `package.json` scripts works the same everywhere:
|
|
59
62
|
|
|
@@ -82,23 +85,23 @@ if the generator version is reproducible.
|
|
|
82
85
|
|
|
83
86
|
```bash
|
|
84
87
|
npx @ankurhalder/codebase-snapshot@2 generate
|
|
85
|
-
pnpm dlx @ankurhalder/codebase-snapshot@
|
|
88
|
+
pnpm dlx @ankurhalder/codebase-snapshot@3.0.0 generate
|
|
86
89
|
```
|
|
87
90
|
|
|
88
91
|
## Verified clients
|
|
89
92
|
|
|
90
93
|
Every client below was used to install the published package and run
|
|
91
|
-
`
|
|
94
|
+
`codebase-snapshot --version` successfully. This matrix is enforced in CI
|
|
92
95
|
(`.github/workflows/ci.yml` → `client-install`), so a change that breaks a client fails
|
|
93
96
|
the build rather than a user's terminal.
|
|
94
97
|
|
|
95
98
|
| Client | Version tested | Run installed binary with |
|
|
96
99
|
| :--- | :--- | :--- |
|
|
97
|
-
| npm | 10.x | `npx
|
|
98
|
-
| yarn (classic) | 1.22.22 | `yarn
|
|
99
|
-
| yarn (Berry, `nodeLinker: pnp`) | 4.6.0 | `yarn
|
|
100
|
-
| pnpm | 10.28.0 | `pnpm exec
|
|
101
|
-
| bun | 1.4.4 | `bun run
|
|
100
|
+
| npm | 10.x | `npx codebase-snapshot` |
|
|
101
|
+
| yarn (classic) | 1.22.22 | `yarn codebase-snapshot` |
|
|
102
|
+
| yarn (Berry, `nodeLinker: pnp`) | 4.6.0 | `yarn codebase-snapshot` |
|
|
103
|
+
| pnpm | 10.28.0 | `pnpm exec codebase-snapshot` |
|
|
104
|
+
| bun | 1.4.4 | `bun run codebase-snapshot` |
|
|
102
105
|
|
|
103
106
|
Yarn Berry's default **strict PnP** mode works: there is no `node_modules` directory, and
|
|
104
107
|
the runtime `typescript` dependency still resolves through yarn's `.pnp.cjs` loader.
|
|
@@ -125,9 +128,9 @@ Snapshots already written to `snapshot/` are ordinary files and are left alone.
|
|
|
125
128
|
|
|
126
129
|
## Troubleshooting
|
|
127
130
|
|
|
128
|
-
**`
|
|
131
|
+
**`codebase-snapshot: command not found`** — when installed locally (not globally), the binary lives
|
|
129
132
|
in `node_modules/.bin` and is only on your `PATH` inside a package script or a client
|
|
130
|
-
runner. Use `npx
|
|
133
|
+
runner. Use `npx codebase-snapshot`, `pnpm exec codebase-snapshot`, `yarn codebase-snapshot`, or `bun run codebase-snapshot`.
|
|
131
134
|
|
|
132
135
|
**`Cannot find module 'typescript'`** — the package declares `typescript` as a runtime
|
|
133
136
|
dependency for AST analysis. If your client prunes or externalizes it (some bundlers and
|
|
@@ -136,14 +139,14 @@ dependency for AST analysis. If your client prunes or externalizes it (some bund
|
|
|
136
139
|
**CI has no Node** — that is not supported yet; this package is JavaScript and needs a
|
|
137
140
|
Node runtime. See the future-work note above.
|
|
138
141
|
|
|
139
|
-
**`yarn
|
|
142
|
+
**`yarn codebase-snapshot` prints extra lines, or breaks a script that parses output** — yarn classic
|
|
140
143
|
wraps everything: it echoes `yarn run 1.22.22`, the resolved command, your tool's output,
|
|
141
144
|
and a `Done in 0.37s.` trailer. For a human that is harmless; for anything that parses
|
|
142
|
-
`
|
|
145
|
+
`codebase-snapshot`'s stdout it is not. In scripts and CI, call the binary directly:
|
|
143
146
|
|
|
144
147
|
```bash
|
|
145
|
-
./node_modules/.bin/
|
|
146
|
-
npx
|
|
148
|
+
./node_modules/.bin/codebase-snapshot generate
|
|
149
|
+
npx codebase-snapshot generate # same, without the yarn wrapper
|
|
147
150
|
```
|
|
148
151
|
|
|
149
152
|
This is why the CI job in this repository reads the version from a line that *is* the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankurhalder/codebase-snapshot",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Production-grade LLM codebase snapshot generator, auditor, and AST partitioner",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codebase",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"bin": {
|
|
35
|
-
"codebase-snapshot": "./dist/bin.js"
|
|
36
|
-
"snap": "./dist/bin.js"
|
|
35
|
+
"codebase-snapshot": "./dist/bin.js"
|
|
37
36
|
},
|
|
38
37
|
"exports": {
|
|
39
38
|
".": {
|