import { H as HostConfigSkillSelection, a as HostConfigConnectionDefaults, b as HostConfigMcpProfileV1, M as McpProtocolVersion, c as HostStyleId, d as ModelVisibleMcpToolResults, e as McpToolResultImageRendering, f as Harness, S as ServerId, g as HostConfigComputer } from './types-HXAijHji.js'; /** * `@mcpjam/sdk/host-config` — PUBLIC type surface. * * MCP-protocol vocabulary for the developer-facing `Host` API. These names are * what an external agent author sees; the internal storage-row vocabulary * (`HostConfigInputV2`, `mcpProfile`, schema versions) stays in `./types.ts` * and `./canonicalize.ts` and is reached only through `Host`. * * Wire compatibility (option b): the internal canonical shape keeps the * on-disk field name `mcpProfile`, but `HostJson` deliberately exposes public * vocabulary (`mcp`). A small mapper in `./host.ts` bridges the two so the * storage-row canonical JSON + hash stay stable. */ /** * Computer attached to a host, as it appears on a NORMALIZED snapshot. This * is the RESOURCE attachment only; the capabilities the model gets on it * (e.g. `bash`) are granted via `builtInToolIds`. * * `kind: "personal"` is the cloud workstation — one machine per * (project, user) — and the only kind you can author. * `kind: "ephemeral"` is a per-run box the platform mints itself (eval runs * boot one per iteration from the run's frozen environment image). It can * appear when you READ a snapshot back; it is not something you write, so * treat an ephemeral computer as read-only snapshot data. See * {@link HostComputerInput} for the authoring shape. */ type HostComputer = HostConfigComputer; /** * Input-tolerant computer shape for the Host builder / JSON snapshots: the * legacy `toolset` key is accepted (and dropped by the canonicalizer) so * pre-existing programmatic callers keep compiling. New code should write * `{ kind: "personal" }` and grant capabilities via `builtInToolIds`. * * Deliberately NOT an alias of the canonical {@link HostComputer}: authoring * is personal-only. `"ephemeral"` is minted by the platform at a run-snapshot * boundary and is never authored, so it is absent from every input type. */ type HostComputerInput = { kind: "personal"; toolset?: "bash"; workdir?: string; }; /** * Skill selection policy for a host (OpenAI plugin import). * Absent → legacy all-visible behavior. `{ mode: "all-visible" }` is the * explicit spelling of the same behavior and normalizes away at `toJSON()`; * `{ mode: "explicit", skillIds }` — including an empty `skillIds` * ("explicitly no skills") — is preserved. Plugin-imported skills are * ordinary materialized skill rows, selectable by id here like any * standalone skill (the UI groups them by plugin provenance). */ type HostSkillSelection = HostConfigSkillSelection; /** Per-host connection defaults (headers + request timeout in ms). */ type HostConnectionDefaults = HostConfigConnectionDefaults; /** * A host's MCP settings — the host-facing rename of the internal `mcpProfile`. * Spec-aligned vocabulary: `protocolVersion`, `initialize` (clientInfo, * supported versions), and `apps` (sandbox, ui/initialize hostInfo, compat * runtime, MCP-Apps overrides). The internal schema-version marker * (`profileVersion`) is supplied by the SDK; authors never set it. */ type HostMcp = Omit & { /** Automatic negotiation or one concrete host-default wire pin. */ protocolVersion?: McpProtocolVersion | "auto"; }; /** * The normalized host configuration returned by `Host.toJSON()`. * * Pure public vocabulary — no implementation names leak here: `mcp` (not * `mcpProfile`), `style`/`model`/`servers`, and no `schemaVersion`/ * `profileVersion` markers. It is normalized (sorted, deduped, derived) and * round-trips: `new Host(host.toJSON())` reproduces an equivalent host. The * internal content-addressed wire form (which the backend stores) is * deliberately not exposed. */ interface HostJson { style: HostStyleId; model: string; systemPrompt: string; temperature: number; requireToolApproval: boolean; progressiveToolDiscovery?: boolean; respectToolVisibility?: boolean; modelVisibleMcpToolResults?: ModelVisibleMcpToolResults; /** Human-facing rendering policy for MCP tool-returned images. */ mcpToolResultImageRendering?: McpToolResultImageRendering; /** Computer attached to this host; absent ⇒ none. Normalized: `null` input * never survives to `HostJson`. Authored hosts are always `"personal"`; * a snapshot read back from a platform run may carry `"ephemeral"`. */ computer?: HostComputer; /** Which harness runs the turn; absent ⇒ emulated. `"claude-code"` runs the * turn in a real Claude Code runtime (requires an attached `computer`). */ harness?: Harness; servers: ServerId[]; optionalServers: ServerId[]; /** Skill selection. Absent ⇒ legacy all-visible. Normalized: * only the explicit variant survives to `HostJson` (`all-visible` collapses * to absent — the type enforces it); `skillIds: []` means "explicitly no * standalone skills". */ skillSelection?: Extract; connectionDefaults: HostConnectionDefaults; clientCapabilities: Record; hostContext: Record; hostCapabilitiesOverride?: Record; chatUiOverride?: Record; mcp?: HostMcp; serverOverrides?: Record; } /** Per-server connection override (host-facing field names). */ interface HostServerOverride { headers?: Record; requestTimeout?: number; protocolVersion?: McpProtocolVersion; } /** * Optional initial configuration for `new Host(init?)`. Every field is * type-optional so the imperative pattern works (`new Host(); host.style = * "..."; host.model = "..."`), but `style` and `model` are **required at * use** — `toJSON()` throws if either is missing. The SDK deliberately ships * no default `style` (so an external author isn't silently opted into MCPJam * product chrome) and no default `model`. After construction every field is * also accessible as a mutable property on the `Host` instance (e.g. * `host.mcp.protocolVersion = "..."`, `host.servers.push(...)`). */ interface HostInit { /** * Host style id (e.g. "mcpjam", "claude", "chatgpt"). Required at * `toJSON()`; no SDK default. **Product knob, not SEP-1865** — selects * which host-style preset (chrome, capability defaults, compat-runtime * shims) the inspector applies. */ style?: HostStyleId; /** LLM model id (e.g. "anthropic/claude-sonnet-4-6"). Required at `toJSON()`; no SDK default. */ model?: string; systemPrompt?: string; /** Sampling temperature. Default: 0.7. */ temperature?: number; requireToolApproval?: boolean; /** Opt into progressive MCP tool discovery (search/load meta-tools). */ progressiveToolDiscovery?: boolean; /** SEP-1865 `_meta.ui.visibility` filtering. Undefined → spec default. */ respectToolVisibility?: boolean; /** Host policy for model visibility of MCP tool-result content/resources. */ modelVisibleMcpToolResults?: ModelVisibleMcpToolResults; /** Human-facing rendering policy for MCP tool-returned images. */ mcpToolResultImageRendering?: McpToolResultImageRendering; /** * Attach a personal cloud workstation (chat `bash` tool + web terminal). * Absent or `null` ⇒ no computer; `null` is accepted so an editor can * clear the field and is normalized away at `toJSON()`. Personal-only — * the platform's `"ephemeral"` kind is not authorable. */ computer?: HostComputerInput | null; /** * Which harness runs the turn; absent ⇒ emulated (MCPJam's own loop). Set to * `"claude-code"` to run the turn inside a real Claude Code runtime via the * AI SDK harness. The harness runs in the host's attached `computer` (E2B), * so a computer is required when this is set. */ harness?: Harness; /** Required servers this host connects to. */ servers?: ServerId[]; /** Optional (auto-connect-if-available) servers. */ optionalServers?: ServerId[]; /** Skill selection. Absent (or `{ mode: "all-visible" }`) ⇒ * legacy all-visible behavior; `{ mode: "explicit", skillIds }` restricts * to the listed skills (`[]` = explicitly none). */ skillSelection?: HostSkillSelection; connectionDefaults?: Partial; clientCapabilities?: Record; hostContext?: Record; /** * Override the SEP-1865 MCP-Apps `hostCapabilities` blob advertised in * `ui/initialize`. `undefined` = use the host-style preset; `{}` = * advertise nothing (hashes distinctly from `undefined`). Used to *cap* * what a host advertises (e.g. drop `serverTools` to block widget→server * tool proxying), never to grant capabilities the preset doesn't already * support. */ hostCapabilitiesOverride?: Record; /** Override the chat-UI surface (logo, fonts, …). */ chatUiOverride?: Record; /** The host's MCP settings. */ mcp?: HostMcp; /** Per-server connection overrides, keyed by server id. */ serverOverrides?: Record; } export type { HostJson as H, HostConnectionDefaults as a, HostInit as b, HostMcp as c, HostServerOverride as d, HostComputer as e, HostComputerInput as f, HostSkillSelection as g };