ModelRolesResolver constructor
ModelRolesResolver({
- required ModelRolesConfig config,
- required Map<
String, String> secrets, - String? cwd,
- String? homeDir,
- void onNotice(
- FallbackNotice notice
- DateTime now()?,
- double jitterFraction()?,
- Future<
bool> sleeper(- Duration delay,
- CancelToken? cancelToken
- StreamFunction streamFactory()?,
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;