@blueking/ai-ui-sdk 0.1.2-beta.1 → 0.1.2-beta.11

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 (140) hide show
  1. package/dist/components/render-aside/index.vue.css +9 -9
  2. package/dist/components/render-aside/index.vue.js +1 -1
  3. package/dist/components/render-auth/auth-dialog-fn.d.ts +2 -0
  4. package/dist/components/render-auth/auth-dialog-fn.ts.js +14 -0
  5. package/dist/components/render-auth/auth-dialog.script.vue.js.js +110 -0
  6. package/dist/components/render-auth/auth-dialog.vue.css +4 -0
  7. package/dist/components/render-auth/auth-dialog.vue.d.ts +5 -0
  8. package/dist/components/render-auth/auth-dialog.vue.js +4 -0
  9. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  10. package/dist/components/render-auto-height-textarea/index.vue.d.ts +2 -2
  11. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  12. package/dist/components/render-choose-tag/index.script.vue.js.js +242 -0
  13. package/dist/components/render-choose-tag/index.vue.css +39 -0
  14. package/dist/components/render-choose-tag/index.vue.d.ts +12 -0
  15. package/dist/components/render-choose-tag/index.vue.js +5 -0
  16. package/dist/components/render-collapse/index.vue.css +2 -2
  17. package/dist/components/render-collapse/index.vue.js +1 -1
  18. package/dist/components/render-dataset/components/edit-dataset-data/index.script.vue.js.js +163 -171
  19. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  20. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.d.ts +4 -0
  21. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  22. package/dist/components/render-dataset/components/operation-record/index.script.vue.js.js +88 -89
  23. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  24. package/dist/components/render-dataset/components/operation-record/index.vue.d.ts +7 -1
  25. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  26. package/dist/components/render-dataset/components/operation-record/table/index.script.vue.js.js +4 -3
  27. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  28. package/dist/components/render-dataset/components/operation-record/table/index.vue.d.ts +1 -0
  29. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  30. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  31. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  32. package/dist/components/render-dataset/components/plus-dataset/dataset-footer.script.vue.js.js +6 -4
  33. package/dist/components/render-dataset/components/plus-dataset/dataset-footer.vue.d.ts +4 -2
  34. package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +89 -26
  35. package/dist/components/render-dataset/components/plus-dataset/dataset-form.vue.d.ts +3 -0
  36. package/dist/components/render-dataset/components/plus-dataset/index.script.vue.js.js +98 -58
  37. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  38. package/dist/components/render-dataset/components/plus-dataset/index.vue.d.ts +6 -0
  39. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  40. package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.script.vue.js.js +10 -3
  41. package/dist/components/render-dataset/components/plus-dataset-data/form/dataset.vue.d.ts +2 -0
  42. package/dist/components/render-dataset/components/plus-dataset-data/form/file.script.vue.js.js +4 -3
  43. package/dist/components/render-dataset/components/plus-dataset-data/form/file.vue.d.ts +1 -0
  44. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.script.vue.js.js +4 -3
  45. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  46. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.d.ts +1 -0
  47. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  48. package/dist/components/render-dataset/components/plus-dataset-data/form/index.script.vue.js.js +17 -3
  49. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  50. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.d.ts +2 -0
  51. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  52. package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js +4 -3
  53. package/dist/components/render-dataset/components/plus-dataset-data/form/manual.vue.d.ts +1 -0
  54. package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +45 -7
  55. package/dist/components/render-dataset/components/plus-dataset-data/index.vue.d.ts +3 -0
  56. package/dist/components/render-dataset/components/search-dataset/index.script.vue.js.js +21 -6
  57. package/dist/components/render-dataset/components/search-dataset/index.vue.d.ts +2 -0
  58. package/dist/components/render-dataset/components/source-type-icon/index.vue.css +3 -3
  59. package/dist/components/render-dataset/components/source-type-icon/index.vue.js +1 -1
  60. package/dist/components/render-dataset/index.script.vue.js.js +24 -7
  61. package/dist/components/render-dataset/index.vue.css +1 -1
  62. package/dist/components/render-dataset/index.vue.d.ts +2 -0
  63. package/dist/components/render-dataset/index.vue.js +1 -1
  64. package/dist/components/render-dataset-detail/components/header.script.vue.js.js +10 -35
  65. package/dist/components/render-dataset-detail/components/header.vue.d.ts +1 -2
  66. package/dist/components/render-dataset-detail/index.script.vue.js.js +55 -13
  67. package/dist/components/render-dataset-detail/index.vue.d.ts +2 -0
  68. package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +41 -16
  69. package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.vue.d.ts +3 -0
  70. package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +257 -170
  71. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.css +1 -1
  72. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.d.ts +2 -0
  73. package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.js +1 -1
  74. package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +29 -6
  75. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  76. package/dist/components/render-dataset-detail-origin-data/index.vue.d.ts +3 -0
  77. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  78. package/dist/components/render-dataset-list/components/main.script.vue.js.js +57 -13
  79. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  80. package/dist/components/render-dataset-list/components/main.vue.d.ts +4 -0
  81. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  82. package/dist/components/render-dataset-list/components/table.script.vue.js.js +447 -143
  83. package/dist/components/render-dataset-list/components/table.vue.d.ts +4 -0
  84. package/dist/components/render-dataset-list/index.script.vue.js.js +13 -2
  85. package/dist/components/render-dataset-list/index.vue.d.ts +4 -0
  86. package/dist/components/render-expand-collapse/index.vue.css +3 -3
  87. package/dist/components/render-expand-collapse/index.vue.js +1 -1
  88. package/dist/components/render-file-card/index.vue.css +11 -11
  89. package/dist/components/render-file-card/index.vue.js +1 -1
  90. package/dist/components/render-file-type-icon/index.vue.css +5 -5
  91. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  92. package/dist/components/render-header/index.vue.css +5 -5
  93. package/dist/components/render-header/index.vue.js +1 -1
  94. package/dist/components/render-router-tab/index.vue.css +3 -3
  95. package/dist/components/render-router-tab/index.vue.js +1 -1
  96. package/dist/{component.d.ts → components.d.ts} +3 -1
  97. package/dist/{component.ts.js → components.ts.js} +3 -1
  98. package/dist/enums.d.ts +1 -0
  99. package/dist/enums.ts.js +1 -0
  100. package/dist/events.d.ts +1 -0
  101. package/dist/events.ts.js +1 -0
  102. package/dist/hooks/use-chat.d.ts +18 -2
  103. package/dist/hooks/use-chat.ts.js +82 -55
  104. package/dist/hooks/use-dataset-http.d.ts +2 -1
  105. package/dist/hooks/use-dataset-http.ts.js +102 -19
  106. package/dist/hooks/use-form-rule.d.ts +29 -0
  107. package/dist/hooks/use-form-rule.ts.js +101 -0
  108. package/dist/hooks/use-meta-http.d.ts +16 -0
  109. package/dist/hooks/use-meta-http.ts.js +83 -0
  110. package/dist/hooks/use-permission-http.d.ts +7 -0
  111. package/dist/hooks/use-permission-http.ts.js +26 -0
  112. package/dist/hooks/use-permission.d.ts +9 -0
  113. package/dist/hooks/use-permission.ts.js +100 -0
  114. package/dist/hooks/use-session-http.d.ts +1 -1
  115. package/dist/hooks/use-session-http.ts.js +37 -11
  116. package/dist/hooks.d.ts +7 -0
  117. package/dist/hooks.ts.js +7 -0
  118. package/dist/http/fetch/error-interceptor.ts.js +1 -6
  119. package/dist/http/fetch/index.ts.js +59 -6
  120. package/dist/http/helper/agent.ts.js +4 -1
  121. package/dist/http/helper/dataset.ts.js +18 -9
  122. package/dist/http/helper/permission.d.ts +7 -1
  123. package/dist/http/helper/permission.ts.js +11 -1
  124. package/dist/http/helper/session.d.ts +10 -0
  125. package/dist/http/helper/session.ts.js +33 -3
  126. package/dist/https.d.ts +2 -0
  127. package/dist/https.ts.js +2 -0
  128. package/dist/transforms.d.ts +4 -0
  129. package/dist/transforms.ts.js +4 -0
  130. package/dist/types/agent.d.ts +7 -0
  131. package/dist/types/dataset.d.ts +19 -1
  132. package/dist/types/enum.d.ts +44 -0
  133. package/dist/types/enum.ts.js +47 -0
  134. package/dist/types/meta.d.ts +3 -0
  135. package/dist/types/permission.d.ts +43 -0
  136. package/dist/types.d.ts +6 -0
  137. package/dist/types.ts.js +6 -0
  138. package/package.json +31 -10
  139. package/dist/main.d.ts +0 -22
  140. package/dist/main.ts.js +0 -28
@@ -1,7 +1,11 @@
1
1
  import type { IDatasetListParam } from '@/types/dataset';
2
+ import { EnumCharacter } from '@/types/enum';
2
3
  interface IProps {
3
4
  apiPrefix: string;
5
+ isInternal?: boolean;
4
6
  search: IDatasetListParam;
7
+ spaceId?: string;
8
+ tabId: EnumCharacter;
5
9
  }
6
10
  declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
11
  export default _default;
@@ -4,7 +4,12 @@ import RenderHeader from './components/header.vue.js';
4
4
  import RenderMain from './components/main.vue.js';
5
5
  export default /*@__PURE__*/ _defineComponent({
6
6
  props: {
7
- apiPrefix: {}
7
+ apiPrefix: {},
8
+ spaceId: {},
9
+ isInternal: {
10
+ type: Boolean
11
+ },
12
+ tabId: {}
8
13
  },
9
14
  emits: [
10
15
  "success-plus-dataset"
@@ -19,9 +24,15 @@ export default /*@__PURE__*/ _defineComponent({
19
24
  _createVNode(RenderHeader),
20
25
  _createVNode(RenderMain, {
21
26
  "api-prefix": _ctx.apiPrefix,
27
+ "space-id": _ctx.spaceId,
28
+ "is-internal": _ctx.isInternal,
29
+ "tab-id": _ctx.tabId,
22
30
  onSuccessPlusDataset: handleSuccessPlusDataset
23
31
  }, null, 8 /* PROPS */ , [
24
- "api-prefix"
32
+ "api-prefix",
33
+ "space-id",
34
+ "is-internal",
35
+ "tab-id"
25
36
  ])
26
37
  ], 64 /* STABLE_FRAGMENT */ );
27
38
  };
@@ -1,6 +1,10 @@
1
1
  import type { IDataset } from '@/types/dataset';
2
+ import { EnumCharacter } from '@/types/enum';
2
3
  interface IProps {
3
4
  apiPrefix: string;
5
+ spaceId?: string;
6
+ isInternal?: boolean;
7
+ tabId: EnumCharacter;
4
8
  }
5
9
  declare const _default: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
10
  "success-plus-dataset": (data: IDataset) => any;
@@ -1,5 +1,5 @@
1
1
 
2
- .expend-collapse-home[data-v-zj4v2dsi] {
2
+ .expend-collapse-home[data-v-9ltqdcsg] {
3
3
  width: 16px;
4
4
  height: 64px;
5
5
  background: #DCDEE5;
@@ -15,9 +15,9 @@
15
15
  cursor: pointer;
16
16
  z-index: 1550;
17
17
  }
18
- .expend-collapse-home[data-v-zj4v2dsi]:hover {
18
+ .expend-collapse-home[data-v-9ltqdcsg]:hover {
19
19
  background: #979BA5;
20
20
  }
21
- .expend-collapse-home.is-close[data-v-zj4v2dsi] {
21
+ .expend-collapse-home.is-close[data-v-9ltqdcsg] {
22
22
  left: 0;
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-zj4v2dsi";
2
+ script.__scopeId = "data-v-9ltqdcsg";
3
3
  script.__file = "./src/components/render-expand-collapse/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,21 +1,21 @@
1
1
 
2
- .upload-file-home[data-v-8ko036f0] {
2
+ .upload-file-home[data-v-igmjhweh] {
3
3
  position: relative;
4
4
  background: #FFFFFF;
5
5
  border: 1px solid #DCDEE5;
6
6
  border-radius: 4px;
7
7
  padding: 12px 12px 10px 12px;
8
8
  }
9
- .upload-file-home[data-v-8ko036f0]:hover {
9
+ .upload-file-home[data-v-igmjhweh]:hover {
10
10
  border: 1px solid #3A84FF;
11
11
  }
12
- .upload-file-home:hover .file-icons[data-v-8ko036f0] {
12
+ .upload-file-home:hover .file-icons[data-v-igmjhweh] {
13
13
  display: flex;
14
14
  }
15
- .upload-file-home .file-icon[data-v-8ko036f0] {
15
+ .upload-file-home .file-icon[data-v-igmjhweh] {
16
16
  font-size: 32px;
17
17
  }
18
- .upload-file-home .file-content[data-v-8ko036f0] {
18
+ .upload-file-home .file-content[data-v-igmjhweh] {
19
19
  font-size: 12px;
20
20
  flex: 1;
21
21
  align-items: flex-start;
@@ -23,28 +23,28 @@
23
23
  font-weight: normal;
24
24
  width: 0;
25
25
  }
26
- .upload-file-home .file-content .file-name[data-v-8ko036f0] {
26
+ .upload-file-home .file-content .file-name[data-v-igmjhweh] {
27
27
  width: 100%;
28
28
  font-size: 14px;
29
29
  line-height: 20px;
30
30
  }
31
- .upload-file-home .file-content .file-size[data-v-8ko036f0] {
31
+ .upload-file-home .file-content .file-size[data-v-igmjhweh] {
32
32
  font-size: 12px;
33
33
  color: #979BA5;
34
34
  line-height: 20px;
35
35
  }
36
- .upload-file-home .file-icons[data-v-8ko036f0] {
36
+ .upload-file-home .file-icons[data-v-igmjhweh] {
37
37
  display: none;
38
38
  color: #979BA5;
39
39
  }
40
- .upload-file-home .file-icons .bkaidev-icon[data-v-8ko036f0] {
40
+ .upload-file-home .file-icons .bkaidev-icon[data-v-igmjhweh] {
41
41
  cursor: pointer;
42
42
  margin-right: 15px;
43
43
  font-size: 16px;
44
44
  }
45
- .upload-file-home .file-icons .bkaidev-icon[data-v-8ko036f0]:hover {
45
+ .upload-file-home .file-icons .bkaidev-icon[data-v-igmjhweh]:hover {
46
46
  color: #3A84FF;
47
47
  }
48
- .upload-file-home .file-icons .bkaidev-delete[data-v-8ko036f0] {
48
+ .upload-file-home .file-icons .bkaidev-delete[data-v-igmjhweh] {
49
49
  margin: 0;
50
50
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-8ko036f0";
2
+ script.__scopeId = "data-v-igmjhweh";
3
3
  script.__file = "./src/components/render-file-card/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,16 +1,16 @@
1
1
 
2
- .ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-2zfzscls] {
2
+ .ai-ui-sdk-icon.ai-ui-sdk-pdf[data-v-fjqjigr9] {
3
3
  color: #EA3636;
4
4
  }
5
- .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-2zfzscls], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-2zfzscls], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-2zfzscls] {
5
+ .ai-ui-sdk-icon.ai-ui-sdk-doc-2[data-v-fjqjigr9], .ai-ui-sdk-icon.ai-ui-sdk-ppt-2[data-v-fjqjigr9], .ai-ui-sdk-icon.ai-ui-sdk-markdown[data-v-fjqjigr9] {
6
6
  color: #3A84FF;
7
7
  }
8
- .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-2zfzscls] {
8
+ .ai-ui-sdk-icon.ai-ui-sdk-folder-fill[data-v-fjqjigr9] {
9
9
  color: #C4C6CC;
10
10
  }
11
- .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-2zfzscls] {
11
+ .ai-ui-sdk-icon.ai-ui-sdk-excel[data-v-fjqjigr9] {
12
12
  color: #2DCB56;
13
13
  }
14
- .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-2zfzscls] {
14
+ .ai-ui-sdk-icon.ai-ui-sdk-wangye[data-v-fjqjigr9] {
15
15
  color: #14A568;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-2zfzscls";
2
+ script.__scopeId = "data-v-fjqjigr9";
3
3
  script.__file = "./src/components/render-file-type-icon/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
 
2
- .header-home[data-v-cz58od97] {
2
+ .header-home[data-v-o0coqno7] {
3
3
  width: 100%;
4
4
  height: 52px;
5
5
  background: #FFFFFF;
@@ -7,14 +7,14 @@
7
7
  position: relative;
8
8
  z-index: 2;
9
9
  }
10
- .header-title[data-v-cz58od97] {
10
+ .header-title[data-v-o0coqno7] {
11
11
  position: absolute;
12
12
  left: 24px;
13
13
  top: 14px;
14
14
  font-size: 16px;
15
15
  color: #313238;
16
16
  }
17
- .header-main[data-v-cz58od97] {
17
+ .header-main[data-v-o0coqno7] {
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: flex-end;
@@ -22,13 +22,13 @@
22
22
  height: 100%;
23
23
  margin: 0 auto;
24
24
  }
25
- .header-select[data-v-cz58od97] {
25
+ .header-select[data-v-o0coqno7] {
26
26
  width: 300px;
27
27
  margin-right: 8px;
28
28
  z-index: 9;
29
29
  font-size: 12px;
30
30
  }
31
- .header-input[data-v-cz58od97] {
31
+ .header-input[data-v-o0coqno7] {
32
32
  width: 300px;
33
33
  font-size: 12px;
34
34
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-cz58od97";
2
+ script.__scopeId = "data-v-o0coqno7";
3
3
  script.__file = "./src/components/render-header/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,12 +1,12 @@
1
1
 
2
- .router-tab[data-v-it4ip5w0] {
2
+ .router-tab[data-v-vjkx1jjz] {
3
3
  margin-top: 2px;
4
4
  height: 42px;
5
5
  background: #FFFFFF;
6
6
  box-shadow: 0 2px 4px 0 #1919290d;
7
7
  padding: 0 45px;
8
8
  }
9
- .router-tab a[data-v-it4ip5w0] {
9
+ .router-tab a[data-v-vjkx1jjz] {
10
10
  padding: 0 8px;
11
11
  margin-right: 24px;
12
12
  font-size: 14px;
@@ -15,7 +15,7 @@
15
15
  color: #4D4F56;
16
16
  box-sizing: border-box;
17
17
  }
18
- .router-tab a.router-link-exact-active[data-v-it4ip5w0] {
18
+ .router-tab a.router-link-exact-active[data-v-vjkx1jjz] {
19
19
  color: #3A84FF;
20
20
  border-bottom: 2px solid #3A84FF;
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js.js';
2
- script.__scopeId = "data-v-it4ip5w0";
2
+ script.__scopeId = "data-v-vjkx1jjz";
3
3
  script.__file = "./src/components/render-router-tab/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,6 +1,8 @@
1
+ import { renderAuthDialog } from './components/render-auth/auth-dialog-fn';
1
2
  import RenderAutoHeightTextarea from './components/render-auto-height-textarea/index.vue';
3
+ import RenderChooseTag from './components/render-choose-tag/index.vue';
2
4
  import RenderDataset from './components/render-dataset/index.vue';
3
5
  import RenderDatasetDetail from './components/render-dataset-detail/index.vue';
4
6
  import RenderDatasetDetailOriginData from './components/render-dataset-detail-origin-data/index.vue';
5
7
  import RenderDatasetList from './components/render-dataset-list/index.vue';
6
- export { RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, };
8
+ export { renderAuthDialog, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderChooseTag, };
@@ -1,7 +1,9 @@
1
1
  // components
2
+ import { renderAuthDialog } from './components/render-auth/auth-dialog-fn.ts.js';
2
3
  import RenderAutoHeightTextarea from './components/render-auto-height-textarea/index.vue.js';
4
+ import RenderChooseTag from './components/render-choose-tag/index.vue.js';
3
5
  import RenderDataset from './components/render-dataset/index.vue.js';
4
6
  import RenderDatasetDetail from './components/render-dataset-detail/index.vue.js';
5
7
  import RenderDatasetDetailOriginData from './components/render-dataset-detail-origin-data/index.vue.js';
6
8
  import RenderDatasetList from './components/render-dataset-list/index.vue.js';
7
- export { RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderAutoHeightTextarea, RenderDatasetDetailOriginData };
9
+ export { renderAuthDialog, RenderDataset, RenderDatasetDetail, RenderDatasetList, RenderAutoHeightTextarea, RenderDatasetDetailOriginData, RenderChooseTag };
@@ -0,0 +1 @@
1
+ export * from './types/enum';
@@ -0,0 +1 @@
1
+ export * from './types/enum.ts.js';
@@ -0,0 +1 @@
1
+ export * from './event';
@@ -0,0 +1 @@
1
+ export * from './event/index.ts.js';
@@ -1,5 +1,5 @@
1
1
  import { SessionContentRole, SessionContentStatus } from '../types/enum';
2
- import type { BasicChatContent, ChatCallbacks, ISession, ISessionContent, ISessionPrompt, ShortcutChatContent } from '../types/session';
2
+ import type { ChatCallbacks, ISession, ISessionContent, ISessionPrompt } from '../types/session';
3
3
  type SessionContentsMap = {
4
4
  [key: string]: ISessionContent[];
5
5
  };
@@ -109,6 +109,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
109
109
  viewQueryTemplate?: boolean;
110
110
  createQueryTemplate?: boolean;
111
111
  manageQueryTemplate?: boolean;
112
+ viewDataset?: boolean;
113
+ manageDataset?: boolean;
112
114
  };
113
115
  }[];
114
116
  anchorPathResources?: {
@@ -157,6 +159,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
157
159
  viewQueryTemplate?: boolean;
158
160
  createQueryTemplate?: boolean;
159
161
  manageQueryTemplate?: boolean;
162
+ viewDataset?: boolean;
163
+ manageDataset?: boolean;
160
164
  };
161
165
  anchorPath?: string;
162
166
  linkFiles?: {
@@ -331,6 +335,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
331
335
  viewQueryTemplate?: boolean;
332
336
  createQueryTemplate?: boolean;
333
337
  manageQueryTemplate?: boolean;
338
+ viewDataset?: boolean;
339
+ manageDataset?: boolean;
334
340
  };
335
341
  children?: /*elided*/ any[];
336
342
  }[];
@@ -409,6 +415,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
409
415
  viewQueryTemplate?: boolean;
410
416
  createQueryTemplate?: boolean;
411
417
  manageQueryTemplate?: boolean;
418
+ viewDataset?: boolean;
419
+ manageDataset?: boolean;
412
420
  };
413
421
  children?: /*elided*/ any[];
414
422
  }[];
@@ -516,6 +524,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
516
524
  viewQueryTemplate?: boolean;
517
525
  createQueryTemplate?: boolean;
518
526
  manageQueryTemplate?: boolean;
527
+ viewDataset?: boolean;
528
+ manageDataset?: boolean;
519
529
  };
520
530
  }[];
521
531
  anchorPathResources?: {
@@ -564,6 +574,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
564
574
  viewQueryTemplate?: boolean;
565
575
  createQueryTemplate?: boolean;
566
576
  manageQueryTemplate?: boolean;
577
+ viewDataset?: boolean;
578
+ manageDataset?: boolean;
567
579
  };
568
580
  anchorPath?: string;
569
581
  linkFiles?: {
@@ -738,6 +750,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
738
750
  viewQueryTemplate?: boolean;
739
751
  createQueryTemplate?: boolean;
740
752
  manageQueryTemplate?: boolean;
753
+ viewDataset?: boolean;
754
+ manageDataset?: boolean;
741
755
  };
742
756
  children?: /*elided*/ any[];
743
757
  }[];
@@ -816,6 +830,8 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
816
830
  viewQueryTemplate?: boolean;
817
831
  createQueryTemplate?: boolean;
818
832
  manageQueryTemplate?: boolean;
833
+ viewDataset?: boolean;
834
+ manageDataset?: boolean;
819
835
  };
820
836
  children?: /*elided*/ any[];
821
837
  }[];
@@ -833,7 +849,6 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
833
849
  data?: Record<string, any>;
834
850
  headers?: Record<string, string>;
835
851
  }) => void;
836
- sendChat: (content: BasicChatContent | ShortcutChatContent, callback?: () => void) => void;
837
852
  stopChat: (sessionCode: string) => void;
838
853
  plusSessionContent: (sessionCode: string, sessionContent: ISessionContent) => Promise<ISessionContent>;
839
854
  updateSessionContent: (sessionContent: ISessionContent) => boolean;
@@ -846,6 +861,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
846
861
  deleteSessionContents: (sessionCode: string, contentIds: number[]) => Promise<number>;
847
862
  handleStartChat: (sessionCode: string) => Promise<void>;
848
863
  handleErrorChat: (sessionCode: string, message: string, code?: string) => Promise<void>;
864
+ handleCompleteRole: (sessionCode: string, prompts: ISessionPrompt[]) => Promise<void>;
849
865
  reGenerateChat: (sessionCode: string, sessionContent: ISessionContent, sessionIndex: number) => void;
850
866
  reSendChat: (sessionCode: string, sessionContent: ISessionContent, sessionIndex: number) => Promise<void>;
851
867
  deleteChat: (index: number, sessionCode: string) => void;
@@ -55,35 +55,52 @@ function _object_spread(target) {
55
55
  }
56
56
  return target;
57
57
  }
58
+ function ownKeys(object, enumerableOnly) {
59
+ var keys = Object.keys(object);
60
+ if (Object.getOwnPropertySymbols) {
61
+ var symbols = Object.getOwnPropertySymbols(object);
62
+ if (enumerableOnly) {
63
+ symbols = symbols.filter(function(sym) {
64
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
65
+ });
66
+ }
67
+ keys.push.apply(keys, symbols);
68
+ }
69
+ return keys;
70
+ }
71
+ function _object_spread_props(target, source) {
72
+ source = source != null ? source : {};
73
+ if (Object.getOwnPropertyDescriptors) {
74
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
75
+ } else {
76
+ ownKeys(Object(source)).forEach(function(key) {
77
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
78
+ });
79
+ }
80
+ return target;
81
+ }
58
82
  import { computed, ref } from 'vue';
59
83
  import { ChatHelper } from '../common/chart-helper.ts.js';
60
- import { processPromptTemplate, throttle } from '../common/util.ts.js';
84
+ import { throttle } from '../common/util.ts.js';
61
85
  import { getHtmlContentFromDocuments, removeReferenceDoc } from './use-reference-doc.ts.js';
62
86
  import { useSessionHttp } from './use-session-http.ts.js';
63
87
  import { getHtmlContentFromThink, isThinking, removeThink } from './use-think.ts.js';
64
- import { transferSessionContent2SessionPrompt } from '../http/helper/session.ts.js';
88
+ import { transferSessionContent2SessionPrompt, transferSessionPrompt2SessionContent } from '../http/helper/session.ts.js';
65
89
  import { HttpErrorCode, SessionContentRole, SessionContentStatus } from '../types/enum.ts.js';
66
90
  // ai 聊天
67
91
  export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions })=>{
68
- // 用 ref 存储 requestOptions,使其可更新
69
- const currentRequestOptions = ref(requestOptions);
70
92
  // 创建一个变量保存当前的API实现
71
- let apiImpl = useSessionHttp(currentRequestOptions.value.url);
72
- // 更新 requestOptions 的方法
73
- function updateRequestOptions(newOptions) {
74
- // 合并新旧配置
75
- currentRequestOptions.value = _object_spread({}, currentRequestOptions.value, newOptions);
76
- // 如果 URL 变更,重新获取 API
77
- if (newOptions.url) {
78
- apiImpl = useSessionHttp(currentRequestOptions.value.url);
79
- }
80
- }
93
+ let apiImpl = useSessionHttp(requestOptions.url, requestOptions.headers);
94
+ // start message
81
95
  const startMessage = '内容正在生成中...';
96
+ // 用 ref 存储 requestOptions,使其可更新
97
+ const currentRequestOptions = ref(requestOptions);
82
98
  // 聊天上下文
83
99
  const currentSession = ref();
84
100
  const sessionLoadingMap = ref({});
85
101
  const sessionContents = ref([]);
86
102
  const sessionContentsMap = {};
103
+ const sessionWaitingPromptsMap = {};
87
104
  // 通过计算得到的会话列表
88
105
  const calculatedSessionContents = computed(()=>{
89
106
  const calculatedSessionContents = [];
@@ -197,6 +214,15 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
197
214
  handleEnd: handleEndChat,
198
215
  handleError: handleErrorChat
199
216
  });
217
+ // 更新 requestOptions 的方法
218
+ function updateRequestOptions(newOptions) {
219
+ // 合并新旧配置
220
+ currentRequestOptions.value = _object_spread({}, currentRequestOptions.value, newOptions);
221
+ // 如果 URL 变更,重新获取 API
222
+ if (newOptions.url) {
223
+ apiImpl = useSessionHttp(currentRequestOptions.value.url, currentRequestOptions.value.headers);
224
+ }
225
+ }
200
226
  // 新增 db
201
227
  function plusSessionContent2Db(sessionContent) {
202
228
  return apiImpl.plusSessionContent(sessionContent).then((result)=>{
@@ -348,7 +374,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
348
374
  const content = getHtmlContentFromDocuments(documents);
349
375
  sessionContent.content = cover ? content : sessionContent.content + content;
350
376
  yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
351
- return handleReferenceDoc === null || handleReferenceDoc === void 0 ? void 0 : handleReferenceDoc(sessionCode, sessionContent);
377
+ yield handleReferenceDoc === null || handleReferenceDoc === void 0 ? void 0 : handleReferenceDoc(sessionCode, sessionContent);
352
378
  });
353
379
  return _handleReferenceDocChat.apply(this, arguments);
354
380
  }
@@ -364,7 +390,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
364
390
  // 更新 db
365
391
  yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
366
392
  // 调用cb
367
- return handleThink === null || handleThink === void 0 ? void 0 : handleThink(sessionCode, sessionContent);
393
+ yield handleThink === null || handleThink === void 0 ? void 0 : handleThink(sessionCode, sessionContent);
368
394
  });
369
395
  return _handleThinkChat.apply(this, arguments);
370
396
  }
@@ -385,7 +411,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
385
411
  // 更新 db
386
412
  yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
387
413
  // 调用cb
388
- return handleText === null || handleText === void 0 ? void 0 : handleText(sessionCode, sessionContent);
414
+ yield handleText === null || handleText === void 0 ? void 0 : handleText(sessionCode, sessionContent);
389
415
  });
390
416
  return _handleTextChat.apply(this, arguments);
391
417
  }
@@ -413,7 +439,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
413
439
  // 更新 db
414
440
  yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
415
441
  // 调用cb
416
- return handleEnd === null || handleEnd === void 0 ? void 0 : handleEnd(sessionCode, sessionContent);
442
+ yield handleEnd === null || handleEnd === void 0 ? void 0 : handleEnd(sessionCode, sessionContent);
417
443
  }
418
444
  });
419
445
  return _handleEndChat.apply(this, arguments);
@@ -435,7 +461,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
435
461
  sessionContent.role = SessionContentRole.TokenExpired;
436
462
  if ((_currentSession_value = currentSession.value) === null || _currentSession_value === void 0 ? void 0 : (_currentSession_value_sessionProperty = _currentSession_value.sessionProperty) === null || _currentSession_value_sessionProperty === void 0 ? void 0 : _currentSession_value_sessionProperty.isAutoClear) {
437
463
  var _currentSession_value1;
438
- yield plusSessionContent2Db({
464
+ yield plusSessionContent(sessionCode, {
439
465
  sessionCode,
440
466
  role: SessionContentRole.System,
441
467
  content: '由于Token超限,已自动清理会话,后续会话不会携带先前的会话信息'
@@ -450,10 +476,36 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
450
476
  // 更新 db
451
477
  yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
452
478
  // 调用cb
453
- return handleError === null || handleError === void 0 ? void 0 : handleError(sessionCode, sessionContent, code);
479
+ yield handleError === null || handleError === void 0 ? void 0 : handleError(sessionCode, sessionContent, code);
454
480
  });
455
481
  return _handleErrorChat.apply(this, arguments);
456
482
  }
483
+ function handleCompleteRole(sessionCode, prompts) {
484
+ return _handleCompleteRole.apply(this, arguments);
485
+ }
486
+ function _handleCompleteRole() {
487
+ _handleCompleteRole = // 完成角色演绎
488
+ _async_to_generator(function*(sessionCode, prompts) {
489
+ let isPaused = false;
490
+ sessionWaitingPromptsMap[sessionCode] = [];
491
+ for (const prompt of prompts){
492
+ if (isPaused) {
493
+ sessionWaitingPromptsMap[sessionCode].push(prompt);
494
+ } else {
495
+ const sessionContent = _object_spread_props(_object_spread({}, transferSessionPrompt2SessionContent(prompt)), {
496
+ sessionCode,
497
+ status: SessionContentStatus.Success
498
+ });
499
+ yield plusSessionContent(sessionCode, sessionContent);
500
+ // 遇到 pause 就暂停
501
+ if (sessionContent.role === SessionContentRole.Pause) {
502
+ isPaused = true;
503
+ }
504
+ }
505
+ }
506
+ });
507
+ return _handleCompleteRole.apply(this, arguments);
508
+ }
457
509
  // 重新生成对话 仅支持重新生成 ai 的回复
458
510
  function reGenerateChat(sessionCode, sessionContent, sessionIndex) {
459
511
  if (sessionContent.role !== SessionContentRole.Ai) {
@@ -469,6 +521,15 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
469
521
  }
470
522
  // 聊天
471
523
  function chat({ sessionCode, url, data, headers }) {
524
+ const sessionWaitingPrompts = sessionWaitingPromptsMap[sessionCode];
525
+ if ((sessionWaitingPrompts === null || sessionWaitingPrompts === void 0 ? void 0 : sessionWaitingPrompts.length) > 0) {
526
+ handleCompleteRole(sessionCode, sessionWaitingPrompts);
527
+ } else {
528
+ streamChat(sessionCode, data, url, headers);
529
+ }
530
+ }
531
+ // stream 聊天
532
+ function streamChat(sessionCode, data, url, headers) {
472
533
  var _currentRequestOptions_value;
473
534
  const sessionContent = getLastSessionContentBySessionCode(sessionCode);
474
535
  // 发送请求
@@ -513,40 +574,6 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
513
574
  });
514
575
  return _reSendChat.apply(this, arguments);
515
576
  }
516
- // 发送聊天
517
- function sendChat(content, callback) {
518
- var _currentSession_value, _currentRequestOptions_value, _currentSession_value1, _currentSession_value2, _currentRequestOptions_value1;
519
- if (!((_currentSession_value = currentSession.value) === null || _currentSession_value === void 0 ? void 0 : _currentSession_value.sessionCode) || !((_currentRequestOptions_value = currentRequestOptions.value) === null || _currentRequestOptions_value === void 0 ? void 0 : _currentRequestOptions_value.url) || currentSessionLoading.value) {
520
- return;
521
- }
522
- const { message, cite, shortcut } = content;
523
- let input = '';
524
- if (shortcut) {
525
- input = processPromptTemplate(shortcut.prompt, cite);
526
- } else {
527
- input = cite ? `${message}: "${cite}"` : message;
528
- }
529
- sessionContents.value.push({
530
- sessionCode: (_currentSession_value1 = currentSession.value) === null || _currentSession_value1 === void 0 ? void 0 : _currentSession_value1.sessionCode,
531
- content: message,
532
- role: SessionContentRole.User,
533
- status: SessionContentStatus.Success,
534
- cite
535
- });
536
- // 发送请求
537
- chatHelper.stream({
538
- sessionCode: (_currentSession_value2 = currentSession.value) === null || _currentSession_value2 === void 0 ? void 0 : _currentSession_value2.sessionCode,
539
- url: currentRequestOptions.value.url,
540
- headers: (_currentRequestOptions_value1 = currentRequestOptions.value) === null || _currentRequestOptions_value1 === void 0 ? void 0 : _currentRequestOptions_value1.headers,
541
- data: {
542
- inputs: {
543
- chat_history: prompts.value.slice(0, prompts.value.length - 1),
544
- input
545
- }
546
- }
547
- });
548
- callback === null || callback === void 0 ? void 0 : callback();
549
- }
550
577
  /**
551
578
  * 删除聊天内容
552
579
  * @param index 要删除的聊天内容索引
@@ -577,7 +604,6 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
577
604
  prompts,
578
605
  currentSessionLoading,
579
606
  chat,
580
- sendChat,
581
607
  stopChat,
582
608
  plusSessionContent,
583
609
  updateSessionContent,
@@ -590,6 +616,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
590
616
  deleteSessionContents,
591
617
  handleStartChat,
592
618
  handleErrorChat,
619
+ handleCompleteRole,
593
620
  reGenerateChat,
594
621
  reSendChat,
595
622
  deleteChat,
@@ -1,5 +1,6 @@
1
+ import { type Ref } from 'vue';
1
2
  import type { IComponent, IDatasetApi, IDatasetDataApi, IDatasetDataForm, IDatasetDataParam, IDatasetForm, IDatasetInfo, IDatasetListParam, IOperatRecordParam, ISchema, IUserInfoForm } from '@/types/dataset';
2
- export declare const useDatasetHttp: (apiPrefix?: string) => {
3
+ export declare const useDatasetHttp: (apiPrefix?: string, spaceId?: Ref<string>) => {
3
4
  getCompanyList: () => Promise<import("@/types/dataset").ICompany[]>;
4
5
  getDatasetMineInfo: () => Promise<IDatasetInfo>;
5
6
  getComponentList: () => Promise<IComponent[]>;