weaver-work-cli 0.1.36 → 0.1.39

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 (169) hide show
  1. package/README.md +4 -2
  2. package/dist/chunks/{archive-XBVH7JU7.js → archive-ENZYBBME.js} +559 -68
  3. package/dist/chunks/{archive-oa-MZM3EKFQ.js → archive-oa-YWLEC5V4.js} +4 -3
  4. package/dist/chunks/{asset-4XO7UOUW.js → asset-OOV6DWPA.js} +8 -7
  5. package/dist/chunks/asset-idle-RE632MY5.js +670 -0
  6. package/dist/chunks/{attachment-content-VXSWANAC.js → attachment-content-RWN2FCLL.js} +3 -3
  7. package/dist/chunks/{blog-PGZKOPSC.js → blog-PEPOJAL7.js} +5 -4
  8. package/dist/chunks/{caizhilian-BH4ZVGUN.js → caizhilian-WYIQDVPJ.js} +5 -4
  9. package/dist/chunks/{calendar-MXEMTIO4.js → calendar-CIARBAOX.js} +4 -3
  10. package/dist/chunks/{chunk-NCOVUAZK.js → chunk-36DIFZAH.js} +4 -3
  11. package/dist/chunks/{chunk-I6QGIBDM.js → chunk-BJGXMFGD.js} +4 -3
  12. package/dist/chunks/{chunk-TC6MZAO3.js → chunk-CQHGNCK2.js} +52 -2
  13. package/dist/chunks/{chunk-WXFPWCXG.js → chunk-EINRJHQ3.js} +3 -3
  14. package/dist/chunks/{chunk-JUXVYKII.js → chunk-EZGFHJFW.js} +201 -19
  15. package/dist/chunks/{chunk-VPUTVEMC.js → chunk-F2EQXUEE.js} +436 -290
  16. package/dist/chunks/{chunk-JYKABYCV.js → chunk-GVPJZXJ2.js} +3 -3
  17. package/dist/chunks/{chunk-6LLJFKJE.js → chunk-HJYVHXUQ.js} +1 -1
  18. package/dist/chunks/{chunk-T72N74ZT.js → chunk-I2HB737U.js} +5 -4
  19. package/dist/chunks/{chunk-VPXOPQJI.js → chunk-K3RUEEOL.js} +4 -2
  20. package/dist/chunks/{chunk-HXJQI5NM.js → chunk-KTCB5R5H.js} +3 -2
  21. package/dist/chunks/{chunk-XMGSYD6S.js → chunk-L4N7B7ZD.js} +4 -4
  22. package/dist/chunks/{chunk-QYGO5EE2.js → chunk-MUQUHKPG.js} +4 -3
  23. package/dist/chunks/{chunk-QHFANTX7.js → chunk-NLK2RZKG.js} +1348 -90
  24. package/dist/chunks/{chunk-F746NKNF.js → chunk-P2DAISYW.js} +1 -1
  25. package/dist/chunks/{chunk-BPE37FPB.js → chunk-T7JDJJ7H.js} +3 -3
  26. package/dist/chunks/{chunk-JNG42JKG.js → chunk-XXJOSZTQ.js} +6 -6
  27. package/dist/chunks/{chunk-5DQEEGCC.js → chunk-YS5DPN4T.js} +1 -1
  28. package/dist/chunks/{chunk-EG6ZU444.js → chunk-ZUX3P6BQ.js} +10 -5
  29. package/dist/chunks/{chunk-JCSN3JGM.js → chunk-ZXRNHZTE.js} +7 -6
  30. package/dist/chunks/{conflict-JAB2LJEZ.js → conflict-DRMDOL56.js} +2 -2
  31. package/dist/chunks/{contract-XI2EEIZU.js → contract-73MERZWN.js} +4 -3
  32. package/dist/chunks/{cowork-SCPGLBA4.js → cowork-HNGBPD7A.js} +4 -3
  33. package/dist/chunks/{ebuilder-form-EYLHNOTA.js → ebuilder-form-OY6DVNRK.js} +3 -3
  34. package/dist/chunks/{ehr-EAP77IMT.js → ehr-RAQNEQO7.js} +4 -3
  35. package/dist/chunks/{esb-2TGGXEE7.js → esb-6XV7C7YV.js} +4 -4
  36. package/dist/chunks/{fna-2X7ZE7BU.js → fna-XTSRB7G7.js} +4 -3
  37. package/dist/chunks/{host-Q4LZGCRU.js → host-3F5UM5GN.js} +3 -3
  38. package/dist/chunks/{host-XCLDDXKQ.js → host-A7J6GDUP.js} +3 -3
  39. package/dist/chunks/{host-I4NRK4MX.js → host-VGPVP7YF.js} +3 -3
  40. package/dist/chunks/{host-C6EL2RKL.js → host-YAQAPYNP.js} +3 -3
  41. package/dist/chunks/{host-UEI5FGDM.js → host-YMBXWFWX.js} +3 -3
  42. package/dist/chunks/{hrm-YXERJM76.js → hrm-TLHKC545.js} +3 -3
  43. package/dist/chunks/{im-A4VZN2TQ.js → im-YOUCFMUK.js} +3 -3
  44. package/dist/chunks/{invoice-2Z6YPMIS.js → invoice-WNBS2B4C.js} +3 -3
  45. package/dist/chunks/{jiuchuanhui-AR5GMKZB.js → jiuchuanhui-XABWS5RN.js} +4 -3
  46. package/dist/chunks/{lazy-dispatch-QXW7P4X3.js → lazy-dispatch-NLZ5UQQI.js} +5 -5
  47. package/dist/chunks/{mail-7GZ6CPBJ.js → mail-LRYMBFNL.js} +4 -3
  48. package/dist/chunks/{meeting-3NMGA3MB.js → meeting-ESXL6MFI.js} +13 -12
  49. package/dist/chunks/{okr-BZ6XUOAG.js → okr-EOV65SSF.js} +4 -3
  50. package/dist/chunks/{plan-DR5CMUYP.js → plan-YFPVKW6Y.js} +4 -3
  51. package/dist/chunks/{project-6J63MK33.js → project-MDVZUYQW.js} +4 -3
  52. package/dist/chunks/{registry-VRTNC6UR.js → registry-QCLZEDAP.js} +8 -8
  53. package/dist/chunks/{registry-KDD7DHNK.js → registry-VT5Y2HLA.js} +4 -4
  54. package/dist/chunks/{registry-TKX2E7C7.js → registry-YX4CSEMD.js} +3 -3
  55. package/dist/chunks/{room-recommend-XCWRMB5P.js → room-recommend-L3MWH4JW.js} +4 -4
  56. package/dist/chunks/{schedule-IVBICP32.js → schedule-UASAVDVD.js} +4 -4
  57. package/dist/chunks/{workflow-D74NFK3C.js → workflow-KDGIUCNW.js} +9 -6
  58. package/dist/core/output.js +16 -6
  59. package/dist/index.js +33 -28
  60. package/dist/internal/e10/auth/messages.js +1 -0
  61. package/dist/internal/e10/auth-recovery.js +127 -7
  62. package/dist/internal/e10/client.js +16 -2
  63. package/dist/internal/e10/context.js +16 -3
  64. package/dist/internal/e10/request-runtime.js +106 -8
  65. package/dist/shortcuts/archive/host.js +5 -2
  66. package/dist/shortcuts/archive/manifest.js +1 -1
  67. package/dist/shortcuts/archive/operations/borrow-list.js +13 -1
  68. package/dist/shortcuts/archive/operations/flow-url.js +1 -1
  69. package/dist/shortcuts/archive/operations/prelib.js +472 -0
  70. package/dist/shortcuts/archive/operations/registry.js +2 -0
  71. package/dist/shortcuts/archive/operations/upload.js +1 -1
  72. package/dist/shortcuts/archive-oa/host.js +2 -1
  73. package/dist/shortcuts/asset/host.js +6 -5
  74. package/dist/shortcuts/asset-idle/errors.js +44 -0
  75. package/dist/shortcuts/asset-idle/host.js +161 -0
  76. package/dist/shortcuts/asset-idle/index.js +114 -0
  77. package/dist/shortcuts/asset-idle/manifest.js +159 -0
  78. package/dist/shortcuts/asset-idle/operations/idle.js +47 -0
  79. package/dist/shortcuts/asset-idle/operations/registry.js +33 -0
  80. package/dist/shortcuts/asset-idle/operations/shared.js +142 -0
  81. package/dist/shortcuts/asset-idle/operations/types.js +9 -0
  82. package/dist/shortcuts/asset-idle/operations.js +15 -0
  83. package/dist/shortcuts/blog/host.js +3 -2
  84. package/dist/shortcuts/caizhilian/host.js +3 -2
  85. package/dist/shortcuts/calendar/host.js +2 -1
  86. package/dist/shortcuts/contract/host.js +2 -1
  87. package/dist/shortcuts/cowork/host.js +2 -1
  88. package/dist/shortcuts/ebuilder-form/host.js +3 -1
  89. package/dist/shortcuts/ehr/host.js +2 -1
  90. package/dist/shortcuts/esb/host.js +2 -1
  91. package/dist/shortcuts/fna/host.js +2 -1
  92. package/dist/shortcuts/hrm/host.js +2 -1
  93. package/dist/shortcuts/im/host.js +3 -2
  94. package/dist/shortcuts/index.js +5 -0
  95. package/dist/shortcuts/invoice/host.js +5 -4
  96. package/dist/shortcuts/jiuchuanhui/host.js +2 -1
  97. package/dist/shortcuts/mail/host.js +2 -1
  98. package/dist/shortcuts/meeting/host.js +3 -2
  99. package/dist/shortcuts/meeting/invitation/text.js +71 -0
  100. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1073 -50
  101. package/dist/shortcuts/meeting/operations/eb/crm-search.js +478 -0
  102. package/dist/shortcuts/meeting/operations/eb/factory.js +60 -1
  103. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  104. package/dist/shortcuts/meeting/operations/invitation.js +122 -9
  105. package/dist/shortcuts/okr/host.js +2 -1
  106. package/dist/shortcuts/plan/host.js +2 -1
  107. package/dist/shortcuts/project/host.js +2 -1
  108. package/dist/shortcuts/workflow/host.js +3 -0
  109. package/dist/shortcuts/workflow/index.js +1 -1
  110. package/dist/shortcuts/workflow/operations/form.js +44 -11
  111. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +77 -26
  112. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +6 -0
  113. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +59 -117
  114. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +44 -7
  115. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +37 -29
  116. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +20 -6
  117. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +22 -18
  118. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +34 -10
  119. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -2
  120. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +9 -2
  121. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +110 -20
  122. package/docs/_catalog.md +3 -0
  123. package/docs/asset-idle.md +45 -0
  124. package/docs/e10-auth.md +1 -1
  125. package/docs/todo-smart-convert/subgroup-rules.md +1 -1
  126. package/package.json +1 -1
  127. package/scripts/package-skill.mjs +2 -0
  128. package/skill-template/business-info.json +14 -1
  129. package/skill-template/domains/asset-idle.md +13 -0
  130. package/skill-template/domains/wenshuding.md +3 -0
  131. package/skills/weaver-e10-archive-oa/SKILL.md +1 -0
  132. package/skills/weaver-e10-archive-oa/references/my-borrow.md +49 -0
  133. package/skills/weaver-e10-asset-idle/SKILL.md +73 -0
  134. package/skills/weaver-e10-asset-idle/references/idle-list.md +62 -0
  135. package/skills/weaver-e10-asset-idle/references/idle-stats-and-charts.md +65 -0
  136. package/skills/weaver-e10-asset-idle/references/source-manifest.json +193 -0
  137. package/skills/weaver-e10-asset-idle/references/widget-style.md +205 -0
  138. package/skills/weaver-e10-caizhilian/SKILL.md +29 -11
  139. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +12 -0
  140. package/skills/weaver-e10-caizhilian/references/files.md +1 -1
  141. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +1 -1
  142. package/skills/weaver-e10-caizhilian/references/source-manifest.json +45 -45
  143. package/skills/weaver-e10-cowork/SKILL.md +2 -0
  144. package/skills/weaver-e10-jucailin/SKILL.md +2 -0
  145. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -0
  146. package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
  147. package/skills/weaver-e10-mail/SKILL.md +3 -0
  148. package/skills/weaver-e10-meeting/SKILL.md +250 -301
  149. package/skills/weaver-e10-meeting/references/meeting-eb.md +203 -0
  150. package/skills/weaver-e10-meeting/references/meeting-invitation.md +37 -5
  151. package/skills/weaver-e10-meeting.zip +0 -0
  152. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  153. package/skills/weaver-e10-shared/SKILL.md +5 -5
  154. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +3 -3
  155. package/skills/weaver-e10-wenshuding/SKILL.md +29 -6
  156. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +14 -0
  157. package/skills/weaver-e10-wenshuding/references/archive-download.md +2 -0
  158. package/skills/weaver-e10-wenshuding/references/archive-flow.md +1 -1
  159. package/skills/weaver-e10-wenshuding/references/archive-prelib-arrange.md +76 -0
  160. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +107 -0
  161. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +59 -0
  162. package/skills/weaver-e10-wenshuding/references/archive-upload.md +4 -1
  163. package/skills/weaver-e10-wenshuding/references/source-manifest.json +108 -65
  164. package/skills/weaver-e10-workflow/SKILL.md +5 -2
  165. package/skills/weaver-e10-workflow/aigroup/default.json +154 -19
  166. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +59 -27
  167. package/skills/weaver-e10-workflow/tools/todo-serve.cjs +113 -25
  168. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +292 -42
  169. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -2,12 +2,13 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createE10RequestRuntime,
5
+ isE10SessionExpiredResponse,
5
6
  requireE10Session
6
- } from "./chunk-JUXVYKII.js";
7
+ } from "./chunk-EZGFHJFW.js";
7
8
  import {
8
9
  E10_SESSION_EXPIRED_MESSAGE,
9
10
  getActiveProfile
10
- } from "./chunk-JNG42JKG.js";
11
+ } from "./chunk-XXJOSZTQ.js";
11
12
  import {
12
13
  CliError,
13
14
  isCliError,
@@ -222,7 +223,7 @@ function createBlogHost(ctx, dependencies = {}) {
222
223
  body,
223
224
  timeoutMs
224
225
  });
225
- if (response.status === 401 || response.status === 302) {
226
+ if (isE10SessionExpiredResponse(response)) {
226
227
  throw blogAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
227
228
  }
228
229
  if (response.parseError) {
@@ -265,7 +266,7 @@ function createBlogHost(ctx, dependencies = {}) {
265
266
  timeoutMs,
266
267
  headers: { Accept: "application/octet-stream, */*" }
267
268
  });
268
- if (response.status === 401 || response.status === 302) {
269
+ if (isE10SessionExpiredResponse(response)) {
269
270
  throw blogAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
270
271
  }
271
272
  const contentType = response.contentType;
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-EZGFHJFW.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-XXJOSZTQ.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -273,7 +274,7 @@ function createCaizhilianHost(ctx, dependencies = {}) {
273
274
  }
274
275
  async function request(request2) {
275
276
  const response = await doRequest(request2, false).catch((error) => mapRuntimeNetworkError(error));
276
- if (response.status === 401 || response.status === 302) {
277
+ if (isE10SessionExpiredResponse(response)) {
277
278
  throw caizhilianAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
278
279
  }
279
280
  if (response.parseError) {
@@ -304,7 +305,7 @@ function createCaizhilianHost(ctx, dependencies = {}) {
304
305
  }
305
306
  async function requestBinary(request2) {
306
307
  const response = await doRequest(request2, true).catch((error) => mapRuntimeNetworkError(error));
307
- if (response.status === 401 || response.status === 302) {
308
+ if (isE10SessionExpiredResponse(response)) {
308
309
  throw caizhilianAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
309
310
  }
310
311
  if (response.status < 200 || response.status >= 300) {
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-EZGFHJFW.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-XXJOSZTQ.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -234,7 +235,7 @@ function createCalendarHost(ctx, dependencies = {}) {
234
235
  } catch (error) {
235
236
  mapRuntimeNetworkError(error);
236
237
  }
237
- if (response.status === 401 || response.status === 302) {
238
+ if (isE10SessionExpiredResponse(response)) {
238
239
  throw calendarAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
239
240
  }
240
241
  if (response.parseError) {
@@ -9,12 +9,13 @@ import {
9
9
  import {
10
10
  E10ApiError,
11
11
  createE10RequestRuntime,
12
+ isE10SessionExpiredResponse,
12
13
  requireE10Session
13
- } from "./chunk-JUXVYKII.js";
14
+ } from "./chunk-EZGFHJFW.js";
14
15
  import {
15
16
  E10_SESSION_EXPIRED_MESSAGE,
16
17
  getActiveProfile
17
- } from "./chunk-JNG42JKG.js";
18
+ } from "./chunk-XXJOSZTQ.js";
18
19
 
19
20
  // src/shortcuts/hrm/host.ts
20
21
  function inferProfile(ctx) {
@@ -113,7 +114,7 @@ function createHrmHost(ctx, dependencies = {}) {
113
114
  } catch (error) {
114
115
  mapRuntimeNetworkError(error);
115
116
  }
116
- if (response.status === 401 || response.status === 302) {
117
+ if (isE10SessionExpiredResponse(response)) {
117
118
  throw hrmAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
118
119
  }
119
120
  if (response.parseError) {
@@ -12,12 +12,13 @@ import {
12
12
  import {
13
13
  E10ApiError,
14
14
  createE10RequestRuntime,
15
+ isE10SessionExpiredResponse,
15
16
  requireE10Session
16
- } from "./chunk-JUXVYKII.js";
17
+ } from "./chunk-EZGFHJFW.js";
17
18
  import {
18
19
  E10_SESSION_EXPIRED_MESSAGE,
19
20
  getActiveProfile
20
- } from "./chunk-JNG42JKG.js";
21
+ } from "./chunk-XXJOSZTQ.js";
21
22
 
22
23
  // src/shortcuts/esb/host.ts
23
24
  var ESB_PATHS = {
@@ -125,7 +126,7 @@ function createEsbHost(ctx, dependencies = {}) {
125
126
  } catch (error) {
126
127
  mapRuntimeNetworkError(error);
127
128
  }
128
- if (response.status === 401 || response.status === 302) {
129
+ if (isE10SessionExpiredResponse(response)) {
129
130
  throw esbAuthError(
130
131
  "session_expired",
131
132
  E10_SESSION_EXPIRED_MESSAGE,
@@ -1530,6 +1530,50 @@ function isWriteKind(kind) {
1530
1530
  var EB_BASE = "/api/ebuilder/form/formdata/v2";
1531
1531
  var EB_READ_OP = { list: "getFormDataList", detail: "getFormDataByPk", get: "getFormDataList" };
1532
1532
  var EB_WRITE_OP = { create: "saveFormData", update: "updateFormData", delete: "deleteFormData" };
1533
+ var PERSONNEL_FIELDS = [
1534
+ "caller",
1535
+ "contacter",
1536
+ "mt_creator",
1537
+ "creator",
1538
+ "updater",
1539
+ "hrm_members",
1540
+ "attend_user",
1541
+ "inviters",
1542
+ "reporting_user",
1543
+ "topic_presenter"
1544
+ ];
1545
+ async function buildPersonnelText(env, data) {
1546
+ const ids = [];
1547
+ for (const key of PERSONNEL_FIELDS) {
1548
+ const raw = String(data?.[key] ?? "").trim();
1549
+ if (raw === "" || !/^[\d,\s]+$/u.test(raw)) continue;
1550
+ ids.push(...raw.split(",").map((one) => one.trim()).filter((one) => one !== ""));
1551
+ }
1552
+ if (ids.length === 0) return {};
1553
+ const names = /* @__PURE__ */ new Map();
1554
+ try {
1555
+ const { hrmEmployeeOperations } = await import("./employee-SAK2QYXX.js");
1556
+ const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
1557
+ if (batch) {
1558
+ const result = await batch.handler({ ids: [...new Set(ids)] }, env);
1559
+ for (const row of result?.data?.rows ?? result?.data?.userList ?? []) {
1560
+ const id = String(row.id ?? "").trim();
1561
+ const name = String(row.name ?? "").trim();
1562
+ if (id && name) names.set(id, name);
1563
+ }
1564
+ }
1565
+ } catch {
1566
+ return {};
1567
+ }
1568
+ const out = {};
1569
+ for (const key of PERSONNEL_FIELDS) {
1570
+ const raw = String(data?.[key] ?? "").trim();
1571
+ if (raw === "" || !/^[\d,\s]+$/u.test(raw)) continue;
1572
+ const mapped = raw.split(",").map((one) => names.get(one.trim()) ?? one.trim()).filter((one) => one !== "");
1573
+ if (mapped.length > 0) out[key] = mapped.join(",");
1574
+ }
1575
+ return out;
1576
+ }
1533
1577
  var CONTINUATION_TTL_SECONDS = 600;
1534
1578
  function ebBusinessSuccess(value) {
1535
1579
  if (!value || typeof value !== "object") return false;
@@ -1705,9 +1749,15 @@ function buildReadOperation(endpoint) {
1705
1749
  if (key !== "mainTable") detailNodes[key] = value;
1706
1750
  }
1707
1751
  }
1752
+ const personnelText = endpoint.operation.startsWith("meeting.") ? await buildPersonnelText(env, data) : {};
1708
1753
  return meetingSuccess(
1709
1754
  endpoint.operation,
1710
- { id, data, ...Object.keys(detailNodes).length > 0 ? { details: detailNodes } : {} },
1755
+ {
1756
+ id,
1757
+ data,
1758
+ ...Object.keys(personnelText).length > 0 ? { personnelText } : {},
1759
+ ...Object.keys(detailNodes).length > 0 ? { details: detailNodes } : {}
1760
+ },
1711
1761
  endpoint.notes ? { meta: { notes: endpoint.notes } } : {}
1712
1762
  );
1713
1763
  }
@@ -2201,7 +2251,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
2201
2251
  );
2202
2252
  }
2203
2253
  if (endpoint.interfacePk === "create_meeting") {
2204
- const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-JAB2LJEZ.js");
2254
+ const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-DRMDOL56.js");
2205
2255
  assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
2206
2256
  }
2207
2257
  const pkQuery = writePkQuery(endpoint, payload);
@@ -12,7 +12,7 @@ import {
12
12
  meetingValidationError,
13
13
  queryBody,
14
14
  toIdCsv
15
- } from "./chunk-TC6MZAO3.js";
15
+ } from "./chunk-CQHGNCK2.js";
16
16
 
17
17
  // src/shortcuts/meeting/operations/eb/conflict.ts
18
18
  var ACTIVE_MT_STATUS = "1,2,8,9";
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
296
296
  const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
297
297
  const nameLike = items.filter((item) => !/^\d+$/u.test(item));
298
298
  if (nameLike.length > 0) {
299
- const { resolveMemberIdsByName } = await import("./schedule-IVBICP32.js");
299
+ const { resolveMemberIdsByName } = await import("./schedule-UASAVDVD.js");
300
300
  const idsByName = await resolveMemberIdsByName(env, nameLike);
301
301
  const resolved = items.map((item) => idsByName.get(item) ?? item);
302
302
  payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
@@ -610,7 +610,7 @@ async function findCommonFreeSlots(env, input) {
610
610
  const scheduleItems = [];
611
611
  if (includeSchedule) {
612
612
  try {
613
- const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-IVBICP32.js");
613
+ const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-UASAVDVD.js");
614
614
  const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
615
615
  const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
616
616
  const flow = await runScheduleConflictFlow(env, {
@@ -3,12 +3,15 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10AuthSession,
5
5
  E10_AUTH_REQUIRED_MESSAGE,
6
+ E10_XIAOE_RECOVERY_FAILED_MESSAGE,
6
7
  getActiveProfile,
7
8
  hasXiaoEEnv,
8
9
  isXiaoERuntimeAgent,
10
+ readProfileConfig,
11
+ resolveXiaoEPreferredBaseUrl,
9
12
  startFetchTiming,
10
13
  tryXiaoEUnifiedLogin
11
- } from "./chunk-JNG42JKG.js";
14
+ } from "./chunk-XXJOSZTQ.js";
12
15
  import {
13
16
  CliError
14
17
  } from "./chunk-LUSPKZKY.js";
@@ -36,6 +39,81 @@ var AUTH_REQUIRED_MARKERS = [
36
39
  "not logged in",
37
40
  "not login"
38
41
  ];
42
+ var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
43
+ var LOGIN_REDIRECT_MARKERS = [
44
+ "login",
45
+ "passport",
46
+ "sso",
47
+ "oauth",
48
+ "signin",
49
+ "sign-in",
50
+ "authorize",
51
+ "authn",
52
+ "atrust",
53
+ "checkticket"
54
+ ];
55
+ var FILE_REDIRECT_MARKERS = [
56
+ "fileservice",
57
+ "/file/download",
58
+ "/file/remotedownload",
59
+ "/remotedownload/",
60
+ "/api/file/",
61
+ "/download/",
62
+ "aliyuncs.com",
63
+ "myqcloud.com",
64
+ "qiniucdn.com",
65
+ "qbox.me",
66
+ "jdcloud.com",
67
+ "amazonaws.com",
68
+ "blob.core.windows.net",
69
+ "ctyunapi.cn",
70
+ "hiclouds.com",
71
+ "minio",
72
+ "s3.",
73
+ "obs.",
74
+ "ks3"
75
+ ];
76
+ var FILE_REQUEST_PATH_MARKERS = [
77
+ "/api/file/",
78
+ "/file/download",
79
+ "/remotedownload/",
80
+ "/fileservice",
81
+ "/download"
82
+ ];
83
+ var APP_SHELL_REDIRECT = /(?:\.html?(?:[?#]|$)|#\/|wui\/)/u;
84
+ function isE10RedirectStatus(status) {
85
+ return REDIRECT_STATUSES.has(status);
86
+ }
87
+ function redirectTarget(location) {
88
+ const raw = location.trim().toLowerCase();
89
+ if (!raw) return "";
90
+ try {
91
+ const url = new URL(raw, "https://e10.invalid");
92
+ return `${url.hostname}${url.pathname}${url.hash}`.toLowerCase();
93
+ } catch {
94
+ return raw.split("?")[0];
95
+ }
96
+ }
97
+ function classifyE10Redirect(response) {
98
+ if (!isE10RedirectStatus(response.status)) return "other";
99
+ const target = redirectTarget(response.headers?.get("location") || "");
100
+ if (!target) return "other";
101
+ if (LOGIN_REDIRECT_MARKERS.some((marker) => target.includes(marker))) return "login";
102
+ if (FILE_REDIRECT_MARKERS.some((marker) => target.includes(marker))) return "file";
103
+ const requestPath = (response.requestPath || "").toLowerCase();
104
+ if (requestPath && FILE_REQUEST_PATH_MARKERS.some((marker) => requestPath.includes(marker)) && !APP_SHELL_REDIRECT.test(target)) {
105
+ return "file";
106
+ }
107
+ return "other";
108
+ }
109
+ function isE10FileRedirect(response) {
110
+ return classifyE10Redirect(response) === "file";
111
+ }
112
+ function isE10SessionExpiredResponse(response) {
113
+ if (response.status === 401) return true;
114
+ if (isE10RedirectStatus(response.status)) return !isE10FileRedirect(response);
115
+ return false;
116
+ }
39
117
  var recoveryInFlight = /* @__PURE__ */ new Map();
40
118
  function asRecord(value) {
41
119
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -71,7 +149,7 @@ function responseText(response) {
71
149
  return "";
72
150
  }
73
151
  function isE10AuthenticationRequired(response) {
74
- if (response.status === 401 || response.status === 302) return true;
152
+ if (isE10SessionExpiredResponse(response)) return true;
75
153
  if (responseCodes(response.value).some((code) => AUTH_REQUIRED_CODES.has(code))) return true;
76
154
  const text = responseText(response).toLowerCase();
77
155
  if (!text) return false;
@@ -91,7 +169,12 @@ async function recoverXiaoEAuthSession(ctx, currentSession) {
91
169
  if (!canAutomaticallyRecoverXiaoE(ctx, currentSession)) return null;
92
170
  const options = globalOptions(ctx);
93
171
  const profile = options.profile || getActiveProfile();
94
- const baseUrl = currentSession.getBaseUrl();
172
+ const config = readProfileConfig(profile);
173
+ const baseUrl = resolveXiaoEPreferredBaseUrl({
174
+ explicitBaseUrl: currentSession?.getBaseUrl() || options.baseUrl,
175
+ profileBaseUrl: config.baseUrl,
176
+ env: ctx.env
177
+ });
95
178
  const key = `${profile}
96
179
  ${baseUrl}`;
97
180
  const existing = recoveryInFlight.get(key);
@@ -103,7 +186,7 @@ ${baseUrl}`;
103
186
  profileBaseUrl: baseUrl,
104
187
  allowBundledEnvScript: true,
105
188
  allowTokenScript: true,
106
- tenantKeyFallback: currentSession.tenantKey,
189
+ tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
107
190
  profileHint: profile
108
191
  // Intentionally no logger: transparent recovery must not leak an
109
192
  // intermediate "login" step into agent stdout/stderr or JSON output.
@@ -130,7 +213,18 @@ async function getE10Session(ctx, load = {}) {
130
213
  return E10AuthSession.fromOptions(options, ctx.cwd, load);
131
214
  }
132
215
  async function requireE10Session(ctx, load = {}) {
133
- const session = await getE10Session(ctx, load);
216
+ let session = await getE10Session(ctx, load);
217
+ if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
218
+ session = await recoverXiaoEAuthSession(ctx).catch(() => null);
219
+ if (!session) {
220
+ throw Object.assign(new CliError(E10_XIAOE_RECOVERY_FAILED_MESSAGE, 3 /* AuthError */), {
221
+ type: "authentication",
222
+ subtype: "xiaoe_credential_unavailable",
223
+ retryable: false,
224
+ stage: "xiaoe_unified_login"
225
+ });
226
+ }
227
+ }
134
228
  if (!session) {
135
229
  throw new CliError(E10_AUTH_REQUIRED_MESSAGE, 3 /* AuthError */);
136
230
  }
@@ -140,6 +234,7 @@ async function requireE10Session(ctx, load = {}) {
140
234
  // src/internal/e10/request-runtime.ts
141
235
  var DEFAULT_TIMEOUT_MS = 3e4;
142
236
  var DEFAULT_BIG_INT_STRINGS = true;
237
+ var MAX_DOWNLOAD_REDIRECTS = 3;
143
238
  var RESERVED_HEADERS = [
144
239
  "authorization",
145
240
  "cookie",
@@ -199,12 +294,12 @@ var E10RequestRuntime = class {
199
294
  }
200
295
  stripReservedHeaders(mutable.headers);
201
296
  const requestEteamsId = this.session.eteamsId;
202
- let parsed = await this.executeRequest(mutable, request.trustedHeaders);
203
- if (!mutable.streamBody && isE10AuthenticationRequired(parsed) && await this.recoverExpiredSession(requestEteamsId)) {
204
- parsed = await this.executeRequest(mutable, request.trustedHeaders);
297
+ let attempt = await this.executeRequest(mutable, request.trustedHeaders);
298
+ if (!mutable.streamBody && !attempt.fromFileRedirect && isE10AuthenticationRequired(authenticationProbe(mutable, attempt.parsed)) && await this.recoverExpiredSession(requestEteamsId)) {
299
+ attempt = await this.executeRequest(mutable, request.trustedHeaders);
205
300
  }
206
- await this.runAfterResponse(mutable, this.sessionContext(), parsed);
207
- return parsed;
301
+ await this.runAfterResponse(mutable, this.sessionContext(), attempt.parsed);
302
+ return attempt.parsed;
208
303
  } catch (error) {
209
304
  await this.runOnError(mutable, this.sessionContext(), error);
210
305
  throw error;
@@ -215,13 +310,77 @@ var E10RequestRuntime = class {
215
310
  const headers = this.composeHeaders(request, trustedHeaders);
216
311
  const init = this.buildFetchInit(request, headers);
217
312
  const response = await this.fetchWithTimeout(url, init, request.timeoutMs);
218
- return this.readResponse(
219
- response,
220
- request.responseType,
221
- request.bigIntStrings,
222
- request.maxResponseBytes,
223
- request.timeoutMs
224
- );
313
+ const followed = request.responseType === "binary" ? await this.followDownloadRedirect(response, request, url) : { response, followed: false };
314
+ if (followed.followed && (followed.response.status === 401 || followed.response.status === 403)) {
315
+ throw new E10ApiError(
316
+ "network",
317
+ "download_file_service_denied",
318
+ `\u6587\u4EF6\u670D\u52A1\u62D2\u7EDD\u4E0B\u8F7D\uFF08HTTP ${followed.response.status}\uFF09\uFF0C\u76F4\u94FE\u53EF\u80FD\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u8BD5\u4E0B\u8F7D`,
319
+ {
320
+ retryable: true,
321
+ exitCode: 4 /* NetworkError */,
322
+ details: { status: followed.response.status }
323
+ }
324
+ );
325
+ }
326
+ return {
327
+ parsed: await this.readResponse(
328
+ followed.response,
329
+ request.responseType,
330
+ request.bigIntStrings,
331
+ request.maxResponseBytes,
332
+ request.timeoutMs
333
+ ),
334
+ fromFileRedirect: followed.followed
335
+ };
336
+ }
337
+ /**
338
+ * 跟随下载直传的 3xx。仅当跳转目标是文件服务(非登录页)时才跟随,最多
339
+ * `MAX_DOWNLOAD_REDIRECTS` 跳;登录类跳转原样返回,交给上层认证恢复处理。
340
+ * 凭证规则:同源才继续带 Cookie/eteamsid,跨域(对象存储)不带任何鉴权头。
341
+ */
342
+ async followDownloadRedirect(response, request, requestUrl) {
343
+ const baseOrigin = safeOrigin(this.session.getBaseUrl());
344
+ let current = response;
345
+ let currentUrl = requestUrl;
346
+ let followed = false;
347
+ for (let hop = 0; hop < MAX_DOWNLOAD_REDIRECTS; hop += 1) {
348
+ const kind = classifyE10Redirect({
349
+ status: current.status,
350
+ headers: current.headers,
351
+ requestPath: request.path
352
+ });
353
+ if (kind !== "file") return { response: current, followed };
354
+ const location = current.headers.get("location");
355
+ if (!location) return { response: current, followed };
356
+ let next;
357
+ try {
358
+ next = new URL(location, currentUrl);
359
+ } catch {
360
+ return { response: current, followed };
361
+ }
362
+ if (!/^https?:$/u.test(next.protocol)) return { response: current, followed };
363
+ const sameOrigin = baseOrigin !== "" && safeOrigin(next.toString()) === baseOrigin;
364
+ current = await this.fetchWithTimeout(
365
+ next,
366
+ this.buildDownloadRedirectInit(sameOrigin),
367
+ request.timeoutMs
368
+ );
369
+ currentUrl = next;
370
+ followed = true;
371
+ }
372
+ return { response: current, followed };
373
+ }
374
+ buildDownloadRedirectInit(sameOrigin) {
375
+ const headers = {
376
+ Accept: "application/octet-stream, */*",
377
+ "User-Agent": this.session.uaHeader()
378
+ };
379
+ if (sameOrigin) {
380
+ headers.Cookie = this.attachSessionTicket ? this.session.cookieHeaderWithSessionTicket() : this.session.cookieHeader();
381
+ headers.eteamsid = this.session.eteamsId;
382
+ }
383
+ return { method: "GET", headers, redirect: "manual" };
225
384
  }
226
385
  async recoverExpiredSession(requestEteamsId) {
227
386
  if (this.session.eteamsId && this.session.eteamsId !== requestEteamsId) return true;
@@ -264,7 +423,8 @@ var E10RequestRuntime = class {
264
423
  maxResponseBytes: request.maxResponseBytes,
265
424
  timeoutMs: request.timeoutMs || DEFAULT_TIMEOUT_MS,
266
425
  responseType: request.responseType || "json",
267
- bigIntStrings: request.bigIntStrings ?? DEFAULT_BIG_INT_STRINGS
426
+ bigIntStrings: request.bigIntStrings ?? DEFAULT_BIG_INT_STRINGS,
427
+ followRedirects: request.followRedirects === true
268
428
  };
269
429
  }
270
430
  sessionContext() {
@@ -334,7 +494,8 @@ var E10RequestRuntime = class {
334
494
  const init = {
335
495
  method: request.method,
336
496
  headers,
337
- redirect: "manual"
497
+ // 文件下载允许跟随重定向(302 → 文件服务);其余请求保持 manual 以便识别登录跳转
498
+ redirect: request.followRedirects ? "follow" : "manual"
338
499
  };
339
500
  if (request.streamBody) {
340
501
  init.body = request.streamBody;
@@ -402,6 +563,25 @@ var E10RequestRuntime = class {
402
563
  function parseJsonPreservingBigInts(text) {
403
564
  return JSON.parse(quoteLargeJsonIntegers(text));
404
565
  }
566
+ function authenticationProbe(request, response) {
567
+ if ("content" in response) {
568
+ return { status: response.status, headers: response.headers, requestPath: request.path };
569
+ }
570
+ return {
571
+ status: response.status,
572
+ headers: response.headers,
573
+ requestPath: request.path,
574
+ text: response.text,
575
+ value: response.value
576
+ };
577
+ }
578
+ function safeOrigin(rawUrl) {
579
+ try {
580
+ return new URL(rawUrl).origin.toLowerCase();
581
+ } catch {
582
+ return "";
583
+ }
584
+ }
405
585
  var LONG_INTEGER_MIN_DIGITS = 16;
406
586
  var JSON_STRING_OR_NUMBER = /"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g;
407
587
  var LONG_DIGIT_RUN = /\d{16}/;
@@ -507,6 +687,8 @@ function cloneForHook(value) {
507
687
  }
508
688
 
509
689
  export {
690
+ isE10SessionExpiredResponse,
691
+ isE10AuthenticationRequired,
510
692
  requireE10Session,
511
693
  E10ApiError,
512
694
  createE10RequestRuntime