huaweicloud-devkit 1.1.13-next.6 → 1.1.13-next.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,7 +1,7 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
3
  "mcpName": "io.github.huaweicloud/huaweicloud-devkit",
4
- "version": "1.1.13-next.6",
4
+ "version": "1.1.13-next.7",
5
5
  "kooCliVersion": "7.3.12",
6
6
  "description": "Agent toolkit that helps coding agents use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities safely and accurately.",
7
7
  "type": "module",
@@ -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.13-next.6",
20
+ "version": "1.1.13-next.7",
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.13-next.6",
23
+ "version": "1.1.13-next.7",
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.13-next.6",
20
+ "version": "1.1.13-next.7",
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.13-next.6",
3
+ "version": "1.1.13-next.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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huaweicloud-devkit",
3
- "version": "1.1.13-next.6",
3
+ "version": "1.1.13-next.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",
@@ -2,7 +2,7 @@
2
2
  "name": "huaweicloud-devkit",
3
3
  "id": "huaweicloud-devkit",
4
4
  "displayName": "HuaweiCloud DevKit",
5
- "version": "1.1.13-next.6",
5
+ "version": "1.1.13-next.7",
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.",
@@ -98,6 +98,20 @@ async function hdkitRequest(method, path, body, timeoutMs = 300000) {
98
98
  // 该文案即最终展示内容(不带 "CODE: " 前缀、不附加引导)
99
99
  err.message = data.message || err.message;
100
100
  }
101
+ // 版本硬门禁(UPGRADE_MIN_VERSION):结构化升级引导,保证 remediation 能穿透 MCP 边界
102
+ if (code === 'HDKIT_VERSION_TOO_OLD') {
103
+ err.clientVersion = data.clientVersion || undefined;
104
+ err.minVersion = data.minVersion || undefined;
105
+ err.message = data.message || err.message;
106
+ err.remediation = {
107
+ hint: `插件版本过旧(当前 ${data.clientVersion || '未知'},需升级至正式版 ${data.minVersion || '最新版'} 及以上):`,
108
+ steps: [
109
+ '在终端执行:npx --yes huaweicloud-devkit@latest update --target <agent>',
110
+ '升级完成后重启当前 Agent 会话(MCP 工具需重启才生效)',
111
+ '也可直接调用 huaweicloud_upgrade 工具完成升级',
112
+ ],
113
+ };
114
+ }
101
115
  // 烧核播报(缺口#5 代码层):账号核心时长耗尽——上游码 HD.97520422 经
102
116
  // hdkitservice 以 HDKIT_UPSTREAM_ERROR 包装透传,客户端按消息内错误码识别。
103
117
  // 仅在前面的分支未设置 remediation 时生效(else-if 语义:烧核不覆盖 429 双码/凭证指引)
@@ -1717,8 +1717,23 @@ export async function callTool(name, rawArgs = {}, opts = {}) {
1717
1717
  args.timeout_ms || 60000,
1718
1718
  );
1719
1719
  }
1720
- case 'huaweicloud_sandbox_check_user':
1721
- return await hdkitCheckUser();
1720
+ case 'huaweicloud_sandbox_check_user': {
1721
+ try {
1722
+ return await hdkitCheckUser();
1723
+ } catch (error) {
1724
+ if (error?.code === 'HDKIT_VERSION_TOO_OLD') {
1725
+ return {
1726
+ ok: false,
1727
+ code: error.code,
1728
+ message: error.message,
1729
+ ...(error.clientVersion ? { clientVersion: error.clientVersion } : {}),
1730
+ ...(error.minVersion ? { minVersion: error.minVersion } : {}),
1731
+ ...(error.remediation ? { remediation: error.remediation } : {}),
1732
+ };
1733
+ }
1734
+ throw error;
1735
+ }
1736
+ }
1722
1737
  case 'huaweicloud_sandbox_sign_agreement':
1723
1738
  return await hdkitSignAgreement();
1724
1739
  case 'huaweicloud_sandbox_connect': {
@@ -1742,6 +1757,7 @@ export async function callTool(name, rawArgs = {}, opts = {}) {
1742
1757
  error?.code === 'HDKIT_QUOTA_EXCEEDED' ||
1743
1758
  error?.code === 'HDKIT_CAPACITY_INSUFFICIENT' ||
1744
1759
  error?.code === 'HDKIT_CRED_INVALID' ||
1760
+ error?.code === 'HDKIT_VERSION_TOO_OLD' ||
1745
1761
  error?.coreHoursExhausted
1746
1762
  ) {
1747
1763
  return {
@@ -1750,6 +1766,8 @@ export async function callTool(name, rawArgs = {}, opts = {}) {
1750
1766
  message: error.message,
1751
1767
  ...(error.retryAfter !== undefined ? { retryAfter: error.retryAfter } : {}),
1752
1768
  ...(error.coreHoursExhausted ? { coreHoursExhausted: true } : {}),
1769
+ ...(error.clientVersion ? { clientVersion: error.clientVersion } : {}),
1770
+ ...(error.minVersion ? { minVersion: error.minVersion } : {}),
1753
1771
  ...(error.remediation ? { remediation: error.remediation } : {}),
1754
1772
  };
1755
1773
  }