weaver-work-cli 0.1.69 → 0.1.71

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 (232) hide show
  1. package/dist/chunks/{archive-VUTREF3P.js → archive-5P33NAUN.js} +22 -5
  2. package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
  3. package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
  4. package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
  5. package/dist/chunks/{attachment-content-7BEDNQ3O.js → attachment-content-7CN7JB6B.js} +3 -3
  6. package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
  7. package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
  8. package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
  9. package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
  10. package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
  11. package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
  12. package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
  13. package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
  14. package/dist/chunks/{chunk-3TZURS7M.js → chunk-EJLP63UO.js} +1 -1
  15. package/dist/chunks/{chunk-FMAZ42HS.js → chunk-FRMDHZSN.js} +11 -11
  16. package/dist/chunks/{chunk-MLJK4KLE.js → chunk-G7ZM2VOX.js} +34 -34
  17. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
  18. package/dist/chunks/{chunk-3CBURKSY.js → chunk-ICNUOWLL.js} +4 -4
  19. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  20. package/dist/chunks/{chunk-BEYEXCWU.js → chunk-LU2SPJYY.js} +2 -2
  21. package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
  22. package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
  23. package/dist/chunks/{chunk-67AN5YJT.js → chunk-OFCF23FY.js} +9 -9
  24. package/dist/chunks/{chunk-ERAE4GHX.js → chunk-OPTJ6IF7.js} +1 -1
  25. package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
  26. package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
  27. package/dist/chunks/{chunk-4XYRTXRR.js → chunk-Q3EXRNB4.js} +1 -1
  28. package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
  29. package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
  30. package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
  31. package/dist/chunks/{chunk-YR3K53BU.js → chunk-VJWVB55R.js} +2 -2
  32. package/dist/chunks/{chunk-JAIZY37Z.js → chunk-VMVMEIL3.js} +4 -4
  33. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  34. package/dist/chunks/{chunk-6DH73Q5H.js → chunk-X2C5CGGM.js} +52 -51
  35. package/dist/chunks/{chunk-ELF5TPSG.js → chunk-XLSJC6JZ.js} +6 -6
  36. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
  37. package/dist/chunks/{conflict-VKCRXHUV.js → conflict-Y4PXZ2YQ.js} +2 -2
  38. package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
  39. package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
  40. package/dist/chunks/{create-flow-WYPLBLRK.js → create-flow-LOUOK46Z.js} +6 -6
  41. package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
  42. package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
  43. package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
  44. package/dist/chunks/{entry-mode-BCJ7RPFC.js → entry-mode-6N2IGCS4.js} +3 -3
  45. package/dist/chunks/{env-SCVCHBN2.js → env-QYLS3EB3.js} +2 -2
  46. package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
  47. package/dist/chunks/{factory-CBXYOEBF.js → factory-LPFPKZ4T.js} +1 -1
  48. package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
  49. package/dist/chunks/{group-chat-RFL4U7RF.js → group-chat-QP2WX4QJ.js} +3 -3
  50. package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
  51. package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
  52. package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
  53. package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
  54. package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
  55. package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
  56. package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
  57. package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
  58. package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
  59. package/dist/chunks/{jiuchuanhui-PY2WEBUH.js → jiuchuanhui-PTABJE7V.js} +1294 -1134
  60. package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
  61. package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
  62. package/dist/chunks/{meeting-N2AGGLVI.js → meeting-NIDHDBCB.js} +29 -16
  63. package/dist/chunks/{minute-doc-C62EZOJH.js → minute-doc-G3QAT7DE.js} +4 -4
  64. package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
  65. package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
  66. package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
  67. package/dist/chunks/{performance-GBKM5G2Y.js → performance-3MQ3AHDQ.js} +97 -11
  68. package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
  69. package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
  70. package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
  71. package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
  72. package/dist/chunks/{registry-7US3QQXV.js → registry-3GQRYP2R.js} +12 -12
  73. package/dist/chunks/{registry-Y2HWS6JS.js → registry-3S7AVMXR.js} +4 -4
  74. package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
  75. package/dist/chunks/{room-recommend-LMNF76YS.js → room-recommend-IOKBJVYP.js} +4 -4
  76. package/dist/chunks/{schedule-4QE2THAP.js → schedule-IB6EUARH.js} +4 -4
  77. package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
  78. package/dist/chunks/{workflow-KXYTQZ2H.js → workflow-RINBAL2M.js} +22 -8
  79. package/dist/cmd/auth/index.js +23 -0
  80. package/dist/cmd/e10/index.js +2 -1
  81. package/dist/cmd/index.js +2 -0
  82. package/dist/core/manifest-view.js +207 -0
  83. package/dist/core/output.js +38 -8
  84. package/dist/index.js +35 -35
  85. package/dist/internal/e10/auth/crypto.js +18 -8
  86. package/dist/internal/e10/auth/error-log.js +1 -2
  87. package/dist/internal/e10/auth/messages.js +2 -3
  88. package/dist/internal/e10/auth/xiaoe.js +1 -1
  89. package/dist/internal/e10/tls-policy.js +61 -13
  90. package/dist/shortcuts/archive/index.js +11 -2
  91. package/dist/shortcuts/archive/operations/download.js +1 -0
  92. package/dist/shortcuts/archive/operations/flow-url.js +3 -0
  93. package/dist/shortcuts/archive/operations/prelib.js +2 -0
  94. package/dist/shortcuts/archive/operations/upload.js +1 -0
  95. package/dist/shortcuts/archive-oa/index.js +11 -2
  96. package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
  97. package/dist/shortcuts/asset/index.js +11 -2
  98. package/dist/shortcuts/asset/manifest.js +7 -0
  99. package/dist/shortcuts/asset-idle/index.js +11 -2
  100. package/dist/shortcuts/blog/index.js +11 -2
  101. package/dist/shortcuts/blog/manifest.js +10 -0
  102. package/dist/shortcuts/caizhilian/host.js +20 -4
  103. package/dist/shortcuts/caizhilian/index.js +12 -2
  104. package/dist/shortcuts/caizhilian/manifest.js +4 -25
  105. package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
  106. package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
  107. package/dist/shortcuts/calendar/index.js +11 -2
  108. package/dist/shortcuts/contract/index.js +11 -2
  109. package/dist/shortcuts/contract/manifest.js +32 -0
  110. package/dist/shortcuts/contract/operations/write.js +3 -0
  111. package/dist/shortcuts/cowork/index.js +21 -5
  112. package/dist/shortcuts/cowork/manifest.js +3 -0
  113. package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
  114. package/dist/shortcuts/cowork/operations/item-write.js +3 -0
  115. package/dist/shortcuts/cowork/operations/member-write.js +2 -0
  116. package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
  117. package/dist/shortcuts/cowork/operations/review-write.js +1 -0
  118. package/dist/shortcuts/data/errors.js +16 -29
  119. package/dist/shortcuts/data/host.js +16 -7
  120. package/dist/shortcuts/data/index.js +12 -41
  121. package/dist/shortcuts/data/manifest.js +5 -44
  122. package/dist/shortcuts/data/operations/attend.js +2 -2
  123. package/dist/shortcuts/data/operations/conf.js +0 -88
  124. package/dist/shortcuts/data/operations/ds.js +4 -4
  125. package/dist/shortcuts/data/operations/index.js +1 -5
  126. package/dist/shortcuts/data/operations/module.js +40 -14
  127. package/dist/shortcuts/data/operations/query.js +2 -2
  128. package/dist/shortcuts/ebuilder-form/index.js +11 -2
  129. package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
  130. package/dist/shortcuts/ehr/index.js +11 -2
  131. package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
  132. package/dist/shortcuts/esb/index.js +11 -2
  133. package/dist/shortcuts/esb/manifest.js +2 -0
  134. package/dist/shortcuts/fna/index.js +11 -2
  135. package/dist/shortcuts/hrm/index.js +11 -1
  136. package/dist/shortcuts/im/index.js +11 -2
  137. package/dist/shortcuts/invoice/index.js +11 -2
  138. package/dist/shortcuts/invoice/manifest.js +8 -0
  139. package/dist/shortcuts/jiuchuanhui/cache.js +49 -35
  140. package/dist/shortcuts/jiuchuanhui/host.js +37 -5
  141. package/dist/shortcuts/jiuchuanhui/index.js +57 -7
  142. package/dist/shortcuts/jiuchuanhui/manifest.js +38 -1
  143. package/dist/shortcuts/jiuchuanhui/operations/customer-quick.js +110 -0
  144. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +11 -56
  145. package/dist/shortcuts/jiuchuanhui/operations/esb.js +9 -16
  146. package/dist/shortcuts/jiuchuanhui/operations/generic.js +8 -30
  147. package/dist/shortcuts/jiuchuanhui/operations/registry.js +8 -2
  148. package/dist/shortcuts/jiuchuanhui/operations/shared.js +0 -10
  149. package/dist/shortcuts/mail/errors.js +14 -0
  150. package/dist/shortcuts/mail/index.js +23 -6
  151. package/dist/shortcuts/mail/manifest.js +11 -4
  152. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  153. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  154. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  155. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  156. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  157. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  158. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  159. package/dist/shortcuts/meeting/index.js +11 -2
  160. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  161. package/dist/shortcuts/okr/index.js +11 -2
  162. package/dist/shortcuts/performance/index.js +62 -3
  163. package/dist/shortcuts/performance/operations/flow-detail.js +5 -4
  164. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  165. package/dist/shortcuts/performance/shared.js +40 -2
  166. package/dist/shortcuts/plan/index.js +11 -2
  167. package/dist/shortcuts/project/index.js +11 -2
  168. package/dist/shortcuts/project/operations/write.js +3 -0
  169. package/dist/shortcuts/reception/index.js +11 -2
  170. package/dist/shortcuts/reception/manifest.js +2 -2
  171. package/dist/shortcuts/reception/operations/ask.js +3 -0
  172. package/dist/shortcuts/recruit-stage/index.js +22 -3
  173. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  174. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
  175. package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
  176. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  177. package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
  178. package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
  179. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  180. package/dist/shortcuts/recruit-stage/shared.js +11 -1
  181. package/dist/shortcuts/smart-extract/index.js +11 -2
  182. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  183. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  184. package/dist/shortcuts/workflow/index.js +21 -1
  185. package/dist/shortcuts/workflow/operations/aiDeepRead/collect.js +5 -2
  186. package/dist/shortcuts/workflow/operations/read.js +2 -2
  187. package/dist/shortcuts/workflow/operations/write.js +1 -1
  188. package/docs/caizhilian.md +1 -1
  189. package/docs/contract.md +1 -0
  190. package/docs/data.md +22 -22
  191. package/docs/e10-auth.md +41 -33
  192. package/docs/ehr.md +2 -0
  193. package/docs/jiuchuanhui.md +17 -5
  194. package/docs/reception.md +4 -3
  195. package/package.json +1 -1
  196. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  197. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  198. package/scripts/pysite/sitecustomize.py +41 -0
  199. package/skill-template/domains/data.md +4 -4
  200. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  201. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  202. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  203. package/skills/weaver-e10-data/SKILL.md +12 -16
  204. package/skills/weaver-e10-data/references/config-center.md +6 -7
  205. package/skills/weaver-e10-data/references/datasource.md +1 -1
  206. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  207. package/skills/weaver-e10-jiuchuanhui/SKILL.md +51 -90
  208. package/skills/weaver-e10-jiuchuanhui/references/cache.md +17 -13
  209. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  210. package/skills/weaver-e10-jiuchuanhui/references/customer.md +49 -11
  211. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +3 -3
  212. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +9 -7
  213. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  214. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  215. package/skills/weaver-e10-mail/SKILL.md +4 -1
  216. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  217. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  218. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  219. package/skills/weaver-e10-performance/SKILL.md +9 -7
  220. package/skills/weaver-e10-performance/agents/openai.yaml +4 -2
  221. package/skills/weaver-e10-performance/references/flow-assess.md +19 -6
  222. package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
  223. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
  224. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  225. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
  226. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
  227. package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
  228. package/skills/weaver-e10-shared/SKILL.md +22 -1
  229. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  230. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  231. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +8 -3
  232. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -23,7 +23,7 @@ import schoolTiers from '../school-tiers.json';
23
23
  import { rsSuccess, schemaOf } from './types.js';
24
24
  import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
25
25
  import { objIdOf, formIdOf, saveFormData, getFormLayoutMeta, runSaveButtonEsbActions, getTableMapping, invertTableMapping, datasetSaveFormData, datasetUpdateFormData, checkUnique, getCandidateByPhone, buildCardUrl, buildTalentViewUrl, talentLinkExtra, talentUiCardUrl, resolveTalentListUrl, findMenuNode, randHex32, getDsOptions, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
26
- import { resolveTags, addEntityTags, queryEntityTags } from '../tag-lookup.js';
26
+ import { addEntityTags, queryEntityTags } from '../tag-lookup.js';
27
27
  import { scanResumeSource } from '../fs-scan.js';
28
28
  import { saveBatchItems, loadBatchItems, saveOcrResult, loadOcrResult } from '../batch-store.js';
29
29
  // 阶段耗时打点(诊断用,不影响业务):E10_TRACE_MS=1 时把每段耗时打到 stderr
@@ -124,6 +124,31 @@ function snapshotParsedResume(s) {
124
124
  return undefined;
125
125
  }
126
126
  }
127
+ /**
128
+ * 🔴 built 签入 continuation 的大小闸门(2026-11-27 加固)。
129
+ * built 含 dataDetails / detailsPayload / fields / subMeta,明细行多时体积可观。
130
+ * continuation 最终可能走命令行参数(直调 CLI 的 `--input-json` 内联形态),
131
+ * Windows cmd 单命令上限 8191 字符,超限会被**静默截断** → apply 报 continuation_invalid,
132
+ * 且现象与「PowerShell 损坏 token」完全一样,极难排查。
133
+ * 走 helper 脚本(文件传参)没有这个限制,但不能假设调用方一定用 helper。
134
+ * 因此超过阈值就不签入:apply 自动回退到 buildImport(多花几个请求,但保证可用)。
135
+ * structured 已在 parsedResume 里单独签入,这里排除以免重复占体积。
136
+ */
137
+ const BUILT_SNAPSHOT_LIMIT = 48 * 1024;
138
+ function snapshotBuilt(built) {
139
+ if (!built || typeof built !== 'object')
140
+ return undefined;
141
+ try {
142
+ const { structured: _omit, ...rest } = built;
143
+ const raw = JSON.stringify(rest);
144
+ if (raw.length > BUILT_SNAPSHOT_LIMIT)
145
+ return undefined;
146
+ return rest;
147
+ }
148
+ catch {
149
+ return undefined;
150
+ }
151
+ }
127
152
  // 闸门:简历抽取功能是否开启(幂等只读;与上传并发发起,先落闸门再解析)
128
153
  async function checkExtractionGate(host) {
129
154
  const b = await host.request({ path: '/api/recruit/ocr/checkResumeExtraction', method: 'POST', body: {} });
@@ -850,6 +875,9 @@ async function prepare(args, env, opts = {}) {
850
875
  const fp = fingerprint(willSubmit);
851
876
  const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp,
852
877
  enumMaps: await dsOptionsSnapshot(),
878
+ // 🔴 2026-11-27 优化:签入已解析的 built(不含 structured,已在 parsedResume 里),
879
+ // apply 直接复用,跳过 buildImport(省 ~6 HTTP)和 findExistingTalents(省 2 HTTP)。
880
+ built: snapshotBuilt(built),
853
881
  // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
854
882
  // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
855
883
  // 否则会报 resume_source_required(文档写法跑不通)。
@@ -889,25 +917,14 @@ async function prepare(args, env, opts = {}) {
889
917
  },
890
918
  }, { continuation, fingerprint: fp, confirmHint: '用户明确确认后,携带 confirm:true 与 continuation 调用 apply' });
891
919
  }
892
- // 查重与标签预检互不依赖 → 并行(标签清单分页通常多 RTT,与查重力求重叠)。
893
- // tagCheckTask 内部自带 try/catch,永不 reject,避免查重先抛错时产生 unhandledRejection。
894
- const tagCheckTask = (async () => {
895
- if (!built.tagNames.length)
896
- return null;
897
- try {
898
- const rt = await resolveTags(ctx.host, built.tagNames);
899
- return { requested: built.tagNames, found: rt.found, missing: rt.missing, ...(typeof rt.availableCount === 'number' ? { availableCount: rt.availableCount } : {}) };
900
- }
901
- catch (e) {
902
- return { requested: built.tagNames, error: e.message };
903
- }
904
- })();
905
- mark('prepare.查重建档并行前');
906
- const [dupInfo, tagCheck] = await Promise.all([
907
- findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone }),
908
- tagCheckTask,
909
- ]);
910
- mark('prepare.查重+标签预检');
920
+ // 🔴 2026-11-27 优化:跳过标签预检(省 2-5 HTTP)。
921
+ // 标签在 apply 时由 addEntityTags 自动解析并写入,prepare 预检只给确认摘要显示 found/missing,
922
+ // 不影响功能正确性。学校标签由 schoolTagInfo 本地推导,不需要 HTTP。
923
+ const dupInfo = await findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone });
924
+ const tagCheck = built.tagNames.length
925
+ ? { requested: built.tagNames, note: '标签将在提交时自动解析并写入' }
926
+ : null;
927
+ mark('prepare.查重完成');
911
928
  const summary = {
912
929
  action: '简历导入建人才',
913
930
  resumeFile: built.fileName || ('fileid=' + built.fileid),
@@ -1015,8 +1032,17 @@ async function applyCore(args, env, payload) {
1015
1032
  ctx.appId = ctx.cache.appId;
1016
1033
  mark('apply.context');
1017
1034
  const argsT = args;
1018
- const built = await buildImport(ctx, argsT);
1019
- mark('apply.buildImport 完成');
1035
+ // 🔴 2026-11-27 优化:prepare 签入了已解析的 built,apply 直接复用,
1036
+ // 跳过 buildImport(省 ~6 HTTP)和 findExistingTalents(省 2 HTTP,prepare 已查重)
1037
+ let built;
1038
+ if (payload.built && (argsT.parsedResume || payload.built.structured)) {
1039
+ built = { ...payload.built, structured: argsT.parsedResume || payload.built.structured };
1040
+ mark('apply.复用prepare的built(跳过buildImport+查重)');
1041
+ }
1042
+ else {
1043
+ built = await buildImport(ctx, argsT);
1044
+ mark('apply.buildImport 完成');
1045
+ }
1020
1046
  // 更新模式
1021
1047
  if (argsT.updateTalentId) {
1022
1048
  const updateTalentId = String(argsT.updateTalentId);
@@ -1073,31 +1099,34 @@ async function applyCore(args, env, payload) {
1073
1099
  });
1074
1100
  }
1075
1101
  // 新建模式:查重阻断
1076
- const dupInfo = await findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone });
1077
- if (dupInfo.byPhone?.candidateId || dupInfo.byPhone?.talentId) {
1078
- const b = dupInfo.byPhone;
1079
- return rsSuccess('recruit-stage.resume.import.apply', {
1080
- mode: 'apply', result: 'duplicate',
1081
- message: '当前手机号已绑定人才信息,按页面规则不新建(未写入任何数据)',
1082
- existingTalent: { talentId: b.talentId, candidateId: b.candidateId, talentViewUrl: b.talentViewUrl, talentCardUrl: b.talentCardUrl },
1083
- talentViewUrl: b.talentViewUrl,
1084
- otherRecords: dupInfo.formConflicts.existing.length ? dupInfo.formConflicts.existing : undefined,
1085
- parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
1086
- nextStep: '如需按这份简历更新该人才,明确说明即可(updateTalentId 走更新通道)',
1087
- });
1088
- }
1089
- if (dupInfo.formConflicts.existing.length) {
1090
- return rsSuccess('recruit-stage.resume.import.apply', {
1091
- mode: 'apply', result: 'duplicate',
1092
- message: '手机号在人才库已存在(表单唯一性命中,但无应聘批次),不新建(未写入任何数据)',
1093
- formConflicts: dupInfo.formConflicts.existing,
1094
- parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
1095
- nextStep: '如需按这份简历更新该人才,明确说明即可(updateTalentId 走更新通道)',
1096
- });
1097
- }
1098
- if (!dupInfo.unique && dupInfo.formConflicts.unreadable.length) {
1099
- throw rsFail('手机号被 ' + dupInfo.formConflicts.unreadable.length + ' 条已删除记录占用(平台唯一性校验仍拦新建,id=' + dupInfo.formConflicts.unreadable.join(',') + '):请先在回收站清理,或改为更新已有人才');
1100
- }
1102
+ // 🔴 2026-11-27 优化:prepare 已查重且 unique=true,payload.built 存在时跳过重复查重(省 2 HTTP)
1103
+ if (!payload.built) {
1104
+ const dupInfo = await findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone });
1105
+ if (dupInfo.byPhone?.candidateId || dupInfo.byPhone?.talentId) {
1106
+ const b = dupInfo.byPhone;
1107
+ return rsSuccess('recruit-stage.resume.import.apply', {
1108
+ mode: 'apply', result: 'duplicate',
1109
+ message: '当前手机号已绑定人才信息,按页面规则不新建(未写入任何数据)',
1110
+ existingTalent: { talentId: b.talentId, candidateId: b.candidateId, talentViewUrl: b.talentViewUrl, talentCardUrl: b.talentCardUrl },
1111
+ talentViewUrl: b.talentViewUrl,
1112
+ otherRecords: dupInfo.formConflicts.existing.length ? dupInfo.formConflicts.existing : undefined,
1113
+ parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
1114
+ nextStep: '如需按这份简历更新该人才,明确说明即可(updateTalentId 走更新通道)',
1115
+ });
1116
+ }
1117
+ if (dupInfo.formConflicts.existing.length) {
1118
+ return rsSuccess('recruit-stage.resume.import.apply', {
1119
+ mode: 'apply', result: 'duplicate',
1120
+ message: '手机号在人才库已存在(表单唯一性命中,但无应聘批次),不新建(未写入任何数据)',
1121
+ formConflicts: dupInfo.formConflicts.existing,
1122
+ parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
1123
+ nextStep: '如需按这份简历更新该人才,明确说明即可(updateTalentId 走更新通道)',
1124
+ });
1125
+ }
1126
+ if (!dupInfo.unique && dupInfo.formConflicts.unreadable.length) {
1127
+ throw rsFail('手机号被 ' + dupInfo.formConflicts.unreadable.length + ' 条已删除记录占用(平台唯一性校验仍拦新建,id=' + dupInfo.formConflicts.unreadable.join(',') + '):请先在回收站清理,或改为更新已有人才');
1128
+ }
1129
+ } // end if (!payload.built) — 跳过查重
1101
1130
  // 建人才:① 首选数据集通道(主表+明细一次写入);② 被拦时回退页面级主表 + 数据集 update 补明细
1102
1131
  mark('apply.查重完成');
1103
1132
  const datasetMain = toDatasetMainTable(built.dataDetails, built.fields);
@@ -50,6 +50,13 @@ async function resolvePureIds(host, ids) {
50
50
  }
51
51
  return map;
52
52
  }
53
+ /** pageSize 归一:默认 10,范围 1~200(服务端单页上限 200,超出会被静默截断且不报错)。 */
54
+ function clampPageSize(v) {
55
+ const n = Number(v);
56
+ if (!Number.isFinite(n) || n <= 0)
57
+ return 10;
58
+ return Math.min(200, Math.trunc(n));
59
+ }
53
60
  async function handler(args, env) {
54
61
  const host = env.host;
55
62
  const session = await host.getSession();
@@ -68,17 +75,60 @@ async function handler(args, env) {
68
75
  const mobileField = 'field_' + fields.telephone;
69
76
  const name = args.name ? String(args.name) : '';
70
77
  const mobile = args.mobile ? String(args.mobile) : '';
78
+ const keyword = args.keyword ? String(args.keyword) : '';
79
+ const createdAfter = args.createdAfter ? String(args.createdAfter) : '';
71
80
  const conds = {};
72
81
  if (name)
73
82
  conds[nameField] = [{ [nameField]: name, [nameField + '_condition_type']: 'like' }];
74
83
  if (mobile)
75
84
  conds[mobileField] = [{ [mobileField]: mobile, [mobileField + '_condition_type']: 'like' }];
85
+ // 🔴 2026-11-27 关键词跨字段搜索(已按 builder 指南修正方法):
86
+ // · `quickSearchFields` 的 key 必须是**列表已配置的快捷搜索字段 id**,不是任意自定义键;
87
+ // 实测传 `{searchKeyword:"投资"}` 完全无效(total=774291 全库),故不用该通道。
88
+ // · 走 `commonSearchFields` + 多字段 + `type:'or'`,字段清单见 KEYWORD_TEXT_FIELDS,
89
+ // 每项都经 `cache.fields[objId]` 校验存在才用(环境没有就跳过,不拼无效 fieldId)。
90
+ // · 操作符按 `getListSearch` 返回的 conditionType 第一项取,**不再一律 like**
91
+ // (guide-list.md §搜索便捷配置明确告诫)。
92
+ // · 关键词与 name/mobile 互斥:有关键词时忽略 name/mobile,跨多字段 or 匹配。
93
+ // · 组合搜索(keyword + tag)不支持同一请求内混用:commonSearchFields 只有一个 type,
94
+ // or/in 不能同存,需分两步搜。
95
+ let searchType = 'and';
96
+ let searchFields;
97
+ let searchNote;
98
+ if (keyword && !name && !mobile) {
99
+ searchType = 'or';
100
+ const meta = await resolveListSearchMeta(host, String(listId));
101
+ const used = [];
102
+ for (const dk of KEYWORD_TEXT_FIELDS) {
103
+ const fid = fields[dk];
104
+ if (!fid)
105
+ continue;
106
+ const bare = String(fid);
107
+ const mk = 'field_' + bare;
108
+ const op = meta.operators[bare] || 'like';
109
+ conds[mk] = [{ [mk]: keyword, [mk + '_condition_type']: op }];
110
+ used.push({ field: dk, label: meta.labels[bare] || dk, operator: op });
111
+ }
112
+ searchFields = used;
113
+ // 🔴 一个字段都没命中时不能静默返回全库:那会让调用方以为"搜到了很多人",
114
+ // 实际是条件为空。显式点名,由调用方决定是否改用 name/mobile 或检查环境字段。
115
+ if (!used.length) {
116
+ searchNote = '关键词搜索未定位到任何可用字段(环境缓存 fields 与目标字段清单无交集),本次未做关键词过滤,返回的是全库分页结果;请改用 name/mobile 精确搜索';
117
+ }
118
+ }
119
+ // 🔴 2026-11-27 实测修正:`create_time` 是**系统字段**,不在表单 fields 映射里,
120
+ // 服务端 commonSearchFields 对它完全无效——实测单传 createdAfter 时 total=774293(=全库),
121
+ // 与不传时逐字相同;原实现回退拼出的 'field_create_time' 是无效标记,被服务端静默忽略。
122
+ // 这类"条件被吞但不报错"最危险:调用方以为筛过时间,实际拿到全时段数据。
123
+ // 改为**客户端按返回行的 createTime 过滤**,并在有该条件时放大取数量,避免筛后不足。
124
+ const wantPageSize = clampPageSize(args.pageSize);
125
+ const fetchPageSize = createdAfter ? Math.min(200, Math.max(wantPageSize * 5, 50)) : wantPageSize;
76
126
  const baseBody = {
77
127
  current: Number(args.current || 1),
78
- pageSize: Number(args.pageSize || 10),
128
+ pageSize: fetchPageSize,
79
129
  tableuid: randHex32(),
80
130
  listId,
81
- searchParamData: { searchType: '3', commonSearchFields: conds, type: 'and' },
131
+ searchParamData: { searchType: '3', commonSearchFields: conds, type: searchType },
82
132
  terminal: 'PC', browser: 'Chrome',
83
133
  requiredMatch: 1, mapResult: 1, recheckQuery: 1,
84
134
  isFollow: 0, isShareToMe: 0, filterCondition: {},
@@ -111,7 +161,14 @@ async function handler(args, env) {
111
161
  if (item.option_id && item.selection_name)
112
162
  dictNameMap[item.option_id] = item.selection_name;
113
163
  }
114
- const out = { env: new URL(baseUrl).hostname, total, rows: [] };
164
+ const out = {
165
+ env: new URL(baseUrl).hostname, total,
166
+ // 🔴 显式回执「本次关键词实际搜了哪些字段、各用什么操作符」:
167
+ // 条件被服务端静默忽略时(total 与全库相同)调用方无从判断,有了这个清单才能自查。
168
+ ...(searchFields ? { keyword, searchFields } : {}),
169
+ ...(searchNote ? { searchNote } : {}),
170
+ rows: [],
171
+ };
115
172
  const outRows = out.rows;
116
173
  const inlineNames = rows.map((r) => parsePortalName(r.creator));
117
174
  const pureIds = [];
@@ -137,6 +194,34 @@ async function handler(args, env) {
137
194
  createTime: r.create_time || null,
138
195
  });
139
196
  });
197
+ // 🔴 客户端时间过滤:服务端不支持 create_time 条件(实测被静默忽略,见上方注释),
198
+ // 只能在取回的行上按 createTime 筛。
199
+ if (createdAfter) {
200
+ const cutoff = Date.parse(String(createdAfter).replace(/-/g, '/'));
201
+ const fetched = outRows.length;
202
+ if (Number.isNaN(cutoff)) {
203
+ out.timeFilter = {
204
+ createdAfter, mode: 'client', applied: false, fetched, matched: fetched,
205
+ note: 'createdAfter 无法解析为日期(应为 YYYY-MM-DD),本次未做时间过滤,返回的是全时段结果',
206
+ };
207
+ }
208
+ else {
209
+ const kept = outRows.filter((r) => {
210
+ const t = Date.parse(String(r.createTime || '').replace(/-/g, '/'));
211
+ return !Number.isNaN(t) && t >= cutoff;
212
+ });
213
+ out.rows = kept;
214
+ out.returned = kept.length;
215
+ out.timeFilter = {
216
+ createdAfter, mode: 'client', applied: true, fetched, matched: kept.length, fetchPageSize,
217
+ // 🔴 必须显式声明「命中数 ≠ 该时间段全库总数」:客户端只能筛已取回的行,
218
+ // 不写清会让调用方把 matched 当成真实总数,进而误判「半年内只有这么多人」。
219
+ note: kept.length < wantPageSize
220
+ ? `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行(少于期望 ${wantPageSize})。命中数不代表该时间段全库总数,可加大 pageSize 或翻页后重查`
221
+ : `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行`,
222
+ };
223
+ }
224
+ }
140
225
  return rsSuccess('recruit-stage.candidate.search', out);
141
226
  }
142
227
  /* ══════════ recruit-stage.candidate.searchByTag —— 按标签搜人才(2026-11-12 新增) ══════════
@@ -168,11 +253,34 @@ function clampInt(v, min, max, fallback) {
168
253
  return Math.min(max, Math.max(min, Math.trunc(n)));
169
254
  }
170
255
  function normTag(s) { return String(s == null ? '' : s).trim().toLowerCase(); }
171
- /** 标签列字段 id:优先运行时解析搜索配置,失败才回退平台常量 */
172
- async function resolveTagFields(host, listId) {
173
- let publicKey = FALLBACK_TAG_FIELDS.public;
174
- let privateKey = FALLBACK_TAG_FIELDS.private;
175
- let fromConfig = false;
256
+ /** 从 conditionType / conditionTypeValue 里取第一个可用操作符码(形态跨版本不一,逐个兼容)。 */
257
+ function firstConditionType(it) {
258
+ const ct = it?.conditionType ?? it?.conditionTypeValue ?? it?.conditionTypes ?? it?.conditions;
259
+ const pick = (v) => {
260
+ if (typeof v === 'string')
261
+ return v;
262
+ if (v && typeof v === 'object')
263
+ return String(v.value ?? v.key ?? v.code ?? v.conditionType ?? '');
264
+ return '';
265
+ };
266
+ if (Array.isArray(ct)) {
267
+ for (const x of ct) {
268
+ const s = pick(x);
269
+ if (s)
270
+ return s;
271
+ }
272
+ return '';
273
+ }
274
+ return pick(ct);
275
+ }
276
+ async function resolveListSearchMeta(host, listId) {
277
+ const meta = {
278
+ publicKey: FALLBACK_TAG_FIELDS.public,
279
+ privateKey: FALLBACK_TAG_FIELDS.private,
280
+ fromConfig: false,
281
+ operators: {},
282
+ labels: {},
283
+ };
176
284
  try {
177
285
  const r = await host.request({
178
286
  path: '/api/ebuilder/form/listSearch/getListSearch/' + encodeURIComponent(listId),
@@ -185,21 +293,45 @@ async function resolveTagFields(host, listId) {
185
293
  continue;
186
294
  const raw = String(it.id);
187
295
  const key = raw.indexOf('field_') === 0 ? raw : 'field_' + raw;
188
- const label = String(it.label || '');
296
+ const bare = key.slice('field_'.length);
297
+ const label = String(it.label || it.showName || it.fieldName || '');
298
+ if (label)
299
+ meta.labels[bare] = label;
189
300
  if (label === '公共标签') {
190
- publicKey = key;
191
- fromConfig = true;
301
+ meta.publicKey = key;
302
+ meta.fromConfig = true;
192
303
  }
193
304
  else if (label === '我的标签') {
194
- privateKey = key;
195
- fromConfig = true;
305
+ meta.privateKey = key;
306
+ meta.fromConfig = true;
196
307
  }
308
+ const op = firstConditionType(it);
309
+ if (op)
310
+ meta.operators[bare] = op;
197
311
  }
198
312
  }
199
313
  }
200
- catch { /* 配置读不到就用平台常量,后面负样本仍会校验 */ }
201
- return { publicKey, privateKey, fromConfig };
314
+ catch { /* 配置读不到就用兜底:标签走平台常量、操作符走 like;后面负样本仍会校验 */ }
315
+ return meta;
202
316
  }
317
+ /**
318
+ * 关键词搜索的目标字段(业务语义清单)。
319
+ * 🔴 每一项都必须经 `cache.fields[objId]` 校验存在才使用——环境没有该字段就跳过,
320
+ * 绝不拼一个无效 fieldId 让服务端静默忽略(那会造成"搜了但没筛"的假成功)。
321
+ * 🔴 实测(2026-11-27 自用环境):BOSS直聘等渠道导入的人才,现职/现公司落在
322
+ * `last_position_id` / `last_company_id`,而 `current_position` / `current_industry` 常为空
323
+ * (后者只在 OCR 解析出 jobInformations[0] 时才写)。两组都搜,否则按职位关键词会大面积漏人。
324
+ */
325
+ const KEYWORD_TEXT_FIELDS = [
326
+ 'candidate_name', // 姓名
327
+ 'intend_position', // 期望职位
328
+ 'current_position', // 当前职位(OCR 建档才有)
329
+ 'last_position_id', // 最近职位(渠道导入常有)
330
+ 'current_industry', // 当前公司(OCR 建档才有)
331
+ 'last_company_id', // 最近公司(渠道导入常有)
332
+ 'college', // 毕业院校
333
+ 'self_desc', // 自我评价
334
+ ];
203
335
  /** 构造标签条件:any = 单条件对象多值(并集);all = 多条件对象(交集) */
204
336
  function buildTagCond(ids, keys, mode) {
205
337
  const groups = [];
@@ -284,7 +416,8 @@ async function handlerSearchByTag(args, env) {
284
416
  via: 'none', total: 0, countFrom: 'local', current, pageSize, rows: [],
285
417
  });
286
418
  }
287
- const keys = await resolveTagFields(host, String(listId));
419
+ // 与 candidate.search 共用同一份列表搜索配置解析(标签列 fieldId + 操作符),避免两处实现漂移
420
+ const keys = await resolveListSearchMeta(host, String(listId));
288
421
  // getListDatas 的 passid/cid 必须是**台账视图 objId**(listInit.data.objid),不是表单 objId;
289
422
  // 两者在某些环境不同,用错会查错台账(forge §19)。失败才回退 context 里的表单 objId。
290
423
  let ledgerObjId = String(objId);
@@ -481,6 +614,8 @@ export const searchOperations = [
481
614
  inputSchema: schemaOf({
482
615
  name: { type: 'string', description: '姓名关键词(like)' },
483
616
  mobile: { type: 'string', pattern: '^\\d{6,20}$', description: '手机号(like)' },
617
+ keyword: { type: 'string', description: '跨字段关键词搜索(E10 列表快捷搜索,匹配姓名/职位/公司/院校等)' },
618
+ createdAfter: { type: 'string', description: '创建时间过滤起始日期(YYYY-MM-DD,按 create_time gte 过滤)' },
484
619
  pageSize: { type: 'integer', minimum: 1, maximum: 100 },
485
620
  current: { type: 'integer', minimum: 1 },
486
621
  }, {}),
@@ -125,12 +125,26 @@ function listOperation() {
125
125
  if (type === 0)
126
126
  body.tagModules = ['recruit'];
127
127
  const r = await env.host.request({ path: '/api/my/tag/query', method: 'POST', body });
128
- const list = r?.data?.data;
129
- if (!Array.isArray(list))
128
+ const payload = r?.data;
129
+ const list = payload?.data;
130
+ // 🔴 空结果 ≠ 失败(2026-11-27 修):上游「成功但没有标签」时只回 total=0、不带数组。
131
+ // 实测 {code:200,status:true,fail:false,msg:"接口返回成功",data:{total:0}};
132
+ // 以前一律 throw,导致「任何关键词零命中」都被判成查询失败,标签推荐第一步就断。
133
+ const upstreamFailed = r?.status === false
134
+ || r?.fail === true
135
+ || (typeof r?.code === 'number' && r.code !== 200);
136
+ if (upstreamFailed)
130
137
  throw rsFail('标签库查询失败:' + (r?.msg || '无返回'), { response: r });
138
+ if (!Array.isArray(list)) {
139
+ const total = Number(payload?.total ?? 0);
140
+ if (Number.isFinite(total) && total > 0) {
141
+ throw rsFail('标签库查询失败:返回结构异常(total=' + total + ' 但没有标签数组)', { response: r });
142
+ }
143
+ return rsSuccess('tag.list', { type: type === 0 ? 'public' : 'personal', total: 0, tags: [] });
144
+ }
131
145
  return rsSuccess('tag.list', {
132
146
  type: type === 0 ? 'public' : 'personal',
133
- total: Number(r?.data?.total ?? list.length),
147
+ total: Number(payload?.total ?? list.length),
134
148
  tags: list.map((t) => ({
135
149
  tagId: String(t.tagId), name: String(t.name), type: Number(t.type ?? 0),
136
150
  color: t.color || '', creator: t.creator || '',
@@ -465,6 +465,16 @@ export function expectedFields(details, fields, keys, nonEmptyOnly = [], optiona
465
465
  }
466
466
  return out;
467
467
  }
468
+ /** 数值归一化比较:字符串不一致时尝试 Number() 比较,消除 "18" vs "18.00" 假 mismatch。 */
469
+ function valuesMatch(expected, actual) {
470
+ if (expected === actual)
471
+ return true;
472
+ const expNum = Number(expected);
473
+ const actNum = Number(actual);
474
+ if (Number.isFinite(expNum) && Number.isFinite(actNum) && expNum === actNum)
475
+ return true;
476
+ return false;
477
+ }
468
478
  /**
469
479
  * 落库回查(缓存方案 A 第三层门禁):saveFormData 返回 success 不代表字段真的写进去——
470
480
  * 后端对不认识的 optionId 会**静默丢弃仍返回成功**(2026-11-06 面试方式为空事故的根因)。
@@ -505,7 +515,7 @@ export async function verifySubmitted(opts) {
505
515
  const actual = d
506
516
  ? String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? '')
507
517
  : '';
508
- const bad = e.expected === '*' ? !actual : actual !== e.expected;
518
+ const bad = e.expected === '*' ? !actual : !valuesMatch(e.expected, actual);
509
519
  if (bad)
510
520
  mismatches.push({ label: e.label, expected: e.expected === '*' ? '(非空)' : e.expected, actual: actual || '(空)' });
511
521
  }
@@ -2,6 +2,7 @@ import { readFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
4
4
  import { stateRoot } from '../../core/state.js';
5
+ import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
5
6
  import { STATE_SUBDIR } from './constants.js';
6
7
  import { createSmartExtractContinuationSigner } from './continuation.js';
7
8
  import { smartExtractValidationError } from './errors.js';
@@ -89,8 +90,16 @@ export const smartExtractShortcut = {
89
90
  .description('E10 智能抽取:fill 一次取齐结构与附件正文,fill.save 校验+落库+回查;其余为排障命令');
90
91
  command.command('schema')
91
92
  .description('输出 operation 合约(Agent 自查入口)')
92
- .action(action((ctx) => {
93
- ctx.output.write(smartExtractManifest, { json: true });
93
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
94
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
95
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
96
+ .action(action((ctx, options) => {
97
+ const schema = schemaOptionsOf(options);
98
+ ctx.output.write(manifestView(smartExtractManifest, schema), {
99
+ json: true,
100
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
101
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
102
+ });
94
103
  }));
95
104
  command.command('run')
96
105
  .description('按 operation 名执行,例如 smart-extract.form.structure')
@@ -3,6 +3,7 @@ export const smartExtractOperations = smartExtractOperationDefinitions.map((defi
3
3
  name: definition.name,
4
4
  risk: definition.risk,
5
5
  summary: definition.summary,
6
+ ...(definition.requiresConfirmation ? { requiresConfirmation: true } : {}),
6
7
  inputSchema: definition.inputSchema,
7
8
  }));
8
9
  export const smartExtractManifest = {
@@ -48,6 +48,7 @@ function requireSuccessResult(result) {
48
48
  const savePrepare = {
49
49
  name: 'smart-extract.save.prepare',
50
50
  risk: 'read-before-write',
51
+ requiresConfirmation: true,
51
52
  summary: '组装落库请求并签发确认票据:先按内容指纹与附件键查本地台账(命中返回 duplicate 与已有 aiExtraId,不签票据),再自动生成 requestId(防「写结果未知后重试」双插)。本身不发写请求。',
52
53
  inputSchema: schemaOf({
53
54
  workflowId: { ...SCHEMA_ID, description: '流程模板 ID(必填,服务端要求)' },
@@ -256,6 +257,7 @@ async function resolveContinuation(args, stateDir) {
256
257
  const saveApply = {
257
258
  name: 'smart-extract.save.apply',
258
259
  risk: 'high-risk-write',
260
+ requiresConfirmation: true,
259
261
  summary: '确认后真正写入批次记录:必须 confirm=true 且带 prepare 返回的 ticketFile。发写请求前先按 requestId/内容指纹/附件键三层查重,重复一律返回已有 aiExtraId,不再入库。',
260
262
  inputSchema: schemaOf({
261
263
  confirm: { type: 'boolean', description: '必须为 true;表示用户已明确确认保存' },
@@ -7,6 +7,7 @@ import { workflowManifest } from './manifest.js';
7
7
  import { executeWorkflowOperation } from './operations.js';
8
8
  import { workflowValidationError, workflowPolicyError } from './errors.js';
9
9
  import { isCapabilityDeniedHere } from '../../core/host-policy.js';
10
+ import { charsOf } from '../../core/output.js';
10
11
  import { compactStdoutPaths } from './stdout-compact.js';
11
12
  import { join } from 'node:path';
12
13
  import { loadRules, resetActiveRules } from './operations/todoSmartConvert/aigroupRules.js';
@@ -232,6 +233,8 @@ export const workflowShortcut = {
232
233
  .description('泛微E10流程智能助手(待办/已办/我发起/全部、详情、操作、批量、发起、修改)');
233
234
  workflow.command('schema')
234
235
  .description('Print workflow operation manifest for agents')
236
+ // `--list` 是本模块的默认行为(默认就输出精简索引),保留声明只为跨域统一。
237
+ .option('--list', '只列操作索引(name/summary/风险),与默认输出一致,全量不截断')
235
238
  .option('--operation <name>', 'print one operation with its full inputSchema')
236
239
  .option('--full', 'print the whole manifest (about 65 KB; stdout may be trimmed)')
237
240
  .action(action((ctx, options) => {
@@ -241,7 +244,24 @@ export const workflowShortcut = {
241
244
  throw workflowValidationError('option_conflict', '不能同时传 --operation 和 --full');
242
245
  }
243
246
  if (opts.full === true) {
244
- ctx.output.write(manifestFull(), { json: true });
247
+ const full = manifestFull();
248
+ // 装不下时返回**完整清单**(一条不丢),而不是让输出层把 `operations` 切成几条。
249
+ // 2026-11-27 实测:整份 75,961 字符,原本只剩 10/29 条,模型据此以为模块只有 10 个能力。
250
+ // 入参本来就用 `--operation` 单取,所以这里丢了 inputSchema 不影响可用性。
251
+ if (charsOf(full) > ctx.output.budgetChars()) {
252
+ ctx.output.write({
253
+ ...manifestIndex(),
254
+ fullOmitted: {
255
+ totalOperations: visibleOperations().length,
256
+ fullChars: charsOf(full),
257
+ hint: '完整 inputSchema 超出 stdout 预算,未随本次返回(否则 operations 会被截成几条,'
258
+ + '让你误以为模块只有那么多个能力)。取某个操作的完整契约:'
259
+ + 'weaver-work-cli workflow schema --operation <name>。',
260
+ },
261
+ }, { json: true });
262
+ return;
263
+ }
264
+ ctx.output.write(full, { json: true });
245
265
  return;
246
266
  }
247
267
  if (requested) {
@@ -1344,6 +1344,9 @@ export function writeCollectCache(payload, batchSize) {
1344
1344
  return String(row?.workflowname ?? row?.workflowName ?? '').trim();
1345
1345
  }).filter(Boolean);
1346
1346
  const batchPrompts = resolvePromptsForBatch(promptEntries, batchWorkflowNames);
1347
+ // 提示词区块置于批次文件头部(2026-11-26 用户定稿):prompt/defaultPrompts 是详读指令,
1348
+ // 放在 rows/details 之前——批次文件体量大头在 details,指令放末尾会被 agent 读取截断
1349
+ // 漏掉(实测:第 1 批未读到 prompts → 误判未命中 → 退回默认口径),放头部彻底规避。
1347
1350
  const batchPayload = {
1348
1351
  collectedAt: payload.collectedAt,
1349
1352
  mode: payload.mode,
@@ -1352,14 +1355,14 @@ export function writeCollectCache(payload, batchSize) {
1352
1355
  batchNo,
1353
1356
  batchTotal: Math.ceil(details.length / size),
1354
1357
  batchSize: size,
1355
- rows: batchRows,
1356
- details: slice,
1357
1358
  // 默认详读提示词(2026-11-24 用户定稿:唯一提示词源 = config defaultPrompt):
1358
1359
  // 每个批次文件都带 defaultPrompts 区块,未命中 prompts 条目的详读指令来源
1359
1360
  ...(payload.defaultPrompts && typeof payload.defaultPrompts === 'object'
1360
1361
  ? { defaultPrompts: payload.defaultPrompts }
1361
1362
  : {}),
1362
1363
  ...(batchPrompts.length > 0 ? { prompts: batchPrompts } : {}),
1364
+ rows: batchRows,
1365
+ details: slice,
1363
1366
  };
1364
1367
  const batchFile = join(dir, `aiDeepRead-batch-${stamp}-${String(batchNo).padStart(2, '0')}.json`);
1365
1368
  const batchJson = JSON.stringify(batchPayload, null, 2);
@@ -3990,7 +3990,7 @@ const workflowSummary = {
3990
3990
  ...schemaOf({
3991
3991
  requestId: SCHEMA_REQUEST_ID,
3992
3992
  index: SCHEMA_INDEX,
3993
- group: { type: 'string' },
3993
+ group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
3994
3994
  summaryFields: { type: 'integer', minimum: 1, default: 12 },
3995
3995
  }),
3996
3996
  // requestId 与 index 至少给一个:只给 index 时按 group 在本地检索索引中定位(见 resolveTargetRequestId)
@@ -4870,7 +4870,7 @@ const workflowOpen = {
4870
4870
  ...schemaOf({
4871
4871
  requestId: SCHEMA_REQUEST_ID,
4872
4872
  index: SCHEMA_INDEX,
4873
- group: { type: 'string' },
4873
+ group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
4874
4874
  openMode: { type: 'string', enum: ['auto', 'localBrowser', 'clientAction', 'url'], default: 'auto' },
4875
4875
  noOpen: { type: 'boolean', default: false },
4876
4876
  }),
@@ -1186,7 +1186,7 @@ const workflowOperateApply = {
1186
1186
  // ===========================================================================
1187
1187
  const SHARE_INPUT = schemaOf({
1188
1188
  requestId: SCHEMA_REQUEST_ID,
1189
- group: { type: 'string' },
1189
+ group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
1190
1190
  index: SCHEMA_INDEX,
1191
1191
  shareObjects: {
1192
1192
  type: 'array',
@@ -50,7 +50,7 @@ weaver-work-cli --json caizhilian get --doc-id 1234567890
50
50
  weaver-work-cli --json caizhilian run caizhilian.folder.query-by-name --input-json '{"folder_name":"财务","kb_type":"company"}'
51
51
  ```
52
52
 
53
- 成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。
53
+ 成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。失败 envelope 的 `error.details.raw` 携带服务端原始响应体摘要(截断 2 KB),服务端不给错误文案时用它自助排障。
54
54
 
55
55
  当前输出层是完整 JSON 直接写 stdout,不提供 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:文档列表先 `page_size=10`,按 `page_no` 继续;`has_next` 的判定是「本页条数 >= page_size」(服务端 `total` 不可信);回复只展示关键字段和数量,超长响应(正文 HTML、批量结果)落本地文件后给路径。
56
56