huaweicloud-devkit 1.1.0-next.2 → 1.1.0-next.4

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.0-next.2",
3
+ "version": "1.1.0-next.4",
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.2",
20
+ "version": "1.1.0-next.4",
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.0-next.2",
23
+ "version": "1.1.0-next.4",
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.0-next.2",
20
+ "version": "1.1.0-next.4",
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.2",
3
+ "version": "1.1.0-next.4",
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.2",
3
+ "version": "1.1.0-next.4",
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.0-next.2",
5
+ "version": "1.1.0-next.4",
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.",
@@ -221,24 +221,22 @@ Before installing project dependencies, verify the sandbox has the required runt
221
221
  ```bash
222
222
  # Core tools (expected pre-installed in sandbox image)
223
223
  echo "=== Checking core tools ==="
224
- command -v node && node --version || echo "MISSING: node"
225
- command -v npm && npm --version || echo "MISSING: npm"
226
- command -v nginx && nginx -v 2>&1 || echo "MISSING: nginx"
227
- command -v git && git --version || echo "MISSING: git"
228
- command -v python3 && python3 --version || echo "MISSING: python3"
229
- command -v curl && curl --version | head -1 || echo "MISSING: curl"
230
- command -v wget && wget --version | head -1 || echo "MISSING: wget"
231
- dpkg -l build-essential >/dev/null 2>&1 && echo "build-essential: found" || echo "MISSING: build-essential"
232
- command -v lsof && lsof -v 2>&1 | head -1 || echo "MISSING: lsof"
233
- command -v netstat && netstat --version 2>&1 | head -1 || echo "MISSING: net-tools"
234
- command -v make && make --version | head -1 || echo "MISSING: make"
224
+ if command -v node >/dev/null 2>&1; then node --version; else echo "MISSING: node"; fi
225
+ if command -v npm >/dev/null 2>&1; then npm --version; else echo "MISSING: npm"; fi
226
+ if command -v nginx >/dev/null 2>&1; then nginx -v 2>&1; else echo "MISSING: nginx"; fi
227
+ if command -v git >/dev/null 2>&1; then git --version; else echo "MISSING: git"; fi
228
+ if command -v python3 >/dev/null 2>&1; then python3 --version; else echo "MISSING: python3"; fi
229
+ if command -v curl >/dev/null 2>&1; then curl --version | head -1; else echo "MISSING: curl"; fi
230
+ if command -v wget >/dev/null 2>&1; then wget --version | head -1; else echo "MISSING: wget"; fi
231
+ if dpkg -l build-essential >/dev/null 2>&1; then echo "build-essential: found"; else echo "MISSING: build-essential"; fi
232
+ if command -v make >/dev/null 2>&1; then make --version | head -1; else echo "MISSING: make"; fi
235
233
 
236
234
  # Framework-specific tools (install on demand)
237
235
  echo "=== Checking framework tools ==="
238
- command -v pnpm && pnpm --version || echo "MISSING: pnpm"
239
- command -v yarn && yarn --version || echo "MISSING: yarn"
240
- command -v hugo && hugo version || echo "MISSING: hugo"
241
- command -v devbridge && devbridge version || echo "MISSING: devbridge"
236
+ if command -v pnpm >/dev/null 2>&1; then pnpm --version; else echo "MISSING: pnpm"; fi
237
+ if command -v yarn >/dev/null 2>&1; then yarn --version; else echo "MISSING: yarn"; fi
238
+ if command -v hugo >/dev/null 2>&1; then hugo version; else echo "MISSING: hugo"; fi
239
+ if command -v devbridge >/dev/null 2>&1; then devbridge version; else echo "MISSING: devbridge"; fi
242
240
  ```
243
241
 
244
242
  **Install only missing tools** — parse the pre-flight output and install only tools reported as `MISSING`. Skip tools already present:
@@ -250,8 +248,6 @@ command -v devbridge && devbridge version || echo "MISSING: devbridge"
250
248
  | curl | `sudo apt-get update -qq && sudo apt-get install -y -qq curl` |
251
249
  | wget | `sudo apt-get update -qq && sudo apt-get install -y -qq wget` |
252
250
  | build-essential | `sudo apt-get update -qq && sudo apt-get install -y -qq build-essential` |
253
- | lsof | `sudo apt-get update -qq && sudo apt-get install -y -qq lsof` |
254
- | net-tools | `sudo apt-get update -qq && sudo apt-get install -y -qq net-tools` |
255
251
  | make | `sudo apt-get update -qq && sudo apt-get install -y -qq make` |
256
252
  | pnpm | `npm i -g pnpm` |
257
253
  | yarn | `npm i -g yarn` |
@@ -277,7 +273,7 @@ Wait for install to complete, then:
277
273
  **Build** — only if build output doesn't already exist:
278
274
 
279
275
  ```bash
280
- cd /workspace/<dirname> && [ -d <outputDir> ] && echo "SKIP: <outputDir> exists" || <buildCmd>
276
+ cd /workspace/<dirname> && [ -d <outputDir> ] && echo "SKIP: <outputDir> exists" || (umask 022 && <buildCmd>)
281
277
  ```
282
278
 
283
279
  - `cd /workspace/<dirname>/<subAppPath>` for Monorepo sub-apps.
@@ -303,6 +299,20 @@ Replace `<port>`, `<project>`, `<outputDir>` (and `<nodePort>`/`<publicPort>` fo
303
299
 
304
300
  Write the config with `sudo tee`, then reload nginx. If nginx fails, fall back to Python HTTP server (see `references/nginx-templates.md`).
305
301
 
302
+ **Verify nginx is serving** — curl-check the app before proceeding to DevBridge:
303
+
304
+ ```bash
305
+ curl -s -o /dev/null -w "nginx status: %{http_code}\n" http://localhost:<port>
306
+ ```
307
+
308
+ If the status code is not 2xx/3xx:
309
+
310
+ - **403** — likely file permissions: run `chmod -R o+rX /workspace/<project>/<outputDir>` and re-test
311
+ - **000 (connection refused)** — nginx not listening: check `sudo nginx -t` for config errors
312
+ - **Other** — check nginx error log: `sudo tail -20 /var/log/nginx/error.log`
313
+
314
+ > If `curl` is unavailable, check port listening via `/proc`: `cat /proc/net/tcp | awk '{print $2}' | grep -q "$(printf '%04X' <port>)" && echo "port <port> listening" || echo "port <port> NOT listening"`
315
+
306
316
  ### Step 6: Start the App
307
317
 
308
318
  - **Static (SPA/SSG/cross-platform)**: nginx is already serving. Skip.
@@ -50,7 +50,6 @@ These tools should be available in the sandbox image. Verify with the pre-flight
50
50
  | curl | 8.x | Tool downloads, health checks |
51
51
  | build-essential | - | Native module compilation |
52
52
  | pnpm | 10.x | Monorepo / workspace installs |
53
- | lsof | 4.95.x | Port conflict detection |
54
53
 
55
54
  ### Install on Demand
56
55
 
@@ -6,7 +6,7 @@ Nginx is the primary serving mechanism for web apps deployed to the sandbox. Pyt
6
6
 
7
7
  ```bash
8
8
  sudo apt-get update -qq && sudo apt-get install -y -qq nginx 2>/dev/null || true
9
- sudo mkdir -p /etc/nginx/sites-enabled
9
+ sudo mkdir -p /etc/nginx/conf.d
10
10
  ```
11
11
 
12
12
  ## Template 1: SPA (with try_files fallback)
@@ -14,7 +14,7 @@ sudo mkdir -p /etc/nginx/sites-enabled
14
14
  Use for: Vite, CRA, Vue CLI, Angular, VitePress, Docusaurus, Taro H5, uni-app H5
15
15
 
16
16
  ```bash
17
- sudo tee /etc/nginx/sites-enabled/app.conf > /dev/null << 'NGINX_EOF'
17
+ sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
18
18
  server {
19
19
  listen <port>;
20
20
  root /workspace/<project>/<outputDir>;
@@ -38,7 +38,7 @@ sudo nginx -s reload 2>/dev/null || sudo nginx
38
38
  Use for: Next.js, Nuxt
39
39
 
40
40
  ```bash
41
- sudo tee /etc/nginx/sites-enabled/app.conf > /dev/null << 'NGINX_EOF'
41
+ sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
42
42
  server {
43
43
  listen <publicPort>;
44
44
  server_name _;
@@ -65,7 +65,7 @@ sudo nginx -s reload 2>/dev/null || sudo nginx
65
65
  Use for: Hugo, Hexo, plain static HTML
66
66
 
67
67
  ```bash
68
- sudo tee /etc/nginx/sites-enabled/app.conf > /dev/null << 'NGINX_EOF'
68
+ sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
69
69
  server {
70
70
  listen <port>;
71
71
  root /workspace/<project>/<outputDir>;