huaweicloud-devkit 1.1.1-next.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.1.1-next.1",
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.1",
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.1",
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.1",
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.1",
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.1",
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.1",
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|delete_publicip\\s*[=:]\\s*true)"
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 (no SPA routing)
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
 
@@ -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
  }
@@ -802,6 +802,7 @@ fi`;
802
802
  index index.html;
803
803
 
804
804
  location / {
805
+ try_files $uri $uri.html $uri/ =404;
805
806
  autoindex off;
806
807
  }
807
808
 
@@ -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
- throw new Error('Provided args do not match the approved plan. Use the exact args from the plan.');
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, {