@mastra/core
Version:
28 lines • 1.46 kB
TypeScript
import type { PubSub } from '../../events/pubsub.js';
import type { Mastra } from '../../mastra/index.js';
import type { Agent } from '../agent.js';
import type { AgentStreamProducer, AgentStreamPublisher } from '../streams/publisher.js';
import type { DurableExecutionClaim } from './execution-fence.js';
import type { RunRegistryEntry } from './types.js';
export declare const executionTransport: unique symbol;
interface ExecutionPublisherOptions {
runId: string;
agentId: string;
mastra?: Mastra;
agent?: Pick<Agent, '__getStreamBus' | '__getRunOwner' | '__usesSharedRunLog'>;
claim?: DurableExecutionClaim;
entry?: RunRegistryEntry;
}
/** Worker output keeps its captured execution authority and cannot settle or clean up the run. */
export declare function getExecutionStreamProducer(options: ExecutionPublisherOptions): AgentStreamProducer | undefined;
/** Owning readers settle and clean up using the authority of their captured execution. */
export declare function getExecutionStreamOwner(options: ExecutionPublisherOptions): AgentStreamPublisher | undefined;
/** Route this run's stream events through its execution-bound producer; other topics pass through unchanged. */
export declare function withExecutionStreamProducer(pubsub: PubSub, options: {
runId: string;
agentId: string;
mastra?: Mastra;
claim?: DurableExecutionClaim;
}): PubSub;
export {};
//# sourceMappingURL=execution-stream-publisher.d.ts.map