codebase-snapshot 0.10.2 → 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/CHANGELOG.md +60 -0
- package/README.md +9 -1
- package/SECURITY.md +2 -2
- package/dist/bin.js +643 -8
- package/dist/{chunk-5EYBTBFY.js → chunk-5ZOXHBTW.js} +30 -3
- package/dist/{chunk-5AV7OR3J.js → chunk-NJ75RVHO.js} +569 -5
- package/dist/cli.cjs +644 -8
- package/dist/cli.d.cts +26 -3
- package/dist/cli.d.ts +26 -3
- package/dist/cli.js +49 -5
- package/dist/index.cjs +569 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +67 -4
- package/dist/mcp.js +2 -2
- package/dist/{types-BoWneA7n.d.cts → types-DGWw3SH2.d.cts} +40 -0
- package/dist/{types-BoWneA7n.d.ts → types-DGWw3SH2.d.ts} +40 -0
- package/docs/cli.md +6 -3
- package/docs/configuration.md +53 -0
- package/docs/how-to-feed-a-repo-to-claude.md +40 -9
- package/docs/mcp.md +3 -3
- package/docs/output.md +52 -2
- package/package.json +1 -1
package/dist/cli.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-
|
|
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
|
-
|
|
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
|
*
|
|
@@ -408,4 +431,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
408
431
|
*/
|
|
409
432
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
410
433
|
|
|
411
|
-
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-
|
|
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
|
-
|
|
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
|
*
|
|
@@ -408,4 +431,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
408
431
|
*/
|
|
409
432
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
410
433
|
|
|
411
|
-
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-
|
|
2
|
-
export { buildAgentContract } from './chunk-
|
|
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-
|
|
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,
|
|
@@ -837,6 +862,12 @@ async function runSetupCommand(invocation, options = {}) {
|
|
|
837
862
|
if (invocation.maxPartTokens !== void 0) {
|
|
838
863
|
generateArgs.push("--max-part-tokens", String(invocation.maxPartTokens));
|
|
839
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
|
+
}
|
|
840
871
|
if (invocation.skeleton === true) generateArgs.push("--skeleton");
|
|
841
872
|
if (invocation.sarif === true) generateArgs.push("--sarif");
|
|
842
873
|
if (invocation.noUpdateCheck) generateArgs.push("--no-update-check");
|
|
@@ -1079,6 +1110,8 @@ ${USAGE}
|
|
|
1079
1110
|
maxPartTokens: invocation.maxPartTokens,
|
|
1080
1111
|
largeFileBytes: invocation.largeFileBytes,
|
|
1081
1112
|
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1113
|
+
attachmentSlots: invocation.attachmentSlots,
|
|
1114
|
+
maxParts: invocation.maxParts,
|
|
1082
1115
|
skipArtifacts: invocation.skipArtifacts,
|
|
1083
1116
|
// `--only-artifacts` is forwarded as itself, not only as the derived suppression list:
|
|
1084
1117
|
// suppression cannot switch an artifact *on*, so a config that had turned one of the
|
|
@@ -1251,7 +1284,16 @@ ${USAGE}
|
|
|
1251
1284
|
);
|
|
1252
1285
|
}
|
|
1253
1286
|
}
|
|
1254
|
-
|
|
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) {
|
|
1255
1297
|
info(` - Artifacts: all disabled (only the ownership marker was written)`);
|
|
1256
1298
|
}
|
|
1257
1299
|
info(` - Fingerprint: ${manifest.fingerprint}`);
|
|
@@ -1395,6 +1437,8 @@ async function runWatchLoop(invocation, resolved, options) {
|
|
|
1395
1437
|
maxPartTokens: invocation.maxPartTokens,
|
|
1396
1438
|
largeFileBytes: invocation.largeFileBytes,
|
|
1397
1439
|
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1440
|
+
attachmentSlots: invocation.attachmentSlots,
|
|
1441
|
+
maxParts: invocation.maxParts,
|
|
1398
1442
|
skipArtifacts: invocation.skipArtifacts,
|
|
1399
1443
|
onlyArtifacts: invocation.onlyArtifacts,
|
|
1400
1444
|
discovery: invocation.discovery,
|
|
@@ -1481,4 +1525,4 @@ if (invokedDirectly) {
|
|
|
1481
1525
|
);
|
|
1482
1526
|
}
|
|
1483
1527
|
|
|
1484
|
-
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 };
|