Capability first · transport second

AIPreferenceTuple.js

Normalizes and compares the six provider/model preference slots.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
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

JavaScript
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

BindingFormDeclaration or signatureParameter syntax
AI_PREFERENCE_SLOT_KEYSvariable · valuevariable AI_PREFERENCE_SLOT_KEYS
normalizeAIPreferenceTuplefunctionfunction normalizeAIPreferenceTuple( value, { defaults, allowedValues=[], aliases=[] }={} ) value, { defaults, allowedValues=[], aliases=[] }={}
aiPreferenceTuplesEqualfunctionfunction aiPreferenceTuplesEqual(left,right)left,right
CallableKindExact public signatureParameter syntax
normalizeAIPreferenceTupleexported-functionfunction normalizeAIPreferenceTuple( value, { defaults, allowedValues=[], aliases=[] }={} ) value, { defaults, allowedValues=[], aliases=[] }={}
aiPreferenceTuplesEqualexported-functionfunction 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

JavaScript
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));

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.