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.
- package/package.json +30 -0
- package/pnpm-workspace.yaml +3 -0
- package/src/agent-flow/adapter/backend.ts +99 -0
- package/src/agent-flow/components/ChatIframePanel.vue +773 -0
- package/src/agent-flow/components/DatasetItemCard.vue +313 -0
- package/src/agent-flow/components/MemoryWindow.vue +104 -0
- package/src/agent-flow/components/PromptEditor.vue +804 -0
- package/src/agent-flow/components/PromptEditorTagPanel.vue +460 -0
- package/src/agent-flow/components/SvgIcon.vue +32 -0
- package/src/agent-flow/components/ToolItemCard.vue +169 -0
- package/src/agent-flow/components/VariableCard.vue +161 -0
- package/src/agent-flow/components/VariableSelector.vue +162 -0
- package/src/agent-flow/components/chat-iframe-types.ts +35 -0
- package/src/agent-flow/components/stubs/DatasetChooser.vue +70 -0
- package/src/agent-flow/components/stubs/Embedding.vue +22 -0
- package/src/agent-flow/components/stubs/ModelSelect.vue +24 -0
- package/src/agent-flow/components/stubs/RestfulSelectCard.vue +24 -0
- package/src/agent-flow/components/stubs/ToolChooser.vue +96 -0
- package/src/agent-flow/components/stubs/TriggersItemCard.vue +126 -0
- package/src/agent-flow/components/stubs/VariableModal.vue +115 -0
- package/src/agent-flow/index.ts +73 -0
- package/src/agent-flow/stores/workflow.ts +72 -0
- package/src/agent-flow/utils/langUtils.ts +173 -0
- package/src/agent-flow/workflow/Ability.vue +65 -0
- package/src/agent-flow/workflow/AuthorizationItem.vue +101 -0
- package/src/agent-flow/workflow/ConversationVar.vue +42 -0
- package/src/agent-flow/workflow/CustomEdge.vue +94 -0
- package/src/agent-flow/workflow/EnvironmentVar.vue +40 -0
- package/src/agent-flow/workflow/FlowDesigner.vue +2802 -0
- package/src/agent-flow/workflow/Icon.vue +179 -0
- package/src/agent-flow/workflow/NodeConfig.vue +509 -0
- package/src/agent-flow/workflow/NodeConfigCard.vue +460 -0
- package/src/agent-flow/workflow/NodeHandle.vue +147 -0
- package/src/agent-flow/workflow/NodeHeaderToolbar.vue +77 -0
- package/src/agent-flow/workflow/NodeHoverToolbar.vue +176 -0
- package/src/agent-flow/workflow/OutputItemCard.vue +668 -0
- package/src/agent-flow/workflow/ParamTableItem.vue +200 -0
- package/src/agent-flow/workflow/StructTable.vue +202 -0
- package/src/agent-flow/workflow/VarInsertField.vue +517 -0
- package/src/agent-flow/workflow/VarSelectField.vue +223 -0
- package/src/agent-flow/workflow/VariableSelectorItem.vue +48 -0
- package/src/agent-flow/workflow/WfField.vue +206 -0
- package/src/agent-flow/workflow/_config-base.css +470 -0
- package/src/agent-flow/workflow/composables/useNode.js +55 -0
- package/src/agent-flow/workflow/index.vue +53 -0
- package/src/agent-flow/workflow/nodeCard/AgentNodeCard.vue +180 -0
- package/src/agent-flow/workflow/nodeCard/AnswerNodeCard.vue +65 -0
- package/src/agent-flow/workflow/nodeCard/ClassifierCard.vue +152 -0
- package/src/agent-flow/workflow/nodeCard/CodeNodeCard.vue +139 -0
- package/src/agent-flow/workflow/nodeCard/ConditionNodeCard.vue +323 -0
- package/src/agent-flow/workflow/nodeCard/DocumentExtractorCard.vue +83 -0
- package/src/agent-flow/workflow/nodeCard/EndNodeCard.vue +123 -0
- package/src/agent-flow/workflow/nodeCard/HttpNodeCard.vue +451 -0
- package/src/agent-flow/workflow/nodeCard/HumanInputCard.vue +152 -0
- package/src/agent-flow/workflow/nodeCard/IterationCard.vue +66 -0
- package/src/agent-flow/workflow/nodeCard/KnowledgeRetrievalCard.vue +48 -0
- package/src/agent-flow/workflow/nodeCard/LLMNodeCard.vue +206 -0
- package/src/agent-flow/workflow/nodeCard/ListOperatorCard.vue +188 -0
- package/src/agent-flow/workflow/nodeCard/ParameterExtractorCard.vue +352 -0
- package/src/agent-flow/workflow/nodeCard/ServiceApiNodeCard.vue +188 -0
- package/src/agent-flow/workflow/nodeCard/StartNodeCard.vue +216 -0
- package/src/agent-flow/workflow/nodeCard/VariableAssignerCard.vue +125 -0
- package/src/agent-flow/workflow/nodeCard/VariableNodeCard.vue +121 -0
- package/src/agent-flow/workflow/nodes/AgentNode.vue +122 -0
- package/src/agent-flow/workflow/nodes/AnswerNode.vue +99 -0
- package/src/agent-flow/workflow/nodes/ClassifierNode.vue +199 -0
- package/src/agent-flow/workflow/nodes/CodeNode.vue +152 -0
- package/src/agent-flow/workflow/nodes/ConditionNode.vue +232 -0
- package/src/agent-flow/workflow/nodes/DocumentExtractorNode.vue +96 -0
- package/src/agent-flow/workflow/nodes/EndNode.vue +119 -0
- package/src/agent-flow/workflow/nodes/FileUploadNode.vue +97 -0
- package/src/agent-flow/workflow/nodes/HttpNode.vue +204 -0
- package/src/agent-flow/workflow/nodes/HumanInputNode.vue +110 -0
- package/src/agent-flow/workflow/nodes/IterationNode.vue +98 -0
- package/src/agent-flow/workflow/nodes/KnowledgeRetrievalNode.vue +253 -0
- package/src/agent-flow/workflow/nodes/LLMNode.vue +134 -0
- package/src/agent-flow/workflow/nodes/ListOperatorNode.vue +111 -0
- package/src/agent-flow/workflow/nodes/LoopNode.vue +94 -0
- package/src/agent-flow/workflow/nodes/ParameterExtractorNode.vue +147 -0
- package/src/agent-flow/workflow/nodes/ServiceApiNode.vue +161 -0
- package/src/agent-flow/workflow/nodes/StartNode.vue +199 -0
- package/src/agent-flow/workflow/nodes/TemplateNode.vue +103 -0
- package/src/agent-flow/workflow/nodes/UserInputNode.vue +92 -0
- package/src/agent-flow/workflow/nodes/VariableAssignerNode.vue +145 -0
- package/src/agent-flow/workflow/nodes/VariableNode.vue +130 -0
- package/src/agent-flow/workflow/nodes/_node-base.css +338 -0
- package/src/agent-flow/workflow/utils/node_card_form.ts +335 -0
- package/src/agent-flow/workflow/utils/node_config.ts +63 -0
- package/src/agent-flow/workflow/utils/workflow_utils.ts +151 -0
- package/src/agent-studio/adapters/springAgentStart.ts +390 -0
- package/src/agent-studio/api/index.ts +1 -0
- package/src/agent-studio/api/types.ts +173 -0
- package/src/agent-studio/components/AgentApiDocs.vue +500 -0
- package/src/agent-studio/components/AgentAppsPage.vue +1601 -0
- package/src/agent-studio/components/AgentCardGrid.vue +259 -0
- package/src/agent-studio/components/AgentChatPage.vue +553 -0
- package/src/agent-studio/components/AgentDebugPanel.vue +350 -0
- package/src/agent-studio/components/AgentLogsPanel.vue +391 -0
- package/src/agent-studio/components/AgentMonitorPanel.vue +204 -0
- package/src/agent-studio/components/AgentOrchestrate.vue +505 -0
- package/src/agent-studio/components/AgentPromptEditor.vue +237 -0
- package/src/agent-studio/components/AgentStudioShell.vue +227 -0
- package/src/agent-studio/components/AgentToolsPanel.vue +394 -0
- package/src/agent-studio/components/AgentVariablesPanel.vue +205 -0
- package/src/agent-studio/components/ApiKeyManager.vue +251 -0
- package/src/agent-studio/components/AppDesignDrawer.vue +3391 -0
- package/src/agent-studio/components/CreateAppModal.vue +737 -0
- package/src/agent-studio/components/SparkChart.vue +200 -0
- package/src/agent-studio/components/VariableEditorModal.vue +499 -0
- package/src/agent-studio/composables/useAgentStudio.ts +347 -0
- package/src/agent-studio/index.ts +60 -0
- package/src/agent-studio/panels/DrawerFlowDesigner.vue +203 -0
- package/src/agent-studio/panels/LogAnnotationPanel.vue +490 -0
- package/src/agent-studio/panels/MonitorPanel.vue +535 -0
- package/src/agent-studio/types.ts +242 -0
- package/src/index.ts +155 -0
- package/src/knowledge-hub/adapters/springAgentStart.ts +472 -0
- package/src/knowledge-hub/components/AddDocumentsWizard.vue +1452 -0
- package/src/knowledge-hub/components/CreateDatasetWizard.vue +1723 -0
- package/src/knowledge-hub/components/DatasetCardGrid.vue +467 -0
- package/src/knowledge-hub/components/DatasetDetailDrawer.vue +888 -0
- package/src/knowledge-hub/components/DatasetPicker.vue +65 -0
- package/src/knowledge-hub/components/DatasetPickerModal.vue +526 -0
- package/src/knowledge-hub/components/DatasetSettingsPanel.vue +908 -0
- package/src/knowledge-hub/components/DatasetSidebar.vue +781 -0
- package/src/knowledge-hub/components/DocumentChunksView.vue +802 -0
- package/src/knowledge-hub/components/DocumentTable.vue +552 -0
- package/src/knowledge-hub/components/HitTestingPanel.vue +74 -0
- package/src/knowledge-hub/components/KnowledgeApp.vue +66 -0
- package/src/knowledge-hub/components/KnowledgeHubApp.vue +504 -0
- package/src/knowledge-hub/components/RecallTestingPanelV2.vue +515 -0
- package/src/knowledge-hub/components/RetrievalConfigPopover.vue +270 -0
- package/src/knowledge-hub/components/RetrievalMethodPicker.vue +547 -0
- package/src/knowledge-hub/components/RetrievedList.vue +24 -0
- package/src/knowledge-hub/components/internal/KhDialog.vue +195 -0
- package/src/knowledge-hub/composables/useKnowledge.ts +89 -0
- package/src/knowledge-hub/i18n/index.ts +2 -0
- package/src/knowledge-hub/i18n/messages.ts +422 -0
- package/src/knowledge-hub/i18n/useKhI18n.ts +107 -0
- package/src/knowledge-hub/index.ts +46 -0
- package/src/knowledge-hub/styles/index.css +4 -0
- package/src/knowledge-hub/styles/tokens.css +138 -0
- package/src/knowledge-hub/types/api.ts +213 -0
- package/src/knowledge-hub/types/dataset.ts +88 -0
- package/src/knowledge-hub/types/document.ts +45 -0
- package/src/knowledge-hub/types/index.ts +9 -0
- package/src/knowledge-hub/types/retrieval.ts +46 -0
- package/src/provider-hub/components/CredentialForm.vue +103 -0
- package/src/provider-hub/components/DefaultModelsPanel.vue +270 -0
- package/src/provider-hub/components/GroupedModelSelect.vue +445 -0
- package/src/provider-hub/components/ModelCardGrid.vue +332 -0
- package/src/provider-hub/components/ModelParameterDrawer.vue +739 -0
- package/src/provider-hub/components/ModelPickerPopover.vue +1282 -0
- package/src/provider-hub/components/ProviderApp.vue +159 -0
- package/src/provider-hub/components/ProviderCredentialModal.vue +321 -0
- package/src/provider-hub/components/ProviderGallery.vue +131 -0
- package/src/provider-hub/components/ProviderHubShell.vue +1992 -0
- package/src/provider-hub/components/ProviderIcon.vue +130 -0
- package/src/provider-hub/composables/useProviderHub.ts +358 -0
- package/src/provider-hub/index.ts +43 -0
- package/src/provider-hub/svg/MiniMax.svg +1 -0
- package/src/provider-hub/svg/Volcengine.svg +1 -0
- package/src/provider-hub/svg/Zhipu.svg +1 -0
- package/src/provider-hub/svg/deepseek.svg +1 -0
- package/src/provider-hub/svg/moonshot.svg +1 -0
- package/src/provider-hub/svg/openai.svg +1 -0
- package/src/provider-hub/svg/qwen.svg +1 -0
- package/src/provider-hub/svg/siliconflow.svg +1 -0
- package/src/provider-hub/types.ts +256 -0
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-agent-start",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unified spring-agent-start UI kit — provider hub, knowledge hub, agent studio, and workflow designer combined behind a single entry point. Replaces the previous four packages (@agent-start/provider-hub, @agent-start/knowledge-hub, @agent-start/agent-studio, @agent-start/agent-flow).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"module": "src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts",
|
|
10
|
+
"./src/*": "./src/*"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"**/*.vue"
|
|
15
|
+
],
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"vue": "^3.4.0",
|
|
18
|
+
"pinia": "^2.1.0 || ^3.0.0",
|
|
19
|
+
"ant-design-vue": "^4.2.6",
|
|
20
|
+
"@ant-design/icons-vue": "^7.0.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@vue-flow/background": "^1.3.0",
|
|
24
|
+
"@vue-flow/controls": "^1.1.2",
|
|
25
|
+
"@vue-flow/core": "^1.41.0",
|
|
26
|
+
"@vue-flow/minimap": "^1.5.0",
|
|
27
|
+
"@vue-flow/node-resizer": "^1.4.0",
|
|
28
|
+
"vue-draggable-next": "^2.2.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { inject, type App, type InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* BackendAdapter — 由宿主应用注入的后端 API 抽象。
|
|
5
|
+
*
|
|
6
|
+
* 组件内部不直接调用任何 HTTP 客户端,而是通过 useBackend() 读取当前实例,
|
|
7
|
+
* 从而实现前后端解耦。宿主项目只要实现下列方法并 provide 即可复用整套 UI。
|
|
8
|
+
*/
|
|
9
|
+
export interface BackendAdapter {
|
|
10
|
+
/** 加载租户当前默认模型(modelType: LLM / EMBEDDING / ...) */
|
|
11
|
+
getCurrentModel: (modelType: string) => Promise<{ data: any }>;
|
|
12
|
+
|
|
13
|
+
/** 分页/条件查询工作流列表 */
|
|
14
|
+
getWorkflow: (query: Record<string, any>) => Promise<{ data: any[] }>;
|
|
15
|
+
|
|
16
|
+
/** 发布工作流 */
|
|
17
|
+
publishWorkflow: (payload: Record<string, any>) => Promise<{ data: any }>;
|
|
18
|
+
|
|
19
|
+
/** 可选:保存工作流草稿(未 provide 时按钮走 no-op) */
|
|
20
|
+
saveWorkflow?: (payload: Record<string, any>) => Promise<{ data: any }>;
|
|
21
|
+
|
|
22
|
+
/** 可选:试运行工作流(未 provide 时按钮走 no-op) */
|
|
23
|
+
runWorkflow?: (payload: Record<string, any>) => Promise<{ data: any }>;
|
|
24
|
+
|
|
25
|
+
/** 可选:模型下拉数据源(Pinia store 风格,返回带 fetch 方法的对象) */
|
|
26
|
+
useModelState?: () => any;
|
|
27
|
+
|
|
28
|
+
/** 可选:额外扩展点,任意自定义 API */
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const BackendAdapterKey: InjectionKey<BackendAdapter> = Symbol(
|
|
33
|
+
'agent-flow.BackendAdapter',
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
/** 一个内置的 no-op 实现,未 provide 时用它兜底避免直接抛错。 */
|
|
37
|
+
export const defaultBackend: BackendAdapter = {
|
|
38
|
+
getCurrentModel: async () => ({ data: {} }),
|
|
39
|
+
getWorkflow: async () => ({ data: [] }),
|
|
40
|
+
publishWorkflow: async () => ({ data: {} }),
|
|
41
|
+
useModelState: () => ({
|
|
42
|
+
modelList: [],
|
|
43
|
+
/** 兼容 fetchModelList / getModelList 两种命名,宿主 provide 时也会保留同名 */
|
|
44
|
+
fetchModelList: async () => [],
|
|
45
|
+
getModelList: async () => [],
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
let installed: BackendAdapter | null = null;
|
|
50
|
+
|
|
51
|
+
/** 在 Vue 应用启动时注入实现,见 index.ts createAgentFlow() */
|
|
52
|
+
export function provideBackend(app: App, adapter: BackendAdapter) {
|
|
53
|
+
installed = adapter;
|
|
54
|
+
app.provide(BackendAdapterKey, adapter);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 组件内部使用;优先 inject,回退全局实例,最后回退到 no-op。
|
|
59
|
+
*
|
|
60
|
+
* 注意:Vue 的 `inject()` 在 setup / 生命周期钩子之外 (例如点击回调、
|
|
61
|
+
* setTimeout 里的箭头函数) 会**忽略默认值直接返回 undefined**。所以先看
|
|
62
|
+
* 全局 `installed`(`provideBackend()` 会写这个模块级变量),命中就直接
|
|
63
|
+
* 用;这样即使在点击处理器里调用 saveWorkflow / publishWorkflow 也不会因
|
|
64
|
+
* 拿到 undefined 而崩。
|
|
65
|
+
*/
|
|
66
|
+
function useBackend(): BackendAdapter {
|
|
67
|
+
if (installed) return installed;
|
|
68
|
+
return inject(BackendAdapterKey, defaultBackend) ?? defaultBackend;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 兼容层:workflow 内部代码历史上直接 `import { getCurrentModel } from '#/api'`。
|
|
73
|
+
* 我们把同名的函数变成"读取当前 adapter 后转发"的薄壳,改动最小化。
|
|
74
|
+
*/
|
|
75
|
+
export const getCurrentModel: BackendAdapter['getCurrentModel'] = (t) =>
|
|
76
|
+
useBackend().getCurrentModel(t);
|
|
77
|
+
|
|
78
|
+
export const getWorkflow: BackendAdapter['getWorkflow'] = (q) =>
|
|
79
|
+
useBackend().getWorkflow(q);
|
|
80
|
+
|
|
81
|
+
export const publishWorkflow: BackendAdapter['publishWorkflow'] = (p) =>
|
|
82
|
+
useBackend().publishWorkflow(p);
|
|
83
|
+
|
|
84
|
+
export const saveWorkflow: BackendAdapter['saveWorkflow'] = async (p) => {
|
|
85
|
+
const b = useBackend();
|
|
86
|
+
if (!b.saveWorkflow) return { data: {} };
|
|
87
|
+
return b.saveWorkflow(p);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const runWorkflow: BackendAdapter['runWorkflow'] = async (p) => {
|
|
91
|
+
const b = useBackend();
|
|
92
|
+
if (!b.runWorkflow) return { data: {} };
|
|
93
|
+
return b.runWorkflow(p);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const useModelState = () => {
|
|
97
|
+
const b = useBackend();
|
|
98
|
+
return b.useModelState ? b.useModelState() : defaultBackend.useModelState!();
|
|
99
|
+
};
|