@ray-js/t-agent 0.2.0-beta-5 → 0.2.0-beta-7

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.
@@ -92,17 +92,20 @@ export default class ChatBubbleTile extends ChatTile {
92
92
  } else if (block.type === 'image_path') {
93
93
  this.message.addTile('file', {
94
94
  mimeType: 'image',
95
- path: block.image_path.path
95
+ path: block.image_path.path,
96
+ size: block.image_path.size || 0
96
97
  });
97
98
  } else if (block.type === 'video_path') {
98
99
  this.message.addTile('file', {
99
100
  mimeType: 'video',
100
- path: block.video_path.path
101
+ path: block.video_path.path,
102
+ size: block.video_path.size || 0
101
103
  });
102
104
  } else if (block.type === 'file_path') {
103
105
  this.message.addTile('file', {
104
106
  mimeType: block.file_path.mime_pype || 'application/octet-stream',
105
- path: block.file_path.path
107
+ path: block.file_path.path,
108
+ size: block.file_path.size || 0
106
109
  });
107
110
  }
108
111
  }
@@ -3,6 +3,7 @@ export default class StreamResponse implements StreamResponseInstance {
3
3
  private partStream;
4
4
  private reader;
5
5
  private aborted;
6
+ get started(): boolean;
6
7
  /**
7
8
  * Create a new StreamResponse instance.
8
9
  *
@@ -3,6 +3,10 @@ import _awaitAsyncGenerator from "@babel/runtime/helpers/esm/awaitAsyncGenerator
3
3
  import _wrapAsyncGenerator from "@babel/runtime/helpers/esm/wrapAsyncGenerator";
4
4
  import "core-js/modules/es.symbol.async-iterator.js";
5
5
  export default class StreamResponse {
6
+ get started() {
7
+ return !!this.reader;
8
+ }
9
+
6
10
  /**
7
11
  * Create a new StreamResponse instance.
8
12
  *
@@ -19,6 +19,7 @@ export type FileTileData = RequireAtLeastOne<{
19
19
  name?: string;
20
20
  path?: string;
21
21
  src?: string;
22
+ size: number;
22
23
  }, 'path' | 'src'>;
23
24
  export interface ImageTileData {
24
25
  src: string;
@@ -181,6 +182,7 @@ export type StreamRequestInstance = {
181
182
  blocks: InputBlock[];
182
183
  };
183
184
  export type StreamResponseInstance = {
185
+ started: boolean;
184
186
  parts: () => AsyncIterable<MessagePart>;
185
187
  cancel: (reason: any) => Promise<void>;
186
188
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent",
3
- "version": "0.2.0-beta-5",
3
+ "version": "0.2.0-beta-7",
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": "a0beda17c8e1c3ef81c718300c02a23d88a3ee4a"
29
+ "gitHead": "622a593292ba773b94c6257f7c117d6a2c7baff9"
30
30
  }