Kpa-clawbot
|
0775302c95
|
Add protobuf definitions for all API responses and WebSocket messages
Define .proto files as single source of truth for the API contract.
10 files covering all 40 endpoints from docs/api-spec.md:
proto/common.proto - Pagination, Histogram, RoleCounts, SignalStats
proto/decoded.proto - DecodedResult, DecodedPayload oneof (10 payload types)
proto/packet.proto - Transmission, Observation, GroupedPacket, traces, audio-lab
proto/node.proto - Node, BulkHealth, NodeAnalytics, ResolveHops
proto/observer.proto - Observer, ObserverAnalytics
proto/channel.proto - Channel, ChannelMessage
proto/analytics.proto - RF, Topology, Distance, HashSizes, Subpaths
proto/websocket.proto - WSMessage, WSPacketData
proto/stats.proto - Stats, Health, Perf
proto/config.proto - Theme, Regions, ClientConfig, MapConfig, IataCoords
DRY composition:
- Node defined once (node.proto), reused in 8 response types
- Transmission defined once (packet.proto), reused in 5 response types
- Observation defined once (packet.proto), reused in detail + analytics
- DecodedPayload uses oneof for ADVERT/TXT_MSG/GRP_TXT/ACK/REQ/etc.
- Shared types: Histogram, SignalStats, TimeBucket, RoleCounts
- NodeObserverStats/NodeStats shared across bulk-health, node-health, analytics
All files validated with protoc. proto3 syntax, package meshcore.v1,
go_package github.com/meshcore-analyzer/proto/v1, json_name annotations
where proto3 default camelCase differs from API spec.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-03-27 14:13:59 -07:00 |
|