$ show streem/pbandk
pbandk is a Kotlin Multiplatform library and code generator for Protocol Buffers. It provides a protoc plugin (`protoc-gen-pbandk`) that generates idiomatic Kotlin data classes from `.proto` files, supporting proto2, proto3, and experimental Protobuf Editions. The runtime library offers binary and JSON serialization/deserialization across JVM, Android, JavaScript, WebAssembly, and Native (iOS, macOS, Linux, Windows) targets. The architecture is a classic protobuf toolchain: `.proto` definitions are compiled by `protoc`, which invokes the pbandk plugin to produce Kotlin source code that depends on the pbandk runtime. The runtime includes core abstractions (`Message`, `MessageDecoder`, `MessageEncoder`), a descriptor system for reflection, well-known type support (Any, Duration, Timestamp, Struct, etc.), and configurable JSON encoding. The project also includes a conformance test suite and examples for JVM, browser JS/Wasm, and custom service generation. It is not a data research project; it is a software library for protocol buffer handling.
The LLM identified 5 files worth highlighting for reuse:
A specialized list implementation that caches the serialized protobuf size of its elements, avoiding recomputation during encoding. It provides a Builder for efficient mutation during decoding and is used for repeated fields. This pattern is reusable in any protobuf library or performance-sensitive serialization context.
A map implementation tailored for protobuf map fields, where each entry is a sub-message. It provides a Builder for decoding and supports efficient merging. The pattern demonstrates how to handle map fields with custom entry types and can be extracted for other protobuf libraries.
A registry for resolving protobuf message types by URL, used for packing/unpacking `google.protobuf.Any`. It provides a builder DSL and supports both static and dynamic registration. This pattern is reusable in any system that needs to resolve types at runtime for serialization.
An interface for custom service code generation, allowing users to generate gRPC or other RPC stubs from protobuf service definitions. It is a clean extension point that decouples service generation from message generation. This pattern is reusable in any protobuf code generator that wants to support pluggable service generation.
A utility class that generates unique Kotlin identifiers from protobuf field and type names, handling collisions with Kotlin built-in names (e.g., `Boolean_`, `List_`). It also manages package names and import resolution. This pattern is reusable in any code generator that needs to produce valid Kotlin identifiers.