@blueking/ai-ui-sdk 0.5.2-beta.5 → 0.6.0-beta.1
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/README.md +65 -0
- package/dist/common/constants.ts.js +16 -15
- package/dist/common/util.d.ts +1 -1
- package/dist/common/util.ts.js +6 -3
- package/dist/components/render-agent/action/index.script.vue.js.js +43 -47
- package/dist/components/render-agent/agent-download.script.vue.js.js +3 -4
- package/dist/components/render-agent/agent-search.script.vue.js.js +19 -13
- package/dist/components/render-agent/agent-search.vue.d.ts +1 -0
- package/dist/components/render-agent/agent-share.script.vue.js.js +13 -8
- package/dist/components/render-agent/agent-type.script.vue.js.js +4 -3
- package/dist/components/render-agent/agent-type.vue.css +11 -11
- package/dist/components/render-agent/agent-type.vue.js +1 -1
- package/dist/components/render-auth/auth-dialog.script.vue.js.js +35 -35
- package/dist/components/render-auto-height-textarea/index.script.vue.js.js +7 -7
- package/dist/components/render-auto-height-textarea/index.vue.css +13 -13
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-auto-refresh/index.vue.css +11 -11
- package/dist/components/render-auto-refresh/index.vue.js +1 -1
- package/dist/components/render-card/agent/index.vue.d.ts +1 -1
- package/dist/components/render-card/agent/prefix-info-tool.script.vue.js.js +36 -35
- package/dist/components/render-card/agent/prefix-info-tool.vue.css +8 -8
- package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
- package/dist/components/render-card/agent/upgrade.script.vue.js.js +20 -15
- package/dist/components/render-card/agent/upgrade.vue.css +3 -3
- package/dist/components/render-card/agent/upgrade.vue.js +1 -1
- package/dist/components/render-card/agent-command/info-tool.script.vue.js.js +23 -17
- package/dist/components/render-card/agent-command/name-suffix.script.vue.js.js +4 -5
- package/dist/components/render-card/base/application-base-actions.script.vue.js.js +12 -14
- package/dist/components/render-card/base/approval-strategy-popover.script.vue.js.js +118 -44
- package/dist/components/render-card/base/approval-strategy-popover.vue.d.ts +2 -0
- package/dist/components/render-card/base/collection-icon.script.vue.js.js +3 -2
- package/dist/components/render-card/base/reference-icon.script.vue.js.js +7 -4
- package/dist/components/render-card/base/tag-suffix.script.vue.js.js +3 -4
- package/dist/components/render-card/base.script.vue.js +143 -162
- package/dist/components/render-card/base.vue.css +27 -24
- package/dist/components/render-card/base.vue.js +1 -1
- package/dist/components/render-card/knowledge/index.vue.d.ts +1 -1
- package/dist/components/render-card/knowledge/info-tool.script.vue.js.js +4 -2
- package/dist/components/render-card/knowledge/tooltip.script.vue.js.js +4 -1
- package/dist/components/render-card/knowledgebase/actions.script.vue.js.js +3 -4
- package/dist/components/render-card/knowledgebase/index.vue.d.ts +1 -1
- package/dist/components/render-card/knowledgebase/info-tool.script.vue.js.js +4 -3
- package/dist/components/render-card/knowledgebase/tooltip.script.vue.js.js +5 -2
- package/dist/components/render-card/llm/actions.script.vue.js.js +5 -8
- package/dist/components/render-card/llm/corner-badge.script.vue.js +27 -33
- package/dist/components/render-card/llm/corner-badge.vue.css +4 -4
- package/dist/components/render-card/llm/corner-badge.vue.js +1 -1
- package/dist/components/render-card/llm/icons.script.vue.js.js +6 -5
- package/dist/components/render-card/llm/icons.vue.css +3 -3
- package/dist/components/render-card/llm/icons.vue.js +1 -1
- package/dist/components/render-card/llm/index.vue.d.ts +1 -1
- package/dist/components/render-card/llm/info.script.vue.js.js +11 -4
- package/dist/components/render-card/llm/info.vue.css +3 -3
- package/dist/components/render-card/llm/info.vue.js +1 -1
- package/dist/components/render-card/llm/tag-prefix.script.vue.js.js +6 -5
- package/dist/components/render-card/llm/tag-prefix.vue.css +3 -3
- package/dist/components/render-card/llm/tag-prefix.vue.js +1 -1
- package/dist/components/render-card/mcp/actions.script.vue.js.js +20 -26
- package/dist/components/render-card/mcp/code-suffix.script.vue.js +43 -46
- package/dist/components/render-card/mcp/index.vue.d.ts +1 -1
- package/dist/components/render-card/mcp/name-suffix.script.vue.js +21 -24
- package/dist/components/render-card/mcp/name-suffix.vue.css +4 -4
- package/dist/components/render-card/mcp/name-suffix.vue.js +1 -1
- package/dist/components/render-card/mcp/prefix-info-tool.script.vue.js.js +4 -3
- package/dist/components/render-card/mcp/selected-tools-info.script.vue.js.js +17 -10
- package/dist/components/render-card/mcp/selected-tools-info.vue.d.ts +1 -1
- package/dist/components/render-card/mcp/tooltip.script.vue.js.js +2 -1
- package/dist/components/render-card/prompt/icons.script.vue.js.js +4 -3
- package/dist/components/render-card/prompt/icons.vue.css +2 -2
- package/dist/components/render-card/prompt/icons.vue.js +1 -1
- package/dist/components/render-card/prompt/index.vue.d.ts +1 -1
- package/dist/components/render-card/role/index.vue.d.ts +1 -1
- package/dist/components/render-card/skill/prefix-info-tool.script.vue.js +50 -88
- package/dist/components/render-card/skill/scanner.script.vue.js.js +5 -4
- package/dist/components/render-card/skill/scanner.vue.css +3 -3
- package/dist/components/render-card/skill/scanner.vue.js +1 -1
- package/dist/components/render-card/tool/actions.script.vue.js.js +18 -22
- package/dist/components/render-card/tool/index.vue.d.ts +1 -1
- package/dist/components/render-card/tool/prefix-info-tool.script.vue.js.js +6 -3
- package/dist/components/render-card/tool/tool-tag.script.vue.js.js +3 -4
- package/dist/components/render-checkbox/index.script.vue.js.js +35 -14
- package/dist/components/render-checkbox/index.vue.css +30 -57
- package/dist/components/render-checkbox/index.vue.d.ts +1 -0
- package/dist/components/render-checkbox/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.script.vue.js.js +15 -15
- package/dist/components/render-choose-tag/index.vue.css +12 -12
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- package/dist/components/render-collapse/index.script.vue.js.js +2 -4
- package/dist/components/render-collapse/index.vue.css +3 -3
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-collection/actions/index.script.vue.js.js +16 -16
- package/dist/components/render-collection/content/index.script.vue.js +39 -43
- package/dist/components/render-collection/content/index.vue.css +6 -6
- package/dist/components/render-collection/content/index.vue.js +1 -1
- package/dist/components/render-collection/search/index.script.vue.js.js +8 -7
- package/dist/components/render-config-provider/index.script.vue.js.js +41 -0
- package/dist/components/render-config-provider/index.vue.d.ts +14 -0
- package/dist/components/render-config-provider/index.vue.js +3 -0
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.script.vue.js +44 -47
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +7 -7
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.script.vue.js.js +34 -30
- package/dist/components/render-dataset/components/batch-review-dataset-data/index.script.vue.js.js +44 -44
- package/dist/components/render-dataset/components/dataset-data-level/index.script.vue.js +22 -24
- package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +45 -26
- package/dist/components/render-dataset/components/dataset-data-valid/index.script.vue.js.js +32 -32
- package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +27 -26
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +4 -4
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +11 -8
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js +140 -175
- package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.script.vue.js.js +7 -4
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +3 -3
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/dataset-footer.script.vue.js.js +11 -10
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +165 -214
- package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +16 -15
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.js +27 -21
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +4 -4
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/category.script.vue.js.js +12 -9
- package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +10 -7
- package/dist/components/render-dataset/components/plus-dataset-data/form/file.script.vue.js.js +38 -25
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.script.vue.js.js +17 -12
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.script.vue.js.js +6 -4
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +3 -4
- package/dist/components/render-dataset/components/review-dataset-data/index.script.vue.js.js +91 -65
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +11 -11
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +18 -15
- package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +1 -0
- package/dist/components/render-dataset/components/search-dataset-data/index.script.vue.js.js +26 -24
- package/dist/components/render-dataset/components/search-operation-record/index.script.vue.js.js +13 -11
- package/dist/components/render-dataset/components/source-type-icon/index.script.vue.js.js +3 -3
- package/dist/components/render-dataset-detail/components/header.script.vue.js.js +14 -8
- package/dist/components/render-dataset-detail/components/tab.script.vue.js.js +2 -1
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +10 -9
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +246 -392
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +63 -16
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +4 -4
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/header.script.vue.js.js +7 -5
- package/dist/components/render-dataset-list/components/main.script.vue.js.js +9 -7
- package/dist/components/render-dataset-list/components/main.vue.css +4 -4
- package/dist/components/render-dataset-list/components/main.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js +201 -299
- package/dist/components/render-dataset-list/index.script.vue.js.js +7 -2
- package/dist/components/render-dataset-list/index.vue.css +2 -2
- package/dist/components/render-dataset-list/index.vue.d.ts +1 -0
- package/dist/components/render-dataset-list/index.vue.js +1 -1
- package/dist/components/render-dialog/choose-footer.script.vue.js.js +32 -20
- package/dist/components/render-dialog/choose-resource.script.vue.js +275 -390
- package/dist/components/render-dialog/choose-resource.vue.css +3 -3
- package/dist/components/render-dialog/choose-resource.vue.js +1 -1
- package/dist/components/render-dialog/choose-result.script.vue.js +172 -220
- package/dist/components/render-dialog/choose-result.vue.css +26 -22
- package/dist/components/render-dialog/choose-result.vue.js +1 -1
- package/dist/components/render-dialog/choose-space.script.vue.js.js +13 -15
- package/dist/components/render-dialog/choose-space.vue.css +17 -16
- package/dist/components/render-dialog/choose-space.vue.js +1 -1
- package/dist/components/render-dialog/index.script.vue.js +113 -172
- package/dist/components/render-dialog/index.vue.css +7 -7
- package/dist/components/render-dialog/index.vue.js +1 -1
- package/dist/components/render-dropdown/index.vue.css +2 -2
- package/dist/components/render-dropdown/index.vue.d.ts +1 -1
- package/dist/components/render-exception/index.script.vue.js.js +84 -0
- package/dist/components/render-exception/index.vue.css +32 -0
- package/dist/components/render-exception/index.vue.d.ts +26 -0
- package/dist/components/render-exception/index.vue.js +5 -0
- package/dist/components/render-exception/svgs/403.d.ts +2 -0
- package/dist/components/render-exception/svgs/403.ts.js +2 -0
- package/dist/components/render-exception/svgs/404.d.ts +2 -0
- package/dist/components/render-exception/svgs/404.ts.js +2 -0
- package/dist/components/render-exception/svgs/500.d.ts +2 -0
- package/dist/components/render-exception/svgs/500.ts.js +2 -0
- package/dist/components/render-exception/svgs/building.d.ts +2 -0
- package/dist/components/render-exception/svgs/building.ts.js +2 -0
- package/dist/components/render-exception/svgs/empty.d.ts +2 -0
- package/dist/components/render-exception/svgs/empty.ts.js +2 -0
- package/dist/components/render-exception/svgs/index.d.ts +4 -0
- package/dist/components/render-exception/svgs/index.ts.js +9 -0
- package/dist/components/render-exception/svgs/login.d.ts +2 -0
- package/dist/components/render-exception/svgs/login.ts.js +2 -0
- package/dist/components/render-exception/svgs/search.d.ts +2 -0
- package/dist/components/render-exception/svgs/search.ts.js +2 -0
- package/dist/components/render-file-card/index.script.vue.js.js +8 -4
- package/dist/components/render-file-card/index.vue.css +17 -17
- package/dist/components/render-file-card/index.vue.d.ts +1 -1
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +12 -12
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-generate-tag/index.script.vue.js.js +11 -2
- package/dist/components/render-generate-tag/index.vue.css +14 -14
- package/dist/components/render-generate-tag/index.vue.js +1 -1
- package/dist/components/render-header/index.script.vue.js.js +13 -9
- package/dist/components/render-image/index.script.vue.js.js +1 -1
- package/dist/components/render-knowledge/icon/index.vue.css +2 -2
- package/dist/components/render-knowledge/icon/index.vue.js +1 -1
- package/dist/components/render-knowledge/search/index.script.vue.js.js +25 -21
- package/dist/components/render-knowledgebase/search/index.script.vue.js.js +10 -9
- package/dist/components/render-markdown/edit.postcss.css +28 -2
- package/dist/components/render-markdown/edit.ts.js +6 -5
- package/dist/components/render-markdown/mark-down-code-copy.ts.js +2 -1
- package/dist/components/render-markdown/prism-atom-one-dark.postcss.css +1 -1
- package/dist/components/render-markdown/view.postcss.css +4 -4
- package/dist/components/render-mcp/install/index.script.vue.js.js +19 -15
- package/dist/components/render-mcp/install/install-guide.script.vue.js.js +6 -3
- package/dist/components/render-mcp/search/index.script.vue.js.js +14 -9
- package/dist/components/render-mcp/search/index.vue.d.ts +1 -0
- package/dist/components/render-permission-tag/index.script.vue.js +81 -87
- package/dist/components/render-prompt/actions/index.script.vue.js.js +16 -16
- package/dist/components/render-prompt/content/index.vue.css +2 -2
- package/dist/components/render-prompt/content/index.vue.js +1 -1
- package/dist/components/render-prompt/search/index.script.vue.js.js +10 -9
- package/dist/components/render-reference/index.script.vue.js +218 -267
- package/dist/components/render-reference/index.vue.css +2 -2
- package/dist/components/render-reference/index.vue.js +1 -1
- package/dist/components/render-relate-agent/index.script.vue.js +360 -651
- package/dist/components/render-relate-agent/index.vue.d.ts +1 -1
- package/dist/components/render-resource-info/index.script.vue.js +52 -50
- package/dist/components/render-resource-version/index.script.vue.js.js +2 -1
- package/dist/components/render-resource-version/index.vue.css +6 -6
- package/dist/components/render-resource-version/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +6 -6
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/components/render-search-empty/index.script.vue.js.js +17 -10
- package/dist/components/render-search-empty/index.vue.d.ts +1 -1
- package/dist/components/render-search-select/index.script.vue.js.js +11 -5
- package/dist/components/render-search-select/index.vue.d.ts +3 -1
- package/dist/components/render-select-plus-extension/index.script.vue.js.js +2 -1
- package/dist/components/render-select-plus-extension/index.vue.css +4 -4
- package/dist/components/render-select-plus-extension/index.vue.js +1 -1
- package/dist/components/render-skill/actions/index.script.vue.js.js +26 -26
- package/dist/components/render-skill/icons/index.script.vue.js.js +5 -2
- package/dist/components/render-skill/install/index.script.vue.js.js +21 -12
- package/dist/components/render-skill/install/install-guide.script.vue.js.js +6 -3
- package/dist/components/render-skill/install/openclaw-windows-instances.script.vue.js.js +20 -13
- package/dist/components/render-skill/search/index.script.vue.js.js +11 -9
- package/dist/components/render-skill/variable-form/index.script.vue.js +58 -80
- package/dist/components/render-t-table/index.script.vue.js.js +443 -0
- package/dist/components/render-t-table/index.vue.css +161 -189
- package/dist/components/render-t-table/index.vue.d.ts +24 -43
- package/dist/components/render-t-table/index.vue.js +2 -2
- package/dist/components/render-tag-tree/index.script.vue.js.js +11 -8
- package/dist/components/render-tag-tree/index.vue.css +12 -13
- package/dist/components/render-tag-tree/index.vue.js +1 -1
- package/dist/components/render-tags/index.script.vue.js +66 -91
- package/dist/components/render-tags/index.vue.css +8 -8
- package/dist/components/render-tags/index.vue.js +1 -1
- package/dist/components/render-tool/search/index.script.vue.js.js +10 -9
- package/dist/components/render-tree/index.script.vue.js +65 -119
- package/dist/components/render-tree/index.vue.css +5 -5
- package/dist/components/render-tree/index.vue.d.ts +1 -1
- package/dist/components.d.ts +3 -1
- package/dist/components.ts.js +3 -1
- package/dist/css/bk-patch.css +1099 -0
- package/dist/css/g-utilities.css +153 -175
- package/dist/css/g-utilities.manifest.json +35 -33
- package/dist/css/main.css +10 -0
- package/dist/css/variable/blue-theme.d.ts +69 -0
- package/dist/css/variable/blue-theme.ts.js +74 -0
- package/dist/css/variable/token.d.ts +114 -0
- package/dist/css/variable/token.ts.js +151 -0
- package/dist/hooks/use-common-http.d.ts +1 -1
- package/dist/hooks/use-common-http.ts.js +4 -2
- package/dist/hooks/use-dataset-http.d.ts +23 -14
- package/dist/hooks/use-dataset-http.ts.js +25 -18
- package/dist/hooks/use-display-name.ts.js +2 -0
- package/dist/hooks/use-form-leave-confirm.ts.js +4 -3
- package/dist/hooks/use-form-rule.ts.js +7 -3
- package/dist/hooks/use-member-http.d.ts +2 -1
- package/dist/hooks/use-member-http.ts.js +7 -5
- package/dist/hooks/use-style.d.ts +7 -3
- package/dist/hooks/use-style.ts.js +45 -3
- package/dist/hooks/use-t-table.d.ts +11 -31
- package/dist/hooks/use-t-table.ts.js +27 -53
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.ts.js +1 -1
- package/dist/http/fetch/error-interceptor.ts.js +2 -1
- package/dist/http/fetch/index.ts.js +3 -1
- package/dist/http/fetch/success-interceptor.ts.js +8 -4
- package/dist/http/helper/agent.ts.js +2 -1
- package/dist/http/helper/common.ts.js +4 -2
- package/dist/http/helper/mcp.ts.js +3 -1
- package/dist/i18n/en-US.d.ts +368 -0
- package/dist/i18n/en-US.ts.js +367 -0
- package/dist/i18n/index.d.ts +11 -0
- package/dist/i18n/index.ts.js +44 -0
- package/dist/i18n/zh-CN.d.ts +368 -0
- package/dist/i18n/zh-CN.ts.js +367 -0
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/common.d.ts +13 -23
- package/dist/types/common.ts.js +1 -1
- package/dist/types/enum.d.ts +21 -5
- package/dist/types/enum.ts.js +26 -6
- package/dist/types/mcp.d.ts +1 -0
- package/package.json +11 -4
- package/dist/components/render-t-table/index.script.vue.js +0 -453
- /package/dist/css/{fonts → bk-icon/fonts}/iconcool.eot +0 -0
- /package/dist/css/{fonts → bk-icon/fonts}/iconcool.svg +0 -0
- /package/dist/css/{fonts → bk-icon/fonts}/iconcool.ttf +0 -0
- /package/dist/css/{fonts → bk-icon/fonts}/iconcool.woff +0 -0
- /package/dist/css/{iconcool.js → bk-icon/iconcool.js} +0 -0
- /package/dist/css/{style.css → bk-icon/style.css} +0 -0
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var _interopRequireDefault = require('../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js');
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require('../../../node_modules/regenerator-runtime/runtime.js');
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require('../../../node_modules/@babel/runtime/helpers/defineProperty.js'));
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require('../../../node_modules/@babel/runtime/helpers/toConsumableArray.js'));
|
|
10
|
-
var _vue = require("vue");
|
|
11
|
-
require('../../../node_modules/core-js/modules/es.array.concat.js');
|
|
12
|
-
require('../../../node_modules/core-js/modules/es.array.filter.js');
|
|
13
|
-
require('../../../node_modules/core-js/modules/es.array.find.js');
|
|
14
|
-
require('../../../node_modules/core-js/modules/es.array.map.js');
|
|
15
|
-
require('../../../node_modules/core-js/modules/es.function.name.js');
|
|
16
|
-
require('../../../node_modules/core-js/modules/es.object.assign.js');
|
|
17
|
-
require('../../../node_modules/core-js/modules/es.object.to-string.js');
|
|
18
|
-
require('../../../node_modules/core-js/modules/es.promise.js');
|
|
19
|
-
require('../../../node_modules/core-js/modules/es.promise.finally.js');
|
|
20
|
-
var _constants = require('../../common/constants.ts.js');
|
|
21
|
-
var _util = require('../../common/util.ts.js');
|
|
22
|
-
var _index = _interopRequireDefault(require('../render-select-plus-extension/index.vue.js'));
|
|
23
|
-
var _index2 = _interopRequireDefault(require('../render-skill/variable-form/index.vue.js'));
|
|
24
|
-
var _useAgentHttp2 = require('../../hooks/use-agent-http.ts.js');
|
|
25
|
-
var _useClickoutside4 = require('../../hooks/use-clickoutside.ts.js');
|
|
26
|
-
var _useSpaceHttp2 = require('../../hooks/use-space-http.ts.js');
|
|
27
|
-
var _enum = require('../../types/enum.ts.js');
|
|
28
|
-
var __awaiter = (void 0) && (void 0).__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1
|
+
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
29
2
|
function adopt(value) {
|
|
30
3
|
return value instanceof P ? value : new P(function(resolve) {
|
|
31
4
|
resolve(value);
|
|
@@ -52,10 +25,25 @@ var __awaiter = (void 0) && (void 0).__awaiter || function(thisArg, _arguments,
|
|
|
52
25
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
53
26
|
});
|
|
54
27
|
};
|
|
55
|
-
|
|
28
|
+
import { defineComponent as _defineComponent, createVNode as _createVNode2 } from 'vue';
|
|
29
|
+
import { renderSlot as _renderSlot, unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, resolveDirective as _resolveDirective, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeClass as _normalizeClass } from "vue";
|
|
30
|
+
const _hoisted_1 = {
|
|
31
|
+
class: "g-text-16 g-text-[var(--aidev-title-color)] g-leading-24"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_2 = {
|
|
56
34
|
class: "g-flex-row g-justify-end g-mt-16"
|
|
57
35
|
};
|
|
58
|
-
|
|
36
|
+
import { ref, toRef, watch } from 'vue';
|
|
37
|
+
import { MAX_PAGE_SIZE, MODULE_NAME } from '../../common/constants.ts.js';
|
|
38
|
+
import { isEmpty } from '../../common/util.ts.js';
|
|
39
|
+
import RenderSelectPlusExtension from '../render-select-plus-extension/index.vue.js';
|
|
40
|
+
import VariableForm from '../render-skill/variable-form/index.vue.js';
|
|
41
|
+
import { useAgentHttp } from '../../hooks/use-agent-http.ts.js';
|
|
42
|
+
import { useClickoutside } from '../../hooks/use-clickoutside.ts.js';
|
|
43
|
+
import { useSpaceHttp } from '../../hooks/use-space-http.ts.js';
|
|
44
|
+
import { t } from '../../i18n/index.ts.js';
|
|
45
|
+
import { AgentType, GroupType, Module, PromptSource, ResourceStatus, SdkNavigateActionType } from '../../types/enum.ts.js';
|
|
46
|
+
export default /*@__PURE__*/ _defineComponent({
|
|
59
47
|
props: {
|
|
60
48
|
resourceType: {},
|
|
61
49
|
resource: {},
|
|
@@ -79,106 +67,102 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
79
67
|
emits: [
|
|
80
68
|
"navigate"
|
|
81
69
|
],
|
|
82
|
-
setup
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var renderEnvs = (0, _vue.ref)([]);
|
|
106
|
-
var formData = (0, _vue.ref)({
|
|
70
|
+
setup (__props, { emit: __emit }) {
|
|
71
|
+
const props = __props;
|
|
72
|
+
const emits = __emit;
|
|
73
|
+
const { getAgent, getAgentList, updateAgent, getAgentMcpPermission, resourceApply } = useAgentHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
|
74
|
+
const { getResourceAuthorizedSpaces } = useSpaceHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
|
75
|
+
const { handleInitClickoutside } = useClickoutside();
|
|
76
|
+
const { handleInitClickoutside: handleInitSpaceSelectClickoutside } = useClickoutside();
|
|
77
|
+
const { handleInitClickoutside: handleInitAgentSelectClickoutside } = useClickoutside();
|
|
78
|
+
const formRef = ref();
|
|
79
|
+
const spaceSelectRef = ref();
|
|
80
|
+
const agentSelectRef = ref();
|
|
81
|
+
const variableFormRef = ref();
|
|
82
|
+
const agents = ref([]);
|
|
83
|
+
const spaces = ref([]);
|
|
84
|
+
const isLoadingAgents = ref(false);
|
|
85
|
+
const isLoadingSpaces = ref(false);
|
|
86
|
+
const isLoadingConfirm = ref(false);
|
|
87
|
+
const isShowPopover = ref(false);
|
|
88
|
+
const isShowConfirm = ref(false);
|
|
89
|
+
const hasMcpPermission = ref(undefined);
|
|
90
|
+
const hasUnfilledRequiredEnv = ref(false);
|
|
91
|
+
const renderEnvs = ref([]);
|
|
92
|
+
const formData = ref({
|
|
107
93
|
selectedAgentId: undefined,
|
|
108
94
|
selectedSpaceId: undefined
|
|
109
95
|
});
|
|
110
|
-
|
|
111
|
-
return props.resourceType ===
|
|
96
|
+
const getWidth = ()=>{
|
|
97
|
+
return props.resourceType === Module.Skill ? 600 : 280;
|
|
112
98
|
};
|
|
113
|
-
|
|
114
|
-
if (props.resourceType ===
|
|
115
|
-
return (
|
|
99
|
+
const getContent = ()=>{
|
|
100
|
+
if (props.resourceType === Module.Skill) {
|
|
101
|
+
return _createVNode2(VariableForm, {
|
|
116
102
|
"ref": variableFormRef,
|
|
117
103
|
"skillEnvs": renderEnvs.value,
|
|
118
104
|
"onUpdate:skillEnvs": handleUpdateEnvs
|
|
119
105
|
}, null);
|
|
120
106
|
}
|
|
121
|
-
return '当前选择的 MCP 暂无使用权限且未经申请,提交后将自动创建申请单';
|
|
107
|
+
return t('当前选择的 MCP 暂无使用权限且未经申请,提交后将自动创建申请单');
|
|
122
108
|
};
|
|
123
|
-
|
|
124
|
-
if (props.resourceType ===
|
|
125
|
-
return '配置 Skill 环境变量';
|
|
109
|
+
const getTitle = ()=>{
|
|
110
|
+
if (props.resourceType === Module.Skill) {
|
|
111
|
+
return t('配置 Skill 环境变量');
|
|
126
112
|
}
|
|
127
|
-
return '确认提交申请?';
|
|
113
|
+
return t('确认提交申请?');
|
|
128
114
|
};
|
|
129
|
-
|
|
115
|
+
const handleGetSpacesAndSetDefaultSpace = ()=>{
|
|
130
116
|
isLoadingSpaces.value = true;
|
|
131
|
-
|
|
117
|
+
const params = {
|
|
132
118
|
resourceType: props.resourceType,
|
|
133
119
|
resourceId: props.resource.id
|
|
134
120
|
};
|
|
135
|
-
if (props.resourceType ===
|
|
121
|
+
if (props.resourceType === Module.Mcp) {
|
|
136
122
|
params.mcpType = props.resource.mcpType;
|
|
137
123
|
}
|
|
138
|
-
return getResourceAuthorizedSpaces(params).then(
|
|
124
|
+
return getResourceAuthorizedSpaces(params).then((data)=>{
|
|
139
125
|
var _a;
|
|
140
126
|
spaces.value = data;
|
|
141
127
|
formData.value.selectedSpaceId = (_a = data[0]) === null || _a === void 0 ? void 0 : _a.spaceId;
|
|
142
|
-
}).finally(
|
|
128
|
+
}).finally(()=>{
|
|
143
129
|
isLoadingSpaces.value = false;
|
|
144
130
|
});
|
|
145
131
|
};
|
|
146
|
-
|
|
132
|
+
const handleGetAgentsAndSetDefaultAgent = ()=>{
|
|
147
133
|
if (!formData.value.selectedSpaceId) return;
|
|
148
134
|
isLoadingAgents.value = true;
|
|
149
|
-
|
|
135
|
+
const params = {
|
|
150
136
|
page: 1,
|
|
151
|
-
pageSize:
|
|
137
|
+
pageSize: MAX_PAGE_SIZE,
|
|
152
138
|
spaceId: formData.value.selectedSpaceId,
|
|
153
|
-
groupType:
|
|
154
|
-
agentType:
|
|
139
|
+
groupType: GroupType.Space,
|
|
140
|
+
agentType: AgentType.Single
|
|
155
141
|
};
|
|
156
|
-
getAgentList(params).then(
|
|
142
|
+
getAgentList(params).then((data)=>{
|
|
157
143
|
var _a;
|
|
158
|
-
|
|
144
|
+
let list = data.results.filter((agent)=>{
|
|
159
145
|
var _a;
|
|
160
146
|
return (_a = agent.permission) === null || _a === void 0 ? void 0 : _a.manageAgent;
|
|
161
147
|
});
|
|
162
|
-
if (props.resourceType ===
|
|
163
|
-
list = list.filter(
|
|
164
|
-
return agent.id !== props.resource.id;
|
|
165
|
-
});
|
|
148
|
+
if (props.resourceType === Module.Agent) {
|
|
149
|
+
list = list.filter((agent)=>agent.id !== props.resource.id);
|
|
166
150
|
}
|
|
167
151
|
agents.value = list;
|
|
168
152
|
formData.value.selectedAgentId = (_a = list[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
169
|
-
}).finally(
|
|
153
|
+
}).finally(()=>{
|
|
170
154
|
isLoadingAgents.value = false;
|
|
171
155
|
});
|
|
172
156
|
};
|
|
173
|
-
|
|
157
|
+
const handleGoCreateAgent = ()=>{
|
|
174
158
|
handleClose();
|
|
175
159
|
emits('navigate', {
|
|
176
|
-
type:
|
|
160
|
+
type: SdkNavigateActionType.AgentList,
|
|
177
161
|
spaceId: formData.value.selectedSpaceId,
|
|
178
162
|
isShowCreateAgent: 1
|
|
179
163
|
});
|
|
180
164
|
};
|
|
181
|
-
|
|
165
|
+
const handleClose = ()=>{
|
|
182
166
|
var _a;
|
|
183
167
|
// 关闭弹窗
|
|
184
168
|
isShowPopover.value = false;
|
|
@@ -195,541 +179,284 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
195
179
|
// 清空表单验证
|
|
196
180
|
(_a = formRef.value) === null || _a === void 0 ? void 0 : _a.clearValidate();
|
|
197
181
|
};
|
|
198
|
-
|
|
182
|
+
const handleClickOutside = ()=>{
|
|
199
183
|
handleClose();
|
|
200
184
|
};
|
|
201
|
-
|
|
185
|
+
const handleSpaceSelectClickOutside = ()=>{
|
|
202
186
|
var _a, _b;
|
|
203
187
|
(_a = spaceSelectRef.value) === null || _a === void 0 ? void 0 : _a.hidePopover();
|
|
204
188
|
(_b = spaceSelectRef.value) === null || _b === void 0 ? void 0 : _b.handleBlur();
|
|
205
189
|
};
|
|
206
|
-
|
|
190
|
+
const handleAgentSelectClickOutside = ()=>{
|
|
207
191
|
var _a, _b;
|
|
208
192
|
(_a = agentSelectRef.value) === null || _a === void 0 ? void 0 : _a.hidePopover();
|
|
209
193
|
(_b = agentSelectRef.value) === null || _b === void 0 ? void 0 : _b.handleBlur();
|
|
210
194
|
};
|
|
211
|
-
|
|
212
|
-
renderEnvs.value =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
216
|
-
return regeneratorRuntime.wrap(function(_context) {
|
|
217
|
-
while(1)switch(_context.prev = _context.next){
|
|
218
|
-
case 0:
|
|
219
|
-
if (!isShowPopover.value) {
|
|
220
|
-
_context.next = 1;
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
return _context.abrupt("return");
|
|
224
|
-
case 1:
|
|
225
|
-
isShowPopover.value = true;
|
|
226
|
-
_context.next = 2;
|
|
227
|
-
return handleGetSpacesAndSetDefaultSpace();
|
|
228
|
-
case 2:
|
|
229
|
-
handleGetAgentsAndSetDefaultAgent();
|
|
230
|
-
case 3:
|
|
231
|
-
case "end":
|
|
232
|
-
return _context.stop();
|
|
233
|
-
}
|
|
234
|
-
}, _callee);
|
|
235
|
-
}));
|
|
195
|
+
const handleUpdateEnvs = (data)=>{
|
|
196
|
+
renderEnvs.value = [
|
|
197
|
+
...data
|
|
198
|
+
];
|
|
236
199
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
},
|
|
267
|
-
conversationSettings: Object.assign(Object.assign({}, selectedAgent.conversationSettings), {
|
|
268
|
-
commands: [].concat((0, _toConsumableArray2.default)(selectedAgent.conversationSettings.commands), (0, _toConsumableArray2.default)(selfCommands))
|
|
269
|
-
})
|
|
270
|
-
}));
|
|
271
|
-
case 3:
|
|
272
|
-
case "end":
|
|
273
|
-
return _context2.stop();
|
|
274
|
-
}
|
|
275
|
-
}, _callee2);
|
|
276
|
-
}));
|
|
277
|
-
};
|
|
278
|
-
var handleRelateToolToAgent = function handleRelateToolToAgent(selectedAgent) {
|
|
279
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee3() {
|
|
200
|
+
const handleShow = ()=>__awaiter(this, void 0, void 0, function*() {
|
|
201
|
+
if (isShowPopover.value) return;
|
|
202
|
+
isShowPopover.value = true;
|
|
203
|
+
yield handleGetSpacesAndSetDefaultSpace();
|
|
204
|
+
handleGetAgentsAndSetDefaultAgent();
|
|
205
|
+
});
|
|
206
|
+
const handleRelateAgentToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
207
|
+
var _a, _b, _c;
|
|
208
|
+
const resourceId = props.resource.id;
|
|
209
|
+
if ((_b = (_a = selectedAgent.relatedAgents) === null || _a === void 0 ? void 0 : _a.agents) === null || _b === void 0 ? void 0 : _b.find((agent)=>agent.id === resourceId)) return;
|
|
210
|
+
const currentAgent = yield getAgent(resourceId);
|
|
211
|
+
const selfCommands = currentAgent.conversationSettings.commands.filter((cmd)=>cmd.agentId === currentAgent.id);
|
|
212
|
+
const relatedAgents = [
|
|
213
|
+
...(_c = selectedAgent.relatedAgents) === null || _c === void 0 ? void 0 : _c.agents,
|
|
214
|
+
currentAgent
|
|
215
|
+
];
|
|
216
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
217
|
+
relatedAgents: {
|
|
218
|
+
agents: relatedAgents
|
|
219
|
+
},
|
|
220
|
+
conversationSettings: Object.assign(Object.assign({}, selectedAgent.conversationSettings), {
|
|
221
|
+
commands: [
|
|
222
|
+
...selectedAgent.conversationSettings.commands,
|
|
223
|
+
...selfCommands
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
}));
|
|
227
|
+
});
|
|
228
|
+
const handleRelateToolToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
280
229
|
var _a, _b, _c, _d;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
return _context3.abrupt("return");
|
|
291
|
-
case 1:
|
|
292
|
-
_context3.next = 2;
|
|
293
|
-
return updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
294
|
-
relatedTools: {
|
|
295
|
-
tools: [].concat((0, _toConsumableArray2.default)(((_c = selectedAgent.relatedTools) === null || _c === void 0 ? void 0 : _c.tools) || []), [
|
|
296
|
-
props.resource
|
|
297
|
-
]),
|
|
298
|
-
mcps: ((_d = selectedAgent.relatedTools) === null || _d === void 0 ? void 0 : _d.mcps) || []
|
|
299
|
-
}
|
|
300
|
-
}));
|
|
301
|
-
case 2:
|
|
302
|
-
case "end":
|
|
303
|
-
return _context3.stop();
|
|
230
|
+
if ((_b = (_a = selectedAgent.relatedTools) === null || _a === void 0 ? void 0 : _a.tools) === null || _b === void 0 ? void 0 : _b.find((tool)=>tool.id === props.resource.id)) return;
|
|
231
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
232
|
+
relatedTools: {
|
|
233
|
+
tools: [
|
|
234
|
+
...((_c = selectedAgent.relatedTools) === null || _c === void 0 ? void 0 : _c.tools) || [],
|
|
235
|
+
props.resource
|
|
236
|
+
],
|
|
237
|
+
mcps: ((_d = selectedAgent.relatedTools) === null || _d === void 0 ? void 0 : _d.mcps) || []
|
|
304
238
|
}
|
|
305
|
-
}
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
return _context4.abrupt("return");
|
|
323
|
-
case 1:
|
|
324
|
-
_context4.next = 2;
|
|
325
|
-
return updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
326
|
-
knowledgebaseSettings: Object.assign(Object.assign({}, selectedAgent.knowledgebaseSettings), {
|
|
327
|
-
knowledgebases: [].concat((0, _toConsumableArray2.default)(((_c = selectedAgent.knowledgebaseSettings) === null || _c === void 0 ? void 0 : _c.knowledgebases) || []), [
|
|
328
|
-
targetKb
|
|
329
|
-
])
|
|
330
|
-
})
|
|
331
|
-
}));
|
|
332
|
-
case 2:
|
|
333
|
-
case "end":
|
|
334
|
-
return _context4.stop();
|
|
335
|
-
}
|
|
336
|
-
}, _callee4);
|
|
337
|
-
}));
|
|
338
|
-
};
|
|
339
|
-
var handleRelateMcpToAgent = function handleRelateMcpToAgent(selectedAgent) {
|
|
340
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee5() {
|
|
239
|
+
}));
|
|
240
|
+
});
|
|
241
|
+
const handleRelateKnowledgebaseToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
242
|
+
var _a, _b, _c;
|
|
243
|
+
const targetKb = props.resource;
|
|
244
|
+
const isAlreadyRelated = (_b = (_a = selectedAgent.knowledgebaseSettings) === null || _a === void 0 ? void 0 : _a.knowledgebases) === null || _b === void 0 ? void 0 : _b.find((knowledgebase)=>knowledgebase.id === targetKb.id);
|
|
245
|
+
if (isAlreadyRelated) return;
|
|
246
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
247
|
+
knowledgebaseSettings: Object.assign(Object.assign({}, selectedAgent.knowledgebaseSettings), {
|
|
248
|
+
knowledgebases: [
|
|
249
|
+
...((_c = selectedAgent.knowledgebaseSettings) === null || _c === void 0 ? void 0 : _c.knowledgebases) || [],
|
|
250
|
+
targetKb
|
|
251
|
+
]
|
|
252
|
+
})
|
|
253
|
+
}));
|
|
254
|
+
});
|
|
255
|
+
const handleRelateMcpToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
341
256
|
var _a, _b, _c, _d;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
return _context5.abrupt("return");
|
|
352
|
-
case 1:
|
|
353
|
-
_context5.next = 2;
|
|
354
|
-
return updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
355
|
-
relatedTools: {
|
|
356
|
-
tools: ((_c = selectedAgent.relatedTools) === null || _c === void 0 ? void 0 : _c.tools) || [],
|
|
357
|
-
mcps: [].concat((0, _toConsumableArray2.default)(((_d = selectedAgent.relatedTools) === null || _d === void 0 ? void 0 : _d.mcps) || []), [
|
|
358
|
-
props.resource
|
|
359
|
-
])
|
|
360
|
-
}
|
|
361
|
-
}));
|
|
362
|
-
case 2:
|
|
363
|
-
case "end":
|
|
364
|
-
return _context5.stop();
|
|
257
|
+
if ((_b = (_a = selectedAgent.relatedTools) === null || _a === void 0 ? void 0 : _a.mcps) === null || _b === void 0 ? void 0 : _b.find((mcp)=>mcp.id === props.resource.id && mcp.mcpType === props.resource.mcpType)) return;
|
|
258
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
259
|
+
relatedTools: {
|
|
260
|
+
tools: ((_c = selectedAgent.relatedTools) === null || _c === void 0 ? void 0 : _c.tools) || [],
|
|
261
|
+
mcps: [
|
|
262
|
+
...((_d = selectedAgent.relatedTools) === null || _d === void 0 ? void 0 : _d.mcps) || [],
|
|
263
|
+
props.resource
|
|
264
|
+
]
|
|
365
265
|
}
|
|
366
|
-
}
|
|
367
|
-
})
|
|
368
|
-
|
|
369
|
-
var handleRelateSkillToAgent = function handleRelateSkillToAgent(selectedAgent) {
|
|
370
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee6() {
|
|
266
|
+
}));
|
|
267
|
+
});
|
|
268
|
+
const handleRelateSkillToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
371
269
|
var _a, _b, _c;
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
})
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return _context6.abrupt("return");
|
|
382
|
-
case 1:
|
|
383
|
-
_context6.next = 2;
|
|
384
|
-
return updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
385
|
-
relatedSkills: {
|
|
386
|
-
skills: [].concat((0, _toConsumableArray2.default)((_c = selectedAgent.relatedSkills) === null || _c === void 0 ? void 0 : _c.skills), [
|
|
387
|
-
Object.assign(Object.assign({}, props.resource), {
|
|
388
|
-
envs: renderEnvs.value
|
|
389
|
-
})
|
|
390
|
-
])
|
|
391
|
-
}
|
|
392
|
-
}));
|
|
393
|
-
case 2:
|
|
394
|
-
case "end":
|
|
395
|
-
return _context6.stop();
|
|
270
|
+
if ((_b = (_a = selectedAgent.relatedSkills) === null || _a === void 0 ? void 0 : _a.skills) === null || _b === void 0 ? void 0 : _b.find((skill)=>skill.id === props.resource.id)) return;
|
|
271
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
272
|
+
relatedSkills: {
|
|
273
|
+
skills: [
|
|
274
|
+
...(_c = selectedAgent.relatedSkills) === null || _c === void 0 ? void 0 : _c.skills,
|
|
275
|
+
Object.assign(Object.assign({}, props.resource), {
|
|
276
|
+
envs: renderEnvs.value
|
|
277
|
+
})
|
|
278
|
+
]
|
|
396
279
|
}
|
|
397
|
-
}
|
|
398
|
-
})
|
|
399
|
-
|
|
400
|
-
var handleRelateLLMToAgent = function handleRelateLLMToAgent(selectedAgent) {
|
|
401
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee7() {
|
|
280
|
+
}));
|
|
281
|
+
});
|
|
282
|
+
const handleRelateLLMToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
402
283
|
var _a, _b, _c;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
collectionContent: collection.content
|
|
467
|
-
})
|
|
468
|
-
}));
|
|
469
|
-
case 2:
|
|
470
|
-
case "end":
|
|
471
|
-
return _context9.stop();
|
|
472
|
-
}
|
|
473
|
-
}, _callee9);
|
|
474
|
-
}));
|
|
475
|
-
};
|
|
476
|
-
var handleBindAndNavigate = function handleBindAndNavigate(selectedAgent) {
|
|
477
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee0() {
|
|
478
|
-
var _a, relateMap;
|
|
479
|
-
return regeneratorRuntime.wrap(function(_context0) {
|
|
480
|
-
while(1)switch(_context0.prev = _context0.next){
|
|
481
|
-
case 0:
|
|
482
|
-
relateMap = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _enum.Module.Agent, handleRelateAgentToAgent), _enum.Module.Mcp, handleRelateMcpToAgent), _enum.Module.Tool, handleRelateToolToAgent), _enum.Module.Skill, handleRelateSkillToAgent), _enum.Module.LLM, handleRelateLLMToAgent), _enum.Module.Knowledgebase, handleRelateKnowledgebaseToAgent), _enum.Module.Prompt, handleRelatePromptToAgent), _enum.Module.Collection, handleRelateCollectionToAgent);
|
|
483
|
-
_context0.next = 1;
|
|
484
|
-
return (_a = relateMap[props.resourceType]) === null || _a === void 0 ? void 0 : _a.call(relateMap, selectedAgent);
|
|
485
|
-
case 1:
|
|
486
|
-
emits('navigate', {
|
|
487
|
-
type: _enum.SdkNavigateActionType.AgentDetailSetting,
|
|
488
|
-
id: formData.value.selectedAgentId,
|
|
489
|
-
spaceId: formData.value.selectedSpaceId,
|
|
490
|
-
isNewTab: true
|
|
491
|
-
});
|
|
492
|
-
handleClose();
|
|
493
|
-
case 2:
|
|
494
|
-
case "end":
|
|
495
|
-
return _context0.stop();
|
|
496
|
-
}
|
|
497
|
-
}, _callee0);
|
|
498
|
-
}));
|
|
499
|
-
};
|
|
500
|
-
var handleConfirm = function handleConfirm() {
|
|
501
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee1() {
|
|
502
|
-
var _a, selectedAgent, _t;
|
|
503
|
-
return regeneratorRuntime.wrap(function(_context1) {
|
|
504
|
-
while(1)switch(_context1.prev = _context1.next){
|
|
505
|
-
case 0:
|
|
506
|
-
_context1.prev = 0;
|
|
507
|
-
_context1.next = 1;
|
|
508
|
-
return (_a = formRef.value) === null || _a === void 0 ? void 0 : _a.validate();
|
|
509
|
-
case 1:
|
|
510
|
-
if (!(hasMcpPermission.value === false || hasUnfilledRequiredEnv.value)) {
|
|
511
|
-
_context1.next = 2;
|
|
512
|
-
break;
|
|
513
|
-
}
|
|
514
|
-
// 没有权限或必填环境变量未配置,显示弹窗
|
|
515
|
-
isShowConfirm.value = true;
|
|
516
|
-
_context1.next = 4;
|
|
517
|
-
break;
|
|
518
|
-
case 2:
|
|
519
|
-
// 有权限且必填环境变量已配置,绑定并跳转
|
|
520
|
-
isLoadingConfirm.value = true;
|
|
521
|
-
_context1.next = 3;
|
|
522
|
-
return getAgent(formData.value.selectedAgentId);
|
|
523
|
-
case 3:
|
|
524
|
-
selectedAgent = _context1.sent;
|
|
525
|
-
_context1.next = 4;
|
|
526
|
-
return handleBindAndNavigate(selectedAgent);
|
|
527
|
-
case 4:
|
|
528
|
-
_context1.next = 6;
|
|
529
|
-
break;
|
|
530
|
-
case 5:
|
|
531
|
-
_context1.prev = 5;
|
|
532
|
-
_t = _context1["catch"](0);
|
|
533
|
-
console.error(_t);
|
|
534
|
-
case 6:
|
|
535
|
-
_context1.prev = 6;
|
|
536
|
-
isLoadingConfirm.value = false;
|
|
537
|
-
return _context1.finish(6);
|
|
538
|
-
case 7:
|
|
539
|
-
case "end":
|
|
540
|
-
return _context1.stop();
|
|
284
|
+
if (((_a = selectedAgent.promptSetting) === null || _a === void 0 ? void 0 : _a.llmCode) === ((_b = props.resource) === null || _b === void 0 ? void 0 : _b.llmCode)) return;
|
|
285
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
286
|
+
promptSetting: Object.assign(Object.assign({}, selectedAgent.promptSetting), {
|
|
287
|
+
llmCode: (_c = props.resource) === null || _c === void 0 ? void 0 : _c.llmCode
|
|
288
|
+
})
|
|
289
|
+
}));
|
|
290
|
+
});
|
|
291
|
+
const handleRelatePromptToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
292
|
+
const prompt = props.resource;
|
|
293
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
294
|
+
promptSetting: Object.assign(Object.assign({}, selectedAgent.promptSetting), {
|
|
295
|
+
promptType: PromptSource.UserDefine,
|
|
296
|
+
promptContent: prompt.content
|
|
297
|
+
})
|
|
298
|
+
}));
|
|
299
|
+
});
|
|
300
|
+
const handleRelateCollectionToAgent = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
301
|
+
var _a;
|
|
302
|
+
const collection = props.resource;
|
|
303
|
+
if (((_a = selectedAgent.promptSetting) === null || _a === void 0 ? void 0 : _a.collectionId) === collection.id) return;
|
|
304
|
+
yield updateAgent(Object.assign(Object.assign({}, selectedAgent), {
|
|
305
|
+
promptSetting: Object.assign(Object.assign({}, selectedAgent.promptSetting), {
|
|
306
|
+
promptType: PromptSource.Collection,
|
|
307
|
+
collectionId: collection.id,
|
|
308
|
+
collectionName: collection.name,
|
|
309
|
+
collectionVariables: collection.variables,
|
|
310
|
+
collectionContent: collection.content
|
|
311
|
+
})
|
|
312
|
+
}));
|
|
313
|
+
});
|
|
314
|
+
const handleBindAndNavigate = (selectedAgent)=>__awaiter(this, void 0, void 0, function*() {
|
|
315
|
+
var _a;
|
|
316
|
+
const relateMap = {
|
|
317
|
+
[Module.Agent]: handleRelateAgentToAgent,
|
|
318
|
+
[Module.Mcp]: handleRelateMcpToAgent,
|
|
319
|
+
[Module.Tool]: handleRelateToolToAgent,
|
|
320
|
+
[Module.Skill]: handleRelateSkillToAgent,
|
|
321
|
+
[Module.LLM]: handleRelateLLMToAgent,
|
|
322
|
+
[Module.Knowledgebase]: handleRelateKnowledgebaseToAgent,
|
|
323
|
+
[Module.Prompt]: handleRelatePromptToAgent,
|
|
324
|
+
[Module.Collection]: handleRelateCollectionToAgent
|
|
325
|
+
};
|
|
326
|
+
yield (_a = relateMap[props.resourceType]) === null || _a === void 0 ? void 0 : _a.call(relateMap, selectedAgent);
|
|
327
|
+
emits('navigate', {
|
|
328
|
+
type: SdkNavigateActionType.AgentDetailSetting,
|
|
329
|
+
id: formData.value.selectedAgentId,
|
|
330
|
+
spaceId: formData.value.selectedSpaceId,
|
|
331
|
+
isNewTab: true
|
|
332
|
+
});
|
|
333
|
+
handleClose();
|
|
334
|
+
});
|
|
335
|
+
const handleConfirm = ()=>__awaiter(this, void 0, void 0, function*() {
|
|
336
|
+
var _a;
|
|
337
|
+
try {
|
|
338
|
+
yield (_a = formRef.value) === null || _a === void 0 ? void 0 : _a.validate();
|
|
339
|
+
if (hasMcpPermission.value === false || hasUnfilledRequiredEnv.value) {
|
|
340
|
+
// 没有权限或必填环境变量未配置,显示弹窗
|
|
341
|
+
isShowConfirm.value = true;
|
|
342
|
+
} else {
|
|
343
|
+
// 有权限且必填环境变量已配置,绑定并跳转
|
|
344
|
+
isLoadingConfirm.value = true;
|
|
345
|
+
const selectedAgent = yield getAgent(formData.value.selectedAgentId);
|
|
346
|
+
yield handleBindAndNavigate(selectedAgent);
|
|
541
347
|
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}));
|
|
551
|
-
};
|
|
552
|
-
var handlePopoverConfirm = function handlePopoverConfirm() {
|
|
553
|
-
if (props.resourceType === _enum.Module.Skill) {
|
|
348
|
+
} catch (error) {
|
|
349
|
+
console.error(error);
|
|
350
|
+
} finally{
|
|
351
|
+
isLoadingConfirm.value = false;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
const handlePopoverConfirm = ()=>{
|
|
355
|
+
if (props.resourceType === Module.Skill) {
|
|
554
356
|
handleValidateSkillAndConfirm();
|
|
555
357
|
}
|
|
556
|
-
if (props.resourceType ===
|
|
358
|
+
if (props.resourceType === Module.Mcp) {
|
|
557
359
|
handleApplyPermissionAndConfirm();
|
|
558
360
|
}
|
|
559
361
|
};
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
1,
|
|
596
|
-
5,
|
|
597
|
-
6,
|
|
598
|
-
7
|
|
599
|
-
]
|
|
600
|
-
]);
|
|
601
|
-
}));
|
|
602
|
-
};
|
|
603
|
-
var handleApplyPermissionAndConfirm = function handleApplyPermissionAndConfirm() {
|
|
604
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee11() {
|
|
605
|
-
var selectedAgent, resource, _t3;
|
|
606
|
-
return regeneratorRuntime.wrap(function(_context11) {
|
|
607
|
-
while(1)switch(_context11.prev = _context11.next){
|
|
608
|
-
case 0:
|
|
609
|
-
isLoadingConfirm.value = true;
|
|
610
|
-
_context11.prev = 1;
|
|
611
|
-
_context11.next = 2;
|
|
612
|
-
return getAgent(formData.value.selectedAgentId);
|
|
613
|
-
case 2:
|
|
614
|
-
selectedAgent = _context11.sent;
|
|
615
|
-
resource = [
|
|
616
|
-
{
|
|
617
|
-
resourceType: _enum.Module.Mcp,
|
|
618
|
-
resourceCode: props.resource.mcpCode
|
|
619
|
-
}
|
|
620
|
-
];
|
|
621
|
-
_context11.next = 3;
|
|
622
|
-
return resourceApply(resource, selectedAgent.id);
|
|
623
|
-
case 3:
|
|
624
|
-
_context11.next = 4;
|
|
625
|
-
return handleBindAndNavigate(selectedAgent);
|
|
626
|
-
case 4:
|
|
627
|
-
isShowConfirm.value = false;
|
|
628
|
-
_context11.next = 6;
|
|
629
|
-
break;
|
|
630
|
-
case 5:
|
|
631
|
-
_context11.prev = 5;
|
|
632
|
-
_t3 = _context11["catch"](1);
|
|
633
|
-
console.error(_t3);
|
|
634
|
-
case 6:
|
|
635
|
-
_context11.prev = 6;
|
|
636
|
-
isLoadingConfirm.value = false;
|
|
637
|
-
return _context11.finish(6);
|
|
638
|
-
case 7:
|
|
639
|
-
case "end":
|
|
640
|
-
return _context11.stop();
|
|
641
|
-
}
|
|
642
|
-
}, _callee11, null, [
|
|
643
|
-
[
|
|
644
|
-
1,
|
|
645
|
-
5,
|
|
646
|
-
6,
|
|
647
|
-
7
|
|
648
|
-
]
|
|
649
|
-
]);
|
|
650
|
-
}));
|
|
651
|
-
};
|
|
652
|
-
var handleCheckConfirm = function handleCheckConfirm() {
|
|
653
|
-
if ((0, _util.isEmpty)(formData.value.selectedAgentId)) {
|
|
362
|
+
const handleValidateSkillAndConfirm = ()=>__awaiter(this, void 0, void 0, function*() {
|
|
363
|
+
var _a;
|
|
364
|
+
isLoadingConfirm.value = true;
|
|
365
|
+
try {
|
|
366
|
+
yield (_a = variableFormRef.value) === null || _a === void 0 ? void 0 : _a.validate();
|
|
367
|
+
const selectedAgent = yield getAgent(formData.value.selectedAgentId);
|
|
368
|
+
yield handleBindAndNavigate(selectedAgent);
|
|
369
|
+
isShowConfirm.value = false;
|
|
370
|
+
} catch (error) {
|
|
371
|
+
console.error(error);
|
|
372
|
+
} finally{
|
|
373
|
+
isLoadingConfirm.value = false;
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
const handleApplyPermissionAndConfirm = ()=>__awaiter(this, void 0, void 0, function*() {
|
|
377
|
+
isLoadingConfirm.value = true;
|
|
378
|
+
try {
|
|
379
|
+
const selectedAgent = yield getAgent(formData.value.selectedAgentId);
|
|
380
|
+
const resource = [
|
|
381
|
+
{
|
|
382
|
+
resourceType: Module.Mcp,
|
|
383
|
+
resourceCode: props.resource.mcpCode
|
|
384
|
+
}
|
|
385
|
+
];
|
|
386
|
+
yield resourceApply(resource, selectedAgent.id);
|
|
387
|
+
yield handleBindAndNavigate(selectedAgent);
|
|
388
|
+
isShowConfirm.value = false;
|
|
389
|
+
} catch (error) {
|
|
390
|
+
console.error(error);
|
|
391
|
+
} finally{
|
|
392
|
+
isLoadingConfirm.value = false;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
const handleCheckConfirm = ()=>{
|
|
396
|
+
if (isEmpty(formData.value.selectedAgentId)) {
|
|
654
397
|
return;
|
|
655
398
|
}
|
|
656
|
-
if (props.resourceType ===
|
|
399
|
+
if (props.resourceType === Module.Skill) {
|
|
657
400
|
handleCheckSkillEnvs();
|
|
658
401
|
}
|
|
659
|
-
if (props.resourceType ===
|
|
402
|
+
if (props.resourceType === Module.Mcp) {
|
|
660
403
|
handleCheckMcpPermission();
|
|
661
404
|
}
|
|
662
405
|
};
|
|
663
406
|
// 检查是否有必填的环境变量
|
|
664
|
-
|
|
665
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/ regeneratorRuntime.mark(function _callee12() {
|
|
407
|
+
const handleCheckSkillEnvs = ()=>__awaiter(this, void 0, void 0, function*() {
|
|
666
408
|
var _a, _b;
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
return Object.assign(Object.assign({}, env), {
|
|
673
|
-
value: env.default
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
return env;
|
|
677
|
-
});
|
|
678
|
-
hasUnfilledRequiredEnv.value = renderEnvs.value.some(function(env) {
|
|
679
|
-
return env.required && (0, _util.isEmpty)(env.value);
|
|
680
|
-
});
|
|
681
|
-
if (hasUnfilledRequiredEnv.value) {
|
|
682
|
-
isLoadingConfirm.value = true;
|
|
683
|
-
getAgent(formData.value.selectedAgentId).then(function(agent) {
|
|
684
|
-
var _a;
|
|
685
|
-
var isAlreadyRelated = (_a = agent.relatedSkills) === null || _a === void 0 ? void 0 : _a.skills.find(function(skill) {
|
|
686
|
-
return skill.id === props.resource.id;
|
|
687
|
-
});
|
|
688
|
-
if (isAlreadyRelated) {
|
|
689
|
-
hasUnfilledRequiredEnv.value = false;
|
|
690
|
-
renderEnvs.value = [];
|
|
691
|
-
}
|
|
692
|
-
}).finally(function() {
|
|
693
|
-
isLoadingConfirm.value = false;
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
case 1:
|
|
697
|
-
case "end":
|
|
698
|
-
return _context12.stop();
|
|
409
|
+
renderEnvs.value = (_b = (_a = props.resource.bkaiDependencies) === null || _a === void 0 ? void 0 : _a.envs) === null || _b === void 0 ? void 0 : _b.map((env)=>{
|
|
410
|
+
if (isEmpty(env.value) && !isEmpty(env.default)) {
|
|
411
|
+
return Object.assign(Object.assign({}, env), {
|
|
412
|
+
value: env.default
|
|
413
|
+
});
|
|
699
414
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
415
|
+
return env;
|
|
416
|
+
});
|
|
417
|
+
hasUnfilledRequiredEnv.value = renderEnvs.value.some((env)=>env.required && isEmpty(env.value));
|
|
418
|
+
if (hasUnfilledRequiredEnv.value) {
|
|
419
|
+
isLoadingConfirm.value = true;
|
|
420
|
+
getAgent(formData.value.selectedAgentId).then((agent)=>{
|
|
421
|
+
var _a;
|
|
422
|
+
const isAlreadyRelated = (_a = agent.relatedSkills) === null || _a === void 0 ? void 0 : _a.skills.find((skill)=>skill.id === props.resource.id);
|
|
423
|
+
if (isAlreadyRelated) {
|
|
424
|
+
hasUnfilledRequiredEnv.value = false;
|
|
425
|
+
renderEnvs.value = [];
|
|
426
|
+
}
|
|
427
|
+
}).finally(()=>{
|
|
428
|
+
isLoadingConfirm.value = false;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
});
|
|
703
432
|
// 检查 MCP 权限
|
|
704
|
-
|
|
433
|
+
const handleCheckMcpPermission = ()=>{
|
|
705
434
|
isLoadingConfirm.value = true;
|
|
706
|
-
|
|
707
|
-
getAgentMcpPermission(formData.value.selectedAgentId, mcp.mcpCode, mcp.mcpType).then(
|
|
708
|
-
hasMcpPermission.value = res.status !==
|
|
709
|
-
}).catch(
|
|
435
|
+
const mcp = props.resource;
|
|
436
|
+
getAgentMcpPermission(formData.value.selectedAgentId, mcp.mcpCode, mcp.mcpType).then((res)=>{
|
|
437
|
+
hasMcpPermission.value = res.status !== ResourceStatus.NoPermission;
|
|
438
|
+
}).catch(()=>{
|
|
710
439
|
hasMcpPermission.value = undefined;
|
|
711
|
-
}).finally(
|
|
440
|
+
}).finally(()=>{
|
|
712
441
|
isLoadingConfirm.value = false;
|
|
713
442
|
});
|
|
714
443
|
};
|
|
715
|
-
|
|
444
|
+
const handleCancelApply = ()=>{
|
|
716
445
|
isShowConfirm.value = false;
|
|
717
446
|
};
|
|
718
447
|
handleInitClickoutside('render-relate-agent-popover', handleClickOutside);
|
|
719
448
|
handleInitSpaceSelectClickoutside('space-select', handleSpaceSelectClickOutside);
|
|
720
449
|
handleInitAgentSelectClickoutside('agent-select', handleAgentSelectClickOutside);
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
var _directive_bk_tooltips = (0, _vue.resolveDirective)("bk-tooltips");
|
|
732
|
-
return (0, _vue.openBlock)(), (0, _vue.createBlock)(_component_bk_popover, {
|
|
450
|
+
watch(()=>formData.value.selectedAgentId, handleCheckConfirm);
|
|
451
|
+
return (_ctx, _cache)=>{
|
|
452
|
+
const _component_bk_button = _resolveComponent("bk-button");
|
|
453
|
+
const _component_bk_select = _resolveComponent("bk-select");
|
|
454
|
+
const _component_bk_form_item = _resolveComponent("bk-form-item");
|
|
455
|
+
const _component_bk_form = _resolveComponent("bk-form");
|
|
456
|
+
const _component_bk_pop_confirm = _resolveComponent("bk-pop-confirm");
|
|
457
|
+
const _component_bk_popover = _resolveComponent("bk-popover");
|
|
458
|
+
const _directive_bk_tooltips = _resolveDirective("bk-tooltips");
|
|
459
|
+
return _openBlock(), _createBlock(_component_bk_popover, {
|
|
733
460
|
placement: props.placement,
|
|
734
461
|
boundary: props.boundary,
|
|
735
462
|
"is-show": isShowPopover.value,
|
|
@@ -738,32 +465,25 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
738
465
|
width: "400",
|
|
739
466
|
"ext-cls": "render-relate-agent-popover"
|
|
740
467
|
}, {
|
|
741
|
-
content: (
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
class: "g-text-16 g-text-black g-leading-24"
|
|
745
|
-
}, " 关联至智能体 ", -1 /* CACHED */ )),
|
|
746
|
-
(0, _vue.createVNode)(_component_bk_form, {
|
|
468
|
+
content: _withCtx(()=>[
|
|
469
|
+
_createElementVNode("span", _hoisted_1, _toDisplayString(_unref(t)('关联至智能体')), 1 /* TEXT */ ),
|
|
470
|
+
_createVNode(_component_bk_form, {
|
|
747
471
|
model: formData.value,
|
|
748
472
|
ref_key: "formRef",
|
|
749
473
|
ref: formRef,
|
|
750
474
|
"form-type": "vertical",
|
|
751
475
|
class: "g-small-form g-small-gap-form !g-mt-16"
|
|
752
476
|
}, {
|
|
753
|
-
default: (
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
label: "空间",
|
|
477
|
+
default: _withCtx(()=>[
|
|
478
|
+
_createVNode(_component_bk_form_item, {
|
|
479
|
+
label: _unref(t)('空间'),
|
|
757
480
|
property: "selectedSpaceId",
|
|
758
481
|
required: ""
|
|
759
482
|
}, {
|
|
760
|
-
default: (
|
|
761
|
-
|
|
762
|
-
(0, _vue.createVNode)(_component_bk_select, {
|
|
483
|
+
default: _withCtx(()=>[
|
|
484
|
+
_createVNode(_component_bk_select, {
|
|
763
485
|
modelValue: formData.value.selectedSpaceId,
|
|
764
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] =
|
|
765
|
-
return formData.value.selectedSpaceId = $event;
|
|
766
|
-
}),
|
|
486
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>formData.value.selectedSpaceId = $event),
|
|
767
487
|
clearable: false,
|
|
768
488
|
loading: isLoadingSpaces.value,
|
|
769
489
|
list: spaces.value,
|
|
@@ -783,23 +503,23 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
783
503
|
"loading",
|
|
784
504
|
"list"
|
|
785
505
|
])
|
|
786
|
-
]
|
|
787
|
-
}),
|
|
506
|
+
]),
|
|
788
507
|
_: 1 /* STABLE */
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
|
|
508
|
+
}, 8 /* PROPS */ , [
|
|
509
|
+
"label"
|
|
510
|
+
]),
|
|
511
|
+
_createVNode(_component_bk_form_item, {
|
|
512
|
+
label: _unref(t)('智能体'),
|
|
792
513
|
property: "selectedAgentId",
|
|
793
514
|
required: ""
|
|
794
515
|
}, {
|
|
795
|
-
default: (
|
|
796
|
-
|
|
797
|
-
(0, _vue.createVNode)(_component_bk_select, {
|
|
516
|
+
default: _withCtx(()=>[
|
|
517
|
+
_createVNode(_component_bk_select, {
|
|
798
518
|
modelValue: formData.value.selectedAgentId,
|
|
799
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] =
|
|
800
|
-
|
|
519
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event)=>formData.value.selectedAgentId = $event),
|
|
520
|
+
"no-data-text": _unref(t)('暂无未关联该{MODULE_NAME}的智能体', {
|
|
521
|
+
MODULE_NAME: _unref(MODULE_NAME)[props.resourceType]
|
|
801
522
|
}),
|
|
802
|
-
"no-data-text": "\u6682\u65E0\u672A\u5173\u8054\u8BE5".concat((0, _vue.unref)(_constants.MODULE_NAME)[props.resourceType], "\u7684\u667A\u80FD\u4F53"),
|
|
803
523
|
clearable: false,
|
|
804
524
|
list: agents.value,
|
|
805
525
|
loading: isLoadingAgents.value,
|
|
@@ -814,14 +534,14 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
814
534
|
"id-key": "id",
|
|
815
535
|
"display-key": "agentName"
|
|
816
536
|
}, {
|
|
817
|
-
extension: (
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
text: "去新建",
|
|
537
|
+
extension: _withCtx(()=>[
|
|
538
|
+
_createVNode(RenderSelectPlusExtension, {
|
|
539
|
+
text: _unref(t)('去新建'),
|
|
821
540
|
onClick: handleGoCreateAgent
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
|
|
541
|
+
}, null, 8 /* PROPS */ , [
|
|
542
|
+
"text"
|
|
543
|
+
])
|
|
544
|
+
]),
|
|
825
545
|
_: 1 /* STABLE */
|
|
826
546
|
}, 8 /* PROPS */ , [
|
|
827
547
|
"modelValue",
|
|
@@ -829,18 +549,18 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
829
549
|
"list",
|
|
830
550
|
"loading"
|
|
831
551
|
])
|
|
832
|
-
]
|
|
833
|
-
}),
|
|
552
|
+
]),
|
|
834
553
|
_: 1 /* STABLE */
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
554
|
+
}, 8 /* PROPS */ , [
|
|
555
|
+
"label"
|
|
556
|
+
])
|
|
557
|
+
]),
|
|
838
558
|
_: 1 /* STABLE */
|
|
839
559
|
}, 8 /* PROPS */ , [
|
|
840
560
|
"model"
|
|
841
561
|
]),
|
|
842
|
-
(
|
|
843
|
-
(
|
|
562
|
+
_createElementVNode("section", _hoisted_2, [
|
|
563
|
+
_createVNode(_component_bk_pop_confirm, {
|
|
844
564
|
width: getWidth(),
|
|
845
565
|
title: getTitle(),
|
|
846
566
|
content: getContent(),
|
|
@@ -855,24 +575,22 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
855
575
|
onConfirm: handlePopoverConfirm,
|
|
856
576
|
onCancel: handleCancelApply
|
|
857
577
|
}, {
|
|
858
|
-
default: (
|
|
859
|
-
|
|
860
|
-
|
|
578
|
+
default: _withCtx(()=>[
|
|
579
|
+
_createVNode(_component_bk_button, {
|
|
580
|
+
class: _normalizeClass({
|
|
581
|
+
'g-main-button': true
|
|
582
|
+
}),
|
|
861
583
|
loading: isLoadingConfirm.value,
|
|
862
|
-
theme: "primary",
|
|
863
584
|
onClick: handleConfirm
|
|
864
585
|
}, {
|
|
865
|
-
default: (
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
]));
|
|
869
|
-
}),
|
|
586
|
+
default: _withCtx(()=>[
|
|
587
|
+
_createTextVNode(_toDisplayString(_unref(t)('保存并去智能体调试')), 1 /* TEXT */ )
|
|
588
|
+
]),
|
|
870
589
|
_: 1 /* STABLE */
|
|
871
590
|
}, 8 /* PROPS */ , [
|
|
872
591
|
"loading"
|
|
873
592
|
])
|
|
874
|
-
]
|
|
875
|
-
}),
|
|
593
|
+
]),
|
|
876
594
|
_: 1 /* STABLE */
|
|
877
595
|
}, 8 /* PROPS */ , [
|
|
878
596
|
"width",
|
|
@@ -881,40 +599,33 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
881
599
|
"is-show",
|
|
882
600
|
"confirm-config"
|
|
883
601
|
]),
|
|
884
|
-
(
|
|
602
|
+
_createVNode(_component_bk_button, {
|
|
885
603
|
class: "g-ml-8",
|
|
886
604
|
onClick: handleClose
|
|
887
605
|
}, {
|
|
888
|
-
default: (
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
]));
|
|
892
|
-
}),
|
|
606
|
+
default: _withCtx(()=>[
|
|
607
|
+
_createTextVNode(_toDisplayString(_unref(t)('取消')), 1 /* TEXT */ )
|
|
608
|
+
]),
|
|
893
609
|
_: 1 /* STABLE */
|
|
894
610
|
})
|
|
895
611
|
])
|
|
896
|
-
]
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
return [
|
|
900
|
-
(0, _vue.renderSlot)(_ctx.$slots, "trigger", {
|
|
612
|
+
]),
|
|
613
|
+
default: _withCtx(()=>[
|
|
614
|
+
_renderSlot(_ctx.$slots, "trigger", {
|
|
901
615
|
handleShow: handleShow
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
(0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_bk_button, {
|
|
616
|
+
}, ()=>[
|
|
617
|
+
_withDirectives((_openBlock(), _createBlock(_component_bk_button, {
|
|
905
618
|
disabled: props.disabled,
|
|
906
619
|
text: props.isTextButton,
|
|
907
620
|
theme: __props.theme,
|
|
908
621
|
size: "small",
|
|
909
|
-
onClick: (
|
|
622
|
+
onClick: _withModifiers(handleShow, [
|
|
910
623
|
"stop"
|
|
911
624
|
])
|
|
912
625
|
}, {
|
|
913
|
-
default: (
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
]));
|
|
917
|
-
}),
|
|
626
|
+
default: _withCtx(()=>[
|
|
627
|
+
_createTextVNode(_toDisplayString(_unref(t)('关联至智能体')), 1 /* TEXT */ )
|
|
628
|
+
]),
|
|
918
629
|
_: 1 /* STABLE */
|
|
919
630
|
}, 8 /* PROPS */ , [
|
|
920
631
|
"disabled",
|
|
@@ -931,10 +642,8 @@ var _default = exports.default = /*@__PURE__*/ (0, _vue.defineComponent)({
|
|
|
931
642
|
}
|
|
932
643
|
]
|
|
933
644
|
])
|
|
934
|
-
]
|
|
935
|
-
|
|
936
|
-
];
|
|
937
|
-
}),
|
|
645
|
+
], true)
|
|
646
|
+
]),
|
|
938
647
|
_: 3 /* FORWARDED */
|
|
939
648
|
}, 8 /* PROPS */ , [
|
|
940
649
|
"placement",
|