codebase-snapshot 0.16.0 → 0.18.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/dist/index.d.cts CHANGED
@@ -1,11 +1,17 @@
1
- import { S as SecretRule, D as DiscoveryMode, a as SkipRecord, J as JsonSummary, M as MarkdownSummary, b as SourceSummary, K as KindRule, L as LayerRule, R as ResolvedSnapshotConfig, c as SnapshotConfig, B as ByteSize, C as CliOptions, d as PartMetadata, F as FileEntry, T as TextEncoding, e as SecretFinding, V as ValidationResult, f as Manifest, A as ArtifactSelection } from './types-Cr5H2Y3t.cjs';
2
- export { g as BudgetConfig, H as HooksConfig, I as InclusionMode, h as IncompleteFile, i as ManifestArtifact, j as ManifestConfigSnapshot, k as ManifestIndexes, l as ManifestTotals, m as Mode, O as OutputFormat, n as OwnerBrief, o as PartFileEntry, P as PromptTask, p as ResolvedArtifacts, q as ResolvedBudgets, r as SecretRuleInput, s as SkipReason, t as SummaryQuality, u as TruncationReason, v as ValidationDrift } from './types-Cr5H2Y3t.cjs';
3
- export { w as workerEntry } from './generate-worker-B79yGkQO.cjs';
1
+ import { S as SecretRule, D as DiscoveryMode, a as SkipRecord, J as JsonSummary, M as MarkdownSummary, b as SourceSummary, K as KindRule, L as LayerRule, R as ResolvedSnapshotConfig, c as SnapshotConfig, B as ByteSize, C as CliOptions, d as PartMetadata, F as FileEntry, T as TextEncoding, e as SecretFinding, V as ValidationResult, f as Manifest, A as ArtifactSelection } from './types-Drw1J0e0.cjs';
2
+ export { g as BudgetConfig, H as HooksConfig, I as InclusionMode, h as IncompleteFile, i as ManifestArtifact, j as ManifestConfigSnapshot, k as ManifestIndexes, l as ManifestTotals, m as Mode, O as OutputFormat, n as OwnerBrief, o as PartFileEntry, P as PromptTask, p as ResolvedArtifacts, q as ResolvedBudgets, r as SecretRuleInput, s as SkipReason, t as SummaryQuality, u as TruncationReason, v as ValidationDrift } from './types-Drw1J0e0.cjs';
3
+ export { w as workerEntry } from './generate-worker-C6Z1I0XS.cjs';
4
4
 
5
5
  interface GitInfo {
6
6
  branch: string;
7
7
  commit: string;
8
8
  isDirty: boolean;
9
+ /**
10
+ * Whether `branch` came from git. In a directory that is not a repository (or on a detached
11
+ * HEAD) the configured fallback is recorded instead, and a reader who is not told that cannot
12
+ * distinguish "on main" from "there is no main here".
13
+ */
14
+ branchFromGit: boolean;
9
15
  }
10
16
 
11
17
  interface CollectOptions {
@@ -548,7 +554,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
548
554
  * `package.json` carries the same version; `npm run verify` compares the two.
549
555
  */
550
556
  declare const GENERATOR_NAME = "codebase-snapshot";
551
- declare const GENERATOR_VERSION = "0.16.0";
557
+ declare const GENERATOR_VERSION = "0.18.0";
552
558
  /**
553
559
  * The manifest and ownership-marker schema this build writes and understands.
554
560
  *
@@ -641,7 +647,8 @@ declare function makeCloneDirectory(): string;
641
647
  * - Loopback by default, a bearer token always (generated on first run, printed once). The page
642
648
  * asks for the token and keeps it in localStorage, so serving / can never leak the credential.
643
649
  * - The API only ever writes where a person pointed it: a local path that exists, with the
644
- * default settings. A remote URL is refused with a message that says what is missing, rather
650
+ * repository's own JSON settings and its executable config refused. A remote URL is refused
651
+ * with a message that says what is missing, rather
645
652
  * than pretending to fetch.
646
653
  * - Every response is bounded. The preview is the first 64 KiB of PROMPT.md, the file list is
647
654
  * capped, the zip is built in memory and streamed once.
@@ -698,12 +705,19 @@ declare const UP_TO_DATE_INTERVAL_MS: number;
698
705
  /**
699
706
  * How long a *failed* check is remembered.
700
707
  *
701
- * Shorter than the success interval on purpose: one offline moment must not hide a release for a
702
- * day, and one hostile network must not cause a retry on every single run.
708
+ * One offline moment must not hide a release for a day, and one hostile network must not cause a
709
+ * retry on every single run. An hour was on the wrong side of that trade — a transient failure
710
+ * made every run in the next hour silent, which is indistinguishable from "you are current" —
711
+ * so the memory is five minutes, and `snapshot update` bypasses it entirely.
703
712
  */
704
713
  declare const FAILURE_INTERVAL_MS: number;
705
- /** Bounds the whole request. A slow registry is not the user's problem. */
706
- declare const REQUEST_TIMEOUT_MS = 1200;
714
+ /**
715
+ * Bounds the whole request. A slow registry is not the user's problem — but neither is a notice
716
+ * nobody sees: 1.2 s was short enough that a cold registry or a slow DNS answer turned into a
717
+ * cached failure, and a cached failure is silence for the next hour. The request overlaps the
718
+ * command, so a longer deadline costs nothing on real work and only bounds the tail.
719
+ */
720
+ declare const REQUEST_TIMEOUT_MS = 2500;
707
721
  interface UpdateNotice {
708
722
  current: string;
709
723
  latest: string;
@@ -733,6 +747,10 @@ interface UpdateCheckOptions {
733
747
  /** Returns the published version, or null when it could not be determined. */
734
748
  fetchLatest?: (url: string, timeoutMs: number) => Promise<string | null>;
735
749
  enabled?: boolean;
750
+ /** The registry document to read; `PACKAGE_LATEST_URL` unless a mirror is configured. */
751
+ latestUrl?: string;
752
+ /** Ignore the cache and ask now — what `snapshot update` does. */
753
+ force?: boolean;
736
754
  }
737
755
  /**
738
756
  * True when `candidate` is a version worth telling somebody about.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,17 @@
1
- import { S as SecretRule, D as DiscoveryMode, a as SkipRecord, J as JsonSummary, M as MarkdownSummary, b as SourceSummary, K as KindRule, L as LayerRule, R as ResolvedSnapshotConfig, c as SnapshotConfig, B as ByteSize, C as CliOptions, d as PartMetadata, F as FileEntry, T as TextEncoding, e as SecretFinding, V as ValidationResult, f as Manifest, A as ArtifactSelection } from './types-Cr5H2Y3t.js';
2
- export { g as BudgetConfig, H as HooksConfig, I as InclusionMode, h as IncompleteFile, i as ManifestArtifact, j as ManifestConfigSnapshot, k as ManifestIndexes, l as ManifestTotals, m as Mode, O as OutputFormat, n as OwnerBrief, o as PartFileEntry, P as PromptTask, p as ResolvedArtifacts, q as ResolvedBudgets, r as SecretRuleInput, s as SkipReason, t as SummaryQuality, u as TruncationReason, v as ValidationDrift } from './types-Cr5H2Y3t.js';
3
- export { w as workerEntry } from './generate-worker-B79yGkQO.js';
1
+ import { S as SecretRule, D as DiscoveryMode, a as SkipRecord, J as JsonSummary, M as MarkdownSummary, b as SourceSummary, K as KindRule, L as LayerRule, R as ResolvedSnapshotConfig, c as SnapshotConfig, B as ByteSize, C as CliOptions, d as PartMetadata, F as FileEntry, T as TextEncoding, e as SecretFinding, V as ValidationResult, f as Manifest, A as ArtifactSelection } from './types-Drw1J0e0.js';
2
+ export { g as BudgetConfig, H as HooksConfig, I as InclusionMode, h as IncompleteFile, i as ManifestArtifact, j as ManifestConfigSnapshot, k as ManifestIndexes, l as ManifestTotals, m as Mode, O as OutputFormat, n as OwnerBrief, o as PartFileEntry, P as PromptTask, p as ResolvedArtifacts, q as ResolvedBudgets, r as SecretRuleInput, s as SkipReason, t as SummaryQuality, u as TruncationReason, v as ValidationDrift } from './types-Drw1J0e0.js';
3
+ export { w as workerEntry } from './generate-worker-C6Z1I0XS.js';
4
4
 
5
5
  interface GitInfo {
6
6
  branch: string;
7
7
  commit: string;
8
8
  isDirty: boolean;
9
+ /**
10
+ * Whether `branch` came from git. In a directory that is not a repository (or on a detached
11
+ * HEAD) the configured fallback is recorded instead, and a reader who is not told that cannot
12
+ * distinguish "on main" from "there is no main here".
13
+ */
14
+ branchFromGit: boolean;
9
15
  }
10
16
 
11
17
  interface CollectOptions {
@@ -548,7 +554,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
548
554
  * `package.json` carries the same version; `npm run verify` compares the two.
549
555
  */
550
556
  declare const GENERATOR_NAME = "codebase-snapshot";
551
- declare const GENERATOR_VERSION = "0.16.0";
557
+ declare const GENERATOR_VERSION = "0.18.0";
552
558
  /**
553
559
  * The manifest and ownership-marker schema this build writes and understands.
554
560
  *
@@ -641,7 +647,8 @@ declare function makeCloneDirectory(): string;
641
647
  * - Loopback by default, a bearer token always (generated on first run, printed once). The page
642
648
  * asks for the token and keeps it in localStorage, so serving / can never leak the credential.
643
649
  * - The API only ever writes where a person pointed it: a local path that exists, with the
644
- * default settings. A remote URL is refused with a message that says what is missing, rather
650
+ * repository's own JSON settings and its executable config refused. A remote URL is refused
651
+ * with a message that says what is missing, rather
645
652
  * than pretending to fetch.
646
653
  * - Every response is bounded. The preview is the first 64 KiB of PROMPT.md, the file list is
647
654
  * capped, the zip is built in memory and streamed once.
@@ -698,12 +705,19 @@ declare const UP_TO_DATE_INTERVAL_MS: number;
698
705
  /**
699
706
  * How long a *failed* check is remembered.
700
707
  *
701
- * Shorter than the success interval on purpose: one offline moment must not hide a release for a
702
- * day, and one hostile network must not cause a retry on every single run.
708
+ * One offline moment must not hide a release for a day, and one hostile network must not cause a
709
+ * retry on every single run. An hour was on the wrong side of that trade — a transient failure
710
+ * made every run in the next hour silent, which is indistinguishable from "you are current" —
711
+ * so the memory is five minutes, and `snapshot update` bypasses it entirely.
703
712
  */
704
713
  declare const FAILURE_INTERVAL_MS: number;
705
- /** Bounds the whole request. A slow registry is not the user's problem. */
706
- declare const REQUEST_TIMEOUT_MS = 1200;
714
+ /**
715
+ * Bounds the whole request. A slow registry is not the user's problem — but neither is a notice
716
+ * nobody sees: 1.2 s was short enough that a cold registry or a slow DNS answer turned into a
717
+ * cached failure, and a cached failure is silence for the next hour. The request overlaps the
718
+ * command, so a longer deadline costs nothing on real work and only bounds the tail.
719
+ */
720
+ declare const REQUEST_TIMEOUT_MS = 2500;
707
721
  interface UpdateNotice {
708
722
  current: string;
709
723
  latest: string;
@@ -733,6 +747,10 @@ interface UpdateCheckOptions {
733
747
  /** Returns the published version, or null when it could not be determined. */
734
748
  fetchLatest?: (url: string, timeoutMs: number) => Promise<string | null>;
735
749
  enabled?: boolean;
750
+ /** The registry document to read; `PACKAGE_LATEST_URL` unless a mirror is configured. */
751
+ latestUrl?: string;
752
+ /** Ignore the cache and ask now — what `snapshot update` does. */
753
+ force?: boolean;
736
754
  }
737
755
  /**
738
756
  * True when `candidate` is a version worth telling somebody about.
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-AEGJYOCF.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, 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-VMRKUSXL.js';