Arcane OS Docs Development only

Reference

Arcane.runtime.current()

Synchronously describes this document's detected Arcane host surface without sending an RPC.

  • Reference

This focused page is derived from the mechanically checked full member inventory.

Syntax

Arcane.runtime.current()

Parameters

None

Return value

Frozen {connected, transport, native, managedLocalAI}

Description

Synchronously describes this document's detected Arcane host surface without sending an RPC.

Overview

Arcane.runtime.current() synchronously describes the Arcane transport surface detected for the current document. It performs no RPC and returns a frozen snapshot immediately.

const runtime = Arcane.runtime.current();

The result has this exact shape:

Property Type Meaning
connected boolean true when this document initialized a callable Arcane messaging transport.
transport string One of webview2, webkitgtk, android-webview, development-http, or standalone.
native boolean true for WebView2, WebKitGTK, and Android WebView hosts.
managedLocalAI boolean true only for the WebView2 and WebKitGTK desktop host classes that can mediate Arcane-managed local services.

connected is a transport fact, not a health, authority, or readiness claim. It does not mean Core answered a request, that the current application is admitted for a method, or that a dependency is installed. Likewise, managedLocalAI describes a host capability class; it does not report that Ollama, speech, or a model is installed or healthy.

Use Arcane.capabilities.list() to inspect the bound application and admitted methods, and use the relevant namespace status method for dependency state.

Runtime snapshot

The method returns a frozen object. It does not return a Promise, does not initialize a new request, and has no asynchronous rejection path.

The transport values mean:

Value Environment
webview2 Native Microsoft NT WebView2 host.
webkitgtk Native Linux WebKitGTK host.
android-webview Native Android WebView host.
development-http Development HTTP bridge; not a native renderer host.
standalone No callable Arcane host transport was selected.

Example

const runtime = globalThis.Arcane?.runtime?.current?.();

if (!runtime) {
    throw new Error('The Arcane API is not loaded in this document.');
}

console.table(runtime);

if (!runtime.connected) {
    console.info('Open this application through an Arcane host to use native methods.');
} else if (runtime.native) {
    console.info(`Running through the native ${runtime.transport} transport.`);
} else {
    console.info(`Running through the ${runtime.transport} development transport.`);
}

Reference group

Core and events

Repository and reviewed source access