huaweicloud-devkit 1.0.2-next.21 → 1.0.2-next.23
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/README.md +7 -3
- package/README.zh-CN.md +7 -3
- 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/src/sandbox/session-manager.mjs +6 -0
- package/plugins/huaweicloud-core/src/tools.mjs +58 -7
package/README.md
CHANGED
|
@@ -101,13 +101,17 @@ npx --yes huaweicloud-devkit uninstall --target officeace
|
|
|
101
101
|
### OpenClaw
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
104
|
+
# Recommended (ClawHub)
|
|
105
|
+
openclaw plugins install clawhub:huaweicloud-devkit
|
|
106
|
+
openclaw plugins uninstall huaweicloud-devkit
|
|
107
|
+
openclaw plugins update huaweicloud-devkit
|
|
105
108
|
```
|
|
106
109
|
|
|
107
|
-
**Restart OpenClaw** after installation.
|
|
110
|
+
**Restart OpenClaw** after installation. If prompted for security risk acknowledgment, add `--acknowledge-clawhub-risk`.
|
|
108
111
|
|
|
109
112
|
```bash
|
|
110
|
-
|
|
113
|
+
# Or via npx
|
|
114
|
+
npx --yes huaweicloud-devkit install --target openclaw
|
|
111
115
|
npx --yes huaweicloud-devkit status --target openclaw
|
|
112
116
|
npx --yes huaweicloud-devkit update --target openclaw
|
|
113
117
|
npx --yes huaweicloud-devkit uninstall --target openclaw
|
package/README.zh-CN.md
CHANGED
|
@@ -101,13 +101,17 @@ npx --yes huaweicloud-devkit uninstall --target officeace
|
|
|
101
101
|
### OpenClaw
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
|
|
104
|
+
# 推荐方式 (ClawHub)
|
|
105
|
+
openclaw plugins install clawhub:huaweicloud-devkit
|
|
106
|
+
openclaw plugins uninstall huaweicloud-devkit
|
|
107
|
+
openclaw plugins update huaweicloud-devkit
|
|
105
108
|
```
|
|
106
109
|
|
|
107
|
-
安装后**重启 OpenClaw
|
|
110
|
+
安装后**重启 OpenClaw**。如提示安全风险确认,加 `--acknowledge-clawhub-risk`。
|
|
108
111
|
|
|
109
112
|
```bash
|
|
110
|
-
|
|
113
|
+
# 或通过 npx
|
|
114
|
+
npx --yes huaweicloud-devkit install --target openclaw
|
|
111
115
|
npx --yes huaweicloud-devkit status --target openclaw
|
|
112
116
|
npx --yes huaweicloud-devkit update --target openclaw
|
|
113
117
|
npx --yes huaweicloud-devkit uninstall --target openclaw
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "huaweicloud-devkit",
|
|
3
|
-
"version": "1.0.2-next.
|
|
3
|
+
"version": "1.0.2-next.23",
|
|
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.0.2-next.
|
|
20
|
+
"version": "1.0.2-next.23",
|
|
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.0.2-next.
|
|
3
|
+
"version": "1.0.2-next.23",
|
|
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,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.0.2-next.
|
|
20
|
+
"version": "1.0.2-next.23",
|
|
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.0.2-next.
|
|
3
|
+
"version": "1.0.2-next.23",
|
|
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.0.2-next.
|
|
3
|
+
"version": "1.0.2-next.23",
|
|
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.
|
|
5
|
+
"version": "1.0.2-next.23",
|
|
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.",
|
|
@@ -527,6 +527,12 @@ export async function uploadProjectWithSession(
|
|
|
527
527
|
timeoutMs = 300000,
|
|
528
528
|
options = {},
|
|
529
529
|
) {
|
|
530
|
+
if (!workspaceId) {
|
|
531
|
+
throw new Error(
|
|
532
|
+
'sandbox upload project: workspace_id is required. ' +
|
|
533
|
+
'Set HW_WORKSPACE_ID env var or ensure huaweicloud_sandbox_connect was called first.',
|
|
534
|
+
);
|
|
535
|
+
}
|
|
530
536
|
if (!existsSync(localDir)) {
|
|
531
537
|
throw new Error(`sandbox upload project: local directory not found: ${localDir}`);
|
|
532
538
|
}
|
|
@@ -468,7 +468,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
468
468
|
required: ['command'],
|
|
469
469
|
properties: {
|
|
470
470
|
command: { type: 'string', description: 'The shell command to execute on the remote workspace' },
|
|
471
|
-
workspace_id: {
|
|
471
|
+
workspace_id: {
|
|
472
|
+
type: 'string',
|
|
473
|
+
description:
|
|
474
|
+
'Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set.',
|
|
475
|
+
},
|
|
472
476
|
username: { type: 'string', description: 'Login username for the remote terminal (default: root)' },
|
|
473
477
|
timeout_ms: { type: 'number', description: 'Execution timeout in milliseconds (default: 120000)' },
|
|
474
478
|
},
|
|
@@ -483,7 +487,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
483
487
|
required: ['command'],
|
|
484
488
|
properties: {
|
|
485
489
|
command: { type: 'string', description: 'The shell command to execute on the remote workspace' },
|
|
486
|
-
workspace_id: {
|
|
490
|
+
workspace_id: {
|
|
491
|
+
type: 'string',
|
|
492
|
+
description:
|
|
493
|
+
'Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set.',
|
|
494
|
+
},
|
|
487
495
|
username: { type: 'string', description: 'Login username for the remote terminal (default: root)' },
|
|
488
496
|
timeout_ms: { type: 'number', description: 'Execution timeout in milliseconds (default: 120000)' },
|
|
489
497
|
},
|
|
@@ -495,7 +503,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
495
503
|
inputSchema: {
|
|
496
504
|
type: 'object',
|
|
497
505
|
properties: {
|
|
498
|
-
workspace_id: {
|
|
506
|
+
workspace_id: {
|
|
507
|
+
type: 'string',
|
|
508
|
+
description:
|
|
509
|
+
'Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set.',
|
|
510
|
+
},
|
|
499
511
|
username: { type: 'string', description: 'Login username (default: root)' },
|
|
500
512
|
},
|
|
501
513
|
},
|
|
@@ -510,7 +522,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
510
522
|
properties: {
|
|
511
523
|
local_path: { type: 'string', description: 'Absolute path to the local file to upload.' },
|
|
512
524
|
remote_path: { type: 'string', description: 'Target path in the sandbox, e.g. /workspace/<repo>/index.html.' },
|
|
513
|
-
workspace_id: {
|
|
525
|
+
workspace_id: {
|
|
526
|
+
type: 'string',
|
|
527
|
+
description:
|
|
528
|
+
'Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set.',
|
|
529
|
+
},
|
|
514
530
|
username: { type: 'string', description: 'Login username (default: root)' },
|
|
515
531
|
timeout_ms: { type: 'number', description: 'Per-command execution timeout in milliseconds (default: 120000)' },
|
|
516
532
|
},
|
|
@@ -530,7 +546,11 @@ export const TOOL_DEFINITIONS = [
|
|
|
530
546
|
description:
|
|
531
547
|
'Remote parent directory where project will be extracted (default: /workspace). Final layout: <remote_dir>/<dirname>/',
|
|
532
548
|
},
|
|
533
|
-
workspace_id: {
|
|
549
|
+
workspace_id: {
|
|
550
|
+
type: 'string',
|
|
551
|
+
description:
|
|
552
|
+
'Workspace ID from huaweicloud_sandbox_connect return value. Required - must be passed explicitly when HW_WORKSPACE_ID is not set.',
|
|
553
|
+
},
|
|
534
554
|
username: { type: 'string', description: 'Login username (default: root)' },
|
|
535
555
|
exclude: {
|
|
536
556
|
type: 'array',
|
|
@@ -666,6 +686,12 @@ export async function callTool(name, args = {}) {
|
|
|
666
686
|
return { status: 'ok', message: 'Runtime credentials set for this MCP session.' };
|
|
667
687
|
case 'huaweicloud_sandbox_exec_with_session': {
|
|
668
688
|
const sandboxWsId2 = args.workspace_id || currentWorkspaceId;
|
|
689
|
+
if (!sandboxWsId2) {
|
|
690
|
+
throw new Error(
|
|
691
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
692
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
693
|
+
);
|
|
694
|
+
}
|
|
669
695
|
const sandboxUser2 = args.username || 'root';
|
|
670
696
|
const sandboxTimeout2 = args.timeout_ms || 120000;
|
|
671
697
|
const sandboxResult2 = await execWithSession(sandboxWsId2, args.command, sandboxUser2, sandboxTimeout2);
|
|
@@ -673,6 +699,12 @@ export async function callTool(name, args = {}) {
|
|
|
673
699
|
}
|
|
674
700
|
case 'huaweicloud_sandbox_exec_one_shot': {
|
|
675
701
|
const sandboxWsId3 = args.workspace_id || currentWorkspaceId;
|
|
702
|
+
if (!sandboxWsId3) {
|
|
703
|
+
throw new Error(
|
|
704
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
705
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
706
|
+
);
|
|
707
|
+
}
|
|
676
708
|
const sandboxUser3 = args.username || 'root';
|
|
677
709
|
const sandboxTimeout3 = args.timeout_ms || 120000;
|
|
678
710
|
const sandboxResult3 = await execOneShot(sandboxWsId3, args.command, sandboxUser3, sandboxTimeout3);
|
|
@@ -680,6 +712,12 @@ export async function callTool(name, args = {}) {
|
|
|
680
712
|
}
|
|
681
713
|
case 'huaweicloud_sandbox_close_session': {
|
|
682
714
|
const sandboxWsId4 = args.workspace_id || currentWorkspaceId;
|
|
715
|
+
if (!sandboxWsId4) {
|
|
716
|
+
throw new Error(
|
|
717
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
718
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
719
|
+
);
|
|
720
|
+
}
|
|
683
721
|
const sandboxUser4 = args.username || 'root';
|
|
684
722
|
const closed = await closeSession(sandboxWsId4, sandboxUser4);
|
|
685
723
|
return closed ? 'ok' : 'not_connected';
|
|
@@ -689,6 +727,12 @@ export async function callTool(name, args = {}) {
|
|
|
689
727
|
throw new Error('local_path and remote_path are required.');
|
|
690
728
|
}
|
|
691
729
|
const sandboxWsId5 = args.workspace_id || currentWorkspaceId;
|
|
730
|
+
if (!sandboxWsId5) {
|
|
731
|
+
throw new Error(
|
|
732
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
733
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
734
|
+
);
|
|
735
|
+
}
|
|
692
736
|
const sandboxUser5 = args.username || 'root';
|
|
693
737
|
const sandboxTimeout5 = args.timeout_ms || 120000;
|
|
694
738
|
return await uploadFileWithSession(
|
|
@@ -704,6 +748,12 @@ export async function callTool(name, args = {}) {
|
|
|
704
748
|
throw new Error('local_dir is required.');
|
|
705
749
|
}
|
|
706
750
|
const sandboxWsId6 = args.workspace_id || currentWorkspaceId;
|
|
751
|
+
if (!sandboxWsId6) {
|
|
752
|
+
throw new Error(
|
|
753
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
754
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
755
|
+
);
|
|
756
|
+
}
|
|
707
757
|
const sandboxUser6 = args.username || 'root';
|
|
708
758
|
const sandboxTimeout6 = args.timeout_ms || 120000;
|
|
709
759
|
return await uploadProjectWithSession(
|
|
@@ -724,8 +774,9 @@ export async function callTool(name, args = {}) {
|
|
|
724
774
|
return await hdkitSignAgreement();
|
|
725
775
|
case 'huaweicloud_sandbox_connect': {
|
|
726
776
|
const connectResult = await hdkitConnect(args);
|
|
727
|
-
|
|
728
|
-
|
|
777
|
+
const devStageId = connectResult?.dev_stage_id || connectResult?.devStageId;
|
|
778
|
+
if (devStageId) {
|
|
779
|
+
setWorkspaceId(devStageId);
|
|
729
780
|
}
|
|
730
781
|
return connectResult;
|
|
731
782
|
}
|