weaver-work-cli 0.1.39 → 0.1.42
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 +4 -2
- package/dist/chunks/{archive-ENZYBBME.js → archive-J4I6MCKF.js} +2 -2
- package/dist/chunks/{archive-oa-YWLEC5V4.js → archive-oa-BRZKKTO4.js} +2 -2
- package/dist/chunks/{asset-OOV6DWPA.js → asset-L7D4FAOZ.js} +2 -2
- package/dist/chunks/{asset-idle-RE632MY5.js → asset-idle-DADLLV75.js} +2 -2
- package/dist/chunks/{attachment-content-RWN2FCLL.js → attachment-content-K4C7VLWQ.js} +3 -3
- package/dist/chunks/{blog-PEPOJAL7.js → blog-BVGQ7NZL.js} +2 -2
- package/dist/chunks/{caizhilian-WYIQDVPJ.js → caizhilian-SAADNFD6.js} +2 -2
- package/dist/chunks/{calendar-CIARBAOX.js → calendar-Q7NQY5Z2.js} +61 -23
- package/dist/chunks/{chunk-F2EQXUEE.js → chunk-3KTFS4IA.js} +397 -159
- package/dist/chunks/{chunk-G2JSIUWF.js → chunk-4PD5NWAX.js} +89 -0
- package/dist/chunks/{chunk-HJYVHXUQ.js → chunk-4RAE6JXP.js} +1 -1
- package/dist/chunks/{chunk-CQHGNCK2.js → chunk-72CKAUAG.js} +41 -8
- package/dist/chunks/{chunk-K3RUEEOL.js → chunk-APVFJUQH.js} +2 -2
- package/dist/chunks/{chunk-BJGXMFGD.js → chunk-BBKDXQEC.js} +2 -2
- package/dist/chunks/chunk-BIPYLLVS.js +501 -0
- package/dist/chunks/{chunk-GVPJZXJ2.js → chunk-EKWAQSLU.js} +92 -50
- package/dist/chunks/{chunk-XXJOSZTQ.js → chunk-FOAA27U5.js} +381 -57
- package/dist/chunks/{chunk-I2HB737U.js → chunk-G4UR6NXN.js} +2 -2
- package/dist/chunks/{chunk-YS5DPN4T.js → chunk-GEWYMQME.js} +1 -1
- package/dist/chunks/{chunk-P2DAISYW.js → chunk-GHXCDPTM.js} +1 -1
- package/dist/chunks/{chunk-L4N7B7ZD.js → chunk-IZ7S7QUS.js} +4 -4
- package/dist/chunks/{chunk-NLK2RZKG.js → chunk-JPRO6ER2.js} +122 -2214
- package/dist/chunks/{chunk-36DIFZAH.js → chunk-LADPYOWC.js} +2 -2
- package/dist/chunks/chunk-LDZQPUIA.js +1238 -0
- package/dist/chunks/chunk-NKZRQXST.js +2546 -0
- package/dist/chunks/{chunk-EINRJHQ3.js → chunk-QKNKR4RH.js} +3 -3
- package/dist/chunks/{chunk-T7JDJJ7H.js → chunk-R4CHUSKC.js} +126 -19
- package/dist/chunks/{chunk-EZGFHJFW.js → chunk-SA6VBIHY.js} +88 -15
- package/dist/chunks/{chunk-ZXRNHZTE.js → chunk-TTPJJJC4.js} +2 -2
- package/dist/chunks/{chunk-KTCB5R5H.js → chunk-W7BEHOSR.js} +2 -2
- package/dist/chunks/{chunk-MUQUHKPG.js → chunk-YRSZQUD2.js} +2 -2
- package/dist/chunks/{conflict-DRMDOL56.js → conflict-F2OMZRTO.js} +2 -2
- package/dist/chunks/{contract-73MERZWN.js → contract-5BETHRSG.js} +2 -2
- package/dist/chunks/{cowork-HNGBPD7A.js → cowork-3MN6EQQO.js} +27 -10
- package/dist/chunks/create-flow-5FQNNMVO.js +55 -0
- package/dist/chunks/{ebuilder-form-OY6DVNRK.js → ebuilder-form-SBHOYBUD.js} +3 -3
- package/dist/chunks/{ehr-RAQNEQO7.js → ehr-KMOJULKG.js} +432 -1234
- package/dist/chunks/env-LB7NBL2O.js +19 -0
- package/dist/chunks/{esb-6XV7C7YV.js → esb-W2PJCFCX.js} +4 -4
- package/dist/chunks/factory-6ZFQXQ46.js +30 -0
- package/dist/chunks/{fna-XTSRB7G7.js → fna-ZQPCUV4R.js} +2 -2
- package/dist/chunks/group-chat-2HHAJN46.js +20 -0
- package/dist/chunks/{host-YMBXWFWX.js → host-4CBHGOHT.js} +3 -3
- package/dist/chunks/{host-A7J6GDUP.js → host-ATKVNZAT.js} +3 -3
- package/dist/chunks/{host-3F5UM5GN.js → host-BQH22NTQ.js} +3 -3
- package/dist/chunks/{host-YAQAPYNP.js → host-X2CSLFM6.js} +3 -3
- package/dist/chunks/{host-VGPVP7YF.js → host-YTODKMSL.js} +3 -3
- package/dist/chunks/{hrm-TLHKC545.js → hrm-FFM4UJFS.js} +4 -4
- package/dist/chunks/{im-YOUCFMUK.js → im-VEHKDQPB.js} +8 -8
- package/dist/chunks/{invoice-WNBS2B4C.js → invoice-LVIKSIIF.js} +3 -3
- package/dist/chunks/{jiuchuanhui-XABWS5RN.js → jiuchuanhui-X6DINO5P.js} +2 -2
- package/dist/chunks/{lazy-dispatch-NLZ5UQQI.js → lazy-dispatch-KSWTN5L6.js} +4 -4
- package/dist/chunks/{mail-LRYMBFNL.js → mail-VDKRGUD3.js} +9 -4
- package/dist/chunks/{meeting-ESXL6MFI.js → meeting-CLC6HP3Z.js} +12 -10
- package/dist/chunks/{okr-EOV65SSF.js → okr-CHG4OO3U.js} +2 -2
- package/dist/chunks/{plan-YFPVKW6Y.js → plan-XWR75667.js} +2 -2
- package/dist/chunks/{project-MDVZUYQW.js → project-5BXOOKMG.js} +40 -23
- package/dist/chunks/recruit-stage-DGMFNNDE.js +4507 -0
- package/dist/chunks/{registry-VT5Y2HLA.js → registry-7FFOXIAW.js} +4 -4
- package/dist/chunks/{registry-QCLZEDAP.js → registry-BKBZPBAJ.js} +10 -8
- package/dist/chunks/{registry-YX4CSEMD.js → registry-RHMW6ANW.js} +2 -2
- package/dist/chunks/{registry-NYPYMZXG.js → registry-Z43434VG.js} +1 -1
- package/dist/chunks/{room-recommend-L3MWH4JW.js → room-recommend-62H7ZQQ6.js} +4 -4
- package/dist/chunks/{schedule-UASAVDVD.js → schedule-FNXKH3DQ.js} +4 -4
- package/dist/chunks/{workflow-KDGIUCNW.js → workflow-ADHKCAJK.js} +4 -4
- package/dist/index.js +33 -28
- package/dist/internal/e10/auth/commands.js +110 -56
- package/dist/internal/e10/auth/messages.js +6 -0
- package/dist/internal/e10/auth/session.js +28 -1
- package/dist/internal/e10/auth/xiaoe.js +315 -48
- package/dist/internal/e10/auth-recovery.js +36 -5
- package/dist/internal/e10/client.js +13 -0
- package/dist/internal/e10/context.js +61 -9
- package/dist/internal/e10/index.js +1 -1
- package/dist/internal/e10/network-error.js +93 -0
- package/dist/internal/e10/request-runtime.js +15 -0
- package/dist/shortcuts/calendar/operations/read.js +31 -22
- package/dist/shortcuts/calendar/operations/write.js +45 -1
- package/dist/shortcuts/cowork/operations/discuss-write.js +5 -1
- package/dist/shortcuts/cowork/operations/item-write.js +5 -3
- package/dist/shortcuts/cowork/operations/member-write.js +3 -1
- package/dist/shortcuts/cowork/operations/permission-write.js +5 -1
- package/dist/shortcuts/cowork/operations/shared.js +7 -0
- package/dist/shortcuts/ehr/operations/attend-write.js +43 -1
- package/dist/shortcuts/ehr/operations/hr-contact.js +7 -4
- package/dist/shortcuts/ehr/operations/hr-report.js +13 -7
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +134 -59
- package/dist/shortcuts/ehr/operations/recruit-write.js +262 -17
- package/dist/shortcuts/ehr/operations/recruit.js +10 -4
- package/dist/shortcuts/ehr/operations/shared.js +47 -0
- package/dist/shortcuts/hrm/operations/org.js +118 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/mail/operations/mail-send.js +8 -2
- package/dist/shortcuts/meeting/operations/eb/catalog.js +9 -2
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +461 -127
- package/dist/shortcuts/meeting/operations/eb/crm-search.js +87 -5
- package/dist/shortcuts/meeting/operations/eb/factory.js +33 -0
- package/dist/shortcuts/meeting/operations/eb/flow-memory.js +49 -0
- package/dist/shortcuts/meeting/operations/eb/group-chat.js +605 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +96 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +44 -6
- package/dist/shortcuts/meeting/operations/eb/room-summary.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/usage-cache.js +99 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +35 -12
- package/dist/shortcuts/project/operations/read.js +6 -25
- package/dist/shortcuts/project/operations/shared.js +22 -0
- package/dist/shortcuts/project/operations/write.js +28 -2
- package/dist/shortcuts/recruit-stage/context.js +119 -0
- package/dist/shortcuts/recruit-stage/continuation.js +73 -0
- package/dist/shortcuts/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/recruit-stage/host.js +109 -0
- package/dist/shortcuts/recruit-stage/index.js +115 -0
- package/dist/shortcuts/recruit-stage/manifest.js +29 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +722 -0
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +269 -0
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +630 -0
- package/dist/shortcuts/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +38 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +1198 -0
- package/dist/shortcuts/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/recruit-stage/operations/types.js +25 -0
- package/dist/shortcuts/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/recruit-stage/shared.js +608 -0
- package/dist/shortcuts/workflow/operations/form.js +21 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +52 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/detailFieldRules.js +4 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +19 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +17 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +14 -9
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +78 -10
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +3 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +17 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +16 -40
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +3 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +52 -15
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.pipeline.js +16 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +151 -63
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subGroup.js +56 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +53 -16
- package/docs/e10-auth.md +22 -1
- package/docs/operation-manual.md +8 -0
- package/package.json +1 -1
- package/scripts/install-skill-to-xiaoe.mjs +105 -0
- package/scripts/mcp-meeting.mjs +234 -0
- package/scripts/package-skill.mjs +4 -2
- package/skill-template/business-info.json +24 -0
- package/skill-template/domains/recruit-stage.md +29 -0
- package/skills/weaver-e10-calendar/SKILL.md +2 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +54 -0
- package/skills/weaver-e10-cowork/SKILL.md +1 -1
- package/skills/weaver-e10-cowork/references/cowork-write.md +3 -1
- package/skills/weaver-e10-jucailin/SKILL.md +1 -1
- package/skills/weaver-e10-jucailin/references/attend-write.md +8 -0
- package/skills/weaver-e10-jucailin/references/hr-contact.md +8 -0
- package/skills/weaver-e10-jucailin/references/hr-report.md +8 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -3
- package/skills/weaver-e10-mail/SKILL.md +1 -1
- package/skills/weaver-e10-mail/references/mail-send.md +2 -0
- package/skills/weaver-e10-meeting/SKILL.md +119 -26
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +25 -11
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-recruit-stage/SKILL.md +226 -0
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +119 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +188 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +322 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +127 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +65 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +73 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +56 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +148 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +59 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +438 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-shared/SKILL.md +2 -2
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-shijingran/SKILL.md +3 -2
- package/skills/weaver-e10-shijingran/references/operations.md +3 -1
- package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
- package/skills/weaver-e10-shijingran/references/write-operations.md +2 -0
- package/skills/weaver-e10-workflow/SKILL.md +7 -1
- package/skills/weaver-e10-workflow/aigroup/default.json +23 -9
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +37 -21
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +135 -43
- package/skills/weaver-e10-yepiaotong/SKILL.md +9 -10
- package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +6 -3
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
esbOperationDefinitions,
|
|
5
5
|
getEsbOperation,
|
|
6
6
|
hasEsbOperation
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-4RAE6JXP.js";
|
|
8
|
+
import "./chunk-BBKDXQEC.js";
|
|
9
9
|
import "./chunk-GPMFD4RD.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-SA6VBIHY.js";
|
|
11
|
+
import "./chunk-FOAA27U5.js";
|
|
12
12
|
import "./chunk-LUSPKZKY.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
14
14
|
export {
|
|
@@ -4,14 +4,16 @@ import {
|
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
hasMeetingOperation,
|
|
6
6
|
meetingOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-JPRO6ER2.js";
|
|
8
|
+
import "./chunk-BIPYLLVS.js";
|
|
9
|
+
import "./chunk-NKZRQXST.js";
|
|
10
|
+
import "./chunk-R4CHUSKC.js";
|
|
11
|
+
import "./chunk-IZ7S7QUS.js";
|
|
12
|
+
import "./chunk-GHXCDPTM.js";
|
|
13
|
+
import "./chunk-QKNKR4RH.js";
|
|
14
|
+
import "./chunk-W7BEHOSR.js";
|
|
15
|
+
import "./chunk-GEWYMQME.js";
|
|
16
|
+
import "./chunk-72CKAUAG.js";
|
|
15
17
|
import "./chunk-LUSPKZKY.js";
|
|
16
18
|
import "./chunk-BUSC6UAE.js";
|
|
17
19
|
export {
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
getWorkflowOperation,
|
|
5
5
|
hasWorkflowOperation,
|
|
6
6
|
workflowOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3KTFS4IA.js";
|
|
8
8
|
import "./chunk-EZALDOQH.js";
|
|
9
9
|
import "./chunk-FMPJJYYI.js";
|
|
10
10
|
import "./chunk-ZUX3P6BQ.js";
|
|
11
11
|
import "./chunk-AJ62BGAW.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FOAA27U5.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
export {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
loadRooms,
|
|
7
7
|
recommendRooms,
|
|
8
8
|
rememberFrequentRoom
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-R4CHUSKC.js";
|
|
10
|
+
import "./chunk-GHXCDPTM.js";
|
|
11
|
+
import "./chunk-GEWYMQME.js";
|
|
12
|
+
import "./chunk-72CKAUAG.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
export {
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
resolveMeetingScheduleTypeIds,
|
|
9
9
|
resolveMemberIdsByName,
|
|
10
10
|
runScheduleConflictFlow
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-IZ7S7QUS.js";
|
|
12
|
+
import "./chunk-GHXCDPTM.js";
|
|
13
|
+
import "./chunk-GEWYMQME.js";
|
|
14
|
+
import "./chunk-72CKAUAG.js";
|
|
15
15
|
import "./chunk-LUSPKZKY.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
17
17
|
export {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createWorkflowHost
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-APVFJUQH.js";
|
|
6
6
|
import {
|
|
7
7
|
USER_INTENT_RULE_FILE,
|
|
8
8
|
aigroupUserDir,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
validateRuleFile,
|
|
18
18
|
workflowOperationDefinitions,
|
|
19
19
|
workflowSuccess
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-3KTFS4IA.js";
|
|
21
21
|
import {
|
|
22
22
|
createWorkflowContinuationSigner
|
|
23
23
|
} from "./chunk-EZALDOQH.js";
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
} from "./chunk-FMPJJYYI.js";
|
|
29
29
|
import "./chunk-ZUX3P6BQ.js";
|
|
30
30
|
import "./chunk-AJ62BGAW.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-SA6VBIHY.js";
|
|
32
|
+
import "./chunk-FOAA27U5.js";
|
|
33
33
|
import {
|
|
34
34
|
isCliError,
|
|
35
35
|
toErrorEnvelope
|
package/dist/index.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
firstPositionalToken,
|
|
8
8
|
registerCommands,
|
|
9
9
|
toCommandMetadata
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-EKWAQSLU.js";
|
|
11
11
|
import "./chunks/chunk-ZUX3P6BQ.js";
|
|
12
12
|
import "./chunks/chunk-AJ62BGAW.js";
|
|
13
|
-
import "./chunks/chunk-
|
|
14
|
-
import "./chunks/chunk-
|
|
15
|
-
import "./chunks/chunk-
|
|
13
|
+
import "./chunks/chunk-TTPJJJC4.js";
|
|
14
|
+
import "./chunks/chunk-SA6VBIHY.js";
|
|
15
|
+
import "./chunks/chunk-FOAA27U5.js";
|
|
16
16
|
import "./chunks/chunk-LUSPKZKY.js";
|
|
17
17
|
import "./chunks/chunk-BUSC6UAE.js";
|
|
18
18
|
|
|
@@ -29,7 +29,7 @@ function lazyShortcut(definition) {
|
|
|
29
29
|
placeholder.allowExcessArguments(true);
|
|
30
30
|
placeholder.helpOption(false);
|
|
31
31
|
placeholder.action(async () => {
|
|
32
|
-
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-
|
|
32
|
+
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-KSWTN5L6.js");
|
|
33
33
|
await dispatchLazyShortcut(definition, shortcutMetadata());
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -39,117 +39,122 @@ var builtinShortcuts = [
|
|
|
39
39
|
lazyShortcut({
|
|
40
40
|
name: "invoice",
|
|
41
41
|
description: "E10 \u4E1A\u7968\u901A\u53D1\u7968\u7BA1\u7406 CLI",
|
|
42
|
-
load: async () => (await import("./chunks/invoice-
|
|
42
|
+
load: async () => (await import("./chunks/invoice-LVIKSIIF.js")).invoiceShortcut
|
|
43
43
|
}),
|
|
44
44
|
lazyShortcut({
|
|
45
45
|
name: "ehr",
|
|
46
46
|
description: "\u6CDB\u5FAEE10\u805A\u624D\u6797\uFF08\u4EBA\u4E8B/\u51FA\u52E4/\u85AA\u916C\uFF09CLI",
|
|
47
|
-
load: async () => (await import("./chunks/ehr-
|
|
47
|
+
load: async () => (await import("./chunks/ehr-KMOJULKG.js")).ehrShortcut
|
|
48
|
+
}),
|
|
49
|
+
lazyShortcut({
|
|
50
|
+
name: "recruit-stage",
|
|
51
|
+
description: "\u6CDB\u5FAEE10\u62DB\u8058\u52A9\u624B\uFF08JD\u751F\u6210/\u7B80\u5386\u5EFA\u6863/AI\u9762\u8BD5\u9080\u7EA6\uFF09CLI",
|
|
52
|
+
load: async () => (await import("./chunks/recruit-stage-DGMFNNDE.js")).recruitStageShortcut
|
|
48
53
|
}),
|
|
49
54
|
lazyShortcut({
|
|
50
55
|
name: "cowork",
|
|
51
56
|
description: "\u6CDB\u5FAEE10\u534F\u4F5C\u533A\uFF08\u534F\u4F5C\u4E8B\u9879/\u8BA8\u8BBA/\u5BA1\u6279/\u5171\u4EAB\u6743\u9650\uFF09CLI",
|
|
52
|
-
load: async () => (await import("./chunks/cowork-
|
|
57
|
+
load: async () => (await import("./chunks/cowork-3MN6EQQO.js")).coworkShortcut
|
|
53
58
|
}),
|
|
54
59
|
lazyShortcut({
|
|
55
60
|
name: "archive",
|
|
56
61
|
description: "E10 \u6587\u4E66\u5B9A\u6863\u6848\u7BA1\u7406 CLI",
|
|
57
|
-
load: async () => (await import("./chunks/archive-
|
|
62
|
+
load: async () => (await import("./chunks/archive-J4I6MCKF.js")).archiveShortcut
|
|
58
63
|
}),
|
|
59
64
|
lazyShortcut({
|
|
60
65
|
name: "archive-oa",
|
|
61
66
|
description: "E10 \u6863\u6848\u5B9A\u4F4D\u4E0E OA \u5546\u52A1\u5408\u540C\u501F\u9605 CLI",
|
|
62
|
-
load: async () => (await import("./chunks/archive-oa-
|
|
67
|
+
load: async () => (await import("./chunks/archive-oa-BRZKKTO4.js")).archiveOaShortcut
|
|
63
68
|
}),
|
|
64
69
|
lazyShortcut({
|
|
65
70
|
name: "calendar",
|
|
66
71
|
description: "\u6CDB\u5FAEE10\u65E5\u7A0B\u7BA1\u7406 CLI\uFF08\u521B\u5EFA/\u67E5\u8BE2/\u66F4\u65B0/\u5220\u9664/\u5B57\u5178\uFF09",
|
|
67
|
-
load: async () => (await import("./chunks/calendar-
|
|
72
|
+
load: async () => (await import("./chunks/calendar-Q7NQY5Z2.js")).calendarShortcut
|
|
68
73
|
}),
|
|
69
74
|
lazyShortcut({
|
|
70
75
|
name: "fna",
|
|
71
76
|
description: "\u6CDB\u5FAEE10\u9F50\u4E1A\u6210\u8D39\u63A7\u4E2D\u5FC3\uFF08\u9884\u7B97/\u8D39\u7528\u4E2D\u5FC3/\u501F\u6B3E\u7BA1\u7406/\u53D1\u7968\u6838\u9500\uFF09CLI",
|
|
72
|
-
load: async () => (await import("./chunks/fna-
|
|
77
|
+
load: async () => (await import("./chunks/fna-ZQPCUV4R.js")).fnaShortcut
|
|
73
78
|
}),
|
|
74
79
|
lazyShortcut({
|
|
75
80
|
name: "hrm",
|
|
76
81
|
description: "\u6CDB\u5FAEE10\u7EC4\u7EC7\u7BA1\u7406\uFF08\u5458\u5DE5/\u7EC4\u7EC7/\u5C97\u4F4D\u67E5\u8BE2\uFF09CLI",
|
|
77
|
-
load: async () => (await import("./chunks/hrm-
|
|
82
|
+
load: async () => (await import("./chunks/hrm-FFM4UJFS.js")).hrmShortcut
|
|
78
83
|
}),
|
|
79
84
|
lazyShortcut({
|
|
80
85
|
name: "mail",
|
|
81
86
|
description: "\u6CDB\u5FAEE10\u90AE\u4EF6\u7BA1\u7406 CLI",
|
|
82
|
-
load: async () => (await import("./chunks/mail-
|
|
87
|
+
load: async () => (await import("./chunks/mail-VDKRGUD3.js")).mailShortcut
|
|
83
88
|
}),
|
|
84
89
|
lazyShortcut({
|
|
85
90
|
name: "meeting",
|
|
86
91
|
description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
|
|
87
|
-
load: async () => (await import("./chunks/meeting-
|
|
92
|
+
load: async () => (await import("./chunks/meeting-CLC6HP3Z.js")).meetingShortcut
|
|
88
93
|
}),
|
|
89
94
|
lazyShortcut({
|
|
90
95
|
name: "okr",
|
|
91
96
|
description: "\u6CDB\u5FAEE10 OKR \u76EE\u6807\u7BA1\u7406 CLI\uFF08\u76EE\u6807\u67E5\u8BE2/\u65B0\u5EFA/\u7F16\u8F91\u3001\u5173\u952E\u6210\u679C\u3001\u76EE\u6807\u5BF9\u9F50\u3001\u8BC4\u8BBA\uFF09",
|
|
92
|
-
load: async () => (await import("./chunks/okr-
|
|
97
|
+
load: async () => (await import("./chunks/okr-CHG4OO3U.js")).okrShortcut
|
|
93
98
|
}),
|
|
94
99
|
lazyShortcut({
|
|
95
100
|
name: "plan",
|
|
96
101
|
description: "\u6CDB\u5FAEE10\u8BA1\u5212\u62A5\u544A CLI\uFF08\u67E5\u8BE2/\u65B0\u5EFA/\u4FEE\u6539/\u53D1\u5E03/\u64A4\u56DE/\u63D0\u4EA4\u63D0\u9192/\u8BC4\u8BBA\uFF09",
|
|
97
|
-
load: async () => (await import("./chunks/plan-
|
|
102
|
+
load: async () => (await import("./chunks/plan-XWR75667.js")).planShortcut
|
|
98
103
|
}),
|
|
99
104
|
lazyShortcut({
|
|
100
105
|
name: "esb",
|
|
101
106
|
description: "\u6CDB\u5FAEE10 ESB \u4E2D\u5FC3\u81EA\u5B9A\u4E49\u89E6\u53D1\u52A8\u4F5C\u6D41 CLI",
|
|
102
|
-
load: async () => (await import("./chunks/esb-
|
|
107
|
+
load: async () => (await import("./chunks/esb-W2PJCFCX.js")).esbShortcut
|
|
103
108
|
}),
|
|
104
109
|
lazyShortcut({
|
|
105
110
|
name: "ebuilder-form",
|
|
106
111
|
description: "\u6CDB\u5FAEE10 eBuilder \u8868\u5355\u83DC\u5355\u3001\u5217\u8868\u548C\u8868\u5355\u6570\u636E CLI",
|
|
107
|
-
load: async () => (await import("./chunks/ebuilder-form-
|
|
112
|
+
load: async () => (await import("./chunks/ebuilder-form-SBHOYBUD.js")).ebuilderFormShortcut
|
|
108
113
|
}),
|
|
109
114
|
lazyShortcut({
|
|
110
115
|
name: "jiuchuanhui",
|
|
111
116
|
description: "\u6CDB\u5FAEE10\u4E5D\u6C1A\u6C47\u8425\u9500\u7BA1\u7406 CLI\uFF08\u5BA2\u6237/\u8054\u7CFB\u4EBA/\u5546\u673A/\u7EBF\u7D22/\u8054\u7CFB\u8BA1\u5212/\u516C\u6D77\uFF09",
|
|
112
|
-
load: async () => (await import("./chunks/jiuchuanhui-
|
|
117
|
+
load: async () => (await import("./chunks/jiuchuanhui-X6DINO5P.js")).jiuchuanhuiShortcut
|
|
113
118
|
}),
|
|
114
119
|
lazyShortcut({
|
|
115
120
|
name: "asset",
|
|
116
121
|
description: "E10 \u8D44\u4EA7\u7BA1\u7406\uFF08\u8D44\u7BA1\u5BB6\uFF09CLI",
|
|
117
|
-
load: async () => (await import("./chunks/asset-
|
|
122
|
+
load: async () => (await import("./chunks/asset-L7D4FAOZ.js")).assetShortcut
|
|
118
123
|
}),
|
|
119
124
|
lazyShortcut({
|
|
120
125
|
name: "asset-idle",
|
|
121
126
|
description: "E10 \u95F2\u7F6E\u8D44\u4EA7\u5224\u5B9A\u7ED3\u679C\u67E5\u8BE2 CLI\uFF08\u5206\u9875\u83B7\u53D6/\u805A\u5408\u7EDF\u8BA1\uFF09",
|
|
122
|
-
load: async () => (await import("./chunks/asset-idle-
|
|
127
|
+
load: async () => (await import("./chunks/asset-idle-DADLLV75.js")).assetIdleShortcut
|
|
123
128
|
}),
|
|
124
129
|
lazyShortcut({
|
|
125
130
|
name: "im",
|
|
126
131
|
description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
|
|
127
|
-
load: async () => (await import("./chunks/im-
|
|
132
|
+
load: async () => (await import("./chunks/im-VEHKDQPB.js")).imShortcut
|
|
128
133
|
}),
|
|
129
134
|
lazyShortcut({
|
|
130
135
|
name: "project",
|
|
131
136
|
description: "\u6CDB\u5FAEE10\u4E8B\u4E95\u7136\u9879\u76EE\u7BA1\u7406 CLI\uFF08\u9879\u76EE/\u4EFB\u52A1\u67E5\u8BE2\u4E0E\u786E\u8BA4\u5199\u5165\uFF09",
|
|
132
|
-
load: async () => (await import("./chunks/project-
|
|
137
|
+
load: async () => (await import("./chunks/project-5BXOOKMG.js")).projectShortcut
|
|
133
138
|
}),
|
|
134
139
|
lazyShortcut({
|
|
135
140
|
name: "workflow",
|
|
136
141
|
description: "\u6CDB\u5FAEE10\u6D41\u7A0B\u667A\u80FD\u52A9\u624B CLI\uFF08\u67E5\u8BE2/\u67E5\u770B/\u64CD\u4F5C/\u6279\u91CF/\u53D1\u8D77/\u4FEE\u6539\uFF09",
|
|
137
|
-
load: async () => (await import("./chunks/workflow-
|
|
142
|
+
load: async () => (await import("./chunks/workflow-ADHKCAJK.js")).workflowShortcut
|
|
138
143
|
}),
|
|
139
144
|
lazyShortcut({
|
|
140
145
|
name: "blog",
|
|
141
146
|
description: "\u6CDB\u5FAEE10\u5DE5\u4F5C\u65E5\u62A5 CLI\uFF08\u67E5\u8BE2/\u53D1\u5E03/\u7F16\u8F91/\u8BC4\u8BBA/\u70B9\u8D5E/\u63D0\u9192/\u5BFC\u51FA\uFF09",
|
|
142
|
-
load: async () => (await import("./chunks/blog-
|
|
147
|
+
load: async () => (await import("./chunks/blog-BVGQ7NZL.js")).blogShortcut
|
|
143
148
|
}),
|
|
144
149
|
lazyShortcut({
|
|
145
150
|
name: "caizhilian",
|
|
146
151
|
description: "\u6CDB\u5FAEE10\u91C7\u77E5\u8FDE\uFF08\u6587\u6863\u4E2D\u5FC3\uFF09CLI",
|
|
147
|
-
load: async () => (await import("./chunks/caizhilian-
|
|
152
|
+
load: async () => (await import("./chunks/caizhilian-SAADNFD6.js")).caizhilianShortcut
|
|
148
153
|
}),
|
|
149
154
|
lazyShortcut({
|
|
150
155
|
name: "contract",
|
|
151
156
|
description: "\u6CDB\u5FAEE10\u4ECA\u627F\u8FBE\u5408\u540C\u7BA1\u7406 CLI",
|
|
152
|
-
load: async () => (await import("./chunks/contract-
|
|
157
|
+
load: async () => (await import("./chunks/contract-5BETHRSG.js")).contractShortcut
|
|
153
158
|
})
|
|
154
159
|
];
|
|
155
160
|
function shortcutMetadata() {
|
|
@@ -17,6 +17,7 @@ const AGENT_RETURN_URL_ENV_KEY = 'WEAVER_AGENT_RETURN_URL';
|
|
|
17
17
|
const AGENT_RETURN_PATH = '/agent-return';
|
|
18
18
|
const AGENT_RETURN_TOKEN_HEADER = 'x-weaver-agent-return-token';
|
|
19
19
|
const AGENT_RETURN_TIMEOUT_MS = 900_000;
|
|
20
|
+
const OAUTH_CALLBACK_PROTOCOL_MISMATCH_GRACE_MS = 30_000;
|
|
20
21
|
const UNSAFE_AGENT_RETURN_PROTOCOLS = new Set([
|
|
21
22
|
'about:',
|
|
22
23
|
'blob:',
|
|
@@ -191,6 +192,7 @@ function formatAuthStatus(status) {
|
|
|
191
192
|
...('credentialSourceStep' in status && status.credentialSourceStep ? ['credentialSourceStep: ' + status.credentialSourceStep] : []),
|
|
192
193
|
...('credentialSourceType' in status && status.credentialSourceType ? ['credentialSourceType: ' + status.credentialSourceType] : []),
|
|
193
194
|
...('credentialSourceLabel' in status && status.credentialSourceLabel ? ['credentialSourceLabel: ' + status.credentialSourceLabel] : []),
|
|
195
|
+
...('expiryTimes' in status && status.expiryTimes ? ['expiryTimes: ' + status.expiryTimes] : []),
|
|
194
196
|
];
|
|
195
197
|
if ('valid' in status) {
|
|
196
198
|
lines.push('valid: ' + String(status.valid));
|
|
@@ -210,6 +212,7 @@ function formatLoginResult(result) {
|
|
|
210
212
|
...(result.credentialSourceStep ? ['credentialSourceStep: ' + result.credentialSourceStep] : []),
|
|
211
213
|
...(result.credentialSourceType ? ['credentialSourceType: ' + result.credentialSourceType] : []),
|
|
212
214
|
...(result.credentialSourceLabel ? ['credentialSourceLabel: ' + result.credentialSourceLabel] : []),
|
|
215
|
+
...(result.expiryTimes ? ['expiryTimes: ' + result.expiryTimes] : []),
|
|
213
216
|
].join('\n');
|
|
214
217
|
}
|
|
215
218
|
async function clearInvoiceTokenCache(profile, authData) {
|
|
@@ -300,6 +303,24 @@ export function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType) {
|
|
|
300
303
|
});
|
|
301
304
|
return `${baseUrl}/papi/sso/oauth2.0/authorize?${authorizeParams.toString()}`;
|
|
302
305
|
}
|
|
306
|
+
/** Node's HTTP parser exposes the first unread bytes when TLS is sent to an HTTP listener. */
|
|
307
|
+
export function isTlsClientHello(error) {
|
|
308
|
+
if (!error || typeof error !== 'object')
|
|
309
|
+
return false;
|
|
310
|
+
const rawPacket = error.rawPacket;
|
|
311
|
+
return Buffer.isBuffer(rawPacket)
|
|
312
|
+
&& rawPacket.length >= 3
|
|
313
|
+
&& rawPacket[0] === 0x16
|
|
314
|
+
&& rawPacket[1] === 0x03;
|
|
315
|
+
}
|
|
316
|
+
export function createOAuthCallbackProtocolMismatchError(port) {
|
|
317
|
+
return Object.assign(new CliError(`OAuth callback protocol mismatch: the browser connected to https://127.0.0.1:${port}, but the CLI callback listener uses HTTP. Retry the login and, on the callback error page, change only the URL scheme to http:// before reloading; keep the path and query unchanged. The E10 authorization service should preserve HTTP loopback redirect URIs.`, ExitCode.AuthError), {
|
|
318
|
+
type: 'authentication',
|
|
319
|
+
subtype: 'oauth_callback_protocol_mismatch',
|
|
320
|
+
retryable: false,
|
|
321
|
+
stage: 'oauth_callback',
|
|
322
|
+
});
|
|
323
|
+
}
|
|
303
324
|
async function readJsonObject(resp) {
|
|
304
325
|
const data = await resp.json().catch(() => ({}));
|
|
305
326
|
return data && typeof data === 'object' && !Array.isArray(data) ? data : {};
|
|
@@ -488,7 +509,7 @@ function xiaoEUnifiedLoginUnavailableMessage(baseUrl, attempted) {
|
|
|
488
509
|
'CLI 会优先使用 XiaoE 客户端内置 Python 执行 tokens.py;自动发现不可用时,可用 WEAVER_XIAOE_TOKEN_SCRIPT_PYTHON 指定兼容解释器。',
|
|
489
510
|
].join(' ');
|
|
490
511
|
}
|
|
491
|
-
async function
|
|
512
|
+
async function runXiaoELogin(ctx, options) {
|
|
492
513
|
const commandOpts = asOptions(options);
|
|
493
514
|
const globalOptions = ctx.getGlobalOptions();
|
|
494
515
|
const profileFromGlobal = globalOptions.profile;
|
|
@@ -499,59 +520,50 @@ async function runBrowserLogin(ctx, options, behavior = {}) {
|
|
|
499
520
|
profileBaseUrl: cfg.baseUrl,
|
|
500
521
|
env: ctx.env,
|
|
501
522
|
});
|
|
502
|
-
const xiaoESources =
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
523
|
+
const xiaoESources = inspectXiaoEUnifiedLoginSources({
|
|
524
|
+
env: ctx.env,
|
|
525
|
+
baseUrl: preferredXiaoEBaseUrl,
|
|
526
|
+
profileBaseUrl: cfg.baseUrl,
|
|
527
|
+
allowTokenScript: true,
|
|
528
|
+
});
|
|
529
|
+
const useXiaoELogin = xiaoESources.any;
|
|
530
|
+
const baseUrl = preferredXiaoEBaseUrl;
|
|
531
|
+
const tenantKey = optionString(commandOpts, 'tenantKey');
|
|
532
|
+
ctx.logger.info([
|
|
533
|
+
'XiaoE unified login preflight:',
|
|
534
|
+
'authMode=xiaoe',
|
|
535
|
+
`credentialSourceDetected=${String(xiaoESources.any)}`,
|
|
536
|
+
`attempted=${String(useXiaoELogin)}`,
|
|
537
|
+
`platformCredentialDetected=${String(xiaoESources.platformCredential)}`,
|
|
538
|
+
`tokenScriptDetected=${String(xiaoESources.tokenScript)}`,
|
|
539
|
+
`clientSettingsDetected=${String(xiaoESources.clientCredential)}`,
|
|
540
|
+
`environmentCredentialDetected=${String(xiaoESources.environmentCredential)}`,
|
|
541
|
+
`clientType=${xiaoESources.clientType || '(unset)'}`,
|
|
542
|
+
`baseUrl=${baseUrl || '(unresolved)'}`,
|
|
543
|
+
].join(' '));
|
|
544
|
+
if (useXiaoELogin) {
|
|
545
|
+
const xiaoEResult = await tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKey, profileFromGlobal, true);
|
|
546
|
+
if (xiaoEResult)
|
|
547
|
+
return xiaoEResult;
|
|
548
|
+
}
|
|
549
|
+
ctx.logger.warn(xiaoEUnifiedLoginUnavailableMessage(baseUrl, useXiaoELogin));
|
|
550
|
+
throw createXiaoEUnifiedLoginUnavailableError(baseUrl);
|
|
551
|
+
}
|
|
552
|
+
async function runBrowserLogin(ctx, options) {
|
|
553
|
+
const commandOpts = asOptions(options);
|
|
554
|
+
const globalOptions = ctx.getGlobalOptions();
|
|
555
|
+
const profileFromGlobal = globalOptions.profile;
|
|
556
|
+
const cfg = readProfileConfig(profileFromGlobal || getActiveProfile());
|
|
557
|
+
const explicitBaseUrl = optionString(commandOpts, 'baseUrl') || globalOptions.baseUrl || '';
|
|
558
|
+
const baseUrl = normalizeUrl(explicitBaseUrl || cfg.baseUrl || '');
|
|
520
559
|
const tenantKey = optionString(commandOpts, 'tenantKey');
|
|
521
560
|
const portText = optionString(commandOpts, 'port') || '19800';
|
|
522
561
|
const port = Number.parseInt(portText, 10);
|
|
523
562
|
const explicitAgentType = optionString(commandOpts, 'agentType', 'agent_type');
|
|
524
|
-
const agentType =
|
|
525
|
-
? optionString(commandOpts, 'agentType', 'agent_type') || XIAOE_AGENT_TYPE
|
|
526
|
-
: resolveAgentType(commandOpts, ctx.env);
|
|
563
|
+
const agentType = resolveAgentType(commandOpts, ctx.env);
|
|
527
564
|
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
528
565
|
throw new CliError('Invalid --port value', ExitCode.UsageError);
|
|
529
566
|
}
|
|
530
|
-
if (behavior.tryXiaoEUnifiedLogin) {
|
|
531
|
-
ctx.logger.info([
|
|
532
|
-
'XiaoE unified login preflight:',
|
|
533
|
-
'authMode=xiaoe',
|
|
534
|
-
`credentialSourceDetected=${String(xiaoESources.any)}`,
|
|
535
|
-
`attempted=${String(useXiaoELogin)}`,
|
|
536
|
-
`platformCredentialDetected=${String(xiaoESources.platformCredential)}`,
|
|
537
|
-
`tokenScriptDetected=${String(xiaoESources.tokenScript)}`,
|
|
538
|
-
`clientSettingsDetected=${String(xiaoESources.clientCredential)}`,
|
|
539
|
-
`environmentCredentialDetected=${String(xiaoESources.environmentCredential)}`,
|
|
540
|
-
`baseUrl=${baseUrl || '(unresolved)'}`,
|
|
541
|
-
].join(' '));
|
|
542
|
-
}
|
|
543
|
-
if (useXiaoELogin) {
|
|
544
|
-
const xiaoEResult = await tryXiaoEUnifiedLogin(ctx, baseUrl, tenantKey, profileFromGlobal, behavior.allowXiaoETokenScript === true);
|
|
545
|
-
if (xiaoEResult)
|
|
546
|
-
return xiaoEResult;
|
|
547
|
-
}
|
|
548
|
-
const willOpenBrowser = behavior.browserFallback !== 'never';
|
|
549
|
-
if (behavior.tryXiaoEUnifiedLogin && behavior.explainXiaoEFallback) {
|
|
550
|
-
ctx.logger.warn(xiaoEUnifiedLoginUnavailableMessage(baseUrl, useXiaoELogin));
|
|
551
|
-
}
|
|
552
|
-
if (!willOpenBrowser) {
|
|
553
|
-
throw createXiaoEUnifiedLoginUnavailableError(baseUrl);
|
|
554
|
-
}
|
|
555
567
|
if (!baseUrl)
|
|
556
568
|
throw new CliError('Missing --base-url', ExitCode.UsageError);
|
|
557
569
|
const agentReturnTarget = resolveAgentReturnTarget(commandOpts, ctx.env, agentType);
|
|
@@ -564,6 +576,7 @@ async function runBrowserLogin(ctx, options, behavior = {}) {
|
|
|
564
576
|
let settled = false;
|
|
565
577
|
let timer = null;
|
|
566
578
|
let pendingLoginResult = null;
|
|
579
|
+
let tlsCallbackDetected = false;
|
|
567
580
|
const finish = (error, result) => {
|
|
568
581
|
if (settled)
|
|
569
582
|
return;
|
|
@@ -647,6 +660,13 @@ async function runBrowserLogin(ctx, options, behavior = {}) {
|
|
|
647
660
|
finish(new CliError('No authorization code received.', ExitCode.AuthError));
|
|
648
661
|
return;
|
|
649
662
|
}
|
|
663
|
+
// The user followed the recovery instruction and reached the HTTP
|
|
664
|
+
// callback. Do not let the protocol-mismatch grace timer race the token
|
|
665
|
+
// exchange that is now legitimately in progress.
|
|
666
|
+
if (tlsCallbackDetected && timer) {
|
|
667
|
+
clearTimeout(timer);
|
|
668
|
+
timer = null;
|
|
669
|
+
}
|
|
650
670
|
try {
|
|
651
671
|
const result = await oidcExchange(code, redirectUri, baseUrl, tenantKey, redirectAgentType, profileFromGlobal);
|
|
652
672
|
const responseHeaders = {
|
|
@@ -685,6 +705,26 @@ async function runBrowserLogin(ctx, options, behavior = {}) {
|
|
|
685
705
|
: error.message;
|
|
686
706
|
finish(new CliError(message, ExitCode.UsageError));
|
|
687
707
|
});
|
|
708
|
+
server.on('clientError', (error, socket) => {
|
|
709
|
+
if (isTlsClientHello(error)) {
|
|
710
|
+
if (!tlsCallbackDetected) {
|
|
711
|
+
tlsCallbackDetected = true;
|
|
712
|
+
ctx.logger.warn([
|
|
713
|
+
`OAuth callback protocol mismatch: the browser used HTTPS for 127.0.0.1:${port}, while the CLI listener is HTTP.`,
|
|
714
|
+
'在 30 秒内把浏览器当前地址开头明确改为 http://,保留后面的完整路径和参数,然后回车重试。',
|
|
715
|
+
'不要把地址中的授权码复制到聊天或日志。',
|
|
716
|
+
].join(' '));
|
|
717
|
+
if (timer)
|
|
718
|
+
clearTimeout(timer);
|
|
719
|
+
timer = setTimeout(() => {
|
|
720
|
+
finish(createOAuthCallbackProtocolMismatchError(port));
|
|
721
|
+
}, OAUTH_CALLBACK_PROTOCOL_MISMATCH_GRACE_MS);
|
|
722
|
+
}
|
|
723
|
+
socket.destroy();
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
socket.destroy();
|
|
727
|
+
});
|
|
688
728
|
server.listen(port, '127.0.0.1', () => {
|
|
689
729
|
ctx.logger.info('Local callback server: ' + redirectUri);
|
|
690
730
|
openUrlInBrowser(loginUrl, ctx);
|
|
@@ -728,7 +768,7 @@ function formatWhoami(title, data) {
|
|
|
728
768
|
'User-Agent: ' + (data.userAgent || ''),
|
|
729
769
|
].join('\n');
|
|
730
770
|
}
|
|
731
|
-
function registerBrowserLoginCommand(auth, action, name, description
|
|
771
|
+
function registerBrowserLoginCommand(auth, action, name, description) {
|
|
732
772
|
const command = auth.command(name)
|
|
733
773
|
.description(description)
|
|
734
774
|
.option('--base-url <url>', 'E10 base URL')
|
|
@@ -738,7 +778,23 @@ function registerBrowserLoginCommand(auth, action, name, description, behavior =
|
|
|
738
778
|
.option('--agent-type <value>', 'Alias of --agent_type')
|
|
739
779
|
.option('--agent-return-url <url>', 'Desktop application URL linked by the login success page');
|
|
740
780
|
command.action(action(async (ctx, options) => {
|
|
741
|
-
const result = await runBrowserLogin(ctx, options
|
|
781
|
+
const result = await runBrowserLogin(ctx, options);
|
|
782
|
+
ctx.output.write(result, { text: formatLoginResult(result) });
|
|
783
|
+
}));
|
|
784
|
+
}
|
|
785
|
+
function registerXiaoELoginCommand(auth, action) {
|
|
786
|
+
auth.command('xiaoe')
|
|
787
|
+
.description('Use XiaoE unified login without browser OAuth fallback')
|
|
788
|
+
.option('--base-url <url>', 'E10 base URL')
|
|
789
|
+
.option('--tenant-key <key>', 'Tenant key fallback after login')
|
|
790
|
+
// Keep previously accepted browser flags as no-ops so existing wrappers do
|
|
791
|
+
// not break. The dedicated handler never parses them or opens a callback.
|
|
792
|
+
.option('--port <n>', 'Deprecated compatibility option; ignored by XiaoE unified login', '19800')
|
|
793
|
+
.option('--agent_type <value>', 'Deprecated compatibility option; ignored by XiaoE unified login')
|
|
794
|
+
.option('--agent-type <value>', 'Alias of --agent_type')
|
|
795
|
+
.option('--agent-return-url <url>', 'Deprecated compatibility option; ignored by XiaoE unified login')
|
|
796
|
+
.action(action(async (ctx, options) => {
|
|
797
|
+
const result = await runXiaoELogin(ctx, options);
|
|
742
798
|
ctx.output.write(result, { text: formatLoginResult(result) });
|
|
743
799
|
}));
|
|
744
800
|
}
|
|
@@ -758,7 +814,9 @@ export function registerE10AuthCommands(parent, action) {
|
|
|
758
814
|
const commandOpts = asOptions(options);
|
|
759
815
|
const authFile = findAuthFile(ctx.cwd, opts);
|
|
760
816
|
const session = authFile ? E10AuthSession.fromFile(authFile, opts.baseUrl, opts.passportUrl) : null;
|
|
761
|
-
const valid = session && commandOpts.check !== false
|
|
817
|
+
const valid = session && commandOpts.check !== false
|
|
818
|
+
? session.isExpired() ? false : await session.checkValid()
|
|
819
|
+
: undefined;
|
|
762
820
|
const status = session
|
|
763
821
|
? {
|
|
764
822
|
loggedIn: true,
|
|
@@ -779,6 +837,7 @@ export function registerE10AuthCommands(parent, action) {
|
|
|
779
837
|
...(session.credentialSourceStep ? { credentialSourceStep: session.credentialSourceStep } : {}),
|
|
780
838
|
...(session.credentialSourceType ? { credentialSourceType: session.credentialSourceType } : {}),
|
|
781
839
|
...(session.credentialSourceLabel ? { credentialSourceLabel: session.credentialSourceLabel } : {}),
|
|
840
|
+
...(session.expiryTimes ? { expiryTimes: session.expiryTimes } : {}),
|
|
782
841
|
valid,
|
|
783
842
|
}
|
|
784
843
|
: {
|
|
@@ -823,12 +882,7 @@ export function registerE10AuthCommands(parent, action) {
|
|
|
823
882
|
}));
|
|
824
883
|
registerBrowserLoginCommand(auth, action, 'login', 'Open browser OAuth2.0 login and save E10 auth');
|
|
825
884
|
registerBrowserLoginCommand(auth, action, 'oidc', 'Alias of auth login for OAuth2.0 browser login');
|
|
826
|
-
|
|
827
|
-
tryXiaoEUnifiedLogin: true,
|
|
828
|
-
allowXiaoETokenScript: true,
|
|
829
|
-
explainXiaoEFallback: true,
|
|
830
|
-
browserFallback: 'never',
|
|
831
|
-
});
|
|
885
|
+
registerXiaoELoginCommand(auth, action);
|
|
832
886
|
auth.command('logout')
|
|
833
887
|
.alias('clear')
|
|
834
888
|
.description('Clear saved E10 auth for the current or selected profile')
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export const E10_REAUTH_GUIDANCE = '请结合当前宿主环境选择合适的登录方式,恢复登录后重试原请求。';
|
|
2
2
|
export const E10_AUTH_REQUIRED_MESSAGE = `E10 登录态不可用。${E10_REAUTH_GUIDANCE}`;
|
|
3
3
|
export const E10_XIAOE_RECOVERY_FAILED_MESSAGE = 'E10 登录态不可用。已尝试小 e 自动重新获取登录信息,但未取得可用登录态。请在小 e 中恢复登录后重试。';
|
|
4
|
+
export const E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE = 'E10 登录态不可用。小 e 网页端未向当前运行环境注入统一登录凭据,自动获取已停止。请检查网页技能沙箱的宿主凭据透传后重试。';
|
|
5
|
+
/**
|
|
6
|
+
* 恢复流程全程只有网络错误时的文案。此时登录态根本没有被验证过,让用户去
|
|
7
|
+
* 重新登录是误导——该做的是稍后重试。
|
|
8
|
+
*/
|
|
9
|
+
export const E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE = '暂时无法连接 E10,请稍后重试';
|
|
4
10
|
export const E10_SESSION_EXPIRED_MESSAGE = `E10 登录态已失效,本次操作已停止。${E10_REAUTH_GUIDANCE}`;
|