huaweicloud-devkit 1.1.10-next.1 → 1.1.10-next.3

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.10-next.1",
4
+ "version": "1.1.10-next.3",
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.10-next.1",
20
+ "version": "1.1.10-next.3",
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.10-next.1",
23
+ "version": "1.1.10-next.3",
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.10-next.1",
20
+ "version": "1.1.10-next.3",
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.10-next.1",
3
+ "version": "1.1.10-next.3",
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.10-next.1",
3
+ "version": "1.1.10-next.3",
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.10-next.1",
5
+ "version": "1.1.10-next.3",
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.",
@@ -11,6 +11,7 @@ import {
11
11
  readCodeArtsCredentials,
12
12
  readGlobalCredentials,
13
13
  resolveCredentialsWithRuntime,
14
+ resolveXAuthToken,
14
15
  writeLastSync,
15
16
  writeObsConfig,
16
17
  } from './credentials.mjs';
@@ -79,6 +80,14 @@ export function computeOnboarding({ credentials, reconciled } = {}) {
79
80
  message = '已从码道 MCP settings 读取到临时凭证,MCP 工具可直接使用。';
80
81
  return { needsSetup: false, scenario, reason, message, steps: [], accountHint };
81
82
  }
83
+ if (resolveXAuthToken() && !s1Has && !envHasCreds) {
84
+ // X-Auth-Token authentication: no AK/SK injected but a token is present —
85
+ // devkit exchanges it for temporary AK/SK on demand, so no manual setup.
86
+ scenario = 0;
87
+ reason = 'token-auth';
88
+ message = '已使用 X-Auth-Token 认证,MCP 工具可直接使用,无需配置 AK/SK。';
89
+ return { needsSetup: false, scenario, reason, message, steps: [], accountHint };
90
+ }
82
91
  if (s1Has && !envHasCreds) {
83
92
  scenario = 1;
84
93
  reason = 's1-only';
@@ -167,6 +176,7 @@ export function getAuthStatus(target = 'all') {
167
176
  const s4Creds = readCodeArtsCredentials();
168
177
  const onboarding = computeOnboarding({ credentials, reconciled });
169
178
  const stsExpiry = computeStsExpiry();
179
+ const tokenAuth = resolveXAuthToken();
170
180
  const credentialPanel = {
171
181
  sts: stsExpiry, // 临时 STS(MCP==沙箱同源)
172
182
  s1: {
@@ -174,11 +184,12 @@ export function getAuthStatus(target = 'all') {
174
184
  fingerprint: credentials?.ak ? fingerprint(credentials.ak, credentials.sk) : null,
175
185
  persistent: true, // 永久,无过期
176
186
  },
177
- activeSource: stsExpiry ? 'temporary-sts' : credentials?.ak ? 's1-persistent' : 'none',
187
+ token: tokenAuth ? { active: true } : { active: false },
188
+ activeSource: stsExpiry ? 'temporary-sts' : credentials?.ak ? 's1-persistent' : tokenAuth ? 'x-auth-token' : 'none',
178
189
  };
179
190
  return {
180
191
  target,
181
- credentialsConfigured: Boolean(credentials?.ak && credentials?.sk),
192
+ credentialsConfigured: Boolean(credentials?.ak && credentials?.sk) || Boolean(tokenAuth),
182
193
  credentialsPath: globalCredentialsPath(),
183
194
  mcpSettingsConfigured: Boolean(s4Creds?.ak && s4Creds?.sk),
184
195
  mcpSettingsSource: s4Creds ? 'codearts' : null,