@opentiny/tiny-robot 0.3.1-alpha.5 → 0.3.1-alpha.7
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 +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +6 -4014
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/history/index.js +1 -1
- package/dist/index.d.ts +1210 -2235
- package/dist/index.js +104 -135
- package/dist/index2.js +4062 -183
- package/dist/index3.js +285 -261
- package/dist/index4.js +329 -362
- package/dist/index5.js +146 -286
- package/dist/mcp-add-form/index.js +1 -1
- package/dist/mcp-server-picker/index.js +58 -57
- package/dist/sender/index.js +1480 -6
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +2 -2
- package/dist/utils.js +1 -1
- package/package.json +3 -13
- package/dist/chat-input/index.js +0 -3151
- package/dist/chat-input-actions/index.js +0 -13
- package/dist/index6.js +0 -161
- package/dist/sender-compat/index.js +0 -233
package/dist/index.js
CHANGED
|
@@ -1,51 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { H as
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import { Prompt as
|
|
13
|
-
import
|
|
14
|
-
import j from "./sender-compat/index.js";
|
|
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";
|
|
15
14
|
import M, { SuggestionPillButton as w } from "./suggestion-pills/index.js";
|
|
16
15
|
import R from "./suggestion-popover/index.js";
|
|
17
|
-
import
|
|
18
|
-
import { useTheme as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
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";
|
|
21
20
|
import I from "./mcp-add-form/index.js";
|
|
22
|
-
import { A as N, S as U, _ as q, W as G, D as J } from "./index2.js";
|
|
23
|
-
import { u as ye } from "./index2.js";
|
|
24
|
-
import { _ as K, V as Q } from "./index3.js";
|
|
25
|
-
import { W as Oe, u as We } from "./index3.js";
|
|
26
21
|
var d = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(d || {});
|
|
27
|
-
function
|
|
22
|
+
function N(e, r) {
|
|
28
23
|
if (!r) return !0;
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
if (
|
|
32
|
-
return e.name.toLowerCase().endsWith(
|
|
33
|
-
if (
|
|
34
|
-
const a =
|
|
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];
|
|
35
30
|
return e.type.startsWith(a + "/");
|
|
36
31
|
} else
|
|
37
|
-
return e.type ===
|
|
32
|
+
return e.type === o;
|
|
38
33
|
});
|
|
39
34
|
}
|
|
40
35
|
function _(e, r) {
|
|
41
36
|
return e.size <= r;
|
|
42
37
|
}
|
|
43
|
-
function
|
|
38
|
+
function q(e, r) {
|
|
44
39
|
return e.length <= r;
|
|
45
40
|
}
|
|
46
|
-
function
|
|
47
|
-
const { accept:
|
|
48
|
-
if (!
|
|
41
|
+
function G(e, r) {
|
|
42
|
+
const { accept: t, multiple: o, maxSize: a, maxFiles: l } = r, n = [], s = [];
|
|
43
|
+
if (!q(e, l))
|
|
49
44
|
return {
|
|
50
45
|
acceptedFiles: n,
|
|
51
46
|
rejectedFiles: Array.from(e),
|
|
@@ -55,8 +50,8 @@ function Z(e, r) {
|
|
|
55
50
|
}
|
|
56
51
|
};
|
|
57
52
|
if (e.forEach((i) => {
|
|
58
|
-
|
|
59
|
-
}), !
|
|
53
|
+
N(i, t) && _(i, a) ? n.push(i) : s.push(i);
|
|
54
|
+
}), !o && n.length > 1)
|
|
60
55
|
return {
|
|
61
56
|
acceptedFiles: [],
|
|
62
57
|
rejectedFiles: n,
|
|
@@ -66,11 +61,11 @@ function Z(e, r) {
|
|
|
66
61
|
}
|
|
67
62
|
};
|
|
68
63
|
if (s.length > 0) {
|
|
69
|
-
const i = s.some((
|
|
64
|
+
const i = s.some((c) => !_(c, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
|
|
70
65
|
return {
|
|
71
66
|
acceptedFiles: n,
|
|
72
67
|
rejectedFiles: s,
|
|
73
|
-
rejectionReason: { code:
|
|
68
|
+
rejectionReason: { code: p, message: m }
|
|
74
69
|
};
|
|
75
70
|
}
|
|
76
71
|
return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
|
|
@@ -86,53 +81,53 @@ function D(e) {
|
|
|
86
81
|
disabled: e.disabled || !1
|
|
87
82
|
};
|
|
88
83
|
}
|
|
89
|
-
const
|
|
84
|
+
const pe = {
|
|
90
85
|
/**
|
|
91
86
|
* 挂载指令
|
|
92
87
|
* @param el 元素
|
|
93
88
|
* @param binding 绑定
|
|
94
89
|
*/
|
|
95
90
|
mounted(e, r) {
|
|
96
|
-
let
|
|
97
|
-
const { disabled:
|
|
91
|
+
let t = 0;
|
|
92
|
+
const { disabled: o, onDraggingChange: a } = r.value;
|
|
98
93
|
e.__vDropzoneOptions__ = D(r.value);
|
|
99
94
|
const l = {
|
|
100
95
|
/**
|
|
101
96
|
* 拖拽进入
|
|
102
97
|
*/
|
|
103
98
|
handleDragEnter: () => {
|
|
104
|
-
|
|
99
|
+
o || (t++, t === 1 && a(!0, e));
|
|
105
100
|
},
|
|
106
101
|
/**
|
|
107
102
|
* 拖拽覆盖
|
|
108
103
|
* @param e 事件
|
|
109
104
|
*/
|
|
110
105
|
handleDragOver: (n) => {
|
|
111
|
-
|
|
106
|
+
o || n.preventDefault();
|
|
112
107
|
},
|
|
113
108
|
/**
|
|
114
109
|
* 拖拽离开
|
|
115
110
|
*/
|
|
116
111
|
handleDragLeave: () => {
|
|
117
|
-
|
|
112
|
+
o || (t--, t === 0 && a(!1, null));
|
|
118
113
|
},
|
|
119
114
|
/**
|
|
120
115
|
* 拖拽放下
|
|
121
116
|
* @param e 事件
|
|
122
117
|
*/
|
|
123
118
|
handleDrop: (n) => {
|
|
124
|
-
var
|
|
125
|
-
if (
|
|
126
|
-
n.preventDefault(),
|
|
127
|
-
const s = (
|
|
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__;
|
|
128
123
|
if (s && s.length > 0) {
|
|
129
|
-
const
|
|
124
|
+
const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
|
|
130
125
|
accept: m,
|
|
131
|
-
multiple:
|
|
132
|
-
maxSize:
|
|
133
|
-
maxFiles:
|
|
126
|
+
multiple: c,
|
|
127
|
+
maxSize: g,
|
|
128
|
+
maxFiles: h
|
|
134
129
|
});
|
|
135
|
-
|
|
130
|
+
f && p({ files: F, ...f }), v.length > 0 && i(v);
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
};
|
|
@@ -148,110 +143,84 @@ const Se = {
|
|
|
148
143
|
unmounted(e) {
|
|
149
144
|
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
145
|
}
|
|
151
|
-
},
|
|
152
|
-
F,
|
|
153
|
-
B,
|
|
154
|
-
x,
|
|
146
|
+
}, J = [
|
|
155
147
|
z,
|
|
156
|
-
|
|
148
|
+
x,
|
|
157
149
|
E,
|
|
158
|
-
|
|
150
|
+
S,
|
|
159
151
|
P,
|
|
152
|
+
b,
|
|
160
153
|
L,
|
|
161
|
-
|
|
154
|
+
B,
|
|
155
|
+
C,
|
|
162
156
|
y,
|
|
163
|
-
H,
|
|
164
157
|
O,
|
|
165
|
-
|
|
158
|
+
A,
|
|
159
|
+
H,
|
|
166
160
|
j,
|
|
167
161
|
M,
|
|
168
162
|
w,
|
|
169
163
|
R,
|
|
170
|
-
$,
|
|
171
164
|
k,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
q,
|
|
177
|
-
K,
|
|
178
|
-
Q,
|
|
179
|
-
G,
|
|
180
|
-
J
|
|
181
|
-
], Fe = {
|
|
165
|
+
W,
|
|
166
|
+
$,
|
|
167
|
+
I
|
|
168
|
+
], me = {
|
|
182
169
|
install(e) {
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
e.component(`Tr${
|
|
170
|
+
J.forEach((r) => {
|
|
171
|
+
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
172
|
+
e.component(`Tr${t}`, r);
|
|
186
173
|
});
|
|
187
174
|
}
|
|
188
175
|
};
|
|
189
176
|
export {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
L as Feedback,
|
|
204
|
-
A as History,
|
|
205
|
-
y as IconButton,
|
|
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,
|
|
206
190
|
I as McpAddForm,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
j as SenderCompat,
|
|
212
|
-
U as SubmitButton,
|
|
191
|
+
$ as McpServerPicker,
|
|
192
|
+
A as Prompt,
|
|
193
|
+
H as Prompts,
|
|
194
|
+
j as Sender,
|
|
213
195
|
w as SuggestionPillButton,
|
|
214
196
|
M as SuggestionPills,
|
|
215
197
|
R as SuggestionPopover,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
L as TrFeedback,
|
|
229
|
-
A as TrHistory,
|
|
230
|
-
y as TrIconButton,
|
|
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,
|
|
231
210
|
I as TrMcpAddForm,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
j as TrSenderCompat,
|
|
237
|
-
U as TrSubmitButton,
|
|
211
|
+
$ as TrMcpServerPicker,
|
|
212
|
+
A as TrPrompt,
|
|
213
|
+
H as TrPrompts,
|
|
214
|
+
j as TrSender,
|
|
238
215
|
w as TrSuggestionPillButton,
|
|
239
216
|
M as TrSuggestionPills,
|
|
240
217
|
R as TrSuggestionPopover,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
k as Welcome,
|
|
250
|
-
G as WordCounter,
|
|
251
|
-
Fe as default,
|
|
252
|
-
ye as useSenderContext,
|
|
253
|
-
We as useSpeechHandler,
|
|
254
|
-
Le as useTheme,
|
|
255
|
-
be as useTouchDevice,
|
|
256
|
-
Se as vDropzone
|
|
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
|
|
257
226
|
};
|