diosc() is the global command function the widget installs. Call it with a command name and its
arguments. Calls made before the widget finishes loading are queued and replayed in order.
Send a message programmatically, with optional page context. When it is the chat’s first message and DioscHub refuses to start the chat (for example an anonymous session limit), the promise still resolves: the widget shows the reason, puts the message back in the composer, and fires session:start_refused.
Choose which of the Assistant’s color sets is active. system follows the OS prefers-color-scheme live; null returns to the Assistant’s own theme mode. Re-themes in place, no reconnect. Mirrors the theme-mode attribute. See Theming.
Approval decisions are not global commands: there is no diosc('approve'). A global approve would
let any script on the host page auto-approve the assistant’s actions, which the consensus model exists
to prevent. The built-in consensus dialog resolves every approval, and there is no host-rendered alternative at
any tier. You can restyle the dialog’s detail body per tool with
diosc('consensusView', …) — that surface reports field edits but carries
no verdict channel.
The object passed to diosc('config', …). All fields are optional.
Field
Type
Description
backendUrl
string
Backend URL for the WebSocket/REST connection.
apiKey
string
Embed key.
assistantId
string
Assistant ID. Auto-detected from the config fetch if omitted.
bindEndpoint
string
Your host endpoint that authenticates the user and forwards identity to DioscHub’s /auth/bind. The widget POSTs { wsId } to it with credentials. Optional for an anonymous-only page: without it the hub binds the connection anonymously when the Assistant allows anonymous use. See Identity & auth.