huaweicloud-devkit 1.1.13-next.7 → 1.1.13
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 +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/hdkitservice-api.mjs +31 -0
- package/plugins/huaweicloud-core/src/tools.mjs +3 -3
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
|
|
4
|
+
"version": "1.1.13",
|
|
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
|
|
20
|
+
"version": "1.1.13",
|
|
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
|
|
23
|
+
"version": "1.1.13",
|
|
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
|
|
20
|
+
"version": "1.1.13",
|
|
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
|
|
3
|
+
"version": "1.1.13",
|
|
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
|
|
3
|
+
"version": "1.1.13",
|
|
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
|
|
5
|
+
"version": "1.1.13",
|
|
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.",
|
|
@@ -166,6 +166,37 @@ export async function hdkitConnect(options = {}) {
|
|
|
166
166
|
return await hdkitRequest('POST', 'connect', body);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
// Gateway 504/502 during sandbox orchestration is a response timeout, not a
|
|
170
|
+
// failed create: the server keeps provisioning and a retry usually reuses the
|
|
171
|
+
// instance. Retry connect twice with a 30s/45s backoff instead of surfacing the
|
|
172
|
+
// raw HTML gateway page to the agent.
|
|
173
|
+
const CONNECT_RETRY_DELAYS_MS = [30000, 45000];
|
|
174
|
+
|
|
175
|
+
function isGatewayTransient(error) {
|
|
176
|
+
if (error?.status === 502 || error?.status === 504) return true;
|
|
177
|
+
const message = String(error?.message || '');
|
|
178
|
+
return /non-JSON \(status (502|504)\)/i.test(message) || /Gateway Time-out|Bad Gateway/i.test(message);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
182
|
+
|
|
183
|
+
export async function hdkitConnectWithRetry(options = {}, { delaysMs = CONNECT_RETRY_DELAYS_MS } = {}) {
|
|
184
|
+
const delays = Array.isArray(delaysMs) ? delaysMs : CONNECT_RETRY_DELAYS_MS;
|
|
185
|
+
let attempt = 0;
|
|
186
|
+
for (;;) {
|
|
187
|
+
try {
|
|
188
|
+
return await hdkitConnect(options);
|
|
189
|
+
} catch (error) {
|
|
190
|
+
if (!isGatewayTransient(error) || attempt >= delays.length) {
|
|
191
|
+
error.connectRetries = attempt;
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
await sleep(delays[attempt]);
|
|
195
|
+
attempt += 1;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
169
200
|
export async function hdkitCredentials(sessionId, devStageId, enableSts = true) {
|
|
170
201
|
const body = { enable_sts: enableSts };
|
|
171
202
|
if (sessionId) body.session_id = sessionId;
|
|
@@ -40,7 +40,7 @@ import { ensureDevbridgeKey, buildKeyringInjectScript, listKeysForQuotaHint } fr
|
|
|
40
40
|
import {
|
|
41
41
|
hdkitCheckUser,
|
|
42
42
|
hdkitSignAgreement,
|
|
43
|
-
|
|
43
|
+
hdkitConnectWithRetry,
|
|
44
44
|
hdkitCredentials,
|
|
45
45
|
hdkitVoucherStatus,
|
|
46
46
|
hdkitVoucherClaim,
|
|
@@ -893,7 +893,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
893
893
|
{
|
|
894
894
|
name: 'huaweicloud_sandbox_connect',
|
|
895
895
|
description:
|
|
896
|
-
'Connect to a sandbox via hdkitservice. One instance per user per pool — reuses the same-pool sandbox if available, otherwise creates a new one. Quota: 1 instance per pool type (a user may hold 1 ephemeral AND 1 persistent simultaneously; same-type requests reuse the existing instance). On quota exhaustion the API returns HTTP 429 with a Retry-After header and a dual error code: HDKIT_QUOTA_EXCEEDED (retry useless — release or reuse the existing instance) vs HDKIT_CAPACITY_INSUFFICIENT (pool capacity; retry later / off-peak). Returns session_id, dev_stage_id, connection_id, connection_address, expiresAt (STS credential expiry), pool_type/template_id echo, server-configured lifecycle numbers (pool_idle_shutdown_minutes / pool_idle_delete_minutes / pool_reclaim_minutes) and started (true when a reused instance was woken from shutdown). Lifecycle hints are announced only on the first connect of a session or when started=true. Ephemeral pool (default): idle auto-shutdown after 30min, auto-delete after 1h — do not keep important data there. Persistent pool: data disk retained (EVS 32G), idle shutdown after 1h, idle reclaim capped at 7 days. Numbers are configured by hdkitservice; the text follows the server echo and falls back to these defaults.',
|
|
896
|
+
'Connect to a sandbox via hdkitservice. One instance per user per pool — reuses the same-pool sandbox if available, otherwise creates a new one. Quota: 1 instance per pool type (a user may hold 1 ephemeral AND 1 persistent simultaneously; same-type requests reuse the existing instance). On quota exhaustion the API returns HTTP 429 with a Retry-After header and a dual error code: HDKIT_QUOTA_EXCEEDED (retry useless — release or reuse the existing instance) vs HDKIT_CAPACITY_INSUFFICIENT (pool capacity; retry later / off-peak). Gateway 502/504 timeouts during orchestration are retried automatically (30s/45s backoff) — the server may already have created the instance, so a retry reuses it. Returns session_id, dev_stage_id, connection_id, connection_address, expiresAt (STS credential expiry), pool_type/template_id echo, server-configured lifecycle numbers (pool_idle_shutdown_minutes / pool_idle_delete_minutes / pool_reclaim_minutes) and started (true when a reused instance was woken from shutdown). Lifecycle hints are announced only on the first connect of a session or when started=true. Ephemeral pool (default): idle auto-shutdown after 30min, auto-delete after 1h — do not keep important data there. Persistent pool: data disk retained (EVS 32G), idle shutdown after 1h, idle reclaim capped at 7 days. Numbers are configured by hdkitservice; the text follows the server echo and falls back to these defaults.',
|
|
897
897
|
inputSchema: {
|
|
898
898
|
type: 'object',
|
|
899
899
|
properties: {
|
|
@@ -1749,7 +1749,7 @@ export async function callTool(name, rawArgs = {}, opts = {}) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
let connectResult;
|
|
1751
1751
|
try {
|
|
1752
|
-
connectResult = await
|
|
1752
|
+
connectResult = await hdkitConnectWithRetry(connectArgs);
|
|
1753
1753
|
} catch (error) {
|
|
1754
1754
|
// 业务预期失败(429 双码 / 烧核 / 凭证失效)转结构化返回,remediation 才能穿透 MCP 边界;
|
|
1755
1755
|
// 其余错误维持抛出(MCP 层透传 code+message)
|