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.
- package/.agents/plugins/marketplace.json +18 -18
- package/README.md +81 -51
- package/README.zh-CN.md +81 -49
- package/bin/setup.cjs +5 -3
- package/integrations/opencode/opencode.json +1 -4
- package/package.json +61 -44
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +64 -17
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +25 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +45 -44
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +127 -42
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +17 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +56 -53
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +108 -5
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
- package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
- package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
- 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 +122 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +9 -9
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +24 -26
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +510 -10
- package/plugins/huaweicloud-core/src/search-market.mjs +46 -12
- package/plugins/huaweicloud-core/src/setup-cli.mjs +1251 -181
- package/plugins/huaweicloud-core/src/tools.mjs +600 -122
- 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 +12 -15
- 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 +267 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-rds
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating, configuring, managing, or troubleshooting RDS instances on Huawei Cloud. Covers MySQL, PostgreSQL, SQL Server. Triggers: RDS, MySQL, PostgreSQL, database instance, backup, read replica. NOT for: GaussDB (use huawei-gaussdb), DDS (use huawei-dds-dcs).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -13,6 +13,7 @@ Always run `hcloud RDS <Operation> --help` before constructing commands to disco
|
|
|
13
13
|
## Prerequisites
|
|
14
14
|
|
|
15
15
|
Before creating an RDS instance, you MUST have:
|
|
16
|
+
|
|
16
17
|
- A VPC and subnet (see `huawei-vpc`)
|
|
17
18
|
- A security group with database port open (MySQL=3306, PostgreSQL=5432, SQL Server=1433)
|
|
18
19
|
- Run `hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>` to get spec codes
|
|
@@ -23,32 +24,33 @@ Before creating an RDS instance, you MUST have:
|
|
|
23
24
|
hcloud RDS <Operation> --cli-region=<region> [--key=value ...]
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
| Rule
|
|
27
|
-
|
|
28
|
-
| Service name
|
|
29
|
-
| Operation
|
|
30
|
-
| Params
|
|
31
|
-
| Array params
|
|
27
|
+
| Rule | Detail |
|
|
28
|
+
| -------------- | --------------------------------------------------------------------------------- |
|
|
29
|
+
| Service name | `RDS` (uppercase) |
|
|
30
|
+
| Operation | PascalCase: `ListInstances`, `CreateManualBackup` |
|
|
31
|
+
| Params | `--key=value` format. JSON params: `--key='{"k":"v"}'` |
|
|
32
|
+
| Array params | 1-based: `--instance_ids.1=xxx` |
|
|
32
33
|
| Password param | Conflicts with KooCLI system param; use `--cli-jsonInput` (see Critical Warnings) |
|
|
33
34
|
|
|
34
35
|
## Critical Warnings
|
|
35
36
|
|
|
36
|
-
| Trap
|
|
37
|
-
|
|
38
|
-
| Engine version immutable
|
|
39
|
-
| Automated backups use OBS
|
|
40
|
-
| Storage auto-scaling off by default | Enable before storage runs out or instance goes read-only
|
|
41
|
-
| `--password` conflicts with KooCLI
|
|
42
|
-
| Volume type must match flavor
|
|
43
|
-
| Flavor not in region
|
|
44
|
-
| `database_name` is case-sensitive
|
|
45
|
-
| Instance creation takes 3–8 min
|
|
46
|
-
| Body `--region` is required
|
|
47
|
-
| Restore creates new instance
|
|
37
|
+
| Trap | Why |
|
|
38
|
+
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| Engine version immutable | Cannot change MySQL to PostgreSQL in-place |
|
|
40
|
+
| Automated backups use OBS | Backup storage incurs separate charges. Set retention period explicitly |
|
|
41
|
+
| Storage auto-scaling off by default | Enable before storage runs out or instance goes read-only |
|
|
42
|
+
| `--password` conflicts with KooCLI | Use `--cli-jsonInput=<file>` with JSON file (see `--cli-jsonInput` section below). The `printf "b\n"` workaround is broken in KooCLI 7.2.12+ |
|
|
43
|
+
| Volume type must match flavor | General→CLOUDSSD; Dedicated→CLOUDSSD\|ESSD; ARM→ULTRAHIGH |
|
|
44
|
+
| Flavor not in region | Always `ListFlavors` first. Spec codes vary by region |
|
|
45
|
+
| `database_name` is case-sensitive | Use `MySQL` / `PostgreSQL` / `SQLServer` / `MariaDB` — NOT lower-case `mysql` |
|
|
46
|
+
| Instance creation takes 3–8 min | Status: BUILD→MODIFYING→ACTIVE. Poll every 15s: `hcloud RDS ListInstances --cli-region=<r> --instance_id=<id> \| jq '.instances[0].status'` |
|
|
47
|
+
| Body `--region` is required | CreateInstance body requires `--region=<r>` (same as `--cli-region`) or `DBS.280243` |
|
|
48
|
+
| Restore creates new instance | No in-place restore. Verify target flavor before restoring |
|
|
48
49
|
|
|
49
50
|
## Instance Management
|
|
50
51
|
|
|
51
52
|
### List
|
|
53
|
+
|
|
52
54
|
```bash
|
|
53
55
|
hcloud RDS ListInstances --cli-region=<r>
|
|
54
56
|
hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>
|
|
@@ -57,6 +59,7 @@ hcloud RDS ListEngineFlavors --instance_id=<id> --cli-region=<r>
|
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
### Create Instance
|
|
62
|
+
|
|
60
63
|
```bash
|
|
61
64
|
hcloud RDS CreateInstance --cli-region=<r> \
|
|
62
65
|
--region=<r> \
|
|
@@ -101,21 +104,22 @@ hcloud RDS CreateInstance --cli-region=<r> \
|
|
|
101
104
|
|
|
102
105
|
> Save as `rds-create.json` then: `hcloud RDS CreateInstance --cli-jsonInput=rds-create.json`. For `project_id`, run `hcloud IAM KeystoneListProjects`.
|
|
103
106
|
|
|
104
|
-
| Param
|
|
105
|
-
|
|
106
|
-
| `--name`
|
|
107
|
-
| `--datastore`
|
|
108
|
-
| `--flavor_ref`
|
|
109
|
-
| `--volume`
|
|
110
|
-
| `--vpc_id`
|
|
111
|
-
| `--subnet_id`
|
|
112
|
-
| `--security_group_id` | Yes
|
|
113
|
-
| `--availability_zone` | Yes
|
|
114
|
-
| `--charge_info`
|
|
115
|
-
| `--password`
|
|
116
|
-
| `--port`
|
|
107
|
+
| Param | Required | Note |
|
|
108
|
+
| --------------------- | -------- | -------------------------------------------------------------------------------------------- |
|
|
109
|
+
| `--name` | Yes | Instance name |
|
|
110
|
+
| `--datastore` | Yes | `--datastore.type=<engine> --datastore.version=<version>` |
|
|
111
|
+
| `--flavor_ref` | Yes | From `ListFlavors` output |
|
|
112
|
+
| `--volume` | Yes | Type matching: General→CLOUDSSD, Dedicated→CLOUDSSD\|ESSD, ARM→ULTRAHIGH |
|
|
113
|
+
| `--vpc_id` | Yes | Must exist in target region |
|
|
114
|
+
| `--subnet_id` | Yes | Must exist in target region |
|
|
115
|
+
| `--security_group_id` | Yes | Must have DB port open |
|
|
116
|
+
| `--availability_zone` | Yes | Use AZ code from `NovaListAvailabilityZones` |
|
|
117
|
+
| `--charge_info` | No | `--charge_info.charge_mode=<mode>`. Default postPaid (pay-per-use). Run `--help` for options |
|
|
118
|
+
| `--password` | Yes | 8-32 chars, uppercase+lowercase+digit+special |
|
|
119
|
+
| `--port` | No | Default 3306 (MySQL) / 5432 (PG) / 1433 (SQL Server) |
|
|
117
120
|
|
|
118
121
|
### Modify / Resize
|
|
122
|
+
|
|
119
123
|
```bash
|
|
120
124
|
hcloud RDS StartInstanceRestartAction --instance_id=<id> --cli-region=<r>
|
|
121
125
|
hcloud RDS StartResizeFlavorAction --instance_id=<id> --flavor_ref=<new-id> --cli-region=<r>
|
|
@@ -125,6 +129,7 @@ hcloud RDS UpdateInstanceAlias --instance_id=<id> --alias=<new-name> --cli-regio
|
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
### Delete
|
|
132
|
+
|
|
128
133
|
```bash
|
|
129
134
|
hcloud RDS DeleteInstance --instance_id=<id> --cli-region=<r>
|
|
130
135
|
```
|
|
@@ -172,41 +177,41 @@ psql -h <private_ip> -p 5432 -U root -d postgres
|
|
|
172
177
|
|
|
173
178
|
If a database client is not installed on the agent's machine, install one:
|
|
174
179
|
|
|
175
|
-
| Platform
|
|
176
|
-
|
|
177
|
-
| **Linux**
|
|
178
|
-
| **macOS**
|
|
179
|
-
| **Windows**
|
|
180
|
+
| Platform | MySQL | PostgreSQL |
|
|
181
|
+
| ---------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
|
|
182
|
+
| **Linux** | `apt install mysql-client` / `yum install mysql` | `apt install postgresql-client` |
|
|
183
|
+
| **macOS** | `brew install mysql-client` | `brew install libpq` |
|
|
184
|
+
| **Windows** | Download MySQL Workbench or `winget install Oracle.MySQL` | Download pgAdmin or `winget install PostgreSQL.PostgreSQL` |
|
|
180
185
|
| **Python (any)** | `pip install pymysql` then `python -c "import pymysql; ..."` | `pip install psycopg2` then `python -c "import psycopg2; ..."` |
|
|
181
|
-
| **Docker (any)** | `docker run -it --rm mysql:8 mysql -h <ip> -u root -p`
|
|
186
|
+
| **Docker (any)** | `docker run -it --rm mysql:8 mysql -h <ip> -u root -p` | `docker run -it --rm postgres:16 psql -h <ip> -U root` |
|
|
182
187
|
|
|
183
188
|
> If no client can be installed, use the Huawei Cloud **Data Studio** console: https://console.huaweicloud.com/dms/
|
|
184
189
|
|
|
185
190
|
## Mutating Operations (Require Approval)
|
|
186
191
|
|
|
187
|
-
| Operation
|
|
188
|
-
|
|
189
|
-
| `CreateInstance`
|
|
190
|
-
| `DeleteInstance`
|
|
191
|
-
| `StartResizeFlavorAction`
|
|
192
|
-
| `StartInstanceEnlargeVolumeAction` | Online, but irreversible
|
|
193
|
-
| `StartFailover`
|
|
194
|
-
| `CreateRestoreInstance`
|
|
195
|
-
| `CreateManualBackup`
|
|
196
|
-
| `DeleteManualBackup`
|
|
192
|
+
| Operation | Effect |
|
|
193
|
+
| ---------------------------------- | ------------------------------------ |
|
|
194
|
+
| `CreateInstance` | New instance (billing starts) |
|
|
195
|
+
| `DeleteInstance` | Irreversible data loss |
|
|
196
|
+
| `StartResizeFlavorAction` | Brief interruption during switchover |
|
|
197
|
+
| `StartInstanceEnlargeVolumeAction` | Online, but irreversible |
|
|
198
|
+
| `StartFailover` | Primary-standby switchover |
|
|
199
|
+
| `CreateRestoreInstance` | Creates new instance from backup |
|
|
200
|
+
| `CreateManualBackup` | Incurs OBS storage charges |
|
|
201
|
+
| `DeleteManualBackup` | Irreversible |
|
|
197
202
|
|
|
198
203
|
## Troubleshooting
|
|
199
204
|
|
|
200
|
-
| Error
|
|
201
|
-
|
|
202
|
-
| Connection refused
|
|
203
|
-
| Storage full
|
|
204
|
-
| DBS.280241 Invalid storage type | Volume type doesn't match flavor group
|
|
205
|
-
| DBS.280448 Sold out
|
|
206
|
-
| Replication lag
|
|
207
|
-
| Instance stuck BUILDING
|
|
208
|
-
| SYS.0403
|
|
209
|
-
| EIP.7905
|
|
205
|
+
| Error | Root Cause -> Fix |
|
|
206
|
+
| ------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| Connection refused | SG missing DB port. Add ingress rule |
|
|
208
|
+
| Storage full | Manual resize or enable auto-scaling |
|
|
209
|
+
| DBS.280241 Invalid storage type | Volume type doesn't match flavor group |
|
|
210
|
+
| DBS.280448 Sold out | Try different volume type or AZ |
|
|
211
|
+
| Replication lag | Check `ShowReplicationStatus`. Consider read replica |
|
|
212
|
+
| Instance stuck BUILDING | Check task status: `hcloud RDS ListTasks` |
|
|
213
|
+
| SYS.0403 | SCP policy denies this operation (e.g. security group rules, EIP binding). See `huawei-vpc` troubleshooting |
|
|
214
|
+
| EIP.7905 | EIP quota exceeded — cannot create new EIP for public access. See `huawei-vpc` troubleshooting |
|
|
210
215
|
|
|
211
216
|
## Security
|
|
212
217
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-sandbox
|
|
3
|
-
description:
|
|
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
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,36 +26,114 @@ Domain expertise for Huawei Cloud Sandbox (DevStation) instances and workspace t
|
|
|
26
26
|
|
|
27
27
|
### User Verification (Prerequisites)
|
|
28
28
|
|
|
29
|
-
| Tool
|
|
30
|
-
|
|
31
|
-
| `huaweicloud_sandbox_check_user`
|
|
29
|
+
| Tool | Purpose |
|
|
30
|
+
| ------------------------------------ | ----------------------------------------------------------- |
|
|
31
|
+
| `huaweicloud_sandbox_check_user` | Check real-name verification and agreement signing status |
|
|
32
32
|
| `huaweicloud_sandbox_sign_agreement` | Sign unsigned/outdated agreements (required before connect) |
|
|
33
33
|
|
|
34
34
|
### Sandbox Lifecycle
|
|
35
35
|
|
|
36
|
-
| Tool
|
|
37
|
-
|
|
38
|
-
| `huaweicloud_sandbox_connect`
|
|
39
|
-
| `huaweicloud_sandbox_credentials` | Inject temporary AK/SK into a running sandbox
|
|
36
|
+
| Tool | Purpose |
|
|
37
|
+
| --------------------------------- | ------------------------------------------------------------------------ |
|
|
38
|
+
| `huaweicloud_sandbox_connect` | Connect to sandbox (one user one instance, reuses existing if available) |
|
|
39
|
+
| `huaweicloud_sandbox_credentials` | Inject temporary AK/SK into a running sandbox |
|
|
40
40
|
|
|
41
41
|
### Terminal Execution
|
|
42
42
|
|
|
43
|
-
| Tool
|
|
44
|
-
|
|
45
|
-
| `huaweicloud_sandbox_exec_with_session` | Session-based execution (state persists)
|
|
46
|
-
| `
|
|
43
|
+
| Tool | Purpose |
|
|
44
|
+
| --------------------------------------- | --------------------------------------------------------------------------- |
|
|
45
|
+
| `huaweicloud_sandbox_exec_with_session` | Session-based execution (state persists; best for interactive work) |
|
|
46
|
+
| `huaweicloud_sandbox_exec_one_shot` | One-shot execution (fresh connection; best for long/heavy commands) |
|
|
47
|
+
| `huaweicloud_sandbox_upload_file` | Upload a local file into the sandbox (chunked base64 write + md5 verify) |
|
|
48
|
+
| `huaweicloud_sandbox_upload_project` | Upload a local project directory to sandbox (HTTP tunnel, tar.gz + extract) |
|
|
49
|
+
| `huaweicloud_sandbox_close_session` | Close a persistent terminal session |
|
|
50
|
+
|
|
51
|
+
### Tool Selection Guide
|
|
52
|
+
|
|
53
|
+
| Scenario | Use | Why |
|
|
54
|
+
| ---------------------------------- | ---------------------------------- | ------------------------------------------------------------ |
|
|
55
|
+
| `cd`, env setup, command chains | `exec_with_session` | Needs shared shell state across calls |
|
|
56
|
+
| `npm install`, `apt-get`, builds | `exec_one_shot` | Long-running (>30s), no state needed, more stable |
|
|
57
|
+
| `curl`, health checks, quick tests | Either — `exec_one_shot` preferred | Stateless, fast |
|
|
58
|
+
| Server startup (background) | `exec_with_session` | Need to `nohup ... &` then check output in same session |
|
|
59
|
+
| Deployment scripts | `exec_one_shot+shot` | Long script, fresh connection avoids session timeouts |
|
|
60
|
+
| Single file upload (<1MB) | `upload_file` | Base64 chunked, reliable for small files |
|
|
61
|
+
| Project directory upload (>1MB) | `upload_project` | HTTP tunnel, much faster than base64 for multi-file projects |
|
|
62
|
+
|
|
63
|
+
**Timeout tuning**: default is 120s. For commands expected to run longer (e.g. large builds), pass `timeout_ms` explicitly:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{ "timeout_ms": 300000 }
|
|
67
|
+
```
|
|
47
68
|
|
|
48
69
|
## Workflow
|
|
49
70
|
|
|
50
71
|
Setup is a **plugin-side preflight** — the developer should be asked a question only once, when the agreement actually needs signing:
|
|
51
72
|
|
|
52
|
-
1. **Check user** (transparent): `huaweicloud_sandbox_check_user` —
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
1. **Check user** (transparent): `huaweicloud_sandbox_check_user` — returns `realnameVerified`/`agreementSigned` (200) when all good, OR throws a 403 error with one of these codes:
|
|
74
|
+
- `HDKIT_NOT_REALNAME` — real-name missing only → go to step 2
|
|
75
|
+
- `HDKIT_NOT_AGREEMENT` — latest agreement not signed only → go to step 3
|
|
76
|
+
- `HDKIT_NOT_REALNAME_AND_AGREEMENT` — both missing → go to step 4
|
|
77
|
+
2. **Real-name verification only** (`HDKIT_NOT_REALNAME`): tell the developer once, "Huawei Cloud requires real-name verification before using the sandbox — please complete it in the Huawei Cloud console (实名认证)." and stop — do not retry `connect` in a loop
|
|
78
|
+
3. **Sign agreement only** (`HDKIT_NOT_AGREEMENT`): **STOP and do NOT sign on your own.** Ask the developer: "Huawei Cloud sandbox requires signing the latest developer service agreement. May I sign it for you?" Then **wait for the developer to explicitly agree** (e.g. "签署" / "确认" / "sign it"). Only after explicit consent call `huaweicloud_sandbox_sign_agreement` and return its result (`signed`/`signedCount`) to the developer. **Never sign a legal agreement on the developer's behalf without their explicit, unambiguous consent.** Do not expose the underlying sandbox/DevBridge service as a separate entity the developer must understand or sign up for
|
|
79
|
+
4. **Both missing** (`HDKIT_NOT_REALNAME_AND_AGREEMENT`): present **both** requirements together in one message — the real-name verification steps (console, step 2) **and** the agreement-signing request (step 3, wait for explicit consent) — so the developer can complete both at once
|
|
80
|
+
5. **Connect**: `huaweicloud_sandbox_connect` — returns `session_id`, `dev_stage_id`, `connection_id`, `connection_address`
|
|
81
|
+
6. **Inject credentials** (optional): `huaweicloud_sandbox_credentials` — enables cloud API access from sandbox
|
|
82
|
+
7. **Execute commands**: use `huaweicloud_sandbox_exec_with_session` for interactive work (cd, env setup), or `huaweicloud_sandbox_exec_one_shot` for long-running builds/installs. See [Tool Selection Guide](#tool-selection-guide).
|
|
83
|
+
8. **Upload project** (if deploying local code): `huaweicloud_sandbox_upload_project` to transfer a local project directory into `/workspace/<name>` — uses HTTP tunnel, much faster than base64 for multi-file projects. Use `huaweicloud_sandbox_upload_file` for single files.
|
|
84
|
+
9. **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
|
|
85
|
+
|
|
86
|
+
## File Transfer (local → sandbox)
|
|
87
|
+
|
|
88
|
+
### upload_project (preferred for directories)
|
|
89
|
+
|
|
90
|
+
`huaweicloud_sandbox_upload_project` packages a local directory as tar.gz, uploads it to the sandbox via HTTP tunnel, and extracts it. This is the fastest way to transfer multi-file projects.
|
|
91
|
+
|
|
92
|
+
**Prerequisites**: sandbox must already be connected (`sandbox_connect` called first). The tool handles everything internally — no manual setup needed.
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"local_dir": "/path/to/local/project",
|
|
97
|
+
"remote_dir": "/workspace",
|
|
98
|
+
"extract": true,
|
|
99
|
+
"exclude": ["node_modules", ".git", "__pycache__"]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- `local_dir` (required): local project directory
|
|
104
|
+
- `remote_dir` (optional, default `/workspace`): parent directory on sandbox
|
|
105
|
+
- `extract` (optional, default `true`): extract tar.gz after upload
|
|
106
|
+
- `exclude` (optional): patterns to exclude from archive
|
|
107
|
+
- Result includes `md5` and `md5Verified` for integrity check
|
|
108
|
+
|
|
109
|
+
### upload_file (for single files)
|
|
110
|
+
|
|
111
|
+
`huaweicloud_sandbox_upload_file` (local_path → remote_path) uploads a local file by base64-encoding it and writing it in small chunks through the terminal session, then decoding and verifying the md5 checksum. Use it for individual files, especially small ones (<1MB).
|
|
112
|
+
|
|
113
|
+
### Exec channel size limit
|
|
114
|
+
|
|
115
|
+
`huaweicloud_sandbox_exec_with_session` and `huaweicloud_sandbox_exec_one_shot` are fragile for long commands and large inline content. Do NOT paste a file's base64 directly into a single command:
|
|
116
|
+
|
|
117
|
+
| Payload | Result |
|
|
118
|
+
| --------------------------- | -------------------------------------- |
|
|
119
|
+
| ~30KB base64 in one command | exec timeout |
|
|
120
|
+
| ~12KB base64 in one command | session crash (`session is not ready`) |
|
|
121
|
+
| ~4–5KB normal command | OK |
|
|
122
|
+
|
|
123
|
+
Keep individual exec commands small (≤ ~4KB). For larger content, use `huaweicloud_sandbox_upload_file` instead.
|
|
124
|
+
|
|
125
|
+
### OBS transfer fallback
|
|
126
|
+
|
|
127
|
+
When the upload tool is unavailable, transfer through OBS: upload to a public-read object locally, then pull it into the sandbox.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Local: upload to OBS (public read)
|
|
131
|
+
hcloud OBS cp <local-file> obs://<bucket>/<key> -f -acl=public-read
|
|
132
|
+
# Sandbox: pull it down
|
|
133
|
+
curl -s -o /workspace/<repo>/<file> https://<bucket>.obs.<region>.myhuaweicloud.com/<key>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
> Requires OBS credentials (`huaweicloud_setup_obs_config`). Bucket ACL does not cascade to objects — set object-level `-acl=public-read` for anonymous reads.
|
|
59
137
|
|
|
60
138
|
## Expose the deployed app (public URL)
|
|
61
139
|
|
|
@@ -66,7 +144,11 @@ Expose a deployed web app to a public URL and return that URL to the developer.
|
|
|
66
144
|
**Install** (internal tooling; skip if `devbridge version` already works):
|
|
67
145
|
|
|
68
146
|
```bash
|
|
69
|
-
|
|
147
|
+
if command -v devbridge >/dev/null 2>&1; then
|
|
148
|
+
echo "devbridge already installed"
|
|
149
|
+
else
|
|
150
|
+
curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh | bash
|
|
151
|
+
fi
|
|
70
152
|
export PATH=$PATH:$HOME/.huawei/bin # installer only writes ~/.bashrc; session shells do not re-source it
|
|
71
153
|
```
|
|
72
154
|
|
|
@@ -95,20 +177,23 @@ sleep 10 && cat /tmp/host.log
|
|
|
95
177
|
|
|
96
178
|
## Critical Warnings
|
|
97
179
|
|
|
98
|
-
| Trap
|
|
99
|
-
|
|
100
|
-
| Agreement required first
|
|
101
|
-
| Real-name required
|
|
102
|
-
| Never expose tunnel details
|
|
103
|
-
| Login needs `--huaweicloud`
|
|
104
|
-
| CLI PATH
|
|
105
|
-
| 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
|
|
106
|
-
| Return the deployment URL
|
|
107
|
-
| Session state persists
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
180
|
+
| Trap | Why |
|
|
181
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
182
|
+
| 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 |
|
|
183
|
+
| Real-name required | `sandbox_connect` fails if `realnameVerified=false`; tell the developer once and stop, don't loop on connect |
|
|
184
|
+
| Never expose tunnel details | Do not mention "DevBridge"/"tunnel"/"devbridge" to the developer — say "正在生成访问地址..." and hand over only the URL |
|
|
185
|
+
| Login needs `--huaweicloud` | `devbridge auth login --access-key/--secret-key` without `--huaweicloud` falls back to interactive browser login, which fails in the sandbox |
|
|
186
|
+
| CLI PATH | The installer only writes `~/.bashrc`; run `export PATH=$PATH:$HOME/.huawei/bin` in the session before using `devbridge` |
|
|
187
|
+
| 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 |
|
|
188
|
+
| Return the deployment URL | Always hand the public URL from the host log to the developer as the final result |
|
|
189
|
+
| Session state persists | `exec_with_session` preserves `cd`, env vars, aliases between calls |
|
|
190
|
+
| Long commands prefer one-shot | `exec_one_shot` creates a fresh connection per call — more stable for builds, installs, and scripts >30s. See [Tool Selection Guide](#tool-selection-guide). |
|
|
191
|
+
| Destructive commands blocked | `rm -rf /`, `mkfs`, `dd if=`, fork bombs are denied by safety policy |
|
|
192
|
+
| Workspace ID = dev_stage_id | Use `dev_stage_id` from `sandbox_connect` as `workspace_id` for terminal exec |
|
|
193
|
+
| 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 |
|
|
194
|
+
| Upload project for local code | Use `sandbox_upload_project` to transfer local projects — packages as tar.gz, uploads via HTTP tunnel, extracts on sandbox. Much faster than base64 for multi-file projects |
|
|
195
|
+
| Upload file for single files | Use `sandbox_upload_file` for individual files — base64 chunked, reliable for small files (<1MB) |
|
|
196
|
+
| 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") |
|
|
112
197
|
|
|
113
198
|
## Node.js in the sandbox
|
|
114
199
|
|
|
@@ -125,11 +210,11 @@ node --version
|
|
|
125
210
|
|
|
126
211
|
## Environment Variables
|
|
127
212
|
|
|
128
|
-
| Variable
|
|
129
|
-
|
|
130
|
-
| `HW_ACCESS_KEY`
|
|
131
|
-
| `HW_SECRET_KEY`
|
|
132
|
-
| `HW_SECURITY_TOKEN`
|
|
133
|
-
| `HW_WORKSPACE_ID`
|
|
134
|
-
| `HDKITSERVICE_ENDPOINT` | No
|
|
135
|
-
| `HWLINK_ENDPOINT`
|
|
213
|
+
| Variable | Required | Description |
|
|
214
|
+
| ----------------------- | -------- | --------------------------------------------------------------- |
|
|
215
|
+
| `HW_ACCESS_KEY` | Yes | Huawei Cloud AK |
|
|
216
|
+
| `HW_SECRET_KEY` | Yes | Huawei Cloud SK |
|
|
217
|
+
| `HW_SECURITY_TOKEN` | No | STS security token |
|
|
218
|
+
| `HW_WORKSPACE_ID` | No | Default workspace ID |
|
|
219
|
+
| `HDKITSERVICE_ENDPOINT` | No | hdkitservice API endpoint (default: devkit.huaweicloud.com) |
|
|
220
|
+
| `HWLINK_ENDPOINT` | No | DevStation API endpoint (default: devstation.myhuaweicloud.com) |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-smn-dms
|
|
3
|
-
description:
|
|
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
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,50 +18,50 @@ Domain expertise for SMN (Simple Message Notification) and DMS (Distributed Mess
|
|
|
18
18
|
|
|
19
19
|
## Critical Warnings
|
|
20
20
|
|
|
21
|
-
| Trap
|
|
22
|
-
|
|
21
|
+
| Trap | Why |
|
|
22
|
+
| ------------------------- | ------------------------------------------------------------- |
|
|
23
23
|
| Subscription confirmation | HTTP/HTTPS subscriptions need endpoint ping-back confirmation |
|
|
24
|
-
| Email subscription delay
|
|
25
|
-
| SMS charge per message
|
|
24
|
+
| Email subscription delay | Email subscriptions require user to click confirmation link |
|
|
25
|
+
| SMS charge per message | Template SMS incurs per-delivery charges |
|
|
26
26
|
|
|
27
27
|
### Common Workflows
|
|
28
28
|
|
|
29
|
-
| Task
|
|
30
|
-
|
|
31
|
-
| List topics
|
|
32
|
-
| Create topic
|
|
33
|
-
| Add subscription
|
|
34
|
-
| List subscriptions
|
|
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
35
|
| Create message template | `CreateMessageTemplate --cli-region=<r> --project_id=<p>` |
|
|
36
|
-
| Publish message
|
|
37
|
-
| Delete topic
|
|
36
|
+
| Publish message | `PublishMessage --cli-region=<r> --project_id=<p>` |
|
|
37
|
+
| Delete topic | `DeleteTopic --cli-region=<r> --project_id=<p>` |
|
|
38
38
|
|
|
39
39
|
## DMS
|
|
40
40
|
|
|
41
41
|
### Service Types
|
|
42
42
|
|
|
43
|
-
| Type
|
|
44
|
-
|
|
45
|
-
| Kafka
|
|
46
|
-
| RabbitMQ | `hcloud DMS`
|
|
47
|
-
| RocketMQ | `hcloud DMS`
|
|
43
|
+
| Type | KooCLI Service |
|
|
44
|
+
| -------- | -------------- |
|
|
45
|
+
| Kafka | `hcloud DMS` |
|
|
46
|
+
| RabbitMQ | `hcloud DMS` |
|
|
47
|
+
| RocketMQ | `hcloud DMS` |
|
|
48
48
|
|
|
49
49
|
### Common Workflows
|
|
50
50
|
|
|
51
|
-
| Task
|
|
52
|
-
|
|
53
|
-
| List instances
|
|
51
|
+
| Task | Operation |
|
|
52
|
+
| --------------------- | -------------------------------------------------- |
|
|
53
|
+
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
54
54
|
| Create Kafka instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
55
|
-
| List Kafka topics
|
|
55
|
+
| List Kafka topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
56
56
|
|
|
57
57
|
Discover exact parameters with `--help` before executing any command.
|
|
58
58
|
|
|
59
59
|
## Troubleshooting
|
|
60
60
|
|
|
61
|
-
| Error
|
|
62
|
-
|
|
63
|
-
| Subscription not confirmed
|
|
64
|
-
| DMS instance creation fails | Check VPC/subnet availability and engine version
|
|
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
65
|
|
|
66
66
|
## Cross-Skill References
|
|
67
67
|
|