a2ui-project / a2ui-project/a2ui
Reinstate template examples
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.4k
- Forks
- 1.3k
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 134
Descripción
### Overview
As the A2UI template feature graduates from experimental to a stable feature across client and agent SDKs, reinstate or graduate the language-agnostic template reference examples into the central `conformance/test_data/templates/` directory (or a dedicated specification gallery).
### Background
In PR #2380 and #2381, the A2UI template specification was formalized as a Spec-Driven Development Feature Blueprint (`blueprints/features/templates.blueprint.md`), and the data-driven test suites are currently maintained within the Python SDK (`agent_sdks/python/a2ui_agent/tests/inference_formats/experimental/template/conformance/suites/`).
To keep the initial blueprint PR tight and focused on architectural and schema contracts, the 14 standalone reference template YAML files were removed from `specification/proposals/templates/examples/`. They are stashed below in full for future reference when cross-language test suites (Swift, Kotlin, TypeScript, Dart) are ready to consume them.
Click to expand: 14 Stashed Reference Template Definitions (YAML)
#### `basic_cards.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: SimpleCard
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
title:
type: string
description: Primary card title
subtitle:
type: string
required: false
layout:
component: Card
child:
component: Column
children:
- component: Text
text: ${title}
variant: h2
---
version: "0.1"
name: ProfileHeader
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
name:
type: string
avatarUrl:
type: string
layout:
component: Row
align: center
children:
- component: Image
url: ${avatarUrl}
variant: avatar
- component: Text
text: ${name}
variant: h3
```
#### `slot_composition.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: ContainerSlot
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
title:
type: string
contentSlot:
type: child
layout:
component: Card
child:
component: Column
children:
- component: Text
text: ${title}
- component: ${contentSlot}
---
version: "0.1"
name: ActionButton
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
label:
type: string
onPress:
type: action
layout:
component: Button
text: ${label}
action: ${onPress}
```
#### `nested_lists.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: MemberList
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
teamName:
type: string
members:
type: array
layout:
component: Card
child:
component: Column
children:
- component: Text
text: ${teamName}
variant: h2
- component: Column
children:
loop:
param: members
as: member
item:
component: Row
children:
- component: Text
text: ${member.name}
- component: Text
text: ${member.role}
variant: caption
```
#### `salary_card.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: SalaryCard
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
employeeId:
type: string
employeeName:
type: string
role:
type: string
baseSalary:
type: string
annualBonus:
type: string
layout:
component: Card
child:
component: Column
children:
- component: Row
justify: spaceBetween
align: center
children:
- component: Text
text: ${employeeName}
variant: h3
- component: Text
text: ${role}
variant: caption
- component: Divider
axis: horizontal
- component: Row
justify: spaceBetween
children:
- component: Text
text: "Base Salary"
variant: caption
- component: Text
text: ${baseSalary}
variant: body
- component: Row
justify: spaceBetween
children:
- component: Text
text: "Annual Bonus"
variant: caption
- component: Text
text: ${annualBonus}
variant: body
```
#### `user_profile.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: UserProfile
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
userId:
type: string
userName:
type: string
role:
type: string
default: Member
layout:
component: Card
child:
component: Column
align: center
children:
- component: Icon
name: account_circle
- component: Text
text: ${userName}
variant: h2
- component: Text
text: ${role}
variant: caption
```
#### `feedback_item.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: FeedbackItem
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
author:
type: string
category:
type: string
text:
type: string
status:
type: string
default: "New"
layout:
component: Card
child:
component: Column
children:
- component: Row
justify: spaceBetween
children:
- component: Text
text: ${author}
variant: h4
- component: Text
text: ${category}
variant: caption
- component: Text
text: ${text}
variant: body
- component: Text
text: "Status: ${status}"
variant: caption
```
#### `goal_item.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: GoalItem
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
title:
type: string
priority:
type: string
default: Medium
targetDate:
type: string
layout:
component: Card
child:
component: Row
justify: spaceBetween
align: center
children:
- component: Column
children:
- component: Text
text: ${title}
variant: body
- component: Text
text: "Target: ${targetDate}"
variant: caption
- component: Text
text: ${priority}
variant: caption
```
#### `section_card.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: SectionCard
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
title:
type: string
description:
type: string
required: false
headerAction:
type: child
required: false
children:
type: children
layout:
component: Card
child:
component: Column
children:
- component: Row
justify: spaceBetween
align: center
children:
- component: Column
children:
- component: Text
text: ${title}
variant: h3
- component: Text
text: ${description}
variant: caption
- component: ${headerAction}
- component: Divider
axis: horizontal
- component: Column
children: ${children}
```
#### `team_card.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TeamCard
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
teamName:
type: string
leadName:
type: string
memberCount:
type: integer
default: 1
layout:
component: Card
child:
component: Column
children:
- component: Text
text: ${teamName}
variant: h2
- component: Row
justify: spaceBetween
children:
- component: Text
text: "Lead: ${leadName}"
variant: body
- component: Text
text: "${memberCount} Members"
variant: caption
```
#### `team_feedback_board.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TeamFeedbackBoard
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
teamName:
type: string
items:
type: array
layout:
component: Card
child:
component: Column
children:
- component: Text
text: "Feedback Board: ${teamName}"
variant: h2
- component: Column
children:
loop:
param: items
as: item
item:
component: Row
justify: spaceBetween
children:
- component: Text
text: ${item.text}
- component: Text
text: ${item.author}
variant: caption
```
#### `team_goal_list.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TeamGoalList
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
teamName:
type: string
goals:
type: array
layout:
component: Card
child:
component: Column
children:
- component: Text
text: "${teamName} OKRs"
variant: h2
- component: Column
children:
loop:
param: goals
as: goal
item:
component: Row
justify: spaceBetween
children:
- component: Text
text: ${goal.title}
- component: Text
text: ${goal.targetDate}
variant: caption
```
#### `team_member_knowledge_panel.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TeamMemberKnowledgePanel
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
memberName:
type: string
role:
type: string
department:
type: string
skills:
type: array
layout:
component: Card
child:
component: Column
children:
- component: Text
text: ${memberName}
variant: h2
- component: Text
text: "${role} • ${department}"
variant: caption
- component: Divider
axis: horizontal
- component: Text
text: "Skills & Expertise"
variant: h4
- component: Row
children:
loop:
param: skills
as: skill
item:
component: Text
text: "${skill} "
variant: caption
```
#### `team_roster.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TeamRoster
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
teamName:
type: string
members:
type: array
layout:
component: Card
child:
component: Column
children:
- component: Text
text: "Team Roster: ${teamName}"
variant: h2
- component: Column
children:
loop:
param: members
as: member
item:
component: Text
text: "• ${member}"
variant: body
```
#### `two_column_layout.yaml`
```yaml
# Copyright 2024 Google LLC
# Apache-2.0
version: "0.1"
name: TwoColumnLayout
catalogs:
- "https://a2ui.org/specification/v0_9_1/catalogs/basic/catalog.json"
parameters:
leftSlot:
type: child
rightSlot:
type: child
layout:
component: Row
children:
- component: ${leftSlot}
- component: ${rightSlot}
```
Guía de contribución
Línea de trabajo
La tarea consiste en mover los 14 ejemplos de plantillas YAML incluidos en el cuerpo del issue desde el cuerpo del issue al directorio central `conformance/test_data/templates/` o a una galería de especificaciones dedicada. Primero, localiza el directorio de destino en el repositorio. Después, crea cada archivo YAML con el contenido exacto proporcionado, asegurándote de que incluya el encabezado de copyright. Verifica que los archivos estén colocados correctamente y que sigan las convenciones existentes de nombres y estructura. Comprueba si alguna prueba existente hace referencia a estos ejemplos para asegurarte de que están integrados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript, yaml
- Área
- documentation, testing
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Activo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 70/100