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
|
@@ -7,6 +7,7 @@ import { writeWithRetry } from '../../../core/write-with-retry.js';
|
|
|
7
7
|
import { createTimeoutSignal } from '../network-error.js';
|
|
8
8
|
import { encryptAuthData, parseAuthFile } from './crypto.js';
|
|
9
9
|
import { lookupAgentHost } from './agent-hosts.js';
|
|
10
|
+
import { isIsolatedAgentHost, matchesAgentHost, resolveSessionHostKey } from './agent-host-key.js';
|
|
10
11
|
import { getE10ActiveProfilePath, getE10ProfilesRoot } from './paths.js';
|
|
11
12
|
/**
|
|
12
13
|
* teamsCheck 与会话探测都是「发业务请求之前的必经往返」,没有上限时一个半开
|
|
@@ -173,30 +174,44 @@ export function clearProfileAuthFile(profile = getActiveProfile()) {
|
|
|
173
174
|
/**
|
|
174
175
|
* 当前宿主应使用的 profile 名。
|
|
175
176
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
177
|
+
* 有宿主记录时优先用它;WorkBuddy / XiaoE 记录缺失时返回宿主自己的默认名,
|
|
178
|
+
* 其他宿主保留全局 profile 兼容行为。记录不可用时
|
|
178
179
|
* **仍然返回该 profile**,让上层按「未登录」处理,而不是静默借用别人的凭据。
|
|
179
180
|
*/
|
|
180
|
-
export function resolveActiveProfileForHost(env = process.env) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
export function resolveActiveProfileForHost(env = process.env, options = {}) {
|
|
182
|
+
const hostKey = resolveSessionHostKey(env, options);
|
|
183
|
+
const host = lookupAgentHost(env, hostKey);
|
|
184
|
+
return host ? host.profile : isIsolatedAgentHost(hostKey) ? hostKey : getActiveProfile();
|
|
183
185
|
}
|
|
184
|
-
export function findAuthFile(startDir = process.cwd(), options = {}) {
|
|
186
|
+
export function findAuthFile(startDir = process.cwd(), options = {}, env = process.env) {
|
|
187
|
+
const hostKey = resolveSessionHostKey(env, options);
|
|
188
|
+
const accept = (path) => {
|
|
189
|
+
if (!isIsolatedAgentHost(hostKey))
|
|
190
|
+
return path;
|
|
191
|
+
if (!existsSync(path))
|
|
192
|
+
return null;
|
|
193
|
+
const session = E10AuthSession.fromFile(path);
|
|
194
|
+
return session && matchesAgentHost(hostKey, session.agentType) ? path : null;
|
|
195
|
+
};
|
|
185
196
|
if (options.auth)
|
|
186
|
-
return options.auth;
|
|
197
|
+
return accept(options.auth);
|
|
187
198
|
if (options.profile) {
|
|
188
199
|
const profileAuth = getProfileAuthPath(options.profile);
|
|
189
200
|
if (existsSync(profileAuth))
|
|
190
|
-
return profileAuth;
|
|
201
|
+
return accept(profileAuth);
|
|
202
|
+
if (isIsolatedAgentHost(hostKey))
|
|
203
|
+
return null;
|
|
191
204
|
}
|
|
192
|
-
const envAuth =
|
|
193
|
-
if (envAuth && existsSync(envAuth))
|
|
194
|
-
return envAuth;
|
|
205
|
+
const envAuth = env.E10_AUTH_PATH;
|
|
206
|
+
if (envAuth && (existsSync(envAuth) || isIsolatedAgentHost(hostKey)))
|
|
207
|
+
return accept(envAuth);
|
|
195
208
|
// 宿主记录优先于全局指针:WorkBuddy 与智能小 E 各自认自己的那次登录。
|
|
196
209
|
// 记录存在但不可用时返回 null(视为未登录),不回落——回落等于跨宿主串用凭据。
|
|
197
|
-
const host = lookupAgentHost();
|
|
210
|
+
const host = lookupAgentHost(env, hostKey);
|
|
198
211
|
if (host)
|
|
199
|
-
return host.status === 'ok' ? host.authFile : null;
|
|
212
|
+
return host.status === 'ok' ? accept(host.authFile) : null;
|
|
213
|
+
if (isIsolatedAgentHost(hostKey))
|
|
214
|
+
return null;
|
|
200
215
|
const activeProfileAuth = getProfileAuthPath(getActiveProfile());
|
|
201
216
|
if (existsSync(activeProfileAuth))
|
|
202
217
|
return activeProfileAuth;
|
|
@@ -439,7 +454,7 @@ export class E10AuthSession {
|
|
|
439
454
|
return null;
|
|
440
455
|
}
|
|
441
456
|
}
|
|
442
|
-
static async fromOptions(options, startDir = process.cwd(), load = {}) {
|
|
457
|
+
static async fromOptions(options, startDir = process.cwd(), load = {}, env = process.env) {
|
|
443
458
|
let baseUrl = options.baseUrl;
|
|
444
459
|
let passportUrl = options.passportUrl;
|
|
445
460
|
if (options.profile) {
|
|
@@ -447,7 +462,7 @@ export class E10AuthSession {
|
|
|
447
462
|
baseUrl ||= cfg.baseUrl;
|
|
448
463
|
passportUrl ||= cfg.passportUrl;
|
|
449
464
|
}
|
|
450
|
-
const authPath = findAuthFile(startDir, options);
|
|
465
|
+
const authPath = findAuthFile(startDir, options, env);
|
|
451
466
|
if (!authPath)
|
|
452
467
|
return null;
|
|
453
468
|
const session = E10AuthSession.fromFile(authPath, baseUrl, passportUrl);
|
|
@@ -4,7 +4,7 @@ import { homedir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { CliError, ExitCode } from '../../../core/errors.js';
|
|
6
6
|
import { packagePath } from '../../../core/package-paths.js';
|
|
7
|
-
import {
|
|
7
|
+
import { isXiaoEHostEnvironment } from '../../../core/runtime-agent.js';
|
|
8
8
|
import { createTimeoutSignal, isAbortError, isNetworkErrorCode, looksLikeTransportMessage, readErrorCauseCode, } from '../network-error.js';
|
|
9
9
|
import { buildE10CookieHeader, E10_TEAMS_CHECK_TIMEOUT_MS, E10AuthSession, extractRawSetCookie, extractSessionTicket, profileNameFromUrl, readTeamsCheckUserInfo, saveAuthFile, saveProfileConfig, setActiveProfile, } from './session.js';
|
|
10
10
|
import { resolveLoginProfileName, upsertAgentHost } from './agent-hosts.js';
|
|
@@ -258,23 +258,7 @@ function envString(env, ...keys) {
|
|
|
258
258
|
* is treated as XiaoE host evidence.
|
|
259
259
|
*/
|
|
260
260
|
export function hasXiaoEEnv(env = process.env, options = {}) {
|
|
261
|
-
|
|
262
|
-
return true;
|
|
263
|
-
// XiaoE reserves this prefix for host-injected runtime variables. Presence
|
|
264
|
-
// of any matching key is sufficient; the value may legitimately be empty.
|
|
265
|
-
if (Object.keys(env).some((key) => key.startsWith('XIAOE_')))
|
|
266
|
-
return true;
|
|
267
|
-
// An explicitly named host remains authoritative over credential signals.
|
|
268
|
-
const explicitHostAgentType = envString(env, 'WORKBUDDY_AGENT_TYPE', 'CODEX_AGENT_TYPE');
|
|
269
|
-
if (explicitHostAgentType)
|
|
270
|
-
return isXiaoERuntimeAgent(explicitHostAgentType);
|
|
271
|
-
// Generic framework markers can coexist with stale profile metadata, so they
|
|
272
|
-
// take precedence over WEAVER_AGENT_TYPE when no XIAOE_* variable is present.
|
|
273
|
-
if (Object.keys(env).some((key) => key.startsWith('WORKBUDDY_') || key.startsWith('CODEX_'))) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
const explicitAgentType = envString(env, 'WEAVER_AGENT_TYPE');
|
|
277
|
-
return explicitAgentType ? isXiaoERuntimeAgent(explicitAgentType) : false;
|
|
261
|
+
return isXiaoEHostEnvironment(env, options);
|
|
278
262
|
}
|
|
279
263
|
export function resolveXiaoEClientType(env = process.env) {
|
|
280
264
|
const raw = envString(env, 'XIAOE_CLIENT_TYPE').toLowerCase();
|
|
@@ -1270,7 +1254,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
1270
1254
|
const profile = resolveLoginProfileName({
|
|
1271
1255
|
derivedName: profileNameFromUrl(baseUrl),
|
|
1272
1256
|
baseUrl,
|
|
1273
|
-
hostKey:
|
|
1257
|
+
hostKey: 'xiaoe',
|
|
1274
1258
|
profileHint: input.profileHint,
|
|
1275
1259
|
});
|
|
1276
1260
|
setActiveProfile(profile);
|
|
@@ -1300,7 +1284,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
1300
1284
|
};
|
|
1301
1285
|
const authFile = saveAuthFile(authData, profile);
|
|
1302
1286
|
saveProfileConfig(baseUrl, baseUrl, profile, tenantKey);
|
|
1303
|
-
upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey:
|
|
1287
|
+
upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey: 'xiaoe' });
|
|
1304
1288
|
const session = new E10AuthSession(authData, authFile);
|
|
1305
1289
|
return {
|
|
1306
1290
|
session,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { isXiaoERuntimeAgent } from '../../core/runtime-agent.js';
|
|
2
|
-
import {
|
|
2
|
+
import { E10AuthSession, readProfileConfig, resolveActiveProfileForHost } from './auth/session.js';
|
|
3
|
+
import { resolveSessionHostKey } from './auth/agent-host-key.js';
|
|
4
|
+
import { getE10AuthRoot } from './auth/paths.js';
|
|
3
5
|
import { appendXiaoEAuthErrorLog, xiaoEAuthLogSecrets } from './auth/error-log.js';
|
|
4
6
|
import { hasXiaoEEnv, resolveXiaoEPreferredBaseUrl, tryXiaoEUnifiedLogin, } from './auth/xiaoe.js';
|
|
5
7
|
const AUTH_REQUIRED_CODES = new Set(['-2', '401']);
|
|
@@ -247,6 +249,8 @@ export function canAutomaticallyRecoverXiaoE(ctx, currentSession) {
|
|
|
247
249
|
// by a profile-backed XiaoE session behind the caller's back.
|
|
248
250
|
if (options.auth)
|
|
249
251
|
return false;
|
|
252
|
+
if (resolveSessionHostKey(ctx.env || process.env, options) === 'workbuddy')
|
|
253
|
+
return false;
|
|
250
254
|
return hasXiaoEEnv(ctx.env || process.env, options)
|
|
251
255
|
|| currentSession?.loginSource === 'xiaoe-unified'
|
|
252
256
|
|| isXiaoERuntimeAgent(currentSession?.agentType);
|
|
@@ -296,14 +300,15 @@ export async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession
|
|
|
296
300
|
if (!canAutomaticallyRecoverXiaoE(ctx, currentSession))
|
|
297
301
|
return emptyOutcome();
|
|
298
302
|
const options = globalOptions(ctx);
|
|
299
|
-
const
|
|
303
|
+
const hostKey = resolveSessionHostKey(ctx.env || process.env, options);
|
|
304
|
+
const profile = options.profile || resolveActiveProfileForHost(ctx.env, options);
|
|
300
305
|
const config = readProfileConfig(profile);
|
|
301
306
|
const baseUrl = resolveXiaoEPreferredBaseUrl({
|
|
302
307
|
explicitBaseUrl: currentSession?.getBaseUrl() || options.baseUrl,
|
|
303
308
|
profileBaseUrl: config.baseUrl,
|
|
304
309
|
env: ctx.env,
|
|
305
310
|
});
|
|
306
|
-
const key = `${profile}\n${baseUrl}`;
|
|
311
|
+
const key = `${getE10AuthRoot()}\n${hostKey}\n${profile}\n${baseUrl}`;
|
|
307
312
|
const existing = recoveryInFlight.get(key);
|
|
308
313
|
if (existing)
|
|
309
314
|
return existing;
|
|
@@ -317,7 +322,8 @@ export async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession
|
|
|
317
322
|
allowBundledEnvScript: true,
|
|
318
323
|
allowTokenScript: true,
|
|
319
324
|
tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
|
|
320
|
-
profileHint: profile,
|
|
325
|
+
profileHint: options.profile || (hostKey === 'xiaoe' && !currentSession ? undefined : profile),
|
|
326
|
+
hostKey: 'xiaoe',
|
|
321
327
|
diagnostics,
|
|
322
328
|
logger: recoveryLogger(ctx),
|
|
323
329
|
});
|
|
@@ -353,6 +359,40 @@ export async function recoverXiaoEAuthSessionWithDiagnostics(ctx, currentSession
|
|
|
353
359
|
recoveryInFlight.delete(key);
|
|
354
360
|
}
|
|
355
361
|
}
|
|
362
|
+
/** Missing WorkBuddy credentials always use WorkBuddy OAuth, never XiaoE token exchange. */
|
|
363
|
+
const workBuddyLoginInFlight = new Map();
|
|
364
|
+
export async function recoverWorkBuddyAuthSession(ctx, login = async (context, options) => {
|
|
365
|
+
const { runBrowserLogin } = await import('./auth/commands.js');
|
|
366
|
+
const previousMachineMode = context.logger.machineMode;
|
|
367
|
+
context.logger.machineMode = true;
|
|
368
|
+
try {
|
|
369
|
+
return await runBrowserLogin(context, options, { machine: true });
|
|
370
|
+
}
|
|
371
|
+
finally {
|
|
372
|
+
context.logger.machineMode = previousMachineMode;
|
|
373
|
+
}
|
|
374
|
+
}) {
|
|
375
|
+
const options = globalOptions(ctx);
|
|
376
|
+
if (options.auth || resolveSessionHostKey(ctx.env || process.env, options) !== 'workbuddy')
|
|
377
|
+
return null;
|
|
378
|
+
const profile = options.profile || resolveActiveProfileForHost(ctx.env, options);
|
|
379
|
+
const key = `${getE10AuthRoot()}\n${profile}\n${options.baseUrl || ''}`;
|
|
380
|
+
const existing = workBuddyLoginInFlight.get(key);
|
|
381
|
+
if (existing)
|
|
382
|
+
return existing;
|
|
383
|
+
const recovery = (async () => {
|
|
384
|
+
await login(ctx, { agentType: 'workbuddy' });
|
|
385
|
+
return E10AuthSession.fromOptions(options, ctx.cwd, { skipProfileEnrichment: true }, ctx.env);
|
|
386
|
+
})();
|
|
387
|
+
workBuddyLoginInFlight.set(key, recovery);
|
|
388
|
+
try {
|
|
389
|
+
return await recovery;
|
|
390
|
+
}
|
|
391
|
+
finally {
|
|
392
|
+
if (workBuddyLoginInFlight.get(key) === recovery)
|
|
393
|
+
workBuddyLoginInFlight.delete(key);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
356
396
|
export function sameE10SessionIdentity(current, recovered) {
|
|
357
397
|
const currentBaseUrl = current.getBaseUrl().replace(/\/+$/u, '').toLowerCase();
|
|
358
398
|
const recoveredBaseUrl = recovered.getBaseUrl().replace(/\/+$/u, '').toLowerCase();
|
|
@@ -6,7 +6,7 @@ import { E10AuthSession, getActiveProfile } from './auth/session.js';
|
|
|
6
6
|
import { E10ApiClient } from './client.js';
|
|
7
7
|
import { isTlsTrustErrorCode, looksLikeTlsTrustMessage } from './network-error.js';
|
|
8
8
|
import { currentE10TlsPolicyStatus, summarizeE10TlsPolicy } from './tls-policy.js';
|
|
9
|
-
import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession, recoverXiaoEAuthSessionWithDiagnostics, } from './auth-recovery.js';
|
|
9
|
+
import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession, recoverXiaoEAuthSessionWithDiagnostics, recoverWorkBuddyAuthSession, } from './auth-recovery.js';
|
|
10
10
|
/**
|
|
11
11
|
* 把一次失败的静默恢复转成可定位的结构化错误。文案按归因分流:只有网络层
|
|
12
12
|
* 完全没打通时才提示「稍后重试」(此时登录态根本没被验证过,让人去重新登录
|
|
@@ -93,7 +93,7 @@ function xiaoERecoveryFailedError(diagnostics, resultSessionExpired = false, env
|
|
|
93
93
|
}
|
|
94
94
|
export async function getE10Session(ctx, load = {}) {
|
|
95
95
|
const options = ctx.getGlobalOptions();
|
|
96
|
-
return E10AuthSession.fromOptions(options, ctx.cwd, load);
|
|
96
|
+
return E10AuthSession.fromOptions(options, ctx.cwd, load, ctx.env);
|
|
97
97
|
}
|
|
98
98
|
export async function requireE10Session(ctx, load = {}) {
|
|
99
99
|
const options = ctx.getGlobalOptions();
|
|
@@ -127,6 +127,9 @@ export async function requireE10Session(ctx, load = {}) {
|
|
|
127
127
|
throw xiaoERecoveryFailedError(outcome?.diagnostics, false, ctx.env);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
if (!session) {
|
|
131
|
+
session = await recoverWorkBuddyAuthSession(ctx);
|
|
132
|
+
}
|
|
130
133
|
if (!session) {
|
|
131
134
|
throw new CliError(E10_AUTH_REQUIRED_MESSAGE, ExitCode.AuthError);
|
|
132
135
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
|
+
import { firstPositionalToken, VALUE_TAKING_GLOBAL_OPTIONS } from '../../cmd/argv.js';
|
|
5
|
+
import { packageRootDir } from '../../core/package-paths.js';
|
|
6
|
+
import { emitUpdateNotice, setUpdateNotice } from '../../core/update-notice.js';
|
|
7
|
+
import { UpdateService } from './service.js';
|
|
8
|
+
/** Minimal argv inspection before the real Commander parser; never interprets business inputs. */
|
|
9
|
+
export function runtimeAgentFromArgv(argv) {
|
|
10
|
+
let runtimeAgent;
|
|
11
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
12
|
+
const token = argv[index];
|
|
13
|
+
if (token === '--')
|
|
14
|
+
break;
|
|
15
|
+
if (token.startsWith('--runtime-agent='))
|
|
16
|
+
runtimeAgent = token.slice('--runtime-agent='.length);
|
|
17
|
+
else if (VALUE_TAKING_GLOBAL_OPTIONS.has(token)) {
|
|
18
|
+
const value = argv[++index];
|
|
19
|
+
if (token === '--runtime-agent')
|
|
20
|
+
runtimeAgent = value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return runtimeAgent;
|
|
24
|
+
}
|
|
25
|
+
export function startupCommand(argv) {
|
|
26
|
+
// The shortcut loader intentionally treats optional connector values loosely.
|
|
27
|
+
// Update dispatch must also recognize the documented --is-connector true form.
|
|
28
|
+
const normalized = argv.filter((token, index) => !(index > 0 && argv[index - 1] === '--is-connector'
|
|
29
|
+
&& ['true', 'false', '1', '0', 'yes', 'no'].includes(token.toLowerCase())));
|
|
30
|
+
return firstPositionalToken(normalized);
|
|
31
|
+
}
|
|
32
|
+
export async function bootstrap(argv = process.argv.slice(2)) {
|
|
33
|
+
const root = packageRootDir();
|
|
34
|
+
const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
35
|
+
const updater = new UpdateService({
|
|
36
|
+
packageRoot: root, currentVersion: pkg.version, env: process.env, runtimeAgent: runtimeAgentFromArgv(argv),
|
|
37
|
+
});
|
|
38
|
+
const command = startupCommand(argv);
|
|
39
|
+
const informational = !command || argv.some((arg) => ['--help', '-h', '--version', '-V'].includes(arg));
|
|
40
|
+
let release;
|
|
41
|
+
// All npm-package invocations register before importing runtime chunks, including those
|
|
42
|
+
// with checking disabled. The updater waits for them before replacing the installation.
|
|
43
|
+
if (updater.isNpmInstallation) {
|
|
44
|
+
try {
|
|
45
|
+
const deadline = Date.now() + 2_000;
|
|
46
|
+
while (!(release = updater.store.enter())) {
|
|
47
|
+
if (Date.now() >= deadline) {
|
|
48
|
+
process.stderr.write(JSON.stringify({
|
|
49
|
+
ok: false, error: { type: 'cli', subtype: 'update_in_progress', retryable: true,
|
|
50
|
+
message: 'CLI 正在更新,请稍后重新执行命令。' },
|
|
51
|
+
}) + '\n');
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
return { handled: true };
|
|
54
|
+
}
|
|
55
|
+
await delay(25);
|
|
56
|
+
}
|
|
57
|
+
process.once('exit', release);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Read-only/unavailable cache must not prevent ordinary use. An installer needs
|
|
61
|
+
// the same writable state directory, so it will fail closed in this environment.
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const cleanup = () => {
|
|
65
|
+
if (release) {
|
|
66
|
+
process.removeListener('exit', release);
|
|
67
|
+
release();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
if (command === 'update') {
|
|
71
|
+
try {
|
|
72
|
+
// No business runtime is loaded during an in-place update. Do not import it afterward.
|
|
73
|
+
const [{ createProgram }, { registerCommands }, { updateCommand }] = await Promise.all([
|
|
74
|
+
import('../../cmd/root.js'), import('../../cmd/register.js'), import('../../cmd/update/index.js'),
|
|
75
|
+
]);
|
|
76
|
+
const { program, ctx } = createProgram();
|
|
77
|
+
await registerCommands(program, ctx, [updateCommand]);
|
|
78
|
+
await program.parseAsync();
|
|
79
|
+
return { handled: true };
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
cleanup();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (!informational && !updater.skipReason) {
|
|
86
|
+
try {
|
|
87
|
+
await updater.check();
|
|
88
|
+
if (!argv.includes('--quiet')) {
|
|
89
|
+
setUpdateNotice(updater.notice());
|
|
90
|
+
process.once('exit', emitUpdateNotice);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch { /* Checking and reminder persistence must never fail the business command. */ }
|
|
94
|
+
}
|
|
95
|
+
return { handled: false, release: cleanup };
|
|
96
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
3
|
+
import { delimiter, dirname, join, resolve } from 'node:path';
|
|
4
|
+
/** Invoke npm through Node, avoiding npm.cmd/shell quoting on Windows. */
|
|
5
|
+
export function findNpmCli(env, execPath = process.execPath) {
|
|
6
|
+
const nodeDir = dirname(realpathSync(execPath));
|
|
7
|
+
const candidates = [
|
|
8
|
+
env.npm_execpath,
|
|
9
|
+
join(nodeDir, 'node_modules', 'npm', 'bin', 'npm-cli.js'),
|
|
10
|
+
resolve(nodeDir, '..', 'lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'),
|
|
11
|
+
];
|
|
12
|
+
for (const dir of (env.PATH || env.Path || '').split(delimiter)) {
|
|
13
|
+
if (!dir)
|
|
14
|
+
continue;
|
|
15
|
+
candidates.push(join(dir, 'npm'), join(dir, 'node_modules', 'npm', 'bin', 'npm-cli.js'));
|
|
16
|
+
}
|
|
17
|
+
for (const candidate of candidates) {
|
|
18
|
+
if (!candidate || !existsSync(candidate))
|
|
19
|
+
continue;
|
|
20
|
+
try {
|
|
21
|
+
const path = realpathSync(candidate);
|
|
22
|
+
if (path.endsWith('npm-cli.js'))
|
|
23
|
+
return path;
|
|
24
|
+
}
|
|
25
|
+
catch { /* Try the next executable. */ }
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
export function npmRunner(npmCli, env, cwd) {
|
|
30
|
+
return (args, timeout) => new Promise((resolveOutput, reject) => {
|
|
31
|
+
execFile(process.execPath, [npmCli, ...args], {
|
|
32
|
+
env, cwd, timeout, windowsHide: true, encoding: 'utf8', maxBuffer: 1024 * 1024,
|
|
33
|
+
}, (error, stdout) => {
|
|
34
|
+
// Do not propagate npm stderr/config output: registry credentials may occur there.
|
|
35
|
+
if (error)
|
|
36
|
+
reject(new Error('npm 操作失败或超时,请检查网络、npm 配置和安装目录权限。'));
|
|
37
|
+
else
|
|
38
|
+
resolveOutput(stdout);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** SemVer ordering, including prereleases; never compare version strings lexically. */
|
|
43
|
+
export function compareVersions(left, right) {
|
|
44
|
+
const parse = (value) => {
|
|
45
|
+
const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.exec(value);
|
|
46
|
+
if (!match || match.slice(1, 4).some((part) => !Number.isSafeInteger(Number(part))))
|
|
47
|
+
return undefined;
|
|
48
|
+
const pre = match[4]?.split('.');
|
|
49
|
+
if (pre?.some((part) => /^\d+$/.test(part) && (part.length > 1 && part[0] === '0')))
|
|
50
|
+
return undefined;
|
|
51
|
+
return { numbers: match.slice(1, 4).map(Number), pre };
|
|
52
|
+
};
|
|
53
|
+
const a = parse(left), b = parse(right);
|
|
54
|
+
if (!a || !b)
|
|
55
|
+
return undefined;
|
|
56
|
+
for (let i = 0; i < 3; i += 1) {
|
|
57
|
+
if (a.numbers[i] !== b.numbers[i])
|
|
58
|
+
return a.numbers[i] > b.numbers[i] ? 1 : -1;
|
|
59
|
+
}
|
|
60
|
+
if (!a.pre || !b.pre)
|
|
61
|
+
return a.pre ? -1 : b.pre ? 1 : 0;
|
|
62
|
+
for (let i = 0; i < Math.max(a.pre.length, b.pre.length); i += 1) {
|
|
63
|
+
const x = a.pre[i], y = b.pre[i];
|
|
64
|
+
if (x === y)
|
|
65
|
+
continue;
|
|
66
|
+
if (x === undefined)
|
|
67
|
+
return -1;
|
|
68
|
+
if (y === undefined)
|
|
69
|
+
return 1;
|
|
70
|
+
const xn = /^\d+$/.test(x), yn = /^\d+$/.test(y);
|
|
71
|
+
if (xn && yn)
|
|
72
|
+
return x.length !== y.length ? Math.sign(x.length - y.length) : x > y ? 1 : -1;
|
|
73
|
+
if (xn !== yn)
|
|
74
|
+
return xn ? -1 : 1;
|
|
75
|
+
return x > y ? 1 : -1;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
}
|