beam_domain
beam_domain is what an API process uses to reach the workers.
beam_domain = { path = "../riverbeam/crates/beam_domain" }
Commands and clients
| Item | Role |
|---|---|
BeamDomain<C> | Typed commands: invoke, stream, resume |
InvokePayload, ResumePayload, StreamAck | Command inputs and the streaming acknowledgement |
BeamWorkerClient | Trait: request(task, payload), send(task, payload) |
NatsWorkerClient | connect(url), connect_with_prefix(url, prefix), new(client, prefix) |
LocalWorkerClient | new(Arc<BeamWorker>); no broker |
task_subject, encode_ok, encode_err, decode_reply, DEFAULT_TASK_PREFIX | The NATS envelope |
Riverbase domain
| Item | Role |
|---|---|
BeamDomainBundle | A riverbase_core::Domain (namespace flrs.beam): new, with_namespace, with_authorizer |
BeamCommandEngine | Commands invoke, stream, resume; with_authorizer |
BeamQueryEngine | Query resources agent, model, agent_session |
Catalog, AgentInfo, ModelInfo, SessionInfo | What the query engine serves |
BEAM_NAMESPACE | "flrs.beam" |
Authorization
| Item | Role |
|---|---|
ActivityAuthorizer | Trait: enforce(&ActivityRequest) |
BeamPolicyAuthorizer | Casbin-style rows: from_csv, enforce_sync; also exported as CasbinActivityAuthorizer |
ActivityRequest, DomainActivity | Subject plus activity |
command_activity, activity_for_command, subject_from_payload, object_from_payload | Build requests from command payloads |
BEAM_POLICY_CSV, build_beam_authorizer() | A demonstration policy; do not use it in production |
BEAM_RESOURCE | "agent" |
There are no feature flags.
How to wire these together, and what to watch for, is in Worker and API.