huaweicloud-devkit 1.0.2-dev.6 → 1.0.2-dev.7

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.0.2-dev.6",
3
+ "version": "1.0.2-dev.7",
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": [
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "1.0.2-dev.6",
23
+ "version": "1.0.2-dev.7",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-core",
3
- "version": "1.0.2-dev.6",
3
+ "version": "1.0.2-dev.7",
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",
@@ -20,7 +20,7 @@
20
20
  "mcpServers": "./.mcp.json",
21
21
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
22
  "skills": "./skills/",
23
- "version": "1.0.2-dev.6",
23
+ "version": "1.0.2-dev.7",
24
24
  "author": {
25
25
  "name": "HuaweiCloud Mate",
26
26
  "url": "https://github.com/huaweicloud"
@@ -63,7 +63,20 @@ Setup is a **plugin-side preflight** — the developer should be asked a questio
63
63
  | Session state persists | `exec_with_session` preserves `cd`, env vars, aliases between calls |
64
64
  | Destructive commands blocked | `rm -rf /`, `mkfs`, `dd if=`, fork bombs are denied by safety policy |
65
65
  | Workspace ID = dev_stage_id | Use `dev_stage_id` from `sandbox_connect` as `workspace_id` for terminal exec |
66
- | Node.js >= 22 required | Sandbox terminal uses built-in WebSocket (globalThis.WebSocket) |
66
+ | Node.js >= 22 required | Sandbox terminal uses built-in WebSocket (globalThis.WebSocket); if Node.js is missing, install it from the Huawei Cloud mirror (see "Node.js in the sandbox") |
67
+
68
+ ## Node.js in the sandbox
69
+
70
+ If the sandbox has no Node.js, download it from the Huawei Cloud mirror. Pick the tarball matching the sandbox arch (`uname -m`: `aarch64` -> arm64, `x86_64` -> x64):
71
+
72
+ ```bash
73
+ # aarch64 sandbox:
74
+ curl -fsSL https://mirrors.huaweicloud.com/nodejs/v24.19.0/node-v24.19.0-linux-arm64.tar.gz -o node.tar.gz
75
+ # x86_64 sandbox:
76
+ curl -fsSL https://mirrors.huaweicloud.com/nodejs/v24.19.0/node-v24.19.0-linux-x64.tar.gz -o node.tar.gz
77
+ sudo tar -xzf node.tar.gz -C /usr/local --strip-components=1
78
+ node --version
79
+ ```
67
80
 
68
81
  ## Environment Variables
69
82
 
@@ -1417,6 +1417,13 @@ function printAuthStatus(status) {
1417
1417
  async function cmdAuthInit() {
1418
1418
  console.log(BANNER);
1419
1419
  console.log('HuaweiCloud DevKit Unified Authentication Setup\n');
1420
+ console.log('\x1b[1m获取 AK/SK(如果还没有):\x1b[0m');
1421
+ console.log(' 1. 打开华为云控制台:');
1422
+ console.log(' https://console.huaweicloud.com/console/?region=cn-north-4#/home');
1423
+ console.log(' 2. 点击右上角账号名 -> 我的凭证');
1424
+ console.log(' 3. 进入"访问密钥"页签 -> 点击"新增访问密钥",完成身份验证');
1425
+ console.log(' 4. 下载凭证文件(内含 AK 和 SK)。');
1426
+ console.log(' 注意:SK 只在创建密钥时显示一次,请妥善保存该文件。\n');
1420
1427
 
1421
1428
  let ak = process.env.HW_ACCESS_KEY || '';
1422
1429
  let sk = process.env.HW_SECRET_KEY || '';
@@ -1445,22 +1452,21 @@ async function cmdAuthInit() {
1445
1452
 
1446
1453
 
1447
1454
  const vaultPath = writeGlobalCredentials({ ak, sk, securityToken, region });
1448
- console.log(`\nCredentials stored: ${vaultPath}`);
1449
1455
 
1450
1456
  try {
1451
- const obs = writeObsConfig({ ak, sk, securityToken, region });
1452
- console.log(`OBS config synced: ${obs.path} (${obs.endpoint})`);
1457
+ writeObsConfig({ ak, sk, securityToken, region });
1453
1458
  } catch (error) {
1454
1459
  console.log(`OBS config sync failed: ${error.message}`);
1455
1460
  }
1456
1461
 
1457
1462
  if (findHcloudBin()) {
1458
1463
  const result = configureHcloud({ ak, sk, region });
1459
- console.log(result.ok ? 'KooCLI profile updated.' : `KooCLI update failed: ${result.error || result.code}`);
1464
+ if (!result.ok) console.log(`KooCLI update failed: ${result.error || result.code}`);
1460
1465
  } else {
1461
1466
  console.log('KooCLI not found. Run "npx huaweicloud-devkit install-hcloud" and then "auth sync".');
1462
1467
  }
1463
1468
 
1469
+ console.log('\nCredentials synchronized.');
1464
1470
  console.log('\nNext steps:');
1465
1471
  console.log(' npx huaweicloud-devkit install --target all');
1466
1472
  console.log(' Restart your agent sessions.');
@@ -1480,12 +1486,10 @@ async function cmdAuthSync() {
1480
1486
 
1481
1487
  const result = syncAuth(target);
1482
1488
  if (result.ok) {
1483
- console.log(`OBS config synced: ${result.obs.path} (${result.obs.endpoint})`);
1489
+ console.log('Credentials synchronized.');
1484
1490
  } else {
1485
1491
  console.error(result.error);
1486
1492
  }
1487
- console.log('Agent MCP registration:');
1488
- printAuthAgents(result.agents);
1489
1493
  }
1490
1494
 
1491
1495
  async function cmdAuthStatus() {