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