@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.
Files changed (205) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -2
  3. package/es/actions/index.d.ts +2 -0
  4. package/es/actions/index.js +5 -0
  5. package/es/actions/style.css +36 -0
  6. package/es/actions.vue.d.ts +34 -0
  7. package/es/actions.vue.js +27 -0
  8. package/es/actions.vue2.js +4 -0
  9. package/es/agent/index.d.ts +5 -0
  10. package/es/agent/index.js +12 -0
  11. package/es/agent/style.css +308 -0
  12. package/es/agent-execution.vue.d.ts +106 -0
  13. package/es/agent-execution.vue.js +441 -0
  14. package/es/agent-execution.vue2.js +4 -0
  15. package/es/agent-workbench/index.d.ts +2 -0
  16. package/es/agent-workbench/index.js +5 -0
  17. package/es/agent-workbench/style.css +1332 -0
  18. package/es/agent-workbench.vue.d.ts +186 -0
  19. package/es/agent-workbench.vue.js +537 -0
  20. package/es/agent-workbench.vue2.js +4 -0
  21. package/es/attachments/index.d.ts +2 -0
  22. package/es/attachments/index.js +5 -0
  23. package/es/attachments/style.css +62 -0
  24. package/es/attachments.vue.d.ts +39 -0
  25. package/es/attachments.vue.js +39 -0
  26. package/es/attachments.vue2.js +4 -0
  27. package/es/bubble/index.d.ts +2 -0
  28. package/es/bubble/index.js +5 -0
  29. package/es/bubble/style.css +241 -0
  30. package/es/bubble.vue.d.ts +27 -0
  31. package/es/bubble.vue.js +82 -0
  32. package/es/bubble.vue2.js +4 -0
  33. package/es/chat/index.d.ts +11 -0
  34. package/es/chat/index.js +23 -0
  35. package/es/chat/style.css +595 -0
  36. package/es/chat-panel/index.d.ts +3 -0
  37. package/es/chat-panel/index.js +8 -0
  38. package/es/chat-panel/style.css +595 -0
  39. package/es/chat-panel.vue.d.ts +108 -0
  40. package/es/chat-panel.vue.js +330 -0
  41. package/es/chat-panel.vue2.js +4 -0
  42. package/es/conversations/index.d.ts +2 -0
  43. package/es/conversations/index.js +5 -0
  44. package/es/conversations/style.css +48 -0
  45. package/es/conversations.vue.d.ts +39 -0
  46. package/es/conversations.vue.js +29 -0
  47. package/es/conversations.vue2.js +4 -0
  48. package/es/form/index.d.ts +3 -0
  49. package/es/form/index.js +9 -0
  50. package/es/form/style.css +242 -0
  51. package/es/form-field.vue.d.ts +28 -0
  52. package/es/form-field.vue.js +176 -0
  53. package/es/form-field.vue2.js +4 -0
  54. package/es/form-schema.d.ts +73 -0
  55. package/es/form-schema.js +105 -0
  56. package/es/form.vue.d.ts +81 -0
  57. package/es/form.vue.js +376 -0
  58. package/es/form.vue2.js +4 -0
  59. package/es/index.d.ts +20 -0
  60. package/es/index.js +42 -0
  61. package/es/package.json +3 -0
  62. package/es/process/index.d.ts +2 -0
  63. package/es/process/index.js +5 -0
  64. package/es/process/style.css +77 -0
  65. package/es/process.vue.d.ts +30 -0
  66. package/es/process.vue.js +29 -0
  67. package/es/process.vue2.js +4 -0
  68. package/es/prompts/index.d.ts +2 -0
  69. package/es/prompts/index.js +5 -0
  70. package/es/prompts/style.css +76 -0
  71. package/es/prompts.vue.d.ts +39 -0
  72. package/es/prompts.vue.js +33 -0
  73. package/es/prompts.vue2.js +4 -0
  74. package/es/safe-markdown.d.ts +3 -0
  75. package/es/safe-markdown.js +23 -0
  76. package/es/sender/index.d.ts +2 -0
  77. package/es/sender/index.js +5 -0
  78. package/es/sender/style.css +88 -0
  79. package/es/sender.vue.d.ts +52 -0
  80. package/es/sender.vue.js +46 -0
  81. package/es/sender.vue2.js +4 -0
  82. package/es/sources/index.d.ts +2 -0
  83. package/es/sources/index.js +5 -0
  84. package/es/sources/style.css +54 -0
  85. package/es/sources.vue.d.ts +30 -0
  86. package/es/sources.vue.js +34 -0
  87. package/es/sources.vue2.js +4 -0
  88. package/es/stream-reducer.d.ts +35 -0
  89. package/es/stream-reducer.js +85 -0
  90. package/es/style.css +1586 -0
  91. package/es/thought-chain/index.d.ts +2 -0
  92. package/es/thought-chain/index.js +5 -0
  93. package/es/thought-chain/style.css +77 -0
  94. package/es/thought-chain.vue.d.ts +30 -0
  95. package/es/thought-chain.vue.js +15 -0
  96. package/es/thought-chain.vue2.js +4 -0
  97. package/es/types.d.ts +203 -0
  98. package/es/welcome/index.d.ts +2 -0
  99. package/es/welcome/index.js +5 -0
  100. package/es/welcome/style.css +33 -0
  101. package/es/welcome.vue.d.ts +41 -0
  102. package/es/welcome.vue.js +27 -0
  103. package/es/welcome.vue2.js +4 -0
  104. package/lib/actions/index.d.ts +2 -0
  105. package/lib/actions/index.js +1 -0
  106. package/lib/actions/style.css +36 -0
  107. package/lib/actions.vue.d.ts +34 -0
  108. package/lib/actions.vue.js +1 -0
  109. package/lib/actions.vue2.js +1 -0
  110. package/lib/agent/index.d.ts +5 -0
  111. package/lib/agent/index.js +1 -0
  112. package/lib/agent/style.css +308 -0
  113. package/lib/agent-execution.vue.d.ts +106 -0
  114. package/lib/agent-execution.vue.js +1 -0
  115. package/lib/agent-execution.vue2.js +1 -0
  116. package/lib/agent-workbench/index.d.ts +2 -0
  117. package/lib/agent-workbench/index.js +1 -0
  118. package/lib/agent-workbench/style.css +1332 -0
  119. package/lib/agent-workbench.vue.d.ts +186 -0
  120. package/lib/agent-workbench.vue.js +1 -0
  121. package/lib/agent-workbench.vue2.js +1 -0
  122. package/lib/attachments/index.d.ts +2 -0
  123. package/lib/attachments/index.js +1 -0
  124. package/lib/attachments/style.css +62 -0
  125. package/lib/attachments.vue.d.ts +39 -0
  126. package/lib/attachments.vue.js +1 -0
  127. package/lib/attachments.vue2.js +1 -0
  128. package/lib/bubble/index.d.ts +2 -0
  129. package/lib/bubble/index.js +1 -0
  130. package/lib/bubble/style.css +241 -0
  131. package/lib/bubble.vue.d.ts +27 -0
  132. package/lib/bubble.vue.js +1 -0
  133. package/lib/bubble.vue2.js +1 -0
  134. package/lib/chat/index.d.ts +11 -0
  135. package/lib/chat/index.js +1 -0
  136. package/lib/chat/style.css +595 -0
  137. package/lib/chat-panel/index.d.ts +3 -0
  138. package/lib/chat-panel/index.js +1 -0
  139. package/lib/chat-panel/style.css +595 -0
  140. package/lib/chat-panel.vue.d.ts +108 -0
  141. package/lib/chat-panel.vue.js +1 -0
  142. package/lib/chat-panel.vue2.js +1 -0
  143. package/lib/conversations/index.d.ts +2 -0
  144. package/lib/conversations/index.js +1 -0
  145. package/lib/conversations/style.css +48 -0
  146. package/lib/conversations.vue.d.ts +39 -0
  147. package/lib/conversations.vue.js +1 -0
  148. package/lib/conversations.vue2.js +1 -0
  149. package/lib/form/index.d.ts +3 -0
  150. package/lib/form/index.js +1 -0
  151. package/lib/form/style.css +242 -0
  152. package/lib/form-field.vue.d.ts +28 -0
  153. package/lib/form-field.vue.js +1 -0
  154. package/lib/form-field.vue2.js +1 -0
  155. package/lib/form-schema.d.ts +73 -0
  156. package/lib/form-schema.js +1 -0
  157. package/lib/form.vue.d.ts +81 -0
  158. package/lib/form.vue.js +1 -0
  159. package/lib/form.vue2.js +1 -0
  160. package/lib/index.d.ts +20 -0
  161. package/lib/index.js +1 -0
  162. package/lib/package.json +3 -0
  163. package/lib/process/index.d.ts +2 -0
  164. package/lib/process/index.js +1 -0
  165. package/lib/process/style.css +77 -0
  166. package/lib/process.vue.d.ts +30 -0
  167. package/lib/process.vue.js +1 -0
  168. package/lib/process.vue2.js +1 -0
  169. package/lib/prompts/index.d.ts +2 -0
  170. package/lib/prompts/index.js +1 -0
  171. package/lib/prompts/style.css +76 -0
  172. package/lib/prompts.vue.d.ts +39 -0
  173. package/lib/prompts.vue.js +1 -0
  174. package/lib/prompts.vue2.js +1 -0
  175. package/lib/safe-markdown.d.ts +3 -0
  176. package/lib/safe-markdown.js +2 -0
  177. package/lib/sender/index.d.ts +2 -0
  178. package/lib/sender/index.js +1 -0
  179. package/lib/sender/style.css +88 -0
  180. package/lib/sender.vue.d.ts +52 -0
  181. package/lib/sender.vue.js +1 -0
  182. package/lib/sender.vue2.js +1 -0
  183. package/lib/sources/index.d.ts +2 -0
  184. package/lib/sources/index.js +1 -0
  185. package/lib/sources/style.css +54 -0
  186. package/lib/sources.vue.d.ts +30 -0
  187. package/lib/sources.vue.js +1 -0
  188. package/lib/sources.vue2.js +1 -0
  189. package/lib/stream-reducer.d.ts +35 -0
  190. package/lib/stream-reducer.js +1 -0
  191. package/lib/style.css +1586 -0
  192. package/lib/thought-chain/index.d.ts +2 -0
  193. package/lib/thought-chain/index.js +1 -0
  194. package/lib/thought-chain/style.css +77 -0
  195. package/lib/thought-chain.vue.d.ts +30 -0
  196. package/lib/thought-chain.vue.js +1 -0
  197. package/lib/thought-chain.vue2.js +1 -0
  198. package/lib/types.d.ts +203 -0
  199. package/lib/welcome/index.d.ts +2 -0
  200. package/lib/welcome/index.js +1 -0
  201. package/lib/welcome/style.css +33 -0
  202. package/lib/welcome.vue.d.ts +41 -0
  203. package/lib/welcome.vue.js +1 -0
  204. package/lib/welcome.vue2.js +1 -0
  205. package/package.json +172 -3
@@ -0,0 +1,308 @@
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-visually-hidden {
14
+ position: absolute;
15
+ width: 1px;
16
+ height: 1px;
17
+ padding: 0;
18
+ margin: -1px;
19
+ overflow: hidden;
20
+ clip: rect(0, 0, 0, 0);
21
+ white-space: nowrap;
22
+ border: 0;
23
+ }
24
+
25
+ .aheart-ai-form {
26
+ box-sizing: border-box;
27
+ color: var(--aheart-color-text, var(--aheart-ai-text));
28
+ letter-spacing: 0;
29
+ }
30
+
31
+ .aheart-ai-form * {
32
+ box-sizing: border-box;
33
+ }
34
+
35
+ .aheart-ai-process h3 {
36
+ margin: 0;
37
+ }
38
+
39
+ .aheart-ai-process small {
40
+ display: block;
41
+ color: var(--aheart-ai-text-secondary);
42
+ font-size: 12px;
43
+ }
44
+
45
+ .aheart-ai-process {
46
+ display: grid;
47
+ gap: 8px;
48
+ }
49
+
50
+ .aheart-ai-process ol {
51
+ margin: 0;
52
+ padding: 0;
53
+ list-style: none;
54
+ }
55
+
56
+ .aheart-ai-process h3 {
57
+ font-size: 12px;
58
+ color: var(--aheart-ai-text-secondary);
59
+ }
60
+
61
+ .aheart-ai-process ol {
62
+ display: grid;
63
+ gap: 6px;
64
+ }
65
+
66
+ .aheart-ai-process li {
67
+ position: relative;
68
+ display: grid;
69
+ gap: 2px;
70
+ padding-inline-start: 16px;
71
+ }
72
+
73
+ .aheart-ai-process li::before {
74
+ content: "";
75
+ position: absolute;
76
+ inset-block-start: 7px;
77
+ inset-inline-start: 2px;
78
+ inline-size: 6px;
79
+ block-size: 6px;
80
+ border-radius: 50%;
81
+ background: #98a2b3;
82
+ }
83
+
84
+ .aheart-ai-process li.is-running::before {
85
+ background: var(--aheart-ai-cyan);
86
+ box-shadow: 0 0 0 3px #cffafe;
87
+ }
88
+
89
+ .aheart-ai-process li.is-complete::before {
90
+ background: #12b76a;
91
+ }
92
+
93
+ .aheart-ai-process li.is-stopped::before {
94
+ background: #98a2b3;
95
+ }
96
+
97
+ .aheart-ai-process li.is-error {
98
+ color: var(--aheart-color-danger, #d92d20);
99
+ }
100
+
101
+ .aheart-ai-form {
102
+ display: grid;
103
+ gap: 20px;
104
+ inline-size: min(100%, 760px);
105
+ padding: clamp(18px, 4vw, 32px);
106
+ border: 1px solid var(--aheart-ai-line);
107
+ border-radius: 8px;
108
+ background: var(--aheart-ai-surface);
109
+ }
110
+
111
+ .aheart-ai-form__header {
112
+ display: grid;
113
+ gap: 5px;
114
+ padding-block-end: 18px;
115
+ border-block-end: 1px solid var(--aheart-ai-line);
116
+ }
117
+
118
+ .aheart-ai-form__header h2,
119
+ .aheart-ai-form__header p {
120
+ margin: 0;
121
+ }
122
+
123
+ .aheart-ai-form__header h2 {
124
+ color: var(--aheart-ai-text);
125
+ font-size: 20px;
126
+ line-height: 1.4;
127
+ }
128
+
129
+ .aheart-ai-form__header p {
130
+ color: var(--aheart-ai-text-secondary);
131
+ line-height: 1.6;
132
+ }
133
+
134
+ .aheart-ai-form__group {
135
+ display: grid;
136
+ gap: 16px;
137
+ min-inline-size: 0;
138
+ margin: 0;
139
+ padding: 0;
140
+ border: 0;
141
+ }
142
+
143
+ fieldset.aheart-ai-form__group {
144
+ padding-block-start: 16px;
145
+ border-block-start: 1px solid var(--aheart-ai-line);
146
+ }
147
+
148
+ .aheart-ai-form__group legend {
149
+ display: grid;
150
+ gap: 3px;
151
+ inline-size: 100%;
152
+ padding: 0;
153
+ color: var(--aheart-ai-text);
154
+ }
155
+
156
+ .aheart-ai-form__group legend span {
157
+ font-weight: 650;
158
+ }
159
+
160
+ .aheart-ai-form__group legend small,
161
+ .aheart-ai-form__field-description {
162
+ color: var(--aheart-ai-text-secondary);
163
+ font-size: 12px;
164
+ line-height: 1.5;
165
+ }
166
+
167
+ .aheart-ai-form__field {
168
+ display: grid;
169
+ grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
170
+ column-gap: 18px;
171
+ row-gap: 6px;
172
+ align-items: start;
173
+ padding: 3px 0;
174
+ border-radius: 5px;
175
+ outline: none;
176
+ }
177
+
178
+ .aheart-ai-form__field:focus-visible {
179
+ box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
180
+ }
181
+
182
+ .aheart-ai-form__field > label {
183
+ grid-column: 1;
184
+ grid-row: 1;
185
+ padding-block-start: 7px;
186
+ color: #344054;
187
+ font-weight: 550;
188
+ line-height: 1.5;
189
+ }
190
+
191
+ .aheart-ai-form__field-description {
192
+ grid-column: 1;
193
+ grid-row: 2;
194
+ margin: 0;
195
+ }
196
+
197
+ .aheart-ai-form__field > :not(label):not(.aheart-ai-form__field-description):not(.aheart-ai-form__field-error):not(.aheart-switch) {
198
+ grid-column: 2;
199
+ grid-row: 1 / span 2;
200
+ inline-size: 100%;
201
+ }
202
+
203
+ .aheart-ai-form__field > .aheart-switch {
204
+ grid-column: 2;
205
+ grid-row: 1 / span 2;
206
+ justify-self: start;
207
+ inline-size: fit-content;
208
+ }
209
+
210
+ .aheart-ai-form__required {
211
+ margin-inline-start: 3px;
212
+ color: var(--aheart-color-danger, #d92d20);
213
+ }
214
+
215
+ .aheart-ai-form__field-error {
216
+ grid-column: 2;
217
+ margin: 0;
218
+ color: var(--aheart-color-danger, #d92d20);
219
+ font-size: 12px;
220
+ }
221
+
222
+ .aheart-ai-form__field.is-error {
223
+ padding: 8px;
224
+ background: #fff7f6;
225
+ }
226
+
227
+ .aheart-ai-form__error-summary,
228
+ .aheart-ai-form__submit-error,
229
+ .aheart-ai-form__error {
230
+ border-inline-start: 3px solid var(--aheart-color-danger, #d92d20);
231
+ background: #fff7f6;
232
+ color: #912018;
233
+ }
234
+
235
+ .aheart-ai-form__error-summary {
236
+ display: grid;
237
+ gap: 8px;
238
+ padding: 12px 14px;
239
+ }
240
+
241
+ .aheart-ai-form__error-summary ul,
242
+ .aheart-ai-form__error ul {
243
+ display: grid;
244
+ gap: 4px;
245
+ margin: 0;
246
+ padding-inline-start: 20px;
247
+ }
248
+
249
+ .aheart-ai-form__error-summary button {
250
+ padding: 0;
251
+ border: 0;
252
+ background: transparent;
253
+ color: inherit;
254
+ font: inherit;
255
+ text-decoration: underline;
256
+ cursor: pointer;
257
+ }
258
+
259
+ .aheart-ai-form__submit-error {
260
+ margin: 0;
261
+ padding: 9px 12px;
262
+ }
263
+
264
+ .aheart-ai-form__footer {
265
+ display: flex;
266
+ justify-content: flex-end;
267
+ padding-block-start: 16px;
268
+ border-block-start: 1px solid var(--aheart-ai-line);
269
+ }
270
+
271
+ .aheart-ai-form__error {
272
+ display: grid;
273
+ gap: 8px;
274
+ max-inline-size: 760px;
275
+ padding: 16px;
276
+ }
277
+
278
+ @media (max-width: 760px) {
279
+
280
+ .aheart-ai-form {
281
+ padding: 18px 14px;
282
+ }
283
+
284
+ .aheart-ai-form__field {
285
+ grid-template-columns: minmax(0, 1fr);
286
+ }
287
+
288
+ .aheart-ai-form__field > label,
289
+ .aheart-ai-form__field-description,
290
+ .aheart-ai-form__field > :not(label):not(.aheart-ai-form__field-description):not(.aheart-ai-form__field-error):not(.aheart-switch),
291
+ .aheart-ai-form__field > .aheart-switch,
292
+ .aheart-ai-form__field-error {
293
+ grid-column: 1;
294
+ grid-row: auto;
295
+ }
296
+
297
+ .aheart-ai-form__field > label {
298
+ padding-block-start: 0;
299
+ }
300
+ }
301
+
302
+ @media (prefers-reduced-motion: reduce) {
303
+ .aheart-ai-form * {
304
+ scroll-behavior: auto !important;
305
+ transition-duration: 0.01ms !important;
306
+ animation-duration: 0.01ms !important;
307
+ }
308
+ }
@@ -0,0 +1,106 @@
1
+ import type { AIAgentArtifact, AIAgentTask } from './types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ tasks?: AIAgentTask[] | undefined;
4
+ artifacts?: AIAgentArtifact[] | undefined;
5
+ activeArtifact?: string | undefined;
6
+ disabled?: boolean | undefined;
7
+ reorderable?: boolean | undefined;
8
+ tasksRevision?: string | number | undefined;
9
+ scopeKey?: string | undefined;
10
+ actionDisabled?: ((task: AIAgentTask, action: string) => boolean) | undefined;
11
+ operationMessages?: Record<string, string> | undefined;
12
+ validateCandidate?: ((tasks: AIAgentTask[]) => string | undefined) | undefined;
13
+ }>, {
14
+ tasks: () => never[];
15
+ artifacts: () => never[];
16
+ activeArtifact: undefined;
17
+ disabled: boolean;
18
+ reorderable: boolean;
19
+ scopeKey: string;
20
+ actionDisabled: () => false;
21
+ operationMessages: () => {};
22
+ validateCandidate: () => undefined;
23
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ retry: (task: AIAgentTask) => void;
25
+ approve: (task: AIAgentTask) => void;
26
+ reject: (task: AIAgentTask) => void;
27
+ cancel: (task: AIAgentTask) => void;
28
+ "update:tasks": (tasks: AIAgentTask[]) => void;
29
+ "move-task": (id: string, direction: "up" | "down") => void;
30
+ "move-task-reject": (reason: string) => void;
31
+ "select-artifact": (artifact: AIAgentArtifact) => void;
32
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
33
+ tasks?: AIAgentTask[] | undefined;
34
+ artifacts?: AIAgentArtifact[] | undefined;
35
+ activeArtifact?: string | undefined;
36
+ disabled?: boolean | undefined;
37
+ reorderable?: boolean | undefined;
38
+ tasksRevision?: string | number | undefined;
39
+ scopeKey?: string | undefined;
40
+ actionDisabled?: ((task: AIAgentTask, action: string) => boolean) | undefined;
41
+ operationMessages?: Record<string, string> | undefined;
42
+ validateCandidate?: ((tasks: AIAgentTask[]) => string | undefined) | undefined;
43
+ }>, {
44
+ tasks: () => never[];
45
+ artifacts: () => never[];
46
+ activeArtifact: undefined;
47
+ disabled: boolean;
48
+ reorderable: boolean;
49
+ scopeKey: string;
50
+ actionDisabled: () => false;
51
+ operationMessages: () => {};
52
+ validateCandidate: () => undefined;
53
+ }>>> & Readonly<{
54
+ onRetry?: ((task: AIAgentTask) => any) | undefined;
55
+ onApprove?: ((task: AIAgentTask) => any) | undefined;
56
+ onReject?: ((task: AIAgentTask) => any) | undefined;
57
+ onCancel?: ((task: AIAgentTask) => any) | undefined;
58
+ "onUpdate:tasks"?: ((tasks: AIAgentTask[]) => any) | undefined;
59
+ "onMove-task"?: ((id: string, direction: "up" | "down") => any) | undefined;
60
+ "onMove-task-reject"?: ((reason: string) => any) | undefined;
61
+ "onSelect-artifact"?: ((artifact: AIAgentArtifact) => any) | undefined;
62
+ }>, {
63
+ disabled: boolean;
64
+ tasks: AIAgentTask[];
65
+ artifacts: AIAgentArtifact[];
66
+ activeArtifact: string;
67
+ reorderable: boolean;
68
+ scopeKey: string;
69
+ actionDisabled: (task: AIAgentTask, action: string) => boolean;
70
+ operationMessages: Record<string, string>;
71
+ validateCandidate: (tasks: AIAgentTask[]) => string | undefined;
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
73
+ task?(_: {
74
+ task: AIAgentTask;
75
+ index: number;
76
+ }): any;
77
+ artifact?(_: {
78
+ artifact: AIAgentArtifact;
79
+ }): any;
80
+ "artifact-preview"?(_: {
81
+ artifact: AIAgentArtifact;
82
+ }): any;
83
+ }>;
84
+ export default _default;
85
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
86
+ type __VLS_TypePropsToRuntimeProps<T> = {
87
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
88
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
89
+ } : {
90
+ type: import('vue').PropType<T[K]>;
91
+ required: true;
92
+ };
93
+ };
94
+ type __VLS_WithDefaults<P, D> = {
95
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
96
+ default: D[K];
97
+ }> : P[K];
98
+ };
99
+ type __VLS_Prettify<T> = {
100
+ [K in keyof T]: T[K];
101
+ } & {};
102
+ type __VLS_WithTemplateSlots<T, S> = T & {
103
+ new (): {
104
+ $slots: S;
105
+ };
106
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("aheart-ui"),ne=require("@aheart-ui/dnd/sortable"),J=require("./safe-markdown.js"),se={class:"aheart-ai-workbench__execution-content"},ce={key:0,class:"aheart-ai-workbench__mobile-priority",role:"region","aria-label":"移动端优先处理"},ie={class:"aheart-ai-workbench__priority-heading"},de={class:"aheart-ai-workbench__eyebrow"},pe={key:0},ue={key:1},ke={key:0,class:"aheart-ai-workbench__priority-approval"},me={key:0},ve={class:"aheart-ai-workbench__priority-actions"},_e={key:1,class:"aheart-ai-workbench__approval-result"},ye=["aria-label"],he={key:0},be=["aria-label"],ge={key:0},Be=["aria-labelledby"],Ne={class:"aheart-ai-workbench__section-heading"},Ve=["id"],Ee={class:"aheart-ai-workbench__timeline"},fe=["data-task-id"],Ce={class:"aheart-ai-workbench__task-body"},we={class:"aheart-ai-workbench__task-summary"},Se={key:0,class:"aheart-ai-workbench__tool-name"},De={class:"aheart-ai-workbench__task-status"},$e={key:0,class:"aheart-ai-workbench__task-detail"},xe={key:1,class:"aheart-ai-workbench__tool-call","aria-label":"工具调用摘要"},je={key:0},Ae={key:1},Te={key:2},Me={key:2,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ie={key:3,class:"aheart-ai-workbench__task-lock-reason",role:"status"},ze={key:4,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ke={key:5,class:"aheart-ai-workbench__task-progress"},Re=["aria-valuenow"],Le={key:6,class:"aheart-ai-workbench__task-time"},Fe={key:0},qe={key:1},Ue={key:7,class:"aheart-ai-workbench__task-error"},He={class:"aheart-ai-workbench__task-actions"},Pe={key:8,class:"aheart-ai-workbench__operation-status",role:"status"},Oe=["data-approval-id"],We={key:0},Ze={key:1,class:"aheart-ai-workbench__approval-result"},Ge={key:0,class:"aheart-ai-workbench__empty"},Je=["aria-labelledby"],Qe={class:"aheart-ai-workbench__section-heading"},Xe=["id"],Ye={key:0,class:"aheart-ai-workbench__artifact-list"},et=["data-artifact-id"],tt=["aria-pressed","onClick"],at={key:0},ot={key:1,class:"aheart-ai-workbench__empty"},lt={key:2,class:"aheart-ai-workbench__artifact-preview","aria-label":"产物预览"},rt={class:"aheart-ai-workbench__artifact-preview-header"},nt=["href"],st={key:0},ct=e.defineComponent({name:"AIAgentWorkbenchExecution",__name:"agent-execution",props:{tasks:{default:()=>[]},artifacts:{default:()=>[]},activeArtifact:{default:void 0},disabled:{type:Boolean,default:!1},reorderable:{type:Boolean,default:!0},tasksRevision:{},scopeKey:{default:"default"},actionDisabled:{type:Function,default:()=>!1},operationMessages:{default:()=>({})},validateCandidate:{type:Function,default:()=>{}}},emits:["update:tasks","approve","reject","cancel","retry","move-task","move-task-reject","select-artifact"],setup(i,{emit:Q}){const r=i,C=e.computed(()=>`aheart-agent-execution-${String(r.scopeKey??"default").replace(/[^a-zA-Z0-9_-]/g,"-")}`),w=e.computed(()=>`${C.value}-tasks`),S=e.computed(()=>`${C.value}-artifacts`),d=Q,X={pending:"等待执行",running:"执行中","waiting-approval":"等待审批",complete:"已完成",error:"执行失败",cancelled:"已取消"},Y=e.computed(()=>r.tasks.map((o,l)=>({...o,__sortableKey:`${o.id}::${l}`}))),n=e.computed(()=>r.artifacts.find(o=>o.id===r.activeArtifact)??r.artifacts[0]),s=e.computed(()=>r.tasks.find(o=>o.approval&&(!o.approval.status||o.approval.status==="pending"))??r.tasks.find(o=>o.approval)),_=e.computed(()=>r.artifacts.find(o=>{var l,c;return o.id===((c=(l=s.value)==null?void 0:l.approval)==null?void 0:c.artifactId)})??n.value),ee=e.computed(()=>{var o;return(o=s.value)!=null&&o.approval&&(!s.value.approval.status||s.value.approval.status==="pending")?"等待审批":s.value?"审批结果":"当前产物"}),a=o=>o,p=o=>o.toolCall,N=o=>{var l;return`${o.id}:${String(o.revision??"")}:${((l=o.approval)==null?void 0:l.id)??""}`},te=o=>{d("move-task-reject",{"stale-revision":"任务版本已变化,排序已拒绝","source-missing":"源任务已不存在,排序已拒绝","target-missing":"目标位置已不存在,排序已拒绝","duplicate-key":"任务标识重复,无法排序","group-mismatch":"任务不属于当前排序分组",disabled:"任务当前不可排序,排序已拒绝","invalid-position":"目标位置无效,排序已拒绝","parent-rejected":"任务版本已变化,排序已拒绝","rollback-rejected":"排序回滚失败,请刷新后重试",unmounted:"排序目标已卸载",cancelled:"排序已取消"}[o.reason??""]??"任务当前不可排序,排序已拒绝")},ae=o=>X[o],oe=o=>o.status,le=o=>ae(o.status),V=o=>Math.min(100,Math.max(0,Math.round(o??0))),re=o=>{var l;if(!r.disabled&&r.reorderable){const c=o.map(({__sortableKey:b,...h})=>h),k=(l=r.validateCandidate)==null?void 0:l.call(r,c);if(k){d("move-task-reject",k);return}d("update:tasks",c)}},D=(o,l)=>{var h;if(E(r.tasks[o],o,l))return;const c=[...r.tasks],[k]=c.splice(o,1);c.splice(o+l,0,k);const b=(h=r.validateCandidate)==null?void 0:h.call(r,c);if(b){d("move-task-reject",b);return}d("update:tasks",c),d("move-task",k.id,l<0?"up":"down")},y=(o,l)=>{var c;return r.disabled||!!((c=r.actionDisabled)!=null&&c.call(r,o,l))},E=(o,l,c)=>!!(r.disabled||!r.reorderable||l+c<0||l+c>=r.tasks.length||(o==null?void 0:o.reorderable)===!1||o!=null&&o.lockedReason||(o==null?void 0:o.status)==="running"||(o==null?void 0:o.status)==="waiting-approval");return(o,l)=>{var c,k,b,h,$,x;return e.openBlock(),e.createElementBlock("div",se,[s.value||n.value?(e.openBlock(),e.createElementBlock("section",ce,[e.createElementVNode("div",ie,[e.createElementVNode("span",de,e.toDisplayString(ee.value),1),s.value?(e.openBlock(),e.createElementBlock("strong",pe,e.toDisplayString((c=s.value.approval)==null?void 0:c.title),1)):(e.openBlock(),e.createElementBlock("strong",ue,"查看当前产物"))]),s.value?(e.openBlock(),e.createElementBlock("div",ke,[(k=s.value.approval)!=null&&k.description?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(s.value.approval.description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ve,[!((b=s.value.approval)!=null&&b.status)||s.value.approval.status==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(s.value,"approve"),onClick:l[0]||(l[0]=t=>d("approve",s.value))},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(s.value,"reject"),onClick:l[1]||(l[1]=t=>d("reject",s.value))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled"])],64)):(e.openBlock(),e.createElementBlock("span",_e,e.toDisplayString(s.value.approval.status==="approved"?"已批准":"已拒绝"),1))])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"approval","aria-label":_.value.title,onClick:l[2]||(l[2]=t=>d("select-artifact",_.value))},[e.createElementVNode("span",null,e.toDisplayString(($=(h=s.value)==null?void 0:h.approval)!=null&&$.artifactId?"审批对象":"当前产物"),1),e.createElementVNode("strong",null,e.toDisplayString(_.value.title),1),_.value.description?(e.openBlock(),e.createElementBlock("small",he,e.toDisplayString(_.value.description),1)):e.createCommentVNode("",!0)],8,ye)):e.createCommentVNode("",!0),n.value&&n.value.id!==((x=_.value)==null?void 0:x.id)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"current","aria-label":n.value.title,onClick:l[3]||(l[3]=t=>d("select-artifact",n.value))},[l[6]||(l[6]=e.createElementVNode("span",null,"当前产物",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value.title),1),n.value.description?(e.openBlock(),e.createElementBlock("small",ge,e.toDisplayString(n.value.description),1)):e.createCommentVNode("",!0)],8,be)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:"aheart-ai-workbench__tasks","aria-labelledby":w.value},[e.createElementVNode("div",Ne,[e.createElementVNode("div",null,[l[7]||(l[7]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"执行流程",-1)),e.createElementVNode("h2",{id:w.value},"执行时间线",8,Ve)]),e.createElementVNode("span",null,e.toDisplayString(i.tasks.length)+" 项",1)]),e.createElementVNode("div",Ee,[e.createVNode(e.unref(ne.SortableList),{items:Y.value,"item-key":"__sortableKey",disabled:i.disabled||!i.reorderable,revision:i.tasksRevision,group:`agent-tasks-${i.scopeKey}`,"onUpdate:items":re,onMoveReject:te},{item:e.withCtx(({item:t,index:m})=>[e.renderSlot(o.$slots,"task",{task:a(t),index:m},()=>{var g,f,j,A,T,M,I,z,K,R,L,F,q,U,H,P,O,W,Z,G;return[e.createElementVNode("article",{"data-task-id":a(t).id,class:e.normalizeClass(["aheart-ai-workbench__timeline-item",[`is-${oe(a(t))}`,{"has-approval-summary":!!a(t).approval}]])},[l[15]||(l[15]=e.createElementVNode("span",{class:"aheart-ai-workbench__timeline-marker","aria-hidden":"true"},null,-1)),e.createElementVNode("div",Ce,[e.createElementVNode("header",we,[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString(a(t).label),1),a(t).toolName?(e.openBlock(),e.createElementBlock("span",Se,e.toDisplayString(a(t).toolName),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",De,e.toDisplayString(le(a(t))),1)]),a(t).detail&&!p(a(t))?(e.openBlock(),e.createElementBlock("p",$e,e.toDisplayString(a(t).detail),1)):e.createCommentVNode("",!0),p(a(t))?(e.openBlock(),e.createElementBlock("section",xe,[e.createElementVNode("strong",null,e.toDisplayString((g=p(a(t)))==null?void 0:g.name),1),e.createElementVNode("span",null,e.toDisplayString((f=p(a(t)))==null?void 0:f.summary),1),(j=p(a(t)))!=null&&j.inputSummary?(e.openBlock(),e.createElementBlock("small",je,e.toDisplayString((A=p(a(t)))==null?void 0:A.inputSummary),1)):e.createCommentVNode("",!0),(T=p(a(t)))!=null&&T.resultSummary?(e.openBlock(),e.createElementBlock("small",Ae,e.toDisplayString((M=p(a(t)))==null?void 0:M.resultSummary),1)):e.createCommentVNode("",!0),(I=p(a(t)))!=null&&I.error?(e.openBlock(),e.createElementBlock("small",Te,e.toDisplayString((z=p(a(t)))==null?void 0:z.error),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).lockedReason||((K=i.operationMessages)==null?void 0:K[N(a(t))])===""?(e.openBlock(),e.createElementBlock("p",Me,e.toDisplayString(a(t).lockedReason),1)):e.createCommentVNode("",!0),a(t).revision===void 0&&y(a(t),"approve")?(e.openBlock(),e.createElementBlock("p",Ie,"缺少任务版本")):e.createCommentVNode("",!0),(R=a(t).approval)!=null&&R.artifactId&&(!i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)})||i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)&&u.revision===void 0}))?(e.openBlock(),e.createElementBlock("p",ze,"缺少产物版本")):e.createCommentVNode("",!0),a(t).progress!==void 0?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{role:"progressbar","aria-label":"任务进度","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":V(a(t).progress)},[e.createElementVNode("span",{style:e.normalizeStyle({inlineSize:`${V(a(t).progress)}%`})},null,4)],8,Re),e.createElementVNode("small",null,e.toDisplayString(V(a(t).progress))+"%",1)])):e.createCommentVNode("",!0),a(t).startedAt||a(t).completedAt?(e.openBlock(),e.createElementBlock("div",Le,[a(t).startedAt?(e.openBlock(),e.createElementBlock("span",Fe,"开始 "+e.toDisplayString(a(t).startedAt),1)):e.createCommentVNode("",!0),a(t).completedAt?(e.openBlock(),e.createElementBlock("span",qe,"完成 "+e.toDisplayString(a(t).completedAt),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).error?(e.openBlock(),e.createElementBlock("details",Ue,[l[8]||(l[8]=e.createElementVNode("summary",null,"查看错误详情",-1)),e.createElementVNode("p",null,e.toDisplayString(a(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[a(t).status==="running"?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:0,"data-action":"cancel",type:"text",disabled:y(a(t),"cancel"),onClick:u=>d("cancel",a(t))},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),a(t).status==="error"||(L=i.operationMessages)!=null&&L[N(a(t))]?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:1,"data-action":"retry",type:"text",disabled:y(a(t),"retry"),onClick:u=>d("retry",a(t))},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("重试",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v.Button),{"data-action":"move-up",type:"text",disabled:E(a(t),m,-1),onClick:u=>D(m,-1)},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"move-down",type:"text",disabled:E(a(t),m,1),onClick:u=>D(m,1)},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])]),(F=i.operationMessages)!=null&&F[N(a(t))]?(e.openBlock(),e.createElementBlock("p",Pe,e.toDisplayString(i.operationMessages[N(a(t))]),1)):e.createCommentVNode("",!0),a(t).approval?(e.openBlock(),e.createElementBlock("div",{key:9,"data-approval-id":(q=a(t).approval)==null?void 0:q.id,class:e.normalizeClass(["aheart-ai-workbench__approval",`is-${((U=a(t).approval)==null?void 0:U.status)??"pending"}`])},[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString((H=a(t).approval)==null?void 0:H.title),1),(P=a(t).approval)!=null&&P.description?(e.openBlock(),e.createElementBlock("p",We,e.toDisplayString((O=a(t).approval)==null?void 0:O.description),1)):e.createCommentVNode("",!0)]),!((W=a(t).approval)!=null&&W.status)||((Z=a(t).approval)==null?void 0:Z.status)==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(a(t),"approve"),onClick:u=>d("approve",a(t))},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(a(t),"reject"),onClick:u=>d("reject",a(t))},{default:e.withCtx(()=>[...l[14]||(l[14]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled","onClick"])],64)):(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(((G=a(t).approval)==null?void 0:G.status)==="approved"?"已批准":"已拒绝"),1))],10,Oe)):e.createCommentVNode("",!0)])],10,fe)]})]),_:3},8,["items","disabled","revision","group"])]),i.tasks.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Ge,"尚无执行任务。"))],8,Be),e.createElementVNode("section",{class:"aheart-ai-workbench__artifacts","aria-labelledby":S.value},[e.createElementVNode("div",Qe,[e.createElementVNode("div",null,[l[16]||(l[16]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"产物输出",-1)),e.createElementVNode("h2",{id:S.value},"产物",8,Xe)]),e.createElementVNode("span",null,e.toDisplayString(i.artifacts.length)+" 项",1)]),i.artifacts.length?(e.openBlock(),e.createElementBlock("ul",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.artifacts,t=>{var m,g;return e.openBlock(),e.createElementBlock("li",{key:t.id,"data-artifact-id":t.id,class:e.normalizeClass({"is-active":t.id===((m=n.value)==null?void 0:m.id)})},[e.createElementVNode("button",{type:"button","aria-pressed":t.id===((g=n.value)==null?void 0:g.id),onClick:f=>d("select-artifact",t)},[e.renderSlot(o.$slots,"artifact",{artifact:t},()=>[e.createElementVNode("span",null,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("small",at,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])],8,tt)],10,et)}),128))])):(e.openBlock(),e.createElementBlock("p",ot,"任务完成后,产物会出现在这里。")),n.value?(e.openBlock(),e.createElementBlock("section",lt,[e.renderSlot(o.$slots,"artifact-preview",{artifact:n.value},()=>[e.createElementVNode("div",rt,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(n.value.type??"文件"),1),e.createElementVNode("h3",null,e.toDisplayString(n.value.title),1)]),e.unref(J.getSafeUrl)(n.value.url)?(e.openBlock(),e.createElementBlock("a",{key:0,href:e.unref(J.getSafeUrl)(n.value.url),target:"_blank",rel:"noreferrer"},"打开产物",8,nt)):e.createCommentVNode("",!0)]),e.createElementVNode("p",null,e.toDisplayString(n.value.description??"业务层可通过 artifact-preview 插槽提供自定义预览。"),1),n.value.updatedAt?(e.openBlock(),e.createElementBlock("small",st,"更新于 "+e.toDisplayString(n.value.updatedAt),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],8,Je)])}}});exports.default=ct;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./agent-execution.vue.js");exports.default=e.default;
@@ -0,0 +1,2 @@
1
+ export { default as AIAgentWorkbench, default } from '../agent-workbench.vue';
2
+ export type * from '../types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../agent-workbench.vue.js");exports.AIAgentWorkbench=e.default;exports.default=e.default;