import { type ChannelSetupLog } from "#setup/cli/index.js";
import { captureVercel, runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";
/** Injected for tests; defaults to the real Vercel CLI subprocess primitives. */
export interface SlackbotProvisionDeps {
    captureVercel: typeof captureVercel;
    runVercel: typeof runVercel;
    runVercelCaptureStdout: typeof runVercelCaptureStdout;
}
/** Outcome of the Connect create-and-attach sequence for a Slackbot. */
export type ProvisionSlackbotResult = {
    kind: "create-failed";
    created: false;
    attached: false;
} | {
    kind: "connector-unresolved";
    created: true;
    attached: false;
} | {
    kind: "attach-failed";
    created: true;
    attached: false;
    connectorUid: string;
} | {
    kind: "attached";
    created: true;
    attached: true;
    connectorUid: string;
    workspaceUrl?: string;
    workspaceName?: string;
};
/** Identifiers returned by Vercel Connect for a Slack connector. */
export interface SlackConnectorRef {
    uid: string;
    id: string;
}
/**
 * Reads the connector identifiers from `vercel connect create … -F json`
 * stdout, the authoritative source for the just-created connector's UID.
 * Returns `undefined` when stdout is empty or not the expected JSON.
 */
export declare function parseCreatedSlackConnector(stdout: string): SlackConnectorRef | undefined;
/**
 * Finds the expected connector, or the newest Slack connector already attached to this project.
 */
export declare function pickSlackConnector(listJson: unknown, projectId: string | undefined, expectedUid: string | undefined): SlackConnectorRef | undefined;
/** Extracts Slack workspace information from a Connect installations response. */
export declare function parseInstallation(body: unknown): {
    workspaceUrl: string;
    workspaceName?: string;
} | undefined;
/**
 * Creates a Slack Connect client, replaces its default trigger destination with the Eve route,
 * and resolves workspace details when Connect reports them. Promptless: progress streams
 * through the rail-styled `log`, and the result union carries every failure mode for the
 * caller to act on.
 *
 * Known quirk, preserved deliberately: a `connector-unresolved` result reports
 * `created: true`, but callers discard that fact (nothing is recorded), so a rerun
 * creates a second connector instead of adopting the unresolved one.
 */
export declare function provisionSlackbot(log: ChannelSetupLog, projectRoot: string, 
/** Connector short-name passed to `vercel connect create slack --name`. */
slug: string, deps?: SlackbotProvisionDeps): Promise<ProvisionSlackbotResult>;
/**
 * Patches a connector UID chosen by Connect before the caller deploys the channel definition.
 */
export declare function reconcileSlackUid(log: ChannelSetupLog, projectRoot: string, slackbot: ProvisionSlackbotResult, expectedUid: string): Promise<boolean>;
