weaver-work-cli 0.1.70 → 0.1.71
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-5P33NAUN.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-7CN7JB6B.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-EJLP63UO.js} +1 -1
- package/dist/chunks/{chunk-HAORST2G.js → chunk-FRMDHZSN.js} +11 -11
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-G7ZM2VOX.js} +34 -34
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-ICNUOWLL.js} +4 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-LU2SPJYY.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-OFCF23FY.js} +6 -6
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-OPTJ6IF7.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-Q3EXRNB4.js} +1 -1
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-VJWVB55R.js} +2 -2
- package/dist/chunks/{chunk-EHH363SP.js → chunk-VMVMEIL3.js} +4 -4
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-X2C5CGGM.js} +52 -51
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-XLSJC6JZ.js} +6 -6
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-Y4PXZ2YQ.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-LOUOK46Z.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6N2IGCS4.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-QYLS3EB3.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-LPFPKZ4T.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-QP2WX4QJ.js} +3 -3
- package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
- package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
- package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
- package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-PTABJE7V.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-NIDHDBCB.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-G3QAT7DE.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-3MQ3AHDQ.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-3GQRYP2R.js} +12 -12
- package/dist/chunks/{registry-3B3OAJYX.js → registry-3S7AVMXR.js} +4 -4
- package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-IOKBJVYP.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-IB6EUARH.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-RINBAL2M.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 +38 -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/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/index.js +11 -2
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
- package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
- package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +11 -1
- 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/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/references/attend-write.md +1 -1
- 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-recruit-stage/SKILL.md +125 -20
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -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
|
@@ -177,6 +177,10 @@ function getKeyFilePath() {
|
|
|
177
177
|
}
|
|
178
178
|
function loadKeyringEntryConstructor() {
|
|
179
179
|
if (keyringEntryConstructor !== void 0) return keyringEntryConstructor;
|
|
180
|
+
if (process.env.WEAVER_WORK_CLI_KEYCHAIN?.toLowerCase() === "off") {
|
|
181
|
+
keyringEntryConstructor = null;
|
|
182
|
+
return keyringEntryConstructor;
|
|
183
|
+
}
|
|
180
184
|
try {
|
|
181
185
|
const module = require2("@napi-rs/keyring");
|
|
182
186
|
keyringEntryConstructor = typeof module.Entry === "function" ? module.Entry : null;
|
|
@@ -221,17 +225,17 @@ function readKeyFile(filePath) {
|
|
|
221
225
|
}
|
|
222
226
|
function getEncKey() {
|
|
223
227
|
if (encKey) return encKey;
|
|
224
|
-
const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
|
|
225
|
-
if (storedKey) {
|
|
226
|
-
encKey = storedKey;
|
|
227
|
-
return encKey;
|
|
228
|
-
}
|
|
229
228
|
const keyFile = getKeyFilePath();
|
|
230
229
|
const fileKey = readKeyFile(keyFile);
|
|
231
230
|
if (fileKey) {
|
|
232
231
|
encKey = fileKey;
|
|
233
232
|
return encKey;
|
|
234
233
|
}
|
|
234
|
+
const storedKey = readKeychainKey(KEYCHAIN_SERVICE);
|
|
235
|
+
if (storedKey) {
|
|
236
|
+
encKey = storedKey;
|
|
237
|
+
return encKey;
|
|
238
|
+
}
|
|
235
239
|
const fresh = randomBytes(32);
|
|
236
240
|
if (writeKeychainKey(KEYCHAIN_SERVICE, fresh)) {
|
|
237
241
|
encKey = fresh;
|
|
@@ -1041,14 +1045,59 @@ var E10AuthSession = class _E10AuthSession {
|
|
|
1041
1045
|
};
|
|
1042
1046
|
|
|
1043
1047
|
// src/internal/e10/tls-policy.ts
|
|
1044
|
-
import { existsSync as
|
|
1048
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
1045
1049
|
import { homedir as homedir2 } from "node:os";
|
|
1046
|
-
import { resolve as
|
|
1050
|
+
import { delimiter, resolve as resolve6 } from "node:path";
|
|
1047
1051
|
import * as tls from "node:tls";
|
|
1052
|
+
|
|
1053
|
+
// src/core/package-paths.ts
|
|
1054
|
+
import { existsSync as existsSync4, realpathSync } from "node:fs";
|
|
1055
|
+
import { dirname as dirname3, join, resolve as resolve5 } from "node:path";
|
|
1056
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1057
|
+
var cachedRoot;
|
|
1058
|
+
function entryDirectory(entry) {
|
|
1059
|
+
const absoluteEntry = resolve5(entry);
|
|
1060
|
+
try {
|
|
1061
|
+
return dirname3(realpathSync(absoluteEntry));
|
|
1062
|
+
} catch {
|
|
1063
|
+
return dirname3(absoluteEntry);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function packageRootDir() {
|
|
1067
|
+
if (cachedRoot) return cachedRoot;
|
|
1068
|
+
const seeds = [];
|
|
1069
|
+
const entry = process.argv[1];
|
|
1070
|
+
if (entry) seeds.push(entryDirectory(entry));
|
|
1071
|
+
seeds.push(dirname3(fileURLToPath(import.meta.url)));
|
|
1072
|
+
for (const seed of seeds) {
|
|
1073
|
+
let dir = seed;
|
|
1074
|
+
for (let depth = 0; depth < 10; depth += 1) {
|
|
1075
|
+
if (existsSync4(join(dir, "package.json"))) {
|
|
1076
|
+
cachedRoot = dir;
|
|
1077
|
+
return dir;
|
|
1078
|
+
}
|
|
1079
|
+
const parent = dirname3(dir);
|
|
1080
|
+
if (parent === dir) break;
|
|
1081
|
+
dir = parent;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
cachedRoot = process.cwd();
|
|
1085
|
+
return cachedRoot;
|
|
1086
|
+
}
|
|
1087
|
+
function packagePath(...segments) {
|
|
1088
|
+
return join(packageRootDir(), ...segments);
|
|
1089
|
+
}
|
|
1090
|
+
function packageFileUrl(...segments) {
|
|
1091
|
+
return pathToFileURL(packagePath(...segments));
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
// src/internal/e10/tls-policy.ts
|
|
1048
1095
|
var E10_TLS_CA_FILE_ENV = "WEAVER_E10_CA_FILE";
|
|
1049
1096
|
var E10_TLS_CA_FILE_ALIASES = ["WEAVER_XIAOE_CA_FILE"];
|
|
1050
1097
|
var E10_TLS_INSECURE_ENV = "WEAVER_E10_TLS_INSECURE";
|
|
1098
|
+
var E10_TLS_INSECURE_FALLBACK = "0";
|
|
1051
1099
|
var INSECURE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
1100
|
+
var SECURE_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
|
|
1052
1101
|
var PEM_MARKER = "BEGIN CERTIFICATE";
|
|
1053
1102
|
function readE10TlsCaFilePaths(env = process.env) {
|
|
1054
1103
|
const raw = [E10_TLS_CA_FILE_ENV, ...E10_TLS_CA_FILE_ALIASES].map((key) => env[key]).filter((value) => typeof value === "string" && value.trim().length > 0).join(",");
|
|
@@ -1056,19 +1105,29 @@ function readE10TlsCaFilePaths(env = process.env) {
|
|
|
1056
1105
|
for (const candidate of raw.split(/[,\n]/u)) {
|
|
1057
1106
|
const trimmed = candidate.trim();
|
|
1058
1107
|
if (!trimmed) continue;
|
|
1059
|
-
const absolute =
|
|
1108
|
+
const absolute = resolve6(expandHome(trimmed));
|
|
1060
1109
|
if (!paths.includes(absolute)) paths.push(absolute);
|
|
1061
1110
|
}
|
|
1062
1111
|
return paths;
|
|
1063
1112
|
}
|
|
1064
1113
|
function expandHome(value) {
|
|
1065
1114
|
if (value === "~") return homedir2();
|
|
1066
|
-
if (value.startsWith("~/")) return
|
|
1115
|
+
if (value.startsWith("~/")) return resolve6(homedir2(), value.slice(2));
|
|
1067
1116
|
return value;
|
|
1068
1117
|
}
|
|
1069
|
-
function
|
|
1118
|
+
function readE10TlsInsecureSetting(env = process.env) {
|
|
1070
1119
|
const raw = env[E10_TLS_INSECURE_ENV];
|
|
1071
|
-
|
|
1120
|
+
if (typeof raw !== "string" || !raw.trim()) return "default";
|
|
1121
|
+
const value = raw.trim().toLowerCase();
|
|
1122
|
+
if (INSECURE_VALUES.has(value)) return "on";
|
|
1123
|
+
if (SECURE_VALUES.has(value)) return "off";
|
|
1124
|
+
return "default";
|
|
1125
|
+
}
|
|
1126
|
+
function isE10TlsInsecureEnabled(env = process.env) {
|
|
1127
|
+
const setting = readE10TlsInsecureSetting(env);
|
|
1128
|
+
if (setting === "on") return true;
|
|
1129
|
+
if (setting === "off") return false;
|
|
1130
|
+
return INSECURE_VALUES.has(E10_TLS_INSECURE_FALLBACK.trim().toLowerCase());
|
|
1072
1131
|
}
|
|
1073
1132
|
function resolveE10TlsPolicy(env = process.env) {
|
|
1074
1133
|
const configuredFiles = readE10TlsCaFilePaths(env);
|
|
@@ -1084,7 +1143,7 @@ function resolveE10TlsPolicy(env = process.env) {
|
|
|
1084
1143
|
const problems = [];
|
|
1085
1144
|
for (const file of configuredFiles) {
|
|
1086
1145
|
try {
|
|
1087
|
-
if (!
|
|
1146
|
+
if (!existsSync5(file)) {
|
|
1088
1147
|
problems.push(`${file}: \u6587\u4EF6\u4E0D\u5B58\u5728`);
|
|
1089
1148
|
continue;
|
|
1090
1149
|
}
|
|
@@ -1125,6 +1184,7 @@ function applyInsecure(policy) {
|
|
|
1125
1184
|
}
|
|
1126
1185
|
function applyUncached(policy) {
|
|
1127
1186
|
if (policy.mode === "insecure") return applyInsecure(policy);
|
|
1187
|
+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === "0") delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;
|
|
1128
1188
|
if (policy.mode !== "custom-ca" || !policy.ca.length) {
|
|
1129
1189
|
return { ...policy, applied: false, notAppliedReason: "no-custom-ca" };
|
|
1130
1190
|
}
|
|
@@ -1202,60 +1262,29 @@ function summarizeE10TlsPolicy(status) {
|
|
|
1202
1262
|
if (status.mode === "insecure" && status.insecureSource) summary.insecureSource = status.insecureSource;
|
|
1203
1263
|
return summary;
|
|
1204
1264
|
}
|
|
1265
|
+
function e10TlsPythonSiteDir() {
|
|
1266
|
+
const dir = packagePath("scripts", "pysite");
|
|
1267
|
+
return existsSync5(dir) ? dir : "";
|
|
1268
|
+
}
|
|
1205
1269
|
function e10TlsChildEnv(env = process.env) {
|
|
1206
1270
|
const policy = resolveE10TlsPolicy(env);
|
|
1207
1271
|
if (policy.mode === "insecure") {
|
|
1208
|
-
|
|
1272
|
+
const next2 = { ...env, [E10_TLS_INSECURE_ENV]: "1" };
|
|
1273
|
+
const siteDir = e10TlsPythonSiteDir();
|
|
1274
|
+
if (siteDir) {
|
|
1275
|
+
const existing = typeof next2.PYTHONPATH === "string" && next2.PYTHONPATH.trim() ? next2.PYTHONPATH : "";
|
|
1276
|
+
next2.PYTHONPATH = existing ? `${siteDir}${delimiter}${existing}` : siteDir;
|
|
1277
|
+
}
|
|
1278
|
+
return next2;
|
|
1209
1279
|
}
|
|
1210
|
-
|
|
1280
|
+
const next = { ...env, [E10_TLS_INSECURE_ENV]: "0" };
|
|
1281
|
+
if (policy.mode !== "custom-ca" || !policy.caFiles.length) return next;
|
|
1211
1282
|
const bundle = policy.caFiles[0];
|
|
1212
|
-
const next = { ...env };
|
|
1213
1283
|
if (!next.SSL_CERT_FILE) next.SSL_CERT_FILE = bundle;
|
|
1214
1284
|
if (!next.REQUESTS_CA_BUNDLE) next.REQUESTS_CA_BUNDLE = bundle;
|
|
1215
1285
|
return next;
|
|
1216
1286
|
}
|
|
1217
1287
|
|
|
1218
|
-
// src/core/package-paths.ts
|
|
1219
|
-
import { existsSync as existsSync5, realpathSync } from "node:fs";
|
|
1220
|
-
import { dirname as dirname3, join, resolve as resolve6 } from "node:path";
|
|
1221
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
1222
|
-
var cachedRoot;
|
|
1223
|
-
function entryDirectory(entry) {
|
|
1224
|
-
const absoluteEntry = resolve6(entry);
|
|
1225
|
-
try {
|
|
1226
|
-
return dirname3(realpathSync(absoluteEntry));
|
|
1227
|
-
} catch {
|
|
1228
|
-
return dirname3(absoluteEntry);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
function packageRootDir() {
|
|
1232
|
-
if (cachedRoot) return cachedRoot;
|
|
1233
|
-
const seeds = [];
|
|
1234
|
-
const entry = process.argv[1];
|
|
1235
|
-
if (entry) seeds.push(entryDirectory(entry));
|
|
1236
|
-
seeds.push(dirname3(fileURLToPath(import.meta.url)));
|
|
1237
|
-
for (const seed of seeds) {
|
|
1238
|
-
let dir = seed;
|
|
1239
|
-
for (let depth = 0; depth < 10; depth += 1) {
|
|
1240
|
-
if (existsSync5(join(dir, "package.json"))) {
|
|
1241
|
-
cachedRoot = dir;
|
|
1242
|
-
return dir;
|
|
1243
|
-
}
|
|
1244
|
-
const parent = dirname3(dir);
|
|
1245
|
-
if (parent === dir) break;
|
|
1246
|
-
dir = parent;
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
cachedRoot = process.cwd();
|
|
1250
|
-
return cachedRoot;
|
|
1251
|
-
}
|
|
1252
|
-
function packagePath(...segments) {
|
|
1253
|
-
return join(packageRootDir(), ...segments);
|
|
1254
|
-
}
|
|
1255
|
-
function packageFileUrl(...segments) {
|
|
1256
|
-
return pathToFileURL(packagePath(...segments));
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
1288
|
// src/core/runtime-agent.ts
|
|
1260
1289
|
var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
|
|
1261
1290
|
"xiaoe",
|
|
@@ -1614,11 +1643,11 @@ function parseXiaoEUnifiedLoginMap(raw, source) {
|
|
|
1614
1643
|
} catch {
|
|
1615
1644
|
}
|
|
1616
1645
|
return value.split(/[;,\n]+/u).map((entry) => entry.trim()).filter(Boolean).map((entry) => {
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1619
|
-
const index = entry.indexOf(
|
|
1646
|
+
const delimiter2 = entry.includes("|") ? "|" : entry.includes("=") ? "=" : "";
|
|
1647
|
+
if (delimiter2) {
|
|
1648
|
+
const index = entry.indexOf(delimiter2);
|
|
1620
1649
|
const baseUrl = entry.slice(0, index).trim();
|
|
1621
|
-
const eteamsId = entry.slice(index +
|
|
1650
|
+
const eteamsId = entry.slice(index + delimiter2.length).trim();
|
|
1622
1651
|
return baseUrl && eteamsId ? { baseUrl: normalizeUrl(baseUrl), eteamsId, source } : null;
|
|
1623
1652
|
}
|
|
1624
1653
|
const parts = entry.split(/\s+/u).filter(Boolean);
|
|
@@ -2362,7 +2391,7 @@ async function saveXiaoEUnifiedLogin(input) {
|
|
|
2362
2391
|
}
|
|
2363
2392
|
async function tryXiaoEUnifiedLogin(options = {}) {
|
|
2364
2393
|
const env = options.env || process.env;
|
|
2365
|
-
const tlsPolicy = applyE10TlsPolicy(
|
|
2394
|
+
const tlsPolicy = applyE10TlsPolicy();
|
|
2366
2395
|
const explicitBaseUrl = normalizeUrl(options.baseUrl || "");
|
|
2367
2396
|
const baseUrl = resolveXiaoEPreferredBaseUrl({
|
|
2368
2397
|
explicitBaseUrl,
|
|
@@ -2500,14 +2529,15 @@ async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
2500
2529
|
}
|
|
2501
2530
|
|
|
2502
2531
|
export {
|
|
2503
|
-
packagePath,
|
|
2504
|
-
packageFileUrl,
|
|
2505
2532
|
isConnectorMode,
|
|
2506
2533
|
normalizeGlobalOptions,
|
|
2507
|
-
|
|
2534
|
+
packagePath,
|
|
2535
|
+
packageFileUrl,
|
|
2536
|
+
isXiaoERuntimeAgent,
|
|
2508
2537
|
readErrorCauseCode,
|
|
2509
2538
|
isTlsTrustErrorCode,
|
|
2510
2539
|
looksLikeTlsTrustMessage,
|
|
2540
|
+
writeWithRetry,
|
|
2511
2541
|
getE10AuthRoot,
|
|
2512
2542
|
resolveAgentHostKey,
|
|
2513
2543
|
lookupAgentHost,
|
|
@@ -2531,7 +2561,6 @@ export {
|
|
|
2531
2561
|
extractRawSetCookie,
|
|
2532
2562
|
extractSessionTicket,
|
|
2533
2563
|
E10AuthSession,
|
|
2534
|
-
isXiaoERuntimeAgent,
|
|
2535
2564
|
applyE10TlsPolicy,
|
|
2536
2565
|
currentE10TlsPolicyStatus,
|
|
2537
2566
|
summarizeE10TlsPolicy,
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-WMRNO6IU.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingStateDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q3EXRNB4.js";
|
|
9
9
|
import {
|
|
10
10
|
SCHEMA_ID,
|
|
11
11
|
meetingSuccess,
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
schemaOf
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EJLP63UO.js";
|
|
15
15
|
|
|
16
16
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
17
17
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
cacheScopeSuffix,
|
|
5
5
|
readCache,
|
|
6
6
|
writeCache
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OPTJ6IF7.js";
|
|
8
8
|
import {
|
|
9
9
|
EB_BASE,
|
|
10
10
|
SCHEMA_DATETIME_MINUTE,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
meetingSuccess,
|
|
14
14
|
queryBody,
|
|
15
15
|
schemaOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EJLP63UO.js";
|
|
17
17
|
|
|
18
18
|
// src/shortcuts/meeting/operations/eb/usage-cache.ts
|
|
19
19
|
var USAGE_TTL_MS = 5 * 60 * 1e3;
|
|
@@ -88,7 +88,7 @@ async function clearCache(env, key) {
|
|
|
88
88
|
try {
|
|
89
89
|
const { rm } = await import("node:fs/promises");
|
|
90
90
|
const { join } = await import("node:path");
|
|
91
|
-
const { meetingStateDir } = await import("./env-
|
|
91
|
+
const { meetingStateDir } = await import("./env-QYLS3EB3.js");
|
|
92
92
|
await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
|
|
93
93
|
} catch {
|
|
94
94
|
}
|
|
@@ -221,7 +221,7 @@ async function loadFrequentRooms(env, options = {}) {
|
|
|
221
221
|
const counts = /* @__PURE__ */ new Map();
|
|
222
222
|
let requests = 0;
|
|
223
223
|
try {
|
|
224
|
-
const { getMeetingOperation } = await import("./registry-
|
|
224
|
+
const { getMeetingOperation } = await import("./registry-3GQRYP2R.js");
|
|
225
225
|
const listOp = getMeetingOperation("meeting.eb.meeting.list");
|
|
226
226
|
let seen = 0;
|
|
227
227
|
let total = 0;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CliError
|
|
5
|
+
} from "./chunk-UG5G54VL.js";
|
|
6
|
+
|
|
7
|
+
// src/core/manifest-view.ts
|
|
8
|
+
var OPERATION_SUMMARY_MAX_CHARS = 40;
|
|
9
|
+
var MANIFEST_LIST_COMPACT_PATHS = ["operations", "withheldOperations"];
|
|
10
|
+
var MAX_SUGGESTIONS = 8;
|
|
11
|
+
function domainOf(manifest) {
|
|
12
|
+
if (typeof manifest.name === "string" && manifest.name !== "") return manifest.name;
|
|
13
|
+
if (typeof manifest.module === "string" && manifest.module !== "") return manifest.module;
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
function clip(text, max) {
|
|
17
|
+
const value = typeof text === "string" ? text : text === void 0 || text === null ? "" : String(text);
|
|
18
|
+
return value.length > max ? `${value.slice(0, max)}\u2026` : value;
|
|
19
|
+
}
|
|
20
|
+
function toListEntry(operation) {
|
|
21
|
+
const entry = { name: operation.name };
|
|
22
|
+
entry.summary = clip(operation.summary, OPERATION_SUMMARY_MAX_CHARS);
|
|
23
|
+
if (typeof operation.risk === "string") entry.risk = operation.risk;
|
|
24
|
+
if (operation.requiresConfirmation === true) entry.requiresConfirmation = true;
|
|
25
|
+
return entry;
|
|
26
|
+
}
|
|
27
|
+
function operationsOf(manifest) {
|
|
28
|
+
if (!Array.isArray(manifest.operations)) return [];
|
|
29
|
+
return manifest.operations.filter(
|
|
30
|
+
(item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function namesOf(manifest) {
|
|
34
|
+
return operationsOf(manifest).map((item) => String(item?.name ?? "")).filter((name) => name !== "");
|
|
35
|
+
}
|
|
36
|
+
function findOperation(manifest, wanted) {
|
|
37
|
+
const operations = operationsOf(manifest);
|
|
38
|
+
const domain = domainOf(manifest);
|
|
39
|
+
const exact = operations.find((item) => String(item?.name ?? "") === wanted);
|
|
40
|
+
if (exact) return exact;
|
|
41
|
+
if (domain) {
|
|
42
|
+
const prefixed = operations.find((item) => String(item?.name ?? "") === `${domain}.${wanted}`);
|
|
43
|
+
if (prefixed) return prefixed;
|
|
44
|
+
}
|
|
45
|
+
const suffixed = operations.filter((item) => String(item?.name ?? "").endsWith(`.${wanted}`));
|
|
46
|
+
return suffixed.length === 1 ? suffixed[0] : void 0;
|
|
47
|
+
}
|
|
48
|
+
function suggestionsOf(manifest, wanted) {
|
|
49
|
+
const needle = wanted.toLowerCase();
|
|
50
|
+
const all = namesOf(manifest);
|
|
51
|
+
const contains = all.filter((name) => name.toLowerCase().includes(needle));
|
|
52
|
+
const tail = all.filter((name) => {
|
|
53
|
+
const last = name.split(".").pop() ?? "";
|
|
54
|
+
return !contains.includes(name) && last.toLowerCase().includes(needle);
|
|
55
|
+
});
|
|
56
|
+
return [...contains, ...tail].slice(0, MAX_SUGGESTIONS);
|
|
57
|
+
}
|
|
58
|
+
function schemaHintOf(manifest) {
|
|
59
|
+
const domain = domainOf(manifest) || "<domain>";
|
|
60
|
+
return `\u672C\u6E05\u5355\u53EA\u542B name/summary/risk\u3002\u53D6\u5355\u4E2A\u64CD\u4F5C\u7684\u5B8C\u6574\u5165\u53C2\u5951\u7EA6\uFF08\u542B inputSchema\uFF09\uFF1Aweaver-work-cli ${domain} schema --operation <name>`;
|
|
61
|
+
}
|
|
62
|
+
function operationHintOf(manifest) {
|
|
63
|
+
const domain = domainOf(manifest) || "<domain>";
|
|
64
|
+
return `\u8981\u770B\u5168\u90E8\u64CD\u4F5C\u6E05\u5355\uFF1Aweaver-work-cli ${domain} schema --list`;
|
|
65
|
+
}
|
|
66
|
+
function schemaOptionsOf(value) {
|
|
67
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
68
|
+
const holder = value;
|
|
69
|
+
return {
|
|
70
|
+
list: holder.list === true,
|
|
71
|
+
full: holder.full === true,
|
|
72
|
+
operation: holder.operation === void 0 || holder.operation === null ? void 0 : String(holder.operation)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function manifestView(manifest, options = {}) {
|
|
76
|
+
const wanted = String(options.operation ?? "").trim();
|
|
77
|
+
if (wanted !== "") {
|
|
78
|
+
const hit = findOperation(manifest, wanted);
|
|
79
|
+
if (!hit) {
|
|
80
|
+
const suggestions = suggestionsOf(manifest, wanted);
|
|
81
|
+
const tail = suggestions.length > 0 ? `\u53EF\u7528\u64CD\u4F5C\uFF08\u8FD1\u4F3C\u5339\u914D\uFF09\uFF1A${suggestions.join(", ")}\u3002\u5148\u7528 --list \u770B\u5168\u91CF\u6E05\u5355\u3002` : "\u5148\u7528 --list \u770B\u5168\u91CF\u6E05\u5355\u3002";
|
|
82
|
+
throw new CliError(
|
|
83
|
+
`\u672A\u77E5\u64CD\u4F5C ${wanted}\uFF08\u57DF ${domainOf(manifest)} \u5171 ${operationsOf(manifest).length} \u4E2A\u64CD\u4F5C\uFF09\u3002${tail}`,
|
|
84
|
+
2 /* UsageError */
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
const domain2 = domainOf(manifest);
|
|
88
|
+
return {
|
|
89
|
+
schemaVersion: 1,
|
|
90
|
+
ok: true,
|
|
91
|
+
...domain2 ? { module: domain2 } : {},
|
|
92
|
+
...typeof manifest.title === "string" ? { title: manifest.title } : {},
|
|
93
|
+
...typeof manifest.sourceSkill === "string" ? { sourceSkill: manifest.sourceSkill } : {},
|
|
94
|
+
operation: hit,
|
|
95
|
+
operationHint: operationHintOf(manifest)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (options.full === true) return manifest;
|
|
99
|
+
if (options.list !== true) return manifest;
|
|
100
|
+
const operations = operationsOf(manifest);
|
|
101
|
+
const withheld = Array.isArray(manifest.withheldOperations) ? manifest.withheldOperations : [];
|
|
102
|
+
const domain = domainOf(manifest);
|
|
103
|
+
return {
|
|
104
|
+
schemaVersion: 1,
|
|
105
|
+
ok: true,
|
|
106
|
+
...domain !== "" ? { module: domain } : {},
|
|
107
|
+
...typeof manifest.title === "string" ? { title: manifest.title } : {},
|
|
108
|
+
...typeof manifest.version === "string" || typeof manifest.version === "number" ? { version: manifest.version } : {},
|
|
109
|
+
...typeof manifest.sourceSkill === "string" ? { sourceSkill: manifest.sourceSkill } : {},
|
|
110
|
+
...Array.isArray(manifest.capabilities) ? { capabilities: manifest.capabilities } : {},
|
|
111
|
+
// count 与 total 相等是常态;分成两个键是为了让模型一眼看出"这份清单没被截断"。
|
|
112
|
+
total: operations.length,
|
|
113
|
+
count: operations.length,
|
|
114
|
+
schemaHint: schemaHintOf(manifest),
|
|
115
|
+
operations: operations.map(toListEntry),
|
|
116
|
+
// 被禁用的操作必须也在清单里:模型看到 `mail.delete.batch` 存在于清单才不会再去找它。
|
|
117
|
+
//
|
|
118
|
+
// `withheldCount` 一起回:各域 SKILL.md 明确要模型"看 withheldCount 与 withheldOperations 条数
|
|
119
|
+
// 是否一致来判断有没有被截",漏掉这个键会让那段指引失效。`--list` 保证全量,所以这里
|
|
120
|
+
// 直接用数组长度,天然自洽(不取 manifest 里的预置值,避免两者口径不一致)。
|
|
121
|
+
// 值为 0 也要回(招聘域当前就是 0),否则模型找不到字段会以为输出残缺。
|
|
122
|
+
...manifest.withheldCount !== void 0 || withheld.length > 0 ? { withheldCount: withheld.length } : {},
|
|
123
|
+
...withheld.length > 0 ? {
|
|
124
|
+
withheldOperations: withheld.map((item) => {
|
|
125
|
+
const record = item ?? {};
|
|
126
|
+
return { name: record.name, reason: clip(record.reason, 80) };
|
|
127
|
+
})
|
|
128
|
+
} : {}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
MANIFEST_LIST_COMPACT_PATHS,
|
|
134
|
+
schemaOptionsOf,
|
|
135
|
+
manifestView
|
|
136
|
+
};
|