@opentiny/tiny-robot 0.3.0-rc.2 → 0.3.0-rc.4
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/index.d.ts +83 -40
- package/dist/index.js +35 -31
- package/dist/mcp-add-form/index.js +212 -0
- package/dist/mcp-server-picker/index.js +312 -486
- package/dist/sender/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1861,6 +1861,8 @@ export declare interface ActionButtonsProps {
|
|
|
1861
1861
|
stopText?: string;
|
|
1862
1862
|
}
|
|
1863
1863
|
|
|
1864
|
+
export declare type AddType = 'form' | 'code';
|
|
1865
|
+
|
|
1864
1866
|
export declare type Attachment = UrlAttachment | RawFileAttachment;
|
|
1865
1867
|
|
|
1866
1868
|
export declare interface AttachmentListEmits {
|
|
@@ -1917,7 +1919,7 @@ declare interface BaseTextItem {
|
|
|
1917
1919
|
content: string;
|
|
1918
1920
|
}
|
|
1919
1921
|
|
|
1920
|
-
declare const Bubble: typeof
|
|
1922
|
+
declare const Bubble: typeof _default_18 & {
|
|
1921
1923
|
install: typeof bubbleInstall;
|
|
1922
1924
|
};
|
|
1923
1925
|
export { Bubble }
|
|
@@ -1974,7 +1976,7 @@ export declare type BubbleContentRenderer = BubbleContentFunctionRenderer | Bubb
|
|
|
1974
1976
|
|
|
1975
1977
|
declare const bubbleInstall: (app: App) => void;
|
|
1976
1978
|
|
|
1977
|
-
declare const BubbleList: typeof
|
|
1979
|
+
declare const BubbleList: typeof _default_19 & {
|
|
1978
1980
|
install: typeof bubbleListInstall;
|
|
1979
1981
|
};
|
|
1980
1982
|
export { BubbleList }
|
|
@@ -2034,7 +2036,7 @@ export declare interface BubbleProps extends BubbleCommonProps {
|
|
|
2034
2036
|
aborted?: boolean;
|
|
2035
2037
|
}
|
|
2036
2038
|
|
|
2037
|
-
declare const BubbleProvider: typeof
|
|
2039
|
+
declare const BubbleProvider: typeof _default_20 & {
|
|
2038
2040
|
install: typeof bubbleProviderInstall;
|
|
2039
2041
|
};
|
|
2040
2042
|
export { BubbleProvider }
|
|
@@ -2099,43 +2101,49 @@ declare const _default: {
|
|
|
2099
2101
|
};
|
|
2100
2102
|
export default _default;
|
|
2101
2103
|
|
|
2102
|
-
declare const _default_10: typeof
|
|
2104
|
+
declare const _default_10: typeof _default_29 & {
|
|
2103
2105
|
install: typeof install_8;
|
|
2104
2106
|
};
|
|
2105
2107
|
export { _default_10 as Sender }
|
|
2106
2108
|
export { _default_10 as TrSender }
|
|
2107
2109
|
|
|
2108
|
-
declare const _default_11: typeof
|
|
2110
|
+
declare const _default_11: typeof _default_31 & {
|
|
2109
2111
|
install: typeof install_9;
|
|
2110
2112
|
};
|
|
2111
2113
|
export { _default_11 as SuggestionPills }
|
|
2112
2114
|
export { _default_11 as TrSuggestionPills }
|
|
2113
2115
|
|
|
2114
|
-
declare const _default_12: typeof
|
|
2116
|
+
declare const _default_12: typeof _default_32 & {
|
|
2115
2117
|
install: typeof install_10;
|
|
2116
2118
|
};
|
|
2117
2119
|
export { _default_12 as SuggestionPopover }
|
|
2118
2120
|
export { _default_12 as TrSuggestionPopover }
|
|
2119
2121
|
|
|
2120
|
-
declare const _default_13: typeof
|
|
2122
|
+
declare const _default_13: typeof _default_33 & {
|
|
2121
2123
|
install: typeof install_11;
|
|
2122
2124
|
};
|
|
2123
2125
|
export { _default_13 as ThemeProvider }
|
|
2124
2126
|
export { _default_13 as TrThemeProvider }
|
|
2125
2127
|
|
|
2126
|
-
declare const _default_14: typeof
|
|
2128
|
+
declare const _default_14: typeof _default_34 & {
|
|
2127
2129
|
install: typeof install_12;
|
|
2128
2130
|
};
|
|
2129
2131
|
export { _default_14 as TrWelcome }
|
|
2130
2132
|
export { _default_14 as Welcome }
|
|
2131
2133
|
|
|
2132
|
-
declare const _default_15: typeof
|
|
2134
|
+
declare const _default_15: typeof _default_35 & {
|
|
2133
2135
|
install: typeof install_13;
|
|
2134
2136
|
};
|
|
2135
2137
|
export { _default_15 as McpServerPicker }
|
|
2136
2138
|
export { _default_15 as TrMcpServerPicker }
|
|
2137
2139
|
|
|
2138
|
-
declare const _default_16:
|
|
2140
|
+
declare const _default_16: typeof _default_36 & {
|
|
2141
|
+
install: typeof install_14;
|
|
2142
|
+
};
|
|
2143
|
+
export { _default_16 as McpAddForm }
|
|
2144
|
+
export { _default_16 as TrMcpAddForm }
|
|
2145
|
+
|
|
2146
|
+
declare const _default_17: DefineComponent<AttachmentListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2139
2147
|
"update:items": (items: Attachment[]) => any;
|
|
2140
2148
|
remove: (file: Attachment) => any;
|
|
2141
2149
|
download: (event: MouseEvent, file: Attachment) => any;
|
|
@@ -2161,29 +2169,29 @@ fileMatchers: FileTypeMatcher_2[];
|
|
|
2161
2169
|
variant: DisplayVariant_2;
|
|
2162
2170
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2163
2171
|
|
|
2164
|
-
declare const
|
|
2172
|
+
declare const _default_18: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
2165
2173
|
|
|
2166
|
-
declare const
|
|
2174
|
+
declare const _default_19: DefineComponent<BubbleListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleListProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
2167
2175
|
scrollContainerRef: HTMLDivElement;
|
|
2168
2176
|
}, HTMLDivElement>;
|
|
2169
2177
|
|
|
2170
|
-
declare const
|
|
2171
|
-
|
|
2172
|
-
declare const _default_2: typeof _default_16 & {
|
|
2178
|
+
declare const _default_2: typeof _default_17 & {
|
|
2173
2179
|
install: typeof install;
|
|
2174
2180
|
};
|
|
2175
2181
|
export { _default_2 as Attachments }
|
|
2176
2182
|
export { _default_2 as TrAttachments }
|
|
2177
2183
|
|
|
2178
|
-
declare const _default_20:
|
|
2184
|
+
declare const _default_20: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
2179
2185
|
|
|
2180
|
-
declare const _default_21:
|
|
2186
|
+
declare const _default_21: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
2181
2187
|
|
|
2182
|
-
declare const _default_22:
|
|
2188
|
+
declare const _default_22: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
2183
2189
|
|
|
2184
|
-
declare const _default_23:
|
|
2190
|
+
declare const _default_23: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
2185
2191
|
|
|
2186
|
-
declare const _default_24:
|
|
2192
|
+
declare const _default_24: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
2193
|
+
|
|
2194
|
+
declare const _default_25: DefineComponent<FeedbackProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2187
2195
|
action: (name: string) => any;
|
|
2188
2196
|
operation: (name: string) => any;
|
|
2189
2197
|
}, string, PublicProps, Readonly<FeedbackProps> & Readonly<{
|
|
@@ -2195,36 +2203,36 @@ actionsLimit: number;
|
|
|
2195
2203
|
sourcesLinesLimit: number;
|
|
2196
2204
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2197
2205
|
|
|
2198
|
-
declare const
|
|
2206
|
+
declare const _default_26: DefineComponent<IconButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IconButtonProps> & Readonly<{}>, {
|
|
2199
2207
|
size: string | number;
|
|
2200
2208
|
svgSize: string | number;
|
|
2201
2209
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
2202
2210
|
|
|
2203
|
-
declare const
|
|
2211
|
+
declare const _default_27: DefineComponent<PromptProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<PromptProps> & Readonly<{}>, {
|
|
2204
2212
|
size: "small" | "medium" | "large";
|
|
2205
2213
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2206
2214
|
|
|
2207
|
-
declare const
|
|
2208
|
-
|
|
2209
|
-
declare const _default_28: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
|
|
2215
|
+
declare const _default_28: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
|
|
2210
2216
|
|
|
2211
|
-
declare const _default_29:
|
|
2217
|
+
declare const _default_29: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
|
|
2212
2218
|
|
|
2213
|
-
declare const _default_3: typeof
|
|
2219
|
+
declare const _default_3: typeof _default_21 & {
|
|
2214
2220
|
install: typeof install_2;
|
|
2215
2221
|
};
|
|
2216
2222
|
export { _default_3 as Container }
|
|
2217
2223
|
export { _default_3 as TrContainer }
|
|
2218
2224
|
|
|
2219
|
-
declare const _default_30:
|
|
2225
|
+
declare const _default_30: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
|
|
2226
|
+
|
|
2227
|
+
declare const _default_31: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
|
|
2220
2228
|
|
|
2221
|
-
declare const
|
|
2229
|
+
declare const _default_32: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
|
|
2222
2230
|
|
|
2223
|
-
declare const
|
|
2231
|
+
declare const _default_33: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
|
|
2224
2232
|
|
|
2225
|
-
declare const
|
|
2233
|
+
declare const _default_34: __VLS_WithTemplateSlots_12<typeof __VLS_component_12, __VLS_TemplateResult_12["slots"]>;
|
|
2226
2234
|
|
|
2227
|
-
declare const
|
|
2235
|
+
declare const _default_35: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
2228
2236
|
"update:visible": (value: boolean) => any;
|
|
2229
2237
|
} & {
|
|
2230
2238
|
refresh: (tab: "installed" | "market") => any;
|
|
@@ -2275,25 +2283,37 @@ allowPluginAdd: boolean;
|
|
|
2275
2283
|
marketLoading: boolean;
|
|
2276
2284
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
2277
2285
|
|
|
2278
|
-
declare const
|
|
2286
|
+
declare const _default_36: DefineComponent<McpAddFormProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2287
|
+
cancel: () => any;
|
|
2288
|
+
confirm: (type: AddType, data: string | McpAddFormData) => any;
|
|
2289
|
+
"update:addType": (value: AddType) => any;
|
|
2290
|
+
}, string, PublicProps, Readonly<McpAddFormProps> & Readonly<{
|
|
2291
|
+
onCancel?: (() => any) | undefined;
|
|
2292
|
+
onConfirm?: ((type: AddType, data: string | McpAddFormData) => any) | undefined;
|
|
2293
|
+
"onUpdate:addType"?: ((value: AddType) => any) | undefined;
|
|
2294
|
+
}>, {
|
|
2295
|
+
addType: AddType;
|
|
2296
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2297
|
+
|
|
2298
|
+
declare const _default_4: typeof _default_22 & {
|
|
2279
2299
|
install: typeof install_3;
|
|
2280
2300
|
};
|
|
2281
2301
|
export { _default_4 as Conversations }
|
|
2282
2302
|
export { _default_4 as TrConversations }
|
|
2283
2303
|
|
|
2284
|
-
declare const _default_5: typeof
|
|
2304
|
+
declare const _default_5: typeof _default_23 & {
|
|
2285
2305
|
install: typeof install_4;
|
|
2286
2306
|
};
|
|
2287
2307
|
export { _default_5 as DragOverlay }
|
|
2288
2308
|
export { _default_5 as TrDragOverlay }
|
|
2289
2309
|
|
|
2290
|
-
declare const _default_6: typeof
|
|
2310
|
+
declare const _default_6: typeof _default_24 & {
|
|
2291
2311
|
install: typeof install_5;
|
|
2292
2312
|
};
|
|
2293
2313
|
export { _default_6 as DropdownMenu }
|
|
2294
2314
|
export { _default_6 as TrDropdownMenu }
|
|
2295
2315
|
|
|
2296
|
-
declare const _default_7: typeof
|
|
2316
|
+
declare const _default_7: typeof _default_25 & {
|
|
2297
2317
|
install: typeof install_6;
|
|
2298
2318
|
};
|
|
2299
2319
|
export { _default_7 as Feedback }
|
|
@@ -2306,7 +2326,7 @@ declare const _default_8: {
|
|
|
2306
2326
|
export { _default_8 as History }
|
|
2307
2327
|
export { _default_8 as TrHistory }
|
|
2308
2328
|
|
|
2309
|
-
declare const _default_9: typeof
|
|
2329
|
+
declare const _default_9: typeof _default_26 & {
|
|
2310
2330
|
install: typeof install_7;
|
|
2311
2331
|
};
|
|
2312
2332
|
export { _default_9 as IconButton }
|
|
@@ -2602,6 +2622,8 @@ declare const install_12: <T>(app: App<T>) => void;
|
|
|
2602
2622
|
|
|
2603
2623
|
declare const install_13: <T>(app: App<T>) => void;
|
|
2604
2624
|
|
|
2625
|
+
declare const install_14: <T>(app: App<T>) => void;
|
|
2626
|
+
|
|
2605
2627
|
declare const install_2: <T>(app: App<T>) => void;
|
|
2606
2628
|
|
|
2607
2629
|
declare const install_3: <T>(app: App<T>) => void;
|
|
@@ -2639,6 +2661,27 @@ export declare interface MarketCategoryOption {
|
|
|
2639
2661
|
label: string;
|
|
2640
2662
|
}
|
|
2641
2663
|
|
|
2664
|
+
export declare interface McpAddFormData {
|
|
2665
|
+
name: string;
|
|
2666
|
+
description: string;
|
|
2667
|
+
type: 'sse' | 'streamableHttp';
|
|
2668
|
+
url: string;
|
|
2669
|
+
headers: string;
|
|
2670
|
+
thumbnail?: File | null;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
export declare interface McpAddFormEmits {
|
|
2674
|
+
(e: 'update:addType', value: AddType): void;
|
|
2675
|
+
(e: 'confirm', type: AddType, data: McpAddFormData | string): void;
|
|
2676
|
+
(e: 'cancel'): void;
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
export declare interface McpAddFormProps {
|
|
2680
|
+
addType?: AddType;
|
|
2681
|
+
formData?: McpAddFormData;
|
|
2682
|
+
codeData?: string;
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2642
2685
|
export declare interface McpServerPickerEmits {
|
|
2643
2686
|
(e: 'market-category-change', category: string): void;
|
|
2644
2687
|
(e: 'tab-change', activeTab: 'installed' | 'market'): void;
|
|
@@ -2754,7 +2797,7 @@ export declare interface PopupConfig {
|
|
|
2754
2797
|
};
|
|
2755
2798
|
}
|
|
2756
2799
|
|
|
2757
|
-
declare const Prompt: typeof
|
|
2800
|
+
declare const Prompt: typeof _default_27 & {
|
|
2758
2801
|
install: typeof installPrompt;
|
|
2759
2802
|
};
|
|
2760
2803
|
export { Prompt }
|
|
@@ -2791,7 +2834,7 @@ export declare interface PromptProps {
|
|
|
2791
2834
|
size?: 'small' | 'medium' | 'large';
|
|
2792
2835
|
}
|
|
2793
2836
|
|
|
2794
|
-
declare const Prompts: typeof
|
|
2837
|
+
declare const Prompts: typeof _default_28 & {
|
|
2795
2838
|
install: typeof installPrompts;
|
|
2796
2839
|
};
|
|
2797
2840
|
export { Prompts }
|
|
@@ -2934,7 +2977,7 @@ export declare interface SuggestionGroup<T = Record<string, unknown>> {
|
|
|
2934
2977
|
|
|
2935
2978
|
export declare type SuggestionItem<T = Record<string, unknown>> = SuggestionBaseItem & T;
|
|
2936
2979
|
|
|
2937
|
-
declare const SuggestionPillButton: typeof
|
|
2980
|
+
declare const SuggestionPillButton: typeof _default_30 & {
|
|
2938
2981
|
install: typeof installPillButton;
|
|
2939
2982
|
};
|
|
2940
2983
|
export { SuggestionPillButton }
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "./attachments/index.js";
|
|
2
2
|
import { Bubble as x, BubbleList as E, BubbleProvider as S } from "./bubble/index.js";
|
|
3
|
-
import { BubbleContentClassRenderer as
|
|
3
|
+
import { BubbleContentClassRenderer as ve, BubbleMarkdownContentRenderer as fe } from "./bubble/index.js";
|
|
4
4
|
import P from "./container/index.js";
|
|
5
5
|
import b from "./conversations/index.js";
|
|
6
6
|
import L from "./drag-overlay/index.js";
|
|
@@ -8,16 +8,17 @@ import C from "./dropdown-menu/index.js";
|
|
|
8
8
|
import B from "./feedback/index.js";
|
|
9
9
|
import y from "./history/index.js";
|
|
10
10
|
import O from "./icon-button/index.js";
|
|
11
|
-
import { Prompt as j, Prompts as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import { Prompt as j, Prompts as A } from "./prompts/index.js";
|
|
12
|
+
import H from "./sender/index.js";
|
|
13
|
+
import M, { SuggestionPillButton as w } from "./suggestion-pills/index.js";
|
|
14
14
|
import R from "./suggestion-popover/index.js";
|
|
15
15
|
import k from "./theme-provider/index.js";
|
|
16
|
-
import { useTheme as
|
|
16
|
+
import { useTheme as ge } from "./theme-provider/index.js";
|
|
17
17
|
import W from "./welcome/index.js";
|
|
18
18
|
import $ from "./mcp-server-picker/index.js";
|
|
19
|
+
import I from "./mcp-add-form/index.js";
|
|
19
20
|
var d = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(d || {});
|
|
20
|
-
function
|
|
21
|
+
function N(e, r) {
|
|
21
22
|
if (!r) return !0;
|
|
22
23
|
const t = r.split(",").map((o) => o.trim());
|
|
23
24
|
return t.includes("*") ? !0 : t.some((o) => {
|
|
@@ -33,12 +34,12 @@ function I(e, r) {
|
|
|
33
34
|
function _(e, r) {
|
|
34
35
|
return e.size <= r;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function q(e, r) {
|
|
37
38
|
return e.length <= r;
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function G(e, r) {
|
|
40
41
|
const { accept: t, multiple: o, maxSize: a, maxFiles: l } = r, n = [], s = [];
|
|
41
|
-
if (!
|
|
42
|
+
if (!q(e, l))
|
|
42
43
|
return {
|
|
43
44
|
acceptedFiles: n,
|
|
44
45
|
rejectedFiles: Array.from(e),
|
|
@@ -48,7 +49,7 @@ function q(e, r) {
|
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
if (e.forEach((i) => {
|
|
51
|
-
|
|
52
|
+
N(i, t) && _(i, a) ? n.push(i) : s.push(i);
|
|
52
53
|
}), !o && n.length > 1)
|
|
53
54
|
return {
|
|
54
55
|
acceptedFiles: [],
|
|
@@ -79,7 +80,7 @@ function g(e) {
|
|
|
79
80
|
disabled: e.disabled || !1
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
|
-
const
|
|
83
|
+
const pe = {
|
|
83
84
|
/**
|
|
84
85
|
* 挂载指令
|
|
85
86
|
* @param el 元素
|
|
@@ -119,7 +120,7 @@ const le = {
|
|
|
119
120
|
n.preventDefault(), t = 0, a(!1, null);
|
|
120
121
|
const s = (u = n.dataTransfer) == null ? void 0 : u.files, { onDrop: i, onError: p, accept: m, multiple: c, maxSize: D, maxFiles: h } = e.__vDropzoneOptions__;
|
|
121
122
|
if (s && s.length > 0) {
|
|
122
|
-
const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } =
|
|
123
|
+
const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
|
|
123
124
|
accept: m,
|
|
124
125
|
multiple: c,
|
|
125
126
|
maxSize: D,
|
|
@@ -141,7 +142,7 @@ const le = {
|
|
|
141
142
|
unmounted(e) {
|
|
142
143
|
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__;
|
|
143
144
|
}
|
|
144
|
-
},
|
|
145
|
+
}, J = [
|
|
145
146
|
z,
|
|
146
147
|
x,
|
|
147
148
|
E,
|
|
@@ -154,17 +155,18 @@ const le = {
|
|
|
154
155
|
y,
|
|
155
156
|
O,
|
|
156
157
|
j,
|
|
157
|
-
H,
|
|
158
|
-
w,
|
|
159
158
|
A,
|
|
159
|
+
H,
|
|
160
160
|
M,
|
|
161
|
+
w,
|
|
161
162
|
R,
|
|
162
163
|
k,
|
|
163
164
|
W,
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
$,
|
|
166
|
+
I
|
|
167
|
+
], me = {
|
|
166
168
|
install(e) {
|
|
167
|
-
|
|
169
|
+
J.forEach((r) => {
|
|
168
170
|
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
169
171
|
e.component(`Tr${t}`, r);
|
|
170
172
|
});
|
|
@@ -173,9 +175,9 @@ const le = {
|
|
|
173
175
|
export {
|
|
174
176
|
z as Attachments,
|
|
175
177
|
x as Bubble,
|
|
176
|
-
|
|
178
|
+
ve as BubbleContentClassRenderer,
|
|
177
179
|
E as BubbleList,
|
|
178
|
-
|
|
180
|
+
fe as BubbleMarkdownContentRenderer,
|
|
179
181
|
S as BubbleProvider,
|
|
180
182
|
P as Container,
|
|
181
183
|
b as Conversations,
|
|
@@ -184,12 +186,13 @@ export {
|
|
|
184
186
|
B as Feedback,
|
|
185
187
|
y as History,
|
|
186
188
|
O as IconButton,
|
|
189
|
+
I as McpAddForm,
|
|
187
190
|
$ as McpServerPicker,
|
|
188
191
|
j as Prompt,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
A as Prompts,
|
|
193
|
+
H as Sender,
|
|
194
|
+
w as SuggestionPillButton,
|
|
195
|
+
M as SuggestionPills,
|
|
193
196
|
R as SuggestionPopover,
|
|
194
197
|
k as ThemeProvider,
|
|
195
198
|
z as TrAttachments,
|
|
@@ -203,17 +206,18 @@ export {
|
|
|
203
206
|
B as TrFeedback,
|
|
204
207
|
y as TrHistory,
|
|
205
208
|
O as TrIconButton,
|
|
209
|
+
I as TrMcpAddForm,
|
|
206
210
|
$ as TrMcpServerPicker,
|
|
207
211
|
j as TrPrompt,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
+
A as TrPrompts,
|
|
213
|
+
H as TrSender,
|
|
214
|
+
w as TrSuggestionPillButton,
|
|
215
|
+
M as TrSuggestionPills,
|
|
212
216
|
R as TrSuggestionPopover,
|
|
213
217
|
k as TrThemeProvider,
|
|
214
218
|
W as TrWelcome,
|
|
215
219
|
W as Welcome,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
me as default,
|
|
221
|
+
ge as useTheme,
|
|
222
|
+
pe as vDropzone
|
|
219
223
|
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { defineComponent as g, ref as b, useModel as k, watch as O, onUnmounted as R, createElementBlock as _, openBlock as v, createElementVNode as t, withDirectives as c, vModelText as f, createVNode as y, unref as D, createCommentVNode as $ } from "vue";
|
|
2
|
+
import { TinyRadioGroup as E } from "@opentiny/vue";
|
|
3
|
+
import { d as L } from "../index2.js";
|
|
4
|
+
import { _ as T } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const M = { class: "form-editor__container" }, S = { class: "form-editor__item" }, F = { class: "form-editor__item" }, I = { class: "form-editor__item" }, N = { class: "form-editor__item" }, H = { class: "form-editor__item" }, w = { class: "form-editor__item" }, A = ["src"], C = "https://res.hc-cdn.com/tinyui-design/1.1.0.20250526191525/home/images/tiny-ng.svg", P = /* @__PURE__ */ g({
|
|
6
|
+
__name: "FormEditor",
|
|
7
|
+
props: {
|
|
8
|
+
formData: { required: !0 },
|
|
9
|
+
formDataModifiers: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:formData"],
|
|
12
|
+
setup(i) {
|
|
13
|
+
const d = b(""), o = k(i, "formData"), s = [
|
|
14
|
+
{ label: "streamableHttp", text: "流式HTTP(Streamable HTTP)" },
|
|
15
|
+
{ label: "sse", text: "服务器发送事件(SSE)" }
|
|
16
|
+
], { open: n, files: u } = L({
|
|
17
|
+
accept: "image/*",
|
|
18
|
+
// 只接受图片文件
|
|
19
|
+
multiple: !1
|
|
20
|
+
// 只允许选择单个文件
|
|
21
|
+
}), r = () => {
|
|
22
|
+
d.value && d.value !== C && (URL.revokeObjectURL(d.value), d.value = "");
|
|
23
|
+
};
|
|
24
|
+
O(u, (m) => {
|
|
25
|
+
if (m && m.length > 0) {
|
|
26
|
+
const e = m[0];
|
|
27
|
+
if (!e.type.startsWith("image/"))
|
|
28
|
+
return;
|
|
29
|
+
const a = 5 * 1024 * 1024;
|
|
30
|
+
if (e.size > a)
|
|
31
|
+
return;
|
|
32
|
+
r(), d.value = URL.createObjectURL(e), o.value.thumbnail = e;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const x = () => {
|
|
36
|
+
n();
|
|
37
|
+
};
|
|
38
|
+
return R(() => {
|
|
39
|
+
r();
|
|
40
|
+
}), (m, e) => (v(), _("form", M, [
|
|
41
|
+
t("div", S, [
|
|
42
|
+
e[5] || (e[5] = t("label", { class: "form-editor__label" }, "名称", -1)),
|
|
43
|
+
c(t("input", {
|
|
44
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => o.value.name = a),
|
|
45
|
+
class: "form-editor__input",
|
|
46
|
+
type: "text",
|
|
47
|
+
placeholder: "请输入插件名称"
|
|
48
|
+
}, null, 512), [
|
|
49
|
+
[f, o.value.name]
|
|
50
|
+
])
|
|
51
|
+
]),
|
|
52
|
+
t("div", F, [
|
|
53
|
+
e[6] || (e[6] = t("label", { class: "form-editor__label" }, "描述", -1)),
|
|
54
|
+
c(t("textarea", {
|
|
55
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => o.value.description = a),
|
|
56
|
+
class: "form-editor__textarea",
|
|
57
|
+
placeholder: "请输入插件描述"
|
|
58
|
+
}, null, 512), [
|
|
59
|
+
[f, o.value.description]
|
|
60
|
+
])
|
|
61
|
+
]),
|
|
62
|
+
t("div", I, [
|
|
63
|
+
e[7] || (e[7] = t("label", { class: "form-editor__label custom-label" }, "类型", -1)),
|
|
64
|
+
y(D(E), {
|
|
65
|
+
modelValue: o.value.type,
|
|
66
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => o.value.type = a),
|
|
67
|
+
options: s,
|
|
68
|
+
class: "form-editor__radio-group"
|
|
69
|
+
}, null, 8, ["modelValue"])
|
|
70
|
+
]),
|
|
71
|
+
t("div", N, [
|
|
72
|
+
e[8] || (e[8] = t("label", { class: "form-editor__label" }, "URL", -1)),
|
|
73
|
+
c(t("input", {
|
|
74
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => o.value.url = a),
|
|
75
|
+
class: "form-editor__input",
|
|
76
|
+
type: "url",
|
|
77
|
+
placeholder: "请输入插件URL"
|
|
78
|
+
}, null, 512), [
|
|
79
|
+
[f, o.value.url]
|
|
80
|
+
])
|
|
81
|
+
]),
|
|
82
|
+
t("div", H, [
|
|
83
|
+
e[9] || (e[9] = t("label", { class: "form-editor__label" }, "请求头", -1)),
|
|
84
|
+
c(t("textarea", {
|
|
85
|
+
"onUpdate:modelValue": e[4] || (e[4] = (a) => o.value.headers = a),
|
|
86
|
+
class: "form-editor__textarea",
|
|
87
|
+
placeholder: "请输入请求头,格式为JSON"
|
|
88
|
+
}, null, 512), [
|
|
89
|
+
[f, o.value.headers]
|
|
90
|
+
])
|
|
91
|
+
]),
|
|
92
|
+
t("div", w, [
|
|
93
|
+
e[11] || (e[11] = t("label", { class: "form-editor__label custom-label" }, "缩略图", -1)),
|
|
94
|
+
t("div", {
|
|
95
|
+
class: "form-editor__file-upload",
|
|
96
|
+
onClick: x
|
|
97
|
+
}, [
|
|
98
|
+
t("img", {
|
|
99
|
+
src: d.value || C,
|
|
100
|
+
alt: "缩略图预览",
|
|
101
|
+
class: "form-editor__file-preview-image"
|
|
102
|
+
}, null, 8, A),
|
|
103
|
+
e[10] || (e[10] = t("div", { class: "form-editor__file-overlay" }, [
|
|
104
|
+
t("div", { class: "form-editor__file-icon" })
|
|
105
|
+
], -1))
|
|
106
|
+
])
|
|
107
|
+
])
|
|
108
|
+
]));
|
|
109
|
+
}
|
|
110
|
+
}), h = /* @__PURE__ */ T(P, [["__scopeId", "data-v-e91567e8"]]), j = { class: "code-editor__container" }, q = { class: "code-editor__section" }, z = { class: "code-editor__area" }, B = /* @__PURE__ */ g({
|
|
111
|
+
__name: "CodeEditor",
|
|
112
|
+
props: {
|
|
113
|
+
codeData: { required: !0 },
|
|
114
|
+
codeDataModifiers: {}
|
|
115
|
+
},
|
|
116
|
+
emits: ["update:codeData"],
|
|
117
|
+
setup(i) {
|
|
118
|
+
const d = k(i, "codeData");
|
|
119
|
+
return (o, s) => (v(), _("div", j, [
|
|
120
|
+
t("div", q, [
|
|
121
|
+
t("div", z, [
|
|
122
|
+
c(t("textarea", {
|
|
123
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => d.value = n),
|
|
124
|
+
class: "code-editor__textarea",
|
|
125
|
+
placeholder: "请输入 JSON 配置..."
|
|
126
|
+
}, null, 512), [
|
|
127
|
+
[f, d.value]
|
|
128
|
+
])
|
|
129
|
+
])
|
|
130
|
+
])
|
|
131
|
+
]));
|
|
132
|
+
}
|
|
133
|
+
}), J = /* @__PURE__ */ T(B, [["__scopeId", "data-v-555fb3c4"]]), G = { class: "mcp-add-form" }, W = { class: "mcp-add-form__content" }, K = { class: "mcp-add-form__add-type" }, Q = { key: 0 }, X = { key: 1 }, Y = /* @__PURE__ */ g({
|
|
134
|
+
__name: "index",
|
|
135
|
+
props: {
|
|
136
|
+
addType: { default: "form" },
|
|
137
|
+
formData: {},
|
|
138
|
+
codeData: {}
|
|
139
|
+
},
|
|
140
|
+
emits: ["update:addType", "confirm", "cancel"],
|
|
141
|
+
setup(i, { emit: d }) {
|
|
142
|
+
const o = i, s = d, n = b(
|
|
143
|
+
o.formData || {
|
|
144
|
+
name: "",
|
|
145
|
+
description: "",
|
|
146
|
+
type: "streamableHttp",
|
|
147
|
+
url: "",
|
|
148
|
+
headers: "",
|
|
149
|
+
thumbnail: null
|
|
150
|
+
}
|
|
151
|
+
), u = b(o.codeData || ""), r = b(o.addType), x = [
|
|
152
|
+
{ label: "form", text: "表单添加" },
|
|
153
|
+
{ label: "code", text: "代码添加" }
|
|
154
|
+
], m = () => {
|
|
155
|
+
s("cancel");
|
|
156
|
+
}, e = () => {
|
|
157
|
+
r.value === "form" ? s("confirm", "form", n.value) : s("confirm", "code", u.value);
|
|
158
|
+
}, a = (V) => {
|
|
159
|
+
s("update:addType", V);
|
|
160
|
+
};
|
|
161
|
+
return (V, l) => (v(), _("div", G, [
|
|
162
|
+
t("div", W, [
|
|
163
|
+
t("div", K, [
|
|
164
|
+
l[3] || (l[3] = t("span", { class: "mcp-add-form__add-type-label" }, "添加方式", -1)),
|
|
165
|
+
y(D(E), {
|
|
166
|
+
modelValue: r.value,
|
|
167
|
+
"onUpdate:modelValue": [
|
|
168
|
+
l[0] || (l[0] = (p) => r.value = p),
|
|
169
|
+
a
|
|
170
|
+
],
|
|
171
|
+
type: "button",
|
|
172
|
+
options: x
|
|
173
|
+
}, null, 8, ["modelValue"])
|
|
174
|
+
]),
|
|
175
|
+
r.value === "form" ? (v(), _("div", Q, [
|
|
176
|
+
y(D(h), {
|
|
177
|
+
"form-data": n.value,
|
|
178
|
+
"onUpdate:formData": l[1] || (l[1] = (p) => n.value = p)
|
|
179
|
+
}, null, 8, ["form-data"])
|
|
180
|
+
])) : $("", !0),
|
|
181
|
+
r.value === "code" ? (v(), _("div", X, [
|
|
182
|
+
y(D(J), {
|
|
183
|
+
"code-data": u.value,
|
|
184
|
+
"onUpdate:codeData": l[2] || (l[2] = (p) => u.value = p)
|
|
185
|
+
}, null, 8, ["code-data"])
|
|
186
|
+
])) : $("", !0)
|
|
187
|
+
]),
|
|
188
|
+
t("div", { class: "mcp-add-form__footer" }, [
|
|
189
|
+
t("div", {
|
|
190
|
+
class: "button cancel",
|
|
191
|
+
onClick: m
|
|
192
|
+
}, [...l[4] || (l[4] = [
|
|
193
|
+
t("span", null, "取消", -1)
|
|
194
|
+
])]),
|
|
195
|
+
t("div", {
|
|
196
|
+
class: "button confirm",
|
|
197
|
+
onClick: e
|
|
198
|
+
}, [...l[5] || (l[5] = [
|
|
199
|
+
t("span", null, "确定", -1)
|
|
200
|
+
])])
|
|
201
|
+
])
|
|
202
|
+
]));
|
|
203
|
+
}
|
|
204
|
+
}), U = /* @__PURE__ */ T(Y, [["__scopeId", "data-v-e85f1044"]]);
|
|
205
|
+
U.name = "TrMcpAddForm";
|
|
206
|
+
const Z = function(i) {
|
|
207
|
+
i.component(U.name, U);
|
|
208
|
+
};
|
|
209
|
+
U.install = Z;
|
|
210
|
+
export {
|
|
211
|
+
U as default
|
|
212
|
+
};
|