/** * Configuration module — loads from a JSON config file. * * Resolution order (highest priority wins): * 1. JSON config file — parsed & validated by JsonConfigSchema * 2. Built-in defaults * * JSON config is loaded from (first found wins): * - $OPENCODE_OTEL_CONFIG_PATH (env var override for file path) * - ~/.config/opencode/otel.json (standard location) */ import * as v from "valibot"; declare const ExporterTypeSchema: v.PicklistSchema<["otlp", "console", "none"], undefined>; declare const OtelProtocolSchema: v.PicklistSchema<["grpc", "http/json", "http/protobuf"], undefined>; declare const TelemetryProfileSchema: v.PicklistSchema<["opencode", "claude-code"], undefined>; export declare const JsonConfigSchema: v.ObjectSchema<{ readonly metricsExporter: v.OptionalSchema, undefined>; readonly logsExporter: v.OptionalSchema, undefined>; readonly protocol: v.OptionalSchema, undefined>; readonly endpoint: v.OptionalSchema, v.UrlAction]>, undefined>; readonly metricsEndpoint: v.OptionalSchema, v.UrlAction]>, undefined>; readonly logsEndpoint: v.OptionalSchema, v.UrlAction]>, undefined>; readonly headers: v.OptionalSchema, v.StringSchema, undefined>, undefined>; readonly metricExportIntervalMs: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>, undefined>; readonly logsExportIntervalMs: v.OptionalSchema, v.IntegerAction, v.MinValueAction]>, undefined>; readonly metricsTemporality: v.OptionalSchema, undefined>; readonly resourceAttributes: v.OptionalSchema, v.StringSchema, undefined>, undefined>; readonly logUserPrompts: v.OptionalSchema, undefined>; readonly logToolDetails: v.OptionalSchema, undefined>; readonly includeSessionId: v.OptionalSchema, undefined>; readonly includeVersion: v.OptionalSchema, undefined>; readonly includeAccountUuid: v.OptionalSchema, undefined>; readonly telemetryProfile: v.OptionalSchema, undefined>; readonly onlyForProvider: v.OptionalSchema, v.ArraySchema, undefined>], undefined>, undefined>; }, undefined>; export declare const OtelConfigSchema: v.ObjectSchema<{ readonly metricsExporter: v.PicklistSchema<["otlp", "console", "none"], undefined>; readonly logsExporter: v.PicklistSchema<["otlp", "console", "none"], undefined>; readonly protocol: v.PicklistSchema<["grpc", "http/json", "http/protobuf"], undefined>; readonly endpoint: v.SchemaWithPipe, v.UrlAction]>; readonly metricsEndpoint: v.OptionalSchema, v.UrlAction]>, undefined>; readonly logsEndpoint: v.OptionalSchema, v.UrlAction]>, undefined>; readonly headers: v.RecordSchema, v.StringSchema, undefined>; readonly metricExportIntervalMs: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly logsExportIntervalMs: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly metricsTemporality: v.PicklistSchema<["delta", "cumulative"], undefined>; readonly resourceAttributes: v.RecordSchema, v.StringSchema, undefined>; readonly logUserPrompts: v.BooleanSchema; readonly logToolDetails: v.BooleanSchema; readonly includeSessionId: v.BooleanSchema; readonly includeVersion: v.BooleanSchema; readonly includeAccountUuid: v.BooleanSchema; readonly telemetryProfile: v.PicklistSchema<["opencode", "claude-code"], undefined>; readonly onlyForProvider: v.OptionalSchema, undefined>, undefined>; }, undefined>; export type ExporterType = v.InferOutput; export type OtelProtocol = v.InferOutput; export type TelemetryProfile = v.InferOutput; export type OtelJsonConfig = v.InferOutput; export type OtelConfig = v.InferOutput; export declare class ConfigValidationError extends Error { readonly source: string; readonly issues: v.BaseIssue[]; constructor(source: string, issues: v.BaseIssue[]); } /** * Load and validate the OTEL config from the JSON config file. * * Returns `undefined` if no endpoint is configured (telemetry disabled). * Throws `ConfigValidationError` if the JSON file has invalid fields. * Throws `Error` if the final config is invalid (e.g. bad endpoint URL). */ export declare function loadConfig(): Promise; export {};