import type { ChannelConfigInput } from "@mono-agent/agent-contracts"; import { MonoAgentConfigError } from "@mono-agent/config"; import type { MonoAgentConfig, ObservabilityExporterConfig } from "@mono-agent/config"; export type MonoAgentAppConfigInput = ChannelConfigInput; export declare function loadAppCoreConfig(input: MonoAgentAppConfigInput): Promise; export declare function isAppCoreConfigError(error: unknown): error is MonoAgentConfigError; /** * Trace defaults a host can override without touching the user's config file * (e.g. the final demo labels its source "Final Agent Demo"). */ export interface AppTraceDefaults { readonly sourceIdPrefix?: string; readonly sourceLabel?: string; } /** * The resolvers below intentionally tolerate an incomplete or invalid config * file: observability and traceability must stay usable while the user is still * fixing their config, so they fall back to defaults instead of throwing on * unreadable JSON. */ export declare function resolveAppArtifactDir(input: MonoAgentAppConfigInput): Promise; /** * Resolve the durable pi-session store the runtime resumes from, the same way the * runtime does: the `MONO_AGENT_PI_SESSIONS_ROOT` env override first, then * `providers.piNative.piSessionsRoot` from the config file. Returns undefined when * neither is set — that means sessions are kept in-memory only, so there is nothing * on disk to purge. Tolerates an unreadable config like the resolvers above. */ export declare function resolveAppSessionsRoot(input: MonoAgentAppConfigInput): Promise; /** * A validated observability exporter resolved for app startup/status/validate. * Mirrors {@link ObservabilityExporterConfig} but with the endpoint always * resolved (defaults applied) so callers never re-derive it. */ export type ResolvedExporter = ObservabilityExporterConfig & { readonly endpoint: string; }; /** * Resolve observability exporters for the app: env-first * (`MONO_AGENT_OBSERVABILITY_EXPORTERS`, JSON array), then the * `observability.exporters` block of the config file, then `[]`. Like the other * app-level resolvers it tolerates an unreadable config file (returns `[]` so the * host stays usable while the user fixes their config), but it DOES throw * a {@link MonoAgentConfigError} for a present-but-invalid exporter shape so bad * config fails clearly before startup. No reachability probe runs here — * reachability is `validate`'s job (Phoenix may start after the agent). */ export declare function resolveAppObservabilityExporters(input: MonoAgentAppConfigInput): Promise; /** * Derive the Phoenix app base URL (origin) from an OTLP traces endpoint so the * CLI/status can point operators at the trace UI — e.g. * `http://127.0.0.1:6006/v1/traces` -> `http://127.0.0.1:6006`. Returns * undefined when the endpoint is not a parseable URL. Note: Phoenix does not * return a stable per-run trace URL from the OTLP ingest endpoint, so callers * print only the app base URL plus run identifiers. */ export declare function phoenixAppBaseUrl(endpoint: string): string | undefined; export declare function describeSensitiveDataExportWarning(endpoint: string): string; export declare function resolveAppTraceRegistryDir(input: MonoAgentAppConfigInput): Promise; export declare function resolveAppTraceSourceId(input: MonoAgentAppConfigInput, defaults?: AppTraceDefaults, /** Canonical public identity path when `input.configPath` is an immutable private read copy. */ fallbackConfigPath?: string): Promise; export declare function resolveAppTraceSourceLabel(input: MonoAgentAppConfigInput, defaults?: AppTraceDefaults): Promise; export declare function resolveAppTraceHeartbeatMs(input: MonoAgentAppConfigInput): Promise; export declare function resolveAppTraceStaleAfterMs(input: MonoAgentAppConfigInput): Promise; /** * The machine-wide default registry every agent's manifest mirrors into * (unless it opts out via `traceability.globalDiscovery: false`), independent * of any per-instance `traceability.registryDir` override — this is * deliberately NOT read from the local config file, since the whole point is * to find agents whose OWN registry is somewhere else. The env override is a * seam for tests/ops (relocating the machine-wide default, e.g. a shared * mount) and must never be confused with `MONO_AGENT_TRACE_REGISTRY_DIR` * (which overrides a single instance's own registry). */ export declare function resolveGlobalTraceRegistryDir(env: Record): string; export declare function resolveAppTraceGlobalDiscovery(input: MonoAgentAppConfigInput): Promise; /** * The root under which a trace registry counts as ephemeral: mirror * registration is suppressed for registries below it, so throwaway test/CI * runs never pollute the developer's real global registry. Defaults to the * real OS tmp directory; the env override is a TEST seam (same pattern as * `MONO_AGENT_GLOBAL_TRACE_REGISTRY_DIR`) letting integration tests point the * guard elsewhere so a genuine `mkdtemp(tmpdir())` fixture can exercise the * mirror-happens path. */ export declare function resolveTraceTmpdirRoot(env: Record): string; /** * True when `path` resolves inside `tmpRoot` (default the real OS tmp * directory). Exported so the mirror-registration safety guard below is * directly unit-testable without touching the filesystem. */ export declare function isPathUnderTmpdir(path: string, tmpRoot?: string): boolean; export interface ShouldMirrorTraceSourceGloballyInput { readonly registryDir: string; readonly globalRegistryDir: string; readonly globalDiscovery: boolean; /** Test seam: the tmp root {@link isPathUnderTmpdir} compares against; defaults to the real OS tmp dir. */ readonly tmpdirRoot?: string; } /** * Gate for the best-effort global-registry mirror (see {@link resolveGlobalTraceRegistryDir}): * an agent whose own registry differs from the machine-wide default also * registers there, so `mono-agent tui` run from anywhere on the machine finds * it — UNLESS the agent opted out (`traceability.globalDiscovery: false`), * its own registry already IS the global one (nothing to mirror), or its * registry lives under the OS tmp directory (keeps throwaway test/ephemeral * runs from polluting the developer's real global registry). */ export declare function shouldMirrorTraceSourceGlobally(input: ShouldMirrorTraceSourceGloballyInput): boolean; //# sourceMappingURL=app-config.d.ts.map