AgentLifecycleRegistry

Application-wide registry of every live agent's AgentLifecycle.

It is providedIn: 'root', so it always exists and every agent registers into the same instance regardless of which injector built it — an agent created in a route or component injector is still visible from the root. External instrumentation packages read lifecycles() to observe every agent in the application without owning the provider graph.

Registration is scoped to the agent's lifetime: an agent unregisters when the injector that created it is destroyed, so lifecycles() never accumulates lifecycles for agents that are gone.

import { AgentLifecycleRegistry } from '@threadplane/langgraph';

Declaration

export declare class AgentLifecycleRegistry  {
  readonly lifecycles: Signal<readonly AgentLifecycle[]>;
  register(lifecycle: AgentLifecycle): void;
  unregister(lifecycle: AgentLifecycle): void;
}

Members

lifecycles

Reactive list of the lifecycles of every currently live agent.

readonly lifecycles: Signal<readonly AgentLifecycle[]>;

register · overload 1

register(lifecycle: AgentLifecycle): void;

Parameters

lifecycle · required
AgentLifecycle

Returns

void

unregister · overload 1

Drop a lifecycle when its agent's injector is destroyed.

unregister(lifecycle: AgentLifecycle): void;

Parameters

lifecycle · required
AgentLifecycle

Returns

void