weaver-work-cli 0.1.40 → 0.1.42

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 (185) hide show
  1. package/dist/chunks/{archive-JHTONRST.js → archive-J4I6MCKF.js} +2 -2
  2. package/dist/chunks/{archive-oa-FCHLCPHC.js → archive-oa-BRZKKTO4.js} +2 -2
  3. package/dist/chunks/{asset-RLIHC7DB.js → asset-L7D4FAOZ.js} +2 -2
  4. package/dist/chunks/{asset-idle-KVOFTLCP.js → asset-idle-DADLLV75.js} +2 -2
  5. package/dist/chunks/{attachment-content-RZYDB3MB.js → attachment-content-K4C7VLWQ.js} +3 -3
  6. package/dist/chunks/{blog-42OZTJNP.js → blog-BVGQ7NZL.js} +2 -2
  7. package/dist/chunks/{caizhilian-KRK547K5.js → caizhilian-SAADNFD6.js} +2 -2
  8. package/dist/chunks/{calendar-RTWAMKHD.js → calendar-Q7NQY5Z2.js} +61 -23
  9. package/dist/chunks/{chunk-LFMSDBZN.js → chunk-3KTFS4IA.js} +308 -153
  10. package/dist/chunks/{chunk-G2JSIUWF.js → chunk-4PD5NWAX.js} +89 -0
  11. package/dist/chunks/{chunk-T6EGVBKU.js → chunk-4RAE6JXP.js} +1 -1
  12. package/dist/chunks/{chunk-7BRU4EFH.js → chunk-72CKAUAG.js} +29 -2
  13. package/dist/chunks/{chunk-NETCCARD.js → chunk-APVFJUQH.js} +2 -2
  14. package/dist/chunks/{chunk-CAQNBBQA.js → chunk-BBKDXQEC.js} +2 -2
  15. package/dist/chunks/{chunk-57IECMWX.js → chunk-BIPYLLVS.js} +26 -12
  16. package/dist/chunks/{chunk-LN447PY2.js → chunk-EKWAQSLU.js} +3 -2
  17. package/dist/chunks/{chunk-4TEDNCON.js → chunk-FOAA27U5.js} +338 -52
  18. package/dist/chunks/{chunk-7U577Q7U.js → chunk-G4UR6NXN.js} +2 -2
  19. package/dist/chunks/{chunk-NJKREDA3.js → chunk-GEWYMQME.js} +1 -1
  20. package/dist/chunks/{chunk-I566ZYNF.js → chunk-GHXCDPTM.js} +1 -1
  21. package/dist/chunks/{chunk-4CTESSKI.js → chunk-IZ7S7QUS.js} +4 -4
  22. package/dist/chunks/{chunk-VNBU55SL.js → chunk-JPRO6ER2.js} +57 -2432
  23. package/dist/chunks/{chunk-IZSSVYAG.js → chunk-LADPYOWC.js} +2 -2
  24. package/dist/chunks/chunk-LDZQPUIA.js +1238 -0
  25. package/dist/chunks/chunk-NKZRQXST.js +2546 -0
  26. package/dist/chunks/{chunk-JWRZM2H2.js → chunk-QKNKR4RH.js} +3 -3
  27. package/dist/chunks/{chunk-FLS4DPGP.js → chunk-R4CHUSKC.js} +28 -15
  28. package/dist/chunks/{chunk-WFFNM65B.js → chunk-SA6VBIHY.js} +73 -19
  29. package/dist/chunks/{chunk-SPRHHSVC.js → chunk-TTPJJJC4.js} +2 -2
  30. package/dist/chunks/{chunk-7E6MUOEK.js → chunk-W7BEHOSR.js} +2 -2
  31. package/dist/chunks/{chunk-CXRQWOZ5.js → chunk-YRSZQUD2.js} +2 -2
  32. package/dist/chunks/{conflict-VR55AOOO.js → conflict-F2OMZRTO.js} +2 -2
  33. package/dist/chunks/{contract-HI4FNPYE.js → contract-5BETHRSG.js} +2 -2
  34. package/dist/chunks/{cowork-HJLI353D.js → cowork-3MN6EQQO.js} +22 -12
  35. package/dist/chunks/create-flow-5FQNNMVO.js +55 -0
  36. package/dist/chunks/{ebuilder-form-HTGI63UU.js → ebuilder-form-SBHOYBUD.js} +3 -3
  37. package/dist/chunks/{ehr-GYXIYH3A.js → ehr-KMOJULKG.js} +432 -1234
  38. package/dist/chunks/{env-DW3G4HUO.js → env-LB7NBL2O.js} +2 -2
  39. package/dist/chunks/{esb-I5INCEFE.js → esb-W2PJCFCX.js} +4 -4
  40. package/dist/chunks/{factory-TKXGXS6L.js → factory-6ZFQXQ46.js} +1 -1
  41. package/dist/chunks/{fna-K2MHTQ24.js → fna-ZQPCUV4R.js} +2 -2
  42. package/dist/chunks/{group-chat-VYBNMJLG.js → group-chat-2HHAJN46.js} +5 -3
  43. package/dist/chunks/{host-ZUQTJYYK.js → host-4CBHGOHT.js} +3 -3
  44. package/dist/chunks/{host-D5SERMAJ.js → host-ATKVNZAT.js} +3 -3
  45. package/dist/chunks/{host-JM4YVHFM.js → host-BQH22NTQ.js} +3 -3
  46. package/dist/chunks/{host-L3VLITMT.js → host-X2CSLFM6.js} +3 -3
  47. package/dist/chunks/{host-256GVCAH.js → host-YTODKMSL.js} +3 -3
  48. package/dist/chunks/{hrm-VLRBKTZB.js → hrm-FFM4UJFS.js} +4 -4
  49. package/dist/chunks/{im-QK3VTLXK.js → im-VEHKDQPB.js} +7 -7
  50. package/dist/chunks/{invoice-T5JTA32H.js → invoice-LVIKSIIF.js} +3 -3
  51. package/dist/chunks/{jiuchuanhui-P2FNEQVZ.js → jiuchuanhui-X6DINO5P.js} +2 -2
  52. package/dist/chunks/{lazy-dispatch-XRRI46M6.js → lazy-dispatch-KSWTN5L6.js} +4 -4
  53. package/dist/chunks/{mail-3Y7MJ6PS.js → mail-VDKRGUD3.js} +2 -2
  54. package/dist/chunks/{meeting-M7LTXGJE.js → meeting-CLC6HP3Z.js} +12 -11
  55. package/dist/chunks/{okr-OBC6S67L.js → okr-CHG4OO3U.js} +2 -2
  56. package/dist/chunks/{plan-5H6I53SK.js → plan-XWR75667.js} +2 -2
  57. package/dist/chunks/{project-L75QZV4S.js → project-5BXOOKMG.js} +40 -23
  58. package/dist/chunks/recruit-stage-DGMFNNDE.js +4507 -0
  59. package/dist/chunks/{registry-RXPN6BBT.js → registry-7FFOXIAW.js} +4 -4
  60. package/dist/chunks/{registry-KMHCPAAD.js → registry-BKBZPBAJ.js} +10 -9
  61. package/dist/chunks/{registry-QGHFNUWS.js → registry-OZSMDVPP.js} +2 -2
  62. package/dist/chunks/{registry-UGRBCBHO.js → registry-RHMW6ANW.js} +2 -2
  63. package/dist/chunks/{registry-NYPYMZXG.js → registry-Z43434VG.js} +1 -1
  64. package/dist/chunks/{room-recommend-A3UDC3CA.js → room-recommend-62H7ZQQ6.js} +4 -4
  65. package/dist/chunks/{schedule-5GCACCK7.js → schedule-FNXKH3DQ.js} +4 -4
  66. package/dist/chunks/{workflow-M5ZJ7DWF.js → workflow-ADHKCAJK.js} +6 -6
  67. package/dist/index.js +33 -28
  68. package/dist/internal/e10/auth/commands.js +1 -0
  69. package/dist/internal/e10/auth/messages.js +6 -0
  70. package/dist/internal/e10/auth/session.js +17 -0
  71. package/dist/internal/e10/auth/xiaoe.js +286 -44
  72. package/dist/internal/e10/auth-recovery.js +36 -5
  73. package/dist/internal/e10/context.js +56 -12
  74. package/dist/internal/e10/index.js +1 -1
  75. package/dist/internal/e10/network-error.js +93 -0
  76. package/dist/internal/e10/request-runtime.js +6 -0
  77. package/dist/shortcuts/calendar/operations/read.js +31 -22
  78. package/dist/shortcuts/calendar/operations/write.js +45 -1
  79. package/dist/shortcuts/cowork/operations/discuss-write.js +5 -1
  80. package/dist/shortcuts/cowork/operations/item-write.js +1 -7
  81. package/dist/shortcuts/cowork/operations/member-write.js +3 -1
  82. package/dist/shortcuts/cowork/operations/permission-write.js +5 -1
  83. package/dist/shortcuts/cowork/operations/shared.js +7 -0
  84. package/dist/shortcuts/ehr/operations/attend-write.js +43 -1
  85. package/dist/shortcuts/ehr/operations/hr-contact.js +7 -4
  86. package/dist/shortcuts/ehr/operations/hr-report.js +13 -7
  87. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +134 -59
  88. package/dist/shortcuts/ehr/operations/recruit-write.js +262 -17
  89. package/dist/shortcuts/ehr/operations/recruit.js +10 -4
  90. package/dist/shortcuts/ehr/operations/shared.js +47 -0
  91. package/dist/shortcuts/hrm/operations/org.js +118 -0
  92. package/dist/shortcuts/index.js +5 -0
  93. package/dist/shortcuts/meeting/operations/eb/catalog.js +4 -1
  94. package/dist/shortcuts/meeting/operations/eb/create-flow.js +85 -28
  95. package/dist/shortcuts/meeting/operations/eb/factory.js +33 -0
  96. package/dist/shortcuts/meeting/operations/eb/group-chat.js +25 -3
  97. package/dist/shortcuts/meeting/operations/eb/person-cache.js +96 -0
  98. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +33 -11
  99. package/dist/shortcuts/project/operations/read.js +6 -25
  100. package/dist/shortcuts/project/operations/shared.js +22 -0
  101. package/dist/shortcuts/project/operations/write.js +28 -2
  102. package/dist/shortcuts/recruit-stage/context.js +119 -0
  103. package/dist/shortcuts/recruit-stage/continuation.js +73 -0
  104. package/dist/shortcuts/recruit-stage/errors.js +65 -0
  105. package/dist/shortcuts/recruit-stage/host.js +109 -0
  106. package/dist/shortcuts/recruit-stage/index.js +115 -0
  107. package/dist/shortcuts/recruit-stage/manifest.js +29 -0
  108. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +722 -0
  109. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +269 -0
  110. package/dist/shortcuts/recruit-stage/operations/jd-create.js +630 -0
  111. package/dist/shortcuts/recruit-stage/operations/list.js +431 -0
  112. package/dist/shortcuts/recruit-stage/operations/registry.js +38 -0
  113. package/dist/shortcuts/recruit-stage/operations/resume-import.js +1198 -0
  114. package/dist/shortcuts/recruit-stage/operations/search.js +158 -0
  115. package/dist/shortcuts/recruit-stage/operations/types.js +25 -0
  116. package/dist/shortcuts/recruit-stage/school-tiers.json +318 -0
  117. package/dist/shortcuts/recruit-stage/shared.js +608 -0
  118. package/dist/shortcuts/workflow/operations/todoSmartConvert/detailFieldRules.js +4 -2
  119. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +13 -6
  120. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +17 -24
  121. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +14 -9
  122. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +50 -8
  123. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -1
  124. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +17 -11
  125. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +7 -39
  126. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +3 -2
  127. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +51 -15
  128. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.pipeline.js +16 -1
  129. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +151 -63
  130. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subGroup.js +56 -0
  131. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +39 -14
  132. package/docs/e10-auth.md +7 -1
  133. package/docs/operation-manual.md +8 -0
  134. package/package.json +1 -1
  135. package/scripts/install-skill-to-xiaoe.mjs +105 -0
  136. package/scripts/package-skill.mjs +4 -2
  137. package/skill-template/business-info.json +24 -0
  138. package/skill-template/domains/recruit-stage.md +29 -0
  139. package/skills/weaver-e10-calendar/SKILL.md +2 -1
  140. package/skills/weaver-e10-calendar/references/calendar-write.md +54 -0
  141. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  142. package/skills/weaver-e10-cowork/references/cowork-write.md +3 -1
  143. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  144. package/skills/weaver-e10-jucailin/references/attend-write.md +8 -0
  145. package/skills/weaver-e10-jucailin/references/hr-contact.md +8 -0
  146. package/skills/weaver-e10-jucailin/references/hr-report.md +8 -0
  147. package/skills/weaver-e10-jucailin/references/recruit-create.md +2 -2
  148. package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
  149. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -3
  150. package/skills/weaver-e10-mail/SKILL.md +1 -1
  151. package/skills/weaver-e10-meeting/SKILL.md +32 -2
  152. package/skills/weaver-e10-meeting.zip +0 -0
  153. package/skills/weaver-e10-recruit-stage/SKILL.md +226 -0
  154. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +119 -0
  155. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +188 -0
  156. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +322 -0
  157. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +127 -0
  158. package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +65 -0
  159. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +63 -0
  160. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +142 -0
  161. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +73 -0
  162. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +56 -0
  163. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +101 -0
  164. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +148 -0
  165. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +77 -0
  166. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +59 -0
  167. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +69 -0
  168. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +241 -0
  169. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +438 -0
  170. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +128 -0
  171. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +146 -0
  172. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +69 -0
  173. package/skills/weaver-e10-shared/SKILL.md +1 -1
  174. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
  175. package/skills/weaver-e10-shijingran/SKILL.md +3 -2
  176. package/skills/weaver-e10-shijingran/references/operations.md +3 -1
  177. package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
  178. package/skills/weaver-e10-shijingran/references/write-operations.md +2 -0
  179. package/skills/weaver-e10-workflow/SKILL.md +4 -2
  180. package/skills/weaver-e10-workflow/aigroup/default.json +11 -9
  181. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +23 -13
  182. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +62 -20
  183. package/skills/weaver-e10-yepiaotong/SKILL.md +9 -10
  184. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +6 -3
  185. package/dist/chunks/{chunk-E7OK5WD5.js → chunk-2LV74IWP.js} +5 -5
@@ -12,7 +12,7 @@ import {
12
12
  meetingValidationError,
13
13
  queryBody,
14
14
  toIdCsv
15
- } from "./chunk-7BRU4EFH.js";
15
+ } from "./chunk-72CKAUAG.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-5GCACCK7.js");
299
+ const { resolveMemberIdsByName } = await import("./schedule-FNXKH3DQ.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-5GCACCK7.js");
613
+ const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-FNXKH3DQ.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, {
@@ -4,7 +4,7 @@ import {
4
4
  cacheScopeSuffix,
5
5
  readCache,
6
6
  writeCache
7
- } from "./chunk-I566ZYNF.js";
7
+ } from "./chunk-GHXCDPTM.js";
8
8
  import {
9
9
  EB_BASE,
10
10
  SCHEMA_DATETIME_MINUTE,
@@ -13,7 +13,7 @@ import {
13
13
  meetingSuccess,
14
14
  queryBody,
15
15
  schemaOf
16
- } from "./chunk-7BRU4EFH.js";
16
+ } from "./chunk-72CKAUAG.js";
17
17
 
18
18
  // src/shortcuts/meeting/operations/eb/usage-cache.ts
19
19
  var USAGE_TTL_MS = 5 * 60 * 1e3;
@@ -88,7 +88,7 @@ async function clearCache(env, key) {
88
88
  try {
89
89
  const { rm } = await import("node:fs/promises");
90
90
  const { join } = await import("node:path");
91
- const { meetingStateDir } = await import("./env-DW3G4HUO.js");
91
+ const { meetingStateDir } = await import("./env-LB7NBL2O.js");
92
92
  await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
93
93
  } catch {
94
94
  }
@@ -147,11 +147,15 @@ function normalizeRoom(row) {
147
147
  maxNum: toNumber(main.allow_maxnum),
148
148
  place: toText(main.place).trim(),
149
149
  equipments: toText(main.equipments).trim(),
150
- mrType: toText(main.mr_type).trim()
150
+ mrType: toText(main.mr_type).trim(),
151
+ // ⛔ 2026-11-04 真机发现:以前没映射 room_desc,`roomDesc` 永远是 undefined,
152
+ // 于是「带客户优先接待类」里**按描述文案判定**那一半从来没生效过(只有名称含「接待」的能命中)。
153
+ // 例:广州会议室四 的描述「用来接待重要来宾…」明明写着,却被当普通房间。
154
+ roomDesc: toText(main.room_desc).trim()
151
155
  };
152
156
  }
153
157
  async function loadRooms(env, options = {}) {
154
- const key = `rooms-v2-${await cacheScopeSuffix(env)}`;
158
+ const key = `rooms-v3-${await cacheScopeSuffix(env)}`;
155
159
  const warnings = [];
156
160
  if (!options.refresh) {
157
161
  const cached = await readCache(env, key, { ttlMs: ROOMS_TTL_MS });
@@ -200,22 +204,27 @@ async function loadFrequentRooms(env, options = {}) {
200
204
  const counts = /* @__PURE__ */ new Map();
201
205
  let requests = 0;
202
206
  try {
203
- const { getMeetingOperation } = await import("./registry-KMHCPAAD.js");
207
+ const { getMeetingOperation } = await import("./registry-BKBZPBAJ.js");
204
208
  const listOp = getMeetingOperation("meeting.eb.meeting.list");
205
- for (let pageNo = 1; pageNo <= 5; pageNo += 1) {
209
+ let seen = 0;
210
+ let total = 0;
211
+ for (let pageNo = 1; pageNo <= 40; pageNo += 1) {
206
212
  const page = await listOp.handler(
207
- { creator: userId, begindatetime: sinceText, pageNo, pageSize: PAGE_SIZE2 },
213
+ { creator: userId, begindatetime: sinceText, pageNo, pageSize: 200 },
208
214
  env
209
215
  );
210
216
  requests += 1;
211
217
  const rows = page?.data?.rows ?? [];
218
+ if (rows.length === 0) break;
219
+ total = Number(page?.data?.total ?? total) || total;
212
220
  for (const row of rows) {
213
221
  const main = row?.mainTable ?? row ?? {};
214
222
  const name = toText(main.address).trim();
215
223
  if (!name) continue;
216
224
  counts.set(name, (counts.get(name) ?? 0) + 1);
217
225
  }
218
- if (rows.length < PAGE_SIZE2) break;
226
+ seen += rows.length;
227
+ if (total > 0 && seen >= total) break;
219
228
  }
220
229
  } catch (error) {
221
230
  warnings.push(`\u5E38\u7528\u4F1A\u8BAE\u5BA4\u7EDF\u8BA1\u5931\u8D25\uFF08${String(error?.message ?? error).slice(0, 80)}\uFF09\uFF1A\u672C\u6B21\u6309\u5168\u91CF\u4F1A\u8BAE\u5BA4\u6392\u5E8F\u63A8\u8350`);
@@ -268,6 +277,7 @@ async function recommendRooms(env, input) {
268
277
  });
269
278
  const memberCount = input.memberCount && input.memberCount > 0 ? input.memberCount : null;
270
279
  const requirement = input.requirement ?? {};
280
+ if (input.hasCustomer === true) requirement.hasCustomer = true;
271
281
  const usable = roomData.rooms.filter((room) => room.status === "0");
272
282
  let busyCount = 0;
273
283
  const candidates = [];
@@ -315,11 +325,12 @@ async function recommendRooms(env, input) {
315
325
  score += 10;
316
326
  }
317
327
  if (requirement.hasCustomer === true) {
318
- const hostText = `${room.roomDesc ?? ""} ${room.name}`;
319
- const hostHit = hostText.match(/(接待|招待|客户|商务|贵宾|vip|VIP)/u);
328
+ const desc = String(room.roomDesc ?? "").trim();
329
+ const nameHit = room.name.match(/(接待|招待|贵宾|商务|vip)/iu);
330
+ const descHit = desc.match(/(接待|招待|贵宾|商务|vip)/iu);
331
+ const hostHit = nameHit ?? descHit;
320
332
  if (hostHit) {
321
- const desc = String(room.roomDesc ?? "").trim();
322
- reasons.push(`\u5E26\u5BA2\u6237\u4F18\u5148\uFF1A${desc !== "" ? `\u63CF\u8FF0\u542B\u300C${desc.slice(0, 30)}\u300D` : `\u540D\u79F0\u542B\u300C${hostHit[1]}\u300D`}`);
333
+ reasons.push(`\u5E26\u5BA2\u6237\u4F18\u5148\uFF1A${descHit ? `\u63CF\u8FF0\u542B\u300C${desc.slice(0, 30)}\u300D` : `\u540D\u79F0\u542B\u300C${hostHit[1]}\u300D`}`);
323
334
  score += 35;
324
335
  }
325
336
  }
@@ -429,7 +440,9 @@ var ebRoomRecommendOperation = {
429
440
  ...args.nameKeyword ? { nameKeyword: String(args.nameKeyword) } : {},
430
441
  ...args.mrType ? { mrType: String(args.mrType) } : {},
431
442
  ...args.roomAttr ? { roomAttr: String(args.roomAttr) } : {},
432
- ...args.equipmentsKeyword ? { equipmentsKeyword: String(args.equipmentsKeyword) } : {}
443
+ ...args.equipmentsKeyword ? { equipmentsKeyword: String(args.equipmentsKeyword) } : {},
444
+ // 2026-11-04 修:以前漏了它 —— 用户传了 hasCustomer,打分却读 requirement.hasCustomer,永远 false
445
+ ...args.hasCustomer === true ? { hasCustomer: true } : {}
433
446
  },
434
447
  ...args.topN !== void 0 ? { topN: Number(args.topN) } : {},
435
448
  ...args.refresh === true ? { refreshRooms: true, refreshFrequent: true } : {},
@@ -450,7 +463,7 @@ async function rememberFrequentRoom(env, roomId) {
450
463
  const id = String(roomId ?? "").trim();
451
464
  if (!id) return false;
452
465
  const scope = await cacheScopeSuffix(env);
453
- const roomsCached = await readCache(env, `rooms-v2-${scope}`, { ttlMs: ROOMS_TTL_MS });
466
+ const roomsCached = await readCache(env, `rooms-v3-${scope}`, { ttlMs: ROOMS_TTL_MS });
454
467
  const name = roomsCached?.data?.find((room) => room.id === id)?.name ?? "";
455
468
  if (!name) return false;
456
469
  const session = await env.host.getSession().catch(() => null);
@@ -3,15 +3,20 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10AuthSession,
5
5
  E10_AUTH_REQUIRED_MESSAGE,
6
+ E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE,
7
+ E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE,
6
8
  E10_XIAOE_RECOVERY_FAILED_MESSAGE,
7
9
  getActiveProfile,
8
10
  hasXiaoEEnv,
9
11
  isXiaoERuntimeAgent,
12
+ lastXiaoEFailure,
13
+ readErrorCauseCode,
10
14
  readProfileConfig,
11
15
  resolveXiaoEPreferredBaseUrl,
12
16
  startFetchTiming,
17
+ summarizeXiaoEFailureKind,
13
18
  tryXiaoEUnifiedLogin
14
- } from "./chunk-4TEDNCON.js";
19
+ } from "./chunk-FOAA27U5.js";
15
20
  import {
16
21
  CliError
17
22
  } from "./chunk-LUSPKZKY.js";
@@ -165,8 +170,25 @@ function canAutomaticallyRecoverXiaoE(ctx, currentSession) {
165
170
  if (options.auth) return false;
166
171
  return hasXiaoEEnv(ctx.env || process.env, options) || currentSession?.loginSource === "xiaoe-unified" || isXiaoERuntimeAgent(currentSession?.agentType);
167
172
  }
173
+ function recoveryLogger(ctx) {
174
+ const options = globalOptions(ctx);
175
+ if (options.json || options.quiet || options.verbose !== true) return void 0;
176
+ const adapter = ctx.logger;
177
+ if (!adapter || typeof adapter.debug !== "function") return void 0;
178
+ return {
179
+ info: (message) => adapter.debug(message),
180
+ warn: (message) => adapter.debug(message)
181
+ };
182
+ }
168
183
  async function recoverXiaoEAuthSession(ctx, currentSession) {
169
- if (!canAutomaticallyRecoverXiaoE(ctx, currentSession)) return null;
184
+ return (await recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession)).session;
185
+ }
186
+ async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession) {
187
+ const emptyOutcome = () => ({
188
+ session: null,
189
+ diagnostics: { attemptedSteps: [] }
190
+ });
191
+ if (!canAutomaticallyRecoverXiaoE(ctx, currentSession)) return emptyOutcome();
170
192
  const options = globalOptions(ctx);
171
193
  const profile = options.profile || getActiveProfile();
172
194
  const config = readProfileConfig(profile);
@@ -179,6 +201,7 @@ async function recoverXiaoEAuthSession(ctx, currentSession) {
179
201
  ${baseUrl}`;
180
202
  const existing = recoveryInFlight.get(key);
181
203
  if (existing) return existing;
204
+ const diagnostics = { attemptedSteps: [] };
182
205
  const recovery = (async () => {
183
206
  const login = await tryXiaoEUnifiedLogin({
184
207
  env: ctx.env,
@@ -187,11 +210,11 @@ ${baseUrl}`;
187
210
  allowBundledEnvScript: true,
188
211
  allowTokenScript: true,
189
212
  tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
190
- profileHint: profile
191
- // Intentionally no logger: transparent recovery must not leak an
192
- // intermediate "login" step into agent stdout/stderr or JSON output.
213
+ profileHint: profile,
214
+ diagnostics,
215
+ logger: recoveryLogger(ctx)
193
216
  });
194
- return login?.session || null;
217
+ return { session: login?.session || null, diagnostics };
195
218
  })();
196
219
  recoveryInFlight.set(key, recovery);
197
220
  try {
@@ -208,13 +231,37 @@ function sameE10SessionIdentity(current, recovered) {
208
231
  }
209
232
 
210
233
  // src/internal/e10/context.ts
211
- function xiaoERecoveryFailedError() {
212
- return Object.assign(new CliError(E10_XIAOE_RECOVERY_FAILED_MESSAGE, 3 /* AuthError */), {
213
- type: "authentication",
214
- subtype: "xiaoe_credential_unavailable",
215
- retryable: false,
216
- stage: "xiaoe_unified_login"
217
- });
234
+ function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false) {
235
+ const failureKind = summarizeXiaoEFailureKind(diagnostics);
236
+ const lastFailure = lastXiaoEFailure(diagnostics);
237
+ const networkUnavailable = failureKind === "network";
238
+ const hostCredentialMissing = diagnostics?.clientType === "cloud" && diagnostics.platformCredentialDetected === false && diagnostics.attemptedSteps.includes("platform_token:missing") && diagnostics.attemptedSteps.includes("environment_map:empty");
239
+ const details = diagnostics ? {
240
+ ...diagnostics.baseUrl ? { baseUrl: diagnostics.baseUrl } : {},
241
+ ...diagnostics.clientType ? { clientType: diagnostics.clientType } : {},
242
+ ...diagnostics.platformCredentialDetected === void 0 ? {} : { platformCredentialDetected: diagnostics.platformCredentialDetected },
243
+ attemptedSteps: diagnostics.attemptedSteps,
244
+ ...diagnostics.lastError ? { lastError: diagnostics.lastError } : {},
245
+ ...failureKind ? { errorKind: failureKind } : {},
246
+ ...lastFailure ? { failureStage: lastFailure.stage } : {},
247
+ ...diagnostics.failures?.length ? { failures: diagnostics.failures } : {},
248
+ ...hostCredentialMissing ? { reason: "host_credential_not_injected" } : {},
249
+ ...resultSessionExpired ? { resultSessionExpired: true } : {}
250
+ } : void 0;
251
+ return Object.assign(
252
+ new CliError(
253
+ networkUnavailable ? E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE : hostCredentialMissing ? E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE : E10_XIAOE_RECOVERY_FAILED_MESSAGE,
254
+ 3 /* AuthError */
255
+ ),
256
+ {
257
+ type: "authentication",
258
+ subtype: networkUnavailable ? "xiaoe_network_unavailable" : "xiaoe_credential_unavailable",
259
+ // 网络错误是可重试的;凭证缺失/被拒重试也一样失败,不能让调用方空转。
260
+ retryable: networkUnavailable,
261
+ stage: lastFailure?.stage || "xiaoe_unified_login",
262
+ ...details ? { details } : {}
263
+ }
264
+ );
218
265
  }
219
266
  async function getE10Session(ctx, load = {}) {
220
267
  const options = ctx.getGlobalOptions();
@@ -223,13 +270,17 @@ async function getE10Session(ctx, load = {}) {
223
270
  async function requireE10Session(ctx, load = {}) {
224
271
  let session = await getE10Session(ctx, load);
225
272
  if (session?.isExpired() && canAutomaticallyRecoverXiaoE(ctx, session)) {
226
- session = await recoverXiaoEAuthSession(ctx, session).catch(() => null);
227
- if (!session || session.isExpired()) throw xiaoERecoveryFailedError();
273
+ const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx, session).catch(() => null);
274
+ session = outcome?.session || null;
275
+ if (!session || session.isExpired()) {
276
+ throw xiaoERecoveryFailedError(outcome?.diagnostics, session?.isExpired() === true);
277
+ }
228
278
  }
229
279
  if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
230
- session = await recoverXiaoEAuthSession(ctx).catch(() => null);
280
+ const outcome = await recoverXiaoEAuthSessionWithDiagnostics(ctx).catch(() => null);
281
+ session = outcome?.session || null;
231
282
  if (!session) {
232
- throw xiaoERecoveryFailedError();
283
+ throw xiaoERecoveryFailedError(outcome?.diagnostics);
233
284
  }
234
285
  }
235
286
  if (!session) {
@@ -540,13 +591,16 @@ var E10RequestRuntime = class {
540
591
  if (error instanceof Error && error.name === "AbortError") {
541
592
  throw new E10ApiError("network", "timeout", `\u8BF7\u6C42\u8D85\u65F6\uFF08${timeoutMs}ms\uFF09`, {
542
593
  retryable: false,
543
- exitCode: 4 /* NetworkError */
594
+ exitCode: 4 /* NetworkError */,
595
+ details: { timeoutMs }
544
596
  });
545
597
  }
546
598
  const message = error instanceof Error ? error.message : String(error);
599
+ const causeCode = readErrorCauseCode(error);
547
600
  throw new E10ApiError("network", "transport", `\u8BF7\u6C42\u5931\u8D25\uFF1A${message}`, {
548
601
  retryable: true,
549
- exitCode: 4 /* NetworkError */
602
+ exitCode: 4 /* NetworkError */,
603
+ ...causeCode ? { details: { causeCode } } : {}
550
604
  });
551
605
  } finally {
552
606
  clearTimeout(timer);
@@ -4,12 +4,12 @@ import {
4
4
  createE10RequestRuntime,
5
5
  isE10SessionExpiredResponse,
6
6
  requireE10Session
7
- } from "./chunk-WFFNM65B.js";
7
+ } from "./chunk-SA6VBIHY.js";
8
8
  import {
9
9
  E10_REAUTH_GUIDANCE,
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-4TEDNCON.js";
12
+ } from "./chunk-FOAA27U5.js";
13
13
  import {
14
14
  CliError
15
15
  } from "./chunk-LUSPKZKY.js";
@@ -2,13 +2,13 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  meetingStateDir
5
- } from "./chunk-NJKREDA3.js";
5
+ } from "./chunk-GEWYMQME.js";
6
6
  import {
7
7
  SCHEMA_ID,
8
8
  meetingSuccess,
9
9
  meetingValidationError,
10
10
  schemaOf
11
- } from "./chunk-7BRU4EFH.js";
11
+ } from "./chunk-72CKAUAG.js";
12
12
 
13
13
  // src/shortcuts/meeting/operations/attachment-content.ts
14
14
  import { mkdir, writeFile } from "node:fs/promises";
@@ -10,10 +10,10 @@ import {
10
10
  createE10RequestRuntime,
11
11
  isE10SessionExpiredResponse,
12
12
  requireE10Session
13
- } from "./chunk-WFFNM65B.js";
13
+ } from "./chunk-SA6VBIHY.js";
14
14
  import {
15
15
  getActiveProfile
16
- } from "./chunk-4TEDNCON.js";
16
+ } from "./chunk-FOAA27U5.js";
17
17
 
18
18
  // src/shortcuts/ebuilder-form/host.ts
19
19
  import { randomUUID } from "node:crypto";
@@ -7,8 +7,8 @@ import {
7
7
  findCommonFreeSlots,
8
8
  meetingEbConflictOperations,
9
9
  runEbConflictCheck
10
- } from "./chunk-JWRZM2H2.js";
11
- import "./chunk-7BRU4EFH.js";
10
+ } from "./chunk-QKNKR4RH.js";
11
+ import "./chunk-72CKAUAG.js";
12
12
  import "./chunk-LUSPKZKY.js";
13
13
  import "./chunk-BUSC6UAE.js";
14
14
  export {
@@ -5,11 +5,11 @@ import {
5
5
  createE10RequestRuntime,
6
6
  isE10SessionExpiredResponse,
7
7
  requireE10Session
8
- } from "./chunk-WFFNM65B.js";
8
+ } from "./chunk-SA6VBIHY.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-4TEDNCON.js";
12
+ } from "./chunk-FOAA27U5.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-WFFNM65B.js";
8
+ } from "./chunk-SA6VBIHY.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-4TEDNCON.js";
12
+ } from "./chunk-FOAA27U5.js";
13
13
  import {
14
14
  CliError,
15
15
  isCliError,
@@ -413,6 +413,11 @@ function unwrapData(response) {
413
413
  if (!response || typeof response !== "object") return response;
414
414
  return response.data;
415
415
  }
416
+ function coworkViewUrl(baseUrl, id, mobile = false) {
417
+ if (!id) return null;
418
+ const base = String(baseUrl || "").replace(/\/+$/, "");
419
+ return `${base}/${mobile ? "mobile" : "sp"}/cowork/view/${id}`;
420
+ }
416
421
  function normalizePaged(response) {
417
422
  const data = unwrapData(response);
418
423
  const page = {};
@@ -1049,11 +1054,6 @@ function hashCode(text) {
1049
1054
  }
1050
1055
  return String(hash >>> 0);
1051
1056
  }
1052
- function coworkViewUrl(baseUrl, id, mobile = false) {
1053
- if (!id) return null;
1054
- const base = String(baseUrl || "").replace(/\/+$/, "");
1055
- return `${base}/${mobile ? "mobile" : "sp"}/cowork/view/${id}`;
1056
- }
1057
1057
  function defaultEndTime() {
1058
1058
  const target = new Date(Date.now() + 7 * 24 * 3600 * 1e3);
1059
1059
  const pad = (n) => String(n).padStart(2, "0");
@@ -1440,7 +1440,9 @@ var discussPublishApply = {
1440
1440
  return coworkSuccess("cowork.discuss.publish.apply", {
1441
1441
  coworkId,
1442
1442
  sectionId,
1443
- status: data.status ?? root?.status ?? null
1443
+ status: data.status ?? root?.status ?? null,
1444
+ viewUrl: coworkViewUrl(lease.baseUrl, coworkId),
1445
+ mobileViewUrl: coworkViewUrl(lease.baseUrl, coworkId, true)
1444
1446
  });
1445
1447
  }
1446
1448
  };
@@ -1575,7 +1577,9 @@ var discussActionApply = {
1575
1577
  action,
1576
1578
  coworkId,
1577
1579
  discussId,
1578
- result: unwrapData(response) ?? null
1580
+ result: unwrapData(response) ?? null,
1581
+ viewUrl: coworkViewUrl(lease.baseUrl, coworkId),
1582
+ mobileViewUrl: coworkViewUrl(lease.baseUrl, coworkId, true)
1579
1583
  });
1580
1584
  }
1581
1585
  };
@@ -1730,7 +1734,9 @@ var memberActionApply = {
1730
1734
  action,
1731
1735
  coworkId,
1732
1736
  userIds: action === "join" ? void 0 : String(form.ids).split(","),
1733
- result: unwrapData(response) ?? null
1737
+ result: unwrapData(response) ?? null,
1738
+ viewUrl: coworkViewUrl(lease.baseUrl, coworkId),
1739
+ mobileViewUrl: coworkViewUrl(lease.baseUrl, coworkId, true)
1734
1740
  });
1735
1741
  }
1736
1742
  };
@@ -2169,7 +2175,9 @@ var permAddApply = {
2169
2175
  permissionId,
2170
2176
  userId,
2171
2177
  userName,
2172
- result: unwrapData(response) ?? null
2178
+ result: unwrapData(response) ?? null,
2179
+ viewUrl: coworkViewUrl(lease.baseUrl, coworkId),
2180
+ mobileViewUrl: coworkViewUrl(lease.baseUrl, coworkId, true)
2173
2181
  });
2174
2182
  }
2175
2183
  };
@@ -2284,7 +2292,9 @@ var permRemoveApply = {
2284
2292
  pkId,
2285
2293
  removed: stillThere === false ? true : void 0,
2286
2294
  verified: stillThere !== null,
2287
- result: unwrapData(response) ?? null
2295
+ result: unwrapData(response) ?? null,
2296
+ viewUrl: coworkViewUrl(lease.baseUrl, coworkId),
2297
+ mobileViewUrl: coworkViewUrl(lease.baseUrl, coworkId, true)
2288
2298
  });
2289
2299
  }
2290
2300
  };
@@ -0,0 +1,55 @@
1
+ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
+ const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ applySelfPersonDefaults,
5
+ crmContactsToDetailRows,
6
+ crmMemberEntriesFromArgs,
7
+ detectCrmMentionInText,
8
+ fixedFlowIds,
9
+ fixedFlowIdsForEnv,
10
+ mapFields,
11
+ meetingEbCreateFlowOperations,
12
+ normalizeCrmDetailRows,
13
+ normalizeWorkflowIds,
14
+ parseRoomRef,
15
+ patchMeetingCrmMembers,
16
+ readFlowFieldMap,
17
+ renderFormPreview,
18
+ renderPreInvitation,
19
+ resolveAddressRoom,
20
+ resolveCrmDetailTarget,
21
+ resolveSelfPerson,
22
+ resolveWorkflowId,
23
+ shapeBrowserValues,
24
+ shouldAutoPickFlow
25
+ } from "./chunk-NKZRQXST.js";
26
+ import "./chunk-R4CHUSKC.js";
27
+ import "./chunk-GHXCDPTM.js";
28
+ import "./chunk-QKNKR4RH.js";
29
+ import "./chunk-GEWYMQME.js";
30
+ import "./chunk-72CKAUAG.js";
31
+ import "./chunk-LUSPKZKY.js";
32
+ import "./chunk-BUSC6UAE.js";
33
+ export {
34
+ applySelfPersonDefaults,
35
+ crmContactsToDetailRows,
36
+ crmMemberEntriesFromArgs,
37
+ detectCrmMentionInText,
38
+ fixedFlowIds,
39
+ fixedFlowIdsForEnv,
40
+ mapFields,
41
+ meetingEbCreateFlowOperations,
42
+ normalizeCrmDetailRows,
43
+ normalizeWorkflowIds,
44
+ parseRoomRef,
45
+ patchMeetingCrmMembers,
46
+ readFlowFieldMap,
47
+ renderFormPreview,
48
+ renderPreInvitation,
49
+ resolveAddressRoom,
50
+ resolveCrmDetailTarget,
51
+ resolveSelfPerson,
52
+ resolveWorkflowId,
53
+ shapeBrowserValues,
54
+ shouldAutoPickFlow
55
+ };
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createEbuilderFormHost
5
- } from "./chunk-CXRQWOZ5.js";
5
+ } from "./chunk-YRSZQUD2.js";
6
6
  import {
7
7
  createEbuilderFormContinuationSigner
8
8
  } from "./chunk-3SO6QL6U.js";
@@ -13,8 +13,8 @@ import {
13
13
  import {
14
14
  ebuilderValidationError
15
15
  } from "./chunk-BYATLLEF.js";
16
- import "./chunk-WFFNM65B.js";
17
- import "./chunk-4TEDNCON.js";
16
+ import "./chunk-SA6VBIHY.js";
17
+ import "./chunk-FOAA27U5.js";
18
18
  import {
19
19
  isCliError,
20
20
  toErrorEnvelope