huaweicloud-devkit 1.1.1-next.0 → 1.1.1-next.2
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/package.json +1 -1
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/openclaw.plugin.json +1 -1
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +22 -1
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +20 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +2 -1
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +10 -5
- package/plugins/huaweicloud-core/src/detect-framework.mjs +1 -1
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +1 -0
- package/plugins/huaweicloud-core/src/tools.mjs +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "huaweicloud-devkit",
|
|
3
|
-
"version": "1.1.1-next.
|
|
3
|
+
"version": "1.1.1-next.2",
|
|
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.1-next.
|
|
20
|
+
"version": "1.1.1-next.2",
|
|
21
21
|
"author": {
|
|
22
22
|
"name": "HuaweiCloud Mate",
|
|
23
23
|
"url": "https://github.com/huaweicloud"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"mcpServers": "./.mcp.json",
|
|
21
21
|
"description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
|
|
22
22
|
"skills": "./skills/",
|
|
23
|
-
"version": "1.1.1-next.
|
|
23
|
+
"version": "1.1.1-next.2",
|
|
24
24
|
"author": {
|
|
25
25
|
"name": "HuaweiCloud Mate",
|
|
26
26
|
"url": "https://github.com/huaweicloud"
|
|
@@ -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.1-next.
|
|
20
|
+
"version": "1.1.1-next.2",
|
|
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.1-next.
|
|
3
|
+
"version": "1.1.1-next.2",
|
|
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.1-next.
|
|
3
|
+
"version": "1.1.1-next.2",
|
|
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",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "huaweicloud-devkit",
|
|
3
3
|
"id": "huaweicloud-devkit",
|
|
4
4
|
"displayName": "HuaweiCloud DevKit",
|
|
5
|
-
"version": "1.1.1-next.
|
|
5
|
+
"version": "1.1.1-next.2",
|
|
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.",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
"field": "text",
|
|
217
|
-
"regex": "(\\s--force|\\s-f\\s|\\s--recursive|\\s-r\\s
|
|
217
|
+
"regex": "(\\s--force|\\s-f\\s|\\s--recursive|\\s-r\\s)"
|
|
218
218
|
}
|
|
219
219
|
]
|
|
220
220
|
},
|
|
@@ -242,6 +242,27 @@
|
|
|
242
242
|
"message": "This hcloud command will delete, detach, or remove cloud resources. The operation may be irreversible.",
|
|
243
243
|
"remediation": "List the resources to be affected first, confirm with the user, and require explicit approval before executing any destructive operation."
|
|
244
244
|
},
|
|
245
|
+
{
|
|
246
|
+
"id": "hwc-destructive-delete-cascade",
|
|
247
|
+
"title": "Cascading cloud resource deletion",
|
|
248
|
+
"category": "destructive",
|
|
249
|
+
"severity": "warn",
|
|
250
|
+
"stages": ["command"],
|
|
251
|
+
"match": {
|
|
252
|
+
"all": [
|
|
253
|
+
{
|
|
254
|
+
"field": "text",
|
|
255
|
+
"regex": "(Delete|BatchDelete|Remove|\\brm\\b|delete)"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"field": "text",
|
|
259
|
+
"regex": "(delete_publicip\\s*[=:]\\s*true|delete_volume\\s*[=:]\\s*true)"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"message": "This delete command will also remove associated resources (EIP, volume). Check that these should be deleted together.",
|
|
264
|
+
"remediation": "Confirm with the user whether to delete the associated resources, or set delete_publicip/delete_volume to false to keep them."
|
|
265
|
+
},
|
|
245
266
|
{
|
|
246
267
|
"id": "hwc-sandbox-missing-ttl",
|
|
247
268
|
"title": "Sandbox deployment missing cleanup metadata",
|
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Maps web frameworks to install, build, serve commands and output directories for sandbox deployment.
|
|
4
4
|
|
|
5
|
+
## Architecture Compatibility
|
|
6
|
+
|
|
7
|
+
The sandbox runs **HCE OS on aarch64**. Frameworks that depend on native binaries (e.g., `@swc/core`, `esbuild`, `sharp`, `prisma`) may fail to install or build inside the sandbox since prebuilt binaries target x86_64 by default.
|
|
8
|
+
|
|
9
|
+
**Recommended strategy**: build locally (x86_64) then upload the dist output to the sandbox for serving.
|
|
10
|
+
|
|
11
|
+
| Dependency | Frameworks Affected | Mitigation |
|
|
12
|
+
| ---------------- | ------------------------ | ------------------------------------- |
|
|
13
|
+
| `@swc/core` | Taro, Next.js 13+ | Pre-build locally, upload dist |
|
|
14
|
+
| `esbuild` | Vite, Nuxt, uni-app | Usually has aarch64 binary; try build |
|
|
15
|
+
| `sharp` | Gatsby, Next.js images | Pre-build locally, upload dist |
|
|
16
|
+
| `prisma` | Next.js, Nuxt (database) | Use `binaryTargets = ["linux-arm64"]` |
|
|
17
|
+
| `node-gyp` (C++) | node-sass, bcrypt | `build-essential` is pre-installed |
|
|
18
|
+
|
|
19
|
+
**Pre-build workflow**:
|
|
20
|
+
|
|
21
|
+
1. Build on local machine (x86_64): `npm install && npm run build`
|
|
22
|
+
2. Use `huaweicloud_sandbox_connect` with git config (auto-transfers code) or `huaweicloud_sandbox_upload_project` to upload dist
|
|
23
|
+
3. Deploy with nginx static/SPA template — no native deps needed at runtime
|
|
24
|
+
|
|
5
25
|
## SSR Frameworks
|
|
6
26
|
|
|
7
27
|
| Framework | Install | Build | Serve | Output Dir | Port | Nginx |
|
|
@@ -64,7 +64,7 @@ NGINX_EOF
|
|
|
64
64
|
sudo nginx -s reload 2>/dev/null || sudo nginx
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
## Template 3: Static Site (
|
|
67
|
+
## Template 3: Static Site (with clean URL support)
|
|
68
68
|
|
|
69
69
|
Use for: Hugo, Hexo, plain static HTML
|
|
70
70
|
|
|
@@ -76,6 +76,7 @@ server {
|
|
|
76
76
|
index index.html;
|
|
77
77
|
|
|
78
78
|
location / {
|
|
79
|
+
try_files $uri $uri.html $uri/ =404;
|
|
79
80
|
autoindex off;
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-voucher
|
|
3
|
-
description: '
|
|
3
|
+
description: '查询和领取华为云激励代金券(一人一次)。当用户首次使用、开始会话、询问插件能力,或提到"领券/代金券/优惠券/激励金/领取/福利"等话题时,先调 voucher_status 查领取状态:未领取(claimed=false)则主动提示可领取一张代金券并询问是否领取;已领取(claimed=true)或状态不明确则静默不打扰。Triggers: 首次使用, 会话开始, voucher, coupon, incentive, 领券, 代金券, 优惠券, 激励金, 领取, 福利. NOT for: 账单/费用查询(用 huawei-billing)。'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,11 +8,16 @@ version: 1
|
|
|
8
8
|
|
|
9
9
|
## 主动提示准则(核心)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
此能力仅在用户尚未领取时才有价值,需避免已领取用户被反复打扰。以下场景默认执行"先查后提示":会话开始、能力导读、首次对话、提到福利领取类话题。
|
|
12
12
|
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
|
|
13
|
+
1. 生产环境直接调用 `huaweicloud_voucher_status`(**不传** `domain_id`,后端从 IAM 自动解析账号)。
|
|
14
|
+
2. 按返回严格判定:
|
|
15
|
+
- `claimed=true` → 静默处理,不再提及代金券,不打扰用户
|
|
16
|
+
- `claimed=false` 且 `message="未领取"` → **主动提示**,用下方话术并询问是否领取
|
|
17
|
+
- 其余情况(如 `message="查询失败"`、状态不明确、调用异常)→ **严格不提示**
|
|
18
|
+
3. 提示话术(可直接使用):
|
|
19
|
+
> "你还可以领取一张华为云激励代金券(一人一次),需要我现在帮你领取吗?"
|
|
20
|
+
4. 能力导读时,若判定未领取,将代金券作为**独立、靠前**的提示项,而非埋在能力清单底部。
|
|
16
21
|
|
|
17
22
|
## 流程
|
|
18
23
|
|
|
@@ -244,7 +244,7 @@ function readVitepressOutDir(projectPath) {
|
|
|
244
244
|
if (!existsSync(configPath)) continue;
|
|
245
245
|
try {
|
|
246
246
|
const content = readFileSync(configPath, 'utf8');
|
|
247
|
-
const match = content.match(/outDir\s*:\s*['"]([^'"]+)['"]
|
|
247
|
+
const match = content.match(/outDir\s*:\s*['"`]?([^'"`\s,}]+)['"`]?/);
|
|
248
248
|
if (match) return match[1];
|
|
249
249
|
} catch {}
|
|
250
250
|
}
|
|
@@ -734,7 +734,8 @@ export const TOOL_DEFINITIONS = [
|
|
|
734
734
|
},
|
|
735
735
|
{
|
|
736
736
|
name: 'huaweicloud_voucher_status',
|
|
737
|
-
description:
|
|
737
|
+
description:
|
|
738
|
+
'查询代金券领取状态。用户首次使用、开始会话或询问插件能力时,应主动调用本工具检查:未领取(claimed=false)则主动提示可领取一张代金券;已领取(claimed=true)则不提示、不打扰。',
|
|
738
739
|
inputSchema: {
|
|
739
740
|
type: 'object',
|
|
740
741
|
properties: {
|
|
@@ -1054,6 +1055,9 @@ export async function callTool(name, args = {}) {
|
|
|
1054
1055
|
try {
|
|
1055
1056
|
await execOneShot(devStageId, 'devbridge delete-all 2>/dev/null || true', 'root', 15000);
|
|
1056
1057
|
} catch {}
|
|
1058
|
+
try {
|
|
1059
|
+
await execWithSession(devStageId, 'export PATH=$HOME/.huawei/bin${PATH:+:$PATH}', 'root', 10000);
|
|
1060
|
+
} catch {}
|
|
1057
1061
|
await transferGitRepo(args, devStageId, connectResult);
|
|
1058
1062
|
}
|
|
1059
1063
|
return connectResult;
|
|
@@ -1326,7 +1330,14 @@ async function runApprovedCommand(args = {}) {
|
|
|
1326
1330
|
}
|
|
1327
1331
|
const providedArgs = Array.isArray(args.args) ? args.args.map(String) : [];
|
|
1328
1332
|
if (JSON.stringify(storedArgs) !== JSON.stringify(providedArgs)) {
|
|
1329
|
-
|
|
1333
|
+
const redactedStored = redactSecrets(storedArgs);
|
|
1334
|
+
const redactedProvided = redactSecrets(providedArgs);
|
|
1335
|
+
if (JSON.stringify(redactedStored) !== JSON.stringify(redactedProvided)) {
|
|
1336
|
+
throw new Error(
|
|
1337
|
+
'Provided args do not match the approved plan. Use the exact args from the plan. ' +
|
|
1338
|
+
'If the plan shows <redacted> for passwords or secrets, replace <redacted> with the actual values in approvedCommand.',
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1330
1341
|
}
|
|
1331
1342
|
const strictPlan = planHcloudCommand(providedArgs, { allowWrites: false });
|
|
1332
1343
|
const result = await runHcloud(providedArgs, {
|