import type { MastraLanguageModel } from '../llm/model/shared.types.js'; import type { ObservabilityContext } from '../observability/index.js'; import { MastraModelOutput } from '../stream/index.js'; import type { InnerAgentExecutionOptions } from './agent.types.js'; import type { MessageList } from './message-list/index.js'; /** * Options for TripWire that control how the tripwire should be handled */ export interface TripWireOptions { /** * If true, the agent should retry with the tripwire reason as feedback. * The failed response will be added to message history along with the reason. */ retry?: boolean; /** * Strongly typed metadata from the processor. * This allows processors to pass structured information about what triggered the tripwire. */ metadata?: TMetadata; } /** * TripWire is a custom Error class for aborting processing with optional retry and metadata. * * When thrown from a processor, it signals that processing should stop. * The `options` field controls how the tripwire should be handled: * - `retry: true` - The agent will retry with the reason as feedback * - `metadata` - Strongly typed data about what triggered the tripwire */ export declare class TripWire extends Error { readonly options: TripWireOptions; readonly processorId?: string; constructor(reason: string, options?: TripWireOptions, processorId?: string); } /** * Tripwire data passed to getModelOutputForTripwire */ export interface TripwireData { reason: string; retry?: boolean; metadata?: TMetadata; processorId?: string; } export declare const getModelOutputForTripwire: ({ tripwire, runId, options, model, messageList, ...rest }: { tripwire: TripwireData; runId: string; options: InnerAgentExecutionOptions; model: MastraLanguageModel; messageList: MessageList; } & ObservabilityContext) => Promise>; //# sourceMappingURL=trip-wire.d.ts.map