Variable: defaultEmitLifecycle
ts
const defaultEmitLifecycle: (
hooks: BatteryLifecycleHooks | undefined,
battery: BatteryLifecycleBattery,
model: string,
phase: BatteryLifecyclePhase,
extra?: Partial<
Pick<
BatteryLifecycleReport,
"error" | "raw" | "detail" | "progress" | "gpuBudget"
>
>,
now: () => string,
) => void = emitLifecycle;Defined in: src/batteries/llm/chat_common/lifecycle.ts:160
Default emitLifecycle.
Build a BatteryLifecycleReport (stamping at) and dispatch it to the firehose (BatteryLifecycleHooks.onLifecycle) AND the per-phase hook for phase. A no-op when hooks is undefined or carries no relevant callbacks. Defensive: each callback is invoked through safeInvoke, so a throwing consumer never disrupts the battery.
Parameters
| Parameter | Type | Description |
|---|---|---|
hooks | | BatteryLifecycleHooks | undefined | The merged lifecycle hooks (may be undefined). |
battery | BatteryLifecycleBattery | Which battery is emitting. |
model | string | Best-effort model id string. |
phase | BatteryLifecyclePhase | The phase being entered. |
extra? | Partial<Pick<BatteryLifecycleReport, "error" | "raw" | "detail" | "progress" | "gpuBudget">> | Optional detail / progress / raw / error fields. |
now? | () => string | Injectable clock for tests; defaults to luxon DateTime.now().toISO(). |
Returns
void