def cands.cf

cswap-bend-cli@0.1.0.0 · policy/decide.bend:327

import cswap-bend-cli@0.1.0.0/policy/decide.bend as Decide
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T
import cswap-bend-cli@0.1.0.0/policy/pick.bend as K
import cswap-bend-cli@0.1.0.0/policy/exhaust.bend as E

327# A healthy consume-first account with no OAuth peer to compare against is
328# below the threshold, exactly as under `best`.
329def cands.cf(+hold: Bool, +t: T.Trigger, +e: Env) -> T.Decision:
330  match hold:
331    case True{}:
332      T.NoSwitch{T.BelowThreshold{}, below.detail(K.ah.or0(env.ah(e)), env.cfg(e))}
333    case False{}:
334      cands.none(Bool.not(E.any_cand(env.as(e), env.active(e))) && Bool.not(cfg.include(env.cfg(e)) && E.any_api(env.as(e), env.active(e))), t, e)

Uses (17)

Used by (1)