pid2.718
The revenge of the Codegen
River (the name we're giving the protocol by which the Workspace and pid2 communicate) is heavily inspired by and is a superset of gRPC. River also supports something called "stream with initialization message" to avoid a case of a client-side stream being forced to be a union of an initialization message and a stream message (make invalid states unrepresentable and all that).
This codebase is a way to have some interoperability between gRPC and River's wire format. That way services can be declared using mostly stock gRPC and implemented in another language / binary (e.g. Python) and then their River declarations exported as an npm package and consumed as a client in another codebase. This means that a service can have a single gRPC declaration and implementation with one adapter that can allow it to have a WebSockets River server.
Usage
pnpm i
pnpm build
pnpm release --dry-run # ensure files are correct and we don't leak secrets
pnpm release
to see the Chat codegenned service types in proto/replit/ai/chat/chat.ts
that can be npm-packed and imported from repl-it-web.