/** * power/work-signals.ts, binds the runtime event bus to the PowerManager's * work holds, so "real work" holds the sleep inhibitor automatically: * * - a running turn (TURN_SUBMITTED → terminal turn event), * - an active agent/fleet node (AGENT_SPAWNING/RUNNING → terminal agent event), * - a queued-or-running scheduled job (AUTOMATION_RUN_QUEUED/STARTED → * terminal run event), the "schedule due soon" signal at its honest source: * the scheduler queues the run when it comes due. * * Every hold is keyed by its work id, so overlapping work refcounts naturally * and the inhibitor releases exactly when the last piece drains. */ import type { EventEnvelope } from '@pellux/goodvibes-transport-core'; import type { PowerManager } from './manager.js'; /** * Structural bus slice, typed against the REAL envelope shape * (packages/transport-core/src/event-envelope.ts: `type`/`ts`/optional * trace-and-id fields/`payload`, never `event`). RuntimeEventBus.on is * generic (`on(eventType: T['type'], callback: * EnvelopeListener)`), so it structurally satisfies this non-generic * signature without a cast at the call site. */ export interface PowerWorkSignalBus { on(eventType: string, callback: (envelope: EventEnvelope>) => void): () => void; } /** Subscribe the manager's work holds to the bus; returns an unbind. */ export declare function bindPowerWorkSignals(bus: PowerWorkSignalBus, manager: Pick): () => void; //# sourceMappingURL=work-signals.d.ts.map