codebase-snapshot 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as OutputFormat, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-Z471HW65.cjs';
1
+ import { O as OutputFormat, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-DGWw3SH2.cjs';
2
2
 
3
3
  /**
4
4
  * The machine-readable description of this tool.
@@ -47,7 +47,12 @@ interface AgentContract {
47
47
  exitCodes: Record<string, string>;
48
48
  options: Array<{
49
49
  flag: string;
50
- type: "string" | "boolean";
50
+ /**
51
+ * `number` is a distinct type, not a string that happens to parse: `--attachment-slots 20`
52
+ * carries a count, and a consumer that treated it as bytes would be off by three orders of
53
+ * magnitude.
54
+ */
55
+ type: "string" | "boolean" | "number";
51
56
  default?: string | number | boolean;
52
57
  appliesTo: string;
53
58
  summary: string;
@@ -134,6 +139,12 @@ declare const CLI_OPTIONS: {
134
139
  readonly "max-monolith-bytes": {
135
140
  readonly type: "string";
136
141
  };
142
+ readonly "attachment-slots": {
143
+ readonly type: "string";
144
+ };
145
+ readonly "max-parts": {
146
+ readonly type: "string";
147
+ };
137
148
  readonly "include-monolith": {
138
149
  readonly type: "boolean";
139
150
  };
@@ -268,6 +279,10 @@ interface ParsedInvocation {
268
279
  maxPartTokens?: number;
269
280
  largeFileBytes?: number;
270
281
  maxMonolithBytes?: number | null;
282
+ /** `--attachment-slots`: files the destination accepts in one message, 0 for no limit. */
283
+ attachmentSlots?: number;
284
+ /** `--max-parts`: the experimental part-count ceiling. */
285
+ maxParts?: number;
271
286
  skipArtifacts?: string[];
272
287
  /**
273
288
  * The artifacts named by `--only-artifacts`, kept separately from the derived
@@ -302,6 +317,14 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
302
317
  * as well as raw byte counts.
303
318
  */
304
319
  declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
320
+ /**
321
+ * Parses a whole-number option such as `--attachment-slots 20`.
322
+ *
323
+ * Not `parseByteOption`: "20" here means twenty files, and a size suffix would be meaningless.
324
+ * `0` is meaningful — it says the destination imposes no limit — so the floor is zero rather
325
+ * than one, and a negative or fractional value is refused instead of rounded.
326
+ */
327
+ declare function parseCountOption(raw: string | undefined, optionName: string, minimum?: number): number | undefined;
305
328
  /**
306
329
  * Parses argv.
307
330
  *
@@ -310,6 +333,16 @@ declare function parseByteOption(raw: string | undefined, optionName: string, mi
310
333
  * through to the writable `generate` command.
311
334
  */
312
335
  declare function parseCliArgs(argv: string[]): ParsedInvocation;
336
+ /**
337
+ * The environment a nested package-manager run gets: the caller's, minus npm's own config.
338
+ *
339
+ * Running `setup` through `npx`/`npm exec` puts the parent npm's resolved config into
340
+ * `npm_config_*` variables, and a child that inherits them is not the `npm install` a user would
341
+ * type — with an npm that supports an `allowScripts` switch, the child aborted with
342
+ * `EALLOWSCRIPTS: --allow-scripts is not allowed in project-scoped installs`. Stripping them makes
343
+ * the child read the project's own `.npmrc` and flags, which is the whole point of using the
344
+ * project's package manager.
345
+ */
313
346
  declare function cleanInstallEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
314
347
  /**
315
348
  * Runs one invocation, and mentions a newer release when there is one.
@@ -375,14 +408,6 @@ declare function isGeneratedWatchPath(candidate: string, paths: WatchPaths): boo
375
408
  * because Windows does not always name the path our own writes produced.
376
409
  */
377
410
  declare function decideWatchEvent(state: WatchState, event: WatchEvent, paths: WatchPaths): WatchDecision;
378
- /**
379
- * Re-generates on every change under `cwd`.
380
- *
381
- * Events inside the resolved output and temporary directories are ignored, so
382
- * writing a snapshot cannot feed the watcher. A source event that arrives while
383
- * a run is in flight sets a pending flag and gets exactly one follow-up run;
384
- * the settle window only suppresses unattributed events.
385
- */
386
411
  /**
387
412
  * The directories the watcher must ignore, derived from a resolved config.
388
413
  *
@@ -406,4 +431,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
406
431
  */
407
432
  declare function watchSupportProblem(platform?: string, version?: string): string | null;
408
433
 
409
- export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parsePositiveInteger, watchPathsFor, watchSupportProblem };
434
+ export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as OutputFormat, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-Z471HW65.js';
1
+ import { O as OutputFormat, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-DGWw3SH2.js';
2
2
 
3
3
  /**
4
4
  * The machine-readable description of this tool.
@@ -47,7 +47,12 @@ interface AgentContract {
47
47
  exitCodes: Record<string, string>;
48
48
  options: Array<{
49
49
  flag: string;
50
- type: "string" | "boolean";
50
+ /**
51
+ * `number` is a distinct type, not a string that happens to parse: `--attachment-slots 20`
52
+ * carries a count, and a consumer that treated it as bytes would be off by three orders of
53
+ * magnitude.
54
+ */
55
+ type: "string" | "boolean" | "number";
51
56
  default?: string | number | boolean;
52
57
  appliesTo: string;
53
58
  summary: string;
@@ -134,6 +139,12 @@ declare const CLI_OPTIONS: {
134
139
  readonly "max-monolith-bytes": {
135
140
  readonly type: "string";
136
141
  };
142
+ readonly "attachment-slots": {
143
+ readonly type: "string";
144
+ };
145
+ readonly "max-parts": {
146
+ readonly type: "string";
147
+ };
137
148
  readonly "include-monolith": {
138
149
  readonly type: "boolean";
139
150
  };
@@ -268,6 +279,10 @@ interface ParsedInvocation {
268
279
  maxPartTokens?: number;
269
280
  largeFileBytes?: number;
270
281
  maxMonolithBytes?: number | null;
282
+ /** `--attachment-slots`: files the destination accepts in one message, 0 for no limit. */
283
+ attachmentSlots?: number;
284
+ /** `--max-parts`: the experimental part-count ceiling. */
285
+ maxParts?: number;
271
286
  skipArtifacts?: string[];
272
287
  /**
273
288
  * The artifacts named by `--only-artifacts`, kept separately from the derived
@@ -302,6 +317,14 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
302
317
  * as well as raw byte counts.
303
318
  */
304
319
  declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
320
+ /**
321
+ * Parses a whole-number option such as `--attachment-slots 20`.
322
+ *
323
+ * Not `parseByteOption`: "20" here means twenty files, and a size suffix would be meaningless.
324
+ * `0` is meaningful — it says the destination imposes no limit — so the floor is zero rather
325
+ * than one, and a negative or fractional value is refused instead of rounded.
326
+ */
327
+ declare function parseCountOption(raw: string | undefined, optionName: string, minimum?: number): number | undefined;
305
328
  /**
306
329
  * Parses argv.
307
330
  *
@@ -310,6 +333,16 @@ declare function parseByteOption(raw: string | undefined, optionName: string, mi
310
333
  * through to the writable `generate` command.
311
334
  */
312
335
  declare function parseCliArgs(argv: string[]): ParsedInvocation;
336
+ /**
337
+ * The environment a nested package-manager run gets: the caller's, minus npm's own config.
338
+ *
339
+ * Running `setup` through `npx`/`npm exec` puts the parent npm's resolved config into
340
+ * `npm_config_*` variables, and a child that inherits them is not the `npm install` a user would
341
+ * type — with an npm that supports an `allowScripts` switch, the child aborted with
342
+ * `EALLOWSCRIPTS: --allow-scripts is not allowed in project-scoped installs`. Stripping them makes
343
+ * the child read the project's own `.npmrc` and flags, which is the whole point of using the
344
+ * project's package manager.
345
+ */
313
346
  declare function cleanInstallEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
314
347
  /**
315
348
  * Runs one invocation, and mentions a newer release when there is one.
@@ -375,14 +408,6 @@ declare function isGeneratedWatchPath(candidate: string, paths: WatchPaths): boo
375
408
  * because Windows does not always name the path our own writes produced.
376
409
  */
377
410
  declare function decideWatchEvent(state: WatchState, event: WatchEvent, paths: WatchPaths): WatchDecision;
378
- /**
379
- * Re-generates on every change under `cwd`.
380
- *
381
- * Events inside the resolved output and temporary directories are ignored, so
382
- * writing a snapshot cannot feed the watcher. A source event that arrives while
383
- * a run is in flight sets a pending flag and gets exactly one follow-up run;
384
- * the settle window only suppresses unattributed events.
385
- */
386
411
  /**
387
412
  * The directories the watcher must ignore, derived from a resolved config.
388
413
  *
@@ -406,4 +431,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
406
431
  */
407
432
  declare function watchSupportProblem(platform?: string, version?: string): string | null;
408
433
 
409
- export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parsePositiveInteger, watchPathsFor, watchSupportProblem };
434
+ export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, type WatchAction, type WatchDecision, type WatchEvent, type WatchPaths, type WatchState, beginWatchRun, buildAgentContract, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
- import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-WDJ3O3R4.js';
2
- export { buildAgentContract } from './chunk-WDJ3O3R4.js';
3
- import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, parseByteSize, stripJsonComments, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-7DAW2LFZ.js';
1
+ import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-5ZOXHBTW.js';
2
+ export { buildAgentContract } from './chunk-5ZOXHBTW.js';
3
+ import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-NJ75RVHO.js';
4
4
  import { spawnSync } from 'child_process';
5
5
  import * as fs from 'fs';
6
6
  import * as path2 from 'path';
@@ -127,6 +127,8 @@ var CLI_OPTIONS = {
127
127
  "max-part-bytes": { type: "string" },
128
128
  "large-file-bytes": { type: "string" },
129
129
  "max-monolith-bytes": { type: "string" },
130
+ "attachment-slots": { type: "string" },
131
+ "max-parts": { type: "string" },
130
132
  "include-monolith": { type: "boolean" },
131
133
  "include-sensitive-files": { type: "boolean" },
132
134
  "skip-artifacts": { type: "string" },
@@ -201,6 +203,10 @@ Options:
201
203
  --skeleton Emit TypeScript signatures instead of bodies
202
204
  --sarif Also write reports/audit.sarif for GitHub Code Scanning
203
205
  --include-sensitive-files Emit .env / *.pem / .npmrc / credential files
206
+ --attachment-slots <n> Files the destination takes in one message (default: 10,
207
+ 0 = no limit); PROMPT.md plans the delivery to fit
208
+ --max-parts <n> Experimental: grow the part budget until the snapshot has at
209
+ most n parts, instead of adding parts as the code grows
204
210
  --skip-artifacts <names> Comma-separated artifacts to omit
205
211
  (readme, manifest, parts, navigation,
206
212
  projectTree, audit, monolith)
@@ -271,6 +277,20 @@ function parseByteOption(raw, optionName, minimum, unit = "byte count") {
271
277
  }
272
278
  return value;
273
279
  }
280
+ function parseCountOption(raw, optionName, minimum = 0) {
281
+ if (raw === void 0) return void 0;
282
+ const trimmed = raw.trim();
283
+ if (!/^\d+$/.test(trimmed) || !Number.isSafeInteger(Number(trimmed))) {
284
+ throw new UsageError(
285
+ `--${optionName} expects a whole number such as 10 or 20, received "${raw}".`
286
+ );
287
+ }
288
+ const value = Number(trimmed);
289
+ if (value < minimum) {
290
+ throw new UsageError(`--${optionName} must be at least ${minimum}, received "${raw}".`);
291
+ }
292
+ return value;
293
+ }
274
294
  function parseArtifactList(raw, flag) {
275
295
  const names = raw.split(",").map((name) => name.trim()).filter(Boolean);
276
296
  if (names.length === 0) {
@@ -512,6 +532,11 @@ function parseCliArgs(argv) {
512
532
  "max-monolith-bytes",
513
533
  1
514
534
  ),
535
+ attachmentSlots: parseCountOption(
536
+ values["attachment-slots"],
537
+ "attachment-slots"
538
+ ),
539
+ maxParts: parseCountOption(values["max-parts"], "max-parts", 1),
515
540
  skipArtifacts,
516
541
  onlyArtifacts,
517
542
  discovery: isDiscoveryMode(rawDiscovery) ? rawDiscovery : void 0,
@@ -642,7 +667,9 @@ async function runInitCommand(invocation) {
642
667
  }
643
668
  function generatorOrigin(cwd) {
644
669
  try {
645
- const pkg = JSON.parse(fs.readFileSync(path2.join(cwd, "package.json"), "utf8"));
670
+ const pkg = JSON.parse(
671
+ stripJsonComments(fs.readFileSync(path2.join(cwd, "package.json"), "utf8"))
672
+ );
646
673
  const spec = pkg.dependencies?.["codebase-snapshot"] ?? pkg.devDependencies?.["codebase-snapshot"];
647
674
  if (typeof spec === "string") return `project dependency ${spec}`;
648
675
  } catch {
@@ -835,6 +862,12 @@ async function runSetupCommand(invocation, options = {}) {
835
862
  if (invocation.maxPartTokens !== void 0) {
836
863
  generateArgs.push("--max-part-tokens", String(invocation.maxPartTokens));
837
864
  }
865
+ if (invocation.attachmentSlots !== void 0) {
866
+ generateArgs.push("--attachment-slots", String(invocation.attachmentSlots));
867
+ }
868
+ if (invocation.maxParts !== void 0) {
869
+ generateArgs.push("--max-parts", String(invocation.maxParts));
870
+ }
838
871
  if (invocation.skeleton === true) generateArgs.push("--skeleton");
839
872
  if (invocation.sarif === true) generateArgs.push("--sarif");
840
873
  if (invocation.noUpdateCheck) generateArgs.push("--no-update-check");
@@ -939,6 +972,8 @@ function runSkillCommand(invocation) {
939
972
  function renderValidateText(result) {
940
973
  if (result.valid) {
941
974
  info("\u2705 Snapshot is valid and up to date with disk.");
975
+ } else if (result.errors.length === 1 && result.errors[0].includes(" is not a snapshot manifest: ")) {
976
+ warn(`\u274C ${result.errors[0]}`);
942
977
  } else {
943
978
  warn("\u274C Snapshot validation failed:");
944
979
  for (const error of result.errors) warn(` - ${error}`);
@@ -1075,6 +1110,8 @@ ${USAGE}
1075
1110
  maxPartTokens: invocation.maxPartTokens,
1076
1111
  largeFileBytes: invocation.largeFileBytes,
1077
1112
  maxMonolithBytes: invocation.maxMonolithBytes,
1113
+ attachmentSlots: invocation.attachmentSlots,
1114
+ maxParts: invocation.maxParts,
1078
1115
  skipArtifacts: invocation.skipArtifacts,
1079
1116
  // `--only-artifacts` is forwarded as itself, not only as the derived suppression list:
1080
1117
  // suppression cannot switch an artifact *on*, so a config that had turned one of the
@@ -1144,7 +1181,11 @@ ${USAGE}
1144
1181
  if (invocation.command === "diff") {
1145
1182
  try {
1146
1183
  const [beforePath, afterPath] = invocation.args;
1147
- const diff = compareManifests(loadManifest(beforePath), loadManifest(afterPath));
1184
+ const diff = compareManifests(
1185
+ loadManifest(beforePath),
1186
+ loadManifest(afterPath),
1187
+ resolved.secretRules
1188
+ );
1148
1189
  emit(invocation.format, diff, () => info(renderDiffText(diff)));
1149
1190
  return 0;
1150
1191
  } catch (err) {
@@ -1199,7 +1240,7 @@ ${USAGE}
1199
1240
  const reasons = skipBreakdown.length > shownReasons.length ? `${shownReasons.join(", ")}, +${skipBreakdown.length - shownReasons.length} more` : shownReasons.join(", ");
1200
1241
  const candidates = manifest.counts.totalFiles + manifest.counts.skippedCount;
1201
1242
  info(
1202
- manifest.counts.skippedCount === 0 ? ` - Tracked files: ${formatNumber(manifest.counts.totalFiles)}` : ` - Tracked files: ${formatNumber(manifest.counts.totalFiles)} included of ${formatNumber(candidates)} found \u2014 ${formatNumber(manifest.counts.skippedCount)} skipped (${reasons}); every one is listed in ${displayOutPath(resolved.cwd, resolved.outDir, "reports/audit.md")}`
1243
+ manifest.counts.skippedCount === 0 ? ` - Tracked files: ${formatNumber(manifest.counts.totalFiles)}` : ` - Tracked files: ${formatNumber(manifest.counts.totalFiles)} included of ${formatNumber(candidates)} paths found \u2014 ${formatNumber(manifest.counts.skippedCount)} skipped (${reasons}); every one is listed in ${displayOutPath(resolved.cwd, resolved.outDir, "reports/audit.md")}`
1203
1244
  );
1204
1245
  info(` - Total lines: ${formatNumber(manifest.counts.totalLines)}`);
1205
1246
  info(
@@ -1243,7 +1284,16 @@ ${USAGE}
1243
1284
  );
1244
1285
  }
1245
1286
  }
1246
- if (reports.length === 0 && !artifacts.parts && !artifacts.manifest && !artifacts.monolith) {
1287
+ const orientation = [
1288
+ artifacts.readme ? "README.md" : null,
1289
+ artifacts.prompt ? "PROMPT.md" : null
1290
+ ].filter((name) => name !== null);
1291
+ if (orientation.length > 0) {
1292
+ info(
1293
+ ` - Orientation: ${orientation.map((name) => displayOutPath(resolved.cwd, resolved.outDir, name)).join(", ")}`
1294
+ );
1295
+ }
1296
+ if (reports.length === 0 && !artifacts.parts && !artifacts.manifest && !artifacts.monolith && orientation.length === 0) {
1247
1297
  info(` - Artifacts: all disabled (only the ownership marker was written)`);
1248
1298
  }
1249
1299
  info(` - Fingerprint: ${manifest.fingerprint}`);
@@ -1387,6 +1437,8 @@ async function runWatchLoop(invocation, resolved, options) {
1387
1437
  maxPartTokens: invocation.maxPartTokens,
1388
1438
  largeFileBytes: invocation.largeFileBytes,
1389
1439
  maxMonolithBytes: invocation.maxMonolithBytes,
1440
+ attachmentSlots: invocation.attachmentSlots,
1441
+ maxParts: invocation.maxParts,
1390
1442
  skipArtifacts: invocation.skipArtifacts,
1391
1443
  onlyArtifacts: invocation.onlyArtifacts,
1392
1444
  discovery: invocation.discovery,
@@ -1473,4 +1525,4 @@ if (invokedDirectly) {
1473
1525
  );
1474
1526
  }
1475
1527
 
1476
- export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parsePositiveInteger, watchPathsFor, watchSupportProblem };
1528
+ export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
@@ -28,7 +28,21 @@ interface GenerateSummary {
28
28
  filename: string;
29
29
  byteSize: number;
30
30
  }>;
31
+ totalSizeBytes: number;
31
32
  totalContentBytes: number;
33
+ preset: string;
34
+ layers: Record<string, number>;
35
+ /**
36
+ * The most common skip reasons, ranked.
37
+ *
38
+ * `snapshot_plan` prints these, and it now runs off-thread too — so the ranking is computed
39
+ * where the manifest is, and the whole `skipped[]` array (one record per path, thousands of
40
+ * them) does not cross the thread boundary to be counted here.
41
+ */
42
+ skipReasons: Array<{
43
+ reason: string;
44
+ count: number;
45
+ }>;
32
46
  warnings: string[];
33
47
  }
34
48
  type WorkerResults = {
@@ -38,13 +52,6 @@ type WorkerResults = {
38
52
  ok: false;
39
53
  message: string;
40
54
  };
41
- /**
42
- * The absolute path of the package entry this process is running from.
43
- *
44
- * `__dirname` exists in the CJS build and `import.meta.url` in the ESM one, and `typeof` on an
45
- * undeclared identifier does not throw — so this resolves correctly in both without a build-time
46
- * substitution.
47
- */
48
55
  /**
49
56
  * Where the worker finds this package's entry: the path, and the URL the worker imports.
50
57
  *
@@ -68,6 +75,8 @@ declare function workerEntry(directory: string, isCjs: boolean): {
68
75
  * as a tool failure naming the reason — never silently retried on the calling thread, because a
69
76
  * quiet fallback would hide exactly the condition this exists to avoid.
70
77
  */
71
- declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions): Promise<WorkerResults>;
78
+ declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions, options?: {
79
+ dryRun?: boolean;
80
+ }): Promise<WorkerResults>;
72
81
 
73
82
  export { type GenerateSummary as G, type WorkerResults as W, generateInWorker as g, workerEntry as w };
@@ -28,7 +28,21 @@ interface GenerateSummary {
28
28
  filename: string;
29
29
  byteSize: number;
30
30
  }>;
31
+ totalSizeBytes: number;
31
32
  totalContentBytes: number;
33
+ preset: string;
34
+ layers: Record<string, number>;
35
+ /**
36
+ * The most common skip reasons, ranked.
37
+ *
38
+ * `snapshot_plan` prints these, and it now runs off-thread too — so the ranking is computed
39
+ * where the manifest is, and the whole `skipped[]` array (one record per path, thousands of
40
+ * them) does not cross the thread boundary to be counted here.
41
+ */
42
+ skipReasons: Array<{
43
+ reason: string;
44
+ count: number;
45
+ }>;
32
46
  warnings: string[];
33
47
  }
34
48
  type WorkerResults = {
@@ -38,13 +52,6 @@ type WorkerResults = {
38
52
  ok: false;
39
53
  message: string;
40
54
  };
41
- /**
42
- * The absolute path of the package entry this process is running from.
43
- *
44
- * `__dirname` exists in the CJS build and `import.meta.url` in the ESM one, and `typeof` on an
45
- * undeclared identifier does not throw — so this resolves correctly in both without a build-time
46
- * substitution.
47
- */
48
55
  /**
49
56
  * Where the worker finds this package's entry: the path, and the URL the worker imports.
50
57
  *
@@ -68,6 +75,8 @@ declare function workerEntry(directory: string, isCjs: boolean): {
68
75
  * as a tool failure naming the reason — never silently retried on the calling thread, because a
69
76
  * quiet fallback would hide exactly the condition this exists to avoid.
70
77
  */
71
- declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions): Promise<WorkerResults>;
78
+ declare function generateInWorker(cwd: string, cliOptions: WorkspaceCliOptions, options?: {
79
+ dryRun?: boolean;
80
+ }): Promise<WorkerResults>;
72
81
 
73
82
  export { type GenerateSummary as G, type WorkerResults as W, generateInWorker as g, workerEntry as w };