/**
 * Run-level workflow progress card (v0.1.5 slice 1).
 *
 * Single Feishu card per workflow run that gets PATCHed on every state
 * change so a chat thread sees one self-updating tile instead of a wall
 * of per-event replies.
 *
 * Codex co-designed the public hook contract:
 *   - `enrichWithTerminalLink(activityId, attemptId)` returns a
 *     `WorkflowProgressCardTerminalLink` when the workflow-attempt
 *     terminal sidecar (slice 2, owned by codex) has something
 *     openable.  Slice 1 ships without ever wiring this; the field is
 *     a placeholder so slice 3 plugs in without re-shaping the JSON.
 *   - Card-update failures must never disturb workflow runtime — every
 *     send/patch site is wrapped in try/catch + logger.warn.
 *   - daemon-internal Map only (no on-disk persistence) — daemon
 *     restart losing the cardMessageId is an accepted limitation for
 *     this slice.
 */
import type { Snapshot } from '../../workflows/events/replay.js';
import { type Locale } from '../../i18n/index.js';
import { workflowRunDetailUrl } from './workflow-cards.js';
export { workflowRunDetailUrl };
export type WorkflowProgressCardTerminalLink = {
    url: string;
    /** UI label.  Defaults derive from `kind` when omitted. */
    label?: string;
    /** `live-terminal` = attempt still in-flight; `execution-log` = attempt ended. */
    kind: 'live-terminal' | 'execution-log';
};
export type WorkflowProgressCardOptions = {
    /** Codex slice-2 hook.  Returning undefined hides the per-attempt button. */
    enrichWithTerminalLink?: (activityId: string, attemptId: string) => WorkflowProgressCardTerminalLink | undefined;
    /** Override the dashboard link (mostly tests). */
    webDetailUrl?: string;
    /** Max running/waiting nodes to inline.  Excess collapses to "+N more". */
    maxInlineRows?: number;
    /**
     * Total number of nodes in the workflow definition.  Used as the
     * denominator in the "X / Y 节点完成" progress line.  Falls back to
     * `snapshot.nodes.size` when omitted — that only counts TRIGGERED
     * nodes so the fraction grows misleadingly (1/2 → 2/3 …) on
     * longer workflows.
     */
    totalNodes?: number;
    /** UI locale for card chrome (labels/sections). Falls back to the process
     *  default when omitted. */
    locale?: Locale;
};
/**
 * Build the initial "starting" card body (no events past `runCreated`).
 *
 * Called once at IM-side `/workflow run` time so the user sees the tile
 * BEFORE the first `attemptCreated` lands — otherwise there's a multi-
 * second hole between "I sent the command" and "card shows up".
 */
export declare function buildWorkflowStartingCard(input: {
    runId: string;
    workflowId: string;
    webDetailUrl?: string;
    locale?: Locale;
}): string;
/**
 * Build the card body from the current snapshot — called every time
 * the fanout watcher sees a state-changing event for this run.
 */
export declare function buildWorkflowProgressCard(snapshot: Snapshot, opts?: WorkflowProgressCardOptions): string;
/**
 * Slice 3 default enricher: pair the run-level card's per-row link with a
 * deeplink into Run Detail focused on the given attempt.  The dashboard
 * side (slice 2, codex 3335adc) reads `attemptIO[attemptId].terminal` and
 * renders the iframe — this enricher just constructs the URL.
 *
 * Only `running` activities get a link: that is the state where a
 * subagent worker has spawned and is expected to expose `terminal.json`
 * with a live web port.  `effectAttempting` is hostExecutor-side work
 * with no worker sidecar; `acquired` / `waiting` / `pending` skip for
 * the same "no sidecar yet" reason.
 */
export declare function buildAttemptDeeplinkEnricher(runId: string, snapshot: Snapshot): NonNullable<WorkflowProgressCardOptions['enrichWithTerminalLink']>;
//# sourceMappingURL=workflow-progress-card.d.ts.map