CustomProviderRegistry class final
The live list of saved custom providers (shared by the CLI, which mutates it, and the executable, which persists it).
Constructors
-
CustomProviderRegistry(List<
CustomProviderEntry> entries) -
Creates a registry over
entries(a live, mutable list). Same-auth- domain records (alias spellings of one canonical id, #706 — e.g. a hand-editedchatgptghost next to the OAuth-mintedchatgpt.com) merge onto ONE record: fields the survivor lacks are inherited from the twin (union — nothing dropped), conflicts keep the survivor's value, and a note lands in mergeNotes. A reserved-named ghost (e.g.chatgpt, which would shadow/providerrouting) never survives — the non-reserved twin wins even when it came later.
Properties
-
entries
→ List<
CustomProviderEntry> -
All saved entries, in insertion order.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keyNameMigrationNotes
→ List<
String> -
Non-destructive migration notes for key slots an older build
generated with the pre-gh-1226 doubling rule — an entry named
z.aion hostapi.z.aipersistedFA_KEY_API_Z_AI_Z_AIwhere the canonical slot isFA_KEY_API_Z_AI(gh-1226 AC3). Resolution still probes each entry's OWN stored keyName first, so an existing doubled slot keeps working; the note tells the user the canonical name to move the value to AND to delete the doubled slot afterwards — otherwise the pinned slot keeps winning and the note reprints on every boot (review thread). Only the doubling class nags: an intentional non-canonical keyName (e.g. a slot shared on purpose across entries) is a user choice, not a defect.no setter -
mergeNotes
→ List<
String> -
Human-readable notes from the load-time same-domain merge (#706).
Each note names the record that was folded and the record that
actually survived (a ghost-first load swaps both — see
_mergeOnLoad).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
CustomProviderEntry entry) → void -
Adds (or replaces, on name clash)
entry. Throws ConfigException when the entry is named after a built-in catalog provider — such an entry shadows/provider <name>routing and is exactly the ghost "openai" of issue #221; the interactive name prompts reject these names already, this is the last line of defense for flows that construct entries directly. -
deriveName(
String baseUrl) → String -
Derives a unique display name from
baseUrl's host (and non-default port), avoiding catalog provider names and existing entries:localhost:11434,api.acme.com,api.acme.com-2, ... -
find(
String name) → CustomProviderEntry? -
Finds an entry by
name(case-insensitive), or null. Alias spellings resolve onto the canonical record:find('chatgpt.com')andfind('chatgpt')both land on the one same-domain entry. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateModel(
String name, String modelId) → void -
Records the last-used model for the entry named
name(no-op when absent).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
copilotEntryKeyName(
String entryName) → String -
The secure-store/env key name backing a connected Copilot account:
FA_KEY_COPILOT_<SANITIZED_ENTRY_NAME>(goal/copilot_provider.md). Scoped to the ENTRY (not the host) so several accounts — possibly on different plans, hence different hosts — keep separate key slots, and so CI can supplyFA_KEY_COPILOT_<NAME>(+_2…) without a store. -
keyNameFor(
String baseUrl, {String? providerName}) → String -
The secure-store key name backing
baseUrl's key:FA_KEY_LOCALHOST_11434,FA_KEY_API_ACME_COM(the store accepts[A-Za-z0-9_]+only). WithproviderName(a saved entry's name) the name is appended —FA_KEY_API_KIMI_COM_WORK— so several accounts on the same endpoint keep separate keys instead of overwriting one host-scoped entry. -
keySlotCandidates(
String baseUrl, {String? providerName}) → List< String> - Every key-slot name the SAME endpoint ever derived, canonical first — the cross-version stability contract (gh-1570 incident REG). A slot name is a persistent contract: a key stored by an older build under THAT build's spelling of the derivation must keep resolving after an update changes the spelling, so resolution probes the whole set and the boot migrates a stranded value forward (gh-1570 review).