@aheart-ui/ai 0.0.0-stage → 1.1.0
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/LICENSE +21 -0
- package/README.md +30 -2
- package/es/actions/index.d.ts +2 -0
- package/es/actions/index.js +5 -0
- package/es/actions/style.css +36 -0
- package/es/actions.vue.d.ts +34 -0
- package/es/actions.vue.js +27 -0
- package/es/actions.vue2.js +4 -0
- package/es/agent/index.d.ts +5 -0
- package/es/agent/index.js +12 -0
- package/es/agent/style.css +308 -0
- package/es/agent-execution.vue.d.ts +106 -0
- package/es/agent-execution.vue.js +441 -0
- package/es/agent-execution.vue2.js +4 -0
- package/es/agent-workbench/index.d.ts +2 -0
- package/es/agent-workbench/index.js +5 -0
- package/es/agent-workbench/style.css +1332 -0
- package/es/agent-workbench.vue.d.ts +186 -0
- package/es/agent-workbench.vue.js +537 -0
- package/es/agent-workbench.vue2.js +4 -0
- package/es/attachments/index.d.ts +2 -0
- package/es/attachments/index.js +5 -0
- package/es/attachments/style.css +62 -0
- package/es/attachments.vue.d.ts +39 -0
- package/es/attachments.vue.js +39 -0
- package/es/attachments.vue2.js +4 -0
- package/es/bubble/index.d.ts +2 -0
- package/es/bubble/index.js +5 -0
- package/es/bubble/style.css +241 -0
- package/es/bubble.vue.d.ts +27 -0
- package/es/bubble.vue.js +82 -0
- package/es/bubble.vue2.js +4 -0
- package/es/chat/index.d.ts +11 -0
- package/es/chat/index.js +23 -0
- package/es/chat/style.css +595 -0
- package/es/chat-panel/index.d.ts +3 -0
- package/es/chat-panel/index.js +8 -0
- package/es/chat-panel/style.css +595 -0
- package/es/chat-panel.vue.d.ts +108 -0
- package/es/chat-panel.vue.js +330 -0
- package/es/chat-panel.vue2.js +4 -0
- package/es/conversations/index.d.ts +2 -0
- package/es/conversations/index.js +5 -0
- package/es/conversations/style.css +48 -0
- package/es/conversations.vue.d.ts +39 -0
- package/es/conversations.vue.js +29 -0
- package/es/conversations.vue2.js +4 -0
- package/es/form/index.d.ts +3 -0
- package/es/form/index.js +9 -0
- package/es/form/style.css +242 -0
- package/es/form-field.vue.d.ts +28 -0
- package/es/form-field.vue.js +176 -0
- package/es/form-field.vue2.js +4 -0
- package/es/form-schema.d.ts +73 -0
- package/es/form-schema.js +105 -0
- package/es/form.vue.d.ts +81 -0
- package/es/form.vue.js +376 -0
- package/es/form.vue2.js +4 -0
- package/es/index.d.ts +20 -0
- package/es/index.js +42 -0
- package/es/package.json +3 -0
- package/es/process/index.d.ts +2 -0
- package/es/process/index.js +5 -0
- package/es/process/style.css +77 -0
- package/es/process.vue.d.ts +30 -0
- package/es/process.vue.js +29 -0
- package/es/process.vue2.js +4 -0
- package/es/prompts/index.d.ts +2 -0
- package/es/prompts/index.js +5 -0
- package/es/prompts/style.css +76 -0
- package/es/prompts.vue.d.ts +39 -0
- package/es/prompts.vue.js +33 -0
- package/es/prompts.vue2.js +4 -0
- package/es/safe-markdown.d.ts +3 -0
- package/es/safe-markdown.js +23 -0
- package/es/sender/index.d.ts +2 -0
- package/es/sender/index.js +5 -0
- package/es/sender/style.css +88 -0
- package/es/sender.vue.d.ts +52 -0
- package/es/sender.vue.js +46 -0
- package/es/sender.vue2.js +4 -0
- package/es/sources/index.d.ts +2 -0
- package/es/sources/index.js +5 -0
- package/es/sources/style.css +54 -0
- package/es/sources.vue.d.ts +30 -0
- package/es/sources.vue.js +34 -0
- package/es/sources.vue2.js +4 -0
- package/es/stream-reducer.d.ts +35 -0
- package/es/stream-reducer.js +85 -0
- package/es/style.css +1586 -0
- package/es/thought-chain/index.d.ts +2 -0
- package/es/thought-chain/index.js +5 -0
- package/es/thought-chain/style.css +77 -0
- package/es/thought-chain.vue.d.ts +30 -0
- package/es/thought-chain.vue.js +15 -0
- package/es/thought-chain.vue2.js +4 -0
- package/es/types.d.ts +203 -0
- package/es/welcome/index.d.ts +2 -0
- package/es/welcome/index.js +5 -0
- package/es/welcome/style.css +33 -0
- package/es/welcome.vue.d.ts +41 -0
- package/es/welcome.vue.js +27 -0
- package/es/welcome.vue2.js +4 -0
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +1 -0
- package/lib/actions/style.css +36 -0
- package/lib/actions.vue.d.ts +34 -0
- package/lib/actions.vue.js +1 -0
- package/lib/actions.vue2.js +1 -0
- package/lib/agent/index.d.ts +5 -0
- package/lib/agent/index.js +1 -0
- package/lib/agent/style.css +308 -0
- package/lib/agent-execution.vue.d.ts +106 -0
- package/lib/agent-execution.vue.js +1 -0
- package/lib/agent-execution.vue2.js +1 -0
- package/lib/agent-workbench/index.d.ts +2 -0
- package/lib/agent-workbench/index.js +1 -0
- package/lib/agent-workbench/style.css +1332 -0
- package/lib/agent-workbench.vue.d.ts +186 -0
- package/lib/agent-workbench.vue.js +1 -0
- package/lib/agent-workbench.vue2.js +1 -0
- package/lib/attachments/index.d.ts +2 -0
- package/lib/attachments/index.js +1 -0
- package/lib/attachments/style.css +62 -0
- package/lib/attachments.vue.d.ts +39 -0
- package/lib/attachments.vue.js +1 -0
- package/lib/attachments.vue2.js +1 -0
- package/lib/bubble/index.d.ts +2 -0
- package/lib/bubble/index.js +1 -0
- package/lib/bubble/style.css +241 -0
- package/lib/bubble.vue.d.ts +27 -0
- package/lib/bubble.vue.js +1 -0
- package/lib/bubble.vue2.js +1 -0
- package/lib/chat/index.d.ts +11 -0
- package/lib/chat/index.js +1 -0
- package/lib/chat/style.css +595 -0
- package/lib/chat-panel/index.d.ts +3 -0
- package/lib/chat-panel/index.js +1 -0
- package/lib/chat-panel/style.css +595 -0
- package/lib/chat-panel.vue.d.ts +108 -0
- package/lib/chat-panel.vue.js +1 -0
- package/lib/chat-panel.vue2.js +1 -0
- package/lib/conversations/index.d.ts +2 -0
- package/lib/conversations/index.js +1 -0
- package/lib/conversations/style.css +48 -0
- package/lib/conversations.vue.d.ts +39 -0
- package/lib/conversations.vue.js +1 -0
- package/lib/conversations.vue2.js +1 -0
- package/lib/form/index.d.ts +3 -0
- package/lib/form/index.js +1 -0
- package/lib/form/style.css +242 -0
- package/lib/form-field.vue.d.ts +28 -0
- package/lib/form-field.vue.js +1 -0
- package/lib/form-field.vue2.js +1 -0
- package/lib/form-schema.d.ts +73 -0
- package/lib/form-schema.js +1 -0
- package/lib/form.vue.d.ts +81 -0
- package/lib/form.vue.js +1 -0
- package/lib/form.vue2.js +1 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +1 -0
- package/lib/package.json +3 -0
- package/lib/process/index.d.ts +2 -0
- package/lib/process/index.js +1 -0
- package/lib/process/style.css +77 -0
- package/lib/process.vue.d.ts +30 -0
- package/lib/process.vue.js +1 -0
- package/lib/process.vue2.js +1 -0
- package/lib/prompts/index.d.ts +2 -0
- package/lib/prompts/index.js +1 -0
- package/lib/prompts/style.css +76 -0
- package/lib/prompts.vue.d.ts +39 -0
- package/lib/prompts.vue.js +1 -0
- package/lib/prompts.vue2.js +1 -0
- package/lib/safe-markdown.d.ts +3 -0
- package/lib/safe-markdown.js +2 -0
- package/lib/sender/index.d.ts +2 -0
- package/lib/sender/index.js +1 -0
- package/lib/sender/style.css +88 -0
- package/lib/sender.vue.d.ts +52 -0
- package/lib/sender.vue.js +1 -0
- package/lib/sender.vue2.js +1 -0
- package/lib/sources/index.d.ts +2 -0
- package/lib/sources/index.js +1 -0
- package/lib/sources/style.css +54 -0
- package/lib/sources.vue.d.ts +30 -0
- package/lib/sources.vue.js +1 -0
- package/lib/sources.vue2.js +1 -0
- package/lib/stream-reducer.d.ts +35 -0
- package/lib/stream-reducer.js +1 -0
- package/lib/style.css +1586 -0
- package/lib/thought-chain/index.d.ts +2 -0
- package/lib/thought-chain/index.js +1 -0
- package/lib/thought-chain/style.css +77 -0
- package/lib/thought-chain.vue.d.ts +30 -0
- package/lib/thought-chain.vue.js +1 -0
- package/lib/thought-chain.vue2.js +1 -0
- package/lib/types.d.ts +203 -0
- package/lib/welcome/index.d.ts +2 -0
- package/lib/welcome/index.js +1 -0
- package/lib/welcome/style.css +33 -0
- package/lib/welcome.vue.d.ts +41 -0
- package/lib/welcome.vue.js +1 -0
- package/lib/welcome.vue2.js +1 -0
- package/package.json +172 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as i, openBlock as t, createElementBlock as a, Fragment as u, renderList as f, unref as r, toDisplayString as o, createCommentVNode as l } from "vue";
|
|
2
|
+
import { getSafeUrl as s } from "./safe-markdown.js";
|
|
3
|
+
const h = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "aheart-ai-attachments",
|
|
6
|
+
"aria-label": "附件"
|
|
7
|
+
}, d = ["href"], _ = { key: 1 }, k = ["aria-label", "onClick"], C = /* @__PURE__ */ i({
|
|
8
|
+
name: "AAIAttachments",
|
|
9
|
+
__name: "attachments",
|
|
10
|
+
props: {
|
|
11
|
+
items: { default: () => [] },
|
|
12
|
+
removable: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["remove"],
|
|
15
|
+
setup(n, { emit: m }) {
|
|
16
|
+
const c = m;
|
|
17
|
+
return (b, p) => n.items.length ? (t(), a("ul", h, [
|
|
18
|
+
(t(!0), a(u, null, f(n.items, (e) => (t(), a("li", {
|
|
19
|
+
key: e.id
|
|
20
|
+
}, [
|
|
21
|
+
r(s)(e.url) ? (t(), a("a", {
|
|
22
|
+
key: 0,
|
|
23
|
+
href: r(s)(e.url),
|
|
24
|
+
target: "_blank",
|
|
25
|
+
rel: "noreferrer"
|
|
26
|
+
}, o(e.name), 9, d)) : (t(), a("span", _, o(e.name), 1)),
|
|
27
|
+
n.removable ? (t(), a("button", {
|
|
28
|
+
key: 2,
|
|
29
|
+
type: "button",
|
|
30
|
+
"aria-label": `移除 ${e.name}`,
|
|
31
|
+
onClick: (y) => c("remove", e)
|
|
32
|
+
}, "移除", 8, k)) : l("", !0)
|
|
33
|
+
]))), 128))
|
|
34
|
+
])) : l("", !0);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
C as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--aheart-ai-cyan: #0e7490;
|
|
3
|
+
--aheart-ai-cyan-strong: #0e7490;
|
|
4
|
+
--aheart-ai-brand-strong: #0958d9;
|
|
5
|
+
--aheart-ai-cyan-soft: #ecfeff;
|
|
6
|
+
--aheart-ai-line: #e4e7ec;
|
|
7
|
+
--aheart-ai-surface: #ffffff;
|
|
8
|
+
--aheart-ai-surface-subtle: #f8fafc;
|
|
9
|
+
--aheart-ai-text: #182230;
|
|
10
|
+
--aheart-ai-text-secondary: #667085;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.aheart-ai-sources h3,
|
|
14
|
+
.aheart-ai-sources p,
|
|
15
|
+
.aheart-ai-process h3 {
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.aheart-ai-process small {
|
|
20
|
+
display: block;
|
|
21
|
+
color: var(--aheart-ai-text-secondary);
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.aheart-ai-bubble {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
max-inline-size: min(760px, 92%);
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 12px 14px;
|
|
32
|
+
border: 1px solid var(--aheart-ai-line);
|
|
33
|
+
border-radius: 7px;
|
|
34
|
+
background: #fff;
|
|
35
|
+
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.aheart-ai-bubble.is-user {
|
|
39
|
+
align-self: end;
|
|
40
|
+
border-color: #91caff;
|
|
41
|
+
background: #f0f7ff;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.aheart-ai-bubble.is-assistant {
|
|
45
|
+
align-self: start;
|
|
46
|
+
border-inline-start: 3px solid var(--aheart-ai-cyan);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.aheart-ai-bubble__header {
|
|
50
|
+
color: var(--aheart-ai-text-secondary);
|
|
51
|
+
font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
52
|
+
text-transform: uppercase;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.aheart-ai-bubble__content,
|
|
56
|
+
.aheart-ai-bubble__error {
|
|
57
|
+
margin: 0;
|
|
58
|
+
line-height: 1.72;
|
|
59
|
+
white-space: pre-wrap;
|
|
60
|
+
overflow-wrap: anywhere;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.aheart-ai-bubble__content a {
|
|
64
|
+
color: var(--aheart-color-primary, #1677ff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.aheart-ai-bubble__tool-call {
|
|
68
|
+
display: grid;
|
|
69
|
+
min-inline-size: 0;
|
|
70
|
+
gap: 10px;
|
|
71
|
+
margin-block: 10px;
|
|
72
|
+
padding: 12px;
|
|
73
|
+
overflow-wrap: anywhere;
|
|
74
|
+
border: 1px solid var(--aheart-ai-line, #d0d5dd);
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
background: var(--aheart-ai-surface-subtle, #f8fafc);
|
|
77
|
+
}
|
|
78
|
+
.aheart-ai-bubble__tool-heading {
|
|
79
|
+
display: grid;
|
|
80
|
+
gap: 3px;
|
|
81
|
+
}
|
|
82
|
+
.aheart-ai-bubble__tool-heading strong {
|
|
83
|
+
color: var(--aheart-ai-text, #101828);
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
}
|
|
86
|
+
.aheart-ai-bubble__tool-heading span {
|
|
87
|
+
color: var(--aheart-ai-text-secondary, #475467);
|
|
88
|
+
font-size: 13px;
|
|
89
|
+
line-height: 1.45;
|
|
90
|
+
}
|
|
91
|
+
.aheart-ai-bubble__tool-details {
|
|
92
|
+
display: grid;
|
|
93
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
94
|
+
gap: 6px 10px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
line-height: 1.45;
|
|
98
|
+
}
|
|
99
|
+
.aheart-ai-bubble__tool-details dt {
|
|
100
|
+
color: var(--aheart-ai-text-secondary, #667085);
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
}
|
|
103
|
+
.aheart-ai-bubble__tool-details dd {
|
|
104
|
+
display: flex;
|
|
105
|
+
min-inline-size: 0;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
gap: 6px;
|
|
108
|
+
margin: 0;
|
|
109
|
+
color: var(--aheart-ai-text, #344054);
|
|
110
|
+
}
|
|
111
|
+
.aheart-ai-bubble__tool-details small {
|
|
112
|
+
padding: 1px 5px;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
background: color-mix(in srgb, currentColor 10%, transparent);
|
|
115
|
+
font-size: 11px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.aheart-ai-bubble__error {
|
|
119
|
+
padding: 8px 10px;
|
|
120
|
+
border-inline-start: 3px solid var(--aheart-color-danger, #d92d20);
|
|
121
|
+
background: #fff1f0;
|
|
122
|
+
color: #b42318;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.aheart-ai-attachments button {
|
|
126
|
+
min-block-size: 28px;
|
|
127
|
+
padding: 3px 8px;
|
|
128
|
+
border: 1px solid transparent;
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
background: transparent;
|
|
131
|
+
color: var(--aheart-ai-text-secondary);
|
|
132
|
+
font: 12px/1.4 inherit;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
transition: border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.aheart-ai-attachments button:hover,
|
|
138
|
+
.aheart-ai-attachments button:focus-visible {
|
|
139
|
+
border-color: #b9c2cf;
|
|
140
|
+
background: var(--aheart-ai-surface-subtle);
|
|
141
|
+
color: var(--aheart-ai-text);
|
|
142
|
+
outline: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.aheart-ai-sources,
|
|
146
|
+
.aheart-ai-process,
|
|
147
|
+
.aheart-ai-attachments {
|
|
148
|
+
display: grid;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.aheart-ai-attachments,
|
|
153
|
+
.aheart-ai-sources ul,
|
|
154
|
+
.aheart-ai-process ol {
|
|
155
|
+
margin: 0;
|
|
156
|
+
padding: 0;
|
|
157
|
+
list-style: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.aheart-ai-attachments li,
|
|
161
|
+
.aheart-ai-sources li {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: space-between;
|
|
165
|
+
gap: 8px;
|
|
166
|
+
min-block-size: 34px;
|
|
167
|
+
padding: 6px 8px;
|
|
168
|
+
border: 1px solid var(--aheart-ai-line);
|
|
169
|
+
border-radius: 5px;
|
|
170
|
+
background: var(--aheart-ai-surface-subtle);
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.aheart-ai-sources {
|
|
175
|
+
padding-block-start: 8px;
|
|
176
|
+
border-block-start: 1px solid var(--aheart-ai-line);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.aheart-ai-sources a {
|
|
180
|
+
color: var(--aheart-ai-brand-strong);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.aheart-ai-sources h3,
|
|
184
|
+
.aheart-ai-process h3 {
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
color: var(--aheart-ai-text-secondary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.aheart-ai-process ol {
|
|
190
|
+
display: grid;
|
|
191
|
+
gap: 6px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.aheart-ai-process li {
|
|
195
|
+
position: relative;
|
|
196
|
+
display: grid;
|
|
197
|
+
gap: 2px;
|
|
198
|
+
padding-inline-start: 16px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.aheart-ai-process li::before {
|
|
202
|
+
content: "";
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset-block-start: 7px;
|
|
205
|
+
inset-inline-start: 2px;
|
|
206
|
+
inline-size: 6px;
|
|
207
|
+
block-size: 6px;
|
|
208
|
+
border-radius: 50%;
|
|
209
|
+
background: #98a2b3;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.aheart-ai-process li.is-running::before {
|
|
213
|
+
background: var(--aheart-ai-cyan);
|
|
214
|
+
box-shadow: 0 0 0 3px #cffafe;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.aheart-ai-process li.is-complete::before {
|
|
218
|
+
background: #12b76a;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.aheart-ai-process li.is-stopped::before {
|
|
222
|
+
background: #98a2b3;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.aheart-ai-process li.is-error {
|
|
226
|
+
color: var(--aheart-color-danger, #d92d20);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@media (max-width: 760px) {
|
|
230
|
+
|
|
231
|
+
.aheart-ai-bubble {
|
|
232
|
+
max-inline-size: 96%;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (pointer: coarse) {
|
|
237
|
+
.aheart-ai-attachments button {
|
|
238
|
+
min-block-size: 44px;
|
|
239
|
+
min-inline-size: 44px;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AIContentRenderer, AIMessage } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
message: AIMessage;
|
|
4
|
+
contentRenderer?: AIContentRenderer | undefined;
|
|
5
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
message: AIMessage;
|
|
7
|
+
contentRenderer?: AIContentRenderer | undefined;
|
|
8
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
9
|
+
actions?(_: {
|
|
10
|
+
message: AIMessage;
|
|
11
|
+
}): any;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
package/es/bubble.vue.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as d, computed as c, openBlock as s, createElementBlock as a, normalizeClass as y, createElementVNode as t, toDisplayString as l, createVNode as r, unref as h, Fragment as i, createCommentVNode as n, renderSlot as f } from "vue";
|
|
2
|
+
import S from "./attachments.vue.js";
|
|
3
|
+
import k from "./process.vue.js";
|
|
4
|
+
import N from "./sources.vue.js";
|
|
5
|
+
import { renderSafeMarkdown as A } from "./safe-markdown.js";
|
|
6
|
+
const B = { class: "aheart-ai-bubble__header" }, $ = { class: "aheart-ai-bubble__content" }, I = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "aheart-ai-bubble__tool-call",
|
|
9
|
+
"aria-label": "工具调用摘要"
|
|
10
|
+
}, R = { class: "aheart-ai-bubble__tool-heading" }, v = { class: "aheart-ai-bubble__tool-details" }, V = { key: 0 }, E = { key: 0 }, F = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "aheart-ai-bubble__error"
|
|
13
|
+
}, M = /* @__PURE__ */ d({
|
|
14
|
+
name: "AAIBubble",
|
|
15
|
+
__name: "bubble",
|
|
16
|
+
props: {
|
|
17
|
+
message: {},
|
|
18
|
+
contentRenderer: { type: Function }
|
|
19
|
+
},
|
|
20
|
+
setup(e) {
|
|
21
|
+
const o = e, b = c(() => ({ user: "你", assistant: "AI 助手", system: "系统", tool: "工具" })[o.message.role]), g = c(() => {
|
|
22
|
+
var m;
|
|
23
|
+
return o.message.toolCall ? "" : ((m = o.contentRenderer) == null ? void 0 : m.call(o, o.message)) ?? A(o.message.content);
|
|
24
|
+
}), C = d({
|
|
25
|
+
name: "AIBubbleRenderNode",
|
|
26
|
+
props: {
|
|
27
|
+
node: { type: null, default: void 0 }
|
|
28
|
+
},
|
|
29
|
+
setup(m) {
|
|
30
|
+
return () => m.node;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (m, u) => (s(), a("article", {
|
|
34
|
+
class: y(["aheart-ai-bubble", `is-${e.message.role}`])
|
|
35
|
+
}, [
|
|
36
|
+
t("header", B, l(b.value), 1),
|
|
37
|
+
t("p", $, [
|
|
38
|
+
r(h(C), { node: g.value }, null, 8, ["node"])
|
|
39
|
+
]),
|
|
40
|
+
e.message.toolCall ? (s(), a("section", I, [
|
|
41
|
+
t("header", R, [
|
|
42
|
+
t("strong", null, l(e.message.toolCall.name), 1),
|
|
43
|
+
t("span", null, l(e.message.toolCall.summary), 1)
|
|
44
|
+
]),
|
|
45
|
+
t("dl", v, [
|
|
46
|
+
e.message.toolCall.inputSummary || e.message.toolCall.inputStatus ? (s(), a(i, { key: 0 }, [
|
|
47
|
+
u[0] || (u[0] = t("dt", null, "输入", -1)),
|
|
48
|
+
t("dd", null, [
|
|
49
|
+
t("span", null, l(e.message.toolCall.inputSummary), 1),
|
|
50
|
+
e.message.toolCall.inputStatus ? (s(), a("small", V, l(e.message.toolCall.inputStatus), 1)) : n("", !0)
|
|
51
|
+
])
|
|
52
|
+
], 64)) : n("", !0),
|
|
53
|
+
e.message.toolCall.resultSummary || e.message.toolCall.resultStatus ? (s(), a(i, { key: 1 }, [
|
|
54
|
+
u[1] || (u[1] = t("dt", null, "结果", -1)),
|
|
55
|
+
t("dd", null, [
|
|
56
|
+
t("span", null, l(e.message.toolCall.resultSummary), 1),
|
|
57
|
+
e.message.toolCall.resultStatus ? (s(), a("small", E, l(e.message.toolCall.resultStatus), 1)) : n("", !0)
|
|
58
|
+
])
|
|
59
|
+
], 64)) : n("", !0),
|
|
60
|
+
e.message.toolCall.error ? (s(), a(i, { key: 2 }, [
|
|
61
|
+
u[2] || (u[2] = t("dt", null, "错误", -1)),
|
|
62
|
+
t("dd", null, l(e.message.toolCall.error), 1)
|
|
63
|
+
], 64)) : n("", !0)
|
|
64
|
+
])
|
|
65
|
+
])) : n("", !0),
|
|
66
|
+
e.message.error ? (s(), a("p", F, l(e.message.error), 1)) : n("", !0),
|
|
67
|
+
r(k, {
|
|
68
|
+
items: e.message.process
|
|
69
|
+
}, null, 8, ["items"]),
|
|
70
|
+
r(N, {
|
|
71
|
+
sources: e.message.sources
|
|
72
|
+
}, null, 8, ["sources"]),
|
|
73
|
+
r(S, {
|
|
74
|
+
items: e.message.attachments
|
|
75
|
+
}, null, 8, ["items"]),
|
|
76
|
+
f(m.$slots, "actions", { message: e.message })
|
|
77
|
+
], 2));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
M as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as AIChatPanel } from '../chat-panel.vue';
|
|
2
|
+
export { default as AIActions } from '../actions.vue';
|
|
3
|
+
export { default as AIAttachments } from '../attachments.vue';
|
|
4
|
+
export { default as AIBubble } from '../bubble.vue';
|
|
5
|
+
export { default as AIConversations } from '../conversations.vue';
|
|
6
|
+
export { default as AIPrompts } from '../prompts.vue';
|
|
7
|
+
export { default as AISender } from '../sender.vue';
|
|
8
|
+
export { default as AISources } from '../sources.vue';
|
|
9
|
+
export { default as AIWelcome } from '../welcome.vue';
|
|
10
|
+
export type * from '../types';
|
|
11
|
+
export * from '../stream-reducer';
|
package/es/chat/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as r } from "../chat-panel.vue.js";
|
|
2
|
+
import { default as a } from "../actions.vue.js";
|
|
3
|
+
import { default as m } from "../attachments.vue.js";
|
|
4
|
+
import { default as u } from "../bubble.vue.js";
|
|
5
|
+
import { default as d } from "../conversations.vue.js";
|
|
6
|
+
import { default as p } from "../prompts.vue.js";
|
|
7
|
+
import { default as x } from "../sender.vue.js";
|
|
8
|
+
import { default as n } from "../sources.vue.js";
|
|
9
|
+
import { default as b } from "../welcome.vue.js";
|
|
10
|
+
import { createAIStreamReducer as i, reduceAIStreamEvent as v } from "../stream-reducer.js";
|
|
11
|
+
export {
|
|
12
|
+
a as AIActions,
|
|
13
|
+
m as AIAttachments,
|
|
14
|
+
u as AIBubble,
|
|
15
|
+
r as AIChatPanel,
|
|
16
|
+
d as AIConversations,
|
|
17
|
+
p as AIPrompts,
|
|
18
|
+
x as AISender,
|
|
19
|
+
n as AISources,
|
|
20
|
+
b as AIWelcome,
|
|
21
|
+
i as createAIStreamReducer,
|
|
22
|
+
v as reduceAIStreamEvent
|
|
23
|
+
};
|