@blueking/ai-ui-sdk 0.6.0-beta.14 → 0.6.0-beta.16
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 +2 -1
- package/dist/components/render-agent/agent-type.vue.css +4 -4
- package/dist/components/render-agent/agent-type.vue.js +1 -1
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-card/agent/prefix-info-tool.vue.css +5 -5
- package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
- package/dist/components/render-card/agent/upgrade.vue.css +2 -2
- package/dist/components/render-card/agent/upgrade.vue.js +1 -1
- package/dist/components/render-card/base.vue.css +13 -13
- package/dist/components/render-card/base.vue.js +1 -1
- package/dist/components/render-card/llm/corner-badge.vue.css +3 -3
- package/dist/components/render-card/llm/corner-badge.vue.js +1 -1
- package/dist/components/render-card/llm/icons.vue.css +2 -2
- package/dist/components/render-card/llm/icons.vue.js +1 -1
- package/dist/components/render-card/llm/info.vue.css +1 -1
- package/dist/components/render-card/llm/info.vue.js +1 -1
- package/dist/components/render-card/llm/tag-prefix.vue.css +2 -2
- package/dist/components/render-card/llm/tag-prefix.vue.js +1 -1
- package/dist/components/render-card/mcp/name-suffix.vue.css +2 -2
- package/dist/components/render-card/mcp/name-suffix.vue.js +1 -1
- package/dist/components/render-card/prompt/icons.vue.css +1 -1
- package/dist/components/render-card/prompt/icons.vue.js +1 -1
- 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-checkbox/index.vue.css +4 -4
- package/dist/components/render-checkbox/index.vue.js +1 -1
- package/dist/components/render-choose-tag/index.vue.css +7 -7
- package/dist/components/render-choose-tag/index.vue.js +1 -1
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-collection/content/index.vue.css +4 -4
- package/dist/components/render-collection/content/index.vue.js +1 -1
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- 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.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.vue.css +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- 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.vue.css +2 -2
- 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/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.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/review-dataset-data/index.vue.css +10 -10
- package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/index.vue.css +2 -2
- package/dist/components/render-dataset-list/index.vue.js +1 -1
- 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.vue.css +14 -14
- package/dist/components/render-dialog/choose-result.vue.js +1 -1
- package/dist/components/render-dialog/choose-space.vue.css +9 -9
- package/dist/components/render-dialog/choose-space.vue.js +1 -1
- package/dist/components/render-dialog/index.vue.css +6 -6
- package/dist/components/render-dialog/index.vue.js +1 -1
- package/dist/components/render-exception/index.vue.css +9 -9
- package/dist/components/render-exception/index.vue.js +1 -1
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +6 -6
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-generate-tag/index.vue.css +7 -7
- package/dist/components/render-generate-tag/index.vue.js +1 -1
- package/dist/components/render-knowledge/icon/index.vue.css +1 -1
- package/dist/components/render-knowledge/icon/index.vue.js +1 -1
- package/dist/components/render-prompt/content/index.vue.css +1 -1
- package/dist/components/render-prompt/content/index.vue.js +1 -1
- package/dist/components/render-reference/index.vue.css +2 -2
- package/dist/components/render-reference/index.vue.js +1 -1
- package/dist/components/render-resource-version/index.vue.css +2 -2
- package/dist/components/render-resource-version/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/components/render-select-plus-extension/index.vue.css +3 -3
- package/dist/components/render-select-plus-extension/index.vue.js +1 -1
- package/dist/components/render-skill/install/index.script.vue.js.js +34 -26
- package/dist/components/render-skill/install/{openclaw-windows-instances.script.vue.js.js → openclaw-instances.script.vue.js.js} +23 -21
- package/dist/components/render-skill/install/{openclaw-windows-instances.vue.d.ts → openclaw-instances.vue.d.ts} +6 -4
- package/dist/components/render-skill/install/openclaw-instances.vue.js +3 -0
- package/dist/components/render-t-table/index.vue.css +30 -30
- package/dist/components/render-t-table/index.vue.js +1 -1
- package/dist/components/render-tag-tree/index.vue.css +7 -7
- package/dist/components/render-tag-tree/index.vue.js +1 -1
- package/dist/components/render-tags/index.vue.css +6 -6
- package/dist/components/render-tags/index.vue.js +1 -1
- package/dist/hooks/use-form-rule.d.ts +31 -2
- package/dist/hooks/use-form-rule.ts.js +65 -26
- package/dist/hooks/use-meta-http.d.ts +6 -2
- package/dist/hooks/use-meta-http.ts.js +19 -5
- package/dist/hooks/use-skill-http.d.ts +7 -6
- package/dist/hooks/use-skill-http.ts.js +19 -17
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.ts.js +1 -0
- package/dist/http/helper/agent.ts.js +4 -2
- package/dist/http/helper/model.ts.js +5 -1
- package/dist/http/helper/skill.d.ts +9 -9
- package/dist/http/helper/skill.ts.js +12 -10
- package/dist/i18n/en-US.d.ts +3 -0
- package/dist/i18n/en-US.ts.js +3 -0
- package/dist/i18n/zh-CN.d.ts +3 -0
- package/dist/i18n/zh-CN.ts.js +3 -0
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/model.d.ts +13 -0
- package/dist/types/skill.d.ts +26 -22
- package/package.json +1 -1
- package/dist/components/render-skill/install/openclaw-windows-instances.vue.js +0 -3
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
|
|
2
|
-
.tag-container[data-v-
|
|
2
|
+
.tag-container[data-v-4e0io8m3] {
|
|
3
3
|
visibility: hidden;
|
|
4
4
|
white-space: nowrap;
|
|
5
5
|
column-gap: 4px;
|
|
6
6
|
width: calc(100% - 20px);
|
|
7
7
|
}
|
|
8
|
-
.tag-home[data-v-
|
|
8
|
+
.tag-home[data-v-4e0io8m3] {
|
|
9
9
|
vertical-align: sub;
|
|
10
10
|
flex-shrink: 0;
|
|
11
11
|
}
|
|
12
|
-
[is-show="true"][data-v-
|
|
12
|
+
[is-show="true"][data-v-4e0io8m3] {
|
|
13
13
|
visibility: visible;
|
|
14
14
|
}
|
|
15
|
-
[is-show="false"][data-v-
|
|
15
|
+
[is-show="false"][data-v-4e0io8m3] {
|
|
16
16
|
display: none !important;
|
|
17
17
|
}
|
|
18
|
-
.popover-main[data-v-
|
|
18
|
+
.popover-main[data-v-4e0io8m3] {
|
|
19
19
|
padding: 8px 8px 10px;
|
|
20
20
|
}
|
|
21
|
-
.tag-list[data-v-
|
|
21
|
+
.tag-list[data-v-4e0io8m3] {
|
|
22
22
|
border-radius: var(--aidev-radius-s);
|
|
23
23
|
background: var(--aidev-tag-background);
|
|
24
24
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import { Module } from '@/types/enum';
|
|
3
|
+
export interface IRemoteRuleOptions {
|
|
4
|
+
getData?: () => Record<string, unknown>;
|
|
5
|
+
key?: number | string;
|
|
6
|
+
}
|
|
3
7
|
export declare const useFormRule: (apiPrefix: string, spaceId?: Ref<string>) => {
|
|
4
8
|
codeRule: {
|
|
5
9
|
validator: (value: string) => boolean;
|
|
@@ -11,12 +15,22 @@ export declare const useFormRule: (apiPrefix: string, spaceId?: Ref<string>) =>
|
|
|
11
15
|
message: string;
|
|
12
16
|
trigger: string;
|
|
13
17
|
};
|
|
14
|
-
getNameRule: (type: Module) => {
|
|
18
|
+
getNameRule: (type: Module, options?: IRemoteRuleOptions) => {
|
|
15
19
|
validator: (value: string) => Promise<boolean>;
|
|
16
20
|
message: () => string;
|
|
17
21
|
trigger: string;
|
|
18
22
|
};
|
|
19
|
-
getCodeRule: (type: Module, getIsEdit?: () => boolean,
|
|
23
|
+
getCodeRule: (type: Module, getIsEdit?: () => boolean, options?: IRemoteRuleOptions) => {
|
|
24
|
+
validator: (value: string) => Promise<boolean>;
|
|
25
|
+
message: () => string;
|
|
26
|
+
trigger: string;
|
|
27
|
+
};
|
|
28
|
+
getUrlRule: (type: Module, options?: IRemoteRuleOptions) => {
|
|
29
|
+
validator: (value: string) => Promise<boolean>;
|
|
30
|
+
message: () => string;
|
|
31
|
+
trigger: string;
|
|
32
|
+
};
|
|
33
|
+
getAsyncRule: (api: (value: string) => Promise<unknown>) => {
|
|
20
34
|
validator: (value: string) => Promise<boolean>;
|
|
21
35
|
message: () => string;
|
|
22
36
|
trigger: string;
|
|
@@ -26,4 +40,19 @@ export declare const useFormRule: (apiPrefix: string, spaceId?: Ref<string>) =>
|
|
|
26
40
|
message: string;
|
|
27
41
|
trigger: string;
|
|
28
42
|
};
|
|
43
|
+
getNumberRule: () => {
|
|
44
|
+
validator: (value: string) => boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
trigger: string;
|
|
47
|
+
};
|
|
48
|
+
getPositiveNumberRule: () => {
|
|
49
|
+
validator: (value: string) => boolean;
|
|
50
|
+
message: string;
|
|
51
|
+
trigger: string;
|
|
52
|
+
};
|
|
53
|
+
getNonNegativeNumberRule: () => {
|
|
54
|
+
validator: (value: string) => boolean;
|
|
55
|
+
message: string;
|
|
56
|
+
trigger: string;
|
|
57
|
+
};
|
|
29
58
|
};
|
|
@@ -30,23 +30,39 @@ function _async_to_generator(fn) {
|
|
|
30
30
|
import { useMetaHttp } from './use-meta-http.ts.js';
|
|
31
31
|
import { t } from '../i18n/index.ts.js';
|
|
32
32
|
export const useFormRule = (apiPrefix, spaceId)=>{
|
|
33
|
-
const { nameValidator, codeValidator } = useMetaHttp(apiPrefix, spaceId);
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
const { nameValidator, codeValidator, urlValidator } = useMetaHttp(apiPrefix, spaceId);
|
|
34
|
+
let asyncErrorMessage = '';
|
|
35
|
+
const remoteRuleStates = new Map();
|
|
36
|
+
const getRemoteRuleState = (stateKey)=>{
|
|
37
|
+
if (!remoteRuleStates.has(stateKey)) {
|
|
38
|
+
remoteRuleStates.set(stateKey, {
|
|
39
|
+
controller: null,
|
|
40
|
+
errorMessage: ''
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return remoteRuleStates.get(stateKey);
|
|
40
44
|
};
|
|
41
|
-
const
|
|
45
|
+
const createRemoteRule = (kind, validator, type, { getData, key = 'default' } = {}, getIsSkip)=>{
|
|
46
|
+
const state = getRemoteRuleState(`${kind}:${type}:${key}`);
|
|
47
|
+
return {
|
|
42
48
|
validator: function() {
|
|
43
49
|
var _ref = _async_to_generator(function*(value) {
|
|
50
|
+
var _state_controller;
|
|
51
|
+
if (getIsSkip === null || getIsSkip === void 0 ? void 0 : getIsSkip()) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
(_state_controller = state.controller) === null || _state_controller === void 0 ? void 0 : _state_controller.abort();
|
|
55
|
+
const current = new AbortController();
|
|
56
|
+
state.controller = current;
|
|
44
57
|
try {
|
|
45
|
-
|
|
46
|
-
const res = yield
|
|
58
|
+
state.errorMessage = '';
|
|
59
|
+
const res = yield validator(value, type, getData === null || getData === void 0 ? void 0 : getData(), current.signal)();
|
|
47
60
|
return res.data;
|
|
48
61
|
} catch (error) {
|
|
49
|
-
|
|
62
|
+
if (state.controller !== current) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
state.errorMessage = error.message;
|
|
50
66
|
return false;
|
|
51
67
|
}
|
|
52
68
|
});
|
|
@@ -54,24 +70,27 @@ export const useFormRule = (apiPrefix, spaceId)=>{
|
|
|
54
70
|
return _ref.apply(this, arguments);
|
|
55
71
|
};
|
|
56
72
|
}(),
|
|
57
|
-
message: ()=>
|
|
73
|
+
message: ()=>state.errorMessage,
|
|
58
74
|
trigger: 'change'
|
|
59
|
-
}
|
|
60
|
-
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const codeRule = {
|
|
78
|
+
validator: (value)=>/^[a-zA-Z0-9-]+$/.test(value),
|
|
79
|
+
message: t('需要是英文字符、数字、中划线'),
|
|
80
|
+
trigger: 'change'
|
|
81
|
+
};
|
|
82
|
+
const getNameRule = (type, options)=>createRemoteRule('name', nameValidator, type, options);
|
|
83
|
+
// 编辑态不校验code
|
|
84
|
+
const getCodeRule = (type, getIsEdit, options)=>createRemoteRule('code', codeValidator, type, options, getIsEdit);
|
|
85
|
+
const getUrlRule = (type, options)=>createRemoteRule('url', urlValidator, type, options);
|
|
86
|
+
const getAsyncRule = (api)=>({
|
|
61
87
|
validator: function() {
|
|
62
88
|
var _ref = _async_to_generator(function*(value) {
|
|
63
89
|
try {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const isEdit = getIsEdit === null || getIsEdit === void 0 ? void 0 : getIsEdit();
|
|
67
|
-
if (isEdit) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
// 新建态校验code
|
|
71
|
-
const res = yield codeValidator(value, type, getData === null || getData === void 0 ? void 0 : getData())();
|
|
72
|
-
return res.data;
|
|
90
|
+
asyncErrorMessage = '';
|
|
91
|
+
yield api(value);
|
|
73
92
|
} catch (error) {
|
|
74
|
-
|
|
93
|
+
asyncErrorMessage = error.message;
|
|
75
94
|
return false;
|
|
76
95
|
}
|
|
77
96
|
});
|
|
@@ -79,7 +98,7 @@ export const useFormRule = (apiPrefix, spaceId)=>{
|
|
|
79
98
|
return _ref.apply(this, arguments);
|
|
80
99
|
};
|
|
81
100
|
}(),
|
|
82
|
-
message: ()=>
|
|
101
|
+
message: ()=>asyncErrorMessage,
|
|
83
102
|
trigger: 'change'
|
|
84
103
|
});
|
|
85
104
|
const getLengthRule = (label, num)=>({
|
|
@@ -95,11 +114,31 @@ export const useFormRule = (apiPrefix, spaceId)=>{
|
|
|
95
114
|
message: t('需要是http://或者https://开头的字符串'),
|
|
96
115
|
trigger: 'change'
|
|
97
116
|
});
|
|
117
|
+
const getNumberRule = ()=>({
|
|
118
|
+
validator: (value)=>!isNaN(+value),
|
|
119
|
+
message: t('需要是数字'),
|
|
120
|
+
trigger: 'change'
|
|
121
|
+
});
|
|
122
|
+
const getPositiveNumberRule = ()=>({
|
|
123
|
+
validator: (value)=>!isNaN(+value) && +value > 0,
|
|
124
|
+
message: t('需要是正数'),
|
|
125
|
+
trigger: 'change'
|
|
126
|
+
});
|
|
127
|
+
const getNonNegativeNumberRule = ()=>({
|
|
128
|
+
validator: (value)=>!isNaN(+value) && +value >= 0,
|
|
129
|
+
message: t('不能是负数'),
|
|
130
|
+
trigger: 'change'
|
|
131
|
+
});
|
|
98
132
|
return {
|
|
99
133
|
codeRule,
|
|
100
134
|
getApiUrlRule,
|
|
101
135
|
getNameRule,
|
|
102
136
|
getCodeRule,
|
|
103
|
-
|
|
137
|
+
getUrlRule,
|
|
138
|
+
getAsyncRule,
|
|
139
|
+
getLengthRule,
|
|
140
|
+
getNumberRule,
|
|
141
|
+
getPositiveNumberRule,
|
|
142
|
+
getNonNegativeNumberRule
|
|
104
143
|
};
|
|
105
144
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import { Module } from '@/types/enum';
|
|
3
3
|
export declare const useMetaHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
|
|
4
|
-
nameValidator: (name: string, type: Module) => () => Promise<{
|
|
4
|
+
nameValidator: (name: string, type: Module, data?: Record<string, unknown>, signal?: AbortSignal) => () => Promise<{
|
|
5
5
|
data: boolean;
|
|
6
6
|
message: string;
|
|
7
7
|
}>;
|
|
8
|
-
codeValidator: (code: string, type: Module, data?: Record<string, unknown
|
|
8
|
+
codeValidator: (code: string, type: Module, data?: Record<string, unknown>, signal?: AbortSignal) => () => Promise<{
|
|
9
|
+
data: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
urlValidator: (url: string, type: Module, data?: Record<string, unknown>, signal?: AbortSignal) => () => Promise<{
|
|
9
13
|
data: boolean;
|
|
10
14
|
message: string;
|
|
11
15
|
}>;
|
|
@@ -31,24 +31,37 @@ import { transferTagApi2Tag } from '../http/helper/meta.ts.js';
|
|
|
31
31
|
const metaPerfix = 'meta/v1';
|
|
32
32
|
export const useMetaHttp = (apiPrefix, spaceId)=>{
|
|
33
33
|
// 名称校验
|
|
34
|
-
const nameValidator = (name, type)=>()=>fetch.get(`${apiPrefix}/${metaPerfix}/name_valid/`, {
|
|
34
|
+
const nameValidator = (name, type, data, signal)=>()=>fetch.get(`${apiPrefix}/${metaPerfix}/name_valid/`, _object_spread({
|
|
35
35
|
name,
|
|
36
36
|
type
|
|
37
|
-
}, {
|
|
37
|
+
}, data), {
|
|
38
38
|
globalError: false,
|
|
39
39
|
headers: {
|
|
40
40
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
signal
|
|
42
43
|
});
|
|
43
44
|
// code校验
|
|
44
|
-
const codeValidator = (code, type, data)=>()=>fetch.get(`${apiPrefix}/${metaPerfix}/code_valid/`, _object_spread({
|
|
45
|
+
const codeValidator = (code, type, data, signal)=>()=>fetch.get(`${apiPrefix}/${metaPerfix}/code_valid/`, _object_spread({
|
|
45
46
|
code,
|
|
46
47
|
type
|
|
47
48
|
}, data), {
|
|
48
49
|
globalError: false,
|
|
49
50
|
headers: {
|
|
50
51
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
51
|
-
}
|
|
52
|
+
},
|
|
53
|
+
signal
|
|
54
|
+
});
|
|
55
|
+
// url校验
|
|
56
|
+
const urlValidator = (url, type, data, signal)=>()=>fetch.post(`${apiPrefix}/${metaPerfix}/url_valid/`, _object_spread({
|
|
57
|
+
url,
|
|
58
|
+
type
|
|
59
|
+
}, data), {
|
|
60
|
+
globalError: false,
|
|
61
|
+
headers: {
|
|
62
|
+
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
63
|
+
},
|
|
64
|
+
signal
|
|
52
65
|
});
|
|
53
66
|
// 获取tag列表
|
|
54
67
|
const getTags = (module)=>fetch.get(`${apiPrefix}/${metaPerfix}/tag/`, {
|
|
@@ -81,6 +94,7 @@ export const useMetaHttp = (apiPrefix, spaceId)=>{
|
|
|
81
94
|
return {
|
|
82
95
|
nameValidator,
|
|
83
96
|
codeValidator,
|
|
97
|
+
urlValidator,
|
|
84
98
|
getTags,
|
|
85
99
|
plusTag,
|
|
86
100
|
checkTag
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { IFetchConfig } from '@/http/fetch';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SkillInstallTargetType } from '@/types/enum';
|
|
4
|
+
import type { ISkillApi, ISkillCountParam, ISkillInstallGuide, ISkillListParam, ISkillOpenclawInstallParam, ISkillOpenclawInstallTaskStatusParam, ISkillOpenclawInstanceStatusParam } from '@/types/skill';
|
|
4
5
|
export declare const useSkillHttp: (apiPrefix: string, spaceId?: Ref<string>) => {
|
|
5
6
|
getSkillList: {
|
|
6
7
|
(param: ISkillListParam, config?: IFetchConfig): Promise<import("@/types/common").IPaginationResponse<import("@/types/skill").ISkill>>;
|
|
@@ -18,11 +19,11 @@ export declare const useSkillHttp: (apiPrefix: string, spaceId?: Ref<string>) =>
|
|
|
18
19
|
markdown: string;
|
|
19
20
|
}>;
|
|
20
21
|
getSkillInstallTargets: () => Promise<import("@/types/skill").ISkillInstallTarget[]>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(data:
|
|
22
|
+
getSkillOpenclawInstances: (targetType?: SkillInstallTargetType) => Promise<import("@/types/skill").ISkillOpenclawInstance[]>;
|
|
23
|
+
getSkillOpenclawInstancesStatus: (data: ISkillOpenclawInstanceStatusParam) => Promise<import("@/types/skill").ISkillOpenclawInstanceStatusMap>;
|
|
24
|
+
installSkillToOpenclaw: (data: ISkillOpenclawInstallParam) => Promise<import("@/types/skill").ISkillOpenclawInstallTasks>;
|
|
25
|
+
getSkillOpenclawInstallTasksStatus: {
|
|
26
|
+
(data: ISkillOpenclawInstallTaskStatusParam): Promise<import("@/types/skill").ISkillOpenclawInstallTaskStatusMap>;
|
|
26
27
|
abort(): void;
|
|
27
28
|
};
|
|
28
29
|
getSkillBuildLog: {
|
|
@@ -51,7 +51,7 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import fetch, { withAbort } from '../http/fetch/index.ts.js';
|
|
54
|
-
import { transferSkillApi2Skill, transferSkillBuildLogApi2SkillBuildLog, transferSkillCount2SkillCountApi, transferSkillInstallGuide2SkillInstallGuideApi, transferSkillInstallTargetApi2SkillInstallTarget,
|
|
54
|
+
import { transferSkillApi2Skill, transferSkillBuildLogApi2SkillBuildLog, transferSkillCount2SkillCountApi, transferSkillInstallGuide2SkillInstallGuideApi, transferSkillInstallTargetApi2SkillInstallTarget, transferSkillOpenclawInstallParam2SkillOpenclawInstallParamApi, transferSkillOpenclawInstallTasksApi2SkillOpenclawInstallTasks, transferSkillOpenclawInstallTaskStatusMapApi2SkillOpenclawInstallTaskStatusMap, transferSkillOpenclawInstallTaskStatusParam2SkillOpenclawInstallTaskStatusParamApi, transferSkillOpenclawInstanceApi2SkillOpenclawInstance, transferSkillOpenclawInstanceStatusMapApi2SkillOpenclawInstanceStatusMap, transferSkillOpenclawInstanceStatusParam2SkillOpenclawInstanceStatusParamApi } from '../http/helper/skill.ts.js';
|
|
55
55
|
import { transferPaginationResponseApi2PaginationResponse, transferReferringAgentApi2ReferringAgent, transferResourceCountApi2ResourceCount, transferSkillParam2SkillParamApi } from '../transforms.ts.js';
|
|
56
56
|
export const useSkillHttp = (apiPrefix, spaceId)=>{
|
|
57
57
|
// 获取 Skill 列表
|
|
@@ -105,31 +105,33 @@ export const useSkillHttp = (apiPrefix, spaceId)=>{
|
|
|
105
105
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
106
106
|
}
|
|
107
107
|
}).then((data)=>data.map(transferSkillInstallTargetApi2SkillInstallTarget));
|
|
108
|
-
//
|
|
109
|
-
const
|
|
108
|
+
// 获取云桌面实例列表
|
|
109
|
+
const getSkillOpenclawInstances = (targetType)=>fetch.get(`${apiPrefix}/skill/v1/openclaw_windows/instances/`, {
|
|
110
|
+
target_type: targetType
|
|
111
|
+
}, {
|
|
110
112
|
headers: {
|
|
111
113
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
112
114
|
}
|
|
113
|
-
}).then((data)=>data.map(
|
|
114
|
-
//
|
|
115
|
-
const
|
|
115
|
+
}).then((data)=>data.map(transferSkillOpenclawInstanceApi2SkillOpenclawInstance));
|
|
116
|
+
// 查询云桌面实例安装状态
|
|
117
|
+
const getSkillOpenclawInstancesStatus = (data)=>fetch.post(`${apiPrefix}/skill/v1/openclaw_windows/check_install_on_instances/`, transferSkillOpenclawInstanceStatusParam2SkillOpenclawInstanceStatusParamApi(data), {
|
|
116
118
|
headers: {
|
|
117
119
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
118
120
|
}
|
|
119
|
-
}).then(
|
|
120
|
-
// 发起 Skill
|
|
121
|
-
const
|
|
121
|
+
}).then(transferSkillOpenclawInstanceStatusMapApi2SkillOpenclawInstanceStatusMap);
|
|
122
|
+
// 发起 Skill 云桌面安装任务
|
|
123
|
+
const installSkillToOpenclaw = (data)=>fetch.post(`${apiPrefix}/skill/v1/openclaw_windows/install/`, transferSkillOpenclawInstallParam2SkillOpenclawInstallParamApi(data), {
|
|
122
124
|
headers: {
|
|
123
125
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
124
126
|
}
|
|
125
|
-
}).then(
|
|
126
|
-
// 查询 Skill
|
|
127
|
-
const
|
|
127
|
+
}).then(transferSkillOpenclawInstallTasksApi2SkillOpenclawInstallTasks);
|
|
128
|
+
// 查询 Skill 云桌面安装任务状态
|
|
129
|
+
const getSkillOpenclawInstallTasksStatus = withAbort((signal, data)=>fetch.post(`${apiPrefix}/skill/v1/openclaw_windows/install_tasks_status/`, transferSkillOpenclawInstallTaskStatusParam2SkillOpenclawInstallTaskStatusParamApi(data), {
|
|
128
130
|
headers: {
|
|
129
131
|
'x-space-id': spaceId === null || spaceId === void 0 ? void 0 : spaceId.value
|
|
130
132
|
},
|
|
131
133
|
signal
|
|
132
|
-
}).then(
|
|
134
|
+
}).then(transferSkillOpenclawInstallTaskStatusMapApi2SkillOpenclawInstallTaskStatusMap));
|
|
133
135
|
// 获取 Skill 构建日志
|
|
134
136
|
const getSkillBuildLog = withAbort((signal, id, version)=>fetch.get(`${apiPrefix}/skill/v1/skill/${id}/build_log/`, {
|
|
135
137
|
version
|
|
@@ -160,10 +162,10 @@ export const useSkillHttp = (apiPrefix, spaceId)=>{
|
|
|
160
162
|
restoreSkill,
|
|
161
163
|
getSkillInstallGuide,
|
|
162
164
|
getSkillInstallTargets,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
getSkillOpenclawInstances,
|
|
166
|
+
getSkillOpenclawInstancesStatus,
|
|
167
|
+
installSkillToOpenclaw,
|
|
168
|
+
getSkillOpenclawInstallTasksStatus,
|
|
167
169
|
getSkillBuildLog,
|
|
168
170
|
addSkillFavorite,
|
|
169
171
|
removeSkillFavorite
|
package/dist/hooks.d.ts
CHANGED
package/dist/hooks.ts.js
CHANGED
|
@@ -180,7 +180,8 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
|
|
|
180
180
|
context_window: data.promptSetting.contextWindow,
|
|
181
181
|
llm_token_limit: data.promptSetting.llmTokenLimit,
|
|
182
182
|
max_tokens: data.promptSetting.maxTokens,
|
|
183
|
-
tool_output_compress_thrd: data.promptSetting.toolOutputCompressThrd
|
|
183
|
+
tool_output_compress_thrd: data.promptSetting.toolOutputCompressThrd,
|
|
184
|
+
reasoning_effort: data.promptSetting.reasoningEffort
|
|
184
185
|
} : undefined,
|
|
185
186
|
knowledgebase_settings: data.knowledgebaseSettings ? _object_spread({
|
|
186
187
|
knowledgebases: data.knowledgebaseSettings.knowledgebases.map(transferKnowledgebase)
|
|
@@ -249,7 +250,8 @@ import { transferTool2ToolApi, transferToolApi2Tool } from './tool.ts.js';
|
|
|
249
250
|
contextWindow: data.prompt_setting.context_window,
|
|
250
251
|
llmTokenLimit: data.prompt_setting.llm_token_limit,
|
|
251
252
|
maxTokens: data.prompt_setting.max_tokens,
|
|
252
|
-
toolOutputCompressThrd: data.prompt_setting.tool_output_compress_thrd
|
|
253
|
+
toolOutputCompressThrd: data.prompt_setting.tool_output_compress_thrd,
|
|
254
|
+
reasoningEffort: data.prompt_setting.reasoning_effort
|
|
253
255
|
} : undefined,
|
|
254
256
|
knowledgebaseSettings: data.knowledgebase_settings ? _object_spread({
|
|
255
257
|
knowledgebases: data.knowledgebase_settings.knowledgebases.map(transferKnowledgebaseApi)
|
|
@@ -29,7 +29,11 @@ export const transferModelApi2Model = (data)=>({
|
|
|
29
29
|
supportThinkingQuick: data.property.support_thinking_quick,
|
|
30
30
|
default: data.property.default,
|
|
31
31
|
isSelfHost: data.property.is_self_host,
|
|
32
|
-
maxModelLen: data.property.max_model_len
|
|
32
|
+
maxModelLen: data.property.max_model_len,
|
|
33
|
+
reasoning: data.property.reasoning ? {
|
|
34
|
+
supportedEfforts: data.property.reasoning.supported_efforts,
|
|
35
|
+
defaultEffort: data.property.reasoning.default_effort
|
|
36
|
+
} : undefined
|
|
33
37
|
} : undefined,
|
|
34
38
|
hyperparameters: data.hyperparameters ? {
|
|
35
39
|
temperature: data.hyperparameters.temperature,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ISkill, ISkillApi, ISkillBuildLog, ISkillBuildLogApi, ISkillCountParam, ISkillCountParamApi, ISkillForm, ISkillFormApi, ISkillInstallGuide, ISkillInstallGuideApi, ISkillInstallTarget, ISkillInstallTargetApi, ISkillListParam, ISkillListParamApi,
|
|
1
|
+
import type { ISkill, ISkillApi, ISkillBuildLog, ISkillBuildLogApi, ISkillCountParam, ISkillCountParamApi, ISkillForm, ISkillFormApi, ISkillInstallGuide, ISkillInstallGuideApi, ISkillInstallTarget, ISkillInstallTargetApi, ISkillListParam, ISkillListParamApi, ISkillOpenclawInstallParam, ISkillOpenclawInstallParamApi, ISkillOpenclawInstallTasks, ISkillOpenclawInstallTasksApi, ISkillOpenclawInstallTaskStatusMap, ISkillOpenclawInstallTaskStatusMapApi, ISkillOpenclawInstallTaskStatusParam, ISkillOpenclawInstallTaskStatusParamApi, ISkillOpenclawInstance, ISkillOpenclawInstanceApi, ISkillOpenclawInstanceStatusMap, ISkillOpenclawInstanceStatusMapApi, ISkillOpenclawInstanceStatusParam, ISkillOpenclawInstanceStatusParamApi } from '@/types/skill';
|
|
2
2
|
/**
|
|
3
3
|
* ui转换为接口使用(表单字段)
|
|
4
4
|
* @param data ISkillForm
|
|
@@ -38,11 +38,11 @@ export declare const transferSkillBuildLogApi2SkillBuildLog: (data: ISkillBuildL
|
|
|
38
38
|
export declare const transferSkillParam2SkillParamApi: (data: ISkillListParam) => ISkillListParamApi;
|
|
39
39
|
export declare const transferSkillInstallGuide2SkillInstallGuideApi: (data: ISkillInstallGuide) => ISkillInstallGuideApi;
|
|
40
40
|
export declare const transferSkillInstallTargetApi2SkillInstallTarget: (data: ISkillInstallTargetApi) => ISkillInstallTarget;
|
|
41
|
-
export declare const
|
|
42
|
-
export declare const
|
|
43
|
-
export declare const
|
|
44
|
-
export declare const
|
|
45
|
-
export declare const
|
|
46
|
-
export declare const
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
41
|
+
export declare const transferSkillOpenclawInstanceApi2SkillOpenclawInstance: (data: ISkillOpenclawInstanceApi) => ISkillOpenclawInstance;
|
|
42
|
+
export declare const transferSkillOpenclawInstance2SkillOpenclawInstanceApi: (data: ISkillOpenclawInstance) => ISkillOpenclawInstanceApi;
|
|
43
|
+
export declare const transferSkillOpenclawInstallParam2SkillOpenclawInstallParamApi: (data: ISkillOpenclawInstallParam) => ISkillOpenclawInstallParamApi;
|
|
44
|
+
export declare const transferSkillOpenclawInstallTasksApi2SkillOpenclawInstallTasks: (data: ISkillOpenclawInstallTasksApi) => ISkillOpenclawInstallTasks;
|
|
45
|
+
export declare const transferSkillOpenclawInstallTaskStatusParam2SkillOpenclawInstallTaskStatusParamApi: (data: ISkillOpenclawInstallTaskStatusParam) => ISkillOpenclawInstallTaskStatusParamApi;
|
|
46
|
+
export declare const transferSkillOpenclawInstallTaskStatusMapApi2SkillOpenclawInstallTaskStatusMap: (data: ISkillOpenclawInstallTaskStatusMapApi) => ISkillOpenclawInstallTaskStatusMap;
|
|
47
|
+
export declare const transferSkillOpenclawInstanceStatusParam2SkillOpenclawInstanceStatusParamApi: (data: ISkillOpenclawInstanceStatusParam) => ISkillOpenclawInstanceStatusParamApi;
|
|
48
|
+
export declare const transferSkillOpenclawInstanceStatusMapApi2SkillOpenclawInstanceStatusMap: (data: ISkillOpenclawInstanceStatusMapApi) => ISkillOpenclawInstanceStatusMap;
|
|
@@ -174,21 +174,22 @@ export const transferSkillInstallTargetApi2SkillInstallTarget = (data)=>({
|
|
|
174
174
|
targetType: data.target_type,
|
|
175
175
|
displayName: data.display_name
|
|
176
176
|
});
|
|
177
|
-
export const
|
|
177
|
+
export const transferSkillOpenclawInstanceApi2SkillOpenclawInstance = (data)=>({
|
|
178
178
|
displayName: data.display_name,
|
|
179
179
|
hostName: data.host_name,
|
|
180
180
|
hostDescription: data.host_description
|
|
181
181
|
});
|
|
182
|
-
export const
|
|
182
|
+
export const transferSkillOpenclawInstance2SkillOpenclawInstanceApi = (data)=>({
|
|
183
183
|
display_name: data.displayName,
|
|
184
184
|
host_name: data.hostName,
|
|
185
185
|
host_description: data.hostDescription
|
|
186
186
|
});
|
|
187
|
-
export const
|
|
187
|
+
export const transferSkillOpenclawInstallParam2SkillOpenclawInstallParamApi = (data)=>({
|
|
188
188
|
skill_id: data.skillId,
|
|
189
|
-
workspaces: data.workspaces.map(
|
|
189
|
+
workspaces: data.workspaces.map(transferSkillOpenclawInstance2SkillOpenclawInstanceApi),
|
|
190
|
+
target_type: data.targetType
|
|
190
191
|
});
|
|
191
|
-
export const
|
|
192
|
+
export const transferSkillOpenclawInstallTasksApi2SkillOpenclawInstallTasks = (data)=>{
|
|
192
193
|
return Object.entries(data).reduce((result, [hostName, task])=>_object_spread_props(_object_spread({}, result), {
|
|
193
194
|
[hostName]: {
|
|
194
195
|
taskId: task.task_id,
|
|
@@ -196,10 +197,10 @@ export const transferSkillOpenclawWindowsInstallTasksApi2SkillOpenclawWindowsIns
|
|
|
196
197
|
}
|
|
197
198
|
}), {});
|
|
198
199
|
};
|
|
199
|
-
export const
|
|
200
|
+
export const transferSkillOpenclawInstallTaskStatusParam2SkillOpenclawInstallTaskStatusParamApi = (data)=>({
|
|
200
201
|
task_ids: data.taskIds
|
|
201
202
|
});
|
|
202
|
-
export const
|
|
203
|
+
export const transferSkillOpenclawInstallTaskStatusMapApi2SkillOpenclawInstallTaskStatusMap = (data)=>{
|
|
203
204
|
return Object.entries(data).reduce((result, [taskId, task])=>_object_spread_props(_object_spread({}, result), {
|
|
204
205
|
[taskId]: {
|
|
205
206
|
status: task.status,
|
|
@@ -207,11 +208,12 @@ export const transferSkillOpenclawWindowsInstallTaskStatusMapApi2SkillOpenclawWi
|
|
|
207
208
|
}
|
|
208
209
|
}), {});
|
|
209
210
|
};
|
|
210
|
-
export const
|
|
211
|
+
export const transferSkillOpenclawInstanceStatusParam2SkillOpenclawInstanceStatusParamApi = (data)=>({
|
|
211
212
|
skill_id: data.skillId,
|
|
212
|
-
workspaces: data.workspaces.map(
|
|
213
|
+
workspaces: data.workspaces.map(transferSkillOpenclawInstance2SkillOpenclawInstanceApi),
|
|
214
|
+
target_type: data.targetType
|
|
213
215
|
});
|
|
214
|
-
export const
|
|
216
|
+
export const transferSkillOpenclawInstanceStatusMapApi2SkillOpenclawInstanceStatusMap = (data)=>{
|
|
215
217
|
return Object.entries(data).reduce((result, [hostName, status])=>_object_spread_props(_object_spread({}, result), {
|
|
216
218
|
[hostName]: {
|
|
217
219
|
isInstalled: status.is_installed
|
package/dist/i18n/en-US.d.ts
CHANGED
|
@@ -365,6 +365,9 @@ declare const _default: {
|
|
|
365
365
|
'\u9700\u8981\u662F\u82F1\u6587\u5B57\u7B26\u3001\u6570\u5B57\u3001\u4E2D\u5212\u7EBF': string;
|
|
366
366
|
'{label}\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7{num}': string;
|
|
367
367
|
'\u9700\u8981\u662Fhttp://\u6216\u8005https://\u5F00\u5934\u7684\u5B57\u7B26\u4E32': string;
|
|
368
|
+
需要是数字: string;
|
|
369
|
+
需要是正数: string;
|
|
370
|
+
不能是负数: string;
|
|
368
371
|
系统错误: string;
|
|
369
372
|
};
|
|
370
373
|
export default _default;
|
package/dist/i18n/en-US.ts.js
CHANGED
|
@@ -365,5 +365,8 @@ export default {
|
|
|
365
365
|
'需要是英文字符、数字、中划线': 'Must contain only English letters, digits, and hyphens',
|
|
366
366
|
'{label}长度不能超过{num}': '{label} cannot exceed {num} characters',
|
|
367
367
|
'需要是http://或者https://开头的字符串': 'Must start with http:// or https://',
|
|
368
|
+
需要是数字: 'Must be a number',
|
|
369
|
+
需要是正数: 'Must be a positive number',
|
|
370
|
+
不能是负数: 'Cannot be negative',
|
|
368
371
|
系统错误: 'System Error'
|
|
369
372
|
};
|
package/dist/i18n/zh-CN.d.ts
CHANGED
|
@@ -365,6 +365,9 @@ declare const _default: {
|
|
|
365
365
|
'\u9700\u8981\u662F\u82F1\u6587\u5B57\u7B26\u3001\u6570\u5B57\u3001\u4E2D\u5212\u7EBF': string;
|
|
366
366
|
'{label}\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7{num}': string;
|
|
367
367
|
'\u9700\u8981\u662Fhttp://\u6216\u8005https://\u5F00\u5934\u7684\u5B57\u7B26\u4E32': string;
|
|
368
|
+
需要是数字: string;
|
|
369
|
+
需要是正数: string;
|
|
370
|
+
不能是负数: string;
|
|
368
371
|
系统错误: string;
|
|
369
372
|
};
|
|
370
373
|
export default _default;
|
package/dist/i18n/zh-CN.ts.js
CHANGED
package/dist/types/agent.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export interface IAgentFormApi extends IResourceFormCommonApi {
|
|
|
123
123
|
llm_token_limit?: number;
|
|
124
124
|
max_tokens?: number;
|
|
125
125
|
tool_output_compress_thrd?: number;
|
|
126
|
+
reasoning_effort?: string;
|
|
126
127
|
};
|
|
127
128
|
knowledgebase_settings?: {
|
|
128
129
|
knowledgebases: IKnowledgebaseApi[];
|
|
@@ -184,6 +185,7 @@ export interface IAgentForm extends IResourceFormCommon {
|
|
|
184
185
|
llmTokenLimit?: number;
|
|
185
186
|
maxTokens?: number;
|
|
186
187
|
toolOutputCompressThrd?: number;
|
|
188
|
+
reasoningEffort?: string;
|
|
187
189
|
};
|
|
188
190
|
knowledgebaseSettings?: {
|
|
189
191
|
knowledgebases: IKnowledgebase[];
|
package/dist/types/model.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { LLMSupport, ModelSpaceAuthMode } from '@/types/enum';
|
|
2
|
+
export interface IReasoningEffort {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
desc?: string;
|
|
6
|
+
}
|
|
2
7
|
export interface IModel {
|
|
3
8
|
llmCode: string;
|
|
4
9
|
llmName: string;
|
|
@@ -31,6 +36,10 @@ export interface IModel {
|
|
|
31
36
|
default?: boolean;
|
|
32
37
|
isSelfHost?: boolean;
|
|
33
38
|
maxModelLen?: number;
|
|
39
|
+
reasoning?: {
|
|
40
|
+
supportedEfforts: IReasoningEffort[];
|
|
41
|
+
defaultEffort?: string;
|
|
42
|
+
};
|
|
34
43
|
};
|
|
35
44
|
hyperparameters?: {
|
|
36
45
|
temperature?: {
|
|
@@ -92,6 +101,10 @@ export interface IModelApi {
|
|
|
92
101
|
default?: boolean;
|
|
93
102
|
is_self_host?: boolean;
|
|
94
103
|
max_model_len?: number;
|
|
104
|
+
reasoning?: {
|
|
105
|
+
supported_efforts: IReasoningEffort[];
|
|
106
|
+
default_effort?: string;
|
|
107
|
+
};
|
|
95
108
|
};
|
|
96
109
|
hyperparameters?: {
|
|
97
110
|
temperature?: {
|