/** The platform API base: explicit override, else $ORA_PLATFORM_URL, else prod. */ export declare function platformBase(override?: string): string; export interface RunSummary { run_id: string; domain?: string; intent?: string; harness?: string; model?: string; effective_model?: string; outcome: string; num_turns?: number; duration_ms?: number; started_at?: string; finished_at?: string; last_seq?: number; } export interface InsightRecommendation { title: string; detail: string; priority?: string; } export interface JourneyInsight { summary?: string; outcome?: string; visibility_score?: number; intent_satisfied?: boolean; task_satisfied?: string; key_observations?: string[]; friction_points?: string[]; recommendations?: InsightRecommendation[]; intent_category?: string; journey_layers?: string[]; /** Usage of the analyzer that produced the insight — not the run itself. */ usage?: { input_tokens?: number; output_tokens?: number; }; } /** * One entry of a `trajectory` snapshot. Richer than the raw `step` events: a * tool call arrives merged with its result (status, duration, structured * output) plus ora's attribution of where the agent got the target from. */ export interface JourneyStep { id: number; turn: number; type: string; kind?: string; text?: string; thinking?: string; tool?: string; action?: string; input?: Record; input_display?: string; summary?: string; label?: string; status?: number; duration_ms?: number; is_error?: boolean; output_structured?: { body?: string; links?: Array<{ title?: string; url?: string; }>; }; elapsed_ms?: number; attribution?: { kind?: string; method?: string; confidence?: string; /** For link-follows: the exact step this URL was discovered on. */ referrer?: { step_id?: number; turn?: number; artifact_kind?: string; url_path?: string; }; }; } /** A raw `step` event payload (loosely typed; the CLI never renders from these). */ export interface RawRunStep { type: string; turn?: number; tool?: string; [extra: string]: unknown; } /** Run-level token/cost totals, read from the runs list after completion. */ export interface RunSpend { totalTokens?: number; inputTokens?: number; outputTokens?: number; cacheReadTokens?: number; cacheCreationTokens?: number; costUsd?: number; } export interface JourneyHooks { /** Fired exactly once when the run exists (the stream's own `run` event is ignored). */ opened?: (runId: string) => void; /** * A full-trajectory snapshot arrived. These flow every few seconds while * the agent works and are the ONLY live signal — drive all UI from here. */ snapshot?: (steps: JourneyStep[]) => void; /** * A raw `step` event arrived. ⚠ The server flushes these in one burst at * the very end of the run; rendering from them means a blank screen until * the agent finishes. */ step?: (step: RawRunStep, seq: number) => void; finished?: (summary: RunSummary) => void; scored?: (insight: JourneyInsight) => void; } export interface RunRequest { intent: string; domain?: string; harness?: string; model?: string; /** "harness" = tool-using agent (default); "direct" = single LLM answer. */ executionKind?: "harness" | "direct"; baseUrl?: string; apiKey?: string; idleMs?: number; } export interface JourneyRun { runId: string; intent: string; domain?: string; harness?: string; result?: RunSummary; insight?: JourneyInsight; usage?: RunSpend; steps: RawRunStep[]; /** The last trajectory snapshot seen — the definitive step list. */ trajectory: JourneyStep[]; } export declare function exchangeKey(base: string, secret: string): Promise; export declare function decodeEventBlock(block: string): { event: string; data: string; } | null; export declare function launchJourney(request: RunRequest, hooks?: JourneyHooks): Promise;