@aheart-ui/ai 0.0.0-stage → 1.0.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 +21 -2
- 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-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.vue.d.ts +186 -0
- package/es/agent-workbench.vue.js +537 -0
- package/es/agent-workbench.vue2.js +4 -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.vue.d.ts +27 -0
- package/es/bubble.vue.js +82 -0
- package/es/bubble.vue2.js +4 -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.vue.d.ts +39 -0
- package/es/conversations.vue.js +29 -0
- package/es/conversations.vue2.js +4 -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.vue.d.ts +30 -0
- package/es/process.vue.js +29 -0
- package/es/process.vue2.js +4 -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.vue.d.ts +52 -0
- package/es/sender.vue.js +46 -0
- package/es/sender.vue2.js +4 -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.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.vue.d.ts +41 -0
- package/es/welcome.vue.js +27 -0
- package/es/welcome.vue2.js +4 -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-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.vue.d.ts +186 -0
- package/lib/agent-workbench.vue.js +1 -0
- package/lib/agent-workbench.vue2.js +1 -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.vue.d.ts +27 -0
- package/lib/bubble.vue.js +1 -0
- package/lib/bubble.vue2.js +1 -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.vue.d.ts +39 -0
- package/lib/conversations.vue.js +1 -0
- package/lib/conversations.vue2.js +1 -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.vue.d.ts +30 -0
- package/lib/process.vue.js +1 -0
- package/lib/process.vue2.js +1 -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.vue.d.ts +52 -0
- package/lib/sender.vue.js +1 -0
- package/lib/sender.vue2.js +1 -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.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.vue.d.ts +41 -0
- package/lib/welcome.vue.js +1 -0
- package/lib/welcome.vue2.js +1 -0
- package/package.json +70 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AIProcessItem } from './types';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
items?: AIProcessItem[] | undefined;
|
|
4
|
+
}>, {
|
|
5
|
+
items: () => never[];
|
|
6
|
+
}>>, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
items?: AIProcessItem[] | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
items: () => never[];
|
|
10
|
+
}>>> & Readonly<{}>, {
|
|
11
|
+
items: AIProcessItem[];
|
|
12
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
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_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
type __VLS_Prettify<T> = {
|
|
29
|
+
[K in keyof T]: T[K];
|
|
30
|
+
} & {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent as t, openBlock as n, createBlock as o } from "vue";
|
|
2
|
+
import m from "./process.vue.js";
|
|
3
|
+
const s = /* @__PURE__ */ t({
|
|
4
|
+
name: "AAIThoughtChain",
|
|
5
|
+
__name: "thought-chain",
|
|
6
|
+
props: {
|
|
7
|
+
items: { default: () => [] }
|
|
8
|
+
},
|
|
9
|
+
setup(e) {
|
|
10
|
+
return (a, i) => (n(), o(m, { items: e.items }, null, 8, ["items"]));
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
s as default
|
|
15
|
+
};
|
package/es/types.d.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export type AIMessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
2
|
+
export type AIMessageStatus = 'complete' | 'streaming' | 'stopped' | 'error';
|
|
3
|
+
export type AIProcessStatus = 'pending' | 'running' | 'complete' | 'stopped' | 'error';
|
|
4
|
+
export interface AIAttachment {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AISource {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AIProcessItem {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
status: AIProcessStatus;
|
|
21
|
+
detail?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AIMessage {
|
|
24
|
+
id: string;
|
|
25
|
+
role: AIMessageRole;
|
|
26
|
+
content: string;
|
|
27
|
+
status?: AIMessageStatus;
|
|
28
|
+
attachments?: AIAttachment[];
|
|
29
|
+
sources?: AISource[];
|
|
30
|
+
process?: AIProcessItem[];
|
|
31
|
+
error?: string;
|
|
32
|
+
retryable?: boolean;
|
|
33
|
+
toolCall?: AIToolCallDisplay;
|
|
34
|
+
}
|
|
35
|
+
export interface AIToolCallDisplay {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
summary: string;
|
|
39
|
+
inputStatus?: 'pending' | 'ready' | 'redacted';
|
|
40
|
+
inputSummary?: string;
|
|
41
|
+
resultStatus?: 'pending' | 'success' | 'error';
|
|
42
|
+
resultSummary?: string;
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
45
|
+
export type AIContentRenderer = (message: AIMessage) => VNodeChild;
|
|
46
|
+
export type AIChatAction = 'send' | 'retry' | 'regenerate' | 'edit';
|
|
47
|
+
export interface AIChatRequest {
|
|
48
|
+
conversationId?: string;
|
|
49
|
+
messages: AIMessage[];
|
|
50
|
+
action?: AIChatAction;
|
|
51
|
+
messageId?: string;
|
|
52
|
+
}
|
|
53
|
+
export type AIStreamEvent = {
|
|
54
|
+
type: 'text-delta';
|
|
55
|
+
delta: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'process';
|
|
58
|
+
item: AIProcessItem;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'sources';
|
|
61
|
+
sources: AISource[];
|
|
62
|
+
} | {
|
|
63
|
+
type: 'done';
|
|
64
|
+
} | {
|
|
65
|
+
type: 'cancelled';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'error';
|
|
68
|
+
error: string;
|
|
69
|
+
};
|
|
70
|
+
export interface AITransport {
|
|
71
|
+
send(request: AIChatRequest, signal: AbortSignal): AsyncIterable<AIStreamEvent>;
|
|
72
|
+
}
|
|
73
|
+
export interface AIStreamEventBaseV2 {
|
|
74
|
+
version: '2';
|
|
75
|
+
requestId: string;
|
|
76
|
+
messageId: string;
|
|
77
|
+
sequence: number;
|
|
78
|
+
revision: number;
|
|
79
|
+
}
|
|
80
|
+
export type AIStreamEventV2 = (AIStreamEventBaseV2 & {
|
|
81
|
+
type: 'text-delta';
|
|
82
|
+
delta: string;
|
|
83
|
+
}) | (AIStreamEventBaseV2 & {
|
|
84
|
+
type: 'process-upsert';
|
|
85
|
+
item: AIProcessItem;
|
|
86
|
+
}) | (AIStreamEventBaseV2 & {
|
|
87
|
+
type: 'sources-replace';
|
|
88
|
+
sources: AISource[];
|
|
89
|
+
}) | (AIStreamEventBaseV2 & {
|
|
90
|
+
type: 'snapshot';
|
|
91
|
+
message: AIMessage;
|
|
92
|
+
}) | (AIStreamEventBaseV2 & {
|
|
93
|
+
type: 'final';
|
|
94
|
+
message: AIMessage;
|
|
95
|
+
}) | (AIStreamEventBaseV2 & {
|
|
96
|
+
type: 'cancelled';
|
|
97
|
+
reason?: string;
|
|
98
|
+
}) | (AIStreamEventBaseV2 & {
|
|
99
|
+
type: 'error';
|
|
100
|
+
error: string;
|
|
101
|
+
retryable?: boolean;
|
|
102
|
+
});
|
|
103
|
+
export interface AIChatResumeCursorV2 {
|
|
104
|
+
afterSequence: number;
|
|
105
|
+
revision: number;
|
|
106
|
+
}
|
|
107
|
+
export interface AIChatRequestV2 extends Omit<AIChatRequest, 'messageId'> {
|
|
108
|
+
version: '2';
|
|
109
|
+
requestId: string;
|
|
110
|
+
messageId: string;
|
|
111
|
+
targetMessageId?: string;
|
|
112
|
+
idempotencyKey: string;
|
|
113
|
+
resume?: AIChatResumeCursorV2;
|
|
114
|
+
}
|
|
115
|
+
export interface AITransportV2 {
|
|
116
|
+
version: '2';
|
|
117
|
+
send(request: AIChatRequestV2, signal: AbortSignal): AsyncIterable<AIStreamEventV2>;
|
|
118
|
+
resume?(request: AIChatRequestV2, signal: AbortSignal): AsyncIterable<AIStreamEventV2>;
|
|
119
|
+
}
|
|
120
|
+
export interface AIPrompt {
|
|
121
|
+
key: string;
|
|
122
|
+
label: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface AIConversation {
|
|
126
|
+
key: string;
|
|
127
|
+
label: string;
|
|
128
|
+
disabled?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface AIAction {
|
|
131
|
+
key: string;
|
|
132
|
+
label: string;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
}
|
|
135
|
+
export type AIAgentTaskStatus = 'pending' | 'running' | 'waiting-approval' | 'complete' | 'error' | 'cancelled';
|
|
136
|
+
export type AIAgentApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
137
|
+
export type AIAgentTaskKind = 'task' | 'tool' | 'approval';
|
|
138
|
+
export interface AIAgentApproval {
|
|
139
|
+
id: string;
|
|
140
|
+
title: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
artifactId?: string;
|
|
143
|
+
status?: AIAgentApprovalStatus;
|
|
144
|
+
}
|
|
145
|
+
export interface AIAgentTask {
|
|
146
|
+
id: string;
|
|
147
|
+
label: string;
|
|
148
|
+
status: AIAgentTaskStatus;
|
|
149
|
+
kind?: AIAgentTaskKind;
|
|
150
|
+
detail?: string;
|
|
151
|
+
error?: string;
|
|
152
|
+
toolName?: string;
|
|
153
|
+
progress?: number;
|
|
154
|
+
startedAt?: string;
|
|
155
|
+
completedAt?: string;
|
|
156
|
+
approval?: AIAgentApproval;
|
|
157
|
+
revision?: string | number;
|
|
158
|
+
dependsOn?: string[];
|
|
159
|
+
reorderable?: boolean;
|
|
160
|
+
lockedReason?: string;
|
|
161
|
+
toolCall?: AIToolCallDisplay;
|
|
162
|
+
}
|
|
163
|
+
export interface AIAgentContextItem {
|
|
164
|
+
id: string;
|
|
165
|
+
label: string;
|
|
166
|
+
description?: string;
|
|
167
|
+
disabled?: boolean;
|
|
168
|
+
}
|
|
169
|
+
export interface AIAgentArtifact {
|
|
170
|
+
id: string;
|
|
171
|
+
title: string;
|
|
172
|
+
description?: string;
|
|
173
|
+
type?: string;
|
|
174
|
+
url?: string;
|
|
175
|
+
status?: 'draft' | 'ready' | 'error';
|
|
176
|
+
updatedAt?: string;
|
|
177
|
+
revision?: string | number;
|
|
178
|
+
}
|
|
179
|
+
export type AIAgentOperationAction = 'approve' | 'reject' | 'cancel' | 'retry';
|
|
180
|
+
export type AIAgentOperationStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
181
|
+
export interface AIAgentOperationRequest {
|
|
182
|
+
operationId: string;
|
|
183
|
+
idempotencyKey: string;
|
|
184
|
+
conversationId?: string;
|
|
185
|
+
taskId: string;
|
|
186
|
+
taskRevision: string | number;
|
|
187
|
+
action: AIAgentOperationAction;
|
|
188
|
+
approvalId?: string;
|
|
189
|
+
artifactId?: string;
|
|
190
|
+
artifactRevision?: string | number;
|
|
191
|
+
}
|
|
192
|
+
export type AIAgentOperationResult = {
|
|
193
|
+
status: 'success';
|
|
194
|
+
operationId: string;
|
|
195
|
+
} | {
|
|
196
|
+
status: 'error';
|
|
197
|
+
operationId: string;
|
|
198
|
+
error: string;
|
|
199
|
+
retryable?: boolean;
|
|
200
|
+
outcome?: 'not-applied' | 'unknown';
|
|
201
|
+
};
|
|
202
|
+
export type AIAgentActionHandler = (request: AIAgentOperationRequest, signal: AbortSignal) => Promise<AIAgentOperationResult>;
|
|
203
|
+
import type { VNodeChild } from 'vue';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
title?: string | undefined;
|
|
3
|
+
description?: string | undefined;
|
|
4
|
+
}>, {
|
|
5
|
+
title: string;
|
|
6
|
+
description: undefined;
|
|
7
|
+
}>>, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
title: string;
|
|
12
|
+
description: undefined;
|
|
13
|
+
}>>> & Readonly<{}>, {
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>, {
|
|
17
|
+
default?(_: {}): any;
|
|
18
|
+
}>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type __VLS_WithDefaults<P, D> = {
|
|
30
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
31
|
+
default: D[K];
|
|
32
|
+
}> : P[K];
|
|
33
|
+
};
|
|
34
|
+
type __VLS_Prettify<T> = {
|
|
35
|
+
[K in keyof T]: T[K];
|
|
36
|
+
} & {};
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as i, openBlock as t, createElementBlock as o, createElementVNode as l, toDisplayString as s, createCommentVNode as c, renderSlot as n } from "vue";
|
|
2
|
+
const r = { class: "aheart-ai-welcome" }, d = { class: "aheart-ai-welcome__title" }, m = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "aheart-ai-welcome__description"
|
|
5
|
+
}, _ = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "aheart-ai-welcome__content"
|
|
8
|
+
}, p = /* @__PURE__ */ i({
|
|
9
|
+
name: "AAIWelcome",
|
|
10
|
+
__name: "welcome",
|
|
11
|
+
props: {
|
|
12
|
+
title: { default: "你好,我能为你做些什么?" },
|
|
13
|
+
description: { default: void 0 }
|
|
14
|
+
},
|
|
15
|
+
setup(e) {
|
|
16
|
+
return (a, h) => (t(), o("section", r, [
|
|
17
|
+
l("h2", d, s(e.title), 1),
|
|
18
|
+
e.description ? (t(), o("p", m, s(e.description), 1)) : c("", !0),
|
|
19
|
+
a.$slots.default ? (t(), o("div", _, [
|
|
20
|
+
n(a.$slots, "default")
|
|
21
|
+
])) : c("", !0)
|
|
22
|
+
]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
p as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AIAction } from './types';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
actions?: AIAction[] | undefined;
|
|
4
|
+
}>, {
|
|
5
|
+
actions: () => never[];
|
|
6
|
+
}>>, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
7
|
+
select: (action: AIAction) => void;
|
|
8
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
+
actions?: AIAction[] | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
actions: () => never[];
|
|
12
|
+
}>>> & Readonly<{
|
|
13
|
+
onSelect?: ((action: AIAction) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
actions: AIAction[];
|
|
16
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c={key:0,class:"aheart-ai-actions","aria-label":"消息操作"},s=["disabled","onClick"],a=e.defineComponent({name:"AAIActions",__name:"actions",props:{actions:{default:()=>[]}},emits:["select"],setup(n,{emit:o}){const l=o;return(i,r)=>n.actions.length?(e.openBlock(),e.createElementBlock("div",c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.actions,t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,type:"button",disabled:t.disabled,onClick:u=>l("select",t)},e.toDisplayString(t.label),9,s))),128))])):e.createCommentVNode("",!0)}});exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./actions.vue.js");exports.default=e.default;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { AIAgentArtifact, AIAgentTask } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").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/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").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/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").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/runtime-core").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"),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;
|