weaver-work-cli 0.1.47 → 0.1.49

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 (229) hide show
  1. package/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-57R2FYHV.js} +565 -17
  2. package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-MU2LPI5P.js} +3 -3
  3. package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
  4. package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
  5. package/dist/chunks/{chunk-IP4CWQCF.js → chunk-3NV2ETZR.js} +8 -8
  6. package/dist/chunks/{chunk-OXHHJWNC.js → chunk-3X7VOSBA.js} +1 -1
  7. package/dist/chunks/chunk-5QYE52LG.js +223 -0
  8. package/dist/chunks/{chunk-IRMIEDXN.js → chunk-6GWU63YF.js} +1 -1
  9. package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
  10. package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
  11. package/dist/chunks/{chunk-AD46OMQK.js → chunk-BRRW7CWA.js} +121 -46
  12. package/dist/chunks/{chunk-76H3IKH6.js → chunk-D2QRZUW4.js} +221 -37
  13. package/dist/chunks/{chunk-GSZTA43P.js → chunk-EJVA5ZVB.js} +2 -2
  14. package/dist/chunks/{chunk-4RWS2YYL.js → chunk-GEOMANP7.js} +3 -3
  15. package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
  16. package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
  17. package/dist/chunks/chunk-JEQHNNSS.js +158 -0
  18. package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-K3BT54CU.js} +4 -4
  19. package/dist/chunks/{chunk-6AXKWFKG.js → chunk-KV5SOWMS.js} +4 -4
  20. package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
  21. package/dist/chunks/{chunk-PSOMGA3U.js → chunk-ZKEUGS2U.js} +36 -7
  22. package/dist/chunks/{conflict-H7EHQXYY.js → conflict-6347A7YK.js} +2 -2
  23. package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
  24. package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-7WG7LVX5.js} +6 -6
  25. package/dist/chunks/data-QO7QWOIV.js +2525 -0
  26. package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
  27. package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
  28. package/dist/chunks/{env-66FPSJDV.js → env-LHRKSLG6.js} +2 -2
  29. package/dist/chunks/{factory-UH2TZBVA.js → factory-2H7Z4RWJ.js} +1 -1
  30. package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-EW6PNDDT.js} +3 -3
  31. package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
  32. package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
  33. package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
  34. package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
  35. package/dist/chunks/{meeting-VTBFW4HI.js → meeting-N2FQBHXI.js} +10 -10
  36. package/dist/chunks/org-NFE7X7FK.js +12 -0
  37. package/dist/chunks/{reception-5WITA44R.js → reception-MYOKJULO.js} +905 -116
  38. package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-FKWS5UQF.js} +118 -29
  39. package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
  40. package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
  41. package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
  42. package/dist/chunks/{registry-JVQBLFQ5.js → registry-CKUVBS53.js} +10 -10
  43. package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-MBCYENQ2.js} +4 -4
  44. package/dist/chunks/{schedule-IDETODCA.js → schedule-5IFMCXME.js} +4 -4
  45. package/dist/chunks/{workflow-BSYT5TGL.js → workflow-2TRU2ZSP.js} +5 -5
  46. package/dist/core/refs.js +19 -2
  47. package/dist/index.js +20 -15
  48. package/dist/shortcuts/archive-oa/constants.js +42 -0
  49. package/dist/shortcuts/archive-oa/host.js +2 -2
  50. package/dist/shortcuts/archive-oa/index.js +38 -0
  51. package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
  52. package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
  53. package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
  54. package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
  55. package/dist/shortcuts/archive-oa/operations/registry.js +9 -4
  56. package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
  57. package/dist/shortcuts/contract/index.js +9 -1
  58. package/dist/shortcuts/contract/manifest.js +14 -2
  59. package/dist/shortcuts/contract/operations/card.js +231 -0
  60. package/dist/shortcuts/contract/operations/registry.js +2 -0
  61. package/dist/shortcuts/contract/operations/review.js +16 -5
  62. package/dist/shortcuts/contract/operations/summary.js +25 -17
  63. package/dist/shortcuts/data/errors.js +64 -0
  64. package/dist/shortcuts/data/host.js +140 -0
  65. package/dist/shortcuts/data/index.js +429 -0
  66. package/dist/shortcuts/data/manifest.js +133 -0
  67. package/dist/shortcuts/data/operations/attend.js +62 -0
  68. package/dist/shortcuts/data/operations/conf.js +384 -0
  69. package/dist/shortcuts/data/operations/ds.js +686 -0
  70. package/dist/shortcuts/data/operations/field.js +68 -0
  71. package/dist/shortcuts/data/operations/index.js +65 -0
  72. package/dist/shortcuts/data/operations/module.js +383 -0
  73. package/dist/shortcuts/data/operations/noun.js +102 -0
  74. package/dist/shortcuts/data/operations/query.js +85 -0
  75. package/dist/shortcuts/data/operations/scene.js +235 -0
  76. package/dist/shortcuts/data/operations/shared.js +279 -0
  77. package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
  78. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +28 -12
  79. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
  80. package/dist/shortcuts/ehr/recruit-stage/shared.js +90 -8
  81. package/dist/shortcuts/im/index.js +128 -0
  82. package/dist/shortcuts/im/operations/session.js +6 -0
  83. package/dist/shortcuts/index.js +5 -0
  84. package/dist/shortcuts/invoice/host.js +0 -3
  85. package/dist/shortcuts/invoice/manifest.js +0 -1
  86. package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
  87. package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
  88. package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
  89. package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
  90. package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
  91. package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
  92. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  93. package/dist/shortcuts/reception/constants.js +11 -0
  94. package/dist/shortcuts/reception/host.js +33 -1
  95. package/dist/shortcuts/reception/index.js +22 -1
  96. package/dist/shortcuts/reception/manifest.js +55 -2
  97. package/dist/shortcuts/reception/operations/ask.js +37 -1
  98. package/dist/shortcuts/reception/operations/compose.js +124 -3
  99. package/dist/shortcuts/reception/operations/doc.js +59 -0
  100. package/dist/shortcuts/reception/operations/docrender.js +25 -1
  101. package/dist/shortcuts/reception/operations/leads.js +245 -0
  102. package/dist/shortcuts/reception/operations/markdown.js +22 -0
  103. package/dist/shortcuts/reception/operations/panels.js +84 -21
  104. package/dist/shortcuts/reception/operations/registry.js +2 -0
  105. package/dist/shortcuts/reception/operations/render.js +76 -3
  106. package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
  107. package/dist/shortcuts/reception/operations/restaurant.js +264 -0
  108. package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
  109. package/dist/shortcuts/reception/operations/schedule.js +7 -1
  110. package/dist/shortcuts/reception/upload.js +22 -6
  111. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +28 -12
  112. package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
  113. package/dist/shortcuts/recruit-stage/shared.js +99 -14
  114. package/docs/SKILL.md +1 -0
  115. package/docs/_catalog.md +3 -0
  116. package/docs/archive-oa.md +4 -2
  117. package/docs/data.md +149 -0
  118. package/docs/reception.md +59 -5
  119. package/package.json +1 -1
  120. package/scripts/check-skill-sync.mjs +188 -0
  121. package/scripts/package-skill.mjs +17 -3
  122. package/skill-template/business-info.json +23 -0
  123. package/skill-template/domains/archive-oa.md +2 -1
  124. package/skill-template/domains/data.md +15 -0
  125. package/skill-template/master-skill-template.md +1 -0
  126. package/skill-template/skill-template.md +1 -0
  127. package/skills/weaver-e10-archive-oa/SKILL.md +35 -7
  128. package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
  129. package/skills/weaver-e10-archive-oa/references/contract-search.md +105 -4
  130. package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +2 -2
  131. package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
  132. package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
  133. package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +48 -2
  134. package/skills/weaver-e10-calendar/SKILL.md +1 -1
  135. package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
  136. package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
  137. package/skills/weaver-e10-cowork/SKILL.md +9 -6
  138. package/skills/weaver-e10-data/SKILL.md +118 -0
  139. package/skills/weaver-e10-data/references/config-center.md +90 -0
  140. package/skills/weaver-e10-data/references/datasource.md +136 -0
  141. package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
  142. package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
  143. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
  144. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
  145. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
  146. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
  147. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
  148. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
  149. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
  150. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
  151. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
  152. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
  153. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
  154. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
  155. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
  156. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
  157. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
  158. package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
  159. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  160. package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
  161. package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
  162. package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
  163. package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
  164. package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
  165. package/skills/weaver-e10-jucailin/SKILL.md +7 -4
  166. package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
  167. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
  168. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
  169. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
  170. package/skills/weaver-e10-mail/SKILL.md +17 -4
  171. package/skills/weaver-e10-meeting/SKILL.md +129 -412
  172. package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
  173. package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
  174. package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
  175. package/skills/weaver-e10-reception-flow/SKILL.md +77 -19
  176. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
  177. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
  178. package/skills/weaver-e10-reception-flow/references/guide.md +4 -3
  179. package/skills/weaver-e10-reception-flow/scripts/render.py +84 -3
  180. package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
  181. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +78 -8
  182. package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
  183. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
  184. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
  185. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
  186. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
  187. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
  188. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
  189. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
  190. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
  191. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
  192. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
  193. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +169 -0
  194. package/skills/weaver-e10-shijingran/SKILL.md +6 -2
  195. package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
  196. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  197. package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
  198. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
  199. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  200. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
  201. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
  202. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
  203. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
  204. package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
  205. package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
  206. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
  207. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  208. package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-CBYI6CQ6.js} +3 -3
  209. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
  210. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
  211. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
  212. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
  213. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
  214. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
  215. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
  216. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
  217. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
  218. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
  219. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
  220. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
  221. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
  222. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
  223. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
  224. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
  225. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
  226. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
  227. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
  228. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
  229. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
@@ -0,0 +1,118 @@
1
+ /** 与快照 `restaurant.roomSource` 保持一致;改这里要同步快照。 */
2
+ export const ROOM_SOURCE = {
3
+ group: 'weaver-ebuilder-form-service',
4
+ table: '840360795890851855',
5
+ appId: '840360791696547845',
6
+ physicalTable: 'uf_xstbxh',
7
+ fields: {
8
+ roomNo: 'field_840360795890851870',
9
+ title: 'field_840360795890851873',
10
+ region: 'field_841962208930570241',
11
+ desc: 'field_840360795890851871',
12
+ },
13
+ /** 数据集接口是 BI 侧能力,缺这个头会 403 */
14
+ businessId: '10000000000000000',
15
+ };
16
+ const pickStr = (value) => (value === null || value === undefined ? '' : String(value)).trim();
17
+ /** 区域字段可能是 '上海' / ['上海'] / [{name:'上海'}],统一成文本。 */
18
+ function regionText(value) {
19
+ if (Array.isArray(value)) {
20
+ return value
21
+ .map((item) => pickStr(item && typeof item === 'object' ? (item.name || item.label) : item))
22
+ .filter(Boolean)
23
+ .join('/');
24
+ }
25
+ if (value && typeof value === 'object') {
26
+ const node = value;
27
+ return pickStr(node.name || node.label || node.text);
28
+ }
29
+ return pickStr(value);
30
+ }
31
+ /** 从「描述」「包厢号」里抠容量:可容纳 16 人 / (16人包厢)/ 16人桌。 */
32
+ export function capacityFromText(text) {
33
+ const s = pickStr(text);
34
+ const matched = /可容纳\s*(\d{1,3})\s*人/.exec(s)
35
+ || /[((]\s*(\d{1,3})\s*人/.exec(s)
36
+ || /(\d{1,3})\s*人/.exec(s);
37
+ const n = matched ? Number(matched[1]) : 0;
38
+ return Number.isFinite(n) && n > 0 && n < 500 ? n : 0;
39
+ }
40
+ export async function fetchRestaurantRooms(runtime, options = {}) {
41
+ const { fields, table, group, appId, businessId } = ROOM_SOURCE;
42
+ const pageSize = options.pageSize || 200;
43
+ const queryDto = {
44
+ tableId: table,
45
+ groupId: group,
46
+ pageNo: 1,
47
+ pageSize,
48
+ queryType: 'getListData',
49
+ containDetailTable: false,
50
+ needFormat: true,
51
+ // e10-data 的 dyn() 会带 eteamsId / userId / tenantKey:服务端按这三项做行级权限,
52
+ // 缺了可能返回空列表而不是报错。值只在内存里传,不落盘、不打印。
53
+ dynamicParams: {
54
+ ...(options.context?.eteamsId ? { eteamsId: options.context.eteamsId } : {}),
55
+ ...(options.context?.userId ? { userId: options.context.userId } : {}),
56
+ ...(options.context?.tenantKey ? { tenantKey: options.context.tenantKey } : {}),
57
+ langId: 7,
58
+ formatDate: 'yyyy-MM-dd HH:mm:ss',
59
+ isPublic: false,
60
+ },
61
+ appId,
62
+ queryFields: Object.values(fields).map((fieldId) => ({
63
+ fieldId,
64
+ fieldName: fieldId,
65
+ objId: table,
66
+ mainField: true,
67
+ })),
68
+ orderFields: [],
69
+ queryCount: true,
70
+ };
71
+ const form = new FormData();
72
+ form.append('sourceType', 'LOGIC');
73
+ form.append('queryDto', JSON.stringify(queryDto));
74
+ const response = await runtime.requestJson({
75
+ module: 'reception',
76
+ operation: 'reception.restaurantRooms',
77
+ method: 'POST',
78
+ path: '/api/dw/newetl/chatBi/ds/getListDatas',
79
+ formData: form,
80
+ headers: {
81
+ langType: 'zh_CN',
82
+ ebbusinessid: businessId,
83
+ referer: '/sp/ebddesigner/1282331905881874436',
84
+ },
85
+ timeoutMs: options.timeoutMs || 30_000,
86
+ });
87
+ const payload = (response.value || {});
88
+ const data = (payload.data || payload);
89
+ const list = Array.isArray(data.list) ? data.list
90
+ : Array.isArray(data.records) ? data.records
91
+ : Array.isArray(data.rows) ? data.rows
92
+ : [];
93
+ const rooms = [];
94
+ for (const row of list) {
95
+ if (!row)
96
+ continue;
97
+ const name = pickStr(row[fields.roomNo] || row[fields.title]
98
+ || row.roomNo || row.name || row.title);
99
+ if (!name)
100
+ continue;
101
+ const desc = pickStr(row[fields.desc] || row.desc || row.description || '');
102
+ const region = regionText(row[fields.region] || row.region || row.area || '');
103
+ // 参观动线在总部,只留上海;没标区域的按可用处理
104
+ if (region && !/上海/.test(region))
105
+ continue;
106
+ rooms.push({
107
+ name,
108
+ capacity: capacityFromText(`${desc} ${name}`),
109
+ where: region,
110
+ region,
111
+ });
112
+ }
113
+ return {
114
+ rooms,
115
+ total: Number(data.count || data.total || rooms.length) || rooms.length,
116
+ rawCount: list.length,
117
+ };
118
+ }
@@ -0,0 +1,264 @@
1
+ /**
2
+ * 小餐厅预定明细:只在客户**明确提到**小餐厅/包厢时填,其余情况整段不出。
3
+ *
4
+ * 包厢号不是编的——必须来自建模表单「小食堂包厢」的实查结果,CLI 只负责从候选里挑一个。
5
+ * 触发只看「用户说过没有」:光有检索候选不算,否则没提小餐厅也会被填进去。
6
+ *
7
+ * 移植自 `@weaver/reception-cli@0.7.15` 的 `lib/restaurant.js`,判定口径保持一致。
8
+ */
9
+ import { hhmmPlus } from './schedule.js';
10
+ /** 与 data/fields-snapshot.json 的 restaurant 段保持一致;快照缺失时用它兜底。 */
11
+ export const RESTAURANT_DETAIL = {
12
+ name: '小餐厅预定明细',
13
+ subFormId: '1328260727015997527',
14
+ dataKey: 'formtable__xctydmx',
15
+ fields: {
16
+ roomNo: '1329411121197875201',
17
+ headcount: '1328336675122282515',
18
+ startDate: '1328336675122282518',
19
+ startTime: '1328337576855699719',
20
+ endDate: '1328336675122282519',
21
+ endTime: '1328337576855699720',
22
+ },
23
+ defaultDurationMinutes: 90,
24
+ };
25
+ /** 触发词:提到小餐厅/包厢/包间才算有预定需求。 */
26
+ const TRIGGER = /小餐厅|包厢|包间|小食堂|内部餐厅/;
27
+ /** 「小食堂包厢」建模表单的字段 id(与快照 restaurant.roomSource 一致),用于吃下 ds 原始行。 */
28
+ const ROOM_FIELDS = {
29
+ roomNo: 'field_840360795890851870',
30
+ title: 'field_840360795890851873',
31
+ region: 'field_841962208930570241',
32
+ desc: 'field_840360795890851871',
33
+ };
34
+ const pickStr = (value) => (value === null || value === undefined ? '' : String(value)).trim();
35
+ /** 从「描述」「包厢号」里抠容量:可容纳 16 人 / (16人包厢)/ 16人桌。 */
36
+ function capacityFromText(text) {
37
+ const s = pickStr(text);
38
+ const matched = /可容纳\s*(\d{1,3})\s*人/.exec(s)
39
+ || /[((]\s*(\d{1,3})\s*人/.exec(s)
40
+ || /(\d{1,3})\s*人/.exec(s);
41
+ const n = matched ? Number(matched[1]) : 0;
42
+ return Number.isFinite(n) && n > 0 && n < 500 ? n : 0;
43
+ }
44
+ /** 区域字段可能是 '上海' / ['上海'] / [{name:'上海'}],统一成文本。 */
45
+ function regionText(value) {
46
+ if (Array.isArray(value)) {
47
+ return value
48
+ .map((item) => pickStr(item && typeof item === 'object' ? (item.name || item.label) : item))
49
+ .filter(Boolean)
50
+ .join('/');
51
+ }
52
+ if (value && typeof value === 'object') {
53
+ const node = value;
54
+ return pickStr(node.name || node.label || node.text);
55
+ }
56
+ return pickStr(value);
57
+ }
58
+ /** ds list 的返回可能是裸数组,也可能裹在 rooms/items/list/records/rows/data 里。 */
59
+ export function unwrapRoomRows(input) {
60
+ if (Array.isArray(input))
61
+ return input;
62
+ if (!input || typeof input !== 'object')
63
+ return [];
64
+ const node = input;
65
+ const candidate = node.rooms || node.items || node.list || node.records || node.rows
66
+ || (node.data && (node.data.list || node.data.records || node.data.rows || node.data.items))
67
+ || (Array.isArray(node.data) ? node.data : null);
68
+ return Array.isArray(candidate) ? candidate : [];
69
+ }
70
+ /** 把 ds list 的原始行(field_xxx 键)或友好的 {name,capacity} 统一成候选包厢。 */
71
+ export function normalizeRoomCandidates(input) {
72
+ const list = unwrapRoomRows(input);
73
+ const out = [];
74
+ for (const row of list) {
75
+ if (!row)
76
+ continue;
77
+ const item = typeof row === 'string' ? { name: row } : row;
78
+ const name = pickStr(item.name || item.roomNo || item.title || item.label
79
+ || item[ROOM_FIELDS.roomNo] || item[ROOM_FIELDS.title]);
80
+ if (!name)
81
+ continue;
82
+ const desc = pickStr(item.desc || item.description || item.remark || item[ROOM_FIELDS.desc]);
83
+ const region = regionText(item.region || item.area || item.location || item[ROOM_FIELDS.region]);
84
+ // 参观动线在总部,只留上海;没标区域的按可用处理
85
+ if (region && !/上海/.test(region))
86
+ continue;
87
+ out.push({
88
+ name,
89
+ capacity: Number(item.capacity || item.seats || item.maxPeople || item.size || 0)
90
+ || capacityFromText(`${desc} ${name}`),
91
+ where: region,
92
+ type: pickStr(item.type || item.kind),
93
+ });
94
+ }
95
+ return out;
96
+ }
97
+ /** 文本里出现的小时:分钟,按出现顺序返回。 */
98
+ function timesIn(text) {
99
+ const out = [];
100
+ const re = /(\d{1,2})\s*[::]\s*(\d{2})/g;
101
+ let matched;
102
+ const source = String(text || '');
103
+ while ((matched = re.exec(source)) !== null) {
104
+ const hour = Number(matched[1]);
105
+ const minute = Number(matched[2]);
106
+ if (hour <= 23 && minute <= 59) {
107
+ out.push(`${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`);
108
+ }
109
+ }
110
+ return out;
111
+ }
112
+ function nextDay(date) {
113
+ const matched = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(date || ''));
114
+ if (!matched)
115
+ return date || '';
116
+ const d = new Date(Date.UTC(Number(matched[1]), Number(matched[2]) - 1, Number(matched[3]) + 1));
117
+ return d.toISOString().slice(0, 10);
118
+ }
119
+ /** 「小食堂包厢」的房间规格:同容量时包厢优先,卡拉OK/烧烤只做兜底。 */
120
+ const RANK = { private: 0, combo: 1, tea: 2, entertainment: 3 };
121
+ const KIND_LABEL = {
122
+ private: '包厢', combo: '通包', tea: '茶室', entertainment: '娱乐场地',
123
+ };
124
+ function kindOf(room) {
125
+ const explicit = pickStr(room.type);
126
+ if (explicit && RANK[explicit] !== undefined)
127
+ return explicit;
128
+ const name = pickStr(room.name);
129
+ if (/卡拉|KTV|ktv|烧烤|娱乐|棋牌/.test(name))
130
+ return 'entertainment';
131
+ if (/茶室|茶座/.test(name))
132
+ return 'tea';
133
+ if (/通包|联通/.test(name))
134
+ return 'combo';
135
+ return 'private';
136
+ }
137
+ /**
138
+ * 从候选里挑一个合适的包厢:装得下的最小间;都装不下取最大间。
139
+ * 容量优先、同容量再按规格(包厢 > 通包 > 茶室)。
140
+ */
141
+ export function pickRestaurantRoom(rooms = [], headcount = 0) {
142
+ const list = normalizeRoomCandidates(rooms);
143
+ if (!list.length)
144
+ return null;
145
+ const count = Number(headcount) || 0;
146
+ const rank = (room) => RANK[kindOf(room)] ?? RANK.private;
147
+ const fitSort = (a, b) => (a.capacity - b.capacity) || (rank(a) - rank(b));
148
+ const overSort = (a, b) => (b.capacity - a.capacity) || (rank(a) - rank(b));
149
+ const playable = list.filter((room) => kindOf(room) !== 'entertainment');
150
+ const label = (room) => KIND_LABEL[kindOf(room)] || '包厢';
151
+ if (count) {
152
+ for (const group of [playable, list]) {
153
+ const fit = group.filter((room) => room.capacity && room.capacity >= count).sort(fitSort);
154
+ if (fit.length) {
155
+ return { ...fit[0], reason: `${count} 人,${fit[0].capacity} 人${label(fit[0])}可容纳` };
156
+ }
157
+ }
158
+ }
159
+ // 人数未知或超出所有房间容量:按最大间预留
160
+ const pool = playable.filter((room) => room.capacity).length
161
+ ? playable.filter((room) => room.capacity)
162
+ : list.filter((room) => room.capacity);
163
+ if (pool.length) {
164
+ const top = pool.sort(overSort)[0];
165
+ return {
166
+ ...top,
167
+ reason: count
168
+ ? `${count} 人超出可用${label(top)}上限(${top.capacity} 人),按最大间预留`
169
+ : `未给人数,按最大 ${top.capacity} 人预留`,
170
+ };
171
+ }
172
+ return { ...list[0], reason: '检索结果未标容量,取第一条' };
173
+ }
174
+ /** 候选输入里到底给了几条原始行(用于区分「没给」和「给了但解析不出」)。 */
175
+ function rawCandidateCount(input) {
176
+ return unwrapRoomRows(input).length;
177
+ }
178
+ /**
179
+ * 归一小餐厅预定信息。
180
+ * 返回 `null` 表示「没提这件事」——调用方据此整段不填。
181
+ */
182
+ export function normalizeRestaurant(options = {}) {
183
+ const data = options.data || {};
184
+ // answers 里可能直接把餐厅信息写成 data.restaurant(原始对象,没有 booked)。
185
+ // 这份必须当作 explicit 参与取值:否则用户指定的包厢、人数、用餐时间全被忽略,
186
+ // 只剩「按候选挑一间 + 默认 10 人」,表面成功、实际不是他点的那间。
187
+ // 已经带 booked 的是上一轮 CLI 产物,走 prev 沿用逻辑,不能再当入参读。
188
+ const rawRestaurant = (data.restaurant && typeof data.restaurant === 'object'
189
+ && !Array.isArray(data.restaurant) && data.restaurant.booked !== true)
190
+ ? data.restaurant
191
+ : {};
192
+ const explicit = {
193
+ ...rawRestaurant,
194
+ ...((options.explicit && typeof options.explicit === 'object') ? options.explicit : {}),
195
+ };
196
+ const rooms = options.rooms ?? null;
197
+ const hay = [data.restaurantRaw, data.logisticsRaw, data.meal, explicit.raw, explicit.note]
198
+ .filter(Boolean).join(' ');
199
+ // 触发只看「用户说过没有」:光有检索候选不算,否则没提小餐厅也会被填进去
200
+ const mentioned = Boolean(data.restaurant)
201
+ || data.restaurantIntent === true
202
+ || Object.keys(explicit).length > 0
203
+ || TRIGGER.test(hay);
204
+ if (!mentioned)
205
+ return null;
206
+ // 人数:用户明确给 > 来访人数(区间取上界)> 10。
207
+ // 不拿「客户 + 陪同」凑数:客户人数没给时那样只会得到 1~2 人,
208
+ // 订出来的包厢装不下整桌人(实测出现过「1 人订 8 人包厢」)。
209
+ // 缺省 10 是业务确认过的口径,宁可多留也不能少留。
210
+ const visit = Number(data.headcountMax || data.headcount || 0) || 0;
211
+ const headcount = Number(explicit.headcount || data.restaurantHeadcount || visit || 10) || 10;
212
+ const baseDate = pickStr(explicit.startDate || data.visitDate || '');
213
+ // 时段:说了具体时间就用它;否则按「中午/晚上」落档,都没提按晚上
214
+ const noon = /中午|午餐|午宴|午饭/.test(hay);
215
+ const evening = /晚上|晚宴|晚餐|夜里|今晚/.test(hay);
216
+ const inText = timesIn(hay);
217
+ const textTime = pickStr(inText[0]);
218
+ const explicitStart = pickStr(explicit.startTime);
219
+ const duration = Number(explicit.durationMinutes || RESTAURANT_DETAIL.defaultDurationMinutes) || 90;
220
+ const startTime = explicitStart || textTime || (noon ? '11:30' : '18:00');
221
+ const endTime = pickStr(explicit.endTime)
222
+ || ((explicitStart || textTime) ? hhmmPlus(startTime, duration) : (noon ? '13:30' : '21:00'));
223
+ const mealPeriod = noon ? '中午' : (evening ? '晚上' : '晚上');
224
+ let endDate = pickStr(explicit.endDate) || baseDate;
225
+ // 跨零点:结束时间不晚于开始时间,日期顺延一天
226
+ if (!pickStr(explicit.endDate) && endTime <= startTime && endDate)
227
+ endDate = nextDay(endDate);
228
+ const explicitRoom = pickStr(explicit.roomNo || explicit.room || explicit.roomName);
229
+ const candidates = normalizeRoomCandidates(rooms || []);
230
+ const prev = (data.restaurant && typeof data.restaurant === 'object') ? data.restaurant : null;
231
+ const picked = explicitRoom
232
+ ? { name: explicitRoom, capacity: 0, reason: '按指定包厢' }
233
+ // 重跑 render 时没再给候选(比如只传了新的 answers),沿用上一轮已定好的包厢
234
+ : (pickRestaurantRoom(candidates, headcount)
235
+ || (prev && prev.roomNo
236
+ ? { name: prev.roomNo, capacity: prev.roomCapacity || 0, reason: prev.roomReason || '沿用上一轮结果' }
237
+ : null));
238
+ // 三种状态分开报,用户才知道是系统问题还是业务问题
239
+ const rawCount = rawCandidateCount(rooms);
240
+ const roomState = picked
241
+ ? ((picked.capacity && headcount > picked.capacity) ? 'overflow' : 'ok')
242
+ : (rawCount ? 'candidates-unparsed' : 'no-candidates');
243
+ return {
244
+ booked: true,
245
+ roomNo: picked ? picked.name : '',
246
+ roomState,
247
+ roomCapacity: picked && picked.capacity ? picked.capacity : 0,
248
+ roomReason: picked
249
+ ? picked.reason
250
+ : (rawCount ? `给了 ${rawCount} 条候选但认不出包厢名/容量(检查字段映射)` : '缺包厢号:没拿到可用包厢清单'),
251
+ headcount,
252
+ startDate: baseDate,
253
+ startTime,
254
+ endDate,
255
+ endTime,
256
+ mealPeriod,
257
+ // 候选清单只留名字与容量,用于「订不上时把可选项告诉用户」
258
+ candidates: (candidates.length
259
+ ? candidates
260
+ : ((prev && Array.isArray(prev.candidates)) ? prev.candidates : []))
261
+ .slice(0, 20).map((room) => ({ name: room.name, capacity: room.capacity })),
262
+ raw: pickStr(hay).slice(0, 200),
263
+ };
264
+ }
@@ -0,0 +1,42 @@
1
+ import { writeFileSync, mkdirSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ /**
4
+ * reception.restaurantRooms —— 只读查「小食堂包厢」,产出可直接喂给
5
+ * `doc-render --restaurant-rooms-file` 的候选清单。
6
+ *
7
+ * 为什么单独一条命令:包厢是建模表单业务数据,模型自己拼 ds 命令容易错参数;
8
+ * 固化成命令后,SKILL.md 里只写「跑这一条」,不写接口细节。
9
+ */
10
+ export async function restaurantRooms(input, ctx) {
11
+ const startedAt = Date.now();
12
+ // 走 host:鉴权与数据集权限上下文由它在内部处理,业务层拿不到凭据
13
+ const result = await ctx.host.fetchRestaurantRooms({
14
+ pageSize: Number(input.pageSize) || undefined,
15
+ timeoutMs: Number(input.timeoutMs) || undefined,
16
+ });
17
+ // --out 直接落盘:模型再读一次文件等于多付一次工具往返
18
+ let file = '';
19
+ if (input.out) {
20
+ const target = resolve(String(input.out));
21
+ mkdirSync(dirname(target), { recursive: true });
22
+ writeFileSync(target, JSON.stringify({ rooms: result.rooms, source: 'e10-ds', fetchedAt: new Date().toISOString() }, null, 2), 'utf8');
23
+ file = target.replace(/\\/gu, '/');
24
+ }
25
+ return {
26
+ state: 'rooms',
27
+ ok: true,
28
+ data: {
29
+ rooms: result.rooms,
30
+ total: result.total,
31
+ rawCount: result.rawCount,
32
+ file,
33
+ /** 超出所有包厢容量时,提示行政区另找场地 */
34
+ maxCapacity: result.rooms.reduce((max, room) => Math.max(max, room.capacity || 0), 0),
35
+ timings: { totalMs: Date.now() - startedAt },
36
+ },
37
+ warnings: result.rooms.length ? [] : ['「小食堂包厢」未返回可用房间:检查数据集权限或上海区域数据'],
38
+ };
39
+ }
40
+ export const restaurantRoomsOperation = {
41
+ execute: (input, ctx) => restaurantRooms(input, ctx),
42
+ };
@@ -1,3 +1,4 @@
1
+ import { normalizeMeeting, normalizeMeetingRoom } from './leads.js';
1
2
  import { nameList } from './shared.js';
2
3
  /**
3
4
  * 日程明细口径:四种来源(scheduleRows / schedule / agenda / 标准议程兜底)+ 7 列按字段 ID 映射。
@@ -82,7 +83,12 @@ export function normalizeScheduleRows(data = {}) {
82
83
  if (!rows.length) {
83
84
  const date = data.visitDate || data.arrivalDate || '';
84
85
  const start = /^\d{1,2}:\d{2}$/.test(String(data.agendaStart || '')) ? String(data.agendaStart) : '09:30';
85
- const room = data.meetingRoom || '总部129/130/131会议室(按人数择一)';
86
+ // 地点列只写一个确定的场地:没开会就写总部,绝不再写「三选一」——
87
+ // 方案里出现「按人数择一」会让人以为还没定场地。
88
+ const venue = String(data.venue || '泛微上海总部');
89
+ const room = normalizeMeeting(data.meeting) === '是'
90
+ ? (normalizeMeetingRoom(data.meetingRoom) || venue)
91
+ : venue;
86
92
  for (const item of STANDARD_AGENDA) {
87
93
  push(pick7({
88
94
  date,
@@ -16,18 +16,23 @@
16
16
  import { createHash } from 'node:crypto';
17
17
  import { readFile, stat } from 'node:fs/promises';
18
18
  import { basename } from 'node:path';
19
- /** 上传协议层错误:`subtype` 直接进 CLI 的 error.subtype,便于按码排障。 */
20
19
  export class UploadProtocolError extends Error {
21
20
  subtype;
22
21
  httpStatus;
23
22
  detail;
24
23
  contentType;
25
- constructor(subtype, message, httpStatus, detail, contentType) {
24
+ failedAt;
25
+ request;
26
+ constructor(subtype, message, httpStatus, detail, contentType,
27
+ /** 失败发生在哪一阶段:teamsCheck / preUploadCheck / moduleUpload */
28
+ failedAt, request) {
26
29
  super(message);
27
30
  this.subtype = subtype;
28
31
  this.httpStatus = httpStatus;
29
32
  this.detail = detail;
30
33
  this.contentType = contentType;
34
+ this.failedAt = failedAt;
35
+ this.request = request;
31
36
  this.name = 'UploadProtocolError';
32
37
  }
33
38
  }
@@ -127,14 +132,25 @@ function terminal(data, expectedSize) {
127
132
  return record.id;
128
133
  }
129
134
  /** 发一次 multipart 并判定成功,返回 data 节点。 */
130
- async function send(transport, path, fields, file) {
135
+ async function send(transport, path, fields, file,
136
+ /** 失败时回填到错误里,便于定位是哪一阶段挂的 */
137
+ stage) {
131
138
  const form = new FormData();
132
139
  for (const [key, value] of Object.entries(fields))
133
140
  form.append(key, value);
134
141
  if (file) {
135
142
  form.append('file', new Blob([new Uint8Array(file.buffer.subarray(file.start, file.start + file.size))]), `e10upload.${file.ext}`);
136
143
  }
137
- return checkedData(await transport.post(path, form));
144
+ try {
145
+ return checkedData(await transport.post(path, form));
146
+ }
147
+ catch (error) {
148
+ if (error instanceof UploadProtocolError) {
149
+ // 只补「哪一步、打到哪」,请求头与凭据状态由 host 层填(它才知道实际注入了什么)
150
+ throw new UploadProtocolError(error.subtype, error.message, error.httpStatus, error.detail, error.contentType, stage, { method: 'POST', path, headers: [], auth: {} });
151
+ }
152
+ throw error;
153
+ }
138
154
  }
139
155
  /**
140
156
  * 走完三阶段上传,返回 fileid。
@@ -186,7 +202,7 @@ export async function uploadToFileService(input) {
186
202
  if (type === 'common') {
187
203
  const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', uploadFields, {
188
204
  name, ext, buffer, start: 0, size: buffer.length,
189
- });
205
+ }, 'moduleUpload');
190
206
  return { fileid: terminal(data, buffer.length), name, size: buffer.length, kind: ext };
191
207
  }
192
208
  // 5) 分片:按服务端给的 MiB 大小切片,逐片上报
@@ -203,7 +219,7 @@ export async function uploadToFileService(input) {
203
219
  for (let index = 0; index < count; index += 1) {
204
220
  const start = index * chunkSize;
205
221
  const size = Math.min(chunkSize, buffer.length - start);
206
- const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', { ...uploadFields, chunk: String(index), chunks: String(count), uploadShardSize: String(size) }, { name, ext, buffer, start, size });
222
+ const data = await send(input.transport, '/api/file/module/upload?sf_request_type=ajax', { ...uploadFields, chunk: String(index), chunks: String(count), uploadShardSize: String(size) }, { name, ext, buffer, start, size }, 'moduleUpload');
207
223
  if (index === count - 1) {
208
224
  fileid = terminal(data, buffer.length);
209
225
  }
@@ -22,7 +22,7 @@
22
22
  import { randomUUID } from 'node:crypto';
23
23
  import { rsSuccess, schemaOf } from './types.js';
24
24
  import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
25
- import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, findMenuNode, resolveCurrentUser, buildCardUrl, buildListUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
25
+ import { objIdOf, formIdOf, getFormLayout, getFormLayoutMeta, saveFormData, runEsb, getFormButtons, resolvePersonId, getDsOptions, getDsOptionsFull, findMenuNode, resolveCurrentUser, buildCardUrl, talentLinkExtra, pickSaveButtonActions, computeRequiredHint, randHex32, talentUiCardUrl, resolveInterviewListUrlOrNative, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
26
26
  // 面试计划表单字段 dataKey(缓存 fields 里取)。
27
27
  // 注意:digital_id 不放入此列表——它只在「面试方式含 AI」时才是必填,
28
28
  // 放进来会让未部署数字人的环境连非 AI 面试都建不了(单独按需校验)。
@@ -266,9 +266,14 @@ async function buildPlan(opts) {
266
266
  getDsOptions(host, objId, fid('interview_type')),
267
267
  getDsOptions(host, objId, fid('interview_session')),
268
268
  ]);
269
- const typeId = typeMap[type];
270
- if (!typeId)
271
- throw rsFail('面试方式「' + type + '」不在枚举中(' + Object.keys(typeMap).join('/') + ')');
269
+ const typeFull = await getDsOptionsFull(host, objId, fid('interview_type'));
270
+ const typeId = typeFull.map[type];
271
+ if (!typeId) {
272
+ if (typeFull.disabled.some(function (d) { return d.name === type; })) {
273
+ throw rsFail('面试方式「' + type + '」已禁用(该枚举项 archive=1),请改用其它面试方式');
274
+ }
275
+ throw rsFail('面试方式「' + type + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
276
+ }
272
277
  const sessionId = sessionMap[session];
273
278
  if (!sessionId)
274
279
  throw rsFail('面试轮次「' + session + '」不在枚举中(' + Object.keys(sessionMap).join('/') + ')');
@@ -507,8 +512,14 @@ async function resolveRequiredHint(plan, ctx) {
507
512
  dataDetails: plan.dataDetails,
508
513
  });
509
514
  }
510
- // 人才卡片详情 URL(EB 详情页):{baseUrl}/sp/ebdpage/view/{ebdDetailPageId}?talentId={id}
511
- function resolveTalentCardUrl(ctx, talentId) {
515
+ // 人才卡片详情 URL:装了人才库 ecode 页面就用新卡片页,否则回退 EB 详情页
516
+ // {baseUrl}/sp/ebdpage/view/{ebdDetailPageId}?talentId={id}(2026-11-10 用户要求改指向新页面)
517
+ async function resolveTalentCardUrl(ctx, talentId) {
518
+ if (talentId) {
519
+ const ui = await talentUiCardUrl(ctx.host, ctx.cache, ctx.baseUrl, String(talentId));
520
+ if (ui)
521
+ return ui;
522
+ }
512
523
  const pid = ctx.cache.ebdDetailPageId;
513
524
  if (!pid || !talentId) {
514
525
  // 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
@@ -753,7 +764,8 @@ async function applyCore(args, env, payload) {
753
764
  const verifyWarnings = verification.mismatches.map((m) => '落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual + '(该字段可能未写入)');
754
765
  const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
755
766
  // 列表链接只打开列表;详情单页由 viewLink 单独给出,不再用「列表+滑出详情」组合地址。
756
- const listLocateUrl = buildListUrl(ctx.baseUrl, (ctx.cache.lists?.interview?.listId) || '');
767
+ // 2026-11-10 用户定稿:装了人才库 ecode 页面就指向新的「面试进展」页,否则回退原生面试台账列表。
768
+ const listLocateUrl = await resolveInterviewListUrlOrNative(ctx.host, ctx.cache, ctx.baseUrl, (ctx.cache.lists?.interview?.listId) || '');
757
769
  return rsSuccess('recruit-stage.interview.arrange.apply', {
758
770
  mode: 'apply', result: verification.mismatches.length ? 'partial' : 'success', interviewFormId: formDataId,
759
771
  interviewCardUrl: detailUrl,
@@ -786,11 +798,15 @@ async function prefill(args, env) {
786
798
  const typeFid = fields.interview_type;
787
799
  if (!typeFid)
788
800
  throw rsFail('面试计划缺少字段 interview_type(ds/fields 解析不到)');
789
- const typeMap = await getDsOptions(ctx.host, objId, typeFid);
790
- const typeId = typeMap[typeKey];
791
- if (!typeId)
792
- throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeMap).join('/') + ')');
793
- const cardUrl = resolveTalentCardUrl(ctx, talentId);
801
+ const typeFull = await getDsOptionsFull(ctx.host, objId, typeFid);
802
+ const typeId = typeFull.map[typeKey];
803
+ if (!typeId) {
804
+ if (typeFull.disabled.some(function (d) { return d.name === typeKey; })) {
805
+ throw rsFail('面试方式「' + typeKey + '」已禁用(该枚举项 archive=1),请改用其它面试方式');
806
+ }
807
+ throw rsFail('面试方式「' + typeKey + '」不在枚举中(' + Object.keys(typeFull.map).join('/') + ')');
808
+ }
809
+ const cardUrl = await resolveTalentCardUrl(ctx, talentId);
794
810
  const listUrl = await resolveInterviewListUrl(ctx).catch(() => null);
795
811
  const jsExpr = `(() => { const W = window.WeFormSDK; const i = W && W.getWeFormInstance('ebuilderform', '${formId}');`
796
812
  + ` if (!i) return 'no-form-instance(请先在人才卡片点「安排面试」打开面试安排表单)';`