Skip to content
Console

SDK Contract

The SDK contract defines the behavior each language SDK should expose, even when method names follow local language style.

Use this page when adding a new language SDK, reviewing a release, or checking whether an integration can move between SDKs.

AreaContract
Control planeDiscover public hubs, list authenticated hubs, and create client identities.
IdentityLoad the same identity fields in every SDK.
ProtocolsSupport WSS, HTTPS, and MQTT over TLS when the identity and hub allow them.
RequestsSupport natural language, action payloads, exact codes, sessions, and context.
RepliesNormalize text, speech, display items, policy state, and raw event data.

Public discovery

List public hubs without requiring an access token.

Authenticated hubs

List hubs visible to the signed-in workspace when API access is allowed.

Identity provisioning

Create a client identity and preserve returned protocol metadata.

Protocol selection

Select WSS, HTTPS, or MQTT explicitly and fail clearly when unavailable.

Health

Check that the endpoint, identity, and transport are usable.

Ask

Send one request and return a normalized reply object.

Action

Send a structured command or UI selection without turning it into prose.

Code

Send exact input such as scanned values, serial numbers, or typed codes.

Every SDK should understand these fields:

FieldMeaning
access_keyClient identifier used during hub auth.
passwordClient secret used during hub auth.
crypto_keyOptional shared payload encryption key.
site_idStable client, service, device, or runtime label.
data_plane_endpointsExplicit WSS, HTTPS, and MQTT endpoints.
protocolsHub protocol flags returned with the identity.
mqttPer-client MQTT broker credentials and topic scope.

SDKs should load ~/.config/thalovant/config.yaml by default for local development, honor XDG_CONFIG_HOME, support named profiles, and reject group-readable or world-readable config files on Linux and macOS.

Every SDK should expose these concepts:

FieldMeaning
textPlain fallback answer for chat, logs, and tests.
speechSpeakable answer text after markup cleanup.
display_itemsStructured UI items such as choices, tables, images, and attachments.
session_idSession used by the request or returned by the hub.
request_idRequest trace key when provided or generated.
policy_deniedTrue when access policy blocked the request.
raw_eventOriginal event payload for advanced integrations.
RuleWhy it matters
Unknown identity fields should be ignored.New fields must not break older clients.
Unknown display items should be ignored.New UI outputs must not break older apps.
Missing optional metadata should use defaults.Small clients should not need every field.
Method names should feel native.Python, Node, Go, and Rust should match their language norms.
Error objects should include context.Callers need endpoint, status, request ID, and policy details when available.
Runtime protocol defaults should be predictable.Prefer WSS, then HTTPS, then MQTT when broker credentials exist.
MQTT requires client-scoped credentials.Broker access must stay limited to one client and its topics.
AreaRequirement
API tokensSend only as authorization headers. Do not put tokens in URLs.
Identity outputRedact passwords, broker passwords, and crypto keys by default.
Local configRequire owner-only permissions for ~/.config/thalovant/config.yaml on Linux and macOS.
TLSHonor mqtt.tls: true even when the endpoint scheme is not already mqtts://.
Public endpointsPrefer https://, wss://, and mqtts:// in examples and generated identities.
MQTT topicsUse returned client topics or derive topics inside the client scope only.
TimeoutsBound connect, send, and wait operations so clients fail clearly.
RuleWhy it matters
Code changes require a version bump.CI publishes existing versions, it does not invent new ones.
Tests cover protocol selection.Every SDK must reject unavailable protocols clearly.
Tests cover secret redaction.SDKs must not leak credentials in normal summaries.
Docs update with new features.Users should not need source code to discover supported behavior.
CapabilityPythonNodeGoRust
AskaskaskAskask
Contextbuild_client_contextbuildClientContextBuildClientContextbuild_client_context
Actionsend_actionsendActionSendActionsend_action
Codesend_codesendCodeSendCodesend_code
Protocol checksupports_protocolsupportsProtocolSupportsProtocolsupports_protocol