@opentiny/tiny-robot 0.3.1-alpha.6 → 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 +8 -8
- package/dist/attachments/index.js +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +11 -4014
- package/dist/container/index.js +7 -7
- package/dist/drag-overlay/index.js +6 -6
- package/dist/dropdown-menu/index.js +7 -7
- package/dist/feedback/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +16 -16
- package/dist/history/index.js +1 -1
- package/dist/icon-button/index.js +1 -1
- package/dist/index.d.ts +942 -673
- package/dist/index.js +108 -104
- package/dist/index2.js +90 -90
- package/dist/index3.js +155 -150
- package/dist/index4.js +319 -295
- package/dist/index5.js +507 -279
- package/dist/index6.js +286 -146
- package/dist/index7.js +161 -0
- package/dist/mcp-add-form/index.js +6 -6
- package/dist/mcp-server-picker/index.js +58 -57
- package/dist/prompts/index.js +3 -3
- package/dist/sender/index.js +3261 -6
- package/dist/sender-compat/index.js +105 -109
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +13 -13
- package/dist/suggestion-popover/index.js +181 -182
- package/dist/theme-provider/index.js +7 -7
- package/dist/welcome/index.js +4 -4
- package/package.json +8 -5
- package/dist/chat-input/index.js +0 -3151
- package/dist/loading.js +0 -4
- /package/dist/{chat-input-actions → sender-actions}/index.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as H, computed as
|
|
2
|
-
import
|
|
3
|
-
import { _ as z, V as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, computed as p, ref as R, openBlock as g, createBlock as b, unref as S, createSlots as J, withCtx as r, renderSlot as i, normalizeProps as y, mergeProps as k, createCommentVNode as d, guardReactiveProps as B } from "vue";
|
|
2
|
+
import V from "../sender/index.js";
|
|
3
|
+
import { _ as z, V as W } from "../index3.js";
|
|
4
|
+
const w = /* @__PURE__ */ H({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
autofocus: { type: Boolean },
|
|
@@ -28,125 +28,119 @@ const k = /* @__PURE__ */ H({
|
|
|
28
28
|
stopText: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["update:modelValue", "update:templateData", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template", "files-selected"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
get: () =>
|
|
31
|
+
setup(t, { expose: L, emit: P }) {
|
|
32
|
+
const c = t, l = P, $ = p({
|
|
33
|
+
get: () => c.modelValue ?? "",
|
|
34
34
|
set: (e) => {
|
|
35
|
-
|
|
35
|
+
l("update:modelValue", e);
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
37
|
+
}), j = p(() => c.defaultValue), u = R(), v = R(), D = p(() => {
|
|
38
38
|
var n;
|
|
39
39
|
const e = [];
|
|
40
|
-
if ((n =
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
items:
|
|
45
|
-
popupWidth:
|
|
46
|
-
activeSuggestionKeys:
|
|
40
|
+
if ((n = c.suggestions) != null && n.length) {
|
|
41
|
+
const s = V.Suggestion;
|
|
42
|
+
s && e.push(
|
|
43
|
+
s.configure({
|
|
44
|
+
items: c.suggestions,
|
|
45
|
+
popupWidth: c.suggestionPopupWidth,
|
|
46
|
+
activeSuggestionKeys: c.activeSuggestionKeys,
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
-
onSelect: (
|
|
49
|
-
|
|
48
|
+
onSelect: (a) => {
|
|
49
|
+
l("suggestion-select", a.content);
|
|
50
50
|
}
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
}),
|
|
57
|
-
var
|
|
54
|
+
const o = V.Template;
|
|
55
|
+
return o && e.push(o.configure({})), e;
|
|
56
|
+
}), I = p(() => {
|
|
57
|
+
var o;
|
|
58
58
|
const e = {};
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}), G = h(() => {
|
|
64
|
-
if (typeof l.speech != "boolean")
|
|
65
|
-
return l.speech;
|
|
59
|
+
return (o = c.buttonGroup) != null && o.submit && (e.submit = c.buttonGroup.submit), Object.keys(e).length > 0 ? e : void 0;
|
|
60
|
+
}), C = p(() => {
|
|
61
|
+
if (typeof c.speech != "boolean")
|
|
62
|
+
return c.speech;
|
|
66
63
|
}), K = (e) => {
|
|
67
|
-
var
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
64
|
+
var s;
|
|
65
|
+
const o = (s = u.value) == null ? void 0 : s.editor;
|
|
66
|
+
if (!o) {
|
|
70
67
|
console.warn("[sender-compat] Editor not ready, cannot set template data");
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
73
70
|
if (!e || e.length === 0) {
|
|
74
|
-
|
|
71
|
+
o.commands.clearContent();
|
|
75
72
|
return;
|
|
76
73
|
}
|
|
77
74
|
const n = e.map(
|
|
78
|
-
(
|
|
75
|
+
(a) => a.type === "template" ? { ...a, type: "block" } : a
|
|
79
76
|
);
|
|
80
|
-
|
|
77
|
+
o.commands.setTemplateData(n), o.commands.focusFirstTemplate();
|
|
81
78
|
}, O = (e) => {
|
|
82
|
-
|
|
79
|
+
l("submit", e);
|
|
83
80
|
}, A = () => {
|
|
84
|
-
|
|
81
|
+
l("clear");
|
|
85
82
|
}, N = () => {
|
|
86
|
-
|
|
83
|
+
l("cancel");
|
|
87
84
|
}, U = (e) => {
|
|
88
|
-
|
|
85
|
+
l("focus", e);
|
|
89
86
|
}, q = (e) => {
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
|
|
87
|
+
l("blur", e);
|
|
88
|
+
}, T = (e) => {
|
|
89
|
+
l("files-selected", e);
|
|
90
|
+
}, G = () => {
|
|
91
|
+
l("speech-start");
|
|
95
92
|
}, x = (e) => {
|
|
96
|
-
|
|
93
|
+
l("speech-end", e);
|
|
97
94
|
}, E = (e) => {
|
|
98
|
-
|
|
95
|
+
l("speech-interim", e);
|
|
99
96
|
}, F = (e) => {
|
|
100
|
-
|
|
97
|
+
l("speech-error", e);
|
|
101
98
|
};
|
|
102
|
-
return
|
|
99
|
+
return L({
|
|
103
100
|
focus: () => {
|
|
104
|
-
var e,
|
|
105
|
-
(
|
|
101
|
+
var e, o;
|
|
102
|
+
(o = (e = u.value) == null ? void 0 : e.focus) == null || o.call(e);
|
|
106
103
|
},
|
|
107
104
|
blur: () => {
|
|
108
|
-
var e,
|
|
109
|
-
(
|
|
105
|
+
var e, o;
|
|
106
|
+
(o = (e = u.value) == null ? void 0 : e.blur) == null || o.call(e);
|
|
110
107
|
},
|
|
111
108
|
clear: () => {
|
|
112
|
-
var e,
|
|
113
|
-
(
|
|
109
|
+
var e, o;
|
|
110
|
+
(o = (e = u.value) == null ? void 0 : e.clear) == null || o.call(e);
|
|
114
111
|
},
|
|
115
112
|
submit: () => {
|
|
116
|
-
var e,
|
|
117
|
-
(
|
|
113
|
+
var e, o;
|
|
114
|
+
(o = (e = u.value) == null ? void 0 : e.submit) == null || o.call(e);
|
|
118
115
|
},
|
|
119
116
|
setTemplateData: K,
|
|
120
117
|
startSpeech: () => {
|
|
121
118
|
var e;
|
|
122
|
-
(e =
|
|
119
|
+
(e = v.value) == null || e.start();
|
|
123
120
|
},
|
|
124
121
|
stopSpeech: () => {
|
|
125
122
|
var e;
|
|
126
|
-
(e =
|
|
123
|
+
(e = v.value) == null || e.stop();
|
|
127
124
|
}
|
|
128
|
-
}), (e,
|
|
129
|
-
ref_key: "
|
|
130
|
-
ref:
|
|
131
|
-
modelValue:
|
|
132
|
-
"onUpdate:modelValue": [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
extensions: j.value,
|
|
148
|
-
"default-actions": D.value,
|
|
149
|
-
"stop-text": o.stopText,
|
|
125
|
+
}), (e, o) => (g(), b(S(V), {
|
|
126
|
+
ref_key: "senderRef",
|
|
127
|
+
ref: u,
|
|
128
|
+
modelValue: $.value,
|
|
129
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => $.value = n),
|
|
130
|
+
"default-value": j.value,
|
|
131
|
+
mode: t.mode,
|
|
132
|
+
placeholder: t.placeholder,
|
|
133
|
+
disabled: t.disabled,
|
|
134
|
+
loading: t.loading,
|
|
135
|
+
"submit-type": t.submitType,
|
|
136
|
+
"max-length": t.maxLength,
|
|
137
|
+
"show-word-limit": t.showWordLimit,
|
|
138
|
+
"auto-size": t.autoSize,
|
|
139
|
+
clearable: t.clearable,
|
|
140
|
+
autofocus: t.autofocus,
|
|
141
|
+
extensions: D.value,
|
|
142
|
+
"default-actions": I.value,
|
|
143
|
+
"stop-text": t.stopText,
|
|
150
144
|
onSubmit: O,
|
|
151
145
|
onClear: A,
|
|
152
146
|
onCancel: N,
|
|
@@ -154,43 +148,45 @@ const k = /* @__PURE__ */ H({
|
|
|
154
148
|
onBlur: q
|
|
155
149
|
}, J({
|
|
156
150
|
"actions-inline": r((n) => {
|
|
157
|
-
var
|
|
151
|
+
var s, a, m, f, h;
|
|
158
152
|
return [
|
|
159
|
-
|
|
160
|
-
...(
|
|
161
|
-
tooltip: (
|
|
162
|
-
}, { onSelect:
|
|
163
|
-
|
|
153
|
+
t.allowFiles && t.mode === "single" ? (g(), b(S(z), k({ key: 0 }, {
|
|
154
|
+
...(s = t.buttonGroup) == null ? void 0 : s.file,
|
|
155
|
+
tooltip: (m = (a = t.buttonGroup) == null ? void 0 : a.file) == null ? void 0 : m.tooltips
|
|
156
|
+
}, { onSelect: T }), null, 16)) : d("", !0),
|
|
157
|
+
t.allowSpeech && t.mode === "single" ? (g(), b(S(W), {
|
|
164
158
|
key: 1,
|
|
165
159
|
ref_key: "voiceRef",
|
|
166
|
-
ref:
|
|
167
|
-
"speech-config":
|
|
168
|
-
icon: (
|
|
169
|
-
onSpeechStart:
|
|
160
|
+
ref: v,
|
|
161
|
+
"speech-config": C.value,
|
|
162
|
+
icon: (h = (f = t.buttonGroup) == null ? void 0 : f.voice) == null ? void 0 : h.icon,
|
|
163
|
+
onSpeechStart: G,
|
|
170
164
|
onSpeechEnd: x,
|
|
171
165
|
onSpeechInterim: E,
|
|
172
166
|
onSpeechError: F
|
|
173
167
|
}, null, 8, ["speech-config", "icon"])) : d("", !0),
|
|
174
|
-
e.$slots.actions ? i(e.$slots, "actions",
|
|
168
|
+
e.$slots.actions ? i(e.$slots, "actions", y(k({ key: 2 }, n))) : d("", !0)
|
|
175
169
|
];
|
|
176
170
|
}),
|
|
177
171
|
footer: r((n) => [
|
|
178
|
-
i(e.$slots, "footer-left",
|
|
179
|
-
i(e.$slots, "footer",
|
|
172
|
+
i(e.$slots, "footer-left", y(B(n))),
|
|
173
|
+
i(e.$slots, "footer", y(B(n)))
|
|
180
174
|
]),
|
|
181
175
|
"footer-right": r((n) => {
|
|
182
|
-
var
|
|
176
|
+
var s, a, m, f, h;
|
|
183
177
|
return [
|
|
184
|
-
e.$slots["footer-right"] ? i(e.$slots, "footer-right",
|
|
185
|
-
|
|
186
|
-
...(
|
|
187
|
-
tooltip: (
|
|
188
|
-
}, { onSelect:
|
|
189
|
-
|
|
178
|
+
e.$slots["footer-right"] ? i(e.$slots, "footer-right", y(k({ key: 0 }, n))) : d("", !0),
|
|
179
|
+
t.allowFiles && t.mode === "multiple" ? (g(), b(S(z), k({ key: 1 }, {
|
|
180
|
+
...(s = t.buttonGroup) == null ? void 0 : s.file,
|
|
181
|
+
tooltip: (m = (a = t.buttonGroup) == null ? void 0 : a.file) == null ? void 0 : m.tooltips
|
|
182
|
+
}, { onSelect: T }), null, 16)) : d("", !0),
|
|
183
|
+
t.allowSpeech && t.mode === "multiple" ? (g(), b(S(W), {
|
|
190
184
|
key: 2,
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
ref_key: "voiceRef",
|
|
186
|
+
ref: v,
|
|
187
|
+
"speech-config": C.value,
|
|
188
|
+
icon: (h = (f = t.buttonGroup) == null ? void 0 : f.voice) == null ? void 0 : h.icon,
|
|
189
|
+
onSpeechStart: G,
|
|
194
190
|
onSpeechEnd: x,
|
|
195
191
|
onSpeechInterim: E,
|
|
196
192
|
onSpeechError: F
|
|
@@ -216,18 +212,18 @@ const k = /* @__PURE__ */ H({
|
|
|
216
212
|
e.$slots.content ? {
|
|
217
213
|
name: "content",
|
|
218
214
|
fn: r((n) => [
|
|
219
|
-
i(e.$slots, "content",
|
|
215
|
+
i(e.$slots, "content", y(B(n)))
|
|
220
216
|
]),
|
|
221
217
|
key: "2"
|
|
222
218
|
} : void 0
|
|
223
219
|
]), 1032, ["modelValue", "default-value", "mode", "placeholder", "disabled", "loading", "submit-type", "max-length", "show-word-limit", "auto-size", "clearable", "autofocus", "extensions", "default-actions", "stop-text"]));
|
|
224
220
|
}
|
|
225
221
|
});
|
|
226
|
-
|
|
227
|
-
const M = function(
|
|
228
|
-
|
|
222
|
+
w.name = "TrSenderCompat";
|
|
223
|
+
const M = function(t) {
|
|
224
|
+
t.component(w.name, w);
|
|
229
225
|
};
|
|
230
|
-
|
|
226
|
+
w.install = M;
|
|
231
227
|
export {
|
|
232
|
-
|
|
228
|
+
w as default
|
|
233
229
|
};
|