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,251 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * ApiKeyManager — Dify-style "API 密钥" modal.
4
+ *
5
+ * Layout mirrors https://cloud.dify.ai/app/<id>/develop → 「API 密钥」按钮
6
+ * ┌ API 密钥 ─────────────────────── ✕ ┐
7
+ * │ 如果不想你的 API 被滥用,请保护好… │
8
+ * │ │
9
+ * │ 密钥 创建时间 最后使用 │
10
+ * │ app...xxxxxxxxxxx 2026-06-14 … │
11
+ * │ ... │
12
+ * │ │
13
+ * │ [创建密钥] │
14
+ * └───────────────────────────────────────┘
15
+ *
16
+ * The panel is presentation-only: it emits {@code list} / {@code create} /
17
+ * {@code delete} to the host (which turns them into REST calls). The host
18
+ * passes results back via the {@code keys} prop.
19
+ *
20
+ * Key masking follows Dify: show the 3-char prefix + "..." + last 20 chars.
21
+ * A "复制" button next to each row copies the *full* token; a per-row copy
22
+ * of the masked preview would be useless.
23
+ */
24
+ import { computed, ref } from 'vue';
25
+ import { CopyOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
26
+ import {
27
+ Button,
28
+ Empty,
29
+ message,
30
+ Modal,
31
+ Popconfirm,
32
+ Spin,
33
+ Table,
34
+ Tooltip,
35
+ } from 'ant-design-vue';
36
+
37
+ import type { StudioApiKey } from '../api/types';
38
+
39
+ interface Props {
40
+ /** v-model:open. */
41
+ open: boolean;
42
+ /** Rows fetched by the host. */
43
+ keys: StudioApiKey[];
44
+ /** Loading state for the list — shows a Spin over the table. */
45
+ loading?: boolean;
46
+ /** Creating state — disables the "创建密钥" button. */
47
+ creating?: boolean;
48
+ }
49
+
50
+ const props = withDefaults(defineProps<Props>(), {
51
+ loading: false,
52
+ creating: false,
53
+ });
54
+
55
+ const emit = defineEmits<{
56
+ (e: 'update:open', v: boolean): void;
57
+ (e: 'create'): void;
58
+ (e: 'delete', row: StudioApiKey): void;
59
+ (e: 'refresh'): void;
60
+ }>();
61
+
62
+ const columns = [
63
+ { title: '密钥', dataIndex: 'token', key: 'token', width: '38%' },
64
+ { title: '创建时间', dataIndex: 'createdAt', key: 'createdAt', width: '22%' },
65
+ { title: '最后使用', dataIndex: 'lastUsedAt', key: 'lastUsedAt', width: '22%' },
66
+ { title: '', key: 'actions', width: '18%', align: 'right' as const },
67
+ ];
68
+
69
+ /**
70
+ * Show the first 3 chars + "..." + last 20 so a user can still identify a
71
+ * token at a glance without exposing enough entropy to be useful in a
72
+ * screenshot. Matches Dify's rendering.
73
+ */
74
+ function mask(token: string | undefined): string {
75
+ if (!token) return '';
76
+ if (token.length <= 24) return token;
77
+ return `${token.slice(0, 3)}...${token.slice(-20)}`;
78
+ }
79
+
80
+ async function copy(text: string) {
81
+ if (!text) return;
82
+ try {
83
+ if (navigator?.clipboard) {
84
+ await navigator.clipboard.writeText(text);
85
+ } else {
86
+ const ta = document.createElement('textarea');
87
+ ta.value = text;
88
+ document.body.appendChild(ta);
89
+ ta.select();
90
+ document.execCommand('copy');
91
+ document.body.removeChild(ta);
92
+ }
93
+ message.success('已复制');
94
+ } catch {
95
+ message.error('复制失败');
96
+ }
97
+ }
98
+
99
+ function onCreate() {
100
+ emit('create');
101
+ }
102
+
103
+ function onDelete(row: StudioApiKey) {
104
+ emit('delete', row);
105
+ }
106
+
107
+ function close() {
108
+ emit('update:open', false);
109
+ }
110
+
111
+ const dataSource = computed(() => props.keys ?? []);
112
+ </script>
113
+
114
+ <template>
115
+ <Modal
116
+ :open="open"
117
+ title="API 密钥"
118
+ :footer="null"
119
+ :width="720"
120
+ :destroy-on-close="true"
121
+ :mask-closable="true"
122
+ @update:open="(v: boolean) => emit('update:open', v)"
123
+ @cancel="close"
124
+ >
125
+ <div class="akm-tip">
126
+ <ExclamationCircleOutlined class="akm-tip-icon" />
127
+ <span>
128
+ 如果不想你的 API 被滥用,请保护好你的 API Key
129
+ <span class="akm-tip-smile">:)</span>
130
+ 最佳实践是避免在前端代码中明文引用。
131
+ </span>
132
+ </div>
133
+
134
+ <Spin :spinning="loading">
135
+ <Table
136
+ :columns="columns"
137
+ :data-source="dataSource"
138
+ :pagination="false"
139
+ row-key="id"
140
+ size="middle"
141
+ class="akm-table"
142
+ >
143
+ <template #emptyText>
144
+ <Empty description="尚未生成 API 密钥" :image="Empty.PRESENTED_IMAGE_SIMPLE" />
145
+ </template>
146
+
147
+ <template #bodyCell="{ column, record }">
148
+ <template v-if="column.key === 'token'">
149
+ <div class="akm-token-cell">
150
+ <Tooltip :title="record.token" placement="topLeft">
151
+ <span class="akm-token-mono">{{ mask(record.token) }}</span>
152
+ </Tooltip>
153
+ <button
154
+ type="button"
155
+ class="akm-icon-btn"
156
+ title="复制"
157
+ @click="copy(record.token)"
158
+ >
159
+ <CopyOutlined />
160
+ </button>
161
+ </div>
162
+ </template>
163
+ <template v-else-if="column.key === 'createdAt'">
164
+ <span class="akm-dim">{{ record.createdAt || '—' }}</span>
165
+ </template>
166
+ <template v-else-if="column.key === 'lastUsedAt'">
167
+ <span class="akm-dim">{{ record.lastUsedAt || '从未使用' }}</span>
168
+ </template>
169
+ <template v-else-if="column.key === 'actions'">
170
+ <Popconfirm
171
+ title="删除后使用该密钥的调用会立刻失效,确定继续?"
172
+ ok-text="删除"
173
+ cancel-text="取消"
174
+ placement="topRight"
175
+ @confirm="onDelete(record)"
176
+ >
177
+ <Button type="link" danger size="small">
178
+ <DeleteOutlined />
179
+ <span>删除</span>
180
+ </Button>
181
+ </Popconfirm>
182
+ </template>
183
+ </template>
184
+ </Table>
185
+ </Spin>
186
+
187
+ <div class="akm-footer">
188
+ <Button type="primary" :loading="creating" @click="onCreate">
189
+ 创建密钥
190
+ </Button>
191
+ </div>
192
+ </Modal>
193
+ </template>
194
+
195
+ <style scoped>
196
+ .akm-tip {
197
+ display: flex;
198
+ align-items: flex-start;
199
+ gap: 8px;
200
+ padding: 10px 12px;
201
+ margin-bottom: 12px;
202
+ border: 1px solid #fde68a;
203
+ background: #fffbeb;
204
+ border-radius: 6px;
205
+ color: #92400e;
206
+ font-size: 12px;
207
+ line-height: 1.6;
208
+ }
209
+ .akm-tip-icon {
210
+ margin-top: 2px;
211
+ color: #d97706;
212
+ }
213
+ .akm-tip-smile {
214
+ color: #d97706;
215
+ font-weight: 600;
216
+ }
217
+ .akm-table {
218
+ --table-header-bg: #f8fafc;
219
+ }
220
+ .akm-token-cell {
221
+ display: inline-flex;
222
+ align-items: center;
223
+ gap: 6px;
224
+ }
225
+ .akm-token-mono {
226
+ font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
227
+ font-size: 12px;
228
+ color: #0f172a;
229
+ }
230
+ .akm-icon-btn {
231
+ border: none;
232
+ background: transparent;
233
+ padding: 2px 4px;
234
+ cursor: pointer;
235
+ color: #64748b;
236
+ border-radius: 4px;
237
+ }
238
+ .akm-icon-btn:hover {
239
+ background: #f1f5f9;
240
+ color: #4338ca;
241
+ }
242
+ .akm-dim {
243
+ color: #64748b;
244
+ font-size: 12px;
245
+ }
246
+ .akm-footer {
247
+ margin-top: 16px;
248
+ display: flex;
249
+ justify-content: flex-end;
250
+ }
251
+ </style>