/** The legacy RPC proxy property checked on the connection handle. */ export declare const CONNECTION_SERVICE = "connection"; /** The dsh ≥ 0.1.2 Typert application-RPC service. */ export declare const REMOTE_SERVICE = "remote"; /** Minimal cordis client context surface this bridge touches. */ export interface ConnectionApiCompatContext { get?(name: string): unknown; inject?(inject: string[], callback: (ctx: ConnectionApiCompatContext) => unknown): unknown; /** cordis effect hook: when present, the bridge assignment and the * fallback timer are torn down with the fiber (HMR-safe). */ effect?(fn: () => (() => void) | void): unknown; } /** Bare RpcResult the 0.1.2 Typert remote resolves to. */ export interface RpcResultOk { ok: true; value: T; } export interface RpcResultError { ok: false; error: { code: string; message: string; details?: unknown; }; } export type RpcResult = RpcResultOk | RpcResultError; /** The legacy 0.1.1 response envelope consumers unwrap with `valueOf`. */ export interface RpcResponse { result: RpcResult; } interface LlmProviderInfoLike { id: string; label?: string; } interface LlmConfigurableProviderLike { provider: string; displayName: string; settingsNs: string; settingsPath?: readonly string[]; declared?: boolean; } /** The remote namespaces this bridge adapts. */ interface RemoteLike { llm?: { listProviders?(): Promise>; listConfigurableProviders?(): Promise>; }; session?: { modelCatalog?(): Promise>; }; settings?: { describe?(): Promise>; /** 0.1.2: merge a patch into the namespace's stored user section. */ update?(ns: string, patch: Record, expectedRevision?: number): Promise>; /** 0.1.2: replace the namespace's stored user section wholesale. */ replace?(ns: string, section: Record, expectedRevision?: number): Promise>; mutate?(ns: string, ops: readonly unknown[], expectedRevision?: number): Promise>; }; } interface SettingsNamespaceViewLike { ns: string; user?: unknown; revision?: number; } interface SettingsDescribeLike { namespaces: readonly SettingsNamespaceViewLike[]; writable?: boolean; } /** * Build the legacy `connection.api` proxy over a 0.1.2 `ctx.remote` face. * Namespaces or methods missing from the remote degrade to a `transport` * failure response rather than a synchronous throw, so one absent method does * not take down the whole proxy. */ export declare function buildLegacyApiProxy(remote: RemoteLike): Record; /** * Install the legacy `connection.api` proxy when the host's connection * handle lacks one. * * The inject list names every nested Remote service the proxy touches: * cordis guards nested service access (`remote.session` etc.) behind the * caller fiber's inject declarations, so the namespaces are resolved through * `scope.get('remote.')` inside the ordered fiber rather than by * walking properties off the `remote` service. * * @param ctx - the client plugin's cordis context. * @param onReady - invoked once the proxy question is settled: synchronously * when no bridge is needed (legacy host, or a context without inject), or * from the ordered inject fiber after the proxy was attached. * @returns true when the ready signal was delivered synchronously. */ export declare function installConnectionApiCompat(ctx: ConnectionApiCompatContext, onReady: () => void): boolean; export {};