/**
 * # Hosted-tier ingest client.
 *
 * Ships eval-run events + trace spans to any orchestrator (ours, a
 * partner's self-hosted one, or a future open implementation) that
 * speaks the wire format in `./types.ts`.
 *
 * Three modes:
 *   - **Ours:** point at `https://orchestrator.tangle.tools` (the host root —
 *     the client appends the versioned `/v1/ingest/...` path itself; a trailing
 *     `/v1` on the endpoint is tolerated and normalized away). We handle ingest
 *     + storage + dashboard.
 *   - **Self-hosted:** point at whatever URL runs the reference receiver
 *     from `examples/hosted-ingest-server/`.
 *   - **Off (default):** when `hostedTenant` is unset, nothing is sent.
 *     Everything stays local.
 */
import { type EvalRunEvent, type HostedWireVersion, type IngestResponse, type TraceSpanEvent } from './types';
export interface HostedTenant {
    /** Orchestrator endpoint base URL (no trailing slash). Required. */
    endpoint: string;
    /** Bearer token issued by the orchestrator. Required. */
    apiKey: string;
    /** Tenant id — the orchestrator's primary key for this consumer. Required. */
    tenantId: string;
    /** Optional `fetch` override (auth wrappers, custom agent, test mocks). */
    fetchImpl?: typeof fetch;
    /** Per-call timeout in ms. Default 30s. */
    timeoutMs?: number;
    /** Retries on 5xx / network errors. Default 2. */
    retries?: number;
}
export interface HostedClient {
    ingestEvalRun(event: EvalRunEvent, idempotencyKey?: string): Promise<IngestResponse>;
    ingestEvalRuns(events: EvalRunEvent[], idempotencyKey?: string): Promise<IngestResponse>;
    ingestTraces(spans: TraceSpanEvent[], idempotencyKey?: string): Promise<IngestResponse>;
    readonly tenant: HostedTenant;
    readonly wireVersion: HostedWireVersion;
}
export declare function createHostedClient(tenant: HostedTenant): HostedClient;
/**
 * Build a `HostedClient` from environment, or `undefined` when ingest is not
 * configured — the canonical, fail-soft wiring every product uses so eval-run +
 * trace provenance lands in the Intelligence dashboard with ONE call:
 *
 *   const hosted = hostedClientFromEnv()
 *   // ...run the loop...
 *   await emitLoopProvenance({ ..., hostedClient: hosted })  // no-op if undefined
 *
 * Returns `undefined` (NOT an error) when any of endpoint / apiKey / tenantId is
 * missing — so a product wires the ship call unconditionally and it stays a
 * no-op until the env is set. Env precedence:
 *   - endpoint:  `TANGLE_INGEST_URL` → `TANGLE_ORCHESTRATOR_URL`
 *   - apiKey:    `TANGLE_INGEST_API_KEY` → `TANGLE_API_KEY`
 *   - tenantId:  `TANGLE_TENANT_ID`
 * A trailing slash on the endpoint is stripped. Pass `overrides` to supply any
 * field directly (e.g. a fixed `tenantId` per product) — overrides win over env.
 */
/**
 * Build a {@link HostedTenant} config from env — the input `selfImprove`'s
 * `hostedTenant` and `emitLoopProvenance` take. Same env precedence + overrides
 * as {@link hostedClientFromEnv}; returns `undefined` (not an error) when any of
 * endpoint / apiKey / tenantId is missing, so a product wires
 * `hostedTenant: hostedTenantFromEnv({ tenantId: 'my-agent' })` unconditionally
 * and it stays off until the env is set.
 */
export declare function hostedTenantFromEnv(overrides?: Partial<HostedTenant> & {
    env?: Record<string, string | undefined>;
}): HostedTenant | undefined;
export declare function hostedClientFromEnv(overrides?: Partial<HostedTenant> & {
    env?: Record<string, string | undefined>;
}): HostedClient | undefined;
//# sourceMappingURL=client.d.ts.map