ModelRolesResolver constructor

ModelRolesResolver({
  1. required ModelRolesConfig config,
  2. required Map<String, String> secrets,
  3. String? cwd,
  4. String? homeDir,
  5. void onNotice(
    1. FallbackNotice notice
    )?,
  6. DateTime now()?,
  7. double jitterFraction()?,
  8. Future<bool> sleeper(
    1. Duration delay,
    2. CancelToken? cancelToken
    )?,
  9. StreamFunction streamFactory(
    1. String kind,
    2. String apiKey
    )?,
})

Creates a resolver over config and a snapshot of secrets (name → value). cwd/homeDir feed path-override matching; now/jitterFraction/sleeper are injectable for deterministic tests and forwarded to every chain wrapper. streamFactory builds the per-key provider adapter (defaults to providerStreamFunction; tests inject fakes).

Implementation

ModelRolesResolver({
  required this.config,
  required Map<String, String> secrets,
  this.cwd,
  this.homeDir,
  this.onNotice,
  DateTime Function()? now,
  this.jitterFraction,
  this.sleeper,
  StreamFunction Function(String kind, String apiKey)? streamFactory,
}) : _secrets = Map.unmodifiable(secrets),
     _now = now ?? DateTime.now,
     _streamFactory = streamFactory ?? providerStreamFunction;