@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,441 @@
1
+ import { defineComponent as fa, computed as w, openBlock as r, createElementBlock as l, createElementVNode as o, toDisplayString as n, createCommentVNode as i, Fragment as N, createVNode as S, unref as k, withCtx as y, createTextVNode as m, renderSlot as x, normalizeClass as D, normalizeStyle as ga, createBlock as ia, renderList as wa } from "vue";
2
+ import { Button as C } from "aheart-ui";
3
+ import { SortableList as ma } from "@aheart-ui/dnd/sortable";
4
+ import { getSafeUrl as da } from "./safe-markdown.js";
5
+ const Ca = { class: "aheart-ai-workbench__execution-content" }, $a = {
6
+ key: 0,
7
+ class: "aheart-ai-workbench__mobile-priority",
8
+ role: "region",
9
+ "aria-label": "移动端优先处理"
10
+ }, Aa = { class: "aheart-ai-workbench__priority-heading" }, ja = { class: "aheart-ai-workbench__eyebrow" }, Sa = { key: 0 }, Ba = { key: 1 }, Ia = {
11
+ key: 0,
12
+ class: "aheart-ai-workbench__priority-approval"
13
+ }, Ma = { key: 0 }, Ka = { class: "aheart-ai-workbench__priority-actions" }, Ra = {
14
+ key: 1,
15
+ class: "aheart-ai-workbench__approval-result"
16
+ }, za = ["aria-label"], La = { key: 0 }, Na = ["aria-label"], xa = { key: 0 }, Da = ["aria-labelledby"], Ta = { class: "aheart-ai-workbench__section-heading" }, Va = ["id"], Ea = { class: "aheart-ai-workbench__timeline" }, Fa = ["data-task-id"], Ha = { class: "aheart-ai-workbench__task-body" }, Ua = { class: "aheart-ai-workbench__task-summary" }, Pa = {
17
+ key: 0,
18
+ class: "aheart-ai-workbench__tool-name"
19
+ }, Wa = { class: "aheart-ai-workbench__task-status" }, Za = {
20
+ key: 0,
21
+ class: "aheart-ai-workbench__task-detail"
22
+ }, qa = {
23
+ key: 1,
24
+ class: "aheart-ai-workbench__tool-call",
25
+ "aria-label": "工具调用摘要"
26
+ }, Ga = { key: 0 }, Ja = { key: 1 }, Oa = { key: 2 }, Qa = {
27
+ key: 2,
28
+ class: "aheart-ai-workbench__task-lock-reason",
29
+ role: "status"
30
+ }, Xa = {
31
+ key: 3,
32
+ class: "aheart-ai-workbench__task-lock-reason",
33
+ role: "status"
34
+ }, Ya = {
35
+ key: 4,
36
+ class: "aheart-ai-workbench__task-lock-reason",
37
+ role: "status"
38
+ }, ae = {
39
+ key: 5,
40
+ class: "aheart-ai-workbench__task-progress"
41
+ }, ee = ["aria-valuenow"], te = {
42
+ key: 6,
43
+ class: "aheart-ai-workbench__task-time"
44
+ }, se = { key: 0 }, oe = { key: 1 }, re = {
45
+ key: 7,
46
+ class: "aheart-ai-workbench__task-error"
47
+ }, le = { class: "aheart-ai-workbench__task-actions" }, ne = {
48
+ key: 8,
49
+ class: "aheart-ai-workbench__operation-status",
50
+ role: "status"
51
+ }, ie = ["data-approval-id"], de = { key: 0 }, ce = {
52
+ key: 1,
53
+ class: "aheart-ai-workbench__approval-result"
54
+ }, ue = {
55
+ key: 0,
56
+ class: "aheart-ai-workbench__empty"
57
+ }, pe = ["aria-labelledby"], ve = { class: "aheart-ai-workbench__section-heading" }, _e = ["id"], ke = {
58
+ key: 0,
59
+ class: "aheart-ai-workbench__artifact-list"
60
+ }, he = ["data-artifact-id"], be = ["aria-pressed", "onClick"], ye = { key: 0 }, fe = {
61
+ key: 1,
62
+ class: "aheart-ai-workbench__empty"
63
+ }, ge = {
64
+ key: 2,
65
+ class: "aheart-ai-workbench__artifact-preview",
66
+ "aria-label": "产物预览"
67
+ }, we = { class: "aheart-ai-workbench__artifact-preview-header" }, me = ["href"], Ce = { key: 0 }, Be = /* @__PURE__ */ fa({
68
+ name: "AIAgentWorkbenchExecution",
69
+ __name: "agent-execution",
70
+ props: {
71
+ tasks: { default: () => [] },
72
+ artifacts: { default: () => [] },
73
+ activeArtifact: { default: void 0 },
74
+ disabled: { type: Boolean, default: !1 },
75
+ reorderable: { type: Boolean, default: !0 },
76
+ tasksRevision: {},
77
+ scopeKey: { default: "default" },
78
+ actionDisabled: { type: Function, default: () => !1 },
79
+ operationMessages: { default: () => ({}) },
80
+ validateCandidate: { type: Function, default: () => {
81
+ } }
82
+ },
83
+ emits: ["update:tasks", "approve", "reject", "cancel", "retry", "move-task", "move-task-reject", "select-artifact"],
84
+ setup(v, { emit: ca }) {
85
+ const d = v, T = w(() => `aheart-agent-execution-${String(d.scopeKey ?? "default").replace(/[^a-zA-Z0-9_-]/g, "-")}`), V = w(() => `${T.value}-tasks`), E = w(() => `${T.value}-artifacts`), _ = ca, ua = {
86
+ pending: "等待执行",
87
+ running: "执行中",
88
+ "waiting-approval": "等待审批",
89
+ complete: "已完成",
90
+ error: "执行失败",
91
+ cancelled: "已取消"
92
+ }, pa = w(() => d.tasks.map((t, s) => ({ ...t, __sortableKey: `${t.id}::${s}` }))), c = w(
93
+ () => d.artifacts.find((t) => t.id === d.activeArtifact) ?? d.artifacts[0]
94
+ ), u = w(
95
+ () => d.tasks.find((t) => t.approval && (!t.approval.status || t.approval.status === "pending")) ?? d.tasks.find((t) => t.approval)
96
+ ), $ = w(
97
+ () => d.artifacts.find((t) => {
98
+ var s, p;
99
+ return t.id === ((p = (s = u.value) == null ? void 0 : s.approval) == null ? void 0 : p.artifactId);
100
+ }) ?? c.value
101
+ ), va = w(() => {
102
+ var t;
103
+ return (t = u.value) != null && t.approval && (!u.value.approval.status || u.value.approval.status === "pending") ? "等待审批" : u.value ? "审批结果" : "当前产物";
104
+ }), e = (t) => t, h = (t) => t.toolCall, K = (t) => {
105
+ var s;
106
+ return `${t.id}:${String(t.revision ?? "")}:${((s = t.approval) == null ? void 0 : s.id) ?? ""}`;
107
+ }, _a = (t) => {
108
+ _("move-task-reject", {
109
+ "stale-revision": "任务版本已变化,排序已拒绝",
110
+ "source-missing": "源任务已不存在,排序已拒绝",
111
+ "target-missing": "目标位置已不存在,排序已拒绝",
112
+ "duplicate-key": "任务标识重复,无法排序",
113
+ "group-mismatch": "任务不属于当前排序分组",
114
+ disabled: "任务当前不可排序,排序已拒绝",
115
+ "invalid-position": "目标位置无效,排序已拒绝",
116
+ "parent-rejected": "任务版本已变化,排序已拒绝",
117
+ "rollback-rejected": "排序回滚失败,请刷新后重试",
118
+ unmounted: "排序目标已卸载",
119
+ cancelled: "排序已取消"
120
+ }[t.reason ?? ""] ?? "任务当前不可排序,排序已拒绝");
121
+ }, ka = (t) => ua[t], ha = (t) => t.status, ba = (t) => ka(t.status), R = (t) => Math.min(100, Math.max(0, Math.round(t ?? 0))), ya = (t) => {
122
+ var s;
123
+ if (!d.disabled && d.reorderable) {
124
+ const p = t.map(({ __sortableKey: B, ...j }) => j), f = (s = d.validateCandidate) == null ? void 0 : s.call(d, p);
125
+ if (f) {
126
+ _("move-task-reject", f);
127
+ return;
128
+ }
129
+ _("update:tasks", p);
130
+ }
131
+ }, F = (t, s) => {
132
+ var j;
133
+ if (z(d.tasks[t], t, s)) return;
134
+ const p = [...d.tasks], [f] = p.splice(t, 1);
135
+ p.splice(t + s, 0, f);
136
+ const B = (j = d.validateCandidate) == null ? void 0 : j.call(d, p);
137
+ if (B) {
138
+ _("move-task-reject", B);
139
+ return;
140
+ }
141
+ _("update:tasks", p), _("move-task", f.id, s < 0 ? "up" : "down");
142
+ }, A = (t, s) => {
143
+ var p;
144
+ return d.disabled || !!((p = d.actionDisabled) != null && p.call(d, t, s));
145
+ }, z = (t, s, p) => !!(d.disabled || !d.reorderable || s + p < 0 || s + p >= d.tasks.length || (t == null ? void 0 : t.reorderable) === !1 || t != null && t.lockedReason || (t == null ? void 0 : t.status) === "running" || (t == null ? void 0 : t.status) === "waiting-approval");
146
+ return (t, s) => {
147
+ var p, f, B, j, H, U;
148
+ return r(), l("div", Ca, [
149
+ u.value || c.value ? (r(), l("section", $a, [
150
+ o("div", Aa, [
151
+ o("span", ja, n(va.value), 1),
152
+ u.value ? (r(), l("strong", Sa, n((p = u.value.approval) == null ? void 0 : p.title), 1)) : (r(), l("strong", Ba, "查看当前产物"))
153
+ ]),
154
+ u.value ? (r(), l("div", Ia, [
155
+ (f = u.value.approval) != null && f.description ? (r(), l("p", Ma, n(u.value.approval.description), 1)) : i("", !0),
156
+ o("div", Ka, [
157
+ !((B = u.value.approval) != null && B.status) || u.value.approval.status === "pending" ? (r(), l(N, { key: 0 }, [
158
+ S(k(C), {
159
+ "data-action": "approve",
160
+ type: "primary",
161
+ disabled: A(u.value, "approve"),
162
+ onClick: s[0] || (s[0] = (a) => _("approve", u.value))
163
+ }, {
164
+ default: y(() => [...s[4] || (s[4] = [
165
+ m("批准", -1)
166
+ ])]),
167
+ _: 1
168
+ }, 8, ["disabled"]),
169
+ S(k(C), {
170
+ "data-action": "reject",
171
+ danger: "",
172
+ disabled: A(u.value, "reject"),
173
+ onClick: s[1] || (s[1] = (a) => _("reject", u.value))
174
+ }, {
175
+ default: y(() => [...s[5] || (s[5] = [
176
+ m("拒绝", -1)
177
+ ])]),
178
+ _: 1
179
+ }, 8, ["disabled"])
180
+ ], 64)) : (r(), l("span", Ra, n(u.value.approval.status === "approved" ? "已批准" : "已拒绝"), 1))
181
+ ])
182
+ ])) : i("", !0),
183
+ $.value ? (r(), l("button", {
184
+ key: 1,
185
+ type: "button",
186
+ class: "aheart-ai-workbench__priority-artifact",
187
+ "data-artifact-role": "approval",
188
+ "aria-label": $.value.title,
189
+ onClick: s[2] || (s[2] = (a) => _("select-artifact", $.value))
190
+ }, [
191
+ o("span", null, n((H = (j = u.value) == null ? void 0 : j.approval) != null && H.artifactId ? "审批对象" : "当前产物"), 1),
192
+ o("strong", null, n($.value.title), 1),
193
+ $.value.description ? (r(), l("small", La, n($.value.description), 1)) : i("", !0)
194
+ ], 8, za)) : i("", !0),
195
+ c.value && c.value.id !== ((U = $.value) == null ? void 0 : U.id) ? (r(), l("button", {
196
+ key: 2,
197
+ type: "button",
198
+ class: "aheart-ai-workbench__priority-artifact",
199
+ "data-artifact-role": "current",
200
+ "aria-label": c.value.title,
201
+ onClick: s[3] || (s[3] = (a) => _("select-artifact", c.value))
202
+ }, [
203
+ s[6] || (s[6] = o("span", null, "当前产物", -1)),
204
+ o("strong", null, n(c.value.title), 1),
205
+ c.value.description ? (r(), l("small", xa, n(c.value.description), 1)) : i("", !0)
206
+ ], 8, Na)) : i("", !0)
207
+ ])) : i("", !0),
208
+ o("section", {
209
+ class: "aheart-ai-workbench__tasks",
210
+ "aria-labelledby": V.value
211
+ }, [
212
+ o("div", Ta, [
213
+ o("div", null, [
214
+ s[7] || (s[7] = o("span", { class: "aheart-ai-workbench__eyebrow" }, "执行流程", -1)),
215
+ o("h2", { id: V.value }, "执行时间线", 8, Va)
216
+ ]),
217
+ o("span", null, n(v.tasks.length) + " 项", 1)
218
+ ]),
219
+ o("div", Ea, [
220
+ S(k(ma), {
221
+ items: pa.value,
222
+ "item-key": "__sortableKey",
223
+ disabled: v.disabled || !v.reorderable,
224
+ revision: v.tasksRevision,
225
+ group: `agent-tasks-${v.scopeKey}`,
226
+ "onUpdate:items": ya,
227
+ onMoveReject: _a
228
+ }, {
229
+ item: y(({ item: a, index: g }) => [
230
+ x(t.$slots, "task", {
231
+ task: e(a),
232
+ index: g
233
+ }, () => {
234
+ var I, L, P, W, Z, q, G, J, O, Q, X, Y, aa, ea, ta, sa, oa, ra, la, na;
235
+ return [
236
+ o("article", {
237
+ "data-task-id": e(a).id,
238
+ class: D(["aheart-ai-workbench__timeline-item", [`is-${ha(e(a))}`, { "has-approval-summary": !!e(a).approval }]])
239
+ }, [
240
+ s[15] || (s[15] = o("span", {
241
+ class: "aheart-ai-workbench__timeline-marker",
242
+ "aria-hidden": "true"
243
+ }, null, -1)),
244
+ o("div", Ha, [
245
+ o("header", Ua, [
246
+ o("div", null, [
247
+ o("strong", null, n(e(a).label), 1),
248
+ e(a).toolName ? (r(), l("span", Pa, n(e(a).toolName), 1)) : i("", !0)
249
+ ]),
250
+ o("span", Wa, n(ba(e(a))), 1)
251
+ ]),
252
+ e(a).detail && !h(e(a)) ? (r(), l("p", Za, n(e(a).detail), 1)) : i("", !0),
253
+ h(e(a)) ? (r(), l("section", qa, [
254
+ o("strong", null, n((I = h(e(a))) == null ? void 0 : I.name), 1),
255
+ o("span", null, n((L = h(e(a))) == null ? void 0 : L.summary), 1),
256
+ (P = h(e(a))) != null && P.inputSummary ? (r(), l("small", Ga, n((W = h(e(a))) == null ? void 0 : W.inputSummary), 1)) : i("", !0),
257
+ (Z = h(e(a))) != null && Z.resultSummary ? (r(), l("small", Ja, n((q = h(e(a))) == null ? void 0 : q.resultSummary), 1)) : i("", !0),
258
+ (G = h(e(a))) != null && G.error ? (r(), l("small", Oa, n((J = h(e(a))) == null ? void 0 : J.error), 1)) : i("", !0)
259
+ ])) : i("", !0),
260
+ e(a).lockedReason || ((O = v.operationMessages) == null ? void 0 : O[K(e(a))]) === "" ? (r(), l("p", Qa, n(e(a).lockedReason), 1)) : i("", !0),
261
+ e(a).revision === void 0 && A(e(a), "approve") ? (r(), l("p", Xa, "缺少任务版本")) : i("", !0),
262
+ (Q = e(a).approval) != null && Q.artifactId && (!v.artifacts.some((b) => {
263
+ var M;
264
+ return b.id === ((M = e(a).approval) == null ? void 0 : M.artifactId);
265
+ }) || v.artifacts.some((b) => {
266
+ var M;
267
+ return b.id === ((M = e(a).approval) == null ? void 0 : M.artifactId) && b.revision === void 0;
268
+ })) ? (r(), l("p", Ya, "缺少产物版本")) : i("", !0),
269
+ e(a).progress !== void 0 ? (r(), l("div", ae, [
270
+ o("div", {
271
+ role: "progressbar",
272
+ "aria-label": "任务进度",
273
+ "aria-valuemin": "0",
274
+ "aria-valuemax": "100",
275
+ "aria-valuenow": R(e(a).progress)
276
+ }, [
277
+ o("span", {
278
+ style: ga({ inlineSize: `${R(e(a).progress)}%` })
279
+ }, null, 4)
280
+ ], 8, ee),
281
+ o("small", null, n(R(e(a).progress)) + "%", 1)
282
+ ])) : i("", !0),
283
+ e(a).startedAt || e(a).completedAt ? (r(), l("div", te, [
284
+ e(a).startedAt ? (r(), l("span", se, "开始 " + n(e(a).startedAt), 1)) : i("", !0),
285
+ e(a).completedAt ? (r(), l("span", oe, "完成 " + n(e(a).completedAt), 1)) : i("", !0)
286
+ ])) : i("", !0),
287
+ e(a).error ? (r(), l("details", re, [
288
+ s[8] || (s[8] = o("summary", null, "查看错误详情", -1)),
289
+ o("p", null, n(e(a).error), 1)
290
+ ])) : i("", !0),
291
+ o("div", le, [
292
+ e(a).status === "running" ? (r(), ia(k(C), {
293
+ key: 0,
294
+ "data-action": "cancel",
295
+ type: "text",
296
+ disabled: A(e(a), "cancel"),
297
+ onClick: (b) => _("cancel", e(a))
298
+ }, {
299
+ default: y(() => [...s[9] || (s[9] = [
300
+ m("取消", -1)
301
+ ])]),
302
+ _: 1
303
+ }, 8, ["disabled", "onClick"])) : i("", !0),
304
+ e(a).status === "error" || (X = v.operationMessages) != null && X[K(e(a))] ? (r(), ia(k(C), {
305
+ key: 1,
306
+ "data-action": "retry",
307
+ type: "text",
308
+ disabled: A(e(a), "retry"),
309
+ onClick: (b) => _("retry", e(a))
310
+ }, {
311
+ default: y(() => [...s[10] || (s[10] = [
312
+ m("重试", -1)
313
+ ])]),
314
+ _: 1
315
+ }, 8, ["disabled", "onClick"])) : i("", !0),
316
+ S(k(C), {
317
+ "data-action": "move-up",
318
+ type: "text",
319
+ disabled: z(e(a), g, -1),
320
+ onClick: (b) => F(g, -1)
321
+ }, {
322
+ default: y(() => [...s[11] || (s[11] = [
323
+ m("上移", -1)
324
+ ])]),
325
+ _: 1
326
+ }, 8, ["disabled", "onClick"]),
327
+ S(k(C), {
328
+ "data-action": "move-down",
329
+ type: "text",
330
+ disabled: z(e(a), g, 1),
331
+ onClick: (b) => F(g, 1)
332
+ }, {
333
+ default: y(() => [...s[12] || (s[12] = [
334
+ m("下移", -1)
335
+ ])]),
336
+ _: 1
337
+ }, 8, ["disabled", "onClick"])
338
+ ]),
339
+ (Y = v.operationMessages) != null && Y[K(e(a))] ? (r(), l("p", ne, n(v.operationMessages[K(e(a))]), 1)) : i("", !0),
340
+ e(a).approval ? (r(), l("div", {
341
+ key: 9,
342
+ "data-approval-id": (aa = e(a).approval) == null ? void 0 : aa.id,
343
+ class: D(["aheart-ai-workbench__approval", `is-${((ea = e(a).approval) == null ? void 0 : ea.status) ?? "pending"}`])
344
+ }, [
345
+ o("div", null, [
346
+ o("strong", null, n((ta = e(a).approval) == null ? void 0 : ta.title), 1),
347
+ (sa = e(a).approval) != null && sa.description ? (r(), l("p", de, n((oa = e(a).approval) == null ? void 0 : oa.description), 1)) : i("", !0)
348
+ ]),
349
+ !((ra = e(a).approval) != null && ra.status) || ((la = e(a).approval) == null ? void 0 : la.status) === "pending" ? (r(), l(N, { key: 0 }, [
350
+ S(k(C), {
351
+ "data-action": "approve",
352
+ type: "primary",
353
+ disabled: A(e(a), "approve"),
354
+ onClick: (b) => _("approve", e(a))
355
+ }, {
356
+ default: y(() => [...s[13] || (s[13] = [
357
+ m("批准", -1)
358
+ ])]),
359
+ _: 1
360
+ }, 8, ["disabled", "onClick"]),
361
+ S(k(C), {
362
+ "data-action": "reject",
363
+ danger: "",
364
+ disabled: A(e(a), "reject"),
365
+ onClick: (b) => _("reject", e(a))
366
+ }, {
367
+ default: y(() => [...s[14] || (s[14] = [
368
+ m("拒绝", -1)
369
+ ])]),
370
+ _: 1
371
+ }, 8, ["disabled", "onClick"])
372
+ ], 64)) : (r(), l("span", ce, n(((na = e(a).approval) == null ? void 0 : na.status) === "approved" ? "已批准" : "已拒绝"), 1))
373
+ ], 10, ie)) : i("", !0)
374
+ ])
375
+ ], 10, Fa)
376
+ ];
377
+ })
378
+ ]),
379
+ _: 3
380
+ }, 8, ["items", "disabled", "revision", "group"])
381
+ ]),
382
+ v.tasks.length ? i("", !0) : (r(), l("p", ue, "尚无执行任务。"))
383
+ ], 8, Da),
384
+ o("section", {
385
+ class: "aheart-ai-workbench__artifacts",
386
+ "aria-labelledby": E.value
387
+ }, [
388
+ o("div", ve, [
389
+ o("div", null, [
390
+ s[16] || (s[16] = o("span", { class: "aheart-ai-workbench__eyebrow" }, "产物输出", -1)),
391
+ o("h2", { id: E.value }, "产物", 8, _e)
392
+ ]),
393
+ o("span", null, n(v.artifacts.length) + " 项", 1)
394
+ ]),
395
+ v.artifacts.length ? (r(), l("ul", ke, [
396
+ (r(!0), l(N, null, wa(v.artifacts, (a) => {
397
+ var g, I;
398
+ return r(), l("li", {
399
+ key: a.id,
400
+ "data-artifact-id": a.id,
401
+ class: D({ "is-active": a.id === ((g = c.value) == null ? void 0 : g.id) })
402
+ }, [
403
+ o("button", {
404
+ type: "button",
405
+ "aria-pressed": a.id === ((I = c.value) == null ? void 0 : I.id),
406
+ onClick: (L) => _("select-artifact", a)
407
+ }, [
408
+ x(t.$slots, "artifact", { artifact: a }, () => [
409
+ o("span", null, n(a.title), 1),
410
+ a.description ? (r(), l("small", ye, n(a.description), 1)) : i("", !0)
411
+ ])
412
+ ], 8, be)
413
+ ], 10, he);
414
+ }), 128))
415
+ ])) : (r(), l("p", fe, "任务完成后,产物会出现在这里。")),
416
+ c.value ? (r(), l("section", ge, [
417
+ x(t.$slots, "artifact-preview", { artifact: c.value }, () => [
418
+ o("div", we, [
419
+ o("div", null, [
420
+ o("span", null, n(c.value.type ?? "文件"), 1),
421
+ o("h3", null, n(c.value.title), 1)
422
+ ]),
423
+ k(da)(c.value.url) ? (r(), l("a", {
424
+ key: 0,
425
+ href: k(da)(c.value.url),
426
+ target: "_blank",
427
+ rel: "noreferrer"
428
+ }, "打开产物", 8, me)) : i("", !0)
429
+ ]),
430
+ o("p", null, n(c.value.description ?? "业务层可通过 artifact-preview 插槽提供自定义预览。"), 1),
431
+ c.value.updatedAt ? (r(), l("small", Ce, "更新于 " + n(c.value.updatedAt), 1)) : i("", !0)
432
+ ])
433
+ ])) : i("", !0)
434
+ ], 8, pe)
435
+ ]);
436
+ };
437
+ }
438
+ });
439
+ export {
440
+ Be as default
441
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./agent-execution.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export { default as AIAgentWorkbench, default } from '../agent-workbench.vue';
2
+ export type * from '../types';
@@ -0,0 +1,5 @@
1
+ import { default as a, default as f } from "../agent-workbench.vue.js";
2
+ export {
3
+ a as AIAgentWorkbench,
4
+ f as default
5
+ };