TrypatchAiOptions<ResultSchema, ToolContext>
Options for trypatch that investigate with an AI provider.
Type Parameters
ResultSchema
ResultSchema extends Schema = Schema
ToolContext
ToolContext = unknown
Properties
logging?
optional logging?: object;Where trypatch logs and how much; nothing is logged without a logger.
logger?
optional logger?: LoggerLike;Nothing is logged without one.
verbosity?
optional verbosity?: LoggingVerbosity;Defaults to 'high'.
getSignal?
optional getSignal?: (ctx) => AbortSignal | undefined;Resolves an abort signal from the investigation context (including the call's arguments), once per call. When it fires, the investigation stops and the decorated method rejects with the signal's reason.
Parameters
ctx
Returns
AbortSignal | undefined
timeoutMs?
optional timeoutMs?: number;Deadline for the whole investigation: tool rounds, MCP connections, the picked result tool and onAiInvestigationEnd. When it passes, the failure is logged and the method rethrows its original error; no deadline when unset.
onInvestigationStart?
optional onInvestigationStart?: (ctx) => void | Promise<void>;Called before the investigation starts, e.g. to report ctx.error. If it throws, the investigation is skipped and the decorated method rejects with its original error.
Parameters
ctx
Returns
void | Promise<void>
aiInvestigation
aiInvestigation: AiInvestigationOptions<ResultSchema, ToolContext>;Investigate with an AI provider.