@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/action-group/index.js +5 -5
- package/dist/anchor/index.js +856 -0
- package/dist/attachments/index.js +326 -269
- package/dist/bubble/index.js +10 -9
- package/dist/container/index.js +13 -13
- package/dist/dropdown-menu/index.js +17 -17
- package/dist/feedback/index.js +2 -2
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +1306 -803
- package/dist/index.js +152 -137
- package/dist/index2.js +152 -126
- package/dist/index3.js +1 -1
- package/dist/index4.js +393 -324
- package/dist/index5.js +230 -177
- package/dist/index6.js +592 -503
- package/dist/index7.js +42 -42
- package/dist/layout/index.js +1243 -0
- package/dist/mcp-server-picker/index.js +178 -177
- package/dist/sender/index.js +1575 -1467
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +12 -12
- package/dist/suggestion-popover/index.js +122 -125
- package/dist/welcome/index.js +9 -9
- package/package.json +19 -13
- package/dist/no-data.js +0 -4
package/dist/index.js
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
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
|
-
import z from "./
|
|
6
|
-
import C from "./
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import j from "./
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import w from "./
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
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
|
|
28
|
+
function re(e, r) {
|
|
27
29
|
if (!r) return !0;
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
if (
|
|
31
|
-
return e.name.toLowerCase().endsWith(
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
return e.type.startsWith(
|
|
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 ===
|
|
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
|
|
44
|
+
function oe(e, r) {
|
|
43
45
|
return e.length <= r;
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
const { accept:
|
|
47
|
-
if (!
|
|
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:
|
|
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
|
-
|
|
58
|
-
}), !
|
|
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:
|
|
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((
|
|
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:
|
|
72
|
+
acceptedFiles: a,
|
|
71
73
|
rejectedFiles: s,
|
|
72
74
|
rejectionReason: { code: d, message: m }
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
|
-
return { acceptedFiles:
|
|
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
|
|
90
|
+
const ze = {
|
|
89
91
|
/**
|
|
90
92
|
* 挂载指令
|
|
91
93
|
* @param el 元素
|
|
92
94
|
* @param binding 绑定
|
|
93
95
|
*/
|
|
94
96
|
mounted(e, r) {
|
|
95
|
-
let
|
|
96
|
-
const { disabled:
|
|
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
|
-
|
|
105
|
+
o || (t++, t === 1 && n(!0, e));
|
|
104
106
|
},
|
|
105
107
|
/**
|
|
106
108
|
* 拖拽覆盖
|
|
107
109
|
* @param e 事件
|
|
108
110
|
*/
|
|
109
|
-
handleDragOver: (
|
|
110
|
-
|
|
111
|
+
handleDragOver: (a) => {
|
|
112
|
+
o || a.preventDefault();
|
|
111
113
|
},
|
|
112
114
|
/**
|
|
113
115
|
* 拖拽离开
|
|
114
116
|
*/
|
|
115
117
|
handleDragLeave: () => {
|
|
116
|
-
|
|
118
|
+
o || (t--, t === 0 && n(!1, null));
|
|
117
119
|
},
|
|
118
120
|
/**
|
|
119
121
|
* 拖拽放下
|
|
120
122
|
* @param e 事件
|
|
121
123
|
*/
|
|
122
|
-
handleDrop: (
|
|
123
|
-
var
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
const s = (
|
|
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: _ } =
|
|
130
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = te(h, {
|
|
129
131
|
accept: m,
|
|
130
|
-
multiple:
|
|
131
|
-
maxSize:
|
|
132
|
-
maxFiles:
|
|
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
|
-
},
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
Z,
|
|
183
|
+
ee,
|
|
184
|
+
J,
|
|
185
|
+
Q
|
|
186
|
+
], Ce = {
|
|
181
187
|
install(e) {
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
e.component(`Tr${
|
|
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
|
-
|
|
190
|
-
|
|
191
|
-
S as
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
Pe as BubbleRendererMatchPriority,
|
|
202
|
+
Ae as BubbleRenderers,
|
|
203
|
+
G as ClearButton,
|
|
197
204
|
E as Container,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
233
|
+
G as TrClearButton,
|
|
223
234
|
E as TrContainer,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
Re as
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
};
|