huaweicloud-devkit 1.0.3-dev.0 → 1.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +18 -18
- package/README.md +114 -41
- package/README.zh-CN.md +114 -41
- package/bin/setup.cjs +7 -4
- package/integrations/opencode/opencode.json +1 -4
- package/package.json +63 -42
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +51 -44
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +128 -42
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +25 -2
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +65 -47
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +134 -2
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
- package/plugins/huaweicloud-core/src/auth/service.mjs +2 -1
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +27 -8
- package/plugins/huaweicloud-core/src/icon-library.mjs +176 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +31 -3
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +73 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +123 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +14 -10
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +35 -27
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +526 -8
- package/plugins/huaweicloud-core/src/search-market.mjs +55 -16
- package/plugins/huaweicloud-core/src/setup-cli.mjs +1942 -206
- package/plugins/huaweicloud-core/src/tools.mjs +678 -131
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +13 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +268 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +11 -5
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
|
@@ -1,15 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { getProxyDispatcher } from './proxy/proxy-agent.mjs';
|
|
2
|
+
|
|
3
|
+
const INDEX_URL =
|
|
4
|
+
'https://gitcode.com/api/v5/repos/2501_91318609/skills-for-index/contents/skills-index/index.json?ref=main';
|
|
5
|
+
const CN_EN_MAP_URL =
|
|
6
|
+
'https://gitcode.com/api/v5/repos/2501_91318609/skills-for-index/contents/skills-index/cn-en-map.json?ref=main';
|
|
3
7
|
const HTTP_TIMEOUT_MS = 10000;
|
|
4
8
|
|
|
5
9
|
const GENERIC_KEYWORDS = new Set([
|
|
6
|
-
'华为云',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
10
|
+
'华为云',
|
|
11
|
+
'huawei',
|
|
12
|
+
'huawei cloud',
|
|
13
|
+
'云',
|
|
14
|
+
'cloud',
|
|
15
|
+
'技能',
|
|
16
|
+
'skill',
|
|
17
|
+
'skills',
|
|
18
|
+
'所有',
|
|
19
|
+
'all',
|
|
20
|
+
'全部',
|
|
21
|
+
'有什么',
|
|
22
|
+
'有哪些',
|
|
23
|
+
'相关',
|
|
24
|
+
'列表',
|
|
25
|
+
'list',
|
|
26
|
+
'查找',
|
|
27
|
+
'搜索',
|
|
28
|
+
'发现',
|
|
29
|
+
'浏览',
|
|
30
|
+
'find',
|
|
31
|
+
'search',
|
|
32
|
+
'discover',
|
|
33
|
+
'browse',
|
|
34
|
+
'show',
|
|
35
|
+
'explore',
|
|
36
|
+
'agent',
|
|
37
|
+
'市场',
|
|
38
|
+
'market',
|
|
39
|
+
'类目',
|
|
40
|
+
'category',
|
|
41
|
+
'安装',
|
|
42
|
+
'install',
|
|
13
43
|
]);
|
|
14
44
|
|
|
15
45
|
let cachedIndex = null;
|
|
@@ -19,18 +49,21 @@ async function fetchJson(url, label = '') {
|
|
|
19
49
|
const controller = new AbortController();
|
|
20
50
|
const timer = setTimeout(() => controller.abort(), HTTP_TIMEOUT_MS);
|
|
21
51
|
try {
|
|
22
|
-
const
|
|
52
|
+
const dispatcher = await getProxyDispatcher(url);
|
|
53
|
+
const fetchOpts = {
|
|
23
54
|
headers: { 'User-Agent': 'huaweicloud-devkit/1.0' },
|
|
24
55
|
signal: controller.signal,
|
|
25
|
-
}
|
|
56
|
+
};
|
|
57
|
+
if (dispatcher) fetchOpts.dispatcher = dispatcher;
|
|
58
|
+
const resp = await fetch(url, fetchOpts);
|
|
26
59
|
const data = await resp.json();
|
|
27
60
|
if (data && data.encoding === 'base64' && data.content) {
|
|
28
61
|
const decoded = Buffer.from(data.content, 'base64').toString('utf8');
|
|
29
62
|
return JSON.parse(decoded);
|
|
30
63
|
}
|
|
31
64
|
return data;
|
|
32
|
-
} catch (
|
|
33
|
-
throw new Error(`Failed to fetch ${label}: ${
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new Error(`Failed to fetch ${label}: ${error.message}`, { cause: error });
|
|
34
67
|
} finally {
|
|
35
68
|
clearTimeout(timer);
|
|
36
69
|
}
|
|
@@ -67,7 +100,7 @@ function expandKeywords(rawKeyword, cnEnMap) {
|
|
|
67
100
|
if (en === lower) expanded.push(cn);
|
|
68
101
|
}
|
|
69
102
|
}
|
|
70
|
-
const unique = [...new Set(expanded)].sort();
|
|
103
|
+
const unique = [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
|
|
71
104
|
const specific = unique.filter((kw) => !isGeneric(kw));
|
|
72
105
|
const generic = unique.filter((kw) => isGeneric(kw));
|
|
73
106
|
return [specific, generic];
|
|
@@ -89,7 +122,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
89
122
|
else if (triggers.some((t) => t.includes(k))) s += 8;
|
|
90
123
|
else if (descLower.includes(k)) s += 5;
|
|
91
124
|
else if (serviceLower.includes(k)) s += 3;
|
|
92
|
-
if (s > 0) {
|
|
125
|
+
if (s > 0) {
|
|
126
|
+
total += s;
|
|
127
|
+
matched.push(kw);
|
|
128
|
+
}
|
|
93
129
|
}
|
|
94
130
|
for (const kw of genericKws) {
|
|
95
131
|
const k = kw.toLowerCase();
|
|
@@ -98,7 +134,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
98
134
|
else if (triggers.some((t) => t.includes(k))) s += 4;
|
|
99
135
|
else if (descLower.includes(k)) s += 2;
|
|
100
136
|
else if (serviceLower.includes(k)) s += 1;
|
|
101
|
-
if (s > 0) {
|
|
137
|
+
if (s > 0) {
|
|
138
|
+
total += s;
|
|
139
|
+
matched.push(kw);
|
|
140
|
+
}
|
|
102
141
|
}
|
|
103
142
|
if (!specificKws.length && total === 0) {
|
|
104
143
|
total = 1;
|