import type { Args, ICommandAgent, IQueryCacheEntry, TCommandAgentState, TTriggerPromise } from "../../../query/types/index.js"; import type { ReadonlySignal } from "../../../signals/types/index.js"; export interface ICommandForAgent { execute(args: Args, key?: string): Promise; getEntry$(key: string): IQueryCacheEntry | null; } export declare class CommandAgent implements ICommandAgent { private readonly _command; private readonly _tracking$; /** Cache key the agent is bound to (via constructor/setKey), reused by trigger. */ private _boundKey; readonly state$: ReadonlySignal>; constructor(command: ICommandForAgent, key?: string); /** * Execute the mutation and track its cache entry via {@link state$}. * * Returns a {@link TTriggerPromise}: the envelope promise never rejects, so * a fire-and-forget call site cannot surface an unhandled rejection (the * failure still lands in {@link state$}); `unwrap()` hands back the raw * throwing promise. */ trigger(args: Args, key?: string): TTriggerPromise; setKey(key: string): void; retry: () => void; private _observeKey; private _deriveState; private _createIdleState; }