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