import { type Capability, type CaptureHeaderDecl, type IndexedDbScopeDecl, type DomSelectorDecl, type GraphqlOpDeclaration, type StoragePointerDecl, type HelloFrameFromServer } from '@fetchproxy/protocol'; import type { Identity } from './identity.js'; /** * Inputs to `buildServerHello`. Mirrors the fields a host or peer * already has to track on startup — `serverName`, `version`, declared * `domains[]`, optional `capabilities[]` — so callers don't have to * spread their own ad-hoc structure into one. */ export interface BuildServerHelloOpts { identity: Identity; mcpId: string; serverName: string; version: string; domains: string[]; /** Optional. Defaults to `['fetch']` to preserve pre-capability behavior. */ capabilities?: Capability[]; /** 0.3.0+: declared scope. Omitted from the wire when empty/absent. */ cookieKeys?: string[]; localStorageKeys?: string[]; sessionStorageKeys?: string[]; captureHeaders?: CaptureHeaderDecl[]; /** 0.4.0+: declared IndexedDB scopes for `read_indexed_db`. */ indexedDbScopes?: IndexedDbScopeDecl[]; /** 0.4.0+: declared JSON-pointer extractions over storage. */ localStoragePointers?: StoragePointerDecl[]; sessionStoragePointers?: StoragePointerDecl[]; /** 1.4.0+: declared DOM selectors for `read_dom`. */ domSelectors?: DomSelectorDecl[]; /** 1.x+: declared GraphQL operations for the `graphql` capability. */ graphqlOps?: GraphqlOpDeclaration[]; } /** * Build a `HelloFrameFromServer` frame, including a fresh 32-byte * session nonce and the Ed25519 signature over `mcpId || sessionNonce`. * * Both `startHost` (concentrator path) and `startPeer` (joiner path) * emit this frame on startup with identical structure; consolidating * the construction here keeps the nonce length, signing payload, and * field defaults in one place. Callers should NOT cache the result — * `sessionNonce` is fresh per call and must remain fresh per session. */ export declare function buildServerHello(opts: BuildServerHelloOpts): Promise;