weaver-work-cli 0.1.44 → 0.1.45
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 +9 -5
- package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
- package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
- package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
- package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
- package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-CE3GMWTS.js} +3 -3
- package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
- package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
- package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
- package/dist/chunks/{chunk-CWYGFU5B.js → chunk-3WBIQLMB.js} +2 -2
- package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-3ZMAQQ3W.js} +161 -33
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-4EXOIQDI.js} +40 -10
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-77YP6I52.js} +1 -1
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-DGMYACGJ.js} +1 -1
- package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
- package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-JWWTI63L.js} +55 -5
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-LGKWL4OH.js} +176 -39
- package/dist/chunks/{chunk-XHK4MDR5.js → chunk-LRCPNDZA.js} +38 -6
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-LXFVWZLM.js} +4 -4
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-OAE3AZBQ.js} +11 -11
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-T4MWQAQB.js} +7 -5
- package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
- package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-VIMCY4DI.js} +5 -5
- package/dist/chunks/chunk-VRPH24IC.js +76 -0
- package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
- package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
- package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-IYJETSGT.js} +2 -2
- package/dist/chunks/continuation-GW6PRWK3.js +12 -0
- package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
- package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
- package/dist/chunks/{create-flow-J22BO65E.js → create-flow-7JLC7UID.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-MYRDCHZ4.js} +121 -49
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-3MBHAWBL.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-TZEVU4DU.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-KL3HFKRM.js} +3 -3
- package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
- package/dist/chunks/host-7NTIBSPK.js +25 -0
- package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
- package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
- package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
- package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
- package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
- package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
- package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
- package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
- package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-UH6HGK2I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-C67EHQ4Z.js} +12 -12
- package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
- package/dist/chunks/operations-J7PUIVWZ.js +15 -0
- package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
- package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
- package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
- package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-AHY5QAMF.js} +450 -117
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
- package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-XPWPGHYE.js} +10 -10
- package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-CNWE5WQK.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-YYNYBQIE.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/index.js +30 -30
- package/dist/internal/e10/auth/commands.js +32 -0
- package/dist/internal/e10/auth/error-log.js +156 -26
- package/dist/internal/e10/auth/xiaoe.js +176 -13
- package/dist/internal/e10/context.js +12 -1
- package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
- package/dist/shortcuts/archive/operations/flow-url.js +182 -22
- package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
- package/dist/shortcuts/archive/operations/prelib.js +33 -4
- package/dist/shortcuts/archive/operations/shared.js +52 -0
- package/dist/shortcuts/contract/host.js +111 -4
- package/dist/shortcuts/contract/index.js +19 -0
- package/dist/shortcuts/contract/manifest.js +125 -0
- package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
- package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
- package/dist/shortcuts/contract/operations/customer.js +192 -0
- package/dist/shortcuts/contract/operations/file-download.js +75 -0
- package/dist/shortcuts/contract/operations/flow.js +44 -2
- package/dist/shortcuts/contract/operations/form-info.js +162 -62
- package/dist/shortcuts/contract/operations/registry.js +8 -0
- package/dist/shortcuts/contract/operations/review.js +116 -1
- package/dist/shortcuts/contract/operations/summary.js +177 -0
- package/dist/shortcuts/contract/operations/upload.js +64 -4
- package/dist/shortcuts/contract/upload-cache.js +104 -0
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +4 -2
- package/dist/shortcuts/ehr/operations/recruit-position.js +136 -35
- package/dist/shortcuts/ehr/operations/recruit-write.js +17 -18
- package/dist/shortcuts/ehr/operations/recruit.js +17 -5
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +182 -58
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +58 -3
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +208 -56
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +42 -16
- package/dist/shortcuts/recruit-stage/shared.js +161 -18
- package/dist/shortcuts/workflow/index.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +8 -3
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
- package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
- package/docs/contract.md +1 -0
- package/docs/e10-auth.md +4 -2
- package/docs/todo-smart-convert/data-contract.md +7 -0
- package/package.json +1 -1
- package/skill-template/domains/jinchengda.md +2 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
- package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +5 -3
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -2
- package/skills/weaver-e10-meeting/SKILL.md +57 -9
- package/skills/weaver-e10-recruit-stage/SKILL.md +11 -6
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +3 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +7 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
- package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
- package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
- package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
- package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
- package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
- package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
- package/skills/weaver-e10-workflow/SKILL.md +19 -17
- package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
- package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
|
@@ -1562,7 +1562,7 @@ async function buildPersonnelText(env, data) {
|
|
|
1562
1562
|
if (ids.length === 0) return {};
|
|
1563
1563
|
const names = /* @__PURE__ */ new Map();
|
|
1564
1564
|
try {
|
|
1565
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
1565
|
+
const { hrmEmployeeOperations } = await import("./employee-NOHNXC46.js");
|
|
1566
1566
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
1567
1567
|
if (batch) {
|
|
1568
1568
|
const result = await batch.handler({ ids: [...new Set(ids)] }, env);
|
|
@@ -1709,7 +1709,11 @@ function buildReadInputSchema(endpoint) {
|
|
|
1709
1709
|
};
|
|
1710
1710
|
}
|
|
1711
1711
|
properties.pageNo = { type: "integer", minimum: 1, description: "\u9875\u7801\uFF0C\u9ED8\u8BA4 1" };
|
|
1712
|
-
properties.pageSize = { type: "integer", minimum: 1, maximum: 200, description: "\u6BCF\u9875\u6761\u6570\uFF0C\u9ED8\u8BA4 20" };
|
|
1712
|
+
properties.pageSize = { type: "integer", minimum: 1, maximum: 200, description: "\u6BCF\u9875\u6761\u6570\uFF0C\u9ED8\u8BA4 50\uFF08\u6CE8\u610F\uFF1A\u672C\u73AF\u5883\u670D\u52A1\u7AEF\u5355\u9875\u5B9E\u9645\u53EA\u56DE 10~20 \u6761\uFF0C\u4F20\u66F4\u5927\u4E5F\u65E0\u6548\uFF1B\u8981\u5168\u91CF\u8BF7\u4F20 all:true\uFF09" };
|
|
1713
|
+
properties.all = {
|
|
1714
|
+
type: "boolean",
|
|
1715
|
+
description: 'true = \u81EA\u52A8\u7FFB\u9875\u62C9\u5168\u91CF\uFF08\u6700\u591A 50 \u9875\uFF09\u3002\u67E5\u53F0\u8D26/\u5217\u6E05\u5355\u65F6**\u5EFA\u8BAE\u76F4\u63A5\u4F20 true**\uFF0C\u5426\u5219\u53EA\u56DE\u7B2C 1 \u9875\uFF08\u672C\u73AF\u5883\u5B9E\u6D4B 10 \u6761\uFF09\uFF0C\u5BB9\u6613\u8BEF\u5224"\u63A5\u53E3\u8BFB\u4E0D\u5168"'
|
|
1716
|
+
};
|
|
1713
1717
|
if (endpoint.countPk) {
|
|
1714
1718
|
properties.withCount = { type: "boolean", description: "\u662F\u5426\u5148\u67E5\u603B\u6570\uFF08\u9ED8\u8BA4 true\uFF0C\u6761\u4EF6\u4E0E\u5217\u8868\u4E00\u81F4\uFF09" };
|
|
1715
1719
|
}
|
|
@@ -1813,8 +1817,54 @@ function buildReadOperation(endpoint) {
|
|
|
1813
1817
|
return meetingSuccess(endpoint.operation, { data, count: rows2.length }, endpoint.notes ? { meta: { notes: endpoint.notes } } : {});
|
|
1814
1818
|
}
|
|
1815
1819
|
const pageNo = typeof args.pageNo === "number" ? args.pageNo : 1;
|
|
1816
|
-
const pageSize = typeof args.pageSize === "number" ? args.pageSize :
|
|
1820
|
+
const pageSize = typeof args.pageSize === "number" ? args.pageSize : 50;
|
|
1817
1821
|
const mainTableFilters = pickMainTableFilters(args, endpoint.mainTableParams);
|
|
1822
|
+
if (args.all === true) {
|
|
1823
|
+
const collected = [];
|
|
1824
|
+
let pages = 0;
|
|
1825
|
+
let totalKnown = 0;
|
|
1826
|
+
for (let p = 1; p <= 50; p += 1) {
|
|
1827
|
+
const pageResponse = await env.host.request({
|
|
1828
|
+
method: "POST",
|
|
1829
|
+
path,
|
|
1830
|
+
operation: endpoint.operation,
|
|
1831
|
+
query: { ...query, pageNo: p, pageSize },
|
|
1832
|
+
body: queryBody(session.userId, { pageNo: p, pageSize }, mainTableFilters),
|
|
1833
|
+
acceptBusiness
|
|
1834
|
+
});
|
|
1835
|
+
const { rows: pageRows, total: pageTotal } = extractEbRows(pageResponse);
|
|
1836
|
+
pages = p;
|
|
1837
|
+
totalKnown = Number(pageTotal ?? totalKnown) || totalKnown;
|
|
1838
|
+
if (pageRows.length === 0) break;
|
|
1839
|
+
collected.push(...pageRows);
|
|
1840
|
+
if (totalKnown > 0 && collected.length >= totalKnown) break;
|
|
1841
|
+
if (pageRows.length < 10) break;
|
|
1842
|
+
}
|
|
1843
|
+
const allRows = Object.keys(mainTableFilters).length === 0 ? collected : collected.filter((row) => {
|
|
1844
|
+
const main = row?.mainTable ?? row ?? {};
|
|
1845
|
+
return Object.entries(mainTableFilters).every(([key, value]) => {
|
|
1846
|
+
const cell = main[key];
|
|
1847
|
+
return cell !== void 0 && cell !== null && String(cell).includes(String(value));
|
|
1848
|
+
});
|
|
1849
|
+
});
|
|
1850
|
+
return meetingSuccess(
|
|
1851
|
+
endpoint.operation,
|
|
1852
|
+
{
|
|
1853
|
+
total: allRows.length,
|
|
1854
|
+
pageNo: 1,
|
|
1855
|
+
pageSize: allRows.length,
|
|
1856
|
+
count: allRows.length,
|
|
1857
|
+
pagesFetched: pages,
|
|
1858
|
+
all: true,
|
|
1859
|
+
rows: allRows,
|
|
1860
|
+
filters: { ...query, ...mainTableFilters }
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
...endpoint.notes ? { meta: { notes: endpoint.notes } } : {},
|
|
1864
|
+
...allRows.length === 0 && endpoint.emptyHint ? { warnings: [endpoint.emptyHint] } : {}
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
1867
|
+
}
|
|
1818
1868
|
let total;
|
|
1819
1869
|
if (endpoint.countPk && args.withCount !== false) {
|
|
1820
1870
|
const countResponse = await env.host.request({
|
|
@@ -2176,7 +2226,7 @@ function buildWriteInputSchema(endpoint, includeConfirm) {
|
|
|
2176
2226
|
}
|
|
2177
2227
|
async function lookupEmployeeDepartmentId(env, userId) {
|
|
2178
2228
|
try {
|
|
2179
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
2229
|
+
const { hrmEmployeeOperations } = await import("./employee-NOHNXC46.js");
|
|
2180
2230
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
2181
2231
|
if (!batch) return null;
|
|
2182
2232
|
const result = await batch.handler({ ids: [userId] }, env);
|
|
@@ -2285,7 +2335,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
|
|
|
2285
2335
|
);
|
|
2286
2336
|
}
|
|
2287
2337
|
if (endpoint.interfacePk === "create_meeting") {
|
|
2288
|
-
const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-
|
|
2338
|
+
const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-IYJETSGT.js");
|
|
2289
2339
|
assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
|
|
2290
2340
|
}
|
|
2291
2341
|
const pkQuery = writePkQuery(endpoint, payload);
|
|
@@ -3,20 +3,21 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
dayOf,
|
|
5
5
|
filterUsages,
|
|
6
|
+
inferRoomFloor,
|
|
6
7
|
invalidateDayUsages,
|
|
7
8
|
loadDayUsages,
|
|
8
9
|
loadRooms,
|
|
9
10
|
recommendRooms
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4EXOIQDI.js";
|
|
11
12
|
import {
|
|
12
13
|
cacheScopeSuffix,
|
|
13
14
|
readCache,
|
|
14
15
|
writeCache
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DGMYACGJ.js";
|
|
16
17
|
import {
|
|
17
18
|
fetchEbAppSettings,
|
|
18
19
|
findCommonFreeSlots
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LXFVWZLM.js";
|
|
20
21
|
import {
|
|
21
22
|
EB_BASE,
|
|
22
23
|
SCHEMA_DATETIME_MINUTE,
|
|
@@ -25,7 +26,7 @@ import {
|
|
|
25
26
|
meetingValidationError,
|
|
26
27
|
schemaOf,
|
|
27
28
|
writeBody
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JWWTI63L.js";
|
|
29
30
|
import {
|
|
30
31
|
CONTINUATION_TTL_MS,
|
|
31
32
|
CONTINUATION_TTL_SECONDS
|
|
@@ -76,15 +77,62 @@ function pickRememberedFlow(launchable, remembered) {
|
|
|
76
77
|
return launchable.find((probe) => probe.workflowId === remembered.workflowId) ?? null;
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
// src/shortcuts/meeting/operations/eb/draft-memory.ts
|
|
81
|
+
var DRAFT_TTL_MS = 30 * 60 * 1e3;
|
|
82
|
+
var MAX_DRAFTS = 30;
|
|
83
|
+
function draftKey(scope, userId) {
|
|
84
|
+
return `draft-v1-${scope}-${userId}`;
|
|
85
|
+
}
|
|
86
|
+
function normName(name) {
|
|
87
|
+
return name.trim().replace(/\s+/g, "\xA4");
|
|
88
|
+
}
|
|
89
|
+
async function loadAll(env) {
|
|
90
|
+
const session = await env.host.getSession();
|
|
91
|
+
const userId = String(session?.userId ?? "").trim();
|
|
92
|
+
const key = draftKey(await cacheScopeSuffix(env), userId);
|
|
93
|
+
const hit = await readCache(env, key, { ttlMs: DRAFT_TTL_MS * 2 });
|
|
94
|
+
const now = Date.now();
|
|
95
|
+
const all = {};
|
|
96
|
+
for (const [name, draft] of Object.entries(hit?.data ?? {})) {
|
|
97
|
+
if (draft && now - Number(draft.updatedAt || 0) <= DRAFT_TTL_MS) all[name] = draft;
|
|
98
|
+
}
|
|
99
|
+
return { key, all };
|
|
100
|
+
}
|
|
101
|
+
async function loadMeetingDraft(env, mtName) {
|
|
102
|
+
const name = normName(mtName);
|
|
103
|
+
if (!name) return null;
|
|
104
|
+
const { all } = await loadAll(env);
|
|
105
|
+
return all[name] ?? null;
|
|
106
|
+
}
|
|
107
|
+
async function saveMeetingDraft(env, draft) {
|
|
108
|
+
const name = normName(draft.mtName);
|
|
109
|
+
if (!name || !draft.begin) return;
|
|
110
|
+
const { key, all } = await loadAll(env);
|
|
111
|
+
all[name] = { ...draft, updatedAt: Date.now() };
|
|
112
|
+
const names = Object.keys(all);
|
|
113
|
+
if (names.length > MAX_DRAFTS) {
|
|
114
|
+
names.sort((a, b) => all[a].updatedAt - all[b].updatedAt).slice(0, names.length - MAX_DRAFTS).forEach((old) => delete all[old]);
|
|
115
|
+
}
|
|
116
|
+
await writeCache(env, key, all);
|
|
117
|
+
}
|
|
118
|
+
async function clearMeetingDraft(env, mtName) {
|
|
119
|
+
const name = normName(mtName);
|
|
120
|
+
if (!name) return;
|
|
121
|
+
const { key, all } = await loadAll(env);
|
|
122
|
+
if (!all[name]) return;
|
|
123
|
+
delete all[name];
|
|
124
|
+
await writeCache(env, key, all);
|
|
125
|
+
}
|
|
126
|
+
|
|
79
127
|
// src/shortcuts/meeting/operations/eb/person-cache.ts
|
|
80
|
-
var PERSON_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
128
|
+
var PERSON_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
81
129
|
var BATCH_MAX = 100;
|
|
82
130
|
function personKey(scope) {
|
|
83
131
|
return `person-v1-${scope}`;
|
|
84
132
|
}
|
|
85
133
|
async function readAll(env) {
|
|
86
134
|
const scope = await cacheScopeSuffix(env);
|
|
87
|
-
const hit = await readCache(env, personKey(scope), { ttlMs: PERSON_TTL_MS *
|
|
135
|
+
const hit = await readCache(env, personKey(scope), { ttlMs: PERSON_TTL_MS * 2 });
|
|
88
136
|
if (!hit) return {};
|
|
89
137
|
const now = Date.now();
|
|
90
138
|
const fresh = {};
|
|
@@ -116,7 +164,7 @@ async function resolvePersonsCached(env, ids, options = {}) {
|
|
|
116
164
|
for (let index = 0; index < missing.length; index += BATCH_MAX) {
|
|
117
165
|
const chunk = missing.slice(index, index + BATCH_MAX);
|
|
118
166
|
try {
|
|
119
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
167
|
+
const { hrmEmployeeOperations } = await import("./employee-NOHNXC46.js");
|
|
120
168
|
const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
|
|
121
169
|
if (!batch) break;
|
|
122
170
|
const result = await batch.handler({ ids: chunk }, env);
|
|
@@ -178,9 +226,9 @@ function workflowEnv(env) {
|
|
|
178
226
|
return env;
|
|
179
227
|
}
|
|
180
228
|
async function loadCreateForm(env, workflowId) {
|
|
181
|
-
const { createWorkflowHost } = await import("./host-
|
|
229
|
+
const { createWorkflowHost } = await import("./host-TUOIOEMC.js");
|
|
182
230
|
const { createWorkflowContinuationSigner } = await import("./continuation-HFW2YT5S.js");
|
|
183
|
-
const { getWorkflowOperation } = await import("./registry-
|
|
231
|
+
const { getWorkflowOperation } = await import("./registry-AQVGHUM6.js");
|
|
184
232
|
const wfEnv = {
|
|
185
233
|
...workflowEnv(env),
|
|
186
234
|
host: createWorkflowHost(env.ctx),
|
|
@@ -222,7 +270,7 @@ async function resolvePersonTokens(env, tokens) {
|
|
|
222
270
|
}
|
|
223
271
|
if (nameLike.length > 0) {
|
|
224
272
|
try {
|
|
225
|
-
const { hrmEmployeeOperations } = await import("./employee-
|
|
273
|
+
const { hrmEmployeeOperations } = await import("./employee-NOHNXC46.js");
|
|
226
274
|
const query = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.query");
|
|
227
275
|
for (const name of nameLike) {
|
|
228
276
|
if (!query) break;
|
|
@@ -285,7 +333,7 @@ async function resolveAddressRoom(env, input) {
|
|
|
285
333
|
const text = String(input ?? "").trim();
|
|
286
334
|
if (!text) return null;
|
|
287
335
|
const ref = parseRoomRef(text);
|
|
288
|
-
const { loadRooms: loadRooms2 } = await import("./room-recommend-
|
|
336
|
+
const { loadRooms: loadRooms2 } = await import("./room-recommend-CNWE5WQK.js");
|
|
289
337
|
let rooms = [];
|
|
290
338
|
try {
|
|
291
339
|
rooms = (await loadRooms2(env, {})).rooms;
|
|
@@ -307,7 +355,7 @@ async function resolveRoomValue(env, input) {
|
|
|
307
355
|
const ref = parseRoomRef(text);
|
|
308
356
|
if (ref.id) {
|
|
309
357
|
try {
|
|
310
|
-
const { getMeetingOperation } = await import("./registry-
|
|
358
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
311
359
|
const detail = await getMeetingOperation("meeting.eb.room.detail").handler({ id: ref.id }, env);
|
|
312
360
|
const main = detail?.data?.mainTable ?? detail?.data?.data?.mainTable ?? {};
|
|
313
361
|
const name = String(main.room_name ?? "").trim() || ref.name || "";
|
|
@@ -419,7 +467,7 @@ async function shapeBrowserValues(env, values) {
|
|
|
419
467
|
const nameOnly = rows.filter((row) => row.id === "" && row.name !== "");
|
|
420
468
|
if (nameOnly.length > 0) {
|
|
421
469
|
try {
|
|
422
|
-
const { getMeetingOperation } = await import("./registry-
|
|
470
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
423
471
|
const search = getMeetingOperation("meeting.eb.crm.search");
|
|
424
472
|
for (const row of nameOnly) {
|
|
425
473
|
const found = await search.handler({ keyword: row.name, limit: 5 }, env).catch(() => null);
|
|
@@ -613,7 +661,7 @@ async function resolveAutoCrmDetailRows(env, raw) {
|
|
|
613
661
|
const missing = [];
|
|
614
662
|
if (entries.length > 0) {
|
|
615
663
|
try {
|
|
616
|
-
const { getMeetingOperation } = await import("./registry-
|
|
664
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
617
665
|
const search = getMeetingOperation("meeting.eb.crm.search");
|
|
618
666
|
for (const entry of entries) {
|
|
619
667
|
if (entry.contacts.length > 0) continue;
|
|
@@ -872,7 +920,7 @@ function shouldAutoPickFlow(args) {
|
|
|
872
920
|
async function sendInvitationToGroup(env, groupId, filePath, warnings) {
|
|
873
921
|
const started = Date.now();
|
|
874
922
|
try {
|
|
875
|
-
const { buildImEnv } = await import("./group-chat-
|
|
923
|
+
const { buildImEnv } = await import("./group-chat-KL3HFKRM.js");
|
|
876
924
|
const { getImOperation } = await import("./registry-PVUZQDDQ.js");
|
|
877
925
|
const imEnv = await buildImEnv(env);
|
|
878
926
|
const prepared = await getImOperation("im.msg.send.group.prepare").handler(
|
|
@@ -985,7 +1033,9 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
985
1033
|
description: "\u7ED3\u675F\u65F6\u95F4\uFF08yyyy-MM-dd HH:mm\uFF09\uFF1B\u4E0D\u4F20\u5219\u6309 durationMinutes \u4ECE\u5F00\u59CB\u65F6\u95F4\u63A8\u7B97\uFF08\u9ED8\u8BA4 60 \u5206\u949F\uFF09"
|
|
986
1034
|
},
|
|
987
1035
|
mt_desc: { type: "string", description: "\u4F1A\u8BAE\u5185\u5BB9/\u8BF4\u660E" },
|
|
988
|
-
address: { type: "string", description:
|
|
1036
|
+
address: { type: "string", description: '\u4F1A\u8BAE\u5BA4\uFF08\u540D\u79F0\u6216 id\uFF09\uFF1B\u4E5F\u53EF\u76F4\u63A5\u5199\u697C\u5C42\uFF08"\u4E00\u697C/1F/3\u5C42"\uFF09\uFF0CCLI \u4F1A\u6309\u697C\u5C42\u7ED9\u5019\u9009' },
|
|
1037
|
+
floor: { type: "number", description: "\u697C\u5C42\uFF081=\u4E00\u697C\uFF09\uFF1A\u548C address \u4E8C\u9009\u4E00\uFF0C\u6309\u540D\u79F0\u63A8\u65AD\u697C\u5C42\u8FC7\u6EE4\u5019\u9009\uFF08120\u4F1A\u8BAE\u5BA4=1\u697C\u30011007=10\u697C\uFF09" },
|
|
1038
|
+
askRoom: { type: "boolean", description: "\u9ED8\u8BA4 false\uFF1A\u4E0D\u6307\u5B9A\u5730\u70B9\u65F6 CLI \u76F4\u63A5\u6309\u63A8\u8350\u7B97\u6CD5\u5B9A\u4E00\u95F4\uFF1B\u4F20 true \u624D\u8FD4\u56DE\u5019\u9009\u8BA9\u7528\u6237\u6311" },
|
|
989
1039
|
customize_address: { type: "string", description: "\u81EA\u5B9A\u4E49\u4F1A\u8BAE\u5730\u70B9" },
|
|
990
1040
|
hrm_members: { type: "string", description: "\u53C2\u4F1A\u4EBA\u5458\uFF08\u9017\u53F7\u5206\u9694\u5458\u5DE5 id \u6216\u59D3\u540D\uFF0C\u6309\u6D41\u7A0B\u8868\u5355\u8981\u6C42\uFF09" },
|
|
991
1041
|
total_member: { type: "number", description: "\u53C2\u4F1A\u4EBA\u6570" },
|
|
@@ -1116,9 +1166,23 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1116
1166
|
}
|
|
1117
1167
|
}
|
|
1118
1168
|
const nameLike = rawMembers.filter((item) => !/^\d+$/.test(item));
|
|
1119
|
-
const nameToId = nameLike.length > 0 ? await import("./schedule-
|
|
1169
|
+
const nameToId = nameLike.length > 0 ? await import("./schedule-YYNYBQIE.js").then((m) => m.resolveMemberIdsByName(env, nameLike)).catch(() => /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
1120
1170
|
const memberIds = rawMembers.map((item) => nameToId.get(item) ?? item);
|
|
1121
|
-
|
|
1171
|
+
let timeConfirmed = args.timeConfirmed === true || slotConfirmed;
|
|
1172
|
+
const draft = await loadMeetingDraft(env, String(args.mt_name ?? "")).catch(() => null);
|
|
1173
|
+
let draftReusedTime = false;
|
|
1174
|
+
if (draft) {
|
|
1175
|
+
if (!/\d{1,2}:\d{2}/.test(beginText) && draft.begin) {
|
|
1176
|
+
beginText = draft.begin;
|
|
1177
|
+
endText = draft.end;
|
|
1178
|
+
timeConfirmed = true;
|
|
1179
|
+
slotConfirmed = true;
|
|
1180
|
+
draftReusedTime = true;
|
|
1181
|
+
} else if (beginText === draft.begin && endText === draft.end && args.timeConfirmed !== true) {
|
|
1182
|
+
timeConfirmed = true;
|
|
1183
|
+
draftReusedTime = true;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1122
1186
|
const callerWorkflowId = String(args.workflowId ?? "").trim();
|
|
1123
1187
|
const earlyWorkflowNote = callerWorkflowId === "" ? "" : `\u26D4 \u4F60\u4F20\u4E86 workflowId=${callerWorkflowId}\uFF0C\u4F46**\u6D41\u7A0B\u8FD8\u6CA1\u5230\u786E\u8BA4\u6B65\u9AA4**\uFF08\u987A\u5E8F\u662F \u540D\u79F0\u2192\u65F6\u95F4\u2192\u53C2\u4F1A\u4EBA\u2192\u5730\u70B9\u2192\u6D41\u7A0B\uFF09\u3002\u672C\u6B21\u53EA\u5904\u7406\u65F6\u95F4/\u5730\u70B9\uFF1B\u26D4 \u4E0D\u8981\u5728\u56DE\u590D\u91CC\u8BF4"\u6309 X \u6D41\u7A0B\u53D1\u8D77"\u2014\u2014\u56DB\u8981\u7D20\u5B9A\u5B8C\u540E CLI \u4F1A\u8FD4\u56DE\u6D41\u7A0B\u9009\u9879\u8BA9\u7528\u6237\u70B9\u3002`;
|
|
1124
1188
|
const beginHasTime = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/.test(beginText);
|
|
@@ -1131,7 +1195,7 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1131
1195
|
if (!beginHasTime || !timeConfirmed) {
|
|
1132
1196
|
const day2 = /^\d{4}-\d{2}-\d{2}/.test(beginText) ? beginText.slice(0, 10) : String(args.dateFrom ?? "").trim().slice(0, 10) || tomorrowIso();
|
|
1133
1197
|
const duration = Number(args.durationMinutes) > 0 ? Math.round(Number(args.durationMinutes)) : 60;
|
|
1134
|
-
const { getMeetingOperation } = await import("./registry-
|
|
1198
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
1135
1199
|
const suggested = await getMeetingOperation("meeting.eb.meeting.create.suggest").handler(
|
|
1136
1200
|
{
|
|
1137
1201
|
dateFrom: day2,
|
|
@@ -1188,6 +1252,11 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1188
1252
|
});
|
|
1189
1253
|
}
|
|
1190
1254
|
let addressInput = args.address;
|
|
1255
|
+
let draftReusedRoom = false;
|
|
1256
|
+
if (String(addressInput ?? "").trim() === "" && draft?.addressId) {
|
|
1257
|
+
addressInput = draft.addressId;
|
|
1258
|
+
draftReusedRoom = true;
|
|
1259
|
+
}
|
|
1191
1260
|
const hadAddressInput = String(args.address ?? "").trim() !== "";
|
|
1192
1261
|
const day = beginText.slice(0, 10);
|
|
1193
1262
|
const durationMinutes = beginText && endText ? Math.max(15, Math.round((Date.parse(endText.replace(" ", "T")) - Date.parse(beginText.replace(" ", "T"))) / 6e4) || 60) : 60;
|
|
@@ -1219,6 +1288,8 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1219
1288
|
);
|
|
1220
1289
|
const hasCustomer = (Array.isArray(args.crm_members) ? args.crm_members.length > 0 : String(args.crm_members ?? "").trim() !== "") || Boolean(crmMentionedInText) || customerWords;
|
|
1221
1290
|
const dayUsagesTask = enrich && beginText && endText ? loadDayUsages(env, day) : Promise.resolve(null);
|
|
1291
|
+
const floorArg = Number.isFinite(Number(args.floor)) ? Number(args.floor) : null;
|
|
1292
|
+
const floorHint = floorArg ?? (/楼|层|\d+\s*F/iu.test(String(args.address ?? "")) ? inferRoomFloor(String(args.address ?? "")) : null);
|
|
1222
1293
|
const roomTask = enrich && beginText && endText ? (async () => {
|
|
1223
1294
|
const usageData = await dayUsagesTask;
|
|
1224
1295
|
return recommendRooms(env, {
|
|
@@ -1227,6 +1298,8 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1227
1298
|
...roomMemberCount ? { memberCount: roomMemberCount } : {},
|
|
1228
1299
|
// 带客户时优先接待类会议室(2026-11-02 用户口径:加了客户就推接待类)
|
|
1229
1300
|
...hasCustomer ? { hasCustomer: true } : {},
|
|
1301
|
+
// 「一楼」这类楼层诉求:按楼层过滤候选(2026-11-06)
|
|
1302
|
+
...floorHint !== null ? { floor: Number(floorHint) } : {},
|
|
1230
1303
|
// 2026-11-03 用户批准松绑:不再每次强制重拉台账(省 ~1s + 2 请求)。
|
|
1231
1304
|
// 兜底在 recommendRooms 内部:24h 缓存凑不出候选时自动强制重拉一次再算;
|
|
1232
1305
|
// 代价是刚导入的会议室在缓存期可能按名称查不到(按 id 指定不受影响)。
|
|
@@ -1235,9 +1308,39 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1235
1308
|
...usageData ? { dayUsages: usageData.rows } : {}
|
|
1236
1309
|
});
|
|
1237
1310
|
})().catch(noteFailure("\u4F1A\u8BAE\u5BA4\u63A8\u8350")) : Promise.resolve(null);
|
|
1311
|
+
let floorAutoPick = null;
|
|
1312
|
+
if (floorHint !== null && String(addressInput ?? "").trim() !== "") {
|
|
1313
|
+
const floorRec = await roomTask.catch(() => null);
|
|
1314
|
+
const first = floorRec?.candidates?.[0] ?? floorRec?.best ?? null;
|
|
1315
|
+
if (first?.id) {
|
|
1316
|
+
addressInput = first.id;
|
|
1317
|
+
floorAutoPick = { id: String(first.id), name: String(first.name ?? ""), ...Array.isArray(first.reasons) ? { reasons: first.reasons } : {} };
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
let autoPickedRoom = null;
|
|
1321
|
+
if (floorAutoPick === null && String(addressInput ?? "").trim() === "" && args.allowNoRoom !== true && args.askRoom !== true) {
|
|
1322
|
+
const rec = await roomTask.catch(() => null);
|
|
1323
|
+
const first = rec?.best ?? rec?.candidates?.[0] ?? null;
|
|
1324
|
+
if (first?.id) {
|
|
1325
|
+
addressInput = first.id;
|
|
1326
|
+
autoPickedRoom = { id: String(first.id), name: String(first.name ?? ""), ...Array.isArray(first.reasons) ? { reasons: first.reasons } : {} };
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1238
1329
|
const addressId = String(addressInput ?? "").trim();
|
|
1239
|
-
const roomConfirmed = args.roomConfirmed === true;
|
|
1240
|
-
const
|
|
1330
|
+
const roomConfirmed = args.roomConfirmed === true || draftReusedRoom || floorAutoPick !== null || autoPickedRoom !== null;
|
|
1331
|
+
const checksKey = `${beginText}|${endText}|${memberIds.join(",")}|${addressId}`;
|
|
1332
|
+
const checkNotices = [];
|
|
1333
|
+
const cachedChecks = draft?.checks && draft.checks.key === checksKey && Date.now() - Number(draft.checks.checkedAt || 0) <= 3 * 60 * 1e3 ? draft.checks : null;
|
|
1334
|
+
if (cachedChecks) {
|
|
1335
|
+
checkNotices.push(
|
|
1336
|
+
`\u7A7A\u95F2\u6821\u9A8C\u6CBF\u7528 ${Math.round((Date.now() - cachedChecks.checkedAt) / 1e3)} \u79D2\u524D\u7684\u7ED3\u8BBA\uFF08\u65F6\u95F4/\u53C2\u4F1A\u4EBA/\u4F1A\u8BAE\u5BA4\u90FD\u6CA1\u53D8\uFF0C\u672A\u91CD\u590D\u67E5\u8BE2\uFF09\u3002`
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
const roomConflictTask = cachedChecks ? Promise.resolve({
|
|
1340
|
+
room: cachedChecks.roomRecord,
|
|
1341
|
+
hasConflict: cachedChecks.roomHasConflict === true,
|
|
1342
|
+
conflicts: cachedChecks.roomConflicts ?? []
|
|
1343
|
+
}) : enrich && beginText && endText && addressId !== "" ? (async () => {
|
|
1241
1344
|
const room = await resolveAddressRoom(env, addressId);
|
|
1242
1345
|
if (!room) return { unresolved: true, input: addressId };
|
|
1243
1346
|
if (!room.id || room.lookupFailed || room.status !== "0") return { room };
|
|
@@ -1253,21 +1356,24 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1253
1356
|
usageFromCache: usageData.fromCache
|
|
1254
1357
|
};
|
|
1255
1358
|
}
|
|
1256
|
-
const { getMeetingOperation } = await import("./registry-
|
|
1359
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
1257
1360
|
const result = await getMeetingOperation("meeting.eb.conflict.room").handler(
|
|
1258
1361
|
{ beginDatetime: beginText, endDatetime: endText, address: room.id },
|
|
1259
1362
|
env
|
|
1260
1363
|
);
|
|
1261
1364
|
return { room, ...result?.data ?? {} };
|
|
1262
1365
|
})().catch(noteFailure("\u4F1A\u8BAE\u5BA4**\u5360\u7528**\u68C0\u6D4B")) : Promise.resolve(null);
|
|
1263
|
-
const conflictTask = enrich && beginText && endText && memberIds.length > 0 ? (async () => {
|
|
1264
|
-
const { getMeetingOperation } = await import("./registry-
|
|
1366
|
+
const conflictTask = cachedChecks ? Promise.resolve({ data: { conflicts: cachedChecks.memberConflicts } }) : enrich && beginText && endText && memberIds.length > 0 ? (async () => {
|
|
1367
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
1265
1368
|
return getMeetingOperation("meeting.eb.conflict.member").handler(
|
|
1266
1369
|
{ beginDatetime: beginText, endDatetime: endText, hrmMembers: memberIds.join(",") },
|
|
1267
1370
|
env
|
|
1268
1371
|
);
|
|
1269
1372
|
})().catch(noteFailure("\u53C2\u4F1A\u4EBA**\u4F1A\u8BAE\u5360\u7528**\u68C0\u6D4B")) : Promise.resolve(null);
|
|
1270
|
-
const availabilityTask =
|
|
1373
|
+
const availabilityTask = cachedChecks ? Promise.resolve({
|
|
1374
|
+
slots: cachedChecks.freeSlots,
|
|
1375
|
+
...cachedChecks.blockingSummary ? { blockingSummary: cachedChecks.blockingSummary } : {}
|
|
1376
|
+
}) : enrich && beginText && endText && memberIds.length > 0 ? findCommonFreeSlots(env, {
|
|
1271
1377
|
rangeStart: `${day} 00:00`,
|
|
1272
1378
|
rangeEnd: `${day} 23:59`,
|
|
1273
1379
|
durationMinutes,
|
|
@@ -1327,7 +1433,7 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1327
1433
|
status: "NEEDS_SELECTION",
|
|
1328
1434
|
selectionType: "room",
|
|
1329
1435
|
ui: { component: "choice", multiple: false, recommendedKey: "R1" },
|
|
1330
|
-
message: `\u6CA1\u627E\u5230\u540D\u4E3A\u300C${addressId}\u300D\u7684\u4F1A\u8BAE\u5BA4\uFF08\u4F1A\u8BAE\u5BA4\u53F0\u8D26\u91CC\u6CA1\u6709\u8FD9\u4E2A\u540D\u5B57\uFF09\uFF0C\u672C\u6B21**\u6CA1\u6709\u63D0\u4EA4**\u3002` + (roomOptions.length > 0 ? `\u8BF7\u4ECE\u4E0B\u9762 ${roomOptions.length} \u4E2A\u5728\u8BE5\u65F6\u6BB5\u7A7A\u95F2\u7684\u4F1A\u8BAE\u5BA4\u91CC\u9009\u4E00\u95F4\uFF0C\u6216\u6838\u5BF9\u4E00\u4E0B\u4F1A\u8BAE\u5BA4\u540D\u79F0` : "\u8BE5\u65F6\u6BB5\u4E5F\u6CA1\u6709\u53EF\u7528\u7684\u7A7A\u95F2\u4F1A\u8BAE\u5BA4\uFF0C\u8BF7\u6539\u4F1A\u8BAE\u65F6\u95F4\u6216\u6539\u7EBF\u4E0A\u4F1A\u8BAE\uFF08allowNoRoom: true\uFF09"),
|
|
1436
|
+
message: floorHint !== null ? `\u300C${addressId}\u300D\u662F\u697C\u5C42\uFF0C\u4E0D\u662F\u623F\u95F4\u540D\uFF1B\u4E0B\u9762\u662F ${floorHint} \u697C\u5728\u8BE5\u65F6\u6BB5\u7A7A\u95F2\u7684\u4F1A\u8BAE\u5BA4\uFF0C\u8BF7\u9009\u4E00\u95F4` + (roomOptions.length > 0 ? "" : "\uFF08\u8BE5\u697C\u5C42\u6682\u65F6\u6CA1\u6709\u7A7A\u95F2\u4F1A\u8BAE\u5BA4\uFF0C\u8BF7\u6539\u697C\u5C42\u6216\u65F6\u95F4\uFF09") : `\u6CA1\u627E\u5230\u540D\u4E3A\u300C${addressId}\u300D\u7684\u4F1A\u8BAE\u5BA4\uFF08\u4F1A\u8BAE\u5BA4\u53F0\u8D26\u91CC\u6CA1\u6709\u8FD9\u4E2A\u540D\u5B57\uFF09\uFF0C\u672C\u6B21**\u6CA1\u6709\u63D0\u4EA4**\u3002` + (roomOptions.length > 0 ? `\u8BF7\u4ECE\u4E0B\u9762 ${roomOptions.length} \u4E2A\u5728\u8BE5\u65F6\u6BB5\u7A7A\u95F2\u7684\u4F1A\u8BAE\u5BA4\u91CC\u9009\u4E00\u95F4\uFF0C\u6216\u6838\u5BF9\u4E00\u4E0B\u4F1A\u8BAE\u5BA4\u540D\u79F0` : "\u8BE5\u65F6\u6BB5\u4E5F\u6CA1\u6709\u53EF\u7528\u7684\u7A7A\u95F2\u4F1A\u8BAE\u5BA4\uFF0C\u8BF7\u6539\u4F1A\u8BAE\u65F6\u95F4\u6216\u6539\u7EBF\u4E0A\u4F1A\u8BAE\uFF08allowNoRoom: true\uFF09"),
|
|
1331
1437
|
workflowPending: true,
|
|
1332
1438
|
options: roomOptions,
|
|
1333
1439
|
recommended: roomOptions[0]?.value ?? null,
|
|
@@ -1625,7 +1731,7 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1625
1731
|
const preferredFields = await readFlowFieldMap(env, workflowId);
|
|
1626
1732
|
const { main, mapped, unmapped, resolved: resolvedFields } = mapFields(form.fields, shaped.values, preferredFields);
|
|
1627
1733
|
await writeFlowFieldMap(env, workflowId, form.workflowName, resolvedFields);
|
|
1628
|
-
const warnings = [];
|
|
1734
|
+
const warnings = [...checkNotices];
|
|
1629
1735
|
if (autoFilledPerson.length > 0) {
|
|
1630
1736
|
const labels = autoFilledPerson.map((one) => `\u300C${PERSON_FIELD_LABELS[one.field]}\u300D`).join("");
|
|
1631
1737
|
warnings.push(
|
|
@@ -1730,9 +1836,19 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1730
1836
|
}
|
|
1731
1837
|
}
|
|
1732
1838
|
const picked = decisions.autoRoom?.picked;
|
|
1839
|
+
if (floorAutoPick) {
|
|
1840
|
+
warnings.push(
|
|
1841
|
+
`\u6309\u697C\u5C42\u81EA\u52A8\u9009\u62E9\u300C${floorAutoPick.name}\u300D\uFF08${(floorAutoPick.reasons ?? []).join("\uFF1B")}\uFF09\uFF1B\u540C\u4E00\u697C\u5C42\u8FD8\u6709\u5176\u5B83\u7A7A\u95F2\u623F\u95F4\uFF0C\u5982\u9700\u66F4\u6362\u76F4\u63A5\u8BF4\u623F\u95F4\u540D`
|
|
1842
|
+
);
|
|
1843
|
+
}
|
|
1844
|
+
if (autoPickedRoom) {
|
|
1845
|
+
warnings.push(
|
|
1846
|
+
`\u672A\u6307\u5B9A\u4F1A\u8BAE\u5BA4 \u2192 \u6309\u63A8\u8350\u9009\u62E9\u300C${autoPickedRoom.name}\u300D\uFF08${(autoPickedRoom.reasons ?? []).join("\uFF1B")}\uFF09\uFF1B\u5982\u9700\u66F4\u6362\u76F4\u63A5\u8BF4\u623F\u95F4\u540D\uFF0C\u6216\u4F20 \`askRoom: true\` \u8BA9 CLI \u8FD4\u56DE\u5019\u9009`
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1733
1849
|
if (picked && !hadAddressInput) {
|
|
1734
1850
|
warnings.push(
|
|
1735
|
-
`\u672A\u6307\u5B9A\u4F1A\u8BAE\u5BA4 \u2192 \u5DF2\u81EA\u52A8\u9009\u62E9\u300C${picked.name}\u300D\uFF08${(picked.reasons ?? []).join("\uFF1B")}\uFF09\uFF1B\u53E6\u6709\u5019\u9009 ${(decisions.roomOptions ?? []).slice(1).map((item) => item.label).join(" / ") || "\u65E0"}`
|
|
1851
|
+
draftReusedRoom ? `\u4F1A\u8BAE\u5730\u70B9\u6CBF\u7528\u4F60\u4E0A\u6B21\u786E\u8BA4\u7684\u300C${picked.name}\u300D\uFF08\u672C\u6B21\u6CA1\u518D\u4F20\u4F1A\u8BAE\u5BA4\uFF09\uFF1B\u5982\u9700\u66F4\u6362\u8BF7\u76F4\u63A5\u8BF4\u623F\u95F4\u540D` : `\u672A\u6307\u5B9A\u4F1A\u8BAE\u5BA4 \u2192 \u5DF2\u81EA\u52A8\u9009\u62E9\u300C${picked.name}\u300D\uFF08${(picked.reasons ?? []).join("\uFF1B")}\uFF09\uFF1B\u53E6\u6709\u5019\u9009 ${(decisions.roomOptions ?? []).slice(1).map((item) => item.label).join(" / ") || "\u65E0"}`
|
|
1736
1852
|
);
|
|
1737
1853
|
}
|
|
1738
1854
|
const slotOptions = decisions.slotOptions ?? [];
|
|
@@ -1805,6 +1921,26 @@ var ebMeetingCreateFlowPrepare = {
|
|
|
1805
1921
|
},
|
|
1806
1922
|
CONTINUATION_TTL_MS
|
|
1807
1923
|
);
|
|
1924
|
+
await saveMeetingDraft(env, {
|
|
1925
|
+
mtName: String(args.mt_name ?? args.mt_subject ?? ""),
|
|
1926
|
+
begin: beginText,
|
|
1927
|
+
end: endText,
|
|
1928
|
+
...addressId !== "" ? { addressId, addressName: confirmedAddressLabel } : {},
|
|
1929
|
+
memberIds,
|
|
1930
|
+
// 校验结论一并记住:下一轮同样时间/参会人直接复用(3 分钟内)
|
|
1931
|
+
checks: cachedChecks ?? {
|
|
1932
|
+
key: checksKey,
|
|
1933
|
+
checkedAt: Date.now(),
|
|
1934
|
+
addressKey: addressId,
|
|
1935
|
+
memberConflicts,
|
|
1936
|
+
freeSlots: freeSlots.map((slot) => ({ begin: slot.begin, end: slot.end })),
|
|
1937
|
+
...free?.blockingSummary ? { blockingSummary: String(free.blockingSummary) } : {},
|
|
1938
|
+
// 会议室占用结论一起记:下一轮同房同时段直接复用(用户 2026-11-06 明确要求)
|
|
1939
|
+
roomHasConflict: roomConflictData?.hasConflict === true,
|
|
1940
|
+
roomConflicts: Array.isArray(roomConflictData?.conflicts) ? roomConflictData.conflicts : [],
|
|
1941
|
+
...roomConflictData?.room ? { roomRecord: roomConflictData.room } : {}
|
|
1942
|
+
}
|
|
1943
|
+
}).catch(() => void 0);
|
|
1808
1944
|
return meetingSuccess(
|
|
1809
1945
|
"meeting.eb.meeting.create.flow.prepare",
|
|
1810
1946
|
{
|
|
@@ -1869,7 +2005,7 @@ async function patchMeetingCrmMembers(env, meetingId, ids, count, settleMsList =
|
|
|
1869
2005
|
});
|
|
1870
2006
|
};
|
|
1871
2007
|
const readBack = async () => {
|
|
1872
|
-
const { getMeetingOperation } = await import("./registry-
|
|
2008
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
1873
2009
|
const detail = getMeetingOperation("meeting.eb.meeting.detail");
|
|
1874
2010
|
const read = await detail.handler({ id: String(meetingId).trim() }, env);
|
|
1875
2011
|
return String(read?.data?.data?.crm_members ?? "").trim();
|
|
@@ -1896,7 +2032,7 @@ async function renderPreInvitation(payload, env) {
|
|
|
1896
2032
|
const fields = payload?.invitationFields ?? {};
|
|
1897
2033
|
const started = Date.now();
|
|
1898
2034
|
try {
|
|
1899
|
-
const { getMeetingOperation } = await import("./registry-
|
|
2035
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
1900
2036
|
const render = getMeetingOperation("meeting.invitation.render");
|
|
1901
2037
|
const rendered = await render.handler(
|
|
1902
2038
|
{
|
|
@@ -1967,9 +2103,9 @@ var ebMeetingCreateFlowApply = {
|
|
|
1967
2103
|
throw meetingValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
1968
2104
|
}
|
|
1969
2105
|
const payload = lease?.payload ?? {};
|
|
1970
|
-
const { createWorkflowHost } = await import("./host-
|
|
2106
|
+
const { createWorkflowHost } = await import("./host-TUOIOEMC.js");
|
|
1971
2107
|
const { createWorkflowContinuationSigner } = await import("./continuation-HFW2YT5S.js");
|
|
1972
|
-
const { getWorkflowOperation } = await import("./registry-
|
|
2108
|
+
const { getWorkflowOperation } = await import("./registry-AQVGHUM6.js");
|
|
1973
2109
|
const wfEnv = {
|
|
1974
2110
|
...workflowEnv(env),
|
|
1975
2111
|
host: createWorkflowHost(env.ctx),
|
|
@@ -2019,7 +2155,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2019
2155
|
const groupPayload2 = payload?.groupChat;
|
|
2020
2156
|
if (groupPayload2) {
|
|
2021
2157
|
try {
|
|
2022
|
-
const { ensureMeetingGroupChat } = await import("./group-chat-
|
|
2158
|
+
const { ensureMeetingGroupChat } = await import("./group-chat-KL3HFKRM.js");
|
|
2023
2159
|
groupChat2 = {
|
|
2024
2160
|
...await ensureMeetingGroupChat(env, {
|
|
2025
2161
|
meetingName: String(payload.mtName ?? ""),
|
|
@@ -2035,7 +2171,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2035
2171
|
}
|
|
2036
2172
|
if (groupChat2 && groupChat2.ok) {
|
|
2037
2173
|
try {
|
|
2038
|
-
const { savePendingForm } = await import("./group-chat-
|
|
2174
|
+
const { savePendingForm } = await import("./group-chat-KL3HFKRM.js");
|
|
2039
2175
|
await savePendingForm(env, {
|
|
2040
2176
|
workflowId: String(payload.workflowId ?? ""),
|
|
2041
2177
|
workflowName: String(payload.workflowName ?? ""),
|
|
@@ -2102,7 +2238,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2102
2238
|
let meetingId = "";
|
|
2103
2239
|
const timings = { submitMs: Date.now() - submitStartedAt };
|
|
2104
2240
|
if (waitSeconds > 0) {
|
|
2105
|
-
const { getMeetingOperation } = await import("./registry-
|
|
2241
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
2106
2242
|
const list = getMeetingOperation("meeting.eb.meeting.list");
|
|
2107
2243
|
const deadline = Date.now() + Math.min(waitSeconds, 30) * 1e3;
|
|
2108
2244
|
const pollStart = Date.now();
|
|
@@ -2152,7 +2288,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2152
2288
|
if (groupPayload) {
|
|
2153
2289
|
const groupStart = Date.now();
|
|
2154
2290
|
try {
|
|
2155
|
-
const { ensureMeetingGroupChat } = await import("./group-chat-
|
|
2291
|
+
const { ensureMeetingGroupChat } = await import("./group-chat-KL3HFKRM.js");
|
|
2156
2292
|
const group = await ensureMeetingGroupChat(env, {
|
|
2157
2293
|
meetingName: String(payload.mtName ?? ""),
|
|
2158
2294
|
beginDatetime: String(groupPayload.beginDatetime ?? ""),
|
|
@@ -2184,7 +2320,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2184
2320
|
if (meetingId) {
|
|
2185
2321
|
const invitationStart = Date.now();
|
|
2186
2322
|
try {
|
|
2187
|
-
const { getMeetingOperation } = await import("./registry-
|
|
2323
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
2188
2324
|
const render = getMeetingOperation("meeting.invitation.render");
|
|
2189
2325
|
const rendered = await render.handler(
|
|
2190
2326
|
{
|
|
@@ -2218,6 +2354,7 @@ var ebMeetingCreateFlowApply = {
|
|
|
2218
2354
|
invitation.sentToGroup = { groupId: inviteGroupId, ok: sent.ok };
|
|
2219
2355
|
timings.invitationSendMs = sent.ms;
|
|
2220
2356
|
}
|
|
2357
|
+
await clearMeetingDraft(env, String(payload.mtName ?? "")).catch(() => void 0);
|
|
2221
2358
|
return meetingSuccess(
|
|
2222
2359
|
"meeting.eb.meeting.create.flow.apply",
|
|
2223
2360
|
{
|
|
@@ -2354,7 +2491,7 @@ var ebMeetingCreateFlowQuick = {
|
|
|
2354
2491
|
`\u4F1A\u8BAE\u540D\u79F0/\u5185\u5BB9\u91CC\u63D0\u5230\u5BA2\u6237\u300C${crmMentioned}\u300D\uFF0C\u4F46\u6CA1\u4F20 crm_members \u2014\u2014 \u63D0\u4EA4\u540E\u300C\u53C2\u4F1A\u5BA2\u6237\u300D\u4F1A\u662F\u7A7A\u7684\u3002\u5148 meeting.eb.crm.search {"keyword":"${crmMentioned}"} \u62FF items[].customerId\uFF0C\u518D\u628A crm_members:[{"id":"<customerId>","name":"<\u5B8C\u6574\u5BA2\u6237\u540D>"}] \u4E00\u8D77\u4F20\uFF08\u5FC5\u987B\u5E26\u540D\u79F0\uFF0C\u53EA\u7ED9 id \u4F1A\u88AB\u9759\u9ED8\u5B58\u7A7A\uFF09\uFF1B\u786E\u5B9E\u4E0D\u9700\u8981\u586B\u53C2\u4F1A\u5BA2\u6237\u5C31\u4F20 crm_skip:true\u3002`
|
|
2355
2492
|
);
|
|
2356
2493
|
}
|
|
2357
|
-
const { getMeetingOperation } = await import("./registry-
|
|
2494
|
+
const { getMeetingOperation } = await import("./registry-XPWPGHYE.js");
|
|
2358
2495
|
const prepareStartedAt = Date.now();
|
|
2359
2496
|
const { submit_mode: _submitMode, confirm: _confirm, ...prepareArgs } = args;
|
|
2360
2497
|
const prepared = await getMeetingOperation("meeting.eb.meeting.create.flow.prepare").handler(
|
|
@@ -2452,7 +2589,7 @@ var ebMeetingCreateSuggest = {
|
|
|
2452
2589
|
const topN = Math.max(1, Math.min(5, Number(args.topN) || 3));
|
|
2453
2590
|
const rawMembers = String(args.hrm_members ?? "").split(/[,;,;\s]+/).map((item) => item.trim()).filter((item) => item !== "");
|
|
2454
2591
|
const nameLike = rawMembers.filter((item) => !/^\d+$/.test(item));
|
|
2455
|
-
const nameToId = nameLike.length > 0 ? await import("./schedule-
|
|
2592
|
+
const nameToId = nameLike.length > 0 ? await import("./schedule-YYNYBQIE.js").then((m) => m.resolveMemberIdsByName(env, nameLike)).catch(() => /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
2456
2593
|
const memberIds = rawMembers.map((item) => nameToId.get(item) ?? item);
|
|
2457
2594
|
const unresolved = rawMembers.filter((item) => nameToId.get(item) === void 0 && !/^\d+$/.test(item));
|
|
2458
2595
|
const selfId = await env.host.getSession().then((s) => String(s?.userId ?? "")).catch(() => "");
|