import type { RouteKitEvalGatewayCallEvent } from "@velum-labs/routekit-eval-service"; import type { EvalClassifierObservation, EvalExecutionPlan, EvalNamedEvent, EvalRunCleanup, EvalRunLedger, EvalRunTarget } from "@velum-labs/routekit-eval-setup"; import type { CostServiceShape } from "@velum-labs/routekit-registry"; import { Effect, FileSystem, Redacted, Ref } from "effect"; import { HttpClient } from "effect/unstable/http"; export type QualificationObservedCall = { readonly callId?: string; readonly role: "candidate" | "judge"; readonly model: string; readonly measurement?: EvalClassifierObservation["measurement"]; }; export declare const qualificationGatewayCallObserver: (observed: Ref.Ref, onIssued?: (call: QualificationObservedCall) => Effect.Effect) => ((event: RouteKitEvalGatewayCallEvent) => Effect.Effect); export type QualificationEventContext = { readonly runId: string; readonly dimensionId: string; readonly caseId: string; }; export declare const qualificationNamedEventObserver: (context: QualificationEventContext, append: (event: EvalNamedEvent) => Effect.Effect) => { readonly observeIssued: (call: QualificationObservedCall) => Effect.Effect; readonly events: () => readonly EvalNamedEvent[]; }; export declare const observeQualificationCalls: (client: HttpClient.HttpClient, observed: Ref.Ref) => HttpClient.HttpClient; export declare const includeQualificationObservedCalls: (ledger: EvalRunLedger, observed: readonly QualificationObservedCall[], costService: CostServiceShape) => Effect.Effect; export type QualificationTarget = { readonly gatewayUrl: string; readonly bearerCredential: Redacted.Redacted; readonly target: EvalRunTarget; readonly inspectCall?: (callId: string) => Effect.Effect; }; export type BoundedEvalSessionTargetInput = { readonly operationId: string; readonly purpose: "authoring" | "qualification"; readonly allowedModels: readonly string[]; readonly limits: { readonly calls: number; readonly inputTokens: number; readonly outputTokens: number; readonly perCallOutputTokens: number; readonly wallTimeMs: number; }; readonly expiresInSeconds: number; }; export type QualificationTargetInput = { readonly operationId: string; readonly plan: EvalExecutionPlan; readonly gatewayUrl?: string; readonly tokenFile?: string; }; export declare const makeQualificationCleanupRef: Effect.Effect>; /** * Shared bounded data-plane target for eval-owned model calls. * * It preflights the complete model allowlist once, opens the session before * any attributed call, and always closes through acquire/use/release. */ export declare function withBoundedEvalSessionTarget(input: BoundedEvalSessionTargetInput, cleanup: Ref.Ref, use: (target: QualificationTarget) => Effect.Effect): Effect.Effect; export declare function withQualificationTarget(input: QualificationTargetInput, cleanup: Ref.Ref, use: (target: QualificationTarget) => Effect.Effect): Effect.Effect;