import { i as McpToolResultImageRenderPlacement, h as McpToolResultImageRenderingPolicy } from './types-HXAijHji.js'; /** * Host execution policy extraction + iteration-metadata stamping. * * Pure — derived from a hostConfig snapshot. Used by both the live chat * runtime (via `prepareChatV2`'s `respectToolVisibility` gate) and the eval * runtime (via `applyVisibilityPolicyAndCountSignals` + `buildHostIterationMetadata`). * * `extractHostExecutionPolicy` accepts the dual progressiveToolDiscovery * shape because HostConfigV2 stores it as a plain boolean while chat-v2 * wire payloads wrap it as `{ enabled, threshold }`. Both flow through here. */ type ResolvedModelVisibleMcpToolResults = { directContent: { text: boolean; image: boolean; audio: boolean; }; embeddedResources: { text: boolean; blob: { enabled: boolean; image: boolean; audio: boolean; document: boolean; video: boolean; otherBinary: boolean; }; }; linkedResources: { text: boolean; blob: { enabled: boolean; image: boolean; audio: boolean; document: boolean; video: boolean; otherBinary: boolean; }; }; }; type ResolvedMcpToolResultImageRenderingPolicy = { placement: McpToolResultImageRenderPlacement; directContent: { image: boolean; }; embeddedResources: { blob: { image: boolean; }; }; linkedResources: { blob: { image: boolean; }; }; }; declare function resolveMcpToolResultImageRendering(policy: McpToolResultImageRenderingPolicy | undefined): ResolvedMcpToolResultImageRenderingPolicy; type HostExecutionPolicy = { requireToolApproval: boolean; /** undefined = spec default (filter app-only tools from model). false = opt out. */ respectToolVisibility: boolean | undefined; progressiveDiscoveryEnabled: boolean; /** * Whether eligible MCP image-bearing tool-result content should be passed * through as model-visible image content instead of staying as JSON. These * are host/client capabilities, not storage or UI-rendering concerns. */ modelVisibleMcpToolResults: ResolvedModelVisibleMcpToolResults; mcpToolResultImageRendering: ResolvedMcpToolResultImageRenderingPolicy; hostStyle: string | undefined; namedHostId: string | undefined; }; declare function extractHostExecutionPolicy(hostConfig: Record | null, namedHostId?: string): HostExecutionPolicy; /** * Builds the scalar host-policy metadata fields to merge into * `EvalIteration.metadata`. Only includes keys with meaningful values to * avoid inflating rows with zero-valued noise. * * The `approvalsWouldRequire` count is the number of tool calls that * actually occurred in this iteration and would have required approval * under the host's `requireToolApproval` policy. Evals do not block on * approval prompts — this is a "would prompt N times" signal only. */ /** * Snapshot-only host metadata for SDK eval reports. Subset of * {@link buildHostIterationMetadata} that needs no per-iteration counters * (signals / approvalsWouldRequire / injectOpenAiCompat) and can be * derived from `Host.toJSON()` alone. * * Used by SDK eval result mapping to stamp executor-derived host context * onto each iteration's metadata. Per-iteration signal counts (tools * exposed / dropped, approvals required) are added by callers that have * runtime access (inspector eval runner, future `HostRuntime` plumbing). */ declare function buildHostSnapshotMetadata(hostConfig: Record | null): Record; declare function buildHostIterationMetadata(policy: HostExecutionPolicy, signals: ToolExposureSignals, approvalsWouldRequire: number, injectOpenAiCompat: boolean): Record; /** * SEP-1865 host visibility filter and exposure-signal counting. * * Structurally pure — depends only on `isAppOnlyTool` (a pure leaf) and the * `HostExecutionPolicy` type. Does NOT import `MCPClientManager` or any AI * SDK code, so this module can ship from `@mcpjam/sdk/host-config/internal` * (which the inspector client imports as source via Vite alias) without * dragging Node-heavy deps into the browser bundle. * * The `ToolMetadataSource` duck-type below is satisfied by * `MCPClientManager` (its `getAllToolsMetadata` signature matches), so * inspector callers pass their existing manager unchanged. */ /** * Structural type for anything that can supply per-server tool metadata. * `MCPClientManager.getAllToolsMetadata(serverId)` satisfies this. */ interface ToolMetadataSource { getAllToolsMetadata(serverId: string): Record>; } type ToolExposureSignals = { toolsTotalBefore: number; toolsExposed: number; toolsDroppedVisibility: number; }; /** * Mutates `tools` in place, removing entries whose source MCP tool declares * SEP-1865 `_meta.ui.visibility` as exactly `["app"]`. * * Per SEP-1865, the visibility array defaults to `["model", "app"]` so a tool * with no visibility metadata is treated as visible to both. * * `tools` is expected to be the tool-set shape produced by * `MCPClientManager.getToolsForAiSdk(...)` — each entry carries a `_serverId` * string used to look up its source metadata. Tools without `_serverId` are * left untouched (they did not originate from an MCP server). */ declare function filterAppOnlyTools(tools: Record, source: ToolMetadataSource): void; /** * Applies the host visibility policy to `tools` (mutates in place, same as * `prepareChatV2`) and returns tool exposure counts for iteration metadata * stamping. * * Call this AFTER loading the full tool set so `toolsTotalBefore` is accurate. */ declare function applyVisibilityPolicyAndCountSignals(tools: Record, source: ToolMetadataSource, policy: HostExecutionPolicy): ToolExposureSignals; export { type HostExecutionPolicy as H, type ResolvedMcpToolResultImageRenderingPolicy as R, type ToolExposureSignals as T, type ToolMetadataSource as a, applyVisibilityPolicyAndCountSignals as b, buildHostIterationMetadata as c, buildHostSnapshotMetadata as d, extractHostExecutionPolicy as e, filterAppOnlyTools as f, resolveMcpToolResultImageRendering as r };