import type { GatewayRequestContext, GatewayRequestOptions } from "../../gateway/server-methods/types.js"; export type PluginRuntimeGatewayRequestScope = { context?: GatewayRequestContext; client?: GatewayRequestOptions["client"]; isWebchatConnect: GatewayRequestOptions["isWebchatConnect"]; pluginId?: string; pluginSource?: string; gatewayMethodDispatchAllowed?: boolean; }; export type PluginRuntimePluginScope = { pluginId: string; pluginSource?: string; }; /** * Runs plugin gateway handlers with request-scoped context that runtime helpers can read. */ export declare function withPluginRuntimeGatewayRequestScope(scope: PluginRuntimeGatewayRequestScope, run: () => T): T; /** * Runs work under the current gateway request scope while attaching plugin identity. */ export declare function withPluginRuntimePluginScope(scope: PluginRuntimePluginScope, run: () => T): T; /** * Runs work under the current gateway request scope while attaching plugin identity. */ export declare function withPluginRuntimePluginIdScope(pluginId: string, run: () => T): T; /** * Returns the current plugin gateway request scope when called from a plugin request handler. */ export declare function getPluginRuntimeGatewayRequestScope(): PluginRuntimeGatewayRequestScope | undefined;