weaver-work-cli 0.1.33 → 0.1.36
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-FVFY6GZN.js → archive-XBVH7JU7.js} +2 -2
- package/dist/chunks/{archive-oa-NW3OD4UV.js → archive-oa-MZM3EKFQ.js} +2 -2
- package/dist/chunks/{asset-7QJKMIDV.js → asset-4XO7UOUW.js} +2 -2
- package/dist/chunks/{attachment-content-OSAVA6K3.js → attachment-content-VXSWANAC.js} +3 -3
- package/dist/chunks/{blog-I7SDPNW4.js → blog-PGZKOPSC.js} +2 -2
- package/dist/chunks/{caizhilian-O37ZIQNY.js → caizhilian-BH4ZVGUN.js} +2 -2
- package/dist/chunks/{calendar-7KXE4ED3.js → calendar-MXEMTIO4.js} +2 -2
- package/dist/chunks/{chunk-VBCFFFGT.js → chunk-5DQEEGCC.js} +4 -1
- package/dist/chunks/{chunk-KAS45KNR.js → chunk-6LLJFKJE.js} +1 -1
- package/dist/chunks/{chunk-HEL5XTYI.js → chunk-BPE37FPB.js} +26 -4
- package/dist/chunks/{chunk-IHUYP6LO.js → chunk-F746NKNF.js} +1 -1
- package/dist/chunks/{chunk-MQ2I5AA3.js → chunk-HXJQI5NM.js} +2 -2
- package/dist/chunks/{chunk-ILMBNVSG.js → chunk-I6QGIBDM.js} +2 -2
- package/dist/chunks/{chunk-EEWPQE3O.js → chunk-JCSN3JGM.js} +2 -2
- package/dist/chunks/{chunk-D223PTXU.js → chunk-JNG42JKG.js} +29 -1
- package/dist/chunks/{chunk-6ATGWRZM.js → chunk-JUXVYKII.js} +4 -1
- package/dist/chunks/{chunk-GFPXQIY2.js → chunk-JYKABYCV.js} +2 -2
- package/dist/chunks/{chunk-Q6LWB5HX.js → chunk-NCOVUAZK.js} +2 -2
- package/dist/chunks/{chunk-WY74UBJ6.js → chunk-QHFANTX7.js} +900 -204
- package/dist/chunks/{chunk-WRRJ4GG2.js → chunk-QYGO5EE2.js} +2 -2
- package/dist/chunks/{chunk-RBGOMK4Y.js → chunk-T72N74ZT.js} +2 -2
- package/dist/chunks/{chunk-MEEFGWTM.js → chunk-TC6MZAO3.js} +84 -9
- package/dist/chunks/{chunk-OCU4RLHC.js → chunk-VPUTVEMC.js} +98 -34
- package/dist/chunks/{chunk-PRHJGPMA.js → chunk-VPXOPQJI.js} +2 -2
- package/dist/chunks/{chunk-NHA62QD7.js → chunk-WXFPWCXG.js} +3 -3
- package/dist/chunks/{chunk-2FLWXFVS.js → chunk-XMGSYD6S.js} +4 -4
- package/dist/chunks/{conflict-SFNEVJY5.js → conflict-JAB2LJEZ.js} +2 -2
- package/dist/chunks/contract-XI2EEIZU.js +9110 -0
- package/dist/chunks/{cowork-CKWYHXYB.js → cowork-SCPGLBA4.js} +44 -25
- package/dist/chunks/{ebuilder-form-KOLJRVZD.js → ebuilder-form-EYLHNOTA.js} +3 -3
- package/dist/chunks/{ehr-WFOC3B4D.js → ehr-EAP77IMT.js} +172 -9
- package/dist/chunks/{esb-LJZTN663.js → esb-2TGGXEE7.js} +4 -4
- package/dist/chunks/{fna-F7QRIIZC.js → fna-2X7ZE7BU.js} +13 -8
- package/dist/chunks/{host-VQ6JJXGQ.js → host-C6EL2RKL.js} +3 -3
- package/dist/chunks/{host-BCGUVEWX.js → host-I4NRK4MX.js} +3 -3
- package/dist/chunks/{host-DGE2TZD4.js → host-Q4LZGCRU.js} +3 -3
- package/dist/chunks/{host-BQBRHVR3.js → host-UEI5FGDM.js} +3 -3
- package/dist/chunks/{host-KXPTEWFS.js → host-XCLDDXKQ.js} +3 -3
- package/dist/chunks/{hrm-NI6XAKW5.js → hrm-YXERJM76.js} +3 -3
- package/dist/chunks/{im-7TRTF3KT.js → im-A4VZN2TQ.js} +3 -3
- package/dist/chunks/{invoice-AOXWJKYT.js → invoice-2Z6YPMIS.js} +3 -3
- package/dist/chunks/{jiuchuanhui-7NQWEZAW.js → jiuchuanhui-AR5GMKZB.js} +2 -2
- package/dist/chunks/{lazy-dispatch-RNS4EE4S.js → lazy-dispatch-QXW7P4X3.js} +4 -4
- package/dist/chunks/{mail-VDHJAB4O.js → mail-7GZ6CPBJ.js} +44 -23
- package/dist/chunks/{meeting-GA7XCNNP.js → meeting-3NMGA3MB.js} +74 -10
- package/dist/chunks/{okr-TQIRERPQ.js → okr-BZ6XUOAG.js} +2 -2
- package/dist/chunks/{plan-4RY4LN2P.js → plan-DR5CMUYP.js} +2 -2
- package/dist/chunks/{project-D6XT2OC5.js → project-6J63MK33.js} +2 -2
- package/dist/chunks/{registry-JHRIDQ3A.js → registry-KDD7DHNK.js} +4 -4
- package/dist/chunks/{registry-VOGKFFTR.js → registry-TKX2E7C7.js} +2 -2
- package/dist/chunks/{registry-QKMI43Q6.js → registry-VRTNC6UR.js} +8 -8
- package/dist/chunks/{room-recommend-D4EUOOWY.js → room-recommend-XCWRMB5P.js} +4 -4
- package/dist/chunks/{schedule-XPFBHPCV.js → schedule-IVBICP32.js} +4 -4
- package/dist/chunks/{workflow-HLBZRWIY.js → workflow-D74NFK3C.js} +11 -4
- package/dist/index.js +31 -26
- package/dist/internal/e10/fetch-timing.js +31 -0
- package/dist/internal/e10/request-runtime.js +5 -0
- package/dist/shortcuts/cowork/host.js +8 -0
- package/dist/shortcuts/cowork/operations/types.js +17 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +35 -0
- package/dist/shortcuts/ehr/operations/recruit.js +147 -0
- package/dist/shortcuts/fna/operations/expense-chart.js +19 -7
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/mail/host.js +8 -0
- package/dist/shortcuts/mail/operations/types.js +17 -2
- package/dist/shortcuts/meeting/index.js +79 -1
- package/dist/shortcuts/meeting/manifest.js +10 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -0
- package/dist/shortcuts/meeting/operations/eb/conflict.js +6 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +1047 -134
- package/dist/shortcuts/meeting/operations/eb/factory.js +101 -7
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +36 -2
- package/dist/shortcuts/meeting/operations/eb-fallback.js +4 -0
- package/dist/shortcuts/meeting/operations/env.js +6 -0
- package/dist/shortcuts/meeting/operations/invitation.js +79 -20
- package/dist/shortcuts/workflow/endpoints.js +8 -3
- package/dist/shortcuts/workflow/operations/form.js +181 -34
- package/dist/shortcuts/workflow/operations.js +23 -1
- package/docs/ehr.md +1 -1
- package/docs/fna.md +2 -1
- package/package.json +1 -1
- package/skill-template/business-info.json +18 -0
- package/skill-template/domains/cowork.md +14 -0
- package/skills/weaver-e10-cowork/SKILL.md +101 -0
- package/skills/weaver-e10-cowork/references/cowork-read.md +90 -0
- package/skills/weaver-e10-cowork/references/cowork-write.md +131 -0
- package/skills/weaver-e10-cowork/references/safety-boundaries.md +45 -0
- package/skills/weaver-e10-jucailin/SKILL.md +21 -3
- package/skills/weaver-e10-jucailin/references/recruit-read.md +25 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +13 -0
- package/skills/weaver-e10-jucailin/references/salary.md +15 -11
- package/skills/weaver-e10-mail/SKILL.md +12 -9
- package/skills/weaver-e10-meeting/SKILL.md +284 -34
- package/skills/weaver-e10-meeting/references/meeting-eb.md +131 -0
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +28 -2
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +5 -2
- package/skills/weaver-e10-qiyecheng/references/catalog.md +2 -2
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +15 -1
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +22 -21
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JUXVYKII.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JUXVYKII.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -3,11 +3,11 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createE10RequestRuntime,
|
|
5
5
|
requireE10Session
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JUXVYKII.js";
|
|
7
7
|
import {
|
|
8
8
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
9
9
|
getActiveProfile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JNG42JKG.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError,
|
|
13
13
|
isCliError,
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
looksLikeFileId,
|
|
9
9
|
meetingAttachmentContentOperations,
|
|
10
10
|
parseFileIdList
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-HXJQI5NM.js";
|
|
12
|
+
import "./chunk-5DQEEGCC.js";
|
|
13
|
+
import "./chunk-TC6MZAO3.js";
|
|
14
14
|
import "./chunk-LUSPKZKY.js";
|
|
15
15
|
import "./chunk-BUSC6UAE.js";
|
|
16
16
|
export {
|
|
@@ -3,11 +3,11 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createE10RequestRuntime,
|
|
5
5
|
requireE10Session
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JUXVYKII.js";
|
|
7
7
|
import {
|
|
8
8
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
9
9
|
getActiveProfile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JNG42JKG.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError,
|
|
13
13
|
isCliError,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JUXVYKII.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JUXVYKII.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ebBusinessSuccess,
|
|
6
6
|
meetingSuccess,
|
|
7
7
|
meetingValidationError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TC6MZAO3.js";
|
|
9
9
|
|
|
10
10
|
// src/shortcuts/meeting/operations/env.ts
|
|
11
11
|
import { existsSync } from "node:fs";
|
|
@@ -109,6 +109,9 @@ async function probeAndPersist(host, ctx, knownEbError, options = {}) {
|
|
|
109
109
|
}
|
|
110
110
|
async function resolveMeetingEnvMode(host, ctx, options = {}) {
|
|
111
111
|
const session = await host.getSession();
|
|
112
|
+
if (options.refresh !== true && String(process.env.WEAVER_MEETING_LOCK_MODE ?? "").trim().toLowerCase() === "eb") {
|
|
113
|
+
return { mode: "eb", smokePath: EB_SMOKE_PATH, fromCache: false, assumed: true, locked: true };
|
|
114
|
+
}
|
|
112
115
|
if (options.refresh === true) {
|
|
113
116
|
return { ...await probeAndPersist(host, ctx), fromCache: false };
|
|
114
117
|
}
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
isEsbFlowUnavailable
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-I6QGIBDM.js";
|
|
6
6
|
import {
|
|
7
7
|
esbValidationError
|
|
8
8
|
} from "./chunk-GPMFD4RD.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
cacheScopeSuffix,
|
|
5
5
|
readCache,
|
|
6
6
|
writeCache
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F746NKNF.js";
|
|
8
8
|
import {
|
|
9
9
|
EB_BASE,
|
|
10
10
|
SCHEMA_DATETIME_MINUTE,
|
|
@@ -13,10 +13,11 @@ import {
|
|
|
13
13
|
meetingSuccess,
|
|
14
14
|
queryBody,
|
|
15
15
|
schemaOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TC6MZAO3.js";
|
|
17
17
|
|
|
18
18
|
// src/shortcuts/meeting/operations/eb/room-recommend.ts
|
|
19
19
|
var ROOMS_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
20
|
+
var STALE_NOTICE_MS = 4 * 60 * 60 * 1e3;
|
|
20
21
|
var FREQUENT_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
21
22
|
var FREQUENT_WINDOW_DAYS = 180;
|
|
22
23
|
var PAGE_SIZE = 100;
|
|
@@ -120,7 +121,7 @@ async function loadFrequentRooms(env, options = {}) {
|
|
|
120
121
|
const counts = /* @__PURE__ */ new Map();
|
|
121
122
|
let requests = 0;
|
|
122
123
|
try {
|
|
123
|
-
const { getMeetingOperation } = await import("./registry-
|
|
124
|
+
const { getMeetingOperation } = await import("./registry-VRTNC6UR.js");
|
|
124
125
|
const listOp = getMeetingOperation("meeting.eb.meeting.list");
|
|
125
126
|
for (let pageNo = 1; pageNo <= 5; pageNo += 1) {
|
|
126
127
|
const page = await listOp.handler(
|
|
@@ -174,6 +175,11 @@ async function recommendRooms(env, input) {
|
|
|
174
175
|
const topN = Math.max(1, Math.min(10, input.topN ?? 3));
|
|
175
176
|
const roomData = await loadRooms(env, { refresh: input.refreshRooms === true });
|
|
176
177
|
warnings.push(...roomData.warnings);
|
|
178
|
+
if (roomData.fromCache && (roomData.ageSeconds ?? 0) * 1e3 > STALE_NOTICE_MS) {
|
|
179
|
+
warnings.push(
|
|
180
|
+
`\u4F1A\u8BAE\u5BA4\u53F0\u8D26\u6765\u81EA ${Math.round((roomData.ageSeconds ?? 0) / 3600)} \u5C0F\u65F6\u524D\u7684\u7F13\u5B58\uFF08\u5171 ${roomData.rooms.length} \u95F4\uFF09\u3002\u5982\u679C\u6700\u8FD1\u65B0\u5EFA/\u5BFC\u5165/\u5C01\u5B58\u8FC7\u4F1A\u8BAE\u5BA4\uFF0C\u8BF7\u5E26 \`refresh: true\` \u91CD\u65B0\u67E5\u8BE2\uFF0C\u5426\u5219\u770B\u5230\u7684\u662F\u65E7\u6E05\u5355\u3002`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
177
183
|
const frequent = await loadFrequentRooms(env, { refresh: input.refreshFrequent === true });
|
|
178
184
|
warnings.push(...frequent.warnings);
|
|
179
185
|
const busy = await fetchBusyRoomIds(env, input.beginDatetime, input.endDatetime);
|
|
@@ -192,9 +198,10 @@ async function recommendRooms(env, input) {
|
|
|
192
198
|
busyCount += 1;
|
|
193
199
|
if (!input.includeBusy) continue;
|
|
194
200
|
}
|
|
201
|
+
let belowMinCapacity = false;
|
|
195
202
|
if (memberCount !== null) {
|
|
196
203
|
if (room.maxNum > 0 && room.maxNum < memberCount) continue;
|
|
197
|
-
if (room.minNum > 0 && room.minNum > memberCount)
|
|
204
|
+
if (room.minNum > 0 && room.minNum > memberCount) belowMinCapacity = true;
|
|
198
205
|
}
|
|
199
206
|
if (requirement.roomAttr && room.roomAttr !== requirement.roomAttr) continue;
|
|
200
207
|
if (requirement.mrType && room.mrType !== requirement.mrType) continue;
|
|
@@ -216,6 +223,10 @@ async function recommendRooms(env, input) {
|
|
|
216
223
|
reasons.push(`\u5BB9\u91CF ${room.maxNum} \u4EBA`);
|
|
217
224
|
score += 5;
|
|
218
225
|
}
|
|
226
|
+
if (belowMinCapacity) {
|
|
227
|
+
reasons.push(`\u8BE5\u623F\u95F4\u5EFA\u8BAE\u81F3\u5C11 ${room.minNum} \u4EBA\u4F7F\u7528\uFF08\u672C\u6B21 ${memberCount} \u4EBA\uFF0C\u672A\u8FBE\u5EFA\u8BAE\u4E0B\u9650\uFF0C\u5982\u53EF\u7528\u8BF7\u81EA\u884C\u786E\u8BA4\uFF09`);
|
|
228
|
+
score -= 15;
|
|
229
|
+
}
|
|
219
230
|
if (requirement.placeKeyword) {
|
|
220
231
|
reasons.push(`\u5730\u70B9\u5339\u914D\u300C${requirement.placeKeyword}\u300D`);
|
|
221
232
|
score += 10;
|
|
@@ -249,6 +260,17 @@ async function recommendRooms(env, input) {
|
|
|
249
260
|
if (leftCap !== rightCap) return leftCap - rightCap;
|
|
250
261
|
return left.name.localeCompare(right.name, "zh-Hans-CN");
|
|
251
262
|
});
|
|
263
|
+
if (candidates.length === 0 && roomData.fromCache && input.refreshRooms !== true) {
|
|
264
|
+
const retried = await recommendRooms(env, { ...input, refreshRooms: true, refreshFrequent: true });
|
|
265
|
+
return {
|
|
266
|
+
...retried,
|
|
267
|
+
meta: { ...retried.meta, cacheRetried: true },
|
|
268
|
+
warnings: [
|
|
269
|
+
`\u7F13\u5B58\u91CC\u7684\u4F1A\u8BAE\u5BA4\u51D1\u4E0D\u51FA\u5019\u9009\uFF08\u7F13\u5B58 ${Math.round((roomData.ageSeconds ?? 0) / 60)} \u5206\u949F\u524D\uFF0C${roomData.rooms.length} \u95F4\uFF09\u2192 \u5DF2\u5F3A\u5236\u91CD\u65B0\u62C9\u53D6\u53F0\u8D26\u540E\u91CD\u7B97`,
|
|
270
|
+
...retried.warnings
|
|
271
|
+
]
|
|
272
|
+
};
|
|
273
|
+
}
|
|
252
274
|
if (candidates.length === 0) {
|
|
253
275
|
if (roomData.rooms.length === 0) {
|
|
254
276
|
warnings.push(
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
meetingStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5DQEEGCC.js";
|
|
6
6
|
|
|
7
7
|
// src/shortcuts/meeting/operations/eb/cache.ts
|
|
8
8
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -2,13 +2,13 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
meetingStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5DQEEGCC.js";
|
|
6
6
|
import {
|
|
7
7
|
SCHEMA_ID,
|
|
8
8
|
meetingSuccess,
|
|
9
9
|
meetingValidationError,
|
|
10
10
|
schemaOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TC6MZAO3.js";
|
|
12
12
|
|
|
13
13
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
14
14
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
E10ApiError,
|
|
14
14
|
createE10RequestRuntime,
|
|
15
15
|
requireE10Session
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JUXVYKII.js";
|
|
17
17
|
import {
|
|
18
18
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
19
19
|
getActiveProfile
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JNG42JKG.js";
|
|
21
21
|
|
|
22
22
|
// src/shortcuts/esb/host.ts
|
|
23
23
|
var ESB_PATHS = {
|
|
@@ -3,12 +3,12 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createE10RequestRuntime,
|
|
5
5
|
requireE10Session
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JUXVYKII.js";
|
|
7
7
|
import {
|
|
8
8
|
E10_REAUTH_GUIDANCE,
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError
|
|
14
14
|
} from "./chunk-LUSPKZKY.js";
|
|
@@ -1581,6 +1581,31 @@ async function tryXiaoEUnifiedLogin(options = {}) {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
1583
|
|
|
1584
|
+
// src/internal/e10/fetch-timing.ts
|
|
1585
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1586
|
+
var storage = new AsyncLocalStorage();
|
|
1587
|
+
function createFetchTimingSink() {
|
|
1588
|
+
return { fetchMs: 0, fetchCount: 0, fetchStart: null, fetchEnd: null };
|
|
1589
|
+
}
|
|
1590
|
+
function runWithFetchTiming(sink, fn) {
|
|
1591
|
+
return storage.run(sink, fn);
|
|
1592
|
+
}
|
|
1593
|
+
function startFetchTiming() {
|
|
1594
|
+
const sink = storage.getStore();
|
|
1595
|
+
if (!sink) return null;
|
|
1596
|
+
const startedAt = Date.now();
|
|
1597
|
+
let finished = false;
|
|
1598
|
+
return () => {
|
|
1599
|
+
if (finished) return;
|
|
1600
|
+
finished = true;
|
|
1601
|
+
const endedAt = Date.now();
|
|
1602
|
+
sink.fetchMs += Math.max(0, endedAt - startedAt);
|
|
1603
|
+
sink.fetchCount += 1;
|
|
1604
|
+
sink.fetchStart = sink.fetchStart === null ? startedAt : Math.min(sink.fetchStart, startedAt);
|
|
1605
|
+
sink.fetchEnd = sink.fetchEnd === null ? endedAt : Math.max(sink.fetchEnd, endedAt);
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1584
1609
|
export {
|
|
1585
1610
|
packagePath,
|
|
1586
1611
|
packageFileUrl,
|
|
@@ -1612,5 +1637,8 @@ export {
|
|
|
1612
1637
|
inspectXiaoEUnifiedLoginSources,
|
|
1613
1638
|
resolveXiaoEPreferredBaseUrl,
|
|
1614
1639
|
createXiaoEUnifiedLoginUnavailableError,
|
|
1615
|
-
tryXiaoEUnifiedLogin
|
|
1640
|
+
tryXiaoEUnifiedLogin,
|
|
1641
|
+
createFetchTimingSink,
|
|
1642
|
+
runWithFetchTiming,
|
|
1643
|
+
startFetchTiming
|
|
1616
1644
|
};
|
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
getActiveProfile,
|
|
7
7
|
hasXiaoEEnv,
|
|
8
8
|
isXiaoERuntimeAgent,
|
|
9
|
+
startFetchTiming,
|
|
9
10
|
tryXiaoEUnifiedLogin
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNG42JKG.js";
|
|
11
12
|
import {
|
|
12
13
|
CliError
|
|
13
14
|
} from "./chunk-LUSPKZKY.js";
|
|
@@ -352,6 +353,7 @@ var E10RequestRuntime = class {
|
|
|
352
353
|
async fetchWithTimeout(url, init, timeoutMs) {
|
|
353
354
|
const controller = new AbortController();
|
|
354
355
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
356
|
+
const stopFetchTiming = startFetchTiming();
|
|
355
357
|
try {
|
|
356
358
|
return await this.fetchFn(url, { ...init, signal: controller.signal });
|
|
357
359
|
} catch (error) {
|
|
@@ -368,6 +370,7 @@ var E10RequestRuntime = class {
|
|
|
368
370
|
});
|
|
369
371
|
} finally {
|
|
370
372
|
clearTimeout(timer);
|
|
373
|
+
stopFetchTiming?.();
|
|
371
374
|
}
|
|
372
375
|
}
|
|
373
376
|
async readResponse(response, responseType, bigIntStrings = DEFAULT_BIG_INT_STRINGS, maxResponseBytes, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-AJ62BGAW.js";
|
|
20
20
|
import {
|
|
21
21
|
clearInvoiceTokenForSession
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JCSN3JGM.js";
|
|
23
23
|
import {
|
|
24
24
|
E10AuthSession,
|
|
25
25
|
XIAOE_AGENT_TYPE,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
setActiveProfile,
|
|
49
49
|
switchActiveProfile,
|
|
50
50
|
tryXiaoEUnifiedLogin
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-JNG42JKG.js";
|
|
52
52
|
import {
|
|
53
53
|
CliError,
|
|
54
54
|
isCliError,
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
E10ApiError,
|
|
11
11
|
createE10RequestRuntime,
|
|
12
12
|
requireE10Session
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JUXVYKII.js";
|
|
14
14
|
import {
|
|
15
15
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
16
16
|
getActiveProfile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JNG42JKG.js";
|
|
18
18
|
|
|
19
19
|
// src/shortcuts/hrm/host.ts
|
|
20
20
|
function inferProfile(ctx) {
|