huaweicloud-devkit 1.1.0-next.0 → 1.1.0-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 (27) hide show
  1. package/.agents/plugins/marketplace.json +7 -7
  2. package/README.md +38 -1
  3. package/README.zh-CN.md +38 -1
  4. package/package.json +1 -1
  5. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
  6. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +22 -19
  7. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
  8. package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -1
  9. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -1
  10. package/plugins/huaweicloud-core/assets/icon.png +0 -0
  11. package/plugins/huaweicloud-core/assets/logo-dark.png +0 -0
  12. package/plugins/huaweicloud-core/assets/logo.png +0 -0
  13. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +23 -15
  14. package/plugins/huaweicloud-core/openclaw.plugin.json +1 -1
  15. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +615 -28
  16. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +64 -0
  17. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +95 -0
  18. package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +52 -0
  19. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +2 -0
  20. package/plugins/huaweicloud-core/src/auth/credentials.mjs +19 -6
  21. package/plugins/huaweicloud-core/src/detect-framework.mjs +344 -0
  22. package/plugins/huaweicloud-core/src/mcp-server.mjs +12 -0
  23. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +18 -0
  24. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +341 -21
  25. package/plugins/huaweicloud-core/src/setup-cli.mjs +417 -107
  26. package/plugins/huaweicloud-core/src/tools.mjs +215 -3
  27. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +29 -8
@@ -5,16 +5,16 @@
5
5
  },
6
6
  "plugins": [
7
7
  {
8
- "name": "huaweicloud-devkit",
9
- "source": {
10
- "source": "local",
11
- "path": "./plugins/huaweicloud-core"
12
- },
13
8
  "policy": {
14
- "installation": "AVAILABLE",
9
+ "installation": "INSTALLED_BY_DEFAULT",
15
10
  "authentication": "ON_USE"
16
11
  },
17
- "category": "Cloud"
12
+ "category": "Cloud",
13
+ "name": "huaweicloud-devkit",
14
+ "source": {
15
+ "path": "./plugins/huaweicloud-core",
16
+ "source": "local"
17
+ }
18
18
  }
19
19
  ]
20
20
  }
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Help AI coding agents use Huawei Cloud safely and accurately — a single integration that gives agents cloud knowledge, CLI tooling, and safety guardrails.
10
10
 
11
- Supports OpenCode, CodeArts Agent, WorkBuddy, DeepSeek Harness (DSH), OfficeAce, OpenClaw, and AtomCode.
11
+ Supports OpenCode, Codex, CodeArts Agent, WorkBuddy, DeepSeek Harness (DSH), OfficeAce, Hermes, OpenClaw, and AtomCode.
12
12
 
13
13
  ## Prerequisites
14
14
 
@@ -34,6 +34,23 @@ npx --yes huaweicloud-devkit uninstall --target opencode
34
34
  rm -rf ~/.npm/_npx/ # Linux/macOS only; Windows path TBD
35
35
  ```
36
36
 
37
+ ### Codex
38
+
39
+ ```bash
40
+ npx --yes huaweicloud-devkit install --target codex
41
+ ```
42
+
43
+ **Restart the Codex session** after installation.
44
+
45
+ ```bash
46
+ npx --yes huaweicloud-devkit doctor --target codex
47
+ npx --yes huaweicloud-devkit status --target codex
48
+ npx --yes huaweicloud-devkit update --target codex
49
+ npx --yes huaweicloud-devkit uninstall --target codex
50
+ ```
51
+
52
+ > **Requires Codex CLI** — the `codex` command must be in PATH. If Codex is installed via WindowsApps (Microsoft Store), use `--target codex-desktop` instead. Run `codex --version` to verify CLI availability.
53
+
37
54
  ### CodeArts Agent
38
55
 
39
56
  ```bash
@@ -98,6 +115,26 @@ npx --yes huaweicloud-devkit update --target officeace
98
115
  npx --yes huaweicloud-devkit uninstall --target officeace
99
116
  ```
100
117
 
118
+ ### Hermes
119
+
120
+ ```bash
121
+ npx --yes huaweicloud-devkit install --target hermes
122
+ ```
123
+
124
+ **Restart the Hermes session** after installation.
125
+
126
+ ```bash
127
+ npx --yes huaweicloud-devkit doctor --target hermes
128
+ npx --yes huaweicloud-devkit status --target hermes
129
+ npx --yes huaweicloud-devkit update --target hermes
130
+ npx --yes huaweicloud-devkit uninstall --target hermes
131
+ ```
132
+
133
+ > **Uninstall notes**: On Linux, run `rm -rf ~/.npm/_npx/* && npm cache clean --force` after uninstall to ensure a clean slate. On Windows, close all Hermes sessions first to release file locks, then after uninstall check `%LOCALAPPDATA%\hermes\config.yaml` for YAML corruption and manually remove `%LOCALAPPDATA%\hermes\huaweicloud-plugins` if any files remain.
134
+ > **Safety hooks**: The installer configures Hermes shell hooks (`config.yaml` → `hooks.pre_tool_call`) to intercept unsafe terminal commands such as credential file reads, environment variable dumps, and unapproved `hcloud` write operations. Hermes shows a consent prompt the first time; approve it or set `hooks_auto_accept: true` in `config.yaml` to auto-accept.
135
+ > **MCP Python SDK**: The installer automatically installs the `mcp` Python package required by Hermes for MCP tool discovery. If you see `[FAIL] Hermes MCP Python SDK` in `doctor`, run `pip3 install mcp` manually.
136
+ > **Windows**: Hermes on Windows stores data under `%LOCALAPPDATA%\hermes` instead of `~/.hermes`. The installer detects this automatically.
137
+
101
138
  ### OpenClaw
102
139
 
103
140
  ```bash
package/README.zh-CN.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  帮助 AI 编码助手安全、准确地使用华为云——一站式集成云知识、CLI 工具和安全护栏。
10
10
 
11
- 支持 OpenCode、码道(CodeArts Agent)、WorkBuddy、DeepSeek Harness(DSH)、OfficeAce、OpenClaw、AtomCode。
11
+ 支持 OpenCode、Codex、码道(CodeArts Agent)、WorkBuddy、DeepSeek Harness(DSH)、OfficeAce、Hermes、OpenClaw、AtomCode。
12
12
 
13
13
  ## 前置条件
14
14
 
@@ -34,6 +34,23 @@ npx --yes huaweicloud-devkit uninstall --target opencode
34
34
  rm -rf ~/.npm/_npx/ # 仅 Linux/macOS;Windows 路径待确认
35
35
  ```
36
36
 
37
+ ### Codex
38
+
39
+ ```bash
40
+ npx --yes huaweicloud-devkit install --target codex
41
+ ```
42
+
43
+ 安装后**重启 Codex 会话**。
44
+
45
+ ```bash
46
+ npx --yes huaweicloud-devkit doctor --target codex
47
+ npx --yes huaweicloud-devkit status --target codex
48
+ npx --yes huaweicloud-devkit update --target codex
49
+ npx --yes huaweicloud-devkit uninstall --target codex
50
+ ```
51
+
52
+ > **需要 Codex CLI** — `codex` 命令必须在 PATH 中。若 Codex 通过 WindowsApps(Microsoft Store)安装,请使用 `--target codex-desktop` 替代。运行 `codex --version` 验证 CLI 可用性。
53
+
37
54
  ### CodeArts Agent(码道)
38
55
 
39
56
  ```bash
@@ -98,6 +115,26 @@ npx --yes huaweicloud-devkit update --target officeace
98
115
  npx --yes huaweicloud-devkit uninstall --target officeace
99
116
  ```
100
117
 
118
+ ### Hermes
119
+
120
+ ```bash
121
+ npx --yes huaweicloud-devkit install --target hermes
122
+ ```
123
+
124
+ 安装后**重启 Hermes 会话**。
125
+
126
+ ```bash
127
+ npx --yes huaweicloud-devkit doctor --target hermes
128
+ npx --yes huaweicloud-devkit status --target hermes
129
+ npx --yes huaweicloud-devkit update --target hermes
130
+ npx --yes huaweicloud-devkit uninstall --target hermes
131
+ ```
132
+
133
+ > **卸载说明**:Linux 上卸载后执行 `rm -rf ~/.npm/_npx/* && npm cache clean --force` 确保下次全新安装。Windows 上先关闭所有 Hermes 会话(释放文件锁),卸载后检查 `%LOCALAPPDATA%\hermes\config.yaml` 是否有 YAML 损坏,如有残留文件手动删除 `%LOCALAPPDATA%\hermes\huaweicloud-plugins`。
134
+ > **安全钩子(Safety hooks)**:安装器会在 `config.yaml` 中写入 shell hooks 配置(`hooks.pre_tool_call`),拦截不安全的终端命令,如读取凭据文件、导出环境变量、未审批的 `hcloud` 写操作。Hermes 首次使用时会弹出同意提示,可批准或设置 `hooks_auto_accept: true` 自动批准。
135
+ > **MCP Python SDK**:安装器会自动安装 Hermes 所需的 `mcp` Python 包。如果 doctor 显示 `[FAIL] Hermes MCP Python SDK`,手动执行 `pip3 install mcp`。
136
+ > **Windows**:Hermes 在 Windows 上数据存储在 `%LOCALAPPDATA%\hermes` 而非 `~/.hermes`,安装器会自动检测适配。
137
+
101
138
  ### OpenClaw
102
139
 
103
140
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.1.0-next.0",
3
+ "version": "1.1.0-next.10",
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": [
@@ -17,7 +17,7 @@
17
17
  "mcpServers": "./.mcp.json",
18
18
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
19
19
  "skills": "./skills/",
20
- "version": "1.1.0-next.0",
20
+ "version": "1.1.0-next.10",
21
21
  "author": {
22
22
  "name": "HuaweiCloud Mate",
23
23
  "url": "https://github.com/huaweicloud"
@@ -1,30 +1,33 @@
1
1
  {
2
- "name": "huaweicloud-devkit",
3
- "version": "1.1.0-next.0",
4
- "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
- "author": {
6
- "name": "HuaweiCloud Mate",
7
- "url": "https://github.com/huaweicloud"
8
- },
9
- "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
10
- "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
11
- "license": "Apache-2.0",
12
- "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"],
13
- "skills": "./skills/",
14
- "mcpServers": "./.mcp.json",
15
2
  "interface": {
16
- "displayName": "HuaweiCloud Devkit",
17
3
  "shortDescription": "HuaweiCloud Devkit - Huawei Cloud guidance, CLI/API/SDK routing, MCP tools, and safety for coding agents.",
18
- "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
19
4
  "developerName": "HuaweiCloud Mate",
20
- "category": "Cloud",
21
5
  "capabilities": ["Read", "Interactive"],
22
- "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
23
6
  "brandColor": "#C7000B",
7
+ "composerIcon": "./assets/icon.png",
8
+ "logo": "./assets/logo.png",
9
+ "logoDark": "./assets/logo-dark.png",
10
+ "category": "Cloud",
24
11
  "defaultPrompt": [
25
12
  "Help me choose the right Huawei Cloud capability.",
26
13
  "Check my Huawei Cloud CLI setup safely.",
27
14
  "Plan this Huawei Cloud API or SDK task."
28
- ]
29
- }
15
+ ],
16
+ "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
17
+ "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
18
+ "displayName": "HuaweiCloud Devkit"
19
+ },
20
+ "mcpServers": "./.mcp.json",
21
+ "description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
22
+ "skills": "./skills/",
23
+ "version": "1.1.0-next.10",
24
+ "author": {
25
+ "name": "HuaweiCloud Mate",
26
+ "url": "https://github.com/huaweicloud"
27
+ },
28
+ "name": "huaweicloud-devkit",
29
+ "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
30
+ "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
31
+ "license": "Apache-2.0",
32
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"]
30
33
  }
@@ -17,7 +17,7 @@
17
17
  "mcpServers": "./.mcp.json",
18
18
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
19
19
  "skills": "./skills/",
20
- "version": "1.1.0-next.0",
20
+ "version": "1.1.0-next.10",
21
21
  "author": {
22
22
  "name": "HuaweiCloud Mate",
23
23
  "url": "https://github.com/huaweicloud"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.1.0-next.0",
3
+ "version": "1.1.0-next.10",
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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.1.0-next.0",
3
+ "version": "1.1.0-next.10",
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",
@@ -53,16 +53,23 @@ READ_OPERATION_RE = re.compile(r"\b(List|Show|Get|Describe|NovaList|NovaShow)\w*
53
53
  READ_OPERATION_RE = re.compile(r"\b(List|Show|Get|Describe|NovaList|NovaShow)\w*", re.I)
54
54
 
55
55
 
56
- def deny(reason):
57
- json.dump(
58
- {
59
- "hookSpecificOutput": {
60
- "hookEventName": "PreToolUse",
61
- "permissionDecision": "deny",
62
- "permissionDecisionReason": DENY_PREFIX + reason,
56
+ def deny(reason, hermes=False):
57
+ sys.stdout.write(
58
+ json.dumps(
59
+ {
60
+ "action": "block",
61
+ "message": DENY_PREFIX + reason,
63
62
  }
64
- },
65
- sys.stdout,
63
+ if hermes
64
+ else {
65
+ "hookSpecificOutput": {
66
+ "hookEventName": "PreToolUse",
67
+ "permissionDecision": "deny",
68
+ "permissionDecisionReason": DENY_PREFIX + reason,
69
+ }
70
+ }
71
+ )
72
+ + "\n"
66
73
  )
67
74
  sys.exit(0)
68
75
 
@@ -139,18 +146,19 @@ def main():
139
146
 
140
147
  tool_name = data.get("tool_name", "")
141
148
  text = command_text(data.get("tool_input", {}))
149
+ hermes = "hook_event_name" in data
142
150
 
143
151
  if CONFIG_FILE_RE and CONFIG_FILE_RE.search(text):
144
- deny("reading Huawei Cloud credential/profile files can expose AK/SK or tokens. Use redacted toolkit tools.")
152
+ deny("reading Huawei Cloud credential/profile files can expose AK/SK or tokens. Use redacted toolkit tools.", hermes)
145
153
  if ENV_DUMP_RE.search(text):
146
- deny("dumping cloud credential environment variables is not allowed.")
154
+ deny("dumping cloud credential environment variables is not allowed.", hermes)
147
155
  if SECRET_READ_RE and SECRET_READ_RE.search(text):
148
- deny("direct secret value retrieval would put plaintext secrets into the agent context.")
156
+ deny("direct secret value retrieval would put plaintext secrets into the agent context.", hermes)
149
157
  denied_rule = first_denied_command_rule(text)
150
158
  if denied_rule:
151
- deny(f"{denied_rule.get('message')} Remediation: {denied_rule.get('remediation')}")
152
- if tool_name == "Bash" and HCLOUD_RE.search(text) and WRITE_OPERATION_RE.search(text) and not READ_OPERATION_RE.search(text):
153
- deny("unapproved Huawei Cloud write operations must be planned first and explicitly approved by the user.")
159
+ deny(f"{denied_rule.get('message')} Remediation: {denied_rule.get('remediation')}", hermes)
160
+ if tool_name in ("Bash", "terminal") and HCLOUD_RE.search(text) and WRITE_OPERATION_RE.search(text) and not READ_OPERATION_RE.search(text):
161
+ deny("unapproved Huawei Cloud write operations must be planned first and explicitly approved by the user.", hermes)
154
162
 
155
163
  allow()
156
164
 
@@ -2,7 +2,7 @@
2
2
  "name": "huaweicloud-devkit",
3
3
  "id": "huaweicloud-devkit",
4
4
  "displayName": "HuaweiCloud DevKit",
5
- "version": "1.1.0-next.0",
5
+ "version": "1.1.0-next.10",
6
6
  "family": "bundle-plugin",
7
7
  "bundleFormat": "codex",
8
8
  "description": "Guide coding agents to use Huawei Cloud safely — KooCLI, APIs, SDKs, 28 MCP tools, skills, and safety guardrails.",