codebase-snapshot 0.20.9 → 0.20.12
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 +53 -6
- package/README.md +13 -15
- package/SECURITY.md +0 -1
- package/dist/bin.js +5521 -4507
- package/dist/{chunk-SU6YGIQT.js → chunk-TUKY6KLH.js} +8030 -7055
- package/dist/cli.cjs +7876 -6868
- package/dist/cli.d.cts +2 -2
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +51 -18
- package/dist/{generate-worker--m4IM5zj.d.ts → generate-worker-CRMESc0b.d.ts} +9 -9
- package/dist/{generate-worker-DfNd8f67.d.cts → generate-worker-DMzNbsAW.d.cts} +9 -9
- package/dist/index.cjs +7996 -7021
- package/dist/index.d.cts +56 -40
- package/dist/index.d.ts +56 -40
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +2014 -7421
- package/dist/mcp.d.cts +4 -4
- package/dist/mcp.d.ts +4 -4
- package/dist/mcp.js +1 -1
- package/dist/{types-D2_K7jfI.d.ts → types-C5ytHMYz.d.cts} +2 -0
- package/dist/{types-D2_K7jfI.d.cts → types-C5ytHMYz.d.ts} +2 -0
- package/docs/benchmarks.md +9 -6
- package/docs/budget.md +3 -2
- package/docs/cli.md +20 -19
- package/docs/configuration.md +17 -16
- package/docs/health.md +1 -1
- package/docs/how-to-feed-a-repo-to-claude.md +8 -11
- package/docs/mcp.md +8 -8
- package/docs/migration.md +42 -43
- package/docs/output.md +2 -1
- package/docs/security-review.md +35 -8
- package/docs/vs-gitingest.md +2 -2
- package/docs/vs-repomix.md +7 -6
- package/docs/workspace.md +4 -2
- package/package.json +1 -1
package/dist/cli.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-
|
|
1
|
+
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-C5ytHMYz.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The machine-readable description of this tool.
|
|
@@ -53,7 +53,7 @@ interface AgentContract {
|
|
|
53
53
|
* magnitude.
|
|
54
54
|
*/
|
|
55
55
|
type: "string" | "boolean" | "number";
|
|
56
|
-
default?: string | number | boolean;
|
|
56
|
+
default?: string | number | boolean | null;
|
|
57
57
|
appliesTo: string;
|
|
58
58
|
summary: string;
|
|
59
59
|
}>;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-
|
|
1
|
+
import { O as OutputFormat, P as PromptTask, D as DiscoveryMode, C as CliOptions, R as ResolvedSnapshotConfig } from './types-C5ytHMYz.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The machine-readable description of this tool.
|
|
@@ -53,7 +53,7 @@ interface AgentContract {
|
|
|
53
53
|
* magnitude.
|
|
54
54
|
*/
|
|
55
55
|
type: "string" | "boolean" | "number";
|
|
56
|
-
default?: string | number | boolean;
|
|
56
|
+
default?: string | number | boolean | null;
|
|
57
57
|
appliesTo: string;
|
|
58
58
|
summary: string;
|
|
59
59
|
}>;
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chunk-WMEZFLUT.js';
|
|
2
|
-
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, startHttpTransport, buildTools, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo, loadSigningKey, SIGNATURE_FILE, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, COMMAND_OPTION_SCOPE, commandsForOption, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, SKILL_NAME, renderSkill, resolveLatest, isNewer, updateCommand, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, runWithStdoutCapture, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderContractText, renderExplainText } from './chunk-
|
|
3
|
-
export { buildAgentContract } from './chunk-
|
|
2
|
+
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, buildAgentContract, startWebServer, startHttpTransport, buildTools, runStdioServer, parseRemoteSource, assertPublicHost, cloneRepository, makeCloneDirectory, loadConfigFileDetailed, resolveConfig, validateSnapshot, readConfinedText, auditSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, getGitInfo, loadSigningKey, SIGNATURE_FILE, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, COMMAND_OPTION_SCOPE, commandsForOption, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, SKILL_NAME, renderSkill, resolveLatest, isNewer, updateCommand, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, runWithStdoutCapture, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderContractText, renderExplainText } from './chunk-TUKY6KLH.js';
|
|
3
|
+
export { buildAgentContract } from './chunk-TUKY6KLH.js';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
5
|
import * as fs2 from 'fs';
|
|
6
6
|
import * as path2 from 'path';
|
|
@@ -260,8 +260,8 @@ Options:
|
|
|
260
260
|
bar, calibration); merged at fixed slots
|
|
261
261
|
--prompt-task <task> audit | review | explain - which job the brief is for
|
|
262
262
|
--skip-artifacts <names> Comma-separated artifacts to omit
|
|
263
|
-
(readme, manifest, parts, navigation,
|
|
264
|
-
projectTree, audit, monolith)
|
|
263
|
+
(readme, prompt, manifest, parts, navigation,
|
|
264
|
+
projectTree, audit, diff, log, tokenTree, monolith)
|
|
265
265
|
--only-artifacts <names> Write *only* these artifacts
|
|
266
266
|
--format <text|json> CLI output format (default: text)
|
|
267
267
|
--dry-run Compute the snapshot without writing anything
|
|
@@ -701,7 +701,9 @@ function splitList(value) {
|
|
|
701
701
|
function displayOutPath(cwd, outDir, ...segments) {
|
|
702
702
|
const absolute = path2.resolve(cwd, outDir, ...segments);
|
|
703
703
|
const relative3 = path2.relative(cwd, absolute);
|
|
704
|
-
if (relative3 && !relative3.startsWith("
|
|
704
|
+
if (relative3 !== "" && relative3 !== ".." && !relative3.startsWith(`..${path2.sep}`) && !relative3.startsWith("../") && !path2.isAbsolute(relative3)) {
|
|
705
|
+
return relative3;
|
|
706
|
+
}
|
|
705
707
|
return absolute;
|
|
706
708
|
}
|
|
707
709
|
function nextStepHint(cwd, scriptsAddedNow) {
|
|
@@ -1433,21 +1435,25 @@ ${USAGE}
|
|
|
1433
1435
|
}
|
|
1434
1436
|
let index;
|
|
1435
1437
|
try {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1438
|
+
const indexRead = readConfinedText(outRoot, "WORKSPACE.json");
|
|
1439
|
+
if (!indexRead.ok) {
|
|
1440
|
+
return fail(invocation.format, "Could not read WORKSPACE.json: " + indexRead.message);
|
|
1441
|
+
}
|
|
1442
|
+
index = JSON.parse(indexRead.text);
|
|
1443
|
+
} catch {
|
|
1444
|
+
return fail(invocation.format, "WORKSPACE.json is not valid JSON.");
|
|
1439
1445
|
}
|
|
1440
1446
|
const rows = [];
|
|
1441
1447
|
const insidePath = (parent, child) => {
|
|
1442
1448
|
const relative3 = path2.relative(parent, child);
|
|
1443
|
-
return relative3 === "" || !relative3.startsWith("
|
|
1449
|
+
return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${path2.sep}`) && !relative3.startsWith("../") && !path2.isAbsolute(relative3);
|
|
1444
1450
|
};
|
|
1445
1451
|
for (const member of index.members ?? []) {
|
|
1446
1452
|
const name = member.name ?? "?";
|
|
1447
1453
|
const snapshotDir2 = path2.resolve(outRoot, name);
|
|
1448
1454
|
const repoPath = member.path ?? name;
|
|
1449
1455
|
const repoDir = path2.resolve(resolved.cwd, repoPath);
|
|
1450
|
-
if (name.length === 0 || path2.isAbsolute(name) || name.split(
|
|
1456
|
+
if (name.length === 0 || path2.isAbsolute(name) || name.split(/[\\/]/).includes("..") || !insidePath(outRoot, snapshotDir2) || path2.isAbsolute(repoPath) || repoPath.split(/[\\/]/).includes("..") || !insidePath(resolved.cwd, repoDir)) {
|
|
1451
1457
|
rows.push({
|
|
1452
1458
|
name,
|
|
1453
1459
|
score: 0,
|
|
@@ -1457,13 +1463,34 @@ ${USAGE}
|
|
|
1457
1463
|
});
|
|
1458
1464
|
continue;
|
|
1459
1465
|
}
|
|
1466
|
+
let canonicalSnapshot = snapshotDir2;
|
|
1467
|
+
let canonicalRepo = repoDir;
|
|
1468
|
+
try {
|
|
1469
|
+
const outRootReal = fs2.realpathSync(outRoot);
|
|
1470
|
+
const cwdReal = fs2.realpathSync(resolved.cwd);
|
|
1471
|
+
canonicalSnapshot = fs2.realpathSync(snapshotDir2);
|
|
1472
|
+
canonicalRepo = fs2.existsSync(repoDir) ? fs2.realpathSync(repoDir) : repoDir;
|
|
1473
|
+
if (!insidePath(outRootReal, canonicalSnapshot) || !insidePath(cwdReal, canonicalRepo)) {
|
|
1474
|
+
rows.push({
|
|
1475
|
+
name,
|
|
1476
|
+
score: 0,
|
|
1477
|
+
counts: { pass: 0, warn: 0, fail: 1 },
|
|
1478
|
+
failed: [],
|
|
1479
|
+
error: "the workspace index names a path outside the workspace"
|
|
1480
|
+
});
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
} catch {
|
|
1484
|
+
canonicalSnapshot = snapshotDir2;
|
|
1485
|
+
canonicalRepo = repoDir;
|
|
1486
|
+
}
|
|
1460
1487
|
if (!fs2.existsSync(path2.join(snapshotDir2, "manifest.json"))) {
|
|
1461
1488
|
rows.push({ name, score: 0, counts: { pass: 0, warn: 0, fail: 1 }, failed: [], error: "no snapshot at " + snapshotDir2 });
|
|
1462
1489
|
continue;
|
|
1463
1490
|
}
|
|
1464
1491
|
let memberSecretRules = resolved.customSecretRules ?? [];
|
|
1465
1492
|
try {
|
|
1466
|
-
const memberLoaded = await loadConfigFileDetailed(
|
|
1493
|
+
const memberLoaded = await loadConfigFileDetailed(canonicalRepo, {
|
|
1467
1494
|
allowExecutableConfig: false
|
|
1468
1495
|
});
|
|
1469
1496
|
if (memberLoaded.errors.length === 0) {
|
|
@@ -1472,8 +1499,8 @@ ${USAGE}
|
|
|
1472
1499
|
} catch {
|
|
1473
1500
|
}
|
|
1474
1501
|
const report2 = auditSnapshot({
|
|
1475
|
-
snapshotDir:
|
|
1476
|
-
repoDir,
|
|
1502
|
+
snapshotDir: canonicalSnapshot,
|
|
1503
|
+
repoDir: canonicalRepo,
|
|
1477
1504
|
...memberSecretRules.length === 0 ? {} : { secretRules: memberSecretRules },
|
|
1478
1505
|
...invocation.deep === true ? { deep: true } : {}
|
|
1479
1506
|
});
|
|
@@ -1638,7 +1665,7 @@ ${USAGE}
|
|
|
1638
1665
|
const outRoot = path2.resolve(invocation.cwd, invocation.outDir ?? "snapshot");
|
|
1639
1666
|
const workspaceCwd = path2.resolve(invocation.cwd);
|
|
1640
1667
|
const outRootRelative = path2.relative(outRoot, workspaceCwd);
|
|
1641
|
-
if (outRootRelative === "" || !outRootRelative.startsWith("
|
|
1668
|
+
if (outRootRelative === "" || outRootRelative !== ".." && !outRootRelative.startsWith(`..${path2.sep}`) && !outRootRelative.startsWith("../") && !path2.isAbsolute(outRootRelative)) {
|
|
1642
1669
|
return fail(
|
|
1643
1670
|
invocation.format,
|
|
1644
1671
|
`--workspace refuses --out-dir ${outRoot}: it is the working directory or one of its ancestors.`
|
|
@@ -1676,10 +1703,16 @@ ${USAGE}
|
|
|
1676
1703
|
continue;
|
|
1677
1704
|
}
|
|
1678
1705
|
try {
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
{
|
|
1706
|
+
const memberConfig = resolveConfig(
|
|
1707
|
+
null,
|
|
1708
|
+
{
|
|
1709
|
+
...generateCliOptions(invocation),
|
|
1710
|
+
cwd: directory,
|
|
1711
|
+
outDir: path2.join(outRoot, name)
|
|
1712
|
+
},
|
|
1713
|
+
directory
|
|
1682
1714
|
);
|
|
1715
|
+
const manifest = generateSnapshot(memberConfig, { dryRun: invocation.dryRun });
|
|
1683
1716
|
records.push({
|
|
1684
1717
|
name,
|
|
1685
1718
|
path: directory,
|
|
@@ -1794,7 +1827,7 @@ ${USAGE}
|
|
|
1794
1827
|
return fail(invocation.format, manifestPath + " is not a snapshot manifest: " + shape);
|
|
1795
1828
|
}
|
|
1796
1829
|
const relativeBase = path2.relative(invocation.cwd, manifestPath).split(path2.sep).join("/");
|
|
1797
|
-
const recordedBase = relativeBase === "" || relativeBase.startsWith("
|
|
1830
|
+
const recordedBase = relativeBase === "" || relativeBase === ".." || relativeBase.startsWith(`..${path2.sep}`) || relativeBase.startsWith("../") || path2.isAbsolute(relativeBase) ? path2.basename(manifestPath) : relativeBase;
|
|
1798
1831
|
deltaBase = { manifest: base, path: recordedBase };
|
|
1799
1832
|
info(" Delta base: " + recordedBase + " (" + base.files.length + " files, fingerprint " + base.fingerprint.slice(0, 12) + ")");
|
|
1800
1833
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SnapshotConfig, f as Manifest } from './types-
|
|
1
|
+
import { c as SnapshotConfig, f as Manifest } from './types-C5ytHMYz.js';
|
|
2
2
|
|
|
3
3
|
/** The options `resolveConfig` was called with, as the CLI would have passed them. */
|
|
4
4
|
interface WorkspaceCliOptions {
|
|
@@ -13,17 +13,17 @@ interface WorkspaceCliOptions {
|
|
|
13
13
|
* override* that beats `skeleton: true` in the project's configuration — the same trap the CLI
|
|
14
14
|
* documents. Absent means "whatever the configuration says".
|
|
15
15
|
*/
|
|
16
|
-
skeleton?:
|
|
17
|
-
sarif?:
|
|
18
|
-
staged?:
|
|
19
|
-
withDependents?:
|
|
16
|
+
skeleton?: boolean;
|
|
17
|
+
sarif?: boolean;
|
|
18
|
+
staged?: boolean;
|
|
19
|
+
withDependents?: boolean;
|
|
20
20
|
changedSince?: string;
|
|
21
21
|
/** Opt-in reports a client can ask for by name; absent means "whatever the configuration says". */
|
|
22
|
-
includeDiffs?:
|
|
22
|
+
includeDiffs?: boolean;
|
|
23
23
|
includeLogs?: number;
|
|
24
|
-
tokenTree?:
|
|
25
|
-
stripComments?:
|
|
26
|
-
removeEmptyLines?:
|
|
24
|
+
tokenTree?: boolean;
|
|
25
|
+
stripComments?: boolean;
|
|
26
|
+
removeEmptyLines?: boolean;
|
|
27
27
|
pack?: "single" | "xml" | "json";
|
|
28
28
|
/** Per-run narrowing, as the CLI's `--only` and `--ignore`; the config's lists are the default. */
|
|
29
29
|
only?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as SnapshotConfig, f as Manifest } from './types-
|
|
1
|
+
import { c as SnapshotConfig, f as Manifest } from './types-C5ytHMYz.cjs';
|
|
2
2
|
|
|
3
3
|
/** The options `resolveConfig` was called with, as the CLI would have passed them. */
|
|
4
4
|
interface WorkspaceCliOptions {
|
|
@@ -13,17 +13,17 @@ interface WorkspaceCliOptions {
|
|
|
13
13
|
* override* that beats `skeleton: true` in the project's configuration — the same trap the CLI
|
|
14
14
|
* documents. Absent means "whatever the configuration says".
|
|
15
15
|
*/
|
|
16
|
-
skeleton?:
|
|
17
|
-
sarif?:
|
|
18
|
-
staged?:
|
|
19
|
-
withDependents?:
|
|
16
|
+
skeleton?: boolean;
|
|
17
|
+
sarif?: boolean;
|
|
18
|
+
staged?: boolean;
|
|
19
|
+
withDependents?: boolean;
|
|
20
20
|
changedSince?: string;
|
|
21
21
|
/** Opt-in reports a client can ask for by name; absent means "whatever the configuration says". */
|
|
22
|
-
includeDiffs?:
|
|
22
|
+
includeDiffs?: boolean;
|
|
23
23
|
includeLogs?: number;
|
|
24
|
-
tokenTree?:
|
|
25
|
-
stripComments?:
|
|
26
|
-
removeEmptyLines?:
|
|
24
|
+
tokenTree?: boolean;
|
|
25
|
+
stripComments?: boolean;
|
|
26
|
+
removeEmptyLines?: boolean;
|
|
27
27
|
pack?: "single" | "xml" | "json";
|
|
28
28
|
/** Per-run narrowing, as the CLI's `--only` and `--ignore`; the config's lists are the default. */
|
|
29
29
|
only?: string[];
|