@blueking/ai-ui-sdk 0.4.3-beta.3 → 0.4.3-beta.30

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 (227) hide show
  1. package/dist/components/{render-card/agent/actions.script.vue.js.js → render-agent/action/index.script.vue.js.js} +38 -10
  2. package/dist/components/{render-card/agent/actions.vue.d.ts → render-agent/action/index.vue.d.ts} +1 -0
  3. package/dist/components/render-agent/action/index.vue.js +3 -0
  4. package/dist/components/render-agent/agent-search.script.vue.js.js +6 -1
  5. package/dist/components/render-agent/agent-search.vue.d.ts +1 -0
  6. package/dist/components/render-agent/agent-share.script.vue.js.js +8 -1
  7. package/dist/components/render-agent/agent-share.vue.d.ts +1 -0
  8. package/dist/components/render-agent/agent-type.script.vue.js.js +9 -3
  9. package/dist/components/render-agent/agent-type.vue.css +7 -3
  10. package/dist/components/render-agent/agent-type.vue.d.ts +1 -1
  11. package/dist/components/render-agent/agent-type.vue.js +1 -1
  12. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  13. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  14. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  15. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  16. package/dist/components/render-card/agent/index.script.vue.js.js +80 -26
  17. package/dist/components/render-card/agent/index.vue.d.ts +3 -1
  18. package/dist/components/render-card/agent/prefix-info-tool.vue.css +5 -5
  19. package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
  20. package/dist/components/render-card/agent/upgrade.script.vue.js.js +122 -0
  21. package/dist/components/render-card/agent/upgrade.vue.css +9 -0
  22. package/dist/components/render-card/agent/upgrade.vue.d.ts +17 -0
  23. package/dist/components/render-card/agent/upgrade.vue.js +5 -0
  24. package/dist/components/render-card/base/application-base-actions.script.vue.js.js +1 -1
  25. package/dist/components/render-card/base/collection-icon.script.vue.js.js +146 -0
  26. package/dist/components/render-card/base/collection-icon.vue.d.ts +20 -0
  27. package/dist/components/render-card/base/collection-icon.vue.js +3 -0
  28. package/dist/components/render-card/base/reference-icon.script.vue.js.js +19 -15
  29. package/dist/components/render-card/base.script.vue.js +5 -11
  30. package/dist/components/render-card/base.vue.css +12 -12
  31. package/dist/components/render-card/base.vue.js +1 -1
  32. package/dist/components/render-card/llm/actions.script.vue.js.js +15 -3
  33. package/dist/components/render-card/llm/actions.vue.d.ts +1 -0
  34. package/dist/components/render-card/llm/corner-badge.vue.css +3 -3
  35. package/dist/components/render-card/llm/corner-badge.vue.js +1 -1
  36. package/dist/components/render-card/llm/icons.script.vue.js.js +6 -14
  37. package/dist/components/render-card/llm/icons.vue.css +2 -2
  38. package/dist/components/render-card/llm/icons.vue.js +1 -1
  39. package/dist/components/render-card/llm/index.script.vue.js.js +9 -8
  40. package/dist/components/render-card/llm/info.vue.css +1 -1
  41. package/dist/components/render-card/llm/info.vue.js +1 -1
  42. package/dist/components/render-card/llm/tag-prefix.script.vue.js.js +18 -14
  43. package/dist/components/render-card/llm/tag-prefix.vue.css +2 -5
  44. package/dist/components/render-card/llm/tag-prefix.vue.d.ts +4 -1
  45. package/dist/components/render-card/llm/tag-prefix.vue.js +1 -1
  46. package/dist/components/render-card/mcp/actions.script.vue.js.js +40 -8
  47. package/dist/components/render-card/mcp/actions.vue.d.ts +1 -0
  48. package/dist/components/render-card/mcp/index.script.vue.js.js +41 -4
  49. package/dist/components/render-card/mcp/index.vue.d.ts +5 -2
  50. package/dist/components/render-card/mcp/name-suffix.vue.css +2 -2
  51. package/dist/components/render-card/mcp/name-suffix.vue.js +1 -1
  52. package/dist/components/render-card/mcp/selected-tools-info.script.vue.js.js +7 -3
  53. package/dist/components/render-card/mcp/selected-tools-info.vue.d.ts +1 -0
  54. package/dist/components/render-card/prompt/icons.vue.css +1 -1
  55. package/dist/components/render-card/prompt/icons.vue.js +1 -1
  56. package/dist/components/render-card/prompt/index.script.vue.js.js +55 -15
  57. package/dist/components/render-card/prompt/index.vue.d.ts +4 -1
  58. package/dist/components/render-card/role/index.script.vue.js.js +60 -21
  59. package/dist/components/render-card/role/index.vue.d.ts +4 -1
  60. package/dist/components/render-card/skill/index.script.vue.js.js +58 -24
  61. package/dist/components/render-card/skill/index.vue.d.ts +8 -4
  62. package/dist/components/render-card/skill/scanner.script.vue.js.js +66 -0
  63. package/dist/components/render-card/skill/{tag-prefix.vue.css → scanner.vue.css} +3 -3
  64. package/dist/components/render-card/skill/scanner.vue.d.ts +11 -0
  65. package/dist/components/render-card/skill/scanner.vue.js +5 -0
  66. package/dist/components/render-card/skill/tag-prefix.script.vue.js.js +11 -50
  67. package/dist/components/render-card/skill/tag-prefix.vue.js +0 -2
  68. package/dist/components/render-card/tool/actions.script.vue.js.js +31 -5
  69. package/dist/components/render-card/tool/actions.vue.d.ts +1 -0
  70. package/dist/components/render-card/tool/index.script.vue.js.js +60 -21
  71. package/dist/components/render-card/tool/index.vue.d.ts +4 -1
  72. package/dist/components/render-card/tool/prefix-info-tool.script.vue.js.js +1 -1
  73. package/dist/components/render-checkbox/index.vue.css +9 -9
  74. package/dist/components/render-checkbox/index.vue.js +1 -1
  75. package/dist/components/render-choose-tag/index.script.vue.js.js +2 -1
  76. package/dist/components/render-choose-tag/index.vue.css +7 -7
  77. package/dist/components/render-choose-tag/index.vue.js +1 -1
  78. package/dist/components/render-collapse/index.script.vue.js.js +1 -3
  79. package/dist/components/render-collapse/index.vue.css +2 -2
  80. package/dist/components/render-collapse/index.vue.js +1 -1
  81. package/dist/components/render-collection/actions/index.script.vue.js.js +27 -5
  82. package/dist/components/render-collection/actions/index.vue.d.ts +1 -0
  83. package/dist/components/render-collection/content/index.vue.css +4 -4
  84. package/dist/components/render-collection/content/index.vue.js +1 -1
  85. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
  86. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
  87. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.script.vue.js.js +3 -3
  88. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.js +0 -2
  89. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  90. package/dist/components/render-dataset/components/dataset-data-valid/index.script.vue.js.js +3 -3
  91. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.js +0 -2
  92. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  93. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  94. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  95. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  96. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  97. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  98. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  99. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  100. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +1 -1
  101. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  102. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  103. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  104. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  105. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  106. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +1 -1
  107. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  108. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  109. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  110. package/dist/components/render-dataset-detail/index.script.vue.js.js +5 -5
  111. package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +10 -7
  112. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  113. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  114. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  115. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  116. package/dist/components/render-dataset-list/index.vue.css +2 -2
  117. package/dist/components/render-dataset-list/index.vue.js +1 -1
  118. package/dist/components/render-dialog/choose-resource.script.vue.js +2 -0
  119. package/dist/components/render-dialog/choose-resource.vue.css +3 -3
  120. package/dist/components/render-dialog/choose-resource.vue.js +1 -1
  121. package/dist/components/render-dialog/choose-result.vue.css +14 -14
  122. package/dist/components/render-dialog/choose-result.vue.js +1 -1
  123. package/dist/components/render-dialog/choose-space.script.vue.js.js +10 -10
  124. package/dist/components/render-dialog/choose-space.vue.css +10 -10
  125. package/dist/components/render-dialog/choose-space.vue.js +1 -1
  126. package/dist/components/render-dialog/index.vue.css +6 -6
  127. package/dist/components/render-dialog/index.vue.js +1 -1
  128. package/dist/components/render-dropdown/index.vue.css +3 -0
  129. package/dist/components/render-dropdown/index.vue.d.ts +5 -5
  130. package/dist/components/render-file-card/index.vue.css +11 -11
  131. package/dist/components/render-file-card/index.vue.js +1 -1
  132. package/dist/components/render-file-type-icon/index.vue.css +6 -6
  133. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  134. package/dist/components/render-generate-tag/index.vue.css +5 -5
  135. package/dist/components/render-generate-tag/index.vue.d.ts +1 -1
  136. package/dist/components/render-generate-tag/index.vue.js +1 -1
  137. package/dist/components/render-knowledge/icon/index.vue.css +1 -1
  138. package/dist/components/render-knowledge/icon/index.vue.js +1 -1
  139. package/dist/components/render-markdown/edit.d.ts +1 -1
  140. package/dist/components/render-markdown/view.d.ts +1 -1
  141. package/dist/components/render-mcp/search/index.script.vue.js.js +7 -4
  142. package/dist/components/render-mcp/search/index.vue.d.ts +1 -0
  143. package/dist/components/render-prompt/actions/index.script.vue.js.js +27 -5
  144. package/dist/components/render-prompt/actions/index.vue.d.ts +1 -0
  145. package/dist/components/render-prompt/content/index.vue.css +1 -1
  146. package/dist/components/render-prompt/content/index.vue.js +1 -1
  147. package/dist/components/render-reference/index.script.vue.js +3 -3
  148. package/dist/components/render-reference/index.vue.css +2 -2
  149. package/dist/components/render-reference/index.vue.js +1 -1
  150. package/dist/components/render-relate-agent/index.script.vue.js +34 -8
  151. package/dist/components/render-relate-agent/index.vue.d.ts +2 -2
  152. package/dist/components/render-resource-version/index.script.vue.js.js +6 -3
  153. package/dist/components/render-resource-version/index.vue.css +2 -2
  154. package/dist/components/render-resource-version/index.vue.d.ts +1 -1
  155. package/dist/components/render-resource-version/index.vue.js +1 -1
  156. package/dist/components/render-router-tab/index.vue.css +3 -3
  157. package/dist/components/render-router-tab/index.vue.js +1 -1
  158. package/dist/components/render-search-select/index.script.vue.js.js +5 -1
  159. package/dist/components/render-search-select/index.vue.d.ts +2 -0
  160. package/dist/components/render-select-plus-extension/index.vue.css +3 -3
  161. package/dist/components/render-select-plus-extension/index.vue.js +1 -1
  162. package/dist/components/render-skill/actions/index.script.vue.js.js +69 -76
  163. package/dist/components/render-skill/actions/index.vue.d.ts +3 -2
  164. package/dist/components/render-t-table/index.script.vue.js +25 -11
  165. package/dist/components/render-t-table/index.vue.css +41 -28
  166. package/dist/components/render-t-table/index.vue.js +1 -1
  167. package/dist/components/render-tag-tree/index.script.vue.js.js +1 -1
  168. package/dist/components/render-tag-tree/index.vue.css +7 -7
  169. package/dist/components/render-tag-tree/index.vue.js +1 -1
  170. package/dist/components/render-tags/index.script.vue.js +6 -6
  171. package/dist/components/render-tags/index.vue.css +6 -6
  172. package/dist/components/render-tags/index.vue.d.ts +1 -1
  173. package/dist/components/render-tags/index.vue.js +1 -1
  174. package/dist/components.d.ts +16 -1
  175. package/dist/components.ts.js +16 -1
  176. package/dist/css/fonts/iconcool.eot +0 -0
  177. package/dist/css/fonts/iconcool.svg +3 -0
  178. package/dist/css/fonts/iconcool.ttf +0 -0
  179. package/dist/css/fonts/iconcool.woff +0 -0
  180. package/dist/css/g-utilities.css +82 -8
  181. package/dist/css/g-utilities.manifest.json +22 -2
  182. package/dist/css/iconcool.js +1 -1
  183. package/dist/css/style.css +3 -0
  184. package/dist/hooks/use-agent-http.d.ts +3 -0
  185. package/dist/hooks/use-agent-http.ts.js +23 -2
  186. package/dist/hooks/use-collection-http.d.ts +2 -0
  187. package/dist/hooks/use-collection-http.ts.js +15 -1
  188. package/dist/hooks/use-common-http.d.ts +1 -1
  189. package/dist/hooks/use-common-http.ts.js +4 -2
  190. package/dist/hooks/use-market-http.d.ts +10 -0
  191. package/dist/hooks/use-market-http.ts.js +71 -1
  192. package/dist/hooks/use-mcp-http.d.ts +2 -0
  193. package/dist/hooks/use-mcp-http.ts.js +15 -1
  194. package/dist/hooks/use-prompt-http.d.ts +2 -0
  195. package/dist/hooks/use-prompt-http.ts.js +15 -1
  196. package/dist/hooks/use-scroll-load.ts.js +1 -1
  197. package/dist/hooks/use-skill-http.d.ts +2 -0
  198. package/dist/hooks/use-skill-http.ts.js +15 -1
  199. package/dist/hooks/use-t-table.d.ts +11 -5
  200. package/dist/hooks/use-t-table.ts.js +25 -3
  201. package/dist/hooks/use-tool-http.d.ts +2 -0
  202. package/dist/hooks/use-tool-http.ts.js +15 -1
  203. package/dist/http/fetch/error-interceptor.ts.js +4 -4
  204. package/dist/http/fetch/request-error.d.ts +3 -3
  205. package/dist/http/fetch/request-error.ts.js +3 -3
  206. package/dist/http/helper/agent.d.ts +7 -1
  207. package/dist/http/helper/agent.ts.js +22 -2
  208. package/dist/http/helper/collection.ts.js +3 -1
  209. package/dist/http/helper/common.d.ts +8 -1
  210. package/dist/http/helper/common.ts.js +19 -0
  211. package/dist/http/helper/mcp.ts.js +8 -2
  212. package/dist/http/helper/prompt.ts.js +3 -1
  213. package/dist/http/helper/skill.ts.js +4 -0
  214. package/dist/http/helper/tool.ts.js +8 -2
  215. package/dist/types/agent.d.ts +25 -1
  216. package/dist/types/collection.d.ts +5 -1
  217. package/dist/types/common.d.ts +10 -1
  218. package/dist/types/enum.d.ts +10 -2
  219. package/dist/types/enum.ts.js +9 -0
  220. package/dist/types/mcp.d.ts +6 -0
  221. package/dist/types/prompt.d.ts +5 -1
  222. package/dist/types/skill.d.ts +4 -0
  223. package/dist/types/tool.d.ts +6 -0
  224. package/package.json +2 -2
  225. package/dist/components/render-card/agent/actions.vue.js +0 -3
  226. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.css +0 -4
  227. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.css +0 -4
@@ -16,4 +16,6 @@ export declare const useCollectionHttp: (apiPrefix: string, spaceId?: Ref<string
16
16
  getCollectionReferringAgents: (collectionId: number) => Promise<import("@/types").IReferringAgent[]>;
17
17
  parseCollection: (collectionId: number, variables: IVariableApi[], model_name: string) => Promise<IContent[]>;
18
18
  parseCollectionVariable: (llm: string, session_id: string, contents: IContent[]) => Promise<IContent[]>;
19
+ addCollectionFavorite: (id: number) => Promise<unknown>;
20
+ removeCollectionFavorite: (id: number) => Promise<unknown>;
19
21
  };
@@ -105,6 +105,18 @@ export const useCollectionHttp = (apiPrefix, spaceId)=>{
105
105
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
106
106
  }
107
107
  });
108
+ // 添加收藏
109
+ const addCollectionFavorite = (id)=>fetch.post(`${apiPrefix}/collection/v1/collection/${id}/add_favorite/`, undefined, {
110
+ headers: {
111
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
112
+ }
113
+ });
114
+ // 取消收藏
115
+ const removeCollectionFavorite = (id)=>fetch.delete(`${apiPrefix}/collection/v1/collection/${id}/remove_favorite/`, undefined, {
116
+ headers: {
117
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
118
+ }
119
+ });
108
120
  return {
109
121
  getCollections,
110
122
  getCollectionCount,
@@ -112,6 +124,8 @@ export const useCollectionHttp = (apiPrefix, spaceId)=>{
112
124
  restoreCollection,
113
125
  getCollectionReferringAgents,
114
126
  parseCollection,
115
- parseCollectionVariable
127
+ parseCollectionVariable,
128
+ addCollectionFavorite,
129
+ removeCollectionFavorite
116
130
  };
117
131
  };
@@ -2,7 +2,7 @@ import { type Ref } from 'vue';
2
2
  import { EnumCharacter, GroupType, Module } from '@/types/enum';
3
3
  export declare const useCommonHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
4
4
  getTagTree: {
5
- (module: Module, subModule: Module, tagName: string, groupType?: GroupType, generateType?: EnumCharacter): Promise<import("@/types/common").ITagTree>;
5
+ (module: Module, subModule: Module, tagName: string, groupType?: GroupType, generateType?: EnumCharacter, agentCode?: string, isPublished?: boolean): Promise<import("@/types/common").ITagTree>;
6
6
  abort(): void;
7
7
  };
8
8
  };
@@ -2,10 +2,12 @@ import fetch, { withAbort } from '../http/fetch/index.ts.js';
2
2
  import { transferTagTreeApi2TagTree } from '../http/helper/common.ts.js';
3
3
  export const useCommonHttp = (apiPrefix, spaceId)=>{
4
4
  // 获取资源标签树
5
- const getTagTree = withAbort((signal, module, subModule, tagName, groupType, generateType)=>fetch.get(`${apiPrefix}/${module}/v1/${subModule}/tag_tree/`, {
5
+ const getTagTree = withAbort((signal, module, subModule, tagName, groupType, generateType, agentCode, isPublished)=>fetch.get(`${apiPrefix}/${module}/v1/${subModule}/tag_tree/`, {
6
6
  tag_name: tagName,
7
7
  group_type: groupType,
8
- generate_type: generateType
8
+ generate_type: generateType,
9
+ agent_code: agentCode,
10
+ is_published: isPublished
9
11
  }, {
10
12
  headers: {
11
13
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
@@ -1,4 +1,14 @@
1
1
  import { Ref } from 'vue';
2
2
  export declare const useMarketHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
3
3
  downloadMarketSkill: (id: number) => Promise<import("@/types/skill").ISkill>;
4
+ addMarketSkillFavorite: (id: number) => Promise<unknown>;
5
+ removeMarketSkillFavorite: (id: number) => Promise<unknown>;
6
+ addMarketToolFavorite: (id: number) => Promise<unknown>;
7
+ removeMarketToolFavorite: (id: number) => Promise<unknown>;
8
+ addMarketAgentFavorite: (id: number) => Promise<unknown>;
9
+ removeMarketAgentFavorite: (id: number) => Promise<unknown>;
10
+ addMarketPromptFavorite: (id: number) => Promise<unknown>;
11
+ removeMarketPromptFavorite: (id: number) => Promise<unknown>;
12
+ addMarketCollectionFavorite: (id: number) => Promise<unknown>;
13
+ removeMarketCollectionFavorite: (id: number) => Promise<unknown>;
4
14
  };
@@ -7,7 +7,77 @@ export const useMarketHttp = (apiPrefix, spaceId)=>{
7
7
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
8
8
  }
9
9
  }).then(transferSkillApi2Skill);
10
+ // 收藏 Skill(市场页)
11
+ const addMarketSkillFavorite = (id)=>fetch.post(`${apiPrefix}/market/v1/skill/${id}/add_favorite/`, undefined, {
12
+ headers: {
13
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
14
+ }
15
+ });
16
+ // 取消收藏 Skill(市场页)
17
+ const removeMarketSkillFavorite = (id)=>fetch.delete(`${apiPrefix}/market/v1/skill/${id}/remove_favorite/`, undefined, {
18
+ headers: {
19
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
20
+ }
21
+ });
22
+ // 收藏 Tool(市场页)
23
+ const addMarketToolFavorite = (id)=>fetch.post(`${apiPrefix}/market/v1/tool/${id}/add_favorite/`, undefined, {
24
+ headers: {
25
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
26
+ }
27
+ });
28
+ // 取消收藏 Tool(市场页)
29
+ const removeMarketToolFavorite = (id)=>fetch.delete(`${apiPrefix}/market/v1/tool/${id}/remove_favorite/`, undefined, {
30
+ headers: {
31
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
32
+ }
33
+ });
34
+ // 收藏 agent(市场页)
35
+ const addMarketAgentFavorite = (id)=>fetch.post(`${apiPrefix}/market/v1/agent/${id}/add_favorite/`, undefined, {
36
+ headers: {
37
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
38
+ }
39
+ });
40
+ // 取消收藏 agent(市场页)
41
+ const removeMarketAgentFavorite = (id)=>fetch.delete(`${apiPrefix}/market/v1/agent/${id}/remove_favorite/`, undefined, {
42
+ headers: {
43
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
44
+ }
45
+ });
46
+ // 收藏 prompt(市场页)
47
+ const addMarketPromptFavorite = (id)=>fetch.post(`${apiPrefix}/market/v1/prompt/${id}/add_favorite/`, undefined, {
48
+ headers: {
49
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
50
+ }
51
+ });
52
+ // 取消收藏 prompt(市场页)
53
+ const removeMarketPromptFavorite = (id)=>fetch.delete(`${apiPrefix}/market/v1/prompt/${id}/remove_favorite/`, undefined, {
54
+ headers: {
55
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
56
+ }
57
+ });
58
+ // 收藏 collection(市场页)
59
+ const addMarketCollectionFavorite = (id)=>fetch.post(`${apiPrefix}/market/v1/collection/${id}/add_favorite/`, undefined, {
60
+ headers: {
61
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
62
+ }
63
+ });
64
+ // 取消收藏 collection(市场页)
65
+ const removeMarketCollectionFavorite = (id)=>fetch.delete(`${apiPrefix}/market/v1/collection/${id}/remove_favorite/`, undefined, {
66
+ headers: {
67
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
68
+ }
69
+ });
10
70
  return {
11
- downloadMarketSkill
71
+ downloadMarketSkill,
72
+ addMarketSkillFavorite,
73
+ removeMarketSkillFavorite,
74
+ addMarketToolFavorite,
75
+ removeMarketToolFavorite,
76
+ addMarketAgentFavorite,
77
+ removeMarketAgentFavorite,
78
+ addMarketPromptFavorite,
79
+ removeMarketPromptFavorite,
80
+ addMarketCollectionFavorite,
81
+ removeMarketCollectionFavorite
12
82
  };
13
83
  };
@@ -18,4 +18,6 @@ export declare const useMcpHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
18
18
  markdown: string;
19
19
  }>;
20
20
  getMcpInstallTargets: () => Promise<import("@/types").IMcpInstallTarget[]>;
21
+ addMcpFavorite: (id: number) => Promise<unknown>;
22
+ removeMcpFavorite: (id: number) => Promise<unknown>;
21
23
  };
@@ -105,6 +105,18 @@ export const useMcpHttp = (apiPrefix, spaceId)=>{
105
105
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
106
106
  }
107
107
  }).then((data)=>data.map(transferMcpInstallTargetApi2McpInstallTarget));
108
+ // 收藏 MCP
109
+ const addMcpFavorite = (id)=>fetch.post(`${apiPrefix}/mcp/v1/mcp/${id}/add_favorite/`, undefined, {
110
+ headers: {
111
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
112
+ }
113
+ });
114
+ // 取消收藏 MCP
115
+ const removeMcpFavorite = (id)=>fetch.delete(`${apiPrefix}/mcp/v1/mcp/${id}/remove_favorite/`, undefined, {
116
+ headers: {
117
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
118
+ }
119
+ });
108
120
  return {
109
121
  getMcpList,
110
122
  deleteMcp,
@@ -113,6 +125,8 @@ export const useMcpHttp = (apiPrefix, spaceId)=>{
113
125
  getMcpCount,
114
126
  getMcpReferringAgents,
115
127
  getMcpInstallGuide,
116
- getMcpInstallTargets
128
+ getMcpInstallTargets,
129
+ addMcpFavorite,
130
+ removeMcpFavorite
117
131
  };
118
132
  };
@@ -13,4 +13,6 @@ export declare const usePromptHttp: (apiPrefix: string, spaceId?: Ref<string>) =
13
13
  (param: import("@/types").IBaseCountParam): Promise<import("@/types").IResourceCount[]>;
14
14
  abort(): void;
15
15
  };
16
+ addPromptFavorite: (id: number) => Promise<unknown>;
17
+ removePromptFavorite: (id: number) => Promise<unknown>;
16
18
  };
@@ -87,11 +87,25 @@ export const usePromptHttp = (apiPrefix, spaceId)=>{
87
87
  },
88
88
  signal
89
89
  }).then((data)=>data.map(transferResourceCountApi2ResourceCount)));
90
+ // 添加收藏
91
+ const addPromptFavorite = (id)=>fetch.post(`${apiPrefix}/prompt/v1/prompt/${id}/add_favorite/`, undefined, {
92
+ headers: {
93
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
94
+ }
95
+ });
96
+ // 取消收藏
97
+ const removePromptFavorite = (id)=>fetch.delete(`${apiPrefix}/prompt/v1/prompt/${id}/remove_favorite/`, undefined, {
98
+ headers: {
99
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
100
+ }
101
+ });
90
102
  return {
91
103
  getPrompts,
92
104
  togglePromptLike,
93
105
  deletePrompt,
94
106
  restorePrompt,
95
- getPromptCount
107
+ getPromptCount,
108
+ addPromptFavorite,
109
+ removePromptFavorite
96
110
  };
97
111
  };
@@ -25,7 +25,7 @@ export const useScrollLoad = ({ targetCls, defaultPageSize = 100, triggerApi, ab
25
25
  }).then((res)=>{
26
26
  onDataLoaded(res.results, append);
27
27
  handleDataUpdated === null || handleDataUpdated === void 0 ? void 0 : handleDataUpdated(datas.value);
28
- isLoadEnd.value = res.count <= page * pageSize;
28
+ isLoadEnd.value = res.count <= page * pageSize || res.hasMore === false;
29
29
  }).finally(()=>{
30
30
  isLoadingMore.value = false;
31
31
  });
@@ -29,4 +29,6 @@ export declare const useSkillHttp: (apiPrefix: string, spaceId?: Ref<string>) =>
29
29
  (id: number, version: string): Promise<import("@/types/skill").ISkillBuildLog>;
30
30
  abort(): void;
31
31
  };
32
+ addSkillFavorite: (id: number) => Promise<unknown>;
33
+ removeSkillFavorite: (id: number) => Promise<unknown>;
32
34
  };
@@ -139,6 +139,18 @@ export const useSkillHttp = (apiPrefix, spaceId)=>{
139
139
  },
140
140
  signal
141
141
  }).then(transferSkillBuildLogApi2SkillBuildLog));
142
+ // 收藏 Skill
143
+ const addSkillFavorite = (id)=>fetch.post(`${apiPrefix}/skill/v1/skill/${id}/add_favorite/`, undefined, {
144
+ headers: {
145
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
146
+ }
147
+ });
148
+ // 取消收藏 Skill
149
+ const removeSkillFavorite = (id)=>fetch.delete(`${apiPrefix}/skill/v1/skill/${id}/remove_favorite/`, undefined, {
150
+ headers: {
151
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
152
+ }
153
+ });
142
154
  return {
143
155
  getSkillList,
144
156
  getSkillCount,
@@ -152,6 +164,8 @@ export const useSkillHttp = (apiPrefix, spaceId)=>{
152
164
  getSkillOpenclawWindowsInstancesStatus,
153
165
  installSkillToOpenclawWindows,
154
166
  getSkillOpenclawWindowsInstallTasksStatus,
155
- getSkillBuildLog
167
+ getSkillBuildLog,
168
+ addSkillFavorite,
169
+ removeSkillFavorite
156
170
  };
157
171
  };
@@ -1,13 +1,15 @@
1
+ import { type Ref } from 'vue';
1
2
  import type { IPagination, IPaginationParam, ISortParam, ITTableSort } from '@/types/common';
2
3
  import { OrderMethod } from '@/types/enum';
3
4
  interface IPaginatedApiResult<T> {
4
5
  results?: T;
5
6
  count?: number;
6
7
  }
8
+ type ITableRow<T> = T extends Array<infer E> ? E : T;
7
9
  export declare const useTTable: <T>() => {
8
- isLoading: import("vue").Ref<boolean, boolean>;
9
- initHook: (callBackFn: (search: IPaginationParam & ISortParam) => Promise<IPaginatedApiResult<T> | T>, isShowPagination: boolean) => void;
10
- sort: import("vue").Ref<{
10
+ isLoading: Ref<boolean, boolean>;
11
+ initHook: (callBackFn: (search: IPaginationParam & ISortParam) => Promise<IPaginatedApiResult<T> | T>, isShowPagination: boolean, key?: string) => void;
12
+ sort: Ref<{
11
13
  descending?: OrderMethod;
12
14
  sortKey?: string;
13
15
  }, ITTableSort | {
@@ -22,7 +24,7 @@ export declare const useTTable: <T>() => {
22
24
  };
23
25
  }) => Promise<void>;
24
26
  triggerApi: () => Promise<void>;
25
- pagination: import("vue").Ref<{
27
+ pagination: Ref<{
26
28
  current: number;
27
29
  limit: number;
28
30
  count: number;
@@ -32,8 +34,12 @@ export declare const useTTable: <T>() => {
32
34
  count: number;
33
35
  }>;
34
36
  resetPagination: () => void;
35
- tableData: [[] | T] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & ([] | T), import("vue").Ref<import("vue").Ref<any, any> & ([] | T), import("vue").Ref<any, any> & ([] | T)>, import("vue").Ref<any, any> & ([] | T)> : import("vue").Ref<[] | import("vue").UnwrapRef<T>, [] | T | import("vue").UnwrapRef<T>>;
37
+ tableData: [[] | T] extends [Ref<any, any>] ? import("@vue/shared").IfAny<Ref<any, any> & ([] | T), Ref<Ref<any, any> & ([] | T), Ref<any, any> & ([] | T)>, Ref<any, any> & ([] | T)> : Ref<[] | import("vue").UnwrapRef<T>, [] | T | import("vue").UnwrapRef<T>>;
36
38
  handlePageChange: (current: number) => void;
37
39
  handlePageSizeChange: (pageSize: number) => void;
40
+ selectedRows: Ref<ITableRow<T>[], ITableRow<T>[]>;
41
+ selectedIds: Ref<(string | number)[], (string | number)[]>;
42
+ handleSelectionChange: (_keys: string | number | (string | number)[], selectedRowData: ITableRow<T>[]) => void;
43
+ handleClearSelection: () => void;
38
44
  };
39
45
  export {};
@@ -1,9 +1,10 @@
1
1
  import { ref } from 'vue';
2
2
  import { OrderMethod } from '../types/enum.ts.js';
3
3
  export const useTTable = ()=>{
4
+ const selectedRows = ref([]);
5
+ const selectedIds = ref([]);
4
6
  const isLoading = ref(false);
5
7
  const isPagination = ref(false);
6
- let callBack;
7
8
  const sort = ref({});
8
9
  const tableData = ref([]);
9
10
  const pagination = ref({
@@ -11,6 +12,9 @@ export const useTTable = ()=>{
11
12
  limit: 20,
12
13
  count: 0
13
14
  });
15
+ let callBack;
16
+ let rowKey = 'id';
17
+ const getRowKey = (row)=>row[rowKey];
14
18
  // 更新数据
15
19
  const triggerApi = ()=>{
16
20
  isLoading.value = true;
@@ -30,9 +34,10 @@ export const useTTable = ()=>{
30
34
  isLoading.value = false;
31
35
  });
32
36
  };
33
- const initHook = (callBackFn, isShowPagination)=>{
37
+ const initHook = (callBackFn, isShowPagination, key = 'id')=>{
34
38
  callBack = callBackFn;
35
39
  isPagination.value = isShowPagination;
40
+ rowKey = key;
36
41
  };
37
42
  // sortKey 为必传
38
43
  const handleSortChange = (config, { col })=>{
@@ -67,6 +72,19 @@ export const useTTable = ()=>{
67
72
  count: 0
68
73
  };
69
74
  };
75
+ const handleSelectionChange = (_keys, selectedRowData)=>{
76
+ const currentPageIds = tableData.value.map(getRowKey);
77
+ const otherPageRows = selectedRows.value.filter((row)=>!currentPageIds.includes(getRowKey(row)));
78
+ selectedRows.value = [
79
+ ...otherPageRows,
80
+ ...selectedRowData
81
+ ];
82
+ selectedIds.value = selectedRows.value.map(getRowKey);
83
+ };
84
+ const handleClearSelection = ()=>{
85
+ selectedRows.value = [];
86
+ selectedIds.value = [];
87
+ };
70
88
  return {
71
89
  isLoading,
72
90
  initHook,
@@ -77,6 +95,10 @@ export const useTTable = ()=>{
77
95
  resetPagination,
78
96
  tableData,
79
97
  handlePageChange,
80
- handlePageSizeChange
98
+ handlePageSizeChange,
99
+ selectedRows,
100
+ selectedIds,
101
+ handleSelectionChange,
102
+ handleClearSelection
81
103
  };
82
104
  };
@@ -13,4 +13,6 @@ export declare const useToolHttp: (apiPrefix: string, spaceId?: Ref<string>) =>
13
13
  abort(): void;
14
14
  };
15
15
  getToolReferringAgents: (toolId: number) => Promise<import("@/types").IReferringAgent[]>;
16
+ addToolFavorite: (id: number) => Promise<unknown>;
17
+ removeToolFavorite: (id: number) => Promise<unknown>;
16
18
  };
@@ -86,11 +86,25 @@ export const useToolHttp = (apiPrefix, spaceId)=>{
86
86
  'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
87
87
  }
88
88
  }).then((data)=>data.map(transferReferringAgentApi2ReferringAgent));
89
+ // 收藏 Tool
90
+ const addToolFavorite = (id)=>fetch.post(`${apiPrefix}/tool/v1/tool/${id}/add_favorite/`, undefined, {
91
+ headers: {
92
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
93
+ }
94
+ });
95
+ // 取消收藏 Tool
96
+ const removeToolFavorite = (id)=>fetch.delete(`${apiPrefix}/tool/v1/tool/${id}/remove_favorite/`, undefined, {
97
+ headers: {
98
+ 'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
99
+ }
100
+ });
89
101
  return {
90
102
  deleteTool,
91
103
  restoreTool,
92
104
  getTools,
93
105
  getToolCount,
94
- getToolReferringAgents
106
+ getToolReferringAgents,
107
+ addToolFavorite,
108
+ removeToolFavorite
95
109
  };
96
110
  };
@@ -3,10 +3,10 @@ import { EventType } from '../../types/enum.ts.js';
3
3
  import RequestError from './request-error.ts.js';
4
4
  // 请求执行失败拦截器
5
5
  export default ((data, config)=>{
6
- var _data_error, _data_response, _data_error1, _data_response1, _data_error2, _data_response2;
7
- const message = (data === null || data === void 0 ? void 0 : (_data_error = data.error) === null || _data_error === void 0 ? void 0 : _data_error.message) || (data === null || data === void 0 ? void 0 : data.message) || (data === null || data === void 0 ? void 0 : (_data_response = data.response) === null || _data_response === void 0 ? void 0 : _data_response.message) || '系统错误';
8
- const code = (data === null || data === void 0 ? void 0 : (_data_error1 = data.error) === null || _data_error1 === void 0 ? void 0 : _data_error1.code) || (data === null || data === void 0 ? void 0 : data.code) || (data === null || data === void 0 ? void 0 : (_data_response1 = data.response) === null || _data_response1 === void 0 ? void 0 : _data_response1.code) || -1;
9
- const item = (data === null || data === void 0 ? void 0 : (_data_error2 = data.error) === null || _data_error2 === void 0 ? void 0 : _data_error2.data) || (data === null || data === void 0 ? void 0 : data.data) || (data === null || data === void 0 ? void 0 : (_data_response2 = data.response) === null || _data_response2 === void 0 ? void 0 : _data_response2.data) || data;
6
+ var _data_error, _data_data, _data_error1, _data_data1, _data_error2, _data_data2;
7
+ const message = (data === null || data === void 0 ? void 0 : (_data_error = data.error) === null || _data_error === void 0 ? void 0 : _data_error.message) || (data === null || data === void 0 ? void 0 : data.message) || (data === null || data === void 0 ? void 0 : (_data_data = data.data) === null || _data_data === void 0 ? void 0 : _data_data.message) || '系统错误';
8
+ const code = (data === null || data === void 0 ? void 0 : (_data_error1 = data.error) === null || _data_error1 === void 0 ? void 0 : _data_error1.code) || (data === null || data === void 0 ? void 0 : data.code) || (data === null || data === void 0 ? void 0 : (_data_data1 = data.data) === null || _data_data1 === void 0 ? void 0 : _data_data1.code) || -1;
9
+ const item = (data === null || data === void 0 ? void 0 : (_data_error2 = data.error) === null || _data_error2 === void 0 ? void 0 : _data_error2.data) || (data === null || data === void 0 ? void 0 : (_data_data2 = data.data) === null || _data_data2 === void 0 ? void 0 : _data_data2.data) || (data === null || data === void 0 ? void 0 : data.data) || data;
10
10
  // 异常情况下,先 emit event
11
11
  emitEvent(EventType.Error, {
12
12
  code,
@@ -1,6 +1,6 @@
1
- export default class RequestError extends Error {
1
+ export default class RequestError<E = unknown> extends Error {
2
2
  code: number;
3
3
  message: string;
4
- response: any;
5
- constructor(code: number, message: string, response?: any);
4
+ data: E;
5
+ constructor(code: number, message: string, data?: E);
6
6
  }
@@ -12,14 +12,14 @@ function _define_property(obj, key, value) {
12
12
  return obj;
13
13
  }
14
14
  class RequestError extends Error {
15
- constructor(code, message, response){
15
+ constructor(code, message, data){
16
16
  super();
17
17
  _define_property(this, "code", void 0);
18
18
  _define_property(this, "message", void 0);
19
- _define_property(this, "response", void 0);
19
+ _define_property(this, "data", void 0);
20
20
  this.code = code;
21
21
  this.message = message;
22
- this.response = response;
22
+ this.data = data;
23
23
  }
24
24
  }
25
25
  export { RequestError as default };
@@ -1,4 +1,4 @@
1
- import type { IAgent, IAgentApi, IAgentApigwMcpPermission, IAgentApigwMcpPermissionApi, IAgentCommand, IAgentCommandApi, IAgentCountParam, IAgentCountParamApi, IAgentForm, IAgentFormApi, IAgentListParam, IAgentListParamApi, IApprovalSetting, IApprovalSettingApi, IResourceApply, IResourceApplyApi } from '@/types/agent';
1
+ import type { IAgent, IAgentApi, IAgentApigwMcpPermission, IAgentApigwMcpPermissionApi, IAgentCommand, IAgentCommandApi, IAgentCountParam, IAgentCountParamApi, IAgentForm, IAgentFormApi, IAgentListParam, IAgentListParamApi, IAgentSdkUpgrade, IAgentSdkUpgradeApi, IApprovalSetting, IApprovalSettingApi, IResourceApply, IResourceApplyApi } from '@/types/agent';
2
2
  /**
3
3
  * 接口转换为ui使用
4
4
  * @param data IAgentCommandApi
@@ -55,6 +55,12 @@ export declare const transferAgentCount2AgentCountApi: (data: IAgentCountParam)
55
55
  * @returns IAgentApigwMcpPermission
56
56
  */
57
57
  export declare const transferAgentApigwMcpPermissionApi2AgentApigwMcpPermission: (data: IAgentApigwMcpPermissionApi) => IAgentApigwMcpPermission;
58
+ /**
59
+ * 接口转换为ui使用(智能体发布页,置顶告知可更新)
60
+ * @param data IAgentSdkUpgradeApi
61
+ * @returns IAgentSdkUpgrade
62
+ */
63
+ export declare const transferAgentSdkUpgradeApi2AgentSdkUpgrade: (data: IAgentSdkUpgradeApi) => IAgentSdkUpgrade;
58
64
  /**
59
65
  * ui转换为接口使用(配置审批)
60
66
  * @param data IApprovalSetting,
@@ -144,6 +144,7 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
144
144
  agent_name: data.agentName,
145
145
  icon: data.icon,
146
146
  agent_type: data.agentType,
147
+ craw_type: data.crawType,
147
148
  user_guide: data.userGuide,
148
149
  is_bind_bk_saas: data.isBindBkSaas,
149
150
  deploy_mode: data.deployMode,
@@ -210,6 +211,7 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
210
211
  agentName: data.agent_name,
211
212
  icon: data.icon,
212
213
  agentType: data.agent_type,
214
+ crawType: data.craw_type,
213
215
  userGuide: data.user_guide,
214
216
  isBindBkSaas: data.is_bind_bk_saas,
215
217
  deployMode: data.deploy_mode,
@@ -217,7 +219,8 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
217
219
  flowSetting: data.flow_setting ? {
218
220
  flowId: data.flow_setting.flow_id,
219
221
  flowVersion: data.flow_setting.flow_version,
220
- isThirdPluginEnabled: data.flow_setting.is_third_plugin_enabled
222
+ isThirdPluginEnabled: data.flow_setting.is_third_plugin_enabled,
223
+ bkflowSpaceId: data.flow_setting.bkflow_space_id
221
224
  } : undefined,
222
225
  conversationSettings: {
223
226
  openingRemark: (_data_conversation_settings_opening_remark = (_data_conversation_settings = data.conversation_settings) === null || _data_conversation_settings === void 0 ? void 0 : _data_conversation_settings.opening_remark) !== null && _data_conversation_settings_opening_remark !== void 0 ? _data_conversation_settings_opening_remark : '',
@@ -269,6 +272,9 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
269
272
  * @param data IAgentApi
270
273
  * @returns IAgent
271
274
  */ export const transferAgentApi2Agent = (data)=>_object_spread_props(_object_spread({}, transferAgentFormApi2AgentForm(data), transferResourceCommonApi2ResourceCommon(data)), {
275
+ needUpgrade: data.need_upgrade,
276
+ agentSdkVersion: data.agent_sdk_version,
277
+ latestSdkVersion: data.latest_sdk_version,
272
278
  version: data.version,
273
279
  latestVersion: data.latest_version,
274
280
  agentUrl: data.agent_url,
@@ -294,6 +300,9 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
294
300
  * @param data IAgent
295
301
  * @returns IAgentApi
296
302
  */ export const transferAgent2AgentApi = (data)=>_object_spread_props(_object_spread({}, transferAgentForm2AgentFormApi(data), transferResourceCommon2ResourceCommonApi(data)), {
303
+ need_upgrade: data.needUpgrade,
304
+ agent_sdk_version: data.agentSdkVersion,
305
+ latest_sdk_version: data.latestSdkVersion,
297
306
  version: data.version,
298
307
  latest_version: data.latestVersion,
299
308
  agent_url: data.agentUrl,
@@ -331,7 +340,8 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
331
340
  description: data.description,
332
341
  updated_by: data.updatedBy,
333
342
  created_by: data.createdBy,
334
- agent_version: data.agentVersion
343
+ agent_version: data.agentVersion,
344
+ group_type: data.groupType
335
345
  });
336
346
  /**
337
347
  * ui转换为接口使用
@@ -365,6 +375,16 @@ export const transferAgentCount2AgentCountApi = (data)=>{
365
375
  url: data.url,
366
376
  protocolType: data.protocol_type
367
377
  });
378
+ /**
379
+ * 接口转换为ui使用(智能体发布页,置顶告知可更新)
380
+ * @param data IAgentSdkUpgradeApi
381
+ * @returns IAgentSdkUpgrade
382
+ */ export const transferAgentSdkUpgradeApi2AgentSdkUpgrade = (data)=>({
383
+ currentSdkVersion: data.current_sdk_version,
384
+ latestSdkVersion: data.latest_sdk_version,
385
+ needUpgrade: data.need_upgrade,
386
+ changelog: data.changelog
387
+ });
368
388
  /**
369
389
  * ui转换为接口使用(配置审批)
370
390
  * @param data IApprovalSetting,
@@ -72,7 +72,8 @@ import { transferBaseCountParam2BaseCountParamApi, transferIPaginationParam2IPag
72
72
  content: data.content,
73
73
  created_by: data.createdBy,
74
74
  created_at: data.createdAt,
75
- updated_by: data.updatedBy
75
+ updated_by: data.updatedBy,
76
+ group_type: data.groupType
76
77
  });
77
78
  };
78
79
  /**
@@ -85,6 +86,7 @@ import { transferBaseCountParam2BaseCountParamApi, transferIPaginationParam2IPag
85
86
  isPublic: data.is_public,
86
87
  name: data.collection_name,
87
88
  code: data.collection_code,
89
+ icon: data.icon,
88
90
  defaultLLMCode: data.default_llm_code,
89
91
  variables: data.variables.map(transferVariableApi2Variable),
90
92
  content: data.content
@@ -1,5 +1,12 @@
1
1
  import { ResourceStatus } from '@/enums';
2
- import type { IBaseCountParam, IBaseCountParamApi, IPaginationParam, IPaginationParamApi, IPaginationResponse, IPaginationResponseApi, IReferringAgent, IReferringAgentApi, IResourceCommon, IResourceCommonApi, IResourceCommonSearchParams, IResourceCommonSearchParamsApi, IResourceCount, IResourceCountApi, IResourceFormCommon, IResourceFormCommonApi, IResourceReference, IResourceReferenceApi, ISortParam, ISortParamApi, ITagTree, ITagTreeApi, ITagTreeNode, ITagTreeNodeApi, IVariable, IVariableApi, IApprovalSettingValue, IApprovalSettingValueApi } from '@/types/common';
2
+ import RequestError from '@/http/fetch/request-error';
3
+ import type { IApprovalSettingValue, IApprovalSettingValueApi, IBaseCountParam, IBaseCountParamApi, IPaginationParam, IPaginationParamApi, IPaginationResponse, IPaginationResponseApi, IReferringAgent, IReferringAgentApi, IResourceCommon, IResourceCommonApi, IResourceCommonSearchParams, IResourceCommonSearchParamsApi, IResourceCount, IResourceCountApi, IResourceFormCommon, IResourceFormCommonApi, IResourceReference, IResourceReferenceApi, ISortParam, ISortParamApi, ITagTree, ITagTreeApi, ITagTreeNode, ITagTreeNodeApi, IVariable, IVariableApi } from '@/types/common';
4
+ /**
5
+ * 将「错误 data 转换函数」包装成可直接用于 Promise.catch 的错误处理器。
6
+ * code / message 由本函数统一透传,data 交给传入的高阶函数转换,转换后仍以 reject 抛出。
7
+ * @param transferData 把接口错误的 data 转换为 UI 使用的数据(其返回类型即为最终错误的 data 类型)
8
+ */
9
+ export declare const transferErrorApi2Error: <E, D>(transferData: (data: E) => D) => (error: RequestError<E>) => Promise<RequestError<D>>;
3
10
  /**
4
11
  * 接口转换为ui使用
5
12
  * @param data ITagsTreeApi
@@ -1,4 +1,18 @@
1
1
  import { transferResourcePermission2ResourcePermissionApi, transferResourcePermissionApi2ResourcePermission } from './permission.ts.js';
2
+ /**
3
+ * 将「错误 data 转换函数」包装成可直接用于 Promise.catch 的错误处理器。
4
+ * code / message 由本函数统一透传,data 交给传入的高阶函数转换,转换后仍以 reject 抛出。
5
+ * @param transferData 把接口错误的 data 转换为 UI 使用的数据(其返回类型即为最终错误的 data 类型)
6
+ */ export const transferErrorApi2Error = (transferData)=>{
7
+ return (error)=>{
8
+ const transferedError = {
9
+ code: error.code,
10
+ data: transferData(error.data),
11
+ message: error.message
12
+ };
13
+ return Promise.reject(transferedError);
14
+ };
15
+ };
2
16
  /**
3
17
  * 接口转换为ui使用
4
18
  * @param data ITagsTreeApi
@@ -78,6 +92,8 @@ import { transferResourcePermission2ResourcePermissionApi, transferResourcePermi
78
92
  spaceId: data.space_id,
79
93
  approvers: data.approvers,
80
94
  ticketUrl: data.ticket_url,
95
+ favorite: data.favorite,
96
+ favoriteCount: data.favorite_count,
81
97
  permission: transferResourcePermissionApi2ResourcePermission(data.permission)
82
98
  });
83
99
  /**
@@ -94,6 +110,8 @@ import { transferResourcePermission2ResourcePermissionApi, transferResourcePermi
94
110
  space_id: data.spaceId,
95
111
  approvers: data.approvers,
96
112
  ticket_url: data.ticketUrl,
113
+ favorite: data.favorite,
114
+ favorite_count: data.favoriteCount,
97
115
  permission: transferResourcePermission2ResourcePermissionApi(data.permission)
98
116
  });
99
117
  /**
@@ -102,6 +120,7 @@ import { transferResourcePermission2ResourcePermissionApi, transferResourcePermi
102
120
  * @returns 将 IPaginationResponseApi<A> 转换为 IPaginationResponse<U> 的函数
103
121
  */ export const transferPaginationResponseApi2PaginationResponse = (transferItem)=>(data)=>({
104
122
  count: data.count,
123
+ hasMore: data.has_more,
105
124
  results: data.results.map(transferItem)
106
125
  });
107
126
  export const transferVariableApi2Variable = (data)=>{