@mastra/core
Version:
16 lines • 787 B
TypeScript
import type { StorageThreadType } from '../memory/types.js';
/**
* Fails closed when an existing memory thread is used with a resource that does not own it.
*
* Threads are scoped to a single resource. Without this check the agent would happily run the
* model (and tools) for a thread/resource pair that can never read or write that thread's history,
* so callers could not rely on `Agent.stream()` to reject an invalid pair before execution.
*
* Threads stored without a `resourceId` are treated as unowned so pre-existing rows keep working.
*/
export declare function assertThreadOwnedByResource({ thread, resourceId, agentName, }: {
thread: StorageThreadType;
resourceId: string;
agentName?: string;
}): void;
//# sourceMappingURL=memory-thread-ownership.d.ts.map