import type { AdapterCapabilities, AdapterObservation, DecisionAdapterBatchObservation, DecisionAdapterBatchRequest, DecisionAdapterCompileRequest, DecisionAdapterRequest, DecisionAdapter, DecisionDefinition, DecisionUsage, JsonValue } from '../types.js'; export declare const JEV_ENDPOINT = "https://api.typesafe.ai/v1/systemone"; interface JevAdapterOptions { endpoint?: string; fetch?: typeof fetch; /** Explicitly authorized public HTTPS origins. */ allowedOrigins?: readonly string[]; /** DNS policy seam; every answer must be public IPv4. */ resolveAddresses?: (hostname: string) => Promise; /** Fake pinned transport seam for offline tests. Production uses Node HTTPS. */ pinnedFetch?: (url: URL, init: RequestInit, pin: PinnedAddress) => Promise; now?: () => number; /** * Host-declared deployment region. Jev exposes no region control, so this is a * declared attribute without transport enforcement. Omitted means unknown, and * the evaluator then denies every projection policy for this adapter. */ region?: string; /** Trusted collection-only observer of bounded response bytes, including terminal invalid answers. * The caller must keep bodies private. Absent observers do not change adapter behavior. */ observeResponseBody?: (body: string, metadata: { actualModel: string | null; usage: DecisionUsage; }) => void; } interface PinnedAddress { address: string; family: 4; } /** Safe resolver taxonomy; messages are intentionally discarded at this boundary. */ export declare class JevCredentialError extends Error { readonly category: 'missing' | 'denied' | 'configuration' | 'failed'; constructor(category: 'missing' | 'denied' | 'configuration' | 'failed'); } export declare class JevDecisionAdapter implements DecisionAdapter { readonly id = "jev"; readonly version = "1.0.0"; private readonly endpoint; private readonly fetchImpl; private readonly allowedOrigins; private readonly resolveAddresses; private readonly pinnedFetch; private readonly now; private readonly region; private readonly observeResponseBody?; constructor(options?: JevAdapterOptions); /** An error response may still report billed usage and correlation metadata. */ private parseErrorResponse; /** * Derives the observer's model/usage from a value `parseBoundedJson` has already produced (or `undefined` * on a failed parse) -- never from a second, independent parse of the same bytes. `parseBoundedJson` runs * inside a bounded-time VM context (`MAX_PARSE_MS`); calling it twice on identical bytes let one call * succeed while the other spuriously hit that wall-clock bound under host contention, so the reported * metadata could disagree with the actual parsed answer even though both described one response. */ private observationMetadataOf; private responseMetadata; /** Observes exactly once, from the single parse attempt `parsed` already represents (successful or not). */ private observeParsed; capabilities(): Promise; /** * Local compilation of the stable question payload. Jev exposes no * server-side compile or prompt-prefix API, so this only prepares the * request bytes the evaluator would otherwise rebuild on every call. */ compile(request: DecisionAdapterCompileRequest): Promise; evaluate(request: DecisionAdapterRequest): Promise; evaluateMany(batch: DecisionAdapterBatchRequest): Promise; } export declare const JEV_COMPILED_QUESTION_FORMAT = "jev-question/v1"; /** * The question is kept as JSON text so its key order, and therefore the * request bytes, survive canonical cache storage unchanged. */ export declare function compileJevQuestion(definition: DecisionDefinition): { format: typeof JEV_COMPILED_QUESTION_FORMAT; question: string; }; /** @internal Exported from this module for direct admission and CPU-cost evidence, not the public barrel. */ export declare function parseBoundedJson(text: string): unknown; export {}; //# sourceMappingURL=jev.d.ts.map