huaweicloud-devkit 0.1.19 → 0.1.20

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/README.md CHANGED
@@ -143,6 +143,13 @@ Agent 技能是经过整理的指令和参考材料包,帮助 Agent 完成特
143
143
  - [安全模型](docs/safety-model.md)
144
144
  - [KooCLI 官方文档](https://support.huaweicloud.com/qs-hcli/hcli_02_003.html)
145
145
 
146
+ ## 发布流程
147
+
148
+ 发布采用两步 workflow,全部在 GitHub Actions 中完成:
149
+
150
+ 1. **Prepare Release**(手动触发,选 `patch` / `minor` / `major`):自动 bump 版本、跑质量门、推 `release/vX.Y.Z` 分支并创建 PR,CI 全绿后自动合并进 `main`。
151
+ 2. **Publish Release**(PR 合并后手动触发):读取 `main` 版本,创建并推送 `vX.Y.Z` tag,生成 GitHub Release;tag 触发 `CD Production`,经 `production` 环境人工审批后发布到 npm(包名 `huaweicloud-devkit`)。
152
+
146
153
  ## 许可证
147
154
 
148
155
  本项目基于 Apache-2.0 许可证发布。详见 [LICENSE](LICENSE)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
5
5
  "type": "module",
6
6
  "files": [
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "0.1.19",
23
+ "version": "0.1.20",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud-mate"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-core",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
5
  "author": {
6
6
  "name": "HuaweiCloud Mate",
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "0.1.19",
23
+ "version": "0.1.20",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud-mate"
@@ -12,7 +12,7 @@ description: |
12
12
 
13
13
  # Huawei Cloud Agent Skills Search and Discovery
14
14
 
15
- This skill enables users to efficiently search, discover, and install Huawei Cloud skills.
15
+ This skill enables users to efficiently search, discover, and install Huawei Cloud skills.
16
16
 
17
17
  ## Scenario Description
18
18
 
@@ -12,7 +12,7 @@ Always run `hcloud DDS <Operation> --help` or `hcloud DCS <Operation> --help` be
12
12
 
13
13
  ## DDS (Document Database Service — MongoDB Compatible)
14
14
 
15
- ## Critical Warnings
15
+ ## DDS Critical Warnings
16
16
 
17
17
  | Trap | Why |
18
18
  |------|-----|
@@ -35,7 +35,7 @@ Discover exact parameters with `--help` before executing any command.
35
35
 
36
36
  ## DCS (Distributed Cache Service — Redis/Memcached)
37
37
 
38
- ## Critical Warnings
38
+ ## DCS Critical Warnings
39
39
 
40
40
  | Trap | Why |
41
41
  |------|-----|
@@ -58,18 +58,20 @@ hcloud ECS CreateServers ... --server.user_data=$user_data
58
58
  ```
59
59
 
60
60
  > **Security**: Never embed secrets (passwords, AK/SK, tokens) in user_data. It is stored unencrypted and readable from within the instance via IMDS. Fetch secrets at boot from DEW/CSMS instead.
61
-
61
+ >
62
62
  > **Debugging**: If the script didn't run, check `/var/log/cloud-init-output.log` on the instance.
63
63
 
64
64
  ## 7. EIP (optional)
65
65
  hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
66
66
 
67
+ ```bash
67
68
  # Get the ECS network port ID
68
69
  hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
69
70
  # → addresses.<vpc-id>[].OS-EXT-IPS:port_id
70
71
 
71
72
  # Bind EIP via port
72
73
  hcloud EIP AssociatePublicips --publicip_id=<eip-id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
74
+ ```
73
75
 
74
76
  ## 8. Verify
75
77
  hcloud ECS ListServersDetails --cli-region=<region> --server_id=<instance-id>
@@ -138,5 +138,5 @@ hcloud FunctionGraph DeleteFunctionTrigger --function_urn=<urn> --trigger_type_c
138
138
  ```
139
139
 
140
140
  > Deleting a trigger does NOT cascade-delete the associated APIG API. After `DeleteFunctionTrigger`, also run `hcloud APIG ListApisV2 --instance_id=<id>` and delete orphaned APIs to avoid resource residue.
141
-
141
+ >
142
142
  > **APIG event format**: When using DEDICATEDGATEWAY, the event body is Base64 encoded and uses a non-standard structure. See `apig-event-format.md` for handler templates.
@@ -57,14 +57,12 @@ Agent processes find executables through `PATH`. If OpenCode/Codex cannot find `
57
57
 
58
58
  ## Configure Credentials Outside Chat
59
59
 
60
- **NEVER let AK/SK enter shell history. This is the #1 credential leak vector.**
61
-
62
60
  - Create AK/SK in the Huawei Cloud console under `My Credentials -> Access Keys`.
63
- - **Interactive** (preferred, SAFE): `hcloud configure init` — prompts for AK/SK via terminal input. Values do NOT enter shell history.
64
- - **Non-interactive** (DANGEROUS — AK/SK in shell history): `hcloud configure set --cli-access-key=<AK> --cli-secret-key=<SK> --cli-region=<region>`. Only use in ephemeral CI/CD shells. User must execute outside agent chat.
65
- - If MCP is available, use `huaweicloud_show_profile_redacted` to check status without ever seeing credentials.
61
+ - **Interactive** (preferred): `hcloud configure init` — prompts safely for AK/SK/region.
62
+ - **Non-interactive** (Agent/CI environments): `hcloud configure set --cli-access-key=<AK> --cli-secret-key=<SK> --cli-region=<region>` user must execute outside agent chat.
63
+ - Required concepts: Access Key ID, Secret Access Key, Region such as `ap-southeast-3`, and Project ID.
66
64
  - Never paste AK/SK, passwords, tokens, or profile files into the agent conversation.
67
- - KooCLI stores credentials in `~/.hcloud/config.json`, NOT environment variables. `HCLOUD_ACCESS_KEY` / `HCLOUD_SECRET_KEY` / `HCLOUD_REGION` env vars are NOT read by KooCLI 7.x.
65
+ - KooCLI stores credentials in `~/.hcloud/config.json`, NOT environment variables. `HCLOUD_ACCESS_KEY` / `HCLOUD_SECRET_KEY` / `HCLOUD_REGION` env vars are NOT read by KooCLI 7.x. Always use `hcloud configure set`.
68
66
 
69
67
  ## Safe Flow
70
68
 
@@ -72,14 +70,14 @@ Agent processes find executables through `PATH`. If OpenCode/Codex cannot find `
72
70
  2. **KooCLI first-run privacy agreement**: On a fresh KooCLI install, `hcloud` blocks with `同意并继续使用(y)/不同意并退出(N)` and fails with `[USE_ERROR]您输入的是无效字符` in non-interactive mode. Detection: check command output for these strings. Ask the user: "KooCLI needs to accept its privacy agreement. May I accept it on your behalf?" If the user agrees, run `huaweicloud_run_readonly_command` with `args=["version"]` and `stdin="y\n"`. This accepts the agreement once, after which hcloud works normally.
73
71
  3. Ask the user to configure credentials outside the agent conversation when setup is needed.
74
72
  4. Inspect profile and region only through redacted tooling.
75
- 4. Discover exact operation names with `hcloud <Service> --help` before guessing. Example: ECS instance listing is commonly `ECS ListServersDetails`; ECS creation is commonly `ECS CreateServers`; image lookup may be under `IMS GlanceShowImage`.
76
- 5. Use `--cli-output=json` for machine-readable responses when supported.
77
- 6. For resource operations, include `--cli-region`, `--cli-profile`, and service-specific project information when required.
78
- 7. Classify every command before running it:
73
+ 5. Discover exact operation names with `hcloud <Service> --help` before guessing. Example: ECS instance listing is commonly `ECS ListServersDetails`; ECS creation is commonly `ECS CreateServers`; image lookup may be under `IMS GlanceShowImage`.
74
+ 6. Use `--cli-output=json` for machine-readable responses when supported.
75
+ 7. For resource operations, include `--cli-region`, `--cli-profile`, and service-specific project information when required.
76
+ 8. Classify every command before running it:
79
77
  - Read-only: `List*`, `Show*`, `Get*`, `Describe*`.
80
78
  - Write: `Create*`, `Delete*`, `Update*`, `Resize*`, `Start*`, `Stop*`, `Authorize*`, and similar.
81
79
  - Secret: any operation returning secret string, binary secret, token, or password.
82
- 8. For write operations, show the exact command and ask for explicit approval.
80
+ 9. For write operations, show the exact command and ask for explicit approval.
83
81
 
84
82
  ## KooCLI Syntax Notes
85
83
 
@@ -592,10 +592,7 @@ async function cmdInstallHcloud() {
592
592
  }
593
593
 
594
594
  console.log('\nAfter install, set HCLOUD_BIN if hcloud is not on PATH.');
595
- console.log('\n\x1b[1m\x1b[33m=== Configure credentials SAFELY ===\x1b[0m');
596
- console.log(' Interactive (safe): hcloud configure init');
597
- console.log(' NEVER: hcloud configure set --cli-access-key=xxx (AK/SK in shell history!)');
598
- console.log('\nThen run: npx huaweicloud-devkit doctor');
595
+ console.log('Then run: npx huaweicloud-devkit doctor');
599
596
  }
600
597
 
601
598
  async function main() {