ali-skills 0.0.30 → 0.0.31

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.
@@ -2340,7 +2340,7 @@ function logSkillParseFailures(failures) {
2340
2340
  if (f.hint) M.message(import_picocolors.default.yellow(` 提示: ${f.hint}`));
2341
2341
  }
2342
2342
  }
2343
- var version$1 = "2.0.31";
2343
+ var version$1 = "2.0.32";
2344
2344
  const isCancelled$1 = (value) => typeof value === "symbol";
2345
2345
  function redactSensitiveText(text) {
2346
2346
  return text.replace(/(https?:\/\/)([^/\s:@]+)(?::([^@/\s]*))?@/gi, "$1").replace(/([?&](?:private_token|access_token|token|api_key|access_key|secret|password)=)[^&\s]+/gi, "$1***");
@@ -4786,7 +4786,7 @@ function removeAuth() {
4786
4786
  if (existsSync(AUTH_FILE)) throw new Error(`Failed to remove auth file: ${AUTH_FILE}`);
4787
4787
  }
4788
4788
  function isAuthExpired(auth) {
4789
- return Date.now() >= auth.expiresAt - 10080 * 60 * 1e3;
4789
+ return Date.now() >= auth.expiresAt;
4790
4790
  }
4791
4791
  function getPrivateToken() {
4792
4792
  return readAuth()?.privateToken || null;
@@ -5492,8 +5492,8 @@ async function status(args = {}) {
5492
5492
  console.log(` 网关: ${getGatewayUrl()}`);
5493
5493
  console.log(` SSO_REFRESH_TOKEN: ${auth.ssoRefreshToken ? `${GREEN$2}已缓存${RESET$3}` : `${YELLOW$3}未缓存${RESET$3}`}${auth.ssoRefreshTokenUpdatedAt ? `${DIM$3}(更新于 ${new Date(auth.ssoRefreshTokenUpdatedAt).toLocaleString()})${RESET$3}` : ""}`);
5494
5494
  if (expired) {
5495
- console.log(` Token: ${YELLOW$3}即将过期${RESET$3}`);
5496
- console.log(`${TEXT$3}建议重新登录: npx ali-skills login${RESET$3}`);
5495
+ console.log(` Token: ${YELLOW$3}已过期${RESET$3}`);
5496
+ console.log(`${TEXT$3}请重新登录: npx ali-skills login --reauth${RESET$3}`);
5497
5497
  } else console.log(` Token: ${GREEN$2}有效${RESET$3} (还剩 ${remainingDays} 天)`);
5498
5498
  if (showAll) {
5499
5499
  console.log();
@@ -5555,10 +5555,11 @@ async function ensureSsoTicket() {
5555
5555
  gatewayDebugLog(`sso-ticket failed: code=${errorData.code ?? "n/a"}, error=${errorData.error ?? "Unknown error"}`);
5556
5556
  if (response.status === 401 && errorData.code === "INVALID_TOKEN") {
5557
5557
  console.error(`${RED$3}ali-skills CLI 会话凭证(Gateway private token)已失效,无法获取 BUC SSO_TICKET${RESET$3}`);
5558
- console.log(`${TEXT$3}请重新登录: npx ali-skills login${RESET$3}`);
5558
+ console.log(`${TEXT$3}请重新登录: npx ali-skills login --reauth${RESET$3}`);
5559
5559
  return null;
5560
5560
  }
5561
5561
  console.error(`${RED$3}获取 BUC SSO_TICKET 失败: ${errorData.error || errorData.code || "Unknown error"}${RESET$3}`);
5562
+ console.log(`${TEXT$3}如果问题持续,请重新登录: npx ali-skills login --reauth${RESET$3}`);
5562
5563
  return null;
5563
5564
  } catch (error) {
5564
5565
  gatewayDebugLog(`sso-ticket fetch exception: ${error.message}`);
@@ -5584,7 +5585,7 @@ async function refreshSsoSession(ssoRefreshToken) {
5584
5585
  async function ensureLogin() {
5585
5586
  const auth = readAuth();
5586
5587
  if (!auth) throw new Error("未登录,请先执行: npx ali-skills login");
5587
- if (isAuthExpired(auth)) throw new Error("登录已过期,请重新执行: npx ali-skills login");
5588
+ if (isAuthExpired(auth)) throw new Error("登录已过期,请重新执行: npx ali-skills login --reauth");
5588
5589
  return {
5589
5590
  privateToken: auth.privateToken,
5590
5591
  ssoRefreshToken: auth.ssoRefreshToken
@@ -6056,7 +6057,7 @@ async function sendSsoCookieDirectRequest(targetUrl, options) {
6056
6057
  console.log(`${DIM$2} 1. 尚未通过 ali-skills 登录${RESET$2}`);
6057
6058
  console.log(`${DIM$2} 2. 登录时未拿到根域 token${RESET$2}`);
6058
6059
  console.log(`${DIM$2} 3. token 已失效${RESET$2}`);
6059
- console.log(`${TEXT$2}建议执行: npx ali-skills login${RESET$2}`);
6060
+ console.log(`${TEXT$2}建议执行: npx ali-skills login --reauth${RESET$2}`);
6060
6061
  process.exit(1);
6061
6062
  }
6062
6063
  const hostname = new URL(targetUrl).hostname;
@@ -6154,7 +6155,7 @@ async function sendSsoTicketDirectRequest(targetUrl, options) {
6154
6155
  }
6155
6156
  if (!ssoTicket) {
6156
6157
  console.error(`${RED$2}Error: 缺少 SSO_TICKET,无法进行直连请求${RESET$2}`);
6157
- console.log(`${TEXT$2}建议执行: npx ali-skills login${RESET$2}`);
6158
+ console.log(`${TEXT$2}建议执行: npx ali-skills login --reauth${RESET$2}`);
6158
6159
  process.exit(1);
6159
6160
  }
6160
6161
  const requestHeaders = {
@@ -6388,7 +6389,7 @@ async function sendGatewayRequest(targetUrl, platformKey, options, authMode = "g
6388
6389
  code: "UNKNOWN"
6389
6390
  }))).code === "INVALID_TOKEN") {
6390
6391
  console.error(`${RED$2}Error: ali-skills CLI 会话凭证(Gateway private token)已失效${RESET$2}`);
6391
- console.log(`${TEXT$2}请重新登录: npx ali-skills login${RESET$2}`);
6392
+ console.log(`${TEXT$2}请重新登录: npx ali-skills login --reauth${RESET$2}`);
6392
6393
  process.exit(1);
6393
6394
  }
6394
6395
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.0.31",
3
+ "version": "2.0.32",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ali-skills",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "author": "",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@ali/cli-skills": "^2.0.31"
34
+ "@ali/cli-skills": "^2.0.32"
35
35
  },
36
36
  "bundleDependencies": [
37
37
  "@ali/cli-skills"