huaweicloud-devkit 1.0.2-next.7 → 1.0.2-next.9

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 (87) hide show
  1. package/.agents/plugins/marketplace.json +18 -18
  2. package/bin/setup.cjs +5 -3
  3. package/integrations/opencode/opencode.json +1 -4
  4. package/package.json +13 -3
  5. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
  6. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
  7. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
  8. package/plugins/huaweicloud-core/.mcp.json +1 -3
  9. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -1
  10. package/plugins/huaweicloud-core/safety/policy.json +75 -100
  11. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
  12. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
  13. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
  14. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
  15. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +32 -32
  16. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
  17. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +12 -11
  18. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +64 -17
  19. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
  20. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
  21. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +20 -20
  22. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
  23. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
  24. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
  25. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
  26. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
  27. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
  29. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
  30. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
  31. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
  33. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
  34. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
  35. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
  36. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
  37. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
  38. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +25 -25
  39. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +44 -44
  40. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
  41. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
  42. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
  43. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
  44. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
  45. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +39 -39
  46. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
  47. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
  48. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
  49. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
  50. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
  51. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
  52. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
  53. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
  54. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +6 -1
  55. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
  56. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +11 -1
  57. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
  58. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +53 -53
  59. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
  60. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
  61. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +3 -1
  62. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
  63. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
  64. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
  65. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
  66. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +5 -3
  67. package/plugins/huaweicloud-core/src/auth/credentials.mjs +12 -4
  68. package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
  69. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  70. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +16 -7
  71. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  72. package/plugins/huaweicloud-core/src/mcp-server.mjs +0 -1
  73. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +1 -2
  74. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +4 -1
  75. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
  76. package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
  77. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +2 -7
  78. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +10 -22
  79. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +30 -9
  80. package/plugins/huaweicloud-core/src/search-market.mjs +46 -12
  81. package/plugins/huaweicloud-core/src/setup-cli.mjs +435 -167
  82. package/plugins/huaweicloud-core/src/tools.mjs +407 -114
  83. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +54 -34
  84. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +1 -5
  85. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +3 -15
  86. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +3 -16
  87. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +37 -31
@@ -11,12 +11,12 @@ Use evidence before fixes. Do not guess service behavior when request IDs, regio
11
11
 
12
12
  ## Critical Warnings
13
13
 
14
- | Trap | Why |
15
- |------|-----|
16
- | Error in response body, not HTTP status | Many APIs return HTTP 200 with error in JSON body. Always check `error_code` and `error_msg` |
17
- | Missing `project_id` is common | New users often omit project_id from API path or CLI. Get it from `IAM KeystoneListProjects` |
18
- | Sandbox may block hcloud | OpenCode/Codex sandbox can block hcloud metadata files in `~/.hcloud/`. Use `dangerouslyDisableSandbox` or Bash tool |
19
- | KooCLI param prefix varies | VPC params need `--vpc.x`, ECS params need `--server.x`, ALWAYS check `--help` first |
14
+ | Trap | Why |
15
+ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
16
+ | Error in response body, not HTTP status | Many APIs return HTTP 200 with error in JSON body. Always check `error_code` and `error_msg` |
17
+ | Missing `project_id` is common | New users often omit project_id from API path or CLI. Get it from `IAM KeystoneListProjects` |
18
+ | Sandbox may block hcloud | OpenCode/Codex sandbox can block hcloud metadata files in `~/.hcloud/`. Use `dangerouslyDisableSandbox` or Bash tool |
19
+ | KooCLI param prefix varies | VPC params need `--vpc.x`, ECS params need `--server.x`, ALWAYS check `--help` first |
20
20
 
21
21
  ## Workflow
22
22
 
@@ -36,42 +36,42 @@ Use evidence before fixes. Do not guess service behavior when request IDs, regio
36
36
 
37
37
  ## Common Checks
38
38
 
39
- | Check | Command |
40
- |-------|---------|
41
- | Authentication | `hcloud configure list` (redacted) |
42
- | Region | Match CLI region, endpoint, and resource region |
43
- | Project ID | `hcloud IAM KeystoneListProjects` |
44
- | Pagination | Add `--limit=100` and check `marker` |
45
- | Quota | Check service quotas in console or API |
39
+ | Check | Command |
40
+ | -------------- | ------------------------------------------------------------- |
41
+ | Authentication | `hcloud configure list` (redacted) |
42
+ | Region | Match CLI region, endpoint, and resource region |
43
+ | Project ID | `hcloud IAM KeystoneListProjects` |
44
+ | Pagination | Add `--limit=100` and check `marker` |
45
+ | Quota | Check service quotas in console or API |
46
46
  | IAM Permission | Verify user/role has required action — see `huawei-iam` skill |
47
- | KooCLI version | `hcloud version` |
47
+ | KooCLI version | `hcloud version` |
48
48
 
49
49
  ## Common Error Codes
50
50
 
51
- | Error | Likely Cause | Fix |
52
- |-------|-------------|-----|
53
- | AuthFailure / 401 | AK/SK invalid or expired | Regenerate AK/SK, re-run `npx huaweicloud-devkit auth init` |
54
- | AccessDenied / 403 | IAM permission missing | Check `huawei-iam` skill, add required policy action |
55
- | NoSuchKey / 404 | Resource not found | Verify resource ID, region, and project_id |
56
- | QuotaExceeded | Account limit reached | Request quota increase in console |
57
- | [USE_ERROR] 不正确的参数 | Wrong param name | Run `--help`, check `--param=value` format and nested prefix |
58
- | Ecs.0005 | Flavor-image mismatch | Check image `__support_*` against flavor virtualization type |
59
- | FSS.0400 | FunctionGraph latest version error | Strip `:latest` from function URN |
60
- | FSS.1417 | DEDICATEDGATEWAY missing params | Add instance_id, group_id, protocol, env_name, env_id |
61
- | APIC.7201 | Missing security_group_id | Add `--security_group_id` param for APIG CreateInstanceV2 |
62
- | [NETWORK_ERROR] | Transient network failure | Retry with `maxRetries` param or wait and retry |
51
+ | Error | Likely Cause | Fix |
52
+ | ------------------------ | ---------------------------------- | ------------------------------------------------------------ |
53
+ | AuthFailure / 401 | AK/SK invalid or expired | Regenerate AK/SK, re-run `npx huaweicloud-devkit auth init` |
54
+ | AccessDenied / 403 | IAM permission missing | Check `huawei-iam` skill, add required policy action |
55
+ | NoSuchKey / 404 | Resource not found | Verify resource ID, region, and project_id |
56
+ | QuotaExceeded | Account limit reached | Request quota increase in console |
57
+ | [USE_ERROR] 不正确的参数 | Wrong param name | Run `--help`, check `--param=value` format and nested prefix |
58
+ | Ecs.0005 | Flavor-image mismatch | Check image `__support_*` against flavor virtualization type |
59
+ | FSS.0400 | FunctionGraph latest version error | Strip `:latest` from function URN |
60
+ | FSS.1417 | DEDICATEDGATEWAY missing params | Add instance_id, group_id, protocol, env_name, env_id |
61
+ | APIC.7201 | Missing security_group_id | Add `--security_group_id` param for APIG CreateInstanceV2 |
62
+ | [NETWORK_ERROR] | Transient network failure | Retry with `maxRetries` param or wait and retry |
63
63
 
64
64
  ## KooCLI Error Types
65
65
 
66
66
  KooCLI classifies errors into 5 types. The error type prefix in the message guides initial diagnosis:
67
67
 
68
- | Type | Meaning | First Check |
69
- |------|---------|-------------|
70
- | `[NETWORK_ERROR]` | HTTP request exception | Network connectivity, firewall, endpoint reachability |
71
- | `[CLI_ERROR]` | KooCLI internal error | Contact KooCLI support |
72
- | `[USE_ERROR]` | Incorrect command parameters | Run `--help`, check param names and format |
73
- | `[OPENAPI_ERROR]` | Cloud service API error | Check service docs, contact service support |
74
- | `[APIE_ERROR]` | API Explorer metadata error | Contact API Explorer support |
68
+ | Type | Meaning | First Check |
69
+ | ----------------- | ---------------------------- | ----------------------------------------------------- |
70
+ | `[NETWORK_ERROR]` | HTTP request exception | Network connectivity, firewall, endpoint reachability |
71
+ | `[CLI_ERROR]` | KooCLI internal error | Contact KooCLI support |
72
+ | `[USE_ERROR]` | Incorrect command parameters | Run `--help`, check param names and format |
73
+ | `[OPENAPI_ERROR]` | Cloud service API error | Check service docs, contact service support |
74
+ | `[APIE_ERROR]` | API Explorer metadata error | Contact API Explorer support |
75
75
 
76
76
  Enable debug with `--cli-debug=true` to see the underlying HTTP request/response and pinpoint network or endpoint issues.
77
77
 
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "Huawei Cloud Troubleshooting"
3
- short_description: "Diagnose Huawei Cloud errors using evidence and read-only checks."
4
- default_prompt: "Use $huaweicloud-troubleshooting to diagnose this Huawei Cloud error."
2
+ display_name: 'Huawei Cloud Troubleshooting'
3
+ short_description: 'Diagnose Huawei Cloud errors using evidence and read-only checks.'
4
+ default_prompt: 'Use $huaweicloud-troubleshooting to diagnose this Huawei Cloud error.'
@@ -80,9 +80,11 @@ function dshRegistered() {
80
80
  if (!existsSync(patchPath)) return false;
81
81
  try {
82
82
  const patch = readFileSync(patchPath, 'utf8');
83
- return patch.includes('id: mcp-huaweicloud')
84
- && patch.includes("@deepseek-ai/dsh-mcp-client")
85
- && patch.includes('serverName: huaweicloud');
83
+ return (
84
+ patch.includes('id: mcp-huaweicloud') &&
85
+ patch.includes('@deepseek-ai/dsh-mcp-client') &&
86
+ patch.includes('serverName: huaweicloud')
87
+ );
86
88
  } catch {
87
89
  return false;
88
90
  }
@@ -7,14 +7,20 @@ import { homedir } from 'node:os';
7
7
  // Native Windows has no POSIX modes (statSync always reports 0666), so skip the check there.
8
8
  function ensurePrivateMode(path) {
9
9
  if (process.platform === 'win32') return;
10
- try { chmodSync(path, 0o600); } catch {}
10
+ try {
11
+ chmodSync(path, 0o600);
12
+ } catch {}
11
13
  try {
12
14
  const mode = statSync(path).mode & 0o777;
13
15
  if (mode !== 0o600) {
14
- console.warn(`\x1b[33m[WARN]\x1b[0m Could not set 0600 on ${path} (current mode ${mode.toString(8)}). Credentials may be readable by other users.`);
16
+ console.warn(
17
+ `\x1b[33m[WARN]\x1b[0m Could not set 0600 on ${path} (current mode ${mode.toString(8)}). Credentials may be readable by other users.`,
18
+ );
15
19
  console.warn(`\x1b[33m If running under WSL, move the credential home to the Linux filesystem:\x1b[0m`);
16
20
  console.warn(`\x1b[33m export HUAWEICLOUD_HOME=$HOME (then re-run auth init)\x1b[0m`);
17
- console.warn(`\x1b[33m Or skip file storage entirely with HW_ACCESS_KEY/HW_SECRET_KEY environment variables.\x1b[0m`);
21
+ console.warn(
22
+ `\x1b[33m Or skip file storage entirely with HW_ACCESS_KEY/HW_SECRET_KEY environment variables.\x1b[0m`,
23
+ );
18
24
  }
19
25
  } catch {}
20
26
  }
@@ -88,7 +94,9 @@ export function resolveCredentials(options = {}) {
88
94
 
89
95
  if (!ak || !sk) {
90
96
  if (options.allowMissing) return null;
91
- throw new Error('Huawei Cloud credentials are not configured. Run "npx huaweicloud-devkit auth init" or set HW_ACCESS_KEY/HW_SECRET_KEY.');
97
+ throw new Error(
98
+ 'Huawei Cloud credentials are not configured. Run "npx huaweicloud-devkit auth init" or set HW_ACCESS_KEY/HW_SECRET_KEY.',
99
+ );
92
100
  }
93
101
 
94
102
  return { ak, sk, securityToken, region };
@@ -42,7 +42,7 @@ export function syncAuth(target = 'all') {
42
42
  };
43
43
  }
44
44
 
45
- let obs = null;
45
+ let obs;
46
46
  try {
47
47
  obs = writeObsConfig(credentials);
48
48
  } catch (error) {