On this page
Overview
Normalizes and compares the six provider/model preference slots.
- Artifact
AIPreferenceTuple.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Fully normalized frozen tuple.
Import and lifecycle
import * as module from '/arcane/modules/AIPreferenceTuple.js';
Pure in-process normalization and comparison with no persistence or host calls.
Application-facing behavior: AIPREFERENCESLOTKEYS, normalizeAIPreferenceTuple(), aiPreferenceTuplesEqual().
Protocol and host implementation
In-process only This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
AI_PREFERENCE_SLOT_KEYS | variable · value | variable AI_PREFERENCE_SLOT_KEYS | — |
normalizeAIPreferenceTuple | function | function normalizeAIPreferenceTuple(
value,
{
defaults,
allowedValues=[],
aliases=[]
}={}
) |
value,
{
defaults,
allowedValues=[],
aliases=[]
}={}
|
aiPreferenceTuplesEqual | function | function aiPreferenceTuplesEqual(left,right) | left,right |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
normalizeAIPreferenceTuple | exported-function | function normalizeAIPreferenceTuple(
value,
{
defaults,
allowedValues=[],
aliases=[]
}={}
) |
value,
{
defaults,
allowedValues=[],
aliases=[]
}={}
|
aiPreferenceTuplesEqual | exported-function | function aiPreferenceTuplesEqual(left,right) | left,right |
Parameter meanings and results
normalizeAIPreferenceTuple(value, {defaults, allowedValues, aliases}) returns a normalized six-element array in the documented slot order. aiPreferenceTuplesEqual(left, right) requires two six-entry arrays with exact values.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- TypeError for invalid defaults, allowed-value collections, or disallowed defaults
Availability and capabilities
Cross-host. Fully normalized frozen tuple.
Normalizes profile tokens only; Core admission remains a separate status and catalog concern.
Contract example
import {AI_PREFERENCE_SLOT_KEYS, normalizeAIPreferenceTuple, aiPreferenceTuplesEqual} from '/arcane/modules/AIPreferenceTuple.js';
const defaults=[
'TWIN','LOCAL_SPEACH','LOCAL_SPEACH',
'openai-gpt-oss-120b','kokoro','whisper-small'
];
const tuple=normalizeAIPreferenceTuple(['OLLAMA'],{defaults});
console.log(AI_PREFERENCE_SLOT_KEYS,aiPreferenceTuplesEqual(tuple,tuple));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.