@enclave-vm/broker package - the orchestration layer for EnclaveJS.
Installation
EnclaveBroker Class
The main broker class for session management and tool orchestration.Constructor
BrokerOptions
Methods
listen(port)
Start the HTTP server.close()
Stop the server and clean up.execute(code, options?)
Execute code and return a stream.getSession(sessionId)
Get session information.submitToolResult(sessionId, callId, result)
Submit a tool call result.HTTP API Endpoints
POST /execute
Execute code with streaming response. Request:GET /sessions/:sessionId
Get session status. Response:POST /sessions/:sessionId/tool-result
Submit tool execution result. Request:GET /health
Health check endpoint. Response:ToolRegistry Class
Registry for managing tools.Constructor
Methods
register(tool)
Register a tool.get(name)
Get a tool by name.list()
List all registered tools.getDocumentation()
Get tool documentation for LLM prompts.RuntimePoolOptions
Authentication
Rate Limiting
Events
BrokerEvents
Complete Example
Related
- Broker Overview - Architecture guide
- @enclave-vm/types - Type definitions
- @enclave-vm/client - Client SDK