Summary
Generate a TypeScript gRPC client from nexus.proto and publish it as
an npm package. Covers both Node.js server-side usage and browser usage
via gRPC-Web.
Deliverables
sdk/typescript/ — generated stubs + typed wrapper
sdk/typescript/src/client.ts — NexusClient class with full TypeScript types
sdk/typescript/package.json — publishable as @nexus-engine/client
- README with quickstart for Node.js and browser (gRPC-Web)
NexusClient API (proposed)
import { NexusClient } from "@nexus-engine/client";
const client = new NexusClient({ host: "localhost:50051", apiKey: "..." });
// One-shot
const response = await client.query("Refactor the auth module");
console.log(response.content);
// Streaming
for await (const event of client.stream("Write a TypeScript handler")) {
if (event.textChunk) process.stdout.write(event.textChunk.text);
}
// Sessions
const session = await client.createSession();
await session.submit("First message");
Acceptance criteria
Summary
Generate a TypeScript gRPC client from
nexus.protoand publish it asan npm package. Covers both Node.js server-side usage and browser usage
via gRPC-Web.
Deliverables
sdk/typescript/— generated stubs + typed wrappersdk/typescript/src/client.ts—NexusClientclass with full TypeScript typessdk/typescript/package.json— publishable as@nexus-engine/clientNexusClient API (proposed)
Acceptance criteria
sdk/typescript/src/_generated/NexusClientexposes a fully typed async/await + async-iterator APImake sdk-typescriptregenerates stubssdk/typescript/examples/