@ray-js/t-agent 0.1.0-beta-2 → 0.1.0-beta-4
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.
- package/README-zh_CN.md +90 -32
- package/README.md +93 -36
- package/dist/chat/ChatAgent.d.ts +0 -5
- package/dist/chat/ChatAgent.js +0 -20
- package/package.json +2 -2
package/README-zh_CN.md
CHANGED
|
@@ -339,6 +339,13 @@ await message.show();
|
|
|
339
339
|
- `message.bubble.setInfo` 方法,设置气泡信息
|
|
340
340
|
- `message.bubble.initWithInputBlocks` 方法,用输入块初始化气泡
|
|
341
341
|
|
|
342
|
+
**气泡消息支持长按操作**,可以进行复制、删除等操作,同时在消息加载和更新过程中会有动画显示。
|
|
343
|
+
|
|
344
|
+
气泡消息支持以下长按操作:
|
|
345
|
+
|
|
346
|
+
- 复制:复制消息文本内容
|
|
347
|
+
- 删除:删除当前消息
|
|
348
|
+
|
|
342
349
|
### 生命周期
|
|
343
350
|
|
|
344
351
|
ChatAgent 在不同的阶段会触发不同的 Hook,开发者可以通过注册 Hook 来实现自定义行为,下面的时序图展示了 ChatAgent 的生命周期。
|
|
@@ -1053,6 +1060,7 @@ props:
|
|
|
1053
1060
|
|
|
1054
1061
|
- `className` 容器的类名
|
|
1055
1062
|
- `createAgent` 创建 `ChatAgent` 的函数,在 `ChatContainer` 挂载后会调用这个函数创建 `ChatAgent` 实例
|
|
1063
|
+
- `agentRef` 用于获取 `ChatAgent` 实例的 ref
|
|
1056
1064
|
- `renderOptions` 渲染选项,用于决定 `MessageList` 中各个元素的渲染方式,具体参照下面的 renderOptions 自定义渲染 部分
|
|
1057
1065
|
- `renderTileAs` 该函数决定如何在消息中渲染 tile
|
|
1058
1066
|
- `customBlockTypes` 自定义 block 类型,只有在这里注册的 block 类型才会被 `renderCustomBlockAs` 渲染
|
|
@@ -1320,25 +1328,30 @@ const renderOptions = {
|
|
|
1320
1328
|
```my-block
|
|
1321
1329
|
Hello, world!
|
|
1322
1330
|
```
|
|
1331
|
+
````
|
|
1323
1332
|
|
|
1324
1333
|
以下 fence 没有注册过,不会被渲染成自定义 block,仅当做普通的代码块渲染。
|
|
1325
1334
|
|
|
1326
1335
|
```javascript
|
|
1327
1336
|
console.log('Hello, world!');
|
|
1328
1337
|
```
|
|
1329
|
-
|
|
1338
|
+
|
|
1339
|
+
```
|
|
1330
1340
|
|
|
1331
1341
|
渲染结果如下:
|
|
1332
1342
|
|
|
1333
1343
|
```
|
|
1344
|
+
|
|
1334
1345
|
这是我的自定义 block!
|
|
1335
1346
|
This is My Block
|
|
1336
1347
|
Hello, world!
|
|
1337
1348
|
以下 fence 没有注册过,不会被渲染成自定义 block,仅当做普通的代码块渲染。
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1349
|
+
|
|
1350
|
+
---
|
|
1351
|
+
|
|
1352
|
+
## | console.log('Hello, world!'); |
|
|
1353
|
+
|
|
1354
|
+
````
|
|
1342
1355
|
|
|
1343
1356
|
### getStaticResourceBizType
|
|
1344
1357
|
|
|
@@ -1351,7 +1364,7 @@ const renderOptions = {
|
|
|
1351
1364
|
...defaultRenderOptions,
|
|
1352
1365
|
getStaticResourceBizType: (src: string, scene: string) => 'bizType',
|
|
1353
1366
|
};
|
|
1354
|
-
|
|
1367
|
+
````
|
|
1355
1368
|
|
|
1356
1369
|
针对不同的场景,你可以需要不同的 `bizType`,你可以根据 `src` 和 `scene` 来返回不同的 `bizType`。
|
|
1357
1370
|
|
|
@@ -1385,29 +1398,74 @@ const renderOptions = {
|
|
|
1385
1398
|
|
|
1386
1399
|
以下是内置的多语言 key:
|
|
1387
1400
|
|
|
1388
|
-
| key | 使用场景
|
|
1389
|
-
| -------------------------------------------------- |
|
|
1390
|
-
| t-agent.build-in.button.create_scene_manually | ButtonTile 内置按钮
|
|
1391
|
-
| t-agent.build-in.button.enter_home_manage | ButtonTile 内置按钮
|
|
1392
|
-
| t-agent.build-in.button.enter_room_manage | ButtonTile 内置按钮
|
|
1393
|
-
| t-agent.build-in.button.enter_alarm_message | ButtonTile 内置按钮
|
|
1394
|
-
| t-agent.build-in.button.enter_home_message | ButtonTile 内置按钮
|
|
1395
|
-
| t-agent.build-in.button.enter_bulletin | ButtonTile 内置按钮
|
|
1396
|
-
| t-agent.build-in.button.enter_notification_setting | ButtonTile 内置按钮
|
|
1397
|
-
| t-agent.build-in.button.enter_personal_information | ButtonTile 内置按钮
|
|
1398
|
-
| t-agent.build-in.button.enter_account_security | ButtonTile 内置按钮
|
|
1399
|
-
| t-agent.build-in.button.enter_setting | ButtonTile 内置按钮
|
|
1400
|
-
| t-agent.build-in.button.enter_paring | ButtonTile 内置按钮
|
|
1401
|
-
| t-agent.build-in.button.enter_share_device | ButtonTile 内置按钮
|
|
1402
|
-
| t-agent.build-in.button.enter_faq_feedback | ButtonTile 内置按钮
|
|
1403
|
-
| t-agent.build-in.button.questionnaire_take | ButtonTile 内置按钮
|
|
1404
|
-
| t-agent.build-in.button.set_home_location | ButtonTile 内置按钮
|
|
1405
|
-
| t-agent.input.voice.require-permission | MessageInput 切换语音输入
|
|
1406
|
-
| t-agent.input.upload.failed | MessageInput 上传文件
|
|
1407
|
-
| t-agent.message.feedback.success | BubbleTile 消息评价
|
|
1408
|
-
| t-agent.message.bubble.aborted | BubbleTile 消息
|
|
1409
|
-
| t-agent.message.action.copy | BubbleTile 长按菜单
|
|
1410
|
-
| t-agent.message.action.delete | BubbleTile 长按菜单
|
|
1411
|
-
| t-agent.message.action.deleteByChannel | BubbleTile 长按菜单
|
|
1412
|
-
| t-agent.message.
|
|
1413
|
-
| t-agent.message.
|
|
1401
|
+
| key | 使用场景 | 含义 |
|
|
1402
|
+
| -------------------------------------------------- | --------------------------- | ------------------------------ |
|
|
1403
|
+
| t-agent.build-in.button.create_scene_manually | ButtonTile 内置按钮 | 手动创建场景 |
|
|
1404
|
+
| t-agent.build-in.button.enter_home_manage | ButtonTile 内置按钮 | 进入"家庭管理" |
|
|
1405
|
+
| t-agent.build-in.button.enter_room_manage | ButtonTile 内置按钮 | 进入"房间管理" |
|
|
1406
|
+
| t-agent.build-in.button.enter_alarm_message | ButtonTile 内置按钮 | 进入"告警消息列表" |
|
|
1407
|
+
| t-agent.build-in.button.enter_home_message | ButtonTile 内置按钮 | 进入"家庭消息列表" |
|
|
1408
|
+
| t-agent.build-in.button.enter_bulletin | ButtonTile 内置按钮 | 进入"通知消息列表" |
|
|
1409
|
+
| t-agent.build-in.button.enter_notification_setting | ButtonTile 内置按钮 | 进入"消息推送设置" |
|
|
1410
|
+
| t-agent.build-in.button.enter_personal_information | ButtonTile 内置按钮 | 进入"个人资料" |
|
|
1411
|
+
| t-agent.build-in.button.enter_account_security | ButtonTile 内置按钮 | 进入"账号与安全" |
|
|
1412
|
+
| t-agent.build-in.button.enter_setting | ButtonTile 内置按钮 | 进入"通用设置" |
|
|
1413
|
+
| t-agent.build-in.button.enter_paring | ButtonTile 内置按钮 | 进入"设备配网" |
|
|
1414
|
+
| t-agent.build-in.button.enter_share_device | ButtonTile 内置按钮 | 进入"设备分享" |
|
|
1415
|
+
| t-agent.build-in.button.enter_faq_feedback | ButtonTile 内置按钮 | 进入"常见问题与反馈" |
|
|
1416
|
+
| t-agent.build-in.button.questionnaire_take | ButtonTile 内置按钮 | 填写问卷 |
|
|
1417
|
+
| t-agent.build-in.button.set_home_location | ButtonTile 内置按钮 | 设置家庭位置 |
|
|
1418
|
+
| t-agent.input.voice.require-permission | MessageInput 切换语音输入 | 需要授权录音权限 |
|
|
1419
|
+
| t-agent.input.upload.failed | MessageInput 上传文件 | 文件上传失败 |
|
|
1420
|
+
| t-agent.message.feedback.success | BubbleTile 消息评价 | 反馈成功 |
|
|
1421
|
+
| t-agent.message.bubble.aborted | BubbleTile 消息 | 用户中断 |
|
|
1422
|
+
| t-agent.message.action.copy | BubbleTile 长按菜单 | 复制消息 |
|
|
1423
|
+
| t-agent.message.action.delete | BubbleTile 长按菜单 | 删除消息 |
|
|
1424
|
+
| t-agent.message.action.deleteByChannel | BubbleTile 长按菜单 | 删除所有渠道消息 |
|
|
1425
|
+
| t-agent.message.copy.success | BubbleTile 复制成功 | 复制成功 |
|
|
1426
|
+
| t-agent.message.delete.success | BubbleTile 删除成功 | 删除成功 |
|
|
1427
|
+
| t-agent.message.delete.title | BubbleTile 删除消息弹窗标题 | 删除消息 |
|
|
1428
|
+
| t-agent.message.delete.content | BubbleTile 删除消息弹窗内容 | 确定要删除这条消息吗? |
|
|
1429
|
+
| t-agent.message.action.like | BubbleTile 长按菜单 | 喜欢消息 |
|
|
1430
|
+
| t-agent.message.action.unlike | BubbleTile 长按菜单 | 不喜欢消息 |
|
|
1431
|
+
| t-agent.message.like.success | BubbleTile 反馈 | 喜欢成功 |
|
|
1432
|
+
| t-agent.message.unlike.success | BubbleTile 反馈 | 不喜欢成功 |
|
|
1433
|
+
| t-agent.execute-card-tile.execution.success | ExecuteCardTile 执行结果 | 执行成功 |
|
|
1434
|
+
| t-agent.execute-card-tile.execution.failed | ExecuteCardTile 执行结果 | 执行失败 |
|
|
1435
|
+
| t-agent.execute-card-tile.scene.invalid | ExecuteCardTile 场景状态 | 场景失效 |
|
|
1436
|
+
| t-agent.execute-card-tile.delete | ExecuteCardTile 按钮 | 删除 |
|
|
1437
|
+
| t-agent.execute-card-tile.execute | ExecuteCardTile 按钮 | 执行 |
|
|
1438
|
+
| t-agent.execute-card-tile.switch.scene.state | ExecuteCardTile 操作 | 切换场景状态 |
|
|
1439
|
+
| t-agent.operate-card-tile.open.device.failed | OperateCardTile 操作结果 | 打开设备失败 |
|
|
1440
|
+
| t-agent.operate-card-tile.open.scene.failed | OperateCardTile 操作结果 | 打开场景失败 |
|
|
1441
|
+
| t-agent.operate-card-tile.operation.impact | OperateCardTile 标题 | 本次操作影响: |
|
|
1442
|
+
| t-agent.operate-card-tile.hide.details | OperateCardTile 按钮 | 收起详情 |
|
|
1443
|
+
| t-agent.operate-card-tile.view.details | OperateCardTile 按钮 | 查看详情 |
|
|
1444
|
+
| t-agent.operate-card-tile.device.move.desc | OperateCardTile 设备移动 | 设备"{device}"移动到"{room}" |
|
|
1445
|
+
| t-agent.operate-card-tile.device.rename.desc | OperateCardTile 设备重命名 | 设备"{oldName}"改名"{newName}" |
|
|
1446
|
+
| t-agent.operate-card-tile.device.count | OperateCardTile 设备计数 | {count}个设备 |
|
|
1447
|
+
| t-agent.operate-card-tile.scene.count | OperateCardTile 场景计数 | {count}个场景 |
|
|
1448
|
+
| t-agent.operate-card-tile.home.count | OperateCardTile 家庭计数 | {count}个家庭 |
|
|
1449
|
+
| t-agent.operate-card-tile.room.count | OperateCardTile 房间计数 | {count}个房间 |
|
|
1450
|
+
| t-agent.operate-card-tile.group.count | OperateCardTile 群组计数 | {count}个群组 |
|
|
1451
|
+
| t-agent.operate-card-tile.description.format | OperateCardTile 描述格式 | {items}。 |
|
|
1452
|
+
| t-agent.operate-card-tile.description.separator | OperateCardTile 描述分隔符 | , |
|
|
1453
|
+
| t-agent.expand.tab.device | ExpandTile 标签页 | 设备 |
|
|
1454
|
+
| t-agent.expand.tab.scene | ExpandTile 标签页 | 场景 |
|
|
1455
|
+
| t-agent.expand.tab.more | ExpandTile 标签页 | 其他 |
|
|
1456
|
+
| t-agent.expand.execution.success | ExpandTile 执行结果 | 执行成功 |
|
|
1457
|
+
| t-agent.expand.execution.failed | ExpandTile 执行结果 | 执行失败 |
|
|
1458
|
+
| t-agent.expand.device.rename | ExpandTile 设备重命名 | {oldName}改名成{newName} |
|
|
1459
|
+
| t-agent.expand.scene.rename | ExpandTile 场景重命名 | {oldName}改名成{newName} |
|
|
1460
|
+
| t-agent.expand.scene.one-click | ExpandTile 场景类型 | 一键执行 |
|
|
1461
|
+
| t-agent.expand.scene.auto | ExpandTile 场景类型 | 自动执行 |
|
|
1462
|
+
| t-agent.expand.no.details | ExpandTile 无内容提示 | 没有可显示的详情内容 |
|
|
1463
|
+
|
|
1464
|
+
# 更新日志
|
|
1465
|
+
|
|
1466
|
+
## 最新版本
|
|
1467
|
+
|
|
1468
|
+
- **气泡消息加载动画**:消息在加载和更新状态下会显示适当的动画效果,提升用户体验
|
|
1469
|
+
- **气泡消息长按操作**:支持长按消息进行复制和删除等操作,其中助手消息还支持按渠道删除
|
|
1470
|
+
- **OperateCardTile**:操作卡片组件,支持自定义详情内容展示
|
|
1471
|
+
- **ExecuteCardTile**:执行卡片组件
|
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ export default function ChatPage() {
|
|
|
112
112
|
|
|
113
113
|
# t-agent
|
|
114
114
|
|
|
115
|
-
The t-agent package, crafted in TypeScript, is a dialogue agent SDK for building feature-rich dialogue interactions, supporting plugins to enhance functionality. As a pure SDK, it doesn
|
|
115
|
+
The t-agent package, crafted in TypeScript, is a dialogue agent SDK for building feature-rich dialogue interactions, supporting plugins to enhance functionality. As a pure SDK, it doesn't contain UI components, allowing flexibility to work with any framework.
|
|
116
116
|
|
|
117
117
|
## Basic Concepts
|
|
118
118
|
|
|
@@ -335,6 +335,13 @@ For bubble messages, additional properties and methods include:
|
|
|
335
335
|
- `message.bubble.setInfo` Configures bubble info
|
|
336
336
|
- `message.bubble.initWithInputBlocks` Initializes bubble with input blocks
|
|
337
337
|
|
|
338
|
+
**Bubble messages support long press operations**, allowing for copy and delete functions, and animations will be displayed during message loading and updating.
|
|
339
|
+
|
|
340
|
+
Bubble messages support the following long press operations:
|
|
341
|
+
|
|
342
|
+
- Copy: Copy the message text content
|
|
343
|
+
- Delete: Delete the current message
|
|
344
|
+
|
|
338
345
|
### Lifecycle
|
|
339
346
|
|
|
340
347
|
ChatAgent phases trigger hooks enabling developers to integrate custom behavior efficiently. Below is the lifecycle depiction:
|
|
@@ -732,7 +739,6 @@ mock.hooks.hook('getAIAssistantGroupHistory', context => {
|
|
|
732
739
|
|
|
733
740
|
### Mock AI Assistant Response
|
|
734
741
|
|
|
735
|
-
````
|
|
736
742
|
```tsx
|
|
737
743
|
import { mock } from '@ray-js/t-agent-plugin-assistant';
|
|
738
744
|
|
|
@@ -781,7 +787,7 @@ mock.hooks.hook('sendToAssistant', context => {
|
|
|
781
787
|
};
|
|
782
788
|
}
|
|
783
789
|
});
|
|
784
|
-
|
|
790
|
+
```
|
|
785
791
|
|
|
786
792
|
### mock ASR Speech Recognition
|
|
787
793
|
|
|
@@ -1001,7 +1007,7 @@ import { useEffect } from 'react';
|
|
|
1001
1007
|
async function getPictureList() {
|
|
1002
1008
|
// Retrieve the user's private picture list from the cloud
|
|
1003
1009
|
const list = await pictureListRequest();
|
|
1004
|
-
// Set into the cache this way, so it won
|
|
1010
|
+
// Set into the cache this way, so it won't need to request next time
|
|
1005
1011
|
for (const item of list) {
|
|
1006
1012
|
setUrlByCloudKey(item.path, item.displayUrl);
|
|
1007
1013
|
}
|
|
@@ -1048,6 +1054,7 @@ props:
|
|
|
1048
1054
|
|
|
1049
1055
|
- `className` Class name of the container
|
|
1050
1056
|
- `createAgent` Function to create `ChatAgent`, which will call this function to create `ChatAgent` instance after `ChatContainer` mount
|
|
1057
|
+
- `agentRef` Reference to the `ChatAgent` instance, used to get the `ChatAgent` instance outside the `ChatContainer`
|
|
1051
1058
|
- `renderOptions` Rendering options, used to decide the rendering method of each element in `MessageList`, refer to the renderOptions custom rendering part below
|
|
1052
1059
|
- `renderTileAs` This function decides how to render tiles in the messages
|
|
1053
1060
|
- `customBlockTypes` Custom block types, only block types registered here will be rendered by `renderCustomBlockAs`
|
|
@@ -1315,25 +1322,30 @@ This is my custom block!
|
|
|
1315
1322
|
```my-block
|
|
1316
1323
|
Hello, world!
|
|
1317
1324
|
```
|
|
1325
|
+
````
|
|
1318
1326
|
|
|
1319
1327
|
The following fence is not registered, and will not be rendered as a custom block, but just as a regular code block.
|
|
1320
1328
|
|
|
1321
1329
|
```javascript
|
|
1322
1330
|
console.log('Hello, world!');
|
|
1323
1331
|
```
|
|
1324
|
-
|
|
1332
|
+
|
|
1333
|
+
```
|
|
1325
1334
|
|
|
1326
1335
|
The rendered result is as follows:
|
|
1327
1336
|
|
|
1328
1337
|
```
|
|
1338
|
+
|
|
1329
1339
|
This is my custom block!
|
|
1330
1340
|
This is My Block
|
|
1331
1341
|
Hello, world!
|
|
1332
1342
|
The following fence is not registered, and will not be rendered as a custom block, but just as a regular code block.
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1343
|
+
|
|
1344
|
+
---
|
|
1345
|
+
|
|
1346
|
+
## | console.log('Hello, world!'); |
|
|
1347
|
+
|
|
1348
|
+
````
|
|
1337
1349
|
|
|
1338
1350
|
### getStaticResourceBizType
|
|
1339
1351
|
|
|
@@ -1346,7 +1358,7 @@ const renderOptions = {
|
|
|
1346
1358
|
...defaultRenderOptions,
|
|
1347
1359
|
getStaticResourceBizType: (src: string, scene: string) => 'bizType',
|
|
1348
1360
|
};
|
|
1349
|
-
|
|
1361
|
+
````
|
|
1350
1362
|
|
|
1351
1363
|
For different scenarios, you may require different `bizType`. You can return different `bizType` based on `src` and `scene`.
|
|
1352
1364
|
|
|
@@ -1380,29 +1392,74 @@ const renderOptions = {
|
|
|
1380
1392
|
|
|
1381
1393
|
Below are the built-in multilingual keys:
|
|
1382
1394
|
|
|
1383
|
-
| key | Usage Context
|
|
1384
|
-
| -------------------------------------------------- |
|
|
1385
|
-
| t-agent.build-in.button.create_scene_manually | Built-in ButtonTile button
|
|
1386
|
-
| t-agent.build-in.button.enter_home_manage | Built-in ButtonTile button
|
|
1387
|
-
| t-agent.build-in.button.enter_room_manage | Built-in ButtonTile button
|
|
1388
|
-
| t-agent.build-in.button.enter_alarm_message | Built-in ButtonTile button
|
|
1389
|
-
| t-agent.build-in.button.enter_home_message | Built-in ButtonTile button
|
|
1390
|
-
| t-agent.build-in.button.enter_bulletin | Built-in ButtonTile button
|
|
1391
|
-
| t-agent.build-in.button.enter_notification_setting | Built-in ButtonTile button
|
|
1392
|
-
| t-agent.build-in.button.enter_personal_information | Built-in ButtonTile button
|
|
1393
|
-
| t-agent.build-in.button.enter_account_security | Built-in ButtonTile button
|
|
1394
|
-
| t-agent.build-in.button.enter_setting | Built-in ButtonTile button
|
|
1395
|
-
| t-agent.build-in.button.enter_paring | Built-in ButtonTile button
|
|
1396
|
-
| t-agent.build-in.button.enter_share_device | Built-in ButtonTile button
|
|
1397
|
-
| t-agent.build-in.button.enter_faq_feedback | Built-in ButtonTile button
|
|
1398
|
-
| t-agent.build-in.button.questionnaire_take | Built-in ButtonTile button
|
|
1399
|
-
| t-agent.build-in.button.set_home_location | Built-in ButtonTile button
|
|
1400
|
-
| t-agent.input.voice.require-permission | MessageInput switch to voice input
|
|
1401
|
-
| t-agent.input.upload.failed | MessageInput file upload
|
|
1402
|
-
| t-agent.message.feedback.success | BubbleTile message feedback
|
|
1403
|
-
| t-agent.message.bubble.aborted | BubbleTile message
|
|
1404
|
-
| t-agent.message.action.copy | BubbleTile long press menu
|
|
1405
|
-
| t-agent.message.action.delete | BubbleTile long press menu
|
|
1406
|
-
| t-agent.message.action.deleteByChannel | BubbleTile long press menu
|
|
1407
|
-
| t-agent.message.
|
|
1408
|
-
| t-agent.message.
|
|
1395
|
+
| key | Usage Context | Meaning |
|
|
1396
|
+
| -------------------------------------------------- | ---------------------------------------- | ----------------------------------------- |
|
|
1397
|
+
| t-agent.build-in.button.create_scene_manually | Built-in ButtonTile button | Manually create scene |
|
|
1398
|
+
| t-agent.build-in.button.enter_home_manage | Built-in ButtonTile button | Enter _"Home Management"_ |
|
|
1399
|
+
| t-agent.build-in.button.enter_room_manage | Built-in ButtonTile button | Enter _"Room Management"_ |
|
|
1400
|
+
| t-agent.build-in.button.enter_alarm_message | Built-in ButtonTile button | Enter _"Alarm Message List"_ |
|
|
1401
|
+
| t-agent.build-in.button.enter_home_message | Built-in ButtonTile button | Enter _"Home Message List"_ |
|
|
1402
|
+
| t-agent.build-in.button.enter_bulletin | Built-in ButtonTile button | Enter _"Bulletin Message List"_ |
|
|
1403
|
+
| t-agent.build-in.button.enter_notification_setting | Built-in ButtonTile button | Enter _"Notification Settings"_ |
|
|
1404
|
+
| t-agent.build-in.button.enter_personal_information | Built-in ButtonTile button | Enter _"Personal Information"_ |
|
|
1405
|
+
| t-agent.build-in.button.enter_account_security | Built-in ButtonTile button | Enter _"Account and Security"_ |
|
|
1406
|
+
| t-agent.build-in.button.enter_setting | Built-in ButtonTile button | Enter _"General Settings"_ |
|
|
1407
|
+
| t-agent.build-in.button.enter_paring | Built-in ButtonTile button | Enter _"Device Pairing"_ |
|
|
1408
|
+
| t-agent.build-in.button.enter_share_device | Built-in ButtonTile button | Enter _"Share Device"_ |
|
|
1409
|
+
| t-agent.build-in.button.enter_faq_feedback | Built-in ButtonTile button | Enter _"FAQs and Feedback"_ |
|
|
1410
|
+
| t-agent.build-in.button.questionnaire_take | Built-in ButtonTile button | Take the questionnaire |
|
|
1411
|
+
| t-agent.build-in.button.set_home_location | Built-in ButtonTile button | Set home location |
|
|
1412
|
+
| t-agent.input.voice.require-permission | MessageInput switch to voice input | Need to grant recording permission |
|
|
1413
|
+
| t-agent.input.upload.failed | MessageInput file upload | File upload failed |
|
|
1414
|
+
| t-agent.message.feedback.success | BubbleTile message feedback | Feedback successful |
|
|
1415
|
+
| t-agent.message.bubble.aborted | BubbleTile message | User aborted |
|
|
1416
|
+
| t-agent.message.action.copy | BubbleTile long press menu | Copy message |
|
|
1417
|
+
| t-agent.message.action.delete | BubbleTile long press menu | Delete message |
|
|
1418
|
+
| t-agent.message.action.deleteByChannel | BubbleTile long press menu | Delete all channel messages |
|
|
1419
|
+
| t-agent.message.copy.success | BubbleTile copy success | Copy successful |
|
|
1420
|
+
| t-agent.message.delete.success | BubbleTile delete success | Delete successful |
|
|
1421
|
+
| t-agent.message.delete.title | BubbleTile delete message dialog title | Delete message |
|
|
1422
|
+
| t-agent.message.delete.content | BubbleTile delete message dialog content | Are you sure to delete this message? |
|
|
1423
|
+
| t-agent.message.action.like | BubbleTile long press menu | Like message |
|
|
1424
|
+
| t-agent.message.action.unlike | BubbleTile long press menu | Dislike message |
|
|
1425
|
+
| t-agent.message.like.success | BubbleTile feedback | Like successful |
|
|
1426
|
+
| t-agent.message.unlike.success | BubbleTile feedback | Dislike successful |
|
|
1427
|
+
| t-agent.execute-card-tile.execution.success | ExecuteCardTile execution result | Execution successful |
|
|
1428
|
+
| t-agent.execute-card-tile.execution.failed | ExecuteCardTile execution result | Execution failed |
|
|
1429
|
+
| t-agent.execute-card-tile.scene.invalid | ExecuteCardTile scene status | Scene invalid |
|
|
1430
|
+
| t-agent.execute-card-tile.delete | ExecuteCardTile button | Delete |
|
|
1431
|
+
| t-agent.execute-card-tile.execute | ExecuteCardTile button | Execute |
|
|
1432
|
+
| t-agent.execute-card-tile.switch.scene.state | ExecuteCardTile operation | Switch scene state |
|
|
1433
|
+
| t-agent.operate-card-tile.open.device.failed | OperateCardTile operation result | Failed to open device |
|
|
1434
|
+
| t-agent.operate-card-tile.open.scene.failed | OperateCardTile operation result | Failed to open scene |
|
|
1435
|
+
| t-agent.operate-card-tile.operation.impact | OperateCardTile title | Operation impact: |
|
|
1436
|
+
| t-agent.operate-card-tile.hide.details | OperateCardTile button | Hide details |
|
|
1437
|
+
| t-agent.operate-card-tile.view.details | OperateCardTile button | View details |
|
|
1438
|
+
| t-agent.operate-card-tile.device.move.desc | OperateCardTile device move | Device "{device}" moved to "{room}" |
|
|
1439
|
+
| t-agent.operate-card-tile.device.rename.desc | OperateCardTile device rename | Device "{oldName}" renamed to "{newName}" |
|
|
1440
|
+
| t-agent.operate-card-tile.device.count | OperateCardTile device count | {count} devices |
|
|
1441
|
+
| t-agent.operate-card-tile.scene.count | OperateCardTile scene count | {count} scenes |
|
|
1442
|
+
| t-agent.operate-card-tile.home.count | OperateCardTile home count | {count} homes |
|
|
1443
|
+
| t-agent.operate-card-tile.room.count | OperateCardTile room count | {count} rooms |
|
|
1444
|
+
| t-agent.operate-card-tile.group.count | OperateCardTile group count | {count} groups |
|
|
1445
|
+
| t-agent.operate-card-tile.description.format | OperateCardTile description format | {items}. |
|
|
1446
|
+
| t-agent.operate-card-tile.description.separator | OperateCardTile description separator | , |
|
|
1447
|
+
| t-agent.expand.tab.device | ExpandTile tab | Devices |
|
|
1448
|
+
| t-agent.expand.tab.scene | ExpandTile tab | Scenes |
|
|
1449
|
+
| t-agent.expand.tab.more | ExpandTile tab | Others |
|
|
1450
|
+
| t-agent.expand.execution.success | ExpandTile execution result | Execution successful |
|
|
1451
|
+
| t-agent.expand.execution.failed | ExpandTile execution result | Execution failed |
|
|
1452
|
+
| t-agent.expand.device.rename | ExpandTile device rename | {oldName} renamed to {newName} |
|
|
1453
|
+
| t-agent.expand.scene.rename | ExpandTile scene rename | {oldName} renamed to {newName} |
|
|
1454
|
+
| t-agent.expand.scene.one-click | ExpandTile scene type | One-click execution |
|
|
1455
|
+
| t-agent.expand.scene.auto | ExpandTile scene type | Automatic execution |
|
|
1456
|
+
| t-agent.expand.no.details | ExpandTile no content prompt | No details available |
|
|
1457
|
+
|
|
1458
|
+
# Change Log
|
|
1459
|
+
|
|
1460
|
+
## Latest Version
|
|
1461
|
+
|
|
1462
|
+
- **Bubble message loading animation**: Messages will display appropriate animations during loading and updating states to enhance user experience
|
|
1463
|
+
- **Bubble message long press operations**: Support copying and deleting operations by long-pressing messages, and assistant messages also support deletion by channel
|
|
1464
|
+
- **OperateCardTile**: Operate card component, support custom detail content display
|
|
1465
|
+
- **ExecuteCardTile**: Execute card component
|
package/dist/chat/ChatAgent.d.ts
CHANGED
|
@@ -145,11 +145,6 @@ export default class ChatAgent<P extends Record<string, unknown> = Record<string
|
|
|
145
145
|
* @param messageId message id
|
|
146
146
|
*/
|
|
147
147
|
removeMessage: (messageId: string) => Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* 按channel删除消息
|
|
150
|
-
* @param channel
|
|
151
|
-
*/
|
|
152
|
-
removeMessageByChannel: (channel: string) => void;
|
|
153
148
|
/**
|
|
154
149
|
* Start a stream to show the response from the StreamResponseInstance, which will trigger the onMessageUpdate hook
|
|
155
150
|
*
|
package/dist/chat/ChatAgent.js
CHANGED
|
@@ -5,8 +5,6 @@ const _excluded = ["hooks"];
|
|
|
5
5
|
import "core-js/modules/es.symbol.description.js";
|
|
6
6
|
import "core-js/modules/es.symbol.async-iterator.js";
|
|
7
7
|
import "core-js/modules/es.promise.finally.js";
|
|
8
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
9
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
10
8
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
11
9
|
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
12
10
|
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function (r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function () { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function (r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function (r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
|
|
@@ -174,24 +172,6 @@ export default class ChatAgent {
|
|
|
174
172
|
await message.remove();
|
|
175
173
|
});
|
|
176
174
|
});
|
|
177
|
-
/**
|
|
178
|
-
* 按channel删除消息
|
|
179
|
-
* @param channel
|
|
180
|
-
*/
|
|
181
|
-
_defineProperty(this, "removeMessageByChannel", channel => {
|
|
182
|
-
this.runWithCatchError(async () => {
|
|
183
|
-
try {
|
|
184
|
-
const assistant = this.plugins.assistant;
|
|
185
|
-
if (assistant !== null && assistant !== void 0 && assistant.removeMessageByChannel) {
|
|
186
|
-
await assistant.removeMessageByChannel(channel);
|
|
187
|
-
} else {
|
|
188
|
-
this.session.messages.values().forEach(message => message.remove());
|
|
189
|
-
}
|
|
190
|
-
} catch (error) {
|
|
191
|
-
this.session.messages.values().forEach(message => message.remove());
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
175
|
/**
|
|
196
176
|
* Start a stream to show the response from the StreamResponseInstance, which will trigger the onMessageUpdate hook
|
|
197
177
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/t-agent",
|
|
3
|
-
"version": "0.1.0-beta-
|
|
3
|
+
"version": "0.1.0-beta-4",
|
|
4
4
|
"author": "Tuya.inc",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"build": "ray build --type=component --output dist",
|
|
27
27
|
"clean": "rimraf ./dist"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "c637b234c10a43611ed395ce06b8d85f3f83bbce"
|
|
30
30
|
}
|