Files
reverse-engineering-anything/src/composition/wasm.ts
T
morluto f3ed1657f8 feat(mcp): support runtime analysis limit recovery (#7049)
* feat(mcp): support runtime analysis limit recovery

* refactor(config): remove unused limit re-exports

* fix(android): keep fixture release metadata dependency-free

* fix(settings): preserve provider budgets and recovery facts

* fix(tests): resolve lint plugins from their repository owner

* refactor(mcp): verify guidance delivery without frozen wording

* fix(android): align availability with runtime timeout

* test(recovery): assert limit facts instead of frozen wording

* fix(mcp): share runtime settings with the default JADX provider

* test(mcp): bound acknowledgements and release held work on failure

* fix(catalog): declare runtime settings tools as MCP-only
2026-10-25 09:45:26 +08:00

34 lines
1.4 KiB
TypeScript

import type { AnalysisSettingsReader } from "../domain/analysisSettings.js";
import { WasmArtifactService } from "../application/wasm/WasmArtifactService.js";
import { WabtArtifactProvider } from "../wasm/WabtArtifactProvider.js";
import { INSPECT_WASM_ARTIFACT_CONTRACT } from "../contracts/wasm/wasmToolContracts.js";
import { CLI_COMMANDS } from "../cliCommandNames.js";
/** Compose the caller-supplied offline toolchain without acquisition or import-time I/O. */
export const createWasmArtifactService = (
environment: Readonly<NodeJS.ProcessEnv> = process.env,
settings?: AnalysisSettingsReader,
): WasmArtifactService =>
new WasmArtifactService(new WabtArtifactProvider(environment), settings);
/**
* Internal static descriptor for one named domain operation and its lifetime.
* CLI/MCP share this binding; the service keeps failed resource ownership so
* close can be retried. Construction performs no acquisition or target I/O.
*/
export const wasmArtifactModule = {
contract: INSPECT_WASM_ARTIFACT_CONTRACT,
cliCommand: CLI_COMMANDS.inspectWasmArtifact,
create(
environment: Readonly<NodeJS.ProcessEnv>,
injected?: WasmArtifactService,
settings?: AnalysisSettingsReader,
): Pick<WasmArtifactService, "inspect" | "close"> {
const service =
injected ?? createWasmArtifactService(environment, settings);
return {
inspect: service.inspect.bind(service),
close: service.close.bind(service),
};
},
} as const;