Files
rea/src/domain/webBundleAnalyzer.ts
T
morlutoandGitHub b5e98915c6 fix(tools)!: simplify direct invocation and harden boundary contracts (#555)
Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures.

Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation.

BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
2026-10-05 20:16:44 +08:00

30 lines
935 B
TypeScript

import type { WebPageInspection } from "./browserObservation.js";
import {
analyzeScript,
emptyAccumulator,
isIncludedScript,
} from "./webBundleAnalyzerInspection.js";
import { buildWebBundleAnalysis } from "./webBundleAnalyzerResult.js";
import type { WebBundleAnalysis } from "./webBundleAnalysis.js";
/** Analyze selected captured JavaScript source without execution. */
export const analyzeCapturedWebBundle = (
inspection: WebPageInspection,
sourceMaps: WebBundleAnalysis["observations"]["source_maps"] = {
status: "not_requested",
requested: 0,
processed: 0,
items: [],
},
): WebBundleAnalysis => {
const accumulator = emptyAccumulator();
const sourceScripts = inspection.scripts.items.filter(isIncludedScript);
for (const script of sourceScripts) analyzeScript(script, accumulator);
return buildWebBundleAnalysis(
inspection,
sourceScripts,
sourceMaps,
accumulator,
);
};