weaver-work-cli 0.1.38 → 0.1.40

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.
Files changed (166) hide show
  1. package/README.md +7 -3
  2. package/dist/chunks/{archive-PDV724YK.js → archive-JHTONRST.js} +556 -66
  3. package/dist/chunks/{archive-oa-4XE4MNXQ.js → archive-oa-FCHLCPHC.js} +2 -2
  4. package/dist/chunks/{asset-PDL2QE2N.js → asset-RLIHC7DB.js} +2 -2
  5. package/dist/chunks/asset-idle-KVOFTLCP.js +670 -0
  6. package/dist/chunks/{attachment-content-MDDGOE5E.js → attachment-content-RZYDB3MB.js} +3 -3
  7. package/dist/chunks/{blog-UYR3EUXW.js → blog-42OZTJNP.js} +2 -2
  8. package/dist/chunks/{caizhilian-LG2X5NMF.js → caizhilian-KRK547K5.js} +2 -2
  9. package/dist/chunks/{calendar-FG4BAZHE.js → calendar-RTWAMKHD.js} +2 -2
  10. package/dist/chunks/{chunk-J7USS3ED.js → chunk-4CTESSKI.js} +4 -4
  11. package/dist/chunks/{chunk-OJQUJZQF.js → chunk-4TEDNCON.js} +45 -5
  12. package/dist/chunks/chunk-57IECMWX.js +487 -0
  13. package/dist/chunks/{chunk-ELYDWBZJ.js → chunk-7BRU4EFH.js} +13 -7
  14. package/dist/chunks/{chunk-6LTFIFLM.js → chunk-7E6MUOEK.js} +2 -2
  15. package/dist/chunks/{chunk-KKRL3REV.js → chunk-7U577Q7U.js} +2 -2
  16. package/dist/chunks/{chunk-UJJD4QWF.js → chunk-CAQNBBQA.js} +2 -2
  17. package/dist/chunks/{chunk-CORFRD7Q.js → chunk-CXRQWOZ5.js} +2 -2
  18. package/dist/chunks/{chunk-GGJFMNJM.js → chunk-FLS4DPGP.js} +110 -16
  19. package/dist/chunks/{chunk-JSMFPO43.js → chunk-I566ZYNF.js} +1 -1
  20. package/dist/chunks/{chunk-6FTTSA45.js → chunk-IZSSVYAG.js} +2 -2
  21. package/dist/chunks/{chunk-XJY7G4DD.js → chunk-JWRZM2H2.js} +3 -3
  22. package/dist/chunks/{chunk-NI6GIPIM.js → chunk-LFMSDBZN.js} +529 -395
  23. package/dist/chunks/{chunk-VRYHGG6O.js → chunk-LN447PY2.js} +92 -51
  24. package/dist/chunks/{chunk-NR6RKXPA.js → chunk-NETCCARD.js} +4 -2
  25. package/dist/chunks/{chunk-Z32KWY6G.js → chunk-NJKREDA3.js} +1 -1
  26. package/dist/chunks/{chunk-FUWVHMVV.js → chunk-SPRHHSVC.js} +2 -2
  27. package/dist/chunks/{chunk-IZUDA353.js → chunk-T6EGVBKU.js} +1 -1
  28. package/dist/chunks/{chunk-DMV2TOMH.js → chunk-VNBU55SL.js} +428 -145
  29. package/dist/chunks/{chunk-UZZBA6PV.js → chunk-WFFNM65B.js} +47 -6
  30. package/dist/chunks/{chunk-EG6ZU444.js → chunk-ZUX3P6BQ.js} +10 -5
  31. package/dist/chunks/{conflict-BQZEQ4SP.js → conflict-VR55AOOO.js} +2 -2
  32. package/dist/chunks/{contract-XIRAFTEV.js → contract-HI4FNPYE.js} +2 -2
  33. package/dist/chunks/{cowork-BLG62BL2.js → cowork-HJLI353D.js} +12 -5
  34. package/dist/chunks/{ebuilder-form-NUKG5QW4.js → ebuilder-form-HTGI63UU.js} +3 -3
  35. package/dist/chunks/{ehr-2STW5ILH.js → ehr-GYXIYH3A.js} +2 -2
  36. package/dist/chunks/env-DW3G4HUO.js +19 -0
  37. package/dist/chunks/{esb-UUDQUNKY.js → esb-I5INCEFE.js} +4 -4
  38. package/dist/chunks/factory-TKXGXS6L.js +30 -0
  39. package/dist/chunks/{fna-6RCY4NU5.js → fna-K2MHTQ24.js} +2 -2
  40. package/dist/chunks/group-chat-VYBNMJLG.js +18 -0
  41. package/dist/chunks/{host-FWDOSRH5.js → host-256GVCAH.js} +3 -3
  42. package/dist/chunks/{host-EJZFROU3.js → host-D5SERMAJ.js} +3 -3
  43. package/dist/chunks/{host-RHM3NPXV.js → host-JM4YVHFM.js} +3 -3
  44. package/dist/chunks/{host-7RXEDMAH.js → host-L3VLITMT.js} +3 -3
  45. package/dist/chunks/{host-UFF33TWJ.js → host-ZUQTJYYK.js} +3 -3
  46. package/dist/chunks/{hrm-PKJ6ELSH.js → hrm-VLRBKTZB.js} +3 -3
  47. package/dist/chunks/{im-YJAXS7CO.js → im-QK3VTLXK.js} +8 -8
  48. package/dist/chunks/{invoice-HWVSXGX6.js → invoice-T5JTA32H.js} +3 -3
  49. package/dist/chunks/{jiuchuanhui-L7VKILZB.js → jiuchuanhui-P2FNEQVZ.js} +2 -2
  50. package/dist/chunks/{lazy-dispatch-NMYEIHRH.js → lazy-dispatch-XRRI46M6.js} +5 -5
  51. package/dist/chunks/{mail-B42RRU7G.js → mail-3Y7MJ6PS.js} +9 -4
  52. package/dist/chunks/{meeting-CFYVBJSS.js → meeting-M7LTXGJE.js} +11 -10
  53. package/dist/chunks/{okr-GCLF6V7W.js → okr-OBC6S67L.js} +2 -2
  54. package/dist/chunks/{plan-ZVL7GBRI.js → plan-5H6I53SK.js} +2 -2
  55. package/dist/chunks/{project-4YWAAE2K.js → project-L75QZV4S.js} +2 -2
  56. package/dist/chunks/{registry-EP4VTHZS.js → registry-KMHCPAAD.js} +9 -8
  57. package/dist/chunks/{registry-OZSMDVPP.js → registry-QGHFNUWS.js} +2 -2
  58. package/dist/chunks/{registry-FRJ6H7BT.js → registry-RXPN6BBT.js} +4 -4
  59. package/dist/chunks/{registry-SG2PGVCF.js → registry-UGRBCBHO.js} +3 -3
  60. package/dist/chunks/{room-recommend-R3JVUUAC.js → room-recommend-A3UDC3CA.js} +4 -4
  61. package/dist/chunks/{schedule-NIJBTYDO.js → schedule-5GCACCK7.js} +4 -4
  62. package/dist/chunks/{workflow-BB24DFBY.js → workflow-M5ZJ7DWF.js} +11 -8
  63. package/dist/core/output.js +16 -6
  64. package/dist/index.js +33 -28
  65. package/dist/internal/e10/auth/commands.js +109 -56
  66. package/dist/internal/e10/auth/messages.js +1 -0
  67. package/dist/internal/e10/auth/session.js +11 -1
  68. package/dist/internal/e10/auth/xiaoe.js +29 -4
  69. package/dist/internal/e10/auth-recovery.js +13 -6
  70. package/dist/internal/e10/client.js +13 -0
  71. package/dist/internal/e10/context.js +24 -3
  72. package/dist/internal/e10/request-runtime.js +12 -1
  73. package/dist/shortcuts/archive/host.js +2 -0
  74. package/dist/shortcuts/archive/manifest.js +1 -1
  75. package/dist/shortcuts/archive/operations/borrow-list.js +13 -1
  76. package/dist/shortcuts/archive/operations/flow-url.js +1 -1
  77. package/dist/shortcuts/archive/operations/prelib.js +472 -0
  78. package/dist/shortcuts/archive/operations/registry.js +2 -0
  79. package/dist/shortcuts/archive/operations/upload.js +1 -1
  80. package/dist/shortcuts/asset-idle/errors.js +44 -0
  81. package/dist/shortcuts/asset-idle/host.js +161 -0
  82. package/dist/shortcuts/asset-idle/index.js +114 -0
  83. package/dist/shortcuts/asset-idle/manifest.js +159 -0
  84. package/dist/shortcuts/asset-idle/operations/idle.js +47 -0
  85. package/dist/shortcuts/asset-idle/operations/registry.js +33 -0
  86. package/dist/shortcuts/asset-idle/operations/shared.js +142 -0
  87. package/dist/shortcuts/asset-idle/operations/types.js +9 -0
  88. package/dist/shortcuts/asset-idle/operations.js +15 -0
  89. package/dist/shortcuts/cowork/operations/item-write.js +10 -2
  90. package/dist/shortcuts/index.js +5 -0
  91. package/dist/shortcuts/mail/operations/mail-send.js +8 -2
  92. package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -1
  93. package/dist/shortcuts/meeting/operations/eb/create-flow.js +381 -104
  94. package/dist/shortcuts/meeting/operations/eb/crm-search.js +87 -5
  95. package/dist/shortcuts/meeting/operations/eb/flow-memory.js +49 -0
  96. package/dist/shortcuts/meeting/operations/eb/group-chat.js +583 -0
  97. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  98. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +19 -3
  99. package/dist/shortcuts/meeting/operations/eb/room-summary.js +2 -0
  100. package/dist/shortcuts/meeting/operations/eb/usage-cache.js +99 -0
  101. package/dist/shortcuts/meeting/operations/from-group-chat.js +35 -12
  102. package/dist/shortcuts/workflow/host.js +3 -0
  103. package/dist/shortcuts/workflow/index.js +1 -1
  104. package/dist/shortcuts/workflow/operations/form.js +65 -171
  105. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +129 -27
  106. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +6 -0
  107. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +60 -117
  108. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +44 -7
  109. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +37 -29
  110. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +48 -8
  111. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
  112. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +22 -18
  113. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +17 -9
  114. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +34 -10
  115. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +5 -2
  116. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +9 -2
  117. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +122 -20
  118. package/docs/_catalog.md +3 -0
  119. package/docs/asset-idle.md +45 -0
  120. package/docs/e10-auth.md +16 -1
  121. package/docs/todo-smart-convert/subgroup-rules.md +1 -1
  122. package/package.json +1 -1
  123. package/scripts/mcp-meeting.mjs +234 -0
  124. package/scripts/package-skill.mjs +2 -0
  125. package/skill-template/business-info.json +14 -1
  126. package/skill-template/domains/asset-idle.md +13 -0
  127. package/skill-template/domains/wenshuding.md +3 -0
  128. package/skills/weaver-e10-archive-oa/SKILL.md +1 -0
  129. package/skills/weaver-e10-archive-oa/references/my-borrow.md +49 -0
  130. package/skills/weaver-e10-asset-idle/SKILL.md +73 -0
  131. package/skills/weaver-e10-asset-idle/references/idle-list.md +62 -0
  132. package/skills/weaver-e10-asset-idle/references/idle-stats-and-charts.md +65 -0
  133. package/skills/weaver-e10-asset-idle/references/source-manifest.json +193 -0
  134. package/skills/weaver-e10-asset-idle/references/widget-style.md +205 -0
  135. package/skills/weaver-e10-caizhilian/SKILL.md +29 -11
  136. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +12 -0
  137. package/skills/weaver-e10-caizhilian/references/files.md +1 -1
  138. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +1 -1
  139. package/skills/weaver-e10-caizhilian/references/source-manifest.json +45 -45
  140. package/skills/weaver-e10-cowork/SKILL.md +2 -0
  141. package/skills/weaver-e10-cowork/references/cowork-write.md +1 -1
  142. package/skills/weaver-e10-jucailin/SKILL.md +2 -0
  143. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -0
  144. package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
  145. package/skills/weaver-e10-mail/SKILL.md +3 -0
  146. package/skills/weaver-e10-mail/references/mail-send.md +2 -0
  147. package/skills/weaver-e10-meeting/SKILL.md +88 -25
  148. package/skills/weaver-e10-meeting/references/meeting-minute-file.md +25 -11
  149. package/skills/weaver-e10-meeting.zip +0 -0
  150. package/skills/weaver-e10-shared/SKILL.md +5 -5
  151. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +3 -3
  152. package/skills/weaver-e10-wenshuding/SKILL.md +29 -6
  153. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +14 -0
  154. package/skills/weaver-e10-wenshuding/references/archive-download.md +2 -0
  155. package/skills/weaver-e10-wenshuding/references/archive-flow.md +1 -1
  156. package/skills/weaver-e10-wenshuding/references/archive-prelib-arrange.md +76 -0
  157. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +107 -0
  158. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +59 -0
  159. package/skills/weaver-e10-wenshuding/references/archive-upload.md +4 -1
  160. package/skills/weaver-e10-wenshuding/references/source-manifest.json +108 -65
  161. package/skills/weaver-e10-workflow/SKILL.md +9 -2
  162. package/skills/weaver-e10-workflow/aigroup/default.json +166 -19
  163. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +72 -34
  164. package/skills/weaver-e10-workflow/tools/todo-serve.cjs +113 -25
  165. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +350 -50
  166. package/dist/chunks/{chunk-2LV74IWP.js → chunk-E7OK5WD5.js} +5 -5
@@ -4,11 +4,11 @@ import {
4
4
  createE10RequestRuntime,
5
5
  isE10SessionExpiredResponse,
6
6
  requireE10Session
7
- } from "./chunk-UZZBA6PV.js";
7
+ } from "./chunk-WFFNM65B.js";
8
8
  import {
9
9
  E10_SESSION_EXPIRED_MESSAGE,
10
10
  getActiveProfile
11
- } from "./chunk-OJQUJZQF.js";
11
+ } from "./chunk-4TEDNCON.js";
12
12
  import {
13
13
  CliError,
14
14
  isCliError,
@@ -5,11 +5,11 @@ import {
5
5
  createE10RequestRuntime,
6
6
  isE10SessionExpiredResponse,
7
7
  requireE10Session
8
- } from "./chunk-UZZBA6PV.js";
8
+ } from "./chunk-WFFNM65B.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-OJQUJZQF.js";
12
+ } from "./chunk-4TEDNCON.js";
13
13
  import {
14
14
  CliError,
15
15
  isCliError,
@@ -5,11 +5,11 @@ import {
5
5
  createE10RequestRuntime,
6
6
  isE10SessionExpiredResponse,
7
7
  requireE10Session
8
- } from "./chunk-UZZBA6PV.js";
8
+ } from "./chunk-WFFNM65B.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-OJQUJZQF.js";
12
+ } from "./chunk-4TEDNCON.js";
13
13
  import {
14
14
  CliError,
15
15
  isCliError,
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  readCache,
5
5
  writeCache
6
- } from "./chunk-JSMFPO43.js";
6
+ } from "./chunk-I566ZYNF.js";
7
7
  import {
8
8
  SCHEMA_DATETIME_MINUTE,
9
9
  meetingSuccess,
10
10
  meetingValidationError,
11
11
  schemaOf
12
- } from "./chunk-ELYDWBZJ.js";
12
+ } from "./chunk-7BRU4EFH.js";
13
13
 
14
14
  // src/shortcuts/meeting/operations/eb/schedule.ts
15
15
  var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
@@ -110,9 +110,9 @@ async function runScheduleConflictFlow(env, input) {
110
110
  if (!employeeId) {
111
111
  throw meetingValidationError("schedule_employee_required", "\u53D6\u4E0D\u5230\u5F53\u524D\u767B\u5F55\u7528\u6237 id\uFF0C\u65E0\u6CD5\u89E6\u53D1 ESB \u65E5\u7A0B\u67E5\u8BE2");
112
112
  }
113
- const { createEsbHost } = await import("./host-FWDOSRH5.js");
113
+ const { createEsbHost } = await import("./host-256GVCAH.js");
114
114
  const { createEsbContinuationSigner } = await import("./continuation-NLECEJPX.js");
115
- const { getEsbOperation } = await import("./registry-FRJ6H7BT.js");
115
+ const { getEsbOperation } = await import("./registry-RXPN6BBT.js");
116
116
  const esbEnv = {
117
117
  ctx: env.ctx,
118
118
  host: createEsbHost(env.ctx),
@@ -488,6 +488,15 @@ var E10AuthSession = class _E10AuthSession {
488
488
  get credentialSourceLabel() {
489
489
  return this.data.credentialSourceLabel || "";
490
490
  }
491
+ get expiryTimes() {
492
+ const value = Number(this.data.expiryTimes);
493
+ return Number.isFinite(value) && value > 0 ? value : void 0;
494
+ }
495
+ /** XiaoE 换取的 ETEAMSID 是否已经超过其明确的失效时间。 */
496
+ isExpired(now = Date.now()) {
497
+ const expiryTimes = this.expiryTimes;
498
+ return expiryTimes !== void 0 && now >= expiryTimes;
499
+ }
491
500
  getBaseUrl() {
492
501
  return (this.data.baseUrl || "").replace(/\/$/, "");
493
502
  }
@@ -540,6 +549,7 @@ var E10AuthSession = class _E10AuthSession {
540
549
  stTicket: this.data.stTicket,
541
550
  redirectUrl: this.data.redirectUrl,
542
551
  cookieSavedAt: this.data.cookieSavedAt,
552
+ expiryTimes: this.expiryTimes,
543
553
  mainUrl: this.data.mainUrl,
544
554
  ...sourceInfo,
545
555
  hasEteamsId: Boolean(this.eteamsId)
@@ -566,7 +576,7 @@ var E10AuthSession = class _E10AuthSession {
566
576
  const authPath = findAuthFile(startDir, options);
567
577
  if (!authPath) return null;
568
578
  const session = _E10AuthSession.fromFile(authPath, baseUrl, passportUrl);
569
- if (session && !(load.skipProfileEnrichment && hasUsableUserId(session))) {
579
+ if (session && !session.isExpired() && !(load.skipProfileEnrichment && hasUsableUserId(session))) {
570
580
  await session.fetchEmployeeId();
571
581
  }
572
582
  return session;
@@ -711,6 +721,7 @@ var E10AuthSession = class _E10AuthSession {
711
721
  // src/internal/e10/auth/messages.ts
712
722
  var E10_REAUTH_GUIDANCE = "\u8BF7\u7ED3\u5408\u5F53\u524D\u5BBF\u4E3B\u73AF\u5883\u9009\u62E9\u5408\u9002\u7684\u767B\u5F55\u65B9\u5F0F\uFF0C\u6062\u590D\u767B\u5F55\u540E\u91CD\u8BD5\u539F\u8BF7\u6C42\u3002";
713
723
  var E10_AUTH_REQUIRED_MESSAGE = `E10 \u767B\u5F55\u6001\u4E0D\u53EF\u7528\u3002${E10_REAUTH_GUIDANCE}`;
724
+ var E10_XIAOE_RECOVERY_FAILED_MESSAGE = "E10 \u767B\u5F55\u6001\u4E0D\u53EF\u7528\u3002\u5DF2\u5C1D\u8BD5\u5C0F e \u81EA\u52A8\u91CD\u65B0\u83B7\u53D6\u767B\u5F55\u4FE1\u606F\uFF0C\u4F46\u672A\u53D6\u5F97\u53EF\u7528\u767B\u5F55\u6001\u3002\u8BF7\u5728\u5C0F e \u4E2D\u6062\u590D\u767B\u5F55\u540E\u91CD\u8BD5\u3002";
714
725
  var E10_SESSION_EXPIRED_MESSAGE = `E10 \u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u672C\u6B21\u64CD\u4F5C\u5DF2\u505C\u6B62\u3002${E10_REAUTH_GUIDANCE}`;
715
726
 
716
727
  // src/core/package-paths.ts
@@ -824,6 +835,7 @@ var XIAOE_SKILL_ETEAMID_API_PATH = "/spec-apps/api/app/rpachat/skill/extend/etea
824
835
  var XIAOE_CLIENT_SETTINGS_SOURCE = "XiaoE/Robots/user_settings.json";
825
836
  var XIAOE_USER_TOKEN_SOURCE = "XIAOE_USER_TOKEN";
826
837
  var XIAOE_BUNDLED_ENV_SCRIPT_SOURCE = "bundled scripts/xiaoe_env.py";
838
+ var XIAOE_ETEAMID_TTL_MS = 72e5;
827
839
  function envString(env, ...keys) {
828
840
  for (const key of keys) {
829
841
  const value = env[key];
@@ -881,6 +893,13 @@ function readString(data, ...keys) {
881
893
  }
882
894
  return "";
883
895
  }
896
+ function readExpiryTimes(data) {
897
+ for (const key of ["expiryTimes", "expiryTime", "expiresAt", "expires_at"]) {
898
+ const value = Number(data[key]);
899
+ if (Number.isFinite(value) && value > 0) return Math.trunc(value);
900
+ }
901
+ return void 0;
902
+ }
884
903
  function cookieString(value) {
885
904
  if (!value) return "";
886
905
  if (typeof value === "string") return value;
@@ -936,7 +955,18 @@ function readXiaoECredentialRecord(value, source, fallbackBaseUrl = "") {
936
955
  const rawCookie = candidates.map((entry) => cookieString(entry.cookies || entry.cookie || entry.rawCookie || entry.raw_cookie)).find(Boolean) || "";
937
956
  const eteamsId = candidates.map((entry) => readString(entry, "eteamsId", "eteamsid", "ETEAMSID", "eteamId", "eteam_id", "eTeamId", "eteamID", "eteam_id")).find(Boolean) || cookieValue(rawCookie, "ETEAMSID");
938
957
  if (!baseUrl || !eteamsId) return null;
939
- return { baseUrl: normalizeUrl(baseUrl), eteamsId, source, rawCookie };
958
+ const expiryTimes = candidates.map(readExpiryTimes).find((value2) => value2 !== void 0);
959
+ return {
960
+ baseUrl: normalizeUrl(baseUrl),
961
+ eteamsId,
962
+ source,
963
+ rawCookie,
964
+ ...expiryTimes !== void 0 ? { expiryTimes } : {}
965
+ };
966
+ }
967
+ function withDefaultXiaoEExpiry(credential) {
968
+ if (!credential || credential.expiryTimes !== void 0) return credential;
969
+ return { ...credential, expiryTimes: Date.now() + XIAOE_ETEAMID_TTL_MS };
940
970
  }
941
971
  function parseXiaoEUnifiedLoginMap(raw, source) {
942
972
  const value = raw.trim();
@@ -1200,14 +1230,18 @@ async function runXiaoETokenScript(baseUrl, env = process.env) {
1200
1230
  async function resolveXiaoETokenScriptCredential(baseUrl, env = process.env) {
1201
1231
  const tokenData = await runXiaoETokenScript(baseUrl, env);
1202
1232
  if (!tokenData) return null;
1203
- return readXiaoECredentialRecord(tokenData, "xiaoeUserData/tokens.py", baseUrl);
1233
+ return withDefaultXiaoEExpiry(
1234
+ readXiaoECredentialRecord(tokenData, "xiaoeUserData/tokens.py", baseUrl)
1235
+ );
1204
1236
  }
1205
1237
  async function resolveXiaoEBundledEnvScriptCredential(baseUrl, env = process.env) {
1206
1238
  const scriptPath = xiaoEBundledEnvScriptPath();
1207
1239
  if (!scriptPath) return null;
1208
1240
  const tokenData = await runXiaoEPythonCredentialScript(scriptPath, baseUrl, env);
1209
1241
  if (!tokenData) return null;
1210
- return readXiaoECredentialRecord(tokenData, XIAOE_BUNDLED_ENV_SCRIPT_SOURCE, baseUrl);
1242
+ return withDefaultXiaoEExpiry(
1243
+ readXiaoECredentialRecord(tokenData, XIAOE_BUNDLED_ENV_SCRIPT_SOURCE, baseUrl)
1244
+ );
1211
1245
  }
1212
1246
  function xiaoEClientRobotsRoot(env = process.env) {
1213
1247
  if (process.platform === "win32") {
@@ -1387,7 +1421,9 @@ async function resolveXiaoETokenCredential(credential, baseUrl) {
1387
1421
  const targetBaseUrl = baseUrl || DEFAULT_E10_BASE_URL;
1388
1422
  const payload = await fetchXiaoEClientEteamId(credential, targetBaseUrl);
1389
1423
  const resolvedBaseUrl = payload.code === 0 ? credential.erpaUrl : targetBaseUrl;
1390
- return readXiaoECredentialRecord(payload, credential.source, resolvedBaseUrl);
1424
+ return withDefaultXiaoEExpiry(
1425
+ readXiaoECredentialRecord(payload, credential.source, resolvedBaseUrl)
1426
+ );
1391
1427
  }
1392
1428
  async function resolveXiaoEPlatformCredential(baseUrl, env = process.env) {
1393
1429
  const credential = readXiaoEPlatformCredential(env);
@@ -1465,6 +1501,7 @@ async function saveXiaoEUnifiedLogin(input) {
1465
1501
  baseUrl,
1466
1502
  passportUrl: baseUrl,
1467
1503
  cookieSavedAt: Date.now(),
1504
+ ...input.expiryTimes !== void 0 ? { expiryTimes: input.expiryTimes } : {},
1468
1505
  loginSource: "xiaoe-unified",
1469
1506
  credentialSourceStep: input.credentialSource.credentialSourceStep,
1470
1507
  credentialSourceType: input.credentialSource.credentialSourceType,
@@ -1487,6 +1524,7 @@ async function saveXiaoEUnifiedLogin(input) {
1487
1524
  agentType: XIAOE_AGENT_TYPE,
1488
1525
  version: "",
1489
1526
  loginSource: "xiaoe-unified",
1527
+ ...input.expiryTimes !== void 0 ? { expiryTimes: input.expiryTimes } : {},
1490
1528
  ...input.credentialSource
1491
1529
  }
1492
1530
  };
@@ -1568,6 +1606,7 @@ async function tryXiaoEUnifiedLogin(options = {}) {
1568
1606
  baseUrl: credential.baseUrl || baseUrl || DEFAULT_E10_BASE_URL,
1569
1607
  eteamsId: credential.eteamsId,
1570
1608
  rawCookie: credential.rawCookie,
1609
+ expiryTimes: credential.expiryTimes,
1571
1610
  tenantKeyFallback: options.tenantKeyFallback,
1572
1611
  profileHint: options.profileHint,
1573
1612
  credentialSource: describeXiaoECredentialSource(credential.source)
@@ -1628,6 +1667,7 @@ export {
1628
1667
  E10AuthSession,
1629
1668
  E10_REAUTH_GUIDANCE,
1630
1669
  E10_AUTH_REQUIRED_MESSAGE,
1670
+ E10_XIAOE_RECOVERY_FAILED_MESSAGE,
1631
1671
  E10_SESSION_EXPIRED_MESSAGE,
1632
1672
  isXiaoERuntimeAgent,
1633
1673
  XIAOE_AGENT_TYPE,