Files
rea/src/server/EvidenceMcpServer.ts
T
morluto 92f32981da refactor(mcp): remove the duplicate result delivery class
Construct the canonical ToolResultDelivery through the native continuation policy factory. Move type and lifecycle spy consumers to the core owner while preserving explicit response budgets and the deferred runtime composition.

Validation: runtime build and 335 focused tests passed; 41 Linux-only firmware cases were skipped on macOS. Tests use authored local fixtures, not real external providers.
2026-10-25 02:28:09 +08:00

49 lines
1.4 KiB
TypeScript

import type {
Implementation,
McpServerOptions,
} from "@modelcontextprotocol/server";
import type { EvidenceWriter } from "../application/investigation/InvestigationRecordPort.js";
import {
FULL_CATALOG_IDENTITY,
createCatalogIdentity,
} from "../catalogIdentity.js";
import type { ToolResultDelivery } from "./ToolResultDelivery.js";
import {
EvidenceMcpServerCore,
type CompactInputSchemaPresentation,
} from "./EvidenceMcpServerCore.js";
export {
forgetPendingMcpRequest,
type CompactInputSchemaPresentation,
} from "./EvidenceMcpServerCore.js";
/** Canonical composition retains the constructor's existing identity defaults. */
export class EvidenceMcpServer extends EvidenceMcpServerCore {
constructor(
info: Implementation,
options: McpServerOptions,
recordEvidence: EvidenceWriter["recordEvidence"] | undefined,
delivery: ToolResultDelivery,
compactPresentation: CompactInputSchemaPresentation | undefined = undefined,
omitOutputSchemas = false,
identity?: ReturnType<typeof createCatalogIdentity>,
) {
super(
info,
options,
recordEvidence,
delivery,
compactPresentation,
omitOutputSchemas,
identity ??
(compactPresentation === undefined && !omitOutputSchemas
? FULL_CATALOG_IDENTITY
: createCatalogIdentity(
compactPresentation,
omitOutputSchemas ? "off" : "full",
)),
);
}
}