huaweicloud-devkit 1.0.2-next.2 → 1.0.2-next.21

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 (96) hide show
  1. package/.agents/plugins/marketplace.json +18 -18
  2. package/README.md +81 -51
  3. package/README.zh-CN.md +81 -49
  4. package/bin/setup.cjs +5 -3
  5. package/integrations/opencode/opencode.json +1 -4
  6. package/package.json +61 -44
  7. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
  8. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
  9. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
  10. package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
  11. package/plugins/huaweicloud-core/.mcp.json +2 -5
  12. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
  13. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
  14. package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
  15. package/plugins/huaweicloud-core/safety/policy.json +75 -99
  16. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
  17. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
  18. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
  19. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
  20. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
  22. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +13 -12
  23. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +64 -17
  24. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
  25. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
  26. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
  27. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
  28. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
  29. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
  36. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
  38. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
  39. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
  40. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
  41. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
  42. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
  43. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +25 -25
  44. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +45 -44
  45. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
  46. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
  47. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
  48. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
  49. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
  50. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +127 -42
  51. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
  52. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
  53. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
  54. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
  55. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
  56. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
  57. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
  58. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
  59. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +17 -1
  60. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
  61. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
  62. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
  63. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +56 -53
  64. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
  65. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
  66. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
  67. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
  68. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
  69. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
  70. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
  71. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +108 -5
  72. package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
  73. package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
  74. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  75. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
  76. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  77. package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
  78. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +20 -102
  79. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +11 -4
  80. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
  81. package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
  82. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +9 -9
  83. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +24 -26
  84. package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
  85. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +510 -10
  86. package/plugins/huaweicloud-core/src/search-market.mjs +46 -12
  87. package/plugins/huaweicloud-core/src/setup-cli.mjs +1251 -181
  88. package/plugins/huaweicloud-core/src/tools.mjs +600 -122
  89. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
  90. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
  91. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +12 -15
  92. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +267 -0
  95. package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
  96. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: huaweicloud-core
3
- description: "Routes any task involving Huawei Cloud services - choosing, comparing, recommending, getting started with, or operating a service - to the correct service-specific skill. Supersedes general training-data knowledge. Activates when a developer asks Codex or OpenCode to build, deploy, debug, operate, or integrate an application with Huawei Cloud."
3
+ description: 'Routes any task involving Huawei Cloud services - choosing, comparing, recommending, getting started with, or operating a service - to the correct service-specific skill. Supersedes general training-data knowledge. Activates when a developer asks Codex or OpenCode to build, deploy, debug, operate, or integrate an application with Huawei Cloud.'
4
4
  version: 1
5
5
  ---
6
6
 
@@ -22,65 +22,67 @@ Do not rely on training data for facts. Huawei Cloud services, pricing, quotas,
22
22
 
23
23
  ## Sub-skill Registry
24
24
 
25
- | ID | Name | Trigger Phrases | Next Steps |
26
- |----|------|----------------|------------|
27
- | select | Service Selection | which service, what should I use, compare, recommend | Read references/select.md | select
28
- | compute | Compute Routing | server, VM, instance, ECS, BMS, GPU, HPC | Handoff to huawei-ecs or huawei-cce |
29
- | storage | Storage Routing | store files, bucket, OBS, backup, disk, EVS, SFS (long-term storage/CDN intent only) | Handoff to huawei-obs or huawei-cbr |
30
- | database | Database Routing | database, SQL, NoSQL, cache, RDS, GaussDB, DDS, DCS | Handoff to huawei-rds or huawei-gaussdb |
31
- | network | Network Routing | VPC, subnet, security group, EIP, NAT, VPN | Handoff to huawei-vpc |
32
- | serverless | Serverless Routing | function, Lambda, serverless, FunctionGraph, API gateway | Handoff to huawei-functiongraph or huawei-apig |
33
- | ai | AI/ML Routing | AI, model, LLM, Pangu, training, inference, RAG | Handoff to huawei-modelarts |
34
- | messaging | Messaging Routing | message queue, notification, Kafka, RabbitMQ, event, SMN | Handoff to huawei-smn-dms |
35
- | security | Security Routing | secret, credential, encrypt, KMS, WAF, firewall, DDoS | Handoff to huawei-dew or huawei-waf-aad |
36
- | observability | Observability Routing | monitor, alarm, log, audit, trace, Cloud Eye | Handoff to huawei-cloud-eye or huawei-cts |
37
- | billing | Billing Routing | cost, bill, budget, spending, invoice | Handoff to huawei-billing |
38
- | iam | IAM Routing | permission, policy, role, user, group, AK/SK | Handoff to huawei-iam |
39
- | deployment | Deployment Routing | deploy, host, publish, CI/CD, pipeline, release | CI/CD pipeline -> huawei-deployment; deploy/host/preview a web app or static website (no CI/CD target) -> present deployment-target options first, see "Deployment Target Options" below |
40
- | sandbox | Sandbox Routing | sandbox, DevStation, workspace, terminal, preview, temporary runtime | Handoff to huawei-sandbox |
41
- | cli | CLI and Auth Routing | install hcloud, configure KooCLI, AK/SK setup | Handoff to huaweicloud-cli-and-auth |
42
- | safety | Safety Routing | is this safe, approve command, risk review | Handoff to huaweicloud-safety |
43
- | troubleshoot | Troubleshooting Routing | error, bug, failed, AccessDenied, quota | Handoff to huaweicloud-troubleshooting |
44
- | api-sdk | API/SDK Routing | API call, SDK, REST, integration, code example | Handoff to huaweicloud-api-and-sdk |
45
- | report-issue | Issue Reporting | wrong service, you picked wrong, incorrect | Read references/report-issue.md |
25
+ | ID | Name | Trigger Phrases | Next Steps |
26
+ | ------------- | ----------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
27
+ | select | Service Selection | which service, what should I use, compare, recommend | Read references/select.md | select |
28
+ | compute | Compute Routing | server, VM, instance, ECS, BMS, GPU, HPC | Handoff to huawei-ecs or huawei-cce |
29
+ | storage | Storage Routing | store files, bucket, OBS, backup, disk, EVS, SFS (long-term storage/CDN intent only) | Handoff to huawei-obs or huawei-cbr |
30
+ | database | Database Routing | database, SQL, NoSQL, cache, RDS, GaussDB, DDS, DCS | Handoff to huawei-rds or huawei-gaussdb |
31
+ | network | Network Routing | VPC, subnet, security group, EIP, NAT, VPN | Handoff to huawei-vpc |
32
+ | serverless | Serverless Routing | function, Lambda, serverless, FunctionGraph, API gateway | Handoff to huawei-functiongraph or huawei-apig |
33
+ | ai | AI/ML Routing | AI, model, LLM, Pangu, training, inference, RAG | Handoff to huawei-modelarts |
34
+ | messaging | Messaging Routing | message queue, notification, Kafka, RabbitMQ, event, SMN | Handoff to huawei-smn-dms |
35
+ | security | Security Routing | secret, credential, encrypt, KMS, WAF, firewall, DDoS | Handoff to huawei-dew or huawei-waf-aad |
36
+ | observability | Observability Routing | monitor, alarm, log, audit, trace, Cloud Eye | Handoff to huawei-cloud-eye or huawei-cts |
37
+ | billing | Billing Routing | cost, bill, budget, spending, invoice | Handoff to huawei-billing |
38
+ | iam | IAM Routing | permission, policy, role, user, group, AK/SK | Handoff to huawei-iam |
39
+ | deployment | Deployment Routing | deploy, host, publish, CI/CD, pipeline, release | CI/CD pipeline -> huawei-deployment; deploy/host/preview a web app or static website (no CI/CD target) -> present deployment-target options first, see "Deployment Target Options" below |
40
+ | sandbox | Sandbox Routing | sandbox, DevStation, workspace, terminal, preview, temporary runtime | Handoff to huawei-sandbox |
41
+ | cli | CLI and Auth Routing | install hcloud, configure KooCLI, AK/SK setup | Handoff to huaweicloud-cli-and-auth |
42
+ | safety | Safety Routing | is this safe, approve command, risk review | Handoff to huaweicloud-safety |
43
+ | troubleshoot | Troubleshooting Routing | error, bug, failed, AccessDenied, quota | Handoff to huaweicloud-troubleshooting |
44
+ | api-sdk | API/SDK Routing | API call, SDK, REST, integration, code example | Handoff to huaweicloud-api-and-sdk |
45
+ | report-issue | Issue Reporting | wrong service, you picked wrong, incorrect | Read references/report-issue.md |
46
46
 
47
47
  ## Service Map
48
48
 
49
- | Workload | Primary Service | Skill |
50
- |----------|----------------|-------|
51
- | Web application hosting | ECS | huawei-ecs |
52
- | Containerized microservices | CCE | huawei-cce |
53
- | Static file storage / CDN (long-term) | OBS | huawei-obs |
54
- | Relational database (MySQL/PG) | RDS | huawei-rds |
55
- | Distributed SQL database | GaussDB | huawei-gaussdb |
56
- | Document database (MongoDB API) | DDS | huawei-dds-dcs |
57
- | In-memory cache | DCS (Redis) | huawei-dds-dcs |
58
- | Serverless functions | FunctionGraph | huawei-functiongraph |
59
- | API management | APIG | huawei-apig |
60
- | AI model training/inference | ModelArts | huawei-modelarts |
61
- | Message queuing | DMS (Kafka/RabbitMQ) | huawei-smn-dms |
62
- | Push notifications | SMN | huawei-smn-dms |
63
- | Secret management | DEW (CSMS) | huawei-dew |
64
- | Key management | DEW (KMS) | huawei-dew |
65
- | DDoS protection | AAD | huawei-waf-aad |
66
- | Web firewall | WAF | huawei-waf-aad |
67
- | Monitoring dashboards | Cloud Eye (CES) | huawei-cloud-eye |
68
- | Audit trails | CTS | huawei-cts |
69
- | Backup / disaster recovery | CBR | huawei-cbr |
70
- | CI/CD pipeline | CloudDeploy | huawei-deployment |
71
- | Temporary runtime / web app preview | Sandbox (DevStation) | huawei-sandbox |
72
- | Getting started | Account setup | huaweicloud-cli-and-auth |
49
+ | Workload | Primary Service | Skill |
50
+ | ------------------------------------------------ | -------------------- | ------------------------ |
51
+ | Web application hosting (production / long-term) | ECS | huawei-ecs |
52
+ | Containerized microservices | CCE | huawei-cce |
53
+ | Static file storage / CDN (long-term) | OBS | huawei-obs |
54
+ | Relational database (MySQL/PG) | RDS | huawei-rds |
55
+ | Distributed SQL database | GaussDB | huawei-gaussdb |
56
+ | Document database (MongoDB API) | DDS | huawei-dds-dcs |
57
+ | In-memory cache | DCS (Redis) | huawei-dds-dcs |
58
+ | Serverless functions | FunctionGraph | huawei-functiongraph |
59
+ | API management | APIG | huawei-apig |
60
+ | AI model training/inference | ModelArts | huawei-modelarts |
61
+ | Message queuing | DMS (Kafka/RabbitMQ) | huawei-smn-dms |
62
+ | Push notifications | SMN | huawei-smn-dms |
63
+ | Secret management | DEW (CSMS) | huawei-dew |
64
+ | Key management | DEW (KMS) | huawei-dew |
65
+ | DDoS protection | AAD | huawei-waf-aad |
66
+ | Web firewall | WAF | huawei-waf-aad |
67
+ | Monitoring dashboards | Cloud Eye (CES) | huawei-cloud-eye |
68
+ | Audit trails | CTS | huawei-cts |
69
+ | Backup / disaster recovery | CBR | huawei-cbr |
70
+ | CI/CD pipeline | CloudDeploy | huawei-deployment |
71
+ | Temporary runtime / web app preview | Sandbox (DevStation) | huawei-sandbox |
72
+ | Getting started | Account setup | huaweicloud-cli-and-auth |
73
+
74
+ **Web app scenario layering**: for "deploy a web app", prefer `huawei-sandbox` for free/quick try (hello world, prototype, demo, temporary preview — temporary runtime + public URL, ~8h validity, zero billed resources); route to `huawei-functiongraph` / `huawei-ecs` (or `huawei-cce`) for production / long-term / custom-domain / high-availability hosting.
73
75
 
74
76
  ## Deployment Target Options
75
77
 
76
78
  When the intent is to **deploy, host, or preview a web app or static website** (no explicit target named), NEVER default to a single service such as OBS. Ask the developer to choose a target and present the options in this order:
77
79
 
78
- | # | Option | When to choose | Skill |
79
- |---|--------|----------------|-------|
80
- | 1 | **Sandbox (DevStation) — recommended** | Temporary runtime, quick preview, demo; instant public URL | huawei-sandbox |
81
- | 2 | OBS static website hosting | Long-term static hosting / CDN, no backend | huawei-obs |
82
- | 3 | ECS | Needs a server runtime (backend, custom server) | huawei-ecs |
83
- | 4 | CCE | Containerized workloads, scaling | huawei-cce |
80
+ | # | Option | When to choose | Skill |
81
+ | --- | -------------------------------------- | ---------------------------------------------------------- | -------------- |
82
+ | 1 | **Sandbox (DevStation) — recommended** | Temporary runtime, quick preview, demo; instant public URL | huawei-sandbox |
83
+ | 2 | OBS static website hosting | Long-term static hosting / CDN, no backend | huawei-obs |
84
+ | 3 | ECS | Needs a server runtime (backend, custom server) | huawei-ecs |
85
+ | 4 | CCE | Containerized workloads, scaling | huawei-cce |
84
86
 
85
87
  - Recommended prompt: "这个项目是 Web 应用/静态网站,建议优先部署到沙箱(临时运行环境,立即可预览)。也可选择 OBS 静态托管、ECS 或 CCE,你想部署到哪里?"
86
88
  - If the developer explicitly names a target (e.g. "deploy to OBS"), follow that target and hand off to the corresponding service skill.
@@ -100,6 +102,7 @@ When the intent is to **deploy, host, or preview a web app or static website** (
100
102
 
101
103
  - Use huaweicloud_search_docs to discover skills covering a topic
102
104
  - Use huaweicloud_retrieve_skill to load a full SKILL.md after routing
105
+ - Use huaweicloud_auth_init to switch credentials at runtime when different accounts co-exist in the same session
103
106
  - If no built-in skill matches, consult huaweicloud-capability-discovery for external marketplace options
104
107
  - Use huaweicloud_list_regions before creating regional resources
105
108
  - Use huaweicloud_get_regional_availability when unsure about service-region pairs
@@ -108,4 +111,4 @@ When the intent is to **deploy, host, or preview a web app or static website** (
108
111
 
109
112
  ## Quality Bar
110
113
 
111
- Prefer short, precise instructions with commands the developer can run. Give source names and exact fields to verify. Avoid inventing service behavior. When uncertain, route to Huawei Cloud Skills or official API/SDK documentation.
114
+ Prefer short, precise instructions with commands the developer can run. Give source names and exact fields to verify. Avoid inventing service behavior. When uncertain, route to Huawei Cloud Skills or official API/SDK documentation.
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "Huawei Cloud Core"
3
- short_description: "Route Huawei Cloud tasks to Skills, CLI, API, SDK, MCP, or Terraform."
4
- default_prompt: "Use $huaweicloud-core to choose the right Huawei Cloud capability path."
2
+ display_name: 'Huawei Cloud Core'
3
+ short_description: 'Route Huawei Cloud tasks to Skills, CLI, API, SDK, MCP, or Terraform.'
4
+ default_prompt: 'Use $huaweicloud-core to choose the right Huawei Cloud capability path.'
@@ -12,9 +12,9 @@ Use when the user reports an issue with a previous routing decision.
12
12
 
13
13
  ## Common Corrections
14
14
 
15
- | Wrong Routing | Likely Correct |
16
- |---------------|---------------|
17
- | ECS for containers | CCE |
18
- | OBS for block storage | EVS (via huawei-ecs) |
19
- | RDS for cache | DCS (via huawei-dds-dcs) |
20
- | FunctionGraph for long-running tasks | ECS or CCE |
15
+ | Wrong Routing | Likely Correct |
16
+ | ------------------------------------ | ------------------------ |
17
+ | ECS for containers | CCE |
18
+ | OBS for block storage | EVS (via huawei-ecs) |
19
+ | RDS for cache | DCS (via huawei-dds-dcs) |
20
+ | FunctionGraph for long-running tasks | ECS or CCE |
@@ -17,12 +17,26 @@ Use when the user asks which service to use or compares services.
17
17
  ## Example: I need a database
18
18
 
19
19
  Ask:
20
+
20
21
  - What type of data? Structured (tables) or flexible (documents)?
21
22
  - What scale? Small app or enterprise?
22
23
  - Do you need SQL queries?
23
24
 
24
25
  Route based on answers:
26
+
25
27
  - SQL + standard scale -> huawei-rds
26
28
  - SQL + massive scale / distributed -> huawei-gaussdb
27
29
  - Document model (MongoDB-compatible) -> huawei-dds-dcs
28
- - Cache / key-value -> huawei-dds-dcs (DCS)
30
+ - Cache / key-value -> huawei-dds-dcs (DCS)
31
+
32
+ ## Example: I need to deploy a web app
33
+
34
+ Ask:
35
+
36
+ - Is this a quick try / prototype / demo / temporary preview (free)?
37
+ - Or production (long-term, custom domain, high availability)?
38
+
39
+ Route by scenario:
40
+
41
+ - Free / quick try / prototype / demo / temporary preview -> huawei-sandbox (temporary runtime + public URL, ~8h validity, zero billed resources)
42
+ - Production / long-term / custom domain / high availability -> huawei-functiongraph / huawei-ecs (or huawei-cce for containers)
@@ -5,7 +5,6 @@ description: Huawei Cloud safety policy for agents. Use when handling credential
5
5
 
6
6
  # Huawei Cloud Safety
7
7
 
8
-
9
8
  **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
9
 
11
10
  Use this skill before any Huawei Cloud action that may expose secrets, change resources, affect cost, change IAM, or expose a network endpoint.
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "Huawei Cloud Safety"
3
- short_description: "Keep Huawei Cloud agent operations safe and redacted."
4
- default_prompt: "Use $huaweicloud-safety to review this Huawei Cloud operation."
2
+ display_name: 'Huawei Cloud Safety'
3
+ short_description: 'Keep Huawei Cloud agent operations safe and redacted.'
4
+ default_prompt: 'Use $huaweicloud-safety to review this Huawei Cloud operation.'
@@ -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.'
@@ -1,9 +1,20 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
2
+ import { join, resolve } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { spawnSync } from 'node:child_process';
5
+ import { createRequire } from 'node:module';
5
6
 
6
- export const SUPPORTED_AGENT_TARGETS = ['opencode', 'codex', 'codex-desktop', 'codearts', 'workbuddy', 'dsh'];
7
+ export const SUPPORTED_AGENT_TARGETS = [
8
+ 'opencode',
9
+ 'codex',
10
+ 'codex-desktop',
11
+ 'codearts',
12
+ 'workbuddy',
13
+ 'dsh',
14
+ 'officeace',
15
+ 'hermes',
16
+ 'openclaw',
17
+ ];
7
18
 
8
19
  function baseHome() {
9
20
  return process.env.HUAWEICLOUD_HOME || homedir();
@@ -80,9 +91,99 @@ function dshRegistered() {
80
91
  if (!existsSync(patchPath)) return false;
81
92
  try {
82
93
  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');
94
+ return (
95
+ patch.includes('id: mcp-huaweicloud') &&
96
+ patch.includes('@deepseek-ai/dsh-mcp-client') &&
97
+ patch.includes('serverName: huaweicloud')
98
+ );
99
+ } catch {
100
+ return false;
101
+ }
102
+ }
103
+
104
+ function readOfficeaceRegistryInstallDir() {
105
+ if (process.platform !== 'win32') return null;
106
+ try {
107
+ const r = spawnSync('reg', ['query', 'HKCU\\SOFTWARE\\OfficeAce\\OfficeAce', '/v', 'InstallDir'], {
108
+ encoding: 'utf8',
109
+ windowsHide: true,
110
+ timeout: 5000,
111
+ });
112
+ if (r.status === 0) {
113
+ const m = r.stdout.match(/InstallDir\s+REG_SZ\s+(.+)/);
114
+ if (m) return m[1].trim();
115
+ }
116
+ } catch {}
117
+ return null;
118
+ }
119
+
120
+ function officeaceCapabilitiesDir() {
121
+ const configRoot = process.env.OFFICE_CLAW_CONFIG_ROOT;
122
+ if (configRoot && existsSync(join(configRoot, 'capabilities.json'))) return configRoot;
123
+ const regDir = readOfficeaceRegistryInstallDir();
124
+ if (regDir) {
125
+ const dir = join(regDir, '.office-claw');
126
+ if (existsSync(join(dir, 'capabilities.json'))) return dir;
127
+ }
128
+ if (process.platform === 'win32') {
129
+ const bases = [process.env.ProgramFiles, 'C:\\Program Files', 'D:\\Program Files'];
130
+ if (process.env.LOCALAPPDATA) bases.push(join(process.env.LOCALAPPDATA, 'Programs'));
131
+ for (const base of bases) {
132
+ if (!base) continue;
133
+ const dir = join(base, 'OfficeAce', '.office-claw');
134
+ if (existsSync(join(dir, 'capabilities.json'))) return dir;
135
+ }
136
+ }
137
+ return null;
138
+ }
139
+
140
+ function officeaceCapabilitiesDirSafe() {
141
+ return officeaceCapabilitiesDir() || join(baseHome(), '.office-claw');
142
+ }
143
+
144
+ function officeaceSqlitePath() {
145
+ const capDir = officeaceCapabilitiesDirSafe();
146
+ return join(resolve(capDir, '..'), 'data', 'mcp-connectors.sqlite');
147
+ }
148
+
149
+ function officeaceRegistered() {
150
+ let hasMcp = false;
151
+ const dbPath = officeaceSqlitePath();
152
+ if (existsSync(dbPath)) {
153
+ const nodeMajor = Number(process.versions.node.split('.')[0]);
154
+ if (nodeMajor >= 22) {
155
+ try {
156
+ const { DatabaseSync } = createRequire(import.meta.url)('node:sqlite');
157
+ const db = new DatabaseSync(dbPath, { readonly: true });
158
+ const row = db.prepare("SELECT enabled FROM mcp_connectors WHERE name = 'huaweicloud-devkit'").get();
159
+ db.close();
160
+ hasMcp = Boolean(row?.enabled);
161
+ } catch {}
162
+ }
163
+ }
164
+
165
+ const capFile = join(officeaceCapabilitiesDirSafe(), 'capabilities.json');
166
+ const cfg = readJsonSafe(capFile);
167
+ const hasSkills = cfg?.capabilities?.some((c) => c.id === 'huaweicloud-core' && c.type === 'skill') ?? false;
168
+
169
+ return hasMcp || hasSkills;
170
+ }
171
+
172
+ function hermesHome() {
173
+ if (process.env.HERMES_HOME) return process.env.HERMES_HOME;
174
+ // Hermes on Windows stores under LOCALAPPDATA, not ~/.hermes
175
+ if (process.platform === 'win32' && process.env.LOCALAPPDATA) {
176
+ return join(process.env.LOCALAPPDATA, 'hermes');
177
+ }
178
+ return join(baseHome(), '.hermes');
179
+ }
180
+
181
+ function hermesRegistered() {
182
+ const configPath = join(hermesHome(), 'config.yaml');
183
+ if (!existsSync(configPath)) return false;
184
+ try {
185
+ const content = readFileSync(configPath, 'utf8');
186
+ return content.includes('mcp_servers:') && content.includes('huaweicloud-devkit');
86
187
  } catch {
87
188
  return false;
88
189
  }
@@ -99,6 +200,8 @@ export function getAgentRegistrationStatuses(target = 'all') {
99
200
  if (agent === 'codearts') configured = codeartsRegistered();
100
201
  if (agent === 'workbuddy') configured = workbuddyRegistered();
101
202
  if (agent === 'dsh') configured = dshRegistered();
203
+ if (agent === 'officeace') configured = officeaceRegistered();
204
+ if (agent === 'hermes') configured = hermesRegistered();
102
205
  result.agents[agent] = { configured };
103
206
  }
104
207
  return result;
@@ -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
  }
@@ -78,6 +84,13 @@ export function resolveCredentials(options = {}) {
78
84
  let securityToken = process.env.HW_SECURITY_TOKEN;
79
85
  let region = process.env.HW_REGION || process.env.HUAWEICLOUD_REGION || '';
80
86
 
87
+ const codeartsCreds = isCodeArtsContext() ? readCodeArtsCredentials() : null;
88
+ if (codeartsCreds) {
89
+ if (!ak && codeartsCreds.ak) ak = codeartsCreds.ak;
90
+ if (!sk && codeartsCreds.sk) sk = codeartsCreds.sk;
91
+ if (!region && codeartsCreds.region) region = codeartsCreds.region;
92
+ }
93
+
81
94
  const stored = readGlobalCredentials();
82
95
  if (stored) {
83
96
  if (!ak && stored.ak) ak = stored.ak;
@@ -88,8 +101,68 @@ export function resolveCredentials(options = {}) {
88
101
 
89
102
  if (!ak || !sk) {
90
103
  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.');
104
+ throw new Error(
105
+ 'Huawei Cloud credentials are not configured. Run "npx huaweicloud-devkit auth init" or set HW_ACCESS_KEY/HW_SECRET_KEY.',
106
+ );
92
107
  }
93
108
 
94
109
  return { ak, sk, securityToken, region };
95
110
  }
111
+
112
+ function isCodeArtsContext() {
113
+ return existsSync(join(process.cwd(), '.codeartsdoer')) || existsSync(join(homedir(), '.codeartsdoer'));
114
+ }
115
+
116
+ function readCodeArtsCredentials() {
117
+ const searchPaths = [
118
+ join(process.cwd(), '.codeartsdoer', 'mcp', 'mcp_settings.json'),
119
+ join(homedir(), '.codeartsdoer', 'mcp', 'mcp_settings.json'),
120
+ ];
121
+
122
+ for (const path of searchPaths) {
123
+ try {
124
+ if (!existsSync(path)) continue;
125
+ const config = JSON.parse(readFileSync(path, 'utf8'));
126
+ const server = config?.mcpServers?.['huaweicloud-devkit'];
127
+ if (!server?.env) continue;
128
+
129
+ const ak = server.env.HW_ACCESS_KEY;
130
+ const sk = server.env.HW_SECRET_KEY;
131
+ if (ak && sk) {
132
+ return {
133
+ ak,
134
+ sk,
135
+ securityToken: server.env.HW_SECURITY_TOKEN || '',
136
+ region: server.env.HW_REGION || server.env.HUAWEICLOUD_REGION || '',
137
+ };
138
+ }
139
+ } catch {
140
+ // mcp_settings.json missing or invalid — skip
141
+ }
142
+ }
143
+
144
+ return null;
145
+ }
146
+
147
+ let runtimeCredentials = null;
148
+
149
+ export function setRuntimeCredentials(ak, sk, securityToken, region) {
150
+ runtimeCredentials = { ak, sk, securityToken: securityToken || '', region: region || '' };
151
+ }
152
+
153
+ export function clearRuntimeCredentials() {
154
+ runtimeCredentials = null;
155
+ }
156
+
157
+ export function resolveCredentialsWithRuntime(options = {}) {
158
+ if (runtimeCredentials) {
159
+ return {
160
+ ak: runtimeCredentials.ak,
161
+ sk: runtimeCredentials.sk,
162
+ securityToken: runtimeCredentials.securityToken,
163
+ region: runtimeCredentials.region,
164
+ };
165
+ }
166
+
167
+ return resolveCredentials(options);
168
+ }
@@ -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) {