API reference

The reference below lists the implemented server-brain, customer-device, and shared runtime exports from @tabworker/sdk. It does not describe proposed routes or unpublished protocol resources.

Classes

TabWorkerBrainHttpClient
Trusted server-only client with createPairing, importWork, getWork, and cancelWork.
TabWorkerBrainHttpError
Server-client error containing HTTP status, bounded Core code, and retryable.
TabWorkerNodeClient
Stateful single-work lifecycle client. Constructor accepts { descriptor, transport }.
HandlerWrapperNodeTransport
Implements WrapperNodeTransport by delegating each operation to a typed callback.
InMemoryWrapperNodeTransport
Local test transport with recorded calls and completions.
NodeSdkError
Error containing code, operation, retryable, and optional cause.
TabWorkerNodeHttpTransport
Persistent Core HTTP adapter with in-memory node credentials and one refresh retry after a 401.
BrainRuntime
Durable pinned/pool assignment coordinator over an injected wire transport.
BodyRuntime
Customer-PC lifecycle runner with local authorization, executor registry, heartbeat, progress, proof, reconnect, cancel, and revoke.
BodyExecutorRegistry
Maps one namespaced capability to one wrapper-owned executor.
PolicyEnforcedBrowserDriver
Applies explicit browser action policy before delegating to an injected driver.
CdpBrowserDriver
Small adapter over an injected CDP command transport; it does not launch Chrome or store credentials.

Server-brain methods

MethodApplication scopeReturns
createPairing(input)node:pairings:writeA one-time pairing code and expiry.
importWork(input)node:work:writeThe imported work ID.
getWork(workId)node:work:readA bounded status/result projection.
cancelWork(input)node:work:writeThe cancelled work projection and replay flag.

The Brain client requires a trusted server runtime and rejects browser construction. Payloads default to a 256 KiB ceiling, reject secret-shaped fields, and allow only opaque local: secret references. Its application key is separate from every customer Node credential.

Transport interface

WrapperNodeTransport defines typed callbacks for connect, pair, receivePinnedWork, claimPinnedWork, authorize, start, heartbeat, progress, complete, cancel, and disconnect.

WrapperNodeTransportHandlers is the corresponding callback object accepted by HandlerWrapperNodeTransport.

Core types

ExportPurpose
NodeDescriptorNode ID, application, environment, optional label/metadata, and capabilities.
NodeCapabilityNamespaced capability name and version.
PinnedWorkItemWork ID, revision, capability, summary, and JSON input.
ClaimedWorkTransport claim ID and the exact pinned item.
LocalAuthorizationAcknowledgementExplicit local authority, consent, time, and opaque reference.
StructuredCompletionJSON result plus ProofReference.
NodeJsonObjectRecursive JSON object alias that does not replace the existing Review Queue JsonObject.

Runtime types

The package root exports WrapperJob, WrapperJobAdapter, BrainDurableState, BrainWireTransport, AssignmentMode, BodySessionConnector, BodyWireSession, BodyExecutor, LocalAuthorizationGate, BodyProofHook, and BodyAuditSink. These are transport and lifecycle seams; none contains product-specific browser instructions.

Brain HTTP types

The package root and @tabworker/sdk/node-runtime export CreateBrainPairingInput, BrainPairingDelivery, ImportBrainWorkInput, ImportBrainWorkResult, BrainWorkProjection, BrainWorkResult, CancelBrainWorkInput, and CancelBrainWorkResult.

Error codes

NodeSdkErrorCode currently includes invalid_descriptor, invalid_capability, invalid_authorization, invalid_input, invalid_state, invalid_progress_sequence, and transport_error.