import type { JsonEnvFieldSpec, RedactedSecretValue, SettingsJson } from "@mono-agent/agent-contracts"; import { type WebhookInvocationMode } from "./server.js"; /** One HTTP endpoint of the webhook server (shares the server's host + port). */ export interface WebhookEndpointConfig { readonly name: string; readonly path: string; readonly mode: WebhookInvocationMode; readonly enabled: boolean; /** Pre-instructions prepended to the incoming request text. Same role as a cron job's prompt. */ readonly prompt?: string; readonly notify?: boolean; readonly notifyConversationId?: string; /** Per-endpoint runtime model override (e.g. `claude:claude-opus-4-8`). A request body `model` wins. */ readonly model?: string; /** Per-endpoint reasoning effort override (e.g. `high`). A request body `effort` wins. */ readonly effort?: string; /** Per-endpoint run watchdog override in milliseconds. `0` disables it for this endpoint. */ readonly maxRunMs?: number; } export interface WebhookAdapterConfig { readonly enabled: boolean; readonly host: string; readonly port: number; readonly allowNonLoopback: boolean; readonly apiKey?: string; readonly retentionMs: number; readonly maxStoredRequests: number; /** Wall-clock bound (ms) per webhook run. Omit to use the adapter default (20 min). */ readonly maxRunMs?: number; /** * Decoded-byte ceiling for one inbound audio attachment (multipart/form-data * or raw `audio/*` bodies). Omit to use `DEFAULT_AGENT_ATTACHMENT_MAX_BYTES`. */ readonly maxAttachmentBytes?: number; readonly endpoints: readonly WebhookEndpointConfig[]; /** Back-compat mirror of `endpoints[0].path`. */ readonly path: string; /** Back-compat mirror of `endpoints[0].mode`. */ readonly defaultMode: WebhookInvocationMode; } export interface RedactedWebhookAdapterConfig extends Omit { readonly apiKey: RedactedSecretValue; } export interface LoadWebhookAdapterConfigInput { readonly env: Record; readonly json?: SettingsJson; readonly jsonPath?: string; /** Base directory the webhook endpoints folder resolves against (usually the app cwd). */ readonly cwd?: string; /** Overrides the endpoints folder; defaults to `webhook.dir` / `MONO_AGENT_WEBHOOK_DIR` / `webhook`. */ readonly dir?: string; } export declare function loadWebhookAdapterConfig(input: LoadWebhookAdapterConfigInput): Promise; export declare function redactWebhookAdapterConfig(config: WebhookAdapterConfig): RedactedWebhookAdapterConfig; /** * The `webhook` 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 the single-endpoint fields (multi-endpoint `endpoints[]` and `dir` * are read straight from JSON / their own env forms). */ export declare const WEBHOOK_CONFIG_FIELDS: readonly JsonEnvFieldSpec[]; //# sourceMappingURL=config.d.ts.map