weaver-work-cli 0.1.76 → 0.1.78

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.
Files changed (175) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/{attachment-content-24RL44SE.js → attachment-content-TFOC3Y3X.js} +3 -3
  3. package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
  4. package/dist/chunks/{chunk-SQFKBWTR.js → chunk-5VQ7JHV4.js} +132 -47
  5. package/dist/chunks/{chunk-KJA7CRES.js → chunk-7SQN5IZR.js} +1 -1
  6. package/dist/chunks/{chunk-MS7MKBGJ.js → chunk-BP7BONZO.js} +664 -75
  7. package/dist/chunks/{chunk-L5SCNJKX.js → chunk-DACQKJ6O.js} +1 -1
  8. package/dist/chunks/{chunk-T7HVQ2WP.js → chunk-E2EY3DMS.js} +2 -2
  9. package/dist/chunks/{chunk-WJQJ7YEX.js → chunk-FAC4IFGQ.js} +2 -2
  10. package/dist/chunks/{minute-doc-4BA2R5EA.js → chunk-IBTGXLOT.js} +99 -16
  11. package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
  12. package/dist/chunks/{chunk-H6N6U2D6.js → chunk-SWFTWNWL.js} +7 -7
  13. package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
  14. package/dist/chunks/{chunk-Q7RXCK2Y.js → chunk-USYFVIUR.js} +22 -7
  15. package/dist/chunks/{chunk-WHI6YAUE.js → chunk-UZ2E3VNI.js} +1 -1
  16. package/dist/chunks/{chunk-AZC53XSQ.js → chunk-VNEU7OUN.js} +1 -1
  17. package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
  18. package/dist/chunks/{chunk-NZQRW4KL.js → chunk-Z44YFIN6.js} +2 -2
  19. package/dist/chunks/{chunk-R4PN3OFK.js → chunk-ZOTXXGUM.js} +7 -7
  20. package/dist/chunks/{cli-DFLV57LO.js → cli-WA7FOQKC.js} +10 -10
  21. package/dist/chunks/{conflict-72Q6DM4I.js → conflict-D4GVAURN.js} +2 -2
  22. package/dist/chunks/{contract-IRNRQ5FY.js → contract-GW7US3UF.js} +4399 -3547
  23. package/dist/chunks/{create-flow-UGTDI7SP.js → create-flow-ERDGW3FZ.js} +10 -6
  24. package/dist/chunks/{ehr-PHIBBUIG.js → ehr-P6T7OAAV.js} +1 -1
  25. package/dist/chunks/{entry-mode-5WOXFE67.js → entry-mode-SQU5WTX6.js} +3 -3
  26. package/dist/chunks/{env-H4ALHESA.js → env-DASBNSEM.js} +2 -2
  27. package/dist/chunks/{factory-COX6AVK7.js → factory-A3NAKZAA.js} +1 -1
  28. package/dist/chunks/{group-chat-ZIWQQO4G.js → group-chat-7SEAVAJR.js} +3 -3
  29. package/dist/chunks/{lazy-dispatch-MZ3EZYDL.js → lazy-dispatch-ZDKLS5MR.js} +3 -3
  30. package/dist/chunks/{meeting-XE6CTXYA.js → meeting-7AEQGBAT.js} +18 -12
  31. package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
  32. package/dist/chunks/{project-XREEXFU2.js → project-6PRGBLO2.js} +38 -14
  33. package/dist/chunks/{recruit-stage-TSQWOGQD.js → recruit-stage-TLZJUFHD.js} +543 -463
  34. package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
  35. package/dist/chunks/{registry-7UDUWYB5.js → registry-UVTI323K.js} +12 -11
  36. package/dist/chunks/{room-recommend-FO3HLPNB.js → room-recommend-ELEJUYBN.js} +4 -4
  37. package/dist/chunks/{schedule-DHNNOHVS.js → schedule-XBKY7VEA.js} +4 -4
  38. package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
  39. package/dist/chunks/{workflow-MAGCHWYZ.js → workflow-SYCBS5XD.js} +1 -1
  40. package/dist/index.js +3 -3
  41. package/dist/internal/update/service.js +9 -8
  42. package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
  43. package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
  44. package/dist/shortcuts/contract/data/report-renderers.js +75 -31
  45. package/dist/shortcuts/contract/data/report-spec.js +17 -3
  46. package/dist/shortcuts/contract/manifest.js +20 -3
  47. package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
  48. package/dist/shortcuts/contract/operations/collection-node.js +116 -1
  49. package/dist/shortcuts/contract/operations/compare-report.js +27 -5
  50. package/dist/shortcuts/contract/operations/credit-page.js +11 -2
  51. package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
  52. package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
  53. package/dist/shortcuts/contract/operations/elements-build.js +162 -30
  54. package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
  55. package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
  56. package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
  57. package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
  58. package/dist/shortcuts/contract/operations/ledger.js +88 -16
  59. package/dist/shortcuts/contract/operations/metrics.js +16 -3
  60. package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
  61. package/dist/shortcuts/contract/operations/page.js +23 -0
  62. package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
  63. package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
  64. package/dist/shortcuts/contract/operations/review-report.js +11 -3
  65. package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
  66. package/dist/shortcuts/contract/operations/triage.js +18 -3
  67. package/dist/shortcuts/contract/operations/viewlink.js +17 -1
  68. package/dist/shortcuts/ehr/operations/recruit.js +255 -90
  69. package/dist/shortcuts/meeting/confirm-gate.js +42 -0
  70. package/dist/shortcuts/meeting/continuation.js +6 -2
  71. package/dist/shortcuts/meeting/minute-doc.js +119 -12
  72. package/dist/shortcuts/meeting/operations/attachment.js +19 -0
  73. package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
  74. package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
  75. package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
  76. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
  77. package/dist/shortcuts/meeting/operations/group-share.js +268 -0
  78. package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
  79. package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
  80. package/dist/shortcuts/meeting/operations/registry.js +4 -0
  81. package/dist/shortcuts/project/operations/read.js +40 -15
  82. package/dist/shortcuts/recruit-stage/context.js +16 -81
  83. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
  84. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
  85. package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
  86. package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
  87. package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
  88. package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
  89. package/dist/shortcuts/recruit-stage/shared.js +153 -4
  90. package/dist/shortcuts/workflow/endpoints.js +2 -0
  91. package/dist/shortcuts/workflow/operations/form.js +11 -0
  92. package/dist/shortcuts/workflow/operations/read.js +24 -5
  93. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
  94. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
  95. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
  96. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
  97. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
  98. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
  99. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
  100. package/docs/project.md +1 -1
  101. package/package.json +1 -1
  102. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  103. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  104. package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
  105. package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
  106. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
  107. package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
  108. package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
  109. package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
  110. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
  111. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
  112. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
  113. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
  114. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
  115. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
  116. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
  117. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
  118. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
  119. package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
  120. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
  121. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
  122. package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
  123. package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
  124. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
  125. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
  126. package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
  127. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
  128. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
  129. package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
  130. package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
  131. package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
  132. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
  133. package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
  134. package/skills/weaver-e10-meeting/SKILL.md +203 -80
  135. package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
  136. package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
  137. package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
  138. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
  139. package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
  140. package/skills/weaver-e10-recruit-stage/SKILL.md +61 -58
  141. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +28 -25
  142. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +20 -14
  143. package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
  144. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +71 -25
  145. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
  146. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
  147. package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
  148. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +8 -5
  149. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
  150. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
  151. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +6 -6
  152. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
  153. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
  154. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
  155. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +2 -1
  156. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +1 -0
  157. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +1 -1
  158. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +10 -28
  159. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -0
  160. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -1
  161. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
  162. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
  163. package/skills/weaver-e10-recruit-stage/templates/match-report.html +14 -10
  164. package/skills/weaver-e10-shijingran/SKILL.md +2 -2
  165. package/skills/weaver-e10-shijingran/references/operations.md +5 -2
  166. package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
  167. package/skills/weaver-e10-workflow/SKILL.md +13 -9
  168. package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
  169. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
  170. package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
  171. package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
  172. package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
  173. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
  174. package/templates/meeting/minute.docx +0 -0
  175. package/skills/weaver-e10-yepiaotong.zip +0 -0
@@ -3,20 +3,26 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  listMeetingAttachments,
5
5
  meetingAttachmentContentOperations
6
- } from "./chunk-T7HVQ2WP.js";
6
+ } from "./chunk-E2EY3DMS.js";
7
+ import {
8
+ buildBodyParagraphsXml,
9
+ buildMinuteDocx
10
+ } from "./chunk-IBTGXLOT.js";
7
11
  import {
8
12
  PENDING_MARK,
9
- renderDocx
13
+ readDocxEntries,
14
+ renderDocx,
15
+ writeDocxEntries
10
16
  } from "./chunk-WMRNO6IU.js";
11
17
  import {
12
18
  meetingEbGroupChatOperations
13
- } from "./chunk-H6N6U2D6.js";
19
+ } from "./chunk-SWFTWNWL.js";
14
20
  import {
15
21
  meetingEntryOperations
16
- } from "./chunk-NZQRW4KL.js";
22
+ } from "./chunk-Z44YFIN6.js";
17
23
  import {
18
24
  meetingEbScheduleOperations
19
- } from "./chunk-WJQJ7YEX.js";
25
+ } from "./chunk-FAC4IFGQ.js";
20
26
  import {
21
27
  attachMeetingUrls,
22
28
  ensureFlowFieldIds,
@@ -27,27 +33,27 @@ import {
27
33
  resolvePersonTokens,
28
34
  resolveSelfPerson,
29
35
  resolveWorkflowId
30
- } from "./chunk-SQFKBWTR.js";
36
+ } from "./chunk-5VQ7JHV4.js";
31
37
  import {
32
38
  ebMeetingWritePreflight,
33
39
  meetingEbConflictOperations
34
- } from "./chunk-R4PN3OFK.js";
40
+ } from "./chunk-ZOTXXGUM.js";
35
41
  import {
36
42
  ebRoomRecommendOperation,
37
43
  inferRoomFloor,
38
44
  recommendRooms,
39
45
  rememberFrequentRoom
40
- } from "./chunk-Q7RXCK2Y.js";
46
+ } from "./chunk-USYFVIUR.js";
41
47
  import {
42
48
  cacheScopeSuffix,
43
49
  readCache,
44
50
  writeCache
45
- } from "./chunk-AZC53XSQ.js";
51
+ } from "./chunk-VNEU7OUN.js";
46
52
  import {
47
53
  meetingEnvOperations,
48
54
  meetingStateDir,
49
55
  resolveMeetingEnvMode
50
- } from "./chunk-KJA7CRES.js";
56
+ } from "./chunk-7SQN5IZR.js";
51
57
  import {
52
58
  EB_BASE,
53
59
  EB_ENDPOINTS,
@@ -79,7 +85,7 @@ import {
79
85
  toIdString,
80
86
  verifyLease,
81
87
  writeBody
82
- } from "./chunk-WHI6YAUE.js";
88
+ } from "./chunk-UZ2E3VNI.js";
83
89
  import {
84
90
  CONTINUATION_TTL_SECONDS
85
91
  } from "./chunk-7BDPM5ST.js";
@@ -1911,6 +1917,32 @@ import { createHash as createHash6 } from "node:crypto";
1911
1917
  import { createReadStream } from "node:fs";
1912
1918
  import { readFile as readFile2, stat } from "node:fs/promises";
1913
1919
  import { extname, resolve as resolve2 } from "node:path";
1920
+
1921
+ // src/shortcuts/meeting/confirm-gate.ts
1922
+ function decideDestructiveConfirm(input) {
1923
+ if (!input.destructive) return { allow: true, reason: "not_destructive" };
1924
+ if (input.confirm === true) return { allow: true, reason: "confirmed" };
1925
+ const details = (Array.isArray(input.details) ? input.details : []).filter((line) => line !== "");
1926
+ const tail = details.length > 0 ? `
1927
+ \u73B0\u72B6\uFF1A
1928
+ - ${details.join("\n- ")}` : "";
1929
+ return {
1930
+ allow: false,
1931
+ reason: "need_confirm",
1932
+ message: `${input.action}\uFF1A\u4F1A\u8986\u76D6\u5DF2\u6709\u6570\u636E\uFF0C\u5FC5\u987B\u663E\u5F0F\u4F20 confirm: true \u624D\u4F1A\u6267\u884C\u3002\u672C\u6B21\u672A\u505A\u4EFB\u4F55\u6539\u52A8\u3002${tail}`,
1933
+ details
1934
+ };
1935
+ }
1936
+ function requireDestructiveConfirm(input) {
1937
+ const decision = decideDestructiveConfirm(input);
1938
+ if (decision.allow) return;
1939
+ throw meetingValidationError("confirm_required", decision.message, {
1940
+ action: input.action,
1941
+ details: decision.details
1942
+ });
1943
+ }
1944
+
1945
+ // src/shortcuts/meeting/operations/attachment.ts
1914
1946
  var MAX_BYTES = 256 * 1024 * 1024;
1915
1947
  var MIME_BY_EXT = {
1916
1948
  ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
@@ -2219,6 +2251,10 @@ var meetingAttachmentAttach = {
2219
2251
  type: "array",
2220
2252
  items: { type: "string" },
2221
2253
  description: "\u53EF\u9009\uFF1A\u663E\u5F0F\u6307\u5B9A\u201C\u73B0\u6709\u9644\u4EF6 id\u201D\u3002\u4E0D\u4F20\u65F6 CLI \u81EA\u5DF1\u8BFB\uFF0C\u901A\u5E38\u4E0D\u9700\u8981\u586B"
2254
+ },
2255
+ confirm: {
2256
+ type: "boolean",
2257
+ description: '\u53EA\u6709 mode="replace" \u4E14\u4F1A\u8BAE\u5DF2\u6709\u9644\u4EF6\u65F6\u624D\u9700\u8981\uFF1A\u4E0D\u4F20\u4F1A\u88AB\u62D2\u7EDD\uFF08confirm_required\uFF09\uFF0C\u56E0\u4E3A\u90A3\u4F1A\u8986\u76D6\u6574\u4EFD\u9644\u4EF6\u5217\u8868\u3002append \u5929\u7136\u4E0D\u9700\u8981'
2222
2258
  }
2223
2259
  },
2224
2260
  required: ["id"]
@@ -2253,7 +2289,18 @@ var meetingAttachmentAttach = {
2253
2289
  if (mode === "append" && existingIds.length === 0) {
2254
2290
  existingIds.push(...beforeIds);
2255
2291
  }
2256
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
2292
+ if (mode === "replace" && beforeIds.length > 0) {
2293
+ requireDestructiveConfirm({
2294
+ confirm: args.confirm,
2295
+ destructive: true,
2296
+ action: "\u7528\u672C\u6B21\u6587\u4EF6\u8986\u76D6\u4F1A\u8BAE\u9644\u4EF6\u5217\u8868",
2297
+ details: [
2298
+ `\u73B0\u6709\u9644\u4EF6 ${beforeIds.length} \u4E2A${beforeIds.length > 0 ? `\uFF1A${beforeIds.slice(0, 5).join("\u3001")}${beforeIds.length > 5 ? " \u7B49" : ""}` : ""}`,
2299
+ `\u8986\u76D6\u540E\u8FD9\u4EFD\u5217\u8868\u91CC\u53EA\u5269\u672C\u6B21\u8FD9 1 \u4E2A\u6587\u4EF6`
2300
+ ]
2301
+ });
2302
+ }
2303
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
2257
2304
  const list = getMeetingOperation2("meeting.eb.meeting.list");
2258
2305
  let fileId = incomingFileId;
2259
2306
  let name = String(args.name ?? "").trim();
@@ -2341,7 +2388,7 @@ function textOf(value) {
2341
2388
  return value === void 0 || value === null ? "" : String(value);
2342
2389
  }
2343
2390
  async function readMinute(env, id) {
2344
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
2391
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
2345
2392
  const detail = getMeetingOperation2("meeting.eb.minute.detail");
2346
2393
  const result = await detail.handler({ id }, env);
2347
2394
  const row = result?.data?.data;
@@ -2385,6 +2432,10 @@ var meetingMinuteWriteContent = {
2385
2432
  with_doc: {
2386
2433
  type: "boolean",
2387
2434
  description: "\u5199\u5B8C\u5185\u5BB9\u540E\u662F\u5426\u751F\u6210 docx \u5E76\u6302\u5230 doc_file\uFF08\u9ED8\u8BA4 true\uFF09\u3002\u7CFB\u7EDF\u4E0D\u4F1A\u6839\u636E\u6B63\u6587\u81EA\u52A8\u51FA\u6587\u6863\uFF0C\u4E0D\u751F\u6210\u7EAA\u8981\u6587\u4EF6\u5B57\u6BB5\u5C31\u4E00\u76F4\u7A7A\u7740\uFF1B\u4F20 false \u53EF\u8DF3\u8FC7"
2435
+ },
2436
+ confirm: {
2437
+ type: "boolean",
2438
+ description: '\u53EA\u6709"\u8981\u8986\u76D6\u5DF2\u6709\u6B63\u6587/\u7EAA\u8981\u6587\u6848"\u65F6\u624D\u9700\u8981\uFF1A\u539F\u5B57\u6BB5\u975E\u7A7A\u4E14\u5185\u5BB9\u4E0D\u540C \u2192 \u4E0D\u4F20\u4F1A\u88AB\u62D2\u7EDD\uFF08confirm_required\uFF09\u3002\u9996\u6B21\u5199\u5165\uFF08\u539F\u5B57\u6BB5\u4E3A\u7A7A\uFF09\u6216\u5185\u5BB9\u76F8\u540C\u4E0D\u9700\u8981'
2388
2439
  }
2389
2440
  },
2390
2441
  required: ["id", "mt_id"]
@@ -2411,6 +2462,32 @@ var meetingMinuteWriteContent = {
2411
2462
  const patch = {};
2412
2463
  if (minutesContent !== void 0) patch.minutes_content = minutesContent;
2413
2464
  if (parseContent !== void 0) patch.parse_content = parseContent;
2465
+ const willWriteText = minutesContent !== void 0 && minutesContent.trim() !== "";
2466
+ const willWriteMinutes = parseContent !== void 0 && parseContent.trim() !== "";
2467
+ if (args.confirm !== true && (willWriteText || willWriteMinutes)) {
2468
+ if (!current) current = await readMinute(env, id);
2469
+ const details = [];
2470
+ if (willWriteText) {
2471
+ const oldText = textOf(current.minutes_content);
2472
+ const nextText = minutesContent;
2473
+ if (oldText.trim() !== "" && oldText.trim() !== nextText.trim()) {
2474
+ details.push(`\u7EAA\u8981\u539F\u6587\uFF1A\u73B0\u6709 ${oldText.length} \u5B57 \u2192 \u5C06\u66FF\u6362\u4E3A ${nextText.length} \u5B57`);
2475
+ }
2476
+ }
2477
+ if (willWriteMinutes) {
2478
+ const oldMinute = textOf(current.parse_content);
2479
+ const nextMinute = parseContent;
2480
+ if (oldMinute.trim() !== "" && oldMinute.trim() !== nextMinute.trim()) {
2481
+ details.push(`\u7EAA\u8981\u6587\u6848\uFF1A\u73B0\u6709 ${oldMinute.length} \u5B57 \u2192 \u5C06\u66FF\u6362\u4E3A ${nextMinute.length} \u5B57`);
2482
+ }
2483
+ }
2484
+ requireDestructiveConfirm({
2485
+ confirm: args.confirm,
2486
+ destructive: details.length > 0,
2487
+ action: "\u8986\u76D6\u8FD9\u6761\u7EAA\u8981\u7684\u5DF2\u6709\u5185\u5BB9",
2488
+ details
2489
+ });
2490
+ }
2414
2491
  let statusReason;
2415
2492
  if (args.minutes_status !== void 0) {
2416
2493
  patch.minutes_status = textOf(args.minutes_status);
@@ -2424,7 +2501,7 @@ var meetingMinuteWriteContent = {
2424
2501
  } else {
2425
2502
  statusReason = "\u4EC5\u6E05\u7A7A\u5185\u5BB9\uFF0C\u672A\u6539\u72B6\u6001";
2426
2503
  }
2427
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
2504
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
2428
2505
  const prepare = getMeetingOperation2("meeting.eb.minute.update.prepare");
2429
2506
  const apply = getMeetingOperation2("meeting.eb.minute.update.apply");
2430
2507
  const prepared = await prepare.handler({ id, mt_id: mtId, ...patch }, env);
@@ -2440,17 +2517,34 @@ var meetingMinuteWriteContent = {
2440
2517
  let minuteDoc = null;
2441
2518
  if (args.with_doc !== false) {
2442
2519
  try {
2443
- const { buildMinuteDocx } = await import("./minute-doc-4BA2R5EA.js");
2444
- const { meetingStateDir: meetingStateDir2 } = await import("./env-H4ALHESA.js");
2445
- const { mkdir: mkdir4, writeFile: writeFile4 } = await import("node:fs/promises");
2446
- const { join: join3 } = await import("node:path");
2520
+ const { generateMinuteDocViaEsb } = await import("./minute-doc-REI6RUE4.js");
2521
+ const esbBody = textOf(after.parse_content) || textOf(after.minutes_content);
2522
+ const esb = await generateMinuteDocViaEsb(env, { id, content: esbBody });
2523
+ if (esb.docId) {
2524
+ const check = await readMinute(env, id);
2525
+ const attached = textOf(check.mt_minutes).includes(esb.docId);
2526
+ minuteDoc = { docId: esb.docId, source: "esb", attached };
2527
+ if (!attached) warnings.push("ESB \u5DF2\u751F\u6210\u7EAA\u8981\u6587\u6863\uFF0C\u4F46 mt_minutes \u56DE\u8BFB\u4E3A\u7A7A\uFF0C\u8BF7\u7A0D\u540E\u590D\u67E5");
2528
+ } else if (esb.error) {
2529
+ warnings.push(`ESB \u751F\u6210\u7EAA\u8981\u6587\u6863\u672A\u6210\u529F\uFF08${esb.error}\uFF09\uFF0C\u6539\u7528\u672C\u5730 docx \u515C\u5E95`);
2530
+ }
2531
+ } catch (error) {
2532
+ warnings.push(`ESB \u751F\u6210\u7EAA\u8981\u6587\u6863\u5F02\u5E38\uFF08${String(error?.message ?? error).slice(0, 100)}\uFF09\uFF0C\u6539\u7528\u672C\u5730 docx \u515C\u5E95`);
2533
+ }
2534
+ }
2535
+ if (args.with_doc !== false && !minuteDoc) {
2536
+ try {
2537
+ const { buildMinuteDocx: buildMinuteDocx2 } = await import("./minute-doc-REI6RUE4.js");
2538
+ const { meetingStateDir: meetingStateDir2 } = await import("./env-DASBNSEM.js");
2539
+ const { mkdir: mkdir5, writeFile: writeFile5 } = await import("node:fs/promises");
2540
+ const { join: join4 } = await import("node:path");
2447
2541
  const subject = textOf(after.mt_minutes_subject).trim() || `\u4F1A\u8BAE\u7EAA\u8981-${mtId}`;
2448
2542
  const body = textOf(after.parse_content) || textOf(after.minutes_content);
2449
- const buf = buildMinuteDocx({ title: subject, meta: [`\u4F1A\u8BAE id\uFF1A${mtId}`], content: body });
2450
- const dir = join3(meetingStateDir2(env.ctx), "minute-docs");
2451
- await mkdir4(dir, { recursive: true });
2452
- const filePath = join3(dir, `${id}.docx`);
2453
- await writeFile4(filePath, buf);
2543
+ const buf = buildMinuteDocx2({ title: subject, meta: [`\u4F1A\u8BAE id\uFF1A${mtId}`], content: body });
2544
+ const dir = join4(meetingStateDir2(env.ctx), "minute-docs");
2545
+ await mkdir5(dir, { recursive: true });
2546
+ const filePath = join4(dir, `${id}.docx`);
2547
+ await writeFile5(filePath, buf);
2454
2548
  const upload = await getMeetingOperation2("meeting.attachment.upload").handler(
2455
2549
  { file: filePath, name: `${subject.replace(/[\\/:*?"<>|]+/g, "-")}.docx`, module: "meeting", refId: mtId },
2456
2550
  env
@@ -2476,9 +2570,9 @@ var meetingMinuteWriteContent = {
2476
2570
  warnings.push(`\u7EAA\u8981\u6587\u6863\u751F\u6210\u5931\u8D25\uFF08\u6B63\u6587\u4E0D\u53D7\u5F71\u54CD\uFF09\uFF1A${String(error?.message ?? error).slice(0, 120)}`);
2477
2571
  }
2478
2572
  }
2479
- if (args.with_doc !== false) {
2573
+ if (args.with_doc !== false && !minuteDoc) {
2480
2574
  try {
2481
- const { ensureMinuteDoc } = await import("./minute-doc-4BA2R5EA.js");
2575
+ const { ensureMinuteDoc } = await import("./minute-doc-REI6RUE4.js");
2482
2576
  const better = await ensureMinuteDoc(env, {
2483
2577
  id,
2484
2578
  mtId,
@@ -2746,16 +2840,16 @@ function buildDigest(messages, nameByUid, keepSystem, maxChars) {
2746
2840
  return { transcript, kept: lines.length, dropped, truncated };
2747
2841
  }
2748
2842
  async function saveTranscript(ctx, mtId, transcript) {
2749
- const { mkdir: mkdir4, writeFile: writeFile4 } = await import("node:fs/promises");
2750
- const { join: join3 } = await import("node:path");
2843
+ const { mkdir: mkdir5, writeFile: writeFile5 } = await import("node:fs/promises");
2844
+ const { join: join4 } = await import("node:path");
2751
2845
  const { stateDir } = await import("./state-Y2XBP6YE.js");
2752
- const dir = join3(stateDir(ctx), "transcripts");
2753
- await mkdir4(dir, { recursive: true });
2846
+ const dir = join4(stateDir(ctx), "transcripts");
2847
+ await mkdir5(dir, { recursive: true });
2754
2848
  const pad3 = (n) => String(n).padStart(2, "0");
2755
2849
  const now = /* @__PURE__ */ new Date();
2756
2850
  const stamp2 = `${now.getFullYear()}${pad3(now.getMonth() + 1)}${pad3(now.getDate())}-${pad3(now.getHours())}${pad3(now.getMinutes())}${pad3(now.getSeconds())}`;
2757
- const filePath = join3(dir, `${mtId}-${stamp2}.txt`);
2758
- await writeFile4(filePath, transcript, "utf8");
2851
+ const filePath = join4(dir, `${mtId}-${stamp2}.txt`);
2852
+ await writeFile5(filePath, transcript, "utf8");
2759
2853
  return filePath;
2760
2854
  }
2761
2855
  var meetingMinuteFromGroupChat = {
@@ -2849,7 +2943,7 @@ var meetingMinuteFromGroupChat = {
2849
2943
  const mtId = textOf2(args.mt_id).trim();
2850
2944
  if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
2851
2945
  const pipeline = ["text", "minutes", "document"].includes(args.pipeline) ? args.pipeline : "text";
2852
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
2946
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
2853
2947
  const ctx = env.ctx;
2854
2948
  let stepStart = Date.now();
2855
2949
  const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
@@ -2941,9 +3035,9 @@ var meetingMinuteFromGroupChat = {
2941
3035
  const extraSections = [];
2942
3036
  for (const file of extraFiles) {
2943
3037
  try {
2944
- const { readFile: readFile4 } = await import("node:fs/promises");
2945
- const buffer = await readFile4(file);
2946
- const { extractText } = await import("./attachment-content-24RL44SE.js");
3038
+ const { readFile: readFile5 } = await import("node:fs/promises");
3039
+ const buffer = await readFile5(file);
3040
+ const { extractText } = await import("./attachment-content-TFOC3Y3X.js");
2947
3041
  const extracted = extractText(buffer, file, "");
2948
3042
  if (extracted.text.trim()) {
2949
3043
  extraSections.push(`\u3010\u6750\u6599\uFF1A${file.split(/[\\/]/).pop() ?? file}\u3011
@@ -3118,21 +3212,21 @@ ${groupTranscript}` : ""
3118
3212
  if (args.with_doc !== false) {
3119
3213
  const docStarted = Date.now();
3120
3214
  try {
3121
- const { buildMinuteDocx } = await import("./minute-doc-4BA2R5EA.js");
3122
- const { meetingStateDir: meetingStateDir2 } = await import("./env-H4ALHESA.js");
3123
- const { mkdir: mkdir4, writeFile: writeFile4 } = await import("node:fs/promises");
3124
- const { join: join3 } = await import("node:path");
3215
+ const { buildMinuteDocx: buildMinuteDocx2 } = await import("./minute-doc-REI6RUE4.js");
3216
+ const { meetingStateDir: meetingStateDir2 } = await import("./env-DASBNSEM.js");
3217
+ const { mkdir: mkdir5, writeFile: writeFile5 } = await import("node:fs/promises");
3218
+ const { join: join4 } = await import("node:path");
3125
3219
  const body = textOf2(row.parse_content) || textOf2(row.minutes_content) || transcript;
3126
3220
  const meta = [
3127
3221
  `\u4F1A\u8BAE\uFF1A${textOf2(meeting.mt_name)}`,
3128
3222
  ...meeting.begin_datetime ? [`\u65F6\u95F4\uFF1A${textOf2(meeting.begin_datetime)} ~ ${textOf2(meeting.end_datetime)}`] : [],
3129
3223
  ...meeting.address ? [`\u5730\u70B9\uFF1A${textOf2(meeting.address)}`] : []
3130
3224
  ];
3131
- const buf = buildMinuteDocx({ title: subject, meta, content: body });
3132
- const dir = join3(meetingStateDir2(env.ctx), "minute-docs");
3133
- await mkdir4(dir, { recursive: true });
3134
- const filePath = join3(dir, `${minuteId}.docx`);
3135
- await writeFile4(filePath, buf);
3225
+ const buf = buildMinuteDocx2({ title: subject, meta, content: body });
3226
+ const dir = join4(meetingStateDir2(env.ctx), "minute-docs");
3227
+ await mkdir5(dir, { recursive: true });
3228
+ const filePath = join4(dir, `${minuteId}.docx`);
3229
+ await writeFile5(filePath, buf);
3136
3230
  const upload = await getMeetingOperation2("meeting.attachment.upload").handler(
3137
3231
  { file: filePath, name: `${subject.replace(/[\\/:*?"<>|]+/g, "-")}.docx`, module: "meeting", refId: mtId },
3138
3232
  env
@@ -3306,7 +3400,7 @@ var meetingDecisionNotifyGroup = {
3306
3400
  const warnings = [];
3307
3401
  const mtId = textOf3(args.mt_id).trim();
3308
3402
  if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
3309
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
3403
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
3310
3404
  const ctx = env.ctx;
3311
3405
  const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
3312
3406
  { mt_id: mtId, pageNo: 1, pageSize: 1 },
@@ -3519,7 +3613,7 @@ async function waitForTaskIncrease(fetchTotal, baseline, timeoutMs = 15e3, inter
3519
3613
  const start = Date.now();
3520
3614
  let total = baseline;
3521
3615
  while (Date.now() - start < timeoutMs) {
3522
- await new Promise((resolve5) => setTimeout(resolve5, intervalMs));
3616
+ await new Promise((resolve6) => setTimeout(resolve6, intervalMs));
3523
3617
  total = await fetchTotal();
3524
3618
  if (total > baseline) return { total, waitedMs: Date.now() - start, increased: true };
3525
3619
  }
@@ -3608,7 +3702,7 @@ var meetingPipelineRun = {
3608
3702
  const needsConfirm = level === "tasks" || level === "notify";
3609
3703
  const confirmed = args.confirm === true;
3610
3704
  const executedLevel = needsConfirm && !confirmed ? "document" : level;
3611
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
3705
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
3612
3706
  const ctx = env.ctx;
3613
3707
  let stepStart = Date.now();
3614
3708
  const reuseMinuteId = textOf4(args.minuteId).trim();
@@ -3980,7 +4074,7 @@ function formatTimeRange(start, end) {
3980
4074
  }
3981
4075
  async function loadAgendaFromTopics(env, mtId) {
3982
4076
  try {
3983
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
4077
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
3984
4078
  const operation = getMeetingOperation2("meeting.eb.topic.list");
3985
4079
  const result = await operation.handler({ mt_id: mtId, pageNo: 1, pageSize: 200 }, env);
3986
4080
  const rows = result.data?.rows ?? [];
@@ -4131,7 +4225,7 @@ async function supplementRowFromDetail(row, mtId, env) {
4131
4225
  const missing = DETAIL_FALLBACK_KEYS.filter((key) => isBlank(row[key]));
4132
4226
  if (missing.length === 0) return { row, filled: [] };
4133
4227
  try {
4134
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
4228
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
4135
4229
  const detailOperation = getMeetingOperation2("meeting.eb.meeting.detail");
4136
4230
  const result = await detailOperation.handler({ id: mtId }, env);
4137
4231
  const flat = result?.data?.data ?? result?.data ?? {};
@@ -4306,7 +4400,7 @@ var meetingInvitationRender = {
4306
4400
  };
4307
4401
  dataSource = "payload";
4308
4402
  } else {
4309
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
4403
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
4310
4404
  const listOperation = getMeetingOperation2("meeting.eb.meeting.list");
4311
4405
  try {
4312
4406
  const listed = await listOperation.handler({ mt_id: mtId, pageNo: 1, pageSize: 1 }, env);
@@ -4654,7 +4748,7 @@ var meetingInvitationPublish = {
4654
4748
  "\u4F1A\u771F\u5B9E\u521B\u5EFA\u6587\u6863\uFF0C\u5FC5\u987B\u663E\u5F0F\u4F20 confirm: true\uFF08\u53EF\u5148\u4E0D\u5E26 confirm \u8C03 meeting.invitation.render \u9884\u89C8\u6B63\u6587\uFF09"
4655
4749
  );
4656
4750
  }
4657
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
4751
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
4658
4752
  const render = getMeetingOperation2("meeting.invitation.render");
4659
4753
  const rendered = await render.handler(
4660
4754
  {
@@ -4732,9 +4826,483 @@ var meetingInvitationPublish = {
4732
4826
  };
4733
4827
  var meetingInvitationPublishOperations = [meetingInvitationPublish];
4734
4828
 
4829
+ // src/shortcuts/meeting/operations/minute-export.ts
4830
+ import { mkdir as mkdir3, readFile as readFile4, writeFile as writeFile3 } from "node:fs/promises";
4831
+ import { dirname as dirname2, join as join2, resolve as resolve4 } from "node:path";
4832
+ import { existsSync as existsSync3 } from "node:fs";
4833
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
4834
+ var BODY_MARK = "@@\u6B63\u6587@@";
4835
+ function templatePath2() {
4836
+ const override = process.env.WEAVER_MEETING_MINUTE_TEMPLATE;
4837
+ if (override && override.trim() !== "") return resolve4(override);
4838
+ let dir = dirname2(fileURLToPath2(import.meta.url));
4839
+ for (let i = 0; i < 8; i += 1) {
4840
+ const candidate = join2(dir, "templates/meeting/minute.docx");
4841
+ if (existsSync3(candidate)) return candidate;
4842
+ const parent = dirname2(dir);
4843
+ if (parent === dir) break;
4844
+ dir = parent;
4845
+ }
4846
+ return join2(dir, "templates/meeting/minute.docx");
4847
+ }
4848
+ function inferFolderType(folderId) {
4849
+ if (folderId === "100") return "sys";
4850
+ if (folderId === "200") return "company";
4851
+ if (folderId === "300") return "privy";
4852
+ return "";
4853
+ }
4854
+ function visibilityOf(folderType) {
4855
+ if (folderType === "privy") return "\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF08\u4E2A\u4EBA\u77E5\u8BC6\u5E93\uFF09";
4856
+ if (folderType === "company") return "\u672C\u79DF\u6237\u53EF\u89C1\uFF08\u516C\u5171\u77E5\u8BC6\u5E93\uFF09";
4857
+ if (folderType === "sys") return "\u7CFB\u7EDF\u77E5\u8BC6\u5E93";
4858
+ return "\u672A\u77E5";
4859
+ }
4860
+ function safeName(input) {
4861
+ return String(input || "\u4F1A\u8BAE\u7EAA\u8981").replace(/[\\/:*?"<>|]+/g, "-").replace(/\s+/g, " ").trim().slice(0, 80) || "\u4F1A\u8BAE\u7EAA\u8981";
4862
+ }
4863
+ function injectMinuteBody(documentXml, content) {
4864
+ const bodyXml = buildBodyParagraphsXml(content, { body: 22, heading: 32, cell: 20 });
4865
+ const paragraphs = documentXml.split(/(?=<w:p[ >])/);
4866
+ let replaced = false;
4867
+ const out = paragraphs.map((chunk2) => {
4868
+ if (replaced || !chunk2.includes(BODY_MARK)) return chunk2;
4869
+ replaced = true;
4870
+ const tail = chunk2.slice(chunk2.indexOf("</w:p>") + "</w:p>".length);
4871
+ return bodyXml + tail;
4872
+ });
4873
+ return replaced ? out.join("") : documentXml;
4874
+ }
4875
+ var minuteExportOperations = [
4876
+ {
4877
+ name: "meeting.minute.exportDoc",
4878
+ resource: "minute",
4879
+ method: "exportDoc",
4880
+ action: "meeting.minute.exportDoc",
4881
+ summary: "\u628A\u4F1A\u8BAE\u8BB0\u5F55\u6574\u7406\u6210\u6807\u51C6\u7248\u5F0F\u7EAA\u8981\u6587\u6863\u5E76\u4E0A\u4F20\uFF1A\u6309\u6A21\u677F templates/meeting/minute.docx \u6E32\u67D3\uFF08\u6807\u9898/\u62AC\u5934\u680F/\u6B63\u6587\u5206\u7EA7\uFF09\uFF0C\u751F\u6210 docx \u5E76\u4F20\u6587\u6863\u4E2D\u5FC3 300 \u76EE\u5F55\uFF0C\u8FD4\u56DE\u6587\u6863 id \u4E0E\u672C\u5730\u8DEF\u5F84\u3002**\u4E0D\u9700\u8981\u4F1A\u8BAE id**\u2014\u2014\u7CFB\u7EDF\u91CC\u6CA1\u6709\u8FD9\u573A\u4F1A\u4E5F\u80FD\u51FA\u6587\u6863",
4882
+ capability: "minute",
4883
+ risk: "read-before-write",
4884
+ inputSchema: {
4885
+ type: "object",
4886
+ additionalProperties: false,
4887
+ properties: {
4888
+ subject: { type: "string", minLength: 1, description: "\u7EAA\u8981\u6807\u9898\uFF08=\u6587\u6863\u540D\uFF09\uFF0C\u5982\u300C\u4E1C\u822A\u9879\u76EE\u6C9F\u901A\u4F1A\u4F1A\u8BAE\u7EAA\u8981\u300D" },
4889
+ content: { type: "string", minLength: 1, description: "\u6B63\u6587\uFF08markdown\uFF09\uFF1A## \u8BA8\u8BBA\u4E0E\u7ED3\u8BBA / ## \u4F1A\u8BAE\u51B3\u8BAE / ## \u5F85\u529E\u4E8B\u9879" },
4890
+ mt_name: { type: "string", description: "\u62AC\u5934\u300C\u4F1A\u8BAE\u4E3B\u9898\u300D\uFF1B\u4E0D\u4F20\u5219\u7528 subject" },
4891
+ begin_datetime: { type: "string", description: "\u62AC\u5934\u300C\u4F1A\u8BAE\u65F6\u95F4\u300D\u8D77\uFF08yyyy-MM-dd HH:mm\uFF09\uFF1B\u53EA\u5728\u8BB0\u5F55\u91CC\u6709\u65F6\u624D\u4F20" },
4892
+ end_datetime: { type: "string", description: "\u62AC\u5934\u300C\u4F1A\u8BAE\u65F6\u95F4\u300D\u6B62" },
4893
+ address: { type: "string", description: "\u62AC\u5934\u300C\u4F1A\u8BAE\u5730\u70B9\u300D" },
4894
+ host: { type: "string", description: "\u62AC\u5934\u300C\u4E3B\u6301\u4EBA\u300D" },
4895
+ recorder: { type: "string", description: "\u62AC\u5934\u300C\u8BB0\u5F55\u4EBA\u300D\uFF0C\u9ED8\u8BA4\u5F53\u524D\u767B\u5F55\u4EBA" },
4896
+ hrm_members: { type: "string", description: "\u62AC\u5934\u300C\u53C2\u4F1A\u4EBA\u5458\u300D\uFF0C\u9017\u53F7\u5206\u9694" },
4897
+ crm_members: { type: "string", description: "\u62AC\u5934\u300C\u53C2\u4F1A\u5BA2\u6237\u300D" },
4898
+ folder_id: { type: "string", description: "\u6587\u6863\u4E2D\u5FC3\u76EE\u5F55 id\uFF0C\u9ED8\u8BA4 300\uFF08\u4E2A\u4EBA\u77E5\u8BC6\u5E93\uFF09\uFF1B200=\u516C\u5171\u77E5\u8BC6\u5E93\u3001100=\u7CFB\u7EDF\u77E5\u8BC6\u5E93" },
4899
+ folder_type: {
4900
+ type: "string",
4901
+ enum: ["company", "privy", "sys"],
4902
+ description: "\u76EE\u5F55\u7C7B\u578B\uFF1B\u7701\u7565\u65F6\u6309 folder_id \u63A8\u65AD\uFF08300\u2192privy\u3001200\u2192company\u3001100\u2192sys\uFF09"
4903
+ }
4904
+ },
4905
+ required: ["subject", "content"]
4906
+ },
4907
+ handler: async (args, env) => {
4908
+ const startedAt = Date.now();
4909
+ const subject = String(args.subject ?? "").trim();
4910
+ const content = String(args.content ?? "").trim();
4911
+ if (!subject) throw meetingValidationError("subject_required", "\u5FC5\u987B\u63D0\u4F9B\u7EAA\u8981\u6807\u9898\uFF08subject\uFF09");
4912
+ if (!content) throw meetingValidationError("content_required", "\u5FC5\u987B\u63D0\u4F9B\u6B63\u6587\uFF08content\uFF09");
4913
+ const session = await env.host.getSession().catch(() => null);
4914
+ let loginName = String(session?.userName ?? session?.name ?? "").trim();
4915
+ const warnings = [];
4916
+ let recorder = String(args.recorder ?? "").trim() || loginName;
4917
+ if (!recorder) {
4918
+ try {
4919
+ const { executeCaizhilianOperation } = await import("./operations-4P2UYVLH.js");
4920
+ const { createCaizhilianHost } = await import("./host-OT4KNR3G.js");
4921
+ const { createCaizhilianContinuationSigner } = await import("./continuation-GW6PRWK3.js");
4922
+ const probeEnv = {
4923
+ ...env,
4924
+ host: createCaizhilianHost(env.ctx),
4925
+ continuation: createCaizhilianContinuationSigner(env.ctx)
4926
+ };
4927
+ const who = await executeCaizhilianOperation("caizhilian.user.current", {}, probeEnv);
4928
+ const name = String(who?.data?.employeeName ?? who?.data?.name ?? who?.data?.userName ?? "").trim();
4929
+ if (name) {
4930
+ recorder = name;
4931
+ loginName = name;
4932
+ }
4933
+ } catch {
4934
+ }
4935
+ }
4936
+ if (!recorder) {
4937
+ recorder = "\u672A\u8BB0\u5F55";
4938
+ warnings.push("\u8BB0\u5F55\u4EBA\u672A\u53D6\u5230\u5F53\u524D\u767B\u5F55\u4EBA\u59D3\u540D\uFF0C\u5DF2\u586B\u300C\u672A\u8BB0\u5F55\u300D\uFF1B\u8981\u5199\u5177\u4F53\u4EBA\u8BF7\u663E\u5F0F\u4F20 recorder");
4939
+ }
4940
+ const tplPath = templatePath2();
4941
+ let template = null;
4942
+ try {
4943
+ template = await readFile4(tplPath);
4944
+ } catch {
4945
+ template = null;
4946
+ warnings.push(
4947
+ `\u7EAA\u8981\u6A21\u677F\u672A\u968F CLI \u5305\u627E\u5230\uFF08${tplPath}\uFF09\uFF0C\u672C\u6B21\u7528\u5185\u7F6E\u7248\u5F0F\u751F\u6210\uFF1B\u91CD\u65B0\u5B89\u88C5 CLI \u53EF\u6062\u590D\u6807\u51C6\u6A21\u677F\u7248\u5F0F\u3002`
4948
+ );
4949
+ }
4950
+ const values = {
4951
+ mt_name: String(args.mt_name ?? "").trim() || subject,
4952
+ begin_datetime: String(args.begin_datetime ?? "").trim() || "\u672A\u8BB0\u5F55",
4953
+ end_datetime: String(args.end_datetime ?? "").trim() || "\u672A\u8BB0\u5F55",
4954
+ address: String(args.address ?? "").trim() || "\u672A\u8BB0\u5F55",
4955
+ host: String(args.host ?? "").trim() || "\u672A\u8BB0\u5F55",
4956
+ recorder,
4957
+ hrm_members: String(args.hrm_members ?? "").trim() || "\u672A\u8BB0\u5F55",
4958
+ crm_members: String(args.crm_members ?? "").trim() || "\u65E0"
4959
+ };
4960
+ let buffer;
4961
+ let filledKeys = [];
4962
+ if (template) {
4963
+ const rendered = renderDocx(template, (key) => ({ text: values[key] ?? "" }));
4964
+ filledKeys = rendered.filled;
4965
+ const entries = readDocxEntries(rendered.buffer).map((entry) => entry.name === "word/document.xml" ? { name: entry.name, data: Buffer.from(injectMinuteBody(entry.data.toString("utf8"), content), "utf8") } : entry);
4966
+ buffer = writeDocxEntries(entries);
4967
+ if (rendered.pending.length > 0) {
4968
+ warnings.push(`\u6A21\u677F\u91CC\u6709\u672A\u586B\u5145\u7684\u5360\u4F4D\u7B26\uFF1A${rendered.pending.join("\u3001")}\uFF08\u5DF2\u7559\u7A7A\uFF0C\u68C0\u67E5\u6A21\u677F\u662F\u5426\u65B0\u589E\u4E86\u5B57\u6BB5\uFF09`);
4969
+ }
4970
+ } else {
4971
+ buffer = buildMinuteDocx({
4972
+ title: subject,
4973
+ meta: [
4974
+ `\u4F1A\u8BAE\u4E3B\u9898\uFF1A${values.mt_name}`,
4975
+ `\u4F1A\u8BAE\u65F6\u95F4\uFF1A${values.begin_datetime} ~ ${values.end_datetime}`,
4976
+ `\u4F1A\u8BAE\u5730\u70B9\uFF1A${values.address}`,
4977
+ `\u4E3B\u6301\u4EBA\uFF1A${values.host}`,
4978
+ `\u8BB0\u5F55\u4EBA\uFF1A${values.recorder}`,
4979
+ `\u53C2\u4F1A\u4EBA\u5458\uFF1A${values.hrm_members}`,
4980
+ `\u53C2\u4F1A\u5BA2\u6237\uFF1A${values.crm_members}`
4981
+ ],
4982
+ content
4983
+ });
4984
+ }
4985
+ const fileName = safeName(subject);
4986
+ const dir = join2(meetingStateDir(env.ctx), "minute-docs");
4987
+ await mkdir3(dir, { recursive: true });
4988
+ const filePath = join2(dir, `${fileName}.docx`);
4989
+ await writeFile3(filePath, buffer);
4990
+ let docId = "";
4991
+ let docError = "";
4992
+ let targetFolderId = "300";
4993
+ let targetFolderType = "company";
4994
+ let caizhilianEnvRef = null;
4995
+ try {
4996
+ const { executeCaizhilianOperation } = await import("./operations-4P2UYVLH.js");
4997
+ const { createCaizhilianHost } = await import("./host-OT4KNR3G.js");
4998
+ const { createCaizhilianContinuationSigner } = await import("./continuation-GW6PRWK3.js");
4999
+ const caizhilianEnv = {
5000
+ ...env,
5001
+ host: createCaizhilianHost(env.ctx),
5002
+ continuation: createCaizhilianContinuationSigner(env.ctx)
5003
+ };
5004
+ const folderId = String(args.folder_id ?? "").trim() || "300";
5005
+ const folderType = String(args.folder_type ?? "").trim() || inferFolderType(folderId) || "company";
5006
+ targetFolderId = folderId;
5007
+ targetFolderType = folderType;
5008
+ caizhilianEnvRef = caizhilianEnv;
5009
+ const base = {
5010
+ file_path: (await import("node:path")).win32.normalize(filePath),
5011
+ name: fileName,
5012
+ folder_id: folderId,
5013
+ folder_type: folderType,
5014
+ author_id: String(session?.userId ?? "").trim()
5015
+ };
5016
+ const prepared = await executeCaizhilianOperation(
5017
+ "caizhilian.document.create-office.prepare",
5018
+ base,
5019
+ caizhilianEnv
5020
+ );
5021
+ const continuation = String(prepared?.data?.continuation ?? "");
5022
+ if (continuation) {
5023
+ const applied = await executeCaizhilianOperation(
5024
+ "caizhilian.document.create-office.apply",
5025
+ { ...base, continuation, confirm: true },
5026
+ caizhilianEnv
5027
+ );
5028
+ docId = String(applied?.data?.doc_id ?? "").trim();
5029
+ }
5030
+ } catch (error) {
5031
+ docError = String(error?.message ?? error).slice(0, 200);
5032
+ }
5033
+ if (!docId) {
5034
+ warnings.push(
5035
+ `\u6587\u6863\u4E2D\u5FC3\u672A\u8FD4\u56DE\u6587\u6863 id${docError ? `\uFF08${docError}\uFF09` : ""}\uFF1Bdocx \u5DF2\u843D\u672C\u5730\uFF0C\u6587\u4EF6\u540D\u53EF\u76F4\u63A5\u7528\u4E8E\u4E0A\u4F20`
5036
+ );
5037
+ }
5038
+ let docFolder = null;
5039
+ let docStatus = null;
5040
+ let contentType = "";
5041
+ if (docId && caizhilianEnvRef) {
5042
+ try {
5043
+ const { executeCaizhilianOperation } = await import("./operations-4P2UYVLH.js");
5044
+ const got = await executeCaizhilianOperation(
5045
+ "caizhilian.document.get",
5046
+ { doc_id: docId },
5047
+ caizhilianEnvRef
5048
+ );
5049
+ const info = got?.data ?? {};
5050
+ docStatus = typeof info.docStatus === "number" ? info.docStatus : null;
5051
+ contentType = String(info.contentType ?? "");
5052
+ const first = Array.isArray(info.parentFolders) ? info.parentFolders[0] : null;
5053
+ if (first) {
5054
+ docFolder = { id: String(first.id ?? ""), name: String(first.name ?? ""), type: String(first.type ?? "") };
5055
+ }
5056
+ } catch (error) {
5057
+ warnings.push(`\u6587\u6863\u5DF2\u521B\u5EFA\uFF08${docId}\uFF09\uFF0C\u4F46\u56DE\u67E5\u76EE\u5F55\u5931\u8D25\uFF1A${String(error?.message ?? error).slice(0, 120)}`);
5058
+ }
5059
+ }
5060
+ if (docFolder && docFolder.id !== targetFolderId) {
5061
+ warnings.push(`\u76EE\u6807\u76EE\u5F55\u662F ${targetFolderId}\uFF0C\u5B9E\u9645\u843D\u5728 ${docFolder.id}\uFF08${docFolder.name}\uFF09\u2014\u2014\u8BF7\u786E\u8BA4\u662F\u5426\u6709\u6743\u9650`);
5062
+ }
5063
+ return meetingSuccess("meeting.minute.exportDoc", {
5064
+ subject,
5065
+ fileName: `${fileName}.docx`,
5066
+ filePath,
5067
+ size: buffer.length,
5068
+ docId,
5069
+ docError,
5070
+ folderId: targetFolderId,
5071
+ folderType: docFolder?.type || targetFolderType,
5072
+ folderName: docFolder?.name ?? "",
5073
+ folderPath: docFolder?.name ?? "",
5074
+ visibility: visibilityOf(docFolder?.type || targetFolderType),
5075
+ docStatus,
5076
+ contentType,
5077
+ templatePath: tplPath,
5078
+ filled: filledKeys,
5079
+ durationMs: Date.now() - startedAt
5080
+ }, { warnings });
5081
+ }
5082
+ }
5083
+ ];
5084
+
5085
+ // src/shortcuts/meeting/operations/group-share.ts
5086
+ import { basename } from "node:path";
5087
+ function splitList(raw) {
5088
+ return String(raw ?? "").split(/[,,、;;\s]+/).map((item) => item.trim()).filter((item) => item !== "");
5089
+ }
5090
+ async function runImWrite(imEnv, prepareName, applyName, input) {
5091
+ const { getImOperation } = await import("./registry-AC33ZZVH.js");
5092
+ const prepared = await getImOperation(prepareName).handler(input, imEnv);
5093
+ const continuation = String(prepared?.continuation ?? prepared?.data?.continuation ?? "");
5094
+ if (!continuation) {
5095
+ return {
5096
+ ok: false,
5097
+ data: {},
5098
+ error: String(prepared?.error?.message ?? "\u672A\u62FF\u5230 continuation\uFF08prepare \u672A\u901A\u8FC7\uFF09").slice(0, 200)
5099
+ };
5100
+ }
5101
+ const applied = await getImOperation(applyName).handler(
5102
+ { continuation, confirm: true },
5103
+ imEnv
5104
+ );
5105
+ return {
5106
+ ok: applied?.ok === true,
5107
+ data: applied?.data ?? {},
5108
+ error: String(applied?.error?.message ?? "").slice(0, 200)
5109
+ };
5110
+ }
5111
+ var groupShareOperations = [
5112
+ {
5113
+ name: "meeting.group.shareMinutes",
5114
+ resource: "meeting",
5115
+ method: "group.shareMinutes",
5116
+ action: "meeting.group.shareMinutes",
5117
+ summary: "\u5EFA\u4F1A\u8BAE\u7FA4\u5E76\u628A\u7EAA\u8981\u6587\u6863 + \u5F85\u529E\u53D1\u8FDB\u7FA4\uFF08\u53EF @ \u5177\u4F53\u4EBA\uFF09\uFF1A\u6309\u4F1A\u8BAE\u540D\u5EFA\u7FA4\uFF0C\u6210\u5458\u7528\u59D3\u540D/\u5DE5\u53F7\uFF1B\u5DF2\u6709\u7FA4\u65F6\u4F20 group_id \u8DF3\u8FC7\u5EFA\u7FA4\u3002\u5199\u64CD\u4F5C\uFF0C\u53D1\u9001\u524D\u5148\u8BA9\u7528\u6237\u786E\u8BA4\u7FA4\u540D\u4E0E\u6210\u5458",
5118
+ capability: "minute",
5119
+ risk: "high-risk-write",
5120
+ inputSchema: {
5121
+ type: "object",
5122
+ additionalProperties: false,
5123
+ properties: {
5124
+ mt_name: { type: "string", description: "\u4F1A\u8BAE\u540D\uFF08\u7FA4\u540D\u9ED8\u8BA4\u7528\u5B83\uFF0C\u5982\u300CAI \u8D8B\u52BF\u8BA8\u8BBA\u4F1A\u300D\uFF09" },
5125
+ group_name: { type: "string", description: "\u7FA4\u540D\uFF1B\u4E0D\u4F20\u5219\u7528 mt_name \u6216\u300C\u4F1A\u8BAE\u7FA4-MMDD\u300D" },
5126
+ members: {
5127
+ type: "string",
5128
+ description: "\u7FA4\u6210\u5458\uFF1A\u59D3\u540D\u6216\u5458\u5DE5 id\uFF0C\u9017\u53F7/\u987F\u53F7\u5206\u9694\uFF08\u5982\u300C\u9C81\u4E91\u806A\u3001\u738B\u4E39\u4E39\u300D\uFF09\uFF1B\u81F3\u5C11\u8981\u4F20\u5F53\u524D\u767B\u5F55\u4EBA\u4EE5\u5916\u7684\u4EBA"
5129
+ },
5130
+ message: {
5131
+ type: "string",
5132
+ description: "\u53D1\u5230\u7FA4\u91CC\u7684\u5F00\u5934\u8BED\uFF08\u4E00\u4E24\u53E5\u8BDD\uFF0C\u5982\u300C\u4F1A\u8BAE\u7EAA\u8981\u4E0E\u5F85\u529E\u5DF2\u4E0A\u4F20\uFF0C\u8BF7\u6309\u5206\u5DE5\u63A8\u8FDB\u300D\uFF09\u3002\u26D4 \u5F85\u529E\u4E0D\u8981\u585E\u5728\u8FD9\u4E32\u91CC \u2014\u2014 \u7528 tasks\uFF0C\u5426\u5219\u4E00\u5806\u4EFB\u52A1\u88AB\u300C\uFF1B\u300D\u8FDE\u6210\u4E00\u884C\uFF0C\u7FA4\u91CC\u770B\u7740\u6CA1\u6709\u6362\u884C"
5133
+ },
5134
+ tasks: {
5135
+ type: "array",
5136
+ description: "\u5F85\u529E\u6E05\u5355\uFF1ACLI \u62FC\u6210\u300C@\u8D23\u4EFB\u4EBA\uFF1A\u4E8B\u9879\uFF08\u671F\u9650\uFF09\u300D\uFF0C**\u4E00\u884C\u4E00\u6761**\uFF0C\u5E76\u81EA\u52A8\u628A\u8FD9\u4E9B\u8D23\u4EFB\u4EBA\u52A0\u5165 @ \u5217\u8868",
5137
+ items: {
5138
+ type: "object",
5139
+ properties: {
5140
+ owner: { type: "string", description: "\u8D23\u4EFB\u4EBA\u59D3\u540D\uFF08\u5E94\u5728 members \u91CC\uFF0C\u5426\u5219 @ \u4E0D\u751F\u6548\uFF09" },
5141
+ content: { type: "string", description: "\u8981\u505A\u7684\u4E8B" },
5142
+ due: { type: "string", description: "\u671F\u9650\u6216\u4EA4\u4ED8\u7269\uFF0C\u53EF\u7701\u7565" }
5143
+ },
5144
+ required: ["content"]
5145
+ }
5146
+ },
5147
+ file_path: { type: "string", description: "\u8981\u53D1\u8FDB\u7FA4\u7684\u672C\u5730\u6587\u4EF6\uFF08\u901A\u5E38\u662F\u7EAA\u8981 docx \u7684 filePath\uFF09" },
5148
+ at_members: {
5149
+ type: "string",
5150
+ description: "@ \u8C01\uFF1A\u59D3\u540D\u6216 id\uFF0C\u9017\u53F7\u5206\u9694\uFF1B\u9ED8\u8BA4 = members\u3002\u26D4 \u5FC5\u987B\u662F\u7FA4\u6210\u5458\uFF0C\u5426\u5219\u53D1\u9001\u4F1A\u88AB\u62D2"
5151
+ },
5152
+ at_all: { type: "boolean", description: "true \u65F6 @\u5168\u4F53\u6210\u5458\uFF08\u4EC5\u6587\u672C\u6D88\u606F\u751F\u6548\uFF09" },
5153
+ group_id: { type: "string", description: "\u5DF2\u6709\u7FA4 id\uFF1A\u4F20\u4E86\u5C31\u4E0D\u518D\u5EFA\u7FA4\uFF0C\u76F4\u63A5\u5F80\u91CC\u53D1" },
5154
+ dry_run: { type: "boolean", description: "true \u65F6\u53EA\u6821\u9A8C\u6210\u5458\u3001\u8FD4\u56DE\u5C06\u8981\u6267\u884C\u7684\u6B65\u9AA4\uFF0C\u4E0D\u771F\u7684\u5EFA\u7FA4/\u53D1\u9001" }
5155
+ },
5156
+ required: []
5157
+ },
5158
+ handler: async (args, env) => {
5159
+ const startedAt = Date.now();
5160
+ const warnings = [];
5161
+ const mtName = String(args.mt_name ?? "").trim();
5162
+ let groupName = String(args.group_name ?? "").trim() || mtName;
5163
+ const memberTokens = splitList(args.members);
5164
+ const filePath = String(args.file_path ?? "").trim();
5165
+ const rawMessage = String(args.message ?? "").trim();
5166
+ let groupId = String(args.group_id ?? "").trim();
5167
+ const rawTasks = Array.isArray(args.tasks) ? args.tasks : [];
5168
+ const taskItems = [];
5169
+ const taskOwners = [];
5170
+ for (const task of rawTasks) {
5171
+ const owner = String(task?.owner ?? "").trim();
5172
+ const content = String(task?.content ?? task?.task ?? "").trim();
5173
+ const due = String(task?.due ?? "").trim();
5174
+ if (content === "") continue;
5175
+ if (owner !== "") taskOwners.push(owner);
5176
+ taskItems.push({ owner, content, due });
5177
+ }
5178
+ if (memberTokens.length === 0 && groupId === "") {
5179
+ throw meetingValidationError(
5180
+ "members_required",
5181
+ "\u5EFA\u7FA4\u81F3\u5C11\u8981\u7ED9 members\uFF08\u7FA4\u6210\u5458\u59D3\u540D\u6216 id\uFF09\u3002\u53EA\u60F3\u53D1\u6D88\u606F\u5230\u5DF2\u6709\u7FA4\u5C31\u4F20 group_id"
5182
+ );
5183
+ }
5184
+ if (groupName === "") {
5185
+ const now = /* @__PURE__ */ new Date();
5186
+ const mm = String(now.getMonth() + 1).padStart(2, "0");
5187
+ const dd = String(now.getDate()).padStart(2, "0");
5188
+ groupName = `\u4F1A\u8BAE\u7FA4-${mm}${dd}`;
5189
+ }
5190
+ const { resolvePersonTokens: resolvePersonTokens2 } = await import("./create-flow-ERDGW3FZ.js");
5191
+ const allTokens = [.../* @__PURE__ */ new Set([...memberTokens, ...taskOwners])];
5192
+ const peopleMap = allTokens.length > 0 ? await resolvePersonTokens2(env, allTokens) : /* @__PURE__ */ new Map();
5193
+ const resolved = memberTokens.map((token) => peopleMap.get(token)).filter(Boolean);
5194
+ const unresolved = memberTokens.filter((token) => !peopleMap.get(token));
5195
+ if (unresolved.length > 0) {
5196
+ warnings.push(`\u8FD9\u4E9B\u6210\u5458\u6CA1\u89E3\u6790\u5230\u5458\u5DE5 id\uFF0C\u5DF2\u8DF3\u8FC7\uFF1A${unresolved.join("\u3001")}\uFF08\u8BF7\u6838\u5BF9\u59D3\u540D\u6216\u76F4\u63A5\u4F20 id\uFF09`);
5197
+ }
5198
+ const memberIds = [...new Set(resolved.map((one) => one.id))];
5199
+ const memberNames = resolved.map((one) => one.name);
5200
+ const displayNameOf = (token) => peopleMap.get(token)?.name ?? token;
5201
+ const taskLines = taskItems.map((item) => `@${item.owner ? displayNameOf(item.owner) : "\uFF08\u672A\u6307\u5B9A\uFF09"}\uFF1A${item.content}${item.due ? `\uFF08${item.due}\uFF09` : ""}`);
5202
+ let headMessage = rawMessage;
5203
+ const atSlots = [];
5204
+ allTokens.forEach((token, index) => {
5205
+ const person = peopleMap.get(token);
5206
+ if (!person || person.name === token) return;
5207
+ if (!headMessage.includes(`@${token}`)) return;
5208
+ const slot = `\0AT${index}\0`;
5209
+ headMessage = headMessage.split(`@${token}`).join(slot);
5210
+ atSlots.push({ slot, name: person.name });
5211
+ });
5212
+ for (const { slot, name } of atSlots) headMessage = headMessage.split(slot).join(`@${name}`);
5213
+ const message = [headMessage, ...taskLines].filter((line) => line !== "").join("\n");
5214
+ let selfId = "";
5215
+ let selfName = "";
5216
+ try {
5217
+ const session = await env.host.getSession();
5218
+ selfId = String(session?.userId ?? "").trim();
5219
+ selfName = String(session?.employeeName ?? session?.name ?? session?.userName ?? "").trim();
5220
+ } catch {
5221
+ selfId = "";
5222
+ selfName = "";
5223
+ }
5224
+ const addSelf = selfId !== "" && !memberIds.includes(selfId);
5225
+ const createUsers = addSelf ? [selfId, ...memberIds] : memberIds;
5226
+ const createNames = addSelf ? [selfName, ...memberNames] : memberNames;
5227
+ const { buildImEnv } = await import("./group-chat-7SEAVAJR.js");
5228
+ const imEnv = await buildImEnv(env);
5229
+ const steps = [];
5230
+ if (args.dry_run === true) {
5231
+ return meetingSuccess("meeting.group.shareMinutes", {
5232
+ dryRun: true,
5233
+ groupName,
5234
+ groupId: groupId || null,
5235
+ members: memberNames,
5236
+ willSendFile: filePath || null,
5237
+ willSendText: message || null,
5238
+ steps: [
5239
+ groupId ? "\u8DF3\u8FC7\u5EFA\u7FA4\uFF08\u5DF2\u7ED9 group_id\uFF09" : `\u5EFA\u7FA4\u300C${groupName}\u300D\uFF0C\u6210\u5458 ${memberNames.join("\u3001") || "\uFF08\u7A7A\uFF09"}`,
5240
+ filePath ? `\u53D1\u7EAA\u8981\u6587\u4EF6\uFF1A${basename(filePath)}` : "\u4E0D\u53D1\u6587\u4EF6\uFF08\u672A\u4F20 file_path\uFF09",
5241
+ message ? "\u53D1\u6587\u672C\uFF08\u542B @ \u63D0\u53CA\uFF09" : "\u4E0D\u53D1\u6587\u672C\uFF08\u672A\u4F20 message\uFF09"
5242
+ ]
5243
+ }, { warnings });
5244
+ }
5245
+ if (!groupId) {
5246
+ const created = await runImWrite(imEnv, "im.group.create.prepare", "im.group.create.apply", {
5247
+ users: createUsers,
5248
+ ...createNames.length > 0 ? { names: createNames } : {},
5249
+ name: groupName
5250
+ });
5251
+ const newId = String(created.data?.groupId ?? created.data?.id ?? "");
5252
+ if (!created.ok || newId === "") {
5253
+ throw meetingValidationError(
5254
+ "group_create_failed",
5255
+ `\u5EFA\u7FA4\u5931\u8D25\uFF1A${created.error || "\u672A\u8FD4\u56DE\u7FA4 id"}\u3002\u8FD9\u7C7B\u5931\u8D25\u901A\u5E38\u662F\u79DF\u6237\u6CA1\u5F00 IM \u5EFA\u7FA4\u6743\u9650\u6216\u6210\u5458\u4E0D\u5728\u540C\u4E00\u7EC4\u7EC7 \u2014\u2014 \u5982\u5B9E\u544A\u8BC9\u7528\u6237\uFF0C\u4E0D\u8981\u6539\u53E3\u8BF4"\u5DF2\u5EFA\u7FA4"`
5256
+ );
5257
+ }
5258
+ groupId = newId;
5259
+ steps.push({ step: "createGroup", ok: true, detail: `\u7FA4 id ${groupId}\uFF08${groupName}\uFF09` });
5260
+ } else {
5261
+ steps.push({ step: "createGroup", ok: true, detail: `\u590D\u7528\u5DF2\u6709\u7FA4 ${groupId}` });
5262
+ }
5263
+ if (filePath) {
5264
+ const sent = await runImWrite(imEnv, "im.msg.send.group.prepare", "im.msg.send.group.apply", {
5265
+ groupId,
5266
+ file: filePath
5267
+ });
5268
+ steps.push({ step: "sendFile", ok: sent.ok, detail: sent.ok ? basename(filePath) : sent.error });
5269
+ if (!sent.ok) warnings.push(`\u7EAA\u8981\u6587\u4EF6\u6CA1\u53D1\u8FDB\u7FA4\uFF08${sent.error}\uFF09\uFF1B\u6587\u4EF6\u5728\u672C\u5730\uFF0C\u53EF\u624B\u52A8\u8F6C\u53D1`);
5270
+ }
5271
+ if (message) {
5272
+ const explicitAt = splitList(args.at_members);
5273
+ const atTokens = explicitAt.length > 0 ? explicitAt : [...new Set([...taskOwners, ...memberTokens].filter((token) => message.includes(`@${displayNameOf(token)}`)))];
5274
+ const atResolved = atTokens.map((token) => peopleMap.get(token)).filter(Boolean);
5275
+ const atIds = [...new Set(atResolved.map((one) => one.id))].filter((id) => memberIds.includes(id));
5276
+ const dropped = atResolved.filter((one) => !memberIds.includes(one.id)).map((one) => one.name);
5277
+ if (dropped.length > 0) {
5278
+ warnings.push(`\u8FD9\u4E9B\u4EBA\u4E0D\u5728\u7FA4\u91CC\uFF0C@ \u4E0D\u751F\u6548\uFF08\u5DF2\u4ECE atUids \u53BB\u6389\uFF09\uFF1A${dropped.join("\u3001")}`);
5279
+ }
5280
+ const sent = await runImWrite(imEnv, "im.msg.send.group.prepare", "im.msg.send.group.apply", {
5281
+ groupId,
5282
+ txt: message,
5283
+ ...args.at_all === true ? { atAll: true } : {},
5284
+ ...atIds.length > 0 ? { atUids: atIds } : {}
5285
+ });
5286
+ steps.push({ step: "sendText", ok: sent.ok, detail: sent.ok ? `@ ${atIds.length} \u4EBA` : sent.error });
5287
+ if (!sent.ok) warnings.push(`\u6587\u672C\u6CA1\u53D1\u8FDB\u7FA4\uFF08${sent.error}\uFF09`);
5288
+ }
5289
+ const failed = steps.filter((step) => !step.ok);
5290
+ return meetingSuccess("meeting.group.shareMinutes", {
5291
+ groupId,
5292
+ groupName,
5293
+ members: memberNames,
5294
+ atCount: steps.find((step) => step.step === "sendText")?.detail ?? "",
5295
+ steps,
5296
+ durationMs: Date.now() - startedAt,
5297
+ ...failed.length === 0 ? { status: "SENT" } : { status: "PARTIAL" }
5298
+ }, { warnings });
5299
+ }
5300
+ }
5301
+ ];
5302
+
4735
5303
  // src/shortcuts/meeting/operations/qrcode.ts
4736
- import { mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
4737
- import { dirname as dirname2, isAbsolute, join as join2, resolve as resolve4 } from "node:path";
5304
+ import { mkdir as mkdir4, writeFile as writeFile4 } from "node:fs/promises";
5305
+ import { dirname as dirname3, isAbsolute, join as join3, resolve as resolve5 } from "node:path";
4738
5306
 
4739
5307
  // src/shortcuts/meeting/qr/encoder.ts
4740
5308
  var ECC_CODEWORDS_PER_BLOCK = {
@@ -5206,7 +5774,7 @@ function stamp() {
5206
5774
  const pad3 = (n) => String(n).padStart(2, "0");
5207
5775
  return `${now.getFullYear()}${pad3(now.getMonth() + 1)}${pad3(now.getDate())}-${pad3(now.getHours())}${pad3(now.getMinutes())}${pad3(now.getSeconds())}`;
5208
5776
  }
5209
- function safeName(input) {
5777
+ function safeName2(input) {
5210
5778
  return input.replace(/[\\/:*?"<>|\s]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
5211
5779
  }
5212
5780
  var meetingQrRender = {
@@ -5290,13 +5858,13 @@ var meetingQrRender = {
5290
5858
  const imageScale = Math.floor(scale);
5291
5859
  const imageMargin = Math.floor(margin);
5292
5860
  const imageSize = (matrix.size + imageMargin * 2) * imageScale;
5293
- const defaultDir = join2(meetingStateDir(env.ctx), "qrcodes");
5861
+ const defaultDir = join3(meetingStateDir(env.ctx), "qrcodes");
5294
5862
  const fallbackName = `qr-${stamp()}.${format}`;
5295
- const explicitName = typeof args.fileName === "string" && args.fileName.trim() !== "" ? `${safeName(args.fileName.replace(/\.(png|svg)$/i, ""))}.${format}` : fallbackName;
5296
- const target = typeof args.outPath === "string" && args.outPath.trim() !== "" ? isAbsolute(args.outPath) ? resolve4(args.outPath) : resolve4(process.cwd(), args.outPath) : join2(defaultDir, explicitName);
5297
- await mkdir3(dirname2(target), { recursive: true });
5863
+ const explicitName = typeof args.fileName === "string" && args.fileName.trim() !== "" ? `${safeName2(args.fileName.replace(/\.(png|svg)$/i, ""))}.${format}` : fallbackName;
5864
+ const target = typeof args.outPath === "string" && args.outPath.trim() !== "" ? isAbsolute(args.outPath) ? resolve5(args.outPath) : resolve5(process.cwd(), args.outPath) : join3(defaultDir, explicitName);
5865
+ await mkdir4(dirname3(target), { recursive: true });
5298
5866
  const payload = format === "svg" ? Buffer.from(renderQrSvg(matrix, { scale: imageScale, margin: imageMargin }), "utf8") : renderQrPng(matrix, { scale: imageScale, margin: imageMargin });
5299
- await writeFile3(target, payload);
5867
+ await writeFile4(target, payload);
5300
5868
  return meetingSuccess("meeting.qrcode.render", {
5301
5869
  path: target,
5302
5870
  format,
@@ -5369,7 +5937,7 @@ var meetingSummaryGet = {
5369
5937
  const mtId = textOf5(args.mt_id).trim();
5370
5938
  if (!mtId) throw meetingValidationError("mt_id_required", "\u5FC5\u987B\u63D0\u4F9B\u4F1A\u8BAE id\uFF08mt_id\uFF09");
5371
5939
  const ctx = env.ctx;
5372
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
5940
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
5373
5941
  const warnings = [];
5374
5942
  const timings = {};
5375
5943
  const include = Array.isArray(args.include) && args.include.length > 0 ? args.include.filter((item) => ALL_SECTIONS.includes(item)) : ALL_SECTIONS;
@@ -5690,7 +6258,7 @@ var MT_STATUS_OVER = "8";
5690
6258
  var CANCELLED_MARK_DELAY_MS = 800;
5691
6259
  async function isCancelledMeeting(env, mtId) {
5692
6260
  try {
5693
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
6261
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
5694
6262
  const listed = await getMeetingOperation2("meeting.eb.meeting.list").handler(
5695
6263
  // withCount:false —— 这里只要一行状态,不必额外请求 count(少一次往返,也便于测试替身)
5696
6264
  { mt_id: mtId, pageNo: 1, pageSize: 1, withCount: false },
@@ -5735,7 +6303,7 @@ async function resolveDecisionPeople(env, input, ownerId) {
5735
6303
  }
5736
6304
  let nameToId = /* @__PURE__ */ new Map();
5737
6305
  if (nameTokens.size > 0) {
5738
- const { resolveMemberIdsByName } = await import("./schedule-DHNNOHVS.js");
6306
+ const { resolveMemberIdsByName } = await import("./schedule-XBKY7VEA.js");
5739
6307
  nameToId = await resolveMemberIdsByName(env, [...nameTokens]).catch(() => /* @__PURE__ */ new Map());
5740
6308
  }
5741
6309
  const unresolved = [];
@@ -6001,8 +6569,8 @@ var decisionPublishApply = {
6001
6569
  }
6002
6570
  writeMs = Date.now() - startedAt;
6003
6571
  if (cancelled) {
6004
- await new Promise((resolve5) => {
6005
- setTimeout(resolve5, CANCELLED_MARK_DELAY_MS);
6572
+ await new Promise((resolve6) => {
6573
+ setTimeout(resolve6, CANCELLED_MARK_DELAY_MS);
6006
6574
  });
6007
6575
  warnings.push(
6008
6576
  `\u8BE5\u4F1A\u8BAE\u6B64\u524D\u88AB\u53D6\u6D88\u8FC7\uFF1A\u5DF2\u5728\u300C\u5199\u51B3\u8BAE\u300D\u4E0E\u300C\u6807\u8BB0\u5DF2\u51B3\u8BAE\u300D\u4E4B\u95F4\u7559 ${CANCELLED_MARK_DELAY_MS}ms \u95F4\u9694\uFF0C\u907F\u514D ESB \u628A\u540C\u4E00\u6279\u660E\u7EC6\u751F\u6210\u4E24\u8F6E\u4EFB\u52A1\uFF08\u771F\u673A\u9A8C\u8BC1\u8FC7\u7684\u5751\uFF09`
@@ -6779,7 +7347,7 @@ var deleteMany = {
6779
7347
  if (args.confirm !== true) {
6780
7348
  throw meetingValidationError("confirmation_required", "\u6279\u91CF\u5220\u9664\u4E0D\u53EF\u6062\u590D\uFF0C\u5FC5\u987B\u4F20 confirm=true");
6781
7349
  }
6782
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
7350
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
6783
7351
  const listOp = getMeetingOperation2("meeting.eb.decisionTask.list");
6784
7352
  const prepareOp = getMeetingOperation2("meeting.eb.decisionTask.delete.prepare");
6785
7353
  const applyOp = getMeetingOperation2("meeting.eb.decisionTask.delete.apply");
@@ -6914,7 +7482,7 @@ var reassign = {
6914
7482
  },
6915
7483
  handler: async (args, env) => {
6916
7484
  if (args.confirm === false) throw meetingValidationError("confirmation_required", "confirm=false\uFF0C\u672A\u6267\u884C");
6917
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
7485
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
6918
7486
  const mtId = String(args.mt_id ?? "").trim();
6919
7487
  const target = await resolveEmployeeId(env, String(args.to_executor ?? ""));
6920
7488
  const from = String(args.from_executor ?? "").trim();
@@ -7213,7 +7781,7 @@ var formLink = {
7213
7781
  pushValue("crm_members", "##" + first.id);
7214
7782
  } else {
7215
7783
  try {
7216
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
7784
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
7217
7785
  const search = getMeetingOperation2("meeting.eb.crm.search");
7218
7786
  const found = await search.handler({ keyword: first.name, pageSize: 10 }, env);
7219
7787
  const rows = found?.data?.items ?? [];
@@ -7368,7 +7936,7 @@ var ebAutoInvitationAfterWrite = async (context) => {
7368
7936
  const mtId = String(context.dataIds?.[0] ?? "").trim();
7369
7937
  if (!isCreate || !enabled || !mtId) return association;
7370
7938
  try {
7371
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
7939
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
7372
7940
  const render = getMeetingOperation2("meeting.invitation.render");
7373
7941
  const result = await render.handler({ mtId }, context.env);
7374
7942
  return { ...association ?? {}, invitation: result?.data ?? null };
@@ -7404,7 +7972,7 @@ var ebOperationsWithLinks = ebBaseOperations.map((operation) => {
7404
7972
  const raw = String(args.member).trim();
7405
7973
  let uid = /^\d+$/.test(raw) ? raw : "";
7406
7974
  if (!uid) {
7407
- const { resolveMemberIdsByName } = await import("./schedule-DHNNOHVS.js");
7975
+ const { resolveMemberIdsByName } = await import("./schedule-XBKY7VEA.js");
7408
7976
  const map = await resolveMemberIdsByName(env, [raw]).catch(() => /* @__PURE__ */ new Map());
7409
7977
  uid = String(map.get(raw) ?? "");
7410
7978
  }
@@ -7443,7 +8011,7 @@ var ebOperationsWithMinuteDoc = ebOperationsWithLinks.map((operation) => {
7443
8011
  if (!String(nextArgs.mt_minutes_subject ?? "").trim() && nextArgs.mt_id) {
7444
8012
  let meetingName = "";
7445
8013
  try {
7446
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
8014
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
7447
8015
  const detailOp = getMeetingOperation2("meeting.eb.meeting.detail");
7448
8016
  const detail = await detailOp.handler({ id: String(nextArgs.mt_id) }, env);
7449
8017
  const row = detail?.data?.data ?? {};
@@ -7463,8 +8031,8 @@ var ebOperationsWithMinuteDoc = ebOperationsWithLinks.map((operation) => {
7463
8031
  handler: async (args, env) => {
7464
8032
  const result = await operation.handler(args, env);
7465
8033
  try {
7466
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
7467
- const { ensureMinuteDoc } = await import("./minute-doc-4BA2R5EA.js");
8034
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
8035
+ const { ensureMinuteDoc } = await import("./minute-doc-REI6RUE4.js");
7468
8036
  const minuteId = String((result?.data?.dataIds ?? [])[0] ?? "").trim();
7469
8037
  if (minuteId) {
7470
8038
  const detail = await getMeetingOperation2("meeting.eb.minute.detail").handler({ id: minuteId }, env);
@@ -7555,7 +8123,10 @@ var composeOutcome = {
7555
8123
  type: "object",
7556
8124
  additionalProperties: false,
7557
8125
  properties: {
7558
- confirm: { type: "boolean", description: "\u53EF\u7701\u7565\uFF08\u9ED8\u8BA4 true\uFF09\uFF1B\u4F20 false \u624D\u963B\u6B62\u5199\u5165" },
8126
+ confirm: {
8127
+ type: "boolean",
8128
+ description: '\u53EF\u7701\u7565\uFF1A\u9996\u6B21\u5199\u5165\uFF08\u540C\u540D\u7EAA\u8981\u4E0D\u5B58\u5728\uFF09\u4E0D\u9700\u8981\uFF1B**\u8981\u8986\u76D6\u5DF2\u5B58\u5728\u7684\u540C\u540D\u7EAA\u8981\u65F6\u5FC5\u987B\u663E\u5F0F\u4F20 true**\uFF0C\u5426\u5219\u88AB\u62D2\u7EDD\uFF08confirm_required\uFF09\u5E76\u7ED9\u51FA"\u73B0\u6709\u591A\u5C11\u5B57 \u2192 \u66FF\u6362\u6210\u591A\u5C11\u5B57"\u3002\u4F20 false \u76F4\u63A5\u963B\u6B62\u5199\u5165'
8129
+ },
7559
8130
  mt_id: { type: "string", description: "\u4F1A\u8BAE id\uFF1B\u4E0E mt_name/date \u4E8C\u9009\u4E00" },
7560
8131
  mt_name: { type: "string", description: "\u4F1A\u8BAE\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u53EF\u7701\u7565 mt_id\uFF0CCLI \u81EA\u52A8\u89E3\u6790\uFF09" },
7561
8132
  date: { type: "string", description: "\u4F1A\u8BAE\u65E5\u671F yyyy-MM-dd\uFF0C\u914D\u5408 mt_name/date \u89E3\u6790\u7528" },
@@ -7588,7 +8159,7 @@ var composeOutcome = {
7588
8159
  if (args.confirm === false) {
7589
8160
  throw meetingValidationError("confirmation_required", "\u4F20\u4E86 confirm=false\uFF0C\u5DF2\u963B\u6B62\u5199\u5165");
7590
8161
  }
7591
- const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-7UDUWYB5.js");
8162
+ const { getMeetingOperation: getMeetingOperation2 } = await import("./registry-UVTI323K.js");
7592
8163
  let mtId = String(args.mt_id ?? "").trim();
7593
8164
  if (!mtId) {
7594
8165
  const listOp2 = getMeetingOperation2("meeting.eb.meeting.list");
@@ -7630,8 +8201,24 @@ var composeOutcome = {
7630
8201
  let minuteId = "";
7631
8202
  let minuteDoc = null;
7632
8203
  if (existing?.id) {
8204
+ requireDestructiveConfirm({
8205
+ confirm: args.confirm,
8206
+ destructive: true,
8207
+ action: `\u8986\u76D6\u5DF2\u5B58\u5728\u7684\u540C\u540D\u7EAA\u8981\u300C${subject}\u300D`,
8208
+ details: [
8209
+ `\u5DF2\u6709\u7EAA\u8981 id ${String(existing.id)}\uFF08\u6807\u9898\u300C${String(existing.mt_minutes_subject ?? subject)}\u300D\uFF09`,
8210
+ `\u539F\u6587\uFF1A\u73B0\u6709 ${String(existing.minutes_content ?? "").length} \u5B57 \u2192 \u5C06\u66FF\u6362\u4E3A ${String(args.minutes_content ?? "").length} \u5B57`,
8211
+ "\u540C\u65F6\u4F1A\u91CD\u65B0\u751F\u6210\u7EAA\u8981\u6587\u6863\u5E76\u56DE\u5199\u300C\u7EAA\u8981\u6587\u4EF6\u300D"
8212
+ ]
8213
+ });
7633
8214
  const written = await getMeetingOperation2("meeting.minute.writeContent").handler(
7634
- { id: String(existing.id), mt_id: mtId, minutes_content: String(args.minutes_content ?? ""), with_doc: true },
8215
+ {
8216
+ id: String(existing.id),
8217
+ mt_id: mtId,
8218
+ minutes_content: String(args.minutes_content ?? ""),
8219
+ with_doc: true,
8220
+ confirm: true
8221
+ },
7635
8222
  env
7636
8223
  );
7637
8224
  minuteId = String(existing.id);
@@ -7747,6 +8334,8 @@ function buildRegistry() {
7747
8334
  ...meetingInvitationOperations,
7748
8335
  ...meetingMemberExpandOperations,
7749
8336
  ...meetingInvitationPublishOperations,
8337
+ ...minuteExportOperations,
8338
+ ...groupShareOperations,
7750
8339
  ...meetingQrOperations,
7751
8340
  ...meetingSummaryOperations,
7752
8341
  ...meetingFormFieldOperations,