import type { EvaluateOptions } from '../evaluate/run.js'; import { type ExperimentGateOptions } from '../prompts/gates.js'; import type { Dataset, DatasetExample, Evaluator, Experiment } from '../types/evaluate.js'; import type { ToolDefinition } from '../types/messages.js'; import type { ContextBundle, ContextPromotionGate } from './hub.js'; export { type ContextChange, type ContextDiff, diffContexts, formatContextDiff } from './diff.js'; export { type ContextBundle, type ContextBundleDefinition, type ContextBundleExport, ContextConflictError, ContextDefinitionError, type ContextHistoryEntry, ContextHub, ContextHubError, type ContextHubOptions, type ContextLabel, ContextNotFoundError, type ContextPromotionContext, ContextPromotionError, type ContextPromotionGate, ContextSignatureError, type ContextVerification, type ContextPromotionResult, type ContextPromptPin, type ContextReference, type ContextSkill, type ContextTool, contextVersion, } from './hub.js'; export type { ExperimentGateOptions } from '../prompts/gates.js'; export { type ContextCryptoKey, type ContextJsonWebKey, type ContextKeyring, type ContextSignature, type ContextSignedContent, type ContextSigner, type ContextSigningKey, contextDigest, ed25519Keyring, ed25519Signer, generateContextKey, } from './signing.js'; /** * A bundle's instructions joined into one system text, in the order the bundle lists them, or only * the ones named in `include`, in that order. */ export declare function contextInstructions(bundle: ContextBundle, options?: { include?: readonly string[]; separator?: string; }): string; /** * A bundle's tools as tool definitions an agent can call: each definition from the bundle, each * implementation from your code, matched by name. A tool the bundle offers without an implementation * is an error, unless `strict` is false, when it is left out; an implementation the bundle does not * offer is never exposed, so the bundle decides what the model can call. */ export declare function bindTools(bundle: ContextBundle, implementations: Record) => unknown>, options?: { strict?: boolean; }): ToolDefinition[]; /** Runs one example with a bundle: build the request from it, call the model or agent, return the output. */ export type ContextTarget = (bundle: ContextBundle, inputs: I, context: { example: DatasetExample; run: number; signal?: AbortSignal; }) => Promise | unknown; /** * Runs a bundle version over a dataset and scores it. The experiment records the bundle in * `metadata.context`, which `contextExperimentGate()` looks for; with a `cache` and no `fingerprint`, * the fingerprint is the bundle's version, so an unchanged bundle re-scores its stored outputs. */ export declare function evaluateContext(bundle: ContextBundle, dataset: Dataset, evaluators: Array>, target: ContextTarget, options?: EvaluateOptions): Promise; /** * Refuses a promotion until an experiment has passed for the exact bundle version being promoted, as * `experimentGate()` does for prompts: an experiment counts when its `metadata.context` names the * version, which `evaluateContext()` records. `thresholds`, `maxErrors`, and `noRegression` work the * same way. */ export declare function contextExperimentGate(options: ExperimentGateOptions): ContextPromotionGate; /** Refuses a promotion unless the version is what another label serves now, such as `staging` before `production`. */ export declare function servedByContextGate(label: string): ContextPromotionGate;