Skip to main content
rpc(options?): {(value, context): void; <V>(value, context): (initial) => V; }
Mark a method (or a function-valued class field) as remote-callable. Only decorated members dispatch over the agent socket; reserved names — the lifecycle hooks (constructor/alarm/fetch/webSocket), the connection seams (authorize/onAttach/onConnect), and _-prefixed names — remain non-dispatchable even if decorated, and an undecorated override of a decorated base method is not dispatchable. The optional metadata is introspectable via rpcSurface, so a caller can discover what an agent exposes remotely. Parameters Returns {(value, context): void; <V>(value, context): (initial) => V; } Example

RpcOptions

Metadata attached to a remote-callable method via @rpc(). Properties description?
readonly optional description?: string
Human-readable summary of what the method does.