Merge branch 'feat/dylib-resolution' into feat/dyld-shared-cache
# Conflicts: # README.md # README_ar.md # README_ja.md # README_ko.md # README_zh.md # docs/product-catalog.json # docs/verification/managed-conformance-manifest.json # skills/reverse-engineer-anything/SKILL.md # src/generatedMcpToolCatalog.ts
This commit is contained in:
@@ -22,6 +22,9 @@ import { createWebModuleTraceService } from "../composition/webModules.js";
|
||||
import { createWebSourceLocationService } from "../composition/webSourceLocations.js";
|
||||
import { registerWebSourceLocationTool } from "./registerWebSourceLocationTool.js";
|
||||
import type { WebSourceLocationService } from "../application/WebSourceLocationService.js";
|
||||
import type { WebRuntimeService } from "../application/WebRuntimeService.js";
|
||||
import { createWebRuntimeService } from "../composition/webRuntime.js";
|
||||
import { registerWebRuntimeTools } from "./registerWebRuntimeTools.js";
|
||||
import { registerJavaScriptRecoveryTool } from "./registerJavaScriptRecoveryTool.js";
|
||||
import { JavaScriptRecoveryService } from "../application/javascript/JavaScriptRecoveryService.js";
|
||||
import type { JavaScriptRecoveryPort } from "../application/javascript/JavaScriptRecoveryPort.js";
|
||||
@@ -58,6 +61,7 @@ export interface CreateServerOptions {
|
||||
readonly javascriptRecovery?: JavaScriptRecoveryPort;
|
||||
readonly webModuleTrace?: WebModuleTraceService;
|
||||
readonly webSourceLocation?: WebSourceLocationService;
|
||||
readonly webRuntime?: WebRuntimeService;
|
||||
readonly androidAnalysis?: AndroidAnalysisPort;
|
||||
readonly browserObservation?: BrowserObservationPort;
|
||||
readonly browserScenarioCapture?: BrowserScenarioCapturePort;
|
||||
@@ -203,6 +207,12 @@ export const createServer = (
|
||||
toolLogger,
|
||||
recordEvidence,
|
||||
);
|
||||
registerWebRuntimeTools(
|
||||
server,
|
||||
options.webRuntime ?? createWebRuntimeService(),
|
||||
toolLogger,
|
||||
recordEvidence,
|
||||
);
|
||||
registerJavaScriptRecoveryTool(
|
||||
server,
|
||||
new JavaScriptRecoveryService(
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
||||
import { err } from "../domain/result.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { registerEvidenceTools } from "./registerEvidenceTools.js";
|
||||
import { runManagedProviderExecution } from "../application/DirectAnalysis.js";
|
||||
import { runManagedProviderExecution } from "../composition/directAnalysis.js";
|
||||
import { isManagedToolName } from "../contracts/managed/managedToolContracts.js";
|
||||
|
||||
/** Register execution-free managed PE/CLI inspection. */
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { McpServer } from "@modelcontextprotocol/server";
|
||||
import type { WebRuntimeService } from "../application/WebRuntimeService.js";
|
||||
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
|
||||
import { toolContract } from "../contracts/toolContracts.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { mcpProgressReporter } from "./mcpProgress.js";
|
||||
import { logToolExecution } from "./toolLogging.js";
|
||||
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
|
||||
import { toCallToolResult } from "./toolResult.js";
|
||||
|
||||
/** Bind distinct runtime operations to named contracts and the session's Evidence owner. */
|
||||
export const registerWebRuntimeTools = (
|
||||
server: McpServer,
|
||||
service: WebRuntimeService,
|
||||
logger: Logger,
|
||||
recordEvidence?: EvidenceWriter["recordEvidence"],
|
||||
): void => {
|
||||
const execution = toolContract("observe_web_execution");
|
||||
const listeners = toolContract("inspect_web_event_listeners");
|
||||
server.registerTool(
|
||||
execution.name,
|
||||
toolRegistrationOptions(execution),
|
||||
async (input, context) => {
|
||||
const result = await logToolExecution(logger, execution.name, () =>
|
||||
service.observe(input, {
|
||||
signal: context.mcpReq.signal,
|
||||
progress: mcpProgressReporter(context),
|
||||
}),
|
||||
);
|
||||
if (!result.ok) return toCallToolResult(result, execution);
|
||||
const recorded = recordEvidence?.(result.value);
|
||||
return recorded !== undefined && !recorded.ok
|
||||
? toCallToolResult(recorded, execution)
|
||||
: toCallToolResult(result, execution);
|
||||
},
|
||||
);
|
||||
server.registerTool(
|
||||
listeners.name,
|
||||
toolRegistrationOptions(listeners),
|
||||
async (input, context) => {
|
||||
const result = await logToolExecution(logger, listeners.name, () =>
|
||||
service.inspect(input, { signal: context.mcpReq.signal }),
|
||||
);
|
||||
if (!result.ok) return toCallToolResult(result, listeners);
|
||||
const recorded = recordEvidence?.(result.value);
|
||||
return recorded !== undefined && !recorded.ok
|
||||
? toCallToolResult(recorded, listeners)
|
||||
: toCallToolResult(result, listeners);
|
||||
},
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user