@mastra/core
Version:
20 lines • 1.36 kB
TypeScript
/**
* Create a durable background task check step. Behavior lives in the shared
* `checkBackgroundTasks` core; this glue owns registry/init-data access, the
* durable wait gate, and pubsub emission.
*
* The durable wait gate differs from the main loop's on purpose: the regular
* agent can skip waiting because background tool-result chunks are pushed
* directly into the live ReadableStream controller — that works even after
* this step returns. The durable agent emits tool-result chunks via pubsub,
* and the subscription is torn down when the stream closes. If this step
* returned without waiting, the workflow would finish, FINISH would fire,
* cleanup would run, and the subscriber would be gone before the background
* task could deliver its result. Therefore the durable agent must always
* wait when tasks are running — using the configured waitTimeoutMs, or a 1 s
* default to keep the workflow (and pubsub) alive. It only signals pending
* without blocking on retryCount 0 when an explicit timeout is configured
* (meaning the caller drives continuation externally).
*/
export declare function createDurableBackgroundTaskCheckStep(): import("../../../../workflows").Step<string, unknown, any, any, unknown, unknown, import("../../../../workflows").DefaultEngineType, unknown>;
//# sourceMappingURL=background-task-check.d.ts.map