vue-agent-start 0.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 (169) hide show
  1. package/package.json +30 -0
  2. package/pnpm-workspace.yaml +3 -0
  3. package/src/agent-flow/adapter/backend.ts +99 -0
  4. package/src/agent-flow/components/ChatIframePanel.vue +773 -0
  5. package/src/agent-flow/components/DatasetItemCard.vue +313 -0
  6. package/src/agent-flow/components/MemoryWindow.vue +104 -0
  7. package/src/agent-flow/components/PromptEditor.vue +804 -0
  8. package/src/agent-flow/components/PromptEditorTagPanel.vue +460 -0
  9. package/src/agent-flow/components/SvgIcon.vue +32 -0
  10. package/src/agent-flow/components/ToolItemCard.vue +169 -0
  11. package/src/agent-flow/components/VariableCard.vue +161 -0
  12. package/src/agent-flow/components/VariableSelector.vue +162 -0
  13. package/src/agent-flow/components/chat-iframe-types.ts +35 -0
  14. package/src/agent-flow/components/stubs/DatasetChooser.vue +70 -0
  15. package/src/agent-flow/components/stubs/Embedding.vue +22 -0
  16. package/src/agent-flow/components/stubs/ModelSelect.vue +24 -0
  17. package/src/agent-flow/components/stubs/RestfulSelectCard.vue +24 -0
  18. package/src/agent-flow/components/stubs/ToolChooser.vue +96 -0
  19. package/src/agent-flow/components/stubs/TriggersItemCard.vue +126 -0
  20. package/src/agent-flow/components/stubs/VariableModal.vue +115 -0
  21. package/src/agent-flow/index.ts +73 -0
  22. package/src/agent-flow/stores/workflow.ts +72 -0
  23. package/src/agent-flow/utils/langUtils.ts +173 -0
  24. package/src/agent-flow/workflow/Ability.vue +65 -0
  25. package/src/agent-flow/workflow/AuthorizationItem.vue +101 -0
  26. package/src/agent-flow/workflow/ConversationVar.vue +42 -0
  27. package/src/agent-flow/workflow/CustomEdge.vue +94 -0
  28. package/src/agent-flow/workflow/EnvironmentVar.vue +40 -0
  29. package/src/agent-flow/workflow/FlowDesigner.vue +2802 -0
  30. package/src/agent-flow/workflow/Icon.vue +179 -0
  31. package/src/agent-flow/workflow/NodeConfig.vue +509 -0
  32. package/src/agent-flow/workflow/NodeConfigCard.vue +460 -0
  33. package/src/agent-flow/workflow/NodeHandle.vue +147 -0
  34. package/src/agent-flow/workflow/NodeHeaderToolbar.vue +77 -0
  35. package/src/agent-flow/workflow/NodeHoverToolbar.vue +176 -0
  36. package/src/agent-flow/workflow/OutputItemCard.vue +668 -0
  37. package/src/agent-flow/workflow/ParamTableItem.vue +200 -0
  38. package/src/agent-flow/workflow/StructTable.vue +202 -0
  39. package/src/agent-flow/workflow/VarInsertField.vue +517 -0
  40. package/src/agent-flow/workflow/VarSelectField.vue +223 -0
  41. package/src/agent-flow/workflow/VariableSelectorItem.vue +48 -0
  42. package/src/agent-flow/workflow/WfField.vue +206 -0
  43. package/src/agent-flow/workflow/_config-base.css +470 -0
  44. package/src/agent-flow/workflow/composables/useNode.js +55 -0
  45. package/src/agent-flow/workflow/index.vue +53 -0
  46. package/src/agent-flow/workflow/nodeCard/AgentNodeCard.vue +180 -0
  47. package/src/agent-flow/workflow/nodeCard/AnswerNodeCard.vue +65 -0
  48. package/src/agent-flow/workflow/nodeCard/ClassifierCard.vue +152 -0
  49. package/src/agent-flow/workflow/nodeCard/CodeNodeCard.vue +139 -0
  50. package/src/agent-flow/workflow/nodeCard/ConditionNodeCard.vue +323 -0
  51. package/src/agent-flow/workflow/nodeCard/DocumentExtractorCard.vue +83 -0
  52. package/src/agent-flow/workflow/nodeCard/EndNodeCard.vue +123 -0
  53. package/src/agent-flow/workflow/nodeCard/HttpNodeCard.vue +451 -0
  54. package/src/agent-flow/workflow/nodeCard/HumanInputCard.vue +152 -0
  55. package/src/agent-flow/workflow/nodeCard/IterationCard.vue +66 -0
  56. package/src/agent-flow/workflow/nodeCard/KnowledgeRetrievalCard.vue +48 -0
  57. package/src/agent-flow/workflow/nodeCard/LLMNodeCard.vue +206 -0
  58. package/src/agent-flow/workflow/nodeCard/ListOperatorCard.vue +188 -0
  59. package/src/agent-flow/workflow/nodeCard/ParameterExtractorCard.vue +352 -0
  60. package/src/agent-flow/workflow/nodeCard/ServiceApiNodeCard.vue +188 -0
  61. package/src/agent-flow/workflow/nodeCard/StartNodeCard.vue +216 -0
  62. package/src/agent-flow/workflow/nodeCard/VariableAssignerCard.vue +125 -0
  63. package/src/agent-flow/workflow/nodeCard/VariableNodeCard.vue +121 -0
  64. package/src/agent-flow/workflow/nodes/AgentNode.vue +122 -0
  65. package/src/agent-flow/workflow/nodes/AnswerNode.vue +99 -0
  66. package/src/agent-flow/workflow/nodes/ClassifierNode.vue +199 -0
  67. package/src/agent-flow/workflow/nodes/CodeNode.vue +152 -0
  68. package/src/agent-flow/workflow/nodes/ConditionNode.vue +232 -0
  69. package/src/agent-flow/workflow/nodes/DocumentExtractorNode.vue +96 -0
  70. package/src/agent-flow/workflow/nodes/EndNode.vue +119 -0
  71. package/src/agent-flow/workflow/nodes/FileUploadNode.vue +97 -0
  72. package/src/agent-flow/workflow/nodes/HttpNode.vue +204 -0
  73. package/src/agent-flow/workflow/nodes/HumanInputNode.vue +110 -0
  74. package/src/agent-flow/workflow/nodes/IterationNode.vue +98 -0
  75. package/src/agent-flow/workflow/nodes/KnowledgeRetrievalNode.vue +253 -0
  76. package/src/agent-flow/workflow/nodes/LLMNode.vue +134 -0
  77. package/src/agent-flow/workflow/nodes/ListOperatorNode.vue +111 -0
  78. package/src/agent-flow/workflow/nodes/LoopNode.vue +94 -0
  79. package/src/agent-flow/workflow/nodes/ParameterExtractorNode.vue +147 -0
  80. package/src/agent-flow/workflow/nodes/ServiceApiNode.vue +161 -0
  81. package/src/agent-flow/workflow/nodes/StartNode.vue +199 -0
  82. package/src/agent-flow/workflow/nodes/TemplateNode.vue +103 -0
  83. package/src/agent-flow/workflow/nodes/UserInputNode.vue +92 -0
  84. package/src/agent-flow/workflow/nodes/VariableAssignerNode.vue +145 -0
  85. package/src/agent-flow/workflow/nodes/VariableNode.vue +130 -0
  86. package/src/agent-flow/workflow/nodes/_node-base.css +338 -0
  87. package/src/agent-flow/workflow/utils/node_card_form.ts +335 -0
  88. package/src/agent-flow/workflow/utils/node_config.ts +63 -0
  89. package/src/agent-flow/workflow/utils/workflow_utils.ts +151 -0
  90. package/src/agent-studio/adapters/springAgentStart.ts +390 -0
  91. package/src/agent-studio/api/index.ts +1 -0
  92. package/src/agent-studio/api/types.ts +173 -0
  93. package/src/agent-studio/components/AgentApiDocs.vue +500 -0
  94. package/src/agent-studio/components/AgentAppsPage.vue +1601 -0
  95. package/src/agent-studio/components/AgentCardGrid.vue +259 -0
  96. package/src/agent-studio/components/AgentChatPage.vue +553 -0
  97. package/src/agent-studio/components/AgentDebugPanel.vue +350 -0
  98. package/src/agent-studio/components/AgentLogsPanel.vue +391 -0
  99. package/src/agent-studio/components/AgentMonitorPanel.vue +204 -0
  100. package/src/agent-studio/components/AgentOrchestrate.vue +505 -0
  101. package/src/agent-studio/components/AgentPromptEditor.vue +237 -0
  102. package/src/agent-studio/components/AgentStudioShell.vue +227 -0
  103. package/src/agent-studio/components/AgentToolsPanel.vue +394 -0
  104. package/src/agent-studio/components/AgentVariablesPanel.vue +205 -0
  105. package/src/agent-studio/components/ApiKeyManager.vue +251 -0
  106. package/src/agent-studio/components/AppDesignDrawer.vue +3391 -0
  107. package/src/agent-studio/components/CreateAppModal.vue +737 -0
  108. package/src/agent-studio/components/SparkChart.vue +200 -0
  109. package/src/agent-studio/components/VariableEditorModal.vue +499 -0
  110. package/src/agent-studio/composables/useAgentStudio.ts +347 -0
  111. package/src/agent-studio/index.ts +60 -0
  112. package/src/agent-studio/panels/DrawerFlowDesigner.vue +203 -0
  113. package/src/agent-studio/panels/LogAnnotationPanel.vue +490 -0
  114. package/src/agent-studio/panels/MonitorPanel.vue +535 -0
  115. package/src/agent-studio/types.ts +242 -0
  116. package/src/index.ts +155 -0
  117. package/src/knowledge-hub/adapters/springAgentStart.ts +472 -0
  118. package/src/knowledge-hub/components/AddDocumentsWizard.vue +1452 -0
  119. package/src/knowledge-hub/components/CreateDatasetWizard.vue +1723 -0
  120. package/src/knowledge-hub/components/DatasetCardGrid.vue +467 -0
  121. package/src/knowledge-hub/components/DatasetDetailDrawer.vue +888 -0
  122. package/src/knowledge-hub/components/DatasetPicker.vue +65 -0
  123. package/src/knowledge-hub/components/DatasetPickerModal.vue +526 -0
  124. package/src/knowledge-hub/components/DatasetSettingsPanel.vue +908 -0
  125. package/src/knowledge-hub/components/DatasetSidebar.vue +781 -0
  126. package/src/knowledge-hub/components/DocumentChunksView.vue +802 -0
  127. package/src/knowledge-hub/components/DocumentTable.vue +552 -0
  128. package/src/knowledge-hub/components/HitTestingPanel.vue +74 -0
  129. package/src/knowledge-hub/components/KnowledgeApp.vue +66 -0
  130. package/src/knowledge-hub/components/KnowledgeHubApp.vue +504 -0
  131. package/src/knowledge-hub/components/RecallTestingPanelV2.vue +515 -0
  132. package/src/knowledge-hub/components/RetrievalConfigPopover.vue +270 -0
  133. package/src/knowledge-hub/components/RetrievalMethodPicker.vue +547 -0
  134. package/src/knowledge-hub/components/RetrievedList.vue +24 -0
  135. package/src/knowledge-hub/components/internal/KhDialog.vue +195 -0
  136. package/src/knowledge-hub/composables/useKnowledge.ts +89 -0
  137. package/src/knowledge-hub/i18n/index.ts +2 -0
  138. package/src/knowledge-hub/i18n/messages.ts +422 -0
  139. package/src/knowledge-hub/i18n/useKhI18n.ts +107 -0
  140. package/src/knowledge-hub/index.ts +46 -0
  141. package/src/knowledge-hub/styles/index.css +4 -0
  142. package/src/knowledge-hub/styles/tokens.css +138 -0
  143. package/src/knowledge-hub/types/api.ts +213 -0
  144. package/src/knowledge-hub/types/dataset.ts +88 -0
  145. package/src/knowledge-hub/types/document.ts +45 -0
  146. package/src/knowledge-hub/types/index.ts +9 -0
  147. package/src/knowledge-hub/types/retrieval.ts +46 -0
  148. package/src/provider-hub/components/CredentialForm.vue +103 -0
  149. package/src/provider-hub/components/DefaultModelsPanel.vue +270 -0
  150. package/src/provider-hub/components/GroupedModelSelect.vue +445 -0
  151. package/src/provider-hub/components/ModelCardGrid.vue +332 -0
  152. package/src/provider-hub/components/ModelParameterDrawer.vue +739 -0
  153. package/src/provider-hub/components/ModelPickerPopover.vue +1282 -0
  154. package/src/provider-hub/components/ProviderApp.vue +159 -0
  155. package/src/provider-hub/components/ProviderCredentialModal.vue +321 -0
  156. package/src/provider-hub/components/ProviderGallery.vue +131 -0
  157. package/src/provider-hub/components/ProviderHubShell.vue +1992 -0
  158. package/src/provider-hub/components/ProviderIcon.vue +130 -0
  159. package/src/provider-hub/composables/useProviderHub.ts +358 -0
  160. package/src/provider-hub/index.ts +43 -0
  161. package/src/provider-hub/svg/MiniMax.svg +1 -0
  162. package/src/provider-hub/svg/Volcengine.svg +1 -0
  163. package/src/provider-hub/svg/Zhipu.svg +1 -0
  164. package/src/provider-hub/svg/deepseek.svg +1 -0
  165. package/src/provider-hub/svg/moonshot.svg +1 -0
  166. package/src/provider-hub/svg/openai.svg +1 -0
  167. package/src/provider-hub/svg/qwen.svg +1 -0
  168. package/src/provider-hub/svg/siliconflow.svg +1 -0
  169. package/src/provider-hub/types.ts +256 -0
@@ -0,0 +1,350 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * 调试与预览 — right-hand panel from Dify's orchestrate tab. Host-owned messages
4
+ * list; input events surface as `send(query)` so the host wires its SSE/stream.
5
+ */
6
+ import { nextTick, ref, watch } from 'vue';
7
+
8
+ import type { StudioChatMessage } from '../types';
9
+
10
+ interface Props {
11
+ messages: StudioChatMessage[];
12
+ loading?: boolean;
13
+ placeholder?: string;
14
+ /** Text under the input — Dify shows "对话已开启" or similar. */
15
+ hint?: string;
16
+ }
17
+
18
+ const props = withDefaults(defineProps<Props>(), {
19
+ loading: false,
20
+ placeholder: '和 Bot 聊天',
21
+ hint: '功能已开启',
22
+ });
23
+
24
+ const emit = defineEmits<{
25
+ (e: 'send', query: string): void;
26
+ (e: 'restart'): void;
27
+ }>();
28
+
29
+ const input = ref('');
30
+ const scroller = ref<HTMLElement | null>(null);
31
+
32
+ async function scrollBottom() {
33
+ await nextTick();
34
+ scroller.value?.scrollTo({
35
+ top: scroller.value.scrollHeight,
36
+ behavior: 'smooth',
37
+ });
38
+ }
39
+
40
+ watch(
41
+ () => props.messages.length,
42
+ () => {
43
+ scrollBottom();
44
+ },
45
+ );
46
+
47
+ function submit() {
48
+ const q = input.value.trim();
49
+ if (!q || props.loading) return;
50
+ input.value = '';
51
+ emit('send', q);
52
+ }
53
+
54
+ function onKeydown(e: KeyboardEvent) {
55
+ if (e.key === 'Enter' && !e.shiftKey) {
56
+ e.preventDefault();
57
+ submit();
58
+ }
59
+ }
60
+ </script>
61
+
62
+ <template>
63
+ <div class="dbg-card">
64
+ <div class="dbg-head">
65
+ <div class="dbg-head-title">调试与预览</div>
66
+ <button
67
+ type="button"
68
+ class="dbg-head-btn"
69
+ title="清空会话重新开始"
70
+ @click="emit('restart')"
71
+ >
72
+
73
+ </button>
74
+ </div>
75
+
76
+ <div ref="scroller" class="dbg-body">
77
+ <div v-if="messages.length === 0" class="dbg-empty">
78
+ <div class="dbg-empty-title">👋 开始一个对话</div>
79
+ <div class="dbg-empty-sub">在下方输入内容测试你的智能体</div>
80
+ </div>
81
+ <div
82
+ v-for="(m, i) in messages"
83
+ :key="i"
84
+ class="dbg-msg"
85
+ :class="{ 'dbg-msg-user': m.role === 'user' }"
86
+ >
87
+ <div class="dbg-avatar" v-if="m.role === 'assistant'">🤖</div>
88
+ <div class="dbg-bubble" :class="{ 'dbg-bubble-failed': m.failed }">
89
+ <div class="dbg-bubble-body">{{ m.content || '思考中...' }}</div>
90
+ <details
91
+ v-if="m.role === 'assistant' && m.steps && m.steps.length > 0"
92
+ class="dbg-steps"
93
+ >
94
+ <summary>思维链 · {{ m.steps.length }} 步</summary>
95
+ <div
96
+ v-for="(s, si) in m.steps"
97
+ :key="si"
98
+ class="dbg-step"
99
+ >
100
+ <div v-if="(s as any).thought">
101
+ <b>Thought:</b> {{ (s as any).thought }}
102
+ </div>
103
+ <div v-if="(s as any).action">
104
+ <b>Action:</b> {{ (s as any).action }}
105
+ </div>
106
+ <div v-if="(s as any).observation">
107
+ <b>Observation:</b> {{ (s as any).observation }}
108
+ </div>
109
+ </div>
110
+ </details>
111
+ </div>
112
+ <div class="dbg-avatar" v-if="m.role === 'user'">🧑</div>
113
+ </div>
114
+ </div>
115
+
116
+ <div class="dbg-input-wrap">
117
+ <div class="dbg-input-row">
118
+ <textarea
119
+ v-model="input"
120
+ class="dbg-input"
121
+ :placeholder="placeholder"
122
+ rows="1"
123
+ :disabled="loading"
124
+ @keydown="onKeydown"
125
+ />
126
+ <button
127
+ type="button"
128
+ class="dbg-send"
129
+ :disabled="!input.trim() || loading"
130
+ @click="submit"
131
+ >
132
+ <span v-if="loading">…</span>
133
+ <span v-else>➤</span>
134
+ </button>
135
+ </div>
136
+ <div class="dbg-input-hint">
137
+ <span class="dbg-hint-dot">●</span>
138
+ {{ hint }}
139
+ <button
140
+ type="button"
141
+ class="dbg-hint-link"
142
+ @click="emit('restart')"
143
+ >
144
+ 管理 →
145
+ </button>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </template>
150
+
151
+ <style scoped>
152
+ .dbg-card {
153
+ display: flex;
154
+ flex-direction: column;
155
+ height: 100%;
156
+ background: #fff;
157
+ border: 1px solid #e5e7eb;
158
+ border-radius: 12px;
159
+ overflow: hidden;
160
+ }
161
+ .dbg-head {
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: space-between;
165
+ padding: 10px 14px;
166
+ border-bottom: 1px solid #f1f5f9;
167
+ }
168
+ .dbg-head-title {
169
+ font-size: 13px;
170
+ font-weight: 600;
171
+ color: #334155;
172
+ }
173
+ .dbg-head-btn {
174
+ width: 26px;
175
+ height: 26px;
176
+ padding: 0;
177
+ border: none;
178
+ background: transparent;
179
+ border-radius: 6px;
180
+ color: #94a3b8;
181
+ font-size: 15px;
182
+ cursor: pointer;
183
+ }
184
+ .dbg-head-btn:hover {
185
+ background: #f1f5f9;
186
+ color: #475569;
187
+ }
188
+ .dbg-body {
189
+ flex: 1;
190
+ overflow-y: auto;
191
+ padding: 16px;
192
+ background: #fafbff;
193
+ }
194
+ .dbg-empty {
195
+ padding: 60px 20px;
196
+ text-align: center;
197
+ color: #94a3b8;
198
+ }
199
+ .dbg-empty-title {
200
+ font-size: 15px;
201
+ color: #64748b;
202
+ }
203
+ .dbg-empty-sub {
204
+ margin-top: 4px;
205
+ font-size: 12px;
206
+ }
207
+ .dbg-msg {
208
+ display: flex;
209
+ gap: 10px;
210
+ margin-bottom: 14px;
211
+ align-items: flex-start;
212
+ }
213
+ .dbg-msg-user {
214
+ flex-direction: row-reverse;
215
+ }
216
+ .dbg-avatar {
217
+ width: 30px;
218
+ height: 30px;
219
+ flex-shrink: 0;
220
+ display: flex;
221
+ align-items: center;
222
+ justify-content: center;
223
+ border-radius: 50%;
224
+ background: #eef2ff;
225
+ font-size: 15px;
226
+ }
227
+ .dbg-msg-user .dbg-avatar {
228
+ background: #ede9fe;
229
+ }
230
+ .dbg-bubble {
231
+ max-width: 78%;
232
+ padding: 10px 12px;
233
+ background: #fff;
234
+ border: 1px solid #e2e8f0;
235
+ border-radius: 12px;
236
+ font-size: 13px;
237
+ color: #0f172a;
238
+ line-height: 1.6;
239
+ }
240
+ .dbg-msg-user .dbg-bubble {
241
+ background: #4f46e5;
242
+ color: #fff;
243
+ border-color: #4f46e5;
244
+ }
245
+ .dbg-bubble-failed {
246
+ background: #fef2f2;
247
+ border-color: #fecaca;
248
+ color: #991b1b;
249
+ }
250
+ .dbg-bubble-body {
251
+ white-space: pre-wrap;
252
+ word-break: break-word;
253
+ }
254
+ .dbg-steps {
255
+ margin-top: 6px;
256
+ font-size: 11px;
257
+ color: #64748b;
258
+ }
259
+ .dbg-steps summary {
260
+ cursor: pointer;
261
+ padding: 2px 0;
262
+ }
263
+ .dbg-step {
264
+ padding: 6px 8px;
265
+ margin-top: 4px;
266
+ background: #f8fafc;
267
+ border-radius: 6px;
268
+ color: #475569;
269
+ }
270
+ .dbg-input-wrap {
271
+ padding: 10px 12px 12px;
272
+ border-top: 1px solid #f1f5f9;
273
+ background: #fff;
274
+ }
275
+ .dbg-input-row {
276
+ display: flex;
277
+ align-items: flex-end;
278
+ gap: 6px;
279
+ padding: 4px 6px 4px 12px;
280
+ border: 1px solid #e2e8f0;
281
+ border-radius: 12px;
282
+ background: #f8fafc;
283
+ }
284
+ .dbg-input-row:focus-within {
285
+ border-color: #6366f1;
286
+ background: #fff;
287
+ }
288
+ .dbg-input {
289
+ flex: 1;
290
+ min-height: 24px;
291
+ max-height: 120px;
292
+ padding: 6px 0;
293
+ border: none;
294
+ outline: none;
295
+ resize: none;
296
+ background: transparent;
297
+ font-family: inherit;
298
+ font-size: 13px;
299
+ color: #0f172a;
300
+ line-height: 1.5;
301
+ }
302
+ .dbg-input:disabled {
303
+ opacity: 0.6;
304
+ }
305
+ .dbg-send {
306
+ width: 32px;
307
+ height: 32px;
308
+ flex-shrink: 0;
309
+ padding: 0;
310
+ border: none;
311
+ border-radius: 999px;
312
+ background: linear-gradient(135deg, #6366f1, #4f46e5);
313
+ color: #fff;
314
+ font-size: 14px;
315
+ cursor: pointer;
316
+ transition: transform 0.05s ease;
317
+ }
318
+ .dbg-send:hover:not(:disabled) {
319
+ transform: scale(1.05);
320
+ }
321
+ .dbg-send:disabled {
322
+ background: #cbd5e1;
323
+ cursor: not-allowed;
324
+ }
325
+ .dbg-input-hint {
326
+ display: flex;
327
+ align-items: center;
328
+ gap: 4px;
329
+ margin-top: 8px;
330
+ padding-left: 4px;
331
+ font-size: 11px;
332
+ color: #94a3b8;
333
+ }
334
+ .dbg-hint-dot {
335
+ color: #22c55e;
336
+ font-size: 8px;
337
+ }
338
+ .dbg-hint-link {
339
+ margin-left: auto;
340
+ padding: 0;
341
+ border: none;
342
+ background: transparent;
343
+ color: #4338ca;
344
+ font-size: 11px;
345
+ cursor: pointer;
346
+ }
347
+ .dbg-hint-link:hover {
348
+ text-decoration: underline;
349
+ }
350
+ </style>