Skip to content

Conversation

gspencergoog
Copy link
Collaborator

@gspencergoog gspencergoog commented Oct 17, 2025

Description

This is a Genkit server that serves A2UI protocol. Now, it's not an A2A server, so that's kind of weird, but it's a start.

Summary of Changes

This pull request establishes the foundational a2ui_server package, a critical server-side component for the GenUI framework. It integrates the Genkit framework to enable dynamic UI generation by an LLM, which processes conversation history and a client's widget catalog to produce real-time UI updates. The server specifically implements the A2UI protocol, translating LLM-generated tool calls into a stream of UI modification messages for the client. This initial setup provides a robust, scalable, and well-documented backend for interactive, AI-driven user interfaces.

Highlights

  • New a2ui_server Package: Introduces a new server-side component for the GenUI framework, built with Genkit.
  • Dynamic UI Generation: Leverages an LLM to dynamically generate UI definitions based on conversation history and a client-provided widget catalog.
  • A2UI Protocol Implementation: Serves the A2UI protocol, transforming LLM tool calls into specific UI modification messages (surfaceUpdate, beginRendering, deleteSurface).
  • Streaming generateUiFlow: Implements a streaming Genkit flow (generateUiFlow) for real-time UI updates.
  • Comprehensive Documentation: Includes detailed IMPLEMENTATION.md and README.md files covering architecture, API, and usage.
  • Developer Tooling: Sets up ESLint for code quality, Jest for testing, and Pino for structured logging.
Changelog
  • packages/spikes/a2ui_server/.gitignore
    • Added a new .gitignore file for the a2ui_server package, ignoring common build artifacts and dependencies.
  • packages/spikes/a2ui_server/IMPLEMENTATION.md
    • Added a detailed implementation document outlining the purpose, architecture, schemas, API design, data flow, and logging for the a2ui_server.
  • packages/spikes/a2ui_server/README.md
    • Added a comprehensive README file for the a2ui_server, including prerequisites, installation, running instructions, logging configuration, and API details.
  • packages/spikes/a2ui_server/eslint.config.mjs
    • Added ESLint configuration for the TypeScript project, enforcing code style and best practices.
  • packages/spikes/a2ui_server/jest.config.js
    • Added Jest configuration for unit testing the TypeScript codebase.
  • packages/spikes/a2ui_server/package.json
    • Added the package manifest, defining project metadata, scripts for development and deployment, and listing all necessary dependencies and devDependencies for the Genkit server.
  • packages/spikes/a2ui_server/pnpm-workspace.yaml
    • Added pnpm workspace configuration to manage dependencies within the monorepo.
  • packages/spikes/a2ui_server/src/generate.ts
    • Implemented the core generateUiFlow logic, including defining UI-related tools (updateSurface, deleteSurface), dynamically generating system prompts based on the widget catalog, transforming client conversation messages into an LLM-compatible format, and streaming A2UI protocol responses.
  • packages/spikes/a2ui_server/src/genkit.ts
    • Configured the Genkit environment, integrating the Google AI plugin and specifying the gemini-1.5-flash model.
  • packages/spikes/a2ui_server/src/index.ts
    • Established the entry point for the Genkit flow server, starting the generateUiFlow.
  • packages/spikes/a2ui_server/src/logger.ts
    • Set up a Pino-based logger for structured logging, with configurable levels and development-friendly pretty printing.
  • packages/spikes/a2ui_server/src/schemas.ts
    • Defined Zod schemas for validating client requests, including a recursive JSON schema for the widget catalog and detailed schemas for various conversation message parts (text, image, UI event, UI definition).
  • packages/spikes/a2ui_server/src/test/generate.test.ts
    • Added unit tests for the generateUiFlow, covering input validation, conversation mapping, tool call transformation, and response handling.
  • packages/spikes/a2ui_server/test_server.sh
    • Added a utility script to facilitate testing the server's startSession endpoint with a predefined widget catalog.

@gspencergoog gspencergoog changed the title Move a2a_client, add a2a_server Add a2a_server Oct 17, 2025
@gspencergoog gspencergoog changed the title Add a2a_server Add a2a_server Oct 17, 2025
@gspencergoog gspencergoog changed the title Add a2a_server Add a2ui_server Oct 17, 2025
@flutter flutter deleted a comment from gemini-code-assist bot Oct 17, 2025
@flutter flutter deleted a comment from gemini-code-assist bot Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant