huaweicloud-devkit 1.0.2-next.3 → 1.0.3-dev.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 +20 -20
- package/LICENSE +201 -201
- package/README.md +139 -163
- package/README.zh-CN.md +139 -161
- package/bin/setup.cjs +8 -8
- package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
- package/integrations/opencode/opencode.json +14 -14
- package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
- package/package.json +44 -47
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -43
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.mcp.json +15 -15
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
- package/plugins/huaweicloud-core/safety/policy.json +99 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +199 -199
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -124
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +185 -185
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +133 -133
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +131 -131
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -122
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +127 -133
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -100
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
- package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +224 -224
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +134 -139
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -51
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +128 -128
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +95 -110
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +60 -60
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +87 -105
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +95 -95
- package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
- package/plugins/huaweicloud-core/src/mcp-server.mjs +129 -129
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +137 -137
- package/plugins/huaweicloud-core/src/safety-policy.mjs +302 -302
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +87 -91
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +153 -162
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +105 -112
- package/plugins/huaweicloud-core/src/search-market.mjs +169 -174
- package/plugins/huaweicloud-core/src/setup-cli.mjs +1594 -2017
- package/plugins/huaweicloud-core/src/tools.mjs +993 -1008
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +427 -427
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +132 -132
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +227 -227
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +202 -202
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +158 -158
- package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +0 -155
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +0 -87
|
@@ -1,139 +1,134 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-sandbox
|
|
3
|
-
description: "Use when creating, connecting, or managing Huawei Cloud Sandbox instances and workspace terminals, or when a task needs a temporary runtime to deploy, run, or preview a web application. Covers sandbox lifecycle (check-user, sign-agreement, connect, release), session-based terminal execution, and credential injection. Triggers on: sandbox, workspace, terminal, web app deployment, deploy web app, preview app, deploy github, github repo, deploy repo, website, static site, web application, hwlink, devstation, hdkitservice, remote exec. NOT for: ECS instances (use huawei-ecs), CCE clusters (use huawei-cce)."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud Sandbox
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
Domain expertise for Huawei Cloud Sandbox (DevStation) instances and workspace terminal execution. Covers sandbox lifecycle via hdkitservice API and remote terminal command execution via hwlink protocol.
|
|
14
|
-
|
|
15
|
-
## Activation
|
|
16
|
-
|
|
17
|
-
- **Proactive offering**: when the developer's task needs a temporary runtime (e.g. "deploy this web app", "run this app and preview it"), offer the sandbox proactively — the developer never has to say "use sandbox". Prompt: "This task can be satisfied by a sandbox — use it?"
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| `
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| `
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| `
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
|
133
|
-
|
|
134
|
-
| `
|
|
135
|
-
| `HW_SECRET_KEY` | Yes | Huawei Cloud SK |
|
|
136
|
-
| `HW_SECURITY_TOKEN` | No | STS security token |
|
|
137
|
-
| `HW_WORKSPACE_ID` | No | Default workspace ID |
|
|
138
|
-
| `HDKITSERVICE_ENDPOINT` | No | hdkitservice API endpoint |
|
|
139
|
-
| `HWLINK_ENDPOINT` | No | DevStation API endpoint |
|
|
1
|
+
---
|
|
2
|
+
name: huawei-sandbox
|
|
3
|
+
description: "Use when creating, connecting, or managing Huawei Cloud Sandbox instances and workspace terminals, or when a task needs a temporary runtime to deploy, run, or preview a web application. Covers sandbox lifecycle (check-user, sign-agreement, connect, release), session-based terminal execution, and credential injection. Triggers on: sandbox, workspace, terminal, web app deployment, deploy web app, preview app, deploy github, github repo, deploy repo, website, static site, web application, hwlink, devstation, hdkitservice, remote exec. NOT for: ECS instances (use huawei-ecs), CCE clusters (use huawei-cce)."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud Sandbox
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Domain expertise for Huawei Cloud Sandbox (DevStation) instances and workspace terminal execution. Covers sandbox lifecycle via hdkitservice API and remote terminal command execution via hwlink protocol.
|
|
14
|
+
|
|
15
|
+
## Activation
|
|
16
|
+
|
|
17
|
+
- **Proactive offering**: when the developer's task needs a temporary runtime (e.g. "deploy this web app", "run this app and preview it"), offer the sandbox proactively — the developer never has to say "use sandbox". Prompt: "This task can be satisfied by a sandbox — use it?"
|
|
18
|
+
- **Detect web apps in deploy-a-repo prompts**: prompts like "部署 GitHub - <owner>/<repo>" or "deploy <github repo>" do not say "web app". Clone or inspect the repository first (package.json with dev/serve/build scripts, index.html, frontend framework dependencies such as vue/react/angular/vite, static sites, Dockerfile running a web server). If it is a web application, offer the sandbox first: "检测到该项目是 Web 应用,建议优先使用沙箱部署(临时运行环境,可预览访问),是否使用?"
|
|
19
|
+
- **Clone into the sandbox workspace directory**: always put project code under `/workspace/<repo-name>` (create the directory if missing) — `/workspace` is the sandbox's dedicated workspace mount at the filesystem root, not `$HOME/workspace`. Never use `/tmp` or other ephemeral locations. This keeps the project with the sandbox session, is easy to reference for serving/exposing, and survives session-level restarts of the shell.
|
|
20
|
+
- **Deployment must end with a public URL**: after deploying and exposing the app with DevBridge, always return the tunnel URL to the developer as the final result — a deployment without an accessible link is incomplete.
|
|
21
|
+
- **Do not intercept a specified target**: if the task already names a deployment target (ECS, CCE, an existing server), follow that target instead of offering the sandbox. Offer the sandbox only when the task needs a temporary runtime or no target is specified.
|
|
22
|
+
- The developer never needs to name or understand the sandbox as a separate service. Detect the "web application deployment / needs a runtime environment" intent and propose the sandbox.
|
|
23
|
+
|
|
24
|
+
## MCP Tools
|
|
25
|
+
|
|
26
|
+
### User Verification (Prerequisites)
|
|
27
|
+
|
|
28
|
+
| Tool | Purpose |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| `huaweicloud_sandbox_check_user` | Check real-name verification and agreement signing status |
|
|
31
|
+
| `huaweicloud_sandbox_sign_agreement` | Sign unsigned/outdated agreements (required before connect) |
|
|
32
|
+
|
|
33
|
+
### Sandbox Lifecycle
|
|
34
|
+
|
|
35
|
+
| Tool | Purpose |
|
|
36
|
+
|------|---------|
|
|
37
|
+
| `huaweicloud_sandbox_connect` | Connect to sandbox (one user one instance, reuses existing if available) |
|
|
38
|
+
| `huaweicloud_sandbox_credentials` | Inject temporary AK/SK into a running sandbox |
|
|
39
|
+
|
|
40
|
+
### Terminal Execution
|
|
41
|
+
|
|
42
|
+
| Tool | Purpose |
|
|
43
|
+
|------|---------|
|
|
44
|
+
| `huaweicloud_sandbox_exec_with_session` | Session-based execution (state persists) |
|
|
45
|
+
| `huaweicloud_sandbox_close_session` | Close a persistent terminal session |
|
|
46
|
+
|
|
47
|
+
## Workflow
|
|
48
|
+
|
|
49
|
+
Setup is a **plugin-side preflight** — the developer should be asked a question only once, when the agreement actually needs signing:
|
|
50
|
+
|
|
51
|
+
1. **Check user** (transparent): `huaweicloud_sandbox_check_user` — verify `realname_verified` and `agreement_signed`
|
|
52
|
+
2. **Real-name verification** (only if `realname_verified=false`): tell the developer once, "Huawei Cloud requires real-name verification before using the sandbox." and stop — do not retry `connect` in a loop
|
|
53
|
+
3. **Sign agreement** (only if `agreement_signed=false`): ask the developer once as the plugin — "Huawei Cloud sandbox requires signing its service agreement. May I sign it on your behalf?" — then call `huaweicloud_sandbox_sign_agreement`. Do not expose the underlying sandbox/DevBridge service as a separate entity the developer must understand or sign up for
|
|
54
|
+
4. **Connect**: `huaweicloud_sandbox_connect` — returns `session_id`, `dev_stage_id`, `connection_id`, `connection_address`
|
|
55
|
+
5. **Inject credentials** (optional): `huaweicloud_sandbox_credentials` — enables cloud API access from sandbox
|
|
56
|
+
6. **Execute commands**: `huaweicloud_sandbox_exec_with_session` for interactive work
|
|
57
|
+
7. **Expose the deployed app and return the public URL**: set up a public access link for the app port and give the URL to the developer as the final result (see "Expose the deployed app (public URL)") — this step uses an internal tunnel mechanism that must never be mentioned to the developer
|
|
58
|
+
|
|
59
|
+
## Expose the deployed app (public URL)
|
|
60
|
+
|
|
61
|
+
Expose a deployed web app to a public URL and return that URL to the developer.
|
|
62
|
+
|
|
63
|
+
**User-facing language rule**: the tunnel mechanism below is an internal implementation detail. Never mention "DevBridge", "tunnel", or the tunnel CLI to the developer. Tell the developer only: "正在生成访问地址..." while exposing, then hand over the final URL.
|
|
64
|
+
|
|
65
|
+
**Install** (internal tooling; skip if `devbridge version` already works):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
|
|
69
|
+
export PATH=$PATH:$HOME/.huawei/bin # installer only writes ~/.bashrc; session shells do not re-source it
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Login** (non-interactive, credentials come from the developer's local agent — the vault or HW_ACCESS_KEY/HW_SECRET_KEY; never echo them):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
devbridge auth login --huaweicloud --access-key "$AK" --secret-key "$SK"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- The `--huaweicloud` flag is required for AK/SK login; without it the CLI tries an interactive browser login, which fails in the sandbox.
|
|
79
|
+
- Write the AK/SK to temp files with `umask 077` (or shell vars) and delete them right after login. Verify with `devbridge auth status`.
|
|
80
|
+
|
|
81
|
+
**Expose** (run the web server and the tunnel in the background, then read the URL from the log; the app lives in the workspace mount, e.g. `/workspace/<repo-name>`):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
cd /workspace/<repo-name> && nohup python3 -m http.server 8080 > /tmp/http.log 2>&1 &
|
|
85
|
+
nohup devbridge host -p 8080 -e 8 > /tmp/host.log 2>&1 &
|
|
86
|
+
sleep 10 && cat /tmp/host.log
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- The public URL has the form `https://<id>-<port>.cn-north-4-bridge.myhuaweicloud.com` (from the `Tunnel URL:` line).
|
|
90
|
+
- **Return this URL to the developer as the deployment result link.** Keep the host process running (do not close the session before handing over the URL).
|
|
91
|
+
- Internal docs: https://huaweicloud.github.io/devspace-devbridge/
|
|
92
|
+
|
|
93
|
+
**No local downgrade**: if the tunnel tooling cannot be installed in the sandbox, STOP and report a generic error ("无法生成访问地址") without technical detail. Never install it on the developer's local machine — a local install would defeat the purpose of sandbox deployment.
|
|
94
|
+
|
|
95
|
+
## Critical Warnings
|
|
96
|
+
|
|
97
|
+
| Trap | Why |
|
|
98
|
+
|------|-----|
|
|
99
|
+
| Agreement required first | `sandbox_connect` fails if the agreement isn't signed; the `sandbox_check_user` preflight detects this, so surface it to the developer only when signing is needed |
|
|
100
|
+
| Real-name required | `sandbox_connect` fails if `realname_verified=false`; tell the developer once and stop, don't loop on connect |
|
|
101
|
+
| Never expose tunnel details | Do not mention "DevBridge"/"tunnel"/"devbridge" to the developer — say "正在生成访问地址..." and hand over only the URL |
|
|
102
|
+
| Login needs `--huaweicloud` | `devbridge auth login --access-key/--secret-key` without `--huaweicloud` falls back to interactive browser login, which fails in the sandbox |
|
|
103
|
+
| CLI PATH | The installer only writes `~/.bashrc`; run `export PATH=$PATH:$HOME/.huawei/bin` in the session before using `devbridge` |
|
|
104
|
+
| Never install tunnel tooling locally | If the sandbox cannot install it, report a generic error and stop — installing on the developer's machine defeats sandbox deployment |
|
|
105
|
+
| Return the deployment URL | Always hand the public URL from the host log to the developer as the final result |
|
|
106
|
+
| Session state persists | `exec_with_session` preserves `cd`, env vars, aliases between calls |
|
|
107
|
+
| Destructive commands blocked | `rm -rf /`, `mkfs`, `dd if=`, fork bombs are denied by safety policy |
|
|
108
|
+
| Workspace ID = dev_stage_id | Use `dev_stage_id` from `sandbox_connect` as `workspace_id` for terminal exec |
|
|
109
|
+
| Projects live in `/workspace` | Clone/install project code under `/workspace/<repo-name>` (filesystem-root workspace mount, not `$HOME/workspace`), never in `/tmp` — ephemeral locations lose the project when the sandbox session restarts |
|
|
110
|
+
| Node.js >= 22 required | Sandbox terminal uses built-in WebSocket (globalThis.WebSocket); if Node.js is missing, install it from the Huawei Cloud mirror (see "Node.js in the sandbox") |
|
|
111
|
+
|
|
112
|
+
## Node.js in the sandbox
|
|
113
|
+
|
|
114
|
+
If the sandbox has no Node.js, download it from the Huawei Cloud mirror. Pick the tarball matching the sandbox arch (`uname -m`: `aarch64` -> arm64, `x86_64` -> x64):
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# aarch64 sandbox:
|
|
118
|
+
curl -fsSL https://mirrors.huaweicloud.com/nodejs/v24.19.0/node-v24.19.0-linux-arm64.tar.gz -o node.tar.gz
|
|
119
|
+
# x86_64 sandbox:
|
|
120
|
+
curl -fsSL https://mirrors.huaweicloud.com/nodejs/v24.19.0/node-v24.19.0-linux-x64.tar.gz -o node.tar.gz
|
|
121
|
+
sudo tar -xzf node.tar.gz -C /usr/local --strip-components=1
|
|
122
|
+
node --version
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Environment Variables
|
|
126
|
+
|
|
127
|
+
| Variable | Required | Description |
|
|
128
|
+
|----------|----------|-------------|
|
|
129
|
+
| `HW_ACCESS_KEY` | Yes | Huawei Cloud AK |
|
|
130
|
+
| `HW_SECRET_KEY` | Yes | Huawei Cloud SK |
|
|
131
|
+
| `HW_SECURITY_TOKEN` | No | STS security token |
|
|
132
|
+
| `HW_WORKSPACE_ID` | No | Default workspace ID |
|
|
133
|
+
| `HDKITSERVICE_ENDPOINT` | No | hdkitservice API endpoint |
|
|
134
|
+
| `HWLINK_ENDPOINT` | No | DevStation API endpoint |
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-smn-dms
|
|
3
|
-
description: "Use when creating or managing SMN topics/subscriptions/messages or DMS Kafka/RabbitMQ/RocketMQ queues on Huawei Cloud. Triggers: SMN, DMS, notification, message queue, Kafka, RabbitMQ, RocketMQ, topic, subscription. NOT for: APIG (use huawei-apig), FunctionGraph triggers (use huawei-functiongraph)."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud SMN / DMS
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
Always run `hcloud SMN <Operation> --help` or `hcloud DMS <Operation> --help` before constructing commands.
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
Domain expertise for SMN (Simple Message Notification) and DMS (Distributed Message Service). SMN is used for notifications and alerts. DMS covers Kafka, RabbitMQ, and RocketMQ instances.
|
|
16
|
-
|
|
17
|
-
## SMN
|
|
18
|
-
|
|
19
|
-
## Critical Warnings
|
|
20
|
-
|
|
21
|
-
| Trap | Why |
|
|
22
|
-
|------|-----|
|
|
23
|
-
| Subscription confirmation | HTTP/HTTPS subscriptions need endpoint ping-back confirmation |
|
|
24
|
-
| Email subscription delay | Email subscriptions require user to click confirmation link |
|
|
25
|
-
| SMS charge per message | Template SMS incurs per-delivery charges |
|
|
26
|
-
|
|
27
|
-
### Common Workflows
|
|
28
|
-
|
|
29
|
-
| Task | Operation |
|
|
30
|
-
|------|-----------|
|
|
31
|
-
| List topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
32
|
-
| Create topic | `CreateTopic --cli-region=<r> --project_id=<p>` |
|
|
33
|
-
| Add subscription | `AddSubscription --cli-region=<r> --project_id=<p>` |
|
|
34
|
-
| List subscriptions | `ListSubscriptions --cli-region=<r> --project_id=<p>` |
|
|
35
|
-
| Create message template | `CreateMessageTemplate --cli-region=<r> --project_id=<p>` |
|
|
36
|
-
| Publish message | `PublishMessage --cli-region=<r> --project_id=<p>` |
|
|
37
|
-
| Delete topic | `DeleteTopic --cli-region=<r> --project_id=<p>` |
|
|
38
|
-
|
|
39
|
-
## DMS
|
|
40
|
-
|
|
41
|
-
### Service Types
|
|
42
|
-
|
|
43
|
-
| Type | KooCLI Service |
|
|
44
|
-
|------|---------------|
|
|
45
|
-
| Kafka | `hcloud DMS` |
|
|
46
|
-
| RabbitMQ | `hcloud DMS` |
|
|
47
|
-
| RocketMQ | `hcloud DMS` |
|
|
48
|
-
|
|
49
|
-
### Common Workflows
|
|
50
|
-
|
|
51
|
-
| Task | Operation |
|
|
52
|
-
|------|-----------|
|
|
53
|
-
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
54
|
-
| Create Kafka instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
55
|
-
| List Kafka topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
56
|
-
|
|
57
|
-
Discover exact parameters with `--help` before executing any command.
|
|
58
|
-
|
|
59
|
-
## Troubleshooting
|
|
60
|
-
|
|
61
|
-
| Error | Fix |
|
|
62
|
-
|-------|-----|
|
|
63
|
-
| Subscription not confirmed | SMN subscriptions need endpoint/user confirmation |
|
|
64
|
-
| DMS instance creation fails | Check VPC/subnet availability and engine version |
|
|
65
|
-
|
|
66
|
-
## Cross-Skill References
|
|
67
|
-
|
|
68
|
-
- **CES alarms**: See `huawei-cloud-eye` for SMN-based alarm notifications
|
|
69
|
-
- **VPC**: See `huawei-vpc` for DMS instance networking
|
|
1
|
+
---
|
|
2
|
+
name: huawei-smn-dms
|
|
3
|
+
description: "Use when creating or managing SMN topics/subscriptions/messages or DMS Kafka/RabbitMQ/RocketMQ queues on Huawei Cloud. Triggers: SMN, DMS, notification, message queue, Kafka, RabbitMQ, RocketMQ, topic, subscription. NOT for: APIG (use huawei-apig), FunctionGraph triggers (use huawei-functiongraph)."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud SMN / DMS
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
Always run `hcloud SMN <Operation> --help` or `hcloud DMS <Operation> --help` before constructing commands.
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Domain expertise for SMN (Simple Message Notification) and DMS (Distributed Message Service). SMN is used for notifications and alerts. DMS covers Kafka, RabbitMQ, and RocketMQ instances.
|
|
16
|
+
|
|
17
|
+
## SMN
|
|
18
|
+
|
|
19
|
+
## Critical Warnings
|
|
20
|
+
|
|
21
|
+
| Trap | Why |
|
|
22
|
+
|------|-----|
|
|
23
|
+
| Subscription confirmation | HTTP/HTTPS subscriptions need endpoint ping-back confirmation |
|
|
24
|
+
| Email subscription delay | Email subscriptions require user to click confirmation link |
|
|
25
|
+
| SMS charge per message | Template SMS incurs per-delivery charges |
|
|
26
|
+
|
|
27
|
+
### Common Workflows
|
|
28
|
+
|
|
29
|
+
| Task | Operation |
|
|
30
|
+
|------|-----------|
|
|
31
|
+
| List topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
32
|
+
| Create topic | `CreateTopic --cli-region=<r> --project_id=<p>` |
|
|
33
|
+
| Add subscription | `AddSubscription --cli-region=<r> --project_id=<p>` |
|
|
34
|
+
| List subscriptions | `ListSubscriptions --cli-region=<r> --project_id=<p>` |
|
|
35
|
+
| Create message template | `CreateMessageTemplate --cli-region=<r> --project_id=<p>` |
|
|
36
|
+
| Publish message | `PublishMessage --cli-region=<r> --project_id=<p>` |
|
|
37
|
+
| Delete topic | `DeleteTopic --cli-region=<r> --project_id=<p>` |
|
|
38
|
+
|
|
39
|
+
## DMS
|
|
40
|
+
|
|
41
|
+
### Service Types
|
|
42
|
+
|
|
43
|
+
| Type | KooCLI Service |
|
|
44
|
+
|------|---------------|
|
|
45
|
+
| Kafka | `hcloud DMS` |
|
|
46
|
+
| RabbitMQ | `hcloud DMS` |
|
|
47
|
+
| RocketMQ | `hcloud DMS` |
|
|
48
|
+
|
|
49
|
+
### Common Workflows
|
|
50
|
+
|
|
51
|
+
| Task | Operation |
|
|
52
|
+
|------|-----------|
|
|
53
|
+
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
54
|
+
| Create Kafka instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
55
|
+
| List Kafka topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
56
|
+
|
|
57
|
+
Discover exact parameters with `--help` before executing any command.
|
|
58
|
+
|
|
59
|
+
## Troubleshooting
|
|
60
|
+
|
|
61
|
+
| Error | Fix |
|
|
62
|
+
|-------|-----|
|
|
63
|
+
| Subscription not confirmed | SMN subscriptions need endpoint/user confirmation |
|
|
64
|
+
| DMS instance creation fails | Check VPC/subnet availability and engine version |
|
|
65
|
+
|
|
66
|
+
## Cross-Skill References
|
|
67
|
+
|
|
68
|
+
- **CES alarms**: See `huawei-cloud-eye` for SMN-based alarm notifications
|
|
69
|
+
- **VPC**: See `huawei-vpc` for DMS instance networking
|