SDKs
| SDK | Audience | Package | Status |
|---|---|---|---|
| TypeScript | Web and Node.js service applications | @openrois/sdk | Available |
| C# | Unity and .NET service applications | org.openrois.sdk | Available |
| Python (adapter SDK) | Components, adapters, and gateways | openrois-core, openrois-components-core | Available |
All SDKs share the RoIS types generated by the type pipeline, so a message has the same fields in every language.
TypeScript
RoISClient wraps the WebSocket transport and exposes the RoIS interfaces as asynchronous
methods. Responses of the command, query, and event operations are validated at runtime
against the generated schemas. The SDK ships
ESM and CommonJS builds and runs in browsers and in Node.js.
| RoIS interface | Methods |
|---|---|
| System | RoISClient.connect(), disconnect(), getProfile(), getErrorDetail() |
| Command | search(), bind(), bindAny(), release(), getParameter(), setParameter(), execute(), getCommandResult() |
| Query | query() |
| Event | subscribe(), unsubscribe(), getEventDetail() |
| Streaming | connectStream(), disconnectStream(), suspendStream(), resumeStream(), queryStreamStatus() |
Pass { token } to RoISClient.connect() when the gateway authenticates; the SDK presents it
at the WebSocket upgrade as the token query parameter.
| Client event | Emitted for |
|---|---|
<event_type> | Each RoIS event, under its own type, for example reached_target |
rois.event.notify | Every RoIS event |
rois.command.completed | Command completion |
rois.system.notify_error | Engine errors |
notification | Every JSON-RPC notification, including rois.system.profile_changed |
close | The connection closed |
Methods whose RoIS operation is not yet implemented by the engine (see the wire protocol) are already present in the SDK and fail until the engine supports them.
See write a service application for a walkthrough.
C#
The C# SDK targets .NET Standard 2.1 for Unity 6.5 and later, works on any .NET runtime
with System.Net.WebSockets, and is distributed as the Unity package org.openrois.sdk
(Git URL install until it is listed on a registry).
RoISClient exposes the same operations as the TypeScript client as async methods, and
raises EventReceived, CommandCompleted, ErrorNotified, ProfileChanged, and Closed
as C# events. Callbacks are marshaled to the SynchronizationContext captured when
ConnectAsync is called, which on Unity's main thread means they may touch scene objects
directly. ClientOptions.Token presents a bearer token when the gateway authenticates.
var client = await RoISClient.ConnectAsync("ws://localhost:8765");
var nav = (await client.SearchAsync()).Find(r => r.Contains("Navigation"));
client.EventReceived += e => Debug.Log(e.EventType);
await client.SubscribeAsync(nav, "reached_target");
await client.BindAsync(nav);
var executed = await client.ExecuteAsync(nav);
| RoIS interface | Methods |
|---|---|
| System | ConnectAsync(), DisconnectAsync(), GetProfileAsync(), GetErrorDetailAsync() |
| Command | SearchAsync(), BindAsync(), BindAnyAsync(), ReleaseAsync(), GetParameterAsync(), SetParameterAsync(), ExecuteAsync(), GetCommandResultAsync() |
| Query | QueryAsync() |
| Event | SubscribeAsync(), UnsubscribeAsync(), GetEventDetailAsync() |
| Streaming | ConnectStreamAsync(), DisconnectStreamAsync(), SuspendStreamAsync(), ResumeStreamAsync(), QueryStreamStatusAsync() |
The client is verified outside the Unity editor by a plain .NET test project against an in-process fake gateway. WebGL builds need a browser transport, which is planned.
Python
The Python packages are the building blocks for everything that runs next to a platform.
| Package | Main API | Purpose |
|---|---|---|
openrois-core | Engine, WsServer, WsClient, read_profile, component_config | Run a gateway or an adapter |
openrois-components-core | @component, @query, @invoke, @subscribe, meta_from_decorators, results | Write components |
openrois-interfaces | Result, ReturnCode, InvokeResponse, typed component models | RoIS types, the source of truth |
See write components and adapters for a walkthrough.