Carry #952's Apple ownership into the cache work: the cache reader and fixture move to src/artifacts/apple/, the cache facts, platforms and resolution schema to src/domain/apple/, the cache service to src/application/apple/, and the lane to scripts/verify/apple/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import type { McpServer } from "@modelcontextprotocol/server";
|
|
|
|
import { inspectDyldSharedCacheEvidence } from "../../application/apple/DyldSharedCacheService.js";
|
|
import { applicationToolContract } from "../../contracts/applicationToolContracts.js";
|
|
import { logToolExecution } from "../toolLogging.js";
|
|
import { toolRegistrationOptions } from "../toolRegistrationOptions.js";
|
|
import { toCallToolResult } from "../toolResult.js";
|
|
import { recordResult } from "./helpers.js";
|
|
import type { ApplicationToolRegistration } from "./types.js";
|
|
|
|
/** Register the target-free dyld shared cache inspection tool. */
|
|
export const registerInspectDyldSharedCacheTool = (
|
|
server: McpServer,
|
|
options: ApplicationToolRegistration,
|
|
): void => {
|
|
const contract = applicationToolContract("inspect_dyld_shared_cache");
|
|
server.registerTool(
|
|
contract.name,
|
|
toolRegistrationOptions(contract),
|
|
async (input: unknown, context) => {
|
|
const result = await logToolExecution(options.logger, contract.name, () =>
|
|
inspectDyldSharedCacheEvidence(input, context.mcpReq.signal),
|
|
);
|
|
if (!result.ok) return toCallToolResult(result, contract);
|
|
return recordResult(options, contract, result.value);
|
|
},
|
|
);
|
|
};
|