weaver-work-cli 0.1.73 → 0.1.75
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/README.md +37 -1
- package/dist/chunks/{archive-THZV4ND4.js → archive-OZJ6PYUR.js} +14 -9
- package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-BHL5RK2F.js} +10 -7
- package/dist/chunks/{asset-RGPROZYH.js → asset-HKRFRQR2.js} +10 -7
- package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-GGIR4KE7.js} +7 -4
- package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-4OV65NK5.js} +3 -3
- package/dist/chunks/{blog-7U3QZPIF.js → blog-HYDP4DV3.js} +10 -7
- package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-JS4RQZ6Z.js} +10 -7
- package/dist/chunks/{calendar-KINM64E4.js → calendar-SWRY4DIT.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-2AUFKU2D.js} +11 -11
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/{chunk-TV46Q4NY.js → chunk-4FCBEWNB.js} +74 -68
- package/dist/chunks/{chunk-NUP4RYZK.js → chunk-5D2V7ZAN.js} +2 -2
- package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
- package/dist/chunks/{chunk-4BXR6CNB.js → chunk-5ZJGPEIB.js} +2 -2
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/chunk-BNKUHN4N.js +1346 -0
- package/dist/chunks/{chunk-2CHGUYMG.js → chunk-BSR5TM7U.js} +4 -4
- package/dist/chunks/{chunk-4I26YMBY.js → chunk-ERZY6GYL.js} +7 -3
- package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
- package/dist/chunks/{chunk-F4HM25K4.js → chunk-I6NOHKEK.js} +1 -1
- package/dist/chunks/{chunk-JMJBPP4B.js → chunk-J7FAAHWH.js} +2 -2
- package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
- package/dist/chunks/chunk-JOY3HZXL.js +467 -0
- package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/{chunk-BWYVS62Z.js → chunk-KEA4XQPO.js} +4 -4
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-IBSJJGXL.js → chunk-KWJEICD4.js} +2 -2
- package/dist/chunks/{chunk-GAMGDNTF.js → chunk-LJI4N6FV.js} +1 -1
- package/dist/chunks/{chunk-IU6UB2TD.js → chunk-MXCRKXOP.js} +48 -6
- package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-NWYHCZTY.js} +1 -1
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/{chunk-L7TYG5SN.js → chunk-OQCK5SAU.js} +2 -2
- package/dist/chunks/chunk-PG5YSNYY.js +1166 -0
- package/dist/chunks/{chunk-XZBYRYWX.js → chunk-QJWVYOOV.js} +2 -2
- package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TA2RBUTH.js} +2 -2
- package/dist/chunks/{chunk-6HT73VOI.js → chunk-U6Y32KEV.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-R3MK2RBN.js → chunk-VOMDD2C5.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/{chunk-2XED2FKY.js → chunk-ZUB4M4N3.js} +38 -36
- package/dist/chunks/{chunk-7QFVXP2X.js → chunk-ZWIMLT6P.js} +8 -7
- package/dist/chunks/cli-FULPXIKJ.js +226 -0
- package/dist/chunks/commands-BNWFNTD3.js +70 -0
- package/dist/chunks/{conflict-VPAR7E6F.js → conflict-5BKCDV2F.js} +2 -2
- package/dist/chunks/{contract-DDXAO2DZ.js → contract-WI23OXVC.js} +12446 -5964
- package/dist/chunks/{cowork-34QCHMDD.js → cowork-DZBBVNMQ.js} +11 -8
- package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-7ZRBRKX7.js} +6 -6
- package/dist/chunks/{data-CLQ62QGD.js → data-PAZVE6QE.js} +6 -3
- package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-5SQXIGXN.js} +9 -6
- package/dist/chunks/{ehr-LCNAVMK5.js → ehr-CX5F4ZAU.js} +23 -16
- package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-I2BYNONZ.js} +3 -3
- package/dist/chunks/{env-RDKWAARB.js → env-ZAQZ7EHN.js} +2 -2
- package/dist/chunks/{esb-ANKPUU65.js → esb-DQTXDIBF.js} +10 -7
- package/dist/chunks/{factory-434B7RAT.js → factory-XRI6KZ7H.js} +1 -1
- package/dist/chunks/{fna-AKBSG5HI.js → fna-FK6HQVJL.js} +13 -8
- package/dist/chunks/{group-chat-PROTW22R.js → group-chat-MLWNYM2P.js} +3 -3
- package/dist/chunks/{host-WO4L5G5I.js → host-3EPREGXS.js} +6 -3
- package/dist/chunks/{host-XIYG4F4B.js → host-J74JGYAW.js} +6 -3
- package/dist/chunks/{host-7FJW4E7R.js → host-KUMU3DDK.js} +6 -3
- package/dist/chunks/{host-5R2SNFWD.js → host-MEC4VQZA.js} +6 -3
- package/dist/chunks/{host-PDJAKCT7.js → host-T6NNQGVZ.js} +6 -3
- package/dist/chunks/{host-CGXUFQO4.js → host-VI7Q45PM.js} +6 -3
- package/dist/chunks/{hrm-WGODDTEH.js → hrm-KKVAW4P5.js} +8 -5
- package/dist/chunks/{im-YKTKAJU3.js → im-47CIWQNL.js} +7 -4
- package/dist/chunks/{invoice-PVYCCCVM.js → invoice-CDYRBNIG.js} +21 -16
- package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-M7QTRHZK.js} +17 -10
- package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-FKQJZFI5.js} +22 -8
- package/dist/chunks/{mail-BNB5S4NW.js → mail-NRBS5N6Y.js} +11 -8
- package/dist/chunks/{meeting-O2KDJH66.js → meeting-WC5LD3IO.js} +22 -18
- package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-OQUMDTKG.js} +4 -4
- package/dist/chunks/{okr-LWFGWOE7.js → okr-EHKSKMPL.js} +10 -7
- package/dist/chunks/{operations-532PN5OB.js → operations-V5VM5MS2.js} +7 -4
- package/dist/chunks/{performance-7W5COCFU.js → performance-ZJADXJPN.js} +6 -3
- package/dist/chunks/{plan-ZVY3IYTL.js → plan-OTDNBDJ7.js} +10 -7
- package/dist/chunks/{project-SA62B7MH.js → project-4XVBQ3HX.js} +10 -7
- package/dist/chunks/{reception-NGIONPQ3.js → reception-3FAHOOH7.js} +8 -4
- package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-3WTVWW2K.js} +199 -74
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/registry-NBTBXR4L.js +30 -0
- package/dist/chunks/{registry-N7P3W2RD.js → registry-TJGCVRCW.js} +7 -4
- package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-KL62XB2Y.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-6UP27HQ4.js → schedule-XOISYUPB.js} +4 -4
- package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-UYGNV3BM.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-V54LJPXL.js} +15 -10
- package/dist/cli.js +40 -0
- package/dist/cmd/action.js +3 -1
- package/dist/cmd/doctor/index.js +1 -1
- package/dist/cmd/e10/index.js +1 -1
- package/dist/cmd/identity/index.js +5 -8
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/setup/index.js +1 -1
- package/dist/cmd/update/index.js +38 -0
- package/dist/core/manifest-view.js +1 -1
- package/dist/core/output.js +8 -1
- package/dist/core/runtime-agent.js +13 -0
- package/dist/core/update-notice.js +23 -0
- package/dist/index.js +105 -198
- package/dist/internal/e10/auth/agent-host-key.js +16 -0
- package/dist/internal/e10/auth/agent-hosts.js +45 -9
- package/dist/internal/e10/auth/commands.js +66 -36
- package/dist/internal/e10/auth/session.js +30 -15
- package/dist/internal/e10/auth/xiaoe.js +4 -20
- package/dist/internal/e10/auth-recovery.js +44 -4
- package/dist/internal/e10/context.js +5 -2
- package/dist/internal/update/bootstrap.js +96 -0
- package/dist/internal/update/npm.js +78 -0
- package/dist/internal/update/service.js +252 -0
- package/dist/internal/update/store.js +135 -0
- package/dist/shortcuts/archive/index.js +2 -2
- package/dist/shortcuts/archive/manifest.js +1 -0
- package/dist/shortcuts/archive/operations/search.js +3 -1
- package/dist/shortcuts/archive-oa/index.js +1 -1
- package/dist/shortcuts/asset/index.js +1 -1
- package/dist/shortcuts/asset-idle/index.js +1 -1
- package/dist/shortcuts/blog/index.js +1 -1
- package/dist/shortcuts/caizhilian/index.js +1 -1
- package/dist/shortcuts/calendar/index.js +1 -1
- package/dist/shortcuts/contract/data/bi-config.js +156 -0
- package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
- package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
- package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
- package/dist/shortcuts/contract/data/report-renderers.js +414 -0
- package/dist/shortcuts/contract/data/report-spec.js +132 -0
- package/dist/shortcuts/contract/error-actions.js +114 -0
- package/dist/shortcuts/contract/host.js +12 -3
- package/dist/shortcuts/contract/index.js +17 -1
- package/dist/shortcuts/contract/manifest.js +398 -3
- package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
- package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
- package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
- package/dist/shortcuts/contract/operations/collection-node.js +229 -0
- package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
- package/dist/shortcuts/contract/operations/draft-build.js +940 -0
- package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
- package/dist/shortcuts/contract/operations/first-screen.js +3 -2
- package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
- package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
- package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
- package/dist/shortcuts/contract/operations/ledger.js +4 -1
- package/dist/shortcuts/contract/operations/metrics.js +9 -3
- package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
- package/dist/shortcuts/contract/operations/page.js +9 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
- package/dist/shortcuts/contract/operations/registry.js +20 -0
- package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
- package/dist/shortcuts/contract/operations/viewlink.js +334 -0
- package/dist/shortcuts/cowork/index.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +1 -1
- package/dist/shortcuts/ehr/index.js +2 -2
- package/dist/shortcuts/ehr/manifest.js +1 -1
- package/dist/shortcuts/ehr/operations/recruit-position.js +7 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +7 -6
- package/dist/shortcuts/ehr/operations/recruit.js +318 -248
- package/dist/shortcuts/ehr/operations/shared.js +22 -2
- package/dist/shortcuts/esb/index.js +1 -1
- package/dist/shortcuts/fna/index.js +1 -1
- package/dist/shortcuts/fna/manifest.js +1 -0
- package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
- package/dist/shortcuts/hrm/index.js +1 -1
- package/dist/shortcuts/invoice/index.js +1 -1
- package/dist/shortcuts/jiuchuanhui/index.js +2 -2
- package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
- package/dist/shortcuts/mail/index.js +2 -2
- package/dist/shortcuts/meeting/index.js +1 -1
- package/dist/shortcuts/meeting/manifest.js +1 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
- package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
- package/dist/shortcuts/meeting/operations/invitation.js +4 -4
- package/dist/shortcuts/meeting/operations/link.js +3 -1
- package/dist/shortcuts/okr/index.js +1 -1
- package/dist/shortcuts/performance/index.js +1 -1
- package/dist/shortcuts/plan/index.js +1 -1
- package/dist/shortcuts/project/index.js +1 -1
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/recruit-stage/context.js +10 -2
- package/dist/shortcuts/recruit-stage/index.js +16 -3
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +17 -8
- package/dist/shortcuts/recruit-stage/operations/list.js +1 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +178 -35
- package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +4 -2
- package/dist/shortcuts/recruit-stage/shared.js +27 -53
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
- package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
- package/dist/shortcuts/workflow/index.js +2 -2
- package/dist/shortcuts/workflow/manifest.js +1 -0
- package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
- package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
- package/dist/shortcuts/workflow/operations/form.js +8 -2
- package/docs/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
- package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
- package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
- package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
- package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
- package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
- package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
- package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
- package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
- package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
- package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
- package/skills/weaver-e10-meeting/SKILL.md +13 -0
- package/skills/weaver-e10-okr/SKILL.md +11 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
- package/skills/weaver-e10-performance/SKILL.md +131 -39
- package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
- package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
- package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
- package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
- package/skills/weaver-e10-plan/SKILL.md +10 -0
- package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
- package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
- package/skills/weaver-e10-recruit-stage/SKILL.md +188 -169
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +55 -37
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +168 -35
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +175 -7
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
- package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
- package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +12 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +16 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +10 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +6 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +31 -23
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +16 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +147 -34
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +16 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +6 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +24 -15
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +7 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +8 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +5 -1
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +41 -28
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +23 -26
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +32 -30
- package/skills/weaver-e10-shared/SKILL.md +40 -5
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
- package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
- package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
- package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
- package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
- package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +5 -5
- package/dist/chunks/chunk-ICP53R52.js +0 -2849
- package/dist/chunks/registry-RIQ67ZT7.js +0 -27
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createE10RequestRuntime,
|
|
5
|
+
isE10SessionExpiredResponse,
|
|
6
|
+
requireE10Session
|
|
7
|
+
} from "./chunk-MXCRKXOP.js";
|
|
8
|
+
import {
|
|
9
|
+
E10_REAUTH_GUIDANCE,
|
|
10
|
+
E10_SESSION_EXPIRED_MESSAGE
|
|
11
|
+
} from "./chunk-IZCQU5D5.js";
|
|
12
|
+
import {
|
|
13
|
+
getActiveProfile
|
|
14
|
+
} from "./chunk-QVKRNL7L.js";
|
|
15
|
+
import {
|
|
16
|
+
CliError
|
|
17
|
+
} from "./chunk-UG5G54VL.js";
|
|
18
|
+
|
|
19
|
+
// src/shortcuts/invoice/errors.ts
|
|
20
|
+
var InvoiceCliError = class extends CliError {
|
|
21
|
+
type;
|
|
22
|
+
subtype;
|
|
23
|
+
code;
|
|
24
|
+
retryable;
|
|
25
|
+
stage;
|
|
26
|
+
details;
|
|
27
|
+
partialData;
|
|
28
|
+
constructor(type, subtype, message, options = {}) {
|
|
29
|
+
super(message, options.exitCode ?? 5 /* InternalError */);
|
|
30
|
+
this.name = "InvoiceCliError";
|
|
31
|
+
this.type = type;
|
|
32
|
+
this.subtype = subtype;
|
|
33
|
+
this.code = options.code;
|
|
34
|
+
this.retryable = options.retryable ?? false;
|
|
35
|
+
this.stage = options.stage;
|
|
36
|
+
this.details = options.details;
|
|
37
|
+
this.partialData = options.partialData;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function invoiceValidationError(subtype, message, details) {
|
|
41
|
+
return new InvoiceCliError("validation", subtype, message, {
|
|
42
|
+
details,
|
|
43
|
+
exitCode: 2 /* UsageError */
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function invoiceAuthError(subtype, message, details) {
|
|
47
|
+
return new InvoiceCliError("authentication", subtype, message, {
|
|
48
|
+
details,
|
|
49
|
+
exitCode: 3 /* AuthError */
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function invoiceNetworkError(subtype, message, options = {}) {
|
|
53
|
+
return new InvoiceCliError("network", subtype, message, {
|
|
54
|
+
...options,
|
|
55
|
+
retryable: options.retryable ?? true,
|
|
56
|
+
exitCode: 4 /* NetworkError */
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function invoiceConfirmationError(action, details) {
|
|
60
|
+
return new InvoiceCliError("confirmation", "required", "\u8BE5\u64CD\u4F5C\u9700\u8981\u660E\u786E\u786E\u8BA4", {
|
|
61
|
+
details: { action, ...details },
|
|
62
|
+
exitCode: 10 /* ConfirmationRequired */
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function invoicePartialError(message, partialData, details) {
|
|
66
|
+
return new InvoiceCliError("partial", "write_uncertain", message, {
|
|
67
|
+
details,
|
|
68
|
+
partialData,
|
|
69
|
+
exitCode: 11 /* Partial */
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function isInvoiceNetworkError(error) {
|
|
73
|
+
return Boolean(
|
|
74
|
+
error && typeof error === "object" && "type" in error && error.type === "network"
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/shortcuts/invoice/host.ts
|
|
79
|
+
import { createHash } from "node:crypto";
|
|
80
|
+
import { readFile } from "node:fs/promises";
|
|
81
|
+
var MAX_DOWNLOAD_BYTES = 50 * 1024 * 1024;
|
|
82
|
+
var TOKEN_SERVICE = "cn.weaver.weaver-work-cli.invoice-token";
|
|
83
|
+
var INVOICE_SESSION_EXPIRED_CODE = "-2";
|
|
84
|
+
function assertPath(requestPath) {
|
|
85
|
+
if (typeof requestPath !== "string" || !requestPath.startsWith("/") || requestPath.startsWith("//")) {
|
|
86
|
+
throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u5FC5\u987B\u662F\u76F8\u5BF9\u7EDD\u5BF9\u8DEF\u5F84");
|
|
87
|
+
}
|
|
88
|
+
if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
|
|
89
|
+
throw invoiceValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
|
|
90
|
+
}
|
|
91
|
+
if (!requestPath.startsWith("/api/")) {
|
|
92
|
+
throw invoiceValidationError("path_not_allowed", "\u4E1A\u7968\u901A\u53EA\u80FD\u8C03\u7528 /api/ \u8DEF\u5F84");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function responseRoot(value) {
|
|
96
|
+
return value?.res_base || value?.data?.res_base || value;
|
|
97
|
+
}
|
|
98
|
+
function responseMessage(value) {
|
|
99
|
+
const root = responseRoot(value);
|
|
100
|
+
return typeof root?.message === "string" ? root.message : typeof root?.msg === "string" ? root.msg : "\u6CDB\u5FAE\u63A5\u53E3\u8FD4\u56DE\u4E1A\u52A1\u5931\u8D25";
|
|
101
|
+
}
|
|
102
|
+
function responseCode(value) {
|
|
103
|
+
const root = responseRoot(value);
|
|
104
|
+
return root?.ret ?? root?.code;
|
|
105
|
+
}
|
|
106
|
+
function isInvoiceSessionExpired(value) {
|
|
107
|
+
const code = responseCode(value);
|
|
108
|
+
return code !== void 0 && String(code) === INVOICE_SESSION_EXPIRED_CODE;
|
|
109
|
+
}
|
|
110
|
+
function tokenAccount(session) {
|
|
111
|
+
return createHash("sha256").update(`${session.profile}
|
|
112
|
+
${session.baseUrl}
|
|
113
|
+
${session.userId}`).digest("hex");
|
|
114
|
+
}
|
|
115
|
+
function createInvoiceTokenStore(session) {
|
|
116
|
+
const account = tokenAccount(session);
|
|
117
|
+
let entryPromise = null;
|
|
118
|
+
async function entry() {
|
|
119
|
+
if (!entryPromise) {
|
|
120
|
+
entryPromise = import("@napi-rs/keyring").then(({ Entry }) => new Entry(TOKEN_SERVICE, account));
|
|
121
|
+
}
|
|
122
|
+
return entryPromise;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
async load() {
|
|
126
|
+
try {
|
|
127
|
+
const value = await (await entry()).getPassword();
|
|
128
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
129
|
+
} catch {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
async save(token) {
|
|
134
|
+
if (!token.trim()) return false;
|
|
135
|
+
try {
|
|
136
|
+
await (await entry()).setPassword(token);
|
|
137
|
+
return true;
|
|
138
|
+
} catch {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
async clear() {
|
|
143
|
+
try {
|
|
144
|
+
await (await entry()).deletePassword();
|
|
145
|
+
return true;
|
|
146
|
+
} catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async function clearInvoiceTokenForSession(session) {
|
|
153
|
+
return createInvoiceTokenStore(session).clear();
|
|
154
|
+
}
|
|
155
|
+
function inferProfile(ctx) {
|
|
156
|
+
const options = ctx.getGlobalOptions();
|
|
157
|
+
return options.profile || getActiveProfile();
|
|
158
|
+
}
|
|
159
|
+
function trustedInvoiceHeaders(invoiceToken) {
|
|
160
|
+
return invoiceToken ? { token: invoiceToken } : {};
|
|
161
|
+
}
|
|
162
|
+
function createInvoiceHost(ctx, dependencies = {}) {
|
|
163
|
+
let e10Session = null;
|
|
164
|
+
let sessionContext = null;
|
|
165
|
+
let invoiceToken = null;
|
|
166
|
+
let tokenStore = null;
|
|
167
|
+
const requireSession = dependencies.requireSession || requireE10Session;
|
|
168
|
+
const tokenStoreFactory = dependencies.tokenStoreFactory || createInvoiceTokenStore;
|
|
169
|
+
async function ensureSession() {
|
|
170
|
+
if (!e10Session) {
|
|
171
|
+
e10Session = await requireSession(ctx);
|
|
172
|
+
sessionContext = {
|
|
173
|
+
baseUrl: e10Session.getBaseUrl(),
|
|
174
|
+
profile: inferProfile(ctx),
|
|
175
|
+
userId: e10Session.userId
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return e10Session;
|
|
179
|
+
}
|
|
180
|
+
async function getSession() {
|
|
181
|
+
await ensureSession();
|
|
182
|
+
return sessionContext;
|
|
183
|
+
}
|
|
184
|
+
async function ensureInvoiceToken(timeoutMs = 3e4) {
|
|
185
|
+
await ensureSession();
|
|
186
|
+
const context = await getSession();
|
|
187
|
+
tokenStore ||= tokenStoreFactory(context);
|
|
188
|
+
if (invoiceToken) return invoiceToken;
|
|
189
|
+
invoiceToken = await tokenStore.load();
|
|
190
|
+
if (invoiceToken) return invoiceToken;
|
|
191
|
+
const tokenResponse = await invoiceRequest({
|
|
192
|
+
method: "GET",
|
|
193
|
+
path: "/api/inc/proxy/getToken",
|
|
194
|
+
query: { appType: 1 },
|
|
195
|
+
needsInvoiceToken: false,
|
|
196
|
+
timeoutMs
|
|
197
|
+
});
|
|
198
|
+
const token = tokenResponse?.data?.token;
|
|
199
|
+
if (typeof token !== "string" || !token.trim()) {
|
|
200
|
+
throw invoiceAuthError("invoice_token_missing", "\u672A\u53D6\u5F97\u4E1A\u7968\u901A\u4E1A\u52A1 Token");
|
|
201
|
+
}
|
|
202
|
+
await tokenStore.save(token);
|
|
203
|
+
invoiceToken = token;
|
|
204
|
+
return token;
|
|
205
|
+
}
|
|
206
|
+
async function ensureContext(needsInvoiceToken, timeoutMs, path) {
|
|
207
|
+
await ensureSession();
|
|
208
|
+
const tokenEndpoint = path === "/api/inc/proxy/getToken" || path === "/api/app/inc/proxy/getToken";
|
|
209
|
+
if (tokenEndpoint) return void 0;
|
|
210
|
+
if (!needsInvoiceToken) {
|
|
211
|
+
}
|
|
212
|
+
return ensureInvoiceToken(timeoutMs);
|
|
213
|
+
}
|
|
214
|
+
async function clearCachedInvoiceToken() {
|
|
215
|
+
invoiceToken = null;
|
|
216
|
+
await tokenStore?.clear().catch(() => false);
|
|
217
|
+
}
|
|
218
|
+
async function runtime() {
|
|
219
|
+
return createE10RequestRuntime(ctx, await ensureSession(), {
|
|
220
|
+
interceptors: dependencies.interceptors,
|
|
221
|
+
fetch: dependencies.fetch
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function businessError(value) {
|
|
225
|
+
const code = responseCode(value);
|
|
226
|
+
return new InvoiceCliError("api", "business_error", responseMessage(value), {
|
|
227
|
+
code: String(code),
|
|
228
|
+
details: { ret: code },
|
|
229
|
+
exitCode: 1
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async function handleBusinessResponse(value, retry, canRetry) {
|
|
233
|
+
const code = responseCode(value);
|
|
234
|
+
if (code === void 0 || code === 0 || code === 200) return value;
|
|
235
|
+
if (isInvoiceSessionExpired(value)) {
|
|
236
|
+
await clearCachedInvoiceToken();
|
|
237
|
+
if (canRetry) return retry();
|
|
238
|
+
throw invoiceAuthError(
|
|
239
|
+
"invoice_session_expired",
|
|
240
|
+
`\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
|
|
241
|
+
{ ret: code }
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
throw businessError(value);
|
|
245
|
+
}
|
|
246
|
+
async function invoiceRequest(request, canRetryExpiredToken = true) {
|
|
247
|
+
const {
|
|
248
|
+
method = "POST",
|
|
249
|
+
path,
|
|
250
|
+
query,
|
|
251
|
+
headers,
|
|
252
|
+
body,
|
|
253
|
+
operation,
|
|
254
|
+
needsInvoiceToken = true,
|
|
255
|
+
timeoutMs = 3e4
|
|
256
|
+
} = request;
|
|
257
|
+
assertPath(path);
|
|
258
|
+
const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
|
|
259
|
+
const response = await (await runtime()).requestJson({
|
|
260
|
+
module: "invoice",
|
|
261
|
+
operation,
|
|
262
|
+
method,
|
|
263
|
+
path,
|
|
264
|
+
query,
|
|
265
|
+
headers,
|
|
266
|
+
body,
|
|
267
|
+
timeoutMs,
|
|
268
|
+
trustedHeaders: trustedInvoiceHeaders(token)
|
|
269
|
+
});
|
|
270
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
271
|
+
throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
272
|
+
}
|
|
273
|
+
if (response.parseError) {
|
|
274
|
+
if (response.status < 200 || response.status >= 300) {
|
|
275
|
+
throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
276
|
+
code: response.status,
|
|
277
|
+
details: { status: response.status },
|
|
278
|
+
exitCode: 1
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
|
|
282
|
+
}
|
|
283
|
+
if (response.status < 200 || response.status >= 300) {
|
|
284
|
+
throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
285
|
+
code: response.status,
|
|
286
|
+
details: { status: response.status, message: responseMessage(response.value) },
|
|
287
|
+
exitCode: 1
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
let value = response.value;
|
|
291
|
+
if (request.rewriteJsonText && response.text) {
|
|
292
|
+
try {
|
|
293
|
+
value = JSON.parse(request.rewriteJsonText(response.text));
|
|
294
|
+
} catch {
|
|
295
|
+
value = response.value;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return handleBusinessResponse(value, () => invoiceRequest(request, false), canRetryExpiredToken && Boolean(token));
|
|
299
|
+
}
|
|
300
|
+
async function invoiceMultipartRequest(request, canRetryExpiredToken = true) {
|
|
301
|
+
const {
|
|
302
|
+
method = "POST",
|
|
303
|
+
path,
|
|
304
|
+
query,
|
|
305
|
+
fields = {},
|
|
306
|
+
file,
|
|
307
|
+
headers,
|
|
308
|
+
operation,
|
|
309
|
+
needsInvoiceToken = true,
|
|
310
|
+
timeoutMs = 3e4
|
|
311
|
+
} = request;
|
|
312
|
+
if (!file && !Object.values(fields).some((value) => value !== void 0 && value !== null && value !== "")) {
|
|
313
|
+
throw invoiceValidationError("input_invalid", "multipart \u8BF7\u6C42\u9700\u8981\u6587\u4EF6\u3001URL \u6216\u8868\u5355\u5B57\u6BB5");
|
|
314
|
+
}
|
|
315
|
+
assertPath(path);
|
|
316
|
+
const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
|
|
317
|
+
const form = new FormData();
|
|
318
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
319
|
+
if (value === void 0 || value === null) continue;
|
|
320
|
+
form.append(key, typeof value === "string" ? value : JSON.stringify(value));
|
|
321
|
+
}
|
|
322
|
+
if (file) {
|
|
323
|
+
const content = await readFile(file.path);
|
|
324
|
+
form.append("file", new Blob([content], { type: file.mimeType || "application/octet-stream" }), file.name);
|
|
325
|
+
}
|
|
326
|
+
const response = await (await runtime()).requestJson({
|
|
327
|
+
module: "invoice",
|
|
328
|
+
operation,
|
|
329
|
+
method,
|
|
330
|
+
path,
|
|
331
|
+
query,
|
|
332
|
+
headers,
|
|
333
|
+
formData: form,
|
|
334
|
+
timeoutMs,
|
|
335
|
+
trustedHeaders: trustedInvoiceHeaders(token)
|
|
336
|
+
});
|
|
337
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
338
|
+
throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
339
|
+
}
|
|
340
|
+
if (response.parseError) {
|
|
341
|
+
throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
|
|
342
|
+
}
|
|
343
|
+
if (response.status < 200 || response.status >= 300) {
|
|
344
|
+
throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
345
|
+
code: response.status,
|
|
346
|
+
details: { status: response.status, message: responseMessage(response.value) },
|
|
347
|
+
exitCode: 1
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return handleBusinessResponse(response.value, () => invoiceMultipartRequest(request, false), canRetryExpiredToken && Boolean(token));
|
|
351
|
+
}
|
|
352
|
+
async function invoiceFormRequest(request, canRetryExpiredToken = true) {
|
|
353
|
+
const {
|
|
354
|
+
method = "POST",
|
|
355
|
+
path,
|
|
356
|
+
query,
|
|
357
|
+
fields = {},
|
|
358
|
+
operation,
|
|
359
|
+
needsInvoiceToken = true,
|
|
360
|
+
timeoutMs = 3e4
|
|
361
|
+
} = request;
|
|
362
|
+
assertPath(path);
|
|
363
|
+
const token = await ensureContext(needsInvoiceToken, timeoutMs, path);
|
|
364
|
+
const form = new URLSearchParams();
|
|
365
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
366
|
+
if (value === void 0 || value === null) continue;
|
|
367
|
+
form.set(key, typeof value === "string" ? value : JSON.stringify(value));
|
|
368
|
+
}
|
|
369
|
+
const response = await (await runtime()).requestJson({
|
|
370
|
+
module: "invoice",
|
|
371
|
+
operation,
|
|
372
|
+
method,
|
|
373
|
+
path,
|
|
374
|
+
query,
|
|
375
|
+
form,
|
|
376
|
+
timeoutMs,
|
|
377
|
+
trustedHeaders: trustedInvoiceHeaders(token)
|
|
378
|
+
});
|
|
379
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
380
|
+
throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
381
|
+
}
|
|
382
|
+
if (response.parseError) {
|
|
383
|
+
throw invoiceNetworkError("protocol", `\u63A5\u53E3\u8FD4\u56DE\u4E0D\u662F\u5408\u6CD5 JSON\uFF08HTTP ${response.status}\uFF09`, { retryable: false });
|
|
384
|
+
}
|
|
385
|
+
if (response.status < 200 || response.status >= 300) {
|
|
386
|
+
throw new InvoiceCliError("api", "http_error", `\u6CDB\u5FAE\u63A5\u53E3 HTTP ${response.status}`, {
|
|
387
|
+
code: response.status,
|
|
388
|
+
details: { status: response.status, message: responseMessage(response.value) },
|
|
389
|
+
exitCode: 1
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
return handleBusinessResponse(response.value, () => invoiceFormRequest(request, false), canRetryExpiredToken && Boolean(token));
|
|
393
|
+
}
|
|
394
|
+
async function invoiceDownload({ id, fid, needLog = false, operation, timeoutMs = 3e4 }, canRetryExpiredToken = true) {
|
|
395
|
+
const token = await ensureContext(true, timeoutMs, "/api/inc/file/download");
|
|
396
|
+
const response = await (await runtime()).requestBinary({
|
|
397
|
+
module: "invoice",
|
|
398
|
+
operation,
|
|
399
|
+
method: "GET",
|
|
400
|
+
path: "/api/inc/file/download",
|
|
401
|
+
query: { id, fid, needLog },
|
|
402
|
+
headers: { Accept: "application/octet-stream, application/pdf, */*" },
|
|
403
|
+
timeoutMs,
|
|
404
|
+
trustedHeaders: trustedInvoiceHeaders(token)
|
|
405
|
+
});
|
|
406
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
407
|
+
throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
408
|
+
}
|
|
409
|
+
const contentType = response.contentType;
|
|
410
|
+
const declaredLength = Number(response.headers.get("content-length"));
|
|
411
|
+
if (Number.isFinite(declaredLength) && declaredLength > MAX_DOWNLOAD_BYTES) {
|
|
412
|
+
throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
|
|
413
|
+
}
|
|
414
|
+
const content = response.content;
|
|
415
|
+
const looksLikeJson = /^[\s\r\n]*[\[{]/u.test(content.subarray(0, 64).toString("utf8"));
|
|
416
|
+
if (response.status < 200 || response.status >= 300 || contentType.includes("json") || looksLikeJson) {
|
|
417
|
+
let value = {};
|
|
418
|
+
try {
|
|
419
|
+
value = JSON.parse(content.toString("utf8"));
|
|
420
|
+
} catch {
|
|
421
|
+
value = {};
|
|
422
|
+
}
|
|
423
|
+
if (isInvoiceSessionExpired(value)) {
|
|
424
|
+
await clearCachedInvoiceToken();
|
|
425
|
+
if (canRetryExpiredToken && token) return invoiceDownload({ id, fid, needLog, operation, timeoutMs }, false);
|
|
426
|
+
throw invoiceAuthError(
|
|
427
|
+
"invoice_session_expired",
|
|
428
|
+
`\u53D1\u7968\u4E1A\u52A1\u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u5DF2\u6E05\u7406\u672C\u5730\u53D1\u7968 Token\u3002${E10_REAUTH_GUIDANCE}`,
|
|
429
|
+
{ ret: responseCode(value), status: response.status }
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
throw new InvoiceCliError("api", "download_failed", responseMessage(value) || `\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${response.status}\uFF09`, {
|
|
433
|
+
code: response.status,
|
|
434
|
+
details: { status: response.status, ret: responseCode(value) },
|
|
435
|
+
exitCode: 1
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
if (!content.length) {
|
|
439
|
+
throw invoiceNetworkError("protocol", "\u4E0B\u8F7D\u63A5\u53E3\u8FD4\u56DE\u7A7A\u6587\u4EF6", { retryable: false });
|
|
440
|
+
}
|
|
441
|
+
if (content.length > MAX_DOWNLOAD_BYTES) {
|
|
442
|
+
throw invoiceNetworkError("response_too_large", `\u4E0B\u8F7D\u6587\u4EF6\u8D85\u8FC7 ${MAX_DOWNLOAD_BYTES} \u5B57\u8282\u9650\u5236`, { retryable: false });
|
|
443
|
+
}
|
|
444
|
+
return { content, contentType };
|
|
445
|
+
}
|
|
446
|
+
return {
|
|
447
|
+
invoiceRequest,
|
|
448
|
+
invoiceMultipartRequest,
|
|
449
|
+
invoiceFormRequest,
|
|
450
|
+
invoiceDownload,
|
|
451
|
+
getSession,
|
|
452
|
+
invalidateToken() {
|
|
453
|
+
invoiceToken = null;
|
|
454
|
+
void clearCachedInvoiceToken();
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export {
|
|
460
|
+
InvoiceCliError,
|
|
461
|
+
invoiceValidationError,
|
|
462
|
+
invoiceConfirmationError,
|
|
463
|
+
invoicePartialError,
|
|
464
|
+
isInvoiceNetworkError,
|
|
465
|
+
clearInvoiceTokenForSession,
|
|
466
|
+
createInvoiceHost
|
|
467
|
+
};
|