huaweicloud-devkit 1.0.2-dev.9 → 1.0.2-next.10

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 (99) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +178 -138
  4. package/README.zh-CN.md +176 -138
  5. package/bin/setup.cjs +10 -8
  6. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  7. package/integrations/opencode/opencode.json +11 -14
  8. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
  9. package/package.json +60 -44
  10. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +31 -44
  11. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +30 -43
  12. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +31 -44
  13. package/plugins/huaweicloud-core/.mcp.json +13 -15
  14. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +31 -44
  15. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  16. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
  17. package/plugins/huaweicloud-core/safety/policy.json +76 -100
  18. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +227 -199
  19. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
  20. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  21. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  22. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +103 -101
  23. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
  24. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +191 -190
  25. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +171 -124
  26. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  27. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  28. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +57 -56
  29. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +106 -97
  30. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +36 -29
  31. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +29 -23
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +188 -185
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +144 -133
  34. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  35. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +57 -55
  36. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -131
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +60 -58
  39. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +72 -71
  40. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  41. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  42. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +69 -65
  44. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  45. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +148 -122
  46. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
  47. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  48. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +134 -127
  49. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
  50. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +31 -26
  51. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +101 -100
  52. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
  53. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  54. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +229 -224
  55. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +173 -134
  56. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  57. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
  58. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +77 -76
  59. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +60 -59
  60. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
  61. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  62. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
  63. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  64. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +56 -47
  65. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  66. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +138 -128
  67. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  68. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +111 -96
  69. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  70. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +20 -20
  71. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +30 -28
  72. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +59 -60
  73. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  74. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  75. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  76. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +54 -1
  77. package/plugins/huaweicloud-core/src/auth/credentials.mjs +103 -95
  78. package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
  79. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  80. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +283 -265
  81. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  82. package/plugins/huaweicloud-core/src/mcp-server.mjs +130 -129
  83. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +68 -0
  84. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
  85. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +140 -137
  86. package/plugins/huaweicloud-core/src/safety-policy.mjs +356 -302
  87. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +86 -87
  88. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +150 -153
  89. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +196 -105
  90. package/plugins/huaweicloud-core/src/search-market.mjs +208 -169
  91. package/plugins/huaweicloud-core/src/setup-cli.mjs +2622 -1594
  92. package/plugins/huaweicloud-core/src/tools.mjs +463 -111
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +447 -427
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +128 -132
  95. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +215 -227
  96. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +189 -202
  97. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +164 -158
  98. package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
  99. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
@@ -1,56 +1,56 @@
1
- # IAM Quick Reference
2
-
3
- ## Common Operations
4
-
5
- ```bash
6
- hcloud IAM KeystoneListProjects # list projects
7
- hcloud IAM KeystoneListUsers # list users
8
- hcloud IAM KeystoneListGroups # list groups
9
- hcloud IAM ListCustomPolicies # list custom policies
10
- hcloud IAM ListAgencies # list agencies
11
- hcloud IAM KeystoneListAuthDomains # list domains
12
- hcloud IAM KeystoneShowUser # show user detail
13
- ```
14
-
15
- ## Credential Management
16
-
17
- ```bash
18
- hcloud IAM KeystoneListAccessKeys --user_id=<id> # list AK/SK for user
19
- hcloud IAM CreateLoginToken # create login token
20
- hcloud IAM GetAccountSummary # account summary
21
- ```
22
-
23
- ## Security Best Practices
24
-
25
- 1. **NEVER create IAM users** — use IAM Identity Center or temporary STS tokens
26
- 2. **NEVER create long-term AK/SK** — use temporary credentials
27
- 3. **Least privilege by default** — start empty, add only needed actions
28
- 4. **Scope resources** — no `*` wildcards on Resource
29
- 5. **Use condition keys** — `g:RequestedRegion`, `g:ResourceTag`, `g:CurrentTime`
30
- 6. **Rotate AK/SK every 90 days** — or use agency delegation
31
-
32
- ## IAM vs AWS Comparison
33
-
34
- | AWS | Huawei Cloud |
35
- |-----|-------------|
36
- | `iam:ListUsers` | `iam:users:list` (lowercase + colon) |
37
- | AWS Managed Policy | System Policy (系统策略) |
38
- | Customer Managed | Custom Policy (自定义策略) |
39
- | Resource-Based Policy | Project-Level Policy (项目级策略) |
40
- | IAM Role | Agency (委托) |
41
-
42
- > Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
43
-
44
- ## Confused Deputy Protection
45
-
46
- ```json
47
- {
48
- "Effect": "Allow",
49
- "Action": ["ecs:*"],
50
- "Resource": ["*"],
51
- "Condition": {
52
- "StringEquals": {"g:SourceAccount": "<account-id>"},
53
- "StringLike": {"g:SourceUrn": "urn:fss:*"}
54
- }
55
- }
56
- ```
1
+ # IAM Quick Reference
2
+
3
+ ## Common Operations
4
+
5
+ ```bash
6
+ hcloud IAM KeystoneListProjects # list projects
7
+ hcloud IAM KeystoneListUsers # list users
8
+ hcloud IAM KeystoneListGroups # list groups
9
+ hcloud IAM ListCustomPolicies # list custom policies
10
+ hcloud IAM ListAgencies # list agencies
11
+ hcloud IAM KeystoneListAuthDomains # list domains
12
+ hcloud IAM KeystoneShowUser # show user detail
13
+ ```
14
+
15
+ ## Credential Management
16
+
17
+ ```bash
18
+ hcloud IAM KeystoneListAccessKeys --user_id=<id> # list AK/SK for user
19
+ hcloud IAM CreateLoginToken # create login token
20
+ hcloud IAM GetAccountSummary # account summary
21
+ ```
22
+
23
+ ## Security Best Practices
24
+
25
+ 1. **NEVER create IAM users** — use IAM Identity Center or temporary STS tokens
26
+ 2. **NEVER create long-term AK/SK** — use temporary credentials
27
+ 3. **Least privilege by default** — start empty, add only needed actions
28
+ 4. **Scope resources** — no `*` wildcards on Resource
29
+ 5. **Use condition keys** — `g:RequestedRegion`, `g:ResourceTag`, `g:CurrentTime`
30
+ 6. **Rotate AK/SK every 90 days** — or use agency delegation
31
+
32
+ ## IAM vs AWS Comparison
33
+
34
+ | AWS | Huawei Cloud |
35
+ | --------------------- | ------------------------------------ |
36
+ | `iam:ListUsers` | `iam:users:list` (lowercase + colon) |
37
+ | AWS Managed Policy | System Policy (系统策略) |
38
+ | Customer Managed | Custom Policy (自定义策略) |
39
+ | Resource-Based Policy | Project-Level Policy (项目级策略) |
40
+ | IAM Role | Agency (委托) |
41
+
42
+ > Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
43
+
44
+ ## Confused Deputy Protection
45
+
46
+ ```json
47
+ {
48
+ "Effect": "Allow",
49
+ "Action": ["ecs:*"],
50
+ "Resource": ["*"],
51
+ "Condition": {
52
+ "StringEquals": { "g:SourceAccount": "<account-id>" },
53
+ "StringLike": { "g:SourceUrn": "urn:fss:*" }
54
+ }
55
+ }
56
+ ```
@@ -1,65 +1,65 @@
1
- ---
2
- name: huawei-modelarts
3
- description: "Use when training, deploying, or managing AI/ML models on Huawei Cloud ModelArts. Covers training jobs, model registry, online services, notebook instances. Triggers: ModelArts, model training, AI, machine learning, deep learning, notebook, inference, deployment. NOT for: general AI/ML concepts, non-Huawei platforms."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud ModelArts
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud ModelArts <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
-
13
- ## Overview
14
-
15
- Domain expertise for ModelArts. Covers training jobs, model deployment, notebook instances, and OBS integration.
16
-
17
- ## Critical Warnings
18
-
19
- | Trap | Why |
20
- |------|-----|
21
- | OBS bucket required | All training data, model outputs, and notebook storage use OBS. Create bucket first |
22
- | Training charges by duration | Pay-per-minute GPU/CPU billing. Stop unused notebooks and services |
23
- | Notebook auto-stop needed | Default no auto-stop — can run indefinitely and incur charges |
24
- | Model deployment needs quota | Online services may require service quota approval in new accounts |
25
- | Training job output must be OBS | Local output not supported. Ensure `--output_path` is a valid OBS path |
26
-
27
- ## Prerequisites
28
-
29
- - Training data must be stored in an OBS bucket (see `huawei-obs`)
30
- - Output path for trained models must be an OBS path
31
- - Notebook instances need a VPC/subnet (see `huawei-vpc`)
32
-
33
- ## Common Workflows
34
-
35
- | Task | Operation |
36
- |------|-----------|
37
- | List models | `ListModels --cli-region=<r> --project_id=<p>` |
38
- | List training jobs | `ListTrainJobs --cli-region=<r> --project_id=<p>` |
39
- | List services | `ListServices --cli-region=<r> --project_id=<p>` |
40
- | List notebooks | `ListNotebooks --cli-region=<r> --project_id=<p>` |
41
- | Create model | `CreateModel --cli-region=<r> --project_id=<p>` |
42
- | Create notebook | `CreateNotebook --cli-region=<r> --project_id=<p>` |
43
-
44
- Discover operation parameters with `--help` before executing any write operation.
45
-
46
- ## Service Types
47
-
48
- | Type | Purpose |
49
- |------|---------|
50
- | Training Job | Train models on GPU/CPU resources |
51
- | Model | Register trained models for deployment |
52
- | Service (Online) | Deploy models as REST API endpoints |
53
- | Notebook | JupyterLab environments for development |
54
-
55
- ## Troubleshooting
56
-
57
- | Error | Fix |
58
- |-------|-----|
59
- | OBS path not found | Verify OBS bucket exists and path is correct |
60
- | Training job fails | Check training data format, resource quotas, and logs in console |
61
-
62
- ## Cross-Skill References
63
-
64
- - **OBS storage**: See `huawei-obs` for bucket and training data management
65
- - **VPC/Subnet**: See `huawei-vpc` for notebook network configuration
1
+ ---
2
+ name: huawei-modelarts
3
+ description: 'Use when training, deploying, or managing AI/ML models on Huawei Cloud ModelArts. Covers training jobs, model registry, online services, notebook instances. Triggers: ModelArts, model training, AI, machine learning, deep learning, notebook, inference, deployment. NOT for: general AI/ML concepts, non-Huawei platforms.'
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud ModelArts
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud ModelArts <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for ModelArts. Covers training jobs, model deployment, notebook instances, and OBS integration.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ | ------------------------------- | ----------------------------------------------------------------------------------- |
21
+ | OBS bucket required | All training data, model outputs, and notebook storage use OBS. Create bucket first |
22
+ | Training charges by duration | Pay-per-minute GPU/CPU billing. Stop unused notebooks and services |
23
+ | Notebook auto-stop needed | Default no auto-stop — can run indefinitely and incur charges |
24
+ | Model deployment needs quota | Online services may require service quota approval in new accounts |
25
+ | Training job output must be OBS | Local output not supported. Ensure `--output_path` is a valid OBS path |
26
+
27
+ ## Prerequisites
28
+
29
+ - Training data must be stored in an OBS bucket (see `huawei-obs`)
30
+ - Output path for trained models must be an OBS path
31
+ - Notebook instances need a VPC/subnet (see `huawei-vpc`)
32
+
33
+ ## Common Workflows
34
+
35
+ | Task | Operation |
36
+ | ------------------ | -------------------------------------------------- |
37
+ | List models | `ListModels --cli-region=<r> --project_id=<p>` |
38
+ | List training jobs | `ListTrainJobs --cli-region=<r> --project_id=<p>` |
39
+ | List services | `ListServices --cli-region=<r> --project_id=<p>` |
40
+ | List notebooks | `ListNotebooks --cli-region=<r> --project_id=<p>` |
41
+ | Create model | `CreateModel --cli-region=<r> --project_id=<p>` |
42
+ | Create notebook | `CreateNotebook --cli-region=<r> --project_id=<p>` |
43
+
44
+ Discover operation parameters with `--help` before executing any write operation.
45
+
46
+ ## Service Types
47
+
48
+ | Type | Purpose |
49
+ | ---------------- | --------------------------------------- |
50
+ | Training Job | Train models on GPU/CPU resources |
51
+ | Model | Register trained models for deployment |
52
+ | Service (Online) | Deploy models as REST API endpoints |
53
+ | Notebook | JupyterLab environments for development |
54
+
55
+ ## Troubleshooting
56
+
57
+ | Error | Fix |
58
+ | ------------------ | ---------------------------------------------------------------- |
59
+ | OBS path not found | Verify OBS bucket exists and path is correct |
60
+ | Training job fails | Check training data format, resource quotas, and logs in console |
61
+
62
+ ## Cross-Skill References
63
+
64
+ - **OBS storage**: See `huawei-obs` for bucket and training data management
65
+ - **VPC/Subnet**: See `huawei-vpc` for notebook network configuration
@@ -1,127 +1,134 @@
1
- ---
2
- name: huawei-obs
3
- description: "Use when creating, configuring, or managing OBS buckets and objects on Huawei Cloud. Covers bucket creation, lifecycle policies, versioning, static website hosting, CORS, access control (IAM/bucket policy/ACL), cross-region replication, event notifications, and presigned URLs. Triggers on: OBS, bucket, object storage, lifecycle, versioning, static website, CORS, presigned, replication. NOT for: EVS block storage (use huawei-ecs), SFS file storage, CBR backup (use huawei-cbr)."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud OBS
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- ## Critical: OBS Command Syntax
12
-
13
- KooCLI OBS uses **obsutil-style** commands, NOT API-style operations. Always run `hcloud OBS help` (no `--`) before constructing commands:
14
-
15
- ```bash
16
- hcloud OBS help # NOT --help
17
- hcloud OBS help <command> # e.g. hcloud OBS help mb
18
- ```
19
-
20
- | Wrong (API-style) | Correct (obsutil-style) |
21
- |-------------------|-------------------------|
22
- | `OBS CreateBucket` | `OBS mb obs://<bucket>` |
23
- | `OBS PutObject` | `OBS cp <file> obs://<bucket>/` |
24
- | `OBS DeleteBucket` | `OBS rm obs://<bucket> -r` |
25
-
26
- ## Overview
27
-
28
- Domain expertise for Huawei Cloud Object Storage Service (OBS). Covers bucket/object lifecycle, access control, static website hosting, and presigned URLs.
29
-
30
- ## Critical Warnings
31
-
32
- | Trap | Why |
33
- |------|-----|
34
- | Bucket name is global | All users share bucket namespace. Always use a unique name: `{prefix}-{timestamp}` (e.g. `mybucket-20260810155048`) |
35
- | Three-layer permissions | IAM > Bucket Policy > ACL. Most restrictive wins |
36
- | Versioning is irreversible | Once enabled, cannot be disabled, only suspended |
37
- | OBS uses AK/SK directly | NOT IAM tokens. Auth errors mean check AK/SK validity |
38
- | Static website via CLI missing | KooCLI OBS lacks website config. Use REST API or console |
39
- | **OBS needs separate cred config** | `hcloud configure` is NOT enough for OBS. Before any OBS operation, call `huaweicloud_setup_obs_config` to sync credentials from hcloud profile. |
40
- | **obsutil interactive prompts** | `cp`/`rm` without `-f` causes "Please input (y/n)" Agent hangs (TIMEOUT). Always use `-f` for non-interactive. |
41
- | **Directory upload adds prefix** | `cp <dir>/ obs://<bucket>/ -r` puts files under `bucket/<dir>/...`. Use `-flat` for root-level files (static sites). Preview with `-dryRun` first. |
42
-
43
- ## OBS Credential Setup (Required Before First Use)
44
-
45
- KooCLI OBS uses a separate config file (`~/.obsutilconfig`), NOT `~/.hcloud/config.json`. All OBS commands fail with credential errors until this is configured.
46
-
47
- **In-session bootstrap (recommended)**: Call `huaweicloud_setup_obs_config` it syncs AK/SK from the active hcloud profile automatically. No manual key entry needed. Run this once per session before any OBS command.
48
-
49
- **CLI fallback** (if MCP tools unavailable):
50
-
51
- ```bash
52
- hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK> -t=token
53
- ```
54
-
55
- > `huaweicloud_setup_obs_config` should be called at the start of every OBS task — never assume credentials are pre-configured from a previous session.
56
-
57
- ## Common Workflows
58
-
59
- | Task | Command |
60
- |------|---------|
61
- | Create bucket | `hcloud OBS mb obs://<bucket> -location=<region>` |
62
- | List buckets/objects | `hcloud OBS ls [obs://<bucket>]` |
63
- | Upload file | `hcloud OBS cp <file> obs://<bucket>/<key>` |
64
- | Upload directory (recursive) | `hcloud OBS cp <dir>/ obs://<bucket>/ -r -f -flat` |
65
- | Download object | `hcloud OBS cp obs://<bucket>/<key> <local-path>` |
66
- | Set bucket ACL | `hcloud OBS chattri obs://<bucket> -acl=public-read` |
67
- | Set object ACL | `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read` | Bucket ACL does NOT cascade — anonymous reads need both |
68
- | Set lifecycle | `hcloud OBS lifecycle obs://<bucket> -method=put -localfile=<json>` |
69
- | Set bucket policy | `hcloud OBS bucketpolicy obs://<bucket> -method=put -localfile=<json>` |
70
- | Set CORS | `hcloud OBS cors obs://<bucket> -method=put -localfile=<json>` |
71
- | Delete bucket | `hcloud OBS rm obs://<bucket> -r` (must be empty) |
72
- | Presigned URL | `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` |
73
- | Object metadata | `hcloud OBS stat obs://<bucket>/<key>` |
74
-
75
- ## Static Website Deployment Workflow
76
-
77
- See `references/static-website.md` for the full end-to-end workflow:
78
- Build Create bucket Upload → Set bucket ACL → Set object ACL → Configure website (REST API/console)
79
-
80
- > KooCLI OBS does NOT support `SetBucketWebsite`. Configure static website hosting via REST API (`PUT /?website`) or the Huawei Cloud console.
81
-
82
- ## Single-File Quick Share
83
-
84
- See `references/single-file-share.md` for the full workflow to host one file and get a shareable link in seconds:
85
-
86
- - **Private, time-limited**: `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` (max 7 days)
87
- - **Public, permanent**: `hcloud OBS cp <file> obs://<bucket>/<key> -f` + `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read`, then share `https://<bucket>.obs.<region>.myhuaweicloud.com/<key>`
88
-
89
- ## Storage Classes
90
-
91
- | Class | Use Case | Min Storage | Retrieval Fee |
92
- |-------|----------|-------------|---------------|
93
- | STANDARD | Frequently accessed | None | No |
94
- | STANDARD_IA | Infrequent access | 30 days | Yes |
95
- | ARCHIVE | Long-term archive | 90 days | Yes (hours) |
96
-
97
- ## Troubleshooting
98
-
99
- | Error | Root Cause -> Fix |
100
- |-------|------------------|
101
- | AccessDenied on bucket | IAM/bucket policy/ACL conflict -> Check all three layers |
102
- | BucketAlreadyExists | Name taken globally -> Generate unique name with timestamp suffix: `{prefix}-{yyyymmddHHMMSS}` |
103
- | NoSuchKey | Object doesn't exist or wrong region -> Verify key and region |
104
- | InvalidAccessKeyId | OBS uses AK/SK directly -> Verify AK/SK validity, OBS endpoint, OBS permissions |
105
- | EntityTooLarge | Single PUT limit 5GB -> Use multipart upload |
106
- | OBS --help fails | KooCLI OBS uses `help` not `--help` -> Run `hcloud OBS help` |
107
-
108
- ## Security Considerations
109
-
110
- - MUST block public access by default
111
- - MUST use HTTPS-only for buckets
112
- - SHOULD enable access logging for audit
113
- - SHOULD rotate presigned URL expiry (max 7 days)
114
- - MUST NOT store AK/SK in bucket policies
115
-
116
- ## Cross-Skill References
117
-
118
- - **EIP**: See `huawei-vpc` for public network access
119
- - **DEW**: See `huawei-dew` for secret management
120
-
121
- ## References
122
-
123
- - OBS Docs: https://support.huaweicloud.com/obs/
124
- - Static website: references/static-website.md
125
- - Single-file share: references/single-file-share.md
126
- - Lifecycle: references/bucket-lifecycle.md
127
- - Replication: references/replication.md
1
+ ---
2
+ name: huawei-obs
3
+ description: 'Use when creating, configuring, or managing OBS buckets and objects on Huawei Cloud. Covers bucket creation, lifecycle policies, versioning, static website hosting, CORS, access control (IAM/bucket policy/ACL), cross-region replication, event notifications, and presigned URLs. Triggers on: OBS, bucket, object storage, lifecycle, versioning, static website, CORS, presigned, replication. NOT for: EVS block storage (use huawei-ecs), SFS file storage, CBR backup (use huawei-cbr).'
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud OBS
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ ## Routing Guard: Deploy vs Store
12
+
13
+ - If the developer's goal is to **deploy, host, or preview a web app / static website** (temporary hosting, quick preview), do NOT default to OBS. Present deployment-target options with the sandbox first: ① huawei-sandbox (recommended), OBS static hosting, ③ ECS, ④ CCE. Ask: "建议优先部署到沙箱(临时运行环境,可预览访问),也可选 OBS 静态托管/ECS/CCE,你想部署到哪里?"
14
+ - Proceed with OBS only when the developer selects OBS, explicitly asks for OBS, or the intent is long-term static hosting / CDN / file storage.
15
+ - OBS is a storage service; it is not a general web-hosting default.
16
+
17
+ ## Critical: OBS Command Syntax
18
+
19
+ KooCLI OBS uses **obsutil-style** commands, NOT API-style operations. Always run `hcloud OBS help` (no `--`) before constructing commands:
20
+
21
+ ```bash
22
+ hcloud OBS help # NOT --help
23
+ hcloud OBS help <command> # e.g. hcloud OBS help mb
24
+ ```
25
+
26
+ | Wrong (API-style) | Correct (obsutil-style) |
27
+ | ------------------ | ------------------------------- |
28
+ | `OBS CreateBucket` | `OBS mb obs://<bucket>` |
29
+ | `OBS PutObject` | `OBS cp <file> obs://<bucket>/` |
30
+ | `OBS DeleteBucket` | `OBS rm obs://<bucket> -r` |
31
+
32
+ ## Overview
33
+
34
+ Domain expertise for Huawei Cloud Object Storage Service (OBS). Covers bucket/object lifecycle, access control, static website hosting, and presigned URLs.
35
+
36
+ ## Critical Warnings
37
+
38
+ | Trap | Why |
39
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | Bucket name is global | All users share bucket namespace. Always use a unique name: `{prefix}-{timestamp}` (e.g. `mybucket-20260810155048`) |
41
+ | Three-layer permissions | IAM > Bucket Policy > ACL. Most restrictive wins |
42
+ | Versioning is irreversible | Once enabled, cannot be disabled, only suspended |
43
+ | OBS uses AK/SK directly | NOT IAM tokens. Auth errors mean check AK/SK validity |
44
+ | Static website via CLI missing | KooCLI OBS lacks website config. Use REST API or console |
45
+ | **OBS needs separate cred config** | `hcloud configure` is NOT enough for OBS. Before any OBS operation, call `huaweicloud_setup_obs_config` to sync credentials from hcloud profile. |
46
+ | **obsutil interactive prompts** | `cp`/`rm` without `-f` causes "Please input (y/n)" → Agent hangs (TIMEOUT). Always use `-f` for non-interactive. |
47
+ | **Directory upload adds prefix** | `cp <dir>/ obs://<bucket>/ -r` puts files under `bucket/<dir>/...`. Use `-flat` for root-level files (static sites). Preview with `-dryRun` first. |
48
+
49
+ ## OBS Credential Setup (Required Before First Use)
50
+
51
+ KooCLI OBS uses a separate config file (`~/.obsutilconfig`), NOT `~/.hcloud/config.json`. All OBS commands fail with credential errors until this is configured.
52
+
53
+ **In-session bootstrap (recommended)**: Call `huaweicloud_setup_obs_config` — it syncs AK/SK from the active hcloud profile automatically. No manual key entry needed. Run this once per session before any OBS command.
54
+
55
+ **CLI fallback** (if MCP tools unavailable):
56
+
57
+ ```bash
58
+ hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK> -t=token
59
+ ```
60
+
61
+ > `huaweicloud_setup_obs_config` should be called at the start of every OBS task never assume credentials are pre-configured from a previous session.
62
+
63
+ ## Common Workflows
64
+
65
+ | Task | Command |
66
+ | ---------------------------- | ---------------------------------------------------------------------- |
67
+ | Create bucket | `hcloud OBS mb obs://<bucket> -location=<region>` |
68
+ | List buckets/objects | `hcloud OBS ls [obs://<bucket>]` |
69
+ | Upload file | `hcloud OBS cp <file> obs://<bucket>/<key>` |
70
+ | Upload directory (recursive) | `hcloud OBS cp <dir>/ obs://<bucket>/ -r -f -flat` |
71
+ | Download object | `hcloud OBS cp obs://<bucket>/<key> <local-path>` |
72
+ | Set bucket ACL | `hcloud OBS chattri obs://<bucket> -acl=public-read` |
73
+ | Set object ACL | `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read` | Bucket ACL does NOT cascade — anonymous reads need both |
74
+ | Set lifecycle | `hcloud OBS lifecycle obs://<bucket> -method=put -localfile=<json>` |
75
+ | Set bucket policy | `hcloud OBS bucketpolicy obs://<bucket> -method=put -localfile=<json>` |
76
+ | Set CORS | `hcloud OBS cors obs://<bucket> -method=put -localfile=<json>` |
77
+ | Delete bucket | `hcloud OBS rm obs://<bucket> -r` (must be empty) |
78
+ | Presigned URL | `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` |
79
+ | Object metadata | `hcloud OBS stat obs://<bucket>/<key>` |
80
+
81
+ ## Static Website Deployment Workflow
82
+
83
+ See `references/static-website.md` for the full end-to-end workflow:
84
+ Build Create bucket Upload Set bucket ACL Set object ACL Configure website (REST API/console)
85
+
86
+ > KooCLI OBS does NOT support `SetBucketWebsite`. Configure static website hosting via REST API (`PUT /?website`) or the Huawei Cloud console.
87
+
88
+ ## Single-File Quick Share
89
+
90
+ See `references/single-file-share.md` for the full workflow to host one file and get a shareable link in seconds:
91
+
92
+ - **Private, time-limited**: `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` (max 7 days)
93
+ - **Public, permanent**: `hcloud OBS cp <file> obs://<bucket>/<key> -f` + `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read`, then share `https://<bucket>.obs.<region>.myhuaweicloud.com/<key>`
94
+
95
+ ## Storage Classes
96
+
97
+ | Class | Use Case | Min Storage | Retrieval Fee |
98
+ | ----------- | ------------------- | ----------- | ------------- |
99
+ | STANDARD | Frequently accessed | None | No |
100
+ | STANDARD_IA | Infrequent access | 30 days | Yes |
101
+ | ARCHIVE | Long-term archive | 90 days | Yes (hours) |
102
+
103
+ ## Troubleshooting
104
+
105
+ | Error | Root Cause -> Fix |
106
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
107
+ | AccessDenied on bucket | IAM/bucket policy/ACL conflict -> Check all three layers |
108
+ | BucketAlreadyExists | Name taken globally -> Generate unique name with timestamp suffix: `{prefix}-{yyyymmddHHMMSS}` |
109
+ | NoSuchKey | Object doesn't exist or wrong region -> Verify key and region |
110
+ | InvalidAccessKeyId | OBS uses AK/SK directly -> Verify AK/SK validity, OBS endpoint, OBS permissions |
111
+ | EntityTooLarge | Single PUT limit 5GB -> Use multipart upload |
112
+ | OBS --help fails | KooCLI OBS uses `help` not `--help` -> Run `hcloud OBS help` |
113
+ | Configuration file is not well-formed | `~/.obsutilconfig` was generated by a non-standard path (CRLF line endings or field-order differences). Even `hcloud OBS --help` fails. Rebuild it with `hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK>` (or `huaweicloud_setup_obs_config`) -> retry |
114
+
115
+ ## Security Considerations
116
+
117
+ - MUST block public access by default
118
+ - MUST use HTTPS-only for buckets
119
+ - SHOULD enable access logging for audit
120
+ - SHOULD rotate presigned URL expiry (max 7 days)
121
+ - MUST NOT store AK/SK in bucket policies
122
+
123
+ ## Cross-Skill References
124
+
125
+ - **EIP**: See `huawei-vpc` for public network access
126
+ - **DEW**: See `huawei-dew` for secret management
127
+
128
+ ## References
129
+
130
+ - OBS Docs: https://support.huaweicloud.com/obs/
131
+ - Static website: references/static-website.md
132
+ - Single-file share: references/single-file-share.md
133
+ - Lifecycle: references/bucket-lifecycle.md
134
+ - Replication: references/replication.md
@@ -1,49 +1,49 @@
1
- # OBS Bucket Creation Reference
2
-
3
- From Huawei Cloud marketplace best practices.
4
-
5
- ## Naming Rules
6
-
7
- | Rule | Detail |
8
- |------|--------|
9
- | Length | 3-63 characters |
10
- | Characters | Lowercase letters, numbers, `-`, `.` |
11
- | No IP format | Cannot be IP address pattern |
12
- | No leading/trailing `-` or `.` | Start and end must be alphanumeric |
13
- | No `..` | Adjacent dots forbidden |
14
- | No `-.` or `.-` | Adjacent dot-hyphen combos forbidden |
15
-
16
- ## Create Bucket
17
-
18
- ```bash
19
- hcloud OBS mb obs://<bucket> [-acl=xxx] [-location=<r>] [-sc=xxx]
20
- ```
21
-
22
- | Option | Values | Default |
23
- |--------|--------|---------|
24
- | `-acl` | private, public-read, public-read-write | private |
25
- | `-location` | cn-south-1, cn-north-4, ... | config default |
26
- | `-sc` | standard, warm, cold, deep-archive | standard |
27
-
28
- ## Quick Verify
29
-
30
- ```bash
31
- hcloud OBS ls
32
- hcloud OBS stat obs://<bucket>
33
- ```
34
-
35
- ## Storage Class Guide
36
-
37
- | Class | Access Frequency | Min Storage | Retrieval Cost |
38
- |-------|-----------------|-------------|----------------|
39
- | standard | Frequent | None | No |
40
- | warm | Infrequent | 30 days | Yes |
41
- | cold | Rare | 90 days | Yes |
42
- | deep-archive | Archive | 180 days | Yes |
43
-
44
- ## Critical Rules
45
-
46
- - Bucket name is globally unique — test with `hcloud OBS stat` before creating
47
- - Region is immutable after creation
48
- - ACL does NOT cascade to objects — set both bucket-level and object-level access
49
- - OBS uses separate credentials (`~/.obsutilconfig`, configure via `hcloud OBS config -i`)
1
+ # OBS Bucket Creation Reference
2
+
3
+ From Huawei Cloud marketplace best practices.
4
+
5
+ ## Naming Rules
6
+
7
+ | Rule | Detail |
8
+ | ------------------------------ | ------------------------------------ |
9
+ | Length | 3-63 characters |
10
+ | Characters | Lowercase letters, numbers, `-`, `.` |
11
+ | No IP format | Cannot be IP address pattern |
12
+ | No leading/trailing `-` or `.` | Start and end must be alphanumeric |
13
+ | No `..` | Adjacent dots forbidden |
14
+ | No `-.` or `.-` | Adjacent dot-hyphen combos forbidden |
15
+
16
+ ## Create Bucket
17
+
18
+ ```bash
19
+ hcloud OBS mb obs://<bucket> [-acl=xxx] [-location=<r>] [-sc=xxx]
20
+ ```
21
+
22
+ | Option | Values | Default |
23
+ | ----------- | --------------------------------------- | -------------- |
24
+ | `-acl` | private, public-read, public-read-write | private |
25
+ | `-location` | cn-south-1, cn-north-4, ... | config default |
26
+ | `-sc` | standard, warm, cold, deep-archive | standard |
27
+
28
+ ## Quick Verify
29
+
30
+ ```bash
31
+ hcloud OBS ls
32
+ hcloud OBS stat obs://<bucket>
33
+ ```
34
+
35
+ ## Storage Class Guide
36
+
37
+ | Class | Access Frequency | Min Storage | Retrieval Cost |
38
+ | ------------ | ---------------- | ----------- | -------------- |
39
+ | standard | Frequent | None | No |
40
+ | warm | Infrequent | 30 days | Yes |
41
+ | cold | Rare | 90 days | Yes |
42
+ | deep-archive | Archive | 180 days | Yes |
43
+
44
+ ## Critical Rules
45
+
46
+ - Bucket name is globally unique — test with `hcloud OBS stat` before creating
47
+ - Region is immutable after creation
48
+ - ACL does NOT cascade to objects — set both bucket-level and object-level access
49
+ - OBS uses separate credentials (`~/.obsutilconfig`, configure via `hcloud OBS config -i`)