codebase-snapshot 0.10.2 → 0.12.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 +102 -0
- package/README.md +10 -1
- package/SECURITY.md +2 -2
- package/dist/bin.js +1282 -296
- package/dist/{chunk-5EYBTBFY.js → chunk-5FPYVWP3.js} +50 -3
- package/dist/{chunk-5AV7OR3J.js → chunk-6HXDYIJS.js} +1204 -338
- package/dist/cli.cjs +1423 -443
- package/dist/cli.d.cts +36 -3
- package/dist/cli.d.ts +36 -3
- package/dist/cli.js +71 -5
- package/dist/index.cjs +1199 -333
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +206 -4
- package/dist/mcp.js +2 -2
- package/dist/{types-BoWneA7n.d.cts → types-c0tLF2WC.d.cts} +91 -1
- package/dist/{types-BoWneA7n.d.ts → types-c0tLF2WC.d.ts} +91 -1
- package/docs/cli.md +8 -3
- package/docs/configuration.md +108 -0
- package/docs/how-to-feed-a-repo-to-claude.md +40 -9
- package/docs/mcp.md +3 -3
- package/docs/output.md +58 -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, P as PromptTask, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-c0tLF2WC.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,18 @@ 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
|
+
};
|
|
148
|
+
readonly brief: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
};
|
|
151
|
+
readonly "prompt-task": {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
};
|
|
137
154
|
readonly "include-monolith": {
|
|
138
155
|
readonly type: "boolean";
|
|
139
156
|
};
|
|
@@ -268,6 +285,14 @@ interface ParsedInvocation {
|
|
|
268
285
|
maxPartTokens?: number;
|
|
269
286
|
largeFileBytes?: number;
|
|
270
287
|
maxMonolithBytes?: number | null;
|
|
288
|
+
/** `--attachment-slots`: files the destination accepts in one message, 0 for no limit. */
|
|
289
|
+
attachmentSlots?: number;
|
|
290
|
+
/** `--max-parts`: the experimental part-count ceiling. */
|
|
291
|
+
maxParts?: number;
|
|
292
|
+
/** `--brief`: path to the owner-written half of the brief. */
|
|
293
|
+
brief?: string;
|
|
294
|
+
/** `--prompt-task`: audit, review or explain. */
|
|
295
|
+
promptTask?: PromptTask;
|
|
271
296
|
skipArtifacts?: string[];
|
|
272
297
|
/**
|
|
273
298
|
* The artifacts named by `--only-artifacts`, kept separately from the derived
|
|
@@ -302,6 +327,14 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
|
|
|
302
327
|
* as well as raw byte counts.
|
|
303
328
|
*/
|
|
304
329
|
declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* Parses a whole-number option such as `--attachment-slots 20`.
|
|
332
|
+
*
|
|
333
|
+
* Not `parseByteOption`: "20" here means twenty files, and a size suffix would be meaningless.
|
|
334
|
+
* `0` is meaningful — it says the destination imposes no limit — so the floor is zero rather
|
|
335
|
+
* than one, and a negative or fractional value is refused instead of rounded.
|
|
336
|
+
*/
|
|
337
|
+
declare function parseCountOption(raw: string | undefined, optionName: string, minimum?: number): number | undefined;
|
|
305
338
|
/**
|
|
306
339
|
* Parses argv.
|
|
307
340
|
*
|
|
@@ -408,4 +441,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
408
441
|
*/
|
|
409
442
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
410
443
|
|
|
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 };
|
|
444
|
+
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, P as PromptTask, D as DiscoveryMode, R as ResolvedSnapshotConfig } from './types-c0tLF2WC.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,18 @@ 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
|
+
};
|
|
148
|
+
readonly brief: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
};
|
|
151
|
+
readonly "prompt-task": {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
};
|
|
137
154
|
readonly "include-monolith": {
|
|
138
155
|
readonly type: "boolean";
|
|
139
156
|
};
|
|
@@ -268,6 +285,14 @@ interface ParsedInvocation {
|
|
|
268
285
|
maxPartTokens?: number;
|
|
269
286
|
largeFileBytes?: number;
|
|
270
287
|
maxMonolithBytes?: number | null;
|
|
288
|
+
/** `--attachment-slots`: files the destination accepts in one message, 0 for no limit. */
|
|
289
|
+
attachmentSlots?: number;
|
|
290
|
+
/** `--max-parts`: the experimental part-count ceiling. */
|
|
291
|
+
maxParts?: number;
|
|
292
|
+
/** `--brief`: path to the owner-written half of the brief. */
|
|
293
|
+
brief?: string;
|
|
294
|
+
/** `--prompt-task`: audit, review or explain. */
|
|
295
|
+
promptTask?: PromptTask;
|
|
271
296
|
skipArtifacts?: string[];
|
|
272
297
|
/**
|
|
273
298
|
* The artifacts named by `--only-artifacts`, kept separately from the derived
|
|
@@ -302,6 +327,14 @@ declare function parsePositiveInteger(raw: string | undefined, optionName: strin
|
|
|
302
327
|
* as well as raw byte counts.
|
|
303
328
|
*/
|
|
304
329
|
declare function parseByteOption(raw: string | undefined, optionName: string, minimum: number, unit?: string): number | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* Parses a whole-number option such as `--attachment-slots 20`.
|
|
332
|
+
*
|
|
333
|
+
* Not `parseByteOption`: "20" here means twenty files, and a size suffix would be meaningless.
|
|
334
|
+
* `0` is meaningful — it says the destination imposes no limit — so the floor is zero rather
|
|
335
|
+
* than one, and a negative or fractional value is refused instead of rounded.
|
|
336
|
+
*/
|
|
337
|
+
declare function parseCountOption(raw: string | undefined, optionName: string, minimum?: number): number | undefined;
|
|
305
338
|
/**
|
|
306
339
|
* Parses argv.
|
|
307
340
|
*
|
|
@@ -408,4 +441,4 @@ declare function watchPathsFor(config: ResolvedSnapshotConfig): WatchPaths;
|
|
|
408
441
|
*/
|
|
409
442
|
declare function watchSupportProblem(platform?: string, version?: string): string | null;
|
|
410
443
|
|
|
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 };
|
|
444
|
+
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-5FPYVWP3.js';
|
|
2
|
+
export { buildAgentContract } from './chunk-5FPYVWP3.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-6HXDYIJS.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,10 @@ 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" },
|
|
132
|
+
brief: { type: "string" },
|
|
133
|
+
"prompt-task": { type: "string" },
|
|
130
134
|
"include-monolith": { type: "boolean" },
|
|
131
135
|
"include-sensitive-files": { type: "boolean" },
|
|
132
136
|
"skip-artifacts": { type: "string" },
|
|
@@ -201,6 +205,13 @@ Options:
|
|
|
201
205
|
--skeleton Emit TypeScript signatures instead of bodies
|
|
202
206
|
--sarif Also write reports/audit.sarif for GitHub Code Scanning
|
|
203
207
|
--include-sensitive-files Emit .env / *.pem / .npmrc / credential files
|
|
208
|
+
--attachment-slots <n> Files the destination takes in one message (default: 10,
|
|
209
|
+
0 = no limit); PROMPT.md plans the delivery to fit
|
|
210
|
+
--max-parts <n> Experimental: grow the part budget until the snapshot has at
|
|
211
|
+
most n parts, instead of adding parts as the code grows
|
|
212
|
+
--brief <path> Owner-written half of PROMPT.md (stakes, system, history,
|
|
213
|
+
bar, calibration); merged at fixed slots
|
|
214
|
+
--prompt-task <task> audit | review | explain - which job the brief is for
|
|
204
215
|
--skip-artifacts <names> Comma-separated artifacts to omit
|
|
205
216
|
(readme, manifest, parts, navigation,
|
|
206
217
|
projectTree, audit, monolith)
|
|
@@ -271,6 +282,27 @@ function parseByteOption(raw, optionName, minimum, unit = "byte count") {
|
|
|
271
282
|
}
|
|
272
283
|
return value;
|
|
273
284
|
}
|
|
285
|
+
function parseCountOption(raw, optionName, minimum = 0) {
|
|
286
|
+
if (raw === void 0) return void 0;
|
|
287
|
+
const trimmed = raw.trim();
|
|
288
|
+
if (!/^\d+$/.test(trimmed) || !Number.isSafeInteger(Number(trimmed))) {
|
|
289
|
+
throw new UsageError(
|
|
290
|
+
`--${optionName} expects a whole number such as 10 or 20, received "${raw}".`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
const value = Number(trimmed);
|
|
294
|
+
if (value < minimum) {
|
|
295
|
+
throw new UsageError(`--${optionName} must be at least ${minimum}, received "${raw}".`);
|
|
296
|
+
}
|
|
297
|
+
return value;
|
|
298
|
+
}
|
|
299
|
+
function parsePromptTask(value) {
|
|
300
|
+
if (value === void 0) return void 0;
|
|
301
|
+
if (value === "audit" || value === "review" || value === "explain") return value;
|
|
302
|
+
throw new UsageError(
|
|
303
|
+
'--prompt-task expects audit, review or explain, received "' + value + '".'
|
|
304
|
+
);
|
|
305
|
+
}
|
|
274
306
|
function parseArtifactList(raw, flag) {
|
|
275
307
|
const names = raw.split(",").map((name) => name.trim()).filter(Boolean);
|
|
276
308
|
if (names.length === 0) {
|
|
@@ -512,6 +544,13 @@ function parseCliArgs(argv) {
|
|
|
512
544
|
"max-monolith-bytes",
|
|
513
545
|
1
|
|
514
546
|
),
|
|
547
|
+
attachmentSlots: parseCountOption(
|
|
548
|
+
values["attachment-slots"],
|
|
549
|
+
"attachment-slots"
|
|
550
|
+
),
|
|
551
|
+
maxParts: parseCountOption(values["max-parts"], "max-parts", 1),
|
|
552
|
+
brief: values.brief === void 0 ? void 0 : String(values.brief),
|
|
553
|
+
promptTask: parsePromptTask(values["prompt-task"]),
|
|
515
554
|
skipArtifacts,
|
|
516
555
|
onlyArtifacts,
|
|
517
556
|
discovery: isDiscoveryMode(rawDiscovery) ? rawDiscovery : void 0,
|
|
@@ -837,6 +876,16 @@ async function runSetupCommand(invocation, options = {}) {
|
|
|
837
876
|
if (invocation.maxPartTokens !== void 0) {
|
|
838
877
|
generateArgs.push("--max-part-tokens", String(invocation.maxPartTokens));
|
|
839
878
|
}
|
|
879
|
+
if (invocation.attachmentSlots !== void 0) {
|
|
880
|
+
generateArgs.push("--attachment-slots", String(invocation.attachmentSlots));
|
|
881
|
+
}
|
|
882
|
+
if (invocation.maxParts !== void 0) {
|
|
883
|
+
generateArgs.push("--max-parts", String(invocation.maxParts));
|
|
884
|
+
}
|
|
885
|
+
if (invocation.brief !== void 0) generateArgs.push("--brief", invocation.brief);
|
|
886
|
+
if (invocation.promptTask !== void 0) {
|
|
887
|
+
generateArgs.push("--prompt-task", invocation.promptTask);
|
|
888
|
+
}
|
|
840
889
|
if (invocation.skeleton === true) generateArgs.push("--skeleton");
|
|
841
890
|
if (invocation.sarif === true) generateArgs.push("--sarif");
|
|
842
891
|
if (invocation.noUpdateCheck) generateArgs.push("--no-update-check");
|
|
@@ -1079,6 +1128,10 @@ ${USAGE}
|
|
|
1079
1128
|
maxPartTokens: invocation.maxPartTokens,
|
|
1080
1129
|
largeFileBytes: invocation.largeFileBytes,
|
|
1081
1130
|
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1131
|
+
attachmentSlots: invocation.attachmentSlots,
|
|
1132
|
+
maxParts: invocation.maxParts,
|
|
1133
|
+
brief: invocation.brief,
|
|
1134
|
+
promptTask: invocation.promptTask,
|
|
1082
1135
|
skipArtifacts: invocation.skipArtifacts,
|
|
1083
1136
|
// `--only-artifacts` is forwarded as itself, not only as the derived suppression list:
|
|
1084
1137
|
// suppression cannot switch an artifact *on*, so a config that had turned one of the
|
|
@@ -1251,7 +1304,16 @@ ${USAGE}
|
|
|
1251
1304
|
);
|
|
1252
1305
|
}
|
|
1253
1306
|
}
|
|
1254
|
-
|
|
1307
|
+
const orientation = [
|
|
1308
|
+
artifacts.readme ? "README.md" : null,
|
|
1309
|
+
artifacts.prompt ? "PROMPT.md" : null
|
|
1310
|
+
].filter((name) => name !== null);
|
|
1311
|
+
if (orientation.length > 0) {
|
|
1312
|
+
info(
|
|
1313
|
+
` - Orientation: ${orientation.map((name) => displayOutPath(resolved.cwd, resolved.outDir, name)).join(", ")}`
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
if (reports.length === 0 && !artifacts.parts && !artifacts.manifest && !artifacts.monolith && orientation.length === 0) {
|
|
1255
1317
|
info(` - Artifacts: all disabled (only the ownership marker was written)`);
|
|
1256
1318
|
}
|
|
1257
1319
|
info(` - Fingerprint: ${manifest.fingerprint}`);
|
|
@@ -1395,6 +1457,10 @@ async function runWatchLoop(invocation, resolved, options) {
|
|
|
1395
1457
|
maxPartTokens: invocation.maxPartTokens,
|
|
1396
1458
|
largeFileBytes: invocation.largeFileBytes,
|
|
1397
1459
|
maxMonolithBytes: invocation.maxMonolithBytes,
|
|
1460
|
+
attachmentSlots: invocation.attachmentSlots,
|
|
1461
|
+
maxParts: invocation.maxParts,
|
|
1462
|
+
brief: invocation.brief,
|
|
1463
|
+
promptTask: invocation.promptTask,
|
|
1398
1464
|
skipArtifacts: invocation.skipArtifacts,
|
|
1399
1465
|
onlyArtifacts: invocation.onlyArtifacts,
|
|
1400
1466
|
discovery: invocation.discovery,
|
|
@@ -1481,4 +1547,4 @@ if (invokedDirectly) {
|
|
|
1481
1547
|
);
|
|
1482
1548
|
}
|
|
1483
1549
|
|
|
1484
|
-
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|
|
1550
|
+
export { CLI_OPTIONS, UsageError, WATCH_DEBOUNCE_MS, WATCH_SETTLE_MS, beginWatchRun, cleanInstallEnv, decideWatchEvent, finishWatchRun, initialWatchState, isGeneratedWatchPath, main, parseByteOption, parseCliArgs, parseCountOption, parsePositiveInteger, watchPathsFor, watchSupportProblem };
|