codebase-snapshot 0.9.8 → 0.9.9
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 +42 -0
- package/README.md +1 -1
- package/dist/bin.js +41 -4
- package/dist/{chunk-RQKXZOD7.js → chunk-HQBEQ67K.js} +3 -3
- package/dist/{chunk-C24OAT6T.js → chunk-KUVFTJHK.js} +23 -6
- package/dist/cli.cjs +41 -4
- package/dist/cli.js +23 -3
- package/dist/index.cjs +22 -3
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/mcp.js +2 -2
- package/docs/cli.md +8 -3
- package/docs/mcp.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -21,6 +21,48 @@ Two versions exist on the registry that are not releases, and both are deprecate
|
|
|
21
21
|
Deleting them requires account-level rights that the release pipeline does not have, so they are
|
|
22
22
|
deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 since it existed.
|
|
23
23
|
|
|
24
|
+
## 0.9.9
|
|
25
|
+
|
|
26
|
+
### `snapshot -version` now answers the question it was asked
|
|
27
|
+
|
|
28
|
+
Reported from a real terminal, by someone trying to find out which version they had:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
> snapshot -version
|
|
32
|
+
❌ Unknown option '-e'. To specify a positional argument starting with a '-', place it at the
|
|
33
|
+
end of the command after '--', as in '-- "-e"'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
That message came from `node:util.parseArgs`, which reads `-version` as the short-flag cluster
|
|
37
|
+
`-v -e -r -s -i -o -n` and objects to the third character. It names something the caller never
|
|
38
|
+
typed, and it buries the actual mistake — one dash where two belong — which is exactly the
|
|
39
|
+
information a usage error exists to give.
|
|
40
|
+
|
|
41
|
+
Every token of that shape is now caught before the parser sees it and answered as a spelling
|
|
42
|
+
problem:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
❌ Unknown option '-version'. Options start with two dashes — did you mean '--version'?
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`-cwd`, `-help`, `-format` and `-dry-run` get the same treatment with their own long form
|
|
49
|
+
suggested. A token that is not an option at all (`-frobnicate`) is told to go after `--` instead of
|
|
50
|
+
being pointed at a `--frobnicate` that does not exist, and a cluster of short flags that *are* real
|
|
51
|
+
(`-vh`) still works.
|
|
52
|
+
|
|
53
|
+
### The update notice suggests the command that fits this copy
|
|
54
|
+
|
|
55
|
+
It said `npm install -g codebase-snapshot` to everybody, which is wrong for two of the three ways
|
|
56
|
+
people run this. `setup` deliberately adds the package as a **devDependency**, where `-g` installs a
|
|
57
|
+
second global copy that shadows the pinned one; an `npx` invocation is a cache entry that the next
|
|
58
|
+
`@latest` run replaces by itself.
|
|
59
|
+
|
|
60
|
+
The suggested command is now derived from the path Node is running: `-g` for a global install,
|
|
61
|
+
`npm install codebase-snapshot@latest` for a dependency of the project being worked in (npm rewrites
|
|
62
|
+
the entry where it already is, so a devDependency stays one), and `npx -y codebase-snapshot@latest`
|
|
63
|
+
for npx. The classification is `_npx` in the path for the cache, and `node_modules` under the
|
|
64
|
+
working directory for a local dependency — evidence rather than a guess.
|
|
65
|
+
|
|
24
66
|
## 0.9.8
|
|
25
67
|
|
|
26
68
|
### A wrapped menu no longer changes height under the cursor
|
package/README.md
CHANGED
|
@@ -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.9 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
|
@@ -4346,7 +4346,7 @@ function gitignorePath(cwd, filePath) {
|
|
|
4346
4346
|
|
|
4347
4347
|
// src/version.ts
|
|
4348
4348
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
4349
|
-
var GENERATOR_VERSION = "0.9.
|
|
4349
|
+
var GENERATOR_VERSION = "0.9.9";
|
|
4350
4350
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
4351
4351
|
function isOurGeneratorName(name) {
|
|
4352
4352
|
if (typeof name !== "string") return false;
|
|
@@ -6957,6 +6957,23 @@ var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
|
6957
6957
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
6958
6958
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
6959
6959
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
6960
|
+
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
6961
|
+
const normalise = (value) => value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
6962
|
+
const script = normalise(scriptPath);
|
|
6963
|
+
if (script === "") return "global";
|
|
6964
|
+
const scriptKey = script.toLowerCase();
|
|
6965
|
+
if (scriptKey.includes("/_npx/")) return "npx";
|
|
6966
|
+
const root = normalise(cwd).toLowerCase();
|
|
6967
|
+
if (scriptKey.includes("/node_modules/") && root !== "" && scriptKey.startsWith(`${root}/`)) {
|
|
6968
|
+
return "local";
|
|
6969
|
+
}
|
|
6970
|
+
return "global";
|
|
6971
|
+
}
|
|
6972
|
+
function updateCommand(kind) {
|
|
6973
|
+
if (kind === "npx") return "npx -y codebase-snapshot@latest";
|
|
6974
|
+
if (kind === "local") return "npm install codebase-snapshot@latest";
|
|
6975
|
+
return "npm install -g codebase-snapshot";
|
|
6976
|
+
}
|
|
6960
6977
|
function versionParts(value) {
|
|
6961
6978
|
const core = value.trim().replace(/^v/i, "").split("-")[0];
|
|
6962
6979
|
return core.split(".").map((part) => {
|
|
@@ -7105,9 +7122,9 @@ async function checkForUpdate(options) {
|
|
|
7105
7122
|
if (!latest) return null;
|
|
7106
7123
|
return isNewer(latest, options.current) ? { current: options.current, latest } : null;
|
|
7107
7124
|
}
|
|
7108
|
-
function formatUpdateNotice(notice) {
|
|
7125
|
+
function formatUpdateNotice(notice, kind) {
|
|
7109
7126
|
return `\u2191 codebase-snapshot ${notice.latest} is available \u2014 you have ${notice.current}.
|
|
7110
|
-
|
|
7127
|
+
${updateCommand(kind)}`;
|
|
7111
7128
|
}
|
|
7112
7129
|
|
|
7113
7130
|
// src/index.ts
|
|
@@ -11231,7 +11248,27 @@ function parseArtifactList(raw, flag) {
|
|
|
11231
11248
|
}
|
|
11232
11249
|
return names;
|
|
11233
11250
|
}
|
|
11251
|
+
var SHORT_FLAGS = new Set(
|
|
11252
|
+
Object.values(CLI_OPTIONS).map((spec) => spec.short).filter((short) => typeof short === "string").map((short) => `-${short}`)
|
|
11253
|
+
);
|
|
11254
|
+
function misdashedLongOption(argv) {
|
|
11255
|
+
for (const token of argv) {
|
|
11256
|
+
if (token === "--") break;
|
|
11257
|
+
if (!/^-[A-Za-z][A-Za-z0-9-]+$/.test(token)) continue;
|
|
11258
|
+
if ([...token.slice(1)].every((character) => SHORT_FLAGS.has(`-${character}`))) continue;
|
|
11259
|
+
return token;
|
|
11260
|
+
}
|
|
11261
|
+
return null;
|
|
11262
|
+
}
|
|
11234
11263
|
function parseCliArgs(argv) {
|
|
11264
|
+
const misdashed = misdashedLongOption(argv);
|
|
11265
|
+
if (misdashed !== null) {
|
|
11266
|
+
const long = `--${misdashed.slice(1)}`;
|
|
11267
|
+
const known = Object.prototype.hasOwnProperty.call(CLI_OPTIONS, misdashed.slice(1));
|
|
11268
|
+
throw new UsageError(
|
|
11269
|
+
known ? `Unknown option '${misdashed}'. Options start with two dashes \u2014 did you mean '${long}'?` : `Unknown option '${misdashed}'. Options start with two dashes; if '${misdashed}' is a path or an argument, put it after '--'.`
|
|
11270
|
+
);
|
|
11271
|
+
}
|
|
11235
11272
|
let parsed;
|
|
11236
11273
|
try {
|
|
11237
11274
|
parsed = parseArgs({
|
|
@@ -11813,7 +11850,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
11813
11850
|
if (pending) {
|
|
11814
11851
|
const notice = await pending;
|
|
11815
11852
|
if (notice) process.stderr.write(`
|
|
11816
|
-
${formatUpdateNotice(notice)}
|
|
11853
|
+
${formatUpdateNotice(notice, installKind())}
|
|
11817
11854
|
`);
|
|
11818
11855
|
}
|
|
11819
11856
|
return code;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GENERATOR_VERSION, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateSnapshot, validateSnapshot, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-
|
|
1
|
+
import { GENERATOR_VERSION, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateSnapshot, validateSnapshot, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-KUVFTJHK.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path2 from 'path';
|
|
4
4
|
|
|
@@ -2599,5 +2599,5 @@ async function runStdioServer(options) {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
|
|
2601
2601
|
export { COMMAND_OPTION_SCOPE, ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SKILL_NAME, SUPPORTED_PROTOCOL_VERSIONS, buildAgentContract, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, commandsForOption, createLineReader, createMcpServer, createServer, createSession, createWriter, inspectModernMeta, negotiateLegacyVersion, renderContractText, renderSkill, runStdioServer, validateArguments };
|
|
2602
|
-
//# sourceMappingURL=chunk-
|
|
2603
|
-
//# sourceMappingURL=chunk-
|
|
2602
|
+
//# sourceMappingURL=chunk-HQBEQ67K.js.map
|
|
2603
|
+
//# sourceMappingURL=chunk-HQBEQ67K.js.map
|
|
@@ -5474,7 +5474,7 @@ function validateSnapshot(configInput) {
|
|
|
5474
5474
|
|
|
5475
5475
|
// src/version.ts
|
|
5476
5476
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
5477
|
-
var GENERATOR_VERSION = "0.9.
|
|
5477
|
+
var GENERATOR_VERSION = "0.9.9";
|
|
5478
5478
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
5479
5479
|
function isOurGeneratorName(name) {
|
|
5480
5480
|
if (typeof name !== "string") return false;
|
|
@@ -5484,6 +5484,23 @@ var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
|
5484
5484
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
5485
5485
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
5486
5486
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
5487
|
+
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
5488
|
+
const normalise = (value) => value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
5489
|
+
const script = normalise(scriptPath);
|
|
5490
|
+
if (script === "") return "global";
|
|
5491
|
+
const scriptKey = script.toLowerCase();
|
|
5492
|
+
if (scriptKey.includes("/_npx/")) return "npx";
|
|
5493
|
+
const root = normalise(cwd).toLowerCase();
|
|
5494
|
+
if (scriptKey.includes("/node_modules/") && root !== "" && scriptKey.startsWith(`${root}/`)) {
|
|
5495
|
+
return "local";
|
|
5496
|
+
}
|
|
5497
|
+
return "global";
|
|
5498
|
+
}
|
|
5499
|
+
function updateCommand(kind) {
|
|
5500
|
+
if (kind === "npx") return "npx -y codebase-snapshot@latest";
|
|
5501
|
+
if (kind === "local") return "npm install codebase-snapshot@latest";
|
|
5502
|
+
return "npm install -g codebase-snapshot";
|
|
5503
|
+
}
|
|
5487
5504
|
function versionParts(value) {
|
|
5488
5505
|
const core = value.trim().replace(/^v/i, "").split("-")[0];
|
|
5489
5506
|
return core.split(".").map((part) => {
|
|
@@ -5632,9 +5649,9 @@ async function checkForUpdate(options) {
|
|
|
5632
5649
|
if (!latest) return null;
|
|
5633
5650
|
return isNewer(latest, options.current) ? { current: options.current, latest } : null;
|
|
5634
5651
|
}
|
|
5635
|
-
function formatUpdateNotice(notice) {
|
|
5652
|
+
function formatUpdateNotice(notice, kind) {
|
|
5636
5653
|
return `\u2191 codebase-snapshot ${notice.latest} is available \u2014 you have ${notice.current}.
|
|
5637
|
-
|
|
5654
|
+
${updateCommand(kind)}`;
|
|
5638
5655
|
}
|
|
5639
5656
|
function describeMatcher(matcher) {
|
|
5640
5657
|
if (typeof matcher === "string") return matcher;
|
|
@@ -8323,6 +8340,6 @@ async function generateSnapshotAsync(configInput, options) {
|
|
|
8323
8340
|
return generateSnapshot(configInput, options);
|
|
8324
8341
|
}
|
|
8325
8342
|
|
|
8326
|
-
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defaultIO, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, displayWidth, escapeControls, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findConfigFile, firstRunMessage, formatNumber, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, isBinaryBuffer, isBinaryExtension, isBinaryFile, isDiscoveryMode, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, unknownPresetMessage, validateSnapshot, wrapLines };
|
|
8327
|
-
//# sourceMappingURL=chunk-
|
|
8328
|
-
//# sourceMappingURL=chunk-
|
|
8343
|
+
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defaultIO, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, displayWidth, escapeControls, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findConfigFile, firstRunMessage, formatNumber, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, installKind, isBinaryBuffer, isBinaryExtension, isBinaryFile, isDiscoveryMode, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, unknownPresetMessage, updateCommand, validateSnapshot, wrapLines };
|
|
8344
|
+
//# sourceMappingURL=chunk-KUVFTJHK.js.map
|
|
8345
|
+
//# sourceMappingURL=chunk-KUVFTJHK.js.map
|
package/dist/cli.cjs
CHANGED
|
@@ -4340,7 +4340,7 @@ function gitignorePath(cwd, filePath) {
|
|
|
4340
4340
|
|
|
4341
4341
|
// src/version.ts
|
|
4342
4342
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
4343
|
-
var GENERATOR_VERSION = "0.9.
|
|
4343
|
+
var GENERATOR_VERSION = "0.9.9";
|
|
4344
4344
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
4345
4345
|
function isOurGeneratorName(name) {
|
|
4346
4346
|
if (typeof name !== "string") return false;
|
|
@@ -6921,6 +6921,23 @@ var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
|
6921
6921
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
6922
6922
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
6923
6923
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
6924
|
+
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
6925
|
+
const normalise = (value) => value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
6926
|
+
const script = normalise(scriptPath);
|
|
6927
|
+
if (script === "") return "global";
|
|
6928
|
+
const scriptKey = script.toLowerCase();
|
|
6929
|
+
if (scriptKey.includes("/_npx/")) return "npx";
|
|
6930
|
+
const root = normalise(cwd).toLowerCase();
|
|
6931
|
+
if (scriptKey.includes("/node_modules/") && root !== "" && scriptKey.startsWith(`${root}/`)) {
|
|
6932
|
+
return "local";
|
|
6933
|
+
}
|
|
6934
|
+
return "global";
|
|
6935
|
+
}
|
|
6936
|
+
function updateCommand(kind) {
|
|
6937
|
+
if (kind === "npx") return "npx -y codebase-snapshot@latest";
|
|
6938
|
+
if (kind === "local") return "npm install codebase-snapshot@latest";
|
|
6939
|
+
return "npm install -g codebase-snapshot";
|
|
6940
|
+
}
|
|
6924
6941
|
function versionParts(value) {
|
|
6925
6942
|
const core = value.trim().replace(/^v/i, "").split("-")[0];
|
|
6926
6943
|
return core.split(".").map((part) => {
|
|
@@ -7069,9 +7086,9 @@ async function checkForUpdate(options) {
|
|
|
7069
7086
|
if (!latest) return null;
|
|
7070
7087
|
return isNewer(latest, options.current) ? { current: options.current, latest } : null;
|
|
7071
7088
|
}
|
|
7072
|
-
function formatUpdateNotice(notice) {
|
|
7089
|
+
function formatUpdateNotice(notice, kind) {
|
|
7073
7090
|
return `\u2191 codebase-snapshot ${notice.latest} is available \u2014 you have ${notice.current}.
|
|
7074
|
-
|
|
7091
|
+
${updateCommand(kind)}`;
|
|
7075
7092
|
}
|
|
7076
7093
|
|
|
7077
7094
|
// src/index.ts
|
|
@@ -11184,7 +11201,27 @@ function parseArtifactList(raw, flag) {
|
|
|
11184
11201
|
}
|
|
11185
11202
|
return names;
|
|
11186
11203
|
}
|
|
11204
|
+
var SHORT_FLAGS = new Set(
|
|
11205
|
+
Object.values(CLI_OPTIONS).map((spec) => spec.short).filter((short) => typeof short === "string").map((short) => `-${short}`)
|
|
11206
|
+
);
|
|
11207
|
+
function misdashedLongOption(argv) {
|
|
11208
|
+
for (const token of argv) {
|
|
11209
|
+
if (token === "--") break;
|
|
11210
|
+
if (!/^-[A-Za-z][A-Za-z0-9-]+$/.test(token)) continue;
|
|
11211
|
+
if ([...token.slice(1)].every((character) => SHORT_FLAGS.has(`-${character}`))) continue;
|
|
11212
|
+
return token;
|
|
11213
|
+
}
|
|
11214
|
+
return null;
|
|
11215
|
+
}
|
|
11187
11216
|
function parseCliArgs(argv) {
|
|
11217
|
+
const misdashed = misdashedLongOption(argv);
|
|
11218
|
+
if (misdashed !== null) {
|
|
11219
|
+
const long = `--${misdashed.slice(1)}`;
|
|
11220
|
+
const known = Object.prototype.hasOwnProperty.call(CLI_OPTIONS, misdashed.slice(1));
|
|
11221
|
+
throw new UsageError(
|
|
11222
|
+
known ? `Unknown option '${misdashed}'. Options start with two dashes \u2014 did you mean '${long}'?` : `Unknown option '${misdashed}'. Options start with two dashes; if '${misdashed}' is a path or an argument, put it after '--'.`
|
|
11223
|
+
);
|
|
11224
|
+
}
|
|
11188
11225
|
let parsed;
|
|
11189
11226
|
try {
|
|
11190
11227
|
parsed = util.parseArgs({
|
|
@@ -11766,7 +11803,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
11766
11803
|
if (pending) {
|
|
11767
11804
|
const notice = await pending;
|
|
11768
11805
|
if (notice) process.stderr.write(`
|
|
11769
|
-
${formatUpdateNotice(notice)}
|
|
11806
|
+
${formatUpdateNotice(notice, installKind())}
|
|
11770
11807
|
`);
|
|
11771
11808
|
}
|
|
11772
11809
|
return code;
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-
|
|
2
|
-
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, PromptCancelled, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, findConfigFile, firstRunMessage, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-
|
|
1
|
+
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-HQBEQ67K.js';
|
|
2
|
+
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, PromptCancelled, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, findConfigFile, firstRunMessage, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-KUVFTJHK.js';
|
|
3
3
|
import { spawnSync } from 'child_process';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import * as path2 from 'path';
|
|
@@ -269,7 +269,27 @@ function parseArtifactList(raw, flag) {
|
|
|
269
269
|
}
|
|
270
270
|
return names;
|
|
271
271
|
}
|
|
272
|
+
var SHORT_FLAGS = new Set(
|
|
273
|
+
Object.values(CLI_OPTIONS).map((spec) => spec.short).filter((short) => typeof short === "string").map((short) => `-${short}`)
|
|
274
|
+
);
|
|
275
|
+
function misdashedLongOption(argv) {
|
|
276
|
+
for (const token of argv) {
|
|
277
|
+
if (token === "--") break;
|
|
278
|
+
if (!/^-[A-Za-z][A-Za-z0-9-]+$/.test(token)) continue;
|
|
279
|
+
if ([...token.slice(1)].every((character) => SHORT_FLAGS.has(`-${character}`))) continue;
|
|
280
|
+
return token;
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
272
284
|
function parseCliArgs(argv) {
|
|
285
|
+
const misdashed = misdashedLongOption(argv);
|
|
286
|
+
if (misdashed !== null) {
|
|
287
|
+
const long = `--${misdashed.slice(1)}`;
|
|
288
|
+
const known = Object.prototype.hasOwnProperty.call(CLI_OPTIONS, misdashed.slice(1));
|
|
289
|
+
throw new UsageError(
|
|
290
|
+
known ? `Unknown option '${misdashed}'. Options start with two dashes \u2014 did you mean '${long}'?` : `Unknown option '${misdashed}'. Options start with two dashes; if '${misdashed}' is a path or an argument, put it after '--'.`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
273
293
|
let parsed;
|
|
274
294
|
try {
|
|
275
295
|
parsed = parseArgs({
|
|
@@ -851,7 +871,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
851
871
|
if (pending) {
|
|
852
872
|
const notice = await pending;
|
|
853
873
|
if (notice) process.stderr.write(`
|
|
854
|
-
${formatUpdateNotice(notice)}
|
|
874
|
+
${formatUpdateNotice(notice, installKind())}
|
|
855
875
|
`);
|
|
856
876
|
}
|
|
857
877
|
return code;
|
package/dist/index.cjs
CHANGED
|
@@ -5490,7 +5490,7 @@ function validateSnapshot(configInput) {
|
|
|
5490
5490
|
|
|
5491
5491
|
// src/version.ts
|
|
5492
5492
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
5493
|
-
var GENERATOR_VERSION = "0.9.
|
|
5493
|
+
var GENERATOR_VERSION = "0.9.9";
|
|
5494
5494
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
5495
5495
|
function isOurGeneratorName(name) {
|
|
5496
5496
|
if (typeof name !== "string") return false;
|
|
@@ -5500,6 +5500,23 @@ var PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
|
5500
5500
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
5501
5501
|
var FAILURE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
5502
5502
|
var REQUEST_TIMEOUT_MS = 1200;
|
|
5503
|
+
function installKind(scriptPath = process.argv[1] ?? "", cwd = process.cwd()) {
|
|
5504
|
+
const normalise = (value) => value.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
5505
|
+
const script = normalise(scriptPath);
|
|
5506
|
+
if (script === "") return "global";
|
|
5507
|
+
const scriptKey = script.toLowerCase();
|
|
5508
|
+
if (scriptKey.includes("/_npx/")) return "npx";
|
|
5509
|
+
const root = normalise(cwd).toLowerCase();
|
|
5510
|
+
if (scriptKey.includes("/node_modules/") && root !== "" && scriptKey.startsWith(`${root}/`)) {
|
|
5511
|
+
return "local";
|
|
5512
|
+
}
|
|
5513
|
+
return "global";
|
|
5514
|
+
}
|
|
5515
|
+
function updateCommand(kind) {
|
|
5516
|
+
if (kind === "npx") return "npx -y codebase-snapshot@latest";
|
|
5517
|
+
if (kind === "local") return "npm install codebase-snapshot@latest";
|
|
5518
|
+
return "npm install -g codebase-snapshot";
|
|
5519
|
+
}
|
|
5503
5520
|
function versionParts(value) {
|
|
5504
5521
|
const core = value.trim().replace(/^v/i, "").split("-")[0];
|
|
5505
5522
|
return core.split(".").map((part) => {
|
|
@@ -5648,9 +5665,9 @@ async function checkForUpdate(options) {
|
|
|
5648
5665
|
if (!latest) return null;
|
|
5649
5666
|
return isNewer(latest, options.current) ? { current: options.current, latest } : null;
|
|
5650
5667
|
}
|
|
5651
|
-
function formatUpdateNotice(notice) {
|
|
5668
|
+
function formatUpdateNotice(notice, kind) {
|
|
5652
5669
|
return `\u2191 codebase-snapshot ${notice.latest} is available \u2014 you have ${notice.current}.
|
|
5653
|
-
|
|
5670
|
+
${updateCommand(kind)}`;
|
|
5654
5671
|
}
|
|
5655
5672
|
function describeMatcher(matcher) {
|
|
5656
5673
|
if (typeof matcher === "string") return matcher;
|
|
@@ -8378,6 +8395,7 @@ exports.generateSnapshotAsync = generateSnapshotAsync;
|
|
|
8378
8395
|
exports.getPreset = getPreset;
|
|
8379
8396
|
exports.globToRegExp = globToRegExp;
|
|
8380
8397
|
exports.hasPriorSnapshot = hasPriorSnapshot;
|
|
8398
|
+
exports.installKind = installKind;
|
|
8381
8399
|
exports.isBinaryBuffer = isBinaryBuffer;
|
|
8382
8400
|
exports.isBinaryExtension = isBinaryExtension;
|
|
8383
8401
|
exports.isBinaryFile = isBinaryFile;
|
|
@@ -8415,6 +8433,7 @@ exports.summarizeWithProfile = summarizeWithProfile;
|
|
|
8415
8433
|
exports.supportsTypeScriptImports = supportsTypeScriptImports;
|
|
8416
8434
|
exports.truncatePreview = truncatePreview;
|
|
8417
8435
|
exports.truncateToBytes = truncateToBytes;
|
|
8436
|
+
exports.updateCommand = updateCommand;
|
|
8418
8437
|
exports.validateSnapshot = validateSnapshot;
|
|
8419
8438
|
exports.wrapLines = wrapLines;
|
|
8420
8439
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -422,7 +422,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
422
422
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
423
423
|
*/
|
|
424
424
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
425
|
-
declare const GENERATOR_VERSION = "0.9.
|
|
425
|
+
declare const GENERATOR_VERSION = "0.9.9";
|
|
426
426
|
|
|
427
427
|
/** The one endpoint this package will ever request. */
|
|
428
428
|
declare const PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
@@ -441,6 +441,22 @@ interface UpdateNotice {
|
|
|
441
441
|
current: string;
|
|
442
442
|
latest: string;
|
|
443
443
|
}
|
|
444
|
+
/** How the running copy of the tool was reached, which decides how to replace it. */
|
|
445
|
+
type InstallKind = "global" | "local" | "npx";
|
|
446
|
+
/**
|
|
447
|
+
* Classifies the script path Node is running.
|
|
448
|
+
*
|
|
449
|
+
* The notice used to tell everybody to run `npm install -g codebase-snapshot`, and that is wrong
|
|
450
|
+
* for two of the three ways people run this. A repository that added it as a devDependency —
|
|
451
|
+
* which is exactly what `setup` does — does not want a second global copy shadowing its pinned
|
|
452
|
+
* one, and an `npx` invocation is a cache entry that the next `@latest` run replaces by itself.
|
|
453
|
+
*
|
|
454
|
+
* The path is the evidence, because it is available without asking npm anything: `_npx` is npm's
|
|
455
|
+
* own cache directory name, and a local dependency lives under the project's `node_modules`.
|
|
456
|
+
*/
|
|
457
|
+
declare function installKind(scriptPath?: string, cwd?: string): InstallKind;
|
|
458
|
+
/** The command that replaces this copy with the published latest. */
|
|
459
|
+
declare function updateCommand(kind: InstallKind): string;
|
|
444
460
|
interface UpdateCheckOptions {
|
|
445
461
|
current: string;
|
|
446
462
|
/** Absolute path to the cache file. */
|
|
@@ -473,7 +489,7 @@ declare function fetchLatestVersion(url?: string, timeoutMs?: number): Promise<s
|
|
|
473
489
|
*/
|
|
474
490
|
declare function checkForUpdate(options: UpdateCheckOptions): Promise<UpdateNotice | null>;
|
|
475
491
|
/** The two lines a user sees, or an empty string when there is nothing to say. */
|
|
476
|
-
declare function formatUpdateNotice(notice: UpdateNotice): string;
|
|
492
|
+
declare function formatUpdateNotice(notice: UpdateNotice, kind: InstallKind): string;
|
|
477
493
|
|
|
478
494
|
declare const DEFAULT_SECRET_PATTERNS: SecretRule[];
|
|
479
495
|
|
|
@@ -879,4 +895,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
879
895
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
880
896
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
881
897
|
|
|
882
|
-
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, 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, type HeuristicResult, type InitDependency, type InitOptions, type InitResult, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, 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, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot, wrapLines };
|
|
898
|
+
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, 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, type HeuristicResult, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, 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, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, installKind, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, updateCommand, validateSnapshot, wrapLines };
|
package/dist/index.d.ts
CHANGED
|
@@ -422,7 +422,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
422
422
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
423
423
|
*/
|
|
424
424
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
425
|
-
declare const GENERATOR_VERSION = "0.9.
|
|
425
|
+
declare const GENERATOR_VERSION = "0.9.9";
|
|
426
426
|
|
|
427
427
|
/** The one endpoint this package will ever request. */
|
|
428
428
|
declare const PACKAGE_LATEST_URL = "https://registry.npmjs.org/codebase-snapshot/latest";
|
|
@@ -441,6 +441,22 @@ interface UpdateNotice {
|
|
|
441
441
|
current: string;
|
|
442
442
|
latest: string;
|
|
443
443
|
}
|
|
444
|
+
/** How the running copy of the tool was reached, which decides how to replace it. */
|
|
445
|
+
type InstallKind = "global" | "local" | "npx";
|
|
446
|
+
/**
|
|
447
|
+
* Classifies the script path Node is running.
|
|
448
|
+
*
|
|
449
|
+
* The notice used to tell everybody to run `npm install -g codebase-snapshot`, and that is wrong
|
|
450
|
+
* for two of the three ways people run this. A repository that added it as a devDependency —
|
|
451
|
+
* which is exactly what `setup` does — does not want a second global copy shadowing its pinned
|
|
452
|
+
* one, and an `npx` invocation is a cache entry that the next `@latest` run replaces by itself.
|
|
453
|
+
*
|
|
454
|
+
* The path is the evidence, because it is available without asking npm anything: `_npx` is npm's
|
|
455
|
+
* own cache directory name, and a local dependency lives under the project's `node_modules`.
|
|
456
|
+
*/
|
|
457
|
+
declare function installKind(scriptPath?: string, cwd?: string): InstallKind;
|
|
458
|
+
/** The command that replaces this copy with the published latest. */
|
|
459
|
+
declare function updateCommand(kind: InstallKind): string;
|
|
444
460
|
interface UpdateCheckOptions {
|
|
445
461
|
current: string;
|
|
446
462
|
/** Absolute path to the cache file. */
|
|
@@ -473,7 +489,7 @@ declare function fetchLatestVersion(url?: string, timeoutMs?: number): Promise<s
|
|
|
473
489
|
*/
|
|
474
490
|
declare function checkForUpdate(options: UpdateCheckOptions): Promise<UpdateNotice | null>;
|
|
475
491
|
/** The two lines a user sees, or an empty string when there is nothing to say. */
|
|
476
|
-
declare function formatUpdateNotice(notice: UpdateNotice): string;
|
|
492
|
+
declare function formatUpdateNotice(notice: UpdateNotice, kind: InstallKind): string;
|
|
477
493
|
|
|
478
494
|
declare const DEFAULT_SECRET_PATTERNS: SecretRule[];
|
|
479
495
|
|
|
@@ -879,4 +895,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
879
895
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
880
896
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
881
897
|
|
|
882
|
-
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, 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, type HeuristicResult, type InitDependency, type InitOptions, type InitResult, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, 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, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot, wrapLines };
|
|
898
|
+
export { ARTIFACT_NAMES, ArtifactSelection, ByteSize, CHECK_INTERVAL_MS, 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, type HeuristicResult, type InitDependency, type InitOptions, type InitResult, type InstallKind, JsonSummary, KindRule, LANGUAGE_PROFILES, type LanguageProfile, LayerRule, MIN_MAX_PART_BYTES, 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, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, installKind, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, updateCommand, validateSnapshot, wrapLines };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot, wrapLines } from './chunk-
|
|
1
|
+
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayWidth, explainPath, fenceForContent, fenceForText, fetchLatestVersion, firstRunMessage, formatUpdateNotice, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, hasPriorSnapshot, installKind, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, shouldCheck, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, updateCommand, validateSnapshot, wrapLines } from './chunk-KUVFTJHK.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/mcp.cjs
CHANGED
|
@@ -6128,7 +6128,7 @@ function validateSnapshot(configInput) {
|
|
|
6128
6128
|
|
|
6129
6129
|
// src/version.ts
|
|
6130
6130
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
6131
|
-
var GENERATOR_VERSION = "0.9.
|
|
6131
|
+
var GENERATOR_VERSION = "0.9.9";
|
|
6132
6132
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
6133
6133
|
function isOurGeneratorName(name) {
|
|
6134
6134
|
if (typeof name !== "string") return false;
|
package/dist/mcp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, inspectModernMeta, negotiateLegacyVersion, runStdioServer, validateArguments } from './chunk-
|
|
2
|
-
import './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, inspectModernMeta, negotiateLegacyVersion, runStdioServer, validateArguments } from './chunk-HQBEQ67K.js';
|
|
2
|
+
import './chunk-KUVFTJHK.js';
|
|
3
3
|
//# sourceMappingURL=mcp.js.map
|
|
4
4
|
//# sourceMappingURL=mcp.js.map
|
package/docs/cli.md
CHANGED
|
@@ -174,7 +174,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
|
|
|
174
174
|
🚀 Setup for: /path/to/repo
|
|
175
175
|
✅ Created snapshot.config.ts (preset: nextjs)
|
|
176
176
|
Added npm scripts: snapshot, snapshot:validate
|
|
177
|
-
Added devDependency: codebase-snapshot ^0.9.
|
|
177
|
+
Added devDependency: codebase-snapshot ^0.9.9
|
|
178
178
|
Added to .gitignore: snapshot/, snapshot.tmp/
|
|
179
179
|
⏳ Installing dependencies…
|
|
180
180
|
✅ Installed dependencies (npm install, 2.1s)
|
|
@@ -211,7 +211,7 @@ It also has three side effects on files you own, and it says so when it does the
|
|
|
211
211
|
```
|
|
212
212
|
✅ Created snapshot.config.ts (preset: node-lib)
|
|
213
213
|
Added npm scripts: snapshot, snapshot:validate
|
|
214
|
-
Added devDependency: codebase-snapshot ^0.9.
|
|
214
|
+
Added devDependency: codebase-snapshot ^0.9.9
|
|
215
215
|
Added to .gitignore: snapshot/, snapshot.tmp/
|
|
216
216
|
```
|
|
217
217
|
|
|
@@ -491,10 +491,15 @@ Once a day, after a command finishes, `snapshot` asks the npm registry whether a
|
|
|
491
491
|
published and prints two lines on stderr if there is one:
|
|
492
492
|
|
|
493
493
|
```
|
|
494
|
-
↑ codebase-snapshot 0.9.
|
|
494
|
+
↑ codebase-snapshot 0.9.8 is available — you have 0.9.7.
|
|
495
495
|
npm install -g codebase-snapshot
|
|
496
496
|
```
|
|
497
497
|
|
|
498
|
+
The second line names the command that would actually replace *this* copy: `-g` for a global
|
|
499
|
+
install, a plain `npm install codebase-snapshot@latest` when the package is a dependency of the
|
|
500
|
+
project being worked in, and `npx -y codebase-snapshot@latest` when it was reached through `npx` —
|
|
501
|
+
a global install would leave a second copy shadowing the pinned one.
|
|
502
|
+
|
|
498
503
|
The request goes to `registry.npmjs.org/codebase-snapshot/latest`, carries no identifier of any
|
|
499
504
|
kind, and its answer is remembered for 24 hours — one request per machine per day at most. It is
|
|
500
505
|
skipped when stdout is not a terminal, in CI, in any `--format json` run, and in `mcp`, whose server
|
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.9 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.9", "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.9 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-snapshot",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"description": "Pack a codebase for an LLM into budgeted Markdown parts, with a manifest of every file and skip, and validate to prove the snapshot is current.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codebase",
|