import type { CliRuntime } from "@velum-labs/routekit-cli-core"; import type { RouteKitControlClient } from "@velum-labs/routekit-control"; import { RouteKitFailure, type RouteKitManagedRuntime } from "@velum-labs/routekit-runtime/effect"; import { Effect } from "effect"; import type { RouteKitRemote } from "./remotes.js"; import type { RemoteStores } from "./repositories/stores.js"; export type TargetSelection = { local: boolean; remote?: string; }; /** Public owner inputs captured with the actual resolved transport, never credentials. */ export type ResolvedTelemetryTargetProvenance = { readonly kind: "local"; readonly runtimeHome: string; readonly routerConfigPath: string; readonly controlUrl: string; } | { readonly kind: "remote"; readonly remote: Readonly; }; export type ResolvedTelemetryTarget = { readonly client: RouteKitControlClient; readonly kind: "local" | "remote" | "peer"; /** Legacy/unprovable clients remain usable generically, but not for candidate trials. */ readonly provenance?: ResolvedTelemetryTargetProvenance; }; export declare function bindResolvedTelemetryTarget(client: RouteKitControlClient, provenance: ResolvedTelemetryTargetProvenance): ResolvedTelemetryTarget; export declare class CliSession { readonly runtime: CliRuntime; targetSelection: TargetSelection; telemetryTarget: ResolvedTelemetryTarget | undefined; readonly remotes: RemoteStores; readonly effectRuntime: RouteKitManagedRuntime; constructor(runtime: CliRuntime, remotes?: RemoteStores); dispose(): Promise; } export declare function runWithCliSession(session: CliSession, run: () => T): T; export declare function activeCliSession(): CliSession; /** Run an Effect program on this CLI invocation's process runtime. */ export declare function runCliEffect(effect: Effect.Effect): Promise; /** Run a synchronous CLI step as an Effect, tagging failures. */ export declare function cliTry(run: () => A): Effect.Effect; /** Run an asynchronous CLI step as an Effect, tagging failures. */ export declare function cliTryPromise(run: () => Promise): Effect.Effect; /** Construct a typed CLI failure for direct `yield*` from command programs. */ export declare function cliFailure(message: string): RouteKitFailure;