/** * Host bridge profile vocabulary (DEC-059). * * Formalizes the interop contract between `@sentropic/h2a` and external host * runtimes that embed `h2a mcp-serve` (e.g. `@sentropic/remote`). * The contract has five clauses from DEC-056: * * 1. identity — how the host names h2a INSTANCE and where it surfaces it. * 2. lifecycle — how the host's session states map to H2ASessionState. * 3. resource-limits — whether the host's resource limits are reflected on h2a * presence and whether h2a enforces them (V1: never). * 4. disclosure — what disclosure boundary the host workspace draws. * 5. auth-boundary — which trust boundary covers the shared `/.h2a/`. * * V1 ships one canonical profile (`remote`) and the audit primitive. * Adding a new host means adding a profile + extending the audit fixtures — * no host-side runtime logic in `@sentropic/h2a` itself. */ import { type H2ASessionState } from "./session.js"; export declare const H2A_HOST_BRIDGE_CLAUSES: readonly ["identity", "lifecycle", "resource-limits", "disclosure", "auth-boundary"]; export type H2AHostBridgeClause = (typeof H2A_HOST_BRIDGE_CLAUSES)[number]; export interface H2AHostBridgeIdentityClause { /** * Template the host uses to derive the h2a INSTANCE id. The shell-style * `${PLACEHOLDER}` syntax is informational; the host's pod template engine * is responsible for the actual substitution. */ readonly instanceTemplate: string; /** Mapping of h2a concept → host env var. */ readonly envVarMap: { readonly instance: string; readonly host: string; readonly root: string; }; /** Value of `host` reported on `h2a_session_open`. */ readonly hostHint: string; } export interface H2AHostBridgeLifecycleClause { /** * Host lifecycle state → h2a session state. Every value MUST be in * `H2A_SESSION_STATES`. The audit refuses unknown targets. */ readonly stateMap: Readonly>; /** * One-line plain-English description of when the transition happens * (e.g. "Pod scheduled → opening"). */ readonly description: string; } export interface H2AHostBridgeResourceLimitsClause { /** True if the host's CPU/RAM limits are surfaced on the h2a presence file. */ readonly reflected: boolean; /** V1 invariant: h2a NEVER enforces host limits. Audit fails if `true`. */ readonly enforced: false; /** Free text explaining where the reflected info lives. */ readonly reflectedAs?: string; } export interface H2AHostBridgeDisclosureClause { /** What disclosure boundary the host workspace draws (informational). */ readonly workspaceBoundary: string; /** Status of cross-workspace disclosure for this host. */ readonly crossWorkspace: "deferred" | "supported" | "n/a"; /** Pointer to the DEC governing cross-workspace evolution. */ readonly crossWorkspaceReference?: string; } export interface H2AHostBridgeAuthBoundaryClause { /** Transport carrying the h2a session traffic (e.g. "filesystem (emptyDir)"). */ readonly transport: string; /** Where trust enforcement happens (e.g. "Pod-level", "Namespace-level"). */ readonly enforcement: string; } export interface H2AHostBridgeProfileDescriptor { readonly hostId: string; readonly label: string; readonly identity: H2AHostBridgeIdentityClause; readonly lifecycle: H2AHostBridgeLifecycleClause; readonly resourceLimits: H2AHostBridgeResourceLimitsClause; readonly disclosure: H2AHostBridgeDisclosureClause; readonly authBoundary: H2AHostBridgeAuthBoundaryClause; readonly references: readonly string[]; } export interface H2AHostBridgeAuditResult { readonly ok: boolean; readonly hostId?: string; readonly clauses: readonly H2AHostBridgeClause[]; readonly issues: readonly string[]; readonly enforces: boolean; } export declare const H2A_HOST_BRIDGE_PROFILES: Readonly<{ readonly remote: Readonly<{ hostId: "remote"; label: "@sentropic/remote session sidecar"; identity: Readonly<{ instanceTemplate: "remote:${SESSION_ID}"; envVarMap: Readonly<{ instance: "H2A_INSTANCE"; host: "H2A_HOST"; root: "H2A_ROOT"; }>; hostHint: "remote"; }>; lifecycle: Readonly<{ stateMap: Readonly<{ provisioning: "opening"; running: "live"; terminating: "draining"; ended: "closed"; }>; description: "remote session-agent emits lifecycle events at Pod scheduling, container Ready, container Terminating and Pod Completed; each maps onto the matching H2ASessionState."; }>; resourceLimits: Readonly<{ reflected: true; enforced: false; reflectedAs: "informational labels on the h2a presence file; h2a never enforces remote CPU/RAM limits."; }>; disclosure: Readonly<{ workspaceBoundary: "one h2a coordination scope per remote session Pod; the emptyDir is the trust boundary."; crossWorkspace: "deferred"; crossWorkspaceReference: "DEC-056 Scenarios B/C"; }>; authBoundary: Readonly<{ transport: "filesystem (emptyDir shared between the runtime container and the h2a-mcp sidecar)"; enforcement: "Pod-level"; }>; references: readonly ["DEC-056", "DEC-058", "DEC-059"]; }>; }>; export type H2AHostBridgeProfileId = keyof typeof H2A_HOST_BRIDGE_PROFILES; export declare function getHostBridgeProfile(hostId: string): H2AHostBridgeProfileDescriptor | undefined; /** * Validate that a host bridge profile (a) is registered, (b) carries the * five canonical clauses, (c) maps every host lifecycle state to a known * `H2ASessionState`, and (d) does NOT claim to enforce host resource limits * (V1 invariant per DEC-059). */ export declare function auditHostBridge(hostId: string): H2AHostBridgeAuditResult; /** * List the registered host bridge profile ids. Useful for tooling that wants * to display the supported bridges (e.g. `h2a host status` extension, or the * @sentropic/remote protocol schema generator). */ export declare function listHostBridgeProfiles(): readonly string[]; //# sourceMappingURL=h2a-bridge.d.ts.map