* feat(captures): discover installed protocol and field definitions * test(captures): isolate the direct glossary oracle profile * test(captures): accept padded kernel limit reports * fix(captures): detach every retained glossary column * fix(captures): describe every field discovery CLI option * fix(captures): retain discovery operation across cleanup retries --------- Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import type { EvidenceMcpServer } from "./EvidenceMcpServer.js";
|
|
import type { PacketCaptureService } from "../application/captures/PacketCaptureService.js";
|
|
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
|
|
import { toolContract } from "../contracts/toolContracts.js";
|
|
import type { Logger } from "pino";
|
|
import type { WithAdmittedAnalysis } from "./analysisAdmission.js";
|
|
import { createEvidenceToolHandler } from "./contractToolHandler.js";
|
|
import { toolRegistrationOptions } from "./toolRegistrationOptions.js";
|
|
|
|
/** Bind the named capture contract through shared admission and retained Evidence delivery. */
|
|
export const registerCaptureTools = (
|
|
server: EvidenceMcpServer,
|
|
service: PacketCaptureService,
|
|
logger: Logger,
|
|
recordEvidence?: EvidenceWriter["recordEvidence"],
|
|
withAdmittedAnalysis?: WithAdmittedAnalysis,
|
|
): void => {
|
|
const contract = toolContract("inspect_packet_capture");
|
|
const handler = createEvidenceToolHandler(
|
|
server,
|
|
(input, options) => service.inspect(input, options),
|
|
logger,
|
|
recordEvidence,
|
|
withAdmittedAnalysis,
|
|
);
|
|
server.registerTool(
|
|
contract.name,
|
|
toolRegistrationOptions(contract),
|
|
handler(contract),
|
|
);
|
|
const discovery = toolContract("inspect_packet_fields");
|
|
const discover = createEvidenceToolHandler(
|
|
server,
|
|
(input, options) => service.inspectFields(input, options),
|
|
logger,
|
|
recordEvidence,
|
|
withAdmittedAnalysis,
|
|
);
|
|
server.registerTool(
|
|
discovery.name,
|
|
toolRegistrationOptions(discovery),
|
|
discover(discovery),
|
|
);
|
|
};
|