def add_current

cswap-bend-cli@0.1.0.0 · store.bend:332

import cswap-bend-cli@0.1.0.0/store.bend as Store
import Base
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/lock.bend as Lock
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/plan.bend as SPlan

332# Adopt the live login (~/.claude.json oauthAccount + .credentials.json) into a
333# slot. The credential's owner is looked up with `fetch` (profile_http in
334# production, a stub in tests); an owner that disagrees with the config's
335# (email, organization) is refused with the reference's wording and nothing is
336# written. An unresolvable owner registers with a Notice line, as the
337# reference does. An occupied slot needs `assume_yes` (see add_token).
338def add_current(+ctx: SBase.Ctx, +alias: Maybe<&2, String>, +slot0: Maybe<&2, U32>, +assume_yes: Bool, fetch: String -> IO(SPlan.Prof)) -> Act.of(String):
339  do ActM<String>:
340    alias_check(alias)
341    Lock.with_lock(String, SBase.lock_path(SBase.root_of(ctx)), 10000, current3(SBase.root_of(ctx), ctx, alias_of(alias), slot0, assume_yes, fetch))

Uses (17)

Used by (1)