mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
Preserve XML and Interface Builder identity at their parsing boundary, retain usable Objective-C slots with precise coverage, and keep native trace failures distinct from absence. Add caller-selected Interface Builder summaries backed by complete retained Evidence, and preserve comparison limitations. Reviewed fixes: #1969, #2088, #2108, #2513, #2639, #2684, #2731, #2759, #2875, #2888, #2889, #2970, #2971, #3002. Validation: relevant native/domain focused lane passed 142 tests; earlier Interface Builder/MCP checks passed 24 tests. Real native UI and Ghidra producer coverage was not repeated.
53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
|
|
|
|
import {
|
|
ARTIFACT_TOOL_CONTRACTS,
|
|
artifactInspectionInputSchema,
|
|
} from "../contracts/artifactToolContracts.js";
|
|
import { createArtifactExtractionDestination } from "../application/artifacts/ArtifactExtractionDestination.js";
|
|
import { registerEvidenceTools } from "./registerEvidenceTools.js";
|
|
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
|
import {
|
|
retainedSummaryDelivery,
|
|
withoutDeliveryDetail,
|
|
type EvidenceToolFamilyOptions,
|
|
} from "./retainedSummaryDelivery.js";
|
|
|
|
/** Operations whose MCP delivery may be a retained summary view. */
|
|
const SUMMARY_DELIVERY: ReadonlySet<string> = new Set([
|
|
"inspect_artifact",
|
|
"decode_interface_builder",
|
|
]);
|
|
/** inspect_artifact keeps an explicit detail in its Evidence parameters. */
|
|
const decodeWithoutDelivery = withoutDeliveryDetail(
|
|
new Set(["decode_interface_builder"]),
|
|
);
|
|
|
|
/** Register deterministic artifact inventory and safe extraction operations. */
|
|
export const registerArtifactTools = (
|
|
server: EvidenceMcpServer,
|
|
options: EvidenceToolFamilyOptions,
|
|
): void => {
|
|
registerEvidenceTools(server, ARTIFACT_TOOL_CONTRACTS, {
|
|
...options,
|
|
...retainedSummaryDelivery(SUMMARY_DELIVERY, options),
|
|
parametersForExecution: (operation, parameters) => {
|
|
if (operation === "inspect_artifact") {
|
|
const { detail: _detail, ...execution } =
|
|
artifactInspectionInputSchema.parse(parameters);
|
|
return execution;
|
|
}
|
|
return operation === "extract_artifact"
|
|
? { ...parameters, output_root: createArtifactExtractionDestination() }
|
|
: decodeWithoutDelivery(operation, parameters);
|
|
},
|
|
parametersForEvidence: decodeWithoutDelivery,
|
|
sourceEvidence: (operation, result) =>
|
|
operation === "inspect_artifact"
|
|
? artifactInspectionResultSchema
|
|
.parse(result)
|
|
.substeps.map(({ evidence }) => evidence)
|
|
: [],
|
|
});
|
|
};
|