Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 68 additions & 35 deletions .gemini/GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,122 @@ This document serves as a guide for using the Gemini agent within the A2UI repos

The A2UI repository is organized into several key directories:

- `specification/v0_8/docs/`: Contains the primary human-readable documentation for the A2UI protocol.
- `a2ui_protocol.md`: The foundational specification document. This is the best place to start to understand the protocol's fundamental goals.
- `specification/v0_8/json/`: Contains the formal JSON schema definitions for the protocol.
- `server_to_client.json`: Defines the schema for messages sent from the server to the client.
- `client_to_server.json`: Defines the schema for event messages sent from the client to the server.
- `a2a_agents/python/`: Contains Python code relating to server-side integration of A2UI
- `a2ui_extension/`: Python implementation of the A2UI A2A extension.
- `adk/samples/`: Contains demo applications that showcase the A2UI protocol in action using the ADK framework.
- `web/`: Contains the web-based client implementations (using Lit and Vite) for the samples, including a shared library (`renderers/lit`).
- `angular/`: Contains an alternative web-based client implementation using Angular.
- `eval/`: Contains a Genkit-based framework for evaluating LLM performance in generating A2UI responses.
- `specification/`: Contains the A2UI protocol specifications.
- `0_8/`: The current protocol version.
- `docs/`: Human-readable documentation.
- `json/`: JSON schema definitions.
- `0_9/`: The next protocol version (in development).
- `docs/`: Human-readable documentation.
- `json/`: JSON schema definitions.
- `eval/`: Genkit-based evaluation framework.
- `samples/`: Contains sample implementations.
- `agent/adk/`: Python-based ADK agent samples (e.g., `contact_lookup`, `restaurant_finder`, `rizzcharts`, `orchestrator`).
- `client/`: Web client implementations.
- `lit/`: Clients using Lit and Vite (e.g., `contact`, `shell`).
- `angular/`: Clients using Angular.
- `mcp/`: MCP server samples (e.g., `flight_booking`).
- `a2a_agents/`: Contains source code for A2A extension integrations.
- `python/a2ui_extension/`: Python implementation of the A2UI A2A extension.
- `java/`: Java implementation of the A2UI A2A extension.
- `renderers/`: Contains renderer libraries.
- `lit/`: The shared Lit renderer library used by the Lit clients.
- `tools/`: Helper tools for development.
- `editor/`: A web-based editor for generating and visualizing A2UI.
- `inspector/`: A web-based inspector for A2UI responses.

## A2UI Specification Overview

The A2UI protocol is a JSONL-based, streaming UI protocol designed to be easily generated by Large Language Models (LLMs). It enables a server to stream a platform-agnostic, abstract UI definition to a client, which then renders it progressively using a native widget set.

### Core Concepts

The core concepts of the A2UI protocol are detailed in the main specification document. Rather than duplicating the content here, you should refer to the authoritative source:
The core concepts of the A2UI protocol are detailed in the main specification document. Refer to the authoritative source for the current version (0.8):

- **A2UI Protocol Specification**: `@docs/a2ui_protocol.md`
- **A2UI Protocol Specification**: `@specification/0_8/docs/a2ui_protocol.md`

This document covers the design philosophy, architecture, data flow, and core concepts of the protocol.

### Schemas

The formal, machine-readable definitions of the protocol are maintained as JSON schemas:
The formal, machine-readable definitions of the protocol are maintained as JSON schemas. For version 0.8:

- **Server-to-Client Schema**: `@specification/v0_8/json/server_to_client.json`
- **Server-to-Client Schema, with standard catalog**: `@specification/v0_8/json/server_to_client_with_standard_catalog.json`
- **Client-to-Server Schema**: `@specification/v0_8/json/client_to_server.json`
- **Server-to-Client Schema**: `@specification/0_8/json/server_to_client.json`
- **Client-to-Server Schema**: `@specification/0_8/json/client_to_server.json`
- **Standard Catalog**: `@specification/0_8/json/standard_catalog_definition.json`

## Running the Demos

There are three demos available in the `a2a_samples/` directory. Each demo has a corresponding web client in the `web/` and `angular/` directories. To run a demo, you will need to start both the server and the client.
The demos are located in the `samples/` directory. Typically, you will need to run both a server (agent) and a client.

### Running a Demo Server
### Running a Demo Server (Python ADK)

To run a demo server, navigate to the demo's directory and run the `__main__.py` script. For example, to run the contact lookup demo:
Navigate to the agent's directory within `samples/agent/adk/` and use `uv` to run it. For example, to run the contact lookup demo:

```bash
cd a2a_samples/a2ui_contact_lookup
python -m __main__
cd samples/agent/adk/contact_lookup
uv run .
```

Ensure you have your environment variables set up (create a `.env` file if necessary, often based on `.env.example`).

### Running a Demo Client (Lit)

To run a demo client, navigate to the corresponding client directory in `web/` and start the development server. For example, to run the contact lookup client:
The Lit clients are located in `samples/client/lit/`.

```bash
cd web/contact
npm install
npm run dev
```
1. **Build the Renderer**:
First, ensure the shared renderer is built:
```bash
cd renderers/lit
npm install
npm run build
```

2. **Run the Client**:
Navigate to the specific client sample (e.g., `contact` or `shell`) and start the dev server:
```bash
cd samples/client/lit/contact
npm install
npm run dev
```

### Running a Demo Client (Angular)

To run a demo client, navigate to the `angular/` directory and start the development server with the project name. For example, to run the contact lookup client:
The Angular clients are located in `samples/client/angular/`.

```bash
cd angular
cd samples/client/angular
npm install
npm start -- contact
npm start -- contact # Replace 'contact' with the desired project name (e.g., restaurant, gallery, rizzcharts)
```

### Running Tools

- **Editor**: Located in `tools/editor`. Run with `npm install && npm run dev`.
- Requires a Gemini API key in `.env` (`GEMINI_API_KEY=<key>`).
- **Inspector**: Located in `tools/inspector`. Run with `npm install && npm run dev`.

## Renderers

There are three renderers available for A2UI:

- **Web (Lit)**: Located in `renderers/lit`, this is the primary web renderer used by the demos in `web/`.
- **Angular**: Located in `angular/projects/lib`, this is an alternative web renderer for Angular applications.
- **Web (Lit)**: Located in `renderers/lit`, this is the primary web renderer used by the Lit samples.
- **Angular**: Located in `samples/client/angular/projects/lib`, this is an alternative web renderer for Angular applications.
- **Flutter**: The Flutter renderer is in a separate repository: [https://github.com/flutter/genui](https://github.com/flutter/genui)

## Keeping This Guide Updated

This document is intended to be a living guide for the repository. As the repository evolves, it's important to keep this file up-to-date. When making changes to the repository, please consider the following:

- **New Demos or Clients**: If you add a new demo or client, add it to the "Running the Demos" section.
- **Specification Changes**: If you make significant changes to the A2UI protocol, ensure that the "A2UI Specification Overview" section is updated to reflect the changes, and that any linked documents are also updated.
- **New Demos or Clients**: If you add a new demo or client in `samples/`, add it to the "Running the Demos" section.
- **Specification Changes**: If you make significant changes to the A2UI protocol, ensure that the "A2UI Specification Overview" section is updated.
- **Repository Structure Changes**: If you change the directory structure of the repository, update the "Repository Structure" section.

To get this file back in sync, you can run the following commands:

1. List all the files in the entire repo with `git ls-tree main --name-only -r`
2. Read the ~50 most important files in the list, potentially in batches.
3. Update this file.

## Change descriptions

If you (the agent) are generating a pull request summary, pull request description, or change description, avoid flowery or hyperbolic terms (e.g. "significantly improves", "greatly enhances", "is an incredible improvement"). Be factual and avoid marketing language: you're not selling the PR, you're describing it.
18 changes: 18 additions & 0 deletions .gemini/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Gemini Configuration

This directory (`.gemini/`) contains configuration and context files for Google's Gemini tools, including:

- **`gemini-cli`**: The command-line interface for Gemini.
- **Gemini Code Assist**: An AI-powered assistant that integrates with GitHub and IDEs and provides for automated code reviews, among other features.

The files in this directory are used to customize the behavior of these tools for this specific repository.

- **`GEMINI.md`**: Provides project-specific context, instructions, and guidelines that are included in the context when using Gemini CLI and Code Assist. This helps the AI understand the project's conventions and requirements.
- **`config.yaml`**: Configuration for the Gemini for GitHub tools, such as settings for code review.
- **`styleguide.md`**: Contains the project's style guide, which is used by the Gemini for Github tools to ensure that generated reviews adhere to the project's conventions.
- **`commands/`**: A directory containing custom command definitions (e.g., `fix_code.toml`) for the Gemini CLI.

## Documentation

- [Gemini CLI Documentation](https://github.com/google-gemini/gemini-cli)
- [Gemini Code Assist Documentation](https://cloud.google.com/products/gemini/code-assist)
30 changes: 30 additions & 0 deletions .gemini/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The bot is less goofy with this off. We don't need poems in the summary...
have_fun: false
code_review:
disable: false
# Set to -1 for unlimited comments.
max_review_comments: 6
# For now, use the default of MEDIUM for testing. Based on desired verbosity,
# we can change this to LOW or HIGH in the future.
comment_severity_threshold: MEDIUM
pull_request_opened:
# Explicitly set help to false in case the default changes in the future, as
# having a help message on every PR would be spammy.
help: false
# These tend to be verbose, and since we expect PR authors to clearly
# describe their PRs this would be at best duplicative.
summary: false
5 changes: 5 additions & 0 deletions .gemini/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"context": {
"fileName": ["GEMINI.md"]
}
}
20 changes: 20 additions & 0 deletions .gemini/styleguide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# A2UI Style Guide

## Introduction

This style guide outlines the coding conventions for contributions to this repository.

## Style Guides

Code should follow the relevant style guides, and use the correct
auto-formatter, for each language, as described in
[the repository contributing guide's Style section](../STYLE_GUIDE.md).

## Best Practices

- Code should follow the guidance and principles described in
[the A2UI contribution guidelines](../CONTRIBUTING.md).
- If there are code changes, code should have tests.
- PR descriptions should include the Pre-Review Checklist from
[the PR template](https://github.com/flutter/genui/blob/main/.github/PULL_REQUEST_TEMPLATE.md),
with all of the steps completed.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Description

_Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots._

_List which issues are fixed by this PR. For larger changes, raising an issue first helps reduce redundant work._

## Pre-launch Checklist

- [ ] I signed the [CLA].
- [ ] I read the [Contributors Guide].
- [ ] I read the [Style Guide].
- [ ] I have added updates to the [CHANGELOG].
- [ ] I updated/added relevant documentation.
- [ ] My code changes (if any) have tests.

If you need help, consider asking for advice on the [discussion board].

<!-- Links -->

[CHANGELOG]: ../CHANGELOG.md
[CLA]: https://cla.developers.google.com/
[Contributors Guide]: ../CONTRIBUTING.md
[discussion board]: https://github.com/google/A2UI/discussions
[Style Guide]: ../STYLE_GUIDE.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link to the style guide appears to be incorrect. This pull request adds CODING_STYLE.md, but this link points to STYLE_GUIDE.md. Please update the link to point to the correct file to avoid confusion for contributors.

Suggested change
[Style Guide]: ../STYLE_GUIDE.md
[Style Guide]: ../CODING_STYLE.md

12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ Here are some additional things to keep in mind during the process:

- **Test your changes.** Before you submit a pull request, make sure that your changes work as expected.
- **Be patient.** It may take some time for your pull request to be reviewed and merged.

## Coding Style

To keep our codebase consistent and maintainable, we follow specific coding standards for Python and TypeScript.

Please refer to [STYLE_GUIDE.md](STYLE_GUIDE.md) for detailed guidelines on:
* **Python**: specific formatting, linting, and naming conventions (Google Python Style).
* **TypeScript**: usage of `gts`, naming conventions, and code organization (Google TypeScript Style).
* **License Headers**: required copyright notices.

We expect all contributors to adhere to these styles.

Loading