import type { Capability } from '@fetchproxy/server'; import type { CaptureHeaderDecl, DomSelectorDecl, DomListSelectorDecl, IndexedDbScopeDecl, StoragePointerDecl, GraphqlOpDeclaration } from '@fetchproxy/protocol'; import type { Profile } from './profiles.js'; export interface DerivedServerOpts { serverName: string; version: string; domains: string[]; capabilities: Capability[]; cookieKeys: string[]; localStorageKeys: string[]; sessionStorageKeys: string[]; captureHeaders: CaptureHeaderDecl[]; indexedDbScopes: IndexedDbScopeDecl[]; localStoragePointers: StoragePointerDecl[]; sessionStoragePointers: StoragePointerDecl[]; domSelectors: DomSelectorDecl[]; domListSelectors: DomListSelectorDecl[]; graphqlOps: GraphqlOpDeclaration[]; } /** * Derive the FetchproxyServer opts for a profile. * * MUST stay in lockstep with `bootstrap()`'s derivation * (packages/bootstrap/src/index.ts, "capabilities" block): extension * trust is keyed to (identity, domains, capabilities), so every fpx * verb — and the `session` verb, which goes through bootstrap() itself * — has to send an identical hello or the user gets re-pair prompts * when alternating verbs. Same push order, same pointer auto-add, and * the same `localStoragePointers`/`sessionStoragePointers` mapping * (outputKey is dropped, storageKey → `key`) so the hello — not just * the capability list and raw key sets — is byte-for-byte identical. * * NOTE: `bootstrap()` (and therefore the `session` verb, which calls it * directly) has no concept of `domSelectors`/`domListSelectors`/`download` — * those fields are `fpx`-only (`dom`/`dom-list`/`download` verbs), so * `runSession` never declares `read_dom`/`read_dom_list`/`download` in its * hello. A profile that declares any of them sends a wider hello on the * direct verbs (`dom`, `dom-list`, `download`, * `get`, `cookies`, …, all of which route through `serverOptsFor`) than * `session` does. This is the same one-time, non-blocking scope-update * self-healing behavior already accepted for the pointer scopes above: * alternating `fpx session` with `fpx dom`/`fpx download` on such a * profile costs a one-time re-pair on first alternation, not a * per-invocation prompt. */ export declare function serverOptsFor(profileName: string, p: Profile, version: string): DerivedServerOpts;