import type { ScopeModule } from '../scope/index.js';
import type { JsonObject } from '../internal/utils.js';
import type { RuntimeAiModule, RuntimeAccountClient, RuntimeAppAuthClient, RuntimeAgentClient, RuntimeAuditClient, RuntimeAuthClient, RuntimeClient, RuntimeConnectorClient, RuntimeEventPayloadMap, RuntimeEventsModule, RuntimeKnowledgeClient, RuntimeLocalServiceClient, RuntimeMemoryClient, RuntimeMediaModule, RuntimeModelClient, RuntimeScopeModule, RuntimeStreamCallOptions, RuntimeUnsafeRawModule, RuntimeWorkflowClient } from './types.js';
import type { RuntimeInternalContext } from './internal-context.js';
type RuntimeInvokeWithClient = <T>(operation: (client: RuntimeClient) => Promise<T>) => Promise<T>;
type RuntimeInvoke = <T>(operation: () => Promise<T>) => Promise<T>;
type RuntimeRawCall = RuntimeUnsafeRawModule['call'];
type RuntimeModuleAppClient = {
    sendMessage: RuntimeClient['app']['sendAppMessage'];
    subscribeMessages: RuntimeClient['app']['subscribeAppMessages'];
};
type RuntimeAuthEventEmitter = {
    emitTokenIssued: (tokenId: string) => void;
    emitTokenRevoked: (tokenId: string) => void;
};
type RuntimeTelemetryEmitter = (name: string, data?: JsonObject) => void;
export type RuntimeCorePassthroughClients = {
    auth: RuntimeAuthClient;
    account: RuntimeAccountClient;
    workflow: RuntimeWorkflowClient;
    model: RuntimeModelClient;
    local: RuntimeLocalServiceClient;
    connector: RuntimeConnectorClient;
    knowledge: RuntimeKnowledgeClient;
    memory: RuntimeMemoryClient;
    agent: RuntimeAgentClient;
    audit: RuntimeAuditClient;
};
export declare function createRuntimeEventsModule(eventBus: {
    on: <K extends keyof RuntimeEventPayloadMap>(name: K, handler: (payload: RuntimeEventPayloadMap[K]) => void) => () => void;
    once: <K extends keyof RuntimeEventPayloadMap>(name: K, handler: (payload: RuntimeEventPayloadMap[K]) => void) => () => void;
}): RuntimeEventsModule;
export declare function createCorePassthroughClients(input: {
    assertMethodAvailable: (moduleKey: string, methodKey: string) => void;
    invokeWithClient: RuntimeInvokeWithClient;
}): RuntimeCorePassthroughClients;
export declare function createAppClient(input: {
    invokeWithClient: RuntimeInvokeWithClient;
    wrapModeDStream: <T>(source: AsyncIterable<T>) => AsyncIterable<T>;
}): RuntimeModuleAppClient;
export declare function createAppAuthClient(input: {
    invokeWithClient: RuntimeInvokeWithClient;
    resolvePublishedCatalogVersion: (requested?: string) => string;
    emitTelemetry: RuntimeTelemetryEmitter;
    authEvents: RuntimeAuthEventEmitter;
}): RuntimeAppAuthClient;
export declare function createScopeClient(input: {
    invoke: RuntimeInvoke;
    scopeModule: ScopeModule;
}): RuntimeScopeModule;
export declare function createAiModule(input: {
    invokeWithClient: RuntimeInvokeWithClient;
    ctx: RuntimeInternalContext;
}): RuntimeAiModule;
export declare function createMediaModule(ctx: RuntimeInternalContext): RuntimeMediaModule;
export declare function createRawModule(input: {
    rawCall: RuntimeRawCall;
    invokeWithClient: RuntimeInvokeWithClient;
}): RuntimeUnsafeRawModule;
export declare function createHealthEventStreams(input: {
    audit: RuntimeAuditClient;
    wrapModeDStream: <T>(source: AsyncIterable<T>) => AsyncIterable<T>;
}): {
    healthEvents: (request?: import('./generated/runtime/v1/audit.js').SubscribeRuntimeHealthEventsRequest, options?: RuntimeStreamCallOptions) => Promise<AsyncIterable<import('./generated/runtime/v1/audit.js').RuntimeHealthEvent>>;
    providerHealthEvents: (request?: import('./generated/runtime/v1/audit.js').SubscribeAIProviderHealthEventsRequest, options?: RuntimeStreamCallOptions) => Promise<AsyncIterable<import('./generated/runtime/v1/audit.js').AIProviderHealthEvent>>;
};
export declare function emitAuthTokenIssuedEvent(eventBus: {
    emit: <K extends keyof RuntimeEventPayloadMap>(name: K, payload: RuntimeEventPayloadMap[K]) => void;
}, tokenId: string): void;
export declare function emitAuthTokenRevokedEvent(eventBus: {
    emit: <K extends keyof RuntimeEventPayloadMap>(name: K, payload: RuntimeEventPayloadMap[K]) => void;
}, tokenId: string): void;
export {};
//# sourceMappingURL=runtime-modules.d.ts.map