import type { ChannelAdapter } from "#channel/adapter.js"; import type { UserContent } from "ai"; import type { ChannelReceiveContext } from "#channel/channel-operations.js"; import type { NormalizedChannelCorsOptions } from "#channel/cors.js"; import type { TypedReceiveTarget } from "#channel/receive-target.js"; import type { RouteDefinition } from "#channel/routes.js"; import type { Session } from "#channel/session.js"; import type { SessionAuthContext, TurnPolicy } from "#channel/types.js"; import type { JsonObject } from "#shared/json.js"; export declare const CHANNEL_SENTINEL: "eve:channel"; interface ChannelBuildMetadata { readonly externalCredentials?: unknown; readonly manifest?: JsonObject; } type ChannelBuildMetadataFactory = (channelName: string) => ChannelBuildMetadata; /** Structural identity shared by public authored channels and compiled channels. */ export interface ChannelReference> extends TypedReceiveTarget { readonly __kind: typeof CHANNEL_SENTINEL; } export interface CompiledChannel, TMetadata extends Record = Record> extends ChannelReference { readonly routes: readonly RouteDefinition[]; readonly adapter: ChannelAdapter; readonly cors?: NormalizedChannelCorsOptions; readonly __metadata?: TMetadata; readonly receive?: (input: { readonly message: string | UserContent; readonly target: Readonly; readonly auth: SessionAuthContext | null; }, ctx: ChannelReceiveContext) => Promise; readonly turnPolicy?: TurnPolicy; } export declare function isCompiledChannel(value: unknown): value is CompiledChannel; export declare function getChannelBuildMetadata(value: unknown, channelName: string): ChannelBuildMetadata | undefined; export declare function setChannelBuildMetadata(channel: unknown, factory: ChannelBuildMetadataFactory): void; export declare function getChannelInstrumentationKind(value: unknown): string | undefined; export declare function setChannelInstrumentationKind(channel: CompiledChannel, kind: string): void; export {};