DocsHarness SDK

BEEOS CLOUD / DEVELOPER REFERENCE

Agent Gateway client

Signed requests to Agent Gateway: files, canvas tokens, agents, channels, A2A, events, connectors and automations.

AgentGatewayClient signs every request with the harness key, re-signs on each retry, and retries only calls that are safe to replay. Resources hang off the client as namespaces such as files and a2a.

AgentGatewayClient

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Client for Agent Gateway. It signs every request with the harness identity, only talks to one origin, retries transient failures of idempotent calls, and groups the routes into resources (files, canvas, agents, channels, a2a, events, bridge, connectors, automations, runtime).

class AgentGatewayClient
new AgentGatewayClient(readonly options: AgentGatewayClientOptions)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
optionsAgentGatewayClientOptionsyesbaseUrl of Agent Gateway, the signing identity, an optional default retry policy (false disables retries; default TRANSIENT_BACKOFF) and an optional onRetry callback.

Python · Constructor

ParameterTypeRequiredDefaultDescription
base_urlstryesBase URL of Agent Gateway. It must be http or https without user information.
keysAgentKeyPairyesThe harness key pair that signs the request.
clienthttpx.AsyncClient | NonenoNoneOptional httpx.AsyncClient to send requests with; a temporary client is used when omitted.
timeoutfloatno30.0Timeout in seconds.
retryBackoffPolicy | NonenoTRANSIENT_BACKOFFDefault retry policy for idempotent calls; None disables retries.
on_retryCallable[[str, str, int, int, BaseException], None] | NonenoNoneCalled before every retry wait with the method, path, attempt number, delay in milliseconds and error.

Properties

NameTypeDescription
readonly baseUrlURLThe gateway origin that requests are sent to.
readonly filesGatewayFilesFile calls: list, presign, confirm, resolve, upload and download.
readonly canvasGatewayCanvasCanvas calls: create a canvas token and build the relay headers.
readonly agentsGatewayAgentsAgent calls: synchronise the agent projection and report its template origin.
readonly channelsGatewayChannelsChannel calls: create a channel.
readonly a2aGatewayA2aAgent-to-agent calls: discover agents, send JSON-RPC requests and complete tasks.
readonly eventsGatewayEventsEvent calls: publish an agent event.
readonly bridgeGatewayBridgeBridge calls: read the bridge configuration.
readonly connectorsGatewayConnectorsConnector calls: pass requests through to the connector MCP endpoint.
readonly automationsGatewayAutomationsAutomation calls: list, create, get and run automations and read their runs.
readonly runtimeGatewayRuntimeRuntime calls: register, heartbeat and redeem operation resources.

fetch

Sends a signed request. Network errors and the statuses 408, 425, 429, 500, 502, 503 and 504 are retried for GET and HEAD calls, for calls marked idempotent, and when a retry policy is given for the call. When retries are used up, the last answer is returned.

async fetch(target: string | URL, init: GatewayRequestInit = {}): Promise<Response>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
targetstring | URLyesPath starting with /, or an absolute URL on the gateway origin.
initGatewayRequestInitno{}Standard fetch options (a body must be a string or Uint8Array) plus retry and idempotent.

Returns Promise<Response>

Python · Parameters

ParameterTypeRequiredDefaultDescription
methodstryesHTTP method.
pathstryesRequest path.
bodyAnynoNoneRequest body of the call, as JSON-compatible data.
headersMapping[str, str] | NonenoNoneAdditional request headers.
retryBackoffPolicy | None | objectno_UNSETRetry policy for this call. Leave it unset to use the client default; None disables retries; an explicit policy also allows retrying a non-GET call.
idempotentboolnoFalseTrue allows retrying a non-GET call that the gateway deduplicates.
timeoutfloat | NonenoNoneTimeout in seconds.

Returns httpx.Response

json

Sends a signed JSON request and returns the decoded answer. Throws CloudHttpError for any non-2xx answer.

async json<T>(method: string, path: string, body?: unknown, init: GatewayRequestInit = {}): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
methodstringyesHTTP method.
pathstringyesRequest path.
bodyunknownnoRequest body of the call, as JSON-compatible data.
initGatewayRequestInitno{}Per-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
methodstryesHTTP method.
pathstryesRequest path.
bodyAnynoNoneRequest body of the call, as JSON-compatible data.
**kwargsAnyyesSame options as fetch: headers, retry, idempotent and timeout.

Returns Any

upgradeHeaders

TypeScript only

Builds the four X-Agent-* headers for a request that you send yourself, such as the canvas relay WebSocket upgrade.

upgradeHeaders(method: string, path: string, body?: string | Uint8Array | null): Record<string, string>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
methodstringyesHTTP method.
pathstringyesRequest path.
bodystring | Uint8Array | nullnoRequest body of the call, as JSON-compatible data.

Returns Record<string, string>

asFetch

TypeScript only

Returns a fetch-style function bound to this client, for components that only need a signed transport.

asFetch(): (url: string | URL, init?: RequestInit) => Promise<Response>

TypeScript · Parameters

No parameters.

Returns (url: string \| URL, init?: RequestInit) => Promise<Response>

aclose

Python only

Closes the underlying HTTP client.

async def aclose() -> None

Python · Parameters

No parameters.

Returns None

bytes

Python only

Sends a signed request and returns the answer as raw bytes.

async def bytes(method: str, path: str, body: Any = None, **kwargs: Any) -> bytes

Python · Parameters

ParameterTypeRequiredDefaultDescription
methodstryesHTTP method.
pathstryesRequest path.
bodyAnynoNoneRequest body of the call, as JSON-compatible data.
**kwargsAnyyesSame options as fetch: headers, retry, idempotent and timeout.

Returns bytes

fetch_sync

Python only

Blocking signed request without retries, for thread-based hosts such as a local HTTP handler.

def fetch_sync(method: str, path: str, *, body: bytes | None = None, headers: Mapping[str, str] | None = None, timeout: float = 60.0) -> httpx.Response

Python · Parameters

ParameterTypeRequiredDefaultDescription
methodstryesHTTP method.
pathstryesRequest path.
bodybytes | NonenoNoneRequest body of the call, as JSON-compatible data.
headersMapping[str, str] | NonenoNoneAdditional request headers.
timeoutfloatno60.0Timeout in seconds.

Returns httpx.Response

GatewayA2a

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Agent-to-agent calls through the gateway.

class GatewayA2a
new GatewayA2a(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

discover

Searches for agents that can be called. limit defaults to 50.

async discover(input: { query?: string; limit?: number }, init?: GatewayRequestInit): Promise<Record<string, unknown>>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
input{ query?: string; limit?: number }yesquery text to search for and limit, the maximum number of results.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<Record<string, unknown>>

Python · Parameters

ParameterTypeRequiredDefaultDescription
querystr | NonenoNoneText to search for; None lists agents without a filter.
limitintno50Maximum number of results. Defaults to 50.

Returns Any

rpc

Sends a JSON-RPC request to a peer agent. It does not throw on an HTTP or RPC error: inspect ok, status and body of the result.

async rpc(agentId: string, method: string, params: Record<string, unknown>, init?: GatewayRequestInit & { requestId?: string }): Promise<GatewayA2aRpcResult>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
agentIdstringyesIdentifier of the peer agent.
methodstringyesHTTP method.
paramsRecord<string, unknown>yesParameters of the JSON-RPC call.
initGatewayRequestInit & { requestId?: string }noPer-call options plus an optional requestId for the JSON-RPC id.

Returns Promise<GatewayA2aRpcResult>

Python · Parameters

ParameterTypeRequiredDefaultDescription
agent_idstryesIdentifier of the peer agent.
methodstryesHTTP method.
paramsMapping[str, Any]yesParameters of the JSON-RPC call.
request_idstr | NonenoNoneValue of the JSON-RPC id; generated when omitted.

Returns dict[str, Any]

completeTask / complete_task

Reports the outcome of an agent-to-agent task.

async completeTask(taskId: string, input: { result: string; error: string }, init?: GatewayRequestInit): Promise<void>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
taskIdstringyesIdentifier of the task.
input{ result: string; error: string }yesresult text and error text of the task.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<void>

Python · Parameters

ParameterTypeRequiredDefaultDescription
task_idstryesIdentifier of the task.
resultstryesResult text of the task.
errorstryesError text of the task; empty when it succeeded.

Returns None

GatewayAgents

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Agent calls through the gateway.

class GatewayAgents
new GatewayAgents(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

sync

Sends the agent projection to Cloud. You provide the exact JSON body, because that body is signed.

async sync<T = Record<string, unknown>>(body: string | object, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
bodystring | objectyesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodyMapping[str, Any] | stryesRequest body of the call, as JSON-compatible data.

Returns Any

reportTemplateOrigin / report_template_origin

Reports the template that an agent was created from, once agent.applyTemplate has been durably applied.

async reportTemplateOrigin(platformAgentId: string, templateId: string, init?: GatewayRequestInit): Promise<void>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
platformAgentIdstringyesIdentifier of the agent that was created from the template.
templateIdstringyesIdentifier of the template.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<void>

Python · Parameters

ParameterTypeRequiredDefaultDescription
platform_agent_idstryesIdentifier of the agent that was created from the template.
template_idstryesIdentifier of the template.

Returns None

GatewayAutomations

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Automation calls through the gateway. Answers are returned as the gateway sent them; unwrap a data envelope yourself.

class GatewayAutomations
new GatewayAutomations(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

list

Lists automations.

async list<T = unknown>(query?: Record<string, string | number | undefined>, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
queryRecord<string, string | number | undefined>noQuery parameters; entries that are undefined or empty are left out.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
queryMapping[str, Any] | NonenoNoneQuery parameters; entries that are undefined or empty are left out.

Returns Any

create

Creates an automation.

async create<T = unknown>(body: Record<string, unknown>, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
bodyRecord<string, unknown>yesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.

Returns Any

createWebhook / create_webhook

Creates a webhook for automations.

async createWebhook<T = unknown>(body: Record<string, unknown>, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
bodyRecord<string, unknown>yesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.

Returns Any

get

Reads one automation.

async get<T = unknown>(automationId: string, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
automationIdstringyesIdentifier of the automation.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
automation_idstryesIdentifier of the automation.

Returns Any

run

Starts a run of an automation. The idempotency key makes a repeated call return the same run.

async run<T = unknown>(automationId: string, body: Record<string, unknown>, idempotencyKey: string, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
automationIdstringyesIdentifier of the automation.
bodyRecord<string, unknown>yesRequest body of the call, as JSON-compatible data.
idempotencyKeystringyesIdempotency key, sent as Idempotency-Key.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
automation_idstryesIdentifier of the automation.
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.
idempotency_keystryesIdempotency key, sent as Idempotency-Key.

Returns Any

runs

Lists the runs of an automation.

async runs<T = unknown>(automationId: string, query?: Record<string, string | number | undefined>, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
automationIdstringyesIdentifier of the automation.
queryRecord<string, string | number | undefined>noQuery parameters; entries that are undefined or empty are left out.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
automation_idstryesIdentifier of the automation.
queryMapping[str, Any] | NonenoNoneQuery parameters; entries that are undefined or empty are left out.

Returns Any

runDetail / run_detail

Reads one run of an automation.

async runDetail<T = unknown>(automationId: string, runId: string, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
automationIdstringyesIdentifier of the automation.
runIdstringyesIdentifier of the run.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
automation_idstryesIdentifier of the automation.
run_idstryesIdentifier of the run.

Returns Any

GatewayBridge

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Bridge calls through the gateway.

class GatewayBridge
new GatewayBridge(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

config

Reads the bridge configuration. Returns undefined (None in Python) when the gateway cannot be reached, so you can fall back to a cached value.

async config(region?: string, init?: GatewayRequestInit): Promise<GatewayBridgeConfig | undefined>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
regionstringnoRegion to ask for; omitted for the default.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<GatewayBridgeConfig | undefined>

Python · Parameters

ParameterTypeRequiredDefaultDescription
regionstr | NonenoNoneRegion to ask for; omitted for the default.

Returns dict[str, str] \| None

GatewayCanvas

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Canvas calls through the gateway.

class GatewayCanvas
new GatewayCanvas(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

token

Creates a canvas connection token and returns it with the relay URL and expiry. The token is not bound to one agent; the association travels with each canvas message.

async token(init?: GatewayRequestInit): Promise<GatewayCanvasToken>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<GatewayCanvasToken>

Python · Parameters

No parameters.

Returns dict[str, Any]

relayHeaders / relay_headers

Builds the signed headers for the GET /ws/agent WebSocket upgrade on the relay origin returned with the token.

relayHeaders(path = "/ws/agent"): Record<string, string>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
pathstringno"/ws/agent"Request path.

Returns Record<string, string>

Python · Parameters

ParameterTypeRequiredDefaultDescription
pathstrno'/ws/agent'Request path.

Returns dict[str, str]

GatewayChannels

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Channel calls through the gateway.

class GatewayChannels
new GatewayChannels(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

create

Creates a channel and returns its id.

async create(input: { participants: string[]; metadata: Record<string, string> }, init?: GatewayRequestInit): Promise<{ id?: string }>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
input{ participants: string[]; metadata: Record<string, string> }yesparticipants (identifiers) and metadata (string pairs) of the channel.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<{ id?: string }>

Python · Parameters

ParameterTypeRequiredDefaultDescription
participantslist[str]yesIdentifiers of the participants.
metadataMapping[str, str]yesMetadata of the channel as string pairs.

Returns dict[str, Any]

GatewayConnectors

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Connector calls through the gateway.

class GatewayConnectors
new GatewayConnectors(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

mcp

Passes a signed request through to the connector MCP endpoint. A streaming body is returned unread.

async mcp(init: GatewayRequestInit): Promise<Response>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
initGatewayRequestInityesRequest options: method, headers and body; retries are off unless you set them.

Returns Promise<Response>

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodybytesyesRequest body of the call, as JSON-compatible data.
headersMapping[str, str] | NonenoNoneAdditional request headers.

Returns httpx.Response

callJson / call_json

Sends one JSON-RPC request (for example tools/call) and returns the JSON answer. Throws CloudHttpError for a non-2xx answer.

async callJson<T = unknown>(rpc: Record<string, unknown>, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
rpcRecord<string, unknown>yesThe JSON-RPC request, for example a tools/call.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<T>

Python · Parameters

ParameterTypeRequiredDefaultDescription
rpcMapping[str, Any]yesThe JSON-RPC request, for example a tools/call.

Returns Any

mcp_sync

Python only

Blocking variant of mcp for thread-based hosts. It is not retried.

def mcp_sync(body: bytes, headers: Mapping[str, str] | None = None, timeout: float = 60.0) -> httpx.Response

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodybytesyesRequest body of the call, as JSON-compatible data.
headersMapping[str, str] | NonenoNoneAdditional request headers.
timeoutfloatno60.0Timeout in seconds.

Returns httpx.Response

GatewayEvents

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Event calls through the gateway.

class GatewayEvents
new GatewayEvents(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

publish

Publishes an agent event.

async publish(event: { type: string; data: unknown }, init?: GatewayRequestInit): Promise<void>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
event{ type: string; data: unknown }yesThe event: its type and data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<void>

Python · Parameters

ParameterTypeRequiredDefaultDescription
event_typestryesType of the event.
dataAnyyesData of the event.

Returns None

GatewayFiles

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

File calls through the gateway.

class GatewayFiles
new GatewayFiles(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

list

Lists the files of the agent.

async list(init?: GatewayRequestInit): Promise<{ files?: GatewayFileRef[] }>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<{ files?: GatewayFileRef[] }>

Python · Parameters

No parameters.

Returns dict[str, Any]

presign

Requests an upload URL for a new file and returns it with the file id.

async presign(input: { fileName: string; mimeType: string }, init?: GatewayRequestInit): Promise<GatewayPresign>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
input{ fileName: string; mimeType: string }yesfileName and mimeType of the file.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<GatewayPresign>

Python · Parameters

ParameterTypeRequiredDefaultDescription
file_namestryesName of the file.
mime_typestryesMIME type of the file.

Returns dict[str, Any]

confirm

Confirms that the file was uploaded and returns its reference.

async confirm(input: { fileId: string }, init?: GatewayRequestInit): Promise<GatewayFileRef>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
input{ fileId: string }yesfileId of the uploaded file.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<GatewayFileRef>

Python · Parameters

ParameterTypeRequiredDefaultDescription
file_idstryesIdentifier of the file.

Returns dict[str, Any]

resolve

Resolves a file id into its details, including a download URL.

async resolve(fileId: string, init?: GatewayRequestInit): Promise<GatewayFileResolve>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
fileIdstringyesIdentifier of the file.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent.

Returns Promise<GatewayFileResolve>

Python · Parameters

ParameterTypeRequiredDefaultDescription
file_idstryesIdentifier of the file.

Returns dict[str, Any]

upload

Uploads a file in one call: presign, PUT the bytes, then confirm. A single caller-owned signal covers all three steps.

async upload(input: { fileName: string; mimeType: string; data: Uint8Array; signal?: AbortSignal }, fetchImpl: typeof fetch = fetch): Promise<GatewayUploadedFile>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
input{ fileName: string; mimeType: string; data: Uint8Array; signal?: AbortSignal }yesfileName, mimeType, the data bytes and an optional signal that covers the whole upload.
fetchImpltypeof fetchnofetchReplacement for the global fetch that performs the upload PUT.

Returns Promise<GatewayUploadedFile>

Python · Parameters

ParameterTypeRequiredDefaultDescription
file_namestryesName of the file.
mime_typestryesMIME type of the file.
databytesyesContent of the file.

Returns dict[str, Any]

download

Downloads the bytes of a presigned URL returned by resolve. No gateway signature is attached.

async download(downloadUrl: string, signal?: AbortSignal, fetchImpl: typeof fetch = fetch): Promise<Uint8Array>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
downloadUrlstringyesDownload URL that resolve returned.
signalAbortSignalnoAborting this signal cancels the call.
fetchImpltypeof fetchnofetchReplacement for the global fetch that performs the download.

Returns Promise<Uint8Array>

Python · Parameters

ParameterTypeRequiredDefaultDescription
download_urlstryesDownload URL that resolve returned.

Returns bytes

GatewayRuntime

TypeScript @beeos-ai/cloud-harness-sdk · Python beeos_cloud_harness_sdk.gateway

Runtime calls through the gateway. register and heartbeat (in Python register_runtime and heartbeat_runtime) can serve as the registration transport.

class GatewayRuntime
new GatewayRuntime(readonly gw: AgentGatewayClient)

TypeScript · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

Python · Constructor

ParameterTypeRequiredDefaultDescription
gwAgentGatewayClientyesThe gateway client that sends the requests.

register

TypeScript only

Sends the registration request and returns the decoded answer. It is never retried here; the coordinator owns retrying.

async register<T = unknown>(body: unknown, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
bodyunknownyesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent. Retries are off by default.

Returns Promise<T>

heartbeat

TypeScript only

Sends a heartbeat for a registration. It is never retried here; the coordinator owns retrying.

async heartbeat<T = unknown>(registrationId: string, body: unknown, init?: GatewayRequestInit): Promise<T>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
registrationIdstringyesIdentifier of the registration.
bodyunknownyesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent. Retries are off by default.

Returns Promise<T>

redeemResource / redeem_resource

Redeems a resource of an operation and returns the raw Response, so you can verify digests and map failures yourself.

async redeemResource(operationId: string, kind: "skill" | "mcp", resourceRef: string, body: unknown, init?: GatewayRequestInit): Promise<Response>

TypeScript · Parameters

ParameterTypeRequiredDefaultDescription
operationIdstringyesIdentifier of the operation.
kind"skill" | "mcp"yesKind of resource: skill or mcp.
resourceRefstringyesReference of the resource that is redeemed.
bodyunknownyesRequest body of the call, as JSON-compatible data.
initGatewayRequestInitnoPer-call options: fetch options plus retry and idempotent. Retries are off by default.

Returns Promise<Response>

Python · Parameters

ParameterTypeRequiredDefaultDescription
operation_idstryesIdentifier of the operation.
kindstryesKind of resource: skill or mcp.
resource_refstryesReference of the resource that is redeemed.
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.
timeoutfloatno120.0Timeout in seconds.

Returns httpx.Response

register_runtime

Python only

Sends the registration request and returns the decoded JSON answer.

async def register_runtime(body: Mapping[str, Any]) -> Any

Python · Parameters

ParameterTypeRequiredDefaultDescription
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.

Returns Any

heartbeat_runtime

Python only

Sends a heartbeat for a registration and returns the decoded JSON answer.

async def heartbeat_runtime(registration_id: str, body: Mapping[str, Any]) -> Any

Python · Parameters

ParameterTypeRequiredDefaultDescription
registration_idstryesIdentifier of the registration.
bodyMapping[str, Any]yesRequest body of the call, as JSON-compatible data.

Returns Any