huaweicloud-devkit 1.0.2-next.20 → 1.0.2-next.21

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.
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "plugins": [
7
7
  {
8
- "name": "huaweicloud-core",
8
+ "name": "huaweicloud-devkit",
9
9
  "source": {
10
10
  "source": "local",
11
11
  "path": "./plugins/huaweicloud-core"
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), and OfficeAce.
11
+ Supports OpenCode, CodeArts Agent, WorkBuddy, DeepSeek Harness (DSH), OfficeAce, and OpenClaw.
12
12
 
13
13
  ## Prerequisites
14
14
 
@@ -31,7 +31,7 @@ npx --yes huaweicloud-devkit doctor --target opencode
31
31
  npx --yes huaweicloud-devkit status --target opencode
32
32
  npx --yes huaweicloud-devkit update --target opencode
33
33
  npx --yes huaweicloud-devkit uninstall --target opencode
34
- rm -rf ~/.npm/_npx/ # Linux/macOS: clear npx cache to remove old version residue
34
+ rm -rf ~/.npm/_npx/ # Linux/macOS only; Windows path TBD
35
35
  ```
36
36
 
37
37
  ### CodeArts Agent
@@ -98,6 +98,22 @@ npx --yes huaweicloud-devkit update --target officeace
98
98
  npx --yes huaweicloud-devkit uninstall --target officeace
99
99
  ```
100
100
 
101
+ ### OpenClaw
102
+
103
+ ```bash
104
+ npx --yes huaweicloud-devkit install --target openclaw
105
+ ```
106
+
107
+ **Restart OpenClaw** after installation.
108
+
109
+ ```bash
110
+ npx --yes huaweicloud-devkit doctor --target openclaw
111
+ npx --yes huaweicloud-devkit status --target openclaw
112
+ npx --yes huaweicloud-devkit update --target openclaw
113
+ npx --yes huaweicloud-devkit uninstall --target openclaw
114
+ rm -rf ~/.npm/_npx/ # Linux/macOS only; Windows path TBD
115
+ ```
116
+
101
117
  ### Other Agents
102
118
 
103
119
  Any agent that supports MCP can use the standard config:
@@ -107,7 +123,7 @@ Any agent that supports MCP can use the standard config:
107
123
  "mcpServers": {
108
124
  "huaweicloud-devkit": {
109
125
  "command": "npx",
110
- "args": ["-y", "-p", "huaweicloud-devkit@next", "huaweicloud-devkit-mcp"]
126
+ "args": ["-y", "-p", "huaweicloud-devkit", "huaweicloud-devkit-mcp"]
111
127
  }
112
128
  }
113
129
  }
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。
11
+ 支持 OpenCode、码道(CodeArts Agent)、WorkBuddy、DeepSeek Harness(DSH)、OfficeAce、OpenClaw
12
12
 
13
13
  ## 前置条件
14
14
 
@@ -31,7 +31,7 @@ npx --yes huaweicloud-devkit doctor --target opencode
31
31
  npx --yes huaweicloud-devkit status --target opencode
32
32
  npx --yes huaweicloud-devkit update --target opencode
33
33
  npx --yes huaweicloud-devkit uninstall --target opencode
34
- rm -rf ~/.npm/_npx/ # Linux/macOS: 清理 npx 缓存避免旧版残留
34
+ rm -rf ~/.npm/_npx/ # Linux/macOS;Windows 路径待确认
35
35
  ```
36
36
 
37
37
  ### CodeArts Agent(码道)
@@ -98,6 +98,22 @@ npx --yes huaweicloud-devkit update --target officeace
98
98
  npx --yes huaweicloud-devkit uninstall --target officeace
99
99
  ```
100
100
 
101
+ ### OpenClaw
102
+
103
+ ```bash
104
+ npx --yes huaweicloud-devkit install --target openclaw
105
+ ```
106
+
107
+ 安装后**重启 OpenClaw**。
108
+
109
+ ```bash
110
+ npx --yes huaweicloud-devkit doctor --target openclaw
111
+ npx --yes huaweicloud-devkit status --target openclaw
112
+ npx --yes huaweicloud-devkit update --target openclaw
113
+ npx --yes huaweicloud-devkit uninstall --target openclaw
114
+ rm -rf ~/.npm/_npx/ # 仅 Linux/macOS;Windows 路径待确认
115
+ ```
116
+
101
117
  ### 其他 Agent
102
118
 
103
119
  任何支持 MCP 协议的 Agent,直接使用标准 MCP 配置:
@@ -107,7 +123,7 @@ npx --yes huaweicloud-devkit uninstall --target officeace
107
123
  "mcpServers": {
108
124
  "huaweicloud-devkit": {
109
125
  "command": "npx",
110
- "args": ["-y", "-p", "huaweicloud-devkit@next", "huaweicloud-devkit-mcp"]
126
+ "args": ["-y", "-p", "huaweicloud-devkit", "huaweicloud-devkit-mcp"]
111
127
  }
112
128
  }
113
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.0.2-next.20",
3
+ "version": "1.0.2-next.21",
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,13 +17,13 @@
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.0.2-next.20",
20
+ "version": "1.0.2-next.21",
21
21
  "author": {
22
22
  "name": "HuaweiCloud Mate",
23
23
  "url": "https://github.com/huaweicloud"
24
24
  },
25
25
  "hooks": "./hooks/",
26
- "name": "huaweicloud-core",
26
+ "name": "huaweicloud-devkit",
27
27
  "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
28
28
  "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
29
29
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "huaweicloud-core",
3
- "version": "1.0.2-next.20",
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.2-next.21",
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",
@@ -17,13 +17,13 @@
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.0.2-next.20",
20
+ "version": "1.0.2-next.21",
21
21
  "author": {
22
22
  "name": "HuaweiCloud Mate",
23
23
  "url": "https://github.com/huaweicloud"
24
24
  },
25
25
  "hooks": "./hooks/",
26
- "name": "huaweicloud-core",
26
+ "name": "huaweicloud-devkit",
27
27
  "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
28
28
  "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
29
29
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "huaweicloud-core",
3
- "version": "1.0.2-next.20",
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.2-next.21",
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
- "name": "huaweicloud-core",
3
- "version": "1.0.2-next.20",
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.2-next.21",
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.0.2-next.18",
5
+ "version": "1.0.2-next.21",
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.",
@@ -14,7 +14,12 @@ const execFileAsync = promisify(execFile);
14
14
  const __dirname = dirname(fileURLToPath(import.meta.url));
15
15
  export const WS_EXEC_INDEX_URL = pathToFileURL(join(__dirname, '..', 'ws-exec', 'index.js')).href;
16
16
 
17
- const DEFAULT_WORKSPACE_ID = process.env.HW_WORKSPACE_ID || '0107bd9997aa4287bd2b4890b49af07d';
17
+ let currentWorkspaceId = process.env.HW_WORKSPACE_ID || null;
18
+
19
+ function setWorkspaceId(id) {
20
+ currentWorkspaceId = id;
21
+ process.env.HW_WORKSPACE_ID = id;
22
+ }
18
23
 
19
24
  function resolveEnv() {
20
25
  const env = { ...process.env };
@@ -604,4 +609,4 @@ export async function closeAllSessions() {
604
609
  }
605
610
  }
606
611
 
607
- export { DEFAULT_WORKSPACE_ID, runNodeExec };
612
+ export { currentWorkspaceId, setWorkspaceId, runNodeExec };
@@ -3046,7 +3046,7 @@ async function main() {
3046
3046
  default:
3047
3047
  console.log(BANNER);
3048
3048
  console.log(
3049
- 'Usage: npx huaweicloud-devkit <command> [--target <opencode|codex|codearts|workbuddy|dsh|officeace|hermes|all>]\n',
3049
+ 'Usage: npx huaweicloud-devkit <command> [--target <opencode|codex|codearts|workbuddy|dsh|officeace|hermes|openclaw|all>]\n',
3050
3050
  );
3051
3051
  console.log('Commands:');
3052
3052
  console.log(' install Install skills, MCP server, safety policy');
@@ -3061,7 +3061,7 @@ async function main() {
3061
3061
  console.log(' help Show this help');
3062
3062
  console.log('\nOptions:');
3063
3063
  console.log(
3064
- ' --target Target agent: opencode (default), codex, codearts, workbuddy, dsh, officeace, hermes, all',
3064
+ ' --target Target agent: opencode (default), codex, codearts, workbuddy, dsh, officeace, hermes, openclaw, all',
3065
3065
  );
3066
3066
  console.log('\nExamples:');
3067
3067
  console.log(' npx huaweicloud-devkit install');
@@ -14,7 +14,8 @@ import {
14
14
  closeSession,
15
15
  uploadFileWithSession,
16
16
  uploadProjectWithSession,
17
- DEFAULT_WORKSPACE_ID,
17
+ currentWorkspaceId,
18
+ setWorkspaceId,
18
19
  } from './sandbox/session-manager.mjs';
19
20
  import { hdkitCheckUser, hdkitSignAgreement, hdkitConnect, hdkitCredentials } from './sandbox/hdkitservice-api.mjs';
20
21
  import { getAuthStatus, syncAuth } from './auth/service.mjs';
@@ -424,7 +425,7 @@ export const TOOL_DEFINITIONS = [
424
425
  target: {
425
426
  type: 'string',
426
427
  description:
427
- 'Agent target to check: opencode, codex, codex-desktop, codearts, workbuddy, dsh, officeace, hermes, or all (default).',
428
+ 'Agent target to check: opencode, codex, codex-desktop, codearts, workbuddy, dsh, officeace, hermes, openclaw, or all (default).',
428
429
  },
429
430
  },
430
431
  },
@@ -664,21 +665,21 @@ export async function callTool(name, args = {}) {
664
665
  setRuntimeCredentials(args.ak, args.sk, undefined, args.region);
665
666
  return { status: 'ok', message: 'Runtime credentials set for this MCP session.' };
666
667
  case 'huaweicloud_sandbox_exec_with_session': {
667
- const sandboxWsId2 = args.workspace_id || DEFAULT_WORKSPACE_ID;
668
+ const sandboxWsId2 = args.workspace_id || currentWorkspaceId;
668
669
  const sandboxUser2 = args.username || 'root';
669
670
  const sandboxTimeout2 = args.timeout_ms || 120000;
670
671
  const sandboxResult2 = await execWithSession(sandboxWsId2, args.command, sandboxUser2, sandboxTimeout2);
671
672
  return { stdout: sandboxResult2.stdout, exitCode: sandboxResult2.exitCode };
672
673
  }
673
674
  case 'huaweicloud_sandbox_exec_one_shot': {
674
- const sandboxWsId3 = args.workspace_id || DEFAULT_WORKSPACE_ID;
675
+ const sandboxWsId3 = args.workspace_id || currentWorkspaceId;
675
676
  const sandboxUser3 = args.username || 'root';
676
677
  const sandboxTimeout3 = args.timeout_ms || 120000;
677
678
  const sandboxResult3 = await execOneShot(sandboxWsId3, args.command, sandboxUser3, sandboxTimeout3);
678
679
  return { stdout: sandboxResult3.stdout, exitCode: sandboxResult3.exitCode };
679
680
  }
680
681
  case 'huaweicloud_sandbox_close_session': {
681
- const sandboxWsId4 = args.workspace_id || DEFAULT_WORKSPACE_ID;
682
+ const sandboxWsId4 = args.workspace_id || currentWorkspaceId;
682
683
  const sandboxUser4 = args.username || 'root';
683
684
  const closed = await closeSession(sandboxWsId4, sandboxUser4);
684
685
  return closed ? 'ok' : 'not_connected';
@@ -687,7 +688,7 @@ export async function callTool(name, args = {}) {
687
688
  if (!args.local_path || !args.remote_path) {
688
689
  throw new Error('local_path and remote_path are required.');
689
690
  }
690
- const sandboxWsId5 = args.workspace_id || DEFAULT_WORKSPACE_ID;
691
+ const sandboxWsId5 = args.workspace_id || currentWorkspaceId;
691
692
  const sandboxUser5 = args.username || 'root';
692
693
  const sandboxTimeout5 = args.timeout_ms || 120000;
693
694
  return await uploadFileWithSession(
@@ -702,7 +703,7 @@ export async function callTool(name, args = {}) {
702
703
  if (!args.local_dir) {
703
704
  throw new Error('local_dir is required.');
704
705
  }
705
- const sandboxWsId6 = args.workspace_id || DEFAULT_WORKSPACE_ID;
706
+ const sandboxWsId6 = args.workspace_id || currentWorkspaceId;
706
707
  const sandboxUser6 = args.username || 'root';
707
708
  const sandboxTimeout6 = args.timeout_ms || 120000;
708
709
  return await uploadProjectWithSession(
@@ -721,8 +722,13 @@ export async function callTool(name, args = {}) {
721
722
  return await hdkitCheckUser();
722
723
  case 'huaweicloud_sandbox_sign_agreement':
723
724
  return await hdkitSignAgreement();
724
- case 'huaweicloud_sandbox_connect':
725
- return await hdkitConnect(args);
725
+ case 'huaweicloud_sandbox_connect': {
726
+ const connectResult = await hdkitConnect(args);
727
+ if (connectResult?.dev_stage_id) {
728
+ setWorkspaceId(connectResult.dev_stage_id);
729
+ }
730
+ return connectResult;
731
+ }
726
732
  case 'huaweicloud_sandbox_credentials':
727
733
  return await hdkitCredentials(args.session_id, args.dev_stage_id, args.enable_sts !== false);
728
734
  default: