Bindu
Bindu copied to clipboard
Feature - add AG-UI bridge
π Describe your changes clearly
This pull request introduces the initial implementation of the Bindu AG-UI Bridge service, which translates AG-UI protocol events to Bindu A2A JSON-RPC calls and streams results back to the frontend using Server-Sent Events (SSE). The changes include project setup, configuration, API route handlers, event definitions, and utilities for communication with the Bindu agent.
Core Bridge Implementation:
- Added a Bun + Hono-based service entry point in
src/index.ts, including middleware setup, root endpoint, and route mounting for/healthand/agui/*APIs. - Implemented the main AG-UI run handler in
src/handlers/run.ts, which processes run requests, communicates with Bindu, polls for task state, and streams AG-UI events via SSE. - Created a Bindu JSON-RPC client in
src/clients/bindu.tsto send messages, poll tasks, and check agent health, with error handling and request timeouts.
Event System and Utilities:
- Defined AG-UI event types and Bindu task states in
src/events/types.ts, and implemented an event builder for consistent event formatting insrc/events/builder.ts. [1] [2] - Added SSE response utilities for formatting and streaming events in
src/events/sse.ts.
Project Setup and Documentation:
- Added
package.jsonwith Bun, TypeScript, and Hono dependencies, and a.gitignorefor node_modules. [1] [2] - Provided a comprehensive
README.mdwith overview, quick start, API documentation, configuration, event mapping, and project structure. - Implemented environment-based configuration with sensible defaults in
src/config.ts.
β Checklist clearly
- [X] I've tested my changes thoroughly.
- [X] I've followed the project's style and linting rules.
- [ ] I've updated documentation (if required).
π Related issue clearly
Link related issues, if applicable: #123
Hi @Shivansh-Khunger, letβs discuss this on Discord first and align on the approach.