@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/action-group/index.js +9 -9
- package/dist/attachments/index.js +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +11 -6
- package/dist/container/index.js +7 -7
- package/dist/drag-overlay/index.js +7 -7
- package/dist/dropdown-menu/index.js +7 -7
- package/dist/feedback/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +17 -17
- package/dist/history/index.js +1 -1
- package/dist/icon-button/index.js +1 -1
- package/dist/index.d.ts +2653 -1357
- package/dist/index.js +158 -123
- package/dist/index2.js +183 -4062
- package/dist/index3.js +266 -285
- package/dist/index4.js +380 -323
- package/dist/index5.js +510 -142
- package/dist/index6.js +301 -0
- package/dist/index7.js +161 -0
- package/dist/mcp-add-form/index.js +7 -7
- package/dist/mcp-server-picker/index.js +1 -1
- package/dist/prompts/index.js +3 -3
- package/dist/sender/index.js +3180 -1399
- package/dist/sender-actions/index.js +13 -0
- package/dist/sender-compat/index.js +229 -0
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +14 -14
- package/dist/suggestion-popover/index.js +181 -182
- package/dist/theme-provider/index.js +7 -7
- package/dist/utils.js +1 -1
- package/dist/welcome/index.js +4 -4
- package/package.json +18 -5
- package/dist/loading.js +0 -4
package/dist/index.js
CHANGED
|
@@ -1,76 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { B as
|
|
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
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
25
|
-
return
|
|
26
|
-
if (
|
|
27
|
-
return e.name.toLowerCase().endsWith(
|
|
28
|
-
if (
|
|
29
|
-
const a =
|
|
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 ===
|
|
36
|
+
return e.type === t;
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
|
-
function
|
|
39
|
+
function v(e, r) {
|
|
36
40
|
return e.size <= r;
|
|
37
41
|
}
|
|
38
|
-
function
|
|
42
|
+
function Q(e, r) {
|
|
39
43
|
return e.length <= r;
|
|
40
44
|
}
|
|
41
|
-
function
|
|
42
|
-
const { accept:
|
|
43
|
-
if (!
|
|
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:
|
|
52
|
+
code: u.FileCountExceeded,
|
|
49
53
|
message: `文件数量不能超过 ${l} 个`
|
|
50
54
|
}
|
|
51
55
|
};
|
|
52
56
|
if (e.forEach((i) => {
|
|
53
|
-
|
|
54
|
-
}), !
|
|
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:
|
|
63
|
+
code: u.FileCountExceeded,
|
|
60
64
|
message: "只允许上传一个文件"
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
if (s.length > 0) {
|
|
64
|
-
const i = s.some((
|
|
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:
|
|
72
|
+
rejectionReason: { code: d, message: m }
|
|
69
73
|
};
|
|
70
74
|
}
|
|
71
75
|
return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
|
|
72
76
|
}
|
|
73
|
-
function
|
|
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
|
|
88
|
+
const Be = {
|
|
85
89
|
/**
|
|
86
90
|
* 挂载指令
|
|
87
91
|
* @param el 元素
|
|
88
92
|
* @param binding 绑定
|
|
89
93
|
*/
|
|
90
94
|
mounted(e, r) {
|
|
91
|
-
let
|
|
92
|
-
const { disabled:
|
|
93
|
-
e.__vDropzoneOptions__ =
|
|
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
|
-
|
|
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
|
-
|
|
110
|
+
t || n.preventDefault();
|
|
107
111
|
},
|
|
108
112
|
/**
|
|
109
113
|
* 拖拽离开
|
|
110
114
|
*/
|
|
111
115
|
handleDragLeave: () => {
|
|
112
|
-
|
|
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
|
|
120
|
-
if (
|
|
121
|
-
n.preventDefault(),
|
|
122
|
-
const s = (
|
|
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
|
|
128
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: B, rejectionReason: _ } = Z(h, {
|
|
125
129
|
accept: m,
|
|
126
|
-
multiple:
|
|
127
|
-
maxSize:
|
|
128
|
-
maxFiles:
|
|
130
|
+
multiple: p,
|
|
131
|
+
maxSize: D,
|
|
132
|
+
maxFiles: g
|
|
129
133
|
});
|
|
130
|
-
|
|
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__ =
|
|
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
|
-
},
|
|
147
|
-
|
|
150
|
+
}, ee = [
|
|
151
|
+
F,
|
|
152
|
+
S,
|
|
153
|
+
b,
|
|
148
154
|
x,
|
|
149
155
|
E,
|
|
150
|
-
|
|
156
|
+
z,
|
|
157
|
+
C,
|
|
151
158
|
P,
|
|
152
|
-
|
|
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
|
-
|
|
164
|
+
H,
|
|
163
165
|
R,
|
|
164
|
-
|
|
166
|
+
j,
|
|
165
167
|
W,
|
|
168
|
+
w,
|
|
166
169
|
$,
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
171
|
-
const
|
|
172
|
-
e.component(`Tr${
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
M as
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
};
|