import type { WorkflowDefinition } from "../types.js";
export interface RemoteSearchResultItem {
    owner: string;
    ownerDisplayName: string | null;
    slug: string;
    title: string;
    description: string | null;
    visibility: string;
    latestVersion: string | null;
    sourceFormat: string | null;
    publishedState: string | null;
    tags: string[];
    updatedAt: string;
    createdAt: string;
}
export interface WhoAmIResponse {
    userId: string;
    username: string | null;
    displayName: string | null;
    authMethod: string;
    scopes: string[];
}
export interface PublishRequest {
    slug: string;
    title: string;
    description?: string | null;
    visibility: "public" | "private";
    versionLabel: string;
    sourceFormat: "markdown" | "json";
    rawSource: string;
    definition: WorkflowDefinition;
    tags?: string[];
    changelog?: string | null;
    publishedState: "draft" | "published";
}
export interface PullResponse {
    owner: string;
    slug: string;
    title: string;
    description: string | null;
    visibility: string;
    version: string;
    sourceFormat: "markdown" | "json";
    rawSource: string;
    definition: WorkflowDefinition;
    changelog: string | null;
    publishedState: string;
    createdAt: string;
}
export interface RunTelemetryPayload {
    workflowKey: string;
    workflowTitle?: string | null;
    runId: string;
    terminalState: "succeeded" | "failed" | "waiting_for_approval" | "cancelled";
    totalSteps: number;
    succeededSteps: number;
    failedSteps: number;
    waitingSteps: number;
    cancelledSteps: number;
    retriedSteps: number;
    eventCount: number;
    durationMs: number;
    effectivenessScore: number;
    outputKeys: string[];
    sourceName?: string | null;
    sourceFormat?: string | null;
    cliVersion?: string | null;
    failureReason?: string | null;
    metadata?: Record<string, unknown>;
}
export interface WorkflowRunInsightsResponse {
    items: Array<{
        workflowKey: string;
        workflowTitle: string | null;
        totalRuns: number;
        successfulRuns: number;
        failedRuns: number;
        approvalRuns: number;
        successRate: number;
        averageEffectiveness: number;
        averageDurationMs: number;
        lastRunAt: string | null;
        latestRun: Record<string, unknown> | null;
        recentRuns: Array<Record<string, unknown>>;
    }>;
}
export declare function fetchWhoAmI(): Promise<WhoAmIResponse>;
export declare function searchRemoteWorkflows(query: string): Promise<{
    items: RemoteSearchResultItem[];
    count: number;
    query: string;
}>;
export declare function publishRemoteWorkflow(request: PublishRequest): Promise<Record<string, unknown>>;
export declare function pullRemoteWorkflow(owner: string, slug: string, version?: string): Promise<PullResponse>;
export declare function trackRunTelemetry(payload: RunTelemetryPayload): Promise<{
    id: string;
    workflowKey: string;
    terminalState: string;
}>;
export declare function fetchWorkflowRunInsights(workflowKey?: string): Promise<WorkflowRunInsightsResponse>;
