a2ui-project / a2ui-project/a2ui
Reinstate template examples
- 主要语言
- TypeScript
- 星标
- 16.4k
- 派生
- 1.3k
- 平均合并
- 3 天 15 小时
- 30 天内合并 PR
- 134
描述
### 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}
```
贡献指南
调研方向
任务是将 issue 正文中暂存的 14 个 YAML 模板示例从 issue 正文移入中央 `conformance/test_data/templates/` 目录或专用的规范示例库。首先,在 repository 中定位目标目录。然后,使用提供的确切内容创建每个 YAML 文件,并确保包含 copyright header。确认文件放置正确,并且遵循现有的命名和结构约定。检查是否有现有测试引用这些示例,以确保它们已集成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript, yaml
- 领域
- documentation, testing
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 70/100