@counterfact-labs/cli 0.2.7 → 0.2.9
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/bundle/client-release.json +1 -1
- package/dist/adapters/analysis-results.js +87 -0
- package/dist/adapters/combined-results.js +27 -0
- package/dist/adapters/entry-files.js +5 -2
- package/dist/adapters/entry-packing.js +161 -0
- package/dist/adapters/entry-selection.js +13 -1
- package/dist/adapters/files.js +110 -5
- package/dist/adapters/git.js +10 -1
- package/dist/adapters/relay-plan.js +5 -7
- package/dist/adapters/release.js +4 -1
- package/dist/adapters/results.js +9 -2
- package/dist/adapters/selection.js +19 -9
- package/dist/adapters/settings.js +37 -6
- package/dist/adapters/source-relay-plan.js +7 -0
- package/dist/analysis-core/analysis/code-agents/skipped-files.js +1 -1
- package/dist/analysis-core/analysis/file-analysis-plan.js +1 -0
- package/dist/analysis-core/analysis/file-dependencies.js +1 -0
- package/dist/analysis-core/analysis/finding-activity-switch.js +1 -0
- package/dist/analysis-core/analysis/finding-identity.js +1 -0
- package/dist/analysis-core/analysis/finding-quality/policy.js +1 -0
- package/dist/analysis-core/analysis/folder-analysis-plan.js +1 -0
- package/dist/analysis-core/analysis/passes/full-file-passes.js +1 -0
- package/dist/analysis-core/analysis/project-architecture.js +1 -0
- package/dist/analysis-core/analysis/schemas.js +1 -1
- package/dist/analysis-core/chunks/2AASSZRO.js +35 -0
- package/dist/analysis-core/chunks/2YREYGOG.js +1 -0
- package/dist/analysis-core/chunks/33HRXJ5Q.js +1 -0
- package/dist/analysis-core/chunks/33IGHOYT.js +1 -0
- package/dist/analysis-core/chunks/4PT5C4IT.js +7 -0
- package/dist/analysis-core/chunks/4RXRAB5S.js +1 -0
- package/dist/analysis-core/chunks/4UDQBDDE.js +1 -0
- package/dist/analysis-core/chunks/{6RWEWBHK.js → 5B5UCWD3.js} +1 -1
- package/dist/analysis-core/chunks/6YCABS5T.js +1 -0
- package/dist/analysis-core/chunks/CQQ4TTXE.js +1 -0
- package/dist/analysis-core/chunks/CTLHKFPH.js +19 -0
- package/dist/analysis-core/chunks/F54DOWKN.js +6 -0
- package/dist/analysis-core/chunks/FRXOQ2M6.js +3 -0
- package/dist/analysis-core/chunks/HCPO6QPU.js +1 -0
- package/dist/analysis-core/chunks/HHFDNY6V.js +14 -0
- package/dist/analysis-core/chunks/{FBTOOUPL.js → HVQJKPQ4.js} +1 -1
- package/dist/analysis-core/chunks/INVTU73D.js +1 -0
- package/dist/analysis-core/chunks/JEWBPIQI.js +1 -0
- package/dist/analysis-core/chunks/JGK37AWN.js +1 -0
- package/dist/analysis-core/chunks/LFYTD7JF.js +1 -0
- package/dist/analysis-core/chunks/LMUXOKIM.js +1 -0
- package/dist/analysis-core/chunks/LOBIDUCA.js +1 -0
- package/dist/analysis-core/chunks/M5YWJY7P.js +1 -0
- package/dist/analysis-core/chunks/MGVIKA74.js +1 -0
- package/dist/analysis-core/chunks/MKYLK6DB.js +1 -0
- package/dist/analysis-core/chunks/MZOKZ3N6.js +1 -0
- package/dist/analysis-core/chunks/NXHVBJL4.js +1 -0
- package/dist/analysis-core/chunks/OKBK3JL3.js +1 -0
- package/dist/analysis-core/chunks/PBHHWFR6.js +1 -0
- package/dist/analysis-core/chunks/Q5WR6B2H.js +2 -0
- package/dist/analysis-core/chunks/QVXARKP7.js +1 -0
- package/dist/analysis-core/chunks/RQTNTIR4.js +1 -0
- package/dist/analysis-core/chunks/{RNTMH4MU.js → S27Y2TP5.js} +1 -1
- package/dist/analysis-core/chunks/SJESFYBA.js +10 -0
- package/dist/analysis-core/chunks/SP6XFHNH.js +1 -0
- package/dist/analysis-core/chunks/VDUFPTDD.js +1 -0
- package/dist/analysis-core/chunks/W24SFYZM.js +67 -0
- package/dist/analysis-core/chunks/YTHF2E2S.js +1 -0
- package/dist/analysis-core/chunks/YWL52FVW.js +2 -0
- package/dist/analysis-core/contracts/analysis-selection.js +1 -1
- package/dist/analysis-core/contracts/analysis-size.js +1 -0
- package/dist/analysis-core/contracts/execution-request.js +1 -0
- package/dist/analysis-core/contracts/intake-finding.js +1 -0
- package/dist/analysis-core/contracts/model-call-identity.js +1 -0
- package/dist/analysis-core/contracts/relay-analysis.js +1 -1
- package/dist/analysis-core/contracts/requests.js +1 -1
- package/dist/analysis-core/conventions/analysis-fit.js +1 -1
- package/dist/analysis-core/conventions/file-admission.js +1 -1
- package/dist/analysis-core/conventions/read-limits.js +1 -0
- package/dist/analysis-core/import/calls/modules.js +1 -1
- package/dist/analysis-core/import/entry-selection.js +1 -0
- package/dist/analysis-core/import/outside-loader-sources.js +1 -1
- package/dist/analysis-core/index.js +3 -3
- package/dist/analysis-core/requests/answer-formats.js +1 -1
- package/dist/analysis-core/requests/local-plan.js +1 -1
- package/dist/analysis-core/requests/planned-limits.js +1 -0
- package/dist/analysis-core/requests/registry.js +1 -1
- package/dist/analysis-core/requests/template-version.js +1 -1
- package/dist/analysis-core/requests/tools.js +1 -1
- package/dist/analysis-core/settings.js +1 -1
- package/dist/analysis-core/stages/engine-entry.js +1 -1
- package/dist/bundle/seal/engine.js +1 -1
- package/dist/cli/analysis-selection.js +47 -5
- package/dist/cli/api.js +1 -1
- package/dist/cli/commands/analyze.js +58 -15
- package/dist/cli/commands/skipped.js +65 -0
- package/dist/cli/context.js +2 -1
- package/dist/cli/finding-display.js +102 -7
- package/dist/cli/finding-settings.js +3 -1
- package/dist/cli/intake-payload.js +26 -2
- package/dist/cli/main.js +21 -7
- package/dist/cli/mcp-failure.js +6 -5
- package/dist/cli/mcp.js +134 -28
- package/dist/cli/relay-check.js +107 -23
- package/dist/cli/relay-failure.js +4 -4
- package/dist/cli/relay-preparation.js +50 -12
- package/dist/cli/result-check.js +31 -12
- package/dist/cli/saved-results.js +10 -0
- package/dist/cli/scope-choices.js +3 -3
- package/dist/cli/sign-in.js +2 -2
- package/dist/cli/skipped-files.js +22 -0
- package/dist/cli/summary.js +15 -1
- package/dist/contract/agent-choice.js +25 -2
- package/dist/contract/cli-api-messages.js +3 -0
- package/dist/contract/cli-refusals.js +31 -5
- package/dist/contract/cli-version.js +1 -1
- package/dist/contract/console-url.js +3 -0
- package/dist/contract/console.js +17 -38
- package/dist/contract/engine.js +1 -1
- package/dist/contract/messages.js +4 -3
- package/dist/contract/project-architecture.js +1 -0
- package/dist/contract/scope-choice.js +31 -11
- package/dist/contract/selection-offer.js +5 -8
- package/dist/gatekeeper/cli-api.js +70 -4
- package/dist/gatekeeper/console.js +19 -3
- package/dist/gatekeeper/model.js +5 -23
- package/dist/gatekeeper/trust/policy.js +2 -1
- package/package.json +4 -2
- package/dist/analysis-core/analysis/source-notes/types.js +0 -1
- package/dist/analysis-core/chunks/2PSNOSJ2.js +0 -1
- package/dist/analysis-core/chunks/2PZF54KH.js +0 -10
- package/dist/analysis-core/chunks/6B2HILSY.js +0 -1
- package/dist/analysis-core/chunks/6U2IR4XB.js +0 -1
- package/dist/analysis-core/chunks/7NEWZ74F.js +0 -1
- package/dist/analysis-core/chunks/CGCJN73D.js +0 -14
- package/dist/analysis-core/chunks/CWYVUGG4.js +0 -1
- package/dist/analysis-core/chunks/FSLWD2PE.js +0 -1
- package/dist/analysis-core/chunks/GOQVKWP3.js +0 -32
- package/dist/analysis-core/chunks/IHAVDX4L.js +0 -66
- package/dist/analysis-core/chunks/IVULXWQN.js +0 -21
- package/dist/analysis-core/chunks/K2GNDX3W.js +0 -1
- package/dist/analysis-core/chunks/K5FUABWW.js +0 -1
- package/dist/analysis-core/chunks/KGQYR62R.js +0 -7
- package/dist/analysis-core/chunks/KWECQJ6X.js +0 -1
- package/dist/analysis-core/chunks/PY5M22CL.js +0 -1
- package/dist/analysis-core/chunks/PYKAERZZ.js +0 -1
- package/dist/analysis-core/chunks/SKVEBOGA.js +0 -1
- package/dist/analysis-core/chunks/SLJ6CW7W.js +0 -1
- package/dist/analysis-core/chunks/UEORNVQB.js +0 -1
- package/dist/analysis-core/chunks/WYLIV2P2.js +0 -1
- package/dist/analysis-core/data/finding-types.js +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { join, relative, sep } from "node:path";
|
|
3
|
-
import { analysisSelectionRequestSchema, analysisSelectionResultSchema } from "../analysis-core/contracts/analysis-selection.js";
|
|
3
|
+
import { analysisSelectionRequestSchema, analysisSelectionResultSchema, ANALYSIS_SELECTION_LIMITS, MAX_ANALYSIS_ENTRIES } from "../analysis-core/contracts/analysis-selection.js";
|
|
4
|
+
import { findEntryScopeChoice } from "../analysis-core/import/entry-selection.js";
|
|
4
5
|
import { INVALID_SCOPE_MESSAGE, INVALID_SELECTION_MESSAGE, SCOPE_PROPOSAL_CONFLICT_MESSAGE, STALE_SCOPE_MESSAGE } from "../contract/scope-choice.js";
|
|
5
6
|
import { assessAnalysisSize, measureAnalysisSize } from "../analysis-core/conventions/analysis-fit.js";
|
|
6
7
|
import { ScopeChoiceError, selectionScopeChoices } from "../contract/selection-offer.js";
|
|
7
8
|
import { readLocalFolder } from "./files.js";
|
|
8
9
|
import { scopeChoicesEnabled, selectionModeEnabled } from "./settings.js";
|
|
9
10
|
import { entrySelectionProvider } from "./entry-selection.js";
|
|
11
|
+
import { fittingEntryGroups } from "./entry-packing.js";
|
|
10
12
|
const samePaths = (left, right) => left.length === right.length
|
|
11
13
|
&& new Set(left).size === left.length && left.every(path => right.includes(path));
|
|
12
|
-
const importsKey = (imports) => JSON.stringify(imports === "none" ? [] : Array.isArray(imports) ? [...imports].sort() : imports);
|
|
13
|
-
const sameScope = (left, right) => left.snapshot === right.snapshot && left.entry === right.entry
|
|
14
|
-
&& importsKey(left.imports) === importsKey(right.imports);
|
|
15
14
|
function selectionRequest(selection) {
|
|
16
15
|
const parsed = analysisSelectionRequestSchema.safeParse(selection.request);
|
|
17
16
|
if (!parsed.success)
|
|
@@ -38,13 +37,14 @@ export async function readAnalysisSelection(settings, selection, options = {}) {
|
|
|
38
37
|
const membership = parsed.data;
|
|
39
38
|
if (membership.launchRoot !== request.launchRoot || membership.kind !== request.kind
|
|
40
39
|
|| request.kind === "file" && (membership.kind !== "file" || membership.entry !== request.entry)
|
|
40
|
+
|| request.kind === "file" && membership.kind === "file" && JSON.stringify(request.entries) !== JSON.stringify(membership.entries)
|
|
41
41
|
|| request.kind === "folder" && (membership.kind !== "folder" || membership.folder !== request.folder))
|
|
42
42
|
throw new Error(INVALID_SELECTION_MESSAGE);
|
|
43
43
|
let paths = membership.files.map(file => file.path);
|
|
44
44
|
if (request.kind === "file" && request.scope) {
|
|
45
45
|
if (request.scope.snapshot !== membership.snapshot)
|
|
46
46
|
throw new Error(STALE_SCOPE_MESSAGE);
|
|
47
|
-
const choice = membership
|
|
47
|
+
const choice = findEntryScopeChoice(membership, request.scope);
|
|
48
48
|
if (!choice)
|
|
49
49
|
throw new Error(INVALID_SCOPE_MESSAGE);
|
|
50
50
|
paths = choice.includes;
|
|
@@ -81,13 +81,23 @@ export async function readAnalysisSelection(settings, selection, options = {}) {
|
|
|
81
81
|
throw new Error(INVALID_SELECTION_MESSAGE);
|
|
82
82
|
return { source: { ...source, sourceBase: request.launchRoot, files: Object.freeze({ ...source.files }), snapshot }, membership };
|
|
83
83
|
}
|
|
84
|
-
/** Local byte admission can prove
|
|
85
|
-
export function selectionSizeOffer(settings, membership, source) {
|
|
86
|
-
|
|
84
|
+
/** Local byte admission can prove a group fits; ordinary run admission still validates its captured source. */
|
|
85
|
+
export function selectionSizeOffer(settings, membership, source, options = {}) {
|
|
86
|
+
const currentPaths = Object.keys(source.files);
|
|
87
|
+
const entryCount = membership.kind === "file" && membership.entries
|
|
88
|
+
? membership.files.filter(file => file.role === "entry" && currentPaths.includes(file.path)).length : 1;
|
|
89
|
+
if (!options.force && source.analysisFit?.fits !== false && entryCount <= MAX_ANALYSIS_ENTRIES)
|
|
87
90
|
return undefined;
|
|
88
91
|
const oversizedPaths = membership.files.filter(file => file.role === "entry"
|
|
89
92
|
&& !assessAnalysisSize(measureAnalysisSize(settings, [file])).fits).map(file => file.path);
|
|
90
|
-
|
|
93
|
+
const groups = fittingEntryGroups(settings, membership, currentPaths);
|
|
94
|
+
const choices = [...groups, ...membership.choices].slice(0, ANALYSIS_SELECTION_LIMITS.choices);
|
|
95
|
+
const offer = selectionScopeChoices({ ...membership, choices }, { currentPaths, oversizedPaths, allowCurrent: options.force });
|
|
96
|
+
if (offer)
|
|
97
|
+
for (const choice of offer.choices)
|
|
98
|
+
if (groups.some(group => group.id === choice.id))
|
|
99
|
+
choice.fits = true;
|
|
100
|
+
return offer;
|
|
91
101
|
}
|
|
92
102
|
/** Both execution paths use this owner to select the reader and stop before a nonfitting run. */
|
|
93
103
|
export async function readAnalysisSource(settings, folder, options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { snapshotSettings } from "../analysis-core/settings.js";
|
|
2
|
-
export { fileScopeEnabled } from "../analysis-core/settings.js";
|
|
2
|
+
export { fileScopeEnabled, multiEntryEnabled } from "../analysis-core/settings.js";
|
|
3
3
|
// Local startup and retention checks share this profile; snapshots never fill it implicitly.
|
|
4
4
|
export const importerCoverageDefaults = Object.freeze({
|
|
5
5
|
CF_IMPORT_COVERAGE: "1", CF_IMPORT_LAYOUTS: "1", CF_IMPORT_MANIFEST: "1", CF_IMPORT_SCOPED_SCAN: "1",
|
|
@@ -14,7 +14,7 @@ export function readJobSettings(env = process.env) {
|
|
|
14
14
|
export function readSelectionSettings(env = process.env, options = {}) {
|
|
15
15
|
const localImportResolution = env.CF_LOCAL_IMPORT_RESOLUTION;
|
|
16
16
|
const saved = Object.freeze({ CF_FILE_SCOPE: env.CF_FILE_SCOPE ?? (localImportResolution === "0" ? "0" : "1"), CF_SCOPE_CHOICES: env.CF_SCOPE_CHOICES ?? "1",
|
|
17
|
-
CF_LOCAL_IMPORT_RESOLUTION: localImportResolution });
|
|
17
|
+
CF_LOCAL_IMPORT_RESOLUTION: localImportResolution, ...(env.CF_MULTI_ENTRY === undefined ? {} : { CF_MULTI_ENTRY: env.CF_MULTI_ENTRY }) });
|
|
18
18
|
if (options.validate !== false)
|
|
19
19
|
for (const [name, value] of Object.entries(saved)) {
|
|
20
20
|
if (value !== undefined && value !== "0" && value !== "1")
|
|
@@ -24,7 +24,27 @@ export function readSelectionSettings(env = process.env, options = {}) {
|
|
|
24
24
|
}
|
|
25
25
|
export function readTransportSettings(env = process.env) {
|
|
26
26
|
return Object.freeze({ CF_LOCAL_RELAY: env.CF_LOCAL_RELAY, CF_RELAY_DEV: env.CF_RELAY_DEV, ANTHROPIC_API_KEY: env.ANTHROPIC_API_KEY,
|
|
27
|
-
...Object.fromEntries(["CF_LOCAL_RESULTS_RETRY", "CF_RELAY_URL", "CF_CONSOLE_URL", "CF_CONSOLE_TOKEN", "CF_RELAY_DEV_TRUST", "CF_RELAY_DEV_BUNDLE", "CF_RELAY_DEV_RELEASE"].filter(key => env[key] !== undefined).map(key => [key, env[key]])) });
|
|
27
|
+
...Object.fromEntries(["CF_CLI_TRANSPORT_ERRORS", "CF_LOCAL_RESULTS_RETRY", "CF_RELAY_URL", "CF_CONSOLE_URL", "CF_CONSOLE_TOKEN", "CF_RELAY_DEV_TRUST", "CF_RELAY_DEV_BUNDLE", "CF_RELAY_DEV_RELEASE"].filter(key => env[key] !== undefined).map(key => [key, env[key]])) });
|
|
28
|
+
}
|
|
29
|
+
export function readSkippedFilesSetting(value) {
|
|
30
|
+
const choice = value ?? "1";
|
|
31
|
+
if (choice !== "0" && choice !== "1")
|
|
32
|
+
throw new Error("CF_SKIPPED_FILES must be 0 or 1.");
|
|
33
|
+
return choice;
|
|
34
|
+
}
|
|
35
|
+
export function readFolderPartsSetting(value) {
|
|
36
|
+
const choice = value ?? "0";
|
|
37
|
+
if (choice !== "0" && choice !== "1")
|
|
38
|
+
throw new Error("CF_FOLDER_PARTS must be 0 or 1.");
|
|
39
|
+
return choice;
|
|
40
|
+
}
|
|
41
|
+
/** Capture only the upload choice when an entry point establishes its execution mode. */
|
|
42
|
+
export function captureArchitectureSettings(settings, transport) {
|
|
43
|
+
// Explicit source runs save results locally and keep their existing settings shape.
|
|
44
|
+
const architecture = settings.CF_LOCAL_ARCHITECTURE ?? (transport.CF_LOCAL_RELAY === "0" ? undefined : "1");
|
|
45
|
+
if (architecture !== undefined && architecture !== "0" && architecture !== "1")
|
|
46
|
+
throw new Error("CF_LOCAL_ARCHITECTURE must be 0 or 1.");
|
|
47
|
+
return Object.freeze({ ...settings, ...(architecture === undefined ? {} : { CF_LOCAL_ARCHITECTURE: architecture }) });
|
|
28
48
|
}
|
|
29
49
|
/** Only creation fills defaults; continuation consumes its saved snapshot unchanged. */
|
|
30
50
|
export function newRunSettings(caller, env = process.env) {
|
|
@@ -32,17 +52,24 @@ export function newRunSettings(caller, env = process.env) {
|
|
|
32
52
|
if (choice !== "0" && choice !== "1")
|
|
33
53
|
throw new Error("CF_FINDING_HEADLINES must be 0 or 1.");
|
|
34
54
|
const outside = caller?.CF_IMPORT_OUTSIDE_LOADERS || env.CF_IMPORT_OUTSIDE_LOADERS || "0";
|
|
55
|
+
const skippedFiles = readSkippedFilesSetting(caller?.CF_SKIPPED_FILES ?? env.CF_SKIPPED_FILES);
|
|
56
|
+
const folderParts = caller?.CF_FOLDER_PARTS ?? env.CF_FOLDER_PARTS;
|
|
57
|
+
readFolderPartsSetting(folderParts);
|
|
58
|
+
const partFiles = caller?.CF_PART_FILES;
|
|
35
59
|
const refuseTooLarge = caller?.CF_REFUSE_TOO_LARGE ?? env.CF_REFUSE_TOO_LARGE ?? "1";
|
|
36
60
|
// Inherit operator safety switches when integrations supply only analysis settings.
|
|
37
61
|
const committedOnly = caller?.CF_LOCAL_COMMITTED_ONLY ?? env.CF_LOCAL_COMMITTED_ONLY;
|
|
38
62
|
const gitignoreOutput = caller?.CF_LOCAL_GITIGNORE_OUTPUT ?? env.CF_LOCAL_GITIGNORE_OUTPUT;
|
|
39
63
|
const chooseAgent = caller?.CF_CHOOSE_AGENT ?? env.CF_CHOOSE_AGENT;
|
|
40
64
|
const findingAudience = caller?.CF_FINDING_AUDIENCE ?? env.CF_FINDING_AUDIENCE;
|
|
65
|
+
const architecture = caller?.CF_LOCAL_ARCHITECTURE ?? env.CF_LOCAL_ARCHITECTURE;
|
|
66
|
+
const costFindings = caller?.CF_COST_FINDINGS ?? env.CF_COST_FINDINGS;
|
|
41
67
|
const selection = readSelectionSettings({ CF_FILE_SCOPE: caller?.CF_FILE_SCOPE ?? env.CF_FILE_SCOPE,
|
|
42
68
|
CF_SCOPE_CHOICES: caller?.CF_SCOPE_CHOICES ?? env.CF_SCOPE_CHOICES,
|
|
69
|
+
CF_MULTI_ENTRY: caller?.CF_MULTI_ENTRY ?? env.CF_MULTI_ENTRY,
|
|
43
70
|
CF_LOCAL_IMPORT_RESOLUTION: caller?.CF_LOCAL_IMPORT_RESOLUTION ?? env.CF_LOCAL_IMPORT_RESOLUTION });
|
|
44
71
|
for (const [name, value] of Object.entries({ CF_LOCAL_COMMITTED_ONLY: committedOnly,
|
|
45
|
-
CF_LOCAL_GITIGNORE_OUTPUT: gitignoreOutput, CF_CHOOSE_AGENT: chooseAgent, CF_FINDING_AUDIENCE: findingAudience })) {
|
|
72
|
+
CF_LOCAL_GITIGNORE_OUTPUT: gitignoreOutput, CF_CHOOSE_AGENT: chooseAgent, CF_FINDING_AUDIENCE: findingAudience, CF_COST_FINDINGS: costFindings })) {
|
|
46
73
|
if (value !== undefined && value !== "0" && value !== "1")
|
|
47
74
|
throw new Error(`${name} must be 0 or 1.`);
|
|
48
75
|
}
|
|
@@ -51,12 +78,16 @@ export function newRunSettings(caller, env = process.env) {
|
|
|
51
78
|
throw new Error("CF_IMPORT_COVERAGE must be 0 or 1.");
|
|
52
79
|
// Disabling coverage must not introduce feature choices into the earlier importer.
|
|
53
80
|
const importer = coverage === "1" ? Object.fromEntries(Object.entries(importerCoverageDefaults).map(([name, value]) => [name, caller?.[name] || env[name] || value])) : { CF_IMPORT_COVERAGE: coverage };
|
|
54
|
-
return snapshotSettings({ ...(caller ?? env), ...importer, CF_FINDING_HEADLINES: choice, CF_IMPORT_OUTSIDE_LOADERS: outside, CF_REFUSE_TOO_LARGE: refuseTooLarge,
|
|
81
|
+
return snapshotSettings(captureArchitectureSettings({ ...(caller ?? env), ...importer, CF_FINDING_HEADLINES: choice, CF_IMPORT_OUTSIDE_LOADERS: outside, CF_REFUSE_TOO_LARGE: refuseTooLarge, CF_SKIPPED_FILES: skippedFiles,
|
|
82
|
+
...(architecture === undefined ? {} : { CF_LOCAL_ARCHITECTURE: architecture }),
|
|
55
83
|
...(committedOnly === undefined ? {} : { CF_LOCAL_COMMITTED_ONLY: committedOnly }),
|
|
56
84
|
...(gitignoreOutput === undefined ? {} : { CF_LOCAL_GITIGNORE_OUTPUT: gitignoreOutput }),
|
|
57
85
|
...(chooseAgent === undefined ? {} : { CF_CHOOSE_AGENT: chooseAgent }),
|
|
58
86
|
...(findingAudience === undefined ? {} : { CF_FINDING_AUDIENCE: findingAudience }),
|
|
59
|
-
...
|
|
87
|
+
...(costFindings === undefined ? {} : { CF_COST_FINDINGS: costFindings }),
|
|
88
|
+
...(folderParts === undefined ? {} : { CF_FOLDER_PARTS: folderParts }),
|
|
89
|
+
CF_PART_FILES: partFiles,
|
|
90
|
+
...selection }, env));
|
|
60
91
|
}
|
|
61
92
|
/** The installed command selects the relay; source-only switches remain on the development runner. */
|
|
62
93
|
export function readCliSettings(env = process.env, emailSignIn) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { localSourcePlan } from "../analysis-core/requests/local-plan.js";
|
|
2
|
+
import { prepareRelayPlanFromCalls } from "./relay-plan.js";
|
|
3
|
+
/** Source preparation plans the captured view once and shares the public paid-plan owner. */
|
|
4
|
+
export function prepareRelayPlan({ bundle, relayVersion, settings, source }) {
|
|
5
|
+
const { files, calls } = localSourcePlan(settings, source);
|
|
6
|
+
return { files, plan: prepareRelayPlanFromCalls({ bundle, relayVersion, calls }) };
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../../chunks/
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../../chunks/HCPO6QPU.js";import"../../chunks/724WZMYW.js";export{e as ANALYZE_SKIPPED_FILES_OFFER,h as analysisSkippedFiles,b as mergeSkippedFiles,d as mergeUnlistedFileWarnings,a as scanSkippedFiles,f as sizeSkippedFiles,c as skippedFileWarnings,g as skippedFilesNotice};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../chunks/LOBIDUCA.js";import"../chunks/YTHF2E2S.js";import"../chunks/4PT5C4IT.js";import"../chunks/2YREYGOG.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import"../chunks/2AASSZRO.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/YUY436SM.js";import"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";export{a as fileScopeOf,b as planFileAnalyses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as l}from"../chunks/YWL52FVW.js";import{a as m,h as i,j as f}from"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";function g(r){let s=new Set(r.entries.map(e=>e.path)),a=new f({files:new Map([...s].map(e=>[e,r.files[e]??""]))},r.settings);return Object.fromEntries(Object.entries(r.files).flatMap(([e,c])=>{let n=m(e);if(!n||!s.has(e))return[];let p=l(e,c,n,!0).flatMap(t=>{let d=t.names.map(o=>t.renamed?.[o]??o);return i(e,t.source,d,n,s,a)});return[[e,[...new Set(p)]]]}))}export{g as fileDependencies};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../chunks/INVTU73D.js";export{b as findingActivitySettings,a as notActiveEnabled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";export{e as declinedFindingRelation,c as evidenceSiteKeys,a as fingerprintOf,b as legacyIdentityOf,d as matchFindingIdentities,j as passFindingIdentity,g as passFindingSites,f as replayFindingIdentities,i as sameEvidence,h as sameLegacyPassFinding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a,h as b}from"../../chunks/F54DOWKN.js";import"../../chunks/QVXARKP7.js";import"../../chunks/2AASSZRO.js";import"../../chunks/74FPPPIG.js";import"../../chunks/MKYLK6DB.js";import"../../chunks/5TATKWLG.js";import"../../chunks/OKBK3JL3.js";import"../../chunks/JKWTHRUR.js";import"../../chunks/3GUKUEEJ.js";import"../../chunks/LFYTD7JF.js";import"../../chunks/MGVIKA74.js";import"../../chunks/YUY436SM.js";import"../../chunks/C6X5GDG4.js";import"../../chunks/724WZMYW.js";import"../../chunks/YWL52FVW.js";import"../../chunks/SJESFYBA.js";import"../../chunks/RUVMFAST.js";import"../../chunks/S27VIQMZ.js";import"../../chunks/INVTU73D.js";import"../../chunks/A7WJJMRY.js";import"../../chunks/Q5WR6B2H.js";import"../../chunks/VDUFPTDD.js";export{a as assessFindings,b as rankFindings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as S,d as O}from"../chunks/33HRXJ5Q.js";import"../chunks/33IGHOYT.js";import{b as q}from"../chunks/LOBIDUCA.js";import{i as x}from"../chunks/YTHF2E2S.js";import"../chunks/4PT5C4IT.js";import"../chunks/2YREYGOG.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import"../chunks/2AASSZRO.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/YUY436SM.js";import"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";import{posix as j}from"node:path";function H(y,f){if(!x(y))return[];let b=[],p=new Set,v=new Set,a=[...new Set(f.paths)],i=new Set(a),d=new Set(f.agentPromptPaths.filter(e=>i.has(e))),r=f.fragment.nodes.filter(e=>e.kind==="agent"),E=new Set(r.flatMap(e=>e.files.map(t=>t.path).filter(t=>i.has(t)))),u=new Map(r.map(e=>[e.id,f.fragment.edges.filter(t=>t.from===e.id&&t.kind==="delegates").map(t=>t.to)])),F=e=>{let t=new Set,s=[e];for(;s.length;){let n=s.pop();t.has(n)||(t.add(n),s.push(...u.get(n)??[]))}return r.filter(n=>t.has(n.id)).flatMap(n=>n.files.map(o=>o.path).filter(o=>i.has(o)))},g=Object.assign(Object.create(null),f.dependencies),P=(e,t)=>{for(let s of e)g[s]=[...new Set([...g[s]??[],...t])]},R=e=>{let t=new Map;for(let s of e)for(let n of new Set(s.files))t.set(n,(t.get(n)??0)+1);return s=>t.get(s)===1},W=r.map(e=>({files:e.files.map(t=>t.path).filter(t=>i.has(t))})),$=R(W),A=e=>[...e.files.map(t=>t.path).filter(t=>i.has(t)).filter($),...e.sourceRef&&i.has(e.sourceRef.path)?[e.sourceRef.path]:[]],C=e=>e.sourceRef&&d.has(e.sourceRef.path)?e.sourceRef.path:e.files.find(t=>d.has(t.path))?.path;for(let e of r)P(A(e),F(e.id));let M=O(f.codeAgents??[]).map(e=>({...e,files:e.files.filter(t=>i.has(t))})),J=R(M);for(let e of M)P(e.files.filter(J),e.files);let k=(e,t,s)=>{if(!t.length)return!1;let n=q(y,{...f,dependencies:g,paths:t});if(n.groups.length!==1||n.tooLarge.length||n.unavailable.length||n.missingContext?.length)return!1;let o=[...n.groups[0].files].sort(),l=d.has(s)&&o.includes(s)?s:o.find(h=>d.has(h));if(!l||a.every(h=>o.includes(h)))return!1;let c=JSON.stringify(o);return v.has(c)||(v.add(c),o.forEach(h=>p.add(h)),b.push({label:e??S(o),files:o,reason:l})),!0},m=new Set,w=e=>{if(m.has(e))return;m.add(e);let t=r.find(n=>n.id===e);if(!t)return;let s=F(e);if(s.length){let n=A(t);if(n.length){let l=S(n);s.push(...a.filter(c=>!E.has(c)&&(l==="."||c.startsWith(`${l}/`))))}let o=C(t);if(o&&k(t.label,s,o))return}for(let n of u.get(e)??[])w(n)},L=new Set([...u.values()].flat());for(let e of r.filter(t=>!L.has(t.id)))w(e.id);for(let e of r)!m.has(e.id)&&!e.files.every(t=>p.has(t.path))&&w(e.id);let N=new Set(a.flatMap(e=>{let t=[];for(let s=j.dirname(e);s!==".";s=j.dirname(s))t.push(s);return t}));for(let e of[...N].sort()){let t=a.filter(s=>s.startsWith(`${e}/`));t.some(s=>p.has(s))||k(void 0,t,t[0])}return b}export{H as planFolderAnalyses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a,c as b,d as c}from"../../chunks/2YREYGOG.js";import"../../chunks/6YCABS5T.js";import"../../chunks/M5YWJY7P.js";import"../../chunks/M6HYSTQD.js";import"../../chunks/4H23CSUM.js";import"../../chunks/JEWBPIQI.js";import"../../chunks/NXHVBJL4.js";import"../../chunks/MJGB25S5.js";import"../../chunks/RQTNTIR4.js";import"../../chunks/LMUXOKIM.js";import"../../chunks/QVXARKP7.js";import"../../chunks/2AASSZRO.js";import"../../chunks/74FPPPIG.js";import"../../chunks/MKYLK6DB.js";import"../../chunks/5TATKWLG.js";import"../../chunks/OKBK3JL3.js";import"../../chunks/JKWTHRUR.js";import"../../chunks/3GUKUEEJ.js";import"../../chunks/LFYTD7JF.js";import"../../chunks/MGVIKA74.js";import"../../chunks/YUY436SM.js";import"../../chunks/C6X5GDG4.js";import"../../chunks/724WZMYW.js";import"../../chunks/YWL52FVW.js";import"../../chunks/SJESFYBA.js";import"../../chunks/RUVMFAST.js";import"../../chunks/S27VIQMZ.js";import"../../chunks/INVTU73D.js";import"../../chunks/A7WJJMRY.js";import"../../chunks/Q5WR6B2H.js";import"../../chunks/VDUFPTDD.js";export{b as fileEvidenceBytes,a as fileSearchBudget,c as fullFilePasses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d,d as s}from"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";function i(r){if(!r?.nodes.length)return;let o=new Map(r.nodes.map((e,t)=>[e.id,`node-${t+1}`])),c={version:1,nodes:r.nodes.map(e=>({id:o.get(e.id),label:e.label,kind:e.kind,files:(e.files??[]).map(t=>({path:t.path,role:t.role,...t.label===void 0?{}:{label:t.label}})),tools:(e.tools??[]).map(t=>({label:t.label,...t.source===void 0?{}:{source:t.source}}))})),edges:r.edges.map(e=>({from:o.get(e.from),to:o.get(e.to),kind:e.kind}))},n=s.safeParse(c);return n.success?n.data:void 0}export{d as PROJECT_ARCHITECTURE_BYTES,i as projectArchitecture,s as projectArchitectureSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ba as g,Ca as h,Da as i,Ea as j,Fa as l,Ka as o,Ma as p,Na as q,Oa as r,Pa as s,Qa as t,Ra as u}from"../chunks/2AASSZRO.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import{c as b,d as c,e as d,f as e,g as f}from"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import{g as a}from"../chunks/MGVIKA74.js";import"../chunks/YUY436SM.js";import"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import{a as m,b as n}from"../chunks/INVTU73D.js";import{a as k}from"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";export{p as MAX_FINDINGS,i as attachFiles,q as cleanFindings,s as cleanFixDelta,h as cleanFragment,a as findingActivitySchema,n as findingActivitySettings,k as findingAudienceEnabled,e as findingsSchema,f as findingsSchemaFor,t as fingerprintOf,r as fixFingerprintOf,o as groupByActivity,l as groupByAudience,b as inspectFixSchema,j as mergeGraphs,g as normaliseBrand,m as notActiveEnabled,u as numberLines,c as otherSiteSchema,d as rawFindingSchema};
|