weaver-work-cli 0.1.44 → 0.1.46
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-MCXQBD6N.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-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
- package/dist/chunks/{chunk-FAZTGX7S.js → chunk-4RWS2YYL.js} +5 -5
- package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-6AXKWFKG.js} +32 -12
- package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
- package/dist/chunks/{chunk-QVSWRLLU.js → chunk-6V5ZPKHV.js} +56 -12
- package/dist/chunks/chunk-762M5XJS.js +215 -0
- package/dist/chunks/{chunk-PC7VKEB5.js → chunk-76H3IKH6.js} +178 -37
- package/dist/chunks/{chunk-FRZKBMSW.js → chunk-AD46OMQK.js} +239 -41
- package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
- 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-CWYGFU5B.js → chunk-GSZTA43P.js} +2 -2
- package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
- package/dist/chunks/{chunk-N4M2DDFE.js → chunk-IP4CWQCF.js} +11 -11
- package/dist/chunks/{chunk-GAMZLAG2.js → chunk-IRMIEDXN.js} +1 -1
- package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
- package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-JFAWZX53.js} +134 -13
- package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
- package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-OXHHJWNC.js} +1 -1
- package/dist/chunks/chunk-P5GQRWDC.js +60 -0
- package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
- package/dist/chunks/{chunk-OF4S23UB.js → chunk-PSOMGA3U.js} +4 -4
- 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-XHK4MDR5.js → chunk-UFIFZ4YC.js} +48 -14
- 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-H7EHQXYY.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-VRVJEOBX.js} +6 -6
- package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
- package/dist/chunks/{ehr-GSTGAIY3.js → ehr-SH2LM3NK.js} +648 -88
- package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
- package/dist/chunks/{env-BX3VRFS7.js → env-66FPSJDV.js} +2 -2
- package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
- package/dist/chunks/{factory-PETTFME6.js → factory-UH2TZBVA.js} +1 -1
- package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
- package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-CAKMMV7K.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-DD6ULZ3I.js} +4 -4
- package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
- package/dist/chunks/{meeting-FEVPZ67S.js → meeting-VTBFW4HI.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-CAKZTUA7.js} +1343 -178
- package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
- package/dist/chunks/{registry-IM5G23LS.js → registry-JVQBLFQ5.js} +10 -10
- 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/{room-recommend-H7KLXA5R.js → room-recommend-5U55FMXZ.js} +6 -4
- package/dist/chunks/{schedule-ESZIBAUO.js → schedule-IDETODCA.js} +4 -4
- package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
- package/dist/cmd/action.js +14 -10
- 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/host.js +2 -2
- package/dist/shortcuts/ehr/index.js +14 -3
- package/dist/shortcuts/ehr/manifest.js +5 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +44 -12
- package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +146 -43
- package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
- package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +154 -36
- package/dist/shortcuts/ehr/operations/recruit.js +196 -12
- package/dist/shortcuts/ehr/operations/registry.js +4 -0
- package/dist/shortcuts/ehr/operations.js +24 -0
- package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
- package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
- package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
- package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
- package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
- package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
- package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
- package/dist/shortcuts/hrm/operations/employee.js +29 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +274 -75
- package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
- package/dist/shortcuts/meeting/operations/eb/factory.js +63 -11
- package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +38 -7
- package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
- package/dist/shortcuts/meeting/operations/invitation.js +27 -4
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
- package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +356 -29
- package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +36 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +309 -67
- package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +310 -17
- package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
- package/dist/shortcuts/recruit-stage/shared.js +221 -24
- 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/SKILL.md +12 -3
- package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
- package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
- package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
- package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
- package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -91
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
- package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
- package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
- package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +55 -11
- package/skills/weaver-e10-meeting/SKILL.md +103 -11
- package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +19 -11
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -8
- package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +23 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -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 +11 -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
|
@@ -232,16 +232,18 @@ function buildReadInputSchema(endpoint) {
|
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
properties.pageNo = { type: 'integer', minimum: 1, description: '页码,默认 1' };
|
|
235
|
-
properties.pageSize = { type: 'integer', minimum: 1, maximum: 200, description: '每页条数,默认 20' };
|
|
235
|
+
properties.pageSize = { type: 'integer', minimum: 1, maximum: 200, description: '每页条数,默认 50(注意:本环境服务端单页实际只回 10~20 条,传更大也无效;要全量请传 all:true)' };
|
|
236
|
+
properties.all = {
|
|
237
|
+
type: 'boolean',
|
|
238
|
+
description: 'true = 自动翻页拉全量(最多 50 页)。查台账/列清单时**建议直接传 true**,'
|
|
239
|
+
+ '否则只回第 1 页(本环境实测 10 条),容易误判"接口读不全"',
|
|
240
|
+
};
|
|
236
241
|
if (endpoint.countPk) {
|
|
237
242
|
properties.withCount = { type: 'boolean', description: '是否先查总数(默认 true,条件与列表一致)' };
|
|
238
243
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
description: '跳过「模糊兜底」:服务端精确匹配不到时,不再翻页扫全量(默认 false=会扫,保证部分词也能查到)',
|
|
243
|
-
};
|
|
244
|
-
}
|
|
244
|
+
// ⛔ 2026-11-08 用户明确:**只支持会议室名称查询**。`noFallback` 是我们内部的调试开关,
|
|
245
|
+
// 一旦被调用方传 true 就会把「服务端精确匹配不到→翻页本地包含匹配」的兜底关掉,
|
|
246
|
+
// 表现为"按 317 查 0 条"。已从对外 schema 移除,只保留默认行为(总是兜底)。
|
|
245
247
|
}
|
|
246
248
|
return {
|
|
247
249
|
type: 'object',
|
|
@@ -343,10 +345,60 @@ function buildReadOperation(endpoint) {
|
|
|
343
345
|
return meetingSuccess(endpoint.operation, { data, count: rows.length }, endpoint.notes ? { meta: { notes: endpoint.notes } } : {});
|
|
344
346
|
}
|
|
345
347
|
const pageNo = typeof args.pageNo === 'number' ? args.pageNo : 1;
|
|
346
|
-
const pageSize = typeof args.pageSize === 'number' ? args.pageSize :
|
|
348
|
+
const pageSize = typeof args.pageSize === 'number' ? args.pageSize : 50;
|
|
347
349
|
// 服务端过滤条件:count 与 list 必须用**同一份**,否则 total 与当页行数对不上
|
|
348
350
|
// (总数是不带过滤的、列表是过滤后的,用户会看到"共 155 间"却只回 1 条)。
|
|
349
351
|
const mainTableFilters = pickMainTableFilters(args, endpoint.mainTableParams);
|
|
352
|
+
// ⛔ 2026-11-06 真机:本环境服务端**单页固定回 10 条**(pageSize=200 也无效),
|
|
353
|
+
// 以前只回第 1 页又只给一句"还有 X 条未取到"的弱提示,agent 直接当成"接口读不全",
|
|
354
|
+
// 对用户说"台账 155 条但只返回 10 间"。这里支持 all:true 一次性翻到底。
|
|
355
|
+
if (args.all === true) {
|
|
356
|
+
const collected = [];
|
|
357
|
+
let pages = 0;
|
|
358
|
+
let totalKnown = 0;
|
|
359
|
+
for (let p = 1; p <= 50; p += 1) {
|
|
360
|
+
const pageResponse = await env.host.request({
|
|
361
|
+
method: 'POST',
|
|
362
|
+
path,
|
|
363
|
+
operation: endpoint.operation,
|
|
364
|
+
query: { ...query, pageNo: p, pageSize },
|
|
365
|
+
body: queryBody(session.userId, { pageNo: p, pageSize }, mainTableFilters),
|
|
366
|
+
acceptBusiness,
|
|
367
|
+
});
|
|
368
|
+
const { rows: pageRows, total: pageTotal } = extractEbRows(pageResponse);
|
|
369
|
+
pages = p;
|
|
370
|
+
totalKnown = Number(pageTotal ?? totalKnown) || totalKnown;
|
|
371
|
+
if (pageRows.length === 0)
|
|
372
|
+
break;
|
|
373
|
+
collected.push(...pageRows);
|
|
374
|
+
if (totalKnown > 0 && collected.length >= totalKnown)
|
|
375
|
+
break;
|
|
376
|
+
if (pageRows.length < 10)
|
|
377
|
+
break; // 服务端单页上限 10
|
|
378
|
+
}
|
|
379
|
+
const allRows = Object.keys(mainTableFilters).length === 0
|
|
380
|
+
? collected
|
|
381
|
+
: collected.filter((row) => {
|
|
382
|
+
const main = (row?.mainTable ?? row ?? {});
|
|
383
|
+
return Object.entries(mainTableFilters).every(([key, value]) => {
|
|
384
|
+
const cell = main[key];
|
|
385
|
+
return cell !== undefined && cell !== null && String(cell).includes(String(value));
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
return meetingSuccess(endpoint.operation, {
|
|
389
|
+
total: allRows.length,
|
|
390
|
+
pageNo: 1,
|
|
391
|
+
pageSize: allRows.length,
|
|
392
|
+
count: allRows.length,
|
|
393
|
+
pagesFetched: pages,
|
|
394
|
+
all: true,
|
|
395
|
+
rows: allRows,
|
|
396
|
+
filters: { ...query, ...mainTableFilters },
|
|
397
|
+
}, {
|
|
398
|
+
...(endpoint.notes ? { meta: { notes: endpoint.notes } } : {}),
|
|
399
|
+
...(allRows.length === 0 && endpoint.emptyHint ? { warnings: [endpoint.emptyHint] } : {}),
|
|
400
|
+
});
|
|
401
|
+
}
|
|
350
402
|
let total;
|
|
351
403
|
if (endpoint.countPk && args.withCount !== false) {
|
|
352
404
|
const countResponse = await env.host.request({
|
|
@@ -390,8 +442,8 @@ function buildReadOperation(endpoint) {
|
|
|
390
442
|
// room_name=测试会议室1 → 1 条 ✅;room_name=测试 / 重庆 → 0 条 ❌,
|
|
391
443
|
// 但全量里明明有「重庆会议室一/二」)。
|
|
392
444
|
// 传了筛选却一条没命中时,回退:不带过滤翻页拉全量,在客户端按 contains 再筛一遍。
|
|
393
|
-
// 只在首轮 0
|
|
394
|
-
if (filterKeys.length > 0 && rows.length === 0
|
|
445
|
+
// 只在首轮 0 条时触发(精确命中时零额外开销);**总是兜底**(2026-11-08 起不再接受 noFallback 开关)
|
|
446
|
+
if (filterKeys.length > 0 && rows.length === 0) {
|
|
395
447
|
const maxPages = readFallbackMaxPages();
|
|
396
448
|
const collected = [];
|
|
397
449
|
let pages = 0;
|
|
@@ -447,7 +499,7 @@ function buildReadOperation(endpoint) {
|
|
|
447
499
|
// ⚠️ 分页提示:本页条数 < 总数时明确告诉调用方"还有没取到的",
|
|
448
500
|
// 避免只看本页就下结论(2026-10-23 我本人就因此误判"该环境只有 10 个会议",
|
|
449
501
|
// 实际 total=46,只是第一页 + stdout 预览把数组截到 10 条)。
|
|
450
|
-
// 注意:
|
|
502
|
+
// 注意:2026-11-06 真机实测,本环境服务端**会把单页压到 10 条**(pageSize=200 也无效),
|
|
451
503
|
// 所以这里只提示翻页/加大 pageSize,不要写成"服务端限制"。
|
|
452
504
|
const effectiveTotal = Math.max(resolvedTotal, rows.length);
|
|
453
505
|
const pageWarnings = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readCache, writeCache, cacheScopeSuffix } from './cache.js';
|
|
2
|
-
const PERSON_TTL_MS = 24 * 60 * 60 * 1000;
|
|
2
|
+
const PERSON_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
3
3
|
const BATCH_MAX = 100;
|
|
4
4
|
function personKey(scope) {
|
|
5
5
|
return `person-v1-${scope}`;
|
|
@@ -7,7 +7,7 @@ function personKey(scope) {
|
|
|
7
7
|
/** 读缓存里的全部人员(id → 记录),过期的条目会被丢弃。 */
|
|
8
8
|
async function readAll(env) {
|
|
9
9
|
const scope = await cacheScopeSuffix(env);
|
|
10
|
-
const hit = await readCache(env, personKey(scope), { ttlMs: PERSON_TTL_MS *
|
|
10
|
+
const hit = await readCache(env, personKey(scope), { ttlMs: PERSON_TTL_MS * 2 });
|
|
11
11
|
if (!hit)
|
|
12
12
|
return {};
|
|
13
13
|
const now = Date.now();
|
|
@@ -2,13 +2,39 @@ import { meetingSuccess, schemaOf, SCHEMA_DATETIME_MINUTE } from '../types.js';
|
|
|
2
2
|
import { EB_BASE, ebBusinessSuccess, extractEbRows, queryBody } from './factory.js';
|
|
3
3
|
import { readCache, writeCache, cacheScopeSuffix } from './cache.js';
|
|
4
4
|
import { busyRoomIds } from './usage-cache.js';
|
|
5
|
+
/**
|
|
6
|
+
* 从会议室名称/描述推断楼层(名称优先,其次描述)。
|
|
7
|
+
* 规则:中文「一楼/二层」、`1F/3楼/10层` 直接取;否则看名称开头的 3~4 位数字
|
|
8
|
+
* (3 位取首位:120→1;4 位取前两位:1007→10;带后缀 601-8→6)。
|
|
9
|
+
*/
|
|
10
|
+
export function inferRoomFloor(name, desc = '') {
|
|
11
|
+
const cnDigits = { 一: 1, 二: 2, 三: 3, 四: 4, 五: 5, 六: 6, 七: 7, 八: 8, 九: 9, 十: 10 };
|
|
12
|
+
const fromText = (text) => {
|
|
13
|
+
const cn = text.match(/([一二三四五六七八九十])\s*(?:楼|层)/u);
|
|
14
|
+
if (cn)
|
|
15
|
+
return cnDigits[cn[1]] ?? null;
|
|
16
|
+
const en = text.match(/(\d{1,2})\s*(?:F|f|楼|层)(?!\d)/u);
|
|
17
|
+
if (en)
|
|
18
|
+
return Number(en[1]);
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
const byText = fromText(name) ?? fromText(desc);
|
|
22
|
+
if (byText)
|
|
23
|
+
return byText;
|
|
24
|
+
const lead = name.match(/^\s*(\d{3,4})/u);
|
|
25
|
+
if (!lead)
|
|
26
|
+
return null;
|
|
27
|
+
const digits = lead[1];
|
|
28
|
+
return digits.length === 4 ? Number(digits.slice(0, 2)) : Number(digits[0]);
|
|
29
|
+
}
|
|
5
30
|
// 会议室台账缓存 24h(用户 2026-10-30 明确要求:不要为了新鲜度把 TTL 缩到 15 分钟,太频繁)。
|
|
6
31
|
// 「刚导入/新建的会议室看不到」靠两层兜底解决,而不是靠缩短 TTL:
|
|
7
32
|
// ① **建会链路强制拉最新**(create.flow.prepare / quick / create.suggest 传 refreshRooms: true)——
|
|
8
33
|
// 这些是"要下单"的场景,宁可多一次请求也必须准;
|
|
9
34
|
// ② **候选为空且来自缓存 → 自动强制重拉重算**(见下方 candidates.length === 0 分支)。
|
|
10
35
|
// 纯查询(room.recommend)走 24h 缓存保持快;缓存超过 STALE_NOTICE_MS 会在 warnings 提示可用 refresh 刷新。
|
|
11
|
-
|
|
36
|
+
// 2026-11-06 用户要求:会议室台账 7 天过期(原 24h,太短,几乎每次都在重拉)
|
|
37
|
+
const ROOMS_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
12
38
|
const STALE_NOTICE_MS = 4 * 60 * 60 * 1000;
|
|
13
39
|
const FREQUENT_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
14
40
|
const FREQUENT_WINDOW_DAYS = 180;
|
|
@@ -70,11 +96,12 @@ function normalizeRoom(row) {
|
|
|
70
96
|
// 于是「带客户优先接待类」里**按描述文案判定**那一半从来没生效过(只有名称含「接待」的能命中)。
|
|
71
97
|
// 例:广州会议室四 的描述「用来接待重要来宾…」明明写着,却被当普通房间。
|
|
72
98
|
roomDesc: toText(main.room_desc).trim(),
|
|
99
|
+
floor: inferRoomFloor(toText(main.room_name).trim(), toText(main.room_desc).trim()),
|
|
73
100
|
};
|
|
74
101
|
}
|
|
75
102
|
/** 全量会议室:优先缓存(24h),`refresh:true` 强制重拉。 */
|
|
76
103
|
export async function loadRooms(env, options = {}) {
|
|
77
|
-
const key = `rooms-
|
|
104
|
+
const key = `rooms-v4-${await cacheScopeSuffix(env)}`;
|
|
78
105
|
const warnings = [];
|
|
79
106
|
if (!options.refresh) {
|
|
80
107
|
const cached = await readCache(env, key, { ttlMs: ROOMS_TTL_MS });
|
|
@@ -242,8 +269,10 @@ export async function recommendRooms(env, input) {
|
|
|
242
269
|
continue;
|
|
243
270
|
if (requirement.mrType && room.mrType !== requirement.mrType)
|
|
244
271
|
continue;
|
|
245
|
-
if (
|
|
272
|
+
if (input.floor !== undefined && input.floor !== null && room.floor !== input.floor)
|
|
246
273
|
continue;
|
|
274
|
+
// ⛔ 2026-11-08:只支持按**会议室名称**筛选(nameKeyword)。原来的 placeKeyword 匹配的是
|
|
275
|
+
// 「地点/园区」字段,传房间号必然 0 条,已从对外入参移除。
|
|
247
276
|
if (requirement.nameKeyword && !room.name.includes(requirement.nameKeyword))
|
|
248
277
|
continue;
|
|
249
278
|
if (requirement.equipmentsKeyword && !room.equipments.includes(requirement.equipmentsKeyword))
|
|
@@ -303,6 +332,7 @@ export async function recommendRooms(env, input) {
|
|
|
303
332
|
place: room.place,
|
|
304
333
|
equipments: room.equipments,
|
|
305
334
|
roomAttrText: room.roomAttrText,
|
|
335
|
+
...(room.floor !== null && room.floor !== undefined ? { floor: room.floor } : {}),
|
|
306
336
|
...(String(room.roomDesc ?? '').trim() !== '' ? { roomDesc: String(room.roomDesc).trim() } : {}),
|
|
307
337
|
frequentCount: freq?.count ?? 0,
|
|
308
338
|
score,
|
|
@@ -384,12 +414,12 @@ export const ebRoomRecommendOperation = {
|
|
|
384
414
|
type: 'string',
|
|
385
415
|
description: '参会人 id 逗号分隔(可选):不传 memberCount 时按它的人数推算',
|
|
386
416
|
},
|
|
387
|
-
placeKeyword: { type: 'string', description: '地点/楼层关键词(模糊匹配会议室 place)' },
|
|
388
417
|
nameKeyword: { type: 'string', description: '会议室名称关键词' },
|
|
389
418
|
mrType: { type: 'string', description: '会议室类型 id(mr_type)' },
|
|
390
419
|
roomAttr: { type: 'string', enum: ['0', '1', '2'], description: '会议室属性:0 实体 / 1 虚拟 / 2 组合' },
|
|
391
420
|
equipmentsKeyword: { type: 'string', description: '设备关键词(模糊匹配 equipments,如 投影/视频)' },
|
|
392
|
-
hasCustomer: { type: 'boolean', description: '本次会议是否带客户:true
|
|
421
|
+
hasCustomer: { type: 'boolean', description: '本次会议是否带客户:true 时优先推荐接待类会议室(名称或描述含 接待/招待/贵宾/商务 的加 35 分)' },
|
|
422
|
+
floor: { type: 'number', description: '只要某层(如 1 表示一楼):按会议室名称/描述推断楼层过滤(120会议室=1楼、1007会议室=10楼、601-8=6楼)' },
|
|
393
423
|
topN: { type: 'number', description: '返回候选数量(默认 3,最多 10)' },
|
|
394
424
|
refresh: { type: 'boolean', description: 'true=刷新会议室全量与常用记录缓存' },
|
|
395
425
|
includeBusy: { type: 'boolean', description: 'true=把该时段已被占用的会议室也返回(排在最后,带说明)' },
|
|
@@ -405,7 +435,6 @@ export const ebRoomRecommendOperation = {
|
|
|
405
435
|
endDatetime: String(args.endDatetime),
|
|
406
436
|
...(Number.isFinite(memberCount) && memberCount > 0 ? { memberCount } : {}),
|
|
407
437
|
requirement: {
|
|
408
|
-
...(args.placeKeyword ? { placeKeyword: String(args.placeKeyword) } : {}),
|
|
409
438
|
...(args.nameKeyword ? { nameKeyword: String(args.nameKeyword) } : {}),
|
|
410
439
|
...(args.mrType ? { mrType: String(args.mrType) } : {}),
|
|
411
440
|
...(args.roomAttr ? { roomAttr: String(args.roomAttr) } : {}),
|
|
@@ -413,6 +442,8 @@ export const ebRoomRecommendOperation = {
|
|
|
413
442
|
// 2026-11-04 修:以前漏了它 —— 用户传了 hasCustomer,打分却读 requirement.hasCustomer,永远 false
|
|
414
443
|
...(args.hasCustomer === true ? { hasCustomer: true } : {}),
|
|
415
444
|
},
|
|
445
|
+
// ⛔ floor 是 RecommendRoomInput 的**顶层**字段(放 requirement 里会被忽略,2026-11-06 踩到)
|
|
446
|
+
...(Number.isFinite(Number(args.floor)) ? { floor: Number(args.floor) } : {}),
|
|
416
447
|
...(args.topN !== undefined ? { topN: Number(args.topN) } : {}),
|
|
417
448
|
...(args.refresh === true ? { refreshRooms: true, refreshFrequent: true } : {}),
|
|
418
449
|
...(args.includeBusy === true ? { includeBusy: true } : {}),
|
|
@@ -439,7 +470,7 @@ export async function rememberFrequentRoom(env, roomId) {
|
|
|
439
470
|
if (!id)
|
|
440
471
|
return false;
|
|
441
472
|
const scope = await cacheScopeSuffix(env);
|
|
442
|
-
const roomsCached = await readCache(env, `rooms-
|
|
473
|
+
const roomsCached = await readCache(env, `rooms-v4-${scope}`, { ttlMs: ROOMS_TTL_MS });
|
|
443
474
|
const name = roomsCached?.data?.find((room) => room.id === id)?.name ?? '';
|
|
444
475
|
if (!name)
|
|
445
476
|
return false;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 邀请函 → E10 文档(2026-11-06 用户需求)。
|
|
3
|
+
*
|
|
4
|
+
* 链路:`meeting.invitation.render`(模板填充,已有)→ `caizhilian.document.create-office`
|
|
5
|
+
* (上传 Office 文件并直接生成文档,源 create_office_document)→ 返回 `docId`。
|
|
6
|
+
*
|
|
7
|
+
* 拿到 docId 后由建会链路写入表单「邀请函」字段(Document 组件):
|
|
8
|
+
* `extraFields: { "邀请函": [{ id: docId, name: 文档名 }] }`
|
|
9
|
+
* (字段值格式 2026-11-06 真机实测:键用**字段 id** 1334688905776169004,值 `[{id,name}]`;
|
|
10
|
+
* 传 dataKey `yqh` 服务端认不到;隐藏字段同样能写入。)
|
|
11
|
+
*/
|
|
12
|
+
import { win32 } from 'node:path';
|
|
13
|
+
import { meetingValidationError } from '../errors.js';
|
|
14
|
+
import { meetingSuccess, SCHEMA_ID } from './types.js';
|
|
15
|
+
/** 邀请函默认落库目录(2026-11-06 用户指定:文档中心目录 300,公共文档)。 */
|
|
16
|
+
const DEFAULT_FOLDER_ID = '300';
|
|
17
|
+
const DEFAULT_FOLDER_TYPE = 'company';
|
|
18
|
+
function normalizeWinPath(path) {
|
|
19
|
+
// ⛔ create-office 的 apply 会拿 file_path 字符串和 prepare 时的指纹**逐字**比对,
|
|
20
|
+
// 斜杠方向不同就报「参数 file_path 与 prepare 时不一致」(2026-11-06 真机踩到)。
|
|
21
|
+
// 统一成 Windows 反斜杠绝对路径。
|
|
22
|
+
return win32.normalize(path);
|
|
23
|
+
}
|
|
24
|
+
const meetingInvitationPublish = {
|
|
25
|
+
name: 'meeting.invitation.publish',
|
|
26
|
+
resource: 'invitation',
|
|
27
|
+
method: 'publish',
|
|
28
|
+
action: 'meeting.invitation.publish',
|
|
29
|
+
summary: '生成邀请函并**发布成 E10 文档**:模板填充 → 上传到文档中心(默认目录 300)→ 返回 docId。'
|
|
30
|
+
+ '拿到后把 `extraFields: {"邀请函":[{"id":docId,"name":文档名}]}` 传给建会接口即可写进表单。'
|
|
31
|
+
+ '会真实创建文档(需 confirm: true)。',
|
|
32
|
+
capability: 'invitation',
|
|
33
|
+
risk: 'high-risk-write',
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
properties: {
|
|
38
|
+
mtId: { ...SCHEMA_ID, description: '会议 id(与下面字段二选一):有则按真实会议数据生成' },
|
|
39
|
+
mt_name: { type: 'string', description: '会议名称(无 mtId 时必填)' },
|
|
40
|
+
begin_datetime: { type: 'string', description: '开始时间 yyyy-MM-dd HH:mm' },
|
|
41
|
+
end_datetime: { type: 'string', description: '结束时间 yyyy-MM-dd HH:mm' },
|
|
42
|
+
address: { type: 'string', description: '会议地点(名称)' },
|
|
43
|
+
hrm_members: { type: 'string', description: '参会人姓名(逗号/顿号分隔)' },
|
|
44
|
+
mt_desc: { type: 'string', description: '会议内容' },
|
|
45
|
+
org_members: { type: 'string', description: '落款单位' },
|
|
46
|
+
caller: { type: 'string', description: '召集人' },
|
|
47
|
+
contacter: { type: 'string', description: '联系人' },
|
|
48
|
+
total_member: { type: 'string', description: '参会人数' },
|
|
49
|
+
extra: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
additionalProperties: { type: 'string' },
|
|
52
|
+
description: '自定义字段(如 guest_org=客户单位;agenda=议程)',
|
|
53
|
+
},
|
|
54
|
+
doc_name: { type: 'string', description: '文档名,默认「邀请函-<会议名>-<日期>」' },
|
|
55
|
+
folder_id: { type: 'string', description: `文档中心目录 id,默认 ${DEFAULT_FOLDER_ID}` },
|
|
56
|
+
folder_type: { type: 'string', enum: ['company', 'privy', 'sys'], description: `目录类型,默认 ${DEFAULT_FOLDER_TYPE}` },
|
|
57
|
+
confirm: { type: 'boolean', description: '必须显式传 true —— 会真实创建一篇文档' },
|
|
58
|
+
},
|
|
59
|
+
required: ['confirm'],
|
|
60
|
+
},
|
|
61
|
+
handler: async (args, env) => {
|
|
62
|
+
if (args.confirm !== true) {
|
|
63
|
+
throw meetingValidationError('confirm_required', '会真实创建文档,必须显式传 confirm: true(可先不带 confirm 调 meeting.invitation.render 预览正文)');
|
|
64
|
+
}
|
|
65
|
+
const { getMeetingOperation } = await import('./registry.js');
|
|
66
|
+
const render = getMeetingOperation('meeting.invitation.render');
|
|
67
|
+
const rendered = await render.handler({
|
|
68
|
+
...(args.mtId !== undefined ? { mtId: args.mtId } : {}),
|
|
69
|
+
...(args.mt_name !== undefined ? { mt_name: args.mt_name } : {}),
|
|
70
|
+
...(args.begin_datetime !== undefined ? { begin_datetime: args.begin_datetime } : {}),
|
|
71
|
+
...(args.end_datetime !== undefined ? { end_datetime: args.end_datetime } : {}),
|
|
72
|
+
...(args.address !== undefined ? { address: args.address } : {}),
|
|
73
|
+
...(args.hrm_members !== undefined ? { hrm_members: args.hrm_members } : {}),
|
|
74
|
+
...(args.mt_desc !== undefined ? { mt_desc: args.mt_desc } : {}),
|
|
75
|
+
...(args.org_members !== undefined ? { org_members: args.org_members } : {}),
|
|
76
|
+
...(args.caller !== undefined ? { caller: args.caller } : {}),
|
|
77
|
+
...(args.contacter !== undefined ? { contacter: args.contacter } : {}),
|
|
78
|
+
...(args.total_member !== undefined ? { total_member: args.total_member } : {}),
|
|
79
|
+
...(args.extra !== undefined ? { extra: args.extra } : {}),
|
|
80
|
+
}, env);
|
|
81
|
+
const filePath = String(rendered?.data?.filePath ?? '').trim();
|
|
82
|
+
if (!filePath)
|
|
83
|
+
throw meetingValidationError('render_failed', '邀请函 docx 未生成(render 未返回 filePath)');
|
|
84
|
+
const session = await env.host.getSession();
|
|
85
|
+
const authorId = String(session?.userId ?? '').trim();
|
|
86
|
+
if (!authorId)
|
|
87
|
+
throw meetingValidationError('session_missing', '拿不到当前登录人,无法创建文档');
|
|
88
|
+
const docName = String(args.doc_name ?? '').trim()
|
|
89
|
+
|| String(rendered?.data?.fileName ?? '').replace(/\.docx$/i, '')
|
|
90
|
+
|| '邀请函';
|
|
91
|
+
const caizhilianArgs = {
|
|
92
|
+
file_path: normalizeWinPath(filePath),
|
|
93
|
+
name: docName,
|
|
94
|
+
folder_id: String(args.folder_id ?? DEFAULT_FOLDER_ID),
|
|
95
|
+
folder_type: String(args.folder_type ?? DEFAULT_FOLDER_TYPE),
|
|
96
|
+
author_id: authorId,
|
|
97
|
+
};
|
|
98
|
+
const { executeCaizhilianOperation } = await import('../../caizhilian/operations.js');
|
|
99
|
+
const { createCaizhilianHost } = await import('../../caizhilian/host.js');
|
|
100
|
+
const { createCaizhilianContinuationSigner } = await import('../../caizhilian/continuation.js');
|
|
101
|
+
const caizhilianEnv = {
|
|
102
|
+
ctx: env.ctx,
|
|
103
|
+
host: createCaizhilianHost(env.ctx),
|
|
104
|
+
continuation: createCaizhilianContinuationSigner(env.ctx),
|
|
105
|
+
};
|
|
106
|
+
// prepare 只校验/预览;apply 用**完全相同**的入参 + continuation 才不会被判「目标变了」
|
|
107
|
+
const prepared = await executeCaizhilianOperation('caizhilian.document.create-office.prepare', caizhilianArgs, caizhilianEnv);
|
|
108
|
+
const continuation = String(prepared?.data?.continuation ?? '');
|
|
109
|
+
if (!continuation) {
|
|
110
|
+
throw meetingValidationError('publish_prepare_failed', 'create-office.prepare 未返回 continuation');
|
|
111
|
+
}
|
|
112
|
+
const applied = await executeCaizhilianOperation('caizhilian.document.create-office.apply', { ...caizhilianArgs, continuation, confirm: true }, caizhilianEnv);
|
|
113
|
+
const docId = String(applied?.data?.doc_id ?? '').trim();
|
|
114
|
+
if (!docId)
|
|
115
|
+
throw meetingValidationError('publish_failed', 'create-office.apply 未返回 doc_id');
|
|
116
|
+
return meetingSuccess('meeting.invitation.publish', {
|
|
117
|
+
docId,
|
|
118
|
+
docName,
|
|
119
|
+
filePath,
|
|
120
|
+
folderId: caizhilianArgs.folder_id,
|
|
121
|
+
folderType: caizhilianArgs.folder_type,
|
|
122
|
+
// 直接可用的表单字段值(建会时放进 extraFields.邀请函)
|
|
123
|
+
formFieldValue: [{ id: docId, name: docName }],
|
|
124
|
+
// 对话里要贴正文,别只给 id
|
|
125
|
+
text: rendered?.data?.text ?? '',
|
|
126
|
+
pendingFields: rendered?.data?.pendingFields ?? [],
|
|
127
|
+
}, {
|
|
128
|
+
...(Array.isArray(applied?.warnings) && applied.warnings.length > 0 ? { warnings: applied.warnings } : {}),
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
export const meetingInvitationPublishOperations = [meetingInvitationPublish];
|
|
@@ -177,16 +177,39 @@ function parseAgendaFromExtra(raw) {
|
|
|
177
177
|
const text = String(raw ?? '').trim();
|
|
178
178
|
if (!text)
|
|
179
179
|
return [];
|
|
180
|
+
// 时间样式:「15分钟」「2小时」「14:00」「14:00-14:15」
|
|
181
|
+
const isTimeLike = (part) => /^\d{1,2}:\d{2}(\s*[-~至]\s*\d{1,2}:\d{2})?$/u.test(part)
|
|
182
|
+
|| /^\d+(\.\d+)?\s*(分钟|分|min|minutes?|小时|h|hours?)$/iu.test(part);
|
|
180
183
|
return text
|
|
181
184
|
.split(/[\r\n;;]+/u)
|
|
182
185
|
.map((line) => line.trim())
|
|
183
186
|
.filter(Boolean)
|
|
184
187
|
.map((line) => {
|
|
185
|
-
const parts = line.split('|').map((part) => part.trim());
|
|
186
|
-
|
|
187
|
-
|
|
188
|
+
const parts = line.split('|').map((part) => part.trim()).filter((part) => part !== '');
|
|
189
|
+
if (parts.length >= 3) {
|
|
190
|
+
// 三段:按「安排|内容|时间」;如果时间被写在第一段(常见误传),换回去
|
|
191
|
+
const [name, content, timeRange] = parts;
|
|
192
|
+
if (!isTimeLike(timeRange) && isTimeLike(name))
|
|
193
|
+
return ['', content, name];
|
|
194
|
+
return [name, content, timeRange];
|
|
195
|
+
}
|
|
196
|
+
if (parts.length === 2) {
|
|
197
|
+
const [a, b] = parts;
|
|
198
|
+
// ⛔ 2026-11-08 真机:模型传「15 分钟|泛微公司介绍」,旧解析把时长当成了「议程安排」,
|
|
199
|
+
// 结果时间列空着、安排列写着"15 分钟"。时长/时间一律归到第三列,正文进「议程安排」。
|
|
200
|
+
if (isTimeLike(a) && !isTimeLike(b))
|
|
201
|
+
return [b, '', a];
|
|
202
|
+
if (isTimeLike(b) && !isTimeLike(a))
|
|
203
|
+
return [a, '', b];
|
|
204
|
+
return [a, b, ''];
|
|
205
|
+
}
|
|
206
|
+
// 只有一段:可能是「14:00-14:15 泛微公司介绍」这种连写,拆出时间;否则当作安排名
|
|
207
|
+
const inline = line.match(/^(\d{1,2}:\d{2}\s*[-~至]\s*\d{1,2}:\d{2})\s*(.+)$/u);
|
|
208
|
+
if (inline)
|
|
209
|
+
return [inline[2].trim(), '', inline[1].trim()];
|
|
210
|
+
return [parts[0] ?? '', '', ''];
|
|
188
211
|
})
|
|
189
|
-
.filter((row) => row[0] !== '');
|
|
212
|
+
.filter((row) => row[0] !== '' || row[2] !== '');
|
|
190
213
|
}
|
|
191
214
|
/**
|
|
192
215
|
* 把会议接口返回的任意字段值压成可渲染文本。
|
|
@@ -17,6 +17,7 @@ import { meetingMinuteFromGroupChatOperations } from './from-group-chat.js';
|
|
|
17
17
|
import { meetingDecisionNotifyOperations } from './task-notify.js';
|
|
18
18
|
import { meetingPipelineOperations } from './pipeline.js';
|
|
19
19
|
import { meetingInvitationOperations } from './invitation.js';
|
|
20
|
+
import { meetingInvitationPublishOperations } from './invitation-publish.js';
|
|
20
21
|
import { meetingQrOperations } from './qrcode.js';
|
|
21
22
|
import { meetingSummaryOperations } from './summary.js';
|
|
22
23
|
import { meetingFormFieldOperations } from './form-fields.js';
|
|
@@ -42,6 +43,7 @@ function buildRegistry() {
|
|
|
42
43
|
...meetingDecisionNotifyOperations,
|
|
43
44
|
...meetingPipelineOperations,
|
|
44
45
|
...meetingInvitationOperations,
|
|
46
|
+
...meetingInvitationPublishOperations,
|
|
45
47
|
...meetingQrOperations,
|
|
46
48
|
...meetingSummaryOperations,
|
|
47
49
|
...meetingFormFieldOperations,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 批量任务的暂存清单(2026-11-06)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么不用 continuation 直接携带:
|
|
5
|
+
* 批量简历导入的每一项都带 `structured`(整份简历 JSON),几十份时 token 会膨胀到几十万字符,
|
|
6
|
+
* Agent 传参不现实。这里把清单落到本机 `~/.weaver-work-cli/batch/`,token 只带文件路径 + 指纹;
|
|
7
|
+
* apply 时重算指纹,不一致即拒绝(防止清单被中途改写)。
|
|
8
|
+
*
|
|
9
|
+
* 安全:
|
|
10
|
+
* - 目录 0700、文件 0600;
|
|
11
|
+
* - 只允许读 batch 目录内的文件(防越权读任意路径);
|
|
12
|
+
* - 24 小时以上的旧清单在下次写入时清理。
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import { chmodSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
16
|
+
import { homedir } from 'node:os';
|
|
17
|
+
import { join, resolve, sep } from 'node:path';
|
|
18
|
+
import { rsValidationError } from './errors.js';
|
|
19
|
+
function batchDir() {
|
|
20
|
+
const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), '.weaver-work-cli');
|
|
21
|
+
const dir = join(home, 'batch');
|
|
22
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
23
|
+
return dir;
|
|
24
|
+
}
|
|
25
|
+
function digest(value) {
|
|
26
|
+
return createHash('sha256').update(JSON.stringify(value)).digest('hex');
|
|
27
|
+
}
|
|
28
|
+
function cleanup(dir) {
|
|
29
|
+
try {
|
|
30
|
+
const now = Date.now();
|
|
31
|
+
for (const f of readdirSync(dir)) {
|
|
32
|
+
if (!f.endsWith('.json'))
|
|
33
|
+
continue;
|
|
34
|
+
const p = join(dir, f);
|
|
35
|
+
try {
|
|
36
|
+
if (now - statSync(p).mtimeMs > 24 * 3600 * 1000)
|
|
37
|
+
unlinkSync(p);
|
|
38
|
+
}
|
|
39
|
+
catch { /* 单文件清理失败忽略 */ }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch { /* 目录不可读忽略 */ }
|
|
43
|
+
}
|
|
44
|
+
/** 落盘批量清单,返回文件路径与内容指纹。 */
|
|
45
|
+
export function saveBatchItems(kind, items) {
|
|
46
|
+
const dir = batchDir();
|
|
47
|
+
cleanup(dir);
|
|
48
|
+
const fingerprint = digest(items);
|
|
49
|
+
const file = join(dir, `${kind}-${fingerprint.slice(0, 16)}.json`);
|
|
50
|
+
writeFileSync(file, JSON.stringify(items), { mode: 0o600 });
|
|
51
|
+
try {
|
|
52
|
+
chmodSync(file, 0o600);
|
|
53
|
+
}
|
|
54
|
+
catch { /* Windows 上可能不支持 */ }
|
|
55
|
+
return { file, fingerprint };
|
|
56
|
+
}
|
|
57
|
+
/** 读取并校验批量清单(路径必须在 batch 目录内,内容指纹必须与 token 一致)。 */
|
|
58
|
+
export function loadBatchItems(file, expectedFingerprint) {
|
|
59
|
+
const dir = resolve(batchDir());
|
|
60
|
+
const target = resolve(String(file || ''));
|
|
61
|
+
if (!target.startsWith(dir + sep)) {
|
|
62
|
+
throw rsValidationError('batch_file_invalid', '批量清单路径非法(必须位于 CLI 的 batch 目录内)');
|
|
63
|
+
}
|
|
64
|
+
let items;
|
|
65
|
+
try {
|
|
66
|
+
items = JSON.parse(readFileSync(target, 'utf8'));
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
throw rsValidationError('batch_file_missing', '批量清单已失效(文件被移动或删除),请重新 prepare');
|
|
70
|
+
}
|
|
71
|
+
if (!Array.isArray(items)) {
|
|
72
|
+
throw rsValidationError('batch_file_invalid', '批量清单格式不正确,请重新 prepare');
|
|
73
|
+
}
|
|
74
|
+
if (digest(items) !== String(expectedFingerprint || '')) {
|
|
75
|
+
throw rsValidationError('batch_file_tampered', '批量清单与确认时不一致(文件被修改),已拒绝执行,请重新 prepare');
|
|
76
|
+
}
|
|
77
|
+
return items;
|
|
78
|
+
}
|