weaver-work-cli 0.1.44 → 0.1.46
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 +9 -5
- package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
- package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
- package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
- package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
- package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-MCXQBD6N.js} +3 -3
- package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
- package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-4RWS2YYL.js} +5 -5
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-6AXKWFKG.js} +32 -12
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-6V5ZPKHV.js} +56 -12
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-76H3IKH6.js} +178 -37
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-AD46OMQK.js} +239 -41
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
- package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
- package/dist/chunks/{chunk-CWYGFU5B.js → chunk-GSZTA43P.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-IP4CWQCF.js} +11 -11
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-IRMIEDXN.js} +1 -1
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-JFAWZX53.js} +134 -13
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-OXHHJWNC.js} +1 -1
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-PSOMGA3U.js} +4 -4
- package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
- package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
- package/dist/chunks/{chunk-XHK4MDR5.js → chunk-UFIFZ4YC.js} +48 -14
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
- package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
- package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-H7EHQXYY.js} +2 -2
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
- package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
- package/dist/chunks/{create-flow-J22BO65E.js → create-flow-VRVJEOBX.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-SH2LM3NK.js} +648 -88
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-66FPSJDV.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-UH2TZBVA.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-CAKMMV7K.js} +3 -3
- package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
- package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
- package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
- package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
- package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
- package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
- package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
- package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
- package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-DD6ULZ3I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-VTBFW4HI.js} +12 -12
- package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
- package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
- package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
- package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-CAKZTUA7.js} +1343 -178
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-JVQBLFQ5.js} +10 -10
- package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
- package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
- package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-5U55FMXZ.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-IDETODCA.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/cmd/action.js +14 -10
- package/dist/index.js +30 -30
- package/dist/internal/e10/auth/commands.js +32 -0
- package/dist/internal/e10/auth/error-log.js +156 -26
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/context.js +12 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +19 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/ehr/host.js +2 -2
- package/dist/shortcuts/ehr/index.js +14 -3
- package/dist/shortcuts/ehr/manifest.js +5 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +44 -12
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +146 -43
- package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +154 -36
- package/dist/shortcuts/ehr/operations/recruit.js +196 -12
- package/dist/shortcuts/ehr/operations/registry.js +4 -0
- package/dist/shortcuts/ehr/operations.js +24 -0
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +274 -75
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +63 -11
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +38 -7
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/invitation.js +27 -4
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +356 -29
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +36 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +309 -67
- package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +310 -17
- package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
- package/dist/shortcuts/recruit-stage/shared.js +221 -24
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/docs/contract.md +1 -0
- package/docs/e10-auth.md +4 -2
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jucailin/SKILL.md +12 -3
- package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
- package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -91
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
- package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +55 -11
- package/skills/weaver-e10-meeting/SKILL.md +103 -11
- package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -11
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -8
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +23 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +11 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
queryBody,
|
|
14
14
|
toIdCsv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6V5ZPKHV.js";
|
|
16
16
|
|
|
17
17
|
// src/shortcuts/meeting/operations/eb/conflict.ts
|
|
18
18
|
var ACTIVE_MT_STATUS = "1,2,8,9";
|
|
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
|
|
|
296
296
|
const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
|
|
297
297
|
const nameLike = items.filter((item) => !/^\d+$/u.test(item));
|
|
298
298
|
if (nameLike.length > 0) {
|
|
299
|
-
const { resolveMemberIdsByName } = await import("./schedule-
|
|
299
|
+
const { resolveMemberIdsByName } = await import("./schedule-IDETODCA.js");
|
|
300
300
|
const idsByName = await resolveMemberIdsByName(env, nameLike);
|
|
301
301
|
const resolved = items.map((item) => idsByName.get(item) ?? item);
|
|
302
302
|
payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
|
|
@@ -535,7 +535,7 @@ async function resolveMemberNames(env, ids) {
|
|
|
535
535
|
const unique = [...new Set(ids.filter((id) => id !== ""))];
|
|
536
536
|
if (unique.length === 0) return map;
|
|
537
537
|
try {
|
|
538
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
538
|
+
const { hrmEmployeeOperations } = await import("./employee-NOHNXC46.js");
|
|
539
539
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
540
540
|
if (!batch) return map;
|
|
541
541
|
const result = await batch.handler({ ids: unique }, env);
|
|
@@ -610,7 +610,7 @@ async function findCommonFreeSlots(env, input) {
|
|
|
610
610
|
const scheduleItems = [];
|
|
611
611
|
if (includeSchedule) {
|
|
612
612
|
try {
|
|
613
|
-
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-
|
|
613
|
+
const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-IDETODCA.js");
|
|
614
614
|
const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
|
|
615
615
|
const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
|
|
616
616
|
const flow = await runScheduleConflictFlow(env, {
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
createE10RequestRuntime,
|
|
15
15
|
isE10SessionExpiredResponse,
|
|
16
16
|
requireE10Session
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6NXT4ICB.js";
|
|
18
18
|
import {
|
|
19
19
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
20
20
|
getActiveProfile
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-U6R6FZHD.js";
|
|
22
22
|
|
|
23
23
|
// src/shortcuts/esb/host.ts
|
|
24
24
|
var ESB_PATHS = {
|
|
@@ -929,15 +929,25 @@ var XIAOE_USER_TOKEN_SOURCE = "XIAOE_USER_TOKEN";
|
|
|
929
929
|
var XIAOE_BUNDLED_ENV_SCRIPT_SOURCE = "bundled scripts/xiaoe_env.py";
|
|
930
930
|
var XIAOE_ETEAMID_TTL_MS = 72e5;
|
|
931
931
|
var XIAOE_DIAGNOSTIC_MAX_LENGTH = 300;
|
|
932
|
-
|
|
932
|
+
var XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH = 2e3;
|
|
933
|
+
function redactXiaoEDiagnostic(message, secrets, maxLength = XIAOE_DIAGNOSTIC_MAX_LENGTH) {
|
|
933
934
|
let text = message;
|
|
934
935
|
for (const secret of secrets) {
|
|
935
936
|
if (secret && secret.length >= 8 && text.includes(secret)) {
|
|
936
937
|
text = text.split(secret).join("<redacted>");
|
|
937
938
|
}
|
|
938
939
|
}
|
|
940
|
+
text = text.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/giu, "$1<redacted>").replace(
|
|
941
|
+
/((?:eteamsid|access[_-]?token|refresh[_-]?token|auth(?:orization)?|cookie|session[_-]?id|secret|password)\s*[:=]\s*)(["']?)[^\s,;}"']+/giu,
|
|
942
|
+
"$1$2<redacted>"
|
|
943
|
+
);
|
|
939
944
|
const normalized = text.replace(/\s+/gu, " ").trim();
|
|
940
|
-
return normalized.length >
|
|
945
|
+
return normalized.length > maxLength ? `${normalized.slice(0, maxLength)}\u2026` : normalized;
|
|
946
|
+
}
|
|
947
|
+
function xiaoEDiagnosticSecrets(env) {
|
|
948
|
+
return Object.entries(env).filter(([key, value]) => Boolean(
|
|
949
|
+
value && (key.startsWith("XIAOE_") || key.startsWith("WEAVER_XIAOE_")) && /(?:TOKEN|AUTH|ETEAMSID|COOKIE|SESSION|SECRET|PASSWORD)/iu.test(key)
|
|
950
|
+
)).map(([, value]) => value);
|
|
941
951
|
}
|
|
942
952
|
function noteXiaoEStep(diagnostics, step) {
|
|
943
953
|
diagnostics?.attemptedSteps.push(step);
|
|
@@ -950,6 +960,12 @@ function readTag(error, key, type) {
|
|
|
950
960
|
const value = error[key];
|
|
951
961
|
return typeof value === type ? value : void 0;
|
|
952
962
|
}
|
|
963
|
+
function readExchangeRequest(error) {
|
|
964
|
+
if (!error || typeof error !== "object") return void 0;
|
|
965
|
+
const request = error.request;
|
|
966
|
+
if (!request || typeof request !== "object" || Array.isArray(request)) return void 0;
|
|
967
|
+
return request;
|
|
968
|
+
}
|
|
953
969
|
function classifyXiaoEHttpStatus(status) {
|
|
954
970
|
if (status === 401 || status === 403) return "credential";
|
|
955
971
|
if (status >= 300 && status < 400) return "credential";
|
|
@@ -980,19 +996,41 @@ function classifyXiaoEError(error) {
|
|
|
980
996
|
function noteXiaoEError(diagnostics, error, secrets = [], stage = "e10_session") {
|
|
981
997
|
if (!diagnostics) return;
|
|
982
998
|
const message = error instanceof Error ? error.message : String(error);
|
|
999
|
+
const request = readExchangeRequest(error);
|
|
983
1000
|
const redacted = redactXiaoEDiagnostic(message, secrets);
|
|
984
1001
|
if (redacted) diagnostics.lastError = redacted;
|
|
1002
|
+
const failureMessage = request || stage === "bundled_env_script" ? redactXiaoEDiagnostic(message, secrets, XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH) : redacted;
|
|
985
1003
|
const { kind, causeCode, status } = classifyXiaoEError(error);
|
|
986
1004
|
const failure = {
|
|
987
1005
|
stage: readTag(error, "stage", "string") ?? stage,
|
|
988
1006
|
kind,
|
|
989
|
-
message:
|
|
1007
|
+
message: failureMessage,
|
|
990
1008
|
...causeCode ? { causeCode } : {},
|
|
991
|
-
...status === void 0 ? {} : { httpStatus: status }
|
|
1009
|
+
...status === void 0 ? {} : { httpStatus: status },
|
|
1010
|
+
...request ? { request } : {}
|
|
992
1011
|
};
|
|
993
1012
|
if (!diagnostics.failures) diagnostics.failures = [];
|
|
994
1013
|
diagnostics.failures.push(failure);
|
|
995
1014
|
}
|
|
1015
|
+
function xiaoEErrorChainDetail(error, secrets) {
|
|
1016
|
+
const parts = [];
|
|
1017
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1018
|
+
let current = error;
|
|
1019
|
+
for (let depth = 0; depth < 5 && current !== void 0 && current !== null; depth += 1) {
|
|
1020
|
+
if (seen.has(current)) break;
|
|
1021
|
+
seen.add(current);
|
|
1022
|
+
const record = typeof current === "object" ? current : null;
|
|
1023
|
+
const name = current instanceof Error ? current.name : typeof record?.name === "string" ? record.name : `cause${depth}`;
|
|
1024
|
+
const message = current instanceof Error ? current.message : typeof record?.message === "string" ? record.message : String(current);
|
|
1025
|
+
const attributes = ["code", "errno", "syscall", "hostname", "address", "port"].map((key) => {
|
|
1026
|
+
const value = record?.[key];
|
|
1027
|
+
return typeof value === "string" || typeof value === "number" ? `${key}=${String(value)}` : "";
|
|
1028
|
+
}).filter(Boolean);
|
|
1029
|
+
parts.push(`${name}: ${message}${attributes.length ? ` {${attributes.join(", ")}}` : ""}`);
|
|
1030
|
+
current = record?.cause;
|
|
1031
|
+
}
|
|
1032
|
+
return redactXiaoEDiagnostic(parts.join(" <- "), secrets, XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH);
|
|
1033
|
+
}
|
|
996
1034
|
function summarizeXiaoEFailureKind(diagnostics) {
|
|
997
1035
|
const failures = diagnostics?.failures || [];
|
|
998
1036
|
if (!failures.length) return void 0;
|
|
@@ -1325,6 +1363,75 @@ function xiaoETokenScriptPythonCandidates(env = process.env, platform = process.
|
|
|
1325
1363
|
function isXiaoETokenScriptEnvFailure(message) {
|
|
1326
1364
|
return /No module named|ModuleNotFoundError|ENOENT|EACCES|permission denied|command not found|not recognized as an internal|cannot find the file/i.test(message);
|
|
1327
1365
|
}
|
|
1366
|
+
function safeXiaoEEndpoint(value) {
|
|
1367
|
+
const url = value instanceof URL ? new URL(value.toString()) : new URL(value);
|
|
1368
|
+
url.username = "";
|
|
1369
|
+
url.password = "";
|
|
1370
|
+
url.search = "";
|
|
1371
|
+
url.hash = "";
|
|
1372
|
+
return url.toString();
|
|
1373
|
+
}
|
|
1374
|
+
function xiaoEExchangeRequestDiagnostic(options) {
|
|
1375
|
+
const endpoint = safeXiaoEEndpoint(options.endpoint);
|
|
1376
|
+
const finalEndpoint = options.finalEndpoint ? safeXiaoEEndpoint(options.finalEndpoint) : endpoint;
|
|
1377
|
+
const body = { domain: options.domain || DEFAULT_E10_BASE_URL };
|
|
1378
|
+
const serializedBody = JSON.stringify(body);
|
|
1379
|
+
return {
|
|
1380
|
+
transport: options.transport,
|
|
1381
|
+
method: "POST",
|
|
1382
|
+
endpoint,
|
|
1383
|
+
...finalEndpoint === endpoint ? {} : { finalEndpoint },
|
|
1384
|
+
redirect: options.transport === "node_fetch" ? "manual" : "safe-follow",
|
|
1385
|
+
headers: {
|
|
1386
|
+
"content-type": "application/json",
|
|
1387
|
+
authorization: "<redacted>"
|
|
1388
|
+
},
|
|
1389
|
+
authorizationPresent: Boolean(options.authorization),
|
|
1390
|
+
authorizationLength: options.authorization.length,
|
|
1391
|
+
body,
|
|
1392
|
+
bodyBytes: Buffer.byteLength(serializedBody, "utf8"),
|
|
1393
|
+
timeoutMs: XIAOE_CLIENT_TOKEN_TIMEOUT_MS,
|
|
1394
|
+
elapsedMs: Math.max(0, Date.now() - options.startedAt),
|
|
1395
|
+
...options.redirectCount ? { redirectCount: options.redirectCount } : {}
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function xiaoEPythonFailureDetail(error, stderr, env) {
|
|
1399
|
+
const stderrText = stderr.trim();
|
|
1400
|
+
const lines = stderrText.split(/\r?\n/u).map((line) => line.trim()).filter(Boolean);
|
|
1401
|
+
let scriptMessage = "";
|
|
1402
|
+
for (const line of [...lines].reverse()) {
|
|
1403
|
+
try {
|
|
1404
|
+
const parsed = JSON.parse(line);
|
|
1405
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
1406
|
+
const candidate = readString(parsed, "msg", "message", "error");
|
|
1407
|
+
if (candidate) {
|
|
1408
|
+
scriptMessage = candidate;
|
|
1409
|
+
break;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
} catch {
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
const stderrTail = lines.slice(-12).join(" | ");
|
|
1416
|
+
const rawDetail = [
|
|
1417
|
+
`exitCode=${String(error.code ?? "unknown")}`,
|
|
1418
|
+
...error.signal ? [`signal=${error.signal}`] : [],
|
|
1419
|
+
...error.killed ? ["killed=true"] : [],
|
|
1420
|
+
...scriptMessage ? [`scriptMessage=${scriptMessage}`] : [],
|
|
1421
|
+
...stderrTail ? [`stderrTail=${stderrTail}`] : [`processError=${error.message || "unknown error"}`]
|
|
1422
|
+
].join(" ");
|
|
1423
|
+
const detail = redactXiaoEDiagnostic(
|
|
1424
|
+
rawDetail,
|
|
1425
|
+
xiaoEDiagnosticSecrets(env),
|
|
1426
|
+
XIAOE_SCRIPT_DIAGNOSTIC_MAX_LENGTH
|
|
1427
|
+
);
|
|
1428
|
+
const causeCode = /\b(?:UND_ERR_[A-Z_]+|E[A-Z_]{3,})\b/u.exec(detail)?.[0];
|
|
1429
|
+
return {
|
|
1430
|
+
detail,
|
|
1431
|
+
...causeCode && isNetworkErrorCode(causeCode) ? { causeCode } : {},
|
|
1432
|
+
network: Boolean(causeCode && isNetworkErrorCode(causeCode) || looksLikeTransportMessage(detail))
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1328
1435
|
async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env) {
|
|
1329
1436
|
const wrapper = [
|
|
1330
1437
|
"import ast,contextlib,io,json,runpy,sys",
|
|
@@ -1368,8 +1475,15 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
|
|
|
1368
1475
|
},
|
|
1369
1476
|
(error, stdout, stderr) => {
|
|
1370
1477
|
if (error) {
|
|
1371
|
-
const detail = (
|
|
1372
|
-
|
|
1478
|
+
const { detail, causeCode, network } = xiaoEPythonFailureDetail(error, stderr, env);
|
|
1479
|
+
const scriptError = new CliError("XiaoE credential script failed: " + detail, 3 /* AuthError */);
|
|
1480
|
+
if (network) {
|
|
1481
|
+
Object.assign(scriptError, {
|
|
1482
|
+
errorKind: "network",
|
|
1483
|
+
...causeCode ? { causeCode } : {}
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
reject(scriptError);
|
|
1373
1487
|
return;
|
|
1374
1488
|
}
|
|
1375
1489
|
const text = stdout.trim();
|
|
@@ -1414,7 +1528,25 @@ async function resolveXiaoETokenScriptCredential(baseUrl, env = process.env) {
|
|
|
1414
1528
|
async function resolveXiaoEBundledEnvScriptCredential(baseUrl, env = process.env) {
|
|
1415
1529
|
const scriptPath = xiaoEBundledEnvScriptPath();
|
|
1416
1530
|
if (!scriptPath) return null;
|
|
1417
|
-
const
|
|
1531
|
+
const platformCredential = readXiaoEPlatformCredential(env);
|
|
1532
|
+
const startedAt = Date.now();
|
|
1533
|
+
let tokenData;
|
|
1534
|
+
try {
|
|
1535
|
+
tokenData = await runXiaoEPythonCredentialScript(scriptPath, baseUrl, env);
|
|
1536
|
+
} catch (error) {
|
|
1537
|
+
if (platformCredential && error && typeof error === "object") {
|
|
1538
|
+
Object.assign(error, {
|
|
1539
|
+
request: xiaoEExchangeRequestDiagnostic({
|
|
1540
|
+
transport: "bundled_python",
|
|
1541
|
+
endpoint: `${platformCredential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`,
|
|
1542
|
+
domain: baseUrl,
|
|
1543
|
+
authorization: platformCredential.authToken,
|
|
1544
|
+
startedAt
|
|
1545
|
+
})
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
throw error;
|
|
1549
|
+
}
|
|
1418
1550
|
if (!tokenData) return null;
|
|
1419
1551
|
return withDefaultXiaoEExpiry(
|
|
1420
1552
|
readXiaoECredentialRecord(tokenData, XIAOE_BUNDLED_ENV_SCRIPT_SOURCE, baseUrl)
|
|
@@ -1544,10 +1676,23 @@ function inspectXiaoEUnifiedLoginSources(options = {}) {
|
|
|
1544
1676
|
};
|
|
1545
1677
|
}
|
|
1546
1678
|
async function fetchXiaoEClientEteamId(credential, domain) {
|
|
1679
|
+
const requestedDomain = domain || DEFAULT_E10_BASE_URL;
|
|
1680
|
+
const startedAt = Date.now();
|
|
1681
|
+
const initialEndpoint = new URL(`${credential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`);
|
|
1682
|
+
let endpoint = initialEndpoint;
|
|
1683
|
+
let redirectCount = 0;
|
|
1684
|
+
const requestDiagnostic = () => xiaoEExchangeRequestDiagnostic({
|
|
1685
|
+
transport: "node_fetch",
|
|
1686
|
+
endpoint: initialEndpoint,
|
|
1687
|
+
finalEndpoint: endpoint,
|
|
1688
|
+
domain: requestedDomain,
|
|
1689
|
+
authorization: credential.authToken,
|
|
1690
|
+
startedAt,
|
|
1691
|
+
redirectCount
|
|
1692
|
+
});
|
|
1547
1693
|
const controller = new AbortController();
|
|
1548
1694
|
const timer = setTimeout(() => controller.abort(), XIAOE_CLIENT_TOKEN_TIMEOUT_MS);
|
|
1549
1695
|
try {
|
|
1550
|
-
let endpoint = new URL(`${credential.erpaUrl}${XIAOE_SKILL_ETEAMID_API_PATH}`);
|
|
1551
1696
|
let resp = null;
|
|
1552
1697
|
for (let redirects = 0; redirects <= 5; redirects += 1) {
|
|
1553
1698
|
resp = await fetch(endpoint, {
|
|
@@ -1556,7 +1701,7 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
1556
1701
|
"content-type": "application/json",
|
|
1557
1702
|
authorization: credential.authToken
|
|
1558
1703
|
},
|
|
1559
|
-
body: JSON.stringify({ domain:
|
|
1704
|
+
body: JSON.stringify({ domain: requestedDomain }),
|
|
1560
1705
|
redirect: "manual",
|
|
1561
1706
|
signal: controller.signal
|
|
1562
1707
|
});
|
|
@@ -1585,6 +1730,7 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
1585
1730
|
}
|
|
1586
1731
|
await resp.body?.cancel().catch(() => void 0);
|
|
1587
1732
|
endpoint = next;
|
|
1733
|
+
redirectCount = redirects + 1;
|
|
1588
1734
|
}
|
|
1589
1735
|
if (!resp?.ok) {
|
|
1590
1736
|
const status = resp?.status || 0;
|
|
@@ -1617,15 +1763,22 @@ async function fetchXiaoEClientEteamId(credential, domain) {
|
|
|
1617
1763
|
if (isAbortError(error)) {
|
|
1618
1764
|
throw tagXiaoEError(
|
|
1619
1765
|
`XiaoE client token endpoint timed out after ${XIAOE_CLIENT_TOKEN_TIMEOUT_MS} ms.`,
|
|
1620
|
-
{ errorKind: "network", causeCode: "ETIMEDOUT" }
|
|
1766
|
+
{ errorKind: "network", causeCode: "ETIMEDOUT", request: requestDiagnostic() }
|
|
1621
1767
|
);
|
|
1622
1768
|
}
|
|
1623
|
-
if (error instanceof CliError)
|
|
1769
|
+
if (error instanceof CliError) {
|
|
1770
|
+
Object.assign(error, { request: requestDiagnostic() });
|
|
1771
|
+
throw error;
|
|
1772
|
+
}
|
|
1624
1773
|
const causeCode = readErrorCauseCode(error);
|
|
1625
|
-
const
|
|
1774
|
+
const detail = xiaoEErrorChainDetail(error, [credential.authToken]);
|
|
1626
1775
|
throw tagXiaoEError(
|
|
1627
|
-
`XiaoE client token endpoint request failed${causeCode ? ` (${causeCode})` : ""}: ${
|
|
1628
|
-
{
|
|
1776
|
+
`XiaoE client token endpoint request failed${causeCode ? ` (${causeCode})` : ""}: ${detail}`,
|
|
1777
|
+
{
|
|
1778
|
+
errorKind: "network",
|
|
1779
|
+
...causeCode ? { causeCode } : {},
|
|
1780
|
+
request: requestDiagnostic()
|
|
1781
|
+
}
|
|
1629
1782
|
);
|
|
1630
1783
|
} finally {
|
|
1631
1784
|
clearTimeout(timer);
|
|
@@ -1940,6 +2093,7 @@ export {
|
|
|
1940
2093
|
packagePath,
|
|
1941
2094
|
packageFileUrl,
|
|
1942
2095
|
normalizeGlobalOptions,
|
|
2096
|
+
writeWithRetry,
|
|
1943
2097
|
readErrorCauseCode,
|
|
1944
2098
|
getE10AuthRoot,
|
|
1945
2099
|
getActiveProfile,
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
resolveRefInput,
|
|
15
15
|
resultThresholdBytes
|
|
16
16
|
} from "./chunk-727FH2NI.js";
|
|
17
|
-
import {
|
|
18
|
-
refsDir
|
|
19
|
-
} from "./chunk-AJ62BGAW.js";
|
|
20
17
|
import {
|
|
21
18
|
Command,
|
|
22
19
|
clearInvoiceTokenForSession
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GR76ZDDX.js";
|
|
21
|
+
import {
|
|
22
|
+
refsDir
|
|
23
|
+
} from "./chunk-AJ62BGAW.js";
|
|
24
24
|
import {
|
|
25
25
|
shouldReportPlatformError,
|
|
26
26
|
toPlatformError
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
normalizeXiaoEAuthErrorLogLimit,
|
|
33
33
|
readXiaoEAuthErrorLog,
|
|
34
34
|
xiaoEAuthLogSecrets
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-6NXT4ICB.js";
|
|
36
36
|
import {
|
|
37
37
|
E10AuthSession,
|
|
38
38
|
XIAOE_AGENT_TYPE,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
setActiveProfile,
|
|
62
62
|
switchActiveProfile,
|
|
63
63
|
tryXiaoEUnifiedLogin
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-U6R6FZHD.js";
|
|
65
65
|
import {
|
|
66
66
|
CliError,
|
|
67
67
|
isCliError,
|
|
@@ -994,6 +994,36 @@ function formatXiaoEAuthErrorLogEntry(entry) {
|
|
|
994
994
|
failure.httpStatus === void 0 ? "" : `httpStatus=${failure.httpStatus}`,
|
|
995
995
|
failure.message
|
|
996
996
|
].filter(Boolean).join(" "));
|
|
997
|
+
if (failure.request) {
|
|
998
|
+
lines.push([
|
|
999
|
+
"request:",
|
|
1000
|
+
`transport=${failure.request.transport}`,
|
|
1001
|
+
`method=${failure.request.method}`,
|
|
1002
|
+
`endpoint=${failure.request.endpoint}`,
|
|
1003
|
+
failure.request.finalEndpoint ? `finalEndpoint=${failure.request.finalEndpoint}` : "",
|
|
1004
|
+
`redirect=${failure.request.redirect}`,
|
|
1005
|
+
`timeoutMs=${failure.request.timeoutMs}`,
|
|
1006
|
+
`elapsedMs=${failure.request.elapsedMs}`,
|
|
1007
|
+
failure.request.redirectCount ? `redirectCount=${failure.request.redirectCount}` : ""
|
|
1008
|
+
].filter(Boolean).join(" "));
|
|
1009
|
+
lines.push(`requestHeaders: ${JSON.stringify(failure.request.headers)}`);
|
|
1010
|
+
lines.push(`requestBody: ${JSON.stringify(failure.request.body)}`);
|
|
1011
|
+
lines.push(`requestParams: ${JSON.stringify({
|
|
1012
|
+
transport: failure.request.transport,
|
|
1013
|
+
url: failure.request.endpoint,
|
|
1014
|
+
...failure.request.finalEndpoint ? { finalUrl: failure.request.finalEndpoint } : {},
|
|
1015
|
+
method: failure.request.method,
|
|
1016
|
+
headers: failure.request.headers,
|
|
1017
|
+
body: failure.request.body,
|
|
1018
|
+
bodyBytes: failure.request.bodyBytes,
|
|
1019
|
+
redirect: failure.request.redirect,
|
|
1020
|
+
timeoutMs: failure.request.timeoutMs,
|
|
1021
|
+
authorizationPresent: failure.request.authorizationPresent,
|
|
1022
|
+
authorizationLength: failure.request.authorizationLength,
|
|
1023
|
+
elapsedMs: failure.request.elapsedMs,
|
|
1024
|
+
...failure.request.redirectCount ? { redirectCount: failure.request.redirectCount } : {}
|
|
1025
|
+
})}`);
|
|
1026
|
+
}
|
|
997
1027
|
}
|
|
998
1028
|
return lines.join("\n");
|
|
999
1029
|
}
|
|
@@ -1009,12 +1039,14 @@ async function showXiaoEAuthErrorLogs(ctx, options) {
|
|
|
1009
1039
|
const text = result.entries.length ? [
|
|
1010
1040
|
`XiaoE auth error logs (${result.returned}/${result.total}, newest first)`,
|
|
1011
1041
|
`logFile: ${result.path}`,
|
|
1042
|
+
...result.expiredRemoved ? [`expiredRemoved: ${result.expiredRemoved}`] : [],
|
|
1012
1043
|
...result.invalidLines ? [`invalidLines: ${result.invalidLines}`] : [],
|
|
1013
1044
|
"",
|
|
1014
1045
|
result.entries.map(formatXiaoEAuthErrorLogEntry).join("\n\n")
|
|
1015
1046
|
].join("\n") : [
|
|
1016
1047
|
"No XiaoE auth error logs.",
|
|
1017
1048
|
`logFile: ${result.path}`,
|
|
1049
|
+
...result.expiredRemoved ? [`expiredRemoved: ${result.expiredRemoved}`] : [],
|
|
1018
1050
|
...result.invalidLines ? [`invalidLines: ${result.invalidLines}`] : []
|
|
1019
1051
|
].join("\n");
|
|
1020
1052
|
ctx.output.write(result, { text });
|
|
@@ -2232,18 +2264,20 @@ function createAction(ctx) {
|
|
|
2232
2264
|
await commandCtx.hooks.afterCommand(commandCtx, result);
|
|
2233
2265
|
} catch (error) {
|
|
2234
2266
|
await commandCtx.hooks.onError(commandCtx, error);
|
|
2235
|
-
if (shouldReportPlatformError(error)) {
|
|
2236
|
-
process.stderr.write(JSON.stringify(toPlatformError(error)) + "\n");
|
|
2237
|
-
}
|
|
2238
2267
|
if (commandCtx.getGlobalOptions().json) {
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2268
|
+
const env = { schemaVersion: 1, ok: false, error: toErrorEnvelope(error) };
|
|
2269
|
+
if (shouldReportPlatformError(error)) {
|
|
2270
|
+
const pe = toPlatformError(error);
|
|
2271
|
+
env.code = pe.code;
|
|
2272
|
+
env.message = pe.message;
|
|
2273
|
+
}
|
|
2274
|
+
console.error(JSON.stringify(env, null, 2));
|
|
2244
2275
|
process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
|
|
2245
2276
|
return;
|
|
2246
2277
|
}
|
|
2278
|
+
if (shouldReportPlatformError(error)) {
|
|
2279
|
+
process.stderr.write(JSON.stringify(toPlatformError(error)) + "\n");
|
|
2280
|
+
}
|
|
2247
2281
|
if (isCliError(error)) {
|
|
2248
2282
|
commandCtx.logger.error(error.message);
|
|
2249
2283
|
process.exitCode = error.exitCode;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
caizhilianValidationError
|
|
5
|
+
} from "./chunk-P5GQRWDC.js";
|
|
6
|
+
import {
|
|
7
|
+
CONTINUATION_TTL_MS
|
|
8
|
+
} from "./chunk-7BDPM5ST.js";
|
|
9
|
+
|
|
10
|
+
// src/shortcuts/caizhilian/continuation.ts
|
|
11
|
+
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { resolve } from "node:path";
|
|
16
|
+
function stateRoot(ctx) {
|
|
17
|
+
const configured = ctx?.config?.path();
|
|
18
|
+
if (configured) return resolve(configured, "..");
|
|
19
|
+
return process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), ".weaver-work-cli");
|
|
20
|
+
}
|
|
21
|
+
async function loadKey(ctx) {
|
|
22
|
+
const keysDir = resolve(stateRoot(ctx), "keys");
|
|
23
|
+
const filename = resolve(keysDir, "caizhilian-continuation.key");
|
|
24
|
+
await mkdir(keysDir, { recursive: true, mode: 448 });
|
|
25
|
+
if (existsSync(filename)) return readFile(filename);
|
|
26
|
+
const key = randomBytes(32);
|
|
27
|
+
try {
|
|
28
|
+
await writeFile(filename, key, { flag: "wx", mode: 384 });
|
|
29
|
+
if (process.platform !== "win32") await chmod(filename, 384).catch(() => void 0);
|
|
30
|
+
return key;
|
|
31
|
+
} catch {
|
|
32
|
+
return readFile(filename);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function encode(value) {
|
|
36
|
+
return Buffer.from(JSON.stringify(value)).toString("base64url");
|
|
37
|
+
}
|
|
38
|
+
function signature(payload, key) {
|
|
39
|
+
return createHmac("sha256", key).update(payload).digest("base64url");
|
|
40
|
+
}
|
|
41
|
+
function createCaizhilianContinuationSigner(ctx) {
|
|
42
|
+
return {
|
|
43
|
+
async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
|
|
44
|
+
const issuedAt = Date.now();
|
|
45
|
+
const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
|
|
46
|
+
const sig = signature(body, await loadKey(ctx));
|
|
47
|
+
return `${body}.${sig}`;
|
|
48
|
+
},
|
|
49
|
+
async verify(token, expectedOperation) {
|
|
50
|
+
if (typeof token !== "string" || !token.includes(".")) {
|
|
51
|
+
throw caizhilianValidationError("continuation_invalid", "continuation \u65E0\u6548");
|
|
52
|
+
}
|
|
53
|
+
const [body, provided] = token.split(".");
|
|
54
|
+
const expected = signature(body, await loadKey(ctx));
|
|
55
|
+
const valid = provided.length === expected.length && timingSafeEqual(Buffer.from(provided), Buffer.from(expected));
|
|
56
|
+
if (!valid) throw caizhilianValidationError("continuation_invalid", "continuation \u7B7E\u540D\u6821\u9A8C\u5931\u8D25");
|
|
57
|
+
let value;
|
|
58
|
+
try {
|
|
59
|
+
value = JSON.parse(Buffer.from(body, "base64url").toString("utf8"));
|
|
60
|
+
} catch {
|
|
61
|
+
throw caizhilianValidationError("continuation_invalid", "continuation \u5185\u5BB9\u65E0\u6CD5\u89E3\u6790");
|
|
62
|
+
}
|
|
63
|
+
if (value.operation !== expectedOperation) {
|
|
64
|
+
throw caizhilianValidationError("continuation_mismatch", "continuation \u4E0D\u5C5E\u4E8E\u5F53\u524D\u64CD\u4F5C");
|
|
65
|
+
}
|
|
66
|
+
if (!Number.isSafeInteger(value.expiresAt) || value.expiresAt < Date.now()) {
|
|
67
|
+
throw caizhilianValidationError("continuation_expired", "continuation \u5DF2\u8FC7\u671F");
|
|
68
|
+
}
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
createCaizhilianContinuationSigner
|
|
76
|
+
};
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
createE10RequestRuntime,
|
|
11
11
|
isE10SessionExpiredResponse,
|
|
12
12
|
requireE10Session
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6NXT4ICB.js";
|
|
14
14
|
import {
|
|
15
15
|
getActiveProfile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-U6R6FZHD.js";
|
|
17
17
|
|
|
18
18
|
// src/shortcuts/ebuilder-form/host.ts
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
createE10RequestRuntime,
|
|
12
12
|
isE10SessionExpiredResponse,
|
|
13
13
|
requireE10Session
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6NXT4ICB.js";
|
|
15
15
|
import {
|
|
16
16
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
17
17
|
getActiveProfile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-U6R6FZHD.js";
|
|
19
19
|
|
|
20
20
|
// src/shortcuts/hrm/host.ts
|
|
21
21
|
function inferProfile(ctx) {
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
findCommonFreeSlots,
|
|
8
8
|
meetingEbConflictOperations,
|
|
9
9
|
runEbConflictCheck
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-PSOMGA3U.js";
|
|
11
|
+
import "./chunk-6V5ZPKHV.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createCaizhilianContinuationSigner
|
|
5
|
+
} from "./chunk-VRPH24IC.js";
|
|
6
|
+
import "./chunk-P5GQRWDC.js";
|
|
7
|
+
import "./chunk-7BDPM5ST.js";
|
|
8
|
+
import "./chunk-UG5G54VL.js";
|
|
9
|
+
import "./chunk-BUSC6UAE.js";
|
|
10
|
+
export {
|
|
11
|
+
createCaizhilianContinuationSigner
|
|
12
|
+
};
|