@opentiny/tiny-robot 0.4.2-alpha.7 → 0.4.2-alpha.8

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/dist/index.js CHANGED
@@ -1,38 +1,39 @@
1
- import F from "./attachments/index.js";
2
- import { B as S, a as b, b as x } from "./index6.js";
3
- import { c as ze, d as Ce, u as Pe, e as Ae, f as Le, g as ye, h as Oe, i as Me, j as je } from "./index6.js";
1
+ import S from "./attachments/index.js";
2
+ import { B as F, a as b, b as x } from "./index6.js";
3
+ import { c as Pe, d as Ae, u as Oe, e as Me, f as je, g as He, h as Re, i as We, j as $e, k as we } from "./index6.js";
4
4
  import E from "./container/index.js";
5
5
  import z from "./anchor/index.js";
6
6
  import C from "./conversations/index.js";
7
- import P from "./drag-overlay/index.js";
8
- import A from "./dropdown-menu/index.js";
9
- import L from "./feedback/index.js";
10
- import { H as y } from "./index7.js";
11
- import { u as Re } from "./index7.js";
7
+ import y from "./drag-overlay/index.js";
8
+ import L from "./dropdown-menu/index.js";
9
+ import P from "./feedback/index.js";
10
+ import { H as A } from "./index7.js";
11
+ import { u as Ne } from "./index7.js";
12
12
  import O from "./icon-button/index.js";
13
- import { Prompt as M, Prompts as j } from "./prompts/index.js";
14
- import H from "./sender/index.js";
15
- import R from "./sender-compat/index.js";
16
- import W, { SuggestionPillButton as $ } from "./suggestion-pills/index.js";
17
- import w from "./suggestion-popover/index.js";
18
- import k from "./theme-provider/index.js";
19
- import { useTheme as $e } from "./theme-provider/index.js";
20
- import N from "./welcome/index.js";
21
- import V from "./mcp-server-picker/index.js";
22
- import I from "./mcp-add-form/index.js";
23
- import { A as U, S as K, _ as X, W as Y, D as q } from "./index2.js";
24
- import { a as ke, u as Ne } from "./index2.js";
25
- import { _ as G, V as J } from "./index3.js";
13
+ import { Layout as M, LayoutProxyScrollbar as j, LayoutAsideToggle as H } from "./layout/index.js";
14
+ import { Prompt as R, Prompts as W } from "./prompts/index.js";
15
+ import $ from "./sender/index.js";
16
+ import w from "./sender-compat/index.js";
17
+ import k, { SuggestionPillButton as N } from "./suggestion-pills/index.js";
18
+ import V from "./suggestion-popover/index.js";
19
+ import I from "./theme-provider/index.js";
20
+ import { useTheme as Ie } from "./theme-provider/index.js";
21
+ import U from "./welcome/index.js";
22
+ import K from "./mcp-server-picker/index.js";
23
+ import X from "./mcp-add-form/index.js";
24
+ import { A as Y, S as q, _ as G, W as J, D as Q } from "./index2.js";
25
+ import { a as Ke, u as Xe } from "./index2.js";
26
+ import { _ as Z, V as ee } from "./index3.js";
26
27
  var u = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(u || {});
27
- function Q(e, r) {
28
+ function re(e, r) {
28
29
  if (!r) return !0;
29
30
  const t = r.split(",").map((o) => o.trim());
30
31
  return t.includes("*") ? !0 : t.some((o) => {
31
32
  if (o.startsWith("."))
32
33
  return e.name.toLowerCase().endsWith(o.toLowerCase());
33
34
  if (o.includes("/*")) {
34
- const a = o.split("/")[0];
35
- return e.type.startsWith(a + "/");
35
+ const n = o.split("/")[0];
36
+ return e.type.startsWith(n + "/");
36
37
  } else
37
38
  return e.type === o;
38
39
  });
@@ -40,14 +41,14 @@ function Q(e, r) {
40
41
  function v(e, r) {
41
42
  return e.size <= r;
42
43
  }
43
- function Z(e, r) {
44
+ function oe(e, r) {
44
45
  return e.length <= r;
45
46
  }
46
- function ee(e, r) {
47
- const { accept: t, multiple: o, maxSize: a, maxFiles: l } = r, n = [], s = [];
48
- if (!Z(e, l))
47
+ function te(e, r) {
48
+ const { accept: t, multiple: o, maxSize: n, maxFiles: l } = r, a = [], s = [];
49
+ if (!oe(e, l))
49
50
  return {
50
- acceptedFiles: n,
51
+ acceptedFiles: a,
51
52
  rejectedFiles: Array.from(e),
52
53
  rejectionReason: {
53
54
  code: u.FileCountExceeded,
@@ -55,25 +56,25 @@ function ee(e, r) {
55
56
  }
56
57
  };
57
58
  if (e.forEach((i) => {
58
- Q(i, t) && v(i, a) ? n.push(i) : s.push(i);
59
- }), !o && n.length > 1)
59
+ re(i, t) && v(i, n) ? a.push(i) : s.push(i);
60
+ }), !o && a.length > 1)
60
61
  return {
61
62
  acceptedFiles: [],
62
- rejectedFiles: n,
63
+ rejectedFiles: a,
63
64
  rejectionReason: {
64
65
  code: u.FileCountExceeded,
65
66
  message: "只允许上传一个文件"
66
67
  }
67
68
  };
68
69
  if (s.length > 0) {
69
- const i = s.some((c) => !v(c, a)), d = i ? u.FileSizeExceeded : u.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
70
+ const i = s.some((c) => !v(c, n)), d = i ? u.FileSizeExceeded : u.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${n / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
70
71
  return {
71
- acceptedFiles: n,
72
+ acceptedFiles: a,
72
73
  rejectedFiles: s,
73
74
  rejectionReason: { code: d, message: m }
74
75
  };
75
76
  }
76
- return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
77
+ return { acceptedFiles: a, rejectedFiles: s, rejectionReason: null };
77
78
  }
78
79
  function T(e) {
79
80
  return {
@@ -86,7 +87,7 @@ function T(e) {
86
87
  disabled: e.disabled || !1
87
88
  };
88
89
  }
89
- const Se = {
90
+ const ze = {
90
91
  /**
91
92
  * 挂载指令
92
93
  * @param el 元素
@@ -94,43 +95,43 @@ const Se = {
94
95
  */
95
96
  mounted(e, r) {
96
97
  let t = 0;
97
- const { disabled: o, onDraggingChange: a } = r.value;
98
+ const { disabled: o, onDraggingChange: n } = r.value;
98
99
  e.__vDropzoneOptions__ = T(r.value);
99
100
  const l = {
100
101
  /**
101
102
  * 拖拽进入
102
103
  */
103
104
  handleDragEnter: () => {
104
- o || (t++, t === 1 && a(!0, e));
105
+ o || (t++, t === 1 && n(!0, e));
105
106
  },
106
107
  /**
107
108
  * 拖拽覆盖
108
109
  * @param e 事件
109
110
  */
110
- handleDragOver: (n) => {
111
- o || n.preventDefault();
111
+ handleDragOver: (a) => {
112
+ o || a.preventDefault();
112
113
  },
113
114
  /**
114
115
  * 拖拽离开
115
116
  */
116
117
  handleDragLeave: () => {
117
- o || (t--, t === 0 && a(!1, null));
118
+ o || (t--, t === 0 && n(!1, null));
118
119
  },
119
120
  /**
120
121
  * 拖拽放下
121
122
  * @param e 事件
122
123
  */
123
- handleDrop: (n) => {
124
+ handleDrop: (a) => {
124
125
  var p;
125
126
  if (o) return;
126
- n.preventDefault(), t = 0, a(!1, null);
127
- const s = (p = n.dataTransfer) == null ? void 0 : p.files, { onDrop: i, onError: d, accept: m, multiple: c, maxSize: D, maxFiles: g } = e.__vDropzoneOptions__;
127
+ a.preventDefault(), t = 0, n(!1, null);
128
+ const s = (p = a.dataTransfer) == null ? void 0 : p.files, { onDrop: i, onError: d, accept: m, multiple: c, maxSize: g, maxFiles: D } = e.__vDropzoneOptions__;
128
129
  if (s && s.length > 0) {
129
- const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = ee(h, {
130
+ const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = te(h, {
130
131
  accept: m,
131
132
  multiple: c,
132
- maxSize: D,
133
- maxFiles: g
133
+ maxSize: g,
134
+ maxFiles: D
134
135
  });
135
136
  _ && d({ files: B, ..._ }), f.length > 0 && i(f);
136
137
  }
@@ -148,18 +149,18 @@ const Se = {
148
149
  unmounted(e) {
149
150
  e.__vDropzoneHandlers__ && (e.removeEventListener("dragenter", e.__vDropzoneHandlers__.handleDragEnter), e.removeEventListener("dragover", e.__vDropzoneHandlers__.handleDragOver), e.removeEventListener("dragleave", e.__vDropzoneHandlers__.handleDragLeave), e.removeEventListener("drop", e.__vDropzoneHandlers__.handleDrop), delete e.__vDropzoneHandlers__), delete e.__vDropzoneOptions__;
150
151
  }
151
- }, re = [
152
- F,
152
+ }, ae = [
153
153
  S,
154
+ F,
154
155
  b,
155
156
  x,
156
157
  E,
157
158
  z,
158
159
  C,
160
+ y,
161
+ L,
159
162
  P,
160
163
  A,
161
- L,
162
- y,
163
164
  O,
164
165
  M,
165
166
  j,
@@ -175,92 +176,102 @@ const Se = {
175
176
  U,
176
177
  K,
177
178
  X,
179
+ Y,
180
+ q,
178
181
  G,
182
+ Z,
183
+ ee,
179
184
  J,
180
- Y,
181
- q
182
- ], be = {
185
+ Q
186
+ ], Ce = {
183
187
  install(e) {
184
- re.forEach((r) => {
188
+ ae.forEach((r) => {
185
189
  const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
186
190
  e.component(`Tr${t}`, r);
187
191
  });
188
192
  }
189
193
  };
190
194
  export {
191
- U as ActionButton,
195
+ Y as ActionButton,
192
196
  z as Anchor,
193
- F as Attachments,
194
- S as Bubble,
197
+ S as Attachments,
198
+ F as Bubble,
195
199
  b as BubbleList,
196
200
  x as BubbleProvider,
197
- ze as BubbleRendererMatchPriority,
198
- Ce as BubbleRenderers,
199
- X as ClearButton,
201
+ Pe as BubbleRendererMatchPriority,
202
+ Ae as BubbleRenderers,
203
+ G as ClearButton,
200
204
  E as Container,
201
205
  C as Conversations,
202
- q as DefaultActionButtons,
203
- P as DragOverlay,
204
- A as DropdownMenu,
205
- L as Feedback,
206
- y as History,
206
+ Q as DefaultActionButtons,
207
+ y as DragOverlay,
208
+ L as DropdownMenu,
209
+ P as Feedback,
210
+ A as History,
207
211
  O as IconButton,
208
- I as McpAddForm,
209
- V as McpServerPicker,
210
- M as Prompt,
211
- j as Prompts,
212
- ke as SENDER_CONTEXT_KEY,
213
- H as Sender,
214
- R as SenderCompat,
215
- K as SubmitButton,
216
- $ as SuggestionPillButton,
217
- W as SuggestionPills,
218
- w as SuggestionPopover,
219
- k as ThemeProvider,
220
- U as TrActionButton,
212
+ M as Layout,
213
+ H as LayoutAsideToggle,
214
+ j as LayoutProxyScrollbar,
215
+ X as McpAddForm,
216
+ K as McpServerPicker,
217
+ R as Prompt,
218
+ W as Prompts,
219
+ Ke as SENDER_CONTEXT_KEY,
220
+ $ as Sender,
221
+ w as SenderCompat,
222
+ q as SubmitButton,
223
+ N as SuggestionPillButton,
224
+ k as SuggestionPills,
225
+ V as SuggestionPopover,
226
+ I as ThemeProvider,
227
+ Y as TrActionButton,
221
228
  z as TrAnchor,
222
- F as TrAttachments,
223
- S as TrBubble,
229
+ S as TrAttachments,
230
+ F as TrBubble,
224
231
  b as TrBubbleList,
225
232
  x as TrBubbleProvider,
226
- X as TrClearButton,
233
+ G as TrClearButton,
227
234
  E as TrContainer,
228
235
  C as TrConversations,
229
- q as TrDefaultActionButtons,
230
- P as TrDragOverlay,
231
- A as TrDropdownMenu,
232
- L as TrFeedback,
233
- y as TrHistory,
236
+ Q as TrDefaultActionButtons,
237
+ y as TrDragOverlay,
238
+ L as TrDropdownMenu,
239
+ P as TrFeedback,
240
+ A as TrHistory,
234
241
  O as TrIconButton,
235
- I as TrMcpAddForm,
236
- V as TrMcpServerPicker,
237
- M as TrPrompt,
238
- j as TrPrompts,
239
- H as TrSender,
240
- R as TrSenderCompat,
241
- K as TrSubmitButton,
242
- $ as TrSuggestionPillButton,
243
- W as TrSuggestionPills,
244
- w as TrSuggestionPopover,
245
- k as TrThemeProvider,
246
- G as TrUploadButton,
247
- J as TrVoiceButton,
248
- N as TrWelcome,
249
- Y as TrWordCounter,
250
- G as UploadButton,
251
- J as VoiceButton,
252
- N as Welcome,
253
- Y as WordCounter,
254
- be as default,
255
- Pe as useAutoScroll,
256
- Ae as useBubbleBoxRenderer,
257
- Le as useBubbleContentRenderer,
258
- ye as useBubbleStateChangeFn,
259
- Oe as useMessageContent,
260
- Me as useOmitMessageFields,
261
- Ne as useSenderContext,
262
- $e as useTheme,
263
- je as useToolCall,
264
- Re as useTouchDevice,
265
- Se as vDropzone
242
+ M as TrLayout,
243
+ H as TrLayoutAsideToggle,
244
+ j as TrLayoutProxyScrollbar,
245
+ X as TrMcpAddForm,
246
+ K as TrMcpServerPicker,
247
+ R as TrPrompt,
248
+ W as TrPrompts,
249
+ $ as TrSender,
250
+ w as TrSenderCompat,
251
+ q as TrSubmitButton,
252
+ N as TrSuggestionPillButton,
253
+ k as TrSuggestionPills,
254
+ V as TrSuggestionPopover,
255
+ I as TrThemeProvider,
256
+ Z as TrUploadButton,
257
+ ee as TrVoiceButton,
258
+ U as TrWelcome,
259
+ J as TrWordCounter,
260
+ Z as UploadButton,
261
+ ee as VoiceButton,
262
+ U as Welcome,
263
+ J as WordCounter,
264
+ Ce as default,
265
+ Oe as useAutoScroll,
266
+ Me as useBubbleBoxRenderer,
267
+ je as useBubbleContentRenderer,
268
+ He as useBubbleEventFn,
269
+ Re as useBubbleStateChangeFn,
270
+ We as useMessageContent,
271
+ $e as useOmitMessageFields,
272
+ Xe as useSenderContext,
273
+ Ie as useTheme,
274
+ we as useToolCall,
275
+ Ne as useTouchDevice,
276
+ ze as vDropzone
266
277
  };