agent-robot-avatar 0.3.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,227 +1,186 @@
1
- # Agent Robot Avatar
2
-
3
- <p align="center">
4
- <img src="../assets/readme/agent-robot-avatar-header.jpg" alt="Agent Robot Avatar">
5
- </p>
6
-
7
- [English](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/README.md) | [简体中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-CN.md) | [繁體中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-TW.md) | [日本語](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ja.md) | [한국어](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ko.md) | [Español](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.es.md) | [Português](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.pt.md) | [Deutsch](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.de.md) | [Français](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.fr.md)
8
-
9
- ![Version](https://img.shields.io/badge/version-v0.3.1-111111?style=flat-square) [![License](https://img.shields.io/badge/license-MIT-0A7EA4?style=flat-square)](../LICENSE) [![CI](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml/badge.svg?branch=main)](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml) [![Ko-fi](https://img.shields.io/badge/Ko--fi-Support-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/P0E625WIOI)
10
-
11
- ![Vanilla JavaScript](https://img.shields.io/badge/Vanilla-JavaScript-F7DF1E?style=flat-square&logo=javascript&logoColor=000) ![Web Component](https://img.shields.io/badge/Web-Native%20Component-5A67D8?style=flat-square) ![SVG](https://img.shields.io/badge/Rendering-SVG-FFB13B?style=flat-square&logo=svg&logoColor=000) ![Zero Dependencies](https://img.shields.io/badge/Dependencies-0-2EA44F?style=flat-square) ![14 Agent States](https://img.shields.io/badge/Agent%20states-14-8B5CF6?style=flat-square) ![Pointer Following](https://img.shields.io/badge/Pointer-following-00A67E?style=flat-square) ![Jelly Drag](https://img.shields.io/badge/Drag-jelly%20physics-FF69B4?style=flat-square)
12
-
13
- 一個輕量、富有表現力的機器人頭像 Web Component,可用於 AI Agent,也可用於其他需要互動回饋的應用。
14
-
15
- 適用於 AI 助理與 Agent 互動介面,包括與 ChatGPT、Claude、Codex、Cursor、Grok Bot、Gemini CLI 和 OpenCode 類似的產品與使用情境。
16
-
17
- 也可用於桌面寵物、虛擬寵物、桌面夥伴、數位吉祥物、聊天機器人頭像,以及其他互動角色體驗。
18
-
19
- Agent Robot Avatar 也可作為 AG-UI 類 Agent 介面的視覺回饋層。
20
-
21
- Agent Robot Avatar 以 SVG 與原生 JavaScript 建構,不依賴第三方動畫框架。它作為原生自訂元素運作,並提供精簡 API 來控制表情、互動狀態、指標跟隨、等待回饋與頭部造型。
22
-
23
- **目前公開版本:v0.3.1**
24
-
25
- <p align="center">
26
- <img src="../assets/demo/agent-robot-avatar-demo.gif" alt="Agent Robot Avatar 互動動畫展示" width="560">
27
- </p>
28
-
29
- ## 線上展示
30
-
31
- 直接體驗互動效果:[開啟 Agent Robot Avatar 線上展示](https://cx-artlab.github.io/agent-robot-avatar/?lang=zh-TW)
32
-
33
- ## 主要特色
34
-
35
- - 純 SVG + 原生 JavaScript
36
- - 原生 Web Component
37
- - 無第三方動畫框架依賴
38
- - 自動眨眼與細微隨機視線活動
39
- - 滑鼠 / 指標跟隨與帶慣性的頭部運動
40
- - 局部果凍式拖曳形變與彈性回彈
41
- - 可由程式觸發的 Agent 狀態與表情
42
- - 明確區分等待、失敗、警告、審視、內容阻止與系統錯誤
43
- - 可調整頭部圓角
44
- - 懸浮式天線,可選擇啟用狀態閃動
45
- - Demo 與可重複使用的元件本體分離
46
-
47
- ## 快速開始
48
-
49
- 直接使用倉庫原始碼時,請讓根目錄的 `agent-robot-avatar.js` 與 `src/` 一起使用,並載入公開入口:
50
-
51
- ```html
52
- <script type="module" src="./agent-robot-avatar.js"></script>
53
- ```
54
-
55
- 加入自訂元素:
56
-
57
- ```html
58
- <agent-robot-avatar id="avatar"></agent-robot-avatar>
59
- ```
60
-
61
- 元件載入後會自動進入預設待機狀態,不需要額外初始化。最小可執行範例位於 [`examples/basic.html`](../examples/basic.html)。
62
-
63
- ## 基本 API
64
-
65
- ```js
66
- const avatar = document.querySelector('#avatar');
67
-
68
- avatar.play('success');
69
- avatar.play('failure');
70
- avatar.play('warning');
71
- avatar.play('inspect');
72
- avatar.play('blocked');
73
- avatar.play('error');
74
-
75
- avatar.reset();
76
- ```
77
-
78
- ## 狀態與表情
79
-
80
- | 狀態 | API 名稱 | 典型用途 |
81
- | --- | --- | --- |
82
- | 預設待機 | `idle` | 正常待機 |
83
- | 發呆 | `bored` | 長時間沒有任務或閒置 |
84
- | 等待 | `waiting` | 請求已送出,等待結果 |
85
- | 輸入中 | `input` | 使用者正在輸入 |
86
- | 傳送 | `send` | 內容已送出 / 點頭回饋 |
87
- | 成功 | `success` | 任務成功完成 |
88
- | 失敗 | `failure` | 任務完成,但結果失敗 |
89
- | 警告確認 | `warning` | 高風險或破壞性操作需要確認 |
90
- | 審視 | `inspect` | 檢查、核對或驗證結果 |
91
- | 內容阻止 | `blocked` | 請求被阻止、不允許或無法繼續 |
92
- | 系統錯誤 | `error` | 連線、服務或系統錯誤 |
93
- | 驚訝 | `surprise` | 意外事件或結果 |
94
- | 睡眠 | `sleep` | 進入睡眠 |
95
- | 喚醒 | `wake` | 從睡眠恢復 |
96
-
97
- `failure` 代表任務本身執行失敗;`error` 專門表示連線、服務或系統故障。`waiting` 是仍在等待已送出請求,而 `bored` 代表目前沒有活躍任務。
98
-
99
- 語意別名:
100
-
101
- ```js
102
- avatar.play('failed');
103
- avatar.play('fail');
104
- avatar.play('verify');
105
- avatar.play('review');
106
- avatar.play('angry'); // 與 blocked 使用相同表情
107
- avatar.play('policy-blocked');
108
- avatar.play('system-error');
109
- avatar.play('connection-error');
110
- ```
111
-
112
- ## 持續等待
113
-
114
- ```js
115
- avatar.startWaiting();
116
- // 收到回覆或結果後停止。
117
- avatar.stopWaiting();
118
- ```
119
-
120
- 呼叫其他動作也會中斷目前等待狀態。
121
-
122
- ## 滑鼠跟隨
123
-
124
- ```js
125
- avatar.setPointerFollow(false);
126
- avatar.setPointerFollow(true);
127
- ```
128
-
129
- ## 頭部圓角
130
-
131
- ```js
132
- avatar.setHeadRoundness(0); // 更方
133
- avatar.setHeadRoundness(50); // 預設
134
- avatar.setHeadRoundness(100); // 更圓
135
-
136
- console.log(avatar.getHeadRoundness());
137
- ```
138
-
139
- 值會限制在 `0–100`。變更時會觸發 `head-roundness-change`:
140
-
141
- ```js
142
- avatar.addEventListener('head-roundness-change', (event) => {
143
- console.log(event.detail.value);
144
- });
145
- ```
146
-
147
- ## 狀態事件
148
-
149
- 視覺狀態變更時會觸發 `face-state`:
150
-
151
- ```js
152
- avatar.addEventListener('face-state', (event) => {
153
- console.log(event.detail.state);
154
- });
155
- ```
156
-
157
- ## 基礎屬性
158
-
159
- ```html
160
- <agent-robot-avatar
161
- size="160"
162
- color="#08090b"
163
- auto-sleep="30000">
164
- </agent-robot-avatar>
165
- ```
166
-
167
- | 屬性 | 說明 |
168
- | --- | --- |
169
- | `size` | 元件尺寸(像素) |
170
- | `color` | 頭像主色 |
171
- | `auto-sleep` | 閒置多久後自動睡眠(毫秒);`0` 關閉自動睡眠 |
172
-
173
- ## 預設行為
174
-
175
- 即使不呼叫 API,頭像也會隨機眨眼、輕微移動視線、在指標靠近時自然跟隨、產生帶慣性的頭部運動,並可選擇自動睡眠。
176
-
177
- ## 拖曳互動
178
-
179
- 拖曳時,頭部會在受力位置附近局部變形,而不是整體剛性移動。
180
-
181
- - 強力向外拉:回彈後觸發 `angry`
182
- - 強力向中心推:回彈後觸發 `success`
183
- - 小幅拖曳:只變形,不觸發表情
184
-
185
- 上述拖曳表情只會在沒有程式控制動作佔用頭像的 idle 狀態生效。`waiting`、`input`、`inspect` 等動作執行期間仍保留拖曳形變,但拖曳表情會被抑制且不會延後補播;`pointercancel` 只恢復形狀,不會觸發成功或生氣表情。
186
-
187
- ## 互動 Demo
188
-
189
- `demo/index.html` 包含全部公開表情、指標跟隨、果凍拖曳、等待生命週期、頭部圓角調整、顏色 / 行為控制,以及模擬 Agent 對話。Demo 專用 JavaScript 全部集中在 `demo/`,不會進入可重複使用的 npm runtime。
190
-
191
- ## 專案結構
192
-
193
- ```text
194
- agent-robot-avatar.js 正式元件入口
195
- src/ 可重複使用的元件 runtime 與表情模組
196
- demo/ 完整互動 Demo 與 Demo 專用程式
197
- examples/ 最小整合範例
198
- assets/support/ 支持專案 / 付款 QR 圖片
199
- docs/ 多語言文件
200
- README.md 英文主文件
201
- CHANGELOG.md 正式版本記錄
202
- CONTRIBUTING.md 貢獻指南
203
- package.json 套件與發佈資訊
204
- LICENSE MIT License
205
- ```
206
-
207
- ## 發佈與相容性
208
-
209
- 套件已以 `agent-robot-avatar` 名稱發佈至 npm,並內建動作、事件與公開方法的 TypeScript 型別宣告。元件面向支援 ES Modules、Custom Elements、SVG、Pointer Events 與 Web Animations API 的現代瀏覽器。
210
-
211
- ## 參與貢獻
212
-
213
- 歡迎 Issue 與 Pull Request。提交前請閱讀 [`CONTRIBUTING.md`](../CONTRIBUTING.md)。
214
-
215
- ## 專案狀態
216
-
217
- v0.3.1 是目前的公開版本。v0.1.0 作為第一個公開版本繼續保留。公開 API 目前刻意保持精簡,讓專案能在未來 `1.0.0` 穩定性承諾前持續謹慎演進。
218
-
219
- Agent Robot Avatar 是獨立開發的開源專案,不隸屬、代表或獲得任何 AI 平台或品牌的官方背書。
220
-
221
- ## License
222
-
223
- MIT License。詳見 [`LICENSE`](../LICENSE)。
224
-
225
- ## 請我喝杯咖啡
226
-
227
- <a href='https://ko-fi.com/P0E625WIOI' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi6.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
1
+ # Agent Robot Avatar
2
+
3
+ <p align="center">
4
+ <img src="../assets/readme/agent-robot-avatar-header.jpg" alt="Agent Robot Avatar">
5
+ </p>
6
+
7
+ [English](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/README.md) | [简体中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-CN.md) | [Español](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.es.md) | [Русский](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ru.md) | [Français](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.fr.md) | [Português](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.pt.md) | [Deutsch](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.de.md) | [日本語](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ja.md) | [한국어](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.ko.md) | [繁體中文](https://github.com/CX-ArtLab/agent-robot-avatar/blob/main/docs/README.zh-TW.md)
8
+
9
+ ![Version](https://img.shields.io/badge/version-v0.5.2-111111?style=flat-square) [![License](https://img.shields.io/badge/license-MIT-0A7EA4?style=flat-square)](../LICENSE) [![CI](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml/badge.svg?branch=main)](https://github.com/CX-ArtLab/agent-robot-avatar/actions/workflows/validate.yml) [![Ko-fi](https://img.shields.io/badge/Ko--fi-Support-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/P0E625WIOI)
10
+
11
+ ![Vanilla JavaScript](https://img.shields.io/badge/Vanilla-JavaScript-F7DF1E?style=flat-square&logo=javascript&logoColor=000) ![Web Component](https://img.shields.io/badge/Web-Native%20Component-5A67D8?style=flat-square) ![SVG](https://img.shields.io/badge/Rendering-SVG-FFB13B?style=flat-square&logo=svg&logoColor=000) ![Zero Dependencies](https://img.shields.io/badge/Dependencies-0-2EA44F?style=flat-square)
12
+
13
+ 一個輕量、富有表現力的機器人頭像 Web Component,適用於 AI Agent 與互動式應用。
14
+
15
+ 可用於 AI 助理、Agent 介面、桌面夥伴、虛擬寵物、數位吉祥物、聊天機器人頭像,以及其他互動角色體驗。
16
+
17
+ 適用於 AI 助理與 Agent 介面,包括類似 ChatGPT、Claude、Codex、Cursor、Grok Bot、Gemini CLI 與 OpenCode 的產品與體驗。
18
+
19
+ 使用 SVG 與原生 JavaScript 建構,以原生 Custom Element 運作,執行階段零依賴。
20
+
21
+ Agent Robot Avatar 也可作為 AG-UI 風格 Agent 介面的視覺回饋層。
22
+
23
+ <p align="center">
24
+ <img src="../assets/demo/agent-robot-avatar-demo.gif" alt="Agent Robot Avatar 互動動畫示範" width="560">
25
+ </p>
26
+
27
+ ## 線上 Demo
28
+
29
+ [開啟互動 Demo](https://cx-artlab.github.io/agent-robot-avatar/?lang=zh-TW)
30
+
31
+ ## 特點
32
+
33
+ - 原生 Web Component
34
+ - SVG 渲染 + 原生 JavaScript
35
+ - 執行階段零依賴
36
+ - 自動眨眼與輕微待機動作
37
+ - 眼睛跟隨指標與頭部慣性移動
38
+ - 果凍式局部拖曳形變與彈性復原
39
+ - 按住擠壓與可拖曳的彈簧天線互動
40
+ - 可透過程式控制 Agent 狀態與表情
41
+ - 支援 waiting、success、failure、warning、review、blocked、system error 等回饋
42
+ - 支援減少動態效果
43
+ - 可設定自動睡眠行為
44
+ - 可調整頭部圓角
45
+ - 可選天線狀態閃爍
46
+ - 內含 TypeScript 型別宣告
47
+
48
+ ## 安裝
49
+
50
+ ```bash
51
+ npm install agent-robot-avatar
52
+ ```
53
+
54
+ ```js
55
+ import 'agent-robot-avatar';
56
+ ```
57
+
58
+ 也可以直接載入儲存庫原始碼:
59
+
60
+ ```html
61
+ <script type="module" src="./agent-robot-avatar.js"></script>
62
+ ```
63
+
64
+ 接著加入元件:
65
+
66
+ ```html
67
+ <agent-robot-avatar id="avatar"></agent-robot-avatar>
68
+ ```
69
+
70
+ 不需要初始化程式碼,頭像會自動進入預設待機狀態。
71
+
72
+ ## 基本用法
73
+
74
+ ```js
75
+ const avatar = document.querySelector('#avatar');
76
+
77
+ avatar.play('success');
78
+ avatar.play('warning');
79
+ avatar.play('error');
80
+
81
+ avatar.reset();
82
+ ```
83
+
84
+ 可用動作:
85
+
86
+ `idle` · `bored` · `waiting` · `waiting-wrap` · `input` · `send` · `success` · `failure` · `warning` · `inspect` · `blocked` · `error` · `surprise` · `love` · `random` · `sleep` · `wake`
87
+
88
+ `failure` 用於表示任務執行完成但結果失敗;`error` 用於連線、服務或系統錯誤。
89
+
90
+ `love` 用於表達喜歡或感謝:兩隻眼睛向中間靠攏合成一顆愛心,跳動三下後恢復。
91
+
92
+ `random` 播放老虎機式的轉動:兩隻眼睛各自在滾筒上滾動,隨後左眼減速、彈跳著停下,右眼稍後停下。`slot` 是它的別名。
93
+
94
+ 典型的 Agent 請求流程:
95
+
96
+ ```js
97
+ avatar.startWaiting();
98
+
99
+ // 第二種等待:眼睛從一側轉出,再從另一側轉入。
100
+ avatar.startWaiting({ variant: 'wrap' });
101
+
102
+ try {
103
+ const result = await runAgentRequest();
104
+ await avatar.play(result.ok ? 'success' : 'failure');
105
+ } catch (error) {
106
+ await avatar.play('error');
107
+ }
108
+ ```
109
+
110
+ ## 常用選項
111
+
112
+ ```html
113
+ <agent-robot-avatar
114
+ size="160"
115
+ color="#08090b"
116
+ auto-sleep="30000"
117
+ wake-on="activity"
118
+ motion="auto">
119
+ </agent-robot-avatar>
120
+ ```
121
+
122
+ | 屬性 | 用途 |
123
+ | --- | --- |
124
+ | `size` | 頭像像素尺寸 |
125
+ | `color` | 頭像主色 |
126
+ | `auto-sleep` | 自動睡眠前的閒置時間;`0` 為關閉 |
127
+ | `wake-on` | 自動喚醒策略:`activity`、`interaction` 或 `manual` |
128
+ | `motion` | 動態效果策略:`auto`、`reduce` 或 `full` |
129
+ | `press-squeeze` | 按住頭像中心進行擠壓;設為 `false` 可關閉 |
130
+ | `antenna-drag` | 拖曳天線、彈簧復原並接憤怒表情;設為 `false` 可關閉 |
131
+
132
+ 常用執行階段控制:
133
+
134
+ ```js
135
+ avatar.setPointerFollow(false);
136
+ avatar.setHeadRoundness(75);
137
+ avatar.setAntennaFlash(true);
138
+ avatar.setPressSqueeze(true);
139
+ avatar.setAntennaDrag(true);
140
+ ```
141
+
142
+ 按住頭像中心會開始擠壓;移動超過 4 個 CSS 像素後,同一次指標操作會切換為原有的頭部拖曳。拖曳天線沿用頭部拖曳的距離限制,復原後接原有的憤怒反應。
143
+
144
+ ## 事件與整合
145
+
146
+ 元件透過 `face-state` 回報視覺狀態變化,透過 `action-state` 回報語意動作生命週期變化。
147
+
148
+ 宿主應用整合與無障礙狀態播報建議優先使用 `action-state`。可查看 [`examples/accessibility.html`](../examples/accessibility.html) 中的請求生命週期範例。
149
+
150
+ 最小整合範例位於 [`examples/basic.html`](../examples/basic.html)。
151
+
152
+ ## 相容性
153
+
154
+ 面向支援 ES Modules、Custom Elements、SVG、Pointer Events、Web Animations API、`IntersectionObserver`、`ResizeObserver` 和 `matchMedia` 的現代瀏覽器。
155
+
156
+ 自動瀏覽器測試涵蓋 Chromium、Firefox 和 WebKit。
157
+
158
+ ## 參與貢獻
159
+
160
+ 歡迎提交 Issue 和 Pull Request。提交修改前請閱讀 [`CONTRIBUTING.md`](../CONTRIBUTING.md)。
161
+
162
+ ## 專案狀態
163
+
164
+ **目前公開版本:v0.5.2**
165
+
166
+ 公開 API 會在未來 `1.0.0` 穩定性承諾前繼續保持精簡並謹慎演進。
167
+
168
+ Agent Robot Avatar 為獨立開發的開源專案,不隸屬、代表或獲得任何 AI 平台或品牌的官方背書。
169
+
170
+ ## 角色設計與視覺識別
171
+
172
+ Agent Robot Avatar 角色,包括機器人外觀與視覺識別,均為 CX ArtLab 的原創設計。
173
+
174
+ MIT License 適用於軟體和原始碼,允許在應用中使用、修改和散布該頭像,但不會轉移 Agent Robot Avatar 名稱、角色身分或視覺識別的所有權,也不授予將其作為其他方原創角色或獨立品牌展示的權利。
175
+
176
+ 本專案提及的第三方產品名稱僅用於說明可能的使用情境,不代表任何關聯或官方認可。
177
+
178
+ ## 授權條款
179
+
180
+ MIT License。詳見 [`LICENSE`](../LICENSE)。
181
+
182
+ ---
183
+
184
+ ## 請我喝杯咖啡
185
+
186
+ <a href='https://ko-fi.com/P0E625WIOI' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi6.png?v=6' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
package/index.d.ts CHANGED
@@ -1,108 +1,128 @@
1
- export type AgentRobotAvatarAction =
2
- | 'idle'
3
- | 'bored'
4
- | 'waiting'
5
- | 'wait'
6
- | 'input'
7
- | 'send'
8
- | 'success'
9
- | 'failure'
10
- | 'failed'
11
- | 'fail'
12
- | 'warning'
13
- | 'inspect'
14
- | 'verify'
15
- | 'review'
16
- | 'angry'
17
- | 'blocked'
18
- | 'policy-blocked'
19
- | 'error'
20
- | 'system-error'
21
- | 'connection-error'
22
- | 'surprise'
23
- | 'sleep'
24
- | 'wake';
25
-
26
- export type AgentRobotAvatarState =
27
- | 'idle'
28
- | 'happy'
29
- | 'sad'
30
- | 'angry'
31
- | 'sleepy'
32
- | 'input'
33
- | 'sleep'
34
- | 'surprise'
35
- | 'waiting'
36
- | 'warning'
37
- | 'error'
38
- | 'inspect'
39
- | 'failure';
40
-
41
- export type AgentRobotAvatarCanonicalAction =
42
- | 'idle'
43
- | 'bored'
44
- | 'waiting'
45
- | 'input'
46
- | 'send'
47
- | 'success'
48
- | 'failure'
49
- | 'warning'
50
- | 'inspect'
51
- | 'angry'
52
- | 'blocked'
53
- | 'error'
54
- | 'surprise'
55
- | 'sleep'
56
- | 'wake'
57
- | 'reaction';
58
-
59
- export type AgentRobotAvatarActionPhase = 'start' | 'end' | 'cancel';
60
- export type AgentRobotAvatarActionSource = 'api' | 'interaction' | 'automatic';
61
- export type AgentRobotAvatarWakeOn = 'activity' | 'interaction' | 'manual';
62
- export type AgentRobotAvatarMotion = 'auto' | 'reduce' | 'full';
63
-
64
- export interface AgentRobotAvatarActionStateDetail {
65
- action: AgentRobotAvatarCanonicalAction;
66
- phase: AgentRobotAvatarActionPhase;
67
- source: AgentRobotAvatarActionSource;
68
- }
69
-
70
- export interface AgentRobotAvatarEventMap extends HTMLElementEventMap {
71
- 'face-state': CustomEvent<{ state: AgentRobotAvatarState }>;
72
- 'action-state': CustomEvent<AgentRobotAvatarActionStateDetail>;
73
- 'head-roundness-change': CustomEvent<{ value: number; version: string }>;
74
- }
75
-
76
- export declare class AgentRobotAvatar extends HTMLElement {
77
- play(action: AgentRobotAvatarAction): this | Promise<void>;
78
- reset(): this;
79
- startWaiting(): Promise<this>;
80
- stopWaiting(): this;
81
- setPointerFollow(enabled?: boolean): this;
82
- setAntennaFlash(enabled?: boolean): this;
83
- setHeadRoundness(value?: number): this;
84
- getHeadRoundness(): number;
85
- noteActivity(wake?: boolean): void;
86
-
87
- addEventListener<K extends keyof AgentRobotAvatarEventMap>(
88
- type: K,
89
- listener: (this: AgentRobotAvatar, event: AgentRobotAvatarEventMap[K]) => unknown,
90
- options?: boolean | AddEventListenerOptions,
91
- ): void;
92
-
93
- removeEventListener<K extends keyof AgentRobotAvatarEventMap>(
94
- type: K,
95
- listener: (this: AgentRobotAvatar, event: AgentRobotAvatarEventMap[K]) => unknown,
96
- options?: boolean | EventListenerOptions,
97
- ): void;
98
- }
99
-
100
- export declare const VERSION: string;
101
-
102
- export default AgentRobotAvatar;
103
-
104
- declare global {
105
- interface HTMLElementTagNameMap {
106
- 'agent-robot-avatar': AgentRobotAvatar;
107
- }
108
- }
1
+ export type AgentRobotAvatarAction =
2
+ | 'idle'
3
+ | 'bored'
4
+ | 'waiting'
5
+ | 'wait'
6
+ | 'waiting-wrap'
7
+ | 'input'
8
+ | 'send'
9
+ | 'success'
10
+ | 'failure'
11
+ | 'failed'
12
+ | 'fail'
13
+ | 'warning'
14
+ | 'inspect'
15
+ | 'verify'
16
+ | 'review'
17
+ | 'angry'
18
+ | 'blocked'
19
+ | 'policy-blocked'
20
+ | 'error'
21
+ | 'system-error'
22
+ | 'connection-error'
23
+ | 'surprise'
24
+ | 'love'
25
+ | 'random'
26
+ | 'slot'
27
+ | 'sleep'
28
+ | 'wake';
29
+
30
+ export type AgentRobotAvatarState =
31
+ | 'idle'
32
+ | 'happy'
33
+ | 'sad'
34
+ | 'angry'
35
+ | 'sleepy'
36
+ | 'input'
37
+ | 'sleep'
38
+ | 'surprise'
39
+ | 'love'
40
+ | 'random'
41
+ | 'waiting'
42
+ | 'warning'
43
+ | 'error'
44
+ | 'inspect'
45
+ | 'failure'
46
+ | 'squeeze'
47
+ | 'antenna-drag';
48
+
49
+ export type AgentRobotAvatarCanonicalAction =
50
+ | 'idle'
51
+ | 'bored'
52
+ | 'waiting'
53
+ | 'input'
54
+ | 'send'
55
+ | 'success'
56
+ | 'failure'
57
+ | 'warning'
58
+ | 'inspect'
59
+ | 'angry'
60
+ | 'blocked'
61
+ | 'error'
62
+ | 'surprise'
63
+ | 'love'
64
+ | 'random'
65
+ | 'sleep'
66
+ | 'wake'
67
+ | 'reaction'
68
+ | 'squeeze'
69
+ | 'antenna-drag';
70
+
71
+ export type AgentRobotAvatarActionPhase = 'start' | 'end' | 'cancel';
72
+ export type AgentRobotAvatarActionSource = 'api' | 'interaction' | 'automatic';
73
+ export type AgentRobotAvatarWakeOn = 'activity' | 'interaction' | 'manual';
74
+ export type AgentRobotAvatarMotion = 'auto' | 'reduce' | 'full';
75
+ export interface AgentRobotAvatarWaitingOptions {
76
+ variant?: 'default' | 'wrap';
77
+ }
78
+
79
+ export interface AgentRobotAvatarActionStateDetail {
80
+ action: AgentRobotAvatarCanonicalAction;
81
+ phase: AgentRobotAvatarActionPhase;
82
+ source: AgentRobotAvatarActionSource;
83
+ }
84
+
85
+ export interface AgentRobotAvatarEventMap extends HTMLElementEventMap {
86
+ 'face-state': CustomEvent<{ state: AgentRobotAvatarState }>;
87
+ 'action-state': CustomEvent<AgentRobotAvatarActionStateDetail>;
88
+ 'head-roundness-change': CustomEvent<{ value: number; version: string }>;
89
+ }
90
+
91
+ export declare class AgentRobotAvatar extends HTMLElement {
92
+ play(action: AgentRobotAvatarAction): this | Promise<void>;
93
+ reset(): this;
94
+ sleep(): this | Promise<void>;
95
+ wake(): this | Promise<void>;
96
+ input(active?: boolean): this | Promise<void>;
97
+ startWaiting(options?: AgentRobotAvatarWaitingOptions): Promise<this>;
98
+ stopWaiting(): this;
99
+ setPointerFollow(enabled?: boolean): this;
100
+ setAntennaFlash(enabled?: boolean): this;
101
+ setPressSqueeze(enabled?: boolean): this;
102
+ setAntennaDrag(enabled?: boolean): this;
103
+ setHeadRoundness(value?: number): this;
104
+ getHeadRoundness(): number;
105
+ noteActivity(wake?: boolean): void;
106
+
107
+ addEventListener<K extends keyof AgentRobotAvatarEventMap>(
108
+ type: K,
109
+ listener: (this: AgentRobotAvatar, event: AgentRobotAvatarEventMap[K]) => unknown,
110
+ options?: boolean | AddEventListenerOptions,
111
+ ): void;
112
+
113
+ removeEventListener<K extends keyof AgentRobotAvatarEventMap>(
114
+ type: K,
115
+ listener: (this: AgentRobotAvatar, event: AgentRobotAvatarEventMap[K]) => unknown,
116
+ options?: boolean | EventListenerOptions,
117
+ ): void;
118
+ }
119
+
120
+ export declare const VERSION: string;
121
+
122
+ export default AgentRobotAvatar;
123
+
124
+ declare global {
125
+ interface HTMLElementTagNameMap {
126
+ 'agent-robot-avatar': AgentRobotAvatar;
127
+ }
128
+ }