import type { EvalSessionEvidenceRequired, EvalSessionExecutionEvidence, OpenedEvalSession } from "@velum-labs/routekit-control"; import { type EvalCandidateTrialPlan, EvalServiceValidationError, type EvalTrialAuthority, type RepositoryAgentModelBinding, type RepositoryAgentModelTrialAuthority, type ServingRequestHttpBinding } from "@velum-labs/routekit-eval-service/effect"; import { type EvalAuthoringCompletion, EvalAuthoringTransport, EvalProjectAuthoringError } from "@velum-labs/routekit-eval-setup"; import { RouteKitFailure } from "@velum-labs/routekit-runtime/effect"; import { Context, Effect, type FileSystem, Layer, type Path, Redacted, type Scope } from "effect"; import type { HttpClient } from "effect/unstable/http"; import { type FoundryExecutionEvidenceIdentity, type FoundryGenerationRejection } from "../protocols/foundry-execution-evidence.js"; import type { RouteKitRemote } from "../remotes.js"; import { type FoundryAuthoringRequestRecorder, FoundryExecutionEvidenceError } from "../stores/foundry-execution-evidence.js"; export type AuthoringSession = { readonly sessionId: string; readonly gatewayUrl: string; readonly bearerCredential: Redacted.Redacted; readonly evidenceRequired?: true; readonly upstreamRetrySafe?: () => Effect.Effect; }; export declare const evalSessionGatewayUrl: (openedGatewayUrl: string, _selectedRemote?: Pick) => string; export declare const evalAuthoringResponseStatusFailureDetail: (payload: unknown, callId?: string | null, maximumOutputTokens?: number) => string | undefined; export declare const evalAuthoringStructuredOutput: (input: { readonly operation: EvalProjectAuthoringError["operation"]; readonly text: string; readonly callId?: string | null; readonly schemaName: string; readonly jsonSchema: Readonly>; }) => Effect.Effect; export declare const evalAuthoringRequestBody: (input: EvalAuthoringCompletion) => string; export declare const evalAuthoringResponsePayload: (response: Response, operation: EvalProjectAuthoringError["operation"], onActivity?: () => void, onReturned?: () => Effect.Effect) => Effect.Effect; export declare const evalAuthoringResponseFailureDetail: (response: Response) => Effect.Effect; export declare function withEvalAuthoringWallTime(effect: Effect.Effect, input: { readonly wallTimeMs: number; readonly expiresAt: string; readonly nowMs?: number; }): Effect.Effect; export declare function makeTargetAuthoringTransport(session: AuthoringSession, httpContext: Context.Context, transientRetryBudget: number, reviewInputVersion?: 2, requestRecorder?: FoundryAuthoringRequestRecorder): import("@velum-labs/routekit-eval-setup").EvalAuthoringTransportShape; type TargetAuthoringSessionInput = { readonly operationId: string; readonly model: string; readonly allowedModels?: readonly string[]; readonly calls: number; readonly maximumOutputTokens: number; readonly totalInputTokens?: number; readonly totalOutputTokens?: number; readonly wallTimeMs?: number; readonly transientRetryBudget?: number; readonly reviewInputVersion?: 2; readonly requestRecorder?: FoundryAuthoringRequestRecorder; readonly evidenceRequired?: EvalSessionEvidenceRequired; /** Internal scoped readiness continuation, before any generation work. */ readonly onReady?: (opened: OpenedEvalSession) => Effect.Effect; readonly onUpstreamEvidence?: (opened: OpenedEvalSession, evidence: EvalSessionExecutionEvidence) => Effect.Effect; /** Ephemeral control invocation identity; never substitutes for the plan digest. */ readonly sessionIdempotencyKey?: string; readonly use: (layer: Layer.Layer) => Effect.Effect; }; export type FoundryCandidateTrialTarget = { readonly lane: "repository-agent"; readonly binding: RepositoryAgentModelBinding; readonly authority: RepositoryAgentModelTrialAuthority; readonly bearerCredential: Redacted.Redacted; } | { readonly lane: "request"; readonly binding: ServingRequestHttpBinding; readonly authority: EvalTrialAuthority; readonly bearerCredential: Redacted.Redacted; }; /** * Accept only the direct host failure, or that sole Fail reason in the complete * Effect Cause. Wrappers, other reasons, defects and interruptions are not * semantic authority, even when their text or nested error contains a marker. */ export declare function foundryGenerationRejectionFromCause(cause: unknown): FoundryGenerationRejection | undefined; /** * The existing session owner supplies the complete scoped operation, including * cleanup. Observer events and an inner `use` return cannot close this evidence. */ export declare function withFoundryExecutionEvidence(input: { readonly identity: FoundryExecutionEvidenceIdentity; readonly maximumPhysicalRequests: number; readonly use: (recorder: FoundryAuthoringRequestRecorder) => Effect.Effect; }): Effect.Effect; export declare function withFoundryAuthoringSession(input: Omit, "requestRecorder" | "onReady" | "sessionIdempotencyKey" | "evidenceRequired" | "onUpstreamEvidence"> & { readonly executionIdentity: FoundryExecutionEvidenceIdentity; /** The supervisor commits its own consumed ledger after this owner is ready. */ readonly beforeExecution?: Effect.Effect; }): Effect.Effect; /** * The actual candidate continuation of the existing target owner. It reloads * canonical host sources itself; no caller-provided target identity, evidence * reader, receipt, hidden answer, alternate session or stand-alone ledger can * authorize a candidate request. * * The return value is an exposure-closed candidate execution only. Existing * hidden/output/trajectory harnesses, admission and routing qualify it * separately; neither an adapter summary nor an inner checkpoint is a grade. */ export declare function withFoundryCandidateTrialSession(input: { readonly repositoryRoot: string; readonly benchmarkArtifactPath: string; readonly manifestPath: string; readonly plan: EvalCandidateTrialPlan; readonly use: (target: FoundryCandidateTrialTarget) => Effect.Effect; }): Effect.Effect; export declare function withTargetAuthoringSession(input: TargetAuthoringSessionInput): Effect.Effect; export {};