import type { JsonEnvFieldSpec, SettingsJson } from "@mono-agent/agent-contracts"; /** A Slack shortcut binding: invoking `callbackId` runs `prompt` as a turn. */ export interface SlackShortcutConfig { readonly callbackId: string; readonly prompt: string; /** * Optional destination. When omitted, a message shortcut uses its source * channel and is refused if that source is unauthorized. A source-less global * shortcut uses the first explicit `allowedChannelIds` entry. */ readonly channelId?: string; /** Optional message posted instantly on invocation, before the run (e.g. "🔄 Syncing…"). */ readonly ackText?: string; /** When true, post the result as a threaded reply under the ack. Requires `ackText`. Default off. */ readonly threadReply?: boolean; } /** An App Home tab button: clicking it runs `prompt`; `label` is the button text. */ export interface SlackHomeButtonConfig { readonly actionId: string; readonly label: string; readonly prompt: string; /** Destination channel for the reply (the Home tab has none of its own). */ readonly channelId?: string; /** Optional message posted instantly on click, before the run. */ readonly ackText?: string; /** When true, post the result as a threaded reply under the ack. Requires `ackText`. Default off. */ readonly threadReply?: boolean; } /** App Home tab config: whether to publish it, an optional header, and its buttons. */ export interface SlackHomeTabConfig { readonly enabled: boolean; readonly headerText?: string; readonly buttons: readonly SlackHomeButtonConfig[]; } /** * Best-effort model-visible transcript of the conversation before a turn, read * from the `slack.threadContext` JSON object (each field also has an env form). */ export interface SlackThreadContextConfig { readonly enabled: boolean; readonly maxMessages: number; readonly requestLimit: number; readonly timeoutMs: number; readonly includeBotMessages: boolean; } export interface SlackAdapterConfig { readonly enabled: boolean; readonly botToken: string; readonly appToken: string; readonly allowedChannelIds: readonly string[]; readonly allowAllChannels: boolean; readonly botUserIds: readonly string[]; readonly mentionTextAliases: readonly string[]; readonly stripMentionText?: boolean; /** Shortcut bindings, read from the `slack.shortcuts` JSON array. */ readonly shortcuts: readonly SlackShortcutConfig[]; /** App Home tab config, read from the `slack.homeTab` JSON object. */ readonly homeTab: SlackHomeTabConfig; /** * Resolve the speaker's real name via `users.info` so the agent knows who is * talking. Requires the `users:read` scope; default `true`, and a missing scope * degrades to an unnamed speaker rather than failing turns. */ readonly resolveUserNames: boolean; /** * Resolve the surface's name via `conversations.info` so the agent knows WHICH * channel it is talking in. Requires `channels:read`/`groups:read`; default * `true`, and a missing scope degrades to the surface kind and id alone. */ readonly resolveChannelNames: boolean; /** Thread/channel turn context, read from `slack.threadContext`. */ readonly threadContext: SlackThreadContextConfig; readonly heartbeatIntervalMs?: number; readonly heartbeatTimeoutMs?: number; readonly reconnectInitialBackoffMs?: number; readonly reconnectMaxBackoffMs?: number; readonly reconnectStabilityMs?: number; readonly reconnectStartupGraceMs?: number; readonly drainDeadlineMs?: number; } export type SlackAdapterConfigErrorCode = "missing_required_config" | "invalid_config"; export interface SlackAdapterConfigErrorDetails { readonly code?: SlackAdapterConfigErrorCode; readonly env?: string; readonly reason?: string; readonly [key: string]: unknown; } export declare class SlackAdapterConfigError extends Error { readonly code: SlackAdapterConfigErrorCode; readonly details: SlackAdapterConfigErrorDetails; constructor(code: SlackAdapterConfigErrorCode, message: string, details?: SlackAdapterConfigErrorDetails); } export interface LoadSlackAdapterConfigInput { readonly env: Record; readonly json?: SettingsJson; readonly jsonPath?: string; } export declare function loadSlackAdapterConfig(input: LoadSlackAdapterConfigInput): Promise; /** * The `slack` section's field registry: the single source of truth both the * JSON→env layering below and the app's config provenance view derive from. * Covers every env-mappable field (JSON-only structures like `shortcuts` and * `homeTab` are read straight from JSON). */ export declare const SLACK_CONFIG_FIELDS: readonly JsonEnvFieldSpec[]; //# sourceMappingURL=config.d.ts.map