This reference is currently available in English. The Cloud console remains in your selected language.
BEEOS CLOUD / DEVELOPER REFERENCE
Harness SDK
Register a runtime and handle chat inside an OpenClaw, Hermes, or custom agent
The Harness SDK is published for TypeScript and Python only. TypeScript @beeos-ai/cloud-harness-sdk exports RuntimeRegistrationCoordinator for registration and lease renewal. Python distribution beeos-cloud-harness-sdk is imported as beeos_cloud_harness_sdk and exports BeeOSAgentRuntime. There is no Java, Rust, or Go package. See language setup.
The TypeScript example registers the runtime. The Python example uses Server SDK 2.0.0 from the product backend to call an already registered harness selected by BEEOS_HARNESS_ID from cloud.harnesses.list(). Server SDK 2.0.0 does not provide Python runtime registration or complete_reply; the runtime host still handles those. Keep the bsk_ key on the product backend.
import {
RuntimeRegistrationCoordinator,
type RuntimeRegistrationConfig,
type RuntimeRegistrationTransport,
} from "@beeos-ai/cloud-harness-sdk";
async function startRuntime(
transport: RuntimeRegistrationTransport,
config: RuntimeRegistrationConfig,
onLeaseLost: (reason: "fenced" | "expired" | "heartbeat_failed", cause?: unknown) => void,
) {
const runtime = new RuntimeRegistrationCoordinator(transport, config, onLeaseLost);
await runtime.start();
return runtime;
}Python BeeOSAgentRuntime.register stores handlers and does not open a network listener. The host adapter delivers method calls to runtime.dispatch_runtime_method(method, params). Cloud Responses/chat arrives as session/prompt; dispatch forwards it to on_chat_message when no custom runtime-method handler is registered. The event carries the pre-created replyMessageId; finish that reply with runtime.chat.complete_reply(conversation_id, reply_message_id, text). If you register on_runtime_method, route session/prompt through runtime.dispatch_session_prompt(params) yourself. The separate message-plane adapter delivers envelopes to runtime.consume_envelope(envelope). consume_envelope emits a chat event only when the envelope has a message ID and channel ID. A chat_cancel envelope calls on_chat_cancel.
messages.reply(conversation_id, inbound_message_id, text) is the separate message-plane agent_reply operation; it does not complete the pre-created Cloud chat reply. Call runtime.close() during shutdown; later requests raise runtime_closed. See ports and errors and custom agent guide.