codebase-snapshot 0.9.17 → 0.9.18
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 +72 -0
- package/README.md +4 -4
- package/dist/bin.js +6 -4
- package/dist/{chunk-S4367K5X.js → chunk-XAW5GY6X.js} +2 -2
- package/dist/{chunk-IIP43I7C.js → chunk-ZXWAVHSZ.js} +5 -3
- package/dist/cli.cjs +6 -4
- package/dist/cli.js +4 -4
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +2 -2
- package/dist/mcp.js +2 -2
- package/docs/cli.md +8 -6
- package/docs/mcp.md +3 -3
- package/docs/vs-repomix.md +9 -5
- package/package.json +14 -17
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,74 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
## 0.9.18
|
|
27
|
+
|
|
28
|
+
A release about what the listing says. The generator is unchanged; what changed is every place
|
|
29
|
+
that describes it — the npm page, the README, the machine-readable summary, and one comparison
|
|
30
|
+
table that had two rows wrong.
|
|
31
|
+
|
|
32
|
+
### The update notice waited a day
|
|
33
|
+
|
|
34
|
+
The check remembered "you are already current" for 24 hours, so a release published two hours
|
|
35
|
+
after a run went unnoticed until the next day — even though the tool exists to prove a thing is
|
|
36
|
+
current. A cached answer that names a newer release still keeps the daily interval, because the
|
|
37
|
+
upgrade command is already known; a "you are current" answer is now re-asked after an hour. An
|
|
38
|
+
active run therefore notices a release within the hour, and a machine that is up to date makes at
|
|
39
|
+
most one request an hour instead of one a day.
|
|
40
|
+
|
|
41
|
+
### The npm description did not contain the product's name
|
|
42
|
+
|
|
43
|
+
"Pack a codebase for an LLM into budgeted Markdown parts" described the mechanism and never said
|
|
44
|
+
*snapshot*. The package is called `codebase-snapshot` and the words people type are "codebase
|
|
45
|
+
snapshot"; the description now opens with that phrase, names the clients it is used with, and says
|
|
46
|
+
it is local.
|
|
47
|
+
|
|
48
|
+
The keyword list lost the words that describe the implementation rather than the job —
|
|
49
|
+
`partitioner`, `ast`, `ai`, `code-analysis`, `prompt-engineering` — and gained the ones a person
|
|
50
|
+
searching for this would use: `llm-context`, `codebase-to-markdown`, `token-budget`, `claude-code`,
|
|
51
|
+
`drift-detection`. Twenty terms, and none of them a competitor's name.
|
|
52
|
+
|
|
53
|
+
### Two rows in the repomix comparison were wrong
|
|
54
|
+
|
|
55
|
+
`docs/vs-repomix.md` said repomix emits "a single packed file" with "no per-artifact ceiling". It
|
|
56
|
+
has `--split-output <size>` and `--token-budget <n>`, and the second exits non-zero above a token
|
|
57
|
+
count — a ceiling of the kind the table denied it. Both rows are corrected, and the page now lists
|
|
58
|
+
a token budget under *where repomix is the better choice*: tokens are what a context window
|
|
59
|
+
measures, and this project budgets bytes.
|
|
60
|
+
|
|
61
|
+
The page was also the first thing a search for "repomix alternative" could land on. A comparison
|
|
62
|
+
that is wrong about the other tool is worse than no comparison, and the correction costs less than
|
|
63
|
+
the credibility it protects.
|
|
64
|
+
|
|
65
|
+
### The README asked for a command the reader did not have yet
|
|
66
|
+
|
|
67
|
+
The first block led with `snapshot`, which exists only after a global install, so the very first
|
|
68
|
+
thing a visitor copied could fail. It leads with `npx codebase-snapshot generate` now, with the
|
|
69
|
+
short form after it.
|
|
70
|
+
|
|
71
|
+
The weekly-downloads badge is gone. On a repository with two stars it advertised a number that is
|
|
72
|
+
mostly registry mirrors and old lockfiles, in a README whose central claim is that it does not
|
|
73
|
+
overstate what it has proven.
|
|
74
|
+
|
|
75
|
+
### `llms.txt` described three of the four pillars
|
|
76
|
+
|
|
77
|
+
The summary an agent reads first mentioned budgeted parts, the manifest and a secret audit, and
|
|
78
|
+
left out `validate` and the MCP server — the two things the project argues about. Both are in the
|
|
79
|
+
summary now.
|
|
80
|
+
|
|
81
|
+
### The scaffolder now says it is the scaffolder
|
|
82
|
+
|
|
83
|
+
`create-codebase-snapshot` described itself as "Set up codebase-snapshot in a repository", which
|
|
84
|
+
reads as the tool itself when it is the first npm result for the name. It describes the scaffolding
|
|
85
|
+
it actually performs.
|
|
86
|
+
|
|
87
|
+
### Also
|
|
88
|
+
|
|
89
|
+
- The 0.9.5 paragraph beginning "The MCP server has not been run against a real client" now carries
|
|
90
|
+
a note pointing at what superseded it: the digit-as-string fix in 0.9.6 was reported from a live
|
|
91
|
+
client session, and `snapshot_dependents` arrived in 0.9.8. The paragraph is history, not a
|
|
92
|
+
current disclaimer, and a reader who found it by search had no way to tell.
|
|
93
|
+
|
|
26
94
|
## 0.9.17
|
|
27
95
|
|
|
28
96
|
Closes the remaining entries of the 0.9.16 verified-bug report and the follow-up report from a
|
|
@@ -1307,6 +1375,10 @@ The MCP server has not been run against a real client. Its protocol is exercised
|
|
|
1307
1375
|
binary, but a client's own configuration, timeouts and approval prompts are theirs. That is the next
|
|
1308
1376
|
thing to check, not something this release proves.
|
|
1309
1377
|
|
|
1378
|
+
> Superseded since: the digit-as-string fix in 0.9.6 was reported from a live client session, and
|
|
1379
|
+
> `snapshot_dependents` arrived in 0.9.8 on the same basis. This paragraph describes 0.9.5 and is
|
|
1380
|
+
> left as written — it is history, not a disclaimer about the current server.
|
|
1381
|
+
|
|
1310
1382
|
## 0.9.4
|
|
1311
1383
|
|
|
1312
1384
|
### The snapshot is now something an agent can ask for
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<p>
|
|
11
11
|
<a href="https://www.npmjs.com/package/codebase-snapshot"><img alt="npm version" src="https://img.shields.io/npm/v/codebase-snapshot.svg"></a>
|
|
12
|
-
<a href="https://
|
|
12
|
+
<a href="https://github.com/ankurhalder/codebase-snapshot/actions/workflows/pr.yml"><img alt="verify" src="https://img.shields.io/github/actions/workflow/status/ankurhalder/codebase-snapshot/pr.yml?label=verify"></a>
|
|
13
13
|
<a href="#license"><img alt="license: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
14
14
|
<a href="https://nodejs.org"><img alt="node: 18 or newer" src="https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg"></a>
|
|
15
15
|
<a href="https://ankurhalder.github.io/codebase-snapshot/"><img alt="documentation" src="https://img.shields.io/badge/docs-read-1a7f37"></a>
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
snapshot
|
|
21
|
-
|
|
20
|
+
npx codebase-snapshot generate # no install: straight to the snapshot
|
|
21
|
+
snapshot # once installed: detects the project, sets it up, generates
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
That writes `./snapshot/` — a directory you can drop into a chat, a prompt, a RAG pipeline or a
|
|
@@ -200,7 +200,7 @@ Everything an agent needs is available as data, and the tool can install its own
|
|
|
200
200
|
```bash
|
|
201
201
|
npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
|
|
202
202
|
npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
|
|
203
|
-
npx -y codebase-snapshot@0.9.
|
|
203
|
+
npx -y codebase-snapshot@0.9.18 mcp # or serve it over MCP
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
|
package/dist/bin.js
CHANGED
|
@@ -2150,7 +2150,7 @@ function applySpans(line, spans) {
|
|
|
2150
2150
|
|
|
2151
2151
|
// src/version.ts
|
|
2152
2152
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2153
|
-
var GENERATOR_VERSION = "0.9.
|
|
2153
|
+
var GENERATOR_VERSION = "0.9.18";
|
|
2154
2154
|
var SCHEMA_VERSION = "3.0.0";
|
|
2155
2155
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2156
2156
|
function isOurGeneratorName(name) {
|
|
@@ -9704,6 +9704,7 @@ import * as os from "os";
|
|
|
9704
9704
|
import * as path13 from "path";
|
|
9705
9705
|
var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
9706
9706
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
9707
|
+
var UP_TO_DATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
9707
9708
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
9708
9709
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
9709
9710
|
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
@@ -9878,7 +9879,8 @@ async function checkForUpdate(options) {
|
|
|
9878
9879
|
needsFetch = age >= FAILURE_INTERVAL_MS;
|
|
9879
9880
|
} else {
|
|
9880
9881
|
latest = cached.latest;
|
|
9881
|
-
|
|
9882
|
+
const interval = isNewer(cached.latest, options.current) ? CHECK_INTERVAL_MS : UP_TO_DATE_INTERVAL_MS;
|
|
9883
|
+
needsFetch = age >= interval;
|
|
9882
9884
|
}
|
|
9883
9885
|
}
|
|
9884
9886
|
if (needsFetch) {
|
|
@@ -13889,7 +13891,7 @@ function buildAgentContract() {
|
|
|
13889
13891
|
type: "boolean",
|
|
13890
13892
|
default: false,
|
|
13891
13893
|
appliesTo: optionAppliesTo("no-update-check"),
|
|
13892
|
-
summary: "Skip the
|
|
13894
|
+
summary: "Skip the check for a newer published version. The check is already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests."
|
|
13893
13895
|
}
|
|
13894
13896
|
],
|
|
13895
13897
|
presets: PRESETS.map((preset) => ({
|
|
@@ -15307,7 +15309,7 @@ Options:
|
|
|
15307
15309
|
--install Write the skill into the repository instead of printing
|
|
15308
15310
|
--target <name> claude | cursor | all (default: all)
|
|
15309
15311
|
|
|
15310
|
-
--no-update-check Skip the
|
|
15312
|
+
--no-update-check Skip the check for a newer published version
|
|
15311
15313
|
|
|
15312
15314
|
-h, --help Display this help message
|
|
15313
15315
|
-v, --version Display version
|
|
@@ -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-
|
|
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-ZXWAVHSZ.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
|
|
@@ -2070,7 +2070,7 @@ function buildAgentContract() {
|
|
|
2070
2070
|
type: "boolean",
|
|
2071
2071
|
default: false,
|
|
2072
2072
|
appliesTo: optionAppliesTo("no-update-check"),
|
|
2073
|
-
summary: "Skip the
|
|
2073
|
+
summary: "Skip the check for a newer published version. The check is already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests."
|
|
2074
2074
|
}
|
|
2075
2075
|
],
|
|
2076
2076
|
presets: PRESETS.map((preset) => ({
|
|
@@ -3863,7 +3863,7 @@ function applySpans(line, spans) {
|
|
|
3863
3863
|
|
|
3864
3864
|
// src/version.ts
|
|
3865
3865
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
3866
|
-
var GENERATOR_VERSION = "0.9.
|
|
3866
|
+
var GENERATOR_VERSION = "0.9.18";
|
|
3867
3867
|
var SCHEMA_VERSION = "3.0.0";
|
|
3868
3868
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
3869
3869
|
function isOurGeneratorName(name) {
|
|
@@ -8045,6 +8045,7 @@ function validateSnapshot(configInput) {
|
|
|
8045
8045
|
}
|
|
8046
8046
|
var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
8047
8047
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
8048
|
+
var UP_TO_DATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
8048
8049
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
8049
8050
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
8050
8051
|
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
@@ -8219,7 +8220,8 @@ async function checkForUpdate(options) {
|
|
|
8219
8220
|
needsFetch = age >= FAILURE_INTERVAL_MS;
|
|
8220
8221
|
} else {
|
|
8221
8222
|
latest = cached.latest;
|
|
8222
|
-
|
|
8223
|
+
const interval = isNewer(cached.latest, options.current) ? CHECK_INTERVAL_MS : UP_TO_DATE_INTERVAL_MS;
|
|
8224
|
+
needsFetch = age >= interval;
|
|
8223
8225
|
}
|
|
8224
8226
|
}
|
|
8225
8227
|
if (needsFetch) {
|
|
@@ -11902,4 +11904,4 @@ async function generateSnapshotAsync(configInput, options) {
|
|
|
11902
11904
|
return manifest;
|
|
11903
11905
|
}
|
|
11904
11906
|
|
|
11905
|
-
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defaultIO, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, escapeControls, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findConfigFile, findSecretInPath, firstRunMessage, formatNumber, formatTokens, formatUpdateNotice, generateInWorker, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isDiscoveryMode, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, runWithStdoutCapture, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, unknownPresetMessage, updateCommand, validateSnapshot, workerEntry, wrapLines };
|
|
11907
|
+
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, UP_TO_DATE_INTERVAL_MS, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defaultIO, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, escapeControls, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findConfigFile, findSecretInPath, firstRunMessage, formatNumber, formatTokens, formatUpdateNotice, generateInWorker, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isDiscoveryMode, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, runWithStdoutCapture, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, unknownPresetMessage, updateCommand, validateSnapshot, workerEntry, wrapLines };
|
package/dist/cli.cjs
CHANGED
|
@@ -2179,7 +2179,7 @@ function applySpans(line, spans) {
|
|
|
2179
2179
|
|
|
2180
2180
|
// src/version.ts
|
|
2181
2181
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2182
|
-
var GENERATOR_VERSION = "0.9.
|
|
2182
|
+
var GENERATOR_VERSION = "0.9.18";
|
|
2183
2183
|
var SCHEMA_VERSION = "3.0.0";
|
|
2184
2184
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2185
2185
|
function isOurGeneratorName(name) {
|
|
@@ -9649,6 +9649,7 @@ function generateProjectTree(filePaths) {
|
|
|
9649
9649
|
}
|
|
9650
9650
|
var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
9651
9651
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
9652
|
+
var UP_TO_DATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
9652
9653
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
9653
9654
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
9654
9655
|
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
@@ -9823,7 +9824,8 @@ async function checkForUpdate(options) {
|
|
|
9823
9824
|
needsFetch = age >= FAILURE_INTERVAL_MS;
|
|
9824
9825
|
} else {
|
|
9825
9826
|
latest = cached.latest;
|
|
9826
|
-
|
|
9827
|
+
const interval = isNewer(cached.latest, options.current) ? CHECK_INTERVAL_MS : UP_TO_DATE_INTERVAL_MS;
|
|
9828
|
+
needsFetch = age >= interval;
|
|
9827
9829
|
}
|
|
9828
9830
|
}
|
|
9829
9831
|
if (needsFetch) {
|
|
@@ -13811,7 +13813,7 @@ function buildAgentContract() {
|
|
|
13811
13813
|
type: "boolean",
|
|
13812
13814
|
default: false,
|
|
13813
13815
|
appliesTo: optionAppliesTo("no-update-check"),
|
|
13814
|
-
summary: "Skip the
|
|
13816
|
+
summary: "Skip the check for a newer published version. The check is already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests."
|
|
13815
13817
|
}
|
|
13816
13818
|
],
|
|
13817
13819
|
presets: PRESETS.map((preset) => ({
|
|
@@ -15219,7 +15221,7 @@ Options:
|
|
|
15219
15221
|
--install Write the skill into the repository instead of printing
|
|
15220
15222
|
--target <name> claude | cursor | all (default: all)
|
|
15221
15223
|
|
|
15222
|
-
--no-update-check Skip the
|
|
15224
|
+
--no-update-check Skip the check for a newer published version
|
|
15223
15225
|
|
|
15224
15226
|
-h, --help Display this help message
|
|
15225
15227
|
-v, --version Display version
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-
|
|
2
|
-
export { buildAgentContract } from './chunk-
|
|
3
|
-
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, parseByteSize, stripJsonComments, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-
|
|
1
|
+
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-XAW5GY6X.js';
|
|
2
|
+
export { buildAgentContract } from './chunk-XAW5GY6X.js';
|
|
3
|
+
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, parseByteSize, stripJsonComments, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-ZXWAVHSZ.js';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as path2 from 'path';
|
|
@@ -237,7 +237,7 @@ Options:
|
|
|
237
237
|
--install Write the skill into the repository instead of printing
|
|
238
238
|
--target <name> claude | cursor | all (default: all)
|
|
239
239
|
|
|
240
|
-
--no-update-check Skip the
|
|
240
|
+
--no-update-check Skip the check for a newer published version
|
|
241
241
|
|
|
242
242
|
-h, --help Display this help message
|
|
243
243
|
-v, --version Display version
|
package/dist/index.cjs
CHANGED
|
@@ -3880,7 +3880,7 @@ function applySpans(line, spans) {
|
|
|
3880
3880
|
|
|
3881
3881
|
// src/version.ts
|
|
3882
3882
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
3883
|
-
var GENERATOR_VERSION = "0.9.
|
|
3883
|
+
var GENERATOR_VERSION = "0.9.18";
|
|
3884
3884
|
var SCHEMA_VERSION = "3.0.0";
|
|
3885
3885
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
3886
3886
|
function isOurGeneratorName(name) {
|
|
@@ -8040,6 +8040,7 @@ function validateSnapshot(configInput) {
|
|
|
8040
8040
|
}
|
|
8041
8041
|
var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
8042
8042
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
8043
|
+
var UP_TO_DATE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
8043
8044
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
8044
8045
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
8045
8046
|
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
@@ -8214,7 +8215,8 @@ async function checkForUpdate(options) {
|
|
|
8214
8215
|
needsFetch = age >= FAILURE_INTERVAL_MS;
|
|
8215
8216
|
} else {
|
|
8216
8217
|
latest = cached.latest;
|
|
8217
|
-
|
|
8218
|
+
const interval = isNewer(cached.latest, options.current) ? CHECK_INTERVAL_MS : UP_TO_DATE_INTERVAL_MS;
|
|
8219
|
+
needsFetch = age >= interval;
|
|
8218
8220
|
}
|
|
8219
8221
|
}
|
|
8220
8222
|
if (needsFetch) {
|
|
@@ -11840,6 +11842,7 @@ exports.PromptBack = PromptBack;
|
|
|
11840
11842
|
exports.PromptCancelled = PromptCancelled;
|
|
11841
11843
|
exports.REQUEST_TIMEOUT_MS = REQUEST_TIMEOUT_MS;
|
|
11842
11844
|
exports.SCHEMA_VERSION = SCHEMA_VERSION;
|
|
11845
|
+
exports.UP_TO_DATE_INTERVAL_MS = UP_TO_DATE_INTERVAL_MS;
|
|
11843
11846
|
exports.anchorForPath = anchorForPath;
|
|
11844
11847
|
exports.appendGitignoreEntries = appendGitignoreEntries;
|
|
11845
11848
|
exports.assertReplaceable = assertReplaceable;
|
package/dist/index.d.cts
CHANGED
|
@@ -520,7 +520,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
520
520
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
521
521
|
*/
|
|
522
522
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
523
|
-
declare const GENERATOR_VERSION = "0.9.
|
|
523
|
+
declare const GENERATOR_VERSION = "0.9.18";
|
|
524
524
|
/**
|
|
525
525
|
* The manifest and ownership-marker schema this build writes and understands.
|
|
526
526
|
*
|
|
@@ -532,8 +532,16 @@ declare const SCHEMA_VERSION = "3.0.0";
|
|
|
532
532
|
|
|
533
533
|
/** The one endpoint this package will ever request. */
|
|
534
534
|
declare const PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
535
|
-
/** A result
|
|
535
|
+
/** A result naming a newer release is trusted for a day: the upgrade command cannot change. */
|
|
536
536
|
declare const CHECK_INTERVAL_MS: number;
|
|
537
|
+
/**
|
|
538
|
+
* How long "you are already current" is trusted.
|
|
539
|
+
*
|
|
540
|
+
* That is the only answer a new release can invalidate. Re-asking it hourly means an active run
|
|
541
|
+
* notices a release within the hour, while a cached upgrade keeps the daily interval: the notice
|
|
542
|
+
* is already known and a second request would buy nothing.
|
|
543
|
+
*/
|
|
544
|
+
declare const UP_TO_DATE_INTERVAL_MS: number;
|
|
537
545
|
/**
|
|
538
546
|
* How long a *failed* check is remembered.
|
|
539
547
|
*
|
|
@@ -1296,4 +1304,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
1296
1304
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
1297
1305
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
1298
1306
|
|
|
1299
|
-
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, DiscoveryMode, type ExplainResult, FAILURE_INTERVAL_MS, FileEntry, type FirstRunFacts, type FirstRunPlan, type FirstRunRefusal, GENERATOR_NAME, GENERATOR_VERSION, type GenerateOptions, HOOK_MARKER, type HeuristicResult, type HookInstallResult, type ImportCandidate, type ImportResolver, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, Manifest, type ManifestDiff, MarkdownSummary, PACKAGE_LATEST_URL, PRESETS, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, wrapLines };
|
|
1307
|
+
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, DiscoveryMode, type ExplainResult, FAILURE_INTERVAL_MS, FileEntry, type FirstRunFacts, type FirstRunPlan, type FirstRunRefusal, GENERATOR_NAME, GENERATOR_VERSION, type GenerateOptions, HOOK_MARKER, type HeuristicResult, type HookInstallResult, type ImportCandidate, type ImportResolver, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, Manifest, type ManifestDiff, MarkdownSummary, PACKAGE_LATEST_URL, PRESETS, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, wrapLines };
|
package/dist/index.d.ts
CHANGED
|
@@ -520,7 +520,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
520
520
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
521
521
|
*/
|
|
522
522
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
523
|
-
declare const GENERATOR_VERSION = "0.9.
|
|
523
|
+
declare const GENERATOR_VERSION = "0.9.18";
|
|
524
524
|
/**
|
|
525
525
|
* The manifest and ownership-marker schema this build writes and understands.
|
|
526
526
|
*
|
|
@@ -532,8 +532,16 @@ declare const SCHEMA_VERSION = "3.0.0";
|
|
|
532
532
|
|
|
533
533
|
/** The one endpoint this package will ever request. */
|
|
534
534
|
declare const PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
535
|
-
/** A result
|
|
535
|
+
/** A result naming a newer release is trusted for a day: the upgrade command cannot change. */
|
|
536
536
|
declare const CHECK_INTERVAL_MS: number;
|
|
537
|
+
/**
|
|
538
|
+
* How long "you are already current" is trusted.
|
|
539
|
+
*
|
|
540
|
+
* That is the only answer a new release can invalidate. Re-asking it hourly means an active run
|
|
541
|
+
* notices a release within the hour, while a cached upgrade keeps the daily interval: the notice
|
|
542
|
+
* is already known and a second request would buy nothing.
|
|
543
|
+
*/
|
|
544
|
+
declare const UP_TO_DATE_INTERVAL_MS: number;
|
|
537
545
|
/**
|
|
538
546
|
* How long a *failed* check is remembered.
|
|
539
547
|
*
|
|
@@ -1296,4 +1304,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
1296
1304
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
1297
1305
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
1298
1306
|
|
|
1299
|
-
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, DiscoveryMode, type ExplainResult, FAILURE_INTERVAL_MS, FileEntry, type FirstRunFacts, type FirstRunPlan, type FirstRunRefusal, GENERATOR_NAME, GENERATOR_VERSION, type GenerateOptions, HOOK_MARKER, type HeuristicResult, type HookInstallResult, type ImportCandidate, type ImportResolver, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, Manifest, type ManifestDiff, MarkdownSummary, PACKAGE_LATEST_URL, PRESETS, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, wrapLines };
|
|
1307
|
+
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, DiscoveryMode, type ExplainResult, FAILURE_INTERVAL_MS, FileEntry, type FirstRunFacts, type FirstRunPlan, type FirstRunRefusal, GENERATOR_NAME, GENERATOR_VERSION, type GenerateOptions, HOOK_MARKER, type HeuristicResult, type HookInstallResult, type ImportCandidate, type ImportResolver, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, Manifest, type ManifestDiff, MarkdownSummary, PACKAGE_LATEST_URL, PRESETS, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, wrapLines };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, workerEntry, wrapLines } from './chunk-
|
|
1
|
+
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, UP_TO_DATE_INTERVAL_MS, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, workerEntry, wrapLines } from './chunk-ZXWAVHSZ.js';
|
package/dist/mcp.cjs
CHANGED
|
@@ -2341,7 +2341,7 @@ function applySpans(line, spans) {
|
|
|
2341
2341
|
|
|
2342
2342
|
// src/version.ts
|
|
2343
2343
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2344
|
-
var GENERATOR_VERSION = "0.9.
|
|
2344
|
+
var GENERATOR_VERSION = "0.9.18";
|
|
2345
2345
|
var SCHEMA_VERSION = "3.0.0";
|
|
2346
2346
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2347
2347
|
function isOurGeneratorName(name) {
|
|
@@ -11422,7 +11422,7 @@ function buildAgentContract() {
|
|
|
11422
11422
|
type: "boolean",
|
|
11423
11423
|
default: false,
|
|
11424
11424
|
appliesTo: optionAppliesTo("no-update-check"),
|
|
11425
|
-
summary: "Skip the
|
|
11425
|
+
summary: "Skip the check for a newer published version. The check is already skipped when stdout is not a terminal, in CI, in a JSON invocation, and in `mcp`, which makes no network requests."
|
|
11426
11426
|
}
|
|
11427
11427
|
],
|
|
11428
11428
|
presets: PRESETS.map((preset) => ({
|
package/dist/mcp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, inspectModernMeta, negotiateLegacyVersion, parsePartSections, runStdioServer, validateArguments, windowText } from './chunk-
|
|
2
|
-
export { generateInWorker } from './chunk-
|
|
1
|
+
export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, inspectModernMeta, negotiateLegacyVersion, parsePartSections, runStdioServer, validateArguments, windowText } from './chunk-XAW5GY6X.js';
|
|
2
|
+
export { generateInWorker } from './chunk-ZXWAVHSZ.js';
|
package/docs/cli.md
CHANGED
|
@@ -183,7 +183,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
|
|
|
183
183
|
🚀 Setup for: /path/to/repo
|
|
184
184
|
✅ Created snapshot.config.ts (preset: nextjs)
|
|
185
185
|
Added npm scripts: snapshot, snapshot:validate
|
|
186
|
-
Added devDependency: codebase-snapshot ^0.9.
|
|
186
|
+
Added devDependency: codebase-snapshot ^0.9.18
|
|
187
187
|
Added to .gitignore: snapshot/, snapshot.tmp/
|
|
188
188
|
⏳ Installing dependencies…
|
|
189
189
|
✅ Installed dependencies (npm install, 2.1s)
|
|
@@ -232,7 +232,7 @@ It also has three side effects on files you own, and it says so when it does the
|
|
|
232
232
|
```
|
|
233
233
|
✅ Created snapshot.config.ts (preset: node-lib)
|
|
234
234
|
Added npm scripts: snapshot, snapshot:validate
|
|
235
|
-
Added devDependency: codebase-snapshot ^0.9.
|
|
235
|
+
Added devDependency: codebase-snapshot ^0.9.18
|
|
236
236
|
Added to .gitignore: snapshot/, snapshot.tmp/
|
|
237
237
|
```
|
|
238
238
|
|
|
@@ -551,10 +551,12 @@ install, a plain `npm install codebase-snapshot@latest` when the package is a de
|
|
|
551
551
|
project being worked in, and `npx -y codebase-snapshot@latest` when it was reached through `npx` —
|
|
552
552
|
a global install would leave a second copy shadowing the pinned one.
|
|
553
553
|
|
|
554
|
-
The request goes to `registry.npmjs.org/codebase-snapshot/latest
|
|
555
|
-
kind
|
|
556
|
-
|
|
557
|
-
|
|
554
|
+
The request goes to `registry.npmjs.org/codebase-snapshot/latest` and carries no identifier of any
|
|
555
|
+
kind. Its answer is remembered for 24 hours when it names a newer release — the upgrade command is
|
|
556
|
+
already known — and for one hour when it says you are current, because that is the only answer a
|
|
557
|
+
new release can change. A machine therefore makes at most one request an hour while it is current,
|
|
558
|
+
and at most one a day while an upgrade is waiting. It is skipped when stdout is not a terminal, in
|
|
559
|
+
CI, in any `--format json` run, and in `mcp`, whose server makes no outbound connections at all.
|
|
558
560
|
|
|
559
561
|
`--no-update-check` or `CODEBASE_SNAPSHOT_NO_UPDATE_CHECK=1` turns it off entirely.
|
|
560
562
|
|
package/docs/mcp.md
CHANGED
|
@@ -10,7 +10,7 @@ walk — that the client sees.
|
|
|
10
10
|
## Start it
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npx -y codebase-snapshot@0.9.
|
|
13
|
+
npx -y codebase-snapshot@0.9.18 mcp
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The server serves the directory it was started in. `--cwd <path>` points it elsewhere, and that
|
|
@@ -25,7 +25,7 @@ Claude Desktop and Cursor:
|
|
|
25
25
|
"mcpServers": {
|
|
26
26
|
"codebase-snapshot": {
|
|
27
27
|
"command": "npx",
|
|
28
|
-
"args": ["-y", "codebase-snapshot@0.9.
|
|
28
|
+
"args": ["-y", "codebase-snapshot@0.9.18", "mcp", "--cwd", "/absolute/path/to/repo"]
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ Claude Desktop and Cursor:
|
|
|
34
34
|
Claude Code registers the same thing from a shell:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.9.
|
|
37
|
+
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.9.18 mcp --cwd /absolute/path/to/repo
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
On Windows, wrap the command as `cmd /c npx` with the same arguments — `npx` is a `.cmd` shim
|
package/docs/vs-repomix.md
CHANGED
|
@@ -10,9 +10,9 @@ better choice, including where repomix clearly is.
|
|
|
10
10
|
|
|
11
11
|
## The short version
|
|
12
12
|
|
|
13
|
-
**repomix** packs a repository into
|
|
14
|
-
by a wide margin — tens of thousands of stars, an MCP server, remote
|
|
15
|
-
ecosystem of integrations.
|
|
13
|
+
**repomix** packs a repository into an AI-friendly file, or several with `--split-output`. It is the
|
|
14
|
+
established tool in this space by a wide margin — tens of thousands of stars, an MCP server, remote
|
|
15
|
+
repository URLs, a token budget that fails a build, and an ecosystem of integrations.
|
|
16
16
|
|
|
17
17
|
**codebase-snapshot** produces *size-budgeted parts* rather than one file, and treats the snapshot
|
|
18
18
|
as something that can go stale and be proven current. Its distinguishing features are a hard byte
|
|
@@ -24,8 +24,8 @@ If you want the most popular, most integrated tool: **use repomix.**
|
|
|
24
24
|
|
|
25
25
|
| | codebase-snapshot | repomix |
|
|
26
26
|
| :--- | :--- | :--- |
|
|
27
|
-
| Output shape | Multiple parts, each under a hard byte budget, plus a JSON manifest |
|
|
28
|
-
|
|
|
27
|
+
| Output shape | Multiple parts, each under a hard byte budget, plus a JSON manifest | One packed file (XML, Markdown or JSON), or several with `--split-output <size>` |
|
|
28
|
+
| Size control | **Yes** — `maxPartBytes` is a per-part byte ceiling; a file too large for one part is truncated with a marker naming the budget | `--split-output <size>` splits by output size, and `--token-budget <n>` exits non-zero above a token count |
|
|
29
29
|
| Reproducible output | Parts are byte-identical across runs; a fingerprint covers them | Content is stable; no published determinism guarantee |
|
|
30
30
|
| Staleness check | `validate` re-hashes the repository and exits non-zero on drift | Not a feature |
|
|
31
31
|
| Remote repositories | No — operates on a local checkout | **Yes** — packs a GitHub URL directly |
|
|
@@ -46,6 +46,10 @@ If you want the most popular, most integrated tool: **use repomix.**
|
|
|
46
46
|
purpose, and it can tell the agent whether the snapshot it is reading is still current.
|
|
47
47
|
- **You want the ecosystem.** More stars, more tutorials, more people who have already hit your
|
|
48
48
|
problem.
|
|
49
|
+
- **Your limit is a token count, not a byte count.** `--token-budget <n>` fails the run when the
|
|
50
|
+
packed output exceeds a tokenizer's count, which is the number a context window actually measures.
|
|
51
|
+
This project budgets bytes per part: exact, cheap to enforce, and one conversion away from the
|
|
52
|
+
token count you care about.
|
|
49
53
|
- **You are packing something enormous and prefer compression to budgets.** repomix's tree-sitter
|
|
50
54
|
compression mode is a different bet — shrink the content — and on very large repositories it may
|
|
51
55
|
suit you better than partitioning.
|
package/package.json
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-snapshot",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.18",
|
|
4
|
+
"description": "Create a codebase snapshot an LLM can read: budgeted Markdown parts for Claude, ChatGPT and Cursor, a manifest of every included and skipped file, secret redaction, and validate, which fails when the snapshot drifts. Local CLI and MCP server.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"codebase-snapshot",
|
|
6
7
|
"codebase",
|
|
7
8
|
"snapshot",
|
|
8
9
|
"llm",
|
|
9
|
-
"
|
|
10
|
-
"chatgpt",
|
|
11
|
-
"cursor",
|
|
12
|
-
"context-window",
|
|
10
|
+
"llm-context",
|
|
13
11
|
"repo-to-llm",
|
|
12
|
+
"codebase-to-markdown",
|
|
14
13
|
"codebase-to-prompt",
|
|
15
|
-
"
|
|
16
|
-
"token-efficiency",
|
|
14
|
+
"context-window",
|
|
17
15
|
"context-engineering",
|
|
18
|
-
"
|
|
16
|
+
"token-budget",
|
|
19
17
|
"mcp",
|
|
20
|
-
"model-context-protocol",
|
|
21
18
|
"mcp-server",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
19
|
+
"model-context-protocol",
|
|
20
|
+
"claude",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"cursor",
|
|
23
|
+
"chatgpt",
|
|
24
|
+
"secret-redaction",
|
|
25
|
+
"drift-detection"
|
|
29
26
|
],
|
|
30
27
|
"author": "Ankur Halder <ankur.halder12345@gmail.com>",
|
|
31
28
|
"license": "MIT",
|