weaver-work-cli 0.1.63 → 0.1.65

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 (159) hide show
  1. package/dist/chunks/{archive-BLDYBZDX.js → archive-WUZKAEZ6.js} +2 -2
  2. package/dist/chunks/{archive-oa-3GJ3TWXR.js → archive-oa-PN46RTI2.js} +2 -2
  3. package/dist/chunks/{asset-AFXJN4CK.js → asset-ZPC5VWZM.js} +2 -2
  4. package/dist/chunks/{asset-idle-VUJXWGWJ.js → asset-idle-DHGP3NYY.js} +2 -2
  5. package/dist/chunks/{attachment-content-VMJA7NSQ.js → attachment-content-QUM27QNB.js} +3 -3
  6. package/dist/chunks/{blog-EREB35VU.js → blog-JC47AIXK.js} +2 -2
  7. package/dist/chunks/{caizhilian-ATM2JO5S.js → caizhilian-IKIHM77A.js} +4 -4
  8. package/dist/chunks/{calendar-E26ZIH7S.js → calendar-GZTSJ57Y.js} +2 -2
  9. package/dist/chunks/{chunk-OMAGCLUE.js → chunk-26FCCU5O.js} +2 -2
  10. package/dist/chunks/{chunk-EOZHSNND.js → chunk-3W5NMGDS.js} +2 -2
  11. package/dist/chunks/{chunk-SHBDXEUE.js → chunk-6AW5LW4T.js} +4 -4
  12. package/dist/chunks/{chunk-C5PIGPGX.js → chunk-6T5X6YWX.js} +2 -2
  13. package/dist/chunks/{chunk-WPBZQVLS.js → chunk-AFZTMYGC.js} +1 -1
  14. package/dist/chunks/{chunk-LOVAIGM2.js → chunk-CUY64WP4.js} +50 -50
  15. package/dist/chunks/{chunk-IGICM3WJ.js → chunk-D6SWOUUP.js} +2 -2
  16. package/dist/chunks/{chunk-BY3WDJO5.js → chunk-E3OQSNF5.js} +1 -1
  17. package/dist/chunks/{chunk-G3ZM57PD.js → chunk-F4ME3CGS.js} +2 -2
  18. package/dist/chunks/{chunk-6VCQLZXE.js → chunk-FDBAFANU.js} +1 -0
  19. package/dist/chunks/{chunk-RV2JAA5I.js → chunk-FJUOUSV3.js} +1 -1
  20. package/dist/chunks/{chunk-6G2JARDK.js → chunk-HLT6B26P.js} +1 -1
  21. package/dist/chunks/{chunk-THMBDCRA.js → chunk-HWA2A25Y.js} +2 -2
  22. package/dist/chunks/{chunk-HEJPVXD3.js → chunk-IJDZ7VDC.js} +4 -4
  23. package/dist/chunks/{chunk-GOBNIGWS.js → chunk-IT3SB7RV.js} +89 -16
  24. package/dist/chunks/{chunk-TNFIUZ4H.js → chunk-JDZOYHAL.js} +1 -1
  25. package/dist/chunks/{chunk-QZYKZ7MQ.js → chunk-K7QKQRSL.js} +155 -57
  26. package/dist/chunks/{chunk-QAMIIFP6.js → chunk-LRK7YND4.js} +11 -11
  27. package/dist/chunks/{chunk-4OB22YKE.js → chunk-NZLFKBEM.js} +6 -6
  28. package/dist/chunks/{chunk-RR45ELVE.js → chunk-Q6D6PSMH.js} +2 -2
  29. package/dist/chunks/{chunk-5CY37VLS.js → chunk-QT7GGCSY.js} +45 -43
  30. package/dist/chunks/{chunk-GQK6WLOS.js → chunk-VLY5RTVO.js} +2 -2
  31. package/dist/chunks/{chunk-SDPC7BG2.js → chunk-WSHIOSGM.js} +2 -2
  32. package/dist/chunks/{chunk-I4C2KR2G.js → chunk-ZV3TYANI.js} +1 -1
  33. package/dist/chunks/{conflict-AMNTM3FV.js → conflict-76ZUL3E7.js} +2 -2
  34. package/dist/chunks/{contract-PLO2V2NO.js → contract-INMS7SYQ.js} +846 -199
  35. package/dist/chunks/{cowork-FZAXE6FO.js → cowork-34CBYVQP.js} +2 -2
  36. package/dist/chunks/{create-flow-2DAUN7HU.js → create-flow-7WGKLRHH.js} +8 -6
  37. package/dist/chunks/{data-7NXMWET4.js → data-QKWI5325.js} +13 -2
  38. package/dist/chunks/{ebuilder-form-DEYHX6M7.js → ebuilder-form-ZONRROK4.js} +3 -3
  39. package/dist/chunks/{ehr-QQH2DYYA.js → ehr-2CONM7R6.js} +2 -2
  40. package/dist/chunks/{entry-mode-2JTVEKMP.js → entry-mode-3UMMMK6Z.js} +3 -3
  41. package/dist/chunks/{env-2JZMXC6I.js → env-7EGXNZR2.js} +2 -2
  42. package/dist/chunks/{esb-I5ZFHJUK.js → esb-FQASCY2H.js} +4 -4
  43. package/dist/chunks/{factory-XIATYHU6.js → factory-BDERKTYX.js} +1 -1
  44. package/dist/chunks/{fna-3V2TL6B2.js → fna-FCLVIWAS.js} +2 -2
  45. package/dist/chunks/{group-chat-CVYUZCOQ.js → group-chat-4E7EZMTJ.js} +3 -3
  46. package/dist/chunks/{host-CBONEAZS.js → host-2ED2KC4X.js} +3 -3
  47. package/dist/chunks/{host-4DP7C7YQ.js → host-2UYZEY2V.js} +3 -3
  48. package/dist/chunks/{host-4KQCAEWA.js → host-46NYKDQP.js} +3 -3
  49. package/dist/chunks/{host-BD7NAM33.js → host-7IPZKIM4.js} +3 -3
  50. package/dist/chunks/{host-L37QVNIV.js → host-P7G22WNM.js} +3 -3
  51. package/dist/chunks/{host-4X2F3JPQ.js → host-XLCBLNJD.js} +3 -3
  52. package/dist/chunks/{hrm-OL3IKN7C.js → hrm-XKL27NX2.js} +3 -3
  53. package/dist/chunks/{im-YXQWUF3R.js → im-NDYIMASG.js} +3 -3
  54. package/dist/chunks/{invoice-4WY32PR2.js → invoice-MOGNB6HN.js} +3 -3
  55. package/dist/chunks/{jiuchuanhui-L6SHLONH.js → jiuchuanhui-3T5X7SB7.js} +2 -2
  56. package/dist/chunks/{lazy-dispatch-OYE6QV24.js → lazy-dispatch-4WOIL3ZQ.js} +4 -4
  57. package/dist/chunks/{mail-PZV2KNRU.js → mail-P7VMUKQW.js} +2 -2
  58. package/dist/chunks/{meeting-6SOBCC6N.js → meeting-2FMYZXG5.js} +13 -13
  59. package/dist/chunks/{minute-doc-KSJSJNOH.js → minute-doc-3DHMYMBE.js} +4 -4
  60. package/dist/chunks/{okr-B76FW5M2.js → okr-VZXRQGS4.js} +2 -2
  61. package/dist/chunks/{operations-YOMEGFLV.js → operations-MI2BSKZX.js} +4 -4
  62. package/dist/chunks/{performance-4VBKUPFO.js → performance-OPEQNW7Y.js} +870 -15
  63. package/dist/chunks/{plan-HBNZRQTI.js → plan-TJAS4N5X.js} +2 -2
  64. package/dist/chunks/{project-IV6FWK74.js → project-CYBGU6K6.js} +2 -2
  65. package/dist/chunks/{reception-BR5YURT6.js → reception-3FT2F66K.js} +2 -2
  66. package/dist/chunks/{recruit-stage-4HQ6OGXT.js → recruit-stage-WPGB5BDJ.js} +2 -2
  67. package/dist/chunks/{registry-JFQEFC7E.js → registry-6UGQO35C.js} +2 -2
  68. package/dist/chunks/{registry-MZJQX65Q.js → registry-QRMXRSCT.js} +4 -4
  69. package/dist/chunks/{registry-7LICMV5J.js → registry-XXFMYPBM.js} +12 -12
  70. package/dist/chunks/{room-recommend-43GLLE7Y.js → room-recommend-7LD2OHL5.js} +4 -4
  71. package/dist/chunks/{schedule-ZQ42BEW6.js → schedule-ZAYMZKTQ.js} +4 -4
  72. package/dist/chunks/{smart-extract-QKAEAZGM.js → smart-extract-FOBSVNYW.js} +2 -2
  73. package/dist/chunks/{workflow-6HV7H5PC.js → workflow-NYJJIT3D.js} +4 -4
  74. package/dist/index.js +33 -33
  75. package/dist/internal/e10/auth/commands.js +182 -43
  76. package/dist/shortcuts/contract/error-actions.js +112 -0
  77. package/dist/shortcuts/contract/errors.js +9 -1
  78. package/dist/shortcuts/contract/manifest.js +18 -7
  79. package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
  80. package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
  81. package/dist/shortcuts/contract/operations/elements-build.js +82 -56
  82. package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
  83. package/dist/shortcuts/contract/operations/ledger-card.js +25 -2
  84. package/dist/shortcuts/contract/operations/ledger.js +33 -5
  85. package/dist/shortcuts/contract/operations/money.js +90 -0
  86. package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
  87. package/dist/shortcuts/contract/operations/quote-recognize.js +54 -17
  88. package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
  89. package/dist/shortcuts/contract/operations/quote-submit.js +20 -3
  90. package/dist/shortcuts/contract/operations/quote.js +66 -12
  91. package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
  92. package/dist/shortcuts/contract/operations/triage.js +55 -9
  93. package/dist/shortcuts/data/operations/shared.js +14 -1
  94. package/dist/shortcuts/meeting/operations/eb/create-flow.js +25 -11
  95. package/dist/shortcuts/performance/flow-utils.js +363 -0
  96. package/dist/shortcuts/performance/manifest.js +2 -2
  97. package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
  98. package/dist/shortcuts/performance/operations/flow-list.js +213 -0
  99. package/dist/shortcuts/performance/operations/flow-score.js +241 -0
  100. package/dist/shortcuts/performance/operations/registry.js +6 -0
  101. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.categoryCounts.js +64 -0
  102. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +15 -0
  103. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -0
  104. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -0
  105. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -0
  106. package/docs/e10-auth.md +27 -2
  107. package/package.json +1 -1
  108. package/skills/weaver-e10-jinchengda/SKILL.md +87 -39
  109. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +29 -29
  110. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +2 -2
  111. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  112. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +29 -7
  113. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +3 -3
  114. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +5 -5
  115. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
  116. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +22 -25
  117. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -314
  118. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +6 -5
  119. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +19 -11
  120. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +3 -3
  121. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +43 -25
  122. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +103 -212
  123. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +7 -7
  124. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +7 -6
  125. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +34 -21
  126. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +6 -6
  127. package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +3 -3
  128. package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +6 -6
  129. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +22 -22
  130. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +21 -19
  131. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +6 -5
  132. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +132 -95
  133. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +1 -1
  134. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  135. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  136. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
  137. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +1 -1
  138. package/skills/weaver-e10-jinchengda/references/orchestration.md +5 -5
  139. package/skills/weaver-e10-meeting/SKILL.md +8 -7
  140. package/skills/weaver-e10-meeting/references/create-commands.md +2 -2
  141. package/skills/weaver-e10-meeting/references/create-flow.md +6 -6
  142. package/skills/weaver-e10-meeting/references/create-guardrails.md +10 -10
  143. package/skills/weaver-e10-meeting/references/invitation.md +1 -1
  144. package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
  145. package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
  146. package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
  147. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  148. package/skills/weaver-e10-performance/SKILL.md +45 -5
  149. package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
  150. package/skills/weaver-e10-performance/references/flow-api.md +128 -0
  151. package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
  152. package/skills/weaver-e10-workflow/SKILL.md +40 -16
  153. package/skills/weaver-e10-workflow/aigroup/default.json +1 -1
  154. package/skills/weaver-e10-workflow/references/todo-dialogue.md +30 -27
  155. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +90 -22
  156. package/skills/weaver-e10-workflow/references/workflow-view.md +18 -2
  157. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +240 -43
  158. package/skills/weaver-e10-yimiaoban/SKILL.md +8 -5
  159. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -2303,6 +2303,7 @@ async function tryXiaoEUnifiedLogin(options = {}) {
2303
2303
  export {
2304
2304
  packagePath,
2305
2305
  packageFileUrl,
2306
+ isConnectorMode,
2306
2307
  normalizeGlobalOptions,
2307
2308
  writeWithRetry,
2308
2309
  readErrorCauseCode,
@@ -19,7 +19,7 @@ import {
19
19
  resolveXiaoEPreferredBaseUrl,
20
20
  summarizeXiaoEFailureKind,
21
21
  tryXiaoEUnifiedLogin
22
- } from "./chunk-6VCQLZXE.js";
22
+ } from "./chunk-FDBAFANU.js";
23
23
  import {
24
24
  CliError,
25
25
  toErrorEnvelope
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  isEsbFlowUnavailable
5
- } from "./chunk-GQK6WLOS.js";
5
+ } from "./chunk-VLY5RTVO.js";
6
6
  import {
7
7
  esbValidationError
8
8
  } from "./chunk-TXUG266F.js";
@@ -9,13 +9,13 @@ import {
9
9
  createE10RequestRuntime,
10
10
  isE10AuthenticationRequired,
11
11
  requireE10Session
12
- } from "./chunk-RV2JAA5I.js";
12
+ } from "./chunk-FJUOUSV3.js";
13
13
  import {
14
14
  E10_SESSION_EXPIRED_MESSAGE
15
15
  } from "./chunk-TJN4PIYO.js";
16
16
  import {
17
17
  getActiveProfile
18
- } from "./chunk-6VCQLZXE.js";
18
+ } from "./chunk-FDBAFANU.js";
19
19
 
20
20
  // src/shortcuts/workflow/host.ts
21
21
  var DEFAULT_TIMEOUT_MS = 3e4;
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  readCache,
5
5
  writeCache
6
- } from "./chunk-I4C2KR2G.js";
6
+ } from "./chunk-ZV3TYANI.js";
7
7
  import {
8
8
  SCHEMA_DATETIME_MINUTE,
9
9
  meetingSuccess,
10
10
  meetingValidationError,
11
11
  schemaOf
12
- } from "./chunk-TNFIUZ4H.js";
12
+ } from "./chunk-JDZOYHAL.js";
13
13
 
14
14
  // src/shortcuts/meeting/operations/eb/schedule.ts
15
15
  var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
@@ -110,9 +110,9 @@ async function runScheduleConflictFlow(env, input) {
110
110
  if (!employeeId) {
111
111
  throw meetingValidationError("schedule_employee_required", "\u53D6\u4E0D\u5230\u5F53\u524D\u767B\u5F55\u7528\u6237 id\uFF0C\u65E0\u6CD5\u89E6\u53D1 ESB \u65E5\u7A0B\u67E5\u8BE2");
112
112
  }
113
- const { createEsbHost } = await import("./host-L37QVNIV.js");
113
+ const { createEsbHost } = await import("./host-P7G22WNM.js");
114
114
  const { createEsbContinuationSigner } = await import("./continuation-KI7DRRZN.js");
115
- const { getEsbOperation } = await import("./registry-MZJQX65Q.js");
115
+ const { getEsbOperation } = await import("./registry-QRMXRSCT.js");
116
116
  const esbEnv = {
117
117
  ctx: env.ctx,
118
118
  host: createEsbHost(env.ctx),
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-TJN4PIYO.js";
31
31
  import {
32
32
  hasXiaoEEnv
33
- } from "./chunk-6VCQLZXE.js";
33
+ } from "./chunk-FDBAFANU.js";
34
34
 
35
35
  // src/shortcuts/workflow/operations/form.ts
36
36
  import { randomUUID } from "node:crypto";
@@ -10291,6 +10291,7 @@ var COLLECT_ORDER_KEYS = ["sort"];
10291
10291
  var ALLOWED_INPUT_KEYS = [
10292
10292
  "stage",
10293
10293
  "outputMode",
10294
+ "includeCategoryCounts",
10294
10295
  "items",
10295
10296
  "aiGroups",
10296
10297
  "aiSummaries",
@@ -10547,6 +10548,9 @@ function rowFromAny(raw, extraFields) {
10547
10548
  return result;
10548
10549
  }
10549
10550
  function assertKnownKeys(args) {
10551
+ if (args.includeCategoryCounts !== void 0 && typeof args.includeCategoryCounts !== "boolean") {
10552
+ throw workflowValidationError("input_invalid", "includeCategoryCounts \u5FC5\u987B\u662F\u5E03\u5C14\u503C");
10553
+ }
10550
10554
  const known = [...ALLOWED_INPUT_KEYS, ...RESUME_INPUT_KEYS];
10551
10555
  const unknown = Object.keys(args).filter((key) => !known.includes(key));
10552
10556
  if (unknown.length > 0) {
@@ -11808,6 +11812,58 @@ function projectDisplayRows(response, extraFields) {
11808
11812
  return projected;
11809
11813
  }
11810
11814
 
11815
+ // src/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.categoryCounts.ts
11816
+ import { isDeepStrictEqual } from "node:util";
11817
+ var CATEGORY_TABS = ["0", "7", "5", "8", "6", "1"];
11818
+ function recordOf(value) {
11819
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
11820
+ }
11821
+ function readTodoCategoryTotal(response) {
11822
+ const outer = recordOf(response);
11823
+ const data = recordOf(responseData(response));
11824
+ const nested = recordOf(data.data);
11825
+ if ([outer, data, nested].some((part) => part.status === false || part.success === false || part.fail === true)) return null;
11826
+ for (const candidate of [data.total, data.count, data.totalCount, nested.total, nested.totalCount]) {
11827
+ if (candidate === void 0 || candidate === null || candidate === "") continue;
11828
+ if (typeof candidate !== "number" && typeof candidate !== "string") return null;
11829
+ if (typeof candidate === "string" && !candidate.trim()) return null;
11830
+ const total = extractTotal({ total: candidate });
11831
+ if (total !== null) return Number.isSafeInteger(total) && total >= 0 ? total : null;
11832
+ }
11833
+ return null;
11834
+ }
11835
+ function withoutPagination(query) {
11836
+ const body = structuredClone(query);
11837
+ for (const key of ["customDisplayPage", "current", "pageSize"]) delete body[key];
11838
+ return body;
11839
+ }
11840
+ async function collectTodoCategoryCounts(env, listQuery, knownTotals = []) {
11841
+ const body = withoutPagination(listQuery);
11842
+ body.params = { ...recordOf(body.params) };
11843
+ const params = recordOf(body.params);
11844
+ delete params.flowSpareType;
11845
+ const counts = {};
11846
+ const currentTab = String(params.tabid ?? "");
11847
+ const known = knownTotals.find((item) => Number.isSafeInteger(item.total) && item.total >= 0 && isDeepStrictEqual(body, withoutPagination(item.body)));
11848
+ if (known && CATEGORY_TABS.some((tab) => tab === currentTab)) counts[currentTab] = known.total;
11849
+ if (currentTab === "0" && counts["0"] === 0) return Object.fromEntries(CATEGORY_TABS.map((tab) => [tab, 0]));
11850
+ const results = await Promise.allSettled(CATEGORY_TABS.filter((tab) => counts[tab] === void 0).map(async (tab) => {
11851
+ const categoryBody = structuredClone(body);
11852
+ categoryBody.params = { ...params, tabid: tab };
11853
+ const response = await env.host.workflowRequest({
11854
+ method: "POST",
11855
+ path: WORKFLOW_ENDPOINTS.TODO_TOTAL,
11856
+ operation: "workflow.todoSmartConvert.categoryCounts",
11857
+ body: categoryBody
11858
+ });
11859
+ return { tab, total: readTodoCategoryTotal(response) };
11860
+ }));
11861
+ for (const result of results) {
11862
+ if (result.status === "fulfilled" && result.value.total !== null) counts[result.value.tab] = result.value.total;
11863
+ }
11864
+ return counts;
11865
+ }
11866
+
11811
11867
  // src/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.ts
11812
11868
  var DETAIL_CACHE_FILE_NAME = "todo-detail-cache.json";
11813
11869
  var DETAIL_CACHE_TTL_MS = SUMMARY_CACHE_TTL_MS;
@@ -12854,6 +12910,7 @@ async function collectRawTodos(args, env) {
12854
12910
  const fmt = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
12855
12911
  return `${fmt(start)} ${fmt(end)}`;
12856
12912
  };
12913
+ const knownTotals = [];
12857
12914
  const probeTodoTotal = async () => {
12858
12915
  const { query } = await buildSearchQuery(
12859
12916
  listEnv,
@@ -12872,6 +12929,10 @@ async function collectRawTodos(args, env) {
12872
12929
  operation: "workflow.todoSmartConvert.total",
12873
12930
  body: totalBody
12874
12931
  });
12932
+ if (args.includeCategoryCounts === true) {
12933
+ const categoryTotal = readTodoCategoryTotal(response);
12934
+ if (categoryTotal !== null) knownTotals.push({ body: totalBody, total: categoryTotal });
12935
+ }
12875
12936
  return extractTotal(response);
12876
12937
  } catch {
12877
12938
  return null;
@@ -12931,6 +12992,7 @@ async function collectRawTodos(args, env) {
12931
12992
  let totalAvailable = null;
12932
12993
  let pages = 0;
12933
12994
  let stoppedEarly = false;
12995
+ let listQuery;
12934
12996
  for (let pageNo = 1; limit === null || (policy.strictLimit ? items.length < limit : pageNo <= (plannedPages ?? 0)); pageNo += 1) {
12935
12997
  const { query, warnings: buildWarnings } = await buildSearchQuery(
12936
12998
  listEnv,
@@ -12945,6 +13007,7 @@ async function collectRawTodos(args, env) {
12945
13007
  if (isremarks !== "") {
12946
13008
  query.params = { ...query.params || {}, isremarks };
12947
13009
  }
13010
+ if (category === "todo" && !listQuery) listQuery = structuredClone(query);
12948
13011
  if (process.env.WEAVER_WORK_CLI_DUMP_LIST_BODY) {
12949
13012
  try {
12950
13013
  writeFileSync(
@@ -13200,10 +13263,13 @@ async function collectRawTodos(args, env) {
13200
13263
  );
13201
13264
  }
13202
13265
  }
13266
+ const categoryCounts = args.includeCategoryCounts === true && category === "todo" && listQuery ? await collectTodoCategoryCounts(env, listQuery, knownTotals) : void 0;
13203
13267
  return {
13204
13268
  stage: "collect",
13205
13269
  query: {
13206
13270
  category,
13271
+ ...listQuery ? { listQuery } : {},
13272
+ ...categoryCounts ? { categoryCounts } : {},
13207
13273
  ...policy.outputMode ? { outputMode: policy.outputMode } : {},
13208
13274
  ...scope ? { tabid: searchArgs.tabid } : {},
13209
13275
  /** 本次有效条数上限;历史未指定模式和 limit 时为 null。 */
@@ -13252,7 +13318,7 @@ async function collectRawTodos(args, env) {
13252
13318
  }
13253
13319
 
13254
13320
  // src/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.ts
13255
- function recordOf(value) {
13321
+ function recordOf2(value) {
13256
13322
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
13257
13323
  }
13258
13324
  function idOf(value) {
@@ -13260,9 +13326,9 @@ function idOf(value) {
13260
13326
  return typeof value === "number" && Number.isSafeInteger(value) ? String(value) : "";
13261
13327
  }
13262
13328
  function successfulData(response) {
13263
- const outer = recordOf(response);
13264
- const data = recordOf(responseData(response));
13265
- const nested = recordOf(data.data);
13329
+ const outer = recordOf2(response);
13330
+ const data = recordOf2(responseData(response));
13331
+ const nested = recordOf2(data.data);
13266
13332
  const failed = [outer, data, nested].find((part) => part.status === false || part.success === false || part.fail === true);
13267
13333
  if (failed) {
13268
13334
  const code = failed.code ?? outer.code;
@@ -13274,7 +13340,7 @@ function successfulData(response) {
13274
13340
  }
13275
13341
  function displayRows(response) {
13276
13342
  const data = successfulData(response);
13277
- const nested = recordOf(data.data);
13343
+ const nested = recordOf2(data.data);
13278
13344
  const rows = nested.displayData ?? data.displayData;
13279
13345
  if (!Array.isArray(rows) || rows.some((row) => row === null || typeof row !== "object" || Array.isArray(row))) {
13280
13346
  throw workflowApiError("unexpected_response", "\u5F85\u529E\u5217\u8868\u8FD4\u56DE\u7ED3\u6784\u5F02\u5E38\uFF0C\u672A\u751F\u6210\u5206\u5E03\u7EDF\u8BA1");
@@ -13323,11 +13389,11 @@ async function prepareTodoQuery(args, env) {
13323
13389
  if (!(error instanceof WorkflowCliError) || error.type === "permission" || error.type === "authorization" || error.code === 401 || error.code === 403 || error.code === "401" || error.code === "403") throw error;
13324
13390
  }
13325
13391
  const selectedNames = /* @__PURE__ */ new Map();
13326
- const workflowConditions = recordOf(recordOf(listQuery.searchParams).formDatas).workflowid;
13392
+ const workflowConditions = recordOf2(recordOf2(listQuery.searchParams).formDatas).workflowid;
13327
13393
  for (const condition of Array.isArray(workflowConditions) ? workflowConditions : []) {
13328
- const browserDatas = recordOf(condition).browserDatas;
13394
+ const browserDatas = recordOf2(condition).browserDatas;
13329
13395
  for (const item of Array.isArray(browserDatas) ? browserDatas : []) {
13330
- const entry = recordOf(item);
13396
+ const entry = recordOf2(item);
13331
13397
  const id = idOf(entry.id);
13332
13398
  if (id && typeof entry.name === "string" && entry.name.trim()) selectedNames.set(id, entry.name.trim());
13333
13399
  }
@@ -13373,6 +13439,7 @@ async function prepareTodoQuery(args, env) {
13373
13439
  }
13374
13440
  const complete = total !== null && seen.size === total && !unreadRows;
13375
13441
  const sort = typeof searchArgs.sort === "string" ? searchArgs.sort.trim() : "";
13442
+ const categoryCounts = args.includeCategoryCounts === true && category === "todo" ? await collectTodoCategoryCounts(env, listQuery, total === null ? [] : [{ body: totalBody, total }]) : void 0;
13376
13443
  return {
13377
13444
  stage: "prepareQuery",
13378
13445
  query: {
@@ -13381,6 +13448,7 @@ async function prepareTodoQuery(args, env) {
13381
13448
  totalAvailable: total,
13382
13449
  filters: Object.fromEntries(Object.entries(searchArgs).filter(([key]) => !["category", "tabid", "sort"].includes(key))),
13383
13450
  listQuery,
13451
+ ...categoryCounts ? { categoryCounts } : {},
13384
13452
  ...sort ? { sort } : {}
13385
13453
  },
13386
13454
  totalCount: total,
@@ -13392,7 +13460,7 @@ async function prepareTodoQuery(args, env) {
13392
13460
 
13393
13461
  // src/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.ts
13394
13462
  var COUNT_CONCURRENCY = 4;
13395
- function recordOf2(value) {
13463
+ function recordOf3(value) {
13396
13464
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
13397
13465
  }
13398
13466
  function textOf(value) {
@@ -13435,7 +13503,7 @@ async function buildCandidateQuery(candidate, args, env) {
13435
13503
  workflowTerm: "in"
13436
13504
  }, "total");
13437
13505
  const isremarks = textOf(args.isremarks) || generalRules()?.identityFilter?.defaultIsremarks?.trim() || "";
13438
- if (isremarks) query.params = { ...recordOf2(query.params), isremarks };
13506
+ if (isremarks) query.params = { ...recordOf3(query.params), isremarks };
13439
13507
  return { candidate, body: query };
13440
13508
  } catch (error) {
13441
13509
  rethrowRequiredError(error);
@@ -13454,7 +13522,7 @@ async function loadWorkflowTypes(queries, env) {
13454
13522
  }
13455
13523
  async function fetchWorkflowMetadata(query, env) {
13456
13524
  try {
13457
- const params = { ...recordOf2(query.params) };
13525
+ const params = { ...recordOf3(query.params) };
13458
13526
  delete params.workflowId;
13459
13527
  delete params.searchAdWorkflowid;
13460
13528
  const flowCenterParam = query.flowCenterParam ?? params.flowCenterParam;
@@ -13465,13 +13533,13 @@ async function fetchWorkflowMetadata(query, env) {
13465
13533
  operation: "workflow.todoSmartConvert.workflowMetadata",
13466
13534
  body
13467
13535
  });
13468
- const data = recordOf2(responseData(response));
13536
+ const data = recordOf3(responseData(response));
13469
13537
  const roots = Array.isArray(data.data) ? data.data : [];
13470
13538
  const metadata = /* @__PURE__ */ new Map();
13471
13539
  const conflicts = /* @__PURE__ */ new Set();
13472
13540
  const visit = (nodes, parentType) => {
13473
13541
  for (const value of nodes) {
13474
- const node = recordOf2(value);
13542
+ const node = recordOf3(value);
13475
13543
  const nodeId = textOf(node.id);
13476
13544
  const name = textOf(node.content) || textOf(node.title);
13477
13545
  const type = /^p?type_?-?\d+$/u.test(nodeId) && name ? name : parentType;
@@ -13514,11 +13582,11 @@ async function loadCandidateCount(query, env) {
13514
13582
  async function enrichWorkflowClarification(error, args, env) {
13515
13583
  if (args.category !== void 0 && args.category !== "todo") return error;
13516
13584
  if (!(error instanceof WorkflowCliError) || error.subtype !== CLARIFICATION_SUBTYPE) return error;
13517
- const details = recordOf2(error.details);
13585
+ const details = recordOf3(error.details);
13518
13586
  if (details.clarificationType !== "workflow" || !Array.isArray(details.candidates)) return error;
13519
13587
  const candidates = [];
13520
13588
  for (const value of details.candidates) {
13521
- const source = recordOf2(value);
13589
+ const source = recordOf3(value);
13522
13590
  const id = textOf(source.id);
13523
13591
  const name = textOf(source.name);
13524
13592
  if (!/^\d+$/u.test(id) || !name) return error;
@@ -15154,6 +15222,11 @@ async function runSmartGroupAdd(args, env) {
15154
15222
 
15155
15223
  // src/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.ts
15156
15224
  var inputSchema = schemaOf({
15225
+ includeCategoryCounts: {
15226
+ type: "boolean",
15227
+ default: false,
15228
+ description: "\u4EC5\u5F85\u529EprepareQuery\uFF0Fcollect\uFF1A\u6309\u6700\u7EC8\u5206\u7C7B\u94FE\u63A5\u6761\u4EF6\u5E76\u884C\u8BFB\u53D6\u5168\u90E8\u3001\u5F85\u5904\u7406\u3001\u5F85\u9605\u3001\u88AB\u9000\u56DE\u3001\u8D85\u65F6\u3001\u672A\u8BFB\u603B\u6570\uFF1B\u590D\u7528\u540C\u6761\u4EF6\u5DF2\u6709\u603B\u6570\uFF0C\u5931\u8D25\u9879\u4FDD\u6301\u672A\u77E5\u3002\u9ED8\u8BA4\u4E0D\u989D\u5916\u7EDF\u8BA1\u3002"
15229
+ },
15157
15230
  outputMode: {
15158
15231
  type: "string",
15159
15232
  enum: [...OUTPUT_MODE_VALUES],
@@ -2335,7 +2335,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
2335
2335
  );
2336
2336
  }
2337
2337
  if (endpoint.interfacePk === "create_meeting") {
2338
- const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-AMNTM3FV.js");
2338
+ const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-76ZUL3E7.js");
2339
2339
  assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
2340
2340
  }
2341
2341
  const pkQuery = writePkQuery(endpoint, payload);