weaver-work-cli 0.1.70 → 0.1.73

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 (263) hide show
  1. package/dist/chunks/{archive-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
  2. package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
  3. package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
  4. package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
  5. package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
  6. package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
  7. package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
  8. package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
  9. package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
  10. package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
  11. package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
  12. package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
  13. package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
  14. package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
  15. package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
  16. package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
  17. package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
  18. package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
  19. package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
  20. package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
  21. package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
  22. package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
  23. package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
  24. package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
  25. package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
  26. package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
  27. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  28. package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
  29. package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
  30. package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
  31. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
  32. package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
  33. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
  34. package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
  35. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  36. package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
  37. package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
  38. package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
  39. package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
  40. package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
  41. package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
  42. package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
  43. package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
  44. package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
  45. package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
  46. package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
  47. package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
  48. package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
  49. package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
  50. package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
  51. package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
  52. package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
  53. package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
  54. package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
  55. package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
  56. package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
  57. package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
  58. package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
  59. package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
  60. package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
  61. package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
  62. package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
  63. package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
  64. package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
  65. package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
  66. package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
  67. package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
  68. package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
  69. package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
  70. package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
  71. package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
  72. package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
  73. package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
  74. package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
  75. package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
  76. package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
  77. package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
  78. package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
  79. package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
  80. package/dist/cmd/auth/index.js +23 -0
  81. package/dist/cmd/e10/index.js +2 -1
  82. package/dist/cmd/index.js +2 -0
  83. package/dist/core/manifest-view.js +207 -0
  84. package/dist/core/output.js +42 -8
  85. package/dist/index.js +35 -35
  86. package/dist/internal/e10/auth/crypto.js +18 -8
  87. package/dist/internal/e10/auth/error-log.js +1 -2
  88. package/dist/internal/e10/auth/messages.js +2 -3
  89. package/dist/internal/e10/auth/xiaoe.js +1 -1
  90. package/dist/internal/e10/tls-policy.js +61 -13
  91. package/dist/shortcuts/archive/index.js +11 -2
  92. package/dist/shortcuts/archive/operations/download.js +1 -0
  93. package/dist/shortcuts/archive/operations/flow-url.js +3 -0
  94. package/dist/shortcuts/archive/operations/prelib.js +2 -0
  95. package/dist/shortcuts/archive/operations/upload.js +1 -0
  96. package/dist/shortcuts/archive-oa/index.js +11 -2
  97. package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
  98. package/dist/shortcuts/asset/index.js +11 -2
  99. package/dist/shortcuts/asset/manifest.js +7 -0
  100. package/dist/shortcuts/asset-idle/index.js +11 -2
  101. package/dist/shortcuts/blog/index.js +11 -2
  102. package/dist/shortcuts/blog/manifest.js +10 -0
  103. package/dist/shortcuts/caizhilian/host.js +20 -4
  104. package/dist/shortcuts/caizhilian/index.js +12 -2
  105. package/dist/shortcuts/caizhilian/manifest.js +4 -25
  106. package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
  107. package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
  108. package/dist/shortcuts/calendar/index.js +11 -2
  109. package/dist/shortcuts/contract/index.js +11 -2
  110. package/dist/shortcuts/contract/manifest.js +32 -0
  111. package/dist/shortcuts/contract/operations/write.js +3 -0
  112. package/dist/shortcuts/cowork/index.js +21 -5
  113. package/dist/shortcuts/cowork/manifest.js +3 -0
  114. package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
  115. package/dist/shortcuts/cowork/operations/item-write.js +3 -0
  116. package/dist/shortcuts/cowork/operations/member-write.js +2 -0
  117. package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
  118. package/dist/shortcuts/cowork/operations/review-write.js +1 -0
  119. package/dist/shortcuts/data/errors.js +16 -29
  120. package/dist/shortcuts/data/host.js +16 -7
  121. package/dist/shortcuts/data/index.js +12 -41
  122. package/dist/shortcuts/data/manifest.js +5 -44
  123. package/dist/shortcuts/data/operations/attend.js +2 -2
  124. package/dist/shortcuts/data/operations/conf.js +0 -88
  125. package/dist/shortcuts/data/operations/ds.js +4 -4
  126. package/dist/shortcuts/data/operations/index.js +1 -5
  127. package/dist/shortcuts/data/operations/module.js +40 -14
  128. package/dist/shortcuts/data/operations/query.js +2 -2
  129. package/dist/shortcuts/ebuilder-form/index.js +11 -2
  130. package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
  131. package/dist/shortcuts/ehr/index.js +11 -2
  132. package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
  133. package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
  134. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
  135. package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
  136. package/dist/shortcuts/ehr/operations/recruit.js +206 -82
  137. package/dist/shortcuts/ehr/operations/shared.js +31 -0
  138. package/dist/shortcuts/esb/index.js +11 -2
  139. package/dist/shortcuts/esb/manifest.js +2 -0
  140. package/dist/shortcuts/fna/index.js +11 -2
  141. package/dist/shortcuts/hrm/index.js +11 -1
  142. package/dist/shortcuts/im/index.js +11 -2
  143. package/dist/shortcuts/invoice/index.js +11 -2
  144. package/dist/shortcuts/invoice/manifest.js +8 -0
  145. package/dist/shortcuts/jiuchuanhui/index.js +15 -1
  146. package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
  147. package/dist/shortcuts/mail/errors.js +14 -0
  148. package/dist/shortcuts/mail/index.js +23 -6
  149. package/dist/shortcuts/mail/manifest.js +11 -4
  150. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  151. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  152. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  153. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  154. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  155. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  156. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  157. package/dist/shortcuts/meeting/index.js +11 -2
  158. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  159. package/dist/shortcuts/okr/index.js +11 -2
  160. package/dist/shortcuts/performance/index.js +62 -3
  161. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  162. package/dist/shortcuts/performance/shared.js +40 -2
  163. package/dist/shortcuts/plan/index.js +11 -2
  164. package/dist/shortcuts/project/index.js +11 -2
  165. package/dist/shortcuts/project/operations/write.js +3 -0
  166. package/dist/shortcuts/reception/constants.js +22 -0
  167. package/dist/shortcuts/reception/index.js +15 -2
  168. package/dist/shortcuts/reception/manifest.js +17 -3
  169. package/dist/shortcuts/reception/operations/ask.js +3 -0
  170. package/dist/shortcuts/reception/operations/doc.js +24 -11
  171. package/dist/shortcuts/reception/operations/docrender.js +18 -1
  172. package/dist/shortcuts/reception/operations/render-assets.js +93 -22
  173. package/dist/shortcuts/recruit-stage/context.js +12 -6
  174. package/dist/shortcuts/recruit-stage/index.js +22 -3
  175. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  176. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
  177. package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
  178. package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
  179. package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
  180. package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
  181. package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
  182. package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
  183. package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
  184. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  185. package/dist/shortcuts/recruit-stage/shared.js +158 -4
  186. package/dist/shortcuts/smart-extract/index.js +11 -2
  187. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  188. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  189. package/dist/shortcuts/workflow/index.js +21 -1
  190. package/dist/shortcuts/workflow/operations/form.js +36 -2
  191. package/dist/shortcuts/workflow/operations/read.js +2 -2
  192. package/dist/shortcuts/workflow/operations/write.js +1 -1
  193. package/docs/caizhilian.md +1 -1
  194. package/docs/contract.md +1 -0
  195. package/docs/data.md +22 -22
  196. package/docs/e10-auth.md +41 -33
  197. package/docs/ehr.md +2 -0
  198. package/docs/reception.md +4 -3
  199. package/package.json +1 -1
  200. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  201. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  202. package/scripts/pysite/sitecustomize.py +41 -0
  203. package/skill-template/domains/data.md +4 -4
  204. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  205. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  206. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  207. package/skills/weaver-e10-data/SKILL.md +12 -16
  208. package/skills/weaver-e10-data/references/config-center.md +6 -7
  209. package/skills/weaver-e10-data/references/datasource.md +1 -1
  210. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  211. package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
  212. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  213. package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
  214. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  215. package/skills/weaver-e10-jucailin/SKILL.md +7 -3
  216. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  217. package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
  218. package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
  219. package/skills/weaver-e10-mail/SKILL.md +4 -1
  220. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  221. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  222. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  223. package/skills/weaver-e10-performance/SKILL.md +8 -6
  224. package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
  225. package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
  226. package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
  227. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
  228. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
  229. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
  230. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
  231. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
  232. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  233. package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
  234. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
  235. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
  236. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
  237. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
  238. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
  239. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
  240. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
  241. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
  242. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
  243. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
  244. package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
  245. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
  246. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
  247. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
  248. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
  249. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
  250. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
  251. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
  252. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
  253. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
  254. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
  255. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
  256. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  257. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
  258. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
  259. package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
  260. package/skills/weaver-e10-shared/SKILL.md +22 -1
  261. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  262. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  263. package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
@@ -177,6 +177,10 @@ function getKeyFilePath() {
177
177
  }
178
178
  function loadKeyringEntryConstructor() {
179
179
  if (keyringEntryConstructor !== void 0) return keyringEntryConstructor;
180
+ if (process.env.WEAVER_WORK_CLI_KEYCHAIN?.toLowerCase() === "off") {
181
+ keyringEntryConstructor = null;
182
+ return keyringEntryConstructor;
183
+ }
180
184
  try {
181
185
  const module = require2("@napi-rs/keyring");
182
186
  keyringEntryConstructor = typeof module.Entry === "function" ? module.Entry : null;
@@ -221,17 +225,17 @@ function readKeyFile(filePath) {
221
225
  }
222
226
  function getEncKey() {
223
227
  if (encKey) return encKey;
224
- const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
225
- if (storedKey) {
226
- encKey = storedKey;
227
- return encKey;
228
- }
229
228
  const keyFile = getKeyFilePath();
230
229
  const fileKey = readKeyFile(keyFile);
231
230
  if (fileKey) {
232
231
  encKey = fileKey;
233
232
  return encKey;
234
233
  }
234
+ const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
235
+ if (storedKey) {
236
+ encKey = storedKey;
237
+ return encKey;
238
+ }
235
239
  const fresh = randomBytes(32);
236
240
  if (writeKeychainKey(KEYCHAIN_SERVICE, fresh)) {
237
241
  encKey = fresh;
@@ -1041,14 +1045,59 @@ var E10AuthSession = class _E10AuthSession {
1041
1045
  };
1042
1046
 
1043
1047
  // src/internal/e10/tls-policy.ts
1044
- import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
1048
+ import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
1045
1049
  import { homedir as homedir2 } from "node:os";
1046
- import { resolve as resolve5 } from "node:path";
1050
+ import { delimiter, resolve as resolve6 } from "node:path";
1047
1051
  import * as tls from "node:tls";
1052
+
1053
+ // src/core/package-paths.ts
1054
+ import { existsSync as existsSync4, realpathSync } from "node:fs";
1055
+ import { dirname as dirname3, join, resolve as resolve5 } from "node:path";
1056
+ import { fileURLToPath, pathToFileURL } from "node:url";
1057
+ var cachedRoot;
1058
+ function entryDirectory(entry) {
1059
+ const absoluteEntry = resolve5(entry);
1060
+ try {
1061
+ return dirname3(realpathSync(absoluteEntry));
1062
+ } catch {
1063
+ return dirname3(absoluteEntry);
1064
+ }
1065
+ }
1066
+ function packageRootDir() {
1067
+ if (cachedRoot) return cachedRoot;
1068
+ const seeds = [];
1069
+ const entry = process.argv[1];
1070
+ if (entry) seeds.push(entryDirectory(entry));
1071
+ seeds.push(dirname3(fileURLToPath(import.meta.url)));
1072
+ for (const seed of seeds) {
1073
+ let dir = seed;
1074
+ for (let depth = 0; depth < 10; depth += 1) {
1075
+ if (existsSync4(join(dir, "package.json"))) {
1076
+ cachedRoot = dir;
1077
+ return dir;
1078
+ }
1079
+ const parent = dirname3(dir);
1080
+ if (parent === dir) break;
1081
+ dir = parent;
1082
+ }
1083
+ }
1084
+ cachedRoot = process.cwd();
1085
+ return cachedRoot;
1086
+ }
1087
+ function packagePath(...segments) {
1088
+ return join(packageRootDir(), ...segments);
1089
+ }
1090
+ function packageFileUrl(...segments) {
1091
+ return pathToFileURL(packagePath(...segments));
1092
+ }
1093
+
1094
+ // src/internal/e10/tls-policy.ts
1048
1095
  var E10_TLS_CA_FILE_ENV = "WEAVER_E10_CA_FILE";
1049
1096
  var E10_TLS_CA_FILE_ALIASES = ["WEAVER_XIAOE_CA_FILE"];
1050
1097
  var E10_TLS_INSECURE_ENV = "WEAVER_E10_TLS_INSECURE";
1098
+ var E10_TLS_INSECURE_FALLBACK = "0";
1051
1099
  var INSECURE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
1100
+ var SECURE_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
1052
1101
  var PEM_MARKER = "BEGIN CERTIFICATE";
1053
1102
  function readE10TlsCaFilePaths(env = process.env) {
1054
1103
  const raw = [E10_TLS_CA_FILE_ENV, ...E10_TLS_CA_FILE_ALIASES].map((key) => env[key]).filter((value) => typeof value === "string" && value.trim().length > 0).join(",");
@@ -1056,19 +1105,29 @@ function readE10TlsCaFilePaths(env = process.env) {
1056
1105
  for (const candidate of raw.split(/[,\n]/u)) {
1057
1106
  const trimmed = candidate.trim();
1058
1107
  if (!trimmed) continue;
1059
- const absolute = resolve5(expandHome(trimmed));
1108
+ const absolute = resolve6(expandHome(trimmed));
1060
1109
  if (!paths.includes(absolute)) paths.push(absolute);
1061
1110
  }
1062
1111
  return paths;
1063
1112
  }
1064
1113
  function expandHome(value) {
1065
1114
  if (value === "~") return homedir2();
1066
- if (value.startsWith("~/")) return resolve5(homedir2(), value.slice(2));
1115
+ if (value.startsWith("~/")) return resolve6(homedir2(), value.slice(2));
1067
1116
  return value;
1068
1117
  }
1069
- function isE10TlsInsecureEnabled(env = process.env) {
1118
+ function readE10TlsInsecureSetting(env = process.env) {
1070
1119
  const raw = env[E10_TLS_INSECURE_ENV];
1071
- return typeof raw === "string" && INSECURE_VALUES.has(raw.trim().toLowerCase());
1120
+ if (typeof raw !== "string" || !raw.trim()) return "default";
1121
+ const value = raw.trim().toLowerCase();
1122
+ if (INSECURE_VALUES.has(value)) return "on";
1123
+ if (SECURE_VALUES.has(value)) return "off";
1124
+ return "default";
1125
+ }
1126
+ function isE10TlsInsecureEnabled(env = process.env) {
1127
+ const setting = readE10TlsInsecureSetting(env);
1128
+ if (setting === "on") return true;
1129
+ if (setting === "off") return false;
1130
+ return INSECURE_VALUES.has(E10_TLS_INSECURE_FALLBACK.trim().toLowerCase());
1072
1131
  }
1073
1132
  function resolveE10TlsPolicy(env = process.env) {
1074
1133
  const configuredFiles = readE10TlsCaFilePaths(env);
@@ -1084,7 +1143,7 @@ function resolveE10TlsPolicy(env = process.env) {
1084
1143
  const problems = [];
1085
1144
  for (const file of configuredFiles) {
1086
1145
  try {
1087
- if (!existsSync4(file)) {
1146
+ if (!existsSync5(file)) {
1088
1147
  problems.push(`${file}: \u6587\u4EF6\u4E0D\u5B58\u5728`);
1089
1148
  continue;
1090
1149
  }
@@ -1125,6 +1184,7 @@ function applyInsecure(policy) {
1125
1184
  }
1126
1185
  function applyUncached(policy) {
1127
1186
  if (policy.mode === "insecure") return applyInsecure(policy);
1187
+ if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === "0") delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;
1128
1188
  if (policy.mode !== "custom-ca" || !policy.ca.length) {
1129
1189
  return { ...policy, applied: false, notAppliedReason: "no-custom-ca" };
1130
1190
  }
@@ -1202,60 +1262,29 @@ function summarizeE10TlsPolicy(status) {
1202
1262
  if (status.mode === "insecure" && status.insecureSource) summary.insecureSource = status.insecureSource;
1203
1263
  return summary;
1204
1264
  }
1265
+ function e10TlsPythonSiteDir() {
1266
+ const dir = packagePath("scripts", "pysite");
1267
+ return existsSync5(dir) ? dir : "";
1268
+ }
1205
1269
  function e10TlsChildEnv(env = process.env) {
1206
1270
  const policy = resolveE10TlsPolicy(env);
1207
1271
  if (policy.mode === "insecure") {
1208
- return { ...env, [E10_TLS_INSECURE_ENV]: "1" };
1272
+ const next2 = { ...env, [E10_TLS_INSECURE_ENV]: "1" };
1273
+ const siteDir = e10TlsPythonSiteDir();
1274
+ if (siteDir) {
1275
+ const existing = typeof next2.PYTHONPATH === "string" && next2.PYTHONPATH.trim() ? next2.PYTHONPATH : "";
1276
+ next2.PYTHONPATH = existing ? `${siteDir}${delimiter}${existing}` : siteDir;
1277
+ }
1278
+ return next2;
1209
1279
  }
1210
- if (policy.mode !== "custom-ca" || !policy.caFiles.length) return env;
1280
+ const next = { ...env, [E10_TLS_INSECURE_ENV]: "0" };
1281
+ if (policy.mode !== "custom-ca" || !policy.caFiles.length) return next;
1211
1282
  const bundle = policy.caFiles[0];
1212
- const next = { ...env };
1213
1283
  if (!next.SSL_CERT_FILE) next.SSL_CERT_FILE = bundle;
1214
1284
  if (!next.REQUESTS_CA_BUNDLE) next.REQUESTS_CA_BUNDLE = bundle;
1215
1285
  return next;
1216
1286
  }
1217
1287
 
1218
- // src/core/package-paths.ts
1219
- import { existsSync as existsSync5, realpathSync } from "node:fs";
1220
- import { dirname as dirname3, join, resolve as resolve6 } from "node:path";
1221
- import { fileURLToPath, pathToFileURL } from "node:url";
1222
- var cachedRoot;
1223
- function entryDirectory(entry) {
1224
- const absoluteEntry = resolve6(entry);
1225
- try {
1226
- return dirname3(realpathSync(absoluteEntry));
1227
- } catch {
1228
- return dirname3(absoluteEntry);
1229
- }
1230
- }
1231
- function packageRootDir() {
1232
- if (cachedRoot) return cachedRoot;
1233
- const seeds = [];
1234
- const entry = process.argv[1];
1235
- if (entry) seeds.push(entryDirectory(entry));
1236
- seeds.push(dirname3(fileURLToPath(import.meta.url)));
1237
- for (const seed of seeds) {
1238
- let dir = seed;
1239
- for (let depth = 0; depth < 10; depth += 1) {
1240
- if (existsSync5(join(dir, "package.json"))) {
1241
- cachedRoot = dir;
1242
- return dir;
1243
- }
1244
- const parent = dirname3(dir);
1245
- if (parent === dir) break;
1246
- dir = parent;
1247
- }
1248
- }
1249
- cachedRoot = process.cwd();
1250
- return cachedRoot;
1251
- }
1252
- function packagePath(...segments) {
1253
- return join(packageRootDir(), ...segments);
1254
- }
1255
- function packageFileUrl(...segments) {
1256
- return pathToFileURL(packagePath(...segments));
1257
- }
1258
-
1259
1288
  // src/core/runtime-agent.ts
1260
1289
  var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
1261
1290
  "xiaoe",
@@ -1614,11 +1643,11 @@ function parseXiaoEUnifiedLoginMap(raw, source) {
1614
1643
  } catch {
1615
1644
  }
1616
1645
  return value.split(/[;,\n]+/u).map((entry) => entry.trim()).filter(Boolean).map((entry) => {
1617
- const delimiter = entry.includes("|") ? "|" : entry.includes("=") ? "=" : "";
1618
- if (delimiter) {
1619
- const index = entry.indexOf(delimiter);
1646
+ const delimiter2 = entry.includes("|") ? "|" : entry.includes("=") ? "=" : "";
1647
+ if (delimiter2) {
1648
+ const index = entry.indexOf(delimiter2);
1620
1649
  const baseUrl = entry.slice(0, index).trim();
1621
- const eteamsId = entry.slice(index + delimiter.length).trim();
1650
+ const eteamsId = entry.slice(index + delimiter2.length).trim();
1622
1651
  return baseUrl && eteamsId ? { baseUrl: normalizeUrl(baseUrl), eteamsId, source } : null;
1623
1652
  }
1624
1653
  const parts = entry.split(/\s+/u).filter(Boolean);
@@ -2362,7 +2391,7 @@ async function saveXiaoEUnifiedLogin(input) {
2362
2391
  }
2363
2392
  async function tryXiaoEUnifiedLogin(options = {}) {
2364
2393
  const env = options.env || process.env;
2365
- const tlsPolicy = applyE10TlsPolicy(env);
2394
+ const tlsPolicy = applyE10TlsPolicy();
2366
2395
  const explicitBaseUrl = normalizeUrl(options.baseUrl || "");
2367
2396
  const baseUrl = resolveXiaoEPreferredBaseUrl({
2368
2397
  explicitBaseUrl,
@@ -2500,14 +2529,15 @@ async function tryXiaoEUnifiedLogin(options = {}) {
2500
2529
  }
2501
2530
 
2502
2531
  export {
2503
- packagePath,
2504
- packageFileUrl,
2505
2532
  isConnectorMode,
2506
2533
  normalizeGlobalOptions,
2507
- writeWithRetry,
2534
+ packagePath,
2535
+ packageFileUrl,
2536
+ isXiaoERuntimeAgent,
2508
2537
  readErrorCauseCode,
2509
2538
  isTlsTrustErrorCode,
2510
2539
  looksLikeTlsTrustMessage,
2540
+ writeWithRetry,
2511
2541
  getE10AuthRoot,
2512
2542
  resolveAgentHostKey,
2513
2543
  lookupAgentHost,
@@ -2531,7 +2561,6 @@ export {
2531
2561
  extractRawSetCookie,
2532
2562
  extractSessionTicket,
2533
2563
  E10AuthSession,
2534
- isXiaoERuntimeAgent,
2535
2564
  applyE10TlsPolicy,
2536
2565
  currentE10TlsPolicyStatus,
2537
2566
  summarizeE10TlsPolicy,
@@ -2539,6 +2568,7 @@ export {
2539
2568
  summarizeXiaoEFailureKind,
2540
2569
  lastXiaoEFailure,
2541
2570
  hasXiaoEEnv,
2571
+ isXiaoECloudRuntime,
2542
2572
  resolveDefaultE10BaseUrl,
2543
2573
  inspectXiaoEUnifiedLoginSources,
2544
2574
  resolveXiaoEPreferredBaseUrl,
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  readCache,
5
5
  writeCache
6
- } from "./chunk-IVCOZCAW.js";
6
+ } from "./chunk-PAFOLIYQ.js";
7
7
  import {
8
8
  SCHEMA_DATETIME_MINUTE,
9
9
  meetingSuccess,
10
10
  meetingValidationError,
11
11
  schemaOf
12
- } from "./chunk-KDOJW5LH.js";
12
+ } from "./chunk-4I26YMBY.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-2UMNXX5H.js");
113
+ const { createEsbHost } = await import("./host-7FJW4E7R.js");
114
114
  const { createEsbContinuationSigner } = await import("./continuation-KI7DRRZN.js");
115
- const { getEsbOperation } = await import("./registry-FTPUUHWC.js");
115
+ const { getEsbOperation } = await import("./registry-N7P3W2RD.js");
116
116
  const esbEnv = {
117
117
  ctx: env.ctx,
118
118
  host: createEsbHost(env.ctx),
@@ -1,5 +1,8 @@
1
1
  import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ isXiaoECloudRuntime
5
+ } from "./chunk-AMAPQVBT.js";
3
6
  import {
4
7
  CliError
5
8
  } from "./chunk-UG5G54VL.js";
@@ -66,6 +69,16 @@ function asObject(value) {
66
69
  }
67
70
  return value;
68
71
  }
72
+ function toMenuList(value) {
73
+ if (Array.isArray(value)) return value;
74
+ if (value && typeof value === "object") {
75
+ const obj = value;
76
+ for (const key of ["cusAppMenus", "menus", "allMenus", "data", "list"]) {
77
+ if (Array.isArray(obj[key])) return obj[key];
78
+ }
79
+ }
80
+ return [];
81
+ }
69
82
  function assertNoForbiddenKeys(input) {
70
83
  for (const key of Object.keys(input)) {
71
84
  if (FORBIDDEN_KEYS.has(key)) {
@@ -250,7 +263,7 @@ function addDays(date, delta) {
250
263
 
251
264
  // src/shortcuts/ehr/operations/recruit.ts
252
265
  import { randomBytes, randomUUID } from "node:crypto";
253
- import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
266
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
254
267
  import { homedir } from "node:os";
255
268
  import { join, resolve } from "node:path";
256
269
 
@@ -279,7 +292,13 @@ var SCHEMA_STRING_LIST = { type: "array", items: { type: "string" } };
279
292
 
280
293
  // src/shortcuts/ehr/operations/recruit.ts
281
294
  var RECRUIT_APP_TAG = "weaver-recruit-service";
282
- var RECRUIT_CACHE_VERSION = 4;
295
+ var SELF_TENANT_KEYS = /* @__PURE__ */ new Set(["t7akvdnf84"]);
296
+ function isSelfTenant(tenantKey) {
297
+ const key = String(tenantKey || "").trim();
298
+ return !!key && SELF_TENANT_KEYS.has(key);
299
+ }
300
+ var RECRUIT_CACHE_VERSION = 5;
301
+ var RECRUIT_CACHE_TTL_MS = 12 * 60 * 60 * 1e3;
283
302
  var RECRUIT_CRITICAL_FORMS = /* @__PURE__ */ new Set(["position_manage", "talent_pool", "interview_plan"]);
284
303
  var RECRUIT_CRITICAL_FORM_LABELS = {
285
304
  position_manage: "\u62DB\u8058\u804C\u4F4D",
@@ -293,6 +312,7 @@ function hasCriticalFields(cache) {
293
312
  const fmap = cache?.fields?.[objId] || {};
294
313
  if (!Object.keys(fmap).length) return false;
295
314
  }
315
+ if (Array.isArray(cache?.degraded) && cache.degraded.length) return false;
296
316
  return true;
297
317
  }
298
318
  var RECRUIT_TAGS = {
@@ -372,6 +392,7 @@ function snapshotPathFor(baseUrl) {
372
392
  return join(cacheDirFor(baseUrl), "..", "_recruit-stage", `context-snapshot-${host}.json`);
373
393
  }
374
394
  function readContextSnapshot(baseUrl) {
395
+ if (isXiaoECloudRuntime()) return null;
375
396
  try {
376
397
  const raw = JSON.parse(readFileSync(snapshotPathFor(baseUrl), "utf8"));
377
398
  if (!raw?.at || raw.cacheVersion !== RECRUIT_CACHE_VERSION) return null;
@@ -383,6 +404,8 @@ function readContextSnapshot(baseUrl) {
383
404
  }
384
405
  }
385
406
  function writeContextSnapshot(baseUrl, appId, resolved) {
407
+ if (Array.isArray(resolved?.degraded) && resolved.degraded.length) return;
408
+ if (isXiaoECloudRuntime()) return;
386
409
  try {
387
410
  const path = snapshotPathFor(baseUrl);
388
411
  mkdirSync(join(path, ".."), { recursive: true });
@@ -465,6 +488,7 @@ async function fetchFormFields(host, appId, objId) {
465
488
  return { fmap, omap };
466
489
  }
467
490
  async function resolveRecruitEnv(host, appId) {
491
+ const degraded = [];
468
492
  const forms = {};
469
493
  let tenantKey = "";
470
494
  const tagEntries = Object.entries(RECRUIT_TAGS);
@@ -489,21 +513,27 @@ async function resolveRecruitEnv(host, appId) {
489
513
  `\u5F53\u524D\u73AF\u5883\u672A\u89E3\u6790\u5230\u300C${RECRUIT_CRITICAL_FORM_LABELS[logic] || logic}\u300D\u8868\u5355\uFF08getObjsByTag \u8FD4\u56DE\u7A7A\uFF09\uFF0C\u5DF2\u4E2D\u6B62\u4E14\u672A\u5199\u5165\u7F13\u5B58\uFF1B\u8BF7\u786E\u8BA4\u62DB\u8058\u5E94\u7528\u5DF2\u5B89\u88C5\u3001\u8D26\u53F7\u5BF9\u8BE5\u8868\u5355\u6709\u6743\u9650\u540E\u91CD\u8BD5\u3002`
490
514
  );
491
515
  }
492
- const menuResponse = await host.request({
493
- path: "/api/cusapp/app/allMenus",
494
- query: { isFront: 1, appId, terminalType: "PC" }
495
- });
516
+ if (!forms.dictionary?.objId) degraded.push("dict");
496
517
  const flat = [];
497
518
  const walk = (nodes) => {
498
- for (const node of nodes || []) {
519
+ for (const node of toMenuList(nodes)) {
499
520
  if (node && typeof node === "object") {
500
521
  flat.push(node);
501
- walk(node.children || node.childs);
522
+ walk(node.children ?? node.childs);
502
523
  }
503
524
  }
504
525
  };
505
- const menuData = menuResponse?.data;
506
- walk(typeof menuData === "object" && menuData ? menuData.cusAppMenus || menuData : menuData);
526
+ let menuFailed = false;
527
+ try {
528
+ const menuResponse = await host.request({
529
+ path: "/api/cusapp/app/allMenus",
530
+ query: { isFront: 1, appId, terminalType: "PC" }
531
+ });
532
+ walk(menuResponse?.data);
533
+ } catch {
534
+ menuFailed = true;
535
+ }
536
+ if (menuFailed || !flat.length) degraded.push("menus");
507
537
  const searchMenus = [];
508
538
  const pages = [];
509
539
  for (const node of flat) {
@@ -532,52 +562,57 @@ async function resolveRecruitEnv(host, appId) {
532
562
  const dictMenu = searchMenus.find((m) => (m.menuName || "").trim() === "\u6570\u636E\u5B57\u5178") || null;
533
563
  const dictObjId = forms.dictionary?.objId || "";
534
564
  if (dictObjId && dictMenu) {
535
- const size = 500;
536
- const CONCURRENCY = 6;
537
- const fetchDictPage = (pageNo2) => host.request({
538
- path: `/api/ebuilder/form/list/getListDatas?passid=${dictObjId}&cid=${dictObjId}`,
539
- body: {
540
- current: pageNo2,
541
- pageSize: size,
542
- tableuid: randHex32(),
543
- listId: dictMenu.listId,
544
- searchParamData: { searchType: "3", type: "and" },
545
- terminal: "PC",
546
- browser: "Chrome",
547
- requiredMatch: 1,
548
- mapResult: 1,
549
- recheckQuery: 1,
550
- isFollow: 0,
551
- isShareToMe: 0,
552
- filterCondition: {},
553
- cusMenuId: dictMenu.cusMenuId,
554
- urlPageTitle: "\u6570\u636E\u5B57\u5178",
555
- menuName: "\u6570\u636E\u5B57\u5178"
556
- },
557
- headers: { ebBusinessId: dictMenu.listId }
558
- });
559
- let pageNo = 1;
560
- let reachedEnd = false;
561
- while (!reachedEnd) {
562
- const batchPages = Array.from({ length: CONCURRENCY }, (_, i) => pageNo + i);
563
- const responses = await Promise.all(batchPages.map((p) => fetchDictPage(p)));
564
- for (const response of responses) {
565
- const rows = response?.data?.data || [];
566
- for (const row of rows) {
567
- const name = row.selection_name;
568
- const optionId = row.form_data_id;
569
- if (name && optionId) {
570
- (dictByName[String(name)] ||= []).push(String(optionId));
571
- dictRaw.push({ selection_name: String(name), option_id: String(optionId), dict_type: row.dict_type, browser_key: row.browser_key });
565
+ try {
566
+ const size = 500;
567
+ const CONCURRENCY = 6;
568
+ const fetchDictPage = (pageNo2) => host.request({
569
+ path: `/api/ebuilder/form/list/getListDatas?passid=${dictObjId}&cid=${dictObjId}`,
570
+ body: {
571
+ current: pageNo2,
572
+ pageSize: size,
573
+ tableuid: randHex32(),
574
+ listId: dictMenu.listId,
575
+ searchParamData: { searchType: "3", type: "and" },
576
+ terminal: "PC",
577
+ browser: "Chrome",
578
+ requiredMatch: 1,
579
+ mapResult: 1,
580
+ recheckQuery: 1,
581
+ isFollow: 0,
582
+ isShareToMe: 0,
583
+ filterCondition: {},
584
+ cusMenuId: dictMenu.cusMenuId,
585
+ urlPageTitle: "\u6570\u636E\u5B57\u5178",
586
+ menuName: "\u6570\u636E\u5B57\u5178"
587
+ },
588
+ headers: { ebBusinessId: dictMenu.listId }
589
+ });
590
+ let pageNo = 1;
591
+ let reachedEnd = false;
592
+ while (!reachedEnd) {
593
+ const batchPages = Array.from({ length: CONCURRENCY }, (_, i) => pageNo + i);
594
+ const responses = await Promise.all(batchPages.map((p) => fetchDictPage(p)));
595
+ for (const response of responses) {
596
+ const rows = response?.data?.data || [];
597
+ for (const row of rows) {
598
+ const name = row.selection_name;
599
+ const optionId = row.form_data_id;
600
+ if (name && optionId) {
601
+ (dictByName[String(name)] ||= []).push(String(optionId));
602
+ dictRaw.push({ selection_name: String(name), option_id: String(optionId), dict_type: row.dict_type, browser_key: row.browser_key });
603
+ }
604
+ }
605
+ if (rows.length < size) {
606
+ reachedEnd = true;
607
+ break;
572
608
  }
573
609
  }
574
- if (rows.length < size) {
575
- reachedEnd = true;
576
- break;
577
- }
610
+ pageNo += CONCURRENCY;
578
611
  }
579
- pageNo += CONCURRENCY;
612
+ } catch {
613
+ degraded.push("dict");
580
614
  }
615
+ if (!Object.keys(dictByName).length) degraded.push("dict");
581
616
  }
582
617
  let ebdDetailPageId = "";
583
618
  let selfUse = "0";
@@ -642,6 +677,7 @@ async function resolveRecruitEnv(host, appId) {
642
677
  } catch {
643
678
  }
644
679
  }
680
+ if (isSelfTenant(tenantKey)) selfUse = "1";
645
681
  if (!ebdDetailPageId) {
646
682
  try {
647
683
  const response = await host.request({
@@ -662,15 +698,19 @@ async function resolveRecruitEnv(host, appId) {
662
698
  const entry = forms[logic] || { objId: "", formId: "", objName: "" };
663
699
  const fieldId = (fields[entry.objId] || {})[dataKey] || "";
664
700
  if (fieldId && entry.objId) {
665
- const response = await host.request({
666
- path: "/api/ebuilder/common/ds/options",
667
- query: { fieldName: fieldId, objId: entry.objId, sourceType: "FORM", groupId: appId }
668
- });
669
- if (Array.isArray(response?.data)) {
670
- options[dataKey] = {};
671
- for (const option of response.data) {
672
- if (option?.id) options[dataKey][String(option.id)] = option.name;
701
+ try {
702
+ const response = await host.request({
703
+ path: "/api/ebuilder/common/ds/options",
704
+ query: { fieldName: fieldId, objId: entry.objId, sourceType: "FORM", groupId: appId }
705
+ });
706
+ if (Array.isArray(response?.data)) {
707
+ options[dataKey] = {};
708
+ for (const option of response.data) {
709
+ if (option?.id) options[dataKey][String(option.id)] = option.name;
710
+ }
673
711
  }
712
+ } catch {
713
+ degraded.push(`options:${dataKey}`);
674
714
  }
675
715
  }
676
716
  }
@@ -698,6 +738,7 @@ async function resolveRecruitEnv(host, appId) {
698
738
  return {
699
739
  appId,
700
740
  tenantKey,
741
+ degraded,
701
742
  forms,
702
743
  lists,
703
744
  fields,
@@ -716,23 +757,7 @@ function createRecruitContextLoader() {
716
757
  const memoKey = baseUrl;
717
758
  let cached = memo.get(memoKey);
718
759
  if (cached) return cached;
719
- let appId = "";
720
- let diskCache = null;
721
- try {
722
- const dir = cacheDirFor(baseUrl);
723
- if (existsSync(dir)) {
724
- const files = readdirSync(dir).filter((file) => file.endsWith(".json") && !file.startsWith("_"));
725
- if (files.length === 1) {
726
- appId = files[0].replace(/\.json$/, "");
727
- diskCache = JSON.parse(readFileSync(join(dir, files[0]), "utf8"));
728
- }
729
- }
730
- } catch {
731
- }
732
- if (diskCache && diskCache.cacheVersion === RECRUIT_CACHE_VERSION && hasCriticalFields(diskCache)) {
733
- memo.set(memoKey, diskCache);
734
- return diskCache;
735
- }
760
+ const cloudRuntime = isXiaoECloudRuntime();
736
761
  const gate = await host.request({
737
762
  path: "/api/bs/ebuilder/app/tags/getAppIds",
738
763
  query: { tag: RECRUIT_APP_TAG }
@@ -744,7 +769,22 @@ function createRecruitContextLoader() {
744
769
  "\u5F53\u524D\u79DF\u6237\u672A\u5B89\u88C5\u62DB\u8058\u670D\u52A1\uFF08weaver-recruit-service\uFF09\uFF0C\u65E0\u6CD5\u4F7F\u7528\u62DB\u8058\u80FD\u529B\u3002\u8BF7\u5148\u5728 E10 \u5E94\u7528\u5E02\u573A\u5B89\u88C5\u300C\u62DB\u8058\u300D\u5E94\u7528\u3002"
745
770
  );
746
771
  }
747
- appId = String(appIds[0]);
772
+ const appId = String(appIds[0]);
773
+ if (!cloudRuntime) {
774
+ try {
775
+ const file = join(cacheDirFor(baseUrl), `${appId}.json`);
776
+ if (existsSync(file)) {
777
+ const candidate = JSON.parse(readFileSync(file, "utf8"));
778
+ const savedAt = Number(candidate?.savedAt || 0);
779
+ const fresh = savedAt > 0 && Date.now() - savedAt <= RECRUIT_CACHE_TTL_MS;
780
+ if (candidate && candidate.cacheVersion === RECRUIT_CACHE_VERSION && fresh && hasCriticalFields(candidate)) {
781
+ memo.set(memoKey, candidate);
782
+ return candidate;
783
+ }
784
+ }
785
+ } catch {
786
+ }
787
+ }
748
788
  const snapshot = readContextSnapshot(baseUrl);
749
789
  if (snapshot && snapshot.appId === appId && !process.env.E10_RS_NO_CTX_SNAPSHOT) {
750
790
  let tagStillMatches = false;
@@ -774,6 +814,13 @@ function createRecruitContextLoader() {
774
814
  return { load };
775
815
  }
776
816
  function persistContextCache(baseUrl, appId, cache) {
817
+ if (Array.isArray(cache?.degraded) && cache.degraded.length) {
818
+ if (process.env.WEAVER_CLI_DEBUG_CACHE) {
819
+ console.error("[recruit-context] \u89E3\u6790\u5B58\u5728\u964D\u7EA7\uFF08", cache.degraded.join(","), "\uFF09\uFF0C\u672C\u6B21\u4E0D\u843D\u76D8\uFF0C\u4E0B\u6B21\u8C03\u7528\u5C06\u5168\u91CF\u91CD\u5EFA");
820
+ }
821
+ return;
822
+ }
823
+ if (isXiaoECloudRuntime()) return;
777
824
  try {
778
825
  const dir = cacheDirFor(baseUrl);
779
826
  mkdirSync(dir, { recursive: true });
@@ -785,8 +832,10 @@ function persistContextCache(baseUrl, appId, cache) {
785
832
  note: "recruit-ops \u73AF\u5883\u53C2\u6570\u7F13\u5B58\uFF08weaver-work-cli \u8FD0\u884C\u65F6\u89E3\u6790\u4EA7\u7269\uFF0C\u4E0D\u542B\u8BA4\u8BC1\u5B57\u6BB5\uFF09"
786
833
  },
787
834
  envKey: `${dir.split(/[\\/]/).pop()}|${appId}`,
835
+ ...cache,
788
836
  cacheVersion: RECRUIT_CACHE_VERSION,
789
- ...cache
837
+ // 🔴 savedAt 必须在 ...cache 之后:防止调用方携带旧 savedAt 把新写入标成过期
838
+ savedAt: Date.now()
790
839
  }, null, 2),
791
840
  "utf8"
792
841
  );
@@ -1485,6 +1534,7 @@ export {
1485
1534
  SCHEMA_ID_LIST,
1486
1535
  SCHEMA_STRING_LIST,
1487
1536
  asObject,
1537
+ toMenuList,
1488
1538
  assertNoForbiddenKeys,
1489
1539
  assertMonth,
1490
1540
  toNumber,
@@ -1501,6 +1551,7 @@ export {
1501
1551
  EHR_PAGES,
1502
1552
  ehrPageUrl,
1503
1553
  addDays,
1554
+ isSelfTenant,
1504
1555
  LIST_TYPES,
1505
1556
  namesOf,
1506
1557
  createRecruitContextLoader,
@@ -5,7 +5,7 @@ import {
5
5
  ebBusinessSuccess,
6
6
  meetingSuccess,
7
7
  meetingValidationError
8
- } from "./chunk-KDOJW5LH.js";
8
+ } from "./chunk-4I26YMBY.js";
9
9
 
10
10
  // src/shortcuts/meeting/operations/env.ts
11
11
  import { existsSync } from "node:fs";