huaweicloud-devkit 1.1.2-next.0 → 1.1.2-next.2
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 +182 -38
- package/README.zh-CN.md +180 -36
- package/bin/dsh-postinstall.cjs +77 -0
- package/bin/setup.cjs +7 -4
- package/cordis.patch.yml +13 -0
- package/integrations/atomcode/hooks/huaweicloud-telemetry.js +181 -0
- package/integrations/atomcode/hooks.json +9 -0
- package/integrations/dsh/hook-plugin.mjs +148 -0
- package/integrations/hermes/hooks/huaweicloud-telemetry.py +238 -0
- package/integrations/hermes/manifest.yaml +43 -0
- package/integrations/opencode/hooks/skill-tracker.js +115 -0
- package/integrations/opencode/opencode.json +1 -4
- package/integrations/workbuddy/hooks/telemetry-tracker.py +226 -0
- package/package.json +74 -43
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +23 -33
- 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/assets/icon.png +0 -0
- package/plugins/huaweicloud-core/assets/logo-dark.png +0 -0
- package/plugins/huaweicloud-core/assets/logo.png +0 -0
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +104 -28
- 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 +196 -35
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +38 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +38 -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 +40 -31
- 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 +45 -37
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +57 -6
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +27 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +44 -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-iac/SKILL.md +93 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/architectures.md +83 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +107 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/state-file.md +104 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +30 -30
- 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 +46 -45
- 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 +71 -61
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +776 -44
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +84 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +100 -0
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +36 -29
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +57 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +22 -15
- 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 +23 -20
- 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 +21 -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 +30 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +68 -54
- 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 +36 -34
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +142 -5
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +217 -5
- package/plugins/huaweicloud-core/src/auth/reconcile.mjs +174 -0
- package/plugins/huaweicloud-core/src/auth/service.mjs +57 -2
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/detect-framework.mjs +366 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +203 -16
- package/plugins/huaweicloud-core/src/icon-library.mjs +176 -0
- package/plugins/huaweicloud-core/src/mcp-protocol.mjs +88 -0
- package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +107 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +154 -99
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +20 -102
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +11 -4
- 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 +48 -12
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +25 -26
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +943 -10
- package/plugins/huaweicloud-core/src/sandbox/uninstall-cleanup.mjs +50 -0
- package/plugins/huaweicloud-core/src/search-market.mjs +49 -14
- package/plugins/huaweicloud-core/src/setup-cli.mjs +3091 -498
- package/plugins/huaweicloud-core/src/telemetry/agent-detect.mjs +40 -0
- package/plugins/huaweicloud-core/src/telemetry/agent-registry.mjs +328 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry.mjs +378 -0
- package/plugins/huaweicloud-core/src/tools.mjs +1272 -146
- package/plugins/huaweicloud-core/src/update-check.mjs +383 -0
- 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 +40 -13
- 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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { existsSync, readdirSync, rmSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
|
|
5
|
+
import { obsConfigPath } from '../auth/credentials.mjs';
|
|
6
|
+
|
|
7
|
+
// Remove the KooCLI (hcloud) binary and its config directory. Only touches the
|
|
8
|
+
// default install locations; a user-managed binary behind HCLOUD_BIN or a
|
|
9
|
+
// Windows PATH entry is left alone. Returns the list of removed paths.
|
|
10
|
+
export function removeKooCli(home = homedir()) {
|
|
11
|
+
const removed = [];
|
|
12
|
+
|
|
13
|
+
for (const bin of [
|
|
14
|
+
join(home, '.local', 'bin', 'hcloud'),
|
|
15
|
+
join(home, 'hcloud', 'hcloud'),
|
|
16
|
+
join(home, 'hcloud', 'hcloud.exe'),
|
|
17
|
+
]) {
|
|
18
|
+
if (existsSync(bin)) {
|
|
19
|
+
rmSync(bin, { force: true });
|
|
20
|
+
removed.push(bin);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const configDir = join(home, '.hcloud');
|
|
25
|
+
if (existsSync(configDir)) {
|
|
26
|
+
rmSync(configDir, { recursive: true, force: true });
|
|
27
|
+
removed.push(configDir);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const installDir = join(home, 'hcloud');
|
|
31
|
+
try {
|
|
32
|
+
if (existsSync(installDir) && readdirSync(installDir).length === 0) {
|
|
33
|
+
rmSync(installDir, { recursive: true, force: true });
|
|
34
|
+
removed.push(installDir);
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// Non-fatal: an empty-dir cleanup is best-effort.
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return removed;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Remove the OBS credential config (~/.obsutilconfig). Returns the removed
|
|
44
|
+
// path, or an empty array when the file did not exist.
|
|
45
|
+
export function removeObsConfig() {
|
|
46
|
+
const p = obsConfigPath();
|
|
47
|
+
if (!existsSync(p)) return [];
|
|
48
|
+
rmSync(p, { force: true });
|
|
49
|
+
return [p];
|
|
50
|
+
}
|
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
import { getProxyDispatcher } from './proxy/proxy-agent.mjs';
|
|
2
2
|
|
|
3
|
-
const INDEX_URL =
|
|
4
|
-
|
|
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';
|
|
5
7
|
const HTTP_TIMEOUT_MS = 10000;
|
|
6
8
|
|
|
7
9
|
const GENERIC_KEYWORDS = new Set([
|
|
8
|
-
'华为云',
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
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',
|
|
15
43
|
]);
|
|
16
44
|
|
|
17
45
|
let cachedIndex = null;
|
|
@@ -34,8 +62,8 @@ async function fetchJson(url, label = '') {
|
|
|
34
62
|
return JSON.parse(decoded);
|
|
35
63
|
}
|
|
36
64
|
return data;
|
|
37
|
-
} catch (
|
|
38
|
-
throw new Error(`Failed to fetch ${label}: ${
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new Error(`Failed to fetch ${label}: ${error.message}`, { cause: error });
|
|
39
67
|
} finally {
|
|
40
68
|
clearTimeout(timer);
|
|
41
69
|
}
|
|
@@ -72,7 +100,7 @@ function expandKeywords(rawKeyword, cnEnMap) {
|
|
|
72
100
|
if (en === lower) expanded.push(cn);
|
|
73
101
|
}
|
|
74
102
|
}
|
|
75
|
-
const unique = [...new Set(expanded)].sort();
|
|
103
|
+
const unique = [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
|
|
76
104
|
const specific = unique.filter((kw) => !isGeneric(kw));
|
|
77
105
|
const generic = unique.filter((kw) => isGeneric(kw));
|
|
78
106
|
return [specific, generic];
|
|
@@ -94,7 +122,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
94
122
|
else if (triggers.some((t) => t.includes(k))) s += 8;
|
|
95
123
|
else if (descLower.includes(k)) s += 5;
|
|
96
124
|
else if (serviceLower.includes(k)) s += 3;
|
|
97
|
-
if (s > 0) {
|
|
125
|
+
if (s > 0) {
|
|
126
|
+
total += s;
|
|
127
|
+
matched.push(kw);
|
|
128
|
+
}
|
|
98
129
|
}
|
|
99
130
|
for (const kw of genericKws) {
|
|
100
131
|
const k = kw.toLowerCase();
|
|
@@ -103,7 +134,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
103
134
|
else if (triggers.some((t) => t.includes(k))) s += 4;
|
|
104
135
|
else if (descLower.includes(k)) s += 2;
|
|
105
136
|
else if (serviceLower.includes(k)) s += 1;
|
|
106
|
-
if (s > 0) {
|
|
137
|
+
if (s > 0) {
|
|
138
|
+
total += s;
|
|
139
|
+
matched.push(kw);
|
|
140
|
+
}
|
|
107
141
|
}
|
|
108
142
|
if (!specificKws.length && total === 0) {
|
|
109
143
|
total = 1;
|
|
@@ -137,6 +171,7 @@ export async function searchMarketplace(query = '', category = '') {
|
|
|
137
171
|
description: truncate(skill.description),
|
|
138
172
|
triggers: (skill.triggers || []).slice(0, 5),
|
|
139
173
|
matched,
|
|
174
|
+
installCommand: `npx skills add huaweicloud/huaweicloud-skills --skill ${skill.name}`,
|
|
140
175
|
});
|
|
141
176
|
}
|
|
142
177
|
results.sort((a, b) => b.score - a.score);
|