Proto
Reference
Proto
Ubo App uses Protocol Buffers for the gRPC API and for serializing store actions and events. Proto definitions live under ubo_app/rpc/proto/; Python bindings are generated into ubo_app/rpc/ubo_bindings/.
What you see
- Hand-written protos (
ubo_app/rpc/proto/): - store/v1/store.proto —
StoreService:DispatchAction,DispatchEvent,SubscribeEvent,SubscribeStore. Messages:DispatchActionRequest/Response,SubscribeEventRequest/Response, etc. Usesubo/v1/ubo.protofor the action/event oneofs. - secrets/v1/secrets.proto — Secrets service RPCs.
- package_info/v1/package_info.proto — Package info.
- buf.yaml — Buf lint/format config.
- Generated from Python — The
ActionandEventoneofs inubo/v1/ubo.protoare generated from the store’s Python action and event classes byubo_app/rpc/generator/generate_proto.py. Runuv run poe proto:generate(orpoe proto) to regenerate after changing actions/events. The generator parses the Python modules and writes message definitions; thenproto:compilecompiles all protos withgrpc_tools.protocand betterproto intoubo_bindings/. - Usage — The gRPC server (
ubo_app/rpc/server.py,store_service.py) converts between proto messages and Python action/event objects (seemessage_to_object.py,object_to_message.py). Clients use the same protos; sample clients: ubo-grpc-clients. The web app runsnpm run proto:compileto generate TypeScript types from the same protos. - Lint —
poe proto:lintrunsbuf format -won the proto directory.