import type { ChannelConversationKind, ChannelLifecycleAction, JsonRecord } from './route-helpers.js'; export type ChannelSurface = string; export type ChannelDirectoryScope = string; export interface ChannelAgentToolDefinitionLike { readonly definition: unknown; } export interface ChannelTargetResolutionInput { readonly input: string; readonly accountId?: string | undefined; readonly preferredKind?: ChannelConversationKind | undefined; readonly threadId?: string | undefined; readonly sessionId?: string | undefined; readonly createIfMissing?: boolean | undefined; readonly live?: boolean | undefined; readonly metadata?: Record | undefined; } export interface ChannelAuthorizeActionInput { readonly actionId: string; readonly actorId?: string | undefined; readonly accountId?: string | undefined; readonly target?: unknown | undefined; readonly metadata?: Record | undefined; } export interface ChannelAllowlistInput { readonly add?: readonly string[] | undefined; readonly remove?: readonly string[] | undefined; readonly groupId?: string | undefined; readonly channelId?: string | undefined; readonly workspaceId?: string | undefined; readonly kind?: 'user' | 'channel' | 'group' | undefined; readonly metadata?: Record | undefined; } export interface ChannelDirectoryQuery { readonly query: string; readonly scope?: ChannelDirectoryScope | undefined; readonly groupId?: string | undefined; readonly limit?: number | undefined; readonly live?: boolean | undefined; } export interface ChannelPluginServiceLike { listAccounts(surface?: ChannelSurface): Promise; getAccount(surface: ChannelSurface, accountId: string): Promise; getSetupSchema(surface: ChannelSurface, accountId?: string): Promise; doctor(surface: ChannelSurface, accountId?: string): Promise; listRepairActions(surface: ChannelSurface, accountId?: string): Promise; getLifecycleState(surface: ChannelSurface, accountId?: string): Promise; runAccountAction(surface: ChannelSurface, action: ChannelLifecycleAction, accountId: string | undefined, input?: JsonRecord): Promise; listCapabilities(surface?: ChannelSurface): Promise; listTools(surface?: ChannelSurface): Promise; listAgentTools(surface?: ChannelSurface): readonly ChannelAgentToolDefinitionLike[]; runTool(surface: ChannelSurface, toolId: string, input?: JsonRecord): Promise; listOperatorActions(surface?: ChannelSurface): Promise; runOperatorAction(surface: ChannelSurface, actionId: string, input?: JsonRecord): Promise; resolveTarget(surface: ChannelSurface, input: ChannelTargetResolutionInput): Promise; authorizeActorAction(surface: ChannelSurface, input: ChannelAuthorizeActionInput): Promise; resolveAllowlist(surface: ChannelSurface, input: ChannelAllowlistInput): Promise; editAllowlist(surface: ChannelSurface, input: ChannelAllowlistInput): Promise; listStatus(): Promise; queryDirectory(surface: ChannelSurface, query: ChannelDirectoryQuery): Promise; } export interface ChannelPolicyServiceLike { listPolicies(): readonly unknown[]; upsertPolicy(surface: ChannelSurface, input: Record): Promise; listAudit(limit: number): readonly unknown[]; } export interface SurfaceRegistryLike { list(): readonly unknown[]; } /** * Inbound mail's health entry, mirrored structurally the way this package * mirrors every SDK type it routes. * * `kind` is the discriminant. It was declared on `InboundMailHealthEntry` and * documented as distinguishing this entry "from a channel's in a mixed list", * and there was no mixed list, the two functions that produce it had zero * callers repo-wide, so email appeared in no health surface at all. This is * the list it was named for. */ export interface InboundMailHealthLike { readonly kind: 'email-inbound'; readonly account: string; readonly mailbox: string; readonly state: string; readonly mode: string; readonly reason: string; readonly enabled: boolean; } export interface DaemonChannelRouteContext { readonly channelPlugins: ChannelPluginServiceLike; /** * Inbound mail's health, when this daemon watches a mailbox. * * Optional because an embedder composing routes without the builtin channel * runtime has no mailbox to report on, not because the answer is optional * when there IS one. */ readonly inboundMailHealth?: (() => InboundMailHealthLike | null) | undefined; readonly channelPolicy: ChannelPolicyServiceLike; readonly parseJsonBody: (req: Request) => Promise; readonly parseOptionalJsonBody: (req: Request) => Promise; readonly requireAdmin: (req: Request) => Response | null; readonly surfaceRegistry: SurfaceRegistryLike; } //# sourceMappingURL=channel-route-types.d.ts.map