weaver-work-cli 0.1.73 → 0.1.76
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-ENBSUMHV.js} +14 -9
- package/dist/chunks/{archive-oa-PQ23OLEV.js → archive-oa-7BFPQ6M5.js} +10 -7
- package/dist/chunks/{asset-RGPROZYH.js → asset-V5SUD3PW.js} +10 -7
- package/dist/chunks/{asset-idle-Z2PDX7NA.js → asset-idle-3CEL7WFX.js} +7 -4
- package/dist/chunks/{attachment-content-R3RPVOYE.js → attachment-content-24RL44SE.js} +3 -3
- package/dist/chunks/{blog-7U3QZPIF.js → blog-FLI4SS3P.js} +10 -7
- package/dist/chunks/{caizhilian-3AB42GCV.js → caizhilian-7WCTKCCP.js} +10 -7
- package/dist/chunks/{calendar-KINM64E4.js → calendar-G726HUUH.js} +10 -7
- package/dist/chunks/chunk-257JXJGD.js +30 -0
- package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
- package/dist/chunks/{chunk-4BXR6CNB.js → chunk-2KW7AI6P.js} +2 -2
- package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
- package/dist/chunks/chunk-2UV4IZIT.js +473 -0
- package/dist/chunks/{chunk-R3MK2RBN.js → chunk-5E2FDXBU.js} +1 -1
- package/dist/chunks/{chunk-DRUND2PJ.js → chunk-5QUTQHXF.js} +225 -152
- package/dist/chunks/chunk-7DE3VMZD.js +35 -0
- package/dist/chunks/{chunk-PAFOLIYQ.js → chunk-AZC53XSQ.js} +1 -1
- package/dist/chunks/{chunk-6HT73VOI.js → chunk-BWFCTE43.js} +2 -2
- package/dist/chunks/{chunk-4YXAK6OA.js → chunk-FEZK536Z.js} +12 -7
- package/dist/chunks/{chunk-IU6UB2TD.js → chunk-FPWCCRKT.js} +48 -6
- package/dist/chunks/{chunk-LLCMOZ5L.js → chunk-H6N6U2D6.js} +11 -11
- package/dist/chunks/{chunk-54ST55IJ.js → chunk-JJONWB5N.js} +11 -1
- package/dist/chunks/{chunk-GWJLAF6B.js → chunk-JWF2R6EQ.js} +0 -462
- package/dist/chunks/chunk-KINXYJXM.js +205 -0
- package/dist/chunks/{chunk-F4HM25K4.js → chunk-KJA7CRES.js} +1 -1
- package/dist/chunks/chunk-L5SCNJKX.js +1166 -0
- package/dist/chunks/{chunk-TV46Q4NY.js → chunk-MS7MKBGJ.js} +74 -68
- package/dist/chunks/{chunk-XZBYRYWX.js → chunk-NZQRW4KL.js} +2 -2
- package/dist/chunks/chunk-OJ4JPD25.js +428 -0
- package/dist/chunks/chunk-OVTCWLNQ.js +1346 -0
- package/dist/chunks/{chunk-NUP4RYZK.js → chunk-PMRNIGKZ.js} +2 -2
- package/dist/chunks/{chunk-2CHGUYMG.js → chunk-Q7RXCK2Y.js} +4 -4
- package/dist/chunks/{chunk-AMAPQVBT.js → chunk-QVKRNL7L.js} +286 -305
- package/dist/chunks/{chunk-7QFVXP2X.js → chunk-R4PN3OFK.js} +8 -7
- package/dist/chunks/{chunk-L7TYG5SN.js → chunk-RVEKGVZU.js} +2 -2
- package/dist/chunks/{chunk-2XED2FKY.js → chunk-SQFKBWTR.js} +38 -36
- package/dist/chunks/chunk-SU6IJD6D.js +49 -0
- package/dist/chunks/{chunk-IBSJJGXL.js → chunk-T7HVQ2WP.js} +2 -2
- package/dist/chunks/{chunk-ZWLWXHJC.js → chunk-TBCKK6LH.js} +2 -2
- package/dist/chunks/{chunk-JMJBPP4B.js → chunk-UDBQJLQF.js} +2 -2
- package/dist/chunks/chunk-UUJK76HV.js +209 -0
- package/dist/chunks/{chunk-4I26YMBY.js → chunk-WHI6YAUE.js} +7 -3
- package/dist/chunks/{chunk-BWYVS62Z.js → chunk-WJQJ7YEX.js} +4 -4
- package/dist/chunks/{chunk-GAMGDNTF.js → chunk-XNN5PZTI.js} +1 -1
- package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
- package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
- package/dist/chunks/cli-DFLV57LO.js +226 -0
- package/dist/chunks/commands-J52MJ6NF.js +70 -0
- package/dist/chunks/{conflict-VPAR7E6F.js → conflict-72Q6DM4I.js} +2 -2
- package/dist/chunks/{contract-DDXAO2DZ.js → contract-IRNRQ5FY.js} +12446 -5964
- package/dist/chunks/{cowork-34QCHMDD.js → cowork-GZDODGKF.js} +11 -8
- package/dist/chunks/{create-flow-52PU2OBI.js → create-flow-UGTDI7SP.js} +6 -6
- package/dist/chunks/{data-CLQ62QGD.js → data-HTQZRPPI.js} +6 -3
- package/dist/chunks/{ebuilder-form-W5R7Q22S.js → ebuilder-form-GHNIZ7ET.js} +9 -6
- package/dist/chunks/{ehr-LCNAVMK5.js → ehr-PHIBBUIG.js} +23 -16
- package/dist/chunks/{entry-mode-6Z3ZV3DE.js → entry-mode-5WOXFE67.js} +3 -3
- package/dist/chunks/{env-RDKWAARB.js → env-H4ALHESA.js} +2 -2
- package/dist/chunks/{esb-ANKPUU65.js → esb-ATRKVHCD.js} +10 -7
- package/dist/chunks/{factory-434B7RAT.js → factory-COX6AVK7.js} +1 -1
- package/dist/chunks/{fna-AKBSG5HI.js → fna-IKYI3SST.js} +13 -8
- package/dist/chunks/{group-chat-PROTW22R.js → group-chat-ZIWQQO4G.js} +3 -3
- package/dist/chunks/{host-5R2SNFWD.js → host-6UOXYOOY.js} +6 -3
- package/dist/chunks/{host-7FJW4E7R.js → host-EJSJSLVK.js} +6 -3
- package/dist/chunks/{host-WO4L5G5I.js → host-EYNLB6S4.js} +6 -3
- package/dist/chunks/{host-PDJAKCT7.js → host-OT4KNR3G.js} +6 -3
- package/dist/chunks/{host-CGXUFQO4.js → host-UY4LQPN4.js} +6 -3
- package/dist/chunks/{host-XIYG4F4B.js → host-XXGDQM7D.js} +6 -3
- package/dist/chunks/{hrm-WGODDTEH.js → hrm-5JQ7QZ6A.js} +8 -5
- package/dist/chunks/{im-YKTKAJU3.js → im-2YJW3EI5.js} +7 -4
- package/dist/chunks/{invoice-PVYCCCVM.js → invoice-37HR6L3W.js} +956 -566
- package/dist/chunks/{jiuchuanhui-RKOQW7BY.js → jiuchuanhui-KBWUZ7WT.js} +17 -10
- package/dist/chunks/{lazy-dispatch-DW45AFQ5.js → lazy-dispatch-MZ3EZYDL.js} +22 -8
- package/dist/chunks/{mail-BNB5S4NW.js → mail-YBKUM6HM.js} +11 -8
- package/dist/chunks/{meeting-O2KDJH66.js → meeting-XE6CTXYA.js} +22 -18
- package/dist/chunks/{minute-doc-JUCG56GY.js → minute-doc-4BA2R5EA.js} +4 -4
- package/dist/chunks/{okr-LWFGWOE7.js → okr-HW7IULIR.js} +10 -7
- package/dist/chunks/{operations-532PN5OB.js → operations-4P2UYVLH.js} +7 -4
- package/dist/chunks/{performance-7W5COCFU.js → performance-PM2G6L3E.js} +6 -3
- package/dist/chunks/{plan-ZVY3IYTL.js → plan-3YYGZ7ZM.js} +10 -7
- package/dist/chunks/{project-SA62B7MH.js → project-XREEXFU2.js} +10 -7
- package/dist/chunks/{reception-NGIONPQ3.js → reception-7G3J2MA6.js} +8 -4
- package/dist/chunks/{recruit-stage-WOSN6MGP.js → recruit-stage-TSQWOGQD.js} +199 -74
- package/dist/chunks/register-SQOPIR2G.js +16 -0
- package/dist/chunks/{registry-N7P3W2RD.js → registry-3VTB3KLV.js} +7 -4
- package/dist/chunks/registry-7UDUWYB5.js +30 -0
- package/dist/chunks/{registry-R72GWXOG.js → registry-F4YFZLOD.js} +7 -3
- package/dist/chunks/{room-recommend-KCGIVUFR.js → room-recommend-FO3HLPNB.js} +4 -4
- package/dist/chunks/root-YZG2TS5W.js +16 -0
- package/dist/chunks/{schedule-6UP27HQ4.js → schedule-DHNNOHVS.js} +4 -4
- package/dist/chunks/{smart-extract-DDOQSPRB.js → smart-extract-T5Z4AULN.js} +15 -7
- package/dist/chunks/update-AV5VOXGY.js +13 -0
- package/dist/chunks/{workflow-V5ALD6QZ.js → workflow-MAGCHWYZ.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/business-response.js +13 -0
- package/dist/shortcuts/invoice/calendar.js +24 -0
- package/dist/shortcuts/invoice/host.js +26 -15
- package/dist/shortcuts/invoice/index.js +3 -3
- package/dist/shortcuts/invoice/invoice-record.js +7 -2
- package/dist/shortcuts/invoice/manifest.js +179 -155
- package/dist/shortcuts/invoice/operations/get.js +9 -3
- package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
- package/dist/shortcuts/invoice/operations/registry.js +4 -5
- package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
- package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
- package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
- package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
- package/dist/shortcuts/invoice/operations/reim.js +2 -126
- package/dist/shortcuts/invoice/operations/shared.js +15 -17
- package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
- package/dist/shortcuts/invoice/projection.js +14 -0
- package/dist/shortcuts/invoice/read-enrichment.js +123 -0
- 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/agent-invoice.md +28 -2
- package/docs/contract.md +6 -1
- package/docs/e10-auth.md +25 -7
- package/docs/invoice.md +60 -9
- package/docs/operation-manual.md +15 -0
- package/package.json +2 -2
- package/skill-template/business-info.json +28 -0
- package/skill-template/domains/jinchengda.md +13 -1
- package/skill-template/domains/yepiaotong.md +36 -7
- 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 +230 -202
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +74 -46
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +3 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +201 -36
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +336 -27
- 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 +20 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +11 -7
- 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 +8 -4
- 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 +32 -25
- 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 +148 -40
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +5 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +32 -8
- 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 +41 -41
- 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 +44 -36
- 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/SKILL.md +133 -61
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
- package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
- package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
- package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
- package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
- package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
- package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
- package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
- package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
- package/skills/weaver-e10-yepiaotong.zip +0 -0
- package/dist/chunks/chunk-ICP53R52.js +0 -2849
- package/dist/chunks/registry-RIQ67ZT7.js +0 -27
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
isXiaoEHostEnvironment
|
|
5
|
+
} from "./chunk-7DE3VMZD.js";
|
|
6
|
+
|
|
7
|
+
// src/internal/update/service.ts
|
|
8
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
9
|
+
import { readFileSync as readFileSync2, realpathSync as realpathSync2 } from "node:fs";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { basename, dirname as dirname2, join as join3, resolve as resolve2 } from "node:path";
|
|
12
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
13
|
+
|
|
14
|
+
// src/internal/update/npm.ts
|
|
15
|
+
import { execFile } from "node:child_process";
|
|
16
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
17
|
+
import { delimiter, dirname, join, resolve } from "node:path";
|
|
18
|
+
function findNpmCli(env, execPath = process.execPath) {
|
|
19
|
+
const nodeDir = dirname(realpathSync(execPath));
|
|
20
|
+
const candidates = [
|
|
21
|
+
env.npm_execpath,
|
|
22
|
+
join(nodeDir, "node_modules", "npm", "bin", "npm-cli.js"),
|
|
23
|
+
resolve(nodeDir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")
|
|
24
|
+
];
|
|
25
|
+
for (const dir of (env.PATH || env.Path || "").split(delimiter)) {
|
|
26
|
+
if (!dir) continue;
|
|
27
|
+
candidates.push(join(dir, "npm"), join(dir, "node_modules", "npm", "bin", "npm-cli.js"));
|
|
28
|
+
}
|
|
29
|
+
for (const candidate of candidates) {
|
|
30
|
+
if (!candidate || !existsSync(candidate)) continue;
|
|
31
|
+
try {
|
|
32
|
+
const path = realpathSync(candidate);
|
|
33
|
+
if (path.endsWith("npm-cli.js")) return path;
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
function npmRunner(npmCli, env, cwd) {
|
|
40
|
+
return (args, timeout) => new Promise((resolveOutput, reject) => {
|
|
41
|
+
execFile(process.execPath, [npmCli, ...args], {
|
|
42
|
+
env,
|
|
43
|
+
cwd,
|
|
44
|
+
timeout,
|
|
45
|
+
windowsHide: true,
|
|
46
|
+
encoding: "utf8",
|
|
47
|
+
maxBuffer: 1024 * 1024
|
|
48
|
+
}, (error, stdout) => {
|
|
49
|
+
if (error) reject(new Error("npm \u64CD\u4F5C\u5931\u8D25\u6216\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u3001npm \u914D\u7F6E\u548C\u5B89\u88C5\u76EE\u5F55\u6743\u9650\u3002"));
|
|
50
|
+
else resolveOutput(stdout);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function compareVersions(left, right) {
|
|
55
|
+
const parse = (value) => {
|
|
56
|
+
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);
|
|
57
|
+
if (!match || match.slice(1, 4).some((part) => !Number.isSafeInteger(Number(part)))) return void 0;
|
|
58
|
+
const pre = match[4]?.split(".");
|
|
59
|
+
if (pre?.some((part) => /^\d+$/.test(part) && (part.length > 1 && part[0] === "0"))) return void 0;
|
|
60
|
+
return { numbers: match.slice(1, 4).map(Number), pre };
|
|
61
|
+
};
|
|
62
|
+
const a = parse(left), b = parse(right);
|
|
63
|
+
if (!a || !b) return void 0;
|
|
64
|
+
for (let i = 0; i < 3; i += 1) {
|
|
65
|
+
if (a.numbers[i] !== b.numbers[i]) return a.numbers[i] > b.numbers[i] ? 1 : -1;
|
|
66
|
+
}
|
|
67
|
+
if (!a.pre || !b.pre) return a.pre ? -1 : b.pre ? 1 : 0;
|
|
68
|
+
for (let i = 0; i < Math.max(a.pre.length, b.pre.length); i += 1) {
|
|
69
|
+
const x = a.pre[i], y = b.pre[i];
|
|
70
|
+
if (x === y) continue;
|
|
71
|
+
if (x === void 0) return -1;
|
|
72
|
+
if (y === void 0) return 1;
|
|
73
|
+
const xn = /^\d+$/.test(x), yn = /^\d+$/.test(y);
|
|
74
|
+
if (xn && yn) return x.length !== y.length ? Math.sign(x.length - y.length) : x > y ? 1 : -1;
|
|
75
|
+
if (xn !== yn) return xn ? -1 : 1;
|
|
76
|
+
return x > y ? 1 : -1;
|
|
77
|
+
}
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/internal/update/store.ts
|
|
82
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
83
|
+
import { existsSync as existsSync2, mkdirSync, openSync, closeSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
84
|
+
import { join as join2 } from "node:path";
|
|
85
|
+
var UPDATE_INTERVAL_MS = 24 * 60 * 6e4;
|
|
86
|
+
function alive(pid) {
|
|
87
|
+
if (!Number.isSafeInteger(pid) || pid <= 0) return false;
|
|
88
|
+
try {
|
|
89
|
+
process.kill(pid, 0);
|
|
90
|
+
return true;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
return error.code !== "ESRCH";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
var UpdateStore = class {
|
|
96
|
+
constructor(home, packageRoot) {
|
|
97
|
+
this.packageRoot = packageRoot;
|
|
98
|
+
const installation = createHash("sha256").update(packageRoot).digest("hex").slice(0, 24);
|
|
99
|
+
this.dir = join2(home, "state", "updates", installation);
|
|
100
|
+
this.statePath = join2(this.dir, "state.json");
|
|
101
|
+
}
|
|
102
|
+
packageRoot;
|
|
103
|
+
dir;
|
|
104
|
+
statePath;
|
|
105
|
+
read() {
|
|
106
|
+
try {
|
|
107
|
+
const value = JSON.parse(readFileSync(this.statePath, "utf8"));
|
|
108
|
+
if (value?.schemaVersion === 1 && typeof value === "object") return value;
|
|
109
|
+
} catch {
|
|
110
|
+
}
|
|
111
|
+
return { schemaVersion: 1 };
|
|
112
|
+
}
|
|
113
|
+
write(state) {
|
|
114
|
+
mkdirSync(this.dir, { recursive: true });
|
|
115
|
+
const temp = join2(this.dir, `state-${process.pid}-${randomUUID()}.tmp`);
|
|
116
|
+
try {
|
|
117
|
+
writeFileSync(temp, JSON.stringify(state) + "\n", { mode: 384, flag: "wx" });
|
|
118
|
+
renameSync(temp, this.statePath);
|
|
119
|
+
} finally {
|
|
120
|
+
try {
|
|
121
|
+
unlinkSync(temp);
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** Never wait for another checker. A dead process's lock is reclaimable. */
|
|
127
|
+
lock(name) {
|
|
128
|
+
mkdirSync(this.dir, { recursive: true });
|
|
129
|
+
const path = join2(this.dir, `${name}.lock`);
|
|
130
|
+
const token = randomUUID();
|
|
131
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
132
|
+
try {
|
|
133
|
+
const fd = openSync(path, "wx", 384);
|
|
134
|
+
try {
|
|
135
|
+
writeFileSync(fd, JSON.stringify({ pid: process.pid, token }));
|
|
136
|
+
} finally {
|
|
137
|
+
closeSync(fd);
|
|
138
|
+
}
|
|
139
|
+
return () => {
|
|
140
|
+
try {
|
|
141
|
+
if (JSON.parse(readFileSync(path, "utf8")).token === token) unlinkSync(path);
|
|
142
|
+
} catch {
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
} catch (error) {
|
|
146
|
+
if (error.code !== "EEXIST") throw error;
|
|
147
|
+
try {
|
|
148
|
+
const raw = readFileSync(path, "utf8");
|
|
149
|
+
let stale = false;
|
|
150
|
+
try {
|
|
151
|
+
stale = !alive(JSON.parse(raw).pid);
|
|
152
|
+
} catch {
|
|
153
|
+
stale = Date.now() - statSync(path).mtimeMs > 3e4;
|
|
154
|
+
}
|
|
155
|
+
if (!stale) return void 0;
|
|
156
|
+
if (readFileSync(path, "utf8") === raw) unlinkSync(path);
|
|
157
|
+
} catch {
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
/** Register under the same gate held by an installer, before loading runtime chunks. */
|
|
165
|
+
enter() {
|
|
166
|
+
const unlock = this.lock("gate");
|
|
167
|
+
if (!unlock) return void 0;
|
|
168
|
+
try {
|
|
169
|
+
const dir = join2(this.dir, "active");
|
|
170
|
+
mkdirSync(dir, { recursive: true });
|
|
171
|
+
const path = join2(dir, `${process.pid}-${randomUUID()}`);
|
|
172
|
+
writeFileSync(path, "", { flag: "wx", mode: 384 });
|
|
173
|
+
const release = () => {
|
|
174
|
+
try {
|
|
175
|
+
unlinkSync(path);
|
|
176
|
+
} catch {
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return release;
|
|
180
|
+
} finally {
|
|
181
|
+
unlock();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
activeProcesses() {
|
|
185
|
+
const dir = join2(this.dir, "active");
|
|
186
|
+
if (!existsSync2(dir)) return [];
|
|
187
|
+
const active = /* @__PURE__ */ new Set();
|
|
188
|
+
for (const entry of readdirSync(dir)) {
|
|
189
|
+
const pid = Number(entry.split("-")[0]);
|
|
190
|
+
if (pid === process.pid) continue;
|
|
191
|
+
if (alive(pid)) active.add(pid);
|
|
192
|
+
else {
|
|
193
|
+
try {
|
|
194
|
+
unlinkSync(join2(dir, entry));
|
|
195
|
+
} catch {
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return [...active];
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/internal/update/service.ts
|
|
204
|
+
var NAME = "weaver-work-cli";
|
|
205
|
+
var CHECK_TIMEOUT_MS = 3e3;
|
|
206
|
+
var INSTALL_TIMEOUT_MS = 12e4;
|
|
207
|
+
var UpdateService = class {
|
|
208
|
+
constructor(options) {
|
|
209
|
+
this.options = options;
|
|
210
|
+
this.env = options.env;
|
|
211
|
+
this.now = options.now || Date.now;
|
|
212
|
+
this.store = new UpdateStore(
|
|
213
|
+
options.home || this.env.WEAVER_WORK_CLI_HOME || this.env.WORK_CLI_HOME || resolve2(homedir(), ".weaver-work-cli"),
|
|
214
|
+
realpathSync2(options.packageRoot)
|
|
215
|
+
);
|
|
216
|
+
this.isNpmInstallation = basename(dirname2(this.store.packageRoot)) === "node_modules" && basename(this.store.packageRoot) === NAME;
|
|
217
|
+
if (isXiaoEHostEnvironment(this.env, options)) this.skipReason = "xiaoe_host_managed";
|
|
218
|
+
else if (["off", "0", "false"].includes((this.env.WEAVER_WORK_CLI_UPDATE || "").toLowerCase())) this.skipReason = "disabled";
|
|
219
|
+
else if (!this.isNpmInstallation) {
|
|
220
|
+
this.skipReason = "development_or_link";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
options;
|
|
224
|
+
store;
|
|
225
|
+
now;
|
|
226
|
+
skipReason;
|
|
227
|
+
isNpmInstallation;
|
|
228
|
+
env;
|
|
229
|
+
runner() {
|
|
230
|
+
if (this.options.runNpm) return this.options.runNpm;
|
|
231
|
+
const cli = findNpmCli(this.env);
|
|
232
|
+
if (!cli) throw new Error("\u672A\u627E\u5230\u5F53\u524D Node.js \u53EF\u7528\u7684 npm\uFF0C\u672A\u6267\u884C\u66F4\u65B0\u3002");
|
|
233
|
+
return npmRunner(cli, this.env, homedir());
|
|
234
|
+
}
|
|
235
|
+
async installation(run, timeout) {
|
|
236
|
+
let config;
|
|
237
|
+
try {
|
|
238
|
+
config = JSON.parse(await run(["config", "list", "--json"], timeout));
|
|
239
|
+
} catch {
|
|
240
|
+
throw new Error("\u65E0\u6CD5\u8BFB\u53D6 npm \u5B89\u88C5\u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5 npm \u662F\u5426\u53EF\u7528\u3002");
|
|
241
|
+
}
|
|
242
|
+
if (typeof config.prefix !== "string" || typeof config.registry !== "string") throw new Error("\u65E0\u6CD5\u8BC6\u522B npm \u5B89\u88C5\u914D\u7F6E\u3002");
|
|
243
|
+
const prefix = resolve2(config.prefix);
|
|
244
|
+
const expected = process.platform === "win32" ? join3(prefix, "node_modules", NAME) : join3(prefix, "lib", "node_modules", NAME);
|
|
245
|
+
let matches = false;
|
|
246
|
+
try {
|
|
247
|
+
matches = realpathSync2(expected) === this.store.packageRoot;
|
|
248
|
+
} catch {
|
|
249
|
+
}
|
|
250
|
+
if (!matches) throw new Error("\u5F53\u524D CLI \u4E0D\u662F\u6B64 npm \u7BA1\u7406\u7684\u5168\u5C40\u5B89\u88C5\uFF0C\u672A\u6267\u884C\u66F4\u65B0\u3002\u8BF7\u4F7F\u7528\u539F\u5B89\u88C5\u65B9\u5F0F\u7EF4\u62A4\u3002");
|
|
251
|
+
const registry = new URL(config.registry);
|
|
252
|
+
if (!["https:", "http:"].includes(registry.protocol) || registry.username || registry.password) {
|
|
253
|
+
throw new Error("npm registry \u914D\u7F6E\u4E0D\u53EF\u7528\u4E8E\u66F4\u65B0\u3002");
|
|
254
|
+
}
|
|
255
|
+
return { prefix, registry: registry.href };
|
|
256
|
+
}
|
|
257
|
+
status() {
|
|
258
|
+
if (this.skipReason) return { currentVersion: this.options.currentVersion, skipped: this.skipReason };
|
|
259
|
+
const state = this.store.read();
|
|
260
|
+
return {
|
|
261
|
+
currentVersion: this.options.currentVersion,
|
|
262
|
+
latestVersion: state.latestVersion,
|
|
263
|
+
lastAttemptAt: state.lastAttemptAt,
|
|
264
|
+
nextCheckAt: state.lastAttemptAt ? state.lastAttemptAt + UPDATE_INTERVAL_MS : void 0,
|
|
265
|
+
pending: this.validPending(state) ? state.pending : void 0
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
validPending(state) {
|
|
269
|
+
return typeof state.pending?.version === "string" && typeof state.pending.token === "string" && /^[a-f0-9-]{36}$/.test(state.pending.token) && compareVersions(state.pending.version, this.options.currentVersion) === 1;
|
|
270
|
+
}
|
|
271
|
+
async check(force = false) {
|
|
272
|
+
if (this.skipReason) return this.status();
|
|
273
|
+
const now = this.now();
|
|
274
|
+
const due = (state) => !Number.isFinite(state.lastAttemptAt) || now < state.lastAttemptAt || now - state.lastAttemptAt >= UPDATE_INTERVAL_MS;
|
|
275
|
+
if (!force && !due(this.store.read())) return { ...this.status(), cached: true };
|
|
276
|
+
const unlock = this.store.lock("check");
|
|
277
|
+
if (!unlock) return { ...this.status(), checking: true };
|
|
278
|
+
try {
|
|
279
|
+
const state = this.store.read();
|
|
280
|
+
if (!force && !due(state)) return { ...this.status(), cached: true };
|
|
281
|
+
state.lastAttemptAt = now;
|
|
282
|
+
this.store.write(state);
|
|
283
|
+
try {
|
|
284
|
+
const run = this.runner();
|
|
285
|
+
const started = Date.now();
|
|
286
|
+
const install = await this.installation(run, 1200);
|
|
287
|
+
const timeout = Math.max(1, CHECK_TIMEOUT_MS - (Date.now() - started));
|
|
288
|
+
const latest = JSON.parse(await run([
|
|
289
|
+
"view",
|
|
290
|
+
NAME,
|
|
291
|
+
"version",
|
|
292
|
+
"--json",
|
|
293
|
+
"--registry",
|
|
294
|
+
install.registry,
|
|
295
|
+
"--fetch-retries=0",
|
|
296
|
+
`--fetch-timeout=${timeout}`
|
|
297
|
+
], timeout));
|
|
298
|
+
if (typeof latest !== "string" || compareVersions(latest, this.options.currentVersion) === void 0) {
|
|
299
|
+
throw new Error("npm \u8FD4\u56DE\u7684\u7248\u672C\u53F7\u65E0\u6548\u3002");
|
|
300
|
+
}
|
|
301
|
+
state.latestVersion = latest;
|
|
302
|
+
state.prefix = install.prefix;
|
|
303
|
+
state.registry = install.registry;
|
|
304
|
+
if (compareVersions(latest, this.options.currentVersion) === 1) {
|
|
305
|
+
if (!this.validPending(state) || state.pending.version !== latest) {
|
|
306
|
+
state.pending = { version: latest, token: randomUUID2() };
|
|
307
|
+
}
|
|
308
|
+
} else delete state.pending;
|
|
309
|
+
this.store.write(state);
|
|
310
|
+
return { ...this.status(), checked: true };
|
|
311
|
+
} catch {
|
|
312
|
+
return { ...this.status(), checked: false, message: "\u7248\u672C\u68C0\u67E5\u672A\u5B8C\u6210\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u3001npm \u914D\u7F6E\u53CA\u5F53\u524D CLI \u662F\u5426\u4E3A npm \u5168\u5C40\u5B89\u88C5\uFF1B\u4E1A\u52A1\u547D\u4EE4\u7EE7\u7EED\u6267\u884C\u3002" };
|
|
313
|
+
}
|
|
314
|
+
} finally {
|
|
315
|
+
unlock();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/** Claim a reminder once per version per day, across processes and Agent sessions. */
|
|
319
|
+
notice(force = false) {
|
|
320
|
+
if (this.skipReason) return void 0;
|
|
321
|
+
const cached = this.store.read();
|
|
322
|
+
if (!this.validPending(cached)) return void 0;
|
|
323
|
+
const now = this.now();
|
|
324
|
+
const ready = (state) => this.validPending(state) && (force || !(state.pending.deferredUntil > now) && !(state.pending.notifiedAt > now - UPDATE_INTERVAL_MS));
|
|
325
|
+
if (!ready(cached)) return void 0;
|
|
326
|
+
const unlock = this.store.lock("check");
|
|
327
|
+
if (!unlock) return void 0;
|
|
328
|
+
try {
|
|
329
|
+
const state = this.store.read();
|
|
330
|
+
if (!ready(state)) return void 0;
|
|
331
|
+
state.pending.notifiedAt = now;
|
|
332
|
+
this.store.write(state);
|
|
333
|
+
const pending = state.pending;
|
|
334
|
+
return {
|
|
335
|
+
type: "cli_update_available",
|
|
336
|
+
currentVersion: this.options.currentVersion,
|
|
337
|
+
latestVersion: pending.version,
|
|
338
|
+
message: `CLI \u5F53\u524D\u7248\u672C ${this.options.currentVersion}\uFF0C\u53D1\u73B0\u65B0\u7248 ${pending.version}\u3002\u8BF7\u8C03\u7528\u5BBF\u4E3B\u7684\u63D0\u95EE/\u786E\u8BA4\u5DE5\u5177\u8BE2\u95EE\u7528\u6237\u662F\u5426\u66F4\u65B0\uFF1B\u786E\u8BA4\u540E\u624D\u6267\u884C commands.update\uFF0C\u9009\u62E9\u7A0D\u540E\u5219\u6267\u884C commands.later\u3002\u672C\u6B21\u4E1A\u52A1\u7EE7\u7EED\u6267\u884C\uFF0C\u65E0\u9700\u91CD\u8DD1\u3002`,
|
|
339
|
+
requiresConfirmation: true,
|
|
340
|
+
hostAction: "ask_user",
|
|
341
|
+
confirmationToken: pending.token,
|
|
342
|
+
commands: {
|
|
343
|
+
update: [NAME, "update", "apply", "--confirm", pending.token],
|
|
344
|
+
later: [NAME, "update", "defer", "--confirm", pending.token]
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
} finally {
|
|
348
|
+
unlock();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
defer(token) {
|
|
352
|
+
this.assertEnabled();
|
|
353
|
+
const unlock = this.store.lock("check");
|
|
354
|
+
if (!unlock) throw new Error("\u7248\u672C\u68C0\u67E5\u6B63\u5728\u8FDB\u884C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");
|
|
355
|
+
try {
|
|
356
|
+
const state = this.confirmedState(token);
|
|
357
|
+
state.pending.deferredUntil = this.now() + UPDATE_INTERVAL_MS;
|
|
358
|
+
this.store.write(state);
|
|
359
|
+
return { deferredUntil: state.pending.deferredUntil, version: state.pending.version };
|
|
360
|
+
} finally {
|
|
361
|
+
unlock();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
assertEnabled() {
|
|
365
|
+
if (this.skipReason) throw new Error(`\u5F53\u524D\u5B89\u88C5\u4E0D\u6267\u884C CLI \u81EA\u66F4\u65B0\uFF08${this.skipReason}\uFF09\u3002`);
|
|
366
|
+
}
|
|
367
|
+
confirmedState(token) {
|
|
368
|
+
const state = this.store.read();
|
|
369
|
+
if (!token || !this.validPending(state) || state.pending.token !== token) {
|
|
370
|
+
throw new Error("\u66F4\u65B0\u786E\u8BA4\u5DF2\u5931\u6548\uFF0C\u8BF7\u5148\u8FD0\u884C weaver-work-cli update check\uFF0C\u518D\u5411\u7528\u6237\u786E\u8BA4\u6307\u5B9A\u7248\u672C\u3002");
|
|
371
|
+
}
|
|
372
|
+
return state;
|
|
373
|
+
}
|
|
374
|
+
async apply(token, waitMs = 3e4) {
|
|
375
|
+
this.assertEnabled();
|
|
376
|
+
this.confirmedState(token);
|
|
377
|
+
const gate = this.store.lock("gate");
|
|
378
|
+
if (!gate) throw new Error("\u53E6\u4E00\u66F4\u65B0\u6216\u547D\u4EE4\u542F\u52A8\u6B63\u5728\u8FDB\u884C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");
|
|
379
|
+
const unlockCheck = this.store.lock("check");
|
|
380
|
+
if (!unlockCheck) {
|
|
381
|
+
gate();
|
|
382
|
+
throw new Error("\u7248\u672C\u68C0\u67E5\u6B63\u5728\u8FDB\u884C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");
|
|
383
|
+
}
|
|
384
|
+
try {
|
|
385
|
+
const state = this.confirmedState(token);
|
|
386
|
+
const run = this.runner();
|
|
387
|
+
const install = await this.installation(run, 3e3);
|
|
388
|
+
if (install.prefix !== state.prefix || install.registry !== state.registry) {
|
|
389
|
+
throw new Error("npm \u5B89\u88C5\u4F4D\u7F6E\u6216\u6E90\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u5E76\u786E\u8BA4\u66F4\u65B0\u3002");
|
|
390
|
+
}
|
|
391
|
+
const deadline = Date.now() + waitMs;
|
|
392
|
+
while (this.store.activeProcesses().length) {
|
|
393
|
+
if (Date.now() >= deadline) throw new Error("\u4ECD\u6709\u4E1A\u52A1\u547D\u4EE4\u8FD0\u884C\uFF0C\u672A\u4FEE\u6539 CLI \u5B89\u88C5\u3002\u8BF7\u7B49\u5F85\u7ED3\u675F\u540E\u91CD\u8BD5\u66F4\u65B0\u3002");
|
|
394
|
+
await delay(100);
|
|
395
|
+
}
|
|
396
|
+
const version = state.pending.version;
|
|
397
|
+
const before = JSON.parse(readFileSync2(join3(this.store.packageRoot, "package.json"), "utf8"));
|
|
398
|
+
if (before.name !== NAME || before.version !== this.options.currentVersion) {
|
|
399
|
+
throw new Error("CLI \u5B89\u88C5\u5DF2\u88AB\u5176\u4ED6\u7A0B\u5E8F\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\u7248\u672C\u540E\u518D\u786E\u8BA4\u66F4\u65B0\u3002");
|
|
400
|
+
}
|
|
401
|
+
await run([
|
|
402
|
+
"install",
|
|
403
|
+
"--global",
|
|
404
|
+
"--prefix",
|
|
405
|
+
install.prefix,
|
|
406
|
+
`${NAME}@${version}`,
|
|
407
|
+
"--registry",
|
|
408
|
+
install.registry,
|
|
409
|
+
"--no-audit",
|
|
410
|
+
"--no-fund",
|
|
411
|
+
"--fetch-retries=0"
|
|
412
|
+
], INSTALL_TIMEOUT_MS);
|
|
413
|
+
const installed = JSON.parse(readFileSync2(join3(this.store.packageRoot, "package.json"), "utf8"));
|
|
414
|
+
if (installed.name !== NAME || installed.version !== version) throw new Error("\u5B89\u88C5\u7ED3\u679C\u4E0E\u5DF2\u786E\u8BA4\u7248\u672C\u4E0D\u7B26\uFF0C\u8BF7\u4F7F\u7528\u539F\u5B89\u88C5\u65B9\u5F0F\u4FEE\u590D CLI\u3002");
|
|
415
|
+
delete state.pending;
|
|
416
|
+
state.lastAttemptAt = this.now();
|
|
417
|
+
this.store.write(state);
|
|
418
|
+
return { updated: true, version, packageRoot: this.store.packageRoot, restartRequired: true };
|
|
419
|
+
} finally {
|
|
420
|
+
unlockCheck();
|
|
421
|
+
gate();
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export {
|
|
427
|
+
UpdateService
|
|
428
|
+
};
|