weaver-work-cli 0.1.70 → 0.1.73
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/dist/chunks/{archive-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
- package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
- package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
- package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
- package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
- package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
- package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
- package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +42 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
- package/dist/shortcuts/ehr/operations/recruit.js +206 -82
- package/dist/shortcuts/ehr/operations/shared.js +31 -0
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +15 -2
- package/dist/shortcuts/reception/manifest.js +17 -3
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +12 -6
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
- package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +158 -4
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/form.js +36 -2
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -3,9 +3,10 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
CAIZHILAN_MAX_DOWNLOAD_BYTES,
|
|
5
5
|
CAIZHILAN_TRANSFER_TIMEOUT_MS,
|
|
6
|
+
CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE,
|
|
6
7
|
caizhilianBusinessMessage,
|
|
7
8
|
isCaizhilianBusinessSuccess
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NUP4RYZK.js";
|
|
9
10
|
import {
|
|
10
11
|
CaizhilianCliError,
|
|
11
12
|
caizhilianAuthError,
|
|
@@ -7951,6 +7952,24 @@ async function searchVirtualFolders(args, env) {
|
|
|
7951
7952
|
folders
|
|
7952
7953
|
});
|
|
7953
7954
|
}
|
|
7955
|
+
function isBareServerFail(raw) {
|
|
7956
|
+
if (typeof raw !== "string") return false;
|
|
7957
|
+
try {
|
|
7958
|
+
const parsed = JSON.parse(raw);
|
|
7959
|
+
return isRecord(parsed) && parsed.code === 500 && parsed.status === false && parsed.fail === true;
|
|
7960
|
+
} catch {
|
|
7961
|
+
return false;
|
|
7962
|
+
}
|
|
7963
|
+
}
|
|
7964
|
+
function applyBusinessErrorMessage(error, businessErrorMessage) {
|
|
7965
|
+
if (!businessErrorMessage || !(error instanceof CaizhilianCliError)) return error;
|
|
7966
|
+
if (error.subtype !== "business_error") return error;
|
|
7967
|
+
if (error.message !== CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE) return error;
|
|
7968
|
+
const raw = error.details?.raw;
|
|
7969
|
+
if (!isBareServerFail(raw)) return error;
|
|
7970
|
+
error.message = businessErrorMessage;
|
|
7971
|
+
return error;
|
|
7972
|
+
}
|
|
7954
7973
|
function browserSearch(config) {
|
|
7955
7974
|
return async (args, env) => {
|
|
7956
7975
|
const { pageNo, pageSize } = parsePage(args, 50);
|
|
@@ -7971,6 +7990,8 @@ function browserSearch(config) {
|
|
|
7971
7990
|
path: config.path,
|
|
7972
7991
|
body,
|
|
7973
7992
|
operation: config.action
|
|
7993
|
+
}).catch((error) => {
|
|
7994
|
+
throw applyBusinessErrorMessage(error, config.businessErrorMessage);
|
|
7974
7995
|
});
|
|
7975
7996
|
const items = nestedList(response, "data", "data");
|
|
7976
7997
|
return caizhilianSuccess(config.action, {
|
|
@@ -8020,6 +8041,7 @@ var subcompanySearch = browserSearch({
|
|
|
8020
8041
|
resultKey: "subcompanies",
|
|
8021
8042
|
head: { browserMultiple: true, virtualType: "ALL", cmd: "list" },
|
|
8022
8043
|
tail: { stopDepartment: false },
|
|
8044
|
+
businessErrorMessage: "\u672C\u79DF\u6237\u672A\u5F00\u901A\u5206\u90E8\u529F\u80FD",
|
|
8023
8045
|
mapItem: (item) => ({
|
|
8024
8046
|
id: String(item.id ?? ""),
|
|
8025
8047
|
name: item.name ?? "",
|
|
@@ -9527,6 +9549,24 @@ var caizhilianSystemHandlers = {
|
|
|
9527
9549
|
};
|
|
9528
9550
|
|
|
9529
9551
|
// src/shortcuts/caizhilian/operations/registry.ts
|
|
9552
|
+
var caizhilianWithheldOperations = [
|
|
9553
|
+
{
|
|
9554
|
+
name: "caizhilian.system.list-systems",
|
|
9555
|
+
reason: "\u6E90 list_systems \u8BFB\u53D6\u7684\u662F Skill \u81EA\u5E26 assets/config.json \u7684\u591A\u73AF\u5883\u914D\u7F6E\u4E0E\u767B\u5F55\u6001\uFF1Bweaver-work-cli \u7684\u73AF\u5883\u4E0E\u767B\u5F55\u6001\u7531\u6846\u67B6\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u7528 `weaver-work-cli config list` \u4E0E `weaver-work-cli auth status` \u67E5\u770B\uFF0C\u8FDE\u901A\u6027\u81EA\u68C0\u7528 caizhilian.system.health\u3002"
|
|
9556
|
+
},
|
|
9557
|
+
{
|
|
9558
|
+
name: "caizhilian.system.get-loaded-config",
|
|
9559
|
+
reason: "\u6E90 get_loaded_config \u4F1A\u8F93\u51FA Skill \u672C\u5730 config.json \u7684\u751F\u6548\u5185\u5BB9\uFF08\u542B cookies \u63A9\u7801\u3001\u4E0B\u8F7D\u76EE\u5F55\u7B49\uFF09\uFF1BCLI \u4FA7\u7B49\u4EF7\u4FE1\u606F\u6765\u81EA\u6846\u67B6\u914D\u7F6E\uFF0C\u8BF7\u7528 `weaver-work-cli config list`\uFF0C\u4E0D\u5728\u4E1A\u52A1\u6A21\u5757\u5185\u66B4\u9732\u914D\u7F6E\u5FEB\u7167\u3002"
|
|
9560
|
+
},
|
|
9561
|
+
{
|
|
9562
|
+
name: "caizhilian.system.reload-config",
|
|
9563
|
+
reason: "\u6E90 reload_config \u91CD\u65B0\u52A0\u8F7D Skill \u672C\u5730 config.json\uFF1BCLI \u6BCF\u6B21\u8FDB\u7A0B\u542F\u52A8\u5373\u8BFB\u53D6\u6846\u67B6\u914D\u7F6E\uFF0C\u65E0\u8FDB\u7A0B\u5185\u7F13\u5B58\u9700\u8981\u5237\u65B0\uFF0C\u6545\u4E0D\u63D0\u4F9B\u8BE5\u64CD\u4F5C\u3002"
|
|
9564
|
+
},
|
|
9565
|
+
{
|
|
9566
|
+
name: "caizhilian.system.switch-config",
|
|
9567
|
+
reason: "\u6E90 switch_config \u5728 Skill \u672C\u5730\u591A\u5957\u73AF\u5883\u914D\u7F6E\u95F4\u5207\u6362\uFF1BCLI \u7684\u73AF\u5883\u4E0E\u8BA4\u8BC1\u914D\u7F6E\u4F53\u7CFB\u8D1F\u8D23\u8FD9\u4E00\u804C\u8D23\uFF0C\u4E1A\u52A1\u6A21\u5757\u4E0D\u505A\u73AF\u5883\u5207\u6362\u3002"
|
|
9568
|
+
}
|
|
9569
|
+
];
|
|
9530
9570
|
var PREPARE_SUFFIX = ".prepare";
|
|
9531
9571
|
var APPLY_SUFFIX = ".apply";
|
|
9532
9572
|
function mergeHandlers(maps) {
|
|
@@ -9628,7 +9668,11 @@ function caizhilianOperationDefinitions() {
|
|
|
9628
9668
|
function getCaizhilianOperation(operation) {
|
|
9629
9669
|
const definition = caizhilianRegistry.get(operation);
|
|
9630
9670
|
if (!definition) {
|
|
9631
|
-
|
|
9671
|
+
const withheld = caizhilianWithheldOperations.some((entry) => entry.name === operation);
|
|
9672
|
+
throw caizhilianValidationError(
|
|
9673
|
+
"operation_unknown",
|
|
9674
|
+
`\u91C7\u77E5\u8FDE\u4E0D\u652F\u6301\u64CD\u4F5C\uFF1A${operation}${withheld ? "\uFF08\u5C5E withheld \u80FD\u529B\uFF0C\u539F\u56E0\u4E0E\u66FF\u4EE3\u547D\u4EE4\u89C1 caizhilian operations \u8F93\u51FA\u7684 withheldOperations\uFF09" : ""}`
|
|
9675
|
+
);
|
|
9632
9676
|
}
|
|
9633
9677
|
return definition;
|
|
9634
9678
|
}
|
|
@@ -9647,24 +9691,6 @@ function caizhilianOperationContracts() {
|
|
|
9647
9691
|
}
|
|
9648
9692
|
|
|
9649
9693
|
// src/shortcuts/caizhilian/manifest.ts
|
|
9650
|
-
var WITHHELD = [
|
|
9651
|
-
{
|
|
9652
|
-
name: "caizhilian.system.list-systems",
|
|
9653
|
-
reason: "\u6E90 list_systems \u8BFB\u53D6\u7684\u662F Skill \u81EA\u5E26 assets/config.json \u7684\u591A\u73AF\u5883\u914D\u7F6E\u4E0E\u767B\u5F55\u6001\uFF1Bweaver-work-cli \u7684\u73AF\u5883\u4E0E\u767B\u5F55\u6001\u7531\u6846\u67B6\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u7528 `weaver-work-cli config list` \u4E0E `weaver-work-cli auth status` \u67E5\u770B\uFF0C\u8FDE\u901A\u6027\u81EA\u68C0\u7528 caizhilian.system.health\u3002"
|
|
9654
|
-
},
|
|
9655
|
-
{
|
|
9656
|
-
name: "caizhilian.system.get-loaded-config",
|
|
9657
|
-
reason: "\u6E90 get_loaded_config \u4F1A\u8F93\u51FA Skill \u672C\u5730 config.json \u7684\u751F\u6548\u5185\u5BB9\uFF08\u542B cookies \u63A9\u7801\u3001\u4E0B\u8F7D\u76EE\u5F55\u7B49\uFF09\uFF1BCLI \u4FA7\u7B49\u4EF7\u4FE1\u606F\u6765\u81EA\u6846\u67B6\u914D\u7F6E\uFF0C\u8BF7\u7528 `weaver-work-cli config list`\uFF0C\u4E0D\u5728\u4E1A\u52A1\u6A21\u5757\u5185\u66B4\u9732\u914D\u7F6E\u5FEB\u7167\u3002"
|
|
9658
|
-
},
|
|
9659
|
-
{
|
|
9660
|
-
name: "caizhilian.system.reload-config",
|
|
9661
|
-
reason: "\u6E90 reload_config \u91CD\u65B0\u52A0\u8F7D Skill \u672C\u5730 config.json\uFF1BCLI \u6BCF\u6B21\u8FDB\u7A0B\u542F\u52A8\u5373\u8BFB\u53D6\u6846\u67B6\u914D\u7F6E\uFF0C\u65E0\u8FDB\u7A0B\u5185\u7F13\u5B58\u9700\u8981\u5237\u65B0\uFF0C\u6545\u4E0D\u63D0\u4F9B\u8BE5\u64CD\u4F5C\u3002"
|
|
9662
|
-
},
|
|
9663
|
-
{
|
|
9664
|
-
name: "caizhilian.system.switch-config",
|
|
9665
|
-
reason: "\u6E90 switch_config \u5728 Skill \u672C\u5730\u591A\u5957\u73AF\u5883\u914D\u7F6E\u95F4\u5207\u6362\uFF1BCLI \u7684\u73AF\u5883\u4E0E\u8BA4\u8BC1\u914D\u7F6E\u4F53\u7CFB\u8D1F\u8D23\u8FD9\u4E00\u804C\u8D23\uFF0C\u4E1A\u52A1\u6A21\u5757\u4E0D\u505A\u73AF\u5883\u5207\u6362\u3002"
|
|
9666
|
-
}
|
|
9667
|
-
];
|
|
9668
9694
|
function buildOperations() {
|
|
9669
9695
|
return caizhilianOperationContracts();
|
|
9670
9696
|
}
|
|
@@ -9678,7 +9704,8 @@ var caizhilianManifest = {
|
|
|
9678
9704
|
sourceSkill: "weaver-e10-caizhilian",
|
|
9679
9705
|
capabilities: ["caizhilian"],
|
|
9680
9706
|
operations: buildOperations(),
|
|
9681
|
-
|
|
9707
|
+
withheldCount: caizhilianWithheldOperations.length,
|
|
9708
|
+
withheldOperations: caizhilianWithheldOperations
|
|
9682
9709
|
};
|
|
9683
9710
|
|
|
9684
9711
|
// src/shortcuts/caizhilian/operations.ts
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
createE10RequestRuntime,
|
|
5
5
|
isE10SessionExpiredResponse,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IU6UB2TD.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_REAUTH_GUIDANCE,
|
|
10
10
|
E10_SESSION_EXPIRED_MESSAGE
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IZCQU5D5.js";
|
|
12
12
|
import {
|
|
13
13
|
getActiveProfile
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AMAPQVBT.js";
|
|
15
15
|
import {
|
|
16
16
|
CliError
|
|
17
17
|
} from "./chunk-UG5G54VL.js";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-WMRNO6IU.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingStateDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F4HM25K4.js";
|
|
9
9
|
import {
|
|
10
10
|
SCHEMA_ID,
|
|
11
11
|
meetingSuccess,
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
schemaOf
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4I26YMBY.js";
|
|
15
15
|
|
|
16
16
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
17
17
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
refMaxCount,
|
|
16
16
|
resolveRefInput,
|
|
17
17
|
resultThresholdChars
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-54ST55IJ.js";
|
|
19
19
|
import {
|
|
20
20
|
refsDir
|
|
21
21
|
} from "./chunk-AJ62BGAW.js";
|
|
22
22
|
import {
|
|
23
23
|
Command,
|
|
24
24
|
clearInvoiceTokenForSession
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GWJLAF6B.js";
|
|
26
26
|
import {
|
|
27
27
|
shouldReportPlatformError,
|
|
28
28
|
toPlatformError
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
normalizeXiaoEAuthErrorLogLimit,
|
|
35
35
|
readXiaoEAuthErrorLog,
|
|
36
36
|
xiaoEAuthLogSecrets
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-IU6UB2TD.js";
|
|
38
38
|
import {
|
|
39
39
|
E10AuthSession,
|
|
40
40
|
XIAOE_AGENT_TYPE,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
switchActiveProfile,
|
|
71
71
|
tryXiaoEUnifiedLogin,
|
|
72
72
|
upsertAgentHost
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-AMAPQVBT.js";
|
|
74
74
|
import {
|
|
75
75
|
CliError,
|
|
76
76
|
isCliError,
|
|
@@ -107,160 +107,10 @@ function toCommandMetadata(commands) {
|
|
|
107
107
|
}));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// src/cmd/commands/index.ts
|
|
111
|
-
var commandsCommand = {
|
|
112
|
-
name: "commands",
|
|
113
|
-
description: "Registered command discovery",
|
|
114
|
-
category: "system",
|
|
115
|
-
register({ program, action }) {
|
|
116
|
-
const commands = program.command("commands").alias("module").description("Inspect registered commands");
|
|
117
|
-
commands.command("list").description("List registered commands").action(action((ctx) => {
|
|
118
|
-
ctx.output.write({ commands: ctx.commands, modules: ctx.modules });
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// src/cmd/config/index.ts
|
|
124
|
-
function parseValue(value) {
|
|
125
|
-
if (value === "true") return true;
|
|
126
|
-
if (value === "false") return false;
|
|
127
|
-
if (value === "null") return null;
|
|
128
|
-
if (/^-?\d+(\.\d+)?$/.test(value)) return Number(value);
|
|
129
|
-
try {
|
|
130
|
-
return JSON.parse(value);
|
|
131
|
-
} catch {
|
|
132
|
-
return value;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
var configCommand = {
|
|
136
|
-
name: "config",
|
|
137
|
-
description: "Generic local configuration commands",
|
|
138
|
-
category: "system",
|
|
139
|
-
register({ program, action }) {
|
|
140
|
-
const config = program.command("config").description("Manage weaver-work-cli config");
|
|
141
|
-
config.command("path").description("Print the active config file path").action(action((ctx) => {
|
|
142
|
-
ctx.output.write({ path: ctx.config.path() }, { text: ctx.config.path() });
|
|
143
|
-
}));
|
|
144
|
-
config.command("list").description("Print all config values").action(action((ctx) => {
|
|
145
|
-
ctx.output.write(ctx.config.all());
|
|
146
|
-
}));
|
|
147
|
-
config.command("get").description("Print one config value").argument("<key>", "config key").action(action((ctx, key) => {
|
|
148
|
-
if (typeof key !== "string") throw new CliError("key must be a string", 2 /* UsageError */);
|
|
149
|
-
ctx.output.write({ key, value: ctx.config.get(key) });
|
|
150
|
-
}));
|
|
151
|
-
config.command("set").description("Set one config value").argument("<key>", "config key").argument("<value>", "config value").action(action((ctx, key, value) => {
|
|
152
|
-
if (typeof key !== "string" || typeof value !== "string") {
|
|
153
|
-
throw new CliError("key and value must be strings", 2 /* UsageError */);
|
|
154
|
-
}
|
|
155
|
-
const parsed = parseValue(value);
|
|
156
|
-
ctx.config.set(key, parsed);
|
|
157
|
-
ctx.output.write({ key, value: parsed, path: ctx.config.path() }, { text: "Saved " + key });
|
|
158
|
-
}));
|
|
159
|
-
config.command("delete").description("Delete one config value").argument("<key>", "config key").action(action((ctx, key) => {
|
|
160
|
-
if (typeof key !== "string") throw new CliError("key must be a string", 2 /* UsageError */);
|
|
161
|
-
const deleted = ctx.config.delete(key);
|
|
162
|
-
ctx.output.write({ key, deleted, path: ctx.config.path() }, { text: deleted ? "Deleted " + key : "No value for " + key });
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/cmd/docs/index.ts
|
|
168
|
-
import { cpSync, existsSync, readdirSync, readFileSync } from "node:fs";
|
|
169
|
-
import { resolve } from "node:path";
|
|
170
|
-
var DOCS_DIR = packagePath("docs");
|
|
171
|
-
var PKG_JSON_URL = packageFileUrl("package.json");
|
|
172
|
-
function packageVersion() {
|
|
173
|
-
try {
|
|
174
|
-
return JSON.parse(readFileSync(PKG_JSON_URL, "utf-8")).version;
|
|
175
|
-
} catch {
|
|
176
|
-
return "unknown";
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function countFiles(dir) {
|
|
180
|
-
let count = 0;
|
|
181
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
182
|
-
const entryPath = resolve(dir, entry.name);
|
|
183
|
-
count += entry.isDirectory() ? countFiles(entryPath) : 1;
|
|
184
|
-
}
|
|
185
|
-
return count;
|
|
186
|
-
}
|
|
187
|
-
function ensureDocs() {
|
|
188
|
-
if (!existsSync(DOCS_DIR)) {
|
|
189
|
-
throw new CliError("docs directory does not exist: " + DOCS_DIR);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
var docsCommand = {
|
|
193
|
-
name: "docs",
|
|
194
|
-
description: "Packaged docs and template copy commands",
|
|
195
|
-
category: "system",
|
|
196
|
-
register({ program, action }) {
|
|
197
|
-
const docs = program.command("docs").description("Read or copy packaged docs");
|
|
198
|
-
docs.command("root").description("Print packaged docs root path").action(action((ctx) => {
|
|
199
|
-
ensureDocs();
|
|
200
|
-
const root = DOCS_DIR.replace(/[\\/]+$/, "");
|
|
201
|
-
ctx.output.write({ root, version: packageVersion() }, { text: root + "\nversion: " + packageVersion() });
|
|
202
|
-
}));
|
|
203
|
-
docs.command("copy").description("Copy packaged docs to <target>/weaver-work-cli-docs").argument("[target]", "target directory", process.cwd()).action(action((ctx, target) => {
|
|
204
|
-
ensureDocs();
|
|
205
|
-
const dest = resolve(String(target || process.cwd()), "weaver-work-cli-docs");
|
|
206
|
-
const sourceRoot = DOCS_DIR.replace(/[\\/]+$/, "");
|
|
207
|
-
if (dest === sourceRoot || dest.startsWith(sourceRoot + "/") || dest.startsWith(sourceRoot + "\\")) {
|
|
208
|
-
throw new CliError("target directory is inside docs source: " + dest);
|
|
209
|
-
}
|
|
210
|
-
cpSync(DOCS_DIR, dest, { recursive: true });
|
|
211
|
-
const files = countFiles(dest);
|
|
212
|
-
ctx.output.write({ files, dest, version: packageVersion() }, { text: "Copied " + files + " files to " + dest });
|
|
213
|
-
}));
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
// src/cmd/doctor/index.ts
|
|
218
|
-
import { existsSync as existsSync2 } from "node:fs";
|
|
219
|
-
function versionMajor(version) {
|
|
220
|
-
return Number(version.replace(/^v/, "").split(".")[0] || 0);
|
|
221
|
-
}
|
|
222
|
-
var doctorCommand = {
|
|
223
|
-
name: "doctor",
|
|
224
|
-
description: "Environment diagnostics",
|
|
225
|
-
category: "system",
|
|
226
|
-
register({ program, action }) {
|
|
227
|
-
program.command("doctor").description("Check local CLI environment").option("--e10", "also check E10 auth file discovery").action(action((ctx, options) => {
|
|
228
|
-
const opts = options && typeof options === "object" ? options : {};
|
|
229
|
-
const checks = [
|
|
230
|
-
{
|
|
231
|
-
name: "node",
|
|
232
|
-
ok: versionMajor(process.version) >= 18,
|
|
233
|
-
detail: process.version
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
name: "package",
|
|
237
|
-
ok: Boolean(ctx.packageInfo.version),
|
|
238
|
-
detail: ctx.packageInfo.name + "@" + ctx.packageInfo.version
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: "configPath",
|
|
242
|
-
ok: true,
|
|
243
|
-
detail: ctx.config.path()
|
|
244
|
-
}
|
|
245
|
-
];
|
|
246
|
-
if (opts.e10) {
|
|
247
|
-
const authFile = findAuthFile(ctx.cwd);
|
|
248
|
-
checks.push({
|
|
249
|
-
name: "e10AuthFile",
|
|
250
|
-
ok: Boolean(authFile && existsSync2(authFile)),
|
|
251
|
-
detail: authFile || "not found"
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
const ok = checks.every((check) => check.ok);
|
|
255
|
-
ctx.output.write({ ok, checks });
|
|
256
|
-
}));
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
|
|
260
110
|
// src/internal/e10/auth/commands.ts
|
|
261
111
|
import { execFile } from "node:child_process";
|
|
262
112
|
import { randomBytes } from "node:crypto";
|
|
263
|
-
import { existsSync
|
|
113
|
+
import { existsSync } from "node:fs";
|
|
264
114
|
import { createServer } from "node:http";
|
|
265
115
|
var DEFAULT_AGENT_TYPE = "weaver-work-cli";
|
|
266
116
|
var EXPLICIT_AGENT_TYPE_ENV_KEYS = [
|
|
@@ -506,7 +356,7 @@ function renderE10LoginSuccessPage(userId, returnTarget = null, launchToken = ""
|
|
|
506
356
|
}
|
|
507
357
|
function defaultFileExists(file) {
|
|
508
358
|
try {
|
|
509
|
-
return
|
|
359
|
+
return existsSync(file);
|
|
510
360
|
} catch {
|
|
511
361
|
return false;
|
|
512
362
|
}
|
|
@@ -1499,13 +1349,172 @@ function registerE10AuthCommands(parent, action) {
|
|
|
1499
1349
|
return auth;
|
|
1500
1350
|
}
|
|
1501
1351
|
|
|
1352
|
+
// src/cmd/auth/index.ts
|
|
1353
|
+
var authCommand = {
|
|
1354
|
+
name: "auth",
|
|
1355
|
+
description: "E10 auth and profile management",
|
|
1356
|
+
category: "platform",
|
|
1357
|
+
register({ program, action }) {
|
|
1358
|
+
registerE10AuthCommands(program, action);
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
// src/cmd/commands/index.ts
|
|
1363
|
+
var commandsCommand = {
|
|
1364
|
+
name: "commands",
|
|
1365
|
+
description: "Registered command discovery",
|
|
1366
|
+
category: "system",
|
|
1367
|
+
register({ program, action }) {
|
|
1368
|
+
const commands = program.command("commands").alias("module").description("Inspect registered commands");
|
|
1369
|
+
commands.command("list").description("List registered commands").action(action((ctx) => {
|
|
1370
|
+
ctx.output.write({ commands: ctx.commands, modules: ctx.modules });
|
|
1371
|
+
}));
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
|
|
1375
|
+
// src/cmd/config/index.ts
|
|
1376
|
+
function parseValue(value) {
|
|
1377
|
+
if (value === "true") return true;
|
|
1378
|
+
if (value === "false") return false;
|
|
1379
|
+
if (value === "null") return null;
|
|
1380
|
+
if (/^-?\d+(\.\d+)?$/.test(value)) return Number(value);
|
|
1381
|
+
try {
|
|
1382
|
+
return JSON.parse(value);
|
|
1383
|
+
} catch {
|
|
1384
|
+
return value;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
var configCommand = {
|
|
1388
|
+
name: "config",
|
|
1389
|
+
description: "Generic local configuration commands",
|
|
1390
|
+
category: "system",
|
|
1391
|
+
register({ program, action }) {
|
|
1392
|
+
const config = program.command("config").description("Manage weaver-work-cli config");
|
|
1393
|
+
config.command("path").description("Print the active config file path").action(action((ctx) => {
|
|
1394
|
+
ctx.output.write({ path: ctx.config.path() }, { text: ctx.config.path() });
|
|
1395
|
+
}));
|
|
1396
|
+
config.command("list").description("Print all config values").action(action((ctx) => {
|
|
1397
|
+
ctx.output.write(ctx.config.all());
|
|
1398
|
+
}));
|
|
1399
|
+
config.command("get").description("Print one config value").argument("<key>", "config key").action(action((ctx, key) => {
|
|
1400
|
+
if (typeof key !== "string") throw new CliError("key must be a string", 2 /* UsageError */);
|
|
1401
|
+
ctx.output.write({ key, value: ctx.config.get(key) });
|
|
1402
|
+
}));
|
|
1403
|
+
config.command("set").description("Set one config value").argument("<key>", "config key").argument("<value>", "config value").action(action((ctx, key, value) => {
|
|
1404
|
+
if (typeof key !== "string" || typeof value !== "string") {
|
|
1405
|
+
throw new CliError("key and value must be strings", 2 /* UsageError */);
|
|
1406
|
+
}
|
|
1407
|
+
const parsed = parseValue(value);
|
|
1408
|
+
ctx.config.set(key, parsed);
|
|
1409
|
+
ctx.output.write({ key, value: parsed, path: ctx.config.path() }, { text: "Saved " + key });
|
|
1410
|
+
}));
|
|
1411
|
+
config.command("delete").description("Delete one config value").argument("<key>", "config key").action(action((ctx, key) => {
|
|
1412
|
+
if (typeof key !== "string") throw new CliError("key must be a string", 2 /* UsageError */);
|
|
1413
|
+
const deleted = ctx.config.delete(key);
|
|
1414
|
+
ctx.output.write({ key, deleted, path: ctx.config.path() }, { text: deleted ? "Deleted " + key : "No value for " + key });
|
|
1415
|
+
}));
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
// src/cmd/docs/index.ts
|
|
1420
|
+
import { cpSync, existsSync as existsSync2, readdirSync, readFileSync } from "node:fs";
|
|
1421
|
+
import { resolve } from "node:path";
|
|
1422
|
+
var DOCS_DIR = packagePath("docs");
|
|
1423
|
+
var PKG_JSON_URL = packageFileUrl("package.json");
|
|
1424
|
+
function packageVersion() {
|
|
1425
|
+
try {
|
|
1426
|
+
return JSON.parse(readFileSync(PKG_JSON_URL, "utf-8")).version;
|
|
1427
|
+
} catch {
|
|
1428
|
+
return "unknown";
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function countFiles(dir) {
|
|
1432
|
+
let count = 0;
|
|
1433
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
1434
|
+
const entryPath = resolve(dir, entry.name);
|
|
1435
|
+
count += entry.isDirectory() ? countFiles(entryPath) : 1;
|
|
1436
|
+
}
|
|
1437
|
+
return count;
|
|
1438
|
+
}
|
|
1439
|
+
function ensureDocs() {
|
|
1440
|
+
if (!existsSync2(DOCS_DIR)) {
|
|
1441
|
+
throw new CliError("docs directory does not exist: " + DOCS_DIR);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
var docsCommand = {
|
|
1445
|
+
name: "docs",
|
|
1446
|
+
description: "Packaged docs and template copy commands",
|
|
1447
|
+
category: "system",
|
|
1448
|
+
register({ program, action }) {
|
|
1449
|
+
const docs = program.command("docs").description("Read or copy packaged docs");
|
|
1450
|
+
docs.command("root").description("Print packaged docs root path").action(action((ctx) => {
|
|
1451
|
+
ensureDocs();
|
|
1452
|
+
const root = DOCS_DIR.replace(/[\\/]+$/, "");
|
|
1453
|
+
ctx.output.write({ root, version: packageVersion() }, { text: root + "\nversion: " + packageVersion() });
|
|
1454
|
+
}));
|
|
1455
|
+
docs.command("copy").description("Copy packaged docs to <target>/weaver-work-cli-docs").argument("[target]", "target directory", process.cwd()).action(action((ctx, target) => {
|
|
1456
|
+
ensureDocs();
|
|
1457
|
+
const dest = resolve(String(target || process.cwd()), "weaver-work-cli-docs");
|
|
1458
|
+
const sourceRoot = DOCS_DIR.replace(/[\\/]+$/, "");
|
|
1459
|
+
if (dest === sourceRoot || dest.startsWith(sourceRoot + "/") || dest.startsWith(sourceRoot + "\\")) {
|
|
1460
|
+
throw new CliError("target directory is inside docs source: " + dest);
|
|
1461
|
+
}
|
|
1462
|
+
cpSync(DOCS_DIR, dest, { recursive: true });
|
|
1463
|
+
const files = countFiles(dest);
|
|
1464
|
+
ctx.output.write({ files, dest, version: packageVersion() }, { text: "Copied " + files + " files to " + dest });
|
|
1465
|
+
}));
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
// src/cmd/doctor/index.ts
|
|
1470
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
1471
|
+
function versionMajor(version) {
|
|
1472
|
+
return Number(version.replace(/^v/, "").split(".")[0] || 0);
|
|
1473
|
+
}
|
|
1474
|
+
var doctorCommand = {
|
|
1475
|
+
name: "doctor",
|
|
1476
|
+
description: "Environment diagnostics",
|
|
1477
|
+
category: "system",
|
|
1478
|
+
register({ program, action }) {
|
|
1479
|
+
program.command("doctor").description("Check local CLI environment").option("--e10", "also check E10 auth file discovery").action(action((ctx, options) => {
|
|
1480
|
+
const opts = options && typeof options === "object" ? options : {};
|
|
1481
|
+
const checks = [
|
|
1482
|
+
{
|
|
1483
|
+
name: "node",
|
|
1484
|
+
ok: versionMajor(process.version) >= 18,
|
|
1485
|
+
detail: process.version
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
name: "package",
|
|
1489
|
+
ok: Boolean(ctx.packageInfo.version),
|
|
1490
|
+
detail: ctx.packageInfo.name + "@" + ctx.packageInfo.version
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
name: "configPath",
|
|
1494
|
+
ok: true,
|
|
1495
|
+
detail: ctx.config.path()
|
|
1496
|
+
}
|
|
1497
|
+
];
|
|
1498
|
+
if (opts.e10) {
|
|
1499
|
+
const authFile = findAuthFile(ctx.cwd);
|
|
1500
|
+
checks.push({
|
|
1501
|
+
name: "e10AuthFile",
|
|
1502
|
+
ok: Boolean(authFile && existsSync3(authFile)),
|
|
1503
|
+
detail: authFile || "not found"
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
const ok = checks.every((check) => check.ok);
|
|
1507
|
+
ctx.output.write({ ok, checks });
|
|
1508
|
+
}));
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1502
1512
|
// src/cmd/e10/index.ts
|
|
1503
1513
|
var e10Command = {
|
|
1504
1514
|
name: "e10",
|
|
1505
1515
|
description: "E10 platform adapter: auth, profiles, and shared API client",
|
|
1506
1516
|
category: "platform",
|
|
1507
1517
|
register({ program, ctx, action }) {
|
|
1508
|
-
registerE10AuthCommands(program, action);
|
|
1509
1518
|
const e10 = program.command("e10").description("E10 platform commands");
|
|
1510
1519
|
registerE10AuthCommands(e10, action);
|
|
1511
1520
|
ctx.hooks.register({
|
|
@@ -2457,6 +2466,7 @@ var builtinCommands = [
|
|
|
2457
2466
|
commandsCommand,
|
|
2458
2467
|
runCommand,
|
|
2459
2468
|
refsCommand,
|
|
2469
|
+
authCommand,
|
|
2460
2470
|
e10Command,
|
|
2461
2471
|
identityCommand,
|
|
2462
2472
|
setupCommand,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
E10_XIAOE_RECOVERY_FAILED_MESSAGE,
|
|
8
8
|
E10_XIAOE_TLS_UNTRUSTED_MESSAGE,
|
|
9
9
|
startFetchTiming
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IZCQU5D5.js";
|
|
11
11
|
import {
|
|
12
12
|
E10AuthSession,
|
|
13
13
|
currentE10TlsPolicyStatus,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
summarizeE10TlsPolicy,
|
|
25
25
|
summarizeXiaoEFailureKind,
|
|
26
26
|
tryXiaoEUnifiedLogin
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AMAPQVBT.js";
|
|
28
28
|
import {
|
|
29
29
|
CliError,
|
|
30
30
|
toErrorEnvelope
|
|
@@ -203,10 +203,9 @@ function sanitizeError(error, secrets) {
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
function sanitizeTlsPolicy(tls, secrets) {
|
|
206
|
-
const caFiles = tls.caFiles.map((file) => redactSensitiveText(file, secrets));
|
|
207
206
|
return {
|
|
208
207
|
mode: tls.mode,
|
|
209
|
-
caFiles,
|
|
208
|
+
caFiles: tls.caFiles.map((file) => redactSensitiveText(file, secrets)),
|
|
210
209
|
applied: tls.applied,
|
|
211
210
|
...tls.notAppliedReason ? { notAppliedReason: tls.notAppliedReason } : {},
|
|
212
211
|
...tls.error ? { error: redactSensitiveText(tls.error, secrets) } : {},
|
|
@@ -7,7 +7,7 @@ var E10_AUTH_REQUIRED_MESSAGE = `E10 \u767B\u5F55\u6001\u4E0D\u53EF\u7528\u3002$
|
|
|
7
7
|
var E10_XIAOE_RECOVERY_FAILED_MESSAGE = "E10 \u767B\u5F55\u6001\u4E0D\u53EF\u7528\u3002\u5DF2\u5C1D\u8BD5\u5C0F e \u81EA\u52A8\u91CD\u65B0\u83B7\u53D6\u767B\u5F55\u4FE1\u606F\uFF0C\u4F46\u672A\u53D6\u5F97\u53EF\u7528\u767B\u5F55\u6001\u3002\u8BF7\u5728\u5C0F e \u4E2D\u6062\u590D\u767B\u5F55\u540E\u91CD\u8BD5\u3002";
|
|
8
8
|
var E10_XIAOE_HOST_CREDENTIAL_MISSING_MESSAGE = "E10 \u767B\u5F55\u6001\u4E0D\u53EF\u7528\u3002\u5C0F e \u7F51\u9875\u7AEF\u672A\u5411\u5F53\u524D\u8FD0\u884C\u73AF\u5883\u6CE8\u5165\u7EDF\u4E00\u767B\u5F55\u51ED\u636E\uFF0C\u81EA\u52A8\u83B7\u53D6\u5DF2\u505C\u6B62\u3002\u8BF7\u68C0\u67E5\u7F51\u9875\u6280\u80FD\u6C99\u7BB1\u7684\u5BBF\u4E3B\u51ED\u636E\u900F\u4F20\u540E\u91CD\u8BD5\u3002";
|
|
9
9
|
var E10_XIAOE_NETWORK_UNAVAILABLE_MESSAGE = "\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5 E10\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5";
|
|
10
|
-
var E10_XIAOE_TLS_UNTRUSTED_MESSAGE = "E10 \u7F51\u5173\u8BC1\u4E66\u4E0D\u53D7\u4FE1\u4EFB\uFF08\u81EA\u7B7E\u540D\u6216\u79C1\u6709 CA \u7B7E\u53D1\u7684\u8BC1\u4E66\u94FE\uFF09\uFF0C\u81EA\u52A8\u83B7\u53D6\u767B\u5F55\u4FE1\u606F\u5DF2\u505C\u6B62\
|
|
10
|
+
var E10_XIAOE_TLS_UNTRUSTED_MESSAGE = "E10 \u7F51\u5173\u8BC1\u4E66\u4E0D\u53D7\u4FE1\u4EFB\uFF08\u81EA\u7B7E\u540D\u6216\u79C1\u6709 CA \u7B7E\u53D1\u7684\u8BC1\u4E66\u94FE\uFF09\uFF0C\u81EA\u52A8\u83B7\u53D6\u767B\u5F55\u4FE1\u606F\u5DF2\u505C\u6B62\u3002CLI \u9ED8\u8BA4\u6821\u9A8C\u8BC1\u4E66\uFF1A\u8BF7\u628A\u7F51\u5173 CA \u8BC1\u4E66\uFF08PEM\uFF09\u4EA4\u7ED9 CLI\u2014\u2014\u8BBE\u7F6E WEAVER_E10_CA_FILE=<CA PEM \u8DEF\u5F84> \u540E\u91CD\u8BD5\uFF1BNode \u4F4E\u4E8E 22.15 \u65F6\u8BE5\u53D8\u91CF\u65E0\u6CD5\u5728\u8FD0\u884C\u65F6\u751F\u6548\uFF0C\u8BF7\u6539\u7528 NODE_EXTRA_CA_CERTS=<CA PEM \u8DEF\u5F84> \u542F\u52A8 CLI\u3002\u4EC5\u5728\u6392\u67E5\u300C\u662F\u4E0D\u662F\u8BC1\u4E66\u95EE\u9898\u300D\u65F6\u53EF\u663E\u5F0F\u8BBE\u7F6E WEAVER_E10_TLS_INSECURE=1 \u4E34\u65F6\u8DF3\u8FC7\u6821\u9A8C\uFF08\u4F1A\u5173\u95ED\u672C\u8FDB\u7A0B\u5168\u90E8\u8BC1\u4E66\u6821\u9A8C\uFF0C\u6362\u7968\u8BF7\u6C42\u643A\u5E26\u7684\u5E73\u53F0\u7968\u636E\u53EF\u80FD\u88AB\u622A\u83B7\uFF0C\u786E\u8BA4\u540E\u7ACB\u523B\u53BB\u6389\uFF09\u3002";
|
|
11
11
|
var E10_SESSION_EXPIRED_MESSAGE = `E10 \u767B\u5F55\u6001\u5DF2\u5931\u6548\uFF0C\u672C\u6B21\u64CD\u4F5C\u5DF2\u505C\u6B62\u3002${E10_REAUTH_GUIDANCE}`;
|
|
12
12
|
|
|
13
13
|
// src/internal/e10/fetch-timing.ts
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
createE10RequestRuntime,
|
|
11
11
|
isE10SessionExpiredResponse,
|
|
12
12
|
requireE10Session
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IU6UB2TD.js";
|
|
14
14
|
import {
|
|
15
15
|
getActiveProfile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AMAPQVBT.js";
|
|
17
17
|
|
|
18
18
|
// src/shortcuts/ebuilder-form/host.ts
|
|
19
19
|
import { randomUUID } from "node:crypto";
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
createE10RequestRuntime,
|
|
15
15
|
isE10SessionExpiredResponse,
|
|
16
16
|
requireE10Session
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IU6UB2TD.js";
|
|
18
18
|
import {
|
|
19
19
|
E10_SESSION_EXPIRED_MESSAGE
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IZCQU5D5.js";
|
|
21
21
|
import {
|
|
22
22
|
getActiveProfile
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-AMAPQVBT.js";
|
|
24
24
|
|
|
25
25
|
// src/shortcuts/esb/host.ts
|
|
26
26
|
var ESB_PATHS = {
|