octoturge bc4ee8690a Drop proto/bambulab/ — plain hand-written Rust structs instead
Reconsidered after actually feeling the friction: this data is JSON over
MQTT (not binary protobuf), only continuum-proxy ever parses it (raw
vendor wire format, never crosses into TS), so none of protobuf's actual
value (cross-language codegen, binary wire efficiency) applied here.
Every gotcha hit while building this (field_attribute's oneof/variant
path collision, needing .bambulab-scoped type_attribute calls, explicit
#[serde(default)] per not-always-present field) came from forcing
prost-build's codegen model onto a plain-JSON, Rust-only use case.

Verified the replacement is strictly simpler, not just smaller: a
hand-written struct's Option<T> field needs zero extra attributes to
handle a missing JSON key (prost's generated String needed an explicit
field_attribute call per field), and #[serde(flatten)] on a hand-written
field has no ambiguity at all (prost-build's oneof/variant path collision
doesn't exist without prost-build's codegen in the picture).

The replacement lives in continuum-proxy: src/printer/bambu_commands/.
continuum.v1 is unaffected — that schema is genuinely cross-language and
proto still earns its keep there.
2026-08-28 22:48:48 +00:00

continuum-schemas

Single source of truth for the Continuum data model. Protobuf definitions in proto/ are compiled into two consumer packages:

  • packages/ts-types — TypeScript types generated via ts-proto, plus hand-written TypeBox schemas under src/schemas/ used for runtime validation in continuum-backend's ElysiaJS routes.
  • packages/rust-types — a Rust crate (continuum-rust-types) that compiles the same .proto files with prost-build (via build.rs), producing serde-derived structs for continuum-proxy and continuum-ai-worker.

Layout

proto/continuum/v1/       canonical .proto message definitions
packages/ts-types/        TypeBox schemas + generated TS proto types
packages/rust-types/      prost-generated Rust structs (build.rs codegen)

Build

Requires protoc on PATH and npm install run at the repo root first.

npm install
npm run build:ts     # protoc + ts-proto -> packages/ts-types/src/generated
npm run build:rust   # cargo build, runs build.rs -> prost-generated structs
npm run build        # both

Generated TS output under packages/ts-types/src/generated is build-derived and gitignored. The Rust crate's generated code lands in OUT_DIR per standard prost-build conventions and is never committed.

S
Description
Continuum platform: continuum-schemas
Readme 146 KiB
Languages
Rust 61.2%
TypeScript 38.8%