weaver-work-cli 0.1.33 → 0.1.38
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-PDV724YK.js} +5 -4
- package/dist/chunks/{archive-oa-NW3OD4UV.js → archive-oa-4XE4MNXQ.js} +4 -3
- package/dist/chunks/{asset-7QJKMIDV.js → asset-PDL2QE2N.js} +8 -7
- package/dist/chunks/{attachment-content-OSAVA6K3.js → attachment-content-MDDGOE5E.js} +3 -3
- package/dist/chunks/{blog-I7SDPNW4.js → blog-UYR3EUXW.js} +5 -4
- package/dist/chunks/{caizhilian-O37ZIQNY.js → caizhilian-LG2X5NMF.js} +5 -4
- package/dist/chunks/{calendar-7KXE4ED3.js → calendar-FG4BAZHE.js} +4 -3
- package/dist/chunks/{chunk-Q6LWB5HX.js → chunk-6FTTSA45.js} +4 -3
- package/dist/chunks/{chunk-MQ2I5AA3.js → chunk-6LTFIFLM.js} +3 -2
- package/dist/chunks/{chunk-WRRJ4GG2.js → chunk-CORFRD7Q.js} +4 -3
- package/dist/chunks/{chunk-WY74UBJ6.js → chunk-DMV2TOMH.js} +2194 -240
- package/dist/chunks/{chunk-MEEFGWTM.js → chunk-ELYDWBZJ.js} +135 -10
- package/dist/chunks/{chunk-EEWPQE3O.js → chunk-FUWVHMVV.js} +7 -6
- package/dist/chunks/{chunk-HEL5XTYI.js → chunk-GGJFMNJM.js} +26 -4
- package/dist/chunks/{chunk-KAS45KNR.js → chunk-IZUDA353.js} +1 -1
- package/dist/chunks/{chunk-2FLWXFVS.js → chunk-J7USS3ED.js} +4 -4
- package/dist/chunks/{chunk-IHUYP6LO.js → chunk-JSMFPO43.js} +1 -1
- package/dist/chunks/{chunk-RBGOMK4Y.js → chunk-KKRL3REV.js} +5 -4
- package/dist/chunks/{chunk-OCU4RLHC.js → chunk-NI6GIPIM.js} +195 -36
- package/dist/chunks/{chunk-PRHJGPMA.js → chunk-NR6RKXPA.js} +2 -2
- package/dist/chunks/{chunk-D223PTXU.js → chunk-OJQUJZQF.js} +33 -7
- package/dist/chunks/{chunk-ILMBNVSG.js → chunk-UJJD4QWF.js} +4 -3
- package/dist/chunks/{chunk-6ATGWRZM.js → chunk-UZZBA6PV.js} +177 -14
- package/dist/chunks/{chunk-GFPXQIY2.js → chunk-VRYHGG6O.js} +2 -2
- package/dist/chunks/{chunk-NHA62QD7.js → chunk-XJY7G4DD.js} +3 -3
- package/dist/chunks/{chunk-VBCFFFGT.js → chunk-Z32KWY6G.js} +4 -1
- package/dist/chunks/{conflict-SFNEVJY5.js → conflict-BQZEQ4SP.js} +2 -2
- package/dist/chunks/contract-XIRAFTEV.js +9111 -0
- package/dist/chunks/{cowork-CKWYHXYB.js → cowork-BLG62BL2.js} +46 -26
- package/dist/chunks/{ebuilder-form-KOLJRVZD.js → ebuilder-form-NUKG5QW4.js} +3 -3
- package/dist/chunks/{ehr-WFOC3B4D.js → ehr-2STW5ILH.js} +174 -10
- package/dist/chunks/{esb-LJZTN663.js → esb-UUDQUNKY.js} +4 -4
- package/dist/chunks/{fna-F7QRIIZC.js → fna-6RCY4NU5.js} +15 -9
- package/dist/chunks/{host-VQ6JJXGQ.js → host-7RXEDMAH.js} +3 -3
- package/dist/chunks/{host-KXPTEWFS.js → host-EJZFROU3.js} +3 -3
- package/dist/chunks/{host-BCGUVEWX.js → host-FWDOSRH5.js} +3 -3
- package/dist/chunks/{host-DGE2TZD4.js → host-RHM3NPXV.js} +3 -3
- package/dist/chunks/{host-BQBRHVR3.js → host-UFF33TWJ.js} +3 -3
- package/dist/chunks/{hrm-NI6XAKW5.js → hrm-PKJ6ELSH.js} +3 -3
- package/dist/chunks/{im-7TRTF3KT.js → im-YJAXS7CO.js} +3 -3
- package/dist/chunks/{invoice-AOXWJKYT.js → invoice-HWVSXGX6.js} +3 -3
- package/dist/chunks/{jiuchuanhui-7NQWEZAW.js → jiuchuanhui-L7VKILZB.js} +4 -3
- package/dist/chunks/{lazy-dispatch-RNS4EE4S.js → lazy-dispatch-NMYEIHRH.js} +4 -4
- package/dist/chunks/{mail-VDHJAB4O.js → mail-B42RRU7G.js} +46 -24
- package/dist/chunks/{meeting-GA7XCNNP.js → meeting-CFYVBJSS.js} +77 -12
- package/dist/chunks/{okr-TQIRERPQ.js → okr-GCLF6V7W.js} +4 -3
- package/dist/chunks/{plan-4RY4LN2P.js → plan-ZVL7GBRI.js} +4 -3
- package/dist/chunks/{project-D6XT2OC5.js → project-4YWAAE2K.js} +4 -3
- package/dist/chunks/{registry-QKMI43Q6.js → registry-EP4VTHZS.js} +8 -8
- package/dist/chunks/{registry-JHRIDQ3A.js → registry-FRJ6H7BT.js} +4 -4
- package/dist/chunks/{registry-VOGKFFTR.js → registry-SG2PGVCF.js} +2 -2
- package/dist/chunks/{room-recommend-D4EUOOWY.js → room-recommend-R3JVUUAC.js} +4 -4
- package/dist/chunks/{schedule-XPFBHPCV.js → schedule-NIJBTYDO.js} +4 -4
- package/dist/chunks/{workflow-HLBZRWIY.js → workflow-BB24DFBY.js} +11 -4
- package/dist/index.js +31 -26
- package/dist/internal/e10/auth-recovery.js +114 -1
- package/dist/internal/e10/client.js +16 -2
- package/dist/internal/e10/fetch-timing.js +31 -0
- package/dist/internal/e10/request-runtime.js +108 -7
- package/dist/shortcuts/archive/host.js +3 -2
- package/dist/shortcuts/archive-oa/host.js +2 -1
- package/dist/shortcuts/asset/host.js +6 -5
- package/dist/shortcuts/blog/host.js +3 -2
- package/dist/shortcuts/caizhilian/host.js +3 -2
- package/dist/shortcuts/calendar/host.js +2 -1
- package/dist/shortcuts/contract/host.js +2 -1
- package/dist/shortcuts/cowork/host.js +10 -1
- package/dist/shortcuts/cowork/operations/types.js +17 -2
- package/dist/shortcuts/ebuilder-form/host.js +3 -1
- package/dist/shortcuts/ehr/host.js +2 -1
- package/dist/shortcuts/ehr/operations/recruit-write.js +35 -0
- package/dist/shortcuts/ehr/operations/recruit.js +147 -0
- package/dist/shortcuts/esb/host.js +2 -1
- package/dist/shortcuts/fna/host.js +2 -1
- package/dist/shortcuts/fna/operations/expense-chart.js +19 -7
- package/dist/shortcuts/hrm/host.js +2 -1
- package/dist/shortcuts/im/host.js +3 -2
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/host.js +5 -4
- package/dist/shortcuts/jiuchuanhui/host.js +2 -1
- package/dist/shortcuts/mail/host.js +10 -1
- package/dist/shortcuts/mail/operations/types.js +17 -2
- package/dist/shortcuts/meeting/host.js +3 -2
- package/dist/shortcuts/meeting/index.js +79 -1
- package/dist/shortcuts/meeting/invitation/text.js +71 -0
- 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 +2105 -169
- package/dist/shortcuts/meeting/operations/eb/crm-search.js +478 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +161 -8
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- 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 +200 -28
- package/dist/shortcuts/okr/host.js +2 -1
- package/dist/shortcuts/plan/host.js +2 -1
- package/dist/shortcuts/project/host.js +2 -1
- package/dist/shortcuts/workflow/endpoints.js +8 -3
- package/dist/shortcuts/workflow/operations/form.js +341 -36
- 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 +499 -300
- package/skills/weaver-e10-meeting/references/meeting-eb.md +334 -0
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +64 -6
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- 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
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
createProgram,
|
|
6
6
|
registerCommands,
|
|
7
7
|
toCommandMetadata
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VRYHGG6O.js";
|
|
9
9
|
import "./chunk-EG6ZU444.js";
|
|
10
10
|
import "./chunk-AJ62BGAW.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-FUWVHMVV.js";
|
|
12
|
+
import "./chunk-UZZBA6PV.js";
|
|
13
|
+
import "./chunk-OJQUJZQF.js";
|
|
14
14
|
import "./chunk-LUSPKZKY.js";
|
|
15
15
|
import "./chunk-BUSC6UAE.js";
|
|
16
16
|
|
|
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
|
+
isE10SessionExpiredResponse,
|
|
6
7
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZZBA6PV.js";
|
|
8
9
|
import {
|
|
9
10
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
11
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OJQUJZQF.js";
|
|
12
13
|
import {
|
|
13
14
|
CliError,
|
|
14
15
|
isCliError,
|
|
@@ -128,6 +129,42 @@ function createMailContinuationSigner(ctx) {
|
|
|
128
129
|
|
|
129
130
|
// src/shortcuts/mail/host.ts
|
|
130
131
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
132
|
+
|
|
133
|
+
// src/shortcuts/mail/operations/types.ts
|
|
134
|
+
var READ = "read";
|
|
135
|
+
var WRITE = "write";
|
|
136
|
+
var mailPerf = {
|
|
137
|
+
t0: Date.now(),
|
|
138
|
+
sessionMs: 0,
|
|
139
|
+
requestCount: 0,
|
|
140
|
+
requestMs: 0
|
|
141
|
+
};
|
|
142
|
+
function mailSuccess(action, data, meta) {
|
|
143
|
+
const payload = { ok: true, action, data };
|
|
144
|
+
const perf = {
|
|
145
|
+
elapsed_ms: Date.now() - mailPerf.t0,
|
|
146
|
+
session_ms: mailPerf.sessionMs || void 0,
|
|
147
|
+
requests: mailPerf.requestCount || void 0,
|
|
148
|
+
network_ms: mailPerf.requestMs || void 0
|
|
149
|
+
};
|
|
150
|
+
for (const k of Object.keys(perf)) if (perf[k] === void 0) delete perf[k];
|
|
151
|
+
payload.meta = { ...meta || {}, ...perf };
|
|
152
|
+
return payload;
|
|
153
|
+
}
|
|
154
|
+
function schemaOf(properties, options = {}) {
|
|
155
|
+
return {
|
|
156
|
+
type: "object",
|
|
157
|
+
additionalProperties: false,
|
|
158
|
+
properties,
|
|
159
|
+
...options.required?.length ? { required: options.required } : {},
|
|
160
|
+
...options.description ? { description: options.description } : {}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
var SCHEMA_STRING = { type: "string" };
|
|
164
|
+
var SCHEMA_INTEGER = { type: "integer" };
|
|
165
|
+
var SCHEMA_BOOLEAN = { type: "boolean" };
|
|
166
|
+
|
|
167
|
+
// src/shortcuts/mail/host.ts
|
|
131
168
|
function inferProfile(ctx) {
|
|
132
169
|
const options = ctx.getGlobalOptions();
|
|
133
170
|
return options.profile || getActiveProfile();
|
|
@@ -195,7 +232,9 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
195
232
|
const requireSession = dependencies.requireSession || ((innerCtx) => requireE10Session(innerCtx, { skipProfileEnrichment: true }));
|
|
196
233
|
async function ensureSession() {
|
|
197
234
|
if (!e10Session) {
|
|
235
|
+
const sessionStart = Date.now();
|
|
198
236
|
e10Session = await requireSession(ctx);
|
|
237
|
+
mailPerf.sessionMs = Date.now() - sessionStart;
|
|
199
238
|
sessionContext = {
|
|
200
239
|
baseUrl: e10Session.getBaseUrl(),
|
|
201
240
|
profile: inferProfile(ctx),
|
|
@@ -231,6 +270,7 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
231
270
|
assertPath(path);
|
|
232
271
|
const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 ? "GET" : "POST");
|
|
233
272
|
let response;
|
|
273
|
+
const reqStart = Date.now();
|
|
234
274
|
try {
|
|
235
275
|
response = await (await runtime()).requestJson({
|
|
236
276
|
module: "mail",
|
|
@@ -253,8 +293,11 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
253
293
|
});
|
|
254
294
|
}
|
|
255
295
|
throw error;
|
|
296
|
+
} finally {
|
|
297
|
+
mailPerf.requestCount += 1;
|
|
298
|
+
mailPerf.requestMs += Date.now() - reqStart;
|
|
256
299
|
}
|
|
257
|
-
if (response
|
|
300
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
258
301
|
throw mailAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
259
302
|
}
|
|
260
303
|
if (response.parseError) {
|
|
@@ -287,27 +330,6 @@ function createMailHost(ctx, dependencies = {}) {
|
|
|
287
330
|
return { request, getSession };
|
|
288
331
|
}
|
|
289
332
|
|
|
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
333
|
// src/shortcuts/mail/operations/mail-read.ts
|
|
312
334
|
var FOLDER_TEXT = {
|
|
313
335
|
"-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-DMV2TOMH.js";
|
|
7
|
+
import "./chunk-GGJFMNJM.js";
|
|
8
|
+
import "./chunk-J7USS3ED.js";
|
|
9
|
+
import "./chunk-JSMFPO43.js";
|
|
10
|
+
import "./chunk-XJY7G4DD.js";
|
|
11
|
+
import "./chunk-6LTFIFLM.js";
|
|
12
12
|
import {
|
|
13
13
|
degradeMeetingEnvToStandard,
|
|
14
14
|
meetingStateDir,
|
|
15
15
|
readCache
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Z32KWY6G.js";
|
|
17
17
|
import {
|
|
18
18
|
MeetingCliError,
|
|
19
19
|
asObject,
|
|
@@ -21,16 +21,17 @@ import {
|
|
|
21
21
|
meetingAuthError,
|
|
22
22
|
meetingNetworkError,
|
|
23
23
|
meetingValidationError
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ELYDWBZJ.js";
|
|
25
25
|
import {
|
|
26
26
|
E10ApiError,
|
|
27
27
|
createE10RequestRuntime,
|
|
28
|
+
isE10SessionExpiredResponse,
|
|
28
29
|
requireE10Session
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-UZZBA6PV.js";
|
|
30
31
|
import {
|
|
31
32
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
32
33
|
getActiveProfile
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OJQUJZQF.js";
|
|
34
35
|
import {
|
|
35
36
|
isCliError,
|
|
36
37
|
toErrorEnvelope
|
|
@@ -210,7 +211,7 @@ function createMeetingHost(ctx, dependencies = {}) {
|
|
|
210
211
|
} catch (error) {
|
|
211
212
|
mapRuntimeNetworkError(error);
|
|
212
213
|
}
|
|
213
|
-
if (response
|
|
214
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
214
215
|
throw meetingAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
215
216
|
}
|
|
216
217
|
if (response.status !== 200) {
|
|
@@ -256,7 +257,7 @@ function createMeetingHost(ctx, dependencies = {}) {
|
|
|
256
257
|
} catch (error) {
|
|
257
258
|
mapRuntimeNetworkError(error);
|
|
258
259
|
}
|
|
259
|
-
if (response
|
|
260
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
260
261
|
throw meetingAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
|
|
261
262
|
}
|
|
262
263
|
if (response.parseError) {
|
|
@@ -336,8 +337,10 @@ function buildOperations() {
|
|
|
336
337
|
inputSchema: definition.inputSchema
|
|
337
338
|
}));
|
|
338
339
|
}
|
|
340
|
+
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
341
|
var meetingManifest = {
|
|
340
342
|
schemaVersion: 1,
|
|
343
|
+
operationIndexHint: OPERATION_INDEX_HINT,
|
|
341
344
|
name: "meeting",
|
|
342
345
|
title: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406\uFF08\u53CC\u6A21\u5F0F\uFF1A\u6807\u51C6\u7248 Java REST + EB \u7248 eBuilder\uFF09",
|
|
343
346
|
version: "1.0.0",
|
|
@@ -433,6 +436,7 @@ function peerHint(operation) {
|
|
|
433
436
|
async function tryDegradeEbFailure(operation, error, host, ctx) {
|
|
434
437
|
if (!operation.startsWith("meeting.eb.")) return null;
|
|
435
438
|
if (process.env.WEAVER_MEETING_ENV_AUTOFALLBACK === "0") return null;
|
|
439
|
+
if (String(process.env.WEAVER_MEETING_LOCK_MODE ?? "").trim().toLowerCase() === "eb") return null;
|
|
436
440
|
const type = String(error?.type ?? "");
|
|
437
441
|
const subtype = String(error?.subtype ?? "");
|
|
438
442
|
if (NO_FALLBACK_TYPES.has(type) || NO_FALLBACK_SUBTYPES.has(subtype)) return null;
|
|
@@ -657,6 +661,67 @@ var meetingShortcut = {
|
|
|
657
661
|
meeting.command("schema").description("Print meeting operation manifest for agents").action(action((ctx) => {
|
|
658
662
|
ctx.output.write(meetingManifest, { json: true });
|
|
659
663
|
}));
|
|
664
|
+
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) => {
|
|
665
|
+
const options = rest.find((item) => item && typeof item === "object" && typeof item.opts !== "function") ?? {};
|
|
666
|
+
const keyword = String(options?.grep ?? "").trim().toLowerCase();
|
|
667
|
+
const capability = String(options?.capability ?? "").trim().toLowerCase();
|
|
668
|
+
const all = meetingManifest.operations;
|
|
669
|
+
const hit = all.filter((item) => {
|
|
670
|
+
if (capability && !String(item.capability ?? "").toLowerCase().startsWith(capability)) return false;
|
|
671
|
+
if (!keyword) return true;
|
|
672
|
+
return item.name.toLowerCase().includes(keyword) || String(item.summary ?? "").toLowerCase().includes(keyword);
|
|
673
|
+
});
|
|
674
|
+
if (options?.json === true) {
|
|
675
|
+
ctx.output.write({
|
|
676
|
+
ok: true,
|
|
677
|
+
schemaVersion: 1,
|
|
678
|
+
operationIndexHint: OPERATION_INDEX_HINT,
|
|
679
|
+
count: hit.length,
|
|
680
|
+
total: all.length,
|
|
681
|
+
operations: hit.map((item) => ({
|
|
682
|
+
name: item.name,
|
|
683
|
+
capability: item.capability,
|
|
684
|
+
risk: item.risk,
|
|
685
|
+
summary: item.summary
|
|
686
|
+
})),
|
|
687
|
+
withheldOperations: meetingManifest.withheldOperations
|
|
688
|
+
}, { json: true });
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
const clip = (text, max) => text.length > max ? `${text.slice(0, max)}\u2026` : text;
|
|
692
|
+
const lines = [
|
|
693
|
+
`\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` : ""}`,
|
|
694
|
+
"\u7528\u6CD5\uFF1Aweaver-work-cli --json meeting run <operation> --input-json '{...}'",
|
|
695
|
+
""
|
|
696
|
+
];
|
|
697
|
+
const groups = /* @__PURE__ */ new Map();
|
|
698
|
+
for (const item of hit) {
|
|
699
|
+
const key = String(item.capability ?? "other");
|
|
700
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
701
|
+
groups.get(key).push(item);
|
|
702
|
+
}
|
|
703
|
+
for (const [group, items] of [...groups.entries()].sort((a, b) => b[1].length - a[1].length)) {
|
|
704
|
+
lines.push(`## ${group}\uFF08${items.length}\uFF09`);
|
|
705
|
+
for (const item of items) {
|
|
706
|
+
lines.push(` ${item.name} ${clip(String(item.summary ?? ""), 96)}`);
|
|
707
|
+
}
|
|
708
|
+
lines.push("");
|
|
709
|
+
}
|
|
710
|
+
if (!capability || "withheld".startsWith(capability)) {
|
|
711
|
+
const withheld = meetingManifest.withheldOperations.filter((item) => {
|
|
712
|
+
if (!keyword) return true;
|
|
713
|
+
return item.name.toLowerCase().includes(keyword) || item.reason.toLowerCase().includes(keyword);
|
|
714
|
+
});
|
|
715
|
+
if (withheld.length > 0) {
|
|
716
|
+
lines.push(`## \u4E0D\u53EF\u7528\uFF08${withheld.length}\uFF09`);
|
|
717
|
+
for (const item of withheld) {
|
|
718
|
+
lines.push(` ${item.name} ${clip(item.reason, 120)}`);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
process.stdout.write(`${lines.join("\n")}
|
|
723
|
+
`);
|
|
724
|
+
}));
|
|
660
725
|
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
726
|
await executeAndPrint(ctx, String(operation), await inputFrom(options));
|
|
662
727
|
}));
|
|
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
|
+
isE10SessionExpiredResponse,
|
|
6
7
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZZBA6PV.js";
|
|
8
9
|
import {
|
|
9
10
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
11
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OJQUJZQF.js";
|
|
12
13
|
import {
|
|
13
14
|
CliError,
|
|
14
15
|
isCliError,
|
|
@@ -286,7 +287,7 @@ function createOkrHost(ctx, dependencies = {}) {
|
|
|
286
287
|
} catch (error) {
|
|
287
288
|
mapRuntimeNetworkError(error);
|
|
288
289
|
}
|
|
289
|
-
if (response
|
|
290
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
290
291
|
throw okrAuthError(
|
|
291
292
|
"session_expired",
|
|
292
293
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
|
+
isE10SessionExpiredResponse,
|
|
6
7
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZZBA6PV.js";
|
|
8
9
|
import {
|
|
9
10
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
11
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OJQUJZQF.js";
|
|
12
13
|
import {
|
|
13
14
|
CliError,
|
|
14
15
|
isCliError,
|
|
@@ -290,7 +291,7 @@ function createPlanHost(ctx, dependencies = {}) {
|
|
|
290
291
|
} catch (error) {
|
|
291
292
|
mapRuntimeNetworkError(error);
|
|
292
293
|
}
|
|
293
|
-
if (response
|
|
294
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
294
295
|
throw planAuthError(
|
|
295
296
|
"session_expired",
|
|
296
297
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
|
+
isE10SessionExpiredResponse,
|
|
6
7
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZZBA6PV.js";
|
|
8
9
|
import {
|
|
9
10
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
11
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OJQUJZQF.js";
|
|
12
13
|
import {
|
|
13
14
|
CliError,
|
|
14
15
|
isCliError,
|
|
@@ -266,7 +267,7 @@ function createProjectHost(ctx, dependencies = {}) {
|
|
|
266
267
|
} catch (error) {
|
|
267
268
|
mapRuntimeNetworkError(error);
|
|
268
269
|
}
|
|
269
|
-
if (response
|
|
270
|
+
if (isE10SessionExpiredResponse(response)) {
|
|
270
271
|
throw projectAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, {
|
|
271
272
|
httpStatus: response.status
|
|
272
273
|
});
|
|
@@ -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-DMV2TOMH.js";
|
|
8
|
+
import "./chunk-GGJFMNJM.js";
|
|
9
|
+
import "./chunk-J7USS3ED.js";
|
|
10
|
+
import "./chunk-JSMFPO43.js";
|
|
11
|
+
import "./chunk-XJY7G4DD.js";
|
|
12
|
+
import "./chunk-6LTFIFLM.js";
|
|
13
|
+
import "./chunk-Z32KWY6G.js";
|
|
14
|
+
import "./chunk-ELYDWBZJ.js";
|
|
15
15
|
import "./chunk-LUSPKZKY.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
17
17
|
export {
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
esbOperationDefinitions,
|
|
5
5
|
getEsbOperation,
|
|
6
6
|
hasEsbOperation
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-IZUDA353.js";
|
|
8
|
+
import "./chunk-UJJD4QWF.js";
|
|
9
9
|
import "./chunk-GPMFD4RD.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-UZZBA6PV.js";
|
|
11
|
+
import "./chunk-OJQUJZQF.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-NI6GIPIM.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-OJQUJZQF.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
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-GGJFMNJM.js";
|
|
10
|
+
import "./chunk-JSMFPO43.js";
|
|
11
|
+
import "./chunk-Z32KWY6G.js";
|
|
12
|
+
import "./chunk-ELYDWBZJ.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-J7USS3ED.js";
|
|
12
|
+
import "./chunk-JSMFPO43.js";
|
|
13
|
+
import "./chunk-Z32KWY6G.js";
|
|
14
|
+
import "./chunk-ELYDWBZJ.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-NR6RKXPA.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-NI6GIPIM.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-UZZBA6PV.js";
|
|
32
|
+
import "./chunk-OJQUJZQF.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
|
}
|