/** * Canonical `isThenable` for the SDK's "consumer-supplied async function * survives sync-loop dispatch" pattern. * * Used everywhere a consumer-registered handler runs inside a sync `for` * loop and may return a Promise (or rejection-bearing thenable) — the * caller chains `.then(undefined, onReject)` so a rejection lands on the * SDK's `[@qodo/sdk]` breadcrumb channel rather than escaping as a * process-level `unhandledRejection`. * * **Why a separate module:** two earlier copies (one in * `src/client/observers.ts`, one inlined in `src/client/ToolClient.ts`) * diverged — the ToolClient copy accepted only `typeof === 'object'`, * missing callable thenables (a function with a `.then` property, valid * per the Promises/A+ spec). One canonical implementation removes the * "diverging mirror" maintenance trap. * * **Why callable thenables matter:** they're rare in TypeScript code * (the type system makes them awkward to construct), but valid JS code * can produce them via `Object.assign(() => {}, { then: ... })` or * via `class extends Function`. Without the function-arm check, such * a handler would have its rejection treated as "not a Promise" and * fall through the sync `try/catch` only, leaving any rejection * unhandled. */ export declare function isThenable(value: unknown): value is PromiseLike; //# sourceMappingURL=thenable.d.ts.map