a2ui-project / a2ui-project/a2ui

Reinstate template examples

Offen Anfängerfreundlich
#2,402 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
component: specification P3 type: feature/enhancement
Vorherrschende Sprache
TypeScript
Sterne
16.4k
Forks
1.3k
Ø Merge
3 T. 15 Std.
Gemergte PRs (30 T.)
134

Beschreibung

### 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}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Die Aufgabe besteht darin, die 14 im Issue-Text hinterlegten YAML-Vorlagenbeispiele aus dem Issue-Text in das zentrale Verzeichnis `conformance/test_data/templates/` oder eine dedizierte Specification-Galerie zu verschieben. Lokalisieren Sie zunächst das Zielverzeichnis im Repository. Erstellen Sie dann jede YAML-Datei mit dem exakt angegebenen Inhalt und stellen Sie sicher, dass der Copyright-Header enthalten ist. Überprüfen Sie, dass die Dateien korrekt platziert sind und den bestehenden Namens- und Strukturkonventionen folgen. Prüfen Sie, ob vorhandene Tests auf diese Beispiele verweisen, um sicherzustellen, dass sie integriert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, yaml
Bereich
documentation, testing
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
70/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.