import type { TelemetryConfig } from "@github/copilot-sdk"; export { toOtlpMetricsUrl, toOtlpTraceUrl } from "./otel-endpoint.js"; /** * Span-batch flush delay (ms) for the spawned Copilot runtime via * `OTEL_BSP_SCHEDULE_DELAY`. The runtime default (5000ms) drops late-ending * spans (e.g. each turn's `invoke_agent` root) when it's torn down before the * next batch; a short delay exports the final trial's trace promptly. */ export declare const RUNTIME_OTEL_SCHEDULE_DELAY_MS = 500; /** * Build the environment for the spawned Copilot runtime. Tune the runtime's * span-batch flush cadence so spans are exported promptly (without clobbering * a caller-provided override). Strips reserved executor-owned keys from the * inherited base env so a host `COPILOT_HOME_SETTINGS_JSON` (or similar) * never leaks into the spawned process — the OTLP keys are replaced by * `runtimeEnvOverrides`, but this key has no override and must be removed. */ export declare function buildRuntimeEnv(telemetry: TelemetryConfig | undefined): NodeJS.ProcessEnv; /** * Env vars the executor layers over `environment.env` — warning suppression * and OTLP wiring. Layered last so a stimulus can't redirect telemetry or * unsilence warnings. `NODE_NO_WARNINGS` is forced unconditionally (that's what * keeps a stimulus from unsilencing warnings); the OTLP vars instead yield to * the operator's `process.env` when already set, falling back to the derived * value otherwise. */ export declare function runtimeEnvOverrides(telemetry: TelemetryConfig | undefined): Record; /** * Keys the executor owns in the spawned runtime env. A stimulus's * `environment.env` must never set these — warning suppression and OTLP wiring * are executor-controlled. `COPILOT_HOME_SETTINGS_JSON` is included because * `execute()` already consumes it to materialize the per-run config home * before this list is applied; forwarding the raw payload into the spawned * process too would be redundant (the runtime reads it from `settings.json`) * and would needlessly expose it to anything that inspects child-process env. */ export declare const RESERVED_RUNTIME_ENV_KEYS: readonly ["NODE_NO_WARNINGS", "OTEL_BSP_SCHEDULE_DELAY", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT", "COPILOT_HOME_SETTINGS_JSON"]; /** * Strip reserved runtime keys from an env map (case-insensitively). Applied to * both the inherited `process.env` base (so host keys like * `COPILOT_HOME_SETTINGS_JSON` never leak into the spawned runtime) and * caller-supplied `environment.env` (so a stimulus can't redirect telemetry). */ export declare function withoutReservedRuntimeKeys(env: NodeJS.ProcessEnv | Record | undefined): Record; //# sourceMappingURL=runtime-telemetry.d.ts.map