Chuyển tới nội dung chính

beam_domain

beam_domain is what an API process uses to reach the workers.

beam_domain = { path = "../riverbeam/crates/beam_domain" }

Commands and clients​

ItemRole
BeamDomain<C>Typed commands: invoke, stream, resume
InvokePayload, ResumePayload, StreamAckCommand inputs and the streaming acknowledgement
BeamWorkerClientTrait: request(task, payload), send(task, payload)
NatsWorkerClientconnect(url), connect_with_prefix(url, prefix), new(client, prefix)
LocalWorkerClientnew(Arc<BeamWorker>); no broker
task_subject, encode_ok, encode_err, decode_reply, DEFAULT_TASK_PREFIXThe NATS envelope

Riverbase domain​

ItemRole
BeamDomainBundleA riverbase_core::Domain (namespace flrs.beam): new, with_namespace, with_authorizer
BeamCommandEngineCommands invoke, stream, resume; with_authorizer
BeamQueryEngineQuery resources agent, model, agent_session
Catalog, AgentInfo, ModelInfo, SessionInfoWhat the query engine serves
BEAM_NAMESPACE"flrs.beam"

Authorization​

ItemRole
ActivityAuthorizerTrait: enforce(&ActivityRequest)
BeamPolicyAuthorizerCasbin-style rows: from_csv, enforce_sync; also exported as CasbinActivityAuthorizer
ActivityRequest, DomainActivitySubject plus activity
command_activity, activity_for_command, subject_from_payload, object_from_payloadBuild 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.