@opentiny/tiny-robot 0.4.2-alpha.0 → 0.4.2-alpha.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.
package/dist/index.js CHANGED
@@ -1,50 +1,51 @@
1
1
  import F from "./attachments/index.js";
2
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";
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";
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";
5
+ import z from "./anchor/index.js";
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";
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";
16
17
  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";
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";
25
26
  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) {
27
+ function Q(e, r) {
27
28
  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];
29
+ const t = r.split(",").map((o) => o.trim());
30
+ return t.includes("*") ? !0 : t.some((o) => {
31
+ if (o.startsWith("."))
32
+ return e.name.toLowerCase().endsWith(o.toLowerCase());
33
+ if (o.includes("/*")) {
34
+ const a = o.split("/")[0];
34
35
  return e.type.startsWith(a + "/");
35
36
  } else
36
- return e.type === t;
37
+ return e.type === o;
37
38
  });
38
39
  }
39
40
  function v(e, r) {
40
41
  return e.size <= r;
41
42
  }
42
- function Q(e, r) {
43
+ function Z(e, r) {
43
44
  return e.length <= r;
44
45
  }
45
- function Z(e, r) {
46
- const { accept: o, multiple: t, maxSize: a, maxFiles: l } = r, n = [], s = [];
47
- if (!Q(e, l))
46
+ function ee(e, r) {
47
+ const { accept: t, multiple: o, maxSize: a, maxFiles: l } = r, n = [], s = [];
48
+ if (!Z(e, l))
48
49
  return {
49
50
  acceptedFiles: n,
50
51
  rejectedFiles: Array.from(e),
@@ -54,8 +55,8 @@ function Z(e, r) {
54
55
  }
55
56
  };
56
57
  if (e.forEach((i) => {
57
- J(i, o) && v(i, a) ? n.push(i) : s.push(i);
58
- }), !t && n.length > 1)
58
+ Q(i, t) && v(i, a) ? n.push(i) : s.push(i);
59
+ }), !o && n.length > 1)
59
60
  return {
60
61
  acceptedFiles: [],
61
62
  rejectedFiles: n,
@@ -65,7 +66,7 @@ function Z(e, r) {
65
66
  }
66
67
  };
67
68
  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})`;
69
+ const i = s.some((c) => !v(c, a)), d = i ? u.FileSizeExceeded : u.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
69
70
  return {
70
71
  acceptedFiles: n,
71
72
  rejectedFiles: s,
@@ -85,49 +86,49 @@ function T(e) {
85
86
  disabled: e.disabled || !1
86
87
  };
87
88
  }
88
- const Be = {
89
+ const Se = {
89
90
  /**
90
91
  * 挂载指令
91
92
  * @param el 元素
92
93
  * @param binding 绑定
93
94
  */
94
95
  mounted(e, r) {
95
- let o = 0;
96
- const { disabled: t, onDraggingChange: a } = r.value;
96
+ let t = 0;
97
+ const { disabled: o, onDraggingChange: a } = r.value;
97
98
  e.__vDropzoneOptions__ = T(r.value);
98
99
  const l = {
99
100
  /**
100
101
  * 拖拽进入
101
102
  */
102
103
  handleDragEnter: () => {
103
- t || (o++, o === 1 && a(!0, e));
104
+ o || (t++, t === 1 && a(!0, e));
104
105
  },
105
106
  /**
106
107
  * 拖拽覆盖
107
108
  * @param e 事件
108
109
  */
109
110
  handleDragOver: (n) => {
110
- t || n.preventDefault();
111
+ o || n.preventDefault();
111
112
  },
112
113
  /**
113
114
  * 拖拽离开
114
115
  */
115
116
  handleDragLeave: () => {
116
- t || (o--, o === 0 && a(!1, null));
117
+ o || (t--, t === 0 && a(!1, null));
117
118
  },
118
119
  /**
119
120
  * 拖拽放下
120
121
  * @param e 事件
121
122
  */
122
123
  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
+ var p;
125
+ 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
128
  if (s && s.length > 0) {
128
- const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = Z(h, {
129
+ const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = ee(h, {
129
130
  accept: m,
130
- multiple: p,
131
+ multiple: c,
131
132
  maxSize: D,
132
133
  maxFiles: g
133
134
  });
@@ -147,7 +148,7 @@ const Be = {
147
148
  unmounted(e) {
148
149
  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
150
  }
150
- }, ee = [
151
+ }, re = [
151
152
  F,
152
153
  S,
153
154
  b,
@@ -165,98 +166,101 @@ const Be = {
165
166
  H,
166
167
  R,
167
168
  W,
168
- w,
169
169
  $,
170
+ w,
170
171
  k,
171
172
  N,
172
173
  V,
173
174
  I,
174
175
  U,
175
176
  K,
176
- q,
177
- G,
178
177
  X,
179
- Y
180
- ], Fe = {
178
+ G,
179
+ J,
180
+ Y,
181
+ q
182
+ ], be = {
181
183
  install(e) {
182
- ee.forEach((r) => {
183
- const o = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
184
- e.component(`Tr${o}`, r);
184
+ re.forEach((r) => {
185
+ const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
186
+ e.component(`Tr${t}`, r);
185
187
  });
186
188
  }
187
189
  };
188
190
  export {
189
- I as ActionButton,
191
+ U as ActionButton,
192
+ z as Anchor,
190
193
  F as Attachments,
191
194
  S as Bubble,
192
195
  b as BubbleList,
193
196
  x as BubbleProvider,
194
- xe as BubbleRendererMatchPriority,
195
- Ee as BubbleRenderers,
196
- K as ClearButton,
197
+ ze as BubbleRendererMatchPriority,
198
+ Ce as BubbleRenderers,
199
+ X as ClearButton,
197
200
  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,
201
+ C as Conversations,
202
+ q as DefaultActionButtons,
203
+ P as DragOverlay,
204
+ A as DropdownMenu,
205
+ L as Feedback,
206
+ y as History,
207
+ 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,
215
218
  w as SuggestionPopover,
216
- $ as ThemeProvider,
217
- I as TrActionButton,
219
+ k as ThemeProvider,
220
+ U as TrActionButton,
221
+ z as TrAnchor,
218
222
  F as TrAttachments,
219
223
  S as TrBubble,
220
224
  b as TrBubbleList,
221
225
  x as TrBubbleProvider,
222
- K as TrClearButton,
226
+ X as TrClearButton,
223
227
  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,
228
+ C as TrConversations,
229
+ q as TrDefaultActionButtons,
230
+ P as TrDragOverlay,
231
+ A as TrDropdownMenu,
232
+ L as TrFeedback,
233
+ y as TrHistory,
234
+ 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,
240
244
  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
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
262
266
  };