@opentiny/tiny-robot 0.4.2-alpha.7 → 0.4.2-alpha.9
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/bubble/index.js +10 -9
- package/dist/index.d.ts +1130 -909
- package/dist/index.js +129 -118
- package/dist/index4.js +380 -317
- package/dist/index5.js +240 -187
- package/dist/index6.js +565 -514
- package/dist/layout/index.js +1243 -0
- package/dist/sender/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { B as
|
|
3
|
-
import { c as
|
|
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
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { H as
|
|
11
|
-
import { u as
|
|
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 {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
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
|
|
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
|
|
35
|
-
return e.type.startsWith(
|
|
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
|
|
44
|
+
function oe(e, r) {
|
|
44
45
|
return e.length <= r;
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
const { accept: t, multiple: o, maxSize:
|
|
48
|
-
if (!
|
|
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:
|
|
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
|
-
|
|
59
|
-
}), !o &&
|
|
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:
|
|
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,
|
|
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:
|
|
72
|
+
acceptedFiles: a,
|
|
72
73
|
rejectedFiles: s,
|
|
73
74
|
rejectionReason: { code: d, message: m }
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
return { acceptedFiles:
|
|
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
|
|
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:
|
|
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 &&
|
|
105
|
+
o || (t++, t === 1 && n(!0, e));
|
|
105
106
|
},
|
|
106
107
|
/**
|
|
107
108
|
* 拖拽覆盖
|
|
108
109
|
* @param e 事件
|
|
109
110
|
*/
|
|
110
|
-
handleDragOver: (
|
|
111
|
-
o ||
|
|
111
|
+
handleDragOver: (a) => {
|
|
112
|
+
o || a.preventDefault();
|
|
112
113
|
},
|
|
113
114
|
/**
|
|
114
115
|
* 拖拽离开
|
|
115
116
|
*/
|
|
116
117
|
handleDragLeave: () => {
|
|
117
|
-
o || (t--, t === 0 &&
|
|
118
|
+
o || (t--, t === 0 && n(!1, null));
|
|
118
119
|
},
|
|
119
120
|
/**
|
|
120
121
|
* 拖拽放下
|
|
121
122
|
* @param e 事件
|
|
122
123
|
*/
|
|
123
|
-
handleDrop: (
|
|
124
|
+
handleDrop: (a) => {
|
|
124
125
|
var p;
|
|
125
126
|
if (o) return;
|
|
126
|
-
|
|
127
|
-
const s = (p =
|
|
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: _ } =
|
|
130
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = te(h, {
|
|
130
131
|
accept: m,
|
|
131
132
|
multiple: c,
|
|
132
|
-
maxSize:
|
|
133
|
-
maxFiles:
|
|
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
|
-
},
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
], be = {
|
|
185
|
+
Q
|
|
186
|
+
], Ce = {
|
|
183
187
|
install(e) {
|
|
184
|
-
|
|
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
|
-
|
|
195
|
+
Y as ActionButton,
|
|
192
196
|
z as Anchor,
|
|
193
|
-
|
|
194
|
-
|
|
197
|
+
S as Attachments,
|
|
198
|
+
F as Bubble,
|
|
195
199
|
b as BubbleList,
|
|
196
200
|
x as BubbleProvider,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
Pe as BubbleRendererMatchPriority,
|
|
202
|
+
Ae as BubbleRenderers,
|
|
203
|
+
G as ClearButton,
|
|
200
204
|
E as Container,
|
|
201
205
|
C as Conversations,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
$ as
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
223
|
-
|
|
229
|
+
S as TrAttachments,
|
|
230
|
+
F as TrBubble,
|
|
224
231
|
b as TrBubbleList,
|
|
225
232
|
x as TrBubbleProvider,
|
|
226
|
-
|
|
233
|
+
G as TrClearButton,
|
|
227
234
|
E as TrContainer,
|
|
228
235
|
C as TrConversations,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
R as
|
|
241
|
-
|
|
242
|
-
$ as
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
};
|