mirror of
https://github.com/morluto/rea.git
synced 2026-11-04 05:46:17 +00:00
* fix(mcp): report Linux-only integrations as unsupported_host off their hosts Session discovery folded the host check into each optional integration's enabled flag, so on macOS or Windows the Linux-only packet, signal, firmware, pwntools, EVM and Wakaru tools reported provider_missing. Their execution guards refuse those hosts whatever is configured, so installing a provider there could never make them available. The server now records, per integration, when the host is outside its verified host and no service is injected. Discovery checks that before configuration and reports unsupported_host with the existing remediation. Injected services and supported hosts behave as before. Fixes #5730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(mcp): share provider host checks with session discovery Discovery restated each Linux-only integration's host rule in createServer while its provider kept a separate execution check, so the two could drift apart again. Each provider now exports its host predicate, uses it in its execution guard, and composition hands the same predicate to createServer for both the host restriction and the enabled flag. Observed host restrictions now also apply when an embedder supplies its own availability policy, as provider load failures already do, because no policy lets the default providers pass their host checks. The MCP regression moves to tests/process-global and emulates darwin arm64, linux arm64 and linux x64 through the real createServer, so CI on Linux x64 exercises the unsupported-host branch. It also covers a configured policy and the matching execution refusals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): keep caller host restrictions beside observed ones The observed host restriction replaced a configured policy's whole hostUnsupported map. For an injected service the observed value is false, so a caller's own restriction was lost and the tool was reported available. Combine both per integration: either the caller or the observed host can mark it unsupported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(pcap): expect unsupported_host for packet tools off Linux The host-independent PATH case asserted provider_missing on every host. Off Linux the packet tools are unavailable because of the host, so discovery now reports unsupported_host there; Linux still reports provider_missing for an unusable PATH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
2.9 KiB
TypeScript
50 lines
2.9 KiB
TypeScript
import { ByteEntropyService } from "../application/binaryDiagnostics/ByteEntropyService.js";
|
|
import { RecordedCrashService } from "../application/binaryDiagnostics/RecordedCrashService.js";
|
|
import { PwntoolsRecordedCrashProvider } from "../native/pwntools/PwntoolsRecordedCrashProvider.js";
|
|
import { BinaryLayoutService } from "../application/binaryDiagnostics/BinaryLayoutService.js";
|
|
import { PwntoolsLayoutProvider } from "../native/pwntools/PwntoolsLayoutProvider.js";
|
|
import { pwntoolsHostSupported } from "../native/pwntools/PwntoolsDecoder.js";
|
|
import { PeResourcesService } from "../application/binaryDiagnostics/PeResourcesService.js";
|
|
import { PeResourcesProvider } from "../native/pe/PeResourcesProvider.js";
|
|
import { PeCertificatesService } from "../application/binaryDiagnostics/PeCertificatesService.js";
|
|
import { PeCertificatesProvider } from "../native/pe/PeCertificatesProvider.js";
|
|
import { ElfNotesService } from "../application/binaryDiagnostics/ElfNotesService.js";
|
|
import { ElfNotesProvider } from "../native/elf/ElfNotesProvider.js";
|
|
import type { ArtifactResourceScope } from "../artifacts/ArtifactResourceScope.js";
|
|
import { NativeExportsService } from "../application/binaryDiagnostics/NativeExportsService.js";
|
|
import { NativeExportsProvider } from "../native/exports/NativeExportsProvider.js";
|
|
|
|
export { pwntoolsHostSupported };
|
|
|
|
/** Portable PE inspection with no engine, installation or target acquisition. */
|
|
export const createPeResourcesService = (): PeResourcesService =>
|
|
new PeResourcesService(new PeResourcesProvider());
|
|
|
|
/** Portable Authenticode table inspection with no engine or catalog verification. */
|
|
export const createPeCertificatesService = (): PeCertificatesService =>
|
|
new PeCertificatesService(new PeCertificatesProvider());
|
|
|
|
/** Portable PE/ELF export tables with no engine, toolchain or target acquisition. */
|
|
export const createNativeExportsService = (): NativeExportsService =>
|
|
new NativeExportsService(new NativeExportsProvider());
|
|
/** Portable ELF note-table inspection with no engine or package catalog. */
|
|
export const createElfNotesService = (): ElfNotesService =>
|
|
new ElfNotesService(new ElfNotesProvider());
|
|
|
|
/** Compose the offline adapter without import-time I/O or dependency acquisition. */
|
|
export const createBinaryLayoutService = (
|
|
environment: Readonly<NodeJS.ProcessEnv> = process.env,
|
|
): BinaryLayoutService =>
|
|
new BinaryLayoutService(new PwntoolsLayoutProvider(environment));
|
|
|
|
/** Compose recorded-core inspection without acquiring a debugger or toolchain. */
|
|
export const createRecordedCrashService = (
|
|
environment: Readonly<NodeJS.ProcessEnv> = process.env,
|
|
): RecordedCrashService =>
|
|
new RecordedCrashService(new PwntoolsRecordedCrashProvider(environment));
|
|
|
|
/** Provider-free local byte analysis. */
|
|
export const createByteEntropyService = (
|
|
resources?: ArtifactResourceScope,
|
|
): ByteEntropyService => new ByteEntropyService(undefined, resources);
|