codebase-snapshot 0.19.0 → 0.20.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/CHANGELOG.md CHANGED
@@ -30,6 +30,16 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
30
30
 
31
31
  ---
32
32
 
33
+ ## 0.20.0
34
+
35
+ **`snapshot update` did not bypass the cache, which is the one thing it promises.**
36
+
37
+ - The command forces a check, but `resolveLatest` let the cache-age branch overwrite the `force`
38
+ decision. While the registry's edge still served the previous document, a cached `0.18.0` made
39
+ `snapshot update` print "the registry publishes 0.18.0" for up to an hour after 0.19.0 was live.
40
+ - `force` now wins: the cache is read only as a **fallback** for a failed request, never as the
41
+ answer, and the age intervals are skipped entirely. A test with an injected cache and fetch pins
42
+ both halves — the forced answer, and the cached fallback when the request fails.
33
43
  ## 0.19.0
34
44
 
35
45
  **The audit now agrees with the generator about what a secret is.**
package/README.md CHANGED
@@ -211,7 +211,7 @@ Everything an agent needs is available as data, and the tool can install its own
211
211
  ```bash
212
212
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
213
213
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
214
- npx -y codebase-snapshot@0.19.0 mcp # or serve it over MCP
214
+ npx -y codebase-snapshot@0.20.0 mcp # or serve it over MCP
215
215
  ```
216
216
 
217
217
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
package/SECURITY.md CHANGED
@@ -6,11 +6,11 @@ Only the latest published release receives security fixes.
6
6
 
7
7
  | Version | Supported |
8
8
  | :--- | :--- |
9
- | <!--@majorMinor-->0.19<!--/@majorMinor-->.x | ✅ |
9
+ | <!--@majorMinor-->0.20<!--/@majorMinor-->.x | ✅ |
10
10
  | anything older | ❌ |
11
11
 
12
12
  The number line restarted at 0.9.0 when the package moved to the unscoped `codebase-snapshot` name,
13
- so <!--@majorMinor-->0.19<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
13
+ so <!--@majorMinor-->0.20<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
14
14
  [changelog](CHANGELOG.md#a-note-on-version-numbers).
15
15
 
16
16
  ## Reporting a vulnerability
package/dist/bin.js CHANGED
@@ -2199,7 +2199,7 @@ function applySpansKeepingQuotes(line, spans) {
2199
2199
 
2200
2200
  // src/version.ts
2201
2201
  var GENERATOR_NAME = "codebase-snapshot";
2202
- var GENERATOR_VERSION = "0.19.0";
2202
+ var GENERATOR_VERSION = "0.20.0";
2203
2203
  var SCHEMA_VERSION = "3.0.0";
2204
2204
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
2205
2205
  function isOurGeneratorName(name) {
@@ -18530,7 +18530,8 @@ async function resolveLatest(options) {
18530
18530
  try {
18531
18531
  const cached = readCache(options.cacheFile);
18532
18532
  let needsFetch = cached === null || options.force === true;
18533
- if (cached) {
18533
+ if (cached) latest = cached.latest;
18534
+ if (cached && options.force !== true) {
18534
18535
  const age = now() - cached.checkedAt;
18535
18536
  if (cached.latest === null) {
18536
18537
  needsFetch = age >= FAILURE_INTERVAL_MS;
@@ -1,4 +1,4 @@
1
- import { createServer, buildTools, GENERATOR_VERSION } from './chunk-RTWSGQ3U.js';
1
+ import { createServer, buildTools, GENERATOR_VERSION } from './chunk-S27VYVC4.js';
2
2
  import * as http from 'http';
3
3
  import * as crypto from 'crypto';
4
4
 
@@ -4002,7 +4002,7 @@ function applySpansKeepingQuotes(line, spans) {
4002
4002
 
4003
4003
  // src/version.ts
4004
4004
  var GENERATOR_NAME = "codebase-snapshot";
4005
- var GENERATOR_VERSION = "0.19.0";
4005
+ var GENERATOR_VERSION = "0.20.0";
4006
4006
  var SCHEMA_VERSION = "3.0.0";
4007
4007
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
4008
4008
  function isOurGeneratorName(name) {
@@ -16906,7 +16906,8 @@ async function resolveLatest(options) {
16906
16906
  try {
16907
16907
  const cached = readCache(options.cacheFile);
16908
16908
  let needsFetch = cached === null || options.force === true;
16909
- if (cached) {
16909
+ if (cached) latest = cached.latest;
16910
+ if (cached && options.force !== true) {
16910
16911
  const age = now() - cached.checkedAt;
16911
16912
  if (cached.latest === null) {
16912
16913
  needsFetch = age >= FAILURE_INTERVAL_MS;
package/dist/cli.cjs CHANGED
@@ -2229,7 +2229,7 @@ function applySpansKeepingQuotes(line, spans) {
2229
2229
 
2230
2230
  // src/version.ts
2231
2231
  var GENERATOR_NAME = "codebase-snapshot";
2232
- var GENERATOR_VERSION = "0.19.0";
2232
+ var GENERATOR_VERSION = "0.20.0";
2233
2233
  var SCHEMA_VERSION = "3.0.0";
2234
2234
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
2235
2235
  function isOurGeneratorName(name) {
@@ -18404,7 +18404,8 @@ async function resolveLatest(options) {
18404
18404
  try {
18405
18405
  const cached = readCache(options.cacheFile);
18406
18406
  let needsFetch = cached === null || options.force === true;
18407
- if (cached) {
18407
+ if (cached) latest = cached.latest;
18408
+ if (cached && options.force !== true) {
18408
18409
  const age = now() - cached.checkedAt;
18409
18410
  if (cached.latest === null) {
18410
18411
  needsFetch = age >= FAILURE_INTERVAL_MS;
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
- import { startHttpTransport } from './chunk-TQXTKDFD.js';
2
- import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo, signManifest, loadSigningKey, writeSignature, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, COMMAND_OPTION_SCOPE, commandsForOption, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, SKILL_NAME, renderSkill, resolveLatest, isNewer, updateCommand, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, runWithStdoutCapture, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderContractText, renderExplainText } from './chunk-RTWSGQ3U.js';
3
- export { buildAgentContract } from './chunk-RTWSGQ3U.js';
1
+ import { startHttpTransport } from './chunk-JCGCY6R3.js';
2
+ import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo, signManifest, loadSigningKey, writeSignature, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, COMMAND_OPTION_SCOPE, commandsForOption, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, SKILL_NAME, renderSkill, resolveLatest, isNewer, updateCommand, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, runWithStdoutCapture, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderContractText, renderExplainText } from './chunk-S27VYVC4.js';
3
+ export { buildAgentContract } from './chunk-S27VYVC4.js';
4
4
  import { spawnSync } from 'child_process';
5
5
  import * as fs2 from 'fs';
6
6
  import * as path2 from 'path';
package/dist/index.cjs CHANGED
@@ -4020,7 +4020,7 @@ function applySpansKeepingQuotes(line, spans) {
4020
4020
 
4021
4021
  // src/version.ts
4022
4022
  var GENERATOR_NAME = "codebase-snapshot";
4023
- var GENERATOR_VERSION = "0.19.0";
4023
+ var GENERATOR_VERSION = "0.20.0";
4024
4024
  var SCHEMA_VERSION = "3.0.0";
4025
4025
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
4026
4026
  function isOurGeneratorName(name) {
@@ -16604,7 +16604,8 @@ async function resolveLatest(options) {
16604
16604
  try {
16605
16605
  const cached = readCache(options.cacheFile);
16606
16606
  let needsFetch = cached === null || options.force === true;
16607
- if (cached) {
16607
+ if (cached) latest = cached.latest;
16608
+ if (cached && options.force !== true) {
16608
16609
  const age = now() - cached.checkedAt;
16609
16610
  if (cached.latest === null) {
16610
16611
  needsFetch = age >= FAILURE_INTERVAL_MS;
@@ -20705,6 +20706,7 @@ exports.renderExplainText = renderExplainText;
20705
20706
  exports.renumberParts = renumberParts;
20706
20707
  exports.resolveChangedScope = resolveChangedScope;
20707
20708
  exports.resolveConfig = resolveConfig;
20709
+ exports.resolveLatest = resolveLatest;
20708
20710
  exports.resolveSafeOutputDirs = resolveSafeOutputDirs;
20709
20711
  exports.resolveSpecifier = resolveSpecifier;
20710
20712
  exports.runInit = runInit;
package/dist/index.d.cts CHANGED
@@ -554,7 +554,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
554
554
  * `package.json` carries the same version; `npm run verify` compares the two.
555
555
  */
556
556
  declare const GENERATOR_NAME = "codebase-snapshot";
557
- declare const GENERATOR_VERSION = "0.19.0";
557
+ declare const GENERATOR_VERSION = "0.20.0";
558
558
  /**
559
559
  * The manifest and ownership-marker schema this build writes and understands.
560
560
  *
@@ -790,6 +790,14 @@ declare function fetchLatestVersion(url?: string, timeoutMs?: number): Promise<s
790
790
  * Never throws: the caller runs this alongside a real command and must not be affected by it.
791
791
  */
792
792
  declare function checkForUpdate(options: UpdateCheckOptions): Promise<UpdateNotice | null>;
793
+ /**
794
+ * The published version, from the cache when it is fresh or the registry when it is not.
795
+ *
796
+ * `checkForUpdate` only answers "is there a newer one"; `snapshot update` has to print the
797
+ * version it compared against even when the answer is no, so the cache and fetch rules live here
798
+ * once and both callers share them.
799
+ */
800
+ declare function resolveLatest(options: UpdateCheckOptions): Promise<string | null>;
793
801
  /** The two lines a user sees, or an empty string when there is nothing to say. */
794
802
  declare function formatUpdateNotice(notice: UpdateNotice, kind: InstallKind): string;
795
803
 
@@ -1520,4 +1528,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
1520
1528
  /** Promise-returning wrapper for consumers that prefer an async call site. */
1521
1529
  declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
1522
1530
 
1523
- export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, type CloneOptions, type CloneResult, 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, type ParsedSource, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, type RemoteSource, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, type ServeHandle, type ServeOptions, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, type ZipEntry, type ZipOptions, anchorForPath, appendGitignoreEntries, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, wrapLines, writeZip };
1531
+ export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, type CloneOptions, type CloneResult, 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, type ParsedSource, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, type RemoteSource, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, type ServeHandle, type ServeOptions, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, type ZipEntry, type ZipOptions, anchorForPath, appendGitignoreEntries, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveLatest, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, wrapLines, writeZip };
package/dist/index.d.ts CHANGED
@@ -554,7 +554,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
554
554
  * `package.json` carries the same version; `npm run verify` compares the two.
555
555
  */
556
556
  declare const GENERATOR_NAME = "codebase-snapshot";
557
- declare const GENERATOR_VERSION = "0.19.0";
557
+ declare const GENERATOR_VERSION = "0.20.0";
558
558
  /**
559
559
  * The manifest and ownership-marker schema this build writes and understands.
560
560
  *
@@ -790,6 +790,14 @@ declare function fetchLatestVersion(url?: string, timeoutMs?: number): Promise<s
790
790
  * Never throws: the caller runs this alongside a real command and must not be affected by it.
791
791
  */
792
792
  declare function checkForUpdate(options: UpdateCheckOptions): Promise<UpdateNotice | null>;
793
+ /**
794
+ * The published version, from the cache when it is fresh or the registry when it is not.
795
+ *
796
+ * `checkForUpdate` only answers "is there a newer one"; `snapshot update` has to print the
797
+ * version it compared against even when the answer is no, so the cache and fetch rules live here
798
+ * once and both callers share them.
799
+ */
800
+ declare function resolveLatest(options: UpdateCheckOptions): Promise<string | null>;
793
801
  /** The two lines a user sees, or an empty string when there is nothing to say. */
794
802
  declare function formatUpdateNotice(notice: UpdateNotice, kind: InstallKind): string;
795
803
 
@@ -1520,4 +1528,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
1520
1528
  /** Promise-returning wrapper for consumers that prefer an async call site. */
1521
1529
  declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
1522
1530
 
1523
- export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, type CloneOptions, type CloneResult, 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, type ParsedSource, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, type RemoteSource, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, type ServeHandle, type ServeOptions, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, type ZipEntry, type ZipOptions, anchorForPath, appendGitignoreEntries, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, wrapLines, writeZip };
1531
+ export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, CONFIG_KEYS, type ChangedScope, type ChangedScopeRequest, CliOptions, type CloneOptions, type CloneResult, 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, type ParsedSource, PartMetadata, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, type RemoteSource, ResolvedSnapshotConfig, SCHEMA_VERSION, SecretFinding, SecretRule, type ServeHandle, type ServeOptions, SkipRecord, SnapshotConfig, SourceSummary, TextEncoding, UP_TO_DATE_INTERVAL_MS, type UpdateCheckOptions, type UpdateNotice, ValidationResult, type WizardAnswers, type ZipEntry, type ZipOptions, anchorForPath, appendGitignoreEntries, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveLatest, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, wrapLines, writeZip };
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, UP_TO_DATE_INTERVAL_MS, anchorForPath, appendGitignoreEntries, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, workerEntry, wrapLines, writeZip } from './chunk-RTWSGQ3U.js';
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, assertPublicHost, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, cloneRepository, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, crc32, 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, isPrivateHost, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, makeCloneDirectory, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, parseRemoteSource, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveLatest, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, startWebServer, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, walkFiles, workerEntry, wrapLines, writeZip } from './chunk-S27VYVC4.js';
package/dist/mcp.cjs CHANGED
@@ -2556,7 +2556,7 @@ function applySpansKeepingQuotes(line, spans) {
2556
2556
 
2557
2557
  // src/version.ts
2558
2558
  var GENERATOR_NAME = "codebase-snapshot";
2559
- var GENERATOR_VERSION = "0.19.0";
2559
+ var GENERATOR_VERSION = "0.20.0";
2560
2560
  var SCHEMA_VERSION = "3.0.0";
2561
2561
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
2562
2562
  function isOurGeneratorName(name) {
package/dist/mcp.js CHANGED
@@ -1,2 +1,2 @@
1
- export { generateToken, startHttpTransport } from './chunk-TQXTKDFD.js';
2
- export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, REPORT_RESOURCE_URIS, RESOURCE_TEMPLATE_URIS, SERVER_INSTRUCTIONS, STATIC_RESOURCE_URIS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, generateInWorker, inspectModernMeta, isCommentStrippable, negotiateLegacyVersion, parsePartSections, runStdioServer, stripComments, validateArguments, windowText } from './chunk-RTWSGQ3U.js';
1
+ export { generateToken, startHttpTransport } from './chunk-JCGCY6R3.js';
2
+ export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, REPORT_RESOURCE_URIS, RESOURCE_TEMPLATE_URIS, SERVER_INSTRUCTIONS, STATIC_RESOURCE_URIS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, generateInWorker, inspectModernMeta, isCommentStrippable, negotiateLegacyVersion, parsePartSections, runStdioServer, stripComments, validateArguments, windowText } from './chunk-S27VYVC4.js';
package/docs/cli.md CHANGED
@@ -98,7 +98,7 @@ Exit `0` when the snapshot passes its own integrity check, `1` when it does not.
98
98
 
99
99
  ```
100
100
  📸 Generating snapshot for: /path/to/repo
101
- Branch: main (fallback) | Part budget: 300 KB | Generator: 0.19.0 (project dependency ^0.19.0)
101
+ Branch: main (fallback) | Part budget: 300 KB | Generator: 0.20.0 (project dependency ^0.20.0)
102
102
 
103
103
  ✅ Snapshot generated in 0.14s:
104
104
  - Tracked files: 121 included of 128 paths found — 7 skipped (default-ignore 5, binary 1, sensitive-file 1); every one is listed in snapshot/reports/audit.md
@@ -219,7 +219,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
219
219
  🚀 Setup for: /path/to/repo
220
220
  ✅ Created snapshot.config.ts (preset: nextjs)
221
221
  Added npm scripts: snapshot, snapshot:validate
222
- Added devDependency: codebase-snapshot ^0.19.0
222
+ Added devDependency: codebase-snapshot ^0.20.0
223
223
  Added to .gitignore: /snapshot/, /snapshot.tmp/
224
224
  ⏳ Installing dependencies…
225
225
  ✅ Installed dependencies (npm install, 2.1s)
@@ -271,7 +271,7 @@ It also has three side effects on files you own, and it says so when it does the
271
271
  ```
272
272
  ✅ Created snapshot.config.ts (preset: node-lib)
273
273
  Added npm scripts: snapshot, snapshot:validate
274
- Added devDependency: codebase-snapshot ^0.19.0
274
+ Added devDependency: codebase-snapshot ^0.20.0
275
275
  Added to .gitignore: /snapshot/, /snapshot.tmp/
276
276
  ```
277
277
 
@@ -421,8 +421,8 @@ agent](agent.md).
421
421
  Ask the npm registry whether a newer release exists, and print the version it compared against:
422
422
 
423
423
  ```bash
424
- npx codebase-snapshot@0.19.0 update # is 0.17.0 still current? print the answer
425
- npx codebase-snapshot@0.19.0 update --format json
424
+ npx codebase-snapshot@0.20.0 update # is 0.17.0 still current? print the answer
425
+ npx codebase-snapshot@0.20.0 update --format json
426
426
  ```
427
427
 
428
428
  ```text
package/docs/deploy.md CHANGED
@@ -61,8 +61,8 @@ After=network.target
61
61
  Type=oneshot
62
62
  User=deploy
63
63
  WorkingDirectory=/srv/app
64
- ExecStart=/usr/bin/npx -y codebase-snapshot@0.19.0 generate --cwd /srv/app
65
- ExecStartPost=/usr/bin/npx -y codebase-snapshot@0.19.0 validate --cwd /srv/app
64
+ ExecStart=/usr/bin/npx -y codebase-snapshot@0.20.0 generate --cwd /srv/app
65
+ ExecStartPost=/usr/bin/npx -y codebase-snapshot@0.20.0 validate --cwd /srv/app
66
66
  ```
67
67
 
68
68
  ```ini
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.19.0 mcp
13
+ npx -y codebase-snapshot@0.20.0 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.19.0", "mcp", "--cwd", "/absolute/path/to/repo"]
28
+ "args": ["-y", "codebase-snapshot@0.20.0", "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.19.0 mcp --cwd /absolute/path/to/repo
37
+ claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.20.0 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
@@ -43,7 +43,7 @@ there, and clients that spawn without a shell cannot execute it directly.
43
43
  ## Over HTTP, for clients that cannot spawn a process
44
44
 
45
45
  ```bash
46
- npx -y codebase-snapshot@0.19.0 mcp --http --port 4789
46
+ npx -y codebase-snapshot@0.20.0 mcp --http --port 4789
47
47
  ```
48
48
 
49
49
  This is the Streamable HTTP shape: POST one JSON-RPC message (or an array) to `/mcp` and read
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-snapshot",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
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
6
  "codebase-snapshot",