import { Hono } from "hono"; import type { McpServer } from "../mcp/server.js"; import type { BrokerLogin } from "./oauth/broker-login.js"; import { type H2AHostedOAuthConfig } from "./oauth/config.js"; import type { SingleTenantOAuthProvider } from "./oauth/single-tenant-provider.js"; export interface HostedAppDeps { oauthProvider: SingleTenantOAuthProvider; oauthConfig: H2AHostedOAuthConfig; /** The in-process h2a MCP dispatch (createMcpServer) — its read-only tools are exposed. */ h2aMcpServer: McpServer; /** * EVO-12 P2 (mode 3): when `oauthConfig.brokerMode`, the broker login (built * from `oauthConfig.upstream`). Its /authorize delegates the user login to * 39-auth instead of the consent secret. Omit for single-tenant. */ brokerLogin?: BrokerLogin; /** * EVO-12 P2 (mode 3, multi-tenant): per-user /mcp serving. When present AND * `oauthConfig.brokerMode`, the /mcp handler derives each request's tenant * root from the access token's `sub` (rootForSub(baseRoot, sub)) and serves * that tenant's h2a dispatch — instead of the single `h2aMcpServer`. Underlying * servers are cached per root; a session is pinned to the tenant that opened * it (a token for another tenant cannot reuse it). `h2aMcpServer` remains the * fallback for any non-broker path. */ tenancy?: { baseRoot: string; /** Build the in-process h2a dispatch rooted at `root` (e.g. createMcpServer({ root })). */ createServer: (root: string) => McpServer; }; } export declare function createHostedApp(deps: HostedAppDeps): Hono; //# sourceMappingURL=app.d.ts.map