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,101 @@
1
+ <script setup lang="ts">
2
+ import VarSelectField from './VarSelectField.vue';
3
+
4
+ defineProps({
5
+ name: {
6
+ type: String,
7
+ default: '',
8
+ },
9
+ /** 当前节点 id —— API Key Value 支持插入上游变量时需要。 */
10
+ nodeId: {
11
+ type: String,
12
+ default: '',
13
+ },
14
+ });
15
+
16
+ const formState: any = defineModel();
17
+ </script>
18
+
19
+ <template>
20
+ <div class="wf-auth">
21
+ <div class="wf-auth-row">
22
+ <div class="wf-auth-col">
23
+ <div class="wf-auth-label">认证类型</div>
24
+ <a-radio-group
25
+ v-model:value="formState.auth_type"
26
+ button-style="solid"
27
+ size="small"
28
+ >
29
+ <a-radio-button value="none">无</a-radio-button>
30
+ <a-radio-button value="api_key">API Key</a-radio-button>
31
+ </a-radio-group>
32
+ </div>
33
+ <div v-if="formState.auth_type === 'api_key'" class="wf-auth-col">
34
+ <div class="wf-auth-label">鉴权前缀</div>
35
+ <a-radio-group
36
+ v-model:value="formState.api_key_header_prefix"
37
+ button-style="solid"
38
+ size="small"
39
+ >
40
+ <a-radio-button value="basic">Basic</a-radio-button>
41
+ <a-radio-button value="bearer">Bearer</a-radio-button>
42
+ <a-radio-button value="custom">Custom</a-radio-button>
43
+ </a-radio-group>
44
+ </div>
45
+ </div>
46
+
47
+ <div v-if="formState.auth_type === 'api_key'" class="wf-auth-grid">
48
+ <div class="wf-auth-col">
49
+ <div class="wf-auth-label">Header Key</div>
50
+ <a-input
51
+ v-model:value="formState.api_key_header"
52
+ placeholder="Authorization"
53
+ size="small"
54
+ />
55
+ </div>
56
+ <div class="wf-auth-col">
57
+ <div class="wf-auth-label">API Key Value</div>
58
+ <VarSelectField
59
+ v-model="formState.api_key_value"
60
+ :node-id="nodeId"
61
+ placeholder="选择变量"
62
+ size="small"
63
+ />
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </template>
68
+
69
+ <style scoped>
70
+ .wf-auth {
71
+ display: flex;
72
+ flex-direction: column;
73
+ gap: 10px;
74
+ }
75
+
76
+ .wf-auth-row {
77
+ display: flex;
78
+ gap: 12px;
79
+ flex-wrap: wrap;
80
+ }
81
+
82
+ .wf-auth-col {
83
+ display: flex;
84
+ flex-direction: column;
85
+ gap: 4px;
86
+ min-width: 0;
87
+ flex: 1;
88
+ }
89
+
90
+ .wf-auth-grid {
91
+ display: grid;
92
+ grid-template-columns: 1fr 1fr;
93
+ gap: 10px;
94
+ }
95
+
96
+ .wf-auth-label {
97
+ font-size: 11px;
98
+ font-weight: 500;
99
+ color: #6b7280;
100
+ }
101
+ </style>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import { h } from 'vue';
3
+
4
+ import {
5
+ DeleteOutlined,
6
+ EditOutlined,
7
+ PlusOutlined,
8
+ } from '@ant-design/icons-vue';
9
+
10
+ const userItems = [{ name: 'sys.query', type: 'String' }];
11
+ </script>
12
+
13
+ <template>
14
+ <div>
15
+ <div>
16
+ <div>
17
+ 会话变量用于存储 LLM
18
+ 需要的上下文信息,如用户偏好、对话历史等。它是可读写的。查看文档了解更多。
19
+ </div>
20
+ <div><a-button :icon="h(PlusOutlined)" size="small" /></div>
21
+ </div>
22
+ <div>
23
+ <a-button :icon="h(PlusOutlined)" size="small">添加变量</a-button>
24
+ </div>
25
+ <div>
26
+ <div v-for="(item, index) in userItems" :key="index">
27
+ <div>
28
+ <span>{x}</span>
29
+ <span>{{ item.name }}</span>
30
+ </div>
31
+ <div>
32
+ <span>必填</span>
33
+ <span>String</span>
34
+ <span><a-button :icon="h(EditOutlined)" size="small" /></span>
35
+ <span><a-button :icon="h(DeleteOutlined)" size="small" /></span>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <style scoped></style>
@@ -0,0 +1,94 @@
1
+ <script setup>
2
+ import { computed, defineEmits, defineProps, ref } from 'vue';
3
+
4
+ import { getBezierPath } from '@vue-flow/core';
5
+
6
+ const props = defineProps({
7
+ sourceX: { type: Number, required: true },
8
+ sourceY: { type: Number, required: true },
9
+ targetX: { type: Number, required: true },
10
+ targetY: { type: Number, required: true },
11
+ sourcePosition: { type: String, default: 'right' },
12
+ targetPosition: { type: String, default: 'left' },
13
+ style: { type: Object, default: () => ({}) },
14
+ markerEnd: { type: String, default: '' },
15
+ data: { type: Object, default: () => ({}) },
16
+ id: { type: String, required: true },
17
+ source: { type: String, required: true },
18
+ target: { type: String, required: true },
19
+ selected: { type: Boolean, default: false },
20
+ });
21
+
22
+ const emit = defineEmits(['edge-click']);
23
+ const hovered = ref(false);
24
+
25
+ const path = computed(() => {
26
+ const result = getBezierPath({
27
+ sourceX: props.sourceX,
28
+ sourceY: props.sourceY,
29
+ sourcePosition: props.sourcePosition,
30
+ targetX: props.targetX,
31
+ targetY: props.targetY,
32
+ targetPosition: props.targetPosition,
33
+ });
34
+ return Array.isArray(result) ? result[0] : result;
35
+ });
36
+
37
+ const pathStyle = computed(() => {
38
+ const baseStroke = props.style.stroke || '#94a3b8';
39
+ const stroke = props.selected ? '#3b82f6' : hovered.value ? '#6366f1' : baseStroke;
40
+ const strokeWidth =
41
+ (props.selected ? 3 : hovered.value ? 2.5 : props.style.strokeWidth || 2);
42
+ return {
43
+ stroke,
44
+ strokeWidth,
45
+ fill: 'none',
46
+ transition: 'stroke 0.15s, stroke-width 0.15s',
47
+ };
48
+ });
49
+
50
+ function handleClick() {
51
+ emit('edge-click', { edge: props });
52
+ }
53
+ </script>
54
+
55
+ <template>
56
+ <g
57
+ class="wf-edge"
58
+ :class="{ 'is-selected': selected, 'is-hovered': hovered }"
59
+ @mouseenter="hovered = true"
60
+ @mouseleave="hovered = false"
61
+ >
62
+ <path
63
+ :d="path"
64
+ :style="pathStyle"
65
+ :marker-end="markerEnd"
66
+ class="vue-flow__edge-path"
67
+ @click="handleClick"
68
+ />
69
+ <!-- 加宽的透明命中区,方便选中/悬停。
70
+ * pointer-events: stroke 要求 stroke 是"已 paint"的;某些浏览器把 stroke="transparent"
71
+ * 当成未 paint 直接丢弃点击。用 pointer-events: all + 24px 宽的几何区域,既
72
+ * 保证宽松的命中判定,也保证透明 stroke 也能吃到事件。 -->
73
+ <path
74
+ :d="path"
75
+ stroke="transparent"
76
+ stroke-width="24"
77
+ fill="none"
78
+ class="wf-edge-hit-area"
79
+ @click="handleClick"
80
+ />
81
+ </g>
82
+ </template>
83
+
84
+ <style scoped>
85
+ .wf-edge {
86
+ cursor: pointer;
87
+ pointer-events: stroke;
88
+ }
89
+
90
+ .wf-edge-hit-area {
91
+ pointer-events: all;
92
+ cursor: pointer;
93
+ }
94
+ </style>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ import { h } from 'vue';
3
+
4
+ import {
5
+ DeleteOutlined,
6
+ EditOutlined,
7
+ PlusOutlined,
8
+ } from '@ant-design/icons-vue';
9
+
10
+ const userItems = [{ name: 'sys.query', type: 'String' }];
11
+ </script>
12
+
13
+ <template>
14
+ <div>
15
+ <div>
16
+ <div>
17
+ 会话变量用于存储 LLM
18
+ 需要的上下文信息,如用户偏好、对话历史等。它是可读写的。查看文档了解更多。
19
+ </div>
20
+ <div><a-button :icon="h(PlusOutlined)" size="small" /></div>
21
+ </div>
22
+ <div><a-button :icon="h(PlusOutlined)" size="small" />添加变量</div>
23
+ <div>
24
+ <div v-for="(item, index) in userItems" :key="index">
25
+ <div>
26
+ <span>{x}</span>
27
+ <span>{{ item.name }}</span>
28
+ </div>
29
+ <div>
30
+ <span>必填</span>
31
+ <span>String</span>
32
+ <span><a-button :icon="h(EditOutlined)" size="small" /></span>
33
+ <span><a-button :icon="h(DeleteOutlined)" size="small" /></span>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <style scoped></style>