@wirecat/drive-cli 0.69.0 → 0.70.0

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 (217) hide show
  1. package/contracts/wirecat.json +14 -13
  2. package/dist/age.d.ts +0 -36
  3. package/dist/age.d.ts.map +1 -1
  4. package/dist/age.js +0 -22
  5. package/dist/age.js.map +1 -1
  6. package/dist/bin/drive.js +2 -2
  7. package/dist/bundle/{all-profiles-B4A737YW.js → all-profiles-FW3GK3QO.js} +13 -13
  8. package/dist/bundle/{anthropic-RZGPDESM.js → anthropic-QVKJT3II.js} +8 -8
  9. package/dist/bundle/{app-server-OWEW7DY5.js → app-server-QU73RD5R.js} +66 -58
  10. package/dist/bundle/{bun-V5QLYBZU.js → bun-5XCD5CBB.js} +2 -2
  11. package/dist/bundle/{bun-sqlite-KHLHXXGH.js → bun-sqlite-TIGSVNSV.js} +9 -9
  12. package/dist/bundle/{chunk-GK6KXBL6.js → chunk-2SBC4DVV.js} +4 -4
  13. package/dist/bundle/{chunk-E7URRFBB.js → chunk-3AHBZP33.js} +10 -15
  14. package/dist/bundle/{chunk-V4FMN5A6.js → chunk-3CHW7JGR.js} +17 -17
  15. package/dist/bundle/chunk-3TCMANIM.js +387 -0
  16. package/dist/bundle/{chunk-6EL5AVXX.js → chunk-3UWRAIWA.js} +4 -4
  17. package/dist/bundle/{chunk-2DS2TDGW.js → chunk-3UZ4OH22.js} +18 -18
  18. package/dist/bundle/{chunk-WQOGHND4.js → chunk-4WK26MPY.js} +1 -1
  19. package/dist/bundle/{chunk-AD7VI3XU.js → chunk-54BQWRJL.js} +7 -7
  20. package/dist/bundle/{chunk-EA2OB75T.js → chunk-54NDYVZA.js} +1 -1
  21. package/dist/bundle/{chunk-4YECZ6CN.js → chunk-5JTB4URG.js} +12 -12
  22. package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-66PL7P4C.js} +1 -1
  23. package/dist/bundle/{chunk-BVVXYZSU.js → chunk-6BMTW5A6.js} +9 -9
  24. package/dist/bundle/{chunk-6D44YQ5X.js → chunk-6DPOWBKA.js} +6 -6
  25. package/dist/bundle/{chunk-AMQGKMLZ.js → chunk-7C5KENNU.js} +3 -3
  26. package/dist/bundle/chunk-7DJNURKV.js +823 -0
  27. package/dist/bundle/{chunk-5TK2YQCO.js → chunk-7IBENBCK.js} +2 -2
  28. package/dist/bundle/chunk-7QSRODXM.js +259 -0
  29. package/dist/bundle/{chunk-HCZYJMBP.js → chunk-ABZ2NYDT.js} +1 -1
  30. package/dist/bundle/{chunk-RLGQMMYE.js → chunk-AV5UKJZM.js} +35 -13
  31. package/dist/bundle/{chunk-533XOW74.js → chunk-BBFXQPKD.js} +3 -3
  32. package/dist/bundle/{chunk-ZUG67442.js → chunk-BBRMDMIR.js} +3 -3
  33. package/dist/bundle/{chunk-LRCSDAYK.js → chunk-BD2K2ONK.js} +4 -4
  34. package/dist/bundle/{chunk-CAQ5GW3A.js → chunk-BFKFKDPC.js} +1 -1
  35. package/dist/bundle/{chunk-OOIAJRKQ.js → chunk-BXPC5TFG.js} +2 -2
  36. package/dist/bundle/chunk-DHX27E5M.js +31 -0
  37. package/dist/bundle/{chunk-L342KHIZ.js → chunk-DR57KDAY.js} +6 -6
  38. package/dist/bundle/{chunk-XUHQ7DVT.js → chunk-DVI72ZQG.js} +1 -1
  39. package/dist/bundle/{chunk-N4ACIIQB.js → chunk-DVVUJ254.js} +2 -2
  40. package/dist/bundle/{chunk-MHXZ62CU.js → chunk-EDO5LZVF.js} +1 -1
  41. package/dist/bundle/{chunk-LUZRVBQR.js → chunk-EG62WVR2.js} +6 -6
  42. package/dist/bundle/{chunk-WNMPIRRF.js → chunk-F5KJWRF5.js} +3 -3
  43. package/dist/bundle/{chunk-U3RXH6RY.js → chunk-FADAOLGB.js} +4 -4
  44. package/dist/bundle/{chunk-4ZFO2CVH.js → chunk-FCSHWUMW.js} +5 -5
  45. package/dist/bundle/{chunk-GHFBT2ZM.js → chunk-FN3RXBO7.js} +6 -6
  46. package/dist/bundle/{chunk-GTDCP5OG.js → chunk-FONIFRYI.js} +4 -4
  47. package/dist/bundle/{chunk-IQ2QU2X6.js → chunk-FVTKFIQH.js} +981 -589
  48. package/dist/bundle/{chunk-F5UUJU6R.js → chunk-FYPW7NMH.js} +4 -4
  49. package/dist/bundle/{chunk-FIVFP53N.js → chunk-GA3URWIF.js} +1 -1
  50. package/dist/bundle/{chunk-HEBZCKMU.js → chunk-GAHIHE4K.js} +1778 -2232
  51. package/dist/bundle/{chunk-4J5GJJ2I.js → chunk-GJZSVSV3.js} +2 -2
  52. package/dist/bundle/{chunk-VUPWDCYV.js → chunk-GK3BJMGK.js} +1 -1
  53. package/dist/bundle/{chunk-6XNTELM5.js → chunk-GPDPEHYX.js} +1 -1
  54. package/dist/bundle/{chunk-CU6RATZH.js → chunk-GV5DGHSA.js} +4 -4
  55. package/dist/bundle/{chunk-JRFKCYMW.js → chunk-HHAZ6DCY.js} +23 -6
  56. package/dist/bundle/{chunk-OUM4ZO53.js → chunk-HK225DAG.js} +1 -1
  57. package/dist/bundle/{chunk-5SJZDEIO.js → chunk-HRATXUFH.js} +20 -20
  58. package/dist/bundle/{chunk-TZ75K6R7.js → chunk-HWUPU6WX.js} +8 -8
  59. package/dist/bundle/{chunk-3RLRJHAI.js → chunk-HYXXMSVD.js} +7688 -8301
  60. package/dist/bundle/{chunk-EL2E3ABX.js → chunk-I7YSHUPW.js} +13 -13
  61. package/dist/bundle/{chunk-EWUQIUTB.js → chunk-IFTX7AQU.js} +5 -5
  62. package/dist/bundle/{chunk-BBJVV4E2.js → chunk-IGNIUDI3.js} +61 -38
  63. package/dist/bundle/{chunk-7JKECODO.js → chunk-ILAQIBEO.js} +1 -11
  64. package/dist/bundle/{chunk-SY2HLH5R.js → chunk-KSJAFMU5.js} +57 -23
  65. package/dist/bundle/{chunk-PB6NWKH3.js → chunk-LINBDWJK.js} +2 -2
  66. package/dist/bundle/{chunk-CZ4UEXCE.js → chunk-LMJBQFW6.js} +6 -6
  67. package/dist/bundle/{chunk-IJCUAKR5.js → chunk-ML3R2UHV.js} +4 -4
  68. package/dist/bundle/{chunk-2Q4CB4EI.js → chunk-MXNQZAJQ.js} +2 -2
  69. package/dist/bundle/{chunk-WOUIHZRI.js → chunk-NP7LJATI.js} +15 -67
  70. package/dist/bundle/chunk-OY7TNUEC.js +16 -0
  71. package/dist/bundle/{chunk-2VFAXC6O.js → chunk-P77FL6RY.js} +18 -18
  72. package/dist/bundle/{chunk-I55XYREN.js → chunk-P7PLKNPX.js} +993 -2512
  73. package/dist/bundle/{chunk-3URYKAJP.js → chunk-PAPY6Q6H.js} +1 -1
  74. package/dist/bundle/{chunk-5B5NOAIA.js → chunk-PN4JYURZ.js} +45 -45
  75. package/dist/bundle/{chunk-ZBYKCVSV.js → chunk-PR7XD2DI.js} +2 -2
  76. package/dist/bundle/{chunk-UPCEHSIZ.js → chunk-Q5C6YKAY.js} +21 -16
  77. package/dist/bundle/{chunk-SEJBS7SI.js → chunk-QBAOIMVB.js} +1 -1
  78. package/dist/bundle/{chunk-KUQDBWPU.js → chunk-RCTOWLCD.js} +31 -32
  79. package/dist/bundle/{chunk-22SH77TG.js → chunk-REM5WHHQ.js} +64 -64
  80. package/dist/bundle/{chunk-Y2QVNVHK.js → chunk-RHSBXOQM.js} +1 -1
  81. package/dist/bundle/{chunk-3YKAFLXY.js → chunk-RLNZ7NX5.js} +2 -2
  82. package/dist/bundle/chunk-RQNRYF6D.js +170 -0
  83. package/dist/bundle/{chunk-PV3AWPHR.js → chunk-SONPLYV7.js} +5 -5
  84. package/dist/bundle/{chunk-RWQ7T4Y5.js → chunk-T5D4OGDC.js} +2 -2
  85. package/dist/bundle/{chunk-25FT44S3.js → chunk-TGS5VPJD.js} +282 -525
  86. package/dist/bundle/chunk-TNKQDS5A.js +335 -0
  87. package/dist/bundle/{chunk-NVDR72GP.js → chunk-VVN6GHAZ.js} +60 -81
  88. package/dist/bundle/{chunk-CDSB7WVG.js → chunk-WJK6KTCS.js} +8 -8
  89. package/dist/bundle/{chunk-T6X6EZ5N.js → chunk-WWE5GO6G.js} +3 -3
  90. package/dist/bundle/{chunk-SYUXKV2E.js → chunk-XOL346TJ.js} +2 -2
  91. package/dist/bundle/{chunk-T4FMXDDV.js → chunk-XZBA6FVH.js} +3 -3
  92. package/dist/bundle/chunk-YCL3SK4T.js +1978 -0
  93. package/dist/bundle/{chunk-XVH3WZSZ.js → chunk-YRUR3E3E.js} +53 -53
  94. package/dist/bundle/{chunk-QJGFQRTL.js → chunk-YZPE72GE.js} +12 -12
  95. package/dist/bundle/{chunk-O6PD7RZY.js → chunk-ZCXWV4XO.js} +4 -4
  96. package/dist/bundle/{chunk-376ZGVUZ.js → chunk-ZHZYGY5R.js} +4 -4
  97. package/dist/bundle/{cli-BS4L3HAP.js → cli-K4D4DIGQ.js} +88 -69
  98. package/dist/bundle/command-contract-V3F452QI.js +43 -0
  99. package/dist/bundle/{command-server-entry-CJ2CV7ZV.js → command-server-entry-WREK3QBB.js} +33 -30
  100. package/dist/bundle/decode-SEETPKBH.js +299 -0
  101. package/dist/bundle/{dispatch-WBEOHZDV.js → dispatch-SQCEURVK.js} +9 -9
  102. package/dist/bundle/drive.js +11 -11
  103. package/dist/bundle/{echarts-QIXLXS3G.js → echarts-WZ5RKFCX.js} +2 -2
  104. package/dist/bundle/{embed-YNZW5X6M.js → embed-B2UCRZZR.js} +9 -9
  105. package/dist/bundle/{embedder-LRC2PKTS.js → embedder-4R6Z7G7L.js} +12 -12
  106. package/dist/bundle/entry-ORZYRJ5N.js +25 -0
  107. package/dist/bundle/{failure-X6PSLVSO.js → failure-CYNXH3RQ.js} +4 -4
  108. package/dist/bundle/first-run-KAKA6KBY.js +31 -0
  109. package/dist/bundle/first-screen-R645UHRH.js +41 -0
  110. package/dist/bundle/google-BSO3YB7N.js +45 -0
  111. package/dist/bundle/{google-api-7JDZDCWE.js → google-api-SAND2F7L.js} +70 -62
  112. package/dist/bundle/grants-PLNFYARD.js +118 -0
  113. package/dist/bundle/{identity-E43WKN5F.js → identity-JVVGS4U6.js} +6 -6
  114. package/dist/bundle/{instructions-MD2RZT5Z.js → instructions-JSMTSB22.js} +1 -1
  115. package/dist/bundle/{login-RBDJPQAG.js → login-6WG3YBDU.js} +78 -70
  116. package/dist/bundle/{mcp-TDKGDB4V.js → mcp-VFIOZDVY.js} +2 -2
  117. package/dist/bundle/meeting-combined-SUKMFK3F.js +27 -0
  118. package/dist/bundle/meeting-model-S4YGKIFI.js +29 -0
  119. package/dist/bundle/meeting-semantic-5U7JQCFF.js +25 -0
  120. package/dist/bundle/{node-IEVT2FSJ.js → node-VJMVHOWD.js} +2 -2
  121. package/dist/bundle/{node-sqlite-IENH4TRX.js → node-sqlite-DCNT3HVE.js} +10 -10
  122. package/dist/bundle/oauth-KCMNQ3ZP.js +22 -0
  123. package/dist/bundle/{open-TZ5H7NYM.js → open-NFOEHVW7.js} +8 -8
  124. package/dist/bundle/{openai-XF2KB7W2.js → openai-D47WY7EC.js} +32 -30
  125. package/dist/bundle/{process-6Q23D3TO.js → process-Q2FRU5VA.js} +1 -1
  126. package/dist/bundle/{program-D5XWOHV5.js → program-T2AJJQEM.js} +1332 -1331
  127. package/dist/bundle/{prompt-KUC5D4GX.js → prompt-YJSDABXN.js} +8 -8
  128. package/dist/bundle/{reasons-KSYP5VDJ.js → reasons-WEHPCSJX.js} +5 -5
  129. package/dist/bundle/{recognize-DPFW7HO3.js → recognize-6OBEIEB3.js} +7 -7
  130. package/dist/bundle/{remote-MODTSUNH.js → remote-3SL2QJ7T.js} +13 -13
  131. package/dist/bundle/{rerank-JK7SERLE.js → rerank-L6F5SLIB.js} +10 -10
  132. package/dist/bundle/{serve-BV2WHZLW.js → serve-GYSWIWH4.js} +12 -12
  133. package/dist/bundle/server-BI46BSRE.js +80 -0
  134. package/dist/bundle/{server-N3WPEU7Z.js → server-GWWP3RIT.js} +54 -46
  135. package/dist/bundle/{services-SV6CFUCS.js → services-BDQBRXT5.js} +79 -54
  136. package/dist/bundle/{sqlite-runtime-RZ5PLZVQ.js → sqlite-runtime-ZSZGAUYB.js} +9 -9
  137. package/dist/bundle/{start-C6EXYXAL.js → start-BJ275RUK.js} +7 -7
  138. package/dist/bundle/{state-RAZIREVG.js → state-HLNGFI2T.js} +9 -9
  139. package/dist/bundle/{store-2DLGLYS6.js → store-I43KZNJW.js} +31 -26
  140. package/dist/bundle/{store-DQKJKX2G.js → store-OSRTGYGI.js} +23 -19
  141. package/dist/bundle/store-maintenance-command-FO7LEVSL.js +72 -0
  142. package/dist/bundle/tokens-DB7O7QNB.js +118 -0
  143. package/dist/catalog.d.ts +0 -28
  144. package/dist/catalog.d.ts.map +1 -1
  145. package/dist/catalog.js +0 -82
  146. package/dist/catalog.js.map +1 -1
  147. package/dist/commands/catalog.d.ts +3 -8
  148. package/dist/commands/catalog.d.ts.map +1 -1
  149. package/dist/commands/catalog.js +36 -109
  150. package/dist/commands/catalog.js.map +1 -1
  151. package/dist/commands/context.d.ts +3 -0
  152. package/dist/commands/context.d.ts.map +1 -1
  153. package/dist/commands/context.js +20 -0
  154. package/dist/commands/context.js.map +1 -1
  155. package/dist/commands/documents.d.ts.map +1 -1
  156. package/dist/commands/documents.js +30 -72
  157. package/dist/commands/documents.js.map +1 -1
  158. package/dist/commands/folders.d.ts +1 -1
  159. package/dist/commands/folders.d.ts.map +1 -1
  160. package/dist/commands/folders.js +45 -48
  161. package/dist/commands/folders.js.map +1 -1
  162. package/dist/commands/knowledge.d.ts +4 -21
  163. package/dist/commands/knowledge.d.ts.map +1 -1
  164. package/dist/commands/knowledge.js +3 -241
  165. package/dist/commands/knowledge.js.map +1 -1
  166. package/dist/commands/mirrors.d.ts +2 -2
  167. package/dist/commands/mirrors.d.ts.map +1 -1
  168. package/dist/commands/mirrors.js +46 -202
  169. package/dist/commands/mirrors.js.map +1 -1
  170. package/dist/commands/search.d.ts +1 -3
  171. package/dist/commands/search.d.ts.map +1 -1
  172. package/dist/commands/search.js +20 -42
  173. package/dist/commands/search.js.map +1 -1
  174. package/dist/commands/sync.d.ts.map +1 -1
  175. package/dist/commands/sync.js +36 -53
  176. package/dist/commands/sync.js.map +1 -1
  177. package/dist/contract-overrides.d.ts +0 -2
  178. package/dist/contract-overrides.d.ts.map +1 -1
  179. package/dist/contract-overrides.js +0 -317
  180. package/dist/contract-overrides.js.map +1 -1
  181. package/dist/knowledge.d.ts +1 -1
  182. package/dist/knowledge.d.ts.map +1 -1
  183. package/dist/knowledge.js +4 -3
  184. package/dist/knowledge.js.map +1 -1
  185. package/dist/list-queries.d.ts +0 -31
  186. package/dist/list-queries.d.ts.map +1 -1
  187. package/dist/list-queries.js +0 -36
  188. package/dist/list-queries.js.map +1 -1
  189. package/dist/program.d.ts.map +1 -1
  190. package/dist/program.js +2 -3
  191. package/dist/program.js.map +1 -1
  192. package/dist/provider-json.d.ts.map +1 -1
  193. package/dist/provider-json.js +5 -5
  194. package/dist/provider-json.js.map +1 -1
  195. package/dist/reasons.d.ts.map +1 -1
  196. package/dist/reasons.js +0 -10
  197. package/dist/reasons.js.map +1 -1
  198. package/dist/version.d.ts +1 -1
  199. package/dist/version.js +1 -1
  200. package/package.json +3 -3
  201. package/dist/bundle/command-contract-HYURWSD6.js +0 -40
  202. package/dist/bundle/decode-E2NM5SSM.js +0 -165
  203. package/dist/bundle/entry-2IMSWRJU.js +0 -25
  204. package/dist/bundle/first-run-7CPHQDM5.js +0 -30
  205. package/dist/bundle/first-screen-OKZ7GMFR.js +0 -38
  206. package/dist/bundle/google-WDKDBDD4.js +0 -45
  207. package/dist/bundle/grants-AU25GWKF.js +0 -110
  208. package/dist/bundle/oauth-3JGSN47Z.js +0 -22
  209. package/dist/bundle/server-6YDI4Y36.js +0 -72
  210. package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +0 -64
  211. package/dist/bundle/tokens-LY3WML55.js +0 -110
  212. package/dist/knowledge-query.d.ts +0 -77
  213. package/dist/knowledge-query.d.ts.map +0 -1
  214. package/dist/knowledge-query.js +0 -104
  215. package/dist/knowledge-query.js.map +0 -1
  216. package/dist/bundle/{chunk-XWBPP2HX.js → chunk-ZI3YTXSF.js} +0 -0
  217. package/dist/bundle/{mdast-util-from-markdown-CE73EWJ2.js → mdast-util-from-markdown-FXEPSNER.js} +3 -3
@@ -7,35 +7,21 @@ import {
7
7
  queryError,
8
8
  queryFieldsOf,
9
9
  timezoneOf,
10
- validateQuery
11
- } from "./chunk-UPCEHSIZ.js";
12
- import {
13
- isCliFailure,
14
- isStoreDamage
15
- } from "./chunk-3YKAFLXY.js";
16
- import {
17
- refuseOwnerStoreInTests
18
- } from "./chunk-RWQ7T4Y5.js";
19
- import {
20
- createRecordLog,
21
- resolvePaths,
22
- writeSecurely
23
- } from "./chunk-5SJZDEIO.js";
10
+ validateQuery,
11
+ walkQuery
12
+ } from "./chunk-Q5C6YKAY.js";
24
13
  import {
25
14
  singleLine,
26
15
  visibleControls
27
- } from "./chunk-HCZYJMBP.js";
28
- import {
29
- traceIdOf
30
- } from "./chunk-5TK2YQCO.js";
16
+ } from "./chunk-ABZ2NYDT.js";
31
17
  import {
32
18
  STEPS,
33
19
  array,
34
20
  boolean,
35
21
  defineSteps,
22
+ exactOptional,
36
23
  integer,
37
24
  isoTime,
38
- isoTimestamp,
39
25
  literal,
40
26
  maxValue,
41
27
  minLength,
@@ -46,540 +32,62 @@ import {
46
32
  pageSchema,
47
33
  picklist,
48
34
  pipe,
49
- record,
50
35
  reference,
51
36
  safeParse,
52
37
  stepOf,
53
38
  strictObject,
54
39
  string,
55
- union,
56
- unknown
57
- } from "./chunk-JRFKCYMW.js";
40
+ union
41
+ } from "./chunk-HHAZ6DCY.js";
58
42
  import {
59
43
  CliError
60
- } from "./chunk-EA2OB75T.js";
44
+ } from "./chunk-54NDYVZA.js";
61
45
  import {
62
46
  __name
63
47
  } from "./chunk-ZVVMGPBJ.js";
64
48
 
65
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/run.js
66
- import { randomUUID } from "node:crypto";
67
- import { appendFileSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
68
- import { userInfo } from "node:os";
69
- import { join, sep } from "node:path";
70
-
71
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
72
- var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
73
- var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
74
- var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
75
- var logAttributes = /* @__PURE__ */ __name((event2) => renamed(event2, snake), "logAttributes");
76
- var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
77
- var snakeLogger = /* @__PURE__ */ __name((logger) => ({
78
- debug: /* @__PURE__ */ __name((event2, message) => logger.debug(logAttributes(event2), message), "debug"),
79
- info: /* @__PURE__ */ __name((event2, message) => logger.info(logAttributes(event2), message), "info"),
80
- warn: /* @__PURE__ */ __name((event2, message) => logger.warn(logAttributes(event2), message), "warn"),
81
- error: /* @__PURE__ */ __name((event2, message) => logger.error(logAttributes(event2), message), "error")
82
- }), "snakeLogger");
83
-
84
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
85
- var diagnostic = {
86
- event: true,
87
- operation: true,
88
- opcode: true,
89
- seq: true,
90
- status: true,
91
- method: true,
92
- endpointTemplate: true,
93
- bytes: true,
94
- ids: true,
95
- counts: true,
96
- durationMs: true,
97
- outcome: true,
98
- errorCode: true,
99
- providerError: true,
100
- level: true,
101
- transport: true,
102
- attempt: true,
103
- waitMs: true,
104
- code: true,
105
- detail: true,
106
- reason: true,
107
- ageMs: true,
108
- kind: true,
109
- table: true,
110
- op: true,
111
- n: true
112
- };
113
- var send = {
114
- profile: true,
115
- chatId: true,
116
- outcome: true,
117
- kind: true,
118
- action: true,
119
- people: true,
120
- messageId: true,
121
- key: true,
122
- count: true,
123
- forEveryone: true,
124
- sendId: true,
125
- operationId: true,
126
- parentOperationId: true,
127
- replyTo: true,
128
- threadId: true,
129
- sendAs: true,
130
- resultChatId: true,
131
- length: true,
132
- attachments: true,
133
- scheduledFor: true,
134
- notify: true,
135
- origin: true,
136
- reservation: true,
137
- errorCode: true
138
- };
139
- var background = [
140
- "job",
141
- "pid",
142
- "schedule",
143
- "exitCode",
144
- "tool",
145
- "tier",
146
- "actorType",
147
- "actorId",
148
- "agent",
149
- "targetType",
150
- "targetId"
151
- ];
152
- var crash = ["errorClass", "frames"];
153
- var dropped = ["dropped"];
154
- var LOG_ATTRIBUTES = [
155
- ...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
156
- ].sort();
157
-
158
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/run.js
159
- var KEEP_RUNS_FOR_DAYS = 30;
160
- var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
161
- var KEEP_STORE_RUNS_FOR_DAYS = 3;
162
- var RUNS_SIZE_LIMIT_MB = 200;
163
- var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
164
- var startRun = /* @__PURE__ */ __name((options) => {
165
- const now = options.now ?? (() => /* @__PURE__ */ new Date());
166
- const startedAt = options.startedAt ?? now();
167
- const id5 = options.runId ?? newRunId(startedAt, options.command);
168
- const dir = join(options.runsDir, day(startedAt), id5);
169
- pruneRuns(options.runsDir, {
170
- keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
171
- keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
172
- keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
173
- maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
174
- now: startedAt
175
- });
176
- refuseRealStateInTests(dir);
177
- const metadata = {
178
- runId: id5,
179
- command: options.command,
180
- ...options.profile === void 0 ? {} : { profile: options.profile },
181
- startedAt: startedAt.toISOString(),
182
- status: "running",
183
- cliVersion: options.cliVersion,
184
- runtime: runtime(),
185
- platform: process.platform,
186
- arch: process.arch,
187
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
188
- ...options.context
189
- };
190
- let file;
191
- const opened = /* @__PURE__ */ __name(() => {
192
- if (file)
193
- return file;
194
- mkdirSync(dir, { recursive: true, mode: 448 });
195
- const events = join(dir, "events.jsonl");
196
- writeFileSync(events, "", { flag: "a", mode: 384 });
197
- file = snakeLogger(createRecordLog({
198
- to: events,
199
- runId: id5,
200
- command: options.command,
201
- resource: { service: options.service, version: options.cliVersion },
202
- allow: LOG_ATTRIBUTES,
203
- ...options.traceId === void 0 ? {} : { traceId: options.traceId },
204
- ...options.onError === void 0 ? {} : { onError: options.onError }
205
- }));
206
- writeRunFile(dir, metadata);
207
- return file;
208
- }, "opened");
209
- if (!options.lazy)
210
- opened();
211
- let finished = false;
212
- const operations = /* @__PURE__ */ new Set();
213
- const codes = /* @__PURE__ */ new Set();
214
- const tables = /* @__PURE__ */ new Set();
215
- const noted = /* @__PURE__ */ __name((level) => (event2, message) => {
216
- const { operation, errorCode, error_code, code, kind: kind3, table } = event2;
217
- if (typeof operation === "string")
218
- operations.add(operation);
219
- if (kind3 === "store" && typeof table === "string")
220
- tables.add(table);
221
- for (const value of [errorCode, error_code, code])
222
- if (typeof value === "string")
223
- codes.add(value);
224
- if (finished)
225
- return;
226
- opened()[level](event2, message);
227
- }, "noted");
228
- const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
229
- return {
230
- id: id5,
231
- dir,
232
- logger,
233
- finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
234
- if (finished)
235
- return;
236
- finished = true;
237
- const completedAt = now();
238
- const final = {
239
- ...metadata,
240
- ...extra,
241
- status,
242
- completedAt: completedAt.toISOString(),
243
- durationMs: completedAt.getTime() - startedAt.getTime(),
244
- operations: [...operations].sort(),
245
- codes: [...codes].sort(),
246
- ...tables.size > 0 ? { tables: [...tables].sort() } : {}
247
- };
248
- if (file || status !== "success") {
249
- opened();
250
- writeRunFile(dir, final);
251
- return;
252
- }
253
- try {
254
- mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
255
- appendIndex(join(dir, ".."), runFileOf(final));
256
- } catch (error) {
257
- options.onError?.(error);
258
- }
259
- }, "finish")
260
- };
261
- }, "startRun");
262
- var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
263
- if (env.VITEST === void 0)
264
- return;
265
- let home;
266
- try {
267
- home = userInfo().homedir;
268
- } catch {
269
- return;
270
- }
271
- if (dir.startsWith(join(home, ".local", "share") + sep))
272
- throw new Error(`a test opened a run in the real data folder: ${dir}`);
273
- }, "refuseRealStateInTests");
274
- var runtime = /* @__PURE__ */ __name(() => {
275
- const bun = process.versions.bun;
276
- return bun ? `bun ${bun}` : `node ${process.versions.node}`;
277
- }, "runtime");
278
- var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
279
- const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
280
- const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
281
- return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
282
- }, "newRunId");
283
- var INDEX = "index.jsonl";
284
- var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
285
- appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
286
- `, { mode: 384 });
287
- }, "appendIndex");
288
- var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
289
- const written = runFileOf(metadata);
290
- writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
291
- `, 384);
292
- try {
293
- appendIndex(join(dir, ".."), written);
294
- } catch {
295
- }
296
- }, "writeRunFile");
297
- var matchesListFilter = /* @__PURE__ */ __name((run2, filter) => (filter.runId === void 0 || run2.runId === filter.runId) && (filter.command === void 0 || run2.command === filter.command) && (filter.profile === void 0 || run2.profile === filter.profile) && (filter.status === void 0 || run2.status === filter.status) && (filter.errorCode === void 0 || run2.errorCode === filter.errorCode), "matchesListFilter");
298
- var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
299
- const first = since === void 0 ? void 0 : day(new Date(since));
300
- const runs = [];
301
- for (const date of days(runsDir).sort().reverse()) {
302
- if (first !== void 0 && date < first || runs.length >= atLeast)
303
- break;
304
- for (const metadata of runsOfDay(join(runsDir, date))) {
305
- if (matchesListFilter(metadata, filter))
306
- runs.push(metadata);
307
- }
308
- }
309
- return runs;
310
- }, "listRuns");
311
- var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
312
- const latest = /* @__PURE__ */ new Map();
313
- let raw = "";
314
- try {
315
- raw = readFileSync(join(dayDir, INDEX), "utf8");
316
- } catch {
317
- }
318
- for (const line2 of raw.split("\n")) {
319
- if (line2.trim() === "")
320
- continue;
321
- try {
322
- const metadata = metadataOf(JSON.parse(line2));
323
- if (typeof metadata.runId === "string")
324
- latest.set(metadata.runId, metadata);
325
- } catch {
326
- }
327
- }
328
- return latest;
329
- }, "indexedRuns");
330
- var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
331
- const latest = indexedRuns(dayDir);
332
- for (const entry of safeReaddir(dayDir)) {
333
- if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
334
- continue;
335
- const metadata = readRun(join(dayDir, entry));
336
- if (metadata)
337
- latest.set(metadata.runId, metadata);
338
- }
339
- return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
340
- }, "runsOfDay");
341
- var findRun = /* @__PURE__ */ __name((runsDir, id5) => {
342
- const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id5);
343
- const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
344
- const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
345
- for (const date of dates) {
346
- const dir = join(runsDir, date, id5);
347
- const metadata = readRun(dir);
348
- if (metadata)
349
- return { dir, metadata };
350
- }
351
- for (const date of dates) {
352
- const metadata = indexedRuns(join(runsDir, date)).get(id5);
353
- if (metadata)
354
- return { dir: join(runsDir, date, id5), metadata };
355
- }
356
- return void 0;
357
- }, "findRun");
358
- var readEvents = /* @__PURE__ */ __name((dir) => {
359
- let raw;
360
- try {
361
- raw = readFileSync(join(dir, "events.jsonl"), "utf8");
362
- } catch {
363
- return [];
364
- }
365
- const events = [];
366
- for (const line2 of raw.split("\n")) {
367
- if (line2.trim() === "")
368
- continue;
369
- try {
370
- const parsed = JSON.parse(line2);
371
- if (parsed !== null && typeof parsed === "object")
372
- events.push(eventOf(parsed));
373
- } catch {
374
- }
375
- }
376
- return events;
377
- }, "readEvents");
378
- var eventOf = /* @__PURE__ */ __name((line2) => {
379
- const { attributes, time: time2, severity: severity2 } = line2;
380
- if (attributes === null || typeof attributes !== "object")
381
- return logAttributes(line2);
382
- return { time: time2, severity: severity2, ...logAttributes(attributes) };
383
- }, "eventOf");
384
- var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
385
- const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
386
- const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
387
- const successCutoff = before(keepSuccessDays);
388
- const storeCutoff = before(keepStoreDays);
389
- const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
390
- let removed = 0;
391
- for (const date of days(runsDir)) {
392
- if (date >= cutoff) {
393
- if (date < storeCutoff)
394
- dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
395
- if (date < successCutoff)
396
- dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
397
- continue;
398
- }
399
- try {
400
- rmSync(join(runsDir, date), { recursive: true, force: true });
401
- removed += 1;
402
- } catch {
403
- }
404
- }
405
- if (maxBytes !== void 0)
406
- removed += fitSize(runsDir, maxBytes, now);
407
- return removed;
408
- }, "pruneRuns");
409
- var DAY_MS = 24 * 60 * 60 * 1e3;
410
- var STORE_WRITE = "store.write";
411
- var SUCCESSES_DROPPED = ".successes-dropped";
412
- var STORE_RUNS_DROPPED = ".store-runs-dropped";
413
- var SIZE_CHECKED = ".size-checked";
414
- var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
415
- const done = join(dayDir, marker);
416
- try {
417
- statSync(done);
418
- return;
419
- } catch {
420
- }
421
- const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
422
- try {
423
- const kept = [];
424
- for (const [id5, metadata] of indexedRuns(dayDir)) {
425
- if (dropped2(metadata))
426
- rmSync(join(dayDir, id5), { recursive: true, force: true });
427
- else
428
- kept.push(JSON.stringify(runFileOf(metadata)));
429
- }
430
- for (const entry of safeReaddir(dayDir)) {
431
- if (entry === INDEX || entry.startsWith("."))
432
- continue;
433
- if (dropped2(readRun(join(dayDir, entry))))
434
- rmSync(join(dayDir, entry), { recursive: true, force: true });
435
- }
436
- writeSecurely(join(dayDir, INDEX), kept.map((line2) => `${line2}
437
- `).join(""), 384);
438
- writeFileSync(done, "", { mode: 384 });
439
- } catch {
440
- }
441
- }, "dropSuccesses");
442
- var sizeOf = /* @__PURE__ */ __name((path) => {
443
- let total = 0;
444
- for (const entry of safeReaddir(path)) {
445
- const full = join(path, entry);
446
- try {
447
- const stat = statSync(full);
448
- total += stat.isDirectory() ? sizeOf(full) : stat.size;
449
- } catch {
450
- }
451
- }
452
- return total;
453
- }, "sizeOf");
454
- var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
455
- const stamp = join(runsDir, SIZE_CHECKED);
456
- const today = day(now);
457
- try {
458
- if (readFileSync(stamp, "utf8").trim() === today)
459
- return 0;
460
- } catch {
461
- }
462
- const dates = days(runsDir).sort();
463
- const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
464
- let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
465
- let removed = 0;
466
- for (const date of dates) {
467
- if (total <= maxBytes || date === today)
468
- break;
469
- dropSuccesses(join(runsDir, date));
470
- const after = sizeOf(join(runsDir, date));
471
- total -= (sizes.get(date) ?? 0) - after;
472
- sizes.set(date, after);
473
- }
474
- for (const date of dates) {
475
- if (total <= maxBytes || date === today)
476
- break;
477
- try {
478
- rmSync(join(runsDir, date), { recursive: true, force: true });
479
- total -= sizes.get(date) ?? 0;
480
- removed += 1;
481
- } catch {
482
- }
483
- }
484
- try {
485
- mkdirSync(runsDir, { recursive: true, mode: 448 });
486
- writeFileSync(stamp, today, { mode: 384 });
487
- } catch {
488
- }
489
- return removed;
490
- }, "fitSize");
491
- var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
492
- var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
493
- var readRun = /* @__PURE__ */ __name((dir) => {
494
- try {
495
- return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
496
- } catch {
497
- return void 0;
498
- }
499
- }, "readRun");
500
- var safeReaddir = /* @__PURE__ */ __name((dir) => {
501
- try {
502
- return readdirSync(dir);
503
- } catch {
504
- return [];
49
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/reference.js
50
+ var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
51
+ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
52
+ if (!Number.isSafeInteger(value) || value < minimum)
53
+ throw invalid();
54
+ return value;
55
+ }, "integer");
56
+ var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
57
+ const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
58
+ if (reference2.transcriptId !== void 0)
59
+ parts.push(integer2(reference2.transcriptId));
60
+ if (reference2.cuePosition !== void 0) {
61
+ if (reference2.transcriptId === void 0)
62
+ throw invalid();
63
+ parts.push(integer2(reference2.cuePosition, 0));
505
64
  }
506
- }, "safeReaddir");
507
- var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
508
- ...logAttributes(metadata),
509
- ...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
510
- }), "runFileOf");
511
- var metadataOf = /* @__PURE__ */ __name((parsed) => {
512
- const { partial, ...metadata } = fromLogAttributes(parsed);
513
- if (partial === null || typeof partial !== "object")
514
- return metadata;
515
- const { failures, ...rest } = fromLogAttributes(partial);
516
- return {
517
- ...metadata,
518
- partial: {
519
- ...rest,
520
- failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
521
- }
65
+ return `meeting:${parts.join("/")}`;
66
+ }, "formatMeetingReference");
67
+ var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
68
+ const value = text7.trim();
69
+ if (!value.startsWith("meeting:"))
70
+ throw invalid();
71
+ const parts = value.slice(8).split("/");
72
+ if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
73
+ throw invalid();
74
+ const ids2 = parts.map(Number);
75
+ const reference2 = {
76
+ type: "meeting",
77
+ accountId: integer2(ids2[0]),
78
+ meetingId: integer2(ids2[1]),
79
+ ...ids2.length > 2 ? { transcriptId: integer2(ids2[2]) } : {},
80
+ ...ids2.length > 3 ? { cuePosition: integer2(ids2[3], 0) } : {}
522
81
  };
523
- }, "metadataOf");
524
-
525
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/runs/scope.js
526
- import { AsyncLocalStorage } from "node:async_hooks";
527
- import { randomBytes } from "node:crypto";
528
- var scopes = new AsyncLocalStorage();
529
- var processScope;
530
- var ownProcesses = new AsyncLocalStorage();
531
- var asOwnProcess = /* @__PURE__ */ __name((body) => ownProcesses.run({}, body), "asOwnProcess");
532
- var currentRun = /* @__PURE__ */ __name(() => {
533
- const scope2 = scopes.getStore();
534
- if (scope2)
535
- return scope2;
536
- const own = ownProcesses.getStore();
537
- const fresh = /* @__PURE__ */ __name(() => ({
538
- runId: newRunId(/* @__PURE__ */ new Date(), "process"),
539
- command: "",
540
- startedAt: Date.now(),
541
- ...traceOf(process.env)
542
- }), "fresh");
543
- if (own) {
544
- own.scope ??= fresh();
545
- return own.scope;
546
- }
547
- processScope ??= fresh();
548
- return processScope;
549
- }, "currentRun");
550
- var inRun = /* @__PURE__ */ __name((scope2, body) => scopes.run(scope2, body), "inRun");
551
- var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
552
- var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
553
- var useAsProcessRun = /* @__PURE__ */ __name((scope2) => {
554
- const own = ownProcesses.getStore();
555
- if (own)
556
- own.scope = scope2;
557
- else
558
- processScope = scope2;
559
- }, "useAsProcessRun");
560
- var processRun = /* @__PURE__ */ __name(() => {
561
- const own = ownProcesses.getStore();
562
- return own ? own.scope : processScope;
563
- }, "processRun");
564
- var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
565
- var traceOf = /* @__PURE__ */ __name((env) => {
566
- const traceId = traceIdOf(env.TRACEPARENT);
567
- return traceId === void 0 ? {} : { traceId };
568
- }, "traceOf");
569
- var childTrace = /* @__PURE__ */ __name(() => {
570
- const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
571
- const traceId = hex(16);
572
- return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
573
- }, "childTrace");
574
- var attempts = new AsyncLocalStorage();
575
- var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
576
- var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
82
+ return reference2;
83
+ }, "parseMeetingReference");
84
+ var canonicalMeetingReference = /* @__PURE__ */ __name((text7) => formatMeetingReference(parseMeetingReference(text7)), "canonicalMeetingReference");
577
85
 
578
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/payment.js
86
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/payment.js
579
87
  var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
580
88
  var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
581
89
  var PAYMENT_STATES = ["expected", "paid", "cancelled"];
582
- var invalid = /* @__PURE__ */ __name((message) => {
90
+ var invalid2 = /* @__PURE__ */ __name((message) => {
583
91
  throw new CliError("validation_error", message);
584
92
  }, "invalid");
585
93
  var CURRENCIES = new Set(Intl.supportedValuesOf("currency"));
@@ -588,28 +96,28 @@ var COUNTERPARTY = /^(person|organization|project):[1-9]\d*$/;
588
96
  var amountOf = /* @__PURE__ */ __name((value) => {
589
97
  const match = AMOUNT.exec(typeof value === "number" ? String(value) : typeof value === "string" ? value.trim() : "");
590
98
  if (!match)
591
- return invalid("a payment's amount is a positive number with at most 2 decimals, such as 1200.50");
99
+ return invalid2("a payment's amount is a positive number with at most 2 decimals, such as 1200.50");
592
100
  const amount = `${BigInt(match[1] ?? "0")}.${(match[2] ?? "").padEnd(2, "0")}`;
593
101
  if (amount === "0.00")
594
- return invalid("a payment's amount is more than 0");
102
+ return invalid2("a payment's amount is more than 0");
595
103
  return amount;
596
104
  }, "amountOf");
597
105
  var dateOf = /* @__PURE__ */ __name((value) => {
598
106
  const date = typeof value === "string" ? value.trim() : "";
599
107
  if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || (/* @__PURE__ */ new Date(`${date}T00:00:00Z`)).toISOString().slice(0, 10) !== date)
600
- return invalid("a payment's dates are ISO dates, such as 2026-10-31");
108
+ return invalid2("a payment's dates are ISO dates, such as 2026-10-31");
601
109
  return date;
602
110
  }, "dateOf");
603
111
  var optionalText = /* @__PURE__ */ __name((value, what, limit) => {
604
112
  if (value === void 0 || value === null)
605
113
  return null;
606
114
  if (typeof value !== "string" || !value.trim() || value.length > limit || value.includes("\0"))
607
- return invalid(`a payment's ${what} takes 1\u2013${limit} characters`);
115
+ return invalid2(`a payment's ${what} takes 1\u2013${limit} characters`);
608
116
  return value.trim();
609
117
  }, "optionalText");
610
118
  var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
611
119
  if (typeof value !== "string" || !allowed.includes(value))
612
- return invalid(`a payment's ${what} is one of ${allowed.join(", ")}`);
120
+ return invalid2(`a payment's ${what} is one of ${allowed.join(", ")}`);
613
121
  return value;
614
122
  }, "oneOf");
615
123
  var FIELDS = [
@@ -625,20 +133,20 @@ var FIELDS = [
625
133
  ];
626
134
  var validatePayment = /* @__PURE__ */ __name((input) => {
627
135
  if (!input || typeof input !== "object" || Array.isArray(input))
628
- return invalid("a payment is an object");
136
+ return invalid2("a payment is an object");
629
137
  const raw = input;
630
- const unknown2 = Object.keys(raw).filter((key) => !FIELDS.includes(key));
631
- if (unknown2.length)
632
- return invalid(`a payment has no field ${unknown2.join(", ")}; its fields are ${FIELDS.join(", ")}`);
138
+ const unknown = Object.keys(raw).filter((key) => !FIELDS.includes(key));
139
+ if (unknown.length)
140
+ return invalid2(`a payment has no field ${unknown.join(", ")}; its fields are ${FIELDS.join(", ")}`);
633
141
  const currency = typeof raw.currency === "string" ? raw.currency.trim().toUpperCase() : "";
634
142
  if (!/^[A-Z]{3}$/.test(currency) || !CURRENCIES.has(currency))
635
- return invalid("a payment's currency is an ISO 4217 code, such as EUR or RUB");
143
+ return invalid2("a payment's currency is an ISO 4217 code, such as EUR or RUB");
636
144
  const counterparty = optionalText(raw.counterparty, "counterparty", 80);
637
145
  if (counterparty !== null && !COUNTERPARTY.test(counterparty))
638
- return invalid("a payment's counterparty is a person:, organization: or project: reference");
146
+ return invalid2("a payment's counterparty is a person:, organization: or project: reference");
639
147
  const state = oneOf(raw.state, PAYMENT_STATES, "state");
640
148
  if (raw.paid_at != null && state !== "paid")
641
- return invalid("only a paid payment has paid_at");
149
+ return invalid2("only a paid payment has paid_at");
642
150
  return {
643
151
  amount: amountOf(raw.amount),
644
152
  currency,
@@ -669,7 +177,129 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
669
177
  return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
670
178
  }, "paymentTitle");
671
179
 
672
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/passage.js
180
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
181
+ var context = {
182
+ command: "search meetings",
183
+ guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
184
+ };
185
+ var words = ["term", "phrase"];
186
+ var MOST_LINES_APART = 20;
187
+ var near = /* @__PURE__ */ __name((node) => {
188
+ if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
189
+ queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
190
+ }, "near");
191
+ var MEETING_HIT_QUERY = defineQuery({
192
+ entity: "meeting_hit",
193
+ backend: "sql",
194
+ fields: [
195
+ {
196
+ name: "text",
197
+ type: "txt",
198
+ operators: words,
199
+ example: "text:budget",
200
+ relation: "a passage with the word in any form, or a spelling speech recognition garbled",
201
+ validate: near
202
+ },
203
+ {
204
+ name: "exact",
205
+ type: "txt",
206
+ operators: words,
207
+ example: "exact:budget",
208
+ relation: "a passage with the word as typed: no other forms, no garbled spellings",
209
+ validate: near
210
+ },
211
+ {
212
+ name: "from",
213
+ type: "kw",
214
+ operators: words,
215
+ example: 'from:"Alice Synthetic"',
216
+ relation: "a line said or a chat message written by this person; attendance is --identity-id"
217
+ }
218
+ ]
219
+ });
220
+ var MEETING_FIELDS = defineQuery({
221
+ entity: "meeting_hit",
222
+ backend: "sql",
223
+ fields: [
224
+ ...MEETING_HIT_QUERY.fields,
225
+ {
226
+ name: "date",
227
+ type: "time",
228
+ operators: ["term", "range"],
229
+ example: "date>=30d",
230
+ relation: "meetings that started then; the same as --since-time and --until-time"
231
+ },
232
+ ...["project", "tag", "topic"].map((name) => ({
233
+ name,
234
+ type: "kw",
235
+ operators: words,
236
+ example: `${name}:"Example name"`,
237
+ relation: `meetings in this ${name}, by name or alias; the same as --${name}`
238
+ }))
239
+ ]
240
+ });
241
+ var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
242
+ var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
243
+ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
244
+ let ast;
245
+ try {
246
+ ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
247
+ } catch (error) {
248
+ if (error instanceof CliError)
249
+ return { query, request };
250
+ throw error;
251
+ }
252
+ const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
253
+ const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
254
+ const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
255
+ const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
256
+ if (wrong)
257
+ queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
258
+ if (!lifted.length)
259
+ return { query, request };
260
+ const next = { ...request };
261
+ const once = /* @__PURE__ */ __name((name, flag2) => {
262
+ if (next[name] !== void 0)
263
+ throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
264
+ }, "once");
265
+ for (const { node } of lifted) {
266
+ if (node.field === "date") {
267
+ const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
268
+ if (range.lower !== void 0) {
269
+ once("since", "--since-time");
270
+ next.since = range.lower + (range.lower_inclusive ? 0 : 1);
271
+ }
272
+ if (range.upper !== void 0) {
273
+ once("until", "--until-time");
274
+ next.until = range.upper - (range.upper_inclusive ? 0 : 1);
275
+ }
276
+ } else {
277
+ const field = node.field;
278
+ once(field, `--${field}`);
279
+ next[field] = node.value;
280
+ }
281
+ }
282
+ let rest = query;
283
+ for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
284
+ rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
285
+ rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
286
+ if (!rest)
287
+ throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
288
+ return { query: rest, request: next };
289
+ }, "liftMeetingFields");
290
+ var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
291
+ var meetingWordsQuery = /* @__PURE__ */ __name((text7) => {
292
+ const found = text7.match(/[\p{L}\p{N}\p{M}]+/gu) ?? [];
293
+ const span = { start: 0, end: text7.length };
294
+ const clauses = found.map((value) => ({
295
+ occur: "must",
296
+ node: { kind: "predicate", field: "text", operator: "term", value, span }
297
+ }));
298
+ const root = clauses.length === 1 && clauses[0] ? clauses[0].node : { kind: "boolean", clauses, span };
299
+ return { version: 1, language: "lucene-v1", root };
300
+ }, "meetingWordsQuery");
301
+
302
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/passage.js
673
303
  var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
674
304
  const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
675
305
  if (![before, after].every((value) => Number.isSafeInteger(value) && value >= 0) || before + after > 999 || !Number.isSafeInteger(bytes) || bytes < 2 || bytes > 4194304 || !Number.isSafeInteger(max_read_bytes) || max_read_bytes < 1 || max_read_bytes > 67108864 || expected_fingerprint !== void 0 && (typeof expected_fingerprint !== "string" || !/^[a-f0-9]{64}$/.test(expected_fingerprint)))
@@ -682,7 +312,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
682
312
  throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
683
313
  }, "validateMeetingPassage");
684
314
 
685
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
315
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
686
316
  var text = string();
687
317
  var identifier = pipe(text, minLength(1));
688
318
  var nullableText = nullable(text);
@@ -846,7 +476,7 @@ var MEETING_RESULT_ENTITIES = {
846
476
  meeting_repair: repair
847
477
  };
848
478
 
849
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/service-query.js
479
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/search/service-query.js
850
480
  var BACKENDS = ["archive", "server", "both"];
851
481
  var MAX_BRANCHES = 64;
852
482
  var some = /* @__PURE__ */ __name((value) => value === void 0 ? [] : [value], "some");
@@ -881,45 +511,11 @@ var windowOf = /* @__PURE__ */ __name(({ lower, upper, lower_inclusive, upper_in
881
511
  ...lower === void 0 ? {} : { from: lower_inclusive ? lower : lower + 1 },
882
512
  ...upper === void 0 ? {} : { to: upper_inclusive ? upper : upper - 1 }
883
513
  }), "windowOf");
514
+ var RELATIVE_TIME = /^\d+[mhd]$/i;
515
+ var OFFSET = /(?:Z|[+-]\d{2}:?\d{2})$/i;
516
+ var readsZone = /* @__PURE__ */ __name((ast, times) => walkQuery(ast.root).some((term) => times.has(term.field) && [term.value, term.upper].some((value) => value !== void 0 && value !== "*" && !RELATIVE_TIME.test(value) && !OFFSET.test(value))), "readsZone");
884
517
 
885
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/reference.js
886
- var invalid2 = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
887
- var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
888
- if (!Number.isSafeInteger(value) || value < minimum)
889
- throw invalid2();
890
- return value;
891
- }, "integer");
892
- var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
893
- const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
894
- if (reference2.transcriptId !== void 0)
895
- parts2.push(integer2(reference2.transcriptId));
896
- if (reference2.cuePosition !== void 0) {
897
- if (reference2.transcriptId === void 0)
898
- throw invalid2();
899
- parts2.push(integer2(reference2.cuePosition, 0));
900
- }
901
- return `meeting:${parts2.join("/")}`;
902
- }, "formatMeetingReference");
903
- var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
904
- const value = text7.trim();
905
- if (!value.startsWith("meeting:"))
906
- throw invalid2();
907
- const parts2 = value.slice(8).split("/");
908
- if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
909
- throw invalid2();
910
- const ids2 = parts2.map(Number);
911
- const reference2 = {
912
- type: "meeting",
913
- accountId: integer2(ids2[0]),
914
- meetingId: integer2(ids2[1]),
915
- ...ids2.length > 2 ? { transcriptId: integer2(ids2[2]) } : {},
916
- ...ids2.length > 3 ? { cuePosition: integer2(ids2[3], 0) } : {}
917
- };
918
- return reference2;
919
- }, "parseMeetingReference");
920
- var canonicalMeetingReference = /* @__PURE__ */ __name((text7) => formatMeetingReference(parseMeetingReference(text7)), "canonicalMeetingReference");
921
-
922
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/item.js
518
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/item.js
923
519
  var text2 = string();
924
520
  var count2 = pipe(number(), integer(), minValue(0));
925
521
  var MEETING_ISSUES = ["time_without_zone"];
@@ -958,7 +554,7 @@ var meetingEntries = {
958
554
  };
959
555
  var meeting = strictObject(meetingEntries);
960
556
  var MEETING_UNTRUSTED = ["title", "description", "location"];
961
- var iso = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
557
+ var iso = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
962
558
  var meetingItem = /* @__PURE__ */ __name((row, owner) => {
963
559
  const issues = meetingIssuesOf(row.metadata);
964
560
  return {
@@ -1009,14 +605,14 @@ var MEETING_QUERY = {
1009
605
  })
1010
606
  };
1011
607
 
1012
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/store.js
608
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/store.js
1013
609
  var MEETING_DOCUMENT_ROLES = ["transcript", "recording", "notes"];
1014
610
  var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
1015
611
 
1016
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/answers.js
612
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/answers.js
1017
613
  var text3 = string();
1018
614
  var count3 = pipe(number(), integer(), minValue(0));
1019
- var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
615
+ var iso2 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
1020
616
  var meetingHit = strictObject({
1021
617
  /** The cue for a transcript passage, else the meeting. */
1022
618
  ref: reference,
@@ -1035,6 +631,10 @@ var meetingHit = strictObject({
1035
631
  /** `corrected`: a query word matched only a garbled form of itself, listed in `corrections`. */
1036
632
  match: optional(picklist(["words", "corrected"])),
1037
633
  corrections: optional(array(strictObject({ from: text3, to: array(text3) }))),
634
+ /** A search with `--model`: which searches found it, its similarity in meaning, and the passage meaning matched. */
635
+ by: optional(array(picklist(["words", "meaning"]))),
636
+ score: optional(nullable(number())),
637
+ passage: optional(strictObject({ first: text3, last: text3 })),
1038
638
  source: optional(strictObject({
1039
639
  ref: reference,
1040
640
  title: nullable(text3),
@@ -1236,10 +836,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
1236
836
  var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
1237
837
  const items = found.items.map(meetingHitItem);
1238
838
  const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
1239
- const pending2 = found.coverage.indexing === "pending";
839
+ const pending = found.coverage.indexing === "pending";
1240
840
  const next = [
1241
841
  ...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
1242
- ...pending2 ? [
842
+ ...pending ? [
1243
843
  stepOf(SEARCH_AGAIN, {
1244
844
  command,
1245
845
  args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
@@ -1255,7 +855,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
1255
855
  ...cursor === void 0 ? {} : { next_cursor: cursor }
1256
856
  },
1257
857
  ...next.length > 0 ? { next } : {},
1258
- ...pending2 ? {
858
+ ...pending ? {
1259
859
  missing: [
1260
860
  {
1261
861
  field: "excerpt",
@@ -1268,7 +868,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
1268
868
  };
1269
869
  }, "meetingHitsList");
1270
870
 
1271
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
871
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1272
872
  var joinKeyOf = /* @__PURE__ */ __name((url) => {
1273
873
  const parsed = urlOf(url);
1274
874
  if (!parsed)
@@ -1302,7 +902,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
1302
902
  }
1303
903
  }, "urlOf");
1304
904
 
1305
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
905
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1306
906
  var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
1307
907
  var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
1308
908
  var htmlToText = /* @__PURE__ */ __name((html) => html.replace(/<\s*br\s*\/?>/giu, "\n").replace(/<\/\s*(p|div|li|tr|h[1-6])\s*>/giu, "\n").replace(/<a\s[^>]*href\s*=\s*"([^"]*)"[^>]*>/giu, " $1 ").replace(/<[^>]+>/gu, "").replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/gu, (_, name) => ENTITIES[name] ?? ""), "htmlToText");
@@ -1311,8 +911,8 @@ var calendarText = /* @__PURE__ */ __name((text7, { dropSecretLines = true } = {
1311
911
  if (!text7)
1312
912
  return null;
1313
913
  const kept = htmlToText(text7).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
1314
- const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1315
- return joined2 || null;
914
+ const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
915
+ return joined || null;
1316
916
  }, "calendarText");
1317
917
  var ENTRY_METADATA_KEYS = [
1318
918
  "colorId",
@@ -1339,7 +939,564 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
1339
939
  return kept;
1340
940
  }, "entryMetadata");
1341
941
 
1342
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
942
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/calls.js
943
+ var CALL_DIRECTIONS = ["incoming", "outgoing", "internal"];
944
+ var CALL_OUTCOMES = ["answered", "voicemail", "busy", "no_answer", "failed"];
945
+ var MISSED_OUTCOMES = ["voicemail", "busy", "no_answer"];
946
+ var isRecord = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord");
947
+ var milliseconds = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.round(value) : null, "milliseconds");
948
+ var word = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() ? value.trim() : null, "word");
949
+ var DIRECTION_WORDS = {
950
+ incoming: "incoming",
951
+ inbound: "incoming",
952
+ outgoing: "outgoing",
953
+ outbound: "outgoing",
954
+ internal: "internal"
955
+ };
956
+ var directionOf = /* @__PURE__ */ __name((value) => {
957
+ const found = word(value)?.toLowerCase();
958
+ return found === void 0 ? null : DIRECTION_WORDS[found] ?? null;
959
+ }, "directionOf");
960
+ var outcomeOf = /* @__PURE__ */ __name((value) => {
961
+ const found = word(value);
962
+ return found && CALL_OUTCOMES.includes(found) ? found : null;
963
+ }, "outcomeOf");
964
+ var numbers = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(word).filter((one) => one !== null) : [], "numbers");
965
+ var callOf = /* @__PURE__ */ __name((stored) => {
966
+ const metadata = isRecord(stored.metadata) ? stored.metadata : {};
967
+ const direction = directionOf(metadata.direction);
968
+ const outcome = outcomeOf(metadata.outcome);
969
+ const clientParticipant = stored.participants.find((one) => one.role === "client");
970
+ if (direction === null && outcome === null && !clientParticipant)
971
+ return null;
972
+ const managers = stored.participants.filter((one) => one.role === "manager");
973
+ const byExtension = /* @__PURE__ */ __name((number2) => {
974
+ const found = managers.find((one) => one.externalId === number2);
975
+ return {
976
+ key: `extension:${number2}`,
977
+ name: found?.name ?? null,
978
+ identityId: found?.identityId ?? null,
979
+ extension: number2
980
+ };
981
+ }, "byExtension");
982
+ const placed = word(metadata.placedBy);
983
+ const answeredBy = numbers(metadata.answeredBy).map(byExtension);
984
+ const rang = numbers(metadata.rang).map(byExtension);
985
+ const placedBy = placed === null ? null : byExtension(placed);
986
+ const named = [placedBy, ...answeredBy, ...rang].filter((one) => one !== null);
987
+ const listed2 = managers.filter((one) => !named.some((employee2) => employee2.identityId === one.identityId)).map((one) => ({
988
+ key: `identity:${one.identityId}`,
989
+ name: one.name,
990
+ identityId: one.identityId,
991
+ extension: one.externalId
992
+ }));
993
+ const employees = [...new Map([...named, ...listed2].map((one) => [one.key, one])).values()];
994
+ return {
995
+ meetingId: stored.meetingId,
996
+ startedAt: stored.startedAt,
997
+ direction,
998
+ outcome,
999
+ waitMs: milliseconds(metadata.waitMs),
1000
+ talkMs: milliseconds(metadata.talkMs),
1001
+ durationMs: milliseconds(metadata.durationMs) ?? milliseconds(stored.durationMs),
1002
+ client: clientParticipant ? { key: clientParticipant.identityKey, name: clientParticipant.name, identityId: clientParticipant.identityId } : null,
1003
+ placedBy,
1004
+ roles: ["placedBy", "answeredBy", "rang"].some((key) => key in metadata),
1005
+ answeredBy,
1006
+ rang,
1007
+ employees
1008
+ };
1009
+ }, "callOf");
1010
+
1011
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/call-answers.js
1012
+ var count4 = pipe(number(), integer(), minValue(0));
1013
+ var ms = count4;
1014
+ var id = pipe(number(), integer(), minValue(1));
1015
+ var counts = /* @__PURE__ */ __name((keys) => strictObject(Object.fromEntries([...keys, "unknown"].map((key) => [key, count4]))), "counts");
1016
+ var maybe = exactOptional;
1017
+ var employee = strictObject({
1018
+ /** `extension:<number>`, or `identity:<id>` where the provider names no extension. */
1019
+ key: string(),
1020
+ name: nullable(string()),
1021
+ identity_id: nullable(id),
1022
+ extension: nullable(string()),
1023
+ calls: count4,
1024
+ incoming: count4,
1025
+ outgoing: count4,
1026
+ internal: count4,
1027
+ placed: maybe(count4),
1028
+ answered: maybe(count4),
1029
+ rang_not_answered: maybe(count4),
1030
+ talk_ms: maybe(ms),
1031
+ mean_talk_ms: maybe(nullable(ms)),
1032
+ mean_wait_ms: maybe(nullable(ms)),
1033
+ max_wait_ms: maybe(nullable(ms))
1034
+ });
1035
+ var periodFields = {
1036
+ calls: count4,
1037
+ incoming: count4,
1038
+ outgoing: count4,
1039
+ internal: count4,
1040
+ answered: maybe(count4),
1041
+ missed: maybe(count4),
1042
+ talk_ms: maybe(ms)
1043
+ };
1044
+ var callRef = strictObject({ ref: reference, meeting_id: id, started_at: nullable(isoTime) });
1045
+ var callStatsSchema = strictObject({
1046
+ time_zone: string(),
1047
+ callback_within_ms: ms,
1048
+ short_call_under_ms: ms,
1049
+ calls: count4,
1050
+ /** Selected meetings that are not calls. */
1051
+ not_calls: count4,
1052
+ /** How many calls give each field; `roles` says who placed, answered and rang. */
1053
+ known: strictObject({
1054
+ direction: count4,
1055
+ outcome: count4,
1056
+ wait_ms: count4,
1057
+ talk_ms: count4,
1058
+ duration_ms: count4,
1059
+ roles: count4
1060
+ }),
1061
+ by_direction: maybe(counts(CALL_DIRECTIONS)),
1062
+ by_outcome: maybe(counts(CALL_OUTCOMES)),
1063
+ talk_ms: maybe(ms),
1064
+ mean_talk_ms: maybe(ms),
1065
+ duration_ms: maybe(ms),
1066
+ mean_wait_ms: maybe(nullable(ms)),
1067
+ max_wait_ms: maybe(nullable(ms)),
1068
+ short_calls: maybe(count4),
1069
+ employees: array(employee),
1070
+ /** Hours 0–23 in `time_zone`. */
1071
+ hours: array(strictObject({ hour: pipe(count4, maxValue(23)), ...periodFields })),
1072
+ /** `YYYY-MM-DD` in `time_zone`, the days with a call. */
1073
+ days: array(strictObject({ date: string(), ...periodFields })),
1074
+ missed: maybe(strictObject({
1075
+ calls: count4,
1076
+ called_back: count4,
1077
+ not_called_back: count4,
1078
+ unknown_callback: count4,
1079
+ unknown_outcome: count4,
1080
+ /** Newest first. */
1081
+ items: array(strictObject({
1082
+ ...callRef.entries,
1083
+ outcome: picklist(["voicemail", "busy", "no_answer"]),
1084
+ client: nullable(strictObject({ key: string(), name: nullable(string()) })),
1085
+ rang: array(string()),
1086
+ called_back: maybe(boolean()),
1087
+ callback: maybe(nullable(strictObject({ ...callRef.entries, after_ms: ms, direction: picklist(["outgoing", "incoming"]) })))
1088
+ })),
1089
+ has_more: boolean()
1090
+ }))
1091
+ });
1092
+ var callStats = callStatsSchema;
1093
+ var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
1094
+ var has = /* @__PURE__ */ __name((key, value) => value === void 0 ? {} : { [key]: value }, "has");
1095
+ var periodItem = /* @__PURE__ */ __name((row) => ({
1096
+ calls: row.calls,
1097
+ incoming: row.incoming,
1098
+ outgoing: row.outgoing,
1099
+ internal: row.internal,
1100
+ ...has("answered", row.answered),
1101
+ ...has("missed", row.missed),
1102
+ ...has("talk_ms", row.talkMs)
1103
+ }), "periodItem");
1104
+ var callStatsItem = /* @__PURE__ */ __name((found) => {
1105
+ const refOf = /* @__PURE__ */ __name((meetingId, startedAt) => ({
1106
+ ref: formatMeetingReference({ type: "meeting", accountId: found.accountId, meetingId }),
1107
+ meeting_id: meetingId,
1108
+ started_at: iso3(startedAt)
1109
+ }), "refOf");
1110
+ return {
1111
+ time_zone: found.timeZone,
1112
+ callback_within_ms: found.callbackWithinMs,
1113
+ short_call_under_ms: found.shortCallUnderMs,
1114
+ calls: found.calls,
1115
+ not_calls: found.notCalls,
1116
+ known: {
1117
+ direction: found.known.direction,
1118
+ outcome: found.known.outcome,
1119
+ wait_ms: found.known.waitMs,
1120
+ talk_ms: found.known.talkMs,
1121
+ duration_ms: found.known.durationMs,
1122
+ roles: found.known.roles
1123
+ },
1124
+ ...has("by_direction", found.byDirection),
1125
+ ...has("by_outcome", found.byOutcome),
1126
+ ...has("talk_ms", found.talkMs),
1127
+ ...has("mean_talk_ms", found.meanTalkMs),
1128
+ ...has("duration_ms", found.durationMs),
1129
+ ...has("mean_wait_ms", found.meanWaitMs),
1130
+ ...has("max_wait_ms", found.maxWaitMs),
1131
+ ...has("short_calls", found.shortCalls),
1132
+ employees: found.employees.map((one) => ({
1133
+ key: one.key,
1134
+ name: one.name,
1135
+ identity_id: one.identityId,
1136
+ extension: one.extension,
1137
+ calls: one.calls,
1138
+ incoming: one.incoming,
1139
+ outgoing: one.outgoing,
1140
+ internal: one.internal,
1141
+ ...has("placed", one.placed),
1142
+ ...has("answered", one.answered),
1143
+ ...has("rang_not_answered", one.rangNotAnswered),
1144
+ ...has("talk_ms", one.talkMs),
1145
+ ...has("mean_talk_ms", one.meanTalkMs),
1146
+ ...has("mean_wait_ms", one.meanWaitMs),
1147
+ ...has("max_wait_ms", one.maxWaitMs)
1148
+ })),
1149
+ hours: found.hours.map((row) => ({ hour: row.hour, ...periodItem(row) })),
1150
+ days: found.days.map((row) => ({ date: row.date, ...periodItem(row) })),
1151
+ ...has("missed", found.missed && {
1152
+ calls: found.missed.calls,
1153
+ called_back: found.missed.calledBack,
1154
+ not_called_back: found.missed.notCalledBack,
1155
+ unknown_callback: found.missed.unknownCallback,
1156
+ unknown_outcome: found.missed.unknownOutcome,
1157
+ items: found.missed.items.map((one) => ({
1158
+ ...refOf(one.meetingId, one.startedAt),
1159
+ outcome: one.outcome,
1160
+ client: one.client,
1161
+ rang: one.rang,
1162
+ ...has("called_back", one.calledBack),
1163
+ ...has("callback", one.callback === void 0 ? void 0 : one.callback && {
1164
+ ...refOf(one.callback.meetingId, one.callback.startedAt),
1165
+ after_ms: one.callback.afterMs,
1166
+ direction: one.callback.direction
1167
+ })
1168
+ })),
1169
+ has_more: found.missed.hasMore
1170
+ })
1171
+ };
1172
+ }, "callStatsItem");
1173
+
1174
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/stats.js
1175
+ var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
1176
+ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
1177
+ const zone = timeZone ?? "UTC";
1178
+ try {
1179
+ new Intl.DateTimeFormat("en", { timeZone: zone });
1180
+ } catch {
1181
+ throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
1182
+ }
1183
+ return zone;
1184
+ }, "zoneOf");
1185
+ var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
1186
+ var weekStart = /* @__PURE__ */ __name((at, format) => {
1187
+ const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1188
+ const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
1189
+ return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
1190
+ }, "weekStart");
1191
+ var dayKey = /* @__PURE__ */ __name((at, format) => {
1192
+ const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1193
+ return `${parts.year}-${parts.month}-${parts.day}`;
1194
+ }, "dayKey");
1195
+ var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
1196
+ timeZone: zone,
1197
+ year: "numeric",
1198
+ month: "2-digit",
1199
+ day: "2-digit",
1200
+ weekday: "short"
1201
+ }), "zoneFormat");
1202
+ var NO_SERIES = "no-series";
1203
+ var MOST_COUNT_ROWS = 100;
1204
+ var minutesOf = /* @__PURE__ */ __name((ms2) => Math.round(ms2 / 6e4), "minutesOf");
1205
+ var meanOf = /* @__PURE__ */ __name((ms2, timed) => timed === 0 ? null : Math.round(ms2 / timed / 6e3) / 10, "meanOf");
1206
+ var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
1207
+ if (!MEETING_COUNTS_GROUPINGS.includes(by))
1208
+ throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
1209
+ if (!Number.isSafeInteger(limit) || limit < 1)
1210
+ throw new CliError("validation_error", "--limit is a positive number");
1211
+ const zone = zoneOf(timeZone);
1212
+ const format = zoneFormat(zone);
1213
+ const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
1214
+ const add = /* @__PURE__ */ __name((into, meeting2) => {
1215
+ into.meetings += 1;
1216
+ if (meeting2.durationMs !== null) {
1217
+ into.ms += Math.max(0, meeting2.durationMs);
1218
+ into.timed += 1;
1219
+ }
1220
+ if (meeting2.transcribed)
1221
+ into.transcripts += 1;
1222
+ }, "add");
1223
+ const total = { ...sum(), name: null };
1224
+ const groups = /* @__PURE__ */ new Map();
1225
+ for (const meeting2 of meetings) {
1226
+ add(total, meeting2);
1227
+ const key = by === "series" ? meeting2.seriesKey === null ? NO_SERIES : `series:${meeting2.seriesKey}` : meeting2.startedAt === null ? null : by === "day" ? dayKey(meeting2.startedAt, format) : weekStart(meeting2.startedAt, format);
1228
+ if (key === null)
1229
+ continue;
1230
+ const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
1231
+ add(group, meeting2);
1232
+ groups.set(key, group);
1233
+ }
1234
+ const ordered = [...groups.entries()].sort(([a, one], [b, other]) => by === "series" ? other.ms - one.ms || other.meetings - one.meetings || a.localeCompare(b) : b.localeCompare(a));
1235
+ const kept = ordered.slice(0, limit);
1236
+ if (by !== "series")
1237
+ kept.reverse();
1238
+ const counted = /* @__PURE__ */ __name(({ meetings: count7, ms: ms2, timed, transcripts }) => ({
1239
+ meetings: count7,
1240
+ minutes: minutesOf(ms2),
1241
+ meanMinutes: meanOf(ms2, timed),
1242
+ transcripts
1243
+ }), "counted");
1244
+ return {
1245
+ by,
1246
+ timeZone: zone,
1247
+ ...counted(total),
1248
+ rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
1249
+ hasMore: ordered.length > limit
1250
+ };
1251
+ }, "aggregateMeetingCounts");
1252
+ var UNKNOWN_SPEAKER = "unknown";
1253
+ var speakerOf = /* @__PURE__ */ __name((row) => row.personId !== null ? { key: `person:${row.personId}`, name: row.personName ?? row.identityName ?? row.speakerName } : row.identityId !== null ? { key: `identity:${row.identityId}`, name: row.identityName ?? row.speakerName } : row.speakerName?.trim() ? { key: `name:${row.speakerName.trim().toLowerCase()}`, name: row.speakerName.trim() } : { key: UNKNOWN_SPEAKER, name: null }, "speakerOf");
1254
+ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
1255
+ const zone = zoneOf(timeZone);
1256
+ const format = zoneFormat(zone);
1257
+ const speakers = /* @__PURE__ */ new Map();
1258
+ const weeks = /* @__PURE__ */ new Map();
1259
+ const meetings = /* @__PURE__ */ new Set();
1260
+ let lines = 0;
1261
+ let words2 = 0;
1262
+ let talkMs = 0;
1263
+ for (const row of rows) {
1264
+ const talk = Math.max(0, row.endMs - row.startMs);
1265
+ meetings.add(row.meetingId);
1266
+ lines += 1;
1267
+ words2 += row.words;
1268
+ talkMs += talk;
1269
+ const who = speakerOf(row);
1270
+ const held = speakers.get(who.key) ?? {
1271
+ key: who.key,
1272
+ name: who.name ?? null,
1273
+ personId: row.personId,
1274
+ identityId: row.personId === null ? row.identityId : null,
1275
+ meetings: 0,
1276
+ lines: 0,
1277
+ words: 0,
1278
+ talkMs: 0,
1279
+ share: 0,
1280
+ seen: /* @__PURE__ */ new Set()
1281
+ };
1282
+ held.seen.add(row.meetingId);
1283
+ held.lines += 1;
1284
+ held.words += row.words;
1285
+ held.talkMs += talk;
1286
+ speakers.set(who.key, held);
1287
+ if (row.startedAt !== null) {
1288
+ const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
1289
+ week.meetings.add(row.meetingId);
1290
+ week.talkMs += talk;
1291
+ weeks.set(weekStart(row.startedAt, format), week);
1292
+ }
1293
+ }
1294
+ return {
1295
+ timeZone: zone,
1296
+ meetings: meetings.size,
1297
+ lines,
1298
+ words: words2,
1299
+ talkMs,
1300
+ speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
1301
+ ...speaker,
1302
+ meetings: seen.size,
1303
+ share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
1304
+ })).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
1305
+ weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
1306
+ };
1307
+ }, "aggregateMeetingStats");
1308
+
1309
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/call-stats.js
1310
+ var CALLBACK_WITHIN_MS = 24 * 60 * 60 * 1e3;
1311
+ var SHORT_CALL_UNDER_MS = 3e4;
1312
+ var MOST_MISSED = 100;
1313
+ var countsOf = /* @__PURE__ */ __name((keys) => Object.fromEntries([...keys, "unknown"].map((key) => [key, 0])), "countsOf");
1314
+ var isMissed = /* @__PURE__ */ __name((call) => call.direction === "incoming" && call.outcome !== null && MISSED_OUTCOMES.includes(call.outcome), "isMissed");
1315
+ var mean = /* @__PURE__ */ __name((sum, count7) => count7 === 0 ? null : Math.round(sum / count7), "mean");
1316
+ var positiveMs = /* @__PURE__ */ __name((value, fallback, name) => {
1317
+ const ms2 = value ?? fallback;
1318
+ if (!Number.isSafeInteger(ms2) || ms2 < 1)
1319
+ throw new CliError("validation_error", `${name} is a positive duration`);
1320
+ return ms2;
1321
+ }, "positiveMs");
1322
+ var hourFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", { timeZone: zone, hour: "2-digit", hourCycle: "h23" }), "hourFormat");
1323
+ var answersMissed = /* @__PURE__ */ __name((missed, later, within2) => missed.startedAt !== null && later.startedAt !== null && later.startedAt > missed.startedAt && later.startedAt - missed.startedAt <= within2 && (later.direction === "outgoing" || later.direction === "incoming" && later.outcome === "answered"), "answersMissed");
1324
+ var when = /* @__PURE__ */ __name((present, value) => present ? value : {}, "when");
1325
+ var period = /* @__PURE__ */ __name(() => ({ calls: 0, incoming: 0, outgoing: 0, internal: 0, answered: 0, missed: 0, talkMs: 0 }), "period");
1326
+ var aggregateCallStats = /* @__PURE__ */ __name((calls, options = {}) => {
1327
+ const zone = zoneOf(options.timeZone);
1328
+ const within2 = positiveMs(options.callbackWithinMs, CALLBACK_WITHIN_MS, "--within");
1329
+ const short = positiveMs(options.shortCallUnderMs, SHORT_CALL_UNDER_MS, "the short-call threshold");
1330
+ const limit = options.missedLimit ?? MOST_MISSED;
1331
+ if (!Number.isSafeInteger(limit) || limit < 0)
1332
+ throw new CliError("validation_error", "--limit is a positive number");
1333
+ const known = {
1334
+ direction: calls.filter((call) => call.direction !== null).length,
1335
+ outcome: calls.filter((call) => call.outcome !== null).length,
1336
+ waitMs: calls.filter((call) => call.waitMs !== null).length,
1337
+ talkMs: calls.filter((call) => call.talkMs !== null).length,
1338
+ durationMs: calls.filter((call) => call.durationMs !== null).length,
1339
+ roles: calls.filter((call) => call.roles).length
1340
+ };
1341
+ const has2 = { outcome: known.outcome > 0, talk: known.talkMs > 0, wait: known.waitMs > 0, roles: known.roles > 0 };
1342
+ const days = zoneFormat(zone);
1343
+ const hourOf = hourFormat(zone);
1344
+ const byDirection = countsOf(CALL_DIRECTIONS);
1345
+ const byOutcome = countsOf(CALL_OUTCOMES);
1346
+ let talk = 0;
1347
+ let duration = 0;
1348
+ let wait = { sum: 0, count: 0, max: null };
1349
+ let shortCalls = 0;
1350
+ const employees = /* @__PURE__ */ new Map();
1351
+ const hours = Array.from({ length: 24 }, period);
1352
+ const dayRows = /* @__PURE__ */ new Map();
1353
+ const employee2 = /* @__PURE__ */ __name((one) => {
1354
+ const held = employees.get(one.key) ?? {
1355
+ ...one,
1356
+ ...period(),
1357
+ placed: 0,
1358
+ rangNotAnswered: 0,
1359
+ talks: 0,
1360
+ waits: 0,
1361
+ waitSum: 0,
1362
+ maxWaitMs: null
1363
+ };
1364
+ held.name ??= one.name;
1365
+ held.identityId ??= one.identityId;
1366
+ employees.set(one.key, held);
1367
+ return held;
1368
+ }, "employee");
1369
+ const addTo = /* @__PURE__ */ __name((row, call) => {
1370
+ row.calls += 1;
1371
+ if (call.direction)
1372
+ row[call.direction] += 1;
1373
+ if (call.outcome === "answered")
1374
+ row.answered += 1;
1375
+ if (isMissed(call))
1376
+ row.missed += 1;
1377
+ row.talkMs += call.talkMs ?? 0;
1378
+ }, "addTo");
1379
+ for (const call of calls) {
1380
+ byDirection[call.direction ?? "unknown"] += 1;
1381
+ byOutcome[call.outcome ?? "unknown"] += 1;
1382
+ talk += call.talkMs ?? 0;
1383
+ duration += call.durationMs ?? 0;
1384
+ if (call.outcome === "answered" && call.talkMs !== null && call.talkMs < short)
1385
+ shortCalls += 1;
1386
+ if (call.direction === "incoming" && call.outcome === "answered" && call.waitMs !== null)
1387
+ wait = { sum: wait.sum + call.waitMs, count: wait.count + 1, max: Math.max(wait.max ?? 0, call.waitMs) };
1388
+ const talkers = /* @__PURE__ */ new Set([
1389
+ ...call.answeredBy.map(({ key }) => key),
1390
+ ...call.placedBy && call.outcome === "answered" ? [call.placedBy.key] : []
1391
+ ]);
1392
+ for (const one of call.employees) {
1393
+ const held = employee2(one);
1394
+ held.calls += 1;
1395
+ if (call.direction)
1396
+ held[call.direction] += 1;
1397
+ if (call.placedBy?.key === one.key)
1398
+ held.placed += 1;
1399
+ if (call.answeredBy.some(({ key }) => key === one.key))
1400
+ held.answered += 1;
1401
+ if (call.rang.some(({ key }) => key === one.key))
1402
+ held.rangNotAnswered += 1;
1403
+ if (talkers.has(one.key) && call.talkMs !== null) {
1404
+ held.talkMs += call.talkMs;
1405
+ held.talks += 1;
1406
+ }
1407
+ if (call.direction === "incoming" && call.answeredBy[0]?.key === one.key && call.waitMs !== null) {
1408
+ held.waits += 1;
1409
+ held.waitSum += call.waitMs;
1410
+ held.maxWaitMs = Math.max(held.maxWaitMs ?? 0, call.waitMs);
1411
+ }
1412
+ }
1413
+ if (call.startedAt !== null) {
1414
+ const hour = hours[Number(hourOf.format(new Date(call.startedAt))) % 24];
1415
+ if (hour)
1416
+ addTo(hour, call);
1417
+ const date = dayKey(call.startedAt, days);
1418
+ const row = dayRows.get(date) ?? period();
1419
+ addTo(row, call);
1420
+ dayRows.set(date, row);
1421
+ }
1422
+ }
1423
+ const periodOf = /* @__PURE__ */ __name(({ answered, missed, talkMs, ...row }) => ({
1424
+ ...row,
1425
+ ...when(has2.outcome, { answered, missed }),
1426
+ ...when(has2.talk, { talkMs })
1427
+ }), "periodOf");
1428
+ const byClient = /* @__PURE__ */ new Map();
1429
+ for (const call of [...calls, ...options.later ?? []]) {
1430
+ if (!call.client)
1431
+ continue;
1432
+ const list = byClient.get(call.client.key) ?? [];
1433
+ list.push(call);
1434
+ byClient.set(call.client.key, list);
1435
+ }
1436
+ for (const list of byClient.values())
1437
+ list.sort((a, b) => (a.startedAt ?? 0) - (b.startedAt ?? 0));
1438
+ const missedCalls = calls.filter(isMissed).sort((a, b) => (b.startedAt ?? 0) - (a.startedAt ?? 0)).map((call) => {
1439
+ const { client, startedAt } = call;
1440
+ const found = client ? byClient.get(client.key)?.find((one) => answersMissed(call, one, within2)) : void 0;
1441
+ return {
1442
+ meetingId: call.meetingId,
1443
+ startedAt,
1444
+ outcome: call.outcome,
1445
+ client: client ? { key: client.key, name: client.name } : null,
1446
+ rang: call.rang.map(({ key }) => key),
1447
+ ...when(client !== null && startedAt !== null, {
1448
+ calledBack: found !== void 0,
1449
+ callback: found && found.startedAt !== null && startedAt !== null ? {
1450
+ meetingId: found.meetingId,
1451
+ startedAt: found.startedAt,
1452
+ afterMs: found.startedAt - startedAt,
1453
+ direction: found.direction
1454
+ } : null
1455
+ })
1456
+ };
1457
+ });
1458
+ return {
1459
+ timeZone: zone,
1460
+ callbackWithinMs: within2,
1461
+ shortCallUnderMs: short,
1462
+ calls: calls.length,
1463
+ known,
1464
+ ...when(known.direction > 0, { byDirection }),
1465
+ ...when(has2.outcome, { byOutcome }),
1466
+ ...when(has2.talk, { talkMs: talk, meanTalkMs: Math.round(talk / known.talkMs) }),
1467
+ ...when(known.durationMs > 0, { durationMs: duration }),
1468
+ ...when(has2.wait, { meanWaitMs: mean(wait.sum, wait.count), maxWaitMs: wait.max }),
1469
+ ...when(has2.outcome && has2.talk, { shortCalls }),
1470
+ employees: [...employees.values()].map(({ talks, waits, waitSum, placed, answered, rangNotAnswered, talkMs, maxWaitMs, missed: _, ...one }) => ({
1471
+ key: one.key,
1472
+ name: one.name,
1473
+ identityId: one.identityId,
1474
+ extension: one.extension,
1475
+ calls: one.calls,
1476
+ incoming: one.incoming,
1477
+ outgoing: one.outgoing,
1478
+ internal: one.internal,
1479
+ ...when(has2.roles, { placed, answered, rangNotAnswered }),
1480
+ ...when(has2.roles && has2.talk, { talkMs, meanTalkMs: mean(talkMs, talks) }),
1481
+ ...when(has2.roles && has2.wait, { meanWaitMs: mean(waitSum, waits), maxWaitMs })
1482
+ })).sort((a, b) => b.calls - a.calls || a.key.localeCompare(b.key)),
1483
+ hours: hours.map((row, hour) => ({ hour, ...periodOf(row) })),
1484
+ days: [...dayRows.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([date, row]) => ({ date, ...periodOf(row) })),
1485
+ ...when(has2.outcome, {
1486
+ missed: {
1487
+ calls: missedCalls.length,
1488
+ calledBack: missedCalls.filter((one) => one.calledBack === true).length,
1489
+ notCalledBack: missedCalls.filter((one) => one.calledBack === false).length,
1490
+ unknownCallback: missedCalls.filter((one) => one.calledBack === void 0).length,
1491
+ unknownOutcome: calls.filter((call) => call.direction === "incoming" && call.outcome === null).length,
1492
+ items: missedCalls.slice(0, limit),
1493
+ hasMore: missedCalls.length > limit
1494
+ }
1495
+ })
1496
+ };
1497
+ }, "aggregateCallStats");
1498
+
1499
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1343
1500
  import { createHash } from "node:crypto";
1344
1501
  var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
1345
1502
  reference: cue2.reference,
@@ -1353,7 +1510,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
1353
1510
  text: cue2.text
1354
1511
  })).digest("hex"), "meetingCueFingerprint");
1355
1512
 
1356
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1513
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1357
1514
  var EVENT_QUERY = defineQuery({
1358
1515
  entity: "event",
1359
1516
  backend: "sql",
@@ -1369,7 +1526,8 @@ var EVENT_QUERY = defineQuery({
1369
1526
  ]
1370
1527
  });
1371
1528
 
1372
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1529
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1530
+ var PARTICIPANT_RESPONSES = ["needs-action", "accepted", "tentative", "declined", "delegated"];
1373
1531
  var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
1374
1532
  var seriesEnd = /* @__PURE__ */ __name((entry) => {
1375
1533
  if (entry.recurrenceEndsAt !== null)
@@ -1378,8 +1536,8 @@ var seriesEnd = /* @__PURE__ */ __name((entry) => {
1378
1536
  const until = rule === void 0 ? null : UNTIL.exec(rule.slice("RRULE:".length));
1379
1537
  if (!until)
1380
1538
  return Number.POSITIVE_INFINITY;
1381
- const [, year, month, day2, hour = "23", minute = "59", second = "59"] = until;
1382
- return Date.UTC(Number(year), Number(month) - 1, Number(day2), Number(hour), Number(minute), Number(second)) + 864e5;
1539
+ const [, year, month, day, hour = "23", minute = "59", second = "59"] = until;
1540
+ return Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)) + 864e5;
1383
1541
  }, "seriesEnd");
1384
1542
  var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
1385
1543
  if (entry.kind === "occurrence" && !entry.exception)
@@ -1392,7 +1550,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
1392
1550
  return Math.max(entry.endsAt ?? start, start + 1) > window.from;
1393
1551
  }, "entryInWindow");
1394
1552
 
1395
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/events.js
1553
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/events.js
1396
1554
  var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(), { create = true } = {}) => {
1397
1555
  const current = await store.meeting(details.meeting.id);
1398
1556
  if (!current)
@@ -1437,7 +1595,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(),
1437
1595
  return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
1438
1596
  }, "linkEvent");
1439
1597
 
1440
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1598
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1441
1599
  var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text7) => text7.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
1442
1600
  var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
1443
1601
  if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
@@ -1461,7 +1619,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
1461
1619
  };
1462
1620
  }, "validateMeetingParticipantSearch");
1463
1621
 
1464
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1622
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1465
1623
  var MeetingError = class extends CliError {
1466
1624
  static {
1467
1625
  __name(this, "MeetingError");
@@ -1592,14 +1750,14 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id5, accountId)
1592
1750
  return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
1593
1751
  }, "meetingSummaryAnswer");
1594
1752
 
1595
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/export.js
1596
- var timestamp = /* @__PURE__ */ __name((milliseconds) => {
1597
- if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
1753
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/export.js
1754
+ var timestamp = /* @__PURE__ */ __name((milliseconds2) => {
1755
+ if (!Number.isSafeInteger(milliseconds2) || milliseconds2 < 0)
1598
1756
  throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
1599
- const hours = Math.floor(milliseconds / 36e5);
1600
- const minutes = Math.floor(milliseconds % 36e5 / 6e4);
1601
- const seconds = Math.floor(milliseconds % 6e4 / 1e3);
1602
- return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds % 1e3).padStart(3, "0")}`;
1757
+ const hours = Math.floor(milliseconds2 / 36e5);
1758
+ const minutes = Math.floor(milliseconds2 % 36e5 / 6e4);
1759
+ const seconds = Math.floor(milliseconds2 % 6e4 / 1e3);
1760
+ return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds2 % 1e3).padStart(3, "0")}`;
1603
1761
  }, "timestamp");
1604
1762
  var vttText = /* @__PURE__ */ __name((text7) => {
1605
1763
  if (visibleControls(text7) !== text7 || /\n\s*\n/.test(text7))
@@ -1654,30 +1812,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
1654
1812
  text: row.text
1655
1813
  })));
1656
1814
  } else {
1657
- const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1815
+ const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1658
1816
  if (details.meeting.description !== null)
1659
- parts2.push("## Description", quote(details.meeting.description));
1817
+ parts.push("## Description", quote(details.meeting.description));
1660
1818
  for (const summary of details.summaries) {
1661
- parts2.push(`## ${heading(summary.title ?? "Summary")}`);
1819
+ parts.push(`## ${heading(summary.title ?? "Summary")}`);
1662
1820
  if (summary.content !== null)
1663
- parts2.push(quote(summary.content));
1821
+ parts.push(quote(summary.content));
1664
1822
  else {
1665
1823
  if (summary.overview !== null)
1666
- parts2.push(quote(summary.overview));
1824
+ parts.push(quote(summary.overview));
1667
1825
  for (const section of summary.sections)
1668
- parts2.push(`### ${heading(section.label)}`, quote(section.text));
1826
+ parts.push(`### ${heading(section.label)}`, quote(section.text));
1669
1827
  if (summary.nextSteps.length > 0)
1670
- parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
1828
+ parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
1671
1829
  }
1672
1830
  }
1673
1831
  for (const part of transcripts) {
1674
- parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
1832
+ parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
1675
1833
  if (part.transcript.supersededAt !== null)
1676
- parts2.push("Version: superseded");
1834
+ parts.push("Version: superseded");
1677
1835
  for (const row of [...part.rows].sort((a, b) => a.position - b.position))
1678
- parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
1836
+ parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
1679
1837
  }
1680
- content = `${parts2.join("\n\n")}
1838
+ content = `${parts.join("\n\n")}
1681
1839
  `;
1682
1840
  }
1683
1841
  return {
@@ -1688,10 +1846,10 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id5, options) => {
1688
1846
  };
1689
1847
  }, "exportMeeting");
1690
1848
 
1691
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1849
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1692
1850
  import { createHash as createHash2 } from "node:crypto";
1693
1851
 
1694
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
1852
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
1695
1853
  var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
1696
1854
  if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
1697
1855
  throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
@@ -1702,7 +1860,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
1702
1860
  return new Date(value).toISOString();
1703
1861
  }, "meetingTimestamp");
1704
1862
 
1705
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1863
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1706
1864
  var TASK_TYPES = ["bug", "feature", "chore"];
1707
1865
  var invalid3 = /* @__PURE__ */ __name((message) => {
1708
1866
  throw new CliError("validation_error", message);
@@ -1716,17 +1874,17 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
1716
1874
  var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
1717
1875
  var findingWhere = /* @__PURE__ */ __name((of) => {
1718
1876
  const id5 = typeof of.id === "string" ? of.id : null;
1719
- const kind3 = typeof of.kind === "string" ? of.kind : null;
1877
+ const kind2 = typeof of.kind === "string" ? of.kind : null;
1720
1878
  return {
1721
- where: id5 || kind3 ? ` in ${[id5, kind3 && `(${kind3})`].filter(Boolean).join(" ")}` : "",
1722
- named: { ...id5 ? { finding: id5 } : {}, ...kind3 ? { kind: kind3 } : {} }
1879
+ where: id5 || kind2 ? ` in ${[id5, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
1880
+ named: { ...id5 ? { finding: id5 } : {}, ...kind2 ? { kind: kind2 } : {} }
1723
1881
  };
1724
1882
  }, "findingWhere");
1725
1883
  var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
1726
- const unknown2 = Object.keys(value).filter((key) => !allowed.includes(key));
1727
- if (!unknown2.length)
1884
+ const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
1885
+ if (!unknown.length)
1728
1886
  return;
1729
- const fields2 = unknown2.map(snakeCase);
1887
+ const fields2 = unknown.map(snakeCase);
1730
1888
  const takes = allowed.map(snakeCase);
1731
1889
  const { where, named } = findingWhere(of);
1732
1890
  throw new CliError("validation_error", `unknown ${noun} field${fields2.length > 1 ? "s" : ""} ${fields2.join(", ")}${where}; it takes ${takes.join(", ")}`, { reason: "finding.unknown-field", fields: fields2, allowed: takes, ...named });
@@ -1772,17 +1930,17 @@ var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
1772
1930
  if (!finding || typeof finding !== "object")
1773
1931
  return invalid3("a finding is an object");
1774
1932
  const id5 = findingId(finding.id, ids2);
1775
- const project2 = finding.project === void 0 && rules.anySubject ? void 0 : findingText(finding.project, 64);
1776
- if (project2 !== void 0 && !/^project:[1-9]\d*$/.test(project2))
1933
+ const project = finding.project === void 0 && rules.anySubject ? void 0 : findingText(finding.project, 64);
1934
+ if (project !== void 0 && !/^project:[1-9]\d*$/.test(project))
1777
1935
  return invalid3("a finding names a project reference");
1778
1936
  if (finding.subject !== void 0 && (!rules.anySubject || !SUBJECT.test(findingText(finding.subject, 80))))
1779
1937
  return invalid3("a finding's subject is a person:, organization:, task: or project: reference");
1780
- if (finding.kind === "task" && project2 === void 0 && !rules.inboxTasks)
1938
+ if (finding.kind === "task" && project === void 0 && !rules.inboxTasks)
1781
1939
  return invalid3("a task finding names the project the task goes in");
1782
1940
  const evidence = validEvidence(finding.evidence, rules);
1783
1941
  const base = {
1784
1942
  id: id5,
1785
- ...project2 === void 0 ? {} : { project: project2 },
1943
+ ...project === void 0 ? {} : { project },
1786
1944
  ...finding.subject === void 0 ? {} : { subject: finding.subject },
1787
1945
  evidence
1788
1946
  };
@@ -1857,7 +2015,7 @@ var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
1857
2015
  };
1858
2016
  }, "validateFinding");
1859
2017
  var support = /* @__PURE__ */ __name((value, evidence, field) => {
1860
- if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
2018
+ if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref2) => typeof ref2 !== "string" || !evidence.some((item) => item.reference === ref2)))
1861
2019
  return invalid3(`${field} lists 1\u20138 references this finding's evidence cites, as plain strings such as ["<reference>"], not evidence objects`);
1862
2020
  return [...new Set(value)].sort();
1863
2021
  }, "support");
@@ -1877,7 +2035,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
1877
2035
  var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
1878
2036
  var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
1879
2037
 
1880
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/findings.js
2038
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/findings.js
1881
2039
  var MEETING_FINDINGS_KIND = "meeting_findings";
1882
2040
  var cue = /* @__PURE__ */ __name((raw) => {
1883
2041
  const reference2 = canonicalMeetingReference(raw);
@@ -1888,151 +2046,29 @@ var cue = /* @__PURE__ */ __name((raw) => {
1888
2046
  var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
1889
2047
  var meetingFindingFingerprint = findingFingerprint;
1890
2048
 
1891
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1892
- var context = {
1893
- command: "search meetings",
1894
- guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
2049
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/language.js
2050
+ var LATIN_WORDS = {
2051
+ en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
2052
+ es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
2053
+ de: ["der", "und", "ist", "nicht", "das", "ich", "wir", "mit", "auch", "ein"],
2054
+ fr: ["le", "les", "est", "une", "pas", "je", "vous", "nous", "avec", "mais"],
2055
+ it: ["gli", "della", "sono", "perch\xE9", "anche", "questo", "molto", "che", "di", "\xE8"],
2056
+ pt: ["n\xE3o", "voc\xEA", "isso", "muito", "ent\xE3o", "com", "uma", "tamb\xE9m", "mas", "eu"]
1895
2057
  };
1896
- var words = ["term", "phrase"];
1897
- var MOST_LINES_APART = 20;
1898
- var near = /* @__PURE__ */ __name((node) => {
1899
- if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
1900
- queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
1901
- }, "near");
1902
- var MEETING_HIT_QUERY = defineQuery({
1903
- entity: "meeting_hit",
1904
- backend: "sql",
1905
- fields: [
1906
- {
1907
- name: "text",
1908
- type: "txt",
1909
- operators: words,
1910
- example: "text:budget",
1911
- relation: "a passage with the word in any form, or a spelling speech recognition garbled",
1912
- validate: near
1913
- },
1914
- {
1915
- name: "exact",
1916
- type: "txt",
1917
- operators: words,
1918
- example: "exact:budget",
1919
- relation: "a passage with the word as typed: no other forms, no garbled spellings",
1920
- validate: near
1921
- },
1922
- {
1923
- name: "from",
1924
- type: "kw",
1925
- operators: words,
1926
- example: 'from:"Alice Synthetic"',
1927
- relation: "a line said or a chat message written by this person; attendance is --identity-id"
1928
- }
1929
- ]
1930
- });
1931
- var MEETING_FIELDS = defineQuery({
1932
- entity: "meeting_hit",
1933
- backend: "sql",
1934
- fields: [
1935
- ...MEETING_HIT_QUERY.fields,
1936
- {
1937
- name: "date",
1938
- type: "time",
1939
- operators: ["term", "range"],
1940
- example: "date>=30d",
1941
- relation: "meetings that started then; the same as --since-time and --until-time"
1942
- },
1943
- ...["project", "tag", "topic"].map((name) => ({
1944
- name,
1945
- type: "kw",
1946
- operators: words,
1947
- example: `${name}:"Example name"`,
1948
- relation: `meetings in this ${name}, by name or alias; the same as --${name}`
1949
- }))
1950
- ]
1951
- });
1952
- var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
1953
- var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
1954
- var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
1955
- let ast;
1956
- try {
1957
- ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
1958
- } catch (error) {
1959
- if (error instanceof CliError)
1960
- return { query, request };
1961
- throw error;
1962
- }
1963
- const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
1964
- const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
1965
- const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
1966
- const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
1967
- if (wrong)
1968
- queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
1969
- if (!lifted.length)
1970
- return { query, request };
1971
- const next = { ...request };
1972
- const once = /* @__PURE__ */ __name((name, flag2) => {
1973
- if (next[name] !== void 0)
1974
- throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
1975
- }, "once");
1976
- for (const { node } of lifted) {
1977
- if (node.field === "date") {
1978
- const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
1979
- if (range.lower !== void 0) {
1980
- once("since", "--since-time");
1981
- next.since = range.lower + (range.lower_inclusive ? 0 : 1);
1982
- }
1983
- if (range.upper !== void 0) {
1984
- once("until", "--until-time");
1985
- next.until = range.upper - (range.upper_inclusive ? 0 : 1);
1986
- }
1987
- } else {
1988
- const field = node.field;
1989
- once(field, `--${field}`);
1990
- next[field] = node.value;
1991
- }
1992
- }
1993
- let rest = query;
1994
- for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
1995
- rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
1996
- rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
1997
- if (!rest)
1998
- throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
1999
- return { query: rest, request: next };
2000
- }, "liftMeetingFields");
2001
- var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
2002
- var meetingWordsQuery = /* @__PURE__ */ __name((text7) => {
2003
- const found = text7.match(/[\p{L}\p{N}\p{M}]+/gu) ?? [];
2004
- const span = { start: 0, end: text7.length };
2005
- const clauses = found.map((value) => ({
2006
- occur: "must",
2007
- node: { kind: "predicate", field: "text", operator: "term", value, span }
2008
- }));
2009
- const root = clauses.length === 1 && clauses[0] ? clauses[0].node : { kind: "boolean", clauses, span };
2010
- return { version: 1, language: "lucene-v1", root };
2011
- }, "meetingWordsQuery");
2012
-
2013
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/language.js
2014
- var LATIN_WORDS = {
2015
- en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
2016
- es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
2017
- de: ["der", "und", "ist", "nicht", "das", "ich", "wir", "mit", "auch", "ein"],
2018
- fr: ["le", "les", "est", "une", "pas", "je", "vous", "nous", "avec", "mais"],
2019
- it: ["gli", "della", "sono", "perch\xE9", "anche", "questo", "molto", "che", "di", "\xE8"],
2020
- pt: ["n\xE3o", "voc\xEA", "isso", "muito", "ent\xE3o", "com", "uma", "tamb\xE9m", "mas", "eu"]
2021
- };
2022
- var LATIN_LANGUAGE = new Map(Object.entries(LATIN_WORDS).flatMap(([language, words2]) => words2.map((word) => [word, language])));
2023
- var UKRAINIAN = /[іїєґ]/giu;
2024
- var CYRILLIC = new RegExp("\\p{Script=Cyrillic}", "gu");
2025
- var LATIN = new RegExp("\\p{Script=Latin}", "gu");
2026
- var MIN_LETTERS = 20;
2027
- var DOMINANT = 0.75;
2028
- var countOf = /* @__PURE__ */ __name((text7, pattern) => text7.match(pattern)?.length ?? 0, "countOf");
2029
- var latinLanguage = /* @__PURE__ */ __name((texts) => {
2030
- const votes = /* @__PURE__ */ new Map();
2031
- for (const text7 of texts)
2032
- for (const word of text7.toLowerCase().split(/[^\p{L}]+/u)) {
2033
- const language = LATIN_LANGUAGE.get(word);
2034
- if (language)
2035
- votes.set(language, (votes.get(language) ?? 0) + 1);
2058
+ var LATIN_LANGUAGE = new Map(Object.entries(LATIN_WORDS).flatMap(([language, words2]) => words2.map((word2) => [word2, language])));
2059
+ var UKRAINIAN = /[іїєґ]/giu;
2060
+ var CYRILLIC = new RegExp("\\p{Script=Cyrillic}", "gu");
2061
+ var LATIN = new RegExp("\\p{Script=Latin}", "gu");
2062
+ var MIN_LETTERS = 20;
2063
+ var DOMINANT = 0.75;
2064
+ var countOf = /* @__PURE__ */ __name((text7, pattern) => text7.match(pattern)?.length ?? 0, "countOf");
2065
+ var latinLanguage = /* @__PURE__ */ __name((texts) => {
2066
+ const votes = /* @__PURE__ */ new Map();
2067
+ for (const text7 of texts)
2068
+ for (const word2 of text7.toLowerCase().split(/[^\p{L}]+/u)) {
2069
+ const language = LATIN_LANGUAGE.get(word2);
2070
+ if (language)
2071
+ votes.set(language, (votes.get(language) ?? 0) + 1);
2036
2072
  }
2037
2073
  const [first, second] = [...votes].sort((a, b) => b[1] - a[1]);
2038
2074
  if (!first || first[1] < 3 || second && first[1] < 2 * second[1])
@@ -2059,7 +2095,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
2059
2095
  return null;
2060
2096
  }, "transcriptLanguage");
2061
2097
 
2062
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2098
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2063
2099
  var contentHash = /* @__PURE__ */ __name(async (text7) => {
2064
2100
  const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text7));
2065
2101
  return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
@@ -2067,8 +2103,8 @@ var contentHash = /* @__PURE__ */ __name(async (text7) => {
2067
2103
  var speakerPosition = /* @__PURE__ */ __name((name, participants) => {
2068
2104
  if (name === null)
2069
2105
  return null;
2070
- const matches2 = participants.flatMap((p, i) => p.displayName === name ? [i] : []);
2071
- return matches2.length === 1 ? matches2[0] ?? null : null;
2106
+ const matches = participants.flatMap((p, i) => p.displayName === name ? [i] : []);
2107
+ return matches.length === 1 ? matches[0] ?? null : null;
2072
2108
  }, "speakerPosition");
2073
2109
  var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source, hashText = JSON.stringify(lines), format = null) => ({
2074
2110
  source,
@@ -2090,13 +2126,13 @@ var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source,
2090
2126
  }))
2091
2127
  }), "transcriptInput");
2092
2128
  var timestamp2 = /* @__PURE__ */ __name((value) => {
2093
- const time2 = Date.parse(value);
2094
- if (!Number.isFinite(time2))
2129
+ const time = Date.parse(value);
2130
+ if (!Number.isFinite(time))
2095
2131
  throw new Error("Invalid meeting timestamp");
2096
- return time2;
2132
+ return time;
2097
2133
  }, "timestamp");
2098
2134
 
2099
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2135
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2100
2136
  var TranscriptTextError = class extends Error {
2101
2137
  static {
2102
2138
  __name(this, "TranscriptTextError");
@@ -2151,7 +2187,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
2151
2187
  return { header, lines };
2152
2188
  }, "parseTranscriptText");
2153
2189
 
2154
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2190
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2155
2191
  var VttError = class extends Error {
2156
2192
  static {
2157
2193
  __name(this, "VttError");
@@ -2164,8 +2200,8 @@ var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
2164
2200
  const match = TIMESTAMP.exec(stamp);
2165
2201
  if (!match)
2166
2202
  throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
2167
- const [, hours = "0", minutes = "0", seconds = "0", ms = "0"] = match;
2168
- return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms);
2203
+ const [, hours = "0", minutes = "0", seconds = "0", ms2 = "0"] = match;
2204
+ return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms2);
2169
2205
  }, "millis");
2170
2206
  var splitSpeaker = /* @__PURE__ */ __name((text7) => {
2171
2207
  const firstLine = text7.split("\n", 1)[0] ?? "";
@@ -2203,7 +2239,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
2203
2239
  return cues;
2204
2240
  }, "parseVtt");
2205
2241
 
2206
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/import.js
2242
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/import.js
2207
2243
  var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
2208
2244
  const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
2209
2245
  for (const file of files) {
@@ -2236,10 +2272,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
2236
2272
  return report;
2237
2273
  }, "importFiles");
2238
2274
 
2239
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/links.js
2275
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/links.js
2240
2276
  var CHAT_MESSAGES_READ = 1e5;
2241
2277
 
2242
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/provider.js
2278
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/provider.js
2243
2279
  var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
2244
2280
  const provider = scope2?.provider;
2245
2281
  const account = scope2?.account;
@@ -2248,56 +2284,7 @@ var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
2248
2284
  return Object.freeze({ provider, account });
2249
2285
  }, "snapshotMeetingScope");
2250
2286
 
2251
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2252
- var nonempty = /* @__PURE__ */ __name((value, name) => {
2253
- if (typeof value !== "string" || !value.trim())
2254
- throw new CliError("validation_error", `${name} must be nonempty`);
2255
- return value;
2256
- }, "nonempty");
2257
- var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
2258
- if (!change || typeof change !== "object" || Array.isArray(change) || Object.keys(change).some((key) => !["title", "kind", "startTime", "durationMinutes", "timezone", "agenda"].includes(key)))
2259
- throw new CliError("validation_error", "unsupported meeting change field");
2260
- const result = {};
2261
- if (change.title !== void 0)
2262
- result.title = nonempty(change.title, "meeting title");
2263
- if (create && result.title === void 0)
2264
- throw new CliError("validation_error", "meeting title is required");
2265
- if (change.kind !== void 0) {
2266
- if (change.kind !== "instant" && change.kind !== "scheduled")
2267
- throw new CliError("validation_error", "only instant or scheduled meeting kinds are supported");
2268
- result.kind = change.kind;
2269
- }
2270
- if (change.startTime !== void 0) {
2271
- result.startTime = meetingTimestamp(change.startTime, "meeting start");
2272
- }
2273
- if (change.durationMinutes !== void 0) {
2274
- if (!Number.isSafeInteger(change.durationMinutes) || change.durationMinutes <= 0 || change.durationMinutes > 1440)
2275
- throw new CliError("validation_error", "meeting duration must be an integer from 1 to 1440 minutes");
2276
- result.durationMinutes = change.durationMinutes;
2277
- }
2278
- if (change.timezone !== void 0) {
2279
- if (typeof change.timezone !== "string" || !change.timezone.trim())
2280
- throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
2281
- try {
2282
- new Intl.DateTimeFormat("en", { timeZone: change.timezone }).format();
2283
- } catch {
2284
- throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
2285
- }
2286
- result.timezone = change.timezone;
2287
- }
2288
- if (change.agenda !== void 0) {
2289
- if (typeof change.agenda !== "string")
2290
- throw new CliError("validation_error", "meeting agenda must be text");
2291
- result.agenda = change.agenda;
2292
- }
2293
- if (create) {
2294
- result.kind ??= "scheduled";
2295
- if (result.kind === "scheduled" && result.startTime === void 0)
2296
- throw new CliError("validation_error", "scheduled meeting start is required");
2297
- } else if (!Object.keys(result).length)
2298
- throw new CliError("validation_error", "at least one meeting change is required");
2299
- return Object.freeze(result);
2300
- }, "validateMeetingChange");
2287
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2301
2288
  var checkCancelled = /* @__PURE__ */ __name((signal) => {
2302
2289
  if (!signal?.aborted)
2303
2290
  return;
@@ -2314,8 +2301,8 @@ var dispatchMeetingMutation = /* @__PURE__ */ __name(async (options, dispatch) =
2314
2301
  return { applied: true, value: await dispatch(signal) };
2315
2302
  }, "dispatchMeetingMutation");
2316
2303
 
2317
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
2318
- var id = /* @__PURE__ */ __name((value) => {
2304
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
2305
+ var id2 = /* @__PURE__ */ __name((value) => {
2319
2306
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
2320
2307
  throw new CliError("validation_error", "meeting context identifiers must be positive integers");
2321
2308
  return value;
@@ -2385,8 +2372,8 @@ var validateMeetingContextChange = /* @__PURE__ */ __name((change) => {
2385
2372
  case "event.link":
2386
2373
  return Object.freeze({
2387
2374
  action: change.action,
2388
- eventId: change.eventId === null ? null : id(change.eventId),
2389
- ...change.expectedEventId === void 0 ? {} : { expectedEventId: change.expectedEventId === null ? null : id(change.expectedEventId) }
2375
+ eventId: change.eventId === null ? null : id2(change.eventId),
2376
+ ...change.expectedEventId === void 0 ? {} : { expectedEventId: change.expectedEventId === null ? null : id2(change.expectedEventId) }
2390
2377
  });
2391
2378
  case "person.link": {
2392
2379
  const targets = change.targetAccountIds;
@@ -2394,9 +2381,9 @@ var validateMeetingContextChange = /* @__PURE__ */ __name((change) => {
2394
2381
  throw new CliError("validation_error", "target accounts must contain 1\u20131000 identifiers");
2395
2382
  return Object.freeze({
2396
2383
  action: change.action,
2397
- participantId: id(change.participantId),
2384
+ participantId: id2(change.participantId),
2398
2385
  personUid: uid(change.personUid),
2399
- ...targets === void 0 ? {} : { targetAccountIds: Object.freeze([...new Set(targets.map(id))]) },
2386
+ ...targets === void 0 ? {} : { targetAccountIds: Object.freeze([...new Set(targets.map(id2))]) },
2400
2387
  ...change.expectedPersonUid === void 0 ? {} : { expectedPersonUid: change.expectedPersonUid === null ? null : uid(change.expectedPersonUid) }
2401
2388
  });
2402
2389
  }
@@ -2404,7 +2391,7 @@ var validateMeetingContextChange = /* @__PURE__ */ __name((change) => {
2404
2391
  }, "validateMeetingContextChange");
2405
2392
  var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) => {
2406
2393
  const fixed = snapshotMeetingScope(scope2);
2407
- const account = id(accountId);
2394
+ const account = id2(accountId);
2408
2395
  const actions = Object.freeze([...new Set(ports.actions)]);
2409
2396
  if (actions.some((action) => !Object.hasOwn(fields, action)))
2410
2397
  throw new CliError("validation_error", "unsupported meeting context capability");
@@ -2414,7 +2401,7 @@ var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) =>
2414
2401
  accountId: account,
2415
2402
  actions,
2416
2403
  async change(meetingId, input, options = {}) {
2417
- const target = id(meetingId);
2404
+ const target = id2(meetingId);
2418
2405
  const change = validateMeetingContextChange(input);
2419
2406
  if (!actions.includes(change.action))
2420
2407
  throw new CliError("provider_unavailable", `meeting context does not support ${change.action}`);
@@ -2436,7 +2423,7 @@ var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) =>
2436
2423
  };
2437
2424
  }, "createMeetingContext");
2438
2425
 
2439
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2426
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2440
2427
  var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2441
2428
  if (!original || typeof original !== "object" || Array.isArray(original))
2442
2429
  throw new CliError("validation_error", "meeting preparation context is required");
@@ -2461,43 +2448,43 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2461
2448
  return { ...input, limit, maxReadBytes };
2462
2449
  }, "validateMeetingPreparationContext");
2463
2450
 
2464
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2465
- var count4 = pipe(number(), integer(), minValue(0));
2466
- var id2 = pipe(string(), minLength(1));
2451
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2452
+ var count5 = pipe(number(), integer(), minValue(0));
2453
+ var id3 = pipe(string(), minLength(1));
2467
2454
  var meetingProjectEvidence = strictObject({
2468
2455
  schema_version: literal(1),
2469
2456
  kind: literal("meeting_project_evidence"),
2470
- account_id: id2,
2457
+ account_id: id3,
2471
2458
  query: string(),
2472
- project: strictObject({ id: id2, name: string(), key: nullable(string()) }),
2459
+ project: strictObject({ id: id3, name: string(), key: nullable(string()) }),
2473
2460
  term: strictObject({
2474
2461
  name: string(),
2475
2462
  kind: picklist(["canonical", "key", "alias"]),
2476
- alias_id: optional(id2)
2463
+ alias_id: optional(id3)
2477
2464
  }),
2478
2465
  hits: array(meetingHit),
2479
2466
  association: literal("unconfirmed-word-evidence"),
2480
- vocabulary_fingerprint: id2,
2467
+ vocabulary_fingerprint: id3,
2481
2468
  selection: strictObject({
2482
- meeting_id: optional(id2),
2483
- identity_id: optional(id2),
2484
- person_id: optional(id2),
2485
- tag_id: optional(id2),
2486
- event_id: optional(id2),
2487
- series_id: optional(id2),
2469
+ meeting_id: optional(id3),
2470
+ identity_id: optional(id3),
2471
+ person_id: optional(id3),
2472
+ tag_id: optional(id3),
2473
+ event_id: optional(id3),
2474
+ series_id: optional(id3),
2488
2475
  since: optional(isoTime),
2489
2476
  until: optional(isoTime)
2490
2477
  }),
2491
- limits: strictObject({ limit: count4, max_read_bytes: count4, max_vocabulary_read_bytes: count4, max_terms: count4 }),
2478
+ limits: strictObject({ limit: count5, max_read_bytes: count5, max_vocabulary_read_bytes: count5, max_terms: count5 }),
2492
2479
  page: pageSchema,
2493
2480
  coverage: strictObject({
2494
2481
  archive_completeness: literal("unknown"),
2495
2482
  current_revisions: literal(true),
2496
2483
  indexing: picklist(["ready", "pending"]),
2497
2484
  index_completeness: literal("unknown"),
2498
- term_index: count4,
2499
- terms_total: count4,
2500
- remaining_terms: count4,
2485
+ term_index: count5,
2486
+ terms_total: count5,
2487
+ remaining_terms: count5,
2501
2488
  duplicates: literal("may-repeat-between-terms")
2502
2489
  })
2503
2490
  });
@@ -2582,7 +2569,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
2582
2569
  };
2583
2570
  }, "meetingProjectEvidenceAnswer");
2584
2571
 
2585
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2572
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2586
2573
  var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
2587
2574
  const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
2588
2575
  if (typeof query !== "string" || !query.trim() || query.includes("\0") || new TextEncoder().encode(query).byteLength > 65536 || !integer3(options.limit ?? 100, 1, 1e3) || !integer3(options.maxReadBytes ?? 4194304, 1, 67108864) || [
@@ -2602,7 +2589,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
2602
2589
  throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
2603
2590
  }, "validateMeetingHitSearch");
2604
2591
 
2605
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2592
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2606
2593
  var ids = {
2607
2594
  meeting_id: "meetingId",
2608
2595
  identity_id: "participantIdentityId",
@@ -2638,8 +2625,8 @@ var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
2638
2625
  ]
2639
2626
  });
2640
2627
  var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
2641
- var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request = {}, now = Date.now()) => {
2642
- if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof project2 !== "string" || !project2.trim() || project2.length > 200 || /[\p{Cc}\p{Cf}]/u.test(project2) || request.query !== void 0 && typeof request.query !== "string")
2628
+ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {}, now = Date.now()) => {
2629
+ if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof project !== "string" || !project.trim() || project.length > 200 || /[\p{Cc}\p{Cf}]/u.test(project) || request.query !== void 0 && typeof request.query !== "string")
2643
2630
  throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
2644
2631
  if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
2645
2632
  throw new CliError("validation_error", "invalid project evidence query or budget");
@@ -2687,21 +2674,21 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request =
2687
2674
  options.until = range.upper - (range.upper_inclusive ? 0 : 1);
2688
2675
  frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
2689
2676
  }
2690
- validateMeetingHitSearch(project2, options);
2677
+ validateMeetingHitSearch(project, options);
2691
2678
  if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
2692
2679
  throw new CliError("validation_error", "invalid project evidence cursor");
2693
- return { project: project2.trim(), options, query: frozen.join(" AND ") };
2680
+ return { project: project.trim(), options, query: frozen.join(" AND ") };
2694
2681
  }, "prepareMeetingProjectEvidence");
2695
2682
 
2696
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2697
- var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, request = {}, now = Date.now()) => {
2698
- const prepared = prepareMeetingProjectEvidence(project2, request, now);
2683
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2684
+ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
2685
+ const prepared = prepareMeetingProjectEvidence(project, request, now);
2699
2686
  const page = await read(prepared.project, prepared.options);
2700
2687
  prepared.options.signal?.throwIfAborted();
2701
2688
  return meetingProjectEvidenceAnswer(page, prepared);
2702
2689
  }, "readMeetingProjectEvidence");
2703
2690
 
2704
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2691
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2705
2692
  var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
2706
2693
  const { identityExternalId, phone, ...fields2 } = p;
2707
2694
  const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
@@ -2757,9 +2744,9 @@ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount
2757
2744
  };
2758
2745
  return meeting2;
2759
2746
  }, "sourceMeetingInput");
2760
- var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts2, { accountId, now, kept }) => {
2747
+ var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts, { accountId, now, kept }) => {
2761
2748
  const id5 = m.occurrence.id;
2762
- const { participants: sourceParticipants, transcript: lines, chat, summary } = parts2;
2749
+ const { participants: sourceParticipants, transcript: lines, chat, summary } = parts;
2763
2750
  const participants = participantInputs(source.provider, id5, sourceParticipants ?? [], accountId);
2764
2751
  const meeting2 = sourceMeetingInput(m, accountId, sourceParticipants === void 0 ? void 0 : sourceParticipants?.length ?? null, kept);
2765
2752
  const linked = sourceParticipants !== void 0;
@@ -2790,8 +2777,8 @@ var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts2,
2790
2777
  metadata: summary.metadata ?? null
2791
2778
  }
2792
2779
  ] : void 0,
2793
- attachments: parts2.files ?? void 0,
2794
- documents: parts2.documents ?? void 0,
2780
+ attachments: parts.files ?? void 0,
2781
+ documents: parts.documents ?? void 0,
2795
2782
  now
2796
2783
  });
2797
2784
  if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
@@ -2810,11 +2797,11 @@ var startOf = /* @__PURE__ */ __name((m) => {
2810
2797
  }, "startOf");
2811
2798
  var pull = /* @__PURE__ */ __name(async (source, store, options) => {
2812
2799
  const now = options.now ?? Date.now();
2813
- for (const [name, ms] of [
2800
+ for (const [name, ms2] of [
2814
2801
  ["lookbackMs", options.lookbackMs ?? 0],
2815
2802
  ["overlapMs", source.overlapMs ?? 0]
2816
2803
  ])
2817
- if (!Number.isSafeInteger(ms) || ms < 0 || ms > 31 * 864e5)
2804
+ if (!Number.isSafeInteger(ms2) || ms2 < 0 || ms2 > 31 * 864e5)
2818
2805
  throw new Error(`${name} must be an integer from 0 through 31 days`);
2819
2806
  const lookbackMs = Math.max(options.lookbackMs ?? 0, source.overlapMs ?? 0);
2820
2807
  const cursor = options.rescan ? void 0 : await store.cursor(options.accountId);
@@ -2901,23 +2888,23 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
2901
2888
  return report;
2902
2889
  }, "pull");
2903
2890
 
2904
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2891
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2905
2892
  var text5 = string();
2906
- var count5 = pipe(number(), integer(), minValue(0));
2907
- var id3 = pipe(number(), integer(), minValue(1));
2908
- var iso3 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
2893
+ var count6 = pipe(number(), integer(), minValue(0));
2894
+ var id4 = pipe(number(), integer(), minValue(1));
2895
+ var iso4 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
2909
2896
  var meetingReview = strictObject({
2910
2897
  ref: reference,
2911
2898
  id: pipe(string(), minLength(1)),
2912
2899
  title: nullable(text5),
2913
2900
  started_at: nullable(isoTime),
2914
- duration_ms: nullable(count5),
2915
- participants_count: nullable(count5),
2901
+ duration_ms: nullable(count6),
2902
+ participants_count: nullable(count6),
2916
2903
  projects: array(text5),
2917
2904
  /** Null when the meeting has no current transcript. */
2918
- transcript: nullable(strictObject({ lines: count5, words: count5 })),
2905
+ transcript: nullable(strictObject({ lines: count6, words: count6 })),
2919
2906
  /** The three who talked longest. */
2920
- speakers: array(strictObject({ name: nullable(text5), talk_ms: count5 })),
2907
+ speakers: array(strictObject({ name: nullable(text5), talk_ms: count6 })),
2921
2908
  /** The newest stored summary; null when there is none. */
2922
2909
  summary: nullable(strictObject({
2923
2910
  source: text5,
@@ -2932,7 +2919,7 @@ var meetingLink = strictObject({
2932
2919
  domain: nullable(text5),
2933
2920
  /** The Google Docs, Sheets, Slides, Forms or Drive file it names. */
2934
2921
  document_id: nullable(text5),
2935
- count: count5,
2922
+ count: count6,
2936
2923
  first_at: isoTime,
2937
2924
  last_at: isoTime,
2938
2925
  senders: array(text5),
@@ -2942,39 +2929,39 @@ var meetingSpeaker = strictObject({
2942
2929
  /** `person:<id>`, `identity:<id>`, `name:<lowercased name>` or `unknown`. */
2943
2930
  key: text5,
2944
2931
  name: nullable(text5),
2945
- person_id: nullable(id3),
2946
- identity_id: nullable(id3),
2947
- meetings: count5,
2948
- lines: count5,
2949
- words: count5,
2950
- talk_ms: count5,
2932
+ person_id: nullable(id4),
2933
+ identity_id: nullable(id4),
2934
+ meetings: count6,
2935
+ lines: count6,
2936
+ words: count6,
2937
+ talk_ms: count6,
2951
2938
  /** This speaker's part of all talk time, 0–1. */
2952
2939
  share: pipe(number(), minValue(0), maxValue(1))
2953
2940
  });
2954
2941
  var meetingStats = strictObject({
2955
2942
  time_zone: text5,
2956
- meetings: count5,
2957
- lines: count5,
2958
- words: count5,
2959
- talk_ms: count5,
2943
+ meetings: count6,
2944
+ lines: count6,
2945
+ words: count6,
2946
+ talk_ms: count6,
2960
2947
  /** `week_start` is the Monday, as a date in `time_zone`. */
2961
- weeks: array(strictObject({ week_start: text5, meetings: count5, talk_ms: count5 })),
2948
+ weeks: array(strictObject({ week_start: text5, meetings: count6, talk_ms: count6 })),
2962
2949
  top_speakers: array(meetingSpeaker)
2963
2950
  });
2964
2951
  var meetingCountsRow = strictObject({
2965
2952
  key: text5,
2966
2953
  name: nullable(text5),
2967
- meetings: count5,
2968
- minutes: count5,
2954
+ meetings: count6,
2955
+ minutes: count6,
2969
2956
  mean_minutes: nullable(number()),
2970
- transcripts: count5
2957
+ transcripts: count6
2971
2958
  });
2972
2959
  var meetingCounts = strictObject({
2973
2960
  by: picklist(["day", "week", "series"]),
2974
- meetings: count5,
2975
- minutes: count5,
2961
+ meetings: count6,
2962
+ minutes: count6,
2976
2963
  mean_minutes: nullable(number()),
2977
- transcripts: count5,
2964
+ transcripts: count6,
2978
2965
  rows: array(meetingCountsRow),
2979
2966
  has_more: boolean()
2980
2967
  });
@@ -2982,27 +2969,27 @@ var truncated = /* @__PURE__ */ __name((...why) => nullable(picklist(why)), "tru
2982
2969
  var meetingParticipants = strictObject({
2983
2970
  schema_version: literal(1),
2984
2971
  kind: literal("meeting_participants"),
2985
- account_id: id3,
2972
+ account_id: id4,
2986
2973
  query: text5,
2987
2974
  items: array(strictObject({
2988
- participant_id: id3,
2989
- meeting_id: id3,
2990
- identity_id: id3,
2975
+ participant_id: id4,
2976
+ meeting_id: id4,
2977
+ identity_id: id4,
2991
2978
  display_name: nullable(text5),
2992
2979
  email: nullable(text5),
2993
2980
  person: nullable(strictObject({ ref: text5, name: nullable(text5) }))
2994
2981
  })),
2995
2982
  /** Several identities on one page are observations, never speaker attribution or person links. */
2996
- ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id3) }),
2983
+ ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id4) }),
2997
2984
  coverage: strictObject({
2998
- scanned: count5,
2999
- read_bytes: count5,
2985
+ scanned: count6,
2986
+ read_bytes: count6,
3000
2987
  archive_completeness: literal("unknown"),
3001
2988
  truncated_by: truncated("limit", "scan_limit", "read_bytes")
3002
2989
  }),
3003
2990
  page: strictObject({
3004
2991
  mode: literal("cursor"),
3005
- limit: count5,
2992
+ limit: count6,
3006
2993
  has_more: boolean(),
3007
2994
  next_cursor: optional(text5)
3008
2995
  })
@@ -3016,12 +3003,12 @@ var meetingPassage = strictObject({
3016
3003
  target_fingerprint: text5,
3017
3004
  fingerprint: text5,
3018
3005
  revision,
3019
- limits: strictObject({ before: count5, after: count5, bytes: count5, max_read_bytes: count5 }),
3020
- content_bytes: count5,
3006
+ limits: strictObject({ before: count6, after: count6, bytes: count6, max_read_bytes: count6 }),
3007
+ content_bytes: count6,
3021
3008
  coverage: strictObject({
3022
- included: count5,
3023
- before: count5,
3024
- after: count5,
3009
+ included: count6,
3010
+ before: count6,
3011
+ after: count6,
3025
3012
  has_before: boolean(),
3026
3013
  has_after: boolean(),
3027
3014
  truncated_by: truncated("bytes"),
@@ -3034,12 +3021,12 @@ var meetingPassage = strictObject({
3034
3021
  items: array(strictObject({
3035
3022
  ref: reference,
3036
3023
  fingerprint: text5,
3037
- transcript_id: id3,
3024
+ transcript_id: id4,
3038
3025
  content_hash: nullable(text5),
3039
- position: count5,
3040
- start_ms: count5,
3041
- end_ms: count5,
3042
- speaker_participant_id: nullable(id3),
3026
+ position: count6,
3027
+ start_ms: count6,
3028
+ end_ms: count6,
3029
+ speaker_participant_id: nullable(id4),
3043
3030
  speaker_name: nullable(text5),
3044
3031
  text: text5,
3045
3032
  revision
@@ -3084,19 +3071,19 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
3084
3071
  title: one.title,
3085
3072
  description: one.description,
3086
3073
  location: one.location,
3087
- starts_at: iso3(one.startsAt),
3088
- ends_at: iso3(one.endsAt),
3074
+ starts_at: iso4(one.startsAt),
3075
+ ends_at: iso4(one.endsAt),
3089
3076
  timezone: one.timezone,
3090
3077
  origin: one.origin,
3091
3078
  status: one.status ?? null,
3092
3079
  all_day: one.allDay === true,
3093
- source_deleted_at: iso3(one.sourceDeletedAt ?? null),
3094
- deleted_at: iso3(one.deletedAt),
3080
+ source_deleted_at: iso4(one.sourceDeletedAt ?? null),
3081
+ deleted_at: iso4(one.deletedAt),
3095
3082
  created_at: new Date(one.createdAt).toISOString(),
3096
3083
  updated_at: new Date(one.updatedAt).toISOString()
3097
3084
  }), "eventItem");
3098
3085
 
3099
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
3086
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
3100
3087
  var MEETING_SERVER_BOUNDS = { calls: 3, pages: 2 };
3101
3088
  var ISSUES = {
3102
3089
  offline: ["permission_error", "meetings.server-offline"],
@@ -3180,9 +3167,9 @@ var stepFor = /* @__PURE__ */ __name((backend) => ({
3180
3167
  found: /* @__PURE__ */ new Map(),
3181
3168
  missing: []
3182
3169
  }), "stepFor");
3183
- var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts2, fresh = false) => {
3170
+ var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts, fresh = false) => {
3184
3171
  const stored = await storedByExternalId(store, accountId, found.meeting.occurrence.id);
3185
- const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts2, {
3172
+ const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts, {
3186
3173
  accountId,
3187
3174
  now,
3188
3175
  ...stored ? { kept: stored.meeting } : {}
@@ -3288,6 +3275,13 @@ var askServerForList = /* @__PURE__ */ __name(async (source, store, accountId, q
3288
3275
  return step;
3289
3276
  }, "askServerForList");
3290
3277
  var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
3278
+ const listed2 = await listThrough(source, store, filter, access);
3279
+ if (!filter.query || !readsZone(filter.query, MEETING_TIMES))
3280
+ return listed2;
3281
+ return { ...listed2, meta: { ...listed2.meta, timezone: timezoneOf(access.timezone) } };
3282
+ }, "meetingsListThrough");
3283
+ var MEETING_TIMES = new Set(MEETING_QUERY.fields.filter(({ type }) => type === "time").map(({ name }) => name));
3284
+ var listThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
3291
3285
  const now = access.now ?? Date.now();
3292
3286
  const zoned = { ...filter, timezone: timezoneOf(access.timezone), now };
3293
3287
  const step = await askServerForList(source, store, filter.accountId, filter.query, { ...access, now });
@@ -3307,7 +3301,7 @@ var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, a
3307
3301
  items: list.items.map((item) => ({ ...item, found_in: step.found.get(Number(item.id)) ?? "archive" })),
3308
3302
  ...extras
3309
3303
  };
3310
- }, "meetingsListThrough");
3304
+ }, "listThrough");
3311
3305
  var storedMeeting = /* @__PURE__ */ __name(async (store, accountId, meeting2) => {
3312
3306
  const text7 = meeting2.trim();
3313
3307
  const own = /* @__PURE__ */ __name((details) => details?.meeting.accountId === accountId ? details : null, "own");
@@ -3377,10 +3371,10 @@ var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId,
3377
3371
  return { details: fresh, foundIn: step.found.get(details.meeting.id) ?? "server", server: step.report };
3378
3372
  }, "meetingShowThrough");
3379
3373
 
3380
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
3374
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
3381
3375
  var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
3382
3376
 
3383
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
3377
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
3384
3378
  var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
3385
3379
  if (!original || typeof original !== "object" || Array.isArray(original))
3386
3380
  throw new CliError("validation_error", "related history request is required");
@@ -3410,14 +3404,14 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
3410
3404
  return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
3411
3405
  }, "validateMeetingRelatedHistory");
3412
3406
 
3413
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/review.js
3407
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/review.js
3414
3408
  var REVIEW_LIMIT = { default: 50, most: 200 };
3415
3409
 
3416
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3410
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3417
3411
  var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
3418
3412
  \`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
3419
3413
 
3420
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3414
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3421
3415
  var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3422
3416
  input.signal?.throwIfAborted();
3423
3417
  if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
@@ -3438,10 +3432,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3438
3432
  return { ...input, limit, maxReadBytes };
3439
3433
  }, "validateMeetingSeriesHistory");
3440
3434
 
3441
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3435
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3442
3436
  var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
3443
3437
 
3444
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3438
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3445
3439
  function invalid4(field, response = false) {
3446
3440
  throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
3447
3441
  }
@@ -3457,11 +3451,11 @@ var cursorDetails = /* @__PURE__ */ __name((value) => {
3457
3451
  if (typeof value !== "string" || value.length > 4096 || !/^[A-Za-z0-9_-]+$/.test(value))
3458
3452
  invalid4("cursor");
3459
3453
  try {
3460
- const decoded2 = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
3461
- object(decoded2, ["version", "selection", "cursor"], "cursor");
3462
- if (decoded2.version !== 1 || typeof decoded2.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded2.selection) || !occurrenceId(decoded2.cursor))
3454
+ const decoded = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
3455
+ object(decoded, ["version", "selection", "cursor"], "cursor");
3456
+ if (decoded.version !== 1 || typeof decoded.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded.selection) || !occurrenceId(decoded.cursor))
3463
3457
  invalid4("cursor");
3464
- return decoded2;
3458
+ return decoded;
3465
3459
  } catch {
3466
3460
  return invalid4("cursor");
3467
3461
  }
@@ -3470,1399 +3464,50 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
3470
3464
  cursorDetails(value);
3471
3465
  }, "validateMeetingSeriesInventoryCursor");
3472
3466
 
3473
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/stats.js
3474
- var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
3475
- var zoneOf = /* @__PURE__ */ __name((timeZone) => {
3476
- const zone = timeZone ?? "UTC";
3477
- try {
3478
- new Intl.DateTimeFormat("en", { timeZone: zone });
3479
- } catch {
3480
- throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
3481
- }
3482
- return zone;
3483
- }, "zoneOf");
3484
- var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
3485
- var weekStart = /* @__PURE__ */ __name((at, format) => {
3486
- const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3487
- const day2 = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
3488
- return new Date(day2 - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
3489
- }, "weekStart");
3490
- var dayKey = /* @__PURE__ */ __name((at, format) => {
3491
- const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3492
- return `${parts2.year}-${parts2.month}-${parts2.day}`;
3493
- }, "dayKey");
3494
- var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
3495
- timeZone: zone,
3496
- year: "numeric",
3497
- month: "2-digit",
3498
- day: "2-digit",
3499
- weekday: "short"
3500
- }), "zoneFormat");
3501
- var NO_SERIES = "no-series";
3502
- var MOST_COUNT_ROWS = 100;
3503
- var minutesOf = /* @__PURE__ */ __name((ms) => Math.round(ms / 6e4), "minutesOf");
3504
- var meanOf = /* @__PURE__ */ __name((ms, timed) => timed === 0 ? null : Math.round(ms / timed / 6e3) / 10, "meanOf");
3505
- var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
3506
- if (!MEETING_COUNTS_GROUPINGS.includes(by))
3507
- throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
3508
- if (!Number.isSafeInteger(limit) || limit < 1)
3509
- throw new CliError("validation_error", "--limit is a positive number");
3510
- const zone = zoneOf(timeZone);
3511
- const format = zoneFormat(zone);
3512
- const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
3513
- const add = /* @__PURE__ */ __name((into, meeting2) => {
3514
- into.meetings += 1;
3515
- if (meeting2.durationMs !== null) {
3516
- into.ms += Math.max(0, meeting2.durationMs);
3517
- into.timed += 1;
3518
- }
3519
- if (meeting2.transcribed)
3520
- into.transcripts += 1;
3521
- }, "add");
3522
- const total = { ...sum(), name: null };
3523
- const groups = /* @__PURE__ */ new Map();
3524
- for (const meeting2 of meetings) {
3525
- add(total, meeting2);
3526
- const key = by === "series" ? meeting2.seriesKey === null ? NO_SERIES : `series:${meeting2.seriesKey}` : meeting2.startedAt === null ? null : by === "day" ? dayKey(meeting2.startedAt, format) : weekStart(meeting2.startedAt, format);
3527
- if (key === null)
3528
- continue;
3529
- const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
3530
- add(group, meeting2);
3531
- groups.set(key, group);
3532
- }
3533
- const ordered = [...groups.entries()].sort(([a, one], [b, other]) => by === "series" ? other.ms - one.ms || other.meetings - one.meetings || a.localeCompare(b) : b.localeCompare(a));
3534
- const kept = ordered.slice(0, limit);
3535
- if (by !== "series")
3536
- kept.reverse();
3537
- const counted = /* @__PURE__ */ __name(({ meetings: count7, ms, timed, transcripts }) => ({
3538
- meetings: count7,
3539
- minutes: minutesOf(ms),
3540
- meanMinutes: meanOf(ms, timed),
3541
- transcripts
3542
- }), "counted");
3543
- return {
3544
- by,
3545
- timeZone: zone,
3546
- ...counted(total),
3547
- rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
3548
- hasMore: ordered.length > limit
3549
- };
3550
- }, "aggregateMeetingCounts");
3551
- var UNKNOWN_SPEAKER = "unknown";
3552
- var speakerOf = /* @__PURE__ */ __name((row) => row.personId !== null ? { key: `person:${row.personId}`, name: row.personName ?? row.identityName ?? row.speakerName } : row.identityId !== null ? { key: `identity:${row.identityId}`, name: row.identityName ?? row.speakerName } : row.speakerName?.trim() ? { key: `name:${row.speakerName.trim().toLowerCase()}`, name: row.speakerName.trim() } : { key: UNKNOWN_SPEAKER, name: null }, "speakerOf");
3553
- var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
3554
- const zone = zoneOf(timeZone);
3555
- const format = zoneFormat(zone);
3556
- const speakers = /* @__PURE__ */ new Map();
3557
- const weeks = /* @__PURE__ */ new Map();
3558
- const meetings = /* @__PURE__ */ new Set();
3559
- let lines = 0;
3560
- let words2 = 0;
3561
- let talkMs = 0;
3562
- for (const row of rows) {
3563
- const talk = Math.max(0, row.endMs - row.startMs);
3564
- meetings.add(row.meetingId);
3565
- lines += 1;
3566
- words2 += row.words;
3567
- talkMs += talk;
3568
- const who = speakerOf(row);
3569
- const held = speakers.get(who.key) ?? {
3570
- key: who.key,
3571
- name: who.name ?? null,
3572
- personId: row.personId,
3573
- identityId: row.personId === null ? row.identityId : null,
3574
- meetings: 0,
3575
- lines: 0,
3576
- words: 0,
3577
- talkMs: 0,
3578
- share: 0,
3579
- seen: /* @__PURE__ */ new Set()
3580
- };
3581
- held.seen.add(row.meetingId);
3582
- held.lines += 1;
3583
- held.words += row.words;
3584
- held.talkMs += talk;
3585
- speakers.set(who.key, held);
3586
- if (row.startedAt !== null) {
3587
- const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
3588
- week.meetings.add(row.meetingId);
3589
- week.talkMs += talk;
3590
- weeks.set(weekStart(row.startedAt, format), week);
3591
- }
3592
- }
3593
- return {
3594
- timeZone: zone,
3595
- meetings: meetings.size,
3596
- lines,
3597
- words: words2,
3598
- talkMs,
3599
- speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
3600
- ...speaker,
3601
- meetings: seen.size,
3602
- share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
3603
- })).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
3604
- weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
3605
- };
3606
- }, "aggregateMeetingStats");
3607
-
3608
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/source-review.js
3609
- var SOURCE_REVIEW_KIND = "memory_source_review";
3610
- var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
3611
- var ERASED_TEXT = "[source erased]";
3612
- var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
3613
- var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
3614
-
3615
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/tasks/model.js
3616
- var TASK_KINDS = ["question", "request", "mention", "promise"];
3617
- var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
3618
- var CLOSED_STATES = ["done", "dismissed"];
3619
- var TASK_ORIGINS = ["rule", "agent", "owner"];
3620
- var TASK_VERDICTS = ["useful", "not_useful"];
3621
- var isClosedState = /* @__PURE__ */ __name((state) => CLOSED_STATES.includes(state), "isClosedState");
3622
- function closeTask(task, state, by, at, reason) {
3623
- if (isClosedState(task.state))
3624
- throw new CliError("validation_error", `task ${task.id} is already ${task.state}`, { reason: "task.closed" });
3625
- const { claimedBy: _by, claimedUntil: _until, ...unclaimed } = task;
3626
- return { ...unclaimed, state, closedAt: at, closedBy: by, ...reason === void 0 ? {} : { reason } };
3627
- }
3628
- __name(closeTask, "closeTask");
3629
-
3630
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/tasks/priority.js
3631
- var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
3632
- var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
3633
- var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
3634
- var priorityLabel = /* @__PURE__ */ __name((score) => score === null ? null : PRIORITY_LABELS[Math.min(3, Math.max(0, Math.floor(score * 4)))], "priorityLabel");
3635
- var priorityBand = /* @__PURE__ */ __name((label) => {
3636
- const at = PRIORITY_LABELS.indexOf(label);
3637
- return { from: at / 4, to: (at + 1) / 4 };
3638
- }, "priorityBand");
3639
- var legacyPriority = /* @__PURE__ */ __name((score) => score === null ? null : score < 0.125 ? 4 : 3 - PRIORITY_LABELS.indexOf(priorityLabel(score)), "legacyPriority");
3640
- var checkedScore = /* @__PURE__ */ __name((score) => {
3641
- if (!Number.isFinite(score) || score < 0 || score > 1)
3642
- throw new CliError("validation_error", "a priority score is 0 to 1");
3643
- return score;
3644
- }, "checkedScore");
3645
- var priorityOf = /* @__PURE__ */ __name((value) => {
3646
- const word = value.trim().toLowerCase();
3647
- if (word === "none")
3648
- return null;
3649
- if (PRIORITY_LABELS.includes(word))
3650
- return MIDDLE[word];
3651
- if (/^[0-4]$/.test(word))
3652
- return LEGACY_PRIORITY_SCORES[Number(word)];
3653
- if (/^(0?\.\d+|[01]\.\d*)$/.test(word) && Number(word) <= 1)
3654
- return Number(word);
3655
- throw new CliError("validation_error", `a priority is ${PRIORITY_LABELS.join(", ")}, none, or a score from 0.0 to 1.0 with its decimal point; 0 (urgent) \u2026 4 (low) still work as critical, high, medium, low, low`);
3656
- }, "priorityOf");
3657
- var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
3658
-
3659
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/tasks/service.js
3660
- function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
3661
- async function find(id5) {
3662
- const task = await store.get(id5);
3663
- if (!task)
3664
- throw new CliError("not_found", `no task ${id5}`);
3665
- return task;
3666
- }
3667
- __name(find, "find");
3668
- return {
3669
- /**
3670
- * A rule never makes a second task from a source it has seen, whatever that task's state, so a
3671
- * dismissed one stays dismissed — nor from a message attached or merged into a task. A person or an agent may
3672
- * add a task of another kind to it. A task a rule opens goes through the host's duplicate check.
3673
- */
3674
- async add(input) {
3675
- const rule = input.origin === "rule";
3676
- const existing = await store.findBySource(input.account, input.source, rule ? { linked: true } : void 0);
3677
- const same = rule ? existing[0] : existing.find((task2) => task2.kind === input.kind);
3678
- if (same)
3679
- return { task: same, created: false };
3680
- const task = { ...input, id: newId(), state: "open", createdAt: now() };
3681
- await store.insert(task);
3682
- if (!rule || !store.reviewDuplicates)
3683
- return { task, created: true };
3684
- return { task, created: true, review: await store.reviewDuplicates(task.id) };
3685
- },
3686
- async close(id5, { as, by, reason }) {
3687
- const task = closeTask(await find(id5), as, by, now(), reason);
3688
- await store.update(task);
3689
- return task;
3690
- },
3691
- list: /* @__PURE__ */ __name((filter = {}) => store.list(filter), "list"),
3692
- async stats(filter = {}) {
3693
- const byGroup = /* @__PURE__ */ new Map();
3694
- for (const task of await store.list(filter))
3695
- byGroup.set(task.group, [...byGroup.get(task.group) ?? [], task]);
3696
- return [...byGroup].map(([group, tasks]) => {
3697
- const open = tasks.filter((task) => !isClosedState(task.state));
3698
- const closeMs = tasks.flatMap((task) => task.closedAt ? [task.closedAt.getTime() - task.createdAt.getTime()] : []);
3699
- const oldestOpenAt = open.map((task) => task.createdAt).sort((a, b) => a.getTime() - b.getTime())[0];
3700
- return {
3701
- group,
3702
- open: open.length,
3703
- ...oldestOpenAt ? { oldestOpenAt } : {},
3704
- ...closeMs.length > 0 ? { medianCloseMs: median(closeMs) } : {}
3705
- };
3706
- });
3707
- }
3708
- };
3709
- }
3710
- __name(createTaskService, "createTaskService");
3711
- function median(values) {
3712
- const sorted = [...values].sort((a, b) => a - b);
3713
- const middle = Math.floor(sorted.length / 2);
3714
- const upper = sorted[middle] ?? 0;
3715
- return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
3716
- }
3717
- __name(median, "median");
3718
-
3719
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/tasks/store.js
3720
- function matches(task, filter) {
3721
- return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
3722
- }
3723
- __name(matches, "matches");
3724
-
3725
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
3726
- var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
3727
- var MEMORY_KINDS = ["summary", "digest", "preference"];
3728
- var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
3729
- var MEMORY_SCOPES = ["personal", "work"];
3730
- var WORK_TASK_TYPES = ["bug", "feature", "chore"];
3731
- var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
3732
-
3733
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/categories.js
3734
- var CATEGORIES = ["client", "supplier", "partner", "employer"];
3735
-
3736
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/fields.js
3467
+ // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/meetings/tag-answers.js
3737
3468
  var text6 = string();
3738
- var id4 = pipe(string(), minLength(1));
3739
- var time = isoTime;
3740
- var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
3741
- var count6 = pipe(number(), integer(), minValue(0));
3742
- var untrusted = optional(array(text6));
3743
- var providerMetadata = optional(record(string(), unknown()));
3744
- var evidenceSource = strictObject({
3745
- ref: nullable(reference),
3746
- kind: text6,
3747
- title: nullable(text6),
3748
- sender: nullable(text6),
3749
- at: nullable(time),
3750
- excerpt: nullable(text6),
3751
- tool: nullable(text6),
3752
- missing: boolean()
3753
- });
3754
- var sourceReview = nullable(strictObject({ id: id4, cause: picklist(SOURCE_REVIEW_CAUSES) }));
3755
- var author = strictObject({
3756
- type: picklist(["person", "bot"]),
3757
- id: id4,
3758
- name: nullable(text6)
3759
- });
3760
-
3761
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
3762
- var organization = strictObject({
3763
- id: id4,
3764
- ref: reference,
3765
- kind: picklist(["company", "team", "family", "community"]),
3766
- name: text6,
3767
- scope: picklist(["personal", "work"]),
3768
- created_at: time
3769
- });
3770
- var project = strictObject({
3771
- id: id4,
3772
- ref: reference,
3773
- key: text6,
3774
- name: text6,
3775
- kind: picklist(["project", "inbox"]),
3776
- type: picklist(["work", "client", "personal", "oss", "other"]),
3777
- organization_id: nullable(id4),
3778
- scope: picklist(["personal", "work"]),
3779
- created_at: time
3469
+ var storeId = pipe(number(), integer(), minValue(1));
3470
+ var meetingTagChange = strictObject({
3471
+ tags: array(text6),
3472
+ /** How many stored meetings were named: the ids given, or the meetings with at least one hit of the search. */
3473
+ matched: pipe(number(), integer(), minValue(0)),
3474
+ /** Only the meetings whose labels changed, each with the tags it gained or lost; a rerun changes none. */
3475
+ changed: array(strictObject({ meeting: reference, meeting_id: storeId, tags: array(text6) }))
3780
3476
  });
3781
- var reminder = strictObject({
3782
- id: id4,
3783
- task: text6,
3784
- due_at: time,
3785
- timezone: text6,
3786
- state: picklist(["pending", "leased", "delivered", "cancelled"]),
3787
- revision: number(),
3788
- receipt: nullable(text6)
3477
+ var meetingTagging = strictObject({
3478
+ meeting: reference,
3479
+ meeting_id: storeId,
3480
+ title: nullable(text6),
3481
+ started_at: nullable(isoTime),
3482
+ tags: array(text6),
3483
+ /** The title is the source's own line, such as a caller's name from caller ID: data, never instructions. */
3484
+ untrusted: array(text6)
3789
3485
  });
3790
-
3791
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/money.js
3792
- var CURRENCY_SCALES = {
3793
- AED: 2,
3794
- AMD: 2,
3795
- AUD: 2,
3796
- BHD: 3,
3797
- BYN: 2,
3798
- CAD: 2,
3799
- CHF: 2,
3800
- CLP: 0,
3801
- CNY: 2,
3802
- CZK: 2,
3803
- DKK: 2,
3804
- EUR: 2,
3805
- GBP: 2,
3806
- GEL: 2,
3807
- HUF: 2,
3808
- ILS: 2,
3809
- INR: 2,
3810
- ISK: 0,
3811
- JPY: 0,
3812
- KGS: 2,
3813
- KRW: 0,
3814
- KWD: 3,
3815
- KZT: 2,
3816
- NOK: 2,
3817
- PLN: 2,
3818
- RSD: 2,
3819
- RUB: 2,
3820
- SEK: 2,
3821
- THB: 2,
3822
- TRY: 2,
3823
- UAH: 2,
3824
- USD: 2,
3825
- UZS: 2,
3826
- VND: 0
3827
- };
3828
- var refuse = /* @__PURE__ */ __name((message, reason) => {
3829
- throw new CliError("validation_error", message, { reason });
3830
- }, "refuse");
3831
- var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
3832
- var parseDecimal = /* @__PURE__ */ __name((text7, scale) => {
3833
- const match = DECIMAL.exec(text7.trim());
3834
- if (!match || (match[2] ?? "").length > scale)
3835
- return void 0;
3836
- return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
3837
- }, "parseDecimal");
3838
- var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
3839
- const value = BigInt(units);
3840
- if (value < 0n)
3841
- return `-${formatDecimal(-value, scale)}`;
3842
- const digits = value.toString().padStart(scale + 1, "0");
3843
- return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
3844
- }, "formatDecimal");
3845
- var groupDigits = /* @__PURE__ */ __name((decimal) => {
3846
- const [whole = "0", fraction] = decimal.split(".");
3847
- const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
3848
- return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
3849
- }, "groupDigits");
3850
- var currencyOf = /* @__PURE__ */ __name((text7) => {
3851
- const code = typeof text7 === "string" ? text7.trim().toUpperCase() : "";
3852
- if (CURRENCY_SCALES[code] === void 0)
3853
- return refuse(`${typeof text7 === "string" && text7.trim() ? text7.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
3854
- return code;
3855
- }, "currencyOf");
3856
- var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
3857
- var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
3858
- const scale = scaleOf(currency);
3859
- const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
3860
- if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
3861
- return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
3862
- return Number(units);
3863
- }, "minorUnits");
3864
- var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
3865
- if (typeof amount !== "string" || !amount.trim().startsWith("-"))
3866
- return minorUnits(amount, currency, what);
3867
- const units = minorUnits(amount.trim().slice(1), currency, what);
3868
- return units === 0 ? 0 : -units;
3869
- }, "signedMinorUnits");
3870
- var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
3871
- amount: formatDecimal(units, scaleOf(currency)),
3872
- currency
3873
- }), "moneyOf");
3874
- var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
3875
- var QUANTITY_SCALE = 3;
3876
- var quantityOf = /* @__PURE__ */ __name((text7) => {
3877
- const thousandths = typeof text7 === "string" ? parseDecimal(text7, QUANTITY_SCALE) : void 0;
3878
- if (thousandths === void 0 || thousandths === 0n)
3879
- return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
3880
- const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
3881
- return { text: plain, thousandths };
3882
- }, "quantityOf");
3883
- var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
3884
-
3885
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/finance.js
3886
- var INVOICE_DIRECTIONS = ["receivable", "payable"];
3887
- var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
3888
- var MONEY_DIRECTIONS = ["in", "out"];
3889
- var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
3890
- var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
3891
- if (current === "draft" || current === "void")
3892
- return current;
3893
- if (paid <= 0)
3894
- return "issued";
3895
- return paid < total ? "partly_paid" : "paid";
3896
- }, "settledStatus");
3897
- var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
3898
- var notes = /* @__PURE__ */ __name((...words2) => {
3899
- const kept = words2.filter((word) => word !== null);
3900
- return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
3901
- }, "notes");
3902
- var invoiceLine = /* @__PURE__ */ __name((invoice) => {
3903
- const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
3904
- const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
3905
- return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
3906
- }, "invoiceLine");
3907
- var paymentLine = /* @__PURE__ */ __name((payment) => {
3908
- const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
3909
- return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
3910
- }, "paymentLine");
3911
- var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
3912
- var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
3913
-
3914
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/business.js
3915
- var CATALOG_KINDS = ["product", "service"];
3916
- var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
3917
- var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
3918
- var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
3919
- var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
3920
- var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
3921
- var TRANSACTION_STATUSES = ["pending", "booked"];
3922
- var ORDER_DIRECTIONS = ["purchase", "sale"];
3923
- var intervalOf = /* @__PURE__ */ __name((text7, reason = "subscription.interval") => {
3924
- const match = typeof text7 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text7.trim()) : null;
3925
- if (!match)
3926
- throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
3927
- return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
3928
- }, "intervalOf");
3929
- var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
3930
- var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
3931
- var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
3932
- var productLine = /* @__PURE__ */ __name((product) => {
3933
- const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
3934
- const per = price && product.unit !== null ? ` per ${product.unit}` : "";
3935
- return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
3936
- }, "productLine");
3937
- var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
3938
- var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
3939
- var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
3940
- var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
3941
-
3942
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/marks.js
3943
- import { readFileSync as readFileSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
3944
- var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
3945
- var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
3946
- var journalMarkPath = /* @__PURE__ */ __name((store) => `${store}.journal.json`, "journalMarkPath");
3947
- var inodeOf = /* @__PURE__ */ __name((store) => statSync2(store, { throwIfNoEntry: false })?.ino, "inodeOf");
3948
- var readJson = /* @__PURE__ */ __name((path) => {
3949
- try {
3950
- return JSON.parse(readFileSync2(path, "utf8"));
3951
- } catch (error) {
3952
- if (error.code === "ENOENT")
3953
- return null;
3954
- throw error;
3955
- }
3956
- }, "readJson");
3957
- var ownerStoreInTests = /* @__PURE__ */ __name((store) => {
3958
- try {
3959
- refuseOwnerStoreInTests(store);
3960
- return false;
3961
- } catch {
3962
- return true;
3963
- }
3964
- }, "ownerStoreInTests");
3965
- var sqliteFailure = /* @__PURE__ */ __name((error) => isCliFailure(error) && error.details?.reason === "store.damaged" ? error.cause : error, "sqliteFailure");
3966
- var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version, runId, now = Date.now }) => {
3967
- const failure = sqliteFailure(error);
3968
- if (!isStoreDamage(failure) || ownerStoreInTests(store))
3969
- return false;
3970
- const inode = inodeOf(store);
3971
- if (inode === void 0)
3972
- return false;
3973
- const mark = {
3974
- at: new Date(now()).toISOString(),
3975
- command,
3976
- ...version ? { cli_version: version } : {},
3977
- ...runId ? { run_id: runId } : {},
3978
- error: failure.message.slice(0, 500),
3979
- inode
3980
- };
3981
- try {
3982
- writeFileSync2(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
3983
- `, { flag: "wx", mode: 384 });
3984
- return true;
3985
- } catch {
3986
- return false;
3987
- }
3988
- }, "markStoreDamaged");
3989
- var readDamageMark = /* @__PURE__ */ __name((store) => {
3990
- const path = damageMarkPath(store);
3991
- let mark;
3992
- try {
3993
- mark = readJson(path);
3994
- } catch {
3995
- return { at: "unknown", command: "unknown", error: `${path} cannot be read`, inode: inodeOf(store) ?? 0 };
3996
- }
3997
- if (mark === null)
3998
- return null;
3999
- if (mark.inode !== inodeOf(store)) {
4000
- clearDamageMark(store);
4001
- return null;
4002
- }
4003
- return mark;
4004
- }, "readDamageMark");
4005
- var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync2(damageMarkPath(store), { force: true }), "clearDamageMark");
4006
- var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
4007
- const mark = readDamageMark(store);
4008
- if (!mark)
4009
- return;
4010
- throw new CliError("configuration_error", `the store was found damaged at ${mark.at} by \`${mark.command}\` (${mark.error}), so nothing writes to it until it is recovered; \`${cli ?? "<cli>"} store recover\` says what is damaged and what to do`, { reason: "store.damaged" });
4011
- }, "refuseDamagedStore");
4012
- var markJournalLost = /* @__PURE__ */ __name((store, { seen, command, now = Date.now }) => {
4013
- if (ownerStoreInTests(store))
4014
- return;
4015
- const mark = { at: new Date(now()).toISOString(), command, seen };
4016
- try {
4017
- writeFileSync2(journalMarkPath(store), `${JSON.stringify(mark, null, 2)}
4018
- `, { flag: "wx", mode: 384 });
4019
- } catch {
4020
- }
4021
- }, "markJournalLost");
4022
- var readJournalMark = /* @__PURE__ */ __name((store) => {
4023
- try {
4024
- return readJson(journalMarkPath(store));
4025
- } catch {
4026
- return null;
4027
- }
4028
- }, "readJournalMark");
4029
- var readHealthMark = /* @__PURE__ */ __name((store) => {
4030
- try {
4031
- return readJson(healthMarkPath(store));
4032
- } catch {
4033
- return null;
4034
- }
4035
- }, "readHealthMark");
4036
- var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, schema, now = Date.now }) => {
4037
- const previous = readHealthMark(store);
4038
- if (ownerStoreInTests(store))
4039
- return { previous, cleared: null };
4040
- const checkedAt = new Date(now()).toISOString();
4041
- const mark = {
4042
- checked_at: checkedAt,
4043
- ok: health.ok,
4044
- problems: health.problems ?? 0,
4045
- schema,
4046
- cli,
4047
- ...version ? { cli_version: version } : {},
4048
- last_ok_at: health.ok ? checkedAt : previous?.last_ok_at ?? null
4049
- };
4050
- const cleared = health.ok ? readDamageMark(store) : null;
4051
- try {
4052
- writeFileSync2(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
4053
- `, { mode: 384 });
4054
- } catch {
4055
- }
4056
- if (cleared)
4057
- clearDamageMark(store);
4058
- if (health.ok)
4059
- rmSync2(journalMarkPath(store), { force: true });
4060
- return { previous, cleared };
4061
- }, "recordDeepCheck");
4062
-
4063
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/locator.js
4064
- var SCHEME = "msg:";
4065
- var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
4066
- var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
4067
- var parseLocator = /* @__PURE__ */ __name((reference2) => {
4068
- const trimmed = reference2.trim();
4069
- const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
4070
- const malformed2 = /* @__PURE__ */ __name(() => new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`), "malformed");
4071
- if (parts2.length !== 4 || parts2.some((part) => part === ""))
4072
- throw malformed2();
4073
- const decoded2 = /* @__PURE__ */ __name((part) => {
4074
- try {
4075
- return decodeURIComponent(part);
4076
- } catch {
4077
- throw malformed2();
4078
- }
4079
- }, "decoded");
4080
- const [provider, account, chat, message] = parts2.map(decoded2);
4081
- return { provider, account, chat, message };
4082
- }, "parseLocator");
4083
-
4084
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/references.js
4085
- var SIMPLE_REFERENCES = [
4086
- "note",
4087
- "document",
4088
- "person",
4089
- "organization",
4090
- "project",
4091
- "task",
4092
- "memory",
4093
- "fact",
4094
- "bot",
4095
- "event",
4096
- "invoice",
4097
- "payment",
4098
- "order",
4099
- "deal",
4100
- "lead",
4101
- "pipeline",
4102
- "product",
4103
- "contract",
4104
- "subscription",
4105
- "wallet",
4106
- "transaction",
4107
- "entity"
4108
- ];
4109
- var malformed = /* @__PURE__ */ __name((text7, shape) => new CliError("validation_error", `"${singleLine(text7)}" is not a reference \u2014 expected ${shape}`, {
4110
- reason: "ref.malformed"
4111
- }), "malformed");
4112
- var decoded = /* @__PURE__ */ __name((part, text7, shape) => {
4113
- try {
4114
- return decodeURIComponent(part);
4115
- } catch {
4116
- throw malformed(text7, shape);
4117
- }
4118
- }, "decoded");
4119
- var parts = /* @__PURE__ */ __name((rest, count7, text7, shape) => {
4120
- const split = rest.split("/");
4121
- if (split.length !== count7 || split.some((part) => part === ""))
4122
- throw malformed(text7, shape);
4123
- return split.map((part) => decoded(part, text7, shape));
4124
- }, "parts");
4125
- var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
4126
- var folderPath = /* @__PURE__ */ __name((path) => {
4127
- const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
4128
- return clean === "" ? path.trim() === "" ? "" : null : clean;
4129
- }, "folderPath");
4130
- var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
4131
- var kind2 = /* @__PURE__ */ __name((spec) => spec, "kind");
4132
- var simple = /* @__PURE__ */ __name((prefix) => kind2({
4133
- prefix,
4134
- type: prefix,
4135
- shape: `${prefix}:<id>`,
4136
- parse: /* @__PURE__ */ __name((rest, text7) => {
4137
- if (!rest.trim())
4138
- throw new CliError("validation_error", `"${singleLine(text7)}" names no ${prefix}`, {
4139
- reason: "ref.malformed"
4140
- });
4141
- return { type: prefix, id: rest };
4142
- }, "parse"),
4143
- format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
4144
- }), "simple");
4145
- var REF_KINDS = [
4146
- kind2({
4147
- prefix: "msg",
4148
- type: "message",
4149
- shape: "msg:<provider>/<account>/<chat>/<message>",
4150
- parse: /* @__PURE__ */ __name((_, text7) => {
4151
- try {
4152
- return { type: "message", ...parseLocator(text7) };
4153
- } catch {
4154
- throw malformed(text7, "msg:<provider>/<account>/<chat>/<message>");
4155
- }
4156
- }, "parse"),
4157
- format: formatLocator
4158
- }),
4159
- kind2({
4160
- prefix: "chat",
4161
- type: "chat",
4162
- shape: "chat:<provider>/<account>/<chat>",
4163
- parse: /* @__PURE__ */ __name((rest, text7) => {
4164
- const [provider, account, chat] = parts(rest, 3, text7, "chat:<provider>/<account>/<chat>");
4165
- return { type: "chat", provider, account, chat };
4166
- }, "parse"),
4167
- format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
4168
- }),
4169
- kind2({
4170
- prefix: "contact",
4171
- type: "contact",
4172
- shape: "contact:<provider>/<id>",
4173
- parse: /* @__PURE__ */ __name((rest, text7) => {
4174
- const [provider, id5] = parts(rest, 2, text7, "contact:<provider>/<id>");
4175
- return { type: "contact", provider, id: id5 };
4176
- }, "parse"),
4177
- format: /* @__PURE__ */ __name(({ provider, id: id5 }) => `contact:${encoded(provider, id5)}`, "format")
4178
- }),
4179
- kind2({
4180
- prefix: "folder",
4181
- type: "folder",
4182
- shape: "folder:<id>[/<path>]",
4183
- parse: /* @__PURE__ */ __name((rest, text7) => {
4184
- const slash = rest.indexOf("/");
4185
- const id5 = decoded(slash < 0 ? rest : rest.slice(0, slash), text7, "folder:<id>[/<path>]");
4186
- const path = slash < 0 ? null : folderPath(decoded(rest.slice(slash + 1), text7, "folder:<id>[/<path>]"));
4187
- if (!id5.trim() || path === "")
4188
- throw malformed(text7, "folder:<id>[/<path>]");
4189
- return { type: "folder", id: id5, path };
4190
- }, "parse"),
4191
- format: /* @__PURE__ */ __name(({ id: id5, path }) => path === null ? `folder:${encodeURIComponent(id5)}` : `folder:${encoded(id5, path)}`, "format")
4192
- }),
4193
- kind2({
4194
- prefix: "meeting",
4195
- type: "meeting",
4196
- shape: MEETING_SHAPE,
4197
- parse: /* @__PURE__ */ __name((_, text7) => {
4198
- try {
4199
- return parseMeetingReference(text7);
4200
- } catch {
4201
- throw malformed(text7, MEETING_SHAPE);
4202
- }
4203
- }, "parse"),
4204
- format: formatMeetingReference
4205
- }),
4206
- ...SIMPLE_REFERENCES.map(simple)
4207
- ];
4208
- var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
4209
- var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
4210
- var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
4211
- var distance = /* @__PURE__ */ __name((a, b) => {
4212
- let row = Array.from({ length: b.length + 1 }, (_, at) => at);
4213
- for (const [i, x] of [...a].entries()) {
4214
- const next = [i + 1];
4215
- for (const [j, y] of [...b].entries())
4216
- next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
4217
- row = next;
4218
- }
4219
- return row[b.length];
4220
- }, "distance");
4221
- var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
4222
- var unknownKind = /* @__PURE__ */ __name((text7, prefix, rest) => {
4223
- const near2 = prefix === "" ? void 0 : nearest(prefix);
4224
- const kinds = offered.map((one) => `${one}:`).join(", ");
4225
- const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
4226
- return new CliError("validation_error", `"${singleLine(text7)}" is no kind of reference${hint}`, {
4227
- reason: "ref.unknown-kind"
4228
- });
4229
- }, "unknownKind");
4230
- var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
4231
- var parseReference = /* @__PURE__ */ __name((text7) => {
4232
- const reference2 = text7.trim();
4233
- const colon = reference2.indexOf(":");
4234
- const prefix = colon < 0 ? "" : reference2.slice(0, colon);
4235
- const rest = reference2.slice(colon + 1);
4236
- const spec = byPrefix.get(prefix);
4237
- if (!spec)
4238
- throw unknownKind(reference2, prefix, rest);
4239
- return spec.parse(rest, reference2);
4240
- }, "parseReference");
4241
- var canonicalReference = /* @__PURE__ */ __name((text7) => formatReference(parseReference(text7)), "canonicalReference");
4242
- var looksLikeReference = /* @__PURE__ */ __name((text7) => {
4243
- const match = /^([a-z]+):\S+$/.exec(text7.trim());
4244
- return match !== null && byPrefix.has(match[1]);
4245
- }, "looksLikeReference");
4246
-
4247
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/providers.js
4248
- var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
4249
- var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
4250
- var PROVIDERS = [
4251
- { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
4252
- { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
4253
- { name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
4254
- { name: "max-bot", kind: "messages", aliases: [] },
4255
- { name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
4256
- { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
4257
- { name: "email", kind: "mail", aliases: [] },
4258
- { name: "notes", kind: "notes", aliases: [] },
4259
- { name: "local", kind: "notes", aliases: [] },
4260
- { name: "obsidian", kind: "notes", aliases: [] },
4261
- { name: "added", kind: "notes", aliases: [] },
4262
- { name: "zoom", kind: "meetings", aliases: [] },
4263
- { name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
4264
- // Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
4265
- { name: "telemost", kind: "meetings", aliases: [] },
4266
- // A phone export's records: its SMS and its calls in the one account the import names.
4267
- { name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true },
4268
- // Any other import: a folder of notes, a CRM's export, a script's records, under `import:<what it is>`.
4269
- { name: "import", kind: "documents", kinds: ["documents", "messages", "events"], aliases: [], imported: true }
4270
- ];
4271
- var LABELS = {
4272
- telegram: "Telegram",
4273
- "telegram-bot": "Telegram bot",
4274
- max: "MAX",
4275
- "max-bot": "MAX bot",
4276
- whatsapp: "WhatsApp",
4277
- "whatsapp-bot": "WhatsApp bot",
4278
- "google-drive": "Google Drive",
4279
- "google-meet": "Google Meet",
4280
- added: "added by hand",
4281
- email: "mail",
4282
- telemost: "Telemost"
4283
- };
4284
- var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
4285
- var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
4286
- var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
4287
- var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
4288
- var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
4289
- var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
4290
- var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
4291
- var ADDED_PROVIDER = "added";
4292
- var ADDED_ACCOUNT = "owner";
4293
- var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
4294
- var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
4295
- var INTERNAL_NOTES = "internal";
4296
- var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
4297
- var WORD = /^[a-z0-9][a-z0-9_-]*$/;
4298
- var invalid5 = /* @__PURE__ */ __name((message) => {
4299
- throw new CliError("validation_error", message);
4300
- }, "invalid");
4301
- var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid5(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
4302
- var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
4303
- var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
4304
- var opensOf = /* @__PURE__ */ __name((value, named) => {
4305
- if (typeof value !== "object" || value === null || Array.isArray(value))
4306
- return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
4307
- const known = Object.entries(value).filter(([kind3]) => OPEN_KINDS.has(kind3));
4308
- for (const [kind3, command] of known)
4309
- if (typeof command !== "string" || !COMMAND_WORDS.test(command))
4310
- invalid5(`provider ${named} opens a ${kind3} with command words, not ${JSON.stringify(command)}`);
4311
- return Object.fromEntries(known);
4312
- }, "opensOf");
4313
- var providerEntryOf = /* @__PURE__ */ __name((value) => {
4314
- if (typeof value !== "object" || value === null || Array.isArray(value))
4315
- return invalid5("a provider entry is an object");
4316
- const { name, kind: kind3, kinds, aliases = [], command, opens, imported } = value;
4317
- const named = wordOf(name, "a provider's name");
4318
- const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
4319
- const given = kinds === void 0 ? [kind3] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
4320
- for (const one of given)
4321
- if (!isKindWord(one))
4322
- invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
4323
- const list = [...new Set(given)];
4324
- if (kind3 !== void 0 && kind3 !== list[0])
4325
- invalid5(`provider ${named}'s kind is the first of its kinds`);
4326
- if (!Array.isArray(aliases))
4327
- invalid5(`provider ${named}'s aliases are a list`);
4328
- if (imported !== void 0 && typeof imported !== "boolean")
4329
- invalid5(`provider ${named}'s imported is true or false`);
4330
- return {
4331
- name: named,
4332
- kind: list[0],
4333
- ...list.length > 1 ? { kinds: list } : {},
4334
- ...imported === true ? { imported: true } : {},
4335
- aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
4336
- ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
4337
- ...opens === void 0 ? {} : { opens: opensOf(opens, named) }
4338
- };
4339
- }, "providerEntryOf");
4340
- var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
4341
- var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
4342
- var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
4343
- .../* @__PURE__ */ new Set([...known, ...entry])
4344
- ], "unitedKinds");
4345
- var wordsOf = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
4346
- var joined = /* @__PURE__ */ __name((known, entry) => {
4347
- const same = known.find(({ name }) => name === entry.name);
4348
- const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
4349
- if (same && same.kind !== entry.kind)
4350
- invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
4351
- if (same && entry.imported === true && same.imported !== true)
4352
- invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
4353
- const merged = same ? {
4354
- ...same,
4355
- ...kinds.length > 1 ? { kinds } : {},
4356
- aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
4357
- ...entry.command ? { command: entry.command } : {},
4358
- ...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
4359
- } : entry;
4360
- const others = known.filter((one) => one !== same);
4361
- for (const word of wordsOf(merged)) {
4362
- const owner = others.find((one) => wordsOf(one).includes(word));
4363
- if (owner)
4364
- invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
4365
- }
4366
- return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
4367
- }, "joined");
4368
- var registry = PROVIDERS;
4369
- var providers = /* @__PURE__ */ __name(() => registry, "providers");
4370
- var useStoredProviders = /* @__PURE__ */ __name((entries) => {
4371
- const left = [];
4372
- registry = entries.reduce((known, entry) => {
4373
- try {
4374
- return joined(known, providerEntryOf(entry));
4375
- } catch (error) {
4376
- if (!(error instanceof CliError))
4377
- throw error;
4378
- left.push(entry);
4379
- return known;
4380
- }
4381
- }, PROVIDERS);
4382
- return left;
4383
- }, "useStoredProviders");
4384
- var addProvider = /* @__PURE__ */ __name((entry) => {
4385
- registry = joined(registry, providerEntryOf(entry));
4386
- }, "addProvider");
4387
- var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
4388
- var providerNamed = /* @__PURE__ */ __name((word) => {
4389
- const wanted = word.toLowerCase();
4390
- return registry.find((entry) => wordsOf(entry).includes(wanted));
4391
- }, "providerNamed");
4392
- var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
4393
- var kindsIn = /* @__PURE__ */ __name((provider) => {
4394
- if (isFolderProvider(provider))
4395
- return ["notes"];
4396
- const entry = registry.find(({ name }) => name === provider);
4397
- if (!entry)
4398
- return [];
4399
- return entry.imported ? unitedKinds(kindsOfEntry(entry), ["documents"]) : kindsOfEntry(entry);
4400
- }, "kindsIn");
4401
- var importedOf = /* @__PURE__ */ __name((entry, held) => {
4402
- const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
4403
- if (builtIn) {
4404
- if (entry.imported === true && builtIn.imported !== true)
4405
- invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
4406
- return builtIn.imported === true;
4407
- }
4408
- if (held === void 0)
4409
- return entry.imported === true;
4410
- if (entry.imported === true && held.imported !== true)
4411
- invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
4412
- return held.imported === true;
4413
- }, "importedOf");
4414
- var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
4415
- var holdsKind = /* @__PURE__ */ __name((provider, kind3) => kindsIn(provider).includes(kind3), "holdsKind");
4416
- var holdsKindOf = /* @__PURE__ */ __name((provider, kind3) => kindIn(provider) === void 0 ? kind3 === "messages" : holdsKind(provider, kind3), "holdsKindOf");
4417
- var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
4418
-
4419
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/query.js
4420
- var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
4421
- var inSource = /* @__PURE__ */ __name((source, provider) => source === "all" || source === "bots" && isBotProvider(provider) || source === "personal" && !isBotProvider(provider) || source === provider || providerNamed(source)?.name === provider || isKind(source) && holdsKindOf(provider, source), "inSource");
4422
- var fail = /* @__PURE__ */ __name((message) => {
4423
- throw new CliError("validation_error", message);
4424
- }, "fail");
4425
- var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
4426
- const sources = [...providers2, "personal", "bots", "all"];
4427
- const source = value.toLowerCase();
4428
- if (sources.includes(source))
4429
- return source;
4430
- if (source === "mail")
4431
- return "email";
4432
- if (source === "messages")
4433
- return source;
4434
- if (isKind(source))
4435
- fail(`${name}${source} names ${source}, which a message search does not read \u2014 search ${source === "meetings" || source === "events" ? `all --source ${source}` : "notes"} does`);
4436
- const named = providerNamed(source);
4437
- if (named && providers2.includes(named.name))
4438
- return named.name;
4439
- return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
4440
- }, "sourceOf");
4441
-
4442
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/account-list.js
4443
- var ACCOUNT_GROUPS = "accountGroups";
4444
- var ACCOUNT_GROUPS_SETTING = "account_groups";
4445
- var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
4446
- var fail2 = /* @__PURE__ */ __name((message) => {
4447
- throw new CliError("validation_error", message);
4448
- }, "fail");
4449
- var isAccountList = /* @__PURE__ */ __name((value) => value.includes(",") || value.includes(":"), "isAccountList");
4450
- var itemsOf = /* @__PURE__ */ __name((value) => {
4451
- const items = value.split(",").map((item) => item.trim());
4452
- if (items.some((item) => item === ""))
4453
- fail2(`"${value}" has an empty entry \u2014 separate accounts with one comma`);
4454
- return items;
4455
- }, "itemsOf");
4456
- var isGroupName = /* @__PURE__ */ __name((name) => GROUP_NAME.test(name), "isGroupName");
4457
- var groupName = /* @__PURE__ */ __name((name) => isGroupName(name) ? name : fail2(`a group name is letters, digits, - and _ \u2014 not "${name}"`), "groupName");
4458
- var groupMembers = /* @__PURE__ */ __name((value) => itemsOf(value).map((item) => item.toLowerCase().startsWith("group:") ? fail2(`a group lists accounts, not other groups \u2014 "${item}"`) : item.includes(":") && item.split(":")[1] === "" ? fail2(`"${item}" names no account after the colon`) : item), "groupMembers");
4459
- var describe2 = /* @__PURE__ */ __name((accounts) => accounts.map(({ provider, account, name }) => `${provider}:${account}${name ? ` (${name})` : ""}`).join(", "), "describe");
4460
- var listedHolds = /* @__PURE__ */ __name((account, kind3) => (account.kinds ?? (account.kind === void 0 ? [] : [account.kind])).includes(kind3), "listedHolds");
4461
- var kindHere = /* @__PURE__ */ __name((provider, running) => provider === running.provider ? kindOf(provider) : kindIn(provider), "kindHere");
4462
- var kindsOfHere = /* @__PURE__ */ __name((provider, running) => {
4463
- const kinds = kindsIn(provider);
4464
- return { kind: kindHere(provider, running), ...kinds.length > 1 ? { kinds } : {} };
4465
- }, "kindsOfHere");
4466
- var heldOf = /* @__PURE__ */ __name((stored, running) => [
4467
- ...stored.filter(({ provider }) => kindIn(provider) !== "notes" && !isDocumentAccountProvider(provider)).map(({ provider, account, name }) => ({ provider, account, name, ...kindsOfHere(provider, running) })),
4468
- { provider: "notes", account: INTERNAL_NOTES, name: null, kind: "notes" },
4469
- ...stored.filter(({ provider }) => isFolderProvider(provider)).map(({ id: id5, name, provider, account }) => ({
4470
- provider: "notes",
4471
- account: String(id5),
4472
- name,
4473
- kind: "notes",
4474
- stored: { provider, account }
4475
- })),
4476
- ...stored.filter(({ provider }) => isDocumentAccountProvider(provider) || provider === ADDED_PROVIDER).map(({ id: id5, provider, account, name }) => ({
4477
- provider: "notes",
4478
- account: String(id5),
4479
- name,
4480
- kind: "notes",
4481
- stored: { provider, account }
3486
+ var ref = /* @__PURE__ */ __name((accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId }), "ref");
3487
+ var meetingTagChangeItem = /* @__PURE__ */ __name((change) => ({
3488
+ tags: change.tags,
3489
+ matched: change.matched,
3490
+ changed: change.changed.map(({ meetingId, tags }) => ({
3491
+ meeting: ref(change.accountId, meetingId),
3492
+ meeting_id: meetingId,
3493
+ tags
4482
3494
  }))
4483
- ], "heldOf");
4484
- var storedAs = /* @__PURE__ */ __name((held, key) => held.filter(({ stored }) => stored?.provider === key.provider && (key.account === "" || stored.account === key.account)), "storedAs");
4485
- var registry2 = /* @__PURE__ */ __name(() => providers().map(({ name, aliases }) => aliases.length ? `${name} (${aliases.join(", ")})` : name).join(", "), "registry");
4486
- var providerOf = /* @__PURE__ */ __name((prefix, held, { running, profiles }) => {
4487
- const wanted = prefix.toLowerCase();
4488
- if (wanted === running.command?.toLowerCase())
4489
- return running.provider;
4490
- const providers2 = [...new Set(held.map(({ provider }) => provider))];
4491
- if (providers2.includes(wanted) || isDocumentAccountProvider(wanted))
4492
- return wanted;
4493
- const named = providerNamed(wanted);
4494
- if (named)
4495
- return named.name;
4496
- const recorded = Object.values(profiles[wanted] ?? {})[0];
4497
- if (recorded)
4498
- return recorded.provider;
4499
- return fail2(`${prefix} is not a provider \u2014 they are ${registry2()}; the store holds ${providers2.join(", ")}`);
4500
- }, "providerOf");
4501
- var profilesOf = /* @__PURE__ */ __name((provider, profiles) => Object.values(profiles).flatMap((named) => Object.entries(named).filter(([, key]) => key.provider === provider)), "profilesOf");
4502
- var accountOf = /* @__PURE__ */ __name((prefix, ref, held, context3) => {
4503
- const provider = providerOf(prefix, held, context3);
4504
- if (isDocumentAccountProvider(provider) && !context3.profiles[prefix.toLowerCase()]?.[ref]) {
4505
- const stored = storedAs(held, { provider, account: ref })[0];
4506
- if (stored)
4507
- return stored;
4508
- }
4509
- const folder = isFolderProvider(provider);
4510
- const ofProvider = folder ? storedAs(held, { provider, account: "" }) : held.filter((one) => one.provider === provider);
4511
- const byId = ofProvider.find(({ account, stored }) => account === ref || account === ref.toLowerCase() || folder && stored?.account === ref.toUpperCase());
4512
- if (byId)
4513
- return byId;
4514
- const keyed = /* @__PURE__ */ __name((key) => ofProvider.find(({ account }) => account === key.account) ?? {
4515
- ...key,
4516
- name: null,
4517
- ...kindsOfHere(key.provider, context3.running)
4518
- }, "keyed");
4519
- const recorded = context3.profiles[prefix.toLowerCase()]?.[ref];
4520
- if (recorded && isFolderProvider(recorded.provider)) {
4521
- const folder2 = held.find((one) => one.provider === "notes" && one.name === recorded.account);
4522
- if (folder2)
4523
- return folder2;
4524
- return fail2(`no stored folder for ${prefix}:${ref}; sync that profile first`);
4525
- }
4526
- if (recorded && isDocumentAccountProvider(recorded.provider)) {
4527
- const account = storedAs(held, recorded)[0];
4528
- if (account)
4529
- return account;
4530
- return fail2(`no stored documents for ${prefix}:${ref}; sync that profile first`);
4531
- }
4532
- if (recorded)
4533
- return keyed(recorded);
4534
- const byProfile = [
4535
- ...new Map(profilesOf(provider, context3.profiles).filter(([name]) => name === ref).map(([, key]) => [key.account, key])).values()
4536
- ];
4537
- if (byProfile.length === 1)
4538
- return keyed(byProfile[0]);
4539
- const byName = ofProvider.filter(({ name }) => name?.toLowerCase() === ref.toLowerCase());
4540
- if (byName.length === 1)
4541
- return byName[0];
4542
- if (byName.length > 1 || byProfile.length > 1)
4543
- fail2(`${provider}:${ref} names more than one account \u2014 use the id: ${describe2(ofProvider)}`);
4544
- const names = profilesOf(provider, context3.profiles).map(([name]) => name);
4545
- return fail2(`no ${provider} account "${ref}" \u2014 the store holds ${describe2(ofProvider) || "none"}` + (names.length ? `; profiles: ${[...new Set(names)].join(", ")}` : ""));
4546
- }, "accountOf");
4547
- var accountsOfWord = /* @__PURE__ */ __name((word, held, context3) => {
4548
- const wanted = word.toLowerCase();
4549
- if (wanted === "all")
4550
- return [...held];
4551
- if (wanted === "personal" || wanted === "bots")
4552
- return held.filter((one) => listedHolds(one, "messages") && isBotProvider(one.provider) === (wanted === "bots"));
4553
- if (isKind(wanted))
4554
- return held.filter((one) => listedHolds(one, wanted));
4555
- const recorded = context3.profiles[wanted];
4556
- if (recorded && Object.values(recorded).every((key) => isFolderProvider(key.provider) || isDocumentAccountProvider(key.provider)))
4557
- return Object.keys(recorded).map((profile) => accountOf(word, profile, held, context3));
4558
- const provider = providerOf(word, held, context3);
4559
- if (isDocumentAccountProvider(provider) || isFolderProvider(provider))
4560
- return storedAs(held, { provider, account: "" });
4561
- return held.filter((one) => one.provider === provider);
4562
- }, "accountsOfWord");
4563
- var keyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
4564
- var sourceOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "sourceOf");
4565
- var sameAs = /* @__PURE__ */ __name((key) => (one) => one.provider === key.provider && one.account === key.account, "sameAs");
4566
- var entriesOfList = /* @__PURE__ */ __name((value, context3) => {
4567
- const held = heldOf(context3.held, context3.running);
4568
- const entries = [];
4569
- const entry = /* @__PURE__ */ __name((item, group) => {
4570
- const colon = item.indexOf(":");
4571
- if (colon === -1) {
4572
- try {
4573
- entries.push({ entry: item, accounts: accountsOfWord(item, held, context3) });
4574
- } catch (error) {
4575
- if (!group || !(error instanceof CliError))
4576
- throw error;
4577
- fail2(`"${item}" in group ${group}: ${error.message}`);
4578
- }
4579
- return;
4580
- }
4581
- const prefix = item.slice(0, colon);
4582
- const ref = item.slice(colon + 1).trim();
4583
- if (ref === "")
4584
- fail2(`"${item}" names no account after the colon`);
4585
- if (prefix.toLowerCase() === "group") {
4586
- if (group)
4587
- fail2(`group ${group} lists another group \u2014 a group lists accounts`);
4588
- const members = context3.groups[ref];
4589
- if (!members) {
4590
- const known = Object.keys(context3.groups);
4591
- fail2(`no account group "${ref}" \u2014 ${known.length ? `there are ${known.join(", ")}` : "none saved yet"}; \`config set ${ACCOUNT_GROUPS_SETTING}.${ref} <accounts>\` saves one`);
4592
- }
4593
- for (const member of members)
4594
- entry(member, ref);
4595
- return;
4596
- }
4597
- entries.push({ entry: item, accounts: [accountOf(prefix, ref, held, context3)] });
4598
- }, "entry");
4599
- for (const item of itemsOf(value))
4600
- entry(item);
4601
- const { only } = context3;
4602
- return entries.map(({ entry: entry2, accounts }) => ({
4603
- entry: entry2,
4604
- accounts: accounts.filter((one) => only === void 0 || only.has(keyOf(one))).map(({ provider, account, kind: kind3, kinds }) => ({
4605
- provider,
4606
- account,
4607
- kind: kind3,
4608
- ...kinds === void 0 ? {} : { kinds }
4609
- }))
4610
- }));
4611
- }, "entriesOfList");
4612
- var accountsOfList = /* @__PURE__ */ __name((value, context3) => {
4613
- const chosen = /* @__PURE__ */ new Map();
4614
- for (const { accounts } of entriesOfList(value, context3))
4615
- for (const one of accounts)
4616
- if (!chosen.has(keyOf(one)))
4617
- chosen.set(keyOf(one), one);
4618
- return [...chosen.values()];
4619
- }, "accountsOfList");
4620
- var READS = {
4621
- messages: "messenger messages \u2014 search messages reads them",
4622
- mail: "a mailbox \u2014 memo search mail reads it",
4623
- notes: "notes \u2014 search notes reads them",
4624
- documents: "documents \u2014 search notes reads them",
4625
- meetings: "meetings \u2014 search all reads them",
4626
- events: "calendar events \u2014 no search reads them yet",
4627
- crm: "CRM deals and leads \u2014 search all reads them"
4628
- };
4629
- var fitting = /* @__PURE__ */ __name((entries, kinds, what, reasonOf2 = (kind3) => READS[kind3], alsoFits = () => false) => {
4630
- const chosen = /* @__PURE__ */ new Map();
4631
- const skipped = [];
4632
- for (const { entry, accounts } of entries) {
4633
- const fits = accounts.filter((one) => kinds.some((kind3) => listedHolds(one, kind3)) || alsoFits(one));
4634
- for (const { provider, account } of fits)
4635
- if (!chosen.has(keyOf({ provider, account })))
4636
- chosen.set(keyOf({ provider, account }), { provider, account });
4637
- const known = accounts.filter(({ kind: kind3 }) => kind3 !== void 0);
4638
- const unknown2 = accounts.filter((one) => one.kind === void 0 && !alsoFits(one));
4639
- if (known.length)
4640
- for (const { provider, account } of unknown2)
4641
- skipped.push({ source: `${provider}:${account}`, code: "not_found", reason: UNKNOWN_PROVIDER });
4642
- if (fits.length)
4643
- continue;
4644
- const other = known[0];
4645
- skipped.push(other?.kind ? { source: entry, code: "validation_error", reason: reasonOf2(other.kind) } : unknown2.length ? { source: entry, code: "not_found", reason: UNKNOWN_PROVIDER } : { source: entry, code: "not_found", reason: "no account in the store" });
4646
- }
4647
- if (chosen.size === 0)
4648
- fail2(`--source names nothing ${what} reads: ${skipped.map(({ source, reason }) => `${source} (${reason})`).join(", ")}`);
4649
- return { accounts: [...chosen.values()], skipped };
4650
- }, "fitting");
4651
-
4652
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/deals.js
4653
- var DEAL_KINDS = ["deal", "lead"];
4654
- var DEAL_STATUSES = ["open", "won", "lost"];
4655
- var STAGE_OUTCOMES = DEAL_STATUSES;
4656
- var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
4657
- var dealLine = /* @__PURE__ */ __name((deal) => {
4658
- const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
4659
- return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
4660
- }, "dealLine");
4661
-
4662
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/orders.js
4663
- var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
4664
- var ORDER_PURPOSES = ["personal", "business", "client", "other"];
4665
- var orderLine = /* @__PURE__ */ __name((order) => {
4666
- const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
4667
- const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
4668
- const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
4669
- return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
4670
- }, "orderLine");
4671
- var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
4672
-
4673
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/relations.js
4674
- var ORGANIZATION_ROLES = [
4675
- "employee",
4676
- "contractor",
4677
- "founder",
4678
- "owner",
4679
- "manager",
4680
- "adviser",
4681
- "contact"
4682
- ];
4683
- var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
4684
- var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
4685
- var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
4686
- var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
4687
- var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
4688
- var checkEngagement = /* @__PURE__ */ __name((kind3, from, to, level) => {
4689
- if (kind3 !== "member-of" || from !== "person" || to !== "project")
4690
- throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
4691
- reason: "relationship.engagement-ends"
4692
- });
4693
- if (!isEngagement(level))
4694
- throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
4695
- reason: "relationship.engagement-unknown"
4696
- });
4697
- return level;
4698
- }, "checkEngagement");
4699
- var RELATIONS = {
4700
- "member-of": {
4701
- from: ["person", "organization", "project", "chat", "email_thread"],
4702
- to: ["organization", "project"],
4703
- roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
4704
- },
4705
- "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
4706
- "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
4707
- "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
4708
- "related-to": {
4709
- from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
4710
- to: ["person", "organization", "project", "task"],
4711
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
4712
- }
4713
- };
4714
- var RELATION_KINDS = Object.keys(RELATIONS);
4715
- var specOf = /* @__PURE__ */ __name((kind3) => Object.hasOwn(RELATIONS, kind3) ? RELATIONS[kind3] : void 0, "specOf");
4716
- var isRelationKind = /* @__PURE__ */ __name((kind3) => specOf(kind3) !== void 0, "isRelationKind");
4717
- var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
4718
- var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
4719
- var checkEnds = /* @__PURE__ */ __name((kind3, from, to) => {
4720
- const spec = specOf(kind3);
4721
- if (!spec)
4722
- throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
4723
- if (memberOnly(from) && (kind3 !== "member-of" || to !== "project"))
4724
- throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
4725
- if (partyOnly(from, to))
4726
- throw new CliError("validation_error", "a contract is related only to a person or an organization");
4727
- if (!spec.from.includes(from) || !spec.to.includes(to))
4728
- throw new CliError("validation_error", `${kind3} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
4729
- return spec;
4730
- }, "checkEnds");
4731
- var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
4732
- var rolesOf = /* @__PURE__ */ __name((kind3, from, to) => {
4733
- const spec = specOf(kind3);
4734
- if (kind3 === "member-of" && from !== "person")
4735
- return void 0;
4736
- return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
4737
- }, "rolesOf");
4738
- var ROLE_LISTS = {
4739
- organization: ORGANIZATION_ROLES,
4740
- project: PROJECT_ROLES,
4741
- deal: DEAL_ROLES,
4742
- contract: CONTRACT_ROLES,
4743
- related: RELATED_ROLES
4744
- };
4745
- var roleListOf = /* @__PURE__ */ __name((kind3, from, to) => {
4746
- if (kind3 === "related-to" && isParty(from) && isParty(to))
4747
- return "related";
4748
- const roles = rolesOf(kind3, from, to);
4749
- return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
4750
- }, "roleListOf");
4751
- var checkRole = /* @__PURE__ */ __name((kind3, from, to, role, extra = []) => {
4752
- const roles = rolesOf(kind3, from, to)?.concat(extra);
4753
- if (roles && !roles.includes(role))
4754
- throw new CliError("validation_error", `a ${from}'s role on ${kind3} ${to} is one of ${roles.join(", ")}`, {
4755
- reason: "relationship.role-unknown"
4756
- });
4757
- return role;
4758
- }, "checkRole");
4759
- var isSymmetric = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric === true, "isSymmetric");
4760
- var inverseOf = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric ? kind3 : specOf(kind3)?.inverse ?? null, "inverseOf");
4761
- var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
4762
- var standingOf = /* @__PURE__ */ __name((link, now) => {
4763
- if (link.endsAt != null && link.endsAt <= now)
4764
- return "ended";
4765
- if (link.confirmed)
4766
- return "confirmed";
4767
- if (link.deletedAt != null)
4768
- return "ended";
4769
- return link.accountId != null ? "reported" : "proposed";
4770
- }, "standingOf");
4771
- var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
4772
- var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
4773
- var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
4774
- var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
4775
-
4776
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/crm.js
4777
- var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
4778
- var isCrmUserId = /* @__PURE__ */ __name((id5) => /^\d{1,20}$/.test(id5), "isCrmUserId");
4779
- var normalCrmUserId = /* @__PURE__ */ __name((id5) => {
4780
- const text7 = id5.trim();
4781
- return /^\d+$/.test(text7) ? text7.replace(/^0+(?=\d)/, "") : text7;
4782
- }, "normalCrmUserId");
4783
- var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
4784
-
4785
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/tags.js
4786
- var TAG_TYPES = ["chat", "contact", "message", "task"];
4787
- var TAG = /^[a-z0-9-]{1,32}$/;
4788
- var tagOf = /* @__PURE__ */ __name((value) => {
4789
- const tag = value.trim().toLowerCase();
4790
- return TAG.test(tag) ? tag : void 0;
4791
- }, "tagOf");
4792
- var normalizeTag = /* @__PURE__ */ __name((value) => {
4793
- const tag = tagOf(value);
4794
- if (tag === void 0)
4795
- throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
4796
- return tag;
4797
- }, "normalizeTag");
4798
-
4799
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
4800
- var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
4801
- var sourceOf3 = /* @__PURE__ */ __name((database, row, metadata) => {
4802
- const reporter = row.account_id == null ? void 0 : "reporter" in row ? row.reporter : database.prepare("SELECT provider || ':' || external_id AS key FROM accounts WHERE id = ?").get(Number(row.account_id))?.key;
4803
- return {
4804
- ...typeof reporter === "string" ? { account: reporter } : {},
4805
- ...typeof metadata.derived === "string" ? { derived: metadata.derived } : {}
4806
- };
4807
- }, "sourceOf");
4808
-
4809
- // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
4810
- var LINK_KINDS = [
4811
- "links-to",
4812
- "blocked-by",
4813
- "follow-up-of",
4814
- "about",
4815
- "member-of",
4816
- "labelled",
4817
- "answered-by",
4818
- "evidence",
4819
- "created-from",
4820
- "duplicate-of",
4821
- "related-to",
4822
- "reports-to",
4823
- "customer-of",
4824
- "partner-of",
4825
- "assigned-to",
4826
- "attached"
4827
- ];
4828
- var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
4829
- var LINK_SOURCES = [...LINK_ORIGINS, "calendar", "meeting"];
4830
- var linkKind = /* @__PURE__ */ __name((kind3) => `'${kind3}'`, "linkKind");
4831
- var COUNTERPART_ROLE = "counterpart";
3495
+ }), "meetingTagChangeItem");
3496
+ var meetingTaggingItem = /* @__PURE__ */ __name((one) => ({
3497
+ meeting: ref(one.accountId, one.meetingId),
3498
+ meeting_id: one.meetingId,
3499
+ title: one.title,
3500
+ started_at: one.startedAt === null ? null : new Date(one.startedAt).toISOString(),
3501
+ tags: one.tags,
3502
+ untrusted: ["title"]
3503
+ }), "meetingTaggingItem");
4832
3504
 
4833
3505
  export {
4834
- logAttributes,
4835
- fromLogAttributes,
4836
- snakeLogger,
4837
- LOG_ATTRIBUTES,
4838
- KEEP_RUNS_FOR_DAYS,
4839
- KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
4840
- KEEP_STORE_RUNS_FOR_DAYS,
4841
- RUNS_SIZE_LIMIT_MB,
4842
- runsDirFor,
4843
- startRun,
4844
- runtime,
4845
- newRunId,
4846
- listRuns,
4847
- findRun,
4848
- readEvents,
4849
- pruneRuns,
4850
- asOwnProcess,
4851
- currentRun,
4852
- inRun,
4853
- runEvent,
4854
- typedCommand,
4855
- useAsProcessRun,
4856
- processRun,
4857
- enclosingTraceId,
4858
- traceOf,
4859
- childTrace,
4860
- withAttempt,
4861
- currentAttempt,
4862
3506
  BACKENDS,
4863
3507
  serviceCallsOf,
4864
3508
  rangeOf,
4865
3509
  windowOf,
3510
+ readsZone,
4866
3511
  formatMeetingReference,
4867
3512
  parseMeetingReference,
4868
3513
  canonicalMeetingReference,
@@ -4879,8 +3524,16 @@ export {
4879
3524
  joinUrlWithoutQuery,
4880
3525
  calendarText,
4881
3526
  entryMetadata,
3527
+ callOf,
3528
+ callStats,
3529
+ callStatsItem,
3530
+ aggregateMeetingCounts,
3531
+ aggregateMeetingStats,
3532
+ CALLBACK_WITHIN_MS,
3533
+ aggregateCallStats,
4882
3534
  meetingCueFingerprint,
4883
3535
  EVENT_QUERY,
3536
+ PARTICIPANT_RESPONSES,
4884
3537
  entryInWindow,
4885
3538
  normalizeMeetingParticipantQuery,
4886
3539
  validateMeetingParticipantSearch,
@@ -4921,7 +3574,6 @@ export {
4921
3574
  importFiles,
4922
3575
  CHAT_MESSAGES_READ,
4923
3576
  snapshotMeetingScope,
4924
- validateMeetingChange,
4925
3577
  validateMeetingContextChange,
4926
3578
  createMeetingContext,
4927
3579
  meetingHitContextLimits,
@@ -4952,179 +3604,8 @@ export {
4952
3604
  SAVE_HELP,
4953
3605
  validateMeetingSeriesHistory,
4954
3606
  validateMeetingSeriesInventoryCursor,
4955
- aggregateMeetingCounts,
4956
- aggregateMeetingStats,
4957
- SOURCE_REVIEW_KIND,
4958
- SOURCE_REVIEW_CAUSES,
4959
- ERASED_TEXT,
4960
- severity,
4961
- graver,
4962
- text6 as text,
4963
- id4 as id,
4964
- time,
4965
- zonedTime,
4966
- count6 as count,
4967
- untrusted,
4968
- providerMetadata,
4969
- evidenceSource,
4970
- sourceReview,
4971
- author,
4972
- TASK_KINDS,
4973
- TASK_STATES,
4974
- CLOSED_STATES,
4975
- TASK_ORIGINS,
4976
- TASK_VERDICTS,
4977
- isClosedState,
4978
- PRIORITY_LABELS,
4979
- priorityLabel,
4980
- priorityBand,
4981
- legacyPriority,
4982
- checkedScore,
4983
- priorityOf,
4984
- priorityOption,
4985
- createTaskService,
4986
- matches,
4987
- FACT_STATUSES,
4988
- MEMORY_KINDS,
4989
- MEMORY_STATUSES,
4990
- MEMORY_SCOPES,
4991
- WORK_TASK_TYPES,
4992
- TASK_TYPES2 as TASK_TYPES,
4993
- CATEGORIES,
4994
- parseDecimal,
4995
- formatDecimal,
4996
- currencyOf,
4997
- scaleOf,
4998
- minorUnits,
4999
- signedMinorUnits,
5000
- moneyOf,
5001
- moneyLabel,
5002
- quantityOf,
5003
- lineUnits,
5004
- DEAL_KINDS,
5005
- DEAL_STATUSES,
5006
- STAGE_OUTCOMES,
5007
- DEAL_ROLES,
5008
- dealLine,
5009
- INVOICE_DIRECTIONS,
5010
- INVOICE_STATUSES,
5011
- MONEY_DIRECTIONS,
5012
- FINANCE_REVIEWS,
5013
- settledStatus,
5014
- invoiceLine,
5015
- paymentLine,
5016
- invoiceTitle,
5017
- paymentEntryTitle,
5018
- ORDER_STATUSES,
5019
- ORDER_PURPOSES,
5020
- orderLine,
5021
- orderTitle,
5022
- isEngagement,
5023
- checkEngagement,
5024
- RELATION_KINDS,
5025
- isRelationKind,
5026
- checkEnds,
5027
- rolesOf,
5028
- ROLE_LISTS,
5029
- roleListOf,
5030
- checkRole,
5031
- isSymmetric,
5032
- inverseOf,
5033
- STANDINGS,
5034
- standingOf,
5035
- isUsable,
5036
- KEYED,
5037
- notOverriddenSql,
5038
- usableLinkSql,
5039
- CRM_ACTIVITY_KINDS,
5040
- isCrmUserId,
5041
- normalCrmUserId,
5042
- isItemKind,
5043
- organization,
5044
- project,
5045
- reminder,
5046
- CATALOG_KINDS,
5047
- BUSINESS_KINDS,
5048
- CONTRACT_KINDS,
5049
- CONTRACT_STATUSES,
5050
- SUBSCRIPTION_STATUSES,
5051
- WALLET_KINDS,
5052
- TRANSACTION_STATUSES,
5053
- ORDER_DIRECTIONS,
5054
- intervalOf,
5055
- productLine,
5056
- contractLine,
5057
- subscriptionLine,
5058
- walletLine,
5059
- transactionLine,
5060
- TAG_TYPES,
5061
- tagOf,
5062
- normalizeTag,
5063
- REPORTER_SQL,
5064
- sourceOf3 as sourceOf,
5065
- LINK_KINDS,
5066
- LINK_ORIGINS,
5067
- LINK_SOURCES,
5068
- linkKind,
5069
- COUNTERPART_ROLE,
5070
- damageMarkPath,
5071
- healthMarkPath,
5072
- journalMarkPath,
5073
- markStoreDamaged,
5074
- readDamageMark,
5075
- clearDamageMark,
5076
- refuseDamagedStore,
5077
- markJournalLost,
5078
- readJournalMark,
5079
- readHealthMark,
5080
- recordDeepCheck,
5081
- formatLocator,
5082
- isLocator,
5083
- parseLocator,
5084
- SIMPLE_REFERENCES,
5085
- formatReference,
5086
- parseReference,
5087
- canonicalReference,
5088
- looksLikeReference,
5089
- providerLabel,
5090
- isFolderProvider,
5091
- folderProviderSql,
5092
- folderProviderOf,
5093
- DOCUMENT_ACCOUNT_PROVIDERS,
5094
- isDocumentAccountProvider,
5095
- ADDED_PROVIDER,
5096
- ADDED_ACCOUNT,
5097
- notAdded,
5098
- filesAccountSql,
5099
- INTERNAL_NOTES,
5100
- UNKNOWN_PROVIDER,
5101
- providerEntryOf,
5102
- kindsOfEntry,
5103
- unitedKinds,
5104
- providers,
5105
- useStoredProviders,
5106
- addProvider,
5107
- isKind,
5108
- providerNamed,
5109
- kindIn,
5110
- importedOf,
5111
- isImportedProvider,
5112
- holdsKind,
5113
- holdsKindOf,
5114
- isBotProvider,
5115
- inSource,
5116
- sourceOf as sourceOf2,
5117
- ACCOUNT_GROUPS,
5118
- ACCOUNT_GROUPS_SETTING,
5119
- isAccountList,
5120
- isGroupName,
5121
- groupName,
5122
- groupMembers,
5123
- listedHolds,
5124
- keyOf,
5125
- sourceOf2 as sourceOf3,
5126
- sameAs,
5127
- entriesOfList,
5128
- accountsOfList,
5129
- fitting
3607
+ meetingTagChange,
3608
+ meetingTagging,
3609
+ meetingTagChangeItem,
3610
+ meetingTaggingItem
5130
3611
  };