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,
|
|
@@ -128,6 +128,42 @@ function createMailContinuationSigner(ctx) {
|
|
|
128
128
|
|
|
129
129
|
// src/shortcuts/mail/host.ts
|
|
130
130
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
131
|
+
|
|
132
|
+
// src/shortcuts/mail/operations/types.ts
|
|
133
|
+
var READ = "read";
|
|
134
|
+
var WRITE = "write";
|
|
135
|
+
var mailPerf = {
|
|
136
|
+
t0: Date.now(),
|
|
137
|
+
sessionMs: 0,
|
|
138
|
+
requestCount: 0,
|
|
139
|
+
requestMs: 0
|
|
140
|
+
};
|
|
141
|
+
function mailSuccess(action, data, meta) {
|
|
142
|
+
const payload = { ok: true, action, data };
|
|
143
|
+
const perf = {
|
|
144
|
+
elapsed_ms: Date.now() - mailPerf.t0,
|
|
145
|
+
session_ms: mailPerf.sessionMs || void 0,
|
|
146
|
+
requests: mailPerf.requestCount || void 0,
|
|
147
|
+
network_ms: mailPerf.requestMs || void 0
|
|
148
|
+
};
|
|
149
|
+
for (const k of Object.keys(perf)) if (perf[k] === void 0) delete perf[k];
|
|
150
|
+
payload.meta = { ...meta || {}, ...perf };
|
|
151
|
+
return payload;
|
|
152
|
+
}
|
|
153
|
+
function schemaOf(properties, options = {}) {
|
|
154
|
+
return {
|
|
155
|
+
type: "object",
|
|
156
|
+
additionalProperties: false,
|
|
157
|
+
properties,
|
|
158
|
+
...options.required?.length ? { required: options.required } : {},
|
|
159
|
+
...options.description ? { description: options.description } : {}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
var SCHEMA_STRING = { type: "string" };
|
|
163
|
+
var SCHEMA_INTEGER = { type: "integer" };
|
|
164
|
+
var SCHEMA_BOOLEAN = { type: "boolean" };
|
|
165
|
+
|
|
166
|
+
// src/shortcuts/mail/host.ts
|
|
131
167
|
function inferProfile(ctx) {
|
|
132
168
|
const options = ctx.getGlobalOptions();
|
|
133
169
|
return options.profile || getActiveProfile();
|
|
@@ -195,7 +231,9 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
195
231
|
const requireSession = dependencies.requireSession || ((innerCtx) => requireE10Session(innerCtx, { skipProfileEnrichment: true }));
|
|
196
232
|
async function ensureSession() {
|
|
197
233
|
if (!e10Session) {
|
|
234
|
+
const sessionStart = Date.now();
|
|
198
235
|
e10Session = await requireSession(ctx);
|
|
236
|
+
mailPerf.sessionMs = Date.now() - sessionStart;
|
|
199
237
|
sessionContext = {
|
|
200
238
|
baseUrl: e10Session.getBaseUrl(),
|
|
201
239
|
profile: inferProfile(ctx),
|
|
@@ -231,6 +269,7 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
231
269
|
assertPath(path);
|
|
232
270
|
const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 ? "GET" : "POST");
|
|
233
271
|
let response;
|
|
272
|
+
const reqStart = Date.now();
|
|
234
273
|
try {
|
|
235
274
|
response = await (await runtime()).requestJson({
|
|
236
275
|
module: "mail",
|
|
@@ -253,6 +292,9 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
253
292
|
});
|
|
254
293
|
}
|
|
255
294
|
throw error;
|
|
295
|
+
} finally {
|
|
296
|
+
mailPerf.requestCount += 1;
|
|
297
|
+
mailPerf.requestMs += Date.now() - reqStart;
|
|
256
298
|
}
|
|
257
299
|
if (response.status === 401 || response.status === 302) {
|
|
258
300
|
throw mailAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
@@ -287,27 +329,6 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
287
329
|
return { request, getSession };
|
|
288
330
|
}
|
|
289
331
|
|
|
290
|
-
// src/shortcuts/mail/operations/types.ts
|
|
291
|
-
var READ = "read";
|
|
292
|
-
var WRITE = "write";
|
|
293
|
-
function mailSuccess(action, data, meta) {
|
|
294
|
-
const payload = { ok: true, action, data };
|
|
295
|
-
if (meta && Object.keys(meta).length > 0) payload.meta = meta;
|
|
296
|
-
return payload;
|
|
297
|
-
}
|
|
298
|
-
function schemaOf(properties, options = {}) {
|
|
299
|
-
return {
|
|
300
|
-
type: "object",
|
|
301
|
-
additionalProperties: false,
|
|
302
|
-
properties,
|
|
303
|
-
...options.required?.length ? { required: options.required } : {},
|
|
304
|
-
...options.description ? { description: options.description } : {}
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
var SCHEMA_STRING = { type: "string" };
|
|
308
|
-
var SCHEMA_INTEGER = { type: "integer" };
|
|
309
|
-
var SCHEMA_BOOLEAN = { type: "boolean" };
|
|
310
|
-
|
|
311
332
|
// src/shortcuts/mail/operations/mail-read.ts
|
|
312
333
|
var FOLDER_TEXT = {
|
|
313
334
|
"-10": "\u5168\u90E8",
|
|
@@ -3,17 +3,17 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
meetingOperationDefinitions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QHFANTX7.js";
|
|
7
|
+
import "./chunk-BPE37FPB.js";
|
|
8
|
+
import "./chunk-XMGSYD6S.js";
|
|
9
|
+
import "./chunk-F746NKNF.js";
|
|
10
|
+
import "./chunk-WXFPWCXG.js";
|
|
11
|
+
import "./chunk-HXJQI5NM.js";
|
|
12
12
|
import {
|
|
13
13
|
degradeMeetingEnvToStandard,
|
|
14
14
|
meetingStateDir,
|
|
15
15
|
readCache
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5DQEEGCC.js";
|
|
17
17
|
import {
|
|
18
18
|
MeetingCliError,
|
|
19
19
|
asObject,
|
|
@@ -21,16 +21,16 @@ import {
|
|
|
21
21
|
meetingAuthError,
|
|
22
22
|
meetingNetworkError,
|
|
23
23
|
meetingValidationError
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-TC6MZAO3.js";
|
|
25
25
|
import {
|
|
26
26
|
E10ApiError,
|
|
27
27
|
createE10RequestRuntime,
|
|
28
28
|
requireE10Session
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JUXVYKII.js";
|
|
30
30
|
import {
|
|
31
31
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
32
32
|
getActiveProfile
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-JNG42JKG.js";
|
|
34
34
|
import {
|
|
35
35
|
isCliError,
|
|
36
36
|
toErrorEnvelope
|
|
@@ -336,8 +336,10 @@ function buildOperations() {
|
|
|
336
336
|
inputSchema: definition.inputSchema
|
|
337
337
|
}));
|
|
338
338
|
}
|
|
339
|
+
var OPERATION_INDEX_HINT = "\u672C JSON \u53EF\u80FD\u88AB\u538B\u7F29\u622A\u65AD\uFF0C\u522B\u636E\u6B64\u5224\u65AD\u80FD\u529B\u662F\u5426\u5B58\u5728\uFF1B\u5B8C\u6574\u6E05\u5355\u8DD1 `weaver-work-cli meeting ops`\uFF08\u7EAF\u6587\u672C\u3001\u4E0D\u538B\u7F29\uFF0C\u652F\u6301 --grep \u5173\u952E\u8BCD\uFF09";
|
|
339
340
|
var meetingManifest = {
|
|
340
341
|
schemaVersion: 1,
|
|
342
|
+
operationIndexHint: OPERATION_INDEX_HINT,
|
|
341
343
|
name: "meeting",
|
|
342
344
|
title: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406\uFF08\u53CC\u6A21\u5F0F\uFF1A\u6807\u51C6\u7248 Java REST + EB \u7248 eBuilder\uFF09",
|
|
343
345
|
version: "1.0.0",
|
|
@@ -433,6 +435,7 @@ function peerHint(operation) {
|
|
|
433
435
|
async function tryDegradeEbFailure(operation, error, host, ctx) {
|
|
434
436
|
if (!operation.startsWith("meeting.eb.")) return null;
|
|
435
437
|
if (process.env.WEAVER_MEETING_ENV_AUTOFALLBACK === "0") return null;
|
|
438
|
+
if (String(process.env.WEAVER_MEETING_LOCK_MODE ?? "").trim().toLowerCase() === "eb") return null;
|
|
436
439
|
const type = String(error?.type ?? "");
|
|
437
440
|
const subtype = String(error?.subtype ?? "");
|
|
438
441
|
if (NO_FALLBACK_TYPES.has(type) || NO_FALLBACK_SUBTYPES.has(subtype)) return null;
|
|
@@ -657,6 +660,67 @@ var meetingShortcut = {
|
|
|
657
660
|
meeting.command("schema").description("Print meeting operation manifest for agents").action(action((ctx) => {
|
|
658
661
|
ctx.output.write(meetingManifest, { json: true });
|
|
659
662
|
}));
|
|
663
|
+
meeting.command("ops").description('\u5217\u51FA\u5168\u90E8\u4F1A\u8BAE operation\uFF08\u7EAF\u6587\u672C\u4E0D\u538B\u7F29\uFF09\uFF1B\u5224\u65AD"\u6709\u6CA1\u6709\u67D0\u80FD\u529B"\u7528\u8FD9\u4E2A\uFF0C\u4E0D\u8981\u7528 schema').option("--grep <keyword>", "\u53EA\u770B\u540D\u5B57\u6216\u6458\u8981\u547D\u4E2D\u5173\u952E\u8BCD\u7684\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09").option("--capability <name>", "\u53EA\u770B\u67D0\u4E2A\u80FD\u529B\u5206\u7EC4\uFF0C\u5982 eb / meeting / room / conflict / sign").option("--json", "JSON \u8F93\u51FA\uFF08\u6CE8\u610F\uFF1AJSON \u8D70\u4FE1\u5C01\u538B\u7F29\uFF0C\u6761\u76EE\u591A\u65F6\u4F1A\u88AB\u622A\u65AD\uFF0C\u67E5\u5168\u91CF\u8BF7\u7528\u6587\u672C\uFF09").action(action((ctx, ...rest) => {
|
|
664
|
+
const options = rest.find((item) => item && typeof item === "object" && typeof item.opts !== "function") ?? {};
|
|
665
|
+
const keyword = String(options?.grep ?? "").trim().toLowerCase();
|
|
666
|
+
const capability = String(options?.capability ?? "").trim().toLowerCase();
|
|
667
|
+
const all = meetingManifest.operations;
|
|
668
|
+
const hit = all.filter((item) => {
|
|
669
|
+
if (capability && !String(item.capability ?? "").toLowerCase().startsWith(capability)) return false;
|
|
670
|
+
if (!keyword) return true;
|
|
671
|
+
return item.name.toLowerCase().includes(keyword) || String(item.summary ?? "").toLowerCase().includes(keyword);
|
|
672
|
+
});
|
|
673
|
+
if (options?.json === true) {
|
|
674
|
+
ctx.output.write({
|
|
675
|
+
ok: true,
|
|
676
|
+
schemaVersion: 1,
|
|
677
|
+
operationIndexHint: OPERATION_INDEX_HINT,
|
|
678
|
+
count: hit.length,
|
|
679
|
+
total: all.length,
|
|
680
|
+
operations: hit.map((item) => ({
|
|
681
|
+
name: item.name,
|
|
682
|
+
capability: item.capability,
|
|
683
|
+
risk: item.risk,
|
|
684
|
+
summary: item.summary
|
|
685
|
+
})),
|
|
686
|
+
withheldOperations: meetingManifest.withheldOperations
|
|
687
|
+
}, { json: true });
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
const clip = (text, max) => text.length > max ? `${text.slice(0, max)}\u2026` : text;
|
|
691
|
+
const lines = [
|
|
692
|
+
`\u6CDB\u5FAEE10\u4F1A\u8BAE CLI \u80FD\u529B\u6E05\u5355\uFF1A\u547D\u4E2D ${hit.length} / \u5171 ${all.length} \u9879${keyword ? `\uFF08\u5173\u952E\u8BCD\u300C${keyword}\u300D\uFF09` : ""}${capability ? `\uFF08\u5206\u7EC4 ${capability}\uFF09` : ""}`,
|
|
693
|
+
"\u7528\u6CD5\uFF1Aweaver-work-cli --json meeting run <operation> --input-json '{...}'",
|
|
694
|
+
""
|
|
695
|
+
];
|
|
696
|
+
const groups = /* @__PURE__ */ new Map();
|
|
697
|
+
for (const item of hit) {
|
|
698
|
+
const key = String(item.capability ?? "other");
|
|
699
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
700
|
+
groups.get(key).push(item);
|
|
701
|
+
}
|
|
702
|
+
for (const [group, items] of [...groups.entries()].sort((a, b) => b[1].length - a[1].length)) {
|
|
703
|
+
lines.push(`## ${group}\uFF08${items.length}\uFF09`);
|
|
704
|
+
for (const item of items) {
|
|
705
|
+
lines.push(` ${item.name} ${clip(String(item.summary ?? ""), 96)}`);
|
|
706
|
+
}
|
|
707
|
+
lines.push("");
|
|
708
|
+
}
|
|
709
|
+
if (!capability || "withheld".startsWith(capability)) {
|
|
710
|
+
const withheld = meetingManifest.withheldOperations.filter((item) => {
|
|
711
|
+
if (!keyword) return true;
|
|
712
|
+
return item.name.toLowerCase().includes(keyword) || item.reason.toLowerCase().includes(keyword);
|
|
713
|
+
});
|
|
714
|
+
if (withheld.length > 0) {
|
|
715
|
+
lines.push(`## \u4E0D\u53EF\u7528\uFF08${withheld.length}\uFF09`);
|
|
716
|
+
for (const item of withheld) {
|
|
717
|
+
lines.push(` ${item.name} ${clip(item.reason, 120)}`);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
process.stdout.write(`${lines.join("\n")}
|
|
722
|
+
`);
|
|
723
|
+
}));
|
|
660
724
|
meeting.command("run").description("Run a meeting operation with JSON input").argument("<operation>", "operation name, e.g. meeting.room.list").option("--input <path>", "JSON input file, or - for stdin").option("--input-json <json>", "inline JSON input object").action(action(async (ctx, operation, options) => {
|
|
661
725
|
await executeAndPrint(ctx, String(operation), await inputFrom(options));
|
|
662
726
|
}));
|
|
@@ -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,
|
|
@@ -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
|
esbOperationDefinitions,
|
|
5
5
|
getEsbOperation,
|
|
6
6
|
hasEsbOperation
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-6LLJFKJE.js";
|
|
8
|
+
import "./chunk-I6QGIBDM.js";
|
|
9
9
|
import "./chunk-GPMFD4RD.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-JUXVYKII.js";
|
|
11
|
+
import "./chunk-JNG42JKG.js";
|
|
12
12
|
import "./chunk-LUSPKZKY.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
14
14
|
export {
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
getWorkflowOperation,
|
|
5
5
|
hasWorkflowOperation,
|
|
6
6
|
workflowOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VPUTVEMC.js";
|
|
8
8
|
import "./chunk-EZALDOQH.js";
|
|
9
9
|
import "./chunk-FMPJJYYI.js";
|
|
10
10
|
import "./chunk-EG6ZU444.js";
|
|
11
11
|
import "./chunk-AJ62BGAW.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JNG42JKG.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
export {
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
hasMeetingOperation,
|
|
6
6
|
meetingOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-QHFANTX7.js";
|
|
8
|
+
import "./chunk-BPE37FPB.js";
|
|
9
|
+
import "./chunk-XMGSYD6S.js";
|
|
10
|
+
import "./chunk-F746NKNF.js";
|
|
11
|
+
import "./chunk-WXFPWCXG.js";
|
|
12
|
+
import "./chunk-HXJQI5NM.js";
|
|
13
|
+
import "./chunk-5DQEEGCC.js";
|
|
14
|
+
import "./chunk-TC6MZAO3.js";
|
|
15
15
|
import "./chunk-LUSPKZKY.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
17
17
|
export {
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
loadRooms,
|
|
7
7
|
recommendRooms,
|
|
8
8
|
rememberFrequentRoom
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BPE37FPB.js";
|
|
10
|
+
import "./chunk-F746NKNF.js";
|
|
11
|
+
import "./chunk-5DQEEGCC.js";
|
|
12
|
+
import "./chunk-TC6MZAO3.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
export {
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
resolveMeetingScheduleTypeIds,
|
|
9
9
|
resolveMemberIdsByName,
|
|
10
10
|
runScheduleConflictFlow
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-XMGSYD6S.js";
|
|
12
|
+
import "./chunk-F746NKNF.js";
|
|
13
|
+
import "./chunk-5DQEEGCC.js";
|
|
14
|
+
import "./chunk-TC6MZAO3.js";
|
|
15
15
|
import "./chunk-LUSPKZKY.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
17
17
|
export {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createWorkflowHost
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VPXOPQJI.js";
|
|
6
6
|
import {
|
|
7
7
|
USER_INTENT_RULE_FILE,
|
|
8
8
|
aigroupUserDir,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
validateRuleFile,
|
|
18
18
|
workflowOperationDefinitions,
|
|
19
19
|
workflowSuccess
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VPUTVEMC.js";
|
|
21
21
|
import {
|
|
22
22
|
createWorkflowContinuationSigner
|
|
23
23
|
} from "./chunk-EZALDOQH.js";
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
} from "./chunk-FMPJJYYI.js";
|
|
29
29
|
import "./chunk-EG6ZU444.js";
|
|
30
30
|
import "./chunk-AJ62BGAW.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-JUXVYKII.js";
|
|
32
|
+
import "./chunk-JNG42JKG.js";
|
|
33
33
|
import {
|
|
34
34
|
isCliError,
|
|
35
35
|
toErrorEnvelope
|
|
@@ -89,6 +89,8 @@ function clarificationEnvelope(error, operation) {
|
|
|
89
89
|
const candidates = Array.isArray(details.candidates) ? details.candidates : [];
|
|
90
90
|
const question = typeof details.clarificationQuestion === "string" && details.clarificationQuestion ? details.clarificationQuestion : error.message;
|
|
91
91
|
const reason = typeof details.clarificationReason === "string" ? details.clarificationReason : "";
|
|
92
|
+
const missingInput = Array.isArray(details.missingInput) ? details.missingInput.map(String) : [];
|
|
93
|
+
const requiredInput = details.requiredInput && typeof details.requiredInput === "object" ? details.requiredInput : null;
|
|
92
94
|
return workflowSuccess(operation, {
|
|
93
95
|
type: "workflowClarification",
|
|
94
96
|
status: "NEEDS_CLARIFICATION",
|
|
@@ -96,6 +98,8 @@ function clarificationEnvelope(error, operation) {
|
|
|
96
98
|
clarificationKeyword: details.clarificationKeyword ?? null,
|
|
97
99
|
clarificationQuestion: question,
|
|
98
100
|
...reason ? { clarificationReason: reason } : {},
|
|
101
|
+
...missingInput.length ? { missingInput } : {},
|
|
102
|
+
...missingInput.length && requiredInput ? { requiredInput } : {},
|
|
99
103
|
candidates,
|
|
100
104
|
candidateCount: candidates.length,
|
|
101
105
|
note: clarificationNote(reason, candidates.length)
|
|
@@ -103,6 +107,9 @@ function clarificationEnvelope(error, operation) {
|
|
|
103
107
|
}
|
|
104
108
|
function clarificationNote(reason, candidateCount) {
|
|
105
109
|
const base = "\u8FD9\u4E0D\u662F\u5931\u8D25\uFF0C\u4E5F**\u4E0D\u4EE3\u8868\u67E5\u8BE2\u5DF2\u6267\u884C**\uFF1A\u672C\u6B21\u67E5\u8BE2\u5DF2\u505C\u6B62\uFF0C\u6CA1\u6709\u8FD4\u56DE\u4EFB\u4F55\u6D41\u7A0B\u6570\u636E\u3002";
|
|
110
|
+
if (reason === "workflow_required") {
|
|
111
|
+
return "\u672C\u6B21\u547D\u4EE4**\u6CA1\u6709\u62FF\u5230\u5FC5\u586B\u5165\u53C2 `workflow`**\uFF08\u6CA1\u5199\u8FD9\u4E2A\u952E\u3001\u7A7A\u6570\u7EC4\u3001\u7A7A\u5B57\u7B26\u4E32\u90FD\u7B97\u6CA1\u7ED9\uFF09\u2014\u2014\u547D\u4EE4\u505C\u5728\u4E86\u67E5\u8BE2\u4E4B\u524D\uFF1A**\u6CA1\u6709\u53D1\u8D77\u4EFB\u4F55\u6D41\u7A0B**\uFF0C\u4E5F\u6CA1\u6709\u53BB\u67E5\u53EF\u53D1\u8D77\u5217\u8868\uFF0C\u8FD9\u65E2\u4E0D\u662F\u6267\u884C\u5931\u8D25\uFF0C\u4E5F\u4E0D\u4EE3\u8868\u300C\u6CA1\u6709\u5339\u914D\u7684\u6D41\u7A0B\u300D\u3002\u8BF7\u5148\u5411\u7528\u6237\u786E\u8BA4\u8981\u53D1\u8D77\u54EA\u4E2A\u6D41\u7A0B\uFF08**\u5FC5\u987B\u95EE\uFF0C\u4E0D\u8981\u81EA\u5DF1\u731C\uFF0C\u4E5F\u4E0D\u8981\u62FF\u76F8\u4F3C\u7684\u540D\u5B57\u4EE3\u66FF**\uFF09\uFF0C\u518D\u6309 `requiredInput.workflow` \u7ED9\u51FA\u7684\u5F62\u6001\u628A\u5165\u53C2\u8865\u4E0A\u3001\u91CD\u53D1\u540C\u4E00\u6761\u547D\u4EE4\u3002\u6CE8\u610F `--input` \u63A5\u6536\u7684\u662F**\u6587\u4EF6\u8DEF\u5F84**\uFF08`-` \u8868\u793A\u6807\u51C6\u8F93\u5165\uFF09\uFF0C\u5185\u8054 JSON \u8981\u7528 `--input-json`\u3002";
|
|
112
|
+
}
|
|
106
113
|
if (reason === "workflow_not_exist") {
|
|
107
114
|
return base + '\u8BF7\u5982\u5B9E\u544A\u77E5\u7528\u6237\uFF1A\u8BE5\u5DE5\u4F5C\u6D41\u4E0D\u5B58\u5728\uFF08\u53EF\u80FD\u5DF2\u5220\u9664\u6216\u88AB\u505C\u7528\uFF09\uFF0C\u8BF7\u7528\u6237\u6539\u7528\u8BE5\u6D41\u7A0B\u7684\u5B8C\u6574\u540D\u79F0\uFF08\u6216\u5176\u5B83\u53EF\u7528\u4E8E\u68C0\u7D22\u7684\u5173\u952E\u8BCD\uFF09\u91CD\u65B0\u6307\u5B9A\u2014\u2014**\u4E0D\u8981\u5411\u7528\u6237\u7D22\u53D6 ID**\u3002**\u4E0D\u8981**\u8BF4\u6210"\u6CA1\u6709\u53EF\u53D1\u8D77\u7684\u5DE5\u4F5C\u6D41"\u8FD9\u7C7B\u6A21\u7CCA\u8BF4\u6CD5\u2014\u2014\u95EE\u9898\u5C31\u51FA\u5728\u8FD9\u4E2A\u76EE\u6807\u4E0A\u3002';
|
|
108
115
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
firstPositionalToken,
|
|
8
8
|
registerCommands,
|
|
9
9
|
toCommandMetadata
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-JYKABYCV.js";
|
|
11
11
|
import "./chunks/chunk-EG6ZU444.js";
|
|
12
12
|
import "./chunks/chunk-AJ62BGAW.js";
|
|
13
|
-
import "./chunks/chunk-
|
|
14
|
-
import "./chunks/chunk-
|
|
15
|
-
import "./chunks/chunk-
|
|
13
|
+
import "./chunks/chunk-JCSN3JGM.js";
|
|
14
|
+
import "./chunks/chunk-JUXVYKII.js";
|
|
15
|
+
import "./chunks/chunk-JNG42JKG.js";
|
|
16
16
|
import "./chunks/chunk-LUSPKZKY.js";
|
|
17
17
|
import "./chunks/chunk-BUSC6UAE.js";
|
|
18
18
|
|
|
@@ -29,7 +29,7 @@ function lazyShortcut(definition) {
|
|
|
29
29
|
placeholder.allowExcessArguments(true);
|
|
30
30
|
placeholder.helpOption(false);
|
|
31
31
|
placeholder.action(async () => {
|
|
32
|
-
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-
|
|
32
|
+
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-QXW7P4X3.js");
|
|
33
33
|
await dispatchLazyShortcut(definition, shortcutMetadata());
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -39,107 +39,112 @@ var builtinShortcuts = [
|
|
|
39
39
|
lazyShortcut({
|
|
40
40
|
name: "invoice",
|
|
41
41
|
description: "E10 \u4E1A\u7968\u901A\u53D1\u7968\u7BA1\u7406 CLI",
|
|
42
|
-
load: async () => (await import("./chunks/invoice-
|
|
42
|
+
load: async () => (await import("./chunks/invoice-2Z6YPMIS.js")).invoiceShortcut
|
|
43
43
|
}),
|
|
44
44
|
lazyShortcut({
|
|
45
45
|
name: "ehr",
|
|
46
46
|
description: "\u6CDB\u5FAEE10\u805A\u624D\u6797\uFF08\u4EBA\u4E8B/\u51FA\u52E4/\u85AA\u916C\uFF09CLI",
|
|
47
|
-
load: async () => (await import("./chunks/ehr-
|
|
47
|
+
load: async () => (await import("./chunks/ehr-EAP77IMT.js")).ehrShortcut
|
|
48
48
|
}),
|
|
49
49
|
lazyShortcut({
|
|
50
50
|
name: "cowork",
|
|
51
51
|
description: "\u6CDB\u5FAEE10\u534F\u4F5C\u533A\uFF08\u534F\u4F5C\u4E8B\u9879/\u8BA8\u8BBA/\u5BA1\u6279/\u5171\u4EAB\u6743\u9650\uFF09CLI",
|
|
52
|
-
load: async () => (await import("./chunks/cowork-
|
|
52
|
+
load: async () => (await import("./chunks/cowork-SCPGLBA4.js")).coworkShortcut
|
|
53
53
|
}),
|
|
54
54
|
lazyShortcut({
|
|
55
55
|
name: "archive",
|
|
56
56
|
description: "E10 \u6587\u4E66\u5B9A\u6863\u6848\u7BA1\u7406 CLI",
|
|
57
|
-
load: async () => (await import("./chunks/archive-
|
|
57
|
+
load: async () => (await import("./chunks/archive-XBVH7JU7.js")).archiveShortcut
|
|
58
58
|
}),
|
|
59
59
|
lazyShortcut({
|
|
60
60
|
name: "archive-oa",
|
|
61
61
|
description: "E10 \u6863\u6848\u5B9A\u4F4D\u4E0E OA \u5546\u52A1\u5408\u540C\u501F\u9605 CLI",
|
|
62
|
-
load: async () => (await import("./chunks/archive-oa-
|
|
62
|
+
load: async () => (await import("./chunks/archive-oa-MZM3EKFQ.js")).archiveOaShortcut
|
|
63
63
|
}),
|
|
64
64
|
lazyShortcut({
|
|
65
65
|
name: "calendar",
|
|
66
66
|
description: "\u6CDB\u5FAEE10\u65E5\u7A0B\u7BA1\u7406 CLI\uFF08\u521B\u5EFA/\u67E5\u8BE2/\u66F4\u65B0/\u5220\u9664/\u5B57\u5178\uFF09",
|
|
67
|
-
load: async () => (await import("./chunks/calendar-
|
|
67
|
+
load: async () => (await import("./chunks/calendar-MXEMTIO4.js")).calendarShortcut
|
|
68
68
|
}),
|
|
69
69
|
lazyShortcut({
|
|
70
70
|
name: "fna",
|
|
71
71
|
description: "\u6CDB\u5FAEE10\u9F50\u4E1A\u6210\u8D39\u63A7\u4E2D\u5FC3\uFF08\u9884\u7B97/\u8D39\u7528\u4E2D\u5FC3/\u501F\u6B3E\u7BA1\u7406/\u53D1\u7968\u6838\u9500\uFF09CLI",
|
|
72
|
-
load: async () => (await import("./chunks/fna-
|
|
72
|
+
load: async () => (await import("./chunks/fna-2X7ZE7BU.js")).fnaShortcut
|
|
73
73
|
}),
|
|
74
74
|
lazyShortcut({
|
|
75
75
|
name: "hrm",
|
|
76
76
|
description: "\u6CDB\u5FAEE10\u7EC4\u7EC7\u7BA1\u7406\uFF08\u5458\u5DE5/\u7EC4\u7EC7/\u5C97\u4F4D\u67E5\u8BE2\uFF09CLI",
|
|
77
|
-
load: async () => (await import("./chunks/hrm-
|
|
77
|
+
load: async () => (await import("./chunks/hrm-YXERJM76.js")).hrmShortcut
|
|
78
78
|
}),
|
|
79
79
|
lazyShortcut({
|
|
80
80
|
name: "mail",
|
|
81
81
|
description: "\u6CDB\u5FAEE10\u90AE\u4EF6\u7BA1\u7406 CLI",
|
|
82
|
-
load: async () => (await import("./chunks/mail-
|
|
82
|
+
load: async () => (await import("./chunks/mail-7GZ6CPBJ.js")).mailShortcut
|
|
83
83
|
}),
|
|
84
84
|
lazyShortcut({
|
|
85
85
|
name: "meeting",
|
|
86
86
|
description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
|
|
87
|
-
load: async () => (await import("./chunks/meeting-
|
|
87
|
+
load: async () => (await import("./chunks/meeting-3NMGA3MB.js")).meetingShortcut
|
|
88
88
|
}),
|
|
89
89
|
lazyShortcut({
|
|
90
90
|
name: "okr",
|
|
91
91
|
description: "\u6CDB\u5FAEE10 OKR \u76EE\u6807\u7BA1\u7406 CLI\uFF08\u76EE\u6807\u67E5\u8BE2/\u65B0\u5EFA/\u7F16\u8F91\u3001\u5173\u952E\u6210\u679C\u3001\u76EE\u6807\u5BF9\u9F50\u3001\u8BC4\u8BBA\uFF09",
|
|
92
|
-
load: async () => (await import("./chunks/okr-
|
|
92
|
+
load: async () => (await import("./chunks/okr-BZ6XUOAG.js")).okrShortcut
|
|
93
93
|
}),
|
|
94
94
|
lazyShortcut({
|
|
95
95
|
name: "plan",
|
|
96
96
|
description: "\u6CDB\u5FAEE10\u8BA1\u5212\u62A5\u544A CLI\uFF08\u67E5\u8BE2/\u65B0\u5EFA/\u4FEE\u6539/\u53D1\u5E03/\u64A4\u56DE/\u63D0\u4EA4\u63D0\u9192/\u8BC4\u8BBA\uFF09",
|
|
97
|
-
load: async () => (await import("./chunks/plan-
|
|
97
|
+
load: async () => (await import("./chunks/plan-DR5CMUYP.js")).planShortcut
|
|
98
98
|
}),
|
|
99
99
|
lazyShortcut({
|
|
100
100
|
name: "esb",
|
|
101
101
|
description: "\u6CDB\u5FAEE10 ESB \u4E2D\u5FC3\u81EA\u5B9A\u4E49\u89E6\u53D1\u52A8\u4F5C\u6D41 CLI",
|
|
102
|
-
load: async () => (await import("./chunks/esb-
|
|
102
|
+
load: async () => (await import("./chunks/esb-2TGGXEE7.js")).esbShortcut
|
|
103
103
|
}),
|
|
104
104
|
lazyShortcut({
|
|
105
105
|
name: "ebuilder-form",
|
|
106
106
|
description: "\u6CDB\u5FAEE10 eBuilder \u8868\u5355\u83DC\u5355\u3001\u5217\u8868\u548C\u8868\u5355\u6570\u636E CLI",
|
|
107
|
-
load: async () => (await import("./chunks/ebuilder-form-
|
|
107
|
+
load: async () => (await import("./chunks/ebuilder-form-EYLHNOTA.js")).ebuilderFormShortcut
|
|
108
108
|
}),
|
|
109
109
|
lazyShortcut({
|
|
110
110
|
name: "jiuchuanhui",
|
|
111
111
|
description: "\u6CDB\u5FAEE10\u4E5D\u6C1A\u6C47\u8425\u9500\u7BA1\u7406 CLI\uFF08\u5BA2\u6237/\u8054\u7CFB\u4EBA/\u5546\u673A/\u7EBF\u7D22/\u8054\u7CFB\u8BA1\u5212/\u516C\u6D77\uFF09",
|
|
112
|
-
load: async () => (await import("./chunks/jiuchuanhui-
|
|
112
|
+
load: async () => (await import("./chunks/jiuchuanhui-AR5GMKZB.js")).jiuchuanhuiShortcut
|
|
113
113
|
}),
|
|
114
114
|
lazyShortcut({
|
|
115
115
|
name: "asset",
|
|
116
116
|
description: "E10 \u8D44\u4EA7\u7BA1\u7406\uFF08\u8D44\u7BA1\u5BB6\uFF09CLI",
|
|
117
|
-
load: async () => (await import("./chunks/asset-
|
|
117
|
+
load: async () => (await import("./chunks/asset-4XO7UOUW.js")).assetShortcut
|
|
118
118
|
}),
|
|
119
119
|
lazyShortcut({
|
|
120
120
|
name: "im",
|
|
121
121
|
description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
|
|
122
|
-
load: async () => (await import("./chunks/im-
|
|
122
|
+
load: async () => (await import("./chunks/im-A4VZN2TQ.js")).imShortcut
|
|
123
123
|
}),
|
|
124
124
|
lazyShortcut({
|
|
125
125
|
name: "project",
|
|
126
126
|
description: "\u6CDB\u5FAEE10\u4E8B\u4E95\u7136\u9879\u76EE\u7BA1\u7406 CLI\uFF08\u9879\u76EE/\u4EFB\u52A1\u67E5\u8BE2\u4E0E\u786E\u8BA4\u5199\u5165\uFF09",
|
|
127
|
-
load: async () => (await import("./chunks/project-
|
|
127
|
+
load: async () => (await import("./chunks/project-6J63MK33.js")).projectShortcut
|
|
128
128
|
}),
|
|
129
129
|
lazyShortcut({
|
|
130
130
|
name: "workflow",
|
|
131
131
|
description: "\u6CDB\u5FAEE10\u6D41\u7A0B\u667A\u80FD\u52A9\u624B CLI\uFF08\u67E5\u8BE2/\u67E5\u770B/\u64CD\u4F5C/\u6279\u91CF/\u53D1\u8D77/\u4FEE\u6539\uFF09",
|
|
132
|
-
load: async () => (await import("./chunks/workflow-
|
|
132
|
+
load: async () => (await import("./chunks/workflow-D74NFK3C.js")).workflowShortcut
|
|
133
133
|
}),
|
|
134
134
|
lazyShortcut({
|
|
135
135
|
name: "blog",
|
|
136
136
|
description: "\u6CDB\u5FAEE10\u5DE5\u4F5C\u65E5\u62A5 CLI\uFF08\u67E5\u8BE2/\u53D1\u5E03/\u7F16\u8F91/\u8BC4\u8BBA/\u70B9\u8D5E/\u63D0\u9192/\u5BFC\u51FA\uFF09",
|
|
137
|
-
load: async () => (await import("./chunks/blog-
|
|
137
|
+
load: async () => (await import("./chunks/blog-PGZKOPSC.js")).blogShortcut
|
|
138
138
|
}),
|
|
139
139
|
lazyShortcut({
|
|
140
140
|
name: "caizhilian",
|
|
141
141
|
description: "\u6CDB\u5FAEE10\u91C7\u77E5\u8FDE\uFF08\u6587\u6863\u4E2D\u5FC3\uFF09CLI",
|
|
142
|
-
load: async () => (await import("./chunks/caizhilian-
|
|
142
|
+
load: async () => (await import("./chunks/caizhilian-BH4ZVGUN.js")).caizhilianShortcut
|
|
143
|
+
}),
|
|
144
|
+
lazyShortcut({
|
|
145
|
+
name: "contract",
|
|
146
|
+
description: "\u6CDB\u5FAEE10\u4ECA\u627F\u8FBE\u5408\u540C\u7BA1\u7406 CLI",
|
|
147
|
+
load: async () => (await import("./chunks/contract-XI2EEIZU.js")).contractShortcut
|
|
143
148
|
})
|
|
144
149
|
];
|
|
145
150
|
function shortcutMetadata() {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
const storage = new AsyncLocalStorage();
|
|
3
|
+
export function createFetchTimingSink() {
|
|
4
|
+
return { fetchMs: 0, fetchCount: 0, fetchStart: null, fetchEnd: null };
|
|
5
|
+
}
|
|
6
|
+
/** 在 `sink` 的上下文里执行 `fn`:期间发生的 fetch 都会记到它上面。 */
|
|
7
|
+
export function runWithFetchTiming(sink, fn) {
|
|
8
|
+
return storage.run(sink, fn);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* fetch 前调一次,拿到的结束函数在 fetch 落定(成功或失败)时调一次。
|
|
12
|
+
* 返回 `null` 表示当前没有 sink(非计时路径)⇒ 调用方跳过全部计时动作。
|
|
13
|
+
*/
|
|
14
|
+
export function startFetchTiming() {
|
|
15
|
+
const sink = storage.getStore();
|
|
16
|
+
if (!sink)
|
|
17
|
+
return null;
|
|
18
|
+
const startedAt = Date.now();
|
|
19
|
+
let finished = false;
|
|
20
|
+
return () => {
|
|
21
|
+
if (finished)
|
|
22
|
+
return;
|
|
23
|
+
finished = true;
|
|
24
|
+
const endedAt = Date.now();
|
|
25
|
+
sink.fetchMs += Math.max(0, endedAt - startedAt);
|
|
26
|
+
sink.fetchCount += 1;
|
|
27
|
+
// 重试会有多次 fetch:起点取最早、终点取最晚,中间的空档(如换票据)不计入 fetchCost。
|
|
28
|
+
sink.fetchStart = sink.fetchStart === null ? startedAt : Math.min(sink.fetchStart, startedAt);
|
|
29
|
+
sink.fetchEnd = sink.fetchEnd === null ? endedAt : Math.max(sink.fetchEnd, endedAt);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliError, ExitCode } from '../../core/errors.js';
|
|
2
2
|
import { isE10AuthenticationRequired, recoverXiaoEAuthSession, sameE10SessionIdentity, } from './auth-recovery.js';
|
|
3
|
+
import { startFetchTiming } from './fetch-timing.js';
|
|
3
4
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
4
5
|
const DEFAULT_BIG_INT_STRINGS = true;
|
|
5
6
|
const RESERVED_HEADERS = [
|
|
@@ -220,6 +221,9 @@ export class E10RequestRuntime {
|
|
|
220
221
|
async fetchWithTimeout(url, init, timeoutMs) {
|
|
221
222
|
const controller = new AbortController();
|
|
222
223
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
224
|
+
// 「纯 fetch」= 发出请求 → 收到响应头(`fetch` 落定那一刻,不含读响应体/解析)。没有计时上下文
|
|
225
|
+
// (`startFetchTiming()` 返回 `null`)时它什么都不做,非计时路径零开销。
|
|
226
|
+
const stopFetchTiming = startFetchTiming();
|
|
223
227
|
try {
|
|
224
228
|
return await this.fetchFn(url, { ...init, signal: controller.signal });
|
|
225
229
|
}
|
|
@@ -238,6 +242,7 @@ export class E10RequestRuntime {
|
|
|
238
242
|
}
|
|
239
243
|
finally {
|
|
240
244
|
clearTimeout(timer);
|
|
245
|
+
stopFetchTiming?.();
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
async readResponse(response, responseType, bigIntStrings = DEFAULT_BIG_INT_STRINGS, maxResponseBytes, timeoutMs = DEFAULT_TIMEOUT_MS) {
|