@opentiny/tiny-robot 0.4.2-alpha.0 → 0.4.2-alpha.10

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