Reference

Client

Typed RPC from the frontend to backend methods, with streaming.
import { createClient } from '@mindstudio-ai/interface';

The frontend calls the backend the way it would call a local async function. createClient returns a typed proxy where every property is one of the app's backend methods, addressed by its camelCase export name. Calling it issues the request, resolves with the method's return value, and throws on failure. There is no route to name, no fetch to write, and no request or response type to keep in sync: both sides live in one project and share the method's own types.

Two things extend the plain call. A method that runs for more than a moment can stream. The same call takes a second InvokeOptions argument: onToken receives the growing text of a language-model response, and onStreamData receives the structured progress a method emits as it works. Any call can also fail: a rejection arrives as a MindStudioInterfaceError, and its code, the value an error boundary or a retry reads, names the cause. File uploads, agent chat, and voice are their own namespaces; this is the workhorse every screen is built on.

3 entries
Methods 1
Types 2