Skip to content

Commit bfac99b

Browse files
Firebase studio template (#312)
* feat: Add Firebase Studio template This commit introduces a Firebase Studio template to the repository. The template allows you to easily open the a2a-samples project in a pre-configured cloud development environment. The template automatically: - Installs Python 3.12 and uv. - Installs project dependencies using `uv sync`. - Configures and launches the demo UI. An "Open in Firebase Studio" button has also been added to the README.md to make it easy for you to access the template. * Fix SVG in idx-template.json * style: Update Firebase Studio button This commit updates the style of the "Open in Firebase Studio" button in the README.md file. The new button uses a `<picture>` element to support light and dark themes, providing a better user experience. The template URL in the `href` attribute has also been URL-encoded as requested. * Update idx-template.json * feat: Update Firebase Studio template icon This commit updates the icon for the Firebase Studio template to use the official A2A logo. The icon is defined in the `idx-template.json` file and is displayed in the Firebase Studio UI when selecting a template. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 02390c0 commit bfac99b

File tree

3 files changed

+135
-55
lines changed

3 files changed

+135
-55
lines changed

‎.firebase-studio/idx-template.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "A2A Samples",
3+
"description": "A template for running the a2a-samples demo UI in Firebase Studio.",
4+
"icon": "https://a2a-protocol.org/latest/assets/a2a-logo-black.svg",
5+
"params": []
6+
}

‎.firebase-studio/idx-template.nix‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{ pkgs, ... }: {
2+
# Add rsync to the bootstrap environment.
3+
packages = [
4+
pkgs.rsync
5+
];
6+
7+
# The bootstrap script runs in a temporary directory containing the
8+
# contents of your template folder.
9+
bootstrap = ''
10+
# Use rsync to copy the entire repository into the new workspace directory ($out).
11+
# rsync is more robust for this task. It excludes the .git and template
12+
# directories to avoid including unnecessary files in the workspace.
13+
rsync -a --exclude ".git" --exclude ".firebase-studio" ${./.}/../ "$out/"
14+
15+
# Create the .idx directory for workspace configuration.
16+
mkdir -p "$out/.idx"
17+
18+
# Create the dev.nix file that defines the workspace environment.
19+
cat > "$out/.idx/dev.nix" <<'EOF'
20+
{pkgs}: {
21+
# Add required system packages.
22+
# pkgs.python312 provides python 3.12
23+
# pkgs.uv is a fast python package installer
24+
packages = [
25+
pkgs.python312
26+
pkgs.uv
27+
];
28+
29+
# Workspace lifecycle hooks allow running commands when the workspace
30+
# is created or started.
31+
idx.workspace.onCreate = {
32+
# Install python dependencies from pyproject.toml and uv.lock
33+
# using 'uv sync'. This runs when the workspace is first created.
34+
install-dependencies = "cd demo/ui && uv sync";
35+
};
36+
37+
# Configure previews for the web application.
38+
idx.previews = {
39+
previews = [
40+
{
41+
id = "a2a-demo-ui";
42+
name = "A2A Demo UI";
43+
# Command to start the demo UI.
44+
# It changes into the 'demo/ui' directory and runs the main python script.
45+
command = "cd demo/ui && uv run main.py";
46+
# The port the application will be running on.
47+
port = 12000;
48+
# 'web' manager opens the preview in a browser tab inside Firebase Studio.
49+
manager = "web";
50+
}
51+
];
52+
};
53+
}
54+
EOF
55+
56+
# Set write permissions on the entire workspace.
57+
chmod -R +w "$out"
58+
'';
59+
}

‎README.md‎

Lines changed: 70 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,70 @@
1-
# Agent2Agent (A2A) Samples
2-
3-
<div style="text-align: right;">
4-
<details>
5-
<summary>🌐 Language</summary>
6-
<div style="text-align: center;">
7-
<a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=en">English</a>
8-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=zh-CN">简体中文</a>
9-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=zh-TW">繁體中文</a>
10-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ja">日本語</a>
11-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ko">한국어</a>
12-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=hi">हिन्दी</a>
13-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=th">ไทย</a>
14-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=fr">Français</a>
15-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=de">Deutsch</a>
16-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=es">Español</a>
17-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=it">Italiano</a>
18-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ru">Русский</a>
19-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=pt">Português</a>
20-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=nl">Nederlands</a>
21-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=pl">Polski</a>
22-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ar">العربية</a>
23-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=fa">فارسی</a>
24-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=tr">Türkçe</a>
25-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=vi">Tiếng Việt</a>
26-
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=id">Bahasa Indonesia</a>
27-
</div>
28-
</details>
29-
</div>
30-
31-
This repository contains code samples and demos which use the [Agent2Agent (A2A) Protocol](https://goo.gle/a2a).
32-
33-
## Related Repositories
34-
35-
- [A2A](https://github.com/a2aproject/A2A) - A2A Specification and documentation.
36-
- [a2a-python](https://github.com/a2aproject/a2a-python) - A2A Python SDK.
37-
- [a2a-inspector](https://github.com/a2aproject/a2a-inspector) - UI tool for inspecting A2A enabled agents.
38-
39-
## Contributing
40-
41-
Contributions welcome! See the [Contributing Guide](CONTRIBUTING.md).
42-
43-
## Getting help
44-
45-
Please use the [issues page](https://github.com/a2aproject/a2a-samples/issues) to provide suggestions, feedback or submit a bug report.
46-
47-
## Disclaimer
48-
49-
This repository itself is not an officially supported Google product. The code in this repository is for demonstrative purposes only.
50-
51-
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
52-
53-
All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide an AgentCard containing crafted data in its fields (e.g., description, name, skills.description). If this data is used without sanitization to construct prompts for a Large Language Model (LLM), it could expose your application to prompt injection attacks. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application.
54-
55-
Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.
1+
# Agent2Agent (A2A) Samples
2+
3+
<a href="https://studio.firebase.google.com/new?template=https%3A%2F%2Fgithub.com%2Fa2aproject%2Fa2a-samples%2Ftree%2Fmain%2F.firebase-studio">
4+
<picture>
5+
<source
6+
media="(prefers-color-scheme: dark)"
7+
srcset="https://cdn.firebasestudio.dev/btn/try_light_20.svg">
8+
<source
9+
media="(prefers-color-scheme: light)"
10+
srcset="https://cdn.firebasestudio.dev/btn/try_dark_20.svg">
11+
<img
12+
height="20"
13+
alt="Try in Firebase Studio"
14+
src="https://cdn.firebasestudio.dev/btn/try_blue_20.svg">
15+
</picture>
16+
</a>
17+
18+
<div style="text-align: right;">
19+
<details>
20+
<summary>🌐 Language</summary>
21+
<div style="text-align: center;">
22+
<a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=en">English</a>
23+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=zh-CN">简体中文</a>
24+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=zh-TW">繁體中文</a>
25+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ja">日本語</a>
26+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ko">한국어</a>
27+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=hi">हिन्दी</a>
28+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=th">ไทย</a>
29+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=fr">Français</a>
30+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=de">Deutsch</a>
31+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=es">Español</a>
32+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=it">Italiano</a>
33+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ru">Русский</a>
34+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=pt">Português</a>
35+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=nl">Nederlands</a>
36+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=pl">Polski</a>
37+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=ar">العربية</a>
38+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=fa">فارسی</a>
39+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=tr">Türkçe</a>
40+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=vi">Tiếng Việt</a>
41+
| <a href="https://openaitx.github.io/view.html?user=a2aproject&project=a2a-samples&lang=id">Bahasa Indonesia</a>
42+
</div>
43+
</details>
44+
</div>
45+
46+
This repository contains code samples and demos which use the [Agent2Agent (A2A) Protocol](https://goo.gle/a2a).
47+
48+
## Related Repositories
49+
50+
- [A2A](https://github.com/a2aproject/A2A) - A2A Specification and documentation.
51+
- [a2a-python](https://github.com/a2aproject/a2a-python) - A2A Python SDK.
52+
- [a2a-inspector](https://github.com/a2aproject/a2a-inspector) - UI tool for inspecting A2A enabled agents.
53+
54+
## Contributing
55+
56+
Contributions welcome! See the [Contributing Guide](CONTRIBUTING.md).
57+
58+
## Getting help
59+
60+
Please use the [issues page](https://github.com/a2aproject/a2a-samples/issues) to provide suggestions, feedback or submit a bug report.
61+
62+
## Disclaimer
63+
64+
This repository itself is not an officially supported Google product. The code in this repository is for demonstrative purposes only.
65+
66+
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
67+
68+
All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide an AgentCard containing crafted data in its fields (e.g., description, name, skills.description). If this data is used without sanitization to construct prompts for a Large Language Model (LLM), it could expose your application to prompt injection attacks. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application.
69+
70+
Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.

0 commit comments

Comments
 (0)