eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
79 lines (78 loc) • 3.34 kB
TypeScript
import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
import type { HandleMessageStreamEvent } from "#protocol/message.js";
import { type EveEvalSkillLoadMatchOptions, type EveEvalSubagentCallMatchOptions, type EveEvalToolCallMatchOptions } from "#evals/match.js";
import type { RunAssertion } from "#evals/assertions/collector.js";
/**
* Asserts the run ran to completion: it did not fail and did not park on an
* unanswered HITL input request.
*/
export declare function completed(): RunAssertion;
/**
* Asserts the run ended parked on HITL input. For approval gates and
* ask-question flows.
*/
export declare function waiting(): RunAssertion;
/**
* Asserts the run did not fail: terminal status is not `"failed"` and no
* `turn.failed` / `step.failed` events were emitted. Parked runs pass; use
* {@link completed} to also reject parking.
*/
export declare function didNotFail(): RunAssertion;
/**
* Asserts the joined assistant message text contains `token` (substring for
* strings, `test` for RegExps).
*/
export declare function messageIncludes(token: string | RegExp): RunAssertion;
/**
* Asserts a tool call with `name` happened. Options constrain the call
* further: `input` partial-deep-matches, `output` matches the result,
* `isError` constrains error state, and `times` requires an exact count.
*/
export declare function calledTool(name: string, options?: EveEvalToolCallMatchOptions): RunAssertion;
/**
* Sugar over {@link calledTool} for the framework `load_skill` tool: asserts a
* skill with id `skill` was loaded. `output`/`isError`/`times` constrain the
* matching call exactly as for `calledTool`.
*/
export declare function loadedSkill(skill: string, options?: EveEvalSkillLoadMatchOptions): RunAssertion;
/**
* Asserts no tool call with `name` happened.
*/
export declare function notCalledTool(name: string): RunAssertion;
/**
* Asserts the named tools were called in the given order (subsequence match:
* other calls may interleave).
*/
export declare function toolOrder(names: readonly string[]): RunAssertion;
/**
* Asserts the run made no tool calls at all.
*/
export declare function usedNoTools(): RunAssertion;
/**
* Asserts the run made at most `max` tool calls.
*/
export declare function maxToolCalls(max: number): RunAssertion;
/**
* Asserts no action result (tool, subagent, or skill) reported a failure.
*/
export declare function noFailedActions(): RunAssertion;
/**
* Asserts a subagent delegation to `name` occurred. `remoteUrl` matches the
* `subagent.called` remote metadata, `output` matches the `subagent.completed`
* output.
*/
export declare function calledSubagent(name: string, options?: EveEvalSubagentCallMatchOptions): RunAssertion;
/**
* Escape hatch: asserts an arbitrary predicate over the full typed event
* stream. `label` names the assertion in reports.
*/
export declare function event(predicate: (events: readonly HandleMessageStreamEvent[]) => boolean, label: string): RunAssertion;
/**
* Asserts `result.output` (the final assistant message) deep-equals `value`.
*/
export declare function outputEquals(value: unknown): RunAssertion;
/**
* Asserts `result.output` validates against a Standard Schema (e.g. a Zod
* schema).
*/
export declare function outputMatches(schema: StandardSchemaV1): RunAssertion;