import { FinishReason, ScenarioJobEventType, ScenarioJobStatus, RoutePolicy, type ScenarioArtifact, type ChatMessage, type ReasoningConfig, type ScenarioJobEvent } from './generated/runtime/v1/ai.js';
import { WorkflowEventType, type WorkflowEvent } from './generated/runtime/v1/workflow.js';
import { RuntimeHealthStatus } from './generated/runtime/v1/audit.js';
import { Struct } from './generated/google/protobuf/struct.js';
import { asRecord, normalizeText, nowIso } from '../internal/utils.js';
import { extractGenerateText as extractGenerateTextShared } from '../internal/scenario-output.js';
import { RuntimeMethodIds } from './method-ids.js';
import type { NimiFinishReason, NimiReasoningConfig, NimiRoutePolicy, NimiTokenUsage, NimiTraceInfo, RuntimeHealth, TextMessage } from './types.js';
export type RuntimeMethodLookupEntry = {
    moduleKey: keyof typeof RuntimeMethodIds;
    methodKey: string;
    stream: boolean;
};
export declare const DEFAULT_WAIT_FOR_READY_TIMEOUT_MS = 10000;
export declare const DEFAULT_MEDIA_POLL_INTERVAL_MS = 250;
export declare const DEFAULT_MEDIA_TIMEOUT_MS = 120000;
export declare const DEFAULT_RETRY_MAX_ATTEMPTS = 3;
export declare const DEFAULT_RETRY_BACKOFF_MS = 200;
export declare const MAX_RETRY_BACKOFF_MS = 3000;
export declare const SDK_RUNTIME_MAJOR_VERSION = 0;
export declare const PHASE2_MODULE_KEYS: ReadonlySet<string>;
export declare const PHASE2_AUDIT_METHOD_IDS: ReadonlySet<string>;
export declare function parseSemverMajor(version: string): number | null;
export declare const RETRYABLE_RUNTIME_REASON_CODES: ReadonlySet<string>;
export declare const RUNTIME_METHOD_LOOKUP: Readonly<Record<string, RuntimeMethodLookupEntry>>;
export { asRecord, normalizeText, nowIso };
export declare const extractGenerateText: typeof extractGenerateTextShared;
export declare function ensureText(value: unknown, fieldName: string): string;
export declare function toRoutePolicy(value: NimiRoutePolicy | undefined): RoutePolicy;
export declare function fromRoutePolicy(value: RoutePolicy): NimiRoutePolicy;
export declare function toFinishReason(value: FinishReason): NimiFinishReason;
export declare function parseCount(value: unknown): number | undefined;
export declare function toUsage(value: unknown): NimiTokenUsage;
export declare function toTraceInfo(input: {
    traceId?: unknown;
    modelResolved?: unknown;
    routeDecision?: unknown;
}): NimiTraceInfo;
export declare function toReasoningConfig(value: NimiReasoningConfig | undefined): ReasoningConfig | undefined;
export declare function toRuntimeMessages(input: string | TextMessage[], system?: string): {
    systemPrompt: string;
    input: ChatMessage[];
};
export declare function toEmbeddingVectors(vectors: unknown): number[][];
export declare function extractEmbeddingVectors(output: unknown): number[][];
export declare function extractSpeechTranscription(output: unknown): {
    text: string;
    artifacts: ScenarioArtifact[];
};
export declare function extractScenarioArtifacts(output: unknown, kind: 'imageGenerate' | 'videoGenerate' | 'musicGenerate' | 'speechSynthesize'): ScenarioArtifact[];
export declare function toProtoStruct(input: Record<string, unknown> | undefined): Struct | undefined;
export declare function toLabels(input: unknown): Record<string, string>;
export declare const MEDIA_JOB_TERMINAL_EVENT_TYPES: ReadonlySet<ScenarioJobEventType>;
export declare const WORKFLOW_TERMINAL_EVENT_TYPES: ReadonlySet<WorkflowEventType>;
export declare function wrapModeBMediaStream(source: AsyncIterable<ScenarioJobEvent>): AsyncIterable<ScenarioJobEvent>;
export declare function wrapModeBWorkflowStream(source: AsyncIterable<WorkflowEvent>): AsyncIterable<WorkflowEvent>;
export declare function sleep(ms: number): Promise<void>;
export declare function toIsoFromTimestamp(value: unknown): string | undefined;
export declare function mediaStatusToString(status: ScenarioJobStatus): string;
export declare function resolveHealthStatus(status: RuntimeHealthStatus): RuntimeHealth['status'];
export declare function decodeUtf8(input: Uint8Array): string;
//# sourceMappingURL=helpers.d.ts.map