/** * The shared memory an AgentTeam holds on behalf of its tasks. * * Python parity: `AgentTeam(memory=...)` builds one `Memory` for the whole team * and assigns it to every task that did not bring its own. The effect on a run * is in `_prepare_task_prompt`: retrieved memory is appended to the task prompt * (bare bullet lines, no section headers), and each finished task writes its * result back. This module is that effect, held by the team rather than pushed * into member agents -- an Agent's own `memory=` stays its own. */ import { type MemoryConfig } from '../memory/memory'; /** The minimum a team memory store must do. Matches `Agent`'s memory contract. */ export interface TeamMemoryStore { search(query: string, limit?: number): Promise; }; score: number; }>>; add(content: string, role: 'user' | 'assistant' | 'system', metadata?: Record): Promise; } /** The value `AgentTeam({ memory })` accepts. */ export type TeamMemoryInput = boolean | string | MemoryConfig | TeamMemoryStore | { userId?: string; user_id?: string; config?: MemoryConfig; [key: string]: unknown; }; /** What {@link resolveTeamMemory} works out from the `memory` option. */ export interface TeamMemorySettings { /** Python parity: AgentTeam.shared_memory. Undefined when memory is off. */ store?: TeamMemoryStore; /** A memory file to open lazily (needs fs, so it is deferred to first use). */ file?: string; /** Python parity: AgentTeam.user_id (default "praison"). */ userId: string; } /** * Resolve `memory` into a shared store, mirroring what Python's resolver * accepts: `False`/`None` off, `True` on with defaults, a config, a memory * instance, or a `MultiAgentMemoryConfig`-shaped object carrying `user_id`. */ export declare function resolveTeamMemory(value: unknown): TeamMemorySettings; /** * The team's shared memory: recall before a task, remember after it. * * Created only when `memory` is truthy, so a team without it does no work and * allocates no store. */ export declare class TeamMemory { private store?; private readonly file?; /** Python parity: AgentTeam.user_id. */ readonly userId: string; constructor(settings: TeamMemorySettings); /** The underlying store (Python parity: `team.shared_memory`), if open. */ getStore(): TeamMemoryStore | undefined; private ensureStore; /** * Memory relevant to `prompt`, formatted the way Python appends it to a task * prompt: bare bullet lines, no section header. Empty string when nothing is * recalled, so the caller can leave the prompt untouched. */ recall(prompt: string, limit?: number): Promise; /** An entry belongs to this team when its userId matches, or it carries none. */ private ownedByTeam; /** Write a finished task back to the shared store. */ remember(prompt: string, result: string, taskName: string): Promise; } /** Build the team's shared memory, or undefined when `memory` is off. */ export declare function createTeamMemory(value: unknown): { memory?: TeamMemory; userId: string; };