@wirecat/mail-cli 0.33.0 → 0.35.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 (153) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -1
  3. package/contracts/wirecat.json +54 -4
  4. package/dist/bin/mail.js +2 -2
  5. package/dist/bundle/agent-KWLCQCSC.js +39 -0
  6. package/dist/bundle/{all-profiles-W3CGXEEJ.js → all-profiles-6BDSMVOO.js} +63 -21
  7. package/dist/bundle/{anthropic-UMDO5AKP.js → anthropic-C3XUXUCJ.js} +8 -8
  8. package/dist/bundle/{app-server-4SICQ5RP.js → app-server-GUHDK4OR.js} +82 -64
  9. package/dist/bundle/{bun-QVVCH4MJ.js → bun-FN7AM4AG.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-CHD4AIUK.js → bun-sqlite-56IVBF22.js} +6 -6
  11. package/dist/bundle/{chunk-HFFHL7SV.js → chunk-2B67TUIF.js} +101 -69
  12. package/dist/bundle/{chunk-OOYIPK4F.js → chunk-2UNQTKRH.js} +1 -1
  13. package/dist/bundle/{chunk-LXUHYDNE.js → chunk-3ACF6TIV.js} +1 -1
  14. package/dist/bundle/chunk-3EV2B7KZ.js +726 -0
  15. package/dist/bundle/chunk-3KAJCOJP.js +109 -0
  16. package/dist/bundle/{chunk-2BFXHCZW.js → chunk-3WAZKCDF.js} +2 -2
  17. package/dist/bundle/{chunk-LKGJMM6W.js → chunk-46SBNO67.js} +12 -63
  18. package/dist/bundle/{chunk-LB5FTCPZ.js → chunk-4IASS7NQ.js} +128 -10
  19. package/dist/bundle/chunk-4U5ODZO7.js +360 -0
  20. package/dist/bundle/{chunk-QN423PC6.js → chunk-5WYBI35N.js} +3 -3
  21. package/dist/bundle/{chunk-GZYICXO4.js → chunk-5XQI7WCJ.js} +1 -1
  22. package/dist/bundle/{chunk-JUYUWMTG.js → chunk-635AFLZO.js} +4 -4
  23. package/dist/bundle/{chunk-2P44S7XK.js → chunk-6B4WZVLN.js} +36 -28
  24. package/dist/bundle/{chunk-47YNANPZ.js → chunk-6Q5THDNW.js} +3 -3
  25. package/dist/bundle/chunk-6VARUB3J.js +787 -0
  26. package/dist/bundle/{chunk-BRRHYXUP.js → chunk-7FXZKQAC.js} +87 -76
  27. package/dist/bundle/{chunk-EW3JFV7J.js → chunk-7JVKQ6NM.js} +4 -4
  28. package/dist/bundle/{chunk-OWAJN74H.js → chunk-7KMI47AP.js} +106 -257
  29. package/dist/bundle/{chunk-BF73DBAA.js → chunk-7PXAUMK5.js} +30 -15
  30. package/dist/bundle/{chunk-UX76GMQM.js → chunk-7YMLEWTX.js} +43 -64
  31. package/dist/bundle/{chunk-2L6D54BR.js → chunk-AISQNKT7.js} +8 -8
  32. package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
  33. package/dist/bundle/{chunk-OFMYFFEF.js → chunk-AXKIXVQA.js} +991 -1609
  34. package/dist/bundle/{chunk-UAV74EY4.js → chunk-CDGVYQXG.js} +1 -1
  35. package/dist/bundle/{chunk-RXUVXAMM.js → chunk-CFQQTDSA.js} +1 -1
  36. package/dist/bundle/chunk-CMGZXBJW.js +259 -0
  37. package/dist/bundle/{chunk-H46MANPR.js → chunk-DD2P67NP.js} +3 -3
  38. package/dist/bundle/{chunk-IBIFX2LK.js → chunk-DFHUJTP5.js} +2 -2
  39. package/dist/bundle/{chunk-DI74RP6R.js → chunk-DREU6TN6.js} +31 -85
  40. package/dist/bundle/{chunk-XQXYAOBV.js → chunk-DZHEVVXA.js} +53 -33
  41. package/dist/bundle/{chunk-LFBD6RTX.js → chunk-E6HSSKRX.js} +4 -4
  42. package/dist/bundle/{chunk-UYZDH5LK.js → chunk-EHAXFDDP.js} +1 -1
  43. package/dist/bundle/chunk-EU4J6GCJ.js +52 -0
  44. package/dist/bundle/{chunk-CHNNKHLL.js → chunk-EX4Z7CCO.js} +4051 -2788
  45. package/dist/bundle/chunk-G662S2M4.js +559 -0
  46. package/dist/bundle/{chunk-XN5KH24X.js → chunk-GG634DR3.js} +5 -5
  47. package/dist/bundle/{chunk-FSMCXQH2.js → chunk-GU3PYIV2.js} +2 -2
  48. package/dist/bundle/{chunk-SW7YGW3T.js → chunk-HF5QWKK2.js} +18 -8
  49. package/dist/bundle/chunk-HJDIMVFW.js +108 -0
  50. package/dist/bundle/chunk-HKWZG7CZ.js +334 -0
  51. package/dist/bundle/{chunk-BI5P7JWM.js → chunk-HM6AMYHR.js} +2 -2
  52. package/dist/bundle/{chunk-35AH33VJ.js → chunk-HVXOA4FO.js} +1 -1
  53. package/dist/bundle/{chunk-LXAX6AZU.js → chunk-I3QZCQJT.js} +6 -6
  54. package/dist/bundle/{chunk-I3UAD4EI.js → chunk-ILEKGH44.js} +68 -59
  55. package/dist/bundle/{chunk-SDWYOYGN.js → chunk-J5ULUTWE.js} +4 -4
  56. package/dist/bundle/{chunk-TK77DCE5.js → chunk-L4RCWRWS.js} +1 -1
  57. package/dist/bundle/chunk-MCJYJIH5.js +192 -0
  58. package/dist/bundle/{chunk-S6CHYNFE.js → chunk-NEDS4ORI.js} +2 -2
  59. package/dist/bundle/{chunk-QO7BK4WD.js → chunk-ODQCRZX5.js} +35 -12
  60. package/dist/bundle/chunk-OO4OKMNB.js +80 -0
  61. package/dist/bundle/{chunk-JCQ47WR4.js → chunk-OOQFBRNR.js} +144 -10
  62. package/dist/bundle/{chunk-LACMDMDI.js → chunk-OTP2HJ67.js} +9 -9
  63. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  64. package/dist/bundle/{chunk-AEKWEYIG.js → chunk-PQDQCCGG.js} +19 -19
  65. package/dist/bundle/{chunk-BZY5W35X.js → chunk-Q5U2HIBJ.js} +7 -7
  66. package/dist/bundle/{chunk-74BYHR44.js → chunk-QFMKCU42.js} +3738 -3415
  67. package/dist/bundle/{chunk-SYUIAMVA.js → chunk-QYCMB7JY.js} +373 -533
  68. package/dist/bundle/{chunk-KLLT572M.js → chunk-RBV2AM52.js} +2 -100
  69. package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-RJNKM3CQ.js} +1 -1
  70. package/dist/bundle/{chunk-6IS4BEN4.js → chunk-RQHWSNX4.js} +4 -4
  71. package/dist/bundle/chunk-RQJGX7F7.js +170 -0
  72. package/dist/bundle/{chunk-RENCSP47.js → chunk-TARNPINT.js} +3 -3
  73. package/dist/bundle/chunk-TP2BCK2Z.js +721 -0
  74. package/dist/bundle/{chunk-MJ7DUSHT.js → chunk-TP766H4O.js} +18 -14
  75. package/dist/bundle/{chunk-2X344EUT.js → chunk-UHGKN5US.js} +8 -8
  76. package/dist/bundle/{chunk-L3MKFI3Y.js → chunk-UWDRU3R6.js} +2 -2
  77. package/dist/bundle/chunk-V4O47JV6.js +72 -0
  78. package/dist/bundle/{chunk-CIG4UVP6.js → chunk-W4JYGMTU.js} +14 -13
  79. package/dist/bundle/{chunk-JADBHKBP.js → chunk-W7ICCFG5.js} +1 -1
  80. package/dist/bundle/{chunk-MNJ3BMPZ.js → chunk-WDEVKKAD.js} +3 -3
  81. package/dist/bundle/{chunk-TBZLGT7R.js → chunk-WZKM5I7B.js} +23 -119
  82. package/dist/bundle/{chunk-MT7T5N2N.js → chunk-XKKYRMGG.js} +4 -4
  83. package/dist/bundle/chunk-XQNKAM26.js +338 -0
  84. package/dist/bundle/{chunk-UWF3SSRL.js → chunk-YA44BG3N.js} +58 -9
  85. package/dist/bundle/{chunk-Y2P2LC5R.js → chunk-YCIWSKOH.js} +9 -9
  86. package/dist/bundle/{chunk-7OYZU5SP.js → chunk-YQTRKNZQ.js} +4 -4
  87. package/dist/bundle/chunk-YRAJFTFU.js +353 -0
  88. package/dist/bundle/chunk-YTI533XF.js +29 -0
  89. package/dist/bundle/{chunk-UG2QDGAH.js → chunk-ZMYRPMAJ.js} +1 -1
  90. package/dist/bundle/{chunk-CZ6ZXDSO.js → chunk-ZX7HZDD6.js} +182 -562
  91. package/dist/bundle/{chunk-IPSLQX64.js → chunk-ZYEU35MB.js} +2 -2
  92. package/dist/bundle/command-contract-D5UXWHMS.js +39 -0
  93. package/dist/bundle/{command-server-entry-G2ZHCN5J.js → command-server-entry-TPJ47FYS.js} +28 -25
  94. package/dist/bundle/decode-XHUASXQK.js +296 -0
  95. package/dist/bundle/{dispatch-RHIK22OA.js → dispatch-MQZHGGVP.js} +8 -8
  96. package/dist/bundle/{dist-X5G2IMYG.js → dist-BAE4IQ52.js} +34 -29
  97. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  98. package/dist/bundle/{echarts-UZJ6AREV.js → echarts-U7Z2PKIG.js} +2 -2
  99. package/dist/bundle/{embed-FEXLUH3T.js → embed-W7GPB6EI.js} +6 -6
  100. package/dist/bundle/{embedder-NHQARKFJ.js → embedder-T72XLFQ5.js} +9 -9
  101. package/dist/bundle/{failure-7DIA4OET.js → failure-MP6VKL5Y.js} +2 -2
  102. package/dist/bundle/{first-run-PS5NR2QG.js → first-run-C44TJXRI.js} +12 -12
  103. package/dist/bundle/first-screen-IESI7DAU.js +39 -0
  104. package/dist/bundle/{instructions-SDDUBGH4.js → instructions-WGMWQNPP.js} +1 -1
  105. package/dist/bundle/mail.js +12 -12
  106. package/dist/bundle/{mcp-GN4FTJX5.js → mcp-YGOAUNC3.js} +2 -2
  107. package/dist/bundle/meeting-combined-XGZBSWIQ.js +24 -0
  108. package/dist/bundle/meeting-model-QVHLD4WI.js +24 -0
  109. package/dist/bundle/meeting-semantic-QKQHUHXX.js +21 -0
  110. package/dist/bundle/{node-ELCNUOCE.js → node-WANDMJJQ.js} +2 -2
  111. package/dist/bundle/{node-sqlite-2E5MKZMH.js → node-sqlite-NM5XA4DR.js} +7 -7
  112. package/dist/bundle/{oauth-JGPEIY3M.js → oauth-6E63ELEE.js} +8 -8
  113. package/dist/bundle/{open-6DEMCZAB.js → open-5542RTLE.js} +5 -5
  114. package/dist/bundle/{openai-IVKDU5AH.js → openai-NOYNPFB5.js} +28 -26
  115. package/dist/bundle/{process-67DAKAAQ.js → process-7AEXXSBX.js} +1 -1
  116. package/dist/bundle/{program-ESJDQMAJ.js → program-VMA5CGNR.js} +5712 -3640
  117. package/dist/bundle/{prompt-ZBWOT5KG.js → prompt-WYYO4AJL.js} +5 -5
  118. package/dist/bundle/{recognize-UUBH2DOH.js → recognize-UGCCOMAS.js} +4 -4
  119. package/dist/bundle/{remote-UYTNWNOB.js → remote-VZS6BNQB.js} +9 -9
  120. package/dist/bundle/{rerank-X2633CQN.js → rerank-O46D5GJ2.js} +7 -7
  121. package/dist/bundle/{serve-CP7Q4OVW.js → serve-QAAF2LCW.js} +10 -10
  122. package/dist/bundle/server-456MYK3X.js +84 -0
  123. package/dist/bundle/{server-I7MXRSAG.js → server-Q3PUZLLX.js} +77 -58
  124. package/dist/bundle/{sqlite-runtime-BX55LI5G.js → sqlite-runtime-EQBCDO2U.js} +6 -6
  125. package/dist/bundle/{state-LLNJQXFH.js → state-XIOHYXCR.js} +6 -6
  126. package/dist/bundle/{store-N27XI3VV.js → store-OXJZZUR7.js} +34 -17
  127. package/dist/bundle/{store-K4KU5N75.js → store-VJBL5XKR.js} +30 -20
  128. package/dist/bundle/store-maintenance-command-D7XYIX52.js +71 -0
  129. package/dist/bundle/surface-N7LK7PKN.js +70 -0
  130. package/dist/commands/read.d.ts +2 -2
  131. package/dist/commands/read.d.ts.map +1 -1
  132. package/dist/commands/read.js +5 -4
  133. package/dist/commands/read.js.map +1 -1
  134. package/dist/commands/sync.d.ts +2 -1
  135. package/dist/commands/sync.d.ts.map +1 -1
  136. package/dist/commands/sync.js +16 -9
  137. package/dist/commands/sync.js.map +1 -1
  138. package/dist/config.d.ts +6 -0
  139. package/dist/config.d.ts.map +1 -1
  140. package/dist/config.js +16 -1
  141. package/dist/config.js.map +1 -1
  142. package/dist/identity.d.ts.map +1 -1
  143. package/dist/identity.js +2 -2
  144. package/dist/identity.js.map +1 -1
  145. package/dist/version.d.ts +1 -1
  146. package/dist/version.js +1 -1
  147. package/package.json +3 -3
  148. package/dist/bundle/chunk-BDCC2J2Z.js +0 -2
  149. package/dist/bundle/command-contract-NRNQAFFE.js +0 -36
  150. package/dist/bundle/decode-U6V6D6XH.js +0 -162
  151. package/dist/bundle/first-screen-C2WTLOG2.js +0 -34
  152. package/dist/bundle/server-QGTMJ7SF.js +0 -67
  153. package/dist/bundle/store-maintenance-command-VPAFQCNA.js +0 -58
@@ -24,6 +24,7 @@ import {
24
24
  pageSchema,
25
25
  picklist,
26
26
  pipe,
27
+ record,
27
28
  reference,
28
29
  safeParse,
29
30
  stepOf,
@@ -31,18 +32,55 @@ import {
31
32
  string,
32
33
  union,
33
34
  variant
34
- } from "./chunk-UWF3SSRL.js";
35
+ } from "./chunk-YA44BG3N.js";
35
36
  import {
36
37
  CliError,
37
38
  isCliError,
38
39
  singleLine,
39
40
  visibleControls
40
- } from "./chunk-BI5P7JWM.js";
41
+ } from "./chunk-HM6AMYHR.js";
41
42
  import {
42
43
  __name
43
44
  } from "./chunk-ZVVMGPBJ.js";
44
45
 
45
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
46
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
47
+ var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
48
+ var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
49
+ var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
50
+ var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
51
+ "field:value",
52
+ ...has(shown, "phrase") ? ['"a phrase"'] : [],
53
+ ...has(shown, "wildcard") ? ["word*"] : [],
54
+ ...backend === "native" ? ["terms joined by AND"] : ["AND OR NOT", "( )"],
55
+ ...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
56
+ ].join(" \xB7 "), "syntaxOf");
57
+ var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
58
+ var fieldsHelp = /* @__PURE__ */ __name((registry, guide) => {
59
+ const shown = shownOf(registry);
60
+ const negatable = leftOut(shown);
61
+ const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
62
+ const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
63
+ return [
64
+ "Fields:",
65
+ ...rows.map(([name = "", kind2 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind2.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
66
+ ...registry.defaults && registry.defaults.length > 0 ? [`Defaults: ${registry.defaults.join(" ")} \u2014 name the field to change it`] : [],
67
+ ...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
68
+ `Syntax: ${syntaxOf(shown, registry.backend)}`,
69
+ ...guide ? [`Guide: ${guide}`] : []
70
+ ].join("\n");
71
+ }, "fieldsHelp");
72
+ var queryDescription = /* @__PURE__ */ __name((registry) => {
73
+ const shown = shownOf(registry);
74
+ if (shown.length === 0)
75
+ return "field:value terms; this list filters by none yet, so any term is refused";
76
+ const negatable = leftOut(shown);
77
+ const terms = registry.backend === "native" ? `field:value terms joined by AND that narrow the list${negatable.length > 0 ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only` : ""}` : `field:value terms that narrow the list (Lucene: AND OR NOT, -field:value${has(shown, "range") ? ", [a TO b], > <" : ""})`;
78
+ const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
79
+ const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
80
+ return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
81
+ }, "queryDescription");
82
+
83
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
46
84
  var QUERY_LIMITS = {
47
85
  bytes: 8192,
48
86
  depth: 32,
@@ -86,7 +124,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
86
124
  __name(queryError, "queryError");
87
125
  var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
88
126
 
89
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
127
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
90
128
  var timezoneOf = /* @__PURE__ */ __name((given) => {
91
129
  const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
92
130
  try {
@@ -120,9 +158,9 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
120
158
  era: "short"
121
159
  });
122
160
  const dayAt = /* @__PURE__ */ __name((time) => {
123
- const parts2 = formatter.formatToParts(time);
124
- const value2 = /* @__PURE__ */ __name((name) => Number(parts2.find((p) => p.type === name)?.value), "value");
125
- const year = parts2.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
161
+ const parts = formatter.formatToParts(time);
162
+ const value2 = /* @__PURE__ */ __name((name) => Number(parts.find((p) => p.type === name)?.value), "value");
163
+ const year = parts.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
126
164
  return year * 1e4 + value2("month") * 100 + value2("day");
127
165
  }, "dayAt");
128
166
  let lo = date.getTime() - 2 * 864e5, hi = date.getTime() + 2 * 864e5;
@@ -157,8 +195,8 @@ var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
157
195
  hourCycle: "h23"
158
196
  });
159
197
  const shown = /* @__PURE__ */ __name((instant) => {
160
- const parts2 = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
161
- return Date.UTC(parts2.year ?? 0, (parts2.month ?? 1) - 1, parts2.day, parts2.hour, parts2.minute, parts2.second) + (instant % 1e3 + 1e3) % 1e3;
198
+ const parts = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
199
+ return Date.UTC(parts.year ?? 0, (parts.month ?? 1) - 1, parts.day, parts.hour, parts.minute, parts.second) + (instant % 1e3 + 1e3) % 1e3;
162
200
  }, "shown");
163
201
  const found = /* @__PURE__ */ new Set();
164
202
  for (const probe of [wanted - 864e5, wanted, wanted + 864e5]) {
@@ -236,8 +274,8 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
236
274
  };
237
275
  }, "dateRange");
238
276
 
239
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
240
- var wordsOf = /* @__PURE__ */ __name((text5) => text5.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
277
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
278
+ var wordsOf = /* @__PURE__ */ __name((text6) => text6.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
241
279
  var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
242
280
  var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
243
281
  var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
@@ -245,10 +283,10 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
245
283
  return false;
246
284
  if (node.operator === "wildcard" && node.value === "*")
247
285
  return true;
248
- const text5 = String(value);
286
+ const text6 = String(value);
249
287
  switch (field.type) {
250
288
  case "txt": {
251
- const words2 = wordsOf(text5);
289
+ const words2 = wordsOf(text6);
252
290
  if (node.operator === "wildcard")
253
291
  return words2.some((word) => pattern(node.value).test(word));
254
292
  const wanted = wordsOf(node.value);
@@ -262,13 +300,13 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
262
300
  return (lower === "*" || (lowerInclusive ? number2 >= Number(lower) : number2 > Number(lower))) && (upper === "*" || (upperInclusive ? number2 <= Number(upper) : number2 < Number(upper)));
263
301
  }
264
302
  case "time": {
265
- const time = Date.parse(text5);
303
+ const time = Date.parse(text6);
266
304
  const [lower, upper, lowerInclusive, upperInclusive] = node.operator === "range" ? [node.value, node.upper ?? "*", node.lower_inclusive ?? true, node.upper_inclusive ?? true] : [node.value, node.value, true, true];
267
305
  const range = dateRange(lower, upper, lowerInclusive, upperInclusive, options.zone ?? "UTC", node.span, options.now);
268
306
  return (range.lower === void 0 || (range.lower_inclusive ? time >= range.lower : time > range.lower)) && (range.upper === void 0 || (range.upper_inclusive ? time <= range.upper : time < range.upper));
269
307
  }
270
308
  default:
271
- return node.operator === "wildcard" ? pattern(node.value).test(text5) : text5.toLowerCase() === node.value.toLowerCase();
309
+ return node.operator === "wildcard" ? pattern(node.value).test(text6) : text6.toLowerCase() === node.value.toLowerCase();
272
310
  }
273
311
  }, "matchOne");
274
312
  var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
@@ -291,7 +329,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
291
329
  }, "matches");
292
330
  var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
293
331
 
294
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
332
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
295
333
  var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
296
334
  var OPERATORS_BY_TYPE = {
297
335
  kw: ["term", "phrase", "wildcard"],
@@ -370,44 +408,7 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
370
408
  return [...own, ...relations, ...states];
371
409
  }, "queryFieldsOf");
372
410
 
373
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
374
- var shownOf = /* @__PURE__ */ __name((registry2) => registry2.backend === "native" ? registry2.fields.filter((field) => field.native) : registry2.fields, "shownOf");
375
- var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
376
- var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
377
- var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
378
- "field:value",
379
- ...has(shown, "phrase") ? ['"a phrase"'] : [],
380
- ...has(shown, "wildcard") ? ["word*"] : [],
381
- ...backend === "native" ? ["terms joined by AND"] : ["AND OR NOT", "( )"],
382
- ...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
383
- ].join(" \xB7 "), "syntaxOf");
384
- var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
385
- var fieldsHelp = /* @__PURE__ */ __name((registry2, guide) => {
386
- const shown = shownOf(registry2);
387
- const negatable = leftOut(shown);
388
- const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
389
- const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
390
- return [
391
- "Fields:",
392
- ...rows.map(([name = "", kind3 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind3.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
393
- ...registry2.defaults && registry2.defaults.length > 0 ? [`Defaults: ${registry2.defaults.join(" ")} \u2014 name the field to change it`] : [],
394
- ...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
395
- `Syntax: ${syntaxOf(shown, registry2.backend)}`,
396
- ...guide ? [`Guide: ${guide}`] : []
397
- ].join("\n");
398
- }, "fieldsHelp");
399
- var queryDescription = /* @__PURE__ */ __name((registry2) => {
400
- const shown = shownOf(registry2);
401
- if (shown.length === 0)
402
- return "field:value terms; this list filters by none yet, so any term is refused";
403
- const negatable = leftOut(shown);
404
- const terms = registry2.backend === "native" ? `field:value terms joined by AND that narrow the list${negatable.length > 0 ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only` : ""}` : `field:value terms that narrow the list (Lucene: AND OR NOT, -field:value${has(shown, "range") ? ", [a TO b], > <" : ""})`;
405
- const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
406
- const defaults = registry2.defaults?.length ? `; unless named: ${registry2.defaults.join(" ")}` : "";
407
- return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
408
- }, "queryDescription");
409
-
410
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
411
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
411
412
  var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
412
413
  var reserved = /* @__PURE__ */ new Set([
413
414
  "+",
@@ -450,46 +451,46 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail) => {
450
451
  }
451
452
  return out;
452
453
  }, "decodeEscapes");
453
- var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
454
+ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
454
455
  const tokens = [];
455
456
  let at = 0;
456
457
  let range = false;
457
- while (at < text5.length) {
458
+ while (at < text6.length) {
458
459
  const start = at;
459
- const c = text5[at] ?? "";
460
+ const c = text6[at] ?? "";
460
461
  if (whitespace(c)) {
461
462
  at++;
462
463
  continue;
463
464
  }
464
- let kind3 = c;
465
+ let kind2 = c;
465
466
  if (c === '"' || !range && c === "/") {
466
467
  at++;
467
- while (at < text5.length && text5[at] !== c) {
468
- if (text5[at] === "\\" && (c === '"' || text5[at + 1] === "/"))
468
+ while (at < text6.length && text6[at] !== c) {
469
+ if (text6[at] === "\\" && (c === '"' || text6[at + 1] === "/"))
469
470
  at++;
470
471
  at++;
471
472
  }
472
- if (at >= text5.length)
473
- fail("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(text5, start) : void 0);
473
+ if (at >= text6.length)
474
+ fail("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(text6, start) : void 0);
474
475
  at++;
475
- if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text5.slice(at)))
476
+ if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text6.slice(at)))
476
477
  fail("query.unsupported-regex-flags", { start: at, end: at + 1 }, "Lucene regex does not take JavaScript flags");
477
- kind3 = c === '"' ? "quoted" : "regex";
478
+ kind2 = c === '"' ? "quoted" : "regex";
478
479
  } else if (range && c !== "]" && c !== "}") {
479
- while (at < text5.length && !whitespace(text5[at] ?? "") && !["]", "}"].includes(text5[at] ?? ""))
480
+ while (at < text6.length && !whitespace(text6[at] ?? "") && !["]", "}"].includes(text6[at] ?? ""))
480
481
  at++;
481
- kind3 = "rangeValue";
482
+ kind2 = "rangeValue";
482
483
  } else if (reserved.has(c)) {
483
484
  if (c === "\\") {
484
485
  at += 2;
485
- while (at < text5.length && !whitespace(text5[at] ?? "") && (!reserved.has(text5[at] ?? "") || ["+", "-"].includes(text5[at] ?? "")))
486
+ while (at < text6.length && !whitespace(text6[at] ?? "") && (!reserved.has(text6[at] ?? "") || ["+", "-"].includes(text6[at] ?? "")))
486
487
  at++;
487
- kind3 = "term";
488
+ kind2 = "term";
488
489
  } else {
489
490
  at++;
490
- if ((c === "<" || c === ">") && text5[at] === "=") {
491
+ if ((c === "<" || c === ">") && text6[at] === "=") {
491
492
  at++;
492
- kind3 += "=";
493
+ kind2 += "=";
493
494
  }
494
495
  if (c === "[" || c === "{")
495
496
  range = true;
@@ -498,15 +499,15 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
498
499
  }
499
500
  } else {
500
501
  at++;
501
- while (at < text5.length) {
502
- const next = text5[at] ?? "";
502
+ while (at < text6.length) {
503
+ const next = text6[at] ?? "";
503
504
  if (next === "\\") {
504
- if (at + 1 >= text5.length)
505
+ if (at + 1 >= text6.length)
505
506
  fail("query.invalid-escape", { start: at, end: at + 1 });
506
507
  at += 2;
507
508
  continue;
508
509
  }
509
- if (next === "@" && new RegExp("^@(?:\\p{L}|[\\p{L}\\p{N}][^\\s@]*\\.[\\p{L}\\p{N}])", "u").test(text5.slice(at))) {
510
+ if (next === "@" && new RegExp("^@(?:\\p{L}|[\\p{L}\\p{N}][^\\s@]*\\.[\\p{L}\\p{N}])", "u").test(text6.slice(at))) {
510
511
  at++;
511
512
  continue;
512
513
  }
@@ -515,19 +516,19 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
515
516
  at++;
516
517
  }
517
518
  const [field, colon] = tokens.slice(-2);
518
- if (field?.kind === "term" && colon?.kind === ":" && colon.span.end === start && text5[at] === ":" && /^[a-z][a-z_-]*$/u.test(text5.slice(start, at)) && /^:[^\s()"]/u.test(text5.slice(at)))
519
- while (at < text5.length && !whitespace(text5[at] ?? "") && !["(", ")", '"'].includes(text5[at] ?? ""))
519
+ if (field?.kind === "term" && colon?.kind === ":" && colon.span.end === start && text6[at] === ":" && /^[a-z][a-z_-]*$/u.test(text6.slice(start, at)) && /^:[^\s()"]/u.test(text6.slice(at)))
520
+ while (at < text6.length && !whitespace(text6[at] ?? "") && !["(", ")", '"'].includes(text6[at] ?? ""))
520
521
  at++;
521
- const raw = text5.slice(start, at);
522
- kind3 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
522
+ const raw = text6.slice(start, at);
523
+ kind2 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
523
524
  }
524
- tokens.push({ kind: kind3, raw: text5.slice(start, at), span: { start, end: at } });
525
+ tokens.push({ kind: kind2, raw: text6.slice(start, at), span: { start, end: at } });
525
526
  }
526
527
  tokens.push({ kind: "EOF", raw: "", span: { start: at, end: at } });
527
528
  return tokens;
528
529
  }, "tokensOf");
529
- var quoteHint = /* @__PURE__ */ __name((text5, at) => {
530
- for (const match of text5.matchAll(/(?<=^|[\s(])([\p{L}\p{N}_.-]+):([^\s"()]+)/gu)) {
530
+ var quoteHint = /* @__PURE__ */ __name((text6, at) => {
531
+ for (const match of text6.matchAll(/(?<=^|[\s(])([\p{L}\p{N}_.-]+):([^\s"()]+)/gu)) {
531
532
  const [whole, field, value = ""] = match;
532
533
  if (at < match.index || at > match.index + whole.length)
533
534
  continue;
@@ -535,22 +536,22 @@ var quoteHint = /* @__PURE__ */ __name((text5, at) => {
535
536
  }
536
537
  return void 0;
537
538
  }, "quoteHint");
538
- var regexHint = /* @__PURE__ */ __name((text5, at) => {
539
- const word = `${/[^\s()"]*$/u.exec(text5.slice(0, at))?.[0] ?? ""}${/^[^\s()"]*/u.exec(text5.slice(at))?.[0] ?? ""}`;
540
- return quoteHint(text5, at) ?? `/ starts a regular expression; put the value in quotes: "${word}"`;
539
+ var regexHint = /* @__PURE__ */ __name((text6, at) => {
540
+ const word = `${/[^\s()"]*$/u.exec(text6.slice(0, at))?.[0] ?? ""}${/^[^\s()"]*/u.exec(text6.slice(at))?.[0] ?? ""}`;
541
+ return quoteHint(text6, at) ?? `/ starts a regular expression; put the value in quotes: "${word}"`;
541
542
  }, "regexHint");
542
- var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proximity = false, ...context3 } = {}) => {
543
- const fail = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(text5, span.start), context3), "fail");
544
- if (text5.length > QUERY_LIMITS.bytes || new TextEncoder().encode(text5).length > QUERY_LIMITS.bytes)
545
- fail("query.too-large", { start: 0, end: text5.length });
546
- const tokens = tokensOf(text5, fail);
543
+ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proximity = false, ...context3 } = {}) => {
544
+ const fail = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(text6, span.start), context3), "fail");
545
+ if (text6.length > QUERY_LIMITS.bytes || new TextEncoder().encode(text6).length > QUERY_LIMITS.bytes)
546
+ fail("query.too-large", { start: 0, end: text6.length });
547
+ const tokens = tokensOf(text6, fail);
547
548
  let at = 0;
548
549
  let count7 = 0;
549
550
  let depth = 0;
550
551
  const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
551
552
  const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
552
- const expect = /* @__PURE__ */ __name((kind3) => {
553
- if (peek().kind !== kind3)
553
+ const expect = /* @__PURE__ */ __name((kind2) => {
554
+ if (peek().kind !== kind2)
554
555
  fail("query.invalid-syntax", peek().span);
555
556
  return take();
556
557
  }, "expect");
@@ -622,14 +623,14 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
622
623
  const value = take();
623
624
  if (!["term", "number", "quoted"].includes(value.kind))
624
625
  fail("query.invalid-syntax", value.span);
625
- const decoded2 = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span, fail);
626
+ const decoded = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span, fail);
626
627
  const lower = operator.kind.startsWith(">");
627
628
  const node2 = built({
628
629
  kind: "predicate",
629
630
  field,
630
631
  operator: "range",
631
- value: lower ? decoded2 : "*",
632
- upper: lower ? "*" : decoded2,
632
+ value: lower ? decoded : "*",
633
+ upper: lower ? "*" : decoded,
633
634
  lower_inclusive: !lower || operator.kind.endsWith("="),
634
635
  upper_inclusive: lower || operator.kind.endsWith("="),
635
636
  span: { start: token.span.start, end: value.span.end }
@@ -687,10 +688,10 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
687
688
  }
688
689
  if (proximity && peek().kind === "~" && node.kind === "predicate" && node.operator === "phrase") {
689
690
  take();
690
- const distance2 = take();
691
- if (distance2.kind !== "number" || !/^\d+$/u.test(distance2.raw))
692
- fail("query.invalid-syntax", distance2.span, 'write the distance as a whole number: "a b"~3');
693
- node = { ...node, slop: Number(distance2.raw), span: { start: node.span.start, end: distance2.span.end } };
691
+ const distance = take();
692
+ if (distance.kind !== "number" || !/^\d+$/u.test(distance.raw))
693
+ fail("query.invalid-syntax", distance.span, 'write the distance as a whole number: "a b"~3');
694
+ node = { ...node, slop: Number(distance.raw), span: { start: node.span.start, end: distance.span.end } };
694
695
  }
695
696
  if (peek().kind === "~")
696
697
  fail("query.unsupported-operator", peek().span, node.kind === "predicate" && node.operator === "phrase" ? "proximity (~) is not supported \u2014 drop the ~ for the exact phrase, or join the words with AND" : "fuzzy matching (~) is not supported \u2014 use a prefix such as word* to catch word forms");
@@ -709,14 +710,14 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
709
710
  }
710
711
  return { version: 1, language: "lucene-v1", root };
711
712
  }, "parseLucene");
712
- var implicitTextTerms = /* @__PURE__ */ __name((text5) => {
713
- const tokens = tokensOf(text5);
714
- if (tokens.some(({ kind: kind3 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind3)))
713
+ var implicitTextTerms = /* @__PURE__ */ __name((text6) => {
714
+ const tokens = tokensOf(text6);
715
+ if (tokens.some(({ kind: kind2 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind2)))
715
716
  return /* @__PURE__ */ new Set();
716
717
  return new Set(tokens.flatMap((token, index) => (token.kind === "term" || token.kind === "number") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index - 1]?.kind ?? "") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index + 1]?.kind ?? "") ? [token.span.start] : []));
717
718
  }, "implicitTextTerms");
718
719
 
719
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
720
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
720
721
  var inContext = /* @__PURE__ */ __name((context3, run2) => {
721
722
  try {
722
723
  run2();
@@ -758,8 +759,8 @@ var checkValue = /* @__PURE__ */ __name((field, node, options) => {
758
759
  return;
759
760
  }
760
761
  }, "checkValue");
761
- var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
762
- const byName = new Map(registry2.fields.map((field) => [field.name, field]));
762
+ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
763
+ const byName = new Map(registry.fields.map((field) => [field.name, field]));
763
764
  const visit = /* @__PURE__ */ __name((node, required) => {
764
765
  if (node.kind === "boolean") {
765
766
  for (const clause of node.clauses)
@@ -769,11 +770,11 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
769
770
  const field = byName.get(node.field);
770
771
  if (!field)
771
772
  queryError("query.unknown-field", node.span, `no field "${node.field}"`, options, {
772
- fields: registry2.fields.map((one) => one.name)
773
+ fields: registry.fields.map((one) => one.name)
773
774
  });
774
- if (registry2.backend === "native" && !field.native)
775
+ if (registry.backend === "native" && !field.native)
775
776
  queryError("query.unsupported-field", node.span, `the source cannot filter by ${field.name}`, options, {
776
- supported: registry2.fields.filter((one) => one.native).map((one) => one.name)
777
+ supported: registry.fields.filter((one) => one.native).map((one) => one.name)
777
778
  });
778
779
  const presence = node.operator === "wildcard" && node.value === "*";
779
780
  if (!presence && !field.operators.includes(node.operator))
@@ -791,48 +792,48 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
791
792
  }, "validateQuery");
792
793
  var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
793
794
 
794
- // node_modules/.pnpm/@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
795
- var describeQuery = /* @__PURE__ */ __name((registry2) => ({
796
- entity: registry2.entity,
797
- backend: registry2.backend,
798
- fields: registry2.fields.map(({ validate: _, ...field }) => field),
799
- ...registry2.defaults && registry2.defaults.length > 0 ? { defaults: [...registry2.defaults] } : {}
795
+ // node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
796
+ var describeQuery = /* @__PURE__ */ __name((registry) => ({
797
+ entity: registry.entity,
798
+ backend: registry.backend,
799
+ fields: registry.fields.map(({ validate: _, ...field }) => field),
800
+ ...registry.defaults && registry.defaults.length > 0 ? { defaults: [...registry.defaults] } : {}
800
801
  }), "describeQuery");
801
- var exampleProblems = /* @__PURE__ */ __name((registry2) => {
802
- const syntaxOnly = { ...registry2, backend: "sql" };
803
- const problem = /* @__PURE__ */ __name((text5, field) => {
802
+ var exampleProblems = /* @__PURE__ */ __name((registry) => {
803
+ const syntaxOnly = { ...registry, backend: "sql" };
804
+ const problem = /* @__PURE__ */ __name((text6, field) => {
804
805
  try {
805
- const named = walkQuery(validateQuery(parseLucene(text5, { defaultField: "none" }), syntaxOnly).root);
806
- return named.every((node) => node.field === field) ? void 0 : `"${text5}" does not name ${field}`;
806
+ const named = walkQuery(validateQuery(parseLucene(text6, { defaultField: "none" }), syntaxOnly).root);
807
+ return named.every((node) => node.field === field) ? void 0 : `"${text6}" does not name ${field}`;
807
808
  } catch (failure) {
808
809
  if (!isCliError(failure))
809
810
  throw failure;
810
- return `"${text5}": ${failure.message}`;
811
+ return `"${text6}": ${failure.message}`;
811
812
  }
812
813
  }, "problem");
813
- const defaults = (registry2.defaults ?? []).map((term) => {
814
+ const defaults = (registry.defaults ?? []).map((term) => {
814
815
  const field = term.replace(/^-/, "").split(/[:<>=]/)[0] ?? "";
815
816
  return { field, problem: problem(term.replace(/^-/, ""), field) };
816
817
  });
817
818
  return [
818
- ...registry2.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
819
+ ...registry.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
819
820
  ...defaults
820
821
  ].filter((entry) => entry.problem !== void 0);
821
822
  }, "exampleProblems");
822
823
  var checked = /* @__PURE__ */ new WeakSet();
823
- var defineQuery = /* @__PURE__ */ __name((registry2) => {
824
- if (checked.has(registry2))
825
- return registry2;
826
- const names = registry2.fields.map((field) => field.name);
824
+ var defineQuery = /* @__PURE__ */ __name((registry) => {
825
+ if (checked.has(registry))
826
+ return registry;
827
+ const names = registry.fields.map((field) => field.name);
827
828
  const problems = [
828
829
  ...duplicates(names).map((name) => `"${name}" is listed twice`),
829
830
  ...names.filter((name) => !SNAKE_CASE.test(name)).map((name) => `"${name}" is not snake_case`),
830
- ...exampleProblems(registry2).map(({ field, problem }) => `${field}: ${problem}`)
831
+ ...exampleProblems(registry).map(({ field, problem }) => `${field}: ${problem}`)
831
832
  ];
832
833
  if (problems.length > 0)
833
- throw new RegistryError(`${registry2.entity} query`, problems);
834
- checked.add(registry2);
835
- return registry2;
834
+ throw new RegistryError(`${registry.entity} query`, problems);
835
+ checked.add(registry);
836
+ return registry;
836
837
  }, "defineQuery");
837
838
  var SPAN = ["span", "alternative", "guide"];
838
839
  var QUERY_REASONS = defineReasons([
@@ -862,7 +863,7 @@ var QUERY_REASONS = defineReasons([
862
863
  details: [...SPAN, ...details]
863
864
  })));
864
865
 
865
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/service-query.js
866
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/search/service-query.js
866
867
  var BACKENDS = ["archive", "server", "both"];
867
868
  var MAX_BRANCHES = 64;
868
869
  var some = /* @__PURE__ */ __name((value) => value === void 0 ? [] : [value], "some");
@@ -901,7 +902,7 @@ var RELATIVE_TIME = /^\d+[mhd]$/i;
901
902
  var OFFSET = /(?:Z|[+-]\d{2}:?\d{2})$/i;
902
903
  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");
903
904
 
904
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/reference.js
905
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/reference.js
905
906
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
906
907
  var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
907
908
  if (!Number.isSafeInteger(value) || value < minimum)
@@ -909,24 +910,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
909
910
  return value;
910
911
  }, "integer");
911
912
  var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
912
- const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
913
+ const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
913
914
  if (reference2.transcriptId !== void 0)
914
- parts2.push(integer2(reference2.transcriptId));
915
+ parts.push(integer2(reference2.transcriptId));
915
916
  if (reference2.cuePosition !== void 0) {
916
917
  if (reference2.transcriptId === void 0)
917
918
  throw invalid();
918
- parts2.push(integer2(reference2.cuePosition, 0));
919
+ parts.push(integer2(reference2.cuePosition, 0));
919
920
  }
920
- return `meeting:${parts2.join("/")}`;
921
+ return `meeting:${parts.join("/")}`;
921
922
  }, "formatMeetingReference");
922
- var parseMeetingReference = /* @__PURE__ */ __name((text5) => {
923
- const value = text5.trim();
923
+ var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
924
+ const value = text6.trim();
924
925
  if (!value.startsWith("meeting:"))
925
926
  throw invalid();
926
- const parts2 = value.slice(8).split("/");
927
- if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
927
+ const parts = value.slice(8).split("/");
928
+ if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
928
929
  throw invalid();
929
- const ids2 = parts2.map(Number);
930
+ const ids2 = parts.map(Number);
930
931
  const reference2 = {
931
932
  type: "meeting",
932
933
  accountId: integer2(ids2[0]),
@@ -936,9 +937,9 @@ var parseMeetingReference = /* @__PURE__ */ __name((text5) => {
936
937
  };
937
938
  return reference2;
938
939
  }, "parseMeetingReference");
939
- var canonicalMeetingReference = /* @__PURE__ */ __name((text5) => formatMeetingReference(parseMeetingReference(text5)), "canonicalMeetingReference");
940
+ var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
940
941
 
941
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/payment.js
942
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/payment.js
942
943
  var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
943
944
  var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
944
945
  var PAYMENT_STATES = ["expected", "paid", "cancelled"];
@@ -1032,7 +1033,139 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
1032
1033
  return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
1033
1034
  }, "paymentTitle");
1034
1035
 
1035
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/item.js
1036
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1037
+ var context = {
1038
+ command: "search meetings",
1039
+ guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
1040
+ };
1041
+ var words = ["term", "phrase"];
1042
+ var MOST_LINES_APART = 20;
1043
+ var near = /* @__PURE__ */ __name((node) => {
1044
+ if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
1045
+ queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
1046
+ }, "near");
1047
+ var MEETING_HIT_QUERY = defineQuery({
1048
+ entity: "meeting_hit",
1049
+ backend: "sql",
1050
+ fields: [
1051
+ {
1052
+ name: "text",
1053
+ type: "txt",
1054
+ operators: words,
1055
+ example: "text:budget",
1056
+ relation: "a passage with the word in any form, or a spelling speech recognition garbled",
1057
+ validate: near
1058
+ },
1059
+ {
1060
+ name: "exact",
1061
+ type: "txt",
1062
+ operators: words,
1063
+ example: "exact:budget",
1064
+ relation: "a passage with the word as typed: no other forms, no garbled spellings",
1065
+ validate: near
1066
+ },
1067
+ {
1068
+ name: "from",
1069
+ type: "kw",
1070
+ operators: words,
1071
+ example: 'from:"Alice Synthetic"',
1072
+ relation: "a line said or a chat message written by this person; attendance is --identity-id"
1073
+ }
1074
+ ]
1075
+ });
1076
+ var MEETING_FIELDS = defineQuery({
1077
+ entity: "meeting_hit",
1078
+ backend: "sql",
1079
+ fields: [
1080
+ ...MEETING_HIT_QUERY.fields,
1081
+ {
1082
+ name: "date",
1083
+ type: "time",
1084
+ operators: ["term", "range"],
1085
+ example: "date>=30d",
1086
+ relation: "meetings that started then; the same as --since-time and --until-time"
1087
+ },
1088
+ ...["project", "tag", "topic"].map((name) => ({
1089
+ name,
1090
+ type: "kw",
1091
+ operators: words,
1092
+ example: `${name}:"Example name"`,
1093
+ relation: `meetings in this ${name}, by name or alias; the same as --${name}`
1094
+ }))
1095
+ ]
1096
+ });
1097
+ var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
1098
+ var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
1099
+ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
1100
+ let ast;
1101
+ try {
1102
+ ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
1103
+ } catch (error) {
1104
+ if (error instanceof CliError)
1105
+ return { query, request };
1106
+ throw error;
1107
+ }
1108
+ const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
1109
+ const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
1110
+ 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");
1111
+ const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
1112
+ if (wrong)
1113
+ queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
1114
+ if (!lifted.length)
1115
+ return { query, request };
1116
+ const next = { ...request };
1117
+ const once = /* @__PURE__ */ __name((name, flag2) => {
1118
+ if (next[name] !== void 0)
1119
+ throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
1120
+ }, "once");
1121
+ for (const { node } of lifted) {
1122
+ if (node.field === "date") {
1123
+ 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);
1124
+ if (range.lower !== void 0) {
1125
+ once("since", "--since-time");
1126
+ next.since = range.lower + (range.lower_inclusive ? 0 : 1);
1127
+ }
1128
+ if (range.upper !== void 0) {
1129
+ once("until", "--until-time");
1130
+ next.until = range.upper - (range.upper_inclusive ? 0 : 1);
1131
+ }
1132
+ } else {
1133
+ const field = node.field;
1134
+ once(field, `--${field}`);
1135
+ next[field] = node.value;
1136
+ }
1137
+ }
1138
+ let rest = query;
1139
+ for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
1140
+ rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
1141
+ rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
1142
+ if (!rest)
1143
+ throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
1144
+ return { query: rest, request: next };
1145
+ }, "liftMeetingFields");
1146
+ var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
1147
+
1148
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/search-store.js
1149
+ var refreshMeetingIndex = /* @__PURE__ */ __name(async (meetings, accountId, signal) => {
1150
+ let before = Number.POSITIVE_INFINITY;
1151
+ for (; ; ) {
1152
+ signal?.throwIfAborted();
1153
+ const { indexed, remaining } = await meetings.indexSearch({
1154
+ accountId,
1155
+ limit: 1e3,
1156
+ maxReadBytes: 64 * 1024 ** 2,
1157
+ signal
1158
+ });
1159
+ if (remaining === 0 || indexed === 0 || remaining >= before)
1160
+ return;
1161
+ before = remaining;
1162
+ }
1163
+ }, "refreshMeetingIndex");
1164
+
1165
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/model.js
1166
+ var MEETING_CALL_DIRECTIONS = ["in", "out"];
1167
+
1168
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/item.js
1036
1169
  var text = string();
1037
1170
  var count = pipe(number(), integer(), minValue(0));
1038
1171
  var MEETING_ISSUES = ["time_without_zone"];
@@ -1040,6 +1173,12 @@ var meetingIssuesOf = /* @__PURE__ */ __name((metadata) => {
1040
1173
  const listed2 = metadata?.issues;
1041
1174
  return Array.isArray(listed2) ? MEETING_ISSUES.filter((issue) => listed2.includes(issue)) : [];
1042
1175
  }, "meetingIssuesOf");
1176
+ var meetingCall = strictObject({
1177
+ direction: nullable(picklist(MEETING_CALL_DIRECTIONS)),
1178
+ manager: nullable(strictObject({ name: nullable(text), person: nullable(reference) })),
1179
+ client_phone: nullable(text)
1180
+ });
1181
+ var meetingCallItem = /* @__PURE__ */ __name((row) => row.direction == null && row.clientPhone == null ? void 0 : { direction: row.direction ?? null, manager: row.manager ?? null, client_phone: row.clientPhone ?? null }, "meetingCallItem");
1043
1182
  var meetingEntries = {
1044
1183
  ref: reference,
1045
1184
  id: pipe(string(), minLength(1)),
@@ -1057,6 +1196,8 @@ var meetingEntries = {
1057
1196
  duration_ms: nullable(count),
1058
1197
  timezone: optional(nullable(text)),
1059
1198
  participants_count: nullable(count),
1199
+ /** Present only on a phone call. */
1200
+ call: optional(meetingCall),
1060
1201
  /** Present only when something about this meeting is doubtful. */
1061
1202
  issues: optional(array(picklist(MEETING_ISSUES))),
1062
1203
  /**
@@ -1074,6 +1215,7 @@ var MEETING_UNTRUSTED = ["title", "description", "location"];
1074
1215
  var iso = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
1075
1216
  var meetingItem = /* @__PURE__ */ __name((row, owner) => {
1076
1217
  const issues = meetingIssuesOf(row.metadata);
1218
+ const call = meetingCallItem(row);
1077
1219
  return {
1078
1220
  ref: formatMeetingReference({ type: "meeting", accountId: row.accountId, meetingId: row.id }),
1079
1221
  id: String(row.id),
@@ -1089,6 +1231,7 @@ var meetingItem = /* @__PURE__ */ __name((row, owner) => {
1089
1231
  duration_ms: row.durationMs,
1090
1232
  timezone: row.timezone,
1091
1233
  participants_count: row.participantsCount,
1234
+ ...call ? { call } : {},
1092
1235
  ...issues.length ? { issues } : {},
1093
1236
  untrusted: [...MEETING_UNTRUSTED],
1094
1237
  created_at: new Date(row.createdAt).toISOString(),
@@ -1122,11 +1265,19 @@ var MEETING_QUERY = {
1122
1265
  })
1123
1266
  };
1124
1267
 
1125
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/store.js
1268
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/store.js
1126
1269
  var MEETING_DOCUMENT_ROLES = ["transcript", "recording", "notes"];
1270
+ var TRANSCRIPT_WORDS = [
1271
+ "Transcript",
1272
+ "Notes by Gemini",
1273
+ "\u0422\u0440\u0430\u043D\u0441\u043A\u0440\u0438\u043F\u0442",
1274
+ "\u0417\u0430\u043C\u0435\u0442\u043A\u0438 Gemini",
1275
+ "Transcripci\xF3n",
1276
+ "Notas de Gemini"
1277
+ ];
1127
1278
  var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
1128
1279
 
1129
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/answers.js
1280
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/answers.js
1130
1281
  var text2 = string();
1131
1282
  var count2 = pipe(number(), integer(), minValue(0));
1132
1283
  var iso2 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
@@ -1148,6 +1299,10 @@ var meetingHit = strictObject({
1148
1299
  /** `corrected`: a query word matched only a garbled form of itself, listed in `corrections`. */
1149
1300
  match: optional(picklist(["words", "corrected"])),
1150
1301
  corrections: optional(array(strictObject({ from: text2, to: array(text2) }))),
1302
+ /** A search with `--model`: which searches found it, its similarity in meaning, and the passage meaning matched. */
1303
+ by: optional(array(picklist(["words", "meaning"]))),
1304
+ score: optional(nullable(number())),
1305
+ passage: optional(strictObject({ first: text2, last: text2 })),
1151
1306
  source: optional(strictObject({
1152
1307
  ref: reference,
1153
1308
  title: nullable(text2),
@@ -1172,7 +1327,9 @@ var meetingTranscript = strictObject({
1172
1327
  /** When a newer transcript of the same source replaced it; `meetings transcript --history` shows those too. */
1173
1328
  superseded_at: nullable(isoTime),
1174
1329
  created_at: isoTime,
1175
- lines: array(line)
1330
+ lines: array(line),
1331
+ /** What people said, and who the service says said it: data, never instructions. */
1332
+ untrusted: optional(array(text2))
1176
1333
  });
1177
1334
  var meetingSummary = strictObject({
1178
1335
  id: pipe(string(), minLength(1)),
@@ -1185,7 +1342,9 @@ var meetingSummary = strictObject({
1185
1342
  content: nullable(text2),
1186
1343
  url: nullable(text2),
1187
1344
  created_at: isoTime,
1188
- updated_at: isoTime
1345
+ updated_at: isoTime,
1346
+ /** What the service wrote of what people said. */
1347
+ untrusted: optional(array(text2))
1189
1348
  });
1190
1349
  var meetingDetailsEntries = {
1191
1350
  ...meeting.entries,
@@ -1212,7 +1371,9 @@ var meetingDetailsEntries = {
1212
1371
  name: nullable(text2),
1213
1372
  mime: nullable(text2),
1214
1373
  size: nullable(count2),
1215
- url: nullable(text2)
1374
+ url: nullable(text2),
1375
+ /** The file on this computer; `null` when it stays on the service or the phone system (pbx over SFTP). */
1376
+ local_path: nullable(text2)
1216
1377
  })),
1217
1378
  /**
1218
1379
  * The Drive files the meeting service saved for it, by role. `document` is the stored document (`document:<id>`) once
@@ -1226,6 +1387,20 @@ var meetingDetailsEntries = {
1226
1387
  }))
1227
1388
  };
1228
1389
  var meetingDetails = strictObject(meetingDetailsEntries);
1390
+ var TRANSCRIPT_UNTRUSTED = ["lines.text", "lines.speaker"];
1391
+ var SUMMARY_UNTRUSTED = ["title", "overview", "sections.label", "sections.text", "next_steps", "content"];
1392
+ var DETAILS_UNTRUSTED = [
1393
+ "series_title",
1394
+ "participants.name",
1395
+ "participants.email",
1396
+ "participants.person.name",
1397
+ "chat.sender",
1398
+ "chat.recipient",
1399
+ "chat.text",
1400
+ "attachments.name",
1401
+ "documents.title"
1402
+ ];
1403
+ var PARTICIPANT_UNTRUSTED = ["display_name", "email", "person.name"];
1229
1404
  var meetingRef = /* @__PURE__ */ __name((accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId }), "meetingRef");
1230
1405
  var meetingTranscriptItem = /* @__PURE__ */ __name((accountId, transcript, rows) => ({
1231
1406
  ref: formatMeetingReference({
@@ -1245,7 +1420,8 @@ var meetingTranscriptItem = /* @__PURE__ */ __name((accountId, transcript, rows)
1245
1420
  end_ms: row.endMs,
1246
1421
  speaker: row.speakerName,
1247
1422
  text: row.text
1248
- }))
1423
+ })),
1424
+ untrusted: [...TRANSCRIPT_UNTRUSTED]
1249
1425
  }), "meetingTranscriptItem");
1250
1426
  var meetingSummaryItem = /* @__PURE__ */ __name((accountId, summary) => ({
1251
1427
  id: String(summary.id),
@@ -1253,17 +1429,20 @@ var meetingSummaryItem = /* @__PURE__ */ __name((accountId, summary) => ({
1253
1429
  source: summary.source,
1254
1430
  title: summary.title,
1255
1431
  overview: summary.overview,
1256
- sections: summary.sections.map(({ label, text: text5 }) => ({ label, text: text5 })),
1432
+ sections: summary.sections.map(({ label, text: text6 }) => ({ label, text: text6 })),
1257
1433
  next_steps: summary.nextSteps,
1258
1434
  content: summary.content,
1259
1435
  url: summary.docUrl,
1260
1436
  created_at: new Date(summary.externalCreatedAt ?? summary.createdAt).toISOString(),
1261
- updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString()
1437
+ updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString(),
1438
+ untrusted: [...SUMMARY_UNTRUSTED]
1262
1439
  }), "meetingSummaryItem");
1263
1440
  var meetingDetailsItem = /* @__PURE__ */ __name((details, owner) => {
1264
1441
  const { accountId } = details.meeting;
1442
+ const item = meetingItem(details.meeting, owner);
1265
1443
  return {
1266
- ...meetingItem(details.meeting, owner),
1444
+ ...item,
1445
+ untrusted: [...item.untrusted ?? [], ...DETAILS_UNTRUSTED],
1267
1446
  event_id: details.meeting.eventId === null ? null : String(details.meeting.eventId),
1268
1447
  series_id: details.meeting.meetingSeriesId === null ? null : String(details.meeting.meetingSeriesId),
1269
1448
  series_title: details.series?.title ?? null,
@@ -1300,7 +1479,8 @@ var meetingDetailsItem = /* @__PURE__ */ __name((details, owner) => {
1300
1479
  name: one.name ?? one.title,
1301
1480
  mime: one.mime,
1302
1481
  size: one.size,
1303
- url: one.url
1482
+ url: one.url,
1483
+ local_path: one.localPath
1304
1484
  })),
1305
1485
  documents: (details.documents ?? []).map((one) => ({
1306
1486
  file_id: one.fileId,
@@ -1349,10 +1529,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
1349
1529
  var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
1350
1530
  const items = found.items.map(meetingHitItem);
1351
1531
  const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
1352
- const pending2 = found.coverage.indexing === "pending";
1532
+ const pending = found.coverage.indexing === "pending";
1353
1533
  const next = [
1354
1534
  ...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
1355
- ...pending2 ? [
1535
+ ...pending ? [
1356
1536
  stepOf(SEARCH_AGAIN, {
1357
1537
  command,
1358
1538
  args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
@@ -1368,7 +1548,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
1368
1548
  ...cursor === void 0 ? {} : { next_cursor: cursor }
1369
1549
  },
1370
1550
  ...next.length > 0 ? { next } : {},
1371
- ...pending2 ? {
1551
+ ...pending ? {
1372
1552
  missing: [
1373
1553
  {
1374
1554
  field: "excerpt",
@@ -1381,7 +1561,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
1381
1561
  };
1382
1562
  }, "meetingHitsList");
1383
1563
 
1384
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1564
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1385
1565
  var joinKeyOf = /* @__PURE__ */ __name((url) => {
1386
1566
  const parsed = urlOf(url);
1387
1567
  if (!parsed)
@@ -1415,17 +1595,17 @@ var urlOf = /* @__PURE__ */ __name((url) => {
1415
1595
  }
1416
1596
  }, "urlOf");
1417
1597
 
1418
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1598
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1419
1599
  var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
1420
1600
  var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
1421
1601
  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");
1422
- var withoutLinkQueries = /* @__PURE__ */ __name((text5) => text5.replace(/https?:\/\/[^\s<>"')\]]+/giu, (url) => joinUrlWithoutQuery(url) ?? ""), "withoutLinkQueries");
1423
- var calendarText = /* @__PURE__ */ __name((text5, { dropSecretLines = true } = {}) => {
1424
- if (!text5)
1602
+ var withoutLinkQueries = /* @__PURE__ */ __name((text6) => text6.replace(/https?:\/\/[^\s<>"')\]]+/giu, (url) => joinUrlWithoutQuery(url) ?? ""), "withoutLinkQueries");
1603
+ var calendarText = /* @__PURE__ */ __name((text6, { dropSecretLines = true } = {}) => {
1604
+ if (!text6)
1425
1605
  return null;
1426
- const kept = htmlToText(text5).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
1427
- const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1428
- return joined2 || null;
1606
+ const kept = htmlToText(text6).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
1607
+ const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1608
+ return joined || null;
1429
1609
  }, "calendarText");
1430
1610
  var ENTRY_METADATA_KEYS = [
1431
1611
  "colorId",
@@ -1452,11 +1632,11 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
1452
1632
  return kept;
1453
1633
  }, "entryMetadata");
1454
1634
 
1455
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/calls.js
1635
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/calls.js
1456
1636
  var CALL_DIRECTIONS = ["incoming", "outgoing", "internal"];
1457
1637
  var CALL_OUTCOMES = ["answered", "voicemail", "busy", "no_answer", "failed"];
1458
1638
 
1459
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/call-answers.js
1639
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/call-answers.js
1460
1640
  var count3 = pipe(number(), integer(), minValue(0));
1461
1641
  var ms = count3;
1462
1642
  var id = pipe(number(), integer(), minValue(1));
@@ -1539,7 +1719,7 @@ var callStatsSchema = strictObject({
1539
1719
  });
1540
1720
  var callStats = callStatsSchema;
1541
1721
 
1542
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/stats.js
1722
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/stats.js
1543
1723
  var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
1544
1724
  var zoneOf = /* @__PURE__ */ __name((timeZone) => {
1545
1725
  const zone = timeZone ?? "UTC";
@@ -1552,13 +1732,13 @@ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
1552
1732
  }, "zoneOf");
1553
1733
  var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
1554
1734
  var weekStart = /* @__PURE__ */ __name((at, format) => {
1555
- const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1556
- const day = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
1557
- return new Date(day - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
1735
+ const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1736
+ const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
1737
+ return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
1558
1738
  }, "weekStart");
1559
1739
  var dayKey = /* @__PURE__ */ __name((at, format) => {
1560
- const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1561
- return `${parts2.year}-${parts2.month}-${parts2.day}`;
1740
+ const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
1741
+ return `${parts.year}-${parts.month}-${parts.day}`;
1562
1742
  }, "dayKey");
1563
1743
  var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
1564
1744
  timeZone: zone,
@@ -1674,10 +1854,10 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
1674
1854
  };
1675
1855
  }, "aggregateMeetingStats");
1676
1856
 
1677
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/call-stats.js
1857
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/call-stats.js
1678
1858
  var CALLBACK_WITHIN_MS = 24 * 60 * 60 * 1e3;
1679
1859
 
1680
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1860
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1681
1861
  import { createHash } from "node:crypto";
1682
1862
  var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
1683
1863
  reference: cue2.reference,
@@ -1691,7 +1871,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
1691
1871
  text: cue2.text
1692
1872
  })).digest("hex"), "meetingCueFingerprint");
1693
1873
 
1694
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1874
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1695
1875
  var EVENT_QUERY = defineQuery({
1696
1876
  entity: "event",
1697
1877
  backend: "sql",
@@ -1707,7 +1887,8 @@ var EVENT_QUERY = defineQuery({
1707
1887
  ]
1708
1888
  });
1709
1889
 
1710
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1890
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1891
+ var PARTICIPANT_RESPONSES = ["needs-action", "accepted", "tentative", "declined", "delegated"];
1711
1892
  var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
1712
1893
  var seriesEnd = /* @__PURE__ */ __name((entry) => {
1713
1894
  if (entry.recurrenceEndsAt !== null)
@@ -1730,7 +1911,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
1730
1911
  return Math.max(entry.endsAt ?? start, start + 1) > window.from;
1731
1912
  }, "entryInWindow");
1732
1913
 
1733
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/events.js
1914
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/events.js
1734
1915
  var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(), { create = true } = {}) => {
1735
1916
  const current = await store.meeting(details.meeting.id);
1736
1917
  if (!current)
@@ -1775,8 +1956,8 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(),
1775
1956
  return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
1776
1957
  }, "linkEvent");
1777
1958
 
1778
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1779
- var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text5) => text5.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
1959
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1960
+ var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text6) => text6.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
1780
1961
  var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
1781
1962
  if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
1782
1963
  throw new CliError("validation_error", "participant query must contain 1\u2013500 characters without NUL");
@@ -1799,7 +1980,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
1799
1980
  };
1800
1981
  }, "validateMeetingParticipantSearch");
1801
1982
 
1802
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1983
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1803
1984
  var MeetingError = class extends CliError {
1804
1985
  static {
1805
1986
  __name(this, "MeetingError");
@@ -1851,6 +2032,7 @@ var meetingPeople = /* @__PURE__ */ __name(async (store, query, accountId, optio
1851
2032
  });
1852
2033
  return {
1853
2034
  ...packet,
2035
+ items: packet.items.map((one) => ({ ...one, untrusted: [...PARTICIPANT_UNTRUSTED] })),
1854
2036
  page: { mode: "cursor", limit, has_more, ...next_cursor ? { next_cursor } : {} },
1855
2037
  ...next_cursor ? {
1856
2038
  next: [
@@ -1871,7 +2053,14 @@ var meetingPeople = /* @__PURE__ */ __name(async (store, query, accountId, optio
1871
2053
  }
1872
2054
  if (Object.values(options).some((value) => value !== void 0))
1873
2055
  throw new MeetingError("configuration_error", "bounded participant lookup needs a selected account and capable store");
1874
- return listed(await store.participants(query, accountId));
2056
+ return listed((await store.participants(query, accountId)).map((one) => ({
2057
+ participant_id: one.id,
2058
+ meeting_id: one.meetingId,
2059
+ identity_id: one.identityId,
2060
+ display_name: one.displayName,
2061
+ email: one.email,
2062
+ untrusted: [...PARTICIPANT_UNTRUSTED]
2063
+ })));
1875
2064
  }, "meetingPeople");
1876
2065
  var PAGE_NEXT2 = STEPS.find((step) => step.id === "page.next");
1877
2066
  var meetingsList = /* @__PURE__ */ __name(async (store, filter = {}) => {
@@ -1903,11 +2092,11 @@ var meetingsList = /* @__PURE__ */ __name(async (store, filter = {}) => {
1903
2092
  } : {}
1904
2093
  };
1905
2094
  }, "meetingsList");
1906
- var meetingsQuery = /* @__PURE__ */ __name((text5) => {
1907
- if (text5 === void 0 || text5.trim() === "")
2095
+ var meetingsQuery = /* @__PURE__ */ __name((text6) => {
2096
+ if (text6 === void 0 || text6.trim() === "")
1908
2097
  return void 0;
1909
2098
  const context3 = { command: "meetings list", guide: MEETING_QUERY_GUIDE };
1910
- const query = parseLucene(text5, { defaultField: "none", ...context3 });
2099
+ const query = parseLucene(text6, { defaultField: "none", ...context3 });
1911
2100
  validateQuery(query, MEETING_QUERY, context3);
1912
2101
  return query;
1913
2102
  }, "meetingsQuery");
@@ -1930,7 +2119,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId)
1930
2119
  return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
1931
2120
  }, "meetingSummaryAnswer");
1932
2121
 
1933
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/export.js
2122
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/export.js
1934
2123
  var timestamp = /* @__PURE__ */ __name((milliseconds) => {
1935
2124
  if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
1936
2125
  throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
@@ -1939,10 +2128,10 @@ var timestamp = /* @__PURE__ */ __name((milliseconds) => {
1939
2128
  const seconds = Math.floor(milliseconds % 6e4 / 1e3);
1940
2129
  return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds % 1e3).padStart(3, "0")}`;
1941
2130
  }, "timestamp");
1942
- var vttText = /* @__PURE__ */ __name((text5) => {
1943
- if (visibleControls(text5) !== text5 || /\n\s*\n/.test(text5))
2131
+ var vttText = /* @__PURE__ */ __name((text6) => {
2132
+ if (visibleControls(text6) !== text6 || /\n\s*\n/.test(text6))
1944
2133
  throw new MeetingError("validation_error", "cue paragraphs or control characters require Markdown export");
1945
- return text5.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
2134
+ return text6.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1946
2135
  }, "vttText");
1947
2136
  var serializeVtt = /* @__PURE__ */ __name((lines) => `WEBVTT
1948
2137
 
@@ -1960,9 +2149,9 @@ ${speaker}${vttText(line2.text)}
1960
2149
 
1961
2150
  `;
1962
2151
  }).join("")}`, "serializeVtt");
1963
- var markdown = /* @__PURE__ */ __name((text5) => visibleControls(text5).replace(/[\\`*_{}[\]()<>#+.!|~]/g, "\\$&"), "markdown");
1964
- var heading = /* @__PURE__ */ __name((text5) => markdown(singleLine(text5)), "heading");
1965
- var quote = /* @__PURE__ */ __name((text5) => markdown(text5).split(/\r\n|\r|\n/).map((line2) => `> ${line2}`).join("\n"), "quote");
2152
+ var markdown = /* @__PURE__ */ __name((text6) => visibleControls(text6).replace(/[\\`*_{}[\]()<>#+.!|~]/g, "\\$&"), "markdown");
2153
+ var heading = /* @__PURE__ */ __name((text6) => markdown(singleLine(text6)), "heading");
2154
+ var quote = /* @__PURE__ */ __name((text6) => markdown(text6).split(/\r\n|\r|\n/).map((line2) => `> ${line2}`).join("\n"), "quote");
1966
2155
  var transcriptsOf = /* @__PURE__ */ __name((details, transcriptId) => {
1967
2156
  if (transcriptId !== void 0) {
1968
2157
  positiveInteger(transcriptId);
@@ -1992,44 +2181,45 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
1992
2181
  text: row.text
1993
2182
  })));
1994
2183
  } else {
1995
- const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
2184
+ const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1996
2185
  if (details.meeting.description !== null)
1997
- parts2.push("## Description", quote(details.meeting.description));
2186
+ parts.push("## Description", quote(details.meeting.description));
1998
2187
  for (const summary of details.summaries) {
1999
- parts2.push(`## ${heading(summary.title ?? "Summary")}`);
2188
+ parts.push(`## ${heading(summary.title ?? "Summary")}`);
2000
2189
  if (summary.content !== null)
2001
- parts2.push(quote(summary.content));
2190
+ parts.push(quote(summary.content));
2002
2191
  else {
2003
2192
  if (summary.overview !== null)
2004
- parts2.push(quote(summary.overview));
2193
+ parts.push(quote(summary.overview));
2005
2194
  for (const section of summary.sections)
2006
- parts2.push(`### ${heading(section.label)}`, quote(section.text));
2195
+ parts.push(`### ${heading(section.label)}`, quote(section.text));
2007
2196
  if (summary.nextSteps.length > 0)
2008
- parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
2197
+ parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
2009
2198
  }
2010
2199
  }
2011
2200
  for (const part of transcripts) {
2012
- parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
2201
+ parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
2013
2202
  if (part.transcript.supersededAt !== null)
2014
- parts2.push("Version: superseded");
2203
+ parts.push("Version: superseded");
2015
2204
  for (const row of [...part.rows].sort((a, b) => a.position - b.position))
2016
- parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
2205
+ parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
2017
2206
  }
2018
- content = `${parts2.join("\n\n")}
2207
+ content = `${parts.join("\n\n")}
2019
2208
  `;
2020
2209
  }
2021
2210
  return {
2022
2211
  meetingId: details.meeting.id,
2023
2212
  format: options.format,
2024
2213
  filename: `meeting-${details.meeting.id}${options.transcriptId === void 0 ? "" : `-transcript-${options.transcriptId}`}.${options.format === "markdown" ? "md" : "vtt"}`,
2025
- content
2214
+ content,
2215
+ untrusted: ["content"]
2026
2216
  };
2027
2217
  }, "exportMeeting");
2028
2218
 
2029
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
2219
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
2030
2220
  import { createHash as createHash2 } from "node:crypto";
2031
2221
 
2032
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
2222
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
2033
2223
  var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
2034
2224
  if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
2035
2225
  throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
@@ -2040,7 +2230,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
2040
2230
  return new Date(value).toISOString();
2041
2231
  }, "meetingTimestamp");
2042
2232
 
2043
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
2233
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
2044
2234
  var TASK_TYPES = ["bug", "feature", "chore"];
2045
2235
  var invalid3 = /* @__PURE__ */ __name((message) => {
2046
2236
  throw new CliError("validation_error", message);
@@ -2054,10 +2244,10 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
2054
2244
  var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
2055
2245
  var findingWhere = /* @__PURE__ */ __name((of) => {
2056
2246
  const id4 = typeof of.id === "string" ? of.id : null;
2057
- const kind3 = typeof of.kind === "string" ? of.kind : null;
2247
+ const kind2 = typeof of.kind === "string" ? of.kind : null;
2058
2248
  return {
2059
- where: id4 || kind3 ? ` in ${[id4, kind3 && `(${kind3})`].filter(Boolean).join(" ")}` : "",
2060
- named: { ...id4 ? { finding: id4 } : {}, ...kind3 ? { kind: kind3 } : {} }
2249
+ where: id4 || kind2 ? ` in ${[id4, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
2250
+ named: { ...id4 ? { finding: id4 } : {}, ...kind2 ? { kind: kind2 } : {} }
2061
2251
  };
2062
2252
  }, "findingWhere");
2063
2253
  var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
@@ -2215,7 +2405,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
2215
2405
  var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
2216
2406
  var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
2217
2407
 
2218
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/findings.js
2408
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/findings.js
2219
2409
  var MEETING_FINDINGS_KIND = "meeting_findings";
2220
2410
  var cue = /* @__PURE__ */ __name((raw) => {
2221
2411
  const reference2 = canonicalMeetingReference(raw);
@@ -2226,141 +2416,29 @@ var cue = /* @__PURE__ */ __name((raw) => {
2226
2416
  var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
2227
2417
  var meetingFindingFingerprint = findingFingerprint;
2228
2418
 
2229
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
2230
- var context = {
2231
- command: "search meetings",
2232
- guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
2419
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/language.js
2420
+ var LATIN_WORDS = {
2421
+ en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
2422
+ es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
2423
+ de: ["der", "und", "ist", "nicht", "das", "ich", "wir", "mit", "auch", "ein"],
2424
+ fr: ["le", "les", "est", "une", "pas", "je", "vous", "nous", "avec", "mais"],
2425
+ it: ["gli", "della", "sono", "perch\xE9", "anche", "questo", "molto", "che", "di", "\xE8"],
2426
+ pt: ["n\xE3o", "voc\xEA", "isso", "muito", "ent\xE3o", "com", "uma", "tamb\xE9m", "mas", "eu"]
2233
2427
  };
2234
- var words = ["term", "phrase"];
2235
- var MOST_LINES_APART = 20;
2236
- var near = /* @__PURE__ */ __name((node) => {
2237
- if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
2238
- queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
2239
- }, "near");
2240
- var MEETING_HIT_QUERY = defineQuery({
2241
- entity: "meeting_hit",
2242
- backend: "sql",
2243
- fields: [
2244
- {
2245
- name: "text",
2246
- type: "txt",
2247
- operators: words,
2248
- example: "text:budget",
2249
- relation: "a passage with the word in any form, or a spelling speech recognition garbled",
2250
- validate: near
2251
- },
2252
- {
2253
- name: "exact",
2254
- type: "txt",
2255
- operators: words,
2256
- example: "exact:budget",
2257
- relation: "a passage with the word as typed: no other forms, no garbled spellings",
2258
- validate: near
2259
- },
2260
- {
2261
- name: "from",
2262
- type: "kw",
2263
- operators: words,
2264
- example: 'from:"Alice Synthetic"',
2265
- relation: "a line said or a chat message written by this person; attendance is --identity-id"
2266
- }
2267
- ]
2268
- });
2269
- var MEETING_FIELDS = defineQuery({
2270
- entity: "meeting_hit",
2271
- backend: "sql",
2272
- fields: [
2273
- ...MEETING_HIT_QUERY.fields,
2274
- {
2275
- name: "date",
2276
- type: "time",
2277
- operators: ["term", "range"],
2278
- example: "date>=30d",
2279
- relation: "meetings that started then; the same as --since-time and --until-time"
2280
- },
2281
- ...["project", "tag", "topic"].map((name) => ({
2282
- name,
2283
- type: "kw",
2284
- operators: words,
2285
- example: `${name}:"Example name"`,
2286
- relation: `meetings in this ${name}, by name or alias; the same as --${name}`
2287
- }))
2288
- ]
2289
- });
2290
- var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
2291
- var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
2292
- var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
2293
- let ast;
2294
- try {
2295
- ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
2296
- } catch (error) {
2297
- if (error instanceof CliError)
2298
- return { query, request };
2299
- throw error;
2300
- }
2301
- const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
2302
- const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
2303
- 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");
2304
- const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
2305
- if (wrong)
2306
- queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
2307
- if (!lifted.length)
2308
- return { query, request };
2309
- const next = { ...request };
2310
- const once = /* @__PURE__ */ __name((name, flag2) => {
2311
- if (next[name] !== void 0)
2312
- throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
2313
- }, "once");
2314
- for (const { node } of lifted) {
2315
- if (node.field === "date") {
2316
- 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);
2317
- if (range.lower !== void 0) {
2318
- once("since", "--since-time");
2319
- next.since = range.lower + (range.lower_inclusive ? 0 : 1);
2320
- }
2321
- if (range.upper !== void 0) {
2322
- once("until", "--until-time");
2323
- next.until = range.upper - (range.upper_inclusive ? 0 : 1);
2324
- }
2325
- } else {
2326
- const field = node.field;
2327
- once(field, `--${field}`);
2328
- next[field] = node.value;
2329
- }
2330
- }
2331
- let rest = query;
2332
- for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
2333
- rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
2334
- rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
2335
- if (!rest)
2336
- throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
2337
- return { query: rest, request: next };
2338
- }, "liftMeetingFields");
2339
- var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
2340
-
2341
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/language.js
2342
- var LATIN_WORDS = {
2343
- en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
2344
- es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
2345
- de: ["der", "und", "ist", "nicht", "das", "ich", "wir", "mit", "auch", "ein"],
2346
- fr: ["le", "les", "est", "une", "pas", "je", "vous", "nous", "avec", "mais"],
2347
- it: ["gli", "della", "sono", "perch\xE9", "anche", "questo", "molto", "che", "di", "\xE8"],
2348
- pt: ["n\xE3o", "voc\xEA", "isso", "muito", "ent\xE3o", "com", "uma", "tamb\xE9m", "mas", "eu"]
2349
- };
2350
- var LATIN_LANGUAGE = new Map(Object.entries(LATIN_WORDS).flatMap(([language, words2]) => words2.map((word) => [word, language])));
2351
- var UKRAINIAN = /[іїєґ]/giu;
2352
- var CYRILLIC = new RegExp("\\p{Script=Cyrillic}", "gu");
2353
- var LATIN = new RegExp("\\p{Script=Latin}", "gu");
2354
- var MIN_LETTERS = 20;
2355
- var DOMINANT = 0.75;
2356
- var countOf = /* @__PURE__ */ __name((text5, pattern2) => text5.match(pattern2)?.length ?? 0, "countOf");
2357
- var latinLanguage = /* @__PURE__ */ __name((texts) => {
2358
- const votes = /* @__PURE__ */ new Map();
2359
- for (const text5 of texts)
2360
- for (const word of text5.toLowerCase().split(/[^\p{L}]+/u)) {
2361
- const language = LATIN_LANGUAGE.get(word);
2362
- if (language)
2363
- votes.set(language, (votes.get(language) ?? 0) + 1);
2428
+ var LATIN_LANGUAGE = new Map(Object.entries(LATIN_WORDS).flatMap(([language, words2]) => words2.map((word) => [word, language])));
2429
+ var UKRAINIAN = /[іїєґ]/giu;
2430
+ var CYRILLIC = new RegExp("\\p{Script=Cyrillic}", "gu");
2431
+ var LATIN = new RegExp("\\p{Script=Latin}", "gu");
2432
+ var MIN_LETTERS = 20;
2433
+ var DOMINANT = 0.75;
2434
+ var countOf = /* @__PURE__ */ __name((text6, pattern2) => text6.match(pattern2)?.length ?? 0, "countOf");
2435
+ var latinLanguage = /* @__PURE__ */ __name((texts) => {
2436
+ const votes = /* @__PURE__ */ new Map();
2437
+ for (const text6 of texts)
2438
+ for (const word of text6.toLowerCase().split(/[^\p{L}]+/u)) {
2439
+ const language = LATIN_LANGUAGE.get(word);
2440
+ if (language)
2441
+ votes.set(language, (votes.get(language) ?? 0) + 1);
2364
2442
  }
2365
2443
  const [first, second] = [...votes].sort((a, b) => b[1] - a[1]);
2366
2444
  if (!first || first[1] < 3 || second && first[1] < 2 * second[1])
@@ -2372,10 +2450,10 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
2372
2450
  let cyrillic = 0;
2373
2451
  let latin = 0;
2374
2452
  let ukrainian = 0;
2375
- for (const text5 of all) {
2376
- cyrillic += countOf(text5, CYRILLIC);
2377
- latin += countOf(text5, LATIN);
2378
- ukrainian += countOf(text5, UKRAINIAN);
2453
+ for (const text6 of all) {
2454
+ cyrillic += countOf(text6, CYRILLIC);
2455
+ latin += countOf(text6, LATIN);
2456
+ ukrainian += countOf(text6, UKRAINIAN);
2379
2457
  }
2380
2458
  const letters = cyrillic + latin;
2381
2459
  if (letters < MIN_LETTERS)
@@ -2387,9 +2465,9 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
2387
2465
  return null;
2388
2466
  }, "transcriptLanguage");
2389
2467
 
2390
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2391
- var contentHash = /* @__PURE__ */ __name(async (text5) => {
2392
- const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text5));
2468
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2469
+ var contentHash = /* @__PURE__ */ __name(async (text6) => {
2470
+ const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text6));
2393
2471
  return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
2394
2472
  }, "contentHash");
2395
2473
  var speakerPosition = /* @__PURE__ */ __name((name, participants) => {
@@ -2424,114 +2502,330 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
2424
2502
  return time;
2425
2503
  }, "timestamp");
2426
2504
 
2427
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2428
- var TranscriptTextError = class extends Error {
2429
- static {
2430
- __name(this, "TranscriptTextError");
2431
- }
2432
- name = "TranscriptTextError";
2433
- };
2434
- var HEADER = {
2435
- "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: ": "title",
2436
- "\u0414\u0430\u0442\u0430: ": "date",
2437
- "Zoom ID: ": "meetingId",
2438
- "\u0413\u043E\u0432\u043E\u0440\u044F\u0442: ": "speakers"
2439
- };
2440
- var LINE = /^\[(\d{2,}):([0-5]\d):([0-5]\d)\]\s*(?:([^:\n]{1,60}):\s*)?([\s\S]*)$/;
2441
- var RULE = /^[—–-]{10,}[^\n]*(?:\n|$)/;
2442
- var EMPTY = /* @__PURE__ */ new Set(["", "\u2014", "-"]);
2443
- var parseTranscriptText = /* @__PURE__ */ __name((input) => {
2444
- const text5 = input.replace(/^/, "").replace(/\r\n?/g, "\n");
2445
- const header = { title: null, date: null, meetingId: null, speakers: [] };
2446
- let sawHeader = false;
2447
- for (const line2 of text5.split("\n")) {
2448
- if (!line2.trim())
2449
- break;
2450
- for (const [prefix, key] of Object.entries(HEADER)) {
2451
- if (!line2.startsWith(prefix))
2452
- continue;
2453
- sawHeader = true;
2454
- const value = line2.slice(prefix.length).trim();
2455
- if (key === "speakers")
2456
- header.speakers = value.split(",").map((name) => name.trim()).filter((name) => !EMPTY.has(name));
2457
- else
2458
- header[key] = EMPTY.has(value) ? null : value;
2505
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2506
+ var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
2507
+ const { identityExternalId, phone, ...fields } = p;
2508
+ const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
2509
+ return {
2510
+ ...fields,
2511
+ identity: {
2512
+ provider,
2513
+ externalId,
2514
+ name: p.displayName,
2515
+ ...phone?.trim() ? { phone } : {},
2516
+ metadata: p.metadata,
2517
+ associatePerson: Boolean(identityExternalId?.trim() || p.email?.trim() || p.externalId?.trim())
2459
2518
  }
2460
- }
2461
- if (!sawHeader)
2462
- throw new TranscriptTextError('a text transcript starts with a header such as "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: \u2026"');
2463
- const found = [];
2464
- for (const block of text5.split(/\n\s*\n/)) {
2465
- const match = LINE.exec(block.trim().replace(RULE, ""));
2466
- if (!match)
2467
- continue;
2468
- const [, hours = "0", minutes = "0", seconds = "0", speaker, said = ""] = match;
2469
- found.push({
2470
- startMs: ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3,
2471
- speaker: speaker?.trim() || null,
2472
- text: said.trim()
2519
+ };
2520
+ }, "participantInput");
2521
+ var participantInputs = /* @__PURE__ */ __name((provider, occurrenceId2, list, accountId) => list.map((p, i) => participantInput(p, provider, occurrenceId2, i, accountId)), "participantInputs");
2522
+ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount, kept) => {
2523
+ const startedAt = timestamp2(m.occurrence.startedAt);
2524
+ const given = m.occurrence.endedAt === null ? null : timestamp2(m.occurrence.endedAt);
2525
+ if (given !== null && given < startedAt)
2526
+ throw new Error("Meeting ends before it starts");
2527
+ const keptEnd = kept?.endedAt ?? null;
2528
+ const endedAt = given ?? (keptEnd !== null && keptEnd >= startedAt ? keptEnd : null);
2529
+ const count7 = participantsCount === null && kept ? kept.participantsCount : participantsCount;
2530
+ const metadata = kept?.metadata && m.metadata ? { ...kept.metadata, ...m.metadata } : m.metadata ?? kept?.metadata ?? null;
2531
+ const meeting2 = {
2532
+ accountId,
2533
+ externalId: m.occurrence.id,
2534
+ title: m.occurrence.title,
2535
+ description: m.description ?? kept?.description ?? null,
2536
+ location: m.location ?? kept?.location ?? null,
2537
+ joinUrl: m.joinUrl ?? m.series?.joinUrl ?? kept?.joinUrl ?? null,
2538
+ startedAt,
2539
+ endedAt,
2540
+ durationMs: endedAt === null ? null : endedAt - startedAt,
2541
+ timezone: m.timezone ?? kept?.timezone ?? null,
2542
+ hostIdentityId: kept?.hostIdentityId ?? null,
2543
+ ...count7 === void 0 ? {} : { participantsCount: count7 },
2544
+ ...m.call ? { direction: m.call.direction ?? null, clientPhone: m.call.clientPhone ?? null } : {},
2545
+ metadata,
2546
+ deletedAt: null
2547
+ };
2548
+ if (m.series)
2549
+ meeting2.series = {
2550
+ externalId: m.series.id,
2551
+ title: m.series.title,
2552
+ description: null,
2553
+ kind: m.series.kind ?? null,
2554
+ recurrence: m.series.recurrence ?? null,
2555
+ hostIdentityId: null,
2556
+ joinUrl: m.series.joinUrl ?? null,
2557
+ metadata: null,
2558
+ deletedAt: null
2559
+ };
2560
+ return meeting2;
2561
+ }, "sourceMeetingInput");
2562
+ var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts, { accountId, now, kept }) => {
2563
+ const id4 = m.occurrence.id;
2564
+ const { participants: sourceParticipants, transcript: lines, chat, summary } = parts;
2565
+ const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], accountId);
2566
+ const meeting2 = sourceMeetingInput(m, accountId, sourceParticipants === void 0 ? void 0 : sourceParticipants?.length ?? null, kept);
2567
+ const linked = sourceParticipants !== void 0;
2568
+ const format = source.transcriptFormat ?? null;
2569
+ const transcripts = lines && linked ? [await transcriptInput(lines, participants, source.name, void 0, format)] : void 0;
2570
+ const details = await store.saveMeeting({
2571
+ meeting: meeting2,
2572
+ participants: sourceParticipants ? participants : void 0,
2573
+ transcripts,
2574
+ chat: chat?.map((line2) => ({
2575
+ externalId: null,
2576
+ sentAt: timestamp2(line2.sentAt),
2577
+ senderParticipantPosition: speakerPosition(line2.sender, participants),
2578
+ senderName: line2.sender,
2579
+ recipient: null,
2580
+ text: line2.text,
2581
+ normalizedText: null,
2582
+ metadata: null
2583
+ })),
2584
+ summaries: summary ? [
2585
+ {
2586
+ ...summary,
2587
+ source: summary.source ?? source.name,
2588
+ content: summary.content ?? null,
2589
+ docUrl: summary.docUrl ?? null,
2590
+ externalCreatedAt: summary.externalCreatedAt ?? null,
2591
+ externalUpdatedAt: summary.externalUpdatedAt ?? null,
2592
+ metadata: summary.metadata ?? null
2593
+ }
2594
+ ] : void 0,
2595
+ attachments: parts.files ?? void 0,
2596
+ documents: parts.documents ?? void 0,
2597
+ now
2598
+ });
2599
+ if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
2600
+ await store.saveMeeting({
2601
+ meeting: meeting2,
2602
+ transcripts: [await transcriptInput(lines, [], source.name, `${JSON.stringify(lines)}
2603
+ unlinked`, format)],
2604
+ now
2473
2605
  });
2474
- }
2475
- const lines = found.map((line2, at) => ({
2476
- ...line2,
2477
- endMs: Math.max(line2.startMs, found[at + 1]?.startMs ?? line2.startMs)
2478
- }));
2479
- return { header, lines };
2480
- }, "parseTranscriptText");
2481
-
2482
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2483
- var VttError = class extends Error {
2484
- static {
2485
- __name(this, "VttError");
2486
- }
2487
- name = "VttError";
2488
- };
2489
- var TIMESTAMP = /^(?:(\d+):)?([0-5]\d):([0-5]\d)\.(\d{3})$/;
2490
- var SKIPPED = /^(NOTE|STYLE|REGION)(\s|$)/;
2491
- var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
2492
- const match = TIMESTAMP.exec(stamp);
2493
- if (!match)
2494
- throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
2495
- const [, hours = "0", minutes = "0", seconds = "0", ms2 = "0"] = match;
2496
- return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms2);
2497
- }, "millis");
2498
- var splitSpeaker = /* @__PURE__ */ __name((text5) => {
2499
- const firstLine = text5.split("\n", 1)[0] ?? "";
2500
- const at = firstLine.indexOf(": ");
2501
- if (at <= 0)
2502
- return { speaker: null, text: text5 };
2503
- return { speaker: firstLine.slice(0, at).trim(), text: text5.slice(at + 2) };
2504
- }, "splitSpeaker");
2505
- var parseVtt = /* @__PURE__ */ __name((input) => {
2506
- const lines = input.replace(/^/, "").split(/\r\n|\r|\n/);
2507
- if (!/^WEBVTT([ \t].*)?$/.test(lines[0] ?? ""))
2508
- throw new VttError('line 1: a WebVTT file starts with "WEBVTT"');
2509
- const cues = [];
2510
- let i = lines.findIndex((line2) => line2.trim() === "");
2511
- if (i < 0)
2512
- return [];
2513
- while (i < lines.length) {
2514
- while (i < lines.length && lines[i]?.trim() === "")
2515
- i++;
2516
- const start = i;
2517
- while (i < lines.length && lines[i]?.trim() !== "")
2518
- i++;
2519
- const block = lines.slice(start, i);
2520
- if (block.length === 0 || SKIPPED.test(block[0] ?? ""))
2521
- continue;
2522
- const timingAt = block.findIndex((line2) => line2.includes("-->"));
2523
- if (timingAt < 0 || timingAt > 1)
2524
- throw new VttError(`line ${start + 1}: a cue has no timing line`);
2525
- const lineNo = start + timingAt + 1;
2526
- const [from = "", rest = ""] = (block[timingAt] ?? "").split("-->");
2527
- const to = rest.trim().split(/\s+/)[0] ?? "";
2528
- const text5 = block.slice(timingAt + 1).join("\n").trim();
2529
- cues.push({ startMs: millis(from.trim(), lineNo), endMs: millis(to, lineNo), ...splitSpeaker(text5) });
2530
- }
2531
- return cues;
2532
- }, "parseVtt");
2533
-
2534
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/import.js
2606
+ await linkEvent(store, details, now, { create: source.createsEvents !== false });
2607
+ return details;
2608
+ }, "saveSourceMeeting");
2609
+ var startOf = /* @__PURE__ */ __name((m) => {
2610
+ const at = Date.parse(m.occurrence.startedAt);
2611
+ return Number.isFinite(at) ? at : Number.POSITIVE_INFINITY;
2612
+ }, "startOf");
2613
+ var indexSaved = /* @__PURE__ */ __name(async (store, accountIds, report) => {
2614
+ const indexSearch = store.indexSearch?.bind(store);
2615
+ if (!indexSearch || report.meetings === 0)
2616
+ return;
2617
+ for (const accountId of new Set(accountIds))
2618
+ try {
2619
+ await refreshMeetingIndex({ indexSearch }, accountId);
2620
+ } catch (error) {
2621
+ report.warnings.push({
2622
+ externalId: String(accountId),
2623
+ message: `search index not updated: ${error instanceof Error ? error.message : "failed"}`
2624
+ });
2625
+ }
2626
+ }, "indexSaved");
2627
+ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
2628
+ const now = options.now ?? Date.now();
2629
+ for (const [name, ms2] of [
2630
+ ["lookbackMs", options.lookbackMs ?? 0],
2631
+ ["overlapMs", source.overlapMs ?? 0]
2632
+ ])
2633
+ if (!Number.isSafeInteger(ms2) || ms2 < 0 || ms2 > 31 * 864e5)
2634
+ throw new Error(`${name} must be an integer from 0 through 31 days`);
2635
+ const lookbackMs = Math.max(options.lookbackMs ?? 0, source.overlapMs ?? 0);
2636
+ const cursor = options.rescan ? void 0 : await store.cursor(options.accountId);
2637
+ const since = options.since ?? cursor ?? new Date(now - 30 * 864e5).toISOString();
2638
+ timestamp2(since);
2639
+ const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
2640
+ let failed = false;
2641
+ let firstFailed;
2642
+ const callers = /* @__PURE__ */ new Set();
2643
+ const linkCallers = /* @__PURE__ */ __name(async () => {
2644
+ if (callers.size === 0 || !store.linkCallers)
2645
+ return;
2646
+ try {
2647
+ await store.linkCallers(source.provider, [...callers]);
2648
+ } catch (error) {
2649
+ report.warnings.push({
2650
+ externalId: source.provider,
2651
+ message: `callers not linked to people: ${error instanceof Error ? error.message : "failed"}`
2652
+ });
2653
+ }
2654
+ }, "linkCallers");
2655
+ const from = timestamp2(since) - lookbackMs;
2656
+ const meetings = (await source.meetings(lookbackMs === 0 ? since : new Date(from).toISOString())).toSorted((a, b) => startOf(a) - startOf(b));
2657
+ for (const [index, m] of meetings.entries()) {
2658
+ const stop = options.budget?.take() ?? null;
2659
+ if (stop) {
2660
+ report.stopped = stop;
2661
+ report.remaining = meetings.length - index;
2662
+ const reached = Math.min(startOf(m), firstFailed ?? Number.POSITIVE_INFINITY);
2663
+ if (Number.isFinite(reached) && reached > timestamp2(since))
2664
+ await store.setCursor(options.accountId, new Date(reached).toISOString(), now);
2665
+ await linkCallers();
2666
+ return report;
2667
+ }
2668
+ const id4 = m.occurrence.id;
2669
+ const failedHere = /* @__PURE__ */ __name(() => {
2670
+ failed = true;
2671
+ firstFailed ??= startOf(m);
2672
+ }, "failedHere");
2673
+ const read = /* @__PURE__ */ __name(async (part, call) => {
2674
+ try {
2675
+ return await call();
2676
+ } catch (error) {
2677
+ failedHere();
2678
+ const message = error instanceof Error ? error.message : "could not be read";
2679
+ report.warnings.push({ externalId: id4, message: `${part}: ${message}` });
2680
+ return void 0;
2681
+ }
2682
+ }, "read");
2683
+ try {
2684
+ const sourceParticipants = await read("participants", () => source.participants(id4));
2685
+ const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], options.accountId);
2686
+ const names = /* @__PURE__ */ new Map();
2687
+ for (const p of participants)
2688
+ if (p.displayName !== null) {
2689
+ const identities = names.get(p.displayName) ?? /* @__PURE__ */ new Set();
2690
+ identities.add(p.identity.externalId);
2691
+ names.set(p.displayName, identities);
2692
+ }
2693
+ if ([...names.values()].some((ids2) => ids2.size > 1))
2694
+ report.warnings.push({ externalId: id4, message: "Participant names are ambiguous" });
2695
+ const lines = await read("transcript", () => source.transcript(id4));
2696
+ const chat = await read("chat", () => source.chat(id4));
2697
+ const summary = await read("summary", () => source.summary(id4));
2698
+ const attachments = await read("files", () => source.files(id4));
2699
+ const listDocuments = source.documents?.bind(source);
2700
+ const documents = listDocuments ? await read("documents", () => listDocuments(id4)) : void 0;
2701
+ await saveSourceMeeting(source, store, m, { participants: sourceParticipants, transcript: lines, chat, summary, files: attachments, documents }, { accountId: options.accountId, now });
2702
+ for (const p of participants)
2703
+ if (p.identity.phone)
2704
+ callers.add(p.identity.externalId);
2705
+ report.meetings++;
2706
+ report.participants += participants.length;
2707
+ report.transcriptRows += lines?.length ?? 0;
2708
+ report.summaries += summary ? 1 : 0;
2709
+ } catch (error) {
2710
+ failedHere();
2711
+ report.warnings.push({ externalId: id4, message: error instanceof Error ? error.message : "Meeting pull failed" });
2712
+ }
2713
+ }
2714
+ await linkCallers();
2715
+ await indexSaved(store, [options.accountId], report);
2716
+ if (!failed)
2717
+ await store.setCursor(options.accountId, new Date(now).toISOString(), now);
2718
+ return report;
2719
+ }, "pull");
2720
+
2721
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2722
+ var TranscriptTextError = class extends Error {
2723
+ static {
2724
+ __name(this, "TranscriptTextError");
2725
+ }
2726
+ name = "TranscriptTextError";
2727
+ };
2728
+ var HEADER = {
2729
+ "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: ": "title",
2730
+ "\u0414\u0430\u0442\u0430: ": "date",
2731
+ "Zoom ID: ": "meetingId",
2732
+ "\u0413\u043E\u0432\u043E\u0440\u044F\u0442: ": "speakers"
2733
+ };
2734
+ var LINE = /^\[(\d{2,}):([0-5]\d):([0-5]\d)\]\s*(?:([^:\n]{1,60}):\s*)?([\s\S]*)$/;
2735
+ var RULE = /^[—–-]{10,}[^\n]*(?:\n|$)/;
2736
+ var EMPTY = /* @__PURE__ */ new Set(["", "\u2014", "-"]);
2737
+ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
2738
+ const text6 = input.replace(/^/, "").replace(/\r\n?/g, "\n");
2739
+ const header = { title: null, date: null, meetingId: null, speakers: [] };
2740
+ let sawHeader = false;
2741
+ for (const line2 of text6.split("\n")) {
2742
+ if (!line2.trim())
2743
+ break;
2744
+ for (const [prefix, key] of Object.entries(HEADER)) {
2745
+ if (!line2.startsWith(prefix))
2746
+ continue;
2747
+ sawHeader = true;
2748
+ const value = line2.slice(prefix.length).trim();
2749
+ if (key === "speakers")
2750
+ header.speakers = value.split(",").map((name) => name.trim()).filter((name) => !EMPTY.has(name));
2751
+ else
2752
+ header[key] = EMPTY.has(value) ? null : value;
2753
+ }
2754
+ }
2755
+ if (!sawHeader)
2756
+ throw new TranscriptTextError('a text transcript starts with a header such as "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: \u2026"');
2757
+ const found = [];
2758
+ for (const block of text6.split(/\n\s*\n/)) {
2759
+ const match = LINE.exec(block.trim().replace(RULE, ""));
2760
+ if (!match)
2761
+ continue;
2762
+ const [, hours = "0", minutes = "0", seconds = "0", speaker, said = ""] = match;
2763
+ found.push({
2764
+ startMs: ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3,
2765
+ speaker: speaker?.trim() || null,
2766
+ text: said.trim()
2767
+ });
2768
+ }
2769
+ const lines = found.map((line2, at) => ({
2770
+ ...line2,
2771
+ endMs: Math.max(line2.startMs, found[at + 1]?.startMs ?? line2.startMs)
2772
+ }));
2773
+ return { header, lines };
2774
+ }, "parseTranscriptText");
2775
+
2776
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2777
+ var VttError = class extends Error {
2778
+ static {
2779
+ __name(this, "VttError");
2780
+ }
2781
+ name = "VttError";
2782
+ };
2783
+ var TIMESTAMP = /^(?:(\d+):)?([0-5]\d):([0-5]\d)\.(\d{3})$/;
2784
+ var SKIPPED = /^(NOTE|STYLE|REGION)(\s|$)/;
2785
+ var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
2786
+ const match = TIMESTAMP.exec(stamp);
2787
+ if (!match)
2788
+ throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
2789
+ const [, hours = "0", minutes = "0", seconds = "0", ms2 = "0"] = match;
2790
+ return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms2);
2791
+ }, "millis");
2792
+ var splitSpeaker = /* @__PURE__ */ __name((text6) => {
2793
+ const firstLine = text6.split("\n", 1)[0] ?? "";
2794
+ const at = firstLine.indexOf(": ");
2795
+ if (at <= 0)
2796
+ return { speaker: null, text: text6 };
2797
+ return { speaker: firstLine.slice(0, at).trim(), text: text6.slice(at + 2) };
2798
+ }, "splitSpeaker");
2799
+ var parseVtt = /* @__PURE__ */ __name((input) => {
2800
+ const lines = input.replace(/^/, "").split(/\r\n|\r|\n/);
2801
+ if (!/^WEBVTT([ \t].*)?$/.test(lines[0] ?? ""))
2802
+ throw new VttError('line 1: a WebVTT file starts with "WEBVTT"');
2803
+ const cues = [];
2804
+ let i = lines.findIndex((line2) => line2.trim() === "");
2805
+ if (i < 0)
2806
+ return [];
2807
+ while (i < lines.length) {
2808
+ while (i < lines.length && lines[i]?.trim() === "")
2809
+ i++;
2810
+ const start = i;
2811
+ while (i < lines.length && lines[i]?.trim() !== "")
2812
+ i++;
2813
+ const block = lines.slice(start, i);
2814
+ if (block.length === 0 || SKIPPED.test(block[0] ?? ""))
2815
+ continue;
2816
+ const timingAt = block.findIndex((line2) => line2.includes("-->"));
2817
+ if (timingAt < 0 || timingAt > 1)
2818
+ throw new VttError(`line ${start + 1}: a cue has no timing line`);
2819
+ const lineNo = start + timingAt + 1;
2820
+ const [from = "", rest = ""] = (block[timingAt] ?? "").split("-->");
2821
+ const to = rest.trim().split(/\s+/)[0] ?? "";
2822
+ const text6 = block.slice(timingAt + 1).join("\n").trim();
2823
+ cues.push({ startMs: millis(from.trim(), lineNo), endMs: millis(to, lineNo), ...splitSpeaker(text6) });
2824
+ }
2825
+ return cues;
2826
+ }, "parseVtt");
2827
+
2828
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/import.js
2535
2829
  var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
2536
2830
  const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
2537
2831
  for (const file of files) {
@@ -2557,6 +2851,7 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
2557
2851
  });
2558
2852
  }
2559
2853
  }
2854
+ await indexSaved(store, files.map((file) => file.meeting.accountId), report);
2560
2855
  const zones = new Set(files.map((file) => file.meeting.timezone).filter((zone2) => zone2 !== null && zone2 !== void 0));
2561
2856
  const [zone] = zones;
2562
2857
  if (zones.size === 1 && zone)
@@ -2564,23 +2859,44 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
2564
2859
  return report;
2565
2860
  }, "importFiles");
2566
2861
 
2567
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/links.js
2862
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/links.js
2568
2863
  var CHAT_MESSAGES_READ = 1e5;
2569
2864
 
2570
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/passage.js
2865
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2866
+ var MEETING_FIELD_KEYS = Object.freeze({
2867
+ title: "title",
2868
+ kind: "kind",
2869
+ startTime: "start_time",
2870
+ durationMinutes: "duration_minutes",
2871
+ timezone: "timezone",
2872
+ agenda: "agenda"
2873
+ });
2874
+ var MEETING_FIELDS2 = Object.freeze(Object.keys(MEETING_FIELD_KEYS));
2875
+ var meetingFieldFlag = /* @__PURE__ */ __name((field) => `--${MEETING_FIELD_KEYS[field].replaceAll("_", "-")}`, "meetingFieldFlag");
2876
+ var SNAKE_CASE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
2877
+
2878
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/passage.js
2571
2879
  var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
2572
2880
  const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
2573
2881
  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)))
2574
2882
  throw new CliError("validation_error", "context takes 0\u2013999 surrounding cues, 2\u20134194304 output bytes and a bounded read budget");
2575
2883
  return { before, after, bytes, max_read_bytes };
2576
2884
  }, "meetingHitContextLimits");
2885
+ var MEETING_CUE_UNTRUSTED = ["speaker_name", "text"];
2886
+ var markedPassage = /* @__PURE__ */ __name((result) => ({
2887
+ ...result,
2888
+ packet: {
2889
+ ...result.packet,
2890
+ items: result.packet.items.map((cue2) => ({ ...cue2, untrusted: [...MEETING_CUE_UNTRUSTED] }))
2891
+ }
2892
+ }), "markedPassage");
2577
2893
  var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
2578
2894
  meetingHitContextLimits(options);
2579
2895
  if (typeof reference2 !== "string" || !reference2.trim() || reference2.length > 200 || options.format !== void 0 && !["json", "text", "markdown"].includes(options.format))
2580
2896
  throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
2581
2897
  }, "validateMeetingPassage");
2582
2898
 
2583
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2899
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2584
2900
  var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2585
2901
  if (!original || typeof original !== "object" || Array.isArray(original))
2586
2902
  throw new CliError("validation_error", "meeting preparation context is required");
@@ -2605,7 +2921,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2605
2921
  return { ...input, limit, maxReadBytes };
2606
2922
  }, "validateMeetingPreparationContext");
2607
2923
 
2608
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2924
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2609
2925
  var count4 = pipe(number(), integer(), minValue(0));
2610
2926
  var id2 = pipe(string(), minLength(1));
2611
2927
  var meetingProjectEvidence = strictObject({
@@ -2708,344 +3024,144 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
2708
3024
  throw new CliError("invalid_response", "project evidence does not match its answer contract");
2709
3025
  return {
2710
3026
  item,
2711
- ...cursor === void 0 ? {} : {
2712
- next: [
2713
- stepOf(PAGE_NEXT3, {
2714
- command,
2715
- args: {
2716
- project: prepared.project,
2717
- query: prepared.query,
2718
- cursor,
2719
- limit: page.limits.limit,
2720
- max_read_bytes: page.limits.maxReadBytes
2721
- },
2722
- values: { shown: page.items.length }
2723
- })
2724
- ]
2725
- }
2726
- };
2727
- }, "meetingProjectEvidenceAnswer");
2728
-
2729
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2730
- var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
2731
- const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
2732
- 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) || [
2733
- options.meetingId,
2734
- options.participantIdentityId,
2735
- options.personId,
2736
- options.projectId,
2737
- options.tagId,
2738
- options.eventId,
2739
- options.meetingSeriesId
2740
- ].some((value) => value !== void 0 && !integer3(value, 1, Number.MAX_SAFE_INTEGER)) || [options.since, options.until].some((value) => value !== void 0 && !integer3(value, -864e13, 864e13)) || options.since !== void 0 && options.until !== void 0 && options.since > options.until || options.after !== void 0 && (typeof options.after !== "string" || !/^[A-Za-z0-9_-]{1,1000}$/.test(options.after)))
2741
- throw new CliError("validation_error", "invalid bounded meeting search query, cursor or limits");
2742
- for (const name of [options.project, options.tag, options.topic])
2743
- if (name !== void 0 && (typeof name !== "string" || !name.trim() || name.length > 200 || /[\p{Cc}\p{Cf}]/u.test(name)))
2744
- throw new CliError("validation_error", "a meeting vocabulary name takes 1\u2013200 characters without control characters");
2745
- if (options.project !== void 0 && options.projectId !== void 0 || [options.tag, options.topic, options.tagId].filter((value) => value !== void 0).length > 1)
2746
- throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
2747
- }, "validateMeetingHitSearch");
2748
-
2749
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2750
- var ids = {
2751
- meeting_id: "meetingId",
2752
- identity_id: "participantIdentityId",
2753
- person_id: "personId",
2754
- tag_id: "tagId",
2755
- event_id: "eventId",
2756
- series_id: "meetingSeriesId"
2757
- };
2758
- var context2 = {
2759
- command: "meetings projects evidence",
2760
- guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
2761
- };
2762
- var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
2763
- entity: "meeting_project_evidence",
2764
- backend: "sql",
2765
- fields: [
2766
- ...Object.keys(ids).map((name) => ({
2767
- name,
2768
- type: "num",
2769
- operators: ["term"],
2770
- example: `${name}:12`,
2771
- placement: "and",
2772
- relation: "meetings selected by this stored ID; identity selects participants, not speakers"
2773
- })),
2774
- {
2775
- name: "started_at",
2776
- type: "time",
2777
- operators: ["term", "phrase", "range"],
2778
- example: "started_at:[2026-10-01 TO 2026-10-31]",
2779
- placement: "and",
2780
- relation: "the meeting start time in UTC"
2781
- }
2782
- ]
2783
- });
2784
- var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
2785
- var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {}, now = Date.now()) => {
2786
- 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")
2787
- throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
2788
- if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
2789
- throw new CliError("validation_error", "invalid project evidence query or budget");
2790
- request.signal?.throwIfAborted();
2791
- const options = {
2792
- limit: request.limit ?? 100,
2793
- maxReadBytes: request.maxReadBytes ?? 4194304,
2794
- ...request.cursor === void 0 ? {} : { cursor: request.cursor },
2795
- ...request.signal === void 0 ? {} : { signal: request.signal }
2796
- };
2797
- const terms = /* @__PURE__ */ new Map();
2798
- if (request.query?.trim()) {
2799
- const ast = parseLucene(request.query, { defaultField: "none", ...context2 });
2800
- validateQuery(ast, MEETING_PROJECT_EVIDENCE_QUERY, context2);
2801
- const add = /* @__PURE__ */ __name((node) => {
2802
- if (terms.has(node.field))
2803
- queryError("query.unsupported-placement", node.span, "each field only once", context2);
2804
- terms.set(node.field, node);
2805
- }, "add");
2806
- if (ast.root.kind === "predicate")
2807
- add(ast.root);
2808
- else
2809
- for (const clause of ast.root.clauses) {
2810
- if (clause.occur !== "must" || clause.node.kind !== "predicate")
2811
- queryError("query.unsupported-placement", clause.node.span, "field:value terms joined by AND", context2);
2812
- add(clause.node);
2813
- }
2814
- }
2815
- const frozen = [];
2816
- for (const [field, key] of Object.entries(ids)) {
2817
- const term2 = terms.get(field);
2818
- if (!term2)
2819
- continue;
2820
- if (term2.operator !== "term" || !/^[1-9]\d*$/.test(term2.value) || !Number.isSafeInteger(Number(term2.value)))
2821
- queryError("query.unsupported-operator", term2.span, "one positive safe integer ID", context2);
2822
- options[key] = Number(term2.value);
2823
- frozen.push(`${field}:${term2.value}`);
2824
- }
2825
- const term = terms.get("started_at");
2826
- if (term) {
2827
- const range = dateRange(term.value, term.operator === "range" ? term.upper ?? "*" : term.value, term.lower_inclusive !== false, term.upper_inclusive !== false, "UTC", term.span, now);
2828
- if (range.lower !== void 0)
2829
- options.since = range.lower + (range.lower_inclusive ? 0 : 1);
2830
- if (range.upper !== void 0)
2831
- options.until = range.upper - (range.upper_inclusive ? 0 : 1);
2832
- frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
2833
- }
2834
- validateMeetingHitSearch(project, options);
2835
- if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
2836
- throw new CliError("validation_error", "invalid project evidence cursor");
2837
- return { project: project.trim(), options, query: frozen.join(" AND ") };
2838
- }, "prepareMeetingProjectEvidence");
2839
-
2840
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2841
- var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
2842
- const prepared = prepareMeetingProjectEvidence(project, request, now);
2843
- const page = await read(prepared.project, prepared.options);
2844
- prepared.options.signal?.throwIfAborted();
2845
- return meetingProjectEvidenceAnswer(page, prepared);
2846
- }, "readMeetingProjectEvidence");
2847
-
2848
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2849
- var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
2850
- const { identityExternalId, phone, ...fields } = p;
2851
- const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
2852
- return {
2853
- ...fields,
2854
- identity: {
2855
- provider,
2856
- externalId,
2857
- name: p.displayName,
2858
- ...phone?.trim() ? { phone } : {},
2859
- metadata: p.metadata,
2860
- associatePerson: Boolean(identityExternalId?.trim() || p.email?.trim() || p.externalId?.trim())
2861
- }
2862
- };
2863
- }, "participantInput");
2864
- var participantInputs = /* @__PURE__ */ __name((provider, occurrenceId2, list, accountId) => list.map((p, i) => participantInput(p, provider, occurrenceId2, i, accountId)), "participantInputs");
2865
- var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount, kept) => {
2866
- const startedAt = timestamp2(m.occurrence.startedAt);
2867
- const given = m.occurrence.endedAt === null ? null : timestamp2(m.occurrence.endedAt);
2868
- if (given !== null && given < startedAt)
2869
- throw new Error("Meeting ends before it starts");
2870
- const keptEnd = kept?.endedAt ?? null;
2871
- const endedAt = given ?? (keptEnd !== null && keptEnd >= startedAt ? keptEnd : null);
2872
- const count7 = participantsCount === null && kept ? kept.participantsCount : participantsCount;
2873
- const metadata = kept?.metadata && m.metadata ? { ...kept.metadata, ...m.metadata } : m.metadata ?? kept?.metadata ?? null;
2874
- const meeting2 = {
2875
- accountId,
2876
- externalId: m.occurrence.id,
2877
- title: m.occurrence.title,
2878
- description: m.description ?? kept?.description ?? null,
2879
- location: m.location ?? kept?.location ?? null,
2880
- joinUrl: m.joinUrl ?? m.series?.joinUrl ?? kept?.joinUrl ?? null,
2881
- startedAt,
2882
- endedAt,
2883
- durationMs: endedAt === null ? null : endedAt - startedAt,
2884
- timezone: m.timezone ?? kept?.timezone ?? null,
2885
- hostIdentityId: kept?.hostIdentityId ?? null,
2886
- ...count7 === void 0 ? {} : { participantsCount: count7 },
2887
- metadata,
2888
- deletedAt: null
2889
- };
2890
- if (m.series)
2891
- meeting2.series = {
2892
- externalId: m.series.id,
2893
- title: m.series.title,
2894
- description: null,
2895
- kind: m.series.kind ?? null,
2896
- recurrence: m.series.recurrence ?? null,
2897
- hostIdentityId: null,
2898
- joinUrl: m.series.joinUrl ?? null,
2899
- metadata: null,
2900
- deletedAt: null
2901
- };
2902
- return meeting2;
2903
- }, "sourceMeetingInput");
2904
- var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts2, { accountId, now, kept }) => {
2905
- const id4 = m.occurrence.id;
2906
- const { participants: sourceParticipants, transcript: lines, chat, summary } = parts2;
2907
- const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], accountId);
2908
- const meeting2 = sourceMeetingInput(m, accountId, sourceParticipants === void 0 ? void 0 : sourceParticipants?.length ?? null, kept);
2909
- const linked = sourceParticipants !== void 0;
2910
- const format = source.transcriptFormat ?? null;
2911
- const transcripts = lines && linked ? [await transcriptInput(lines, participants, source.name, void 0, format)] : void 0;
2912
- const details = await store.saveMeeting({
2913
- meeting: meeting2,
2914
- participants: sourceParticipants ? participants : void 0,
2915
- transcripts,
2916
- chat: chat?.map((line2) => ({
2917
- externalId: null,
2918
- sentAt: timestamp2(line2.sentAt),
2919
- senderParticipantPosition: speakerPosition(line2.sender, participants),
2920
- senderName: line2.sender,
2921
- recipient: null,
2922
- text: line2.text,
2923
- normalizedText: null,
2924
- metadata: null
2925
- })),
2926
- summaries: summary ? [
2927
- {
2928
- ...summary,
2929
- source: summary.source ?? source.name,
2930
- content: summary.content ?? null,
2931
- docUrl: summary.docUrl ?? null,
2932
- externalCreatedAt: summary.externalCreatedAt ?? null,
2933
- externalUpdatedAt: summary.externalUpdatedAt ?? null,
2934
- metadata: summary.metadata ?? null
2935
- }
2936
- ] : void 0,
2937
- attachments: parts2.files ?? void 0,
2938
- documents: parts2.documents ?? void 0,
2939
- now
2940
- });
2941
- if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
2942
- await store.saveMeeting({
2943
- meeting: meeting2,
2944
- transcripts: [await transcriptInput(lines, [], source.name, `${JSON.stringify(lines)}
2945
- unlinked`, format)],
2946
- now
2947
- });
2948
- await linkEvent(store, details, now, { create: source.createsEvents !== false });
2949
- return details;
2950
- }, "saveSourceMeeting");
2951
- var startOf = /* @__PURE__ */ __name((m) => {
2952
- const at = Date.parse(m.occurrence.startedAt);
2953
- return Number.isFinite(at) ? at : Number.POSITIVE_INFINITY;
2954
- }, "startOf");
2955
- var pull = /* @__PURE__ */ __name(async (source, store, options) => {
2956
- const now = options.now ?? Date.now();
2957
- for (const [name, ms2] of [
2958
- ["lookbackMs", options.lookbackMs ?? 0],
2959
- ["overlapMs", source.overlapMs ?? 0]
2960
- ])
2961
- if (!Number.isSafeInteger(ms2) || ms2 < 0 || ms2 > 31 * 864e5)
2962
- throw new Error(`${name} must be an integer from 0 through 31 days`);
2963
- const lookbackMs = Math.max(options.lookbackMs ?? 0, source.overlapMs ?? 0);
2964
- const cursor = options.rescan ? void 0 : await store.cursor(options.accountId);
2965
- const since = options.since ?? cursor ?? new Date(now - 30 * 864e5).toISOString();
2966
- timestamp2(since);
2967
- const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
2968
- let failed = false;
2969
- let firstFailed;
2970
- const callers = /* @__PURE__ */ new Set();
2971
- const linkCallers = /* @__PURE__ */ __name(async () => {
2972
- if (callers.size === 0 || !store.linkCallers)
2973
- return;
2974
- try {
2975
- await store.linkCallers(source.provider, [...callers]);
2976
- } catch (error) {
2977
- report.warnings.push({
2978
- externalId: source.provider,
2979
- message: `callers not linked to people: ${error instanceof Error ? error.message : "failed"}`
2980
- });
3027
+ ...cursor === void 0 ? {} : {
3028
+ next: [
3029
+ stepOf(PAGE_NEXT3, {
3030
+ command,
3031
+ args: {
3032
+ project: prepared.project,
3033
+ query: prepared.query,
3034
+ cursor,
3035
+ limit: page.limits.limit,
3036
+ max_read_bytes: page.limits.maxReadBytes
3037
+ },
3038
+ values: { shown: page.items.length }
3039
+ })
3040
+ ]
2981
3041
  }
2982
- }, "linkCallers");
2983
- const from = timestamp2(since) - lookbackMs;
2984
- const meetings = (await source.meetings(lookbackMs === 0 ? since : new Date(from).toISOString())).toSorted((a, b) => startOf(a) - startOf(b));
2985
- for (const [index, m] of meetings.entries()) {
2986
- const stop = options.budget?.take() ?? null;
2987
- if (stop) {
2988
- report.stopped = stop;
2989
- report.remaining = meetings.length - index;
2990
- const reached = Math.min(startOf(m), firstFailed ?? Number.POSITIVE_INFINITY);
2991
- if (Number.isFinite(reached) && reached > timestamp2(since))
2992
- await store.setCursor(options.accountId, new Date(reached).toISOString(), now);
2993
- await linkCallers();
2994
- return report;
3042
+ };
3043
+ }, "meetingProjectEvidenceAnswer");
3044
+
3045
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
3046
+ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
3047
+ const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
3048
+ 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) || [
3049
+ options.meetingId,
3050
+ options.participantIdentityId,
3051
+ options.personId,
3052
+ options.projectId,
3053
+ options.tagId,
3054
+ options.eventId,
3055
+ options.meetingSeriesId
3056
+ ].some((value) => value !== void 0 && !integer3(value, 1, Number.MAX_SAFE_INTEGER)) || [options.since, options.until].some((value) => value !== void 0 && !integer3(value, -864e13, 864e13)) || options.since !== void 0 && options.until !== void 0 && options.since > options.until || options.after !== void 0 && (typeof options.after !== "string" || !/^[A-Za-z0-9_-]{1,1000}$/.test(options.after)))
3057
+ throw new CliError("validation_error", "invalid bounded meeting search query, cursor or limits");
3058
+ for (const name of [options.project, options.tag, options.topic])
3059
+ if (name !== void 0 && (typeof name !== "string" || !name.trim() || name.length > 200 || /[\p{Cc}\p{Cf}]/u.test(name)))
3060
+ throw new CliError("validation_error", "a meeting vocabulary name takes 1\u2013200 characters without control characters");
3061
+ if (options.project !== void 0 && options.projectId !== void 0 || [options.tag, options.topic, options.tagId].filter((value) => value !== void 0).length > 1)
3062
+ throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
3063
+ }, "validateMeetingHitSearch");
3064
+
3065
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
3066
+ var ids = {
3067
+ meeting_id: "meetingId",
3068
+ identity_id: "participantIdentityId",
3069
+ person_id: "personId",
3070
+ tag_id: "tagId",
3071
+ event_id: "eventId",
3072
+ series_id: "meetingSeriesId"
3073
+ };
3074
+ var context2 = {
3075
+ command: "meetings projects evidence",
3076
+ guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
3077
+ };
3078
+ var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
3079
+ entity: "meeting_project_evidence",
3080
+ backend: "sql",
3081
+ fields: [
3082
+ ...Object.keys(ids).map((name) => ({
3083
+ name,
3084
+ type: "num",
3085
+ operators: ["term"],
3086
+ example: `${name}:12`,
3087
+ placement: "and",
3088
+ relation: "meetings selected by this stored ID; identity selects participants, not speakers"
3089
+ })),
3090
+ {
3091
+ name: "started_at",
3092
+ type: "time",
3093
+ operators: ["term", "phrase", "range"],
3094
+ example: "started_at:[2026-10-01 TO 2026-10-31]",
3095
+ placement: "and",
3096
+ relation: "the meeting start time in UTC"
2995
3097
  }
2996
- const id4 = m.occurrence.id;
2997
- const failedHere = /* @__PURE__ */ __name(() => {
2998
- failed = true;
2999
- firstFailed ??= startOf(m);
3000
- }, "failedHere");
3001
- const read = /* @__PURE__ */ __name(async (part, call) => {
3002
- try {
3003
- return await call();
3004
- } catch (error) {
3005
- failedHere();
3006
- const message = error instanceof Error ? error.message : "could not be read";
3007
- report.warnings.push({ externalId: id4, message: `${part}: ${message}` });
3008
- return void 0;
3098
+ ]
3099
+ });
3100
+ var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
3101
+ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {}, now = Date.now()) => {
3102
+ 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")
3103
+ throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
3104
+ if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
3105
+ throw new CliError("validation_error", "invalid project evidence query or budget");
3106
+ request.signal?.throwIfAborted();
3107
+ const options = {
3108
+ limit: request.limit ?? 100,
3109
+ maxReadBytes: request.maxReadBytes ?? 4194304,
3110
+ ...request.cursor === void 0 ? {} : { cursor: request.cursor },
3111
+ ...request.signal === void 0 ? {} : { signal: request.signal }
3112
+ };
3113
+ const terms = /* @__PURE__ */ new Map();
3114
+ if (request.query?.trim()) {
3115
+ const ast = parseLucene(request.query, { defaultField: "none", ...context2 });
3116
+ validateQuery(ast, MEETING_PROJECT_EVIDENCE_QUERY, context2);
3117
+ const add = /* @__PURE__ */ __name((node) => {
3118
+ if (terms.has(node.field))
3119
+ queryError("query.unsupported-placement", node.span, "each field only once", context2);
3120
+ terms.set(node.field, node);
3121
+ }, "add");
3122
+ if (ast.root.kind === "predicate")
3123
+ add(ast.root);
3124
+ else
3125
+ for (const clause of ast.root.clauses) {
3126
+ if (clause.occur !== "must" || clause.node.kind !== "predicate")
3127
+ queryError("query.unsupported-placement", clause.node.span, "field:value terms joined by AND", context2);
3128
+ add(clause.node);
3009
3129
  }
3010
- }, "read");
3011
- try {
3012
- const sourceParticipants = await read("participants", () => source.participants(id4));
3013
- const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], options.accountId);
3014
- const names = /* @__PURE__ */ new Map();
3015
- for (const p of participants)
3016
- if (p.displayName !== null) {
3017
- const identities = names.get(p.displayName) ?? /* @__PURE__ */ new Set();
3018
- identities.add(p.identity.externalId);
3019
- names.set(p.displayName, identities);
3020
- }
3021
- if ([...names.values()].some((ids2) => ids2.size > 1))
3022
- report.warnings.push({ externalId: id4, message: "Participant names are ambiguous" });
3023
- const lines = await read("transcript", () => source.transcript(id4));
3024
- const chat = await read("chat", () => source.chat(id4));
3025
- const summary = await read("summary", () => source.summary(id4));
3026
- const attachments = await read("files", () => source.files(id4));
3027
- const listDocuments = source.documents?.bind(source);
3028
- const documents = listDocuments ? await read("documents", () => listDocuments(id4)) : void 0;
3029
- await saveSourceMeeting(source, store, m, { participants: sourceParticipants, transcript: lines, chat, summary, files: attachments, documents }, { accountId: options.accountId, now });
3030
- for (const p of participants)
3031
- if (p.identity.phone)
3032
- callers.add(p.identity.externalId);
3033
- report.meetings++;
3034
- report.participants += participants.length;
3035
- report.transcriptRows += lines?.length ?? 0;
3036
- report.summaries += summary ? 1 : 0;
3037
- } catch (error) {
3038
- failedHere();
3039
- report.warnings.push({ externalId: id4, message: error instanceof Error ? error.message : "Meeting pull failed" });
3040
- }
3041
3130
  }
3042
- await linkCallers();
3043
- if (!failed)
3044
- await store.setCursor(options.accountId, new Date(now).toISOString(), now);
3045
- return report;
3046
- }, "pull");
3131
+ const frozen = [];
3132
+ for (const [field, key] of Object.entries(ids)) {
3133
+ const term2 = terms.get(field);
3134
+ if (!term2)
3135
+ continue;
3136
+ if (term2.operator !== "term" || !/^[1-9]\d*$/.test(term2.value) || !Number.isSafeInteger(Number(term2.value)))
3137
+ queryError("query.unsupported-operator", term2.span, "one positive safe integer ID", context2);
3138
+ options[key] = Number(term2.value);
3139
+ frozen.push(`${field}:${term2.value}`);
3140
+ }
3141
+ const term = terms.get("started_at");
3142
+ if (term) {
3143
+ const range = dateRange(term.value, term.operator === "range" ? term.upper ?? "*" : term.value, term.lower_inclusive !== false, term.upper_inclusive !== false, "UTC", term.span, now);
3144
+ if (range.lower !== void 0)
3145
+ options.since = range.lower + (range.lower_inclusive ? 0 : 1);
3146
+ if (range.upper !== void 0)
3147
+ options.until = range.upper - (range.upper_inclusive ? 0 : 1);
3148
+ frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
3149
+ }
3150
+ validateMeetingHitSearch(project, options);
3151
+ if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
3152
+ throw new CliError("validation_error", "invalid project evidence cursor");
3153
+ return { project: project.trim(), options, query: frozen.join(" AND ") };
3154
+ }, "prepareMeetingProjectEvidence");
3047
3155
 
3048
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
3156
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
3157
+ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
3158
+ const prepared = prepareMeetingProjectEvidence(project, request, now);
3159
+ const page = await read(prepared.project, prepared.options);
3160
+ prepared.options.signal?.throwIfAborted();
3161
+ return meetingProjectEvidenceAnswer(page, prepared);
3162
+ }, "readMeetingProjectEvidence");
3163
+
3164
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
3049
3165
  var text3 = string();
3050
3166
  var count5 = pipe(number(), integer(), minValue(0));
3051
3167
  var id3 = pipe(number(), integer(), minValue(1));
@@ -3134,7 +3250,8 @@ var meetingParticipants = strictObject({
3134
3250
  identity_id: id3,
3135
3251
  display_name: nullable(text3),
3136
3252
  email: nullable(text3),
3137
- person: nullable(strictObject({ ref: text3, name: nullable(text3) }))
3253
+ person: nullable(strictObject({ ref: text3, name: nullable(text3) })),
3254
+ untrusted: optional(array(text3))
3138
3255
  })),
3139
3256
  /** Several identities on one page are observations, never speaker attribution or person links. */
3140
3257
  ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id3) }),
@@ -3186,7 +3303,9 @@ var meetingPassage = strictObject({
3186
3303
  speaker_participant_id: nullable(id3),
3187
3304
  speaker_name: nullable(text3),
3188
3305
  text: text3,
3189
- revision
3306
+ revision,
3307
+ /** What people said: `speaker_name` and `text`. */
3308
+ untrusted: optional(array(text3))
3190
3309
  }))
3191
3310
  });
3192
3311
  var event = strictObject({
@@ -3240,13 +3359,14 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
3240
3359
  updated_at: new Date(one.updatedAt).toISOString()
3241
3360
  }), "eventItem");
3242
3361
 
3243
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
3362
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
3244
3363
  var MEETING_SERVER_BOUNDS = { calls: 3, pages: 2 };
3245
3364
  var ISSUES = {
3246
3365
  offline: ["permission_error", "meetings.server-offline"],
3247
3366
  unreachable: ["network_error", "meetings.server-unreachable"],
3248
3367
  not_signed_in: ["authentication_error", "meetings.server-signed-out"],
3249
3368
  refused: ["permission_error", "meetings.server-refused"],
3369
+ rate_limited: ["rate_limited", "meetings.server-rate-limited"],
3250
3370
  failed: ["provider_error", "meetings.server-failed"]
3251
3371
  };
3252
3372
  var metaOf = /* @__PURE__ */ __name((reason, provider) => {
@@ -3259,6 +3379,7 @@ var WHY = {
3259
3379
  unreachable: /* @__PURE__ */ __name((provider) => `${provider} could not be reached \u2014 the answer is the store's`, "unreachable"),
3260
3380
  not_signed_in: /* @__PURE__ */ __name((provider) => `not signed in to ${provider} \u2014 the answer is the store's`, "not_signed_in"),
3261
3381
  refused: /* @__PURE__ */ __name((provider) => `${provider} refused the request \u2014 the answer is the store's`, "refused"),
3382
+ rate_limited: /* @__PURE__ */ __name((provider) => `${provider} asked to wait before more requests \u2014 the answer is the store's`, "rate_limited"),
3262
3383
  failed: /* @__PURE__ */ __name((provider) => `${provider} could not be read \u2014 the answer is the store's`, "failed"),
3263
3384
  no_upcoming: /* @__PURE__ */ __name((provider) => `${provider} lists no meeting before it starts \u2014 upcoming ones are not in the answer`, "no_upcoming")
3264
3385
  };
@@ -3270,6 +3391,8 @@ var reasonOf = /* @__PURE__ */ __name((error) => {
3270
3391
  return "refused";
3271
3392
  if (code === "network_error")
3272
3393
  return "unreachable";
3394
+ if (code === "rate_limited")
3395
+ return "rate_limited";
3273
3396
  return "failed";
3274
3397
  }, "reasonOf");
3275
3398
  var refusal = /* @__PURE__ */ __name((reason, provider, error) => error ?? new CliError("validation_error", `--backend server: ${WHY[reason](provider).replace(/ — .*$/, "")}; use --backend archive or both`, { reason }), "refusal");
@@ -3324,9 +3447,9 @@ var stepFor = /* @__PURE__ */ __name((backend) => ({
3324
3447
  found: /* @__PURE__ */ new Map(),
3325
3448
  missing: []
3326
3449
  }), "stepFor");
3327
- var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts2, fresh = false) => {
3450
+ var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts, fresh = false) => {
3328
3451
  const stored = await storedByExternalId(store, accountId, found.meeting.occurrence.id);
3329
- const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts2, {
3452
+ const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts, {
3330
3453
  accountId,
3331
3454
  now,
3332
3455
  ...stored ? { kept: stored.meeting } : {}
@@ -3379,14 +3502,17 @@ var askServerForList = /* @__PURE__ */ __name(async (source, store, accountId, q
3379
3502
  for (const call of asked) {
3380
3503
  let cursor = null;
3381
3504
  for (let page = 0; page < MEETING_SERVER_BOUNDS.pages; page++) {
3505
+ access.signal?.throwIfAborted();
3382
3506
  step.report.calls += 1;
3383
3507
  let answer;
3384
3508
  try {
3385
- answer = await source.find(call.window, call.terms, cursor);
3509
+ answer = await source.find(call.window, call.terms, cursor, access.signal);
3386
3510
  } catch (error) {
3511
+ access.signal?.throwIfAborted();
3387
3512
  return skip(reasonOf(error), error);
3388
3513
  }
3389
3514
  for (const found of answer.meetings) {
3515
+ access.signal?.throwIfAborted();
3390
3516
  if (seen.has(found.meeting.occurrence.id))
3391
3517
  continue;
3392
3518
  seen.add(found.meeting.occurrence.id);
@@ -3460,20 +3586,20 @@ var listThrough = /* @__PURE__ */ __name(async (source, store, filter, access) =
3460
3586
  };
3461
3587
  }, "listThrough");
3462
3588
  var storedMeeting = /* @__PURE__ */ __name(async (store, accountId, meeting2) => {
3463
- const text5 = meeting2.trim();
3589
+ const text6 = meeting2.trim();
3464
3590
  const own = /* @__PURE__ */ __name((details) => details?.meeting.accountId === accountId ? details : null, "own");
3465
- if (/^[1-9]\d*$/.test(text5) && Number.isSafeInteger(Number(text5))) {
3466
- const byNumber = own(await store.meeting(Number(text5)));
3591
+ if (/^[1-9]\d*$/.test(text6) && Number.isSafeInteger(Number(text6))) {
3592
+ const byNumber = own(await store.meeting(Number(text6)));
3467
3593
  if (byNumber)
3468
3594
  return byNumber;
3469
3595
  }
3470
- if (text5.startsWith("meeting:")) {
3471
- const reference2 = parseMeetingReference(text5);
3596
+ if (text6.startsWith("meeting:")) {
3597
+ const reference2 = parseMeetingReference(text6);
3472
3598
  if (reference2.accountId !== accountId)
3473
3599
  throw new MeetingError("not_found", "meeting not found");
3474
3600
  return own(await store.meeting(reference2.meetingId));
3475
3601
  }
3476
- return store.meetingByExternalId ? own(await store.meetingByExternalId(accountId, text5)) : null;
3602
+ return store.meetingByExternalId ? own(await store.meetingByExternalId(accountId, text6)) : null;
3477
3603
  }, "storedMeeting");
3478
3604
  var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId, meeting2, access) => {
3479
3605
  if (!meeting2.trim())
@@ -3511,11 +3637,13 @@ var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId,
3511
3637
  return fromStore("unsupported");
3512
3638
  if (access.offline)
3513
3639
  return fromStore("offline");
3640
+ access.signal?.throwIfAborted();
3514
3641
  step.report.calls = 1;
3515
3642
  let full;
3516
3643
  try {
3517
- full = await source.get(providerId);
3644
+ full = await source.get(providerId, access.signal);
3518
3645
  } catch (error) {
3646
+ access.signal?.throwIfAborted();
3519
3647
  return fromStore(reasonOf(error), error);
3520
3648
  }
3521
3649
  if (!full) {
@@ -3528,10 +3656,10 @@ var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId,
3528
3656
  return { details: fresh, foundIn: step.found.get(details.meeting.id) ?? "server", server: step.report };
3529
3657
  }, "meetingShowThrough");
3530
3658
 
3531
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
3659
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
3532
3660
  var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
3533
3661
 
3534
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
3662
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
3535
3663
  var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
3536
3664
  if (!original || typeof original !== "object" || Array.isArray(original))
3537
3665
  throw new CliError("validation_error", "related history request is required");
@@ -3561,7 +3689,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
3561
3689
  return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
3562
3690
  }, "validateMeetingRelatedHistory");
3563
3691
 
3564
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
3692
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
3565
3693
  var text4 = string();
3566
3694
  var identifier = pipe(text4, minLength(1));
3567
3695
  var nullableText = nullable(text4);
@@ -3577,7 +3705,13 @@ var run = strictObject({
3577
3705
  timezone: optional(text4)
3578
3706
  });
3579
3707
  var exported = union([
3580
- strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), filename: text4, content: text4 }),
3708
+ strictObject({
3709
+ meeting_id: identifier,
3710
+ format: picklist(["markdown", "vtt"]),
3711
+ filename: text4,
3712
+ content: text4,
3713
+ untrusted: optional(array(text4))
3714
+ }),
3581
3715
  strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), output: text4 })
3582
3716
  ]);
3583
3717
  var eventChange = strictObject({
@@ -3699,7 +3833,8 @@ var managedChange = strictObject({
3699
3833
  start_time: optional(text4),
3700
3834
  duration_minutes: optional(count6),
3701
3835
  timezone: optional(text4),
3702
- agenda: optional(text4)
3836
+ agenda: optional(text4),
3837
+ settings: optional(record(text4, union([text4, flag])))
3703
3838
  })),
3704
3839
  applied: flag,
3705
3840
  meeting: optional(strictObject({
@@ -3711,7 +3846,8 @@ var managedChange = strictObject({
3711
3846
  timezone: nullableText,
3712
3847
  agenda: nullableText,
3713
3848
  join_url: nullableText
3714
- }))
3849
+ })),
3850
+ untrusted: optional(array(text4))
3715
3851
  });
3716
3852
  var invitation = strictObject({ id: identifier, invitation: text4, untrusted: optional(array(text4)) });
3717
3853
  var MEETING_RESULT_ENTITIES = {
@@ -3725,14 +3861,14 @@ var MEETING_RESULT_ENTITIES = {
3725
3861
  meeting_repair: repair
3726
3862
  };
3727
3863
 
3728
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/review.js
3864
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/review.js
3729
3865
  var REVIEW_LIMIT = { default: 50, most: 200 };
3730
3866
 
3731
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3867
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3732
3868
  var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
3733
3869
  \`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
3734
3870
 
3735
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3871
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3736
3872
  var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3737
3873
  input.signal?.throwIfAborted();
3738
3874
  if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
@@ -3753,10 +3889,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3753
3889
  return { ...input, limit, maxReadBytes };
3754
3890
  }, "validateMeetingSeriesHistory");
3755
3891
 
3756
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3892
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3757
3893
  var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
3758
3894
 
3759
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3895
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3760
3896
  function invalid4(field, response = false) {
3761
3897
  throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
3762
3898
  }
@@ -3772,11 +3908,11 @@ var cursorDetails = /* @__PURE__ */ __name((value) => {
3772
3908
  if (typeof value !== "string" || value.length > 4096 || !/^[A-Za-z0-9_-]+$/.test(value))
3773
3909
  invalid4("cursor");
3774
3910
  try {
3775
- const decoded2 = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
3776
- object2(decoded2, ["version", "selection", "cursor"], "cursor");
3777
- if (decoded2.version !== 1 || typeof decoded2.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded2.selection) || !occurrenceId(decoded2.cursor))
3911
+ const decoded = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
3912
+ object2(decoded, ["version", "selection", "cursor"], "cursor");
3913
+ if (decoded.version !== 1 || typeof decoded.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded.selection) || !occurrenceId(decoded.cursor))
3778
3914
  invalid4("cursor");
3779
- return decoded2;
3915
+ return decoded;
3780
3916
  } catch {
3781
3917
  return invalid4("cursor");
3782
3918
  }
@@ -3785,671 +3921,25 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
3785
3921
  cursorDetails(value);
3786
3922
  }, "validateMeetingSeriesInventoryCursor");
3787
3923
 
3788
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/locator.js
3789
- var SCHEME = "msg:";
3790
- var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
3791
- var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
3792
- var parseLocator = /* @__PURE__ */ __name((reference2) => {
3793
- const trimmed = reference2.trim();
3794
- const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
3795
- const malformed2 = /* @__PURE__ */ __name(() => new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`), "malformed");
3796
- if (parts2.length !== 4 || parts2.some((part) => part === ""))
3797
- throw malformed2();
3798
- const decoded2 = /* @__PURE__ */ __name((part) => {
3799
- try {
3800
- return decodeURIComponent(part);
3801
- } catch {
3802
- throw malformed2();
3803
- }
3804
- }, "decoded");
3805
- const [provider, account, chat, message] = parts2.map(decoded2);
3806
- return { provider, account, chat, message };
3807
- }, "parseLocator");
3808
-
3809
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/references.js
3810
- var SIMPLE_REFERENCES = [
3811
- "note",
3812
- "document",
3813
- "person",
3814
- "organization",
3815
- "project",
3816
- "task",
3817
- "memory",
3818
- "fact",
3819
- "bot",
3820
- "event",
3821
- "invoice",
3822
- "payment",
3823
- "order",
3824
- "deal",
3825
- "lead",
3826
- "pipeline",
3827
- "product",
3828
- "contract",
3829
- "subscription",
3830
- "wallet",
3831
- "transaction",
3832
- "entity"
3833
- ];
3834
- var malformed = /* @__PURE__ */ __name((text5, shape) => new CliError("validation_error", `"${singleLine(text5)}" is not a reference \u2014 expected ${shape}`, {
3835
- reason: "ref.malformed"
3836
- }), "malformed");
3837
- var decoded = /* @__PURE__ */ __name((part, text5, shape) => {
3838
- try {
3839
- return decodeURIComponent(part);
3840
- } catch {
3841
- throw malformed(text5, shape);
3842
- }
3843
- }, "decoded");
3844
- var parts = /* @__PURE__ */ __name((rest, count7, text5, shape) => {
3845
- const split = rest.split("/");
3846
- if (split.length !== count7 || split.some((part) => part === ""))
3847
- throw malformed(text5, shape);
3848
- return split.map((part) => decoded(part, text5, shape));
3849
- }, "parts");
3850
- var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
3851
- var folderPath = /* @__PURE__ */ __name((path) => {
3852
- const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
3853
- return clean === "" ? path.trim() === "" ? "" : null : clean;
3854
- }, "folderPath");
3855
- var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
3856
- var kind2 = /* @__PURE__ */ __name((spec) => spec, "kind");
3857
- var simple = /* @__PURE__ */ __name((prefix) => kind2({
3858
- prefix,
3859
- type: prefix,
3860
- shape: `${prefix}:<id>`,
3861
- parse: /* @__PURE__ */ __name((rest, text5) => {
3862
- if (!rest.trim())
3863
- throw new CliError("validation_error", `"${singleLine(text5)}" names no ${prefix}`, {
3864
- reason: "ref.malformed"
3865
- });
3866
- return { type: prefix, id: rest };
3867
- }, "parse"),
3868
- format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
3869
- }), "simple");
3870
- var REF_KINDS = [
3871
- kind2({
3872
- prefix: "msg",
3873
- type: "message",
3874
- shape: "msg:<provider>/<account>/<chat>/<message>",
3875
- parse: /* @__PURE__ */ __name((_, text5) => {
3876
- try {
3877
- return { type: "message", ...parseLocator(text5) };
3878
- } catch {
3879
- throw malformed(text5, "msg:<provider>/<account>/<chat>/<message>");
3880
- }
3881
- }, "parse"),
3882
- format: formatLocator
3883
- }),
3884
- kind2({
3885
- prefix: "chat",
3886
- type: "chat",
3887
- shape: "chat:<provider>/<account>/<chat>",
3888
- parse: /* @__PURE__ */ __name((rest, text5) => {
3889
- const [provider, account, chat] = parts(rest, 3, text5, "chat:<provider>/<account>/<chat>");
3890
- return { type: "chat", provider, account, chat };
3891
- }, "parse"),
3892
- format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
3893
- }),
3894
- kind2({
3895
- prefix: "contact",
3896
- type: "contact",
3897
- shape: "contact:<provider>/<id>",
3898
- parse: /* @__PURE__ */ __name((rest, text5) => {
3899
- const [provider, id4] = parts(rest, 2, text5, "contact:<provider>/<id>");
3900
- return { type: "contact", provider, id: id4 };
3901
- }, "parse"),
3902
- format: /* @__PURE__ */ __name(({ provider, id: id4 }) => `contact:${encoded(provider, id4)}`, "format")
3903
- }),
3904
- kind2({
3905
- prefix: "folder",
3906
- type: "folder",
3907
- shape: "folder:<id>[/<path>]",
3908
- parse: /* @__PURE__ */ __name((rest, text5) => {
3909
- const slash = rest.indexOf("/");
3910
- const id4 = decoded(slash < 0 ? rest : rest.slice(0, slash), text5, "folder:<id>[/<path>]");
3911
- const path = slash < 0 ? null : folderPath(decoded(rest.slice(slash + 1), text5, "folder:<id>[/<path>]"));
3912
- if (!id4.trim() || path === "")
3913
- throw malformed(text5, "folder:<id>[/<path>]");
3914
- return { type: "folder", id: id4, path };
3915
- }, "parse"),
3916
- format: /* @__PURE__ */ __name(({ id: id4, path }) => path === null ? `folder:${encodeURIComponent(id4)}` : `folder:${encoded(id4, path)}`, "format")
3917
- }),
3918
- kind2({
3919
- prefix: "meeting",
3920
- type: "meeting",
3921
- shape: MEETING_SHAPE,
3922
- parse: /* @__PURE__ */ __name((_, text5) => {
3923
- try {
3924
- return parseMeetingReference(text5);
3925
- } catch {
3926
- throw malformed(text5, MEETING_SHAPE);
3927
- }
3928
- }, "parse"),
3929
- format: formatMeetingReference
3930
- }),
3931
- ...SIMPLE_REFERENCES.map(simple)
3932
- ];
3933
- var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
3934
- var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
3935
- var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
3936
- var distance = /* @__PURE__ */ __name((a, b) => {
3937
- let row = Array.from({ length: b.length + 1 }, (_, at) => at);
3938
- for (const [i, x] of [...a].entries()) {
3939
- const next = [i + 1];
3940
- for (const [j, y] of [...b].entries())
3941
- next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
3942
- row = next;
3943
- }
3944
- return row[b.length];
3945
- }, "distance");
3946
- 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");
3947
- var unknownKind = /* @__PURE__ */ __name((text5, prefix, rest) => {
3948
- const near2 = prefix === "" ? void 0 : nearest(prefix);
3949
- const kinds = offered.map((one) => `${one}:`).join(", ");
3950
- const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
3951
- return new CliError("validation_error", `"${singleLine(text5)}" is no kind of reference${hint}`, {
3952
- reason: "ref.unknown-kind"
3953
- });
3954
- }, "unknownKind");
3955
- var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
3956
- var parseReference = /* @__PURE__ */ __name((text5) => {
3957
- const reference2 = text5.trim();
3958
- const colon = reference2.indexOf(":");
3959
- const prefix = colon < 0 ? "" : reference2.slice(0, colon);
3960
- const rest = reference2.slice(colon + 1);
3961
- const spec = byPrefix.get(prefix);
3962
- if (!spec)
3963
- throw unknownKind(reference2, prefix, rest);
3964
- return spec.parse(rest, reference2);
3965
- }, "parseReference");
3966
- var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
3967
- var looksLikeReference = /* @__PURE__ */ __name((text5) => {
3968
- const match = /^([a-z]+):\S+$/.exec(text5.trim());
3969
- return match !== null && byPrefix.has(match[1]);
3970
- }, "looksLikeReference");
3971
-
3972
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/providers.js
3973
- var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
3974
- var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
3975
- var CRM_OPENS = { deal: "deals show", lead: "leads show", pipeline: "pipelines show" };
3976
- var PROVIDERS = [
3977
- { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
3978
- { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
3979
- { name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
3980
- { name: "max-bot", kind: "messages", aliases: [] },
3981
- { name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
3982
- { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
3983
- { name: "email", kind: "mail", aliases: [] },
3984
- { name: "notes", kind: "notes", aliases: [] },
3985
- { name: "local", kind: "notes", aliases: [] },
3986
- { name: "obsidian", kind: "notes", aliases: [] },
3987
- { name: "added", kind: "notes", aliases: [] },
3988
- { name: "zoom", kind: "meetings", aliases: [] },
3989
- { name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
3990
- { name: "google-drive", kind: "documents", aliases: [] },
3991
- // Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
3992
- { name: "telemost", kind: "meetings", aliases: [] },
3993
- // A phone export's records: its SMS and its calls in the one account the import names.
3994
- { name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true },
3995
- // Any other import: a folder of notes, a CRM's export, a script's records, under `import:<what it is>`.
3996
- { name: "import", kind: "documents", kinds: ["documents", "messages", "events"], aliases: [], imported: true }
3997
- ];
3998
- var LABELS = {
3999
- telegram: "Telegram",
4000
- "telegram-bot": "Telegram bot",
4001
- max: "MAX",
4002
- "max-bot": "MAX bot",
4003
- whatsapp: "WhatsApp",
4004
- "whatsapp-bot": "WhatsApp bot",
4005
- "google-drive": "Google Drive",
4006
- "google-meet": "Google Meet",
4007
- added: "added by hand",
4008
- email: "mail",
4009
- telemost: "Telemost"
4010
- };
4011
- var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
4012
- var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
4013
- var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
4014
- var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
4015
- var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
4016
- var documentAccountProviders = /* @__PURE__ */ __name(() => registry.filter((entry) => entry.kind === "documents" && entry.imported !== true).map(({ name }) => name), "documentAccountProviders");
4017
- var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => typeof provider === "string" && documentAccountProviders().includes(provider), "isDocumentAccountProvider");
4018
- var documentAccountProvidersSql = /* @__PURE__ */ __name(() => documentAccountProviders().map((name) => `'${name}'`).join(", ") || "NULL", "documentAccountProvidersSql");
4019
- var ADDED_PROVIDER = "added";
4020
- var ADDED_ACCOUNT = "owner";
4021
- var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
4022
- var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...documentAccountProviders(), ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
4023
- var INTERNAL_NOTES = "internal";
4024
- var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
4025
- var WORD = /^[a-z0-9][a-z0-9_-]*$/;
4026
- var invalid5 = /* @__PURE__ */ __name((message) => {
4027
- throw new CliError("validation_error", message);
4028
- }, "invalid");
4029
- 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");
4030
- var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
4031
- var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
4032
- var opensOf = /* @__PURE__ */ __name((value, named) => {
4033
- if (typeof value !== "object" || value === null || Array.isArray(value))
4034
- return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
4035
- const known = Object.entries(value).filter(([kind3]) => OPEN_KINDS.has(kind3));
4036
- for (const [kind3, command] of known)
4037
- if (typeof command !== "string" || !COMMAND_WORDS.test(command))
4038
- invalid5(`provider ${named} opens a ${kind3} with command words, not ${JSON.stringify(command)}`);
4039
- return Object.fromEntries(known);
4040
- }, "opensOf");
4041
- var providerEntryOf = /* @__PURE__ */ __name((value) => {
4042
- if (typeof value !== "object" || value === null || Array.isArray(value))
4043
- return invalid5("a provider entry is an object");
4044
- const { name, kind: kind3, kinds, aliases = [], command, opens, imported } = value;
4045
- const named = wordOf(name, "a provider's name");
4046
- const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
4047
- const given = kinds === void 0 ? [kind3] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
4048
- for (const one of given)
4049
- if (!isKindWord(one))
4050
- invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
4051
- const list = [...new Set(given)];
4052
- if (kind3 !== void 0 && kind3 !== list[0])
4053
- invalid5(`provider ${named}'s kind is the first of its kinds`);
4054
- if (!Array.isArray(aliases))
4055
- invalid5(`provider ${named}'s aliases are a list`);
4056
- if (imported !== void 0 && typeof imported !== "boolean")
4057
- invalid5(`provider ${named}'s imported is true or false`);
4058
- return {
4059
- name: named,
4060
- kind: list[0],
4061
- ...list.length > 1 ? { kinds: list } : {},
4062
- ...imported === true ? { imported: true } : {},
4063
- aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
4064
- ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
4065
- ...opens === void 0 ? {} : { opens: opensOf(opens, named) }
4066
- };
4067
- }, "providerEntryOf");
4068
- var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
4069
- var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
4070
- var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
4071
- .../* @__PURE__ */ new Set([...known, ...entry])
4072
- ], "unitedKinds");
4073
- var wordsOf2 = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
4074
- var joined = /* @__PURE__ */ __name((known, entry) => {
4075
- const same = known.find(({ name }) => name === entry.name);
4076
- const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
4077
- if (same && same.kind !== entry.kind)
4078
- invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
4079
- if (same && entry.imported === true && same.imported !== true)
4080
- invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
4081
- const merged = same ? {
4082
- ...same,
4083
- ...kinds.length > 1 ? { kinds } : {},
4084
- aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
4085
- ...entry.command ? { command: entry.command } : {},
4086
- ...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
4087
- } : entry;
4088
- const others = known.filter((one) => one !== same);
4089
- for (const word of wordsOf2(merged)) {
4090
- const owner = others.find((one) => wordsOf2(one).includes(word));
4091
- if (owner)
4092
- invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
4093
- }
4094
- return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
4095
- }, "joined");
4096
- var registry = PROVIDERS;
4097
- var providers = /* @__PURE__ */ __name(() => registry, "providers");
4098
- var useProviders = /* @__PURE__ */ __name((entries) => {
4099
- registry = entries.map(providerEntryOf).reduce(joined, PROVIDERS);
4100
- }, "useProviders");
4101
- var useStoredProviders = /* @__PURE__ */ __name((entries) => {
4102
- const left = [];
4103
- registry = entries.reduce((known, entry) => {
4104
- try {
4105
- return joined(known, providerEntryOf(entry));
4106
- } catch (error) {
4107
- if (!(error instanceof CliError))
4108
- throw error;
4109
- left.push(entry);
4110
- return known;
4111
- }
4112
- }, PROVIDERS);
4113
- return left;
4114
- }, "useStoredProviders");
4115
- var addProvider = /* @__PURE__ */ __name((entry) => {
4116
- registry = joined(registry, providerEntryOf(entry));
4117
- }, "addProvider");
4118
- var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
4119
- var providerNamed = /* @__PURE__ */ __name((word) => {
4120
- const wanted = word.toLowerCase();
4121
- return registry.find((entry) => wordsOf2(entry).includes(wanted));
4122
- }, "providerNamed");
4123
- var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
4124
- var kindsIn = /* @__PURE__ */ __name((provider) => {
4125
- if (isFolderProvider(provider))
4126
- return ["notes"];
4127
- const entry = registry.find(({ name }) => name === provider);
4128
- if (!entry)
4129
- return [];
4130
- return entry.imported ? unitedKinds(kindsOfEntry(entry), ["documents"]) : kindsOfEntry(entry);
4131
- }, "kindsIn");
4132
- var importedOf = /* @__PURE__ */ __name((entry, held) => {
4133
- const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
4134
- if (builtIn) {
4135
- if (entry.imported === true && builtIn.imported !== true)
4136
- invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
4137
- return builtIn.imported === true;
4138
- }
4139
- if (held === void 0)
4140
- return entry.imported === true;
4141
- if (entry.imported === true && held.imported !== true)
4142
- invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
4143
- return held.imported === true;
4144
- }, "importedOf");
4145
- var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
4146
- var holdsKind = /* @__PURE__ */ __name((provider, kind3) => kindsIn(provider).includes(kind3), "holdsKind");
4147
- var holdsKindOf = /* @__PURE__ */ __name((provider, kind3) => kindIn(provider) === void 0 ? kind3 === "messages" : holdsKind(provider, kind3), "holdsKindOf");
4148
- var kindOf2 = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
4149
-
4150
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/money.js
4151
- var CURRENCY_SCALES = {
4152
- AED: 2,
4153
- AMD: 2,
4154
- AUD: 2,
4155
- BHD: 3,
4156
- BYN: 2,
4157
- CAD: 2,
4158
- CHF: 2,
4159
- CLP: 0,
4160
- CNY: 2,
4161
- CZK: 2,
4162
- DKK: 2,
4163
- EUR: 2,
4164
- GBP: 2,
4165
- GEL: 2,
4166
- HUF: 2,
4167
- ILS: 2,
4168
- INR: 2,
4169
- ISK: 0,
4170
- JPY: 0,
4171
- KGS: 2,
4172
- KRW: 0,
4173
- KWD: 3,
4174
- KZT: 2,
4175
- NOK: 2,
4176
- PLN: 2,
4177
- RSD: 2,
4178
- RUB: 2,
4179
- SEK: 2,
4180
- THB: 2,
4181
- TRY: 2,
4182
- UAH: 2,
4183
- USD: 2,
4184
- UZS: 2,
4185
- VND: 0
4186
- };
4187
- var refuse = /* @__PURE__ */ __name((message, reason) => {
4188
- throw new CliError("validation_error", message, { reason });
4189
- }, "refuse");
4190
- var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
4191
- var parseDecimal = /* @__PURE__ */ __name((text5, scale) => {
4192
- const match = DECIMAL.exec(text5.trim());
4193
- if (!match || (match[2] ?? "").length > scale)
4194
- return void 0;
4195
- return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
4196
- }, "parseDecimal");
4197
- var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
4198
- const value = BigInt(units);
4199
- if (value < 0n)
4200
- return `-${formatDecimal(-value, scale)}`;
4201
- const digits = value.toString().padStart(scale + 1, "0");
4202
- return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
4203
- }, "formatDecimal");
4204
- var groupDigits = /* @__PURE__ */ __name((decimal) => {
4205
- const [whole = "0", fraction] = decimal.split(".");
4206
- const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
4207
- return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
4208
- }, "groupDigits");
4209
- var currencyOf = /* @__PURE__ */ __name((text5) => {
4210
- const code = typeof text5 === "string" ? text5.trim().toUpperCase() : "";
4211
- if (CURRENCY_SCALES[code] === void 0)
4212
- return refuse(`${typeof text5 === "string" && text5.trim() ? text5.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
4213
- return code;
4214
- }, "currencyOf");
4215
- var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
4216
- var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
4217
- const scale = scaleOf(currency);
4218
- const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
4219
- if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
4220
- 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");
4221
- return Number(units);
4222
- }, "minorUnits");
4223
- var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
4224
- if (typeof amount !== "string" || !amount.trim().startsWith("-"))
4225
- return minorUnits(amount, currency, what);
4226
- const units = minorUnits(amount.trim().slice(1), currency, what);
4227
- return units === 0 ? 0 : -units;
4228
- }, "signedMinorUnits");
4229
- var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
4230
- amount: formatDecimal(units, scaleOf(currency)),
4231
- currency
4232
- }), "moneyOf");
4233
- var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
4234
- var QUANTITY_SCALE = 3;
4235
- var quantityOf = /* @__PURE__ */ __name((text5) => {
4236
- const thousandths = typeof text5 === "string" ? parseDecimal(text5, QUANTITY_SCALE) : void 0;
4237
- if (thousandths === void 0 || thousandths === 0n)
4238
- return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
4239
- const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
4240
- return { text: plain, thousandths };
4241
- }, "quantityOf");
4242
- var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
4243
-
4244
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/deals.js
4245
- var DEAL_KINDS = ["deal", "lead"];
4246
- var DEAL_STATUSES = ["open", "won", "lost"];
4247
- var STAGE_OUTCOMES = DEAL_STATUSES;
4248
- var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
4249
- var dealLine = /* @__PURE__ */ __name((deal) => {
4250
- const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
4251
- return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
4252
- }, "dealLine");
4253
-
4254
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/finance.js
4255
- var INVOICE_DIRECTIONS = ["receivable", "payable"];
4256
- var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
4257
- var MONEY_DIRECTIONS = ["in", "out"];
4258
- var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
4259
- var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
4260
- if (current === "draft" || current === "void")
4261
- return current;
4262
- if (paid <= 0)
4263
- return "issued";
4264
- return paid < total ? "partly_paid" : "paid";
4265
- }, "settledStatus");
4266
- var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
4267
- var notes = /* @__PURE__ */ __name((...words2) => {
4268
- const kept = words2.filter((word) => word !== null);
4269
- return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
4270
- }, "notes");
4271
- var invoiceLine = /* @__PURE__ */ __name((invoice) => {
4272
- const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
4273
- const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
4274
- return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
4275
- }, "invoiceLine");
4276
- var paymentLine = /* @__PURE__ */ __name((payment) => {
4277
- const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
4278
- return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
4279
- }, "paymentLine");
4280
- var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
4281
- var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
4282
-
4283
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/orders.js
4284
- var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
4285
- var ORDER_PURPOSES = ["personal", "business", "client", "other"];
4286
- var orderLine = /* @__PURE__ */ __name((order) => {
4287
- const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
4288
- const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
4289
- const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
4290
- return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
4291
- }, "orderLine");
4292
- var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
4293
-
4294
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/relations.js
4295
- var ORGANIZATION_ROLES = [
4296
- "employee",
4297
- "contractor",
4298
- "founder",
4299
- "owner",
4300
- "manager",
4301
- "adviser",
4302
- "contact"
4303
- ];
4304
- var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
4305
- var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
4306
- var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
4307
- var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
4308
- var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
4309
- var checkEngagement = /* @__PURE__ */ __name((kind3, from, to, level) => {
4310
- if (kind3 !== "member-of" || from !== "person" || to !== "project")
4311
- throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
4312
- reason: "relationship.engagement-ends"
4313
- });
4314
- if (!isEngagement(level))
4315
- throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
4316
- reason: "relationship.engagement-unknown"
4317
- });
4318
- return level;
4319
- }, "checkEngagement");
4320
- var ENGAGEMENT_ORDER = { high: 0, medium: 1, unknown: 2, low: 3, none: 4 };
4321
- var engagementRank = /* @__PURE__ */ __name((level) => ENGAGEMENT_ORDER[level ?? "unknown"], "engagementRank");
4322
- var byEngagement = /* @__PURE__ */ __name((items) => items.map((item, index) => ({ item, index })).sort((a, b) => engagementRank(a.item.engagement) - engagementRank(b.item.engagement) || a.index - b.index).map(({ item }) => item), "byEngagement");
4323
- var RELATIONS = {
4324
- "member-of": {
4325
- from: ["person", "organization", "project", "chat", "email_thread"],
4326
- to: ["organization", "project"],
4327
- roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
4328
- },
4329
- "reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
4330
- "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
4331
- "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
4332
- "related-to": {
4333
- from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
4334
- to: ["person", "organization", "project", "task"],
4335
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
4336
- }
4337
- };
4338
- var RELATION_KINDS = Object.keys(RELATIONS);
4339
- var specOf = /* @__PURE__ */ __name((kind3) => Object.hasOwn(RELATIONS, kind3) ? RELATIONS[kind3] : void 0, "specOf");
4340
- var isRelationKind = /* @__PURE__ */ __name((kind3) => specOf(kind3) !== void 0, "isRelationKind");
4341
- var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
4342
- var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
4343
- var checkEnds = /* @__PURE__ */ __name((kind3, from, to) => {
4344
- const spec = specOf(kind3);
4345
- if (!spec)
4346
- throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
4347
- if (memberOnly(from) && (kind3 !== "member-of" || to !== "project"))
4348
- throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
4349
- if (partyOnly(from, to))
4350
- throw new CliError("validation_error", "a contract is related only to a person or an organization");
4351
- if (!spec.from.includes(from) || !spec.to.includes(to))
4352
- throw new CliError("validation_error", `${kind3} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
4353
- return spec;
4354
- }, "checkEnds");
4355
- var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
4356
- var rolesOf = /* @__PURE__ */ __name((kind3, from, to) => {
4357
- const spec = specOf(kind3);
4358
- if (kind3 === "member-of" && from !== "person")
4359
- return void 0;
4360
- return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
4361
- }, "rolesOf");
4362
- var ROLE_LISTS = {
4363
- organization: ORGANIZATION_ROLES,
4364
- project: PROJECT_ROLES,
4365
- deal: DEAL_ROLES,
4366
- contract: CONTRACT_ROLES,
4367
- related: RELATED_ROLES
4368
- };
4369
- var roleListOf = /* @__PURE__ */ __name((kind3, from, to) => {
4370
- if (kind3 === "related-to" && isParty(from) && isParty(to))
4371
- return "related";
4372
- const roles = rolesOf(kind3, from, to);
4373
- return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
4374
- }, "roleListOf");
4375
- var checkRole = /* @__PURE__ */ __name((kind3, from, to, role, extra = []) => {
4376
- const roles = rolesOf(kind3, from, to)?.concat(extra);
4377
- if (roles && !roles.includes(role))
4378
- throw new CliError("validation_error", `a ${from}'s role on ${kind3} ${to} is one of ${roles.join(", ")}`, {
4379
- reason: "relationship.role-unknown"
4380
- });
4381
- return role;
4382
- }, "checkRole");
4383
- var isSymmetric = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric === true, "isSymmetric");
4384
- var inverseOf = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric ? kind3 : specOf(kind3)?.inverse ?? null, "inverseOf");
4385
- var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
4386
- var standingOf = /* @__PURE__ */ __name((link, now) => {
4387
- if (link.endsAt != null && link.endsAt <= now)
4388
- return "ended";
4389
- if (link.confirmed)
4390
- return "confirmed";
4391
- if (link.deletedAt != null)
4392
- return "ended";
4393
- return link.accountId != null ? "reported" : "proposed";
4394
- }, "standingOf");
4395
- var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
4396
- var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
4397
- var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
4398
- 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");
4399
- 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");
4400
-
4401
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/crm.js
4402
- var CRM_KINDS = ["organization", "person", "deal", "lead"];
4403
- var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
4404
- var isCrmUserId = /* @__PURE__ */ __name((id4) => /^\d{1,20}$/.test(id4), "isCrmUserId");
4405
- var normalCrmUserId = /* @__PURE__ */ __name((id4) => {
4406
- const text5 = id4.trim();
4407
- return /^\d+$/.test(text5) ? text5.replace(/^0+(?=\d)/, "") : text5;
4408
- }, "normalCrmUserId");
4409
- var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
4410
-
4411
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/tags.js
4412
- var TAG_TYPES = ["chat", "contact", "message", "task"];
4413
- var TAG = /^[a-z0-9-]{1,32}$/;
4414
- var tagOf = /* @__PURE__ */ __name((value) => {
4415
- const tag = value.trim().toLowerCase();
4416
- return TAG.test(tag) ? tag : void 0;
4417
- }, "tagOf");
4418
- var normalizeTag = /* @__PURE__ */ __name((value) => {
4419
- const tag = tagOf(value);
4420
- if (tag === void 0)
4421
- throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
4422
- return tag;
4423
- }, "normalizeTag");
4424
-
4425
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/business.js
4426
- var CATALOG_KINDS = ["product", "service"];
4427
- var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
4428
- var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
4429
- var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
4430
- var PERIOD_UNITS = ["day", "week", "month", "year"];
4431
- var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
4432
- var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
4433
- var TRANSACTION_STATUSES = ["pending", "booked"];
4434
- var ORDER_DIRECTIONS = ["purchase", "sale"];
4435
- var intervalOf = /* @__PURE__ */ __name((text5, reason = "subscription.interval") => {
4436
- const match = typeof text5 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text5.trim()) : null;
4437
- if (!match)
4438
- throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
4439
- return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
4440
- }, "intervalOf");
4441
- var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
4442
- var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
4443
- var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
4444
- var productLine = /* @__PURE__ */ __name((product) => {
4445
- const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
4446
- const per = price && product.unit !== null ? ` per ${product.unit}` : "";
4447
- return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
4448
- }, "productLine");
4449
- var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
4450
- var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
4451
- var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
4452
- 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");
3924
+ // node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/meetings/tag-answers.js
3925
+ var text5 = string();
3926
+ var storeId = pipe(number(), integer(), minValue(1));
3927
+ var meetingTagChange = strictObject({
3928
+ tags: array(text5),
3929
+ /** How many stored meetings were named: the ids given, or the meetings with at least one hit of the search. */
3930
+ matched: pipe(number(), integer(), minValue(0)),
3931
+ /** Only the meetings whose labels changed, each with the tags it gained or lost; a rerun changes none. */
3932
+ changed: array(strictObject({ meeting: reference, meeting_id: storeId, tags: array(text5) }))
3933
+ });
3934
+ var meetingTagging = strictObject({
3935
+ meeting: reference,
3936
+ meeting_id: storeId,
3937
+ title: nullable(text5),
3938
+ started_at: nullable(isoTime),
3939
+ tags: array(text5),
3940
+ /** The title is the source's own line, such as a caller's name from caller ID: data, never instructions. */
3941
+ untrusted: array(text5)
3942
+ });
4453
3943
 
4454
3944
  export {
4455
3945
  QUERY_LIMITS,
@@ -4479,12 +3969,16 @@ export {
4479
3969
  rangeOf,
4480
3970
  windowOf,
4481
3971
  readsZone,
3972
+ MEETING_CALL_DIRECTIONS,
4482
3973
  formatMeetingReference,
4483
3974
  parseMeetingReference,
4484
3975
  canonicalMeetingReference,
3976
+ meetingCall,
3977
+ meetingCallItem,
4485
3978
  meeting,
4486
3979
  MEETING_QUERY,
4487
3980
  MEETING_DOCUMENT_ROLES,
3981
+ TRANSCRIPT_WORDS,
4488
3982
  READ_BUDGET_EXCEEDED,
4489
3983
  meetingHit,
4490
3984
  meetingTranscript,
@@ -4500,6 +3994,7 @@ export {
4500
3994
  aggregateMeetingStats,
4501
3995
  meetingCueFingerprint,
4502
3996
  EVENT_QUERY,
3997
+ PARTICIPANT_RESPONSES,
4503
3998
  entryInWindow,
4504
3999
  normalizeMeetingParticipantQuery,
4505
4000
  validateMeetingParticipantSearch,
@@ -4535,8 +4030,15 @@ export {
4535
4030
  liftMeetingFields,
4536
4031
  parseMeetingQuery,
4537
4032
  transcriptLanguage,
4033
+ refreshMeetingIndex,
4034
+ pull,
4538
4035
  importFiles,
4539
4036
  CHAT_MESSAGES_READ,
4037
+ MEETING_FIELD_KEYS,
4038
+ MEETING_FIELDS2 as MEETING_FIELDS,
4039
+ meetingFieldFlag,
4040
+ SNAKE_CASE2 as SNAKE_CASE,
4041
+ markedPassage,
4540
4042
  validateMeetingPassage,
4541
4043
  validateMeetingPreparationContext,
4542
4044
  meetingProjectEvidence,
@@ -4545,7 +4047,6 @@ export {
4545
4047
  MEETING_PROJECT_EVIDENCE_QUERY,
4546
4048
  prepareMeetingProjectEvidence,
4547
4049
  readMeetingProjectEvidence,
4548
- pull,
4549
4050
  meetingReview,
4550
4051
  meetingLink,
4551
4052
  meetingSpeaker,
@@ -4564,125 +4065,6 @@ export {
4564
4065
  SAVE_HELP,
4565
4066
  validateMeetingSeriesHistory,
4566
4067
  validateMeetingSeriesInventoryCursor,
4567
- formatLocator,
4568
- isLocator,
4569
- parseLocator,
4570
- SIMPLE_REFERENCES,
4571
- REF_KINDS,
4572
- formatReference,
4573
- parseReference,
4574
- canonicalReference,
4575
- looksLikeReference,
4576
- KINDS,
4577
- CRM_OPENS,
4578
- PROVIDERS,
4579
- providerLabel,
4580
- FOLDER_PROVIDERS,
4581
- isFolderProvider,
4582
- folderProviderSql,
4583
- folderProviderOf,
4584
- documentAccountProviders,
4585
- isDocumentAccountProvider,
4586
- documentAccountProvidersSql,
4587
- ADDED_PROVIDER,
4588
- ADDED_ACCOUNT,
4589
- notAdded,
4590
- filesAccountSql,
4591
- INTERNAL_NOTES,
4592
- UNKNOWN_PROVIDER,
4593
- providerEntryOf,
4594
- kindsOfEntry,
4595
- unitedKinds,
4596
- providers,
4597
- useProviders,
4598
- useStoredProviders,
4599
- addProvider,
4600
- isKind,
4601
- providerNamed,
4602
- kindIn,
4603
- kindsIn,
4604
- importedOf,
4605
- isImportedProvider,
4606
- holdsKind,
4607
- holdsKindOf,
4608
- kindOf2 as kindOf,
4609
- CURRENCY_SCALES,
4610
- parseDecimal,
4611
- formatDecimal,
4612
- currencyOf,
4613
- scaleOf,
4614
- minorUnits,
4615
- signedMinorUnits,
4616
- moneyOf,
4617
- moneyLabel,
4618
- quantityOf,
4619
- lineUnits,
4620
- DEAL_KINDS,
4621
- DEAL_STATUSES,
4622
- STAGE_OUTCOMES,
4623
- DEAL_ROLES,
4624
- dealLine,
4625
- INVOICE_DIRECTIONS,
4626
- INVOICE_STATUSES,
4627
- MONEY_DIRECTIONS,
4628
- FINANCE_REVIEWS,
4629
- settledStatus,
4630
- invoiceLine,
4631
- paymentLine,
4632
- invoiceTitle,
4633
- paymentEntryTitle,
4634
- ORDER_STATUSES,
4635
- ORDER_PURPOSES,
4636
- orderLine,
4637
- orderTitle,
4638
- ORGANIZATION_ROLES,
4639
- PROJECT_ROLES,
4640
- CONTRACT_ROLES,
4641
- RELATED_ROLES,
4642
- ENGAGEMENT_LEVELS,
4643
- isEngagement,
4644
- checkEngagement,
4645
- engagementRank,
4646
- byEngagement,
4647
- RELATIONS,
4648
- RELATION_KINDS,
4649
- isRelationKind,
4650
- checkEnds,
4651
- rolesOf,
4652
- ROLE_LISTS,
4653
- roleListOf,
4654
- checkRole,
4655
- isSymmetric,
4656
- inverseOf,
4657
- STANDINGS,
4658
- standingOf,
4659
- isUsable,
4660
- usableLink,
4661
- KEYED,
4662
- notOverriddenSql,
4663
- usableLinkSql,
4664
- CRM_KINDS,
4665
- CRM_ACTIVITY_KINDS,
4666
- isCrmUserId,
4667
- normalCrmUserId,
4668
- isItemKind,
4669
- TAG_TYPES,
4670
- tagOf,
4671
- normalizeTag,
4672
- CATALOG_KINDS,
4673
- BUSINESS_KINDS,
4674
- CONTRACT_KINDS,
4675
- CONTRACT_STATUSES,
4676
- PERIOD_UNITS,
4677
- SUBSCRIPTION_STATUSES,
4678
- WALLET_KINDS,
4679
- TRANSACTION_STATUSES,
4680
- ORDER_DIRECTIONS,
4681
- intervalOf,
4682
- intervalText,
4683
- productLine,
4684
- contractLine,
4685
- subscriptionLine,
4686
- walletLine,
4687
- transactionLine
4068
+ meetingTagChange,
4069
+ meetingTagging
4688
4070
  };