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
|
@@ -1,35 +1,91 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
isConnectorMode
|
|
5
|
+
} from "./chunk-Y3C6MDL7.js";
|
|
6
|
+
import {
|
|
7
|
+
isXiaoEHostEnvironment,
|
|
8
|
+
isXiaoERuntimeAgent
|
|
9
|
+
} from "./chunk-7DE3VMZD.js";
|
|
10
|
+
import {
|
|
11
|
+
packagePath
|
|
12
|
+
} from "./chunk-2BZ7TY4M.js";
|
|
3
13
|
import {
|
|
4
14
|
CliError
|
|
5
15
|
} from "./chunk-UG5G54VL.js";
|
|
6
16
|
|
|
7
|
-
// src/internal/e10/auth/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
17
|
+
// src/internal/e10/auth/paths.ts
|
|
18
|
+
import { homedir } from "node:os";
|
|
19
|
+
import { resolve } from "node:path";
|
|
20
|
+
function getE10AuthRoot() {
|
|
21
|
+
const override = process.env.WEAVER_WORK_CLI_AUTH_ROOT?.trim();
|
|
22
|
+
return override ? resolve(override) : resolve(homedir(), ".weaver-work-cli", "e10");
|
|
23
|
+
}
|
|
24
|
+
function getE10ProfilesRoot() {
|
|
25
|
+
return resolve(getE10AuthRoot(), "profiles");
|
|
26
|
+
}
|
|
27
|
+
function getE10ActiveProfilePath() {
|
|
28
|
+
return resolve(getE10AuthRoot(), "profile");
|
|
29
|
+
}
|
|
30
|
+
function getE10AgentsPath() {
|
|
31
|
+
return resolve(getE10AuthRoot(), "agents.json");
|
|
32
|
+
}
|
|
11
33
|
|
|
12
|
-
// src/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
// src/internal/e10/auth/agent-host-key.ts
|
|
35
|
+
function hasEnvPrefix(env, prefix) {
|
|
36
|
+
return Object.keys(env).some((key) => key === prefix || key.startsWith(`${prefix}_`));
|
|
37
|
+
}
|
|
38
|
+
var AGENT_HOST_PREFIXES = [
|
|
39
|
+
{ key: "xiaoe", prefixes: ["XIAOE", "WEAVER_XIAOE"] },
|
|
40
|
+
{ key: "workbuddy", prefixes: ["WORKBUDDY"] },
|
|
41
|
+
{ key: "codex", prefixes: ["CODEX"] },
|
|
42
|
+
{ key: "doubao", prefixes: ["DOUBAO_OFFICE", "DOUBAO"] },
|
|
43
|
+
{ key: "qwen", prefixes: ["QWENWORK", "QWEN"] }
|
|
44
|
+
];
|
|
45
|
+
var DEFAULT_AGENT_HOST_KEY = "default";
|
|
46
|
+
function resolveSessionHostKey(env, options = {}) {
|
|
47
|
+
if (isXiaoERuntimeAgent(options.runtimeAgent)) return "xiaoe";
|
|
48
|
+
return resolveAgentHostKey(env, options.runtimeAgent);
|
|
49
|
+
}
|
|
50
|
+
function isIsolatedAgentHost(hostKey) {
|
|
51
|
+
return hostKey === "workbuddy" || hostKey === "xiaoe";
|
|
52
|
+
}
|
|
53
|
+
function matchesAgentHost(hostKey, agentType) {
|
|
54
|
+
if (hostKey === "xiaoe") return isXiaoERuntimeAgent(agentType);
|
|
55
|
+
if (hostKey === "workbuddy") return normalizeAgentHostKey(agentType) === "workbuddy";
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function normalizeAgentHostKey(value) {
|
|
59
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "");
|
|
60
|
+
}
|
|
61
|
+
function normalizeExplicitAgentHostKey(value) {
|
|
62
|
+
const normalized = normalizeAgentHostKey(value);
|
|
63
|
+
if (!normalized) return "";
|
|
64
|
+
for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
|
|
65
|
+
if (normalized === normalizeAgentHostKey(key)) return key;
|
|
66
|
+
if (prefixes.some((prefix) => normalized.startsWith(normalizeAgentHostKey(prefix)))) return key;
|
|
67
|
+
}
|
|
68
|
+
return normalized;
|
|
69
|
+
}
|
|
70
|
+
function resolveAgentHostKey(env = process.env, explicitAgentType = "") {
|
|
71
|
+
const explicit = normalizeExplicitAgentHostKey(explicitAgentType);
|
|
72
|
+
if (explicit) return explicit;
|
|
73
|
+
for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
|
|
74
|
+
if (prefixes.some((prefix) => hasEnvPrefix(env, prefix))) return key;
|
|
75
|
+
}
|
|
76
|
+
return DEFAULT_AGENT_HOST_KEY;
|
|
31
77
|
}
|
|
32
78
|
|
|
79
|
+
// src/internal/e10/auth/agent-hosts.ts
|
|
80
|
+
import { chmodSync, closeSync, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync2, renameSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
81
|
+
import { dirname, resolve as resolve3 } from "node:path";
|
|
82
|
+
|
|
83
|
+
// src/internal/e10/auth/crypto.ts
|
|
84
|
+
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
85
|
+
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
86
|
+
import { createRequire } from "node:module";
|
|
87
|
+
import { resolve as resolve2 } from "node:path";
|
|
88
|
+
|
|
33
89
|
// src/core/write-with-retry.ts
|
|
34
90
|
import { writeFileSync } from "node:fs";
|
|
35
91
|
var RETRIABLE_WRITE_ERRORS = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY", "ENOTEMPTY"]);
|
|
@@ -52,117 +108,6 @@ function writeWithRetry(path, data, options) {
|
|
|
52
108
|
}
|
|
53
109
|
}
|
|
54
110
|
|
|
55
|
-
// src/internal/e10/network-error.ts
|
|
56
|
-
var NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
57
|
-
"ECONNREFUSED",
|
|
58
|
-
"ECONNRESET",
|
|
59
|
-
"ECONNABORTED",
|
|
60
|
-
"EHOSTUNREACH",
|
|
61
|
-
"EHOSTDOWN",
|
|
62
|
-
"ENETUNREACH",
|
|
63
|
-
"ENETDOWN",
|
|
64
|
-
"ENETRESET",
|
|
65
|
-
"ENOTFOUND",
|
|
66
|
-
"EAI_AGAIN",
|
|
67
|
-
"EPIPE",
|
|
68
|
-
"ETIMEDOUT",
|
|
69
|
-
"ESOCKETTIMEDOUT",
|
|
70
|
-
"ERR_SOCKET_CONNECTION_TIMEOUT",
|
|
71
|
-
"UND_ERR_CONNECT_TIMEOUT",
|
|
72
|
-
"UND_ERR_HEADERS_TIMEOUT",
|
|
73
|
-
"UND_ERR_BODY_TIMEOUT",
|
|
74
|
-
"UND_ERR_SOCKET",
|
|
75
|
-
"UND_ERR_CLOSED",
|
|
76
|
-
"UND_ERR_ABORTED",
|
|
77
|
-
"CERT_HAS_EXPIRED",
|
|
78
|
-
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
79
|
-
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
80
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
81
|
-
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
82
|
-
"ERR_SSL_WRONG_VERSION_NUMBER"
|
|
83
|
-
]);
|
|
84
|
-
var TLS_TRUST_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
85
|
-
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
86
|
-
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
87
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
88
|
-
"UNABLE_TO_GET_ISSUER_CERT",
|
|
89
|
-
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
90
|
-
"CERT_HAS_EXPIRED",
|
|
91
|
-
"CERT_NOT_YET_VALID",
|
|
92
|
-
"CERT_UNTRUSTED",
|
|
93
|
-
"CERT_REVOKED",
|
|
94
|
-
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
95
|
-
]);
|
|
96
|
-
var TLS_TRUST_MESSAGE_PATTERN = /certificate verify failed|self[- ]signed certificate|certificate (?:has )?expired|unable to (?:verify|get) (?:the )?(?:leaf|issuer|local issuer)|certificate chain/i;
|
|
97
|
-
var ABORT_ERROR_CODE = "ABORT_ERR";
|
|
98
|
-
function asRecord(value) {
|
|
99
|
-
return value && typeof value === "object" ? value : null;
|
|
100
|
-
}
|
|
101
|
-
function readErrorCauseCode(error, maxDepth = 5) {
|
|
102
|
-
let current = error;
|
|
103
|
-
const seen = /* @__PURE__ */ new Set();
|
|
104
|
-
for (let depth = 0; depth < maxDepth; depth += 1) {
|
|
105
|
-
if (current === void 0 || current === null || seen.has(current)) return void 0;
|
|
106
|
-
seen.add(current);
|
|
107
|
-
if (current instanceof Error && current.name === "AbortError") return ABORT_ERROR_CODE;
|
|
108
|
-
const record = asRecord(current);
|
|
109
|
-
if (!record) return void 0;
|
|
110
|
-
if (record.name === "AbortError") return ABORT_ERROR_CODE;
|
|
111
|
-
const code = record.code;
|
|
112
|
-
if (typeof code === "string" && code) return code;
|
|
113
|
-
const errno = record.errno;
|
|
114
|
-
if (typeof errno === "string" && errno) return errno;
|
|
115
|
-
if (typeof errno === "number") return String(errno);
|
|
116
|
-
current = record.cause;
|
|
117
|
-
}
|
|
118
|
-
return void 0;
|
|
119
|
-
}
|
|
120
|
-
function isAbortError(error) {
|
|
121
|
-
if (error instanceof Error && error.name === "AbortError") return true;
|
|
122
|
-
return asRecord(error)?.name === "AbortError";
|
|
123
|
-
}
|
|
124
|
-
function isNetworkErrorCode(code) {
|
|
125
|
-
return typeof code === "string" && NETWORK_ERROR_CODES.has(code.toUpperCase());
|
|
126
|
-
}
|
|
127
|
-
function isTlsTrustErrorCode(code) {
|
|
128
|
-
return typeof code === "string" && TLS_TRUST_ERROR_CODES.has(code.toUpperCase());
|
|
129
|
-
}
|
|
130
|
-
function looksLikeTlsTrustMessage(message) {
|
|
131
|
-
return TLS_TRUST_MESSAGE_PATTERN.test(message);
|
|
132
|
-
}
|
|
133
|
-
var TRANSPORT_MESSAGE_PATTERN = /fetch failed|socket hang up|other side closed|network|connection (?:refused|reset|closed)|timed? ?out|timeout|certificate|getaddrinfo|dns lookup/i;
|
|
134
|
-
function looksLikeTransportMessage(message) {
|
|
135
|
-
return TRANSPORT_MESSAGE_PATTERN.test(message);
|
|
136
|
-
}
|
|
137
|
-
function createTimeoutSignal(timeoutMs) {
|
|
138
|
-
const controller = new AbortController();
|
|
139
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
140
|
-
return { signal: controller.signal, clear: () => clearTimeout(timer) };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// src/internal/e10/auth/crypto.ts
|
|
144
|
-
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
145
|
-
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
146
|
-
import { createRequire } from "node:module";
|
|
147
|
-
import { resolve as resolve2 } from "node:path";
|
|
148
|
-
|
|
149
|
-
// src/internal/e10/auth/paths.ts
|
|
150
|
-
import { homedir } from "node:os";
|
|
151
|
-
import { resolve } from "node:path";
|
|
152
|
-
function getE10AuthRoot() {
|
|
153
|
-
const override = process.env.WEAVER_WORK_CLI_AUTH_ROOT?.trim();
|
|
154
|
-
return override ? resolve(override) : resolve(homedir(), ".weaver-work-cli", "e10");
|
|
155
|
-
}
|
|
156
|
-
function getE10ProfilesRoot() {
|
|
157
|
-
return resolve(getE10AuthRoot(), "profiles");
|
|
158
|
-
}
|
|
159
|
-
function getE10ActiveProfilePath() {
|
|
160
|
-
return resolve(getE10AuthRoot(), "profile");
|
|
161
|
-
}
|
|
162
|
-
function getE10AgentsPath() {
|
|
163
|
-
return resolve(getE10AuthRoot(), "agents.json");
|
|
164
|
-
}
|
|
165
|
-
|
|
166
111
|
// src/internal/e10/auth/crypto.ts
|
|
167
112
|
var ALGORITHM = "aes-256-gcm";
|
|
168
113
|
var IV_LENGTH = 12;
|
|
@@ -283,48 +228,11 @@ function parseAuthFile(raw) {
|
|
|
283
228
|
}
|
|
284
229
|
}
|
|
285
230
|
|
|
286
|
-
// src/internal/e10/auth/agent-hosts.ts
|
|
287
|
-
import { chmodSync, closeSync, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync2, renameSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
288
|
-
import { dirname, resolve as resolve3 } from "node:path";
|
|
289
|
-
|
|
290
|
-
// src/internal/e10/auth/agent-host-key.ts
|
|
291
|
-
function hasEnvPrefix(env, prefix) {
|
|
292
|
-
return Object.keys(env).some((key) => key === prefix || key.startsWith(`${prefix}_`));
|
|
293
|
-
}
|
|
294
|
-
var AGENT_HOST_PREFIXES = [
|
|
295
|
-
{ key: "xiaoe", prefixes: ["XIAOE", "WEAVER_XIAOE"] },
|
|
296
|
-
{ key: "workbuddy", prefixes: ["WORKBUDDY"] },
|
|
297
|
-
{ key: "codex", prefixes: ["CODEX"] },
|
|
298
|
-
{ key: "doubao", prefixes: ["DOUBAO_OFFICE", "DOUBAO"] },
|
|
299
|
-
{ key: "qwen", prefixes: ["QWENWORK", "QWEN"] }
|
|
300
|
-
];
|
|
301
|
-
var DEFAULT_AGENT_HOST_KEY = "default";
|
|
302
|
-
function normalizeAgentHostKey(value) {
|
|
303
|
-
return value.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "");
|
|
304
|
-
}
|
|
305
|
-
function normalizeExplicitAgentHostKey(value) {
|
|
306
|
-
const normalized = normalizeAgentHostKey(value);
|
|
307
|
-
if (!normalized) return "";
|
|
308
|
-
for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
|
|
309
|
-
if (normalized === normalizeAgentHostKey(key)) return key;
|
|
310
|
-
if (prefixes.some((prefix) => normalized.startsWith(normalizeAgentHostKey(prefix)))) return key;
|
|
311
|
-
}
|
|
312
|
-
return normalized;
|
|
313
|
-
}
|
|
314
|
-
function resolveAgentHostKey(env = process.env, explicitAgentType = "") {
|
|
315
|
-
const explicit = normalizeExplicitAgentHostKey(explicitAgentType);
|
|
316
|
-
if (explicit) return explicit;
|
|
317
|
-
for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
|
|
318
|
-
if (prefixes.some((prefix) => hasEnvPrefix(env, prefix))) return key;
|
|
319
|
-
}
|
|
320
|
-
return DEFAULT_AGENT_HOST_KEY;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
231
|
// src/internal/e10/auth/agent-hosts.ts
|
|
324
232
|
var AGENTS_FILE_VERSION = 1;
|
|
325
233
|
var AGENTS_LOCK_TIMEOUT_MS = 600;
|
|
326
234
|
var AGENTS_LOCK_RETRY_MS = 15;
|
|
327
|
-
function
|
|
235
|
+
function asRecord(value) {
|
|
328
236
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
329
237
|
}
|
|
330
238
|
function readText(value) {
|
|
@@ -344,12 +252,12 @@ function readAgentHosts() {
|
|
|
344
252
|
const filePath = getE10AgentsPath();
|
|
345
253
|
if (!existsSync2(filePath)) return null;
|
|
346
254
|
try {
|
|
347
|
-
const parsed =
|
|
255
|
+
const parsed = asRecord(JSON.parse(readFileSync2(filePath, "utf-8")));
|
|
348
256
|
const version = typeof parsed.version === "number" ? parsed.version : AGENTS_FILE_VERSION;
|
|
349
257
|
if (!Number.isInteger(version) || version > AGENTS_FILE_VERSION) return null;
|
|
350
258
|
const hosts = {};
|
|
351
|
-
for (const [key, raw] of Object.entries(
|
|
352
|
-
const entry =
|
|
259
|
+
for (const [key, raw] of Object.entries(asRecord(parsed.hosts))) {
|
|
260
|
+
const entry = asRecord(raw);
|
|
353
261
|
const profile = readText(entry.profile);
|
|
354
262
|
if (!profile) continue;
|
|
355
263
|
hosts[key] = {
|
|
@@ -393,11 +301,40 @@ function lookupAgentHost(env = process.env, explicitAgentType = "") {
|
|
|
393
301
|
}
|
|
394
302
|
function resolveLoginProfileName(input) {
|
|
395
303
|
const hinted = (input.profileHint || "").trim();
|
|
396
|
-
if (hinted) return hinted;
|
|
397
304
|
const derived = (input.derivedName || "").trim() || "default";
|
|
398
305
|
const hostKey = (input.hostKey || "").trim() || resolveAgentHostKey(input.env || process.env);
|
|
399
306
|
const origin = normalizeOrigin(input.baseUrl);
|
|
400
307
|
const hosts = readAgentHosts()?.hosts || {};
|
|
308
|
+
const ownedByAnotherHost = (profile) => {
|
|
309
|
+
if (Object.entries(hosts).some(([key, record]) => key !== hostKey && record.profile === profile && (isIsolatedAgentHost(key) || isIsolatedAgentHost(hostKey)))) return true;
|
|
310
|
+
try {
|
|
311
|
+
const data = parseAuthFile(readFileSync2(resolve3(getE10ProfilesRoot(), profile, "auth"), "utf-8"));
|
|
312
|
+
const agentType = data?.agentType || data?.agent_type || "";
|
|
313
|
+
return Boolean(data) && (!matchesAgentHost(hostKey, agentType) || isIsolatedAgentHost(resolveAgentHostKey({}, agentType)) && resolveAgentHostKey({}, agentType) !== hostKey);
|
|
314
|
+
} catch {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
if (hinted) {
|
|
319
|
+
if (ownedByAnotherHost(hinted)) {
|
|
320
|
+
throw new CliError(`E10 profile "${hinted}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
|
|
321
|
+
}
|
|
322
|
+
return hinted;
|
|
323
|
+
}
|
|
324
|
+
if (isIsolatedAgentHost(hostKey) && !(hosts[hostKey]?.profile === derived && !ownedByAnotherHost(derived))) {
|
|
325
|
+
const isolated = `${derived}-${hostKey}`;
|
|
326
|
+
if (ownedByAnotherHost(isolated)) {
|
|
327
|
+
throw new CliError(`E10 profile "${isolated}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
|
|
328
|
+
}
|
|
329
|
+
return isolated;
|
|
330
|
+
}
|
|
331
|
+
if (ownedByAnotherHost(derived)) {
|
|
332
|
+
const isolated = `${derived}-${hostKey}`;
|
|
333
|
+
if (ownedByAnotherHost(isolated)) {
|
|
334
|
+
throw new CliError(`E10 profile "${isolated}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
|
|
335
|
+
}
|
|
336
|
+
return isolated;
|
|
337
|
+
}
|
|
401
338
|
const claimedByOthers = Object.entries(hosts).filter(([key, record]) => key !== hostKey && record.profile === derived);
|
|
402
339
|
if (!claimedByOthers.length) return derived;
|
|
403
340
|
const sharesDomain = claimedByOthers.some(([, record]) => normalizeOrigin(record.baseUrl || "") === origin);
|
|
@@ -487,6 +424,99 @@ function upsertAgentHost(input) {
|
|
|
487
424
|
}
|
|
488
425
|
}
|
|
489
426
|
|
|
427
|
+
// src/internal/e10/auth/session.ts
|
|
428
|
+
import { constants, createDecipheriv as createDecipheriv2, createHash, publicEncrypt } from "node:crypto";
|
|
429
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, readdirSync, unlinkSync as unlinkSync2 } from "node:fs";
|
|
430
|
+
import { dirname as dirname2, resolve as resolve4 } from "node:path";
|
|
431
|
+
|
|
432
|
+
// src/internal/e10/network-error.ts
|
|
433
|
+
var NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
434
|
+
"ECONNREFUSED",
|
|
435
|
+
"ECONNRESET",
|
|
436
|
+
"ECONNABORTED",
|
|
437
|
+
"EHOSTUNREACH",
|
|
438
|
+
"EHOSTDOWN",
|
|
439
|
+
"ENETUNREACH",
|
|
440
|
+
"ENETDOWN",
|
|
441
|
+
"ENETRESET",
|
|
442
|
+
"ENOTFOUND",
|
|
443
|
+
"EAI_AGAIN",
|
|
444
|
+
"EPIPE",
|
|
445
|
+
"ETIMEDOUT",
|
|
446
|
+
"ESOCKETTIMEDOUT",
|
|
447
|
+
"ERR_SOCKET_CONNECTION_TIMEOUT",
|
|
448
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
449
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
450
|
+
"UND_ERR_BODY_TIMEOUT",
|
|
451
|
+
"UND_ERR_SOCKET",
|
|
452
|
+
"UND_ERR_CLOSED",
|
|
453
|
+
"UND_ERR_ABORTED",
|
|
454
|
+
"CERT_HAS_EXPIRED",
|
|
455
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
456
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
457
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
458
|
+
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
459
|
+
"ERR_SSL_WRONG_VERSION_NUMBER"
|
|
460
|
+
]);
|
|
461
|
+
var TLS_TRUST_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
462
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
463
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
464
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
465
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
466
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
467
|
+
"CERT_HAS_EXPIRED",
|
|
468
|
+
"CERT_NOT_YET_VALID",
|
|
469
|
+
"CERT_UNTRUSTED",
|
|
470
|
+
"CERT_REVOKED",
|
|
471
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
472
|
+
]);
|
|
473
|
+
var TLS_TRUST_MESSAGE_PATTERN = /certificate verify failed|self[- ]signed certificate|certificate (?:has )?expired|unable to (?:verify|get) (?:the )?(?:leaf|issuer|local issuer)|certificate chain/i;
|
|
474
|
+
var ABORT_ERROR_CODE = "ABORT_ERR";
|
|
475
|
+
function asRecord2(value) {
|
|
476
|
+
return value && typeof value === "object" ? value : null;
|
|
477
|
+
}
|
|
478
|
+
function readErrorCauseCode(error, maxDepth = 5) {
|
|
479
|
+
let current = error;
|
|
480
|
+
const seen = /* @__PURE__ */ new Set();
|
|
481
|
+
for (let depth = 0; depth < maxDepth; depth += 1) {
|
|
482
|
+
if (current === void 0 || current === null || seen.has(current)) return void 0;
|
|
483
|
+
seen.add(current);
|
|
484
|
+
if (current instanceof Error && current.name === "AbortError") return ABORT_ERROR_CODE;
|
|
485
|
+
const record = asRecord2(current);
|
|
486
|
+
if (!record) return void 0;
|
|
487
|
+
if (record.name === "AbortError") return ABORT_ERROR_CODE;
|
|
488
|
+
const code = record.code;
|
|
489
|
+
if (typeof code === "string" && code) return code;
|
|
490
|
+
const errno = record.errno;
|
|
491
|
+
if (typeof errno === "string" && errno) return errno;
|
|
492
|
+
if (typeof errno === "number") return String(errno);
|
|
493
|
+
current = record.cause;
|
|
494
|
+
}
|
|
495
|
+
return void 0;
|
|
496
|
+
}
|
|
497
|
+
function isAbortError(error) {
|
|
498
|
+
if (error instanceof Error && error.name === "AbortError") return true;
|
|
499
|
+
return asRecord2(error)?.name === "AbortError";
|
|
500
|
+
}
|
|
501
|
+
function isNetworkErrorCode(code) {
|
|
502
|
+
return typeof code === "string" && NETWORK_ERROR_CODES.has(code.toUpperCase());
|
|
503
|
+
}
|
|
504
|
+
function isTlsTrustErrorCode(code) {
|
|
505
|
+
return typeof code === "string" && TLS_TRUST_ERROR_CODES.has(code.toUpperCase());
|
|
506
|
+
}
|
|
507
|
+
function looksLikeTlsTrustMessage(message) {
|
|
508
|
+
return TLS_TRUST_MESSAGE_PATTERN.test(message);
|
|
509
|
+
}
|
|
510
|
+
var TRANSPORT_MESSAGE_PATTERN = /fetch failed|socket hang up|other side closed|network|connection (?:refused|reset|closed)|timed? ?out|timeout|certificate|getaddrinfo|dns lookup/i;
|
|
511
|
+
function looksLikeTransportMessage(message) {
|
|
512
|
+
return TRANSPORT_MESSAGE_PATTERN.test(message);
|
|
513
|
+
}
|
|
514
|
+
function createTimeoutSignal(timeoutMs) {
|
|
515
|
+
const controller = new AbortController();
|
|
516
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
517
|
+
return { signal: controller.signal, clear: () => clearTimeout(timer) };
|
|
518
|
+
}
|
|
519
|
+
|
|
490
520
|
// src/internal/e10/auth/session.ts
|
|
491
521
|
var E10_TEAMS_CHECK_TIMEOUT_MS = 15e3;
|
|
492
522
|
var RSA_PUBLIC_KEY_PEM = `-----BEGIN PUBLIC KEY-----
|
|
@@ -647,20 +677,30 @@ function clearProfileAuthFile(profile = getActiveProfile()) {
|
|
|
647
677
|
unlinkSync2(authFile);
|
|
648
678
|
return { profile, authFile, cleared: true };
|
|
649
679
|
}
|
|
650
|
-
function resolveActiveProfileForHost(env = process.env) {
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
680
|
+
function resolveActiveProfileForHost(env = process.env, options = {}) {
|
|
681
|
+
const hostKey = resolveSessionHostKey(env, options);
|
|
682
|
+
const host = lookupAgentHost(env, hostKey);
|
|
683
|
+
return host ? host.profile : isIsolatedAgentHost(hostKey) ? hostKey : getActiveProfile();
|
|
684
|
+
}
|
|
685
|
+
function findAuthFile(startDir = process.cwd(), options = {}, env = process.env) {
|
|
686
|
+
const hostKey = resolveSessionHostKey(env, options);
|
|
687
|
+
const accept = (path) => {
|
|
688
|
+
if (!isIsolatedAgentHost(hostKey)) return path;
|
|
689
|
+
if (!existsSync3(path)) return null;
|
|
690
|
+
const session = E10AuthSession.fromFile(path);
|
|
691
|
+
return session && matchesAgentHost(hostKey, session.agentType) ? path : null;
|
|
692
|
+
};
|
|
693
|
+
if (options.auth) return accept(options.auth);
|
|
656
694
|
if (options.profile) {
|
|
657
695
|
const profileAuth = getProfileAuthPath(options.profile);
|
|
658
|
-
if (existsSync3(profileAuth)) return profileAuth;
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
696
|
+
if (existsSync3(profileAuth)) return accept(profileAuth);
|
|
697
|
+
if (isIsolatedAgentHost(hostKey)) return null;
|
|
698
|
+
}
|
|
699
|
+
const envAuth = env.E10_AUTH_PATH;
|
|
700
|
+
if (envAuth && (existsSync3(envAuth) || isIsolatedAgentHost(hostKey))) return accept(envAuth);
|
|
701
|
+
const host = lookupAgentHost(env, hostKey);
|
|
702
|
+
if (host) return host.status === "ok" ? accept(host.authFile) : null;
|
|
703
|
+
if (isIsolatedAgentHost(hostKey)) return null;
|
|
664
704
|
const activeProfileAuth = getProfileAuthPath(getActiveProfile());
|
|
665
705
|
if (existsSync3(activeProfileAuth)) return activeProfileAuth;
|
|
666
706
|
return null;
|
|
@@ -871,7 +911,7 @@ var E10AuthSession = class _E10AuthSession {
|
|
|
871
911
|
return null;
|
|
872
912
|
}
|
|
873
913
|
}
|
|
874
|
-
static async fromOptions(options, startDir = process.cwd(), load = {}) {
|
|
914
|
+
static async fromOptions(options, startDir = process.cwd(), load = {}, env = process.env) {
|
|
875
915
|
let baseUrl = options.baseUrl;
|
|
876
916
|
let passportUrl = options.passportUrl;
|
|
877
917
|
if (options.profile) {
|
|
@@ -879,7 +919,7 @@ var E10AuthSession = class _E10AuthSession {
|
|
|
879
919
|
baseUrl ||= cfg.baseUrl;
|
|
880
920
|
passportUrl ||= cfg.passportUrl;
|
|
881
921
|
}
|
|
882
|
-
const authPath = findAuthFile(startDir, options);
|
|
922
|
+
const authPath = findAuthFile(startDir, options, env);
|
|
883
923
|
if (!authPath) return null;
|
|
884
924
|
const session = _E10AuthSession.fromFile(authPath, baseUrl, passportUrl);
|
|
885
925
|
if (session && !session.isExpired() && !(load.skipProfileEnrichment && hasUsableUserId(session))) {
|
|
@@ -1045,53 +1085,10 @@ var E10AuthSession = class _E10AuthSession {
|
|
|
1045
1085
|
};
|
|
1046
1086
|
|
|
1047
1087
|
// src/internal/e10/tls-policy.ts
|
|
1048
|
-
import { existsSync as
|
|
1088
|
+
import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
|
|
1049
1089
|
import { homedir as homedir2 } from "node:os";
|
|
1050
|
-
import { delimiter, resolve as
|
|
1090
|
+
import { delimiter, resolve as resolve5 } from "node:path";
|
|
1051
1091
|
import * as tls from "node:tls";
|
|
1052
|
-
|
|
1053
|
-
// src/core/package-paths.ts
|
|
1054
|
-
import { existsSync as existsSync4, realpathSync } from "node:fs";
|
|
1055
|
-
import { dirname as dirname3, join, resolve as resolve5 } from "node:path";
|
|
1056
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1057
|
-
var cachedRoot;
|
|
1058
|
-
function entryDirectory(entry) {
|
|
1059
|
-
const absoluteEntry = resolve5(entry);
|
|
1060
|
-
try {
|
|
1061
|
-
return dirname3(realpathSync(absoluteEntry));
|
|
1062
|
-
} catch {
|
|
1063
|
-
return dirname3(absoluteEntry);
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
function packageRootDir() {
|
|
1067
|
-
if (cachedRoot) return cachedRoot;
|
|
1068
|
-
const seeds = [];
|
|
1069
|
-
const entry = process.argv[1];
|
|
1070
|
-
if (entry) seeds.push(entryDirectory(entry));
|
|
1071
|
-
seeds.push(dirname3(fileURLToPath(import.meta.url)));
|
|
1072
|
-
for (const seed of seeds) {
|
|
1073
|
-
let dir = seed;
|
|
1074
|
-
for (let depth = 0; depth < 10; depth += 1) {
|
|
1075
|
-
if (existsSync4(join(dir, "package.json"))) {
|
|
1076
|
-
cachedRoot = dir;
|
|
1077
|
-
return dir;
|
|
1078
|
-
}
|
|
1079
|
-
const parent = dirname3(dir);
|
|
1080
|
-
if (parent === dir) break;
|
|
1081
|
-
dir = parent;
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
cachedRoot = process.cwd();
|
|
1085
|
-
return cachedRoot;
|
|
1086
|
-
}
|
|
1087
|
-
function packagePath(...segments) {
|
|
1088
|
-
return join(packageRootDir(), ...segments);
|
|
1089
|
-
}
|
|
1090
|
-
function packageFileUrl(...segments) {
|
|
1091
|
-
return pathToFileURL(packagePath(...segments));
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
// src/internal/e10/tls-policy.ts
|
|
1095
1092
|
var E10_TLS_CA_FILE_ENV = "WEAVER_E10_CA_FILE";
|
|
1096
1093
|
var E10_TLS_CA_FILE_ALIASES = ["WEAVER_XIAOE_CA_FILE"];
|
|
1097
1094
|
var E10_TLS_INSECURE_ENV = "WEAVER_E10_TLS_INSECURE";
|
|
@@ -1105,14 +1102,14 @@ function readE10TlsCaFilePaths(env = process.env) {
|
|
|
1105
1102
|
for (const candidate of raw.split(/[,\n]/u)) {
|
|
1106
1103
|
const trimmed = candidate.trim();
|
|
1107
1104
|
if (!trimmed) continue;
|
|
1108
|
-
const absolute =
|
|
1105
|
+
const absolute = resolve5(expandHome(trimmed));
|
|
1109
1106
|
if (!paths.includes(absolute)) paths.push(absolute);
|
|
1110
1107
|
}
|
|
1111
1108
|
return paths;
|
|
1112
1109
|
}
|
|
1113
1110
|
function expandHome(value) {
|
|
1114
1111
|
if (value === "~") return homedir2();
|
|
1115
|
-
if (value.startsWith("~/")) return
|
|
1112
|
+
if (value.startsWith("~/")) return resolve5(homedir2(), value.slice(2));
|
|
1116
1113
|
return value;
|
|
1117
1114
|
}
|
|
1118
1115
|
function readE10TlsInsecureSetting(env = process.env) {
|
|
@@ -1143,7 +1140,7 @@ function resolveE10TlsPolicy(env = process.env) {
|
|
|
1143
1140
|
const problems = [];
|
|
1144
1141
|
for (const file of configuredFiles) {
|
|
1145
1142
|
try {
|
|
1146
|
-
if (!
|
|
1143
|
+
if (!existsSync4(file)) {
|
|
1147
1144
|
problems.push(`${file}: \u6587\u4EF6\u4E0D\u5B58\u5728`);
|
|
1148
1145
|
continue;
|
|
1149
1146
|
}
|
|
@@ -1264,7 +1261,7 @@ function summarizeE10TlsPolicy(status) {
|
|
|
1264
1261
|
}
|
|
1265
1262
|
function e10TlsPythonSiteDir() {
|
|
1266
1263
|
const dir = packagePath("scripts", "pysite");
|
|
1267
|
-
return
|
|
1264
|
+
return existsSync4(dir) ? dir : "";
|
|
1268
1265
|
}
|
|
1269
1266
|
function e10TlsChildEnv(env = process.env) {
|
|
1270
1267
|
const policy = resolveE10TlsPolicy(env);
|
|
@@ -1285,31 +1282,11 @@ function e10TlsChildEnv(env = process.env) {
|
|
|
1285
1282
|
return next;
|
|
1286
1283
|
}
|
|
1287
1284
|
|
|
1288
|
-
// src/core/runtime-agent.ts
|
|
1289
|
-
var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
|
|
1290
|
-
"xiaoe",
|
|
1291
|
-
"xiaoeclient",
|
|
1292
|
-
"\u5C0Fe",
|
|
1293
|
-
"\u5C0Fe\u5BA2\u6237\u7AEF",
|
|
1294
|
-
"\u667A\u80FD\u5C0Fe",
|
|
1295
|
-
"\u667A\u80FD\u5C0Fe\u5BA2\u6237\u7AEF"
|
|
1296
|
-
]);
|
|
1297
|
-
function normalizeRuntimeAgent(value) {
|
|
1298
|
-
if (typeof value !== "string") return "";
|
|
1299
|
-
return value.toLowerCase().replace(/[^a-z0-9\p{Script=Han}]+/gu, "");
|
|
1300
|
-
}
|
|
1301
|
-
function isXiaoERuntimeAgent(value) {
|
|
1302
|
-
return XIAOE_RUNTIME_AGENT_ALIASES.has(normalizeRuntimeAgent(value));
|
|
1303
|
-
}
|
|
1304
|
-
function isXiaoERuntime(options) {
|
|
1305
|
-
return isXiaoERuntimeAgent(options?.runtimeAgent);
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
1285
|
// src/internal/e10/auth/xiaoe.ts
|
|
1309
1286
|
import { execFile } from "node:child_process";
|
|
1310
|
-
import { accessSync, constants as fsConstants, existsSync as
|
|
1287
|
+
import { accessSync, constants as fsConstants, existsSync as existsSync5, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync } from "node:fs";
|
|
1311
1288
|
import { homedir as homedir3 } from "node:os";
|
|
1312
|
-
import { join
|
|
1289
|
+
import { join } from "node:path";
|
|
1313
1290
|
var DEFAULT_E10_LOGIN_BASE_URL = "https://weapp.eteams.cn";
|
|
1314
1291
|
var DEFAULT_E10_BASE_URL = "https://www.e-cology.com.cn";
|
|
1315
1292
|
var XIAOE_AGENT_TYPE = "XiaoE";
|
|
@@ -1485,15 +1462,7 @@ function envString(env, ...keys) {
|
|
|
1485
1462
|
return "";
|
|
1486
1463
|
}
|
|
1487
1464
|
function hasXiaoEEnv(env = process.env, options = {}) {
|
|
1488
|
-
|
|
1489
|
-
if (Object.keys(env).some((key) => key.startsWith("XIAOE_"))) return true;
|
|
1490
|
-
const explicitHostAgentType = envString(env, "WORKBUDDY_AGENT_TYPE", "CODEX_AGENT_TYPE");
|
|
1491
|
-
if (explicitHostAgentType) return isXiaoERuntimeAgent(explicitHostAgentType);
|
|
1492
|
-
if (Object.keys(env).some((key) => key.startsWith("WORKBUDDY_") || key.startsWith("CODEX_"))) {
|
|
1493
|
-
return false;
|
|
1494
|
-
}
|
|
1495
|
-
const explicitAgentType = envString(env, "WEAVER_AGENT_TYPE");
|
|
1496
|
-
return explicitAgentType ? isXiaoERuntimeAgent(explicitAgentType) : false;
|
|
1465
|
+
return isXiaoEHostEnvironment(env, options);
|
|
1497
1466
|
}
|
|
1498
1467
|
function resolveXiaoEClientType(env = process.env) {
|
|
1499
1468
|
const raw = envString(env, "XIAOE_CLIENT_TYPE").toLowerCase();
|
|
@@ -1686,6 +1655,11 @@ function isXiaoEHostedEnvironment(env = process.env) {
|
|
|
1686
1655
|
function resolveDefaultE10BaseUrl(env = process.env) {
|
|
1687
1656
|
return isXiaoEHostedEnvironment(env) ? DEFAULT_E10_BASE_URL : DEFAULT_E10_LOGIN_BASE_URL;
|
|
1688
1657
|
}
|
|
1658
|
+
function resolveXiaoEDefaultBaseUrl(env = process.env) {
|
|
1659
|
+
const configured = resolveXiaoEConfiguredBaseUrl(env);
|
|
1660
|
+
if (configured) return configured;
|
|
1661
|
+
return resolveDefaultE10BaseUrl(env);
|
|
1662
|
+
}
|
|
1689
1663
|
function uniqueStrings(values) {
|
|
1690
1664
|
const seen = /* @__PURE__ */ new Set();
|
|
1691
1665
|
const result = [];
|
|
@@ -1703,30 +1677,30 @@ function xiaoETokenScriptCandidatePaths(env = process.env) {
|
|
|
1703
1677
|
const localAppData = envString(env, "LOCALAPPDATA");
|
|
1704
1678
|
const userProfile = envString(env, "USERPROFILE");
|
|
1705
1679
|
return uniqueStrings([
|
|
1706
|
-
localAppData ?
|
|
1707
|
-
userProfile ?
|
|
1680
|
+
localAppData ? join(localAppData, "xiaoeUserData", "tokens.py") : "",
|
|
1681
|
+
userProfile ? join(userProfile, "AppData", "Local", "xiaoeUserData", "tokens.py") : ""
|
|
1708
1682
|
]);
|
|
1709
1683
|
}
|
|
1710
1684
|
const envHome = envString(env, "HOME");
|
|
1711
1685
|
const nodeHome = envHome ? "" : homedir3();
|
|
1712
1686
|
return uniqueStrings([
|
|
1713
|
-
envHome ?
|
|
1714
|
-
nodeHome ?
|
|
1687
|
+
envHome ? join(envHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : "",
|
|
1688
|
+
nodeHome ? join(nodeHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : ""
|
|
1715
1689
|
]);
|
|
1716
1690
|
}
|
|
1717
1691
|
function xiaoETokenScriptPath(env = process.env) {
|
|
1718
|
-
return xiaoETokenScriptCandidatePaths(env).find((path) =>
|
|
1692
|
+
return xiaoETokenScriptCandidatePaths(env).find((path) => existsSync5(path)) || "";
|
|
1719
1693
|
}
|
|
1720
1694
|
function xiaoEBundledEnvScriptPath() {
|
|
1721
1695
|
const scriptPath = packagePath("scripts", "xiaoe_env.py");
|
|
1722
|
-
return
|
|
1696
|
+
return existsSync5(scriptPath) ? scriptPath : "";
|
|
1723
1697
|
}
|
|
1724
1698
|
function hasXiaoETokenScript(env = process.env, allowLocalDiscovery = true) {
|
|
1725
1699
|
const explicit = envString(env, XIAOE_TOKEN_SCRIPT_ENV_KEY, XIAOE_TOKEN_SCRIPT_LEGACY_ENV_KEY);
|
|
1726
|
-
if (explicit) return
|
|
1700
|
+
if (explicit) return existsSync5(explicit);
|
|
1727
1701
|
if (!allowLocalDiscovery) return false;
|
|
1728
1702
|
const scriptPath = xiaoETokenScriptPath(env);
|
|
1729
|
-
return Boolean(scriptPath &&
|
|
1703
|
+
return Boolean(scriptPath && existsSync5(scriptPath));
|
|
1730
1704
|
}
|
|
1731
1705
|
function isExecutableFile(path) {
|
|
1732
1706
|
try {
|
|
@@ -1738,18 +1712,18 @@ function isExecutableFile(path) {
|
|
|
1738
1712
|
}
|
|
1739
1713
|
}
|
|
1740
1714
|
function listXiaoEPythonRuntimeDirectories(resourcesRoot) {
|
|
1741
|
-
if (!resourcesRoot || !
|
|
1715
|
+
if (!resourcesRoot || !existsSync5(resourcesRoot)) return [];
|
|
1742
1716
|
try {
|
|
1743
|
-
return readdirSync2(resourcesRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^Python3(?:[-_.]\d[\d.]*)?$/iu.test(entry.name)).map((entry) =>
|
|
1717
|
+
return readdirSync2(resourcesRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^Python3(?:[-_.]\d[\d.]*)?$/iu.test(entry.name)).map((entry) => join(resourcesRoot, entry.name)).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
|
|
1744
1718
|
} catch {
|
|
1745
1719
|
return [];
|
|
1746
1720
|
}
|
|
1747
1721
|
}
|
|
1748
1722
|
function listExecutablePythonFiles(directory, platform) {
|
|
1749
|
-
if (!directory || !
|
|
1723
|
+
if (!directory || !existsSync5(directory)) return [];
|
|
1750
1724
|
try {
|
|
1751
1725
|
const pattern = platform === "win32" ? /^python(?:3(?:\.\d+)*)?\.exe$/iu : /^python3(?:\.\d+)*$/u;
|
|
1752
|
-
return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && pattern.test(entry.name)).map((entry) =>
|
|
1726
|
+
return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && pattern.test(entry.name)).map((entry) => join(directory, entry.name)).filter(isExecutableFile).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
|
|
1753
1727
|
} catch {
|
|
1754
1728
|
return [];
|
|
1755
1729
|
}
|
|
@@ -1760,7 +1734,7 @@ function xiaoEClientPythonCandidates(env = process.env, platform = process.platf
|
|
|
1760
1734
|
const envHome = envString(env, "HOME");
|
|
1761
1735
|
const nodeHome = homedir3();
|
|
1762
1736
|
for (const home of uniqueStrings([envHome, nodeHome])) {
|
|
1763
|
-
appRoots.push(
|
|
1737
|
+
appRoots.push(join(home, "Applications", "\u667A\u80FD\u5C0Fe.app"));
|
|
1764
1738
|
}
|
|
1765
1739
|
appRoots.push("/Applications/\u667A\u80FD\u5C0Fe.app");
|
|
1766
1740
|
} else if (platform === "win32") {
|
|
@@ -1773,19 +1747,19 @@ function xiaoEClientPythonCandidates(env = process.env, platform = process.platf
|
|
|
1773
1747
|
const appNames = ["\u667A\u80FD\u5C0Fe", "XiaoE", "XiaoEClient", "XiaoEAI"];
|
|
1774
1748
|
if (localAppData) {
|
|
1775
1749
|
for (const appName of appNames) {
|
|
1776
|
-
appRoots.push(
|
|
1750
|
+
appRoots.push(join(localAppData, "Programs", appName), join(localAppData, appName));
|
|
1777
1751
|
}
|
|
1778
1752
|
}
|
|
1779
1753
|
for (const programFilesRoot of programFiles) {
|
|
1780
|
-
for (const appName of appNames) appRoots.push(
|
|
1754
|
+
for (const appName of appNames) appRoots.push(join(programFilesRoot, appName));
|
|
1781
1755
|
}
|
|
1782
1756
|
}
|
|
1783
1757
|
const candidates = [];
|
|
1784
1758
|
for (const appRoot of uniqueStrings(appRoots)) {
|
|
1785
|
-
const resourcesRoots = platform === "darwin" ? [
|
|
1759
|
+
const resourcesRoots = platform === "darwin" ? [join(appRoot, "Contents", "Resources")] : [join(appRoot, "Resources"), appRoot];
|
|
1786
1760
|
for (const resourcesRoot of resourcesRoots) {
|
|
1787
1761
|
for (const runtimeRoot of listXiaoEPythonRuntimeDirectories(resourcesRoot)) {
|
|
1788
|
-
const executableDirectories = platform === "win32" ? [runtimeRoot,
|
|
1762
|
+
const executableDirectories = platform === "win32" ? [runtimeRoot, join(runtimeRoot, "bin")] : [join(runtimeRoot, "bin")];
|
|
1789
1763
|
for (const executableDirectory of executableDirectories) {
|
|
1790
1764
|
candidates.push(...listExecutablePythonFiles(executableDirectory, platform));
|
|
1791
1765
|
}
|
|
@@ -1905,7 +1879,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
|
|
|
1905
1879
|
' raise SystemExit("XiaoE credential script produced empty stdout")',
|
|
1906
1880
|
"print(json.dumps(data, ensure_ascii=False))"
|
|
1907
1881
|
].join("\n");
|
|
1908
|
-
return await new Promise((
|
|
1882
|
+
return await new Promise((resolve7, reject) => {
|
|
1909
1883
|
execFile(
|
|
1910
1884
|
pythonCommand,
|
|
1911
1885
|
["-c", wrapper],
|
|
@@ -1936,7 +1910,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
|
|
|
1936
1910
|
}
|
|
1937
1911
|
try {
|
|
1938
1912
|
const parsed = JSON.parse(text);
|
|
1939
|
-
|
|
1913
|
+
resolve7(parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null);
|
|
1940
1914
|
} catch {
|
|
1941
1915
|
reject(new CliError("XiaoE credential script stdout is not valid JSON.", 3 /* AuthError */));
|
|
1942
1916
|
}
|
|
@@ -1945,7 +1919,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
|
|
|
1945
1919
|
});
|
|
1946
1920
|
}
|
|
1947
1921
|
async function runXiaoEPythonCredentialScript(scriptPath, baseUrl, env) {
|
|
1948
|
-
if (!scriptPath || !
|
|
1922
|
+
if (!scriptPath || !existsSync5(scriptPath)) return null;
|
|
1949
1923
|
let lastError = null;
|
|
1950
1924
|
for (const pythonCommand of xiaoETokenScriptPythonCandidates(env)) {
|
|
1951
1925
|
try {
|
|
@@ -1998,13 +1972,13 @@ async function resolveXiaoEBundledEnvScriptCredential(baseUrl, env = process.env
|
|
|
1998
1972
|
function xiaoEClientRobotsRoot(env = process.env) {
|
|
1999
1973
|
if (process.platform === "win32") {
|
|
2000
1974
|
const localAppData = envString(env, "LOCALAPPDATA");
|
|
2001
|
-
return localAppData ?
|
|
1975
|
+
return localAppData ? join(localAppData, "XiaoE", "Robots") : "";
|
|
2002
1976
|
}
|
|
2003
1977
|
const home = envString(env, "HOME") || homedir3();
|
|
2004
|
-
return home ?
|
|
1978
|
+
return home ? join(home, "Library", "Application Support", "XiaoE", "Robots") : "";
|
|
2005
1979
|
}
|
|
2006
1980
|
function isFile(path) {
|
|
2007
|
-
if (!path || !
|
|
1981
|
+
if (!path || !existsSync5(path)) return false;
|
|
2008
1982
|
try {
|
|
2009
1983
|
return statSync(path).isFile();
|
|
2010
1984
|
} catch {
|
|
@@ -2012,7 +1986,7 @@ function isFile(path) {
|
|
|
2012
1986
|
}
|
|
2013
1987
|
}
|
|
2014
1988
|
function isDirectory(path) {
|
|
2015
|
-
if (!path || !
|
|
1989
|
+
if (!path || !existsSync5(path)) return false;
|
|
2016
1990
|
try {
|
|
2017
1991
|
return statSync(path).isDirectory();
|
|
2018
1992
|
} catch {
|
|
@@ -2031,15 +2005,15 @@ function listXiaoEClientSettingsFiles(root) {
|
|
|
2031
2005
|
if (!isDirectory(directory)) return;
|
|
2032
2006
|
try {
|
|
2033
2007
|
for (const entry of readdirSync2(directory, { withFileTypes: true })) {
|
|
2034
|
-
if (entry.isDirectory()) addCandidate(
|
|
2008
|
+
if (entry.isDirectory()) addCandidate(join(directory, entry.name, "user_settings.json"));
|
|
2035
2009
|
}
|
|
2036
2010
|
} catch {
|
|
2037
2011
|
}
|
|
2038
2012
|
};
|
|
2039
|
-
addCandidate(
|
|
2013
|
+
addCandidate(join(root, "user_settings.json"));
|
|
2040
2014
|
addChildSettings(root);
|
|
2041
|
-
const robotsRoot =
|
|
2042
|
-
addCandidate(
|
|
2015
|
+
const robotsRoot = join(root, "Robots");
|
|
2016
|
+
addCandidate(join(robotsRoot, "user_settings.json"));
|
|
2043
2017
|
addChildSettings(robotsRoot);
|
|
2044
2018
|
return uniqueStrings(candidates);
|
|
2045
2019
|
}
|
|
@@ -2118,6 +2092,9 @@ function inspectXiaoEUnifiedLoginSources(options = {}) {
|
|
|
2118
2092
|
any: platformCredential || tokenScript || clientCredential || environmentCredential
|
|
2119
2093
|
};
|
|
2120
2094
|
}
|
|
2095
|
+
function hasXiaoEUnifiedLoginSource(options = {}) {
|
|
2096
|
+
return inspectXiaoEUnifiedLoginSources(options).any;
|
|
2097
|
+
}
|
|
2121
2098
|
async function fetchXiaoEClientEteamId(credential, domain) {
|
|
2122
2099
|
const requestedDomain = domain || DEFAULT_E10_BASE_URL;
|
|
2123
2100
|
const startedAt = Date.now();
|
|
@@ -2340,7 +2317,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
2340
2317
|
const profile = resolveLoginProfileName({
|
|
2341
2318
|
derivedName: profileNameFromUrl(baseUrl),
|
|
2342
2319
|
baseUrl,
|
|
2343
|
-
hostKey:
|
|
2320
|
+
hostKey: "xiaoe",
|
|
2344
2321
|
profileHint: input.profileHint
|
|
2345
2322
|
});
|
|
2346
2323
|
setActiveProfile(profile);
|
|
@@ -2369,7 +2346,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
2369
2346
|
};
|
|
2370
2347
|
const authFile = saveAuthFile(authData, profile);
|
|
2371
2348
|
saveProfileConfig(baseUrl, baseUrl, profile, tenantKey);
|
|
2372
|
-
upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey:
|
|
2349
|
+
upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey: "xiaoe" });
|
|
2373
2350
|
const session = new E10AuthSession(authData, authFile);
|
|
2374
2351
|
return {
|
|
2375
2352
|
session,
|
|
@@ -2529,16 +2506,13 @@ async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
2529
2506
|
}
|
|
2530
2507
|
|
|
2531
2508
|
export {
|
|
2532
|
-
isConnectorMode,
|
|
2533
|
-
normalizeGlobalOptions,
|
|
2534
|
-
packagePath,
|
|
2535
|
-
packageFileUrl,
|
|
2536
|
-
isXiaoERuntimeAgent,
|
|
2537
2509
|
readErrorCauseCode,
|
|
2538
2510
|
isTlsTrustErrorCode,
|
|
2539
2511
|
looksLikeTlsTrustMessage,
|
|
2540
2512
|
writeWithRetry,
|
|
2541
2513
|
getE10AuthRoot,
|
|
2514
|
+
resolveSessionHostKey,
|
|
2515
|
+
isIsolatedAgentHost,
|
|
2542
2516
|
resolveAgentHostKey,
|
|
2543
2517
|
lookupAgentHost,
|
|
2544
2518
|
resolveLoginProfileName,
|
|
@@ -2564,13 +2538,20 @@ export {
|
|
|
2564
2538
|
applyE10TlsPolicy,
|
|
2565
2539
|
currentE10TlsPolicyStatus,
|
|
2566
2540
|
summarizeE10TlsPolicy,
|
|
2541
|
+
DEFAULT_E10_LOGIN_BASE_URL,
|
|
2542
|
+
DEFAULT_E10_BASE_URL,
|
|
2567
2543
|
XIAOE_AGENT_TYPE,
|
|
2568
2544
|
summarizeXiaoEFailureKind,
|
|
2569
2545
|
lastXiaoEFailure,
|
|
2570
2546
|
hasXiaoEEnv,
|
|
2571
2547
|
isXiaoECloudRuntime,
|
|
2548
|
+
resolveXiaoEUnifiedLoginCredential,
|
|
2549
|
+
isXiaoEHostedEnvironment,
|
|
2572
2550
|
resolveDefaultE10BaseUrl,
|
|
2551
|
+
resolveXiaoEDefaultBaseUrl,
|
|
2552
|
+
hasXiaoETokenScript,
|
|
2573
2553
|
inspectXiaoEUnifiedLoginSources,
|
|
2554
|
+
hasXiaoEUnifiedLoginSource,
|
|
2574
2555
|
resolveXiaoEPreferredBaseUrl,
|
|
2575
2556
|
createXiaoEUnifiedLoginUnavailableError,
|
|
2576
2557
|
tryXiaoEUnifiedLogin
|