weaver-work-cli 0.1.62 → 0.1.63
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.
- package/dist/chunks/{archive-S2VKZWQ3.js → archive-BLDYBZDX.js} +5 -4
- package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-3GJ3TWXR.js} +5 -4
- package/dist/chunks/{asset-HYH4W357.js → asset-AFXJN4CK.js} +5 -4
- package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-VUJXWGWJ.js} +5 -4
- package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-VMJA7NSQ.js} +3 -3
- package/dist/chunks/{blog-SLMZZICV.js → blog-EREB35VU.js} +5 -4
- package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-ATM2JO5S.js} +5 -5
- package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-E26ZIH7S.js} +5 -4
- package/dist/chunks/{chunk-6XSSAUNW.js → chunk-4OB22YKE.js} +48 -12
- package/dist/chunks/{chunk-UBGWIXU3.js → chunk-5CY37VLS.js} +131 -38
- package/dist/chunks/{chunk-EGANE35F.js → chunk-6G2JARDK.js} +1 -1
- package/dist/chunks/{chunk-WIWDVETN.js → chunk-6VCQLZXE.js} +75 -76
- package/dist/chunks/{chunk-E5YD5JWR.js → chunk-BY3WDJO5.js} +1 -1
- package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
- package/dist/chunks/{chunk-BQYX2UX5.js → chunk-C5PIGPGX.js} +5 -3
- package/dist/chunks/{chunk-UBRWONP4.js → chunk-EOZHSNND.js} +2 -2
- package/dist/chunks/{chunk-UQFPF4EX.js → chunk-G3ZM57PD.js} +2 -2
- package/dist/chunks/{chunk-XT77MP54.js → chunk-GOBNIGWS.js} +410 -24
- package/dist/chunks/{chunk-KY3R42RS.js → chunk-GQK6WLOS.js} +5 -3
- package/dist/chunks/{chunk-BIA2NKUG.js → chunk-HEJPVXD3.js} +5 -5
- package/dist/chunks/{chunk-ILALC2N6.js → chunk-I4C2KR2G.js} +1 -1
- package/dist/chunks/{chunk-YI2YMW5N.js → chunk-IGICM3WJ.js} +2 -2
- package/dist/chunks/chunk-IN6NXQ26.js +680 -0
- package/dist/chunks/{chunk-VBFBMM7G.js → chunk-LOVAIGM2.js} +387 -70
- package/dist/chunks/{chunk-H6YOMI3U.js → chunk-OMAGCLUE.js} +5 -3
- package/dist/chunks/{chunk-VNYOUAWV.js → chunk-QAMIIFP6.js} +11 -11
- package/dist/chunks/{chunk-QBDXJS2W.js → chunk-QZYKZ7MQ.js} +16 -8
- package/dist/chunks/{chunk-V2LASYKO.js → chunk-RR45ELVE.js} +30 -24
- package/dist/chunks/{chunk-NRYDJN4J.js → chunk-RV2JAA5I.js} +89 -8
- package/dist/chunks/{chunk-TEZHIB6T.js → chunk-SDPC7BG2.js} +5 -3
- package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-SHBDXEUE.js} +4 -7
- package/dist/chunks/{chunk-P6TXQK75.js → chunk-THMBDCRA.js} +5 -3
- package/dist/chunks/chunk-TJN4PIYO.js +47 -0
- package/dist/chunks/{chunk-DTCQFTHW.js → chunk-TNFIUZ4H.js} +3 -3
- package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
- package/dist/chunks/{chunk-KXJA42EA.js → chunk-WPBZQVLS.js} +1 -1
- package/dist/chunks/{conflict-GFJRS6I7.js → conflict-AMNTM3FV.js} +2 -2
- package/dist/chunks/{contract-U3ZGNRWB.js → contract-PLO2V2NO.js} +2333 -4426
- package/dist/chunks/{cowork-EX7PKIDK.js → cowork-FZAXE6FO.js} +5 -4
- package/dist/chunks/{create-flow-EJZD434E.js → create-flow-2DAUN7HU.js} +16 -6
- package/dist/chunks/{data-FOODGAMF.js → data-7NXMWET4.js} +3 -3
- package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-DEYHX6M7.js} +4 -4
- package/dist/chunks/{ehr-TE4RFNID.js → ehr-QQH2DYYA.js} +244 -151
- package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
- package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-2JTVEKMP.js} +3 -3
- package/dist/chunks/{env-TID5NFR6.js → env-2JZMXC6I.js} +2 -2
- package/dist/chunks/{esb-7L6MHYLB.js → esb-I5ZFHJUK.js} +8 -8
- package/dist/chunks/{factory-OG7BPMH5.js → factory-XIATYHU6.js} +1 -1
- package/dist/chunks/{fna-6V2ENR3Y.js → fna-3V2TL6B2.js} +5 -4
- package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-CVYUZCOQ.js} +3 -3
- package/dist/chunks/{host-TJ5VVHM7.js → host-4DP7C7YQ.js} +4 -4
- package/dist/chunks/{host-3DLYA54R.js → host-4KQCAEWA.js} +4 -4
- package/dist/chunks/{host-ONZC6AE7.js → host-4X2F3JPQ.js} +4 -4
- package/dist/chunks/{host-OGBHL75G.js → host-BD7NAM33.js} +4 -4
- package/dist/chunks/{host-VTPAWDZV.js → host-CBONEAZS.js} +4 -4
- package/dist/chunks/{host-GOJHHTPY.js → host-L37QVNIV.js} +4 -4
- package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-OL3IKN7C.js} +6 -6
- package/dist/chunks/{im-XCH47ZBN.js → im-YXQWUF3R.js} +4 -4
- package/dist/chunks/{invoice-5KJ7T774.js → invoice-4WY32PR2.js} +4 -4
- package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-L6SHLONH.js} +5 -4
- package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-OYE6QV24.js} +5 -5
- package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-PZV2KNRU.js} +5 -4
- package/dist/chunks/{meeting-5E3BNARL.js → meeting-6SOBCC6N.js} +16 -15
- package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-KSJSJNOH.js} +4 -4
- package/dist/chunks/{okr-3O3XNYOK.js → okr-B76FW5M2.js} +5 -4
- package/dist/chunks/{operations-EZWG72FH.js → operations-YOMEGFLV.js} +5 -5
- package/dist/chunks/{performance-Y7CPNSOR.js → performance-4VBKUPFO.js} +5 -4
- package/dist/chunks/{plan-BLGPZF5M.js → plan-HBNZRQTI.js} +5 -4
- package/dist/chunks/{project-6MZMLJMP.js → project-IV6FWK74.js} +5 -4
- package/dist/chunks/{reception-F2VT2X52.js → reception-BR5YURT6.js} +3 -3
- package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-4HQ6OGXT.js} +654 -336
- package/dist/chunks/{registry-I4DVPDMU.js → registry-7LICMV5J.js} +12 -12
- package/dist/chunks/{registry-3FYSWV3U.js → registry-JFQEFC7E.js} +3 -3
- package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
- package/dist/chunks/{registry-7RS74TCK.js → registry-MZJQX65Q.js} +5 -5
- package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-43GLLE7Y.js} +4 -4
- package/dist/chunks/{schedule-6AN63MJQ.js → schedule-ZQ42BEW6.js} +4 -4
- package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-QKAEAZGM.js} +3 -3
- package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-6HV7H5PC.js} +10 -7
- package/dist/index.js +34 -34
- package/dist/internal/e10/auth/commands.js +21 -1
- package/dist/internal/e10/auth/xiaoe.js +6 -2
- package/dist/internal/e10/auth-recovery.js +28 -2
- package/dist/internal/e10/request-runtime.js +15 -3
- package/dist/internal/e10/request-trace.js +65 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
- package/dist/shortcuts/contract/index.js +14 -39
- package/dist/shortcuts/contract/manifest.js +115 -270
- package/dist/shortcuts/contract/operations/compare-report.js +437 -0
- package/dist/shortcuts/contract/operations/compare.js +2 -0
- package/dist/shortcuts/contract/operations/first-screen.js +96 -207
- package/dist/shortcuts/contract/operations/flow.js +19 -1
- package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +98 -25
- package/dist/shortcuts/contract/operations/ledger.js +315 -1
- package/dist/shortcuts/contract/operations/metrics.js +93 -0
- package/dist/shortcuts/contract/operations/modeltext.js +3 -3
- package/dist/shortcuts/contract/operations/page.js +8 -4
- package/dist/shortcuts/contract/operations/performance.js +53 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +289 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +264 -0
- package/dist/shortcuts/contract/operations/recommend.js +42 -1
- package/dist/shortcuts/contract/operations/registry.js +16 -23
- package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
- package/dist/shortcuts/contract/operations/review.js +33 -167
- package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
- package/dist/shortcuts/contract/operations/triage.js +13 -6
- package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
- package/dist/shortcuts/contract/operations/upload.js +17 -11
- package/dist/shortcuts/contract/prewarm-cache.js +6 -2
- package/dist/shortcuts/contract/prewarm.js +33 -23
- package/dist/shortcuts/contract/recommend-cache.js +191 -0
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
- package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
- package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
- package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
- package/dist/shortcuts/ehr/operations/recruit.js +338 -121
- package/dist/shortcuts/hrm/operations/employee.js +64 -17
- package/dist/shortcuts/hrm/operations/resolve.js +419 -369
- package/dist/shortcuts/im/host.js +38 -22
- package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +116 -7
- package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
- package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
- package/dist/shortcuts/recruit-stage/context.js +75 -9
- package/dist/shortcuts/recruit-stage/manifest.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
- package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
- package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
- package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/form.js +12 -15
- package/dist/shortcuts/workflow/operations/read.js +8 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
- package/dist/shortcuts/workflow/operations.js +5 -0
- package/docs/contract.md +2 -2
- package/docs/e10-auth.md +28 -0
- package/docs/ehr.md +1 -1
- package/package.json +1 -1
- package/skills/weaver-e10-hrm/SKILL.md +3 -3
- package/skills/weaver-e10-hrm/references/employee.md +13 -2
- package/skills/weaver-e10-jinchengda/SKILL.md +237 -347
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +109 -185
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +12 -4
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
- package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +21 -12
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +18 -17
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +73 -104
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +32 -37
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +12 -10
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +70 -82
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +37 -33
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +94 -27
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +9 -15
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +9 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +59 -32
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +7 -5
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +21 -13
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +13 -13
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +6 -5
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +11 -20
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +203 -54
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +4 -11
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +11 -17
- package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
- package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
- package/skills/weaver-e10-jinchengda/references/orchestration.md +31 -33
- package/skills/weaver-e10-jucailin/SKILL.md +6 -7
- package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
- package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
- package/skills/weaver-e10-meeting/SKILL.md +83 -531
- package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
- package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
- package/skills/weaver-e10-meeting/references/create-flow.md +3 -1
- package/skills/weaver-e10-meeting/references/create-guardrails.md +14 -8
- package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
- package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
- package/skills/weaver-e10-meeting/references/invitation.md +69 -0
- package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
- package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-workflow/SKILL.md +49 -32
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
- package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
- package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
- package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
- package/skills/weaver-e10-yimiaoban/SKILL.md +10 -10
- package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
- package/dist/chunks/chunk-6QYNE6HE.js +0 -658
- package/dist/chunks/chunk-SHYQUBY3.js +0 -48
- package/dist/shortcuts/contract/operations/card-action.js +0 -1266
- package/dist/shortcuts/contract/operations/card-plan.js +0 -393
- package/dist/shortcuts/contract/operations/card.js +0 -232
- package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
- package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
- package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
- package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
- package/dist/shortcuts/contract/operations/summary.js +0 -187
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
- package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
- package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
- package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
- package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
- package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""简历证件照提取(recruit-resume-photo)
|
|
3
|
-
|
|
4
|
-
从 PDF 简历中提取内嵌位图,按证件照特征筛出候选头像,落成本地图片文件,
|
|
5
|
-
供 `weaver-work-cli recruit-stage run recruit-stage.resume.import.prepare|apply`
|
|
6
|
-
的 `photoFile` 参数使用。
|
|
7
|
-
|
|
8
|
-
用法:
|
|
9
|
-
python recruit-resume-photo.py --pdf <简历.pdf> [--out <输出目录>] [--json]
|
|
10
|
-
|
|
11
|
-
输出(stdout JSON):
|
|
12
|
-
{
|
|
13
|
-
"ok": true,
|
|
14
|
-
"pdf": "...",
|
|
15
|
-
"pageCount": 4,
|
|
16
|
-
"scanned": 1, # 扫描到的内嵌位图总数
|
|
17
|
-
"candidates": [ # 按可信度降序
|
|
18
|
-
{"path": ".../photo_1.png", "page": 1, "width": 74, "height": 92,
|
|
19
|
-
"ratio": 0.804, "score": 85, "reason": "..."}
|
|
20
|
-
],
|
|
21
|
-
"best": {...} | null,
|
|
22
|
-
"notes": ["..."] # 无候选时的原因说明
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
判定口径(无渲染器、只看内嵌位图,因此只能靠几何+色彩特征):
|
|
26
|
-
- 证件照常见宽高比 0.55 ~ 0.90(一寸 295x413≈0.714,二寸 413x579≈0.713)
|
|
27
|
-
- 宽幅图(ratio > 1.2)基本是 logo / 横幅 / 分隔条,直接排除
|
|
28
|
-
- 最小边 < 40px 视为图标排除
|
|
29
|
-
- 位于第 1 页的候选加分(简历头像通常在第一页)
|
|
30
|
-
- 肤色像素占比明显偏高加分(简单启发式,不做人脸识别)
|
|
31
|
-
|
|
32
|
-
退出码: 0 有候选 / 2 无候选 / 1 参数或读取错误
|
|
33
|
-
"""
|
|
34
|
-
import argparse
|
|
35
|
-
import io
|
|
36
|
-
import json
|
|
37
|
-
import os
|
|
38
|
-
import sys
|
|
39
|
-
|
|
40
|
-
MIN_SIDE = 40
|
|
41
|
-
RATIO_LOW, RATIO_HIGH = 0.55, 0.90
|
|
42
|
-
WIDE_RATIO = 1.2
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def _skin_ratio(pil_img):
|
|
46
|
-
"""粗估肤色像素占比,仅作加分项,不用于硬判定。"""
|
|
47
|
-
try:
|
|
48
|
-
small = pil_img.convert("RGB").resize((32, 32))
|
|
49
|
-
except Exception:
|
|
50
|
-
return 0.0
|
|
51
|
-
hit = total = 0
|
|
52
|
-
for r, g, b in small.getdata():
|
|
53
|
-
total += 1
|
|
54
|
-
if r > 95 and g > 40 and b > 20 and r > g and r > b and (max(r, g, b) - min(r, g, b)) > 15:
|
|
55
|
-
hit += 1
|
|
56
|
-
return round(hit / total, 3) if total else 0.0
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def extract(pdf_path, out_dir):
|
|
60
|
-
from pypdf import PdfReader
|
|
61
|
-
from PIL import Image
|
|
62
|
-
|
|
63
|
-
reader = PdfReader(pdf_path)
|
|
64
|
-
os.makedirs(out_dir, exist_ok=True)
|
|
65
|
-
|
|
66
|
-
scanned = []
|
|
67
|
-
for page_no, page in enumerate(reader.pages, 1):
|
|
68
|
-
try:
|
|
69
|
-
images = list(page.images)
|
|
70
|
-
except Exception:
|
|
71
|
-
continue
|
|
72
|
-
for idx, im in enumerate(images):
|
|
73
|
-
try:
|
|
74
|
-
pil = Image.open(io.BytesIO(im.data))
|
|
75
|
-
pil.load()
|
|
76
|
-
except Exception:
|
|
77
|
-
continue
|
|
78
|
-
w, h = pil.size
|
|
79
|
-
scanned.append({
|
|
80
|
-
"page": page_no,
|
|
81
|
-
"index": idx,
|
|
82
|
-
"name": getattr(im, "name", "img%d" % idx),
|
|
83
|
-
"pil": pil,
|
|
84
|
-
"width": w,
|
|
85
|
-
"height": h,
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
candidates = []
|
|
89
|
-
notes = []
|
|
90
|
-
for item in scanned:
|
|
91
|
-
w, h = item["width"], item["height"]
|
|
92
|
-
ratio = round(w / h, 3) if h else 0
|
|
93
|
-
if min(w, h) < MIN_SIDE:
|
|
94
|
-
notes.append("跳过 %s:尺寸过小(%dx%d)" % (item["name"], w, h))
|
|
95
|
-
continue
|
|
96
|
-
if ratio > WIDE_RATIO:
|
|
97
|
-
notes.append("跳过 %s:宽幅图(ratio=%.2f),判为 logo/横幅" % (item["name"], ratio))
|
|
98
|
-
continue
|
|
99
|
-
|
|
100
|
-
score = 60
|
|
101
|
-
reasons = []
|
|
102
|
-
if RATIO_LOW <= ratio <= RATIO_HIGH:
|
|
103
|
-
score += 20
|
|
104
|
-
reasons.append("宽高比 %.2f 符合证件照" % ratio)
|
|
105
|
-
else:
|
|
106
|
-
score += 5
|
|
107
|
-
reasons.append("宽高比 %.2f 偏离证件照但仍在竖图范围" % ratio)
|
|
108
|
-
if item["page"] == 1:
|
|
109
|
-
score += 10
|
|
110
|
-
reasons.append("位于第 1 页")
|
|
111
|
-
skin = _skin_ratio(item["pil"])
|
|
112
|
-
if skin >= 0.12:
|
|
113
|
-
score += 10
|
|
114
|
-
reasons.append("肤色占比 %.0f%%" % (skin * 100))
|
|
115
|
-
if w >= 100 and h >= 130:
|
|
116
|
-
score += 5
|
|
117
|
-
reasons.append("分辨率可用 %dx%d" % (w, h))
|
|
118
|
-
|
|
119
|
-
candidates.append({
|
|
120
|
-
"page": item["page"],
|
|
121
|
-
"index": item["index"],
|
|
122
|
-
"width": w,
|
|
123
|
-
"height": h,
|
|
124
|
-
"ratio": ratio,
|
|
125
|
-
"skinRatio": skin,
|
|
126
|
-
"score": min(score, 99),
|
|
127
|
-
"reason": ";".join(reasons),
|
|
128
|
-
"_pil": item["pil"],
|
|
129
|
-
"_name": item["name"],
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
candidates.sort(key=lambda c: c["score"], reverse=True)
|
|
133
|
-
|
|
134
|
-
# 落盘:优先 PNG(无损),超过 2MB 转 JPEG
|
|
135
|
-
results = []
|
|
136
|
-
for order, cand in enumerate(candidates, 1):
|
|
137
|
-
pil = cand.pop("_pil")
|
|
138
|
-
name = cand.pop("_name")
|
|
139
|
-
ext = ".png"
|
|
140
|
-
try:
|
|
141
|
-
buf = io.BytesIO()
|
|
142
|
-
pil.save(buf, format="PNG")
|
|
143
|
-
if buf.tell() > 2 * 1024 * 1024:
|
|
144
|
-
buf = io.BytesIO()
|
|
145
|
-
pil.convert("RGB").save(buf, format="JPEG", quality=90)
|
|
146
|
-
ext = ".jpg"
|
|
147
|
-
path = os.path.join(out_dir, "photo_%d%s" % (order, ext))
|
|
148
|
-
with open(path, "wb") as f:
|
|
149
|
-
f.write(buf.getvalue())
|
|
150
|
-
cand["path"] = path
|
|
151
|
-
cand["bytes"] = buf.tell()
|
|
152
|
-
cand["sourceName"] = name
|
|
153
|
-
results.append(cand)
|
|
154
|
-
except Exception as e:
|
|
155
|
-
notes.append("写入候选图失败(%s):%s" % (name, e))
|
|
156
|
-
|
|
157
|
-
if not results:
|
|
158
|
-
notes.append("简历中未找到符合证件照特征的内嵌图片")
|
|
159
|
-
return {
|
|
160
|
-
"ok": bool(results),
|
|
161
|
-
"pdf": pdf_path,
|
|
162
|
-
"pageCount": len(reader.pages),
|
|
163
|
-
"scanned": len(scanned),
|
|
164
|
-
"candidates": results,
|
|
165
|
-
"best": results[0] if results else None,
|
|
166
|
-
"notes": notes,
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
def main():
|
|
171
|
-
ap = argparse.ArgumentParser(description="从 PDF 简历中提取证件照候选")
|
|
172
|
-
ap.add_argument("--pdf", required=True, help="简历 PDF 路径")
|
|
173
|
-
ap.add_argument("--out", default=None, help="输出目录(默认与 PDF 同目录下 resume-photo)")
|
|
174
|
-
ap.add_argument("--json", action="store_true", help="仅输出 JSON(默认也是 JSON,保留兼容)")
|
|
175
|
-
args = ap.parse_args()
|
|
176
|
-
|
|
177
|
-
pdf_path = os.path.abspath(args.pdf)
|
|
178
|
-
if not os.path.isfile(pdf_path):
|
|
179
|
-
print(json.dumps({"ok": False, "error": "文件不存在: %s" % pdf_path}, ensure_ascii=False))
|
|
180
|
-
return 1
|
|
181
|
-
|
|
182
|
-
out_dir = args.out or os.path.join(os.path.dirname(pdf_path), "resume-photo")
|
|
183
|
-
try:
|
|
184
|
-
result = extract(pdf_path, out_dir)
|
|
185
|
-
except Exception as e:
|
|
186
|
-
print(json.dumps({"ok": False, "error": "%s: %s" % (type(e).__name__, e)}, ensure_ascii=False))
|
|
187
|
-
return 1
|
|
188
|
-
|
|
189
|
-
print(json.dumps(result, ensure_ascii=False, indent=2))
|
|
190
|
-
return 0 if result["ok"] else 2
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if __name__ == "__main__":
|
|
194
|
-
sys.exit(main())
|