mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 09:34:20 +00:00
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.
49 lines
1.4 KiB
TypeScript
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",
|
|
)),
|
|
);
|
|
}
|
|
}
|