mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 05:56:19 -10:00
Follow up #2199 and #2183. Replace invalid cross-process WM_PRINT DC delivery with PrintWindow in one owned, deadline- and memory-bounded helper. Return metadata summaries by default through MCP with explicit retained image reads. Verified actual pixels through CLI and MCP on Windows x64, including a non-elevated desktop, live redraws, PNG capacity refusal and retry, and target identity rejection. Final expanded acceptance and CI results are recorded in the pull request.
29 lines
960 B
TypeScript
29 lines
960 B
TypeScript
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
|
|
|
|
import { NATIVE_TOOL_CONTRACTS } from "../contracts/native/nativeToolContracts.js";
|
|
import { registerEvidenceTools } from "./registerEvidenceTools.js";
|
|
import {
|
|
retainedSummaryDelivery,
|
|
withoutDeliveryDetail,
|
|
type EvidenceToolFamilyOptions,
|
|
} from "./retainedSummaryDelivery.js";
|
|
|
|
const SUMMARY_DELIVERY: ReadonlySet<string> = new Set([
|
|
"inspect_macho",
|
|
"capture_windows_window_screenshot",
|
|
]);
|
|
|
|
/** Register native contracts with caller-selected retained summaries. */
|
|
export const registerNativeTools = (
|
|
server: EvidenceMcpServer,
|
|
options: EvidenceToolFamilyOptions,
|
|
): void => {
|
|
const withoutDelivery = withoutDeliveryDetail(SUMMARY_DELIVERY);
|
|
registerEvidenceTools(server, NATIVE_TOOL_CONTRACTS, {
|
|
...options,
|
|
...retainedSummaryDelivery(SUMMARY_DELIVERY, options),
|
|
parametersForExecution: withoutDelivery,
|
|
parametersForEvidence: withoutDelivery,
|
|
});
|
|
};
|