Capability first · transport second

AIPreferenceRuntime.js

Applies and reads non-persistent per-user AI preference overrides.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Applies and reads non-persistent per-user AI preference overrides.

  • Artifact
    AIPreferenceRuntime.js · esm
  • Classification
    public first party
  • Availability
    Cross-host
  • Normalization
    Normalized six-slot preference state.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/AIPreferenceRuntime.js';

Stores an optional six-slot override in a WeakMap keyed by the user object; it never persists or mutates the user entity.

Application-facing behavior: setAIPreferenceRuntimeOverride(), getAIPreferencesForRuntime().

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
setAIPreferenceRuntimeOverridefunctionfunction setAIPreferenceRuntimeOverride(user,preferences)user,preferences
getAIPreferencesForRuntimefunctionfunction getAIPreferencesForRuntime(user)user
CallableKindExact public signatureParameter syntax
setAIPreferenceRuntimeOverrideexported-functionfunction setAIPreferenceRuntimeOverride(user,preferences)user,preferences
getAIPreferencesForRuntimeexported-functionfunction getAIPreferencesForRuntime(user)user

Parameter meanings and results

setAIPreferenceRuntimeOverride(user, tupleOrNull) freezes and returns a six-entry snapshot or removes it. getAIPreferencesForRuntime(user) returns the override or user.preferredModels.

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 a missing owner or a non-six-entry tuple

Availability and capabilities

Cross-host. Normalized six-slot preference state.

Feeds runtime provider and model selection without choosing or admitting a Core model.

Contract example

JavaScript
import {setAIPreferenceRuntimeOverride, getAIPreferencesForRuntime} from '/arcane/modules/AIPreferenceRuntime.js';

const user={
    preferredModels:[
        'TWIN','LOCAL_SPEACH','LOCAL_SPEACH',
        'openai-gpt-oss-120b','kokoro','whisper-small'
    ]
};
setAIPreferenceRuntimeOverride(user,[
    'OLLAMA','LOCAL_SPEACH','LOCAL_SPEACH','llama3.2:latest','local','local'
]);
console.log(getAIPreferencesForRuntime(user));

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