UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

18 lines (17 loc) • 1.41 kB
/** * The options of the FIRST TOOL LISTING of an MCP dial: the phase's bound, and the run's abort for as long as the listing is in the air. * The abort is what lets a run that was cancelled stop waiting on a server that never answers it (the bound alone is a minute at the * SDK's default); the dial then fails like any dial that did not finish. * * The listing runs on a connection the pool may share, so the abort cannot hang the transport up — it ends the listing request only. The * SDK's request keeps a listener on the signal it is given for the life of that signal, and an abort that reaches it later sends the * server a `notifications/cancelled` for a request long answered. So the request is given a signal of its own that follows the run's * only while the listing is in flight. (The handshake owns its transport until it lands and stops by closing it — see the dial.) */ /** What the SDK's request takes of a startup call. */ export interface StartupRequestOptions { timeout?: number; signal?: AbortSignal; } /** Run one startup request under `bound` (milliseconds, absent = the SDK's default) and, when given, the run's `abort`. Throws the abort's reason at once when it already fired. */ export declare function underStartupBound<T>(bound: number | undefined, abort: AbortSignal | undefined, request: (options: StartupRequestOptions | undefined) => Promise<T>): Promise<T>;