codebase-snapshot 0.9.6 → 0.9.8
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 +51 -0
- package/README.md +1 -1
- package/dist/bin.js +69 -3
- package/dist/{chunk-3KUL3QRH.js → chunk-C24OAT6T.js} +72 -6
- package/dist/{chunk-ZKZOGGM3.js → chunk-RQKXZOD7.js} +3 -3
- package/dist/cli.cjs +69 -3
- package/dist/cli.js +2 -2
- package/dist/index.cjs +72 -3
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/mcp.js +2 -2
- package/docs/cli.md +2 -2
- package/docs/mcp.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -21,6 +21,57 @@ 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.8
|
|
25
|
+
|
|
26
|
+
### A wrapped menu no longer changes height under the cursor
|
|
27
|
+
|
|
28
|
+
Found while checking 0.9.7, by rendering it at 48 columns. The wrapping added there made a frame
|
|
29
|
+
the height it claimed to be, but the wrap point was measured from a line's leading whitespace — and
|
|
30
|
+
a selected row starts ` ❯ ` while an unselected one starts ` `. So the same hint wrapped one
|
|
31
|
+
word differently depending on whether the cursor was on it, and at some widths the whole menu grew
|
|
32
|
+
a row as you moved through it.
|
|
33
|
+
|
|
34
|
+
Continuation rows now line up with the *content*: the marker gutter is measured rather than guessed,
|
|
35
|
+
which keeps the wrap stable — and puts a wrapped hint under the label instead of two columns past
|
|
36
|
+
it, which reads better at any width.
|
|
37
|
+
|
|
38
|
+
`tests/wizard-frame.test.js` now also asserts that five repaints of the same menu are all the same
|
|
39
|
+
height, at 48 columns: the width where it used to flicker.
|
|
40
|
+
|
|
41
|
+
## 0.9.7
|
|
42
|
+
|
|
43
|
+
### The setup menu stops eating its own screen
|
|
44
|
+
|
|
45
|
+
Reported with a screenshot from a terminal about 70 columns wide: every keypress on `snapshot`'s
|
|
46
|
+
first question added another `◆ How should I set this up?` line, until 28 of them were piled above
|
|
47
|
+
the live menu.
|
|
48
|
+
|
|
49
|
+
The wizard repaints a prompt in place by moving the cursor up by the height of the last frame it
|
|
50
|
+
drew — and it counted that height in *lines*, while a terminal lays out *rows*. The recommended
|
|
51
|
+
answer carries the hint `node-lib · config · npm scripts · install · generate`, which makes that
|
|
52
|
+
line 83 cells wide. In a narrow terminal the terminal wrapped it into two rows itself, so the frame
|
|
53
|
+
was one row taller than the erase believed, and moving up one row short left the top of the old
|
|
54
|
+
frame behind. Every keypress. Notice that the leftover was always exactly one line: the question.
|
|
55
|
+
|
|
56
|
+
Frames are now wrapped to the visible width before they are drawn, so the height that is counted is
|
|
57
|
+
the height that is shown. Continuation lines keep their indent, a token longer than the line breaks
|
|
58
|
+
rather than overflowing it, and the width is re-read on every draw so a window that changed size is
|
|
59
|
+
measured as it is now rather than as it was. Two cells of slack are left for `◆ ❯ ◻ ←`, which some
|
|
60
|
+
fonts draw double-width.
|
|
61
|
+
|
|
62
|
+
No existing test could have caught this: every one of them pinned `columns` to 120, where nothing
|
|
63
|
+
wraps and the two counts agree. `tests/wizard-frame.test.js` drives the real wizard at 70, 60 and 50
|
|
64
|
+
columns, replays the escape sequences through a small terminal simulator, and asserts that the
|
|
65
|
+
screen shows one question rather than one per keypress. Putting the old arithmetic back turns three
|
|
66
|
+
of its seven tests red.
|
|
67
|
+
|
|
68
|
+
### Install pins in the docs are now maintained, not remembered
|
|
69
|
+
|
|
70
|
+
`docs/mcp.md` told clients to run `codebase-snapshot@0.9.6` in four places that have to change at
|
|
71
|
+
every release, and a comment marker cannot live inside a JSON fence. `sync-docs` now rewrites any
|
|
72
|
+
`codebase-snapshot@x.y.z` pin and the `Added devDependency:` examples by shape, so the next release
|
|
73
|
+
cannot leave a copy-pasteable snippet pointing at an old version. `@latest` is untouched.
|
|
74
|
+
|
|
24
75
|
## 0.9.6
|
|
25
76
|
|
|
26
77
|
### It tells you when it is out of date
|
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.8 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.8";
|
|
4350
4350
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
4351
4351
|
function isOurGeneratorName(name) {
|
|
4352
4352
|
if (typeof name !== "string") return false;
|
|
@@ -4509,6 +4509,59 @@ function toggleIndex(selected, index) {
|
|
|
4509
4509
|
else next.add(index);
|
|
4510
4510
|
return next;
|
|
4511
4511
|
}
|
|
4512
|
+
function isWideCodePoint(code) {
|
|
4513
|
+
return code >= 4352 && code <= 4447 || // Hangul Jamo
|
|
4514
|
+
code >= 11904 && code <= 12350 || // CJK radicals, Kangxi, CJK symbols
|
|
4515
|
+
code >= 12353 && code <= 13311 || // kana through CJK compatibility
|
|
4516
|
+
code >= 13312 && code <= 19903 || // CJK extension A
|
|
4517
|
+
code >= 19968 && code <= 40959 || // CJK unified ideographs
|
|
4518
|
+
code >= 40960 && code <= 42191 || // Yi
|
|
4519
|
+
code >= 44032 && code <= 55203 || // Hangul syllables
|
|
4520
|
+
code >= 63744 && code <= 64255 || // CJK compatibility ideographs
|
|
4521
|
+
code >= 65072 && code <= 65135 || // CJK compatibility forms
|
|
4522
|
+
code >= 65280 && code <= 65376 || // fullwidth forms
|
|
4523
|
+
code >= 65504 && code <= 65510 || code >= 127744 && code <= 129535 || // emoji and pictographs
|
|
4524
|
+
code >= 131072 && code <= 262141;
|
|
4525
|
+
}
|
|
4526
|
+
var ANSI_PATTERN = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
4527
|
+
function displayWidth(line) {
|
|
4528
|
+
let width = 0;
|
|
4529
|
+
for (const character of line.replace(ANSI_PATTERN, "")) {
|
|
4530
|
+
width += isWideCodePoint(character.codePointAt(0) ?? 0) ? 2 : 1;
|
|
4531
|
+
}
|
|
4532
|
+
return width;
|
|
4533
|
+
}
|
|
4534
|
+
var GUTTER_PATTERN = /^[ \t]*(?:[❯◆◻◼▏✖][ \t]+)*/;
|
|
4535
|
+
function wrapOneLine(line, limit) {
|
|
4536
|
+
if (displayWidth(line) <= limit) return [line];
|
|
4537
|
+
const gutter = GUTTER_PATTERN.exec(line)?.[0] ?? "";
|
|
4538
|
+
const gutterWidth = displayWidth(gutter);
|
|
4539
|
+
const continuation = " ".repeat(gutterWidth);
|
|
4540
|
+
const rows = [];
|
|
4541
|
+
let prefix = gutter;
|
|
4542
|
+
let rest = line.slice(gutter.length).trimEnd();
|
|
4543
|
+
while (rest.length > 0) {
|
|
4544
|
+
const room = limit - displayWidth(prefix);
|
|
4545
|
+
if (room <= 0 || displayWidth(rest) <= room) {
|
|
4546
|
+
rows.push(prefix + rest);
|
|
4547
|
+
break;
|
|
4548
|
+
}
|
|
4549
|
+
let cut = room;
|
|
4550
|
+
const space = rest.slice(0, room).lastIndexOf(" ");
|
|
4551
|
+
if (space > 0) cut = space;
|
|
4552
|
+
const taken = rest.slice(0, cut).trimEnd();
|
|
4553
|
+
rows.push(`${prefix}${taken.length > 0 ? taken : rest.slice(0, cut)}`);
|
|
4554
|
+
rest = rest.slice(cut).trimStart();
|
|
4555
|
+
prefix = continuation;
|
|
4556
|
+
}
|
|
4557
|
+
return rows;
|
|
4558
|
+
}
|
|
4559
|
+
function wrapLines(text2, limit) {
|
|
4560
|
+
const width = Math.max(8, Math.floor(limit));
|
|
4561
|
+
const rows = [];
|
|
4562
|
+
for (const line of text2.split("\n")) rows.push(...wrapOneLine(line, width));
|
|
4563
|
+
return rows;
|
|
4564
|
+
}
|
|
4512
4565
|
function marker(active) {
|
|
4513
4566
|
return active ? "\u276F" : " ";
|
|
4514
4567
|
}
|
|
@@ -4586,14 +4639,27 @@ var Frame = class {
|
|
|
4586
4639
|
drawn = 0;
|
|
4587
4640
|
draw(text2) {
|
|
4588
4641
|
this.erase();
|
|
4589
|
-
this.
|
|
4642
|
+
const rows = wrapLines(text2, this.width());
|
|
4643
|
+
this.output.write(`${rows.join("\n")}
|
|
4590
4644
|
`);
|
|
4591
|
-
this.drawn =
|
|
4645
|
+
this.drawn = rows.length;
|
|
4592
4646
|
}
|
|
4593
4647
|
erase() {
|
|
4594
4648
|
if (this.drawn > 0) this.output.write(`\x1B[${this.drawn}A\x1B[0J`);
|
|
4595
4649
|
this.drawn = 0;
|
|
4596
4650
|
}
|
|
4651
|
+
/**
|
|
4652
|
+
* The usable width, in cells.
|
|
4653
|
+
*
|
|
4654
|
+
* Two cells of slack: an ambiguous-width glyph (`◆`, `❯`, `←`) renders two cells in some fonts
|
|
4655
|
+
* and one in others, and a row that lands exactly on the last column is the one case a terminal
|
|
4656
|
+
* may or may not wrap. Below that, a line cannot reach the edge to begin with.
|
|
4657
|
+
*/
|
|
4658
|
+
width() {
|
|
4659
|
+
const columns = this.output.columns;
|
|
4660
|
+
if (typeof columns !== "number" || !Number.isFinite(columns) || columns <= 0) return 80;
|
|
4661
|
+
return Math.max(8, Math.floor(columns) - 2);
|
|
4662
|
+
}
|
|
4597
4663
|
};
|
|
4598
4664
|
function isCancel(key) {
|
|
4599
4665
|
return key.ctrl === true && key.name === "c" || key.ctrl === true && key.name === "d";
|
|
@@ -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.8";
|
|
5478
5478
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
5479
5479
|
function isOurGeneratorName(name) {
|
|
5480
5480
|
if (typeof name !== "string") return false;
|
|
@@ -6228,6 +6228,59 @@ function toggleIndex(selected, index) {
|
|
|
6228
6228
|
else next.add(index);
|
|
6229
6229
|
return next;
|
|
6230
6230
|
}
|
|
6231
|
+
function isWideCodePoint(code) {
|
|
6232
|
+
return code >= 4352 && code <= 4447 || // Hangul Jamo
|
|
6233
|
+
code >= 11904 && code <= 12350 || // CJK radicals, Kangxi, CJK symbols
|
|
6234
|
+
code >= 12353 && code <= 13311 || // kana through CJK compatibility
|
|
6235
|
+
code >= 13312 && code <= 19903 || // CJK extension A
|
|
6236
|
+
code >= 19968 && code <= 40959 || // CJK unified ideographs
|
|
6237
|
+
code >= 40960 && code <= 42191 || // Yi
|
|
6238
|
+
code >= 44032 && code <= 55203 || // Hangul syllables
|
|
6239
|
+
code >= 63744 && code <= 64255 || // CJK compatibility ideographs
|
|
6240
|
+
code >= 65072 && code <= 65135 || // CJK compatibility forms
|
|
6241
|
+
code >= 65280 && code <= 65376 || // fullwidth forms
|
|
6242
|
+
code >= 65504 && code <= 65510 || code >= 127744 && code <= 129535 || // emoji and pictographs
|
|
6243
|
+
code >= 131072 && code <= 262141;
|
|
6244
|
+
}
|
|
6245
|
+
var ANSI_PATTERN = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
6246
|
+
function displayWidth(line) {
|
|
6247
|
+
let width = 0;
|
|
6248
|
+
for (const character of line.replace(ANSI_PATTERN, "")) {
|
|
6249
|
+
width += isWideCodePoint(character.codePointAt(0) ?? 0) ? 2 : 1;
|
|
6250
|
+
}
|
|
6251
|
+
return width;
|
|
6252
|
+
}
|
|
6253
|
+
var GUTTER_PATTERN = /^[ \t]*(?:[❯◆◻◼▏✖][ \t]+)*/;
|
|
6254
|
+
function wrapOneLine(line, limit) {
|
|
6255
|
+
if (displayWidth(line) <= limit) return [line];
|
|
6256
|
+
const gutter = GUTTER_PATTERN.exec(line)?.[0] ?? "";
|
|
6257
|
+
const gutterWidth = displayWidth(gutter);
|
|
6258
|
+
const continuation = " ".repeat(gutterWidth);
|
|
6259
|
+
const rows = [];
|
|
6260
|
+
let prefix = gutter;
|
|
6261
|
+
let rest = line.slice(gutter.length).trimEnd();
|
|
6262
|
+
while (rest.length > 0) {
|
|
6263
|
+
const room = limit - displayWidth(prefix);
|
|
6264
|
+
if (room <= 0 || displayWidth(rest) <= room) {
|
|
6265
|
+
rows.push(prefix + rest);
|
|
6266
|
+
break;
|
|
6267
|
+
}
|
|
6268
|
+
let cut = room;
|
|
6269
|
+
const space = rest.slice(0, room).lastIndexOf(" ");
|
|
6270
|
+
if (space > 0) cut = space;
|
|
6271
|
+
const taken = rest.slice(0, cut).trimEnd();
|
|
6272
|
+
rows.push(`${prefix}${taken.length > 0 ? taken : rest.slice(0, cut)}`);
|
|
6273
|
+
rest = rest.slice(cut).trimStart();
|
|
6274
|
+
prefix = continuation;
|
|
6275
|
+
}
|
|
6276
|
+
return rows;
|
|
6277
|
+
}
|
|
6278
|
+
function wrapLines(text2, limit) {
|
|
6279
|
+
const width = Math.max(8, Math.floor(limit));
|
|
6280
|
+
const rows = [];
|
|
6281
|
+
for (const line of text2.split("\n")) rows.push(...wrapOneLine(line, width));
|
|
6282
|
+
return rows;
|
|
6283
|
+
}
|
|
6231
6284
|
function marker(active) {
|
|
6232
6285
|
return active ? "\u276F" : " ";
|
|
6233
6286
|
}
|
|
@@ -6305,14 +6358,27 @@ var Frame = class {
|
|
|
6305
6358
|
drawn = 0;
|
|
6306
6359
|
draw(text2) {
|
|
6307
6360
|
this.erase();
|
|
6308
|
-
this.
|
|
6361
|
+
const rows = wrapLines(text2, this.width());
|
|
6362
|
+
this.output.write(`${rows.join("\n")}
|
|
6309
6363
|
`);
|
|
6310
|
-
this.drawn =
|
|
6364
|
+
this.drawn = rows.length;
|
|
6311
6365
|
}
|
|
6312
6366
|
erase() {
|
|
6313
6367
|
if (this.drawn > 0) this.output.write(`\x1B[${this.drawn}A\x1B[0J`);
|
|
6314
6368
|
this.drawn = 0;
|
|
6315
6369
|
}
|
|
6370
|
+
/**
|
|
6371
|
+
* The usable width, in cells.
|
|
6372
|
+
*
|
|
6373
|
+
* Two cells of slack: an ambiguous-width glyph (`◆`, `❯`, `←`) renders two cells in some fonts
|
|
6374
|
+
* and one in others, and a row that lands exactly on the last column is the one case a terminal
|
|
6375
|
+
* may or may not wrap. Below that, a line cannot reach the edge to begin with.
|
|
6376
|
+
*/
|
|
6377
|
+
width() {
|
|
6378
|
+
const columns = this.output.columns;
|
|
6379
|
+
if (typeof columns !== "number" || !Number.isFinite(columns) || columns <= 0) return 80;
|
|
6380
|
+
return Math.max(8, Math.floor(columns) - 2);
|
|
6381
|
+
}
|
|
6316
6382
|
};
|
|
6317
6383
|
function isCancel(key) {
|
|
6318
6384
|
return key.ctrl === true && key.name === "c" || key.ctrl === true && key.name === "d";
|
|
@@ -8257,6 +8323,6 @@ async function generateSnapshotAsync(configInput, options) {
|
|
|
8257
8323
|
return generateSnapshot(configInput, options);
|
|
8258
8324
|
}
|
|
8259
8325
|
|
|
8260
|
-
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, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defaultIO, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, 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 };
|
|
8261
|
-
//# sourceMappingURL=chunk-
|
|
8262
|
-
//# sourceMappingURL=chunk-
|
|
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-C24OAT6T.js.map
|
|
8328
|
+
//# sourceMappingURL=chunk-C24OAT6T.js.map
|
|
@@ -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-C24OAT6T.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-RQKXZOD7.js.map
|
|
2603
|
+
//# sourceMappingURL=chunk-RQKXZOD7.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.8";
|
|
4344
4344
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
4345
4345
|
function isOurGeneratorName(name) {
|
|
4346
4346
|
if (typeof name !== "string") return false;
|
|
@@ -4496,6 +4496,59 @@ function toggleIndex(selected, index) {
|
|
|
4496
4496
|
else next.add(index);
|
|
4497
4497
|
return next;
|
|
4498
4498
|
}
|
|
4499
|
+
function isWideCodePoint(code) {
|
|
4500
|
+
return code >= 4352 && code <= 4447 || // Hangul Jamo
|
|
4501
|
+
code >= 11904 && code <= 12350 || // CJK radicals, Kangxi, CJK symbols
|
|
4502
|
+
code >= 12353 && code <= 13311 || // kana through CJK compatibility
|
|
4503
|
+
code >= 13312 && code <= 19903 || // CJK extension A
|
|
4504
|
+
code >= 19968 && code <= 40959 || // CJK unified ideographs
|
|
4505
|
+
code >= 40960 && code <= 42191 || // Yi
|
|
4506
|
+
code >= 44032 && code <= 55203 || // Hangul syllables
|
|
4507
|
+
code >= 63744 && code <= 64255 || // CJK compatibility ideographs
|
|
4508
|
+
code >= 65072 && code <= 65135 || // CJK compatibility forms
|
|
4509
|
+
code >= 65280 && code <= 65376 || // fullwidth forms
|
|
4510
|
+
code >= 65504 && code <= 65510 || code >= 127744 && code <= 129535 || // emoji and pictographs
|
|
4511
|
+
code >= 131072 && code <= 262141;
|
|
4512
|
+
}
|
|
4513
|
+
var ANSI_PATTERN = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
4514
|
+
function displayWidth(line) {
|
|
4515
|
+
let width = 0;
|
|
4516
|
+
for (const character of line.replace(ANSI_PATTERN, "")) {
|
|
4517
|
+
width += isWideCodePoint(character.codePointAt(0) ?? 0) ? 2 : 1;
|
|
4518
|
+
}
|
|
4519
|
+
return width;
|
|
4520
|
+
}
|
|
4521
|
+
var GUTTER_PATTERN = /^[ \t]*(?:[❯◆◻◼▏✖][ \t]+)*/;
|
|
4522
|
+
function wrapOneLine(line, limit) {
|
|
4523
|
+
if (displayWidth(line) <= limit) return [line];
|
|
4524
|
+
const gutter = GUTTER_PATTERN.exec(line)?.[0] ?? "";
|
|
4525
|
+
const gutterWidth = displayWidth(gutter);
|
|
4526
|
+
const continuation = " ".repeat(gutterWidth);
|
|
4527
|
+
const rows = [];
|
|
4528
|
+
let prefix = gutter;
|
|
4529
|
+
let rest = line.slice(gutter.length).trimEnd();
|
|
4530
|
+
while (rest.length > 0) {
|
|
4531
|
+
const room = limit - displayWidth(prefix);
|
|
4532
|
+
if (room <= 0 || displayWidth(rest) <= room) {
|
|
4533
|
+
rows.push(prefix + rest);
|
|
4534
|
+
break;
|
|
4535
|
+
}
|
|
4536
|
+
let cut = room;
|
|
4537
|
+
const space = rest.slice(0, room).lastIndexOf(" ");
|
|
4538
|
+
if (space > 0) cut = space;
|
|
4539
|
+
const taken = rest.slice(0, cut).trimEnd();
|
|
4540
|
+
rows.push(`${prefix}${taken.length > 0 ? taken : rest.slice(0, cut)}`);
|
|
4541
|
+
rest = rest.slice(cut).trimStart();
|
|
4542
|
+
prefix = continuation;
|
|
4543
|
+
}
|
|
4544
|
+
return rows;
|
|
4545
|
+
}
|
|
4546
|
+
function wrapLines(text2, limit) {
|
|
4547
|
+
const width = Math.max(8, Math.floor(limit));
|
|
4548
|
+
const rows = [];
|
|
4549
|
+
for (const line of text2.split("\n")) rows.push(...wrapOneLine(line, width));
|
|
4550
|
+
return rows;
|
|
4551
|
+
}
|
|
4499
4552
|
function marker(active) {
|
|
4500
4553
|
return active ? "\u276F" : " ";
|
|
4501
4554
|
}
|
|
@@ -4573,14 +4626,27 @@ var Frame = class {
|
|
|
4573
4626
|
drawn = 0;
|
|
4574
4627
|
draw(text2) {
|
|
4575
4628
|
this.erase();
|
|
4576
|
-
this.
|
|
4629
|
+
const rows = wrapLines(text2, this.width());
|
|
4630
|
+
this.output.write(`${rows.join("\n")}
|
|
4577
4631
|
`);
|
|
4578
|
-
this.drawn =
|
|
4632
|
+
this.drawn = rows.length;
|
|
4579
4633
|
}
|
|
4580
4634
|
erase() {
|
|
4581
4635
|
if (this.drawn > 0) this.output.write(`\x1B[${this.drawn}A\x1B[0J`);
|
|
4582
4636
|
this.drawn = 0;
|
|
4583
4637
|
}
|
|
4638
|
+
/**
|
|
4639
|
+
* The usable width, in cells.
|
|
4640
|
+
*
|
|
4641
|
+
* Two cells of slack: an ambiguous-width glyph (`◆`, `❯`, `←`) renders two cells in some fonts
|
|
4642
|
+
* and one in others, and a row that lands exactly on the last column is the one case a terminal
|
|
4643
|
+
* may or may not wrap. Below that, a line cannot reach the edge to begin with.
|
|
4644
|
+
*/
|
|
4645
|
+
width() {
|
|
4646
|
+
const columns = this.output.columns;
|
|
4647
|
+
if (typeof columns !== "number" || !Number.isFinite(columns) || columns <= 0) return 80;
|
|
4648
|
+
return Math.max(8, Math.floor(columns) - 2);
|
|
4649
|
+
}
|
|
4584
4650
|
};
|
|
4585
4651
|
function isCancel(key) {
|
|
4586
4652
|
return key.ctrl === true && key.name === "c" || key.ctrl === true && key.name === "d";
|
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-RQKXZOD7.js';
|
|
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-C24OAT6T.js';
|
|
3
3
|
import { spawnSync } from 'child_process';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import * as path2 from 'path';
|
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.8";
|
|
5494
5494
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
5495
5495
|
function isOurGeneratorName(name) {
|
|
5496
5496
|
if (typeof name !== "string") return false;
|
|
@@ -6241,6 +6241,59 @@ function toggleIndex(selected, index) {
|
|
|
6241
6241
|
else next.add(index);
|
|
6242
6242
|
return next;
|
|
6243
6243
|
}
|
|
6244
|
+
function isWideCodePoint(code) {
|
|
6245
|
+
return code >= 4352 && code <= 4447 || // Hangul Jamo
|
|
6246
|
+
code >= 11904 && code <= 12350 || // CJK radicals, Kangxi, CJK symbols
|
|
6247
|
+
code >= 12353 && code <= 13311 || // kana through CJK compatibility
|
|
6248
|
+
code >= 13312 && code <= 19903 || // CJK extension A
|
|
6249
|
+
code >= 19968 && code <= 40959 || // CJK unified ideographs
|
|
6250
|
+
code >= 40960 && code <= 42191 || // Yi
|
|
6251
|
+
code >= 44032 && code <= 55203 || // Hangul syllables
|
|
6252
|
+
code >= 63744 && code <= 64255 || // CJK compatibility ideographs
|
|
6253
|
+
code >= 65072 && code <= 65135 || // CJK compatibility forms
|
|
6254
|
+
code >= 65280 && code <= 65376 || // fullwidth forms
|
|
6255
|
+
code >= 65504 && code <= 65510 || code >= 127744 && code <= 129535 || // emoji and pictographs
|
|
6256
|
+
code >= 131072 && code <= 262141;
|
|
6257
|
+
}
|
|
6258
|
+
var ANSI_PATTERN = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
6259
|
+
function displayWidth(line) {
|
|
6260
|
+
let width = 0;
|
|
6261
|
+
for (const character of line.replace(ANSI_PATTERN, "")) {
|
|
6262
|
+
width += isWideCodePoint(character.codePointAt(0) ?? 0) ? 2 : 1;
|
|
6263
|
+
}
|
|
6264
|
+
return width;
|
|
6265
|
+
}
|
|
6266
|
+
var GUTTER_PATTERN = /^[ \t]*(?:[❯◆◻◼▏✖][ \t]+)*/;
|
|
6267
|
+
function wrapOneLine(line, limit) {
|
|
6268
|
+
if (displayWidth(line) <= limit) return [line];
|
|
6269
|
+
const gutter = GUTTER_PATTERN.exec(line)?.[0] ?? "";
|
|
6270
|
+
const gutterWidth = displayWidth(gutter);
|
|
6271
|
+
const continuation = " ".repeat(gutterWidth);
|
|
6272
|
+
const rows = [];
|
|
6273
|
+
let prefix = gutter;
|
|
6274
|
+
let rest = line.slice(gutter.length).trimEnd();
|
|
6275
|
+
while (rest.length > 0) {
|
|
6276
|
+
const room = limit - displayWidth(prefix);
|
|
6277
|
+
if (room <= 0 || displayWidth(rest) <= room) {
|
|
6278
|
+
rows.push(prefix + rest);
|
|
6279
|
+
break;
|
|
6280
|
+
}
|
|
6281
|
+
let cut = room;
|
|
6282
|
+
const space = rest.slice(0, room).lastIndexOf(" ");
|
|
6283
|
+
if (space > 0) cut = space;
|
|
6284
|
+
const taken = rest.slice(0, cut).trimEnd();
|
|
6285
|
+
rows.push(`${prefix}${taken.length > 0 ? taken : rest.slice(0, cut)}`);
|
|
6286
|
+
rest = rest.slice(cut).trimStart();
|
|
6287
|
+
prefix = continuation;
|
|
6288
|
+
}
|
|
6289
|
+
return rows;
|
|
6290
|
+
}
|
|
6291
|
+
function wrapLines(text2, limit) {
|
|
6292
|
+
const width = Math.max(8, Math.floor(limit));
|
|
6293
|
+
const rows = [];
|
|
6294
|
+
for (const line of text2.split("\n")) rows.push(...wrapOneLine(line, width));
|
|
6295
|
+
return rows;
|
|
6296
|
+
}
|
|
6244
6297
|
function marker(active) {
|
|
6245
6298
|
return active ? "\u276F" : " ";
|
|
6246
6299
|
}
|
|
@@ -6318,14 +6371,27 @@ var Frame = class {
|
|
|
6318
6371
|
drawn = 0;
|
|
6319
6372
|
draw(text2) {
|
|
6320
6373
|
this.erase();
|
|
6321
|
-
this.
|
|
6374
|
+
const rows = wrapLines(text2, this.width());
|
|
6375
|
+
this.output.write(`${rows.join("\n")}
|
|
6322
6376
|
`);
|
|
6323
|
-
this.drawn =
|
|
6377
|
+
this.drawn = rows.length;
|
|
6324
6378
|
}
|
|
6325
6379
|
erase() {
|
|
6326
6380
|
if (this.drawn > 0) this.output.write(`\x1B[${this.drawn}A\x1B[0J`);
|
|
6327
6381
|
this.drawn = 0;
|
|
6328
6382
|
}
|
|
6383
|
+
/**
|
|
6384
|
+
* The usable width, in cells.
|
|
6385
|
+
*
|
|
6386
|
+
* Two cells of slack: an ambiguous-width glyph (`◆`, `❯`, `←`) renders two cells in some fonts
|
|
6387
|
+
* and one in others, and a row that lands exactly on the last column is the one case a terminal
|
|
6388
|
+
* may or may not wrap. Below that, a line cannot reach the edge to begin with.
|
|
6389
|
+
*/
|
|
6390
|
+
width() {
|
|
6391
|
+
const columns = this.output.columns;
|
|
6392
|
+
if (typeof columns !== "number" || !Number.isFinite(columns) || columns <= 0) return 80;
|
|
6393
|
+
return Math.max(8, Math.floor(columns) - 2);
|
|
6394
|
+
}
|
|
6329
6395
|
};
|
|
6330
6396
|
function isCancel(key) {
|
|
6331
6397
|
return key.ctrl === true && key.name === "c" || key.ctrl === true && key.name === "d";
|
|
@@ -8281,6 +8347,7 @@ exports.LANGUAGE_PROFILES = LANGUAGE_PROFILES;
|
|
|
8281
8347
|
exports.MIN_MAX_PART_BYTES = MIN_MAX_PART_BYTES;
|
|
8282
8348
|
exports.PACKAGE_LATEST_URL = PACKAGE_LATEST_URL;
|
|
8283
8349
|
exports.PRESETS = PRESETS;
|
|
8350
|
+
exports.PromptBack = PromptBack;
|
|
8284
8351
|
exports.PromptCancelled = PromptCancelled;
|
|
8285
8352
|
exports.REQUEST_TIMEOUT_MS = REQUEST_TIMEOUT_MS;
|
|
8286
8353
|
exports.SCHEMA_VERSION = SCHEMA_VERSION;
|
|
@@ -8298,6 +8365,7 @@ exports.decodeText = decodeText;
|
|
|
8298
8365
|
exports.defineConfig = defineConfig;
|
|
8299
8366
|
exports.detectLanguage = detectLanguage;
|
|
8300
8367
|
exports.detectPreset = detectPreset;
|
|
8368
|
+
exports.displayWidth = displayWidth;
|
|
8301
8369
|
exports.explainPath = explainPath;
|
|
8302
8370
|
exports.fenceForContent = fenceForContent;
|
|
8303
8371
|
exports.fenceForText = fenceForText;
|
|
@@ -8348,5 +8416,6 @@ exports.supportsTypeScriptImports = supportsTypeScriptImports;
|
|
|
8348
8416
|
exports.truncatePreview = truncatePreview;
|
|
8349
8417
|
exports.truncateToBytes = truncateToBytes;
|
|
8350
8418
|
exports.validateSnapshot = validateSnapshot;
|
|
8419
|
+
exports.wrapLines = wrapLines;
|
|
8351
8420
|
//# sourceMappingURL=index.cjs.map
|
|
8352
8421
|
//# 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.8";
|
|
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";
|
|
@@ -613,8 +613,22 @@ interface PromptIO {
|
|
|
613
613
|
declare class PromptCancelled extends Error {
|
|
614
614
|
constructor();
|
|
615
615
|
}
|
|
616
|
+
/** Thrown when the developer asks to return to the previous question. */
|
|
617
|
+
declare class PromptBack extends Error {
|
|
618
|
+
constructor();
|
|
619
|
+
}
|
|
616
620
|
/** Both ends must be a TTY before anything interactive is attempted. */
|
|
617
621
|
declare function isInteractive(io: PromptIO): boolean;
|
|
622
|
+
/** Cells a line occupies on screen. Escape sequences occupy none. */
|
|
623
|
+
declare function displayWidth(line: string): number;
|
|
624
|
+
/**
|
|
625
|
+
* Breaks a block so that no row is wider than `limit` cells.
|
|
626
|
+
*
|
|
627
|
+
* A terminal wraps anything wider than itself without saying so, which is the whole reason this
|
|
628
|
+
* exists: a frame that wraps behind the renderer's back is one row taller than it claims to be.
|
|
629
|
+
* See {@link Frame}.
|
|
630
|
+
*/
|
|
631
|
+
declare function wrapLines(text: string, limit: number): string[];
|
|
618
632
|
|
|
619
633
|
interface InitOptions {
|
|
620
634
|
cwd: string;
|
|
@@ -865,4 +879,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
865
879
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
866
880
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
867
881
|
|
|
868
|
-
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, 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, 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 };
|
|
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 };
|
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.8";
|
|
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";
|
|
@@ -613,8 +613,22 @@ interface PromptIO {
|
|
|
613
613
|
declare class PromptCancelled extends Error {
|
|
614
614
|
constructor();
|
|
615
615
|
}
|
|
616
|
+
/** Thrown when the developer asks to return to the previous question. */
|
|
617
|
+
declare class PromptBack extends Error {
|
|
618
|
+
constructor();
|
|
619
|
+
}
|
|
616
620
|
/** Both ends must be a TTY before anything interactive is attempted. */
|
|
617
621
|
declare function isInteractive(io: PromptIO): boolean;
|
|
622
|
+
/** Cells a line occupies on screen. Escape sequences occupy none. */
|
|
623
|
+
declare function displayWidth(line: string): number;
|
|
624
|
+
/**
|
|
625
|
+
* Breaks a block so that no row is wider than `limit` cells.
|
|
626
|
+
*
|
|
627
|
+
* A terminal wraps anything wider than itself without saying so, which is the whole reason this
|
|
628
|
+
* exists: a frame that wraps behind the renderer's back is one row taller than it claims to be.
|
|
629
|
+
* See {@link Frame}.
|
|
630
|
+
*/
|
|
631
|
+
declare function wrapLines(text: string, limit: number): string[];
|
|
618
632
|
|
|
619
633
|
interface InitOptions {
|
|
620
634
|
cwd: string;
|
|
@@ -865,4 +879,4 @@ declare function generateSnapshot(configInput?: SnapshotConfig | ResolvedSnapsho
|
|
|
865
879
|
/** Promise-returning wrapper for consumers that prefer an async call site. */
|
|
866
880
|
declare function generateSnapshotAsync(configInput?: SnapshotConfig | ResolvedSnapshotConfig | null, options?: GenerateOptions): Promise<Manifest>;
|
|
867
881
|
|
|
868
|
-
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, 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, 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 };
|
|
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 };
|
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, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, cacheDirectory, cacheFilePath, checkForUpdate, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, 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 } 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, 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-C24OAT6T.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.8";
|
|
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-RQKXZOD7.js';
|
|
2
|
+
import './chunk-C24OAT6T.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.8
|
|
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.8
|
|
215
215
|
Added to .gitignore: snapshot/, snapshot.tmp/
|
|
216
216
|
```
|
|
217
217
|
|
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.8 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.8", "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.8 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.8",
|
|
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",
|