weaver-work-cli 0.1.39 → 0.1.40
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/README.md +4 -2
- package/dist/chunks/{archive-ENZYBBME.js → archive-JHTONRST.js} +2 -2
- package/dist/chunks/{archive-oa-YWLEC5V4.js → archive-oa-FCHLCPHC.js} +2 -2
- package/dist/chunks/{asset-OOV6DWPA.js → asset-RLIHC7DB.js} +2 -2
- package/dist/chunks/{asset-idle-RE632MY5.js → asset-idle-KVOFTLCP.js} +2 -2
- package/dist/chunks/{attachment-content-RWN2FCLL.js → attachment-content-RZYDB3MB.js} +3 -3
- package/dist/chunks/{blog-PEPOJAL7.js → blog-42OZTJNP.js} +2 -2
- package/dist/chunks/{caizhilian-WYIQDVPJ.js → caizhilian-KRK547K5.js} +2 -2
- package/dist/chunks/{calendar-CIARBAOX.js → calendar-RTWAMKHD.js} +2 -2
- package/dist/chunks/{chunk-L4N7B7ZD.js → chunk-4CTESSKI.js} +4 -4
- package/dist/chunks/{chunk-XXJOSZTQ.js → chunk-4TEDNCON.js} +43 -5
- package/dist/chunks/chunk-57IECMWX.js +487 -0
- package/dist/chunks/{chunk-CQHGNCK2.js → chunk-7BRU4EFH.js} +13 -7
- package/dist/chunks/{chunk-KTCB5R5H.js → chunk-7E6MUOEK.js} +2 -2
- package/dist/chunks/{chunk-I2HB737U.js → chunk-7U577Q7U.js} +2 -2
- package/dist/chunks/{chunk-BJGXMFGD.js → chunk-CAQNBBQA.js} +2 -2
- package/dist/chunks/{chunk-MUQUHKPG.js → chunk-CXRQWOZ5.js} +2 -2
- package/dist/chunks/{chunk-T7JDJJ7H.js → chunk-FLS4DPGP.js} +110 -16
- package/dist/chunks/{chunk-P2DAISYW.js → chunk-I566ZYNF.js} +1 -1
- package/dist/chunks/{chunk-36DIFZAH.js → chunk-IZSSVYAG.js} +2 -2
- package/dist/chunks/{chunk-EINRJHQ3.js → chunk-JWRZM2H2.js} +3 -3
- package/dist/chunks/{chunk-F2EQXUEE.js → chunk-LFMSDBZN.js} +97 -14
- package/dist/chunks/{chunk-GVPJZXJ2.js → chunk-LN447PY2.js} +91 -50
- package/dist/chunks/{chunk-K3RUEEOL.js → chunk-NETCCARD.js} +2 -2
- package/dist/chunks/{chunk-YS5DPN4T.js → chunk-NJKREDA3.js} +1 -1
- package/dist/chunks/{chunk-ZXRNHZTE.js → chunk-SPRHHSVC.js} +2 -2
- package/dist/chunks/{chunk-HJYVHXUQ.js → chunk-T6EGVBKU.js} +1 -1
- package/dist/chunks/{chunk-NLK2RZKG.js → chunk-VNBU55SL.js} +428 -145
- package/dist/chunks/{chunk-EZGFHJFW.js → chunk-WFFNM65B.js} +26 -7
- package/dist/chunks/{conflict-DRMDOL56.js → conflict-VR55AOOO.js} +2 -2
- package/dist/chunks/{contract-73MERZWN.js → contract-HI4FNPYE.js} +2 -2
- package/dist/chunks/{cowork-HNGBPD7A.js → cowork-HJLI353D.js} +12 -5
- package/dist/chunks/{ebuilder-form-OY6DVNRK.js → ebuilder-form-HTGI63UU.js} +3 -3
- package/dist/chunks/{ehr-RAQNEQO7.js → ehr-GYXIYH3A.js} +2 -2
- package/dist/chunks/env-DW3G4HUO.js +19 -0
- package/dist/chunks/{esb-6XV7C7YV.js → esb-I5INCEFE.js} +4 -4
- package/dist/chunks/factory-TKXGXS6L.js +30 -0
- package/dist/chunks/{fna-XTSRB7G7.js → fna-K2MHTQ24.js} +2 -2
- package/dist/chunks/group-chat-VYBNMJLG.js +18 -0
- package/dist/chunks/{host-VGPVP7YF.js → host-256GVCAH.js} +3 -3
- package/dist/chunks/{host-A7J6GDUP.js → host-D5SERMAJ.js} +3 -3
- package/dist/chunks/{host-3F5UM5GN.js → host-JM4YVHFM.js} +3 -3
- package/dist/chunks/{host-YAQAPYNP.js → host-L3VLITMT.js} +3 -3
- package/dist/chunks/{host-YMBXWFWX.js → host-ZUQTJYYK.js} +3 -3
- package/dist/chunks/{hrm-TLHKC545.js → hrm-VLRBKTZB.js} +3 -3
- package/dist/chunks/{im-YOUCFMUK.js → im-QK3VTLXK.js} +8 -8
- package/dist/chunks/{invoice-WNBS2B4C.js → invoice-T5JTA32H.js} +3 -3
- package/dist/chunks/{jiuchuanhui-XABWS5RN.js → jiuchuanhui-P2FNEQVZ.js} +2 -2
- package/dist/chunks/{lazy-dispatch-NLZ5UQQI.js → lazy-dispatch-XRRI46M6.js} +4 -4
- package/dist/chunks/{mail-LRYMBFNL.js → mail-3Y7MJ6PS.js} +9 -4
- package/dist/chunks/{meeting-ESXL6MFI.js → meeting-M7LTXGJE.js} +11 -10
- package/dist/chunks/{okr-EOV65SSF.js → okr-OBC6S67L.js} +2 -2
- package/dist/chunks/{plan-YFPVKW6Y.js → plan-5H6I53SK.js} +2 -2
- package/dist/chunks/{project-MDVZUYQW.js → project-L75QZV4S.js} +2 -2
- package/dist/chunks/{registry-QCLZEDAP.js → registry-KMHCPAAD.js} +9 -8
- package/dist/chunks/{registry-OZSMDVPP.js → registry-QGHFNUWS.js} +2 -2
- package/dist/chunks/{registry-VT5Y2HLA.js → registry-RXPN6BBT.js} +4 -4
- package/dist/chunks/{registry-YX4CSEMD.js → registry-UGRBCBHO.js} +2 -2
- package/dist/chunks/{room-recommend-L3MWH4JW.js → room-recommend-A3UDC3CA.js} +4 -4
- package/dist/chunks/{schedule-UASAVDVD.js → schedule-5GCACCK7.js} +4 -4
- package/dist/chunks/{workflow-KDGIUCNW.js → workflow-M5ZJ7DWF.js} +6 -6
- package/dist/index.js +28 -28
- package/dist/internal/e10/auth/commands.js +109 -56
- package/dist/internal/e10/auth/session.js +11 -1
- package/dist/internal/e10/auth/xiaoe.js +29 -4
- package/dist/internal/e10/client.js +13 -0
- package/dist/internal/e10/context.js +14 -6
- package/dist/internal/e10/request-runtime.js +9 -0
- package/dist/shortcuts/cowork/operations/item-write.js +10 -2
- package/dist/shortcuts/mail/operations/mail-send.js +8 -2
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +381 -104
- package/dist/shortcuts/meeting/operations/eb/crm-search.js +87 -5
- package/dist/shortcuts/meeting/operations/eb/flow-memory.js +49 -0
- package/dist/shortcuts/meeting/operations/eb/group-chat.js +583 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +19 -3
- package/dist/shortcuts/meeting/operations/eb/room-summary.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/usage-cache.js +99 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +35 -12
- package/dist/shortcuts/workflow/operations/form.js +21 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +52 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +10 -9
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +28 -2
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +17 -9
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +14 -2
- package/docs/e10-auth.md +15 -0
- package/package.json +1 -1
- package/scripts/mcp-meeting.mjs +234 -0
- package/skills/weaver-e10-cowork/references/cowork-write.md +1 -1
- package/skills/weaver-e10-mail/references/mail-send.md +2 -0
- package/skills/weaver-e10-meeting/SKILL.md +88 -25
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +25 -11
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-shared/SKILL.md +1 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +1 -1
- package/skills/weaver-e10-workflow/SKILL.md +4 -0
- package/skills/weaver-e10-workflow/aigroup/default.json +12 -0
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +17 -11
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +73 -23
- package/dist/chunks/{chunk-2LV74IWP.js → chunk-E7OK5WD5.js} +5 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isE10AuthenticationRequired, isE10LoginRedirect, isE10RedirectStatus, sameE10SessionIdentity, } from './auth-recovery.js';
|
|
2
|
+
import { E10_XIAOE_RECOVERY_FAILED_MESSAGE } from './auth/messages.js';
|
|
2
3
|
class E10AuthenticationContextChangedError extends Error {
|
|
3
4
|
}
|
|
4
5
|
export class E10ApiClient {
|
|
@@ -62,6 +63,18 @@ export class E10ApiClient {
|
|
|
62
63
|
async requestRaw(url, init) {
|
|
63
64
|
let lastError = null;
|
|
64
65
|
let authenticationRecoveryAttempted = false;
|
|
66
|
+
if (this.auth.isExpired?.()) {
|
|
67
|
+
authenticationRecoveryAttempted = true;
|
|
68
|
+
const recovered = await this.recoverAuthentication?.(this.auth) || null;
|
|
69
|
+
if (!recovered || recovered.isExpired?.()) {
|
|
70
|
+
throw new Error(E10_XIAOE_RECOVERY_FAILED_MESSAGE);
|
|
71
|
+
}
|
|
72
|
+
if (!sameE10SessionIdentity(this.auth, recovered)) {
|
|
73
|
+
throw new E10AuthenticationContextChangedError('XiaoE automatic authentication recovery changed the E10 login context');
|
|
74
|
+
}
|
|
75
|
+
this.auth.replaceWith(recovered);
|
|
76
|
+
refreshAuthenticationHeaders(init, this.auth);
|
|
77
|
+
}
|
|
65
78
|
for (let attempt = 1; attempt <= this.retries; attempt++) {
|
|
66
79
|
try {
|
|
67
80
|
const resp = await fetch(url, { ...init, redirect: 'manual' });
|
|
@@ -3,23 +3,31 @@ import { E10_AUTH_REQUIRED_MESSAGE, E10_XIAOE_RECOVERY_FAILED_MESSAGE } from './
|
|
|
3
3
|
import { E10AuthSession } from './auth/session.js';
|
|
4
4
|
import { E10ApiClient } from './client.js';
|
|
5
5
|
import { canAutomaticallyRecoverXiaoE, recoverXiaoEAuthSession } from './auth-recovery.js';
|
|
6
|
+
function xiaoERecoveryFailedError() {
|
|
7
|
+
return Object.assign(new CliError(E10_XIAOE_RECOVERY_FAILED_MESSAGE, ExitCode.AuthError), {
|
|
8
|
+
type: 'authentication',
|
|
9
|
+
subtype: 'xiaoe_credential_unavailable',
|
|
10
|
+
retryable: false,
|
|
11
|
+
stage: 'xiaoe_unified_login',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
6
14
|
export async function getE10Session(ctx, load = {}) {
|
|
7
15
|
const options = ctx.getGlobalOptions();
|
|
8
16
|
return E10AuthSession.fromOptions(options, ctx.cwd, load);
|
|
9
17
|
}
|
|
10
18
|
export async function requireE10Session(ctx, load = {}) {
|
|
11
19
|
let session = await getE10Session(ctx, load);
|
|
20
|
+
if (session?.isExpired() && canAutomaticallyRecoverXiaoE(ctx, session)) {
|
|
21
|
+
session = await recoverXiaoEAuthSession(ctx, session).catch(() => null);
|
|
22
|
+
if (!session || session.isExpired())
|
|
23
|
+
throw xiaoERecoveryFailedError();
|
|
24
|
+
}
|
|
12
25
|
if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
|
|
13
26
|
// Read-only probes use getE10Session; only a command requiring a session
|
|
14
27
|
// may establish one from the current XiaoE host's credentials.
|
|
15
28
|
session = await recoverXiaoEAuthSession(ctx).catch(() => null);
|
|
16
29
|
if (!session) {
|
|
17
|
-
throw
|
|
18
|
-
type: 'authentication',
|
|
19
|
-
subtype: 'xiaoe_credential_unavailable',
|
|
20
|
-
retryable: false,
|
|
21
|
-
stage: 'xiaoe_unified_login',
|
|
22
|
-
});
|
|
30
|
+
throw xiaoERecoveryFailedError();
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
if (!session) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CliError, ExitCode } from '../../core/errors.js';
|
|
2
2
|
import { classifyE10Redirect, isE10AuthenticationRequired, recoverXiaoEAuthSession, sameE10SessionIdentity, } from './auth-recovery.js';
|
|
3
3
|
import { startFetchTiming } from './fetch-timing.js';
|
|
4
|
+
import { E10_XIAOE_RECOVERY_FAILED_MESSAGE } from './auth/messages.js';
|
|
4
5
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
5
6
|
const DEFAULT_BIG_INT_STRINGS = true;
|
|
6
7
|
/** 下载直传最多跟几跳:E10 -> 对象存储通常 1 跳,留一点余量但不允许成环。 */
|
|
@@ -53,6 +54,12 @@ export class E10RequestRuntime {
|
|
|
53
54
|
return this.request({ ...request, responseType: 'binary' });
|
|
54
55
|
}
|
|
55
56
|
async request(request) {
|
|
57
|
+
if (this.session.isExpired?.()) {
|
|
58
|
+
const recovered = await this.recoverExpiredSession(this.session.eteamsId);
|
|
59
|
+
if (!recovered || this.session.isExpired?.()) {
|
|
60
|
+
throw new E10ApiError('authentication', 'session_expired', E10_XIAOE_RECOVERY_FAILED_MESSAGE, { exitCode: ExitCode.AuthError, retryable: false });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
56
63
|
const mutable = this.prepareRequest(request);
|
|
57
64
|
try {
|
|
58
65
|
await this.runBeforeRequest(mutable, this.sessionContext());
|
|
@@ -171,6 +178,8 @@ export class E10RequestRuntime {
|
|
|
171
178
|
}
|
|
172
179
|
if (!recovered)
|
|
173
180
|
return false;
|
|
181
|
+
if (recovered.isExpired?.())
|
|
182
|
+
return false;
|
|
174
183
|
if (!sameE10SessionIdentity(this.session, recovered)) {
|
|
175
184
|
throw new E10ApiError('authentication', 'session_context_changed', 'XiaoE 自动恢复后的登录身份或 E10 环境发生变化,本次请求未重试', { exitCode: ExitCode.AuthError, retryable: false });
|
|
176
185
|
}
|
|
@@ -114,6 +114,12 @@ function hashCode(text) {
|
|
|
114
114
|
}
|
|
115
115
|
return String(hash >>> 0);
|
|
116
116
|
}
|
|
117
|
+
function coworkViewUrl(baseUrl, id, mobile = false) {
|
|
118
|
+
if (!id)
|
|
119
|
+
return null;
|
|
120
|
+
const base = String(baseUrl || '').replace(/\/+$/, '');
|
|
121
|
+
return `${base}/${mobile ? 'mobile' : 'sp'}/cowork/view/${id}`;
|
|
122
|
+
}
|
|
117
123
|
function defaultEndTime() {
|
|
118
124
|
const target = new Date(Date.now() + 7 * 24 * 3600 * 1000);
|
|
119
125
|
const pad = (n) => String(n).padStart(2, '0');
|
|
@@ -203,6 +209,8 @@ const itemCreateApply = {
|
|
|
203
209
|
sectionId,
|
|
204
210
|
principal,
|
|
205
211
|
endTime,
|
|
212
|
+
viewUrl: coworkViewUrl(lease.baseUrl, data.id),
|
|
213
|
+
mobileViewUrl: coworkViewUrl(lease.baseUrl, data.id, true),
|
|
206
214
|
});
|
|
207
215
|
},
|
|
208
216
|
};
|
|
@@ -295,7 +303,7 @@ const itemActionApply = {
|
|
|
295
303
|
}
|
|
296
304
|
throw error;
|
|
297
305
|
}
|
|
298
|
-
return coworkSuccess('cowork.item.action.apply', { action, id, result: unwrapData(response) ?? null });
|
|
306
|
+
return coworkSuccess('cowork.item.action.apply', { action, id, result: unwrapData(response) ?? null, viewUrl: coworkViewUrl(lease.baseUrl, id) });
|
|
299
307
|
},
|
|
300
308
|
};
|
|
301
309
|
const ITEM_FLAGS = ['hide', 'vote'];
|
|
@@ -367,7 +375,7 @@ const itemFlagApply = {
|
|
|
367
375
|
form,
|
|
368
376
|
operation: 'cowork.item.flag.apply',
|
|
369
377
|
});
|
|
370
|
-
return coworkSuccess('cowork.item.flag.apply', { action, id, result: unwrapData(response) ?? null });
|
|
378
|
+
return coworkSuccess('cowork.item.flag.apply', { action, id, result: unwrapData(response) ?? null, viewUrl: coworkViewUrl(lease.baseUrl, id) });
|
|
371
379
|
},
|
|
372
380
|
};
|
|
373
381
|
export const coworkItemWriteOperations = [
|
|
@@ -5,6 +5,12 @@ const CONTINUATION_TTL_MS = 600_000;
|
|
|
5
5
|
function b64(s) {
|
|
6
6
|
return Buffer.from(s, 'utf8').toString('base64');
|
|
7
7
|
}
|
|
8
|
+
function mailViewUrl(baseUrl, mailResourceId) {
|
|
9
|
+
if (!mailResourceId)
|
|
10
|
+
return null;
|
|
11
|
+
const base = String(baseUrl || '').replace(/\/+$/, '');
|
|
12
|
+
return `${base}/sp/mail/view?mailResourceId=${mailResourceId}`;
|
|
13
|
+
}
|
|
8
14
|
function splitNames(s) {
|
|
9
15
|
if (!s)
|
|
10
16
|
return [];
|
|
@@ -466,9 +472,9 @@ const opSendApply = {
|
|
|
466
472
|
const value = (await env.host.request({ path, method: 'POST', body }));
|
|
467
473
|
const d = value?.data || {};
|
|
468
474
|
if (draft) {
|
|
469
|
-
return mailSuccess('mail.send.apply', { success: d.status === 1, draft: true, mailResourceId: d.mailResourceId, subject: lease.subject }, { savedDraft: true });
|
|
475
|
+
return mailSuccess('mail.send.apply', { success: d.status === 1, draft: true, mailResourceId: d.mailResourceId, subject: lease.subject, viewUrl: mailViewUrl(session.baseUrl, d.mailResourceId) }, { savedDraft: true });
|
|
470
476
|
}
|
|
471
|
-
return mailSuccess('mail.send.apply', { success: d.success === 1, msg: d.msg || '邮件已发送', subject: lease.subject }, { sent: true });
|
|
477
|
+
return mailSuccess('mail.send.apply', { success: d.success === 1, msg: d.msg || '邮件已发送', subject: lease.subject, mailResourceId: d.mailResourceId ?? null, viewUrl: mailViewUrl(session.baseUrl, d.mailResourceId) }, { sent: true });
|
|
472
478
|
},
|
|
473
479
|
};
|
|
474
480
|
export const mailSendOperations = [opSendPrepare, opSendApply];
|
|
@@ -120,8 +120,12 @@ export const EB_ENDPOINTS = [
|
|
|
120
120
|
queryParams: [
|
|
121
121
|
'mt_id', 'creator', 'mt_name', 'mt_status', 'mt_type', 'caller', 'contacter',
|
|
122
122
|
'enddatetime', 'begindatetime', 'address', 'hrmmember', 'attend_user', 'reporting_user',
|
|
123
|
-
'topic_presenter',
|
|
123
|
+
'topic_presenter',
|
|
124
124
|
],
|
|
125
|
+
// 群 id 走 body `datajson.mainTable` 精确匹配(2026-11-02 实测:按它查回 1 条,准)。
|
|
126
|
+
// ⛔ `request_id` 不能当筛选条件:接口文档里它**不是入参**,URL query 传了被忽略,
|
|
127
|
+
// 出参是「按显示名称」(返回流程标题,不是单号)—— 想按单号找会议,只能取列表再逐条 detail 比对。
|
|
128
|
+
mainTableParams: ['imchat_groupid'],
|
|
125
129
|
summary: 'EB 版会议列表(query_mtDetail_list + count):URL query 传筛选条件,body 带 datajson',
|
|
126
130
|
notes: [
|
|
127
131
|
'hrmmember 等人员参数必须传员工 id,不能传姓名文本。',
|