sessionPowerAssertions function
PowerAssertionController?
sessionPowerAssertions(
- AgentCliConfig config,
- void onWarn(
- String message
Builds the session's sleep-prevention controller (issues #325/#326) from the host-injected runner + configured level + hold lifecycle; a null runner (tests, web) means no assertions — power is host-best-effort.
Implementation
PowerAssertionController? sessionPowerAssertions(
AgentCliConfig config,
void Function(String message) onWarn,
) => config.powerRunner == null
? null
: PowerAssertionController(
runner: config.powerRunner!,
level: config.powerSleepPrevention,
hold: config.powerSleepPreventionHold,
onWarn: onWarn,
);