@wirecat/mail-cli 0.23.1 → 0.24.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 (114) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-FJHJCGRU.js → all-profiles-VS7P6DJY.js} +11 -11
  4. package/dist/bundle/{anthropic-AFL7NKVZ.js → anthropic-C5JXKGBS.js} +16 -7
  5. package/dist/bundle/{app-server-WKCBJMHI.js → app-server-HU3LVU42.js} +51 -50
  6. package/dist/bundle/{bun-HQATAQJQ.js → bun-QLFX47WZ.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-4ECAV7OU.js → bun-sqlite-W4PGAKVY.js} +5 -5
  8. package/dist/bundle/{chunk-3UFD76IR.js → chunk-3FD3IATT.js} +6 -6
  9. package/dist/bundle/{chunk-R554W7ZO.js → chunk-3KSK5BBB.js} +2 -2
  10. package/dist/bundle/{chunk-AGNAT7CM.js → chunk-4QNHAM3J.js} +2 -2
  11. package/dist/bundle/{chunk-7SWWVDEZ.js → chunk-4W4EVVL4.js} +61 -21
  12. package/dist/bundle/{chunk-NMGF3UOZ.js → chunk-5NLHDK7P.js} +50 -46
  13. package/dist/bundle/{chunk-VFKX5UMJ.js → chunk-5X3GU5LI.js} +6 -6
  14. package/dist/bundle/{chunk-NKBAZ4VC.js → chunk-64ZG5ERD.js} +2 -2
  15. package/dist/bundle/{chunk-WN4HP7IZ.js → chunk-6PWCQKMD.js} +12 -12
  16. package/dist/bundle/{chunk-V3TDQUXD.js → chunk-6VV7J2TN.js} +36 -57
  17. package/dist/bundle/{chunk-SNTLN2QT.js → chunk-A6J4MPTI.js} +3 -1
  18. package/dist/bundle/{chunk-CUOCDJFI.js → chunk-AUTX2MLF.js} +11 -9
  19. package/dist/bundle/{chunk-5UKBUI4I.js → chunk-B72343TK.js} +2 -2
  20. package/dist/bundle/{chunk-4IWJARFA.js → chunk-BFQQV22T.js} +1 -1
  21. package/dist/bundle/chunk-C3NYJW6B.js +1542 -0
  22. package/dist/bundle/{chunk-OJCUSHZG.js → chunk-C5BMCLCQ.js} +4 -4
  23. package/dist/bundle/{chunk-OU5CWCG2.js → chunk-DW3F6DUW.js} +1 -1
  24. package/dist/bundle/chunk-EKGRNFYQ.js +18 -0
  25. package/dist/bundle/{chunk-B6QMMRIM.js → chunk-FKWUUCX2.js} +1340 -1542
  26. package/dist/bundle/{chunk-LLYVBO3R.js → chunk-FNLUKODV.js} +19 -19
  27. package/dist/bundle/{chunk-KKGX7JMX.js → chunk-H5FJTHVA.js} +2 -2
  28. package/dist/bundle/{chunk-3QVGB2CI.js → chunk-HBZAJINU.js} +4 -4
  29. package/dist/bundle/{chunk-V7CFZ773.js → chunk-IRUN4XOV.js} +2 -2
  30. package/dist/bundle/{chunk-VAMCRP47.js → chunk-JMLIKXFO.js} +2 -2
  31. package/dist/bundle/{chunk-QR7JZM3D.js → chunk-JOQGJUFT.js} +1 -1
  32. package/dist/bundle/{chunk-CBWA2T3N.js → chunk-JWMLMAHP.js} +4 -4
  33. package/dist/bundle/{chunk-S5OTP7XS.js → chunk-KGOVFEWZ.js} +3 -3
  34. package/dist/bundle/{chunk-PMIKRELC.js → chunk-KV4VTKF3.js} +3 -3
  35. package/dist/bundle/chunk-LVGX7VTD.js +138 -0
  36. package/dist/bundle/{chunk-3DQYO7FB.js → chunk-MCPOZNWG.js} +1 -1
  37. package/dist/bundle/{chunk-E7ZVKQHG.js → chunk-MTO6YVMN.js} +3 -3
  38. package/dist/bundle/{chunk-CCYHBNRL.js → chunk-NCRSE647.js} +286 -48
  39. package/dist/bundle/{chunk-GJNFNC76.js → chunk-NSIN5IM4.js} +8 -8
  40. package/dist/bundle/{chunk-ZXIPJF3Y.js → chunk-NWKKPDZV.js} +2 -2
  41. package/dist/bundle/chunk-O373QEAJ.js +1243 -0
  42. package/dist/bundle/{chunk-VYIIX6VN.js → chunk-OQW6GHUA.js} +1 -1
  43. package/dist/bundle/{chunk-2HXHAFRP.js → chunk-PRQ2U7HF.js} +2 -2
  44. package/dist/bundle/{chunk-MBKNL5TX.js → chunk-PT6MF2VU.js} +87 -77
  45. package/dist/bundle/{chunk-SBGXKM4U.js → chunk-Q4OKEN3B.js} +7 -7
  46. package/dist/bundle/{chunk-ROKTS7WM.js → chunk-Q6K2XUGU.js} +1 -1
  47. package/dist/bundle/{chunk-VYHIX3OP.js → chunk-QI3PXUOJ.js} +43 -595
  48. package/dist/bundle/{chunk-UMXVQIGD.js → chunk-QVMOEB3I.js} +377 -12
  49. package/dist/bundle/{chunk-HOKGIYUO.js → chunk-RLQZFZLK.js} +62 -7
  50. package/dist/bundle/{chunk-3OZKDC6Y.js → chunk-RN7OI5KL.js} +8 -8
  51. package/dist/bundle/{chunk-BVJQBAGL.js → chunk-RNZKQMFY.js} +14 -14
  52. package/dist/bundle/{chunk-4YJJQNNJ.js → chunk-RUASZW3M.js} +5 -5
  53. package/dist/bundle/{chunk-UHC5I3JV.js → chunk-RX5CJ55S.js} +1 -1
  54. package/dist/bundle/{chunk-SR3ADLGX.js → chunk-SWKQ6IAR.js} +3 -3
  55. package/dist/bundle/{chunk-QUKD5SO2.js → chunk-TI7ZIPA2.js} +4 -4
  56. package/dist/bundle/{chunk-LQDMUMA2.js → chunk-TLEBSMC7.js} +1997 -768
  57. package/dist/bundle/{chunk-MUDHCYN4.js → chunk-U6MMQNNK.js} +6 -6
  58. package/dist/bundle/{chunk-CYQVWITQ.js → chunk-VNKWSCN7.js} +99 -42
  59. package/dist/bundle/{chunk-DALBYUPC.js → chunk-VUBZFMGP.js} +2 -2
  60. package/dist/bundle/{chunk-34743C4C.js → chunk-VVL4MKYH.js} +1 -1
  61. package/dist/bundle/{chunk-7YRKUEYE.js → chunk-WOX7FZJP.js} +667 -222
  62. package/dist/bundle/{chunk-R5MYOLQP.js → chunk-X47BL4M5.js} +13 -13
  63. package/dist/bundle/{chunk-GOMJNH56.js → chunk-X7J3TTDO.js} +8 -8
  64. package/dist/bundle/{chunk-NOA6E6MM.js → chunk-XBEO472U.js} +29202 -16302
  65. package/dist/bundle/{chunk-4IFX4HV2.js → chunk-YA45XV6G.js} +4 -4
  66. package/dist/bundle/{chunk-M7RGG3UU.js → chunk-YBQ5AYLZ.js} +3 -3
  67. package/dist/bundle/{chunk-QV3M2MHG.js → chunk-YI544LHI.js} +13 -136
  68. package/dist/bundle/chunk-ZO4MQWIK.js +188 -0
  69. package/dist/bundle/{chunk-76RTQYJQ.js → chunk-ZR2BDNGG.js} +1 -1
  70. package/dist/bundle/command-contract-ERYYPAD2.js +35 -0
  71. package/dist/bundle/command-server-entry-5E3PPDE5.js +164 -0
  72. package/dist/bundle/{decode-QXKTMOTH.js → decode-AVWV7SVZ.js} +5 -5
  73. package/dist/bundle/{dispatch-G4CYFWQ2.js → dispatch-BXPHSNK5.js} +10 -10
  74. package/dist/bundle/{dist-5FX36DAW.js → dist-PIOOKBWT.js} +70 -44
  75. package/dist/bundle/{echarts-HHUM43TU.js → echarts-7K6YQV52.js} +2 -2
  76. package/dist/bundle/{embed-SRZSDZVI.js → embed-4NT76GJK.js} +6 -6
  77. package/dist/bundle/{embedder-WZIZCWLX.js → embedder-ITQFF7EN.js} +9 -9
  78. package/dist/bundle/{failure-FFPK2WYB.js → failure-3Q65JOPD.js} +2 -2
  79. package/dist/bundle/{first-run-6DVWZ3JQ.js → first-run-PM74YU4X.js} +11 -11
  80. package/dist/bundle/first-screen-WBVGVSMY.js +33 -0
  81. package/dist/bundle/{instructions-UWONE6UT.js → instructions-JDSITYHV.js} +1 -1
  82. package/dist/bundle/mail.js +37 -13
  83. package/dist/bundle/{mcp-CFVG2OUS.js → mcp-7KQUJNFN.js} +2 -2
  84. package/dist/bundle/{node-HLAOYJDB.js → node-D6YIJOJI.js} +2 -2
  85. package/dist/bundle/{node-sqlite-RO66I7W6.js → node-sqlite-PJOHHB4X.js} +6 -6
  86. package/dist/bundle/{oauth-VNLB2TET.js → oauth-BOWJ3IBT.js} +7 -7
  87. package/dist/bundle/{open-QQSG343L.js → open-FIAKKZMW.js} +5 -5
  88. package/dist/bundle/{openai-JTFC7OGF.js → openai-QL54VVLC.js} +16 -37
  89. package/dist/bundle/{process-3CZAXR6P.js → process-AYHK7WRC.js} +1 -1
  90. package/dist/bundle/{program-XTOS4RAM.js → program-6FKWOTBK.js} +2267 -1351
  91. package/dist/bundle/{prompt-HGQ6GPYL.js → prompt-XJZCBELC.js} +5 -5
  92. package/dist/bundle/{recognize-2SHMNEIZ.js → recognize-OQKWAHBY.js} +4 -4
  93. package/dist/bundle/{remote-GBQC3433.js → remote-NLVUZ5WK.js} +7 -7
  94. package/dist/bundle/{rerank-FQHQXFNR.js → rerank-NRPZDTJ7.js} +7 -7
  95. package/dist/bundle/{serve-THU67QUZ.js → serve-O4YUI7F6.js} +9 -9
  96. package/dist/bundle/server-6OT5ZEWL.js +66 -0
  97. package/dist/bundle/{server-LOT3CLYX.js → server-WAL3M4OO.js} +40 -40
  98. package/dist/bundle/{sqlite-runtime-NOOUMBC4.js → sqlite-runtime-5YHGI4D4.js} +6 -6
  99. package/dist/bundle/{state-KSKZCV2U.js → state-WYYOJ7KK.js} +6 -6
  100. package/dist/bundle/{store-BAKSHTKF.js → store-6BJO3F2J.js} +16 -16
  101. package/dist/bundle/{store-OHNZOQ7U.js → store-X72GOJHD.js} +44 -20
  102. package/dist/bundle/store-maintenance-command-ASS7RBYC.js +54 -0
  103. package/dist/config.d.ts +4 -0
  104. package/dist/config.d.ts.map +1 -1
  105. package/dist/version.d.ts +1 -1
  106. package/dist/version.js +1 -1
  107. package/package.json +3 -3
  108. package/dist/bundle/chunk-EXPR6QAX.js +0 -394
  109. package/dist/bundle/chunk-FWFNUJQD.js +0 -12172
  110. package/dist/bundle/command-contract-IIHBNF7J.js +0 -35
  111. package/dist/bundle/first-screen-SRZ7NYHZ.js +0 -33
  112. package/dist/bundle/server-VKMUX7ZT.js +0 -65
  113. package/dist/bundle/store-maintenance-command-ROQHJVEA.js +0 -54
  114. /package/dist/bundle/{chunk-QZLK2ISN.js → chunk-YVNHQFLC.js} +0 -0
@@ -30,18 +30,18 @@ import {
30
30
  string,
31
31
  union,
32
32
  variant
33
- } from "./chunk-GOMJNH56.js";
33
+ } from "./chunk-X7J3TTDO.js";
34
34
  import {
35
35
  CliError,
36
36
  isCliError,
37
37
  singleLine,
38
38
  visibleControls
39
- } from "./chunk-DALBYUPC.js";
39
+ } from "./chunk-VUBZFMGP.js";
40
40
  import {
41
41
  __name
42
42
  } from "./chunk-ZVVMGPBJ.js";
43
43
 
44
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/reference.js
44
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/reference.js
45
45
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
46
46
  var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
47
47
  if (!Number.isSafeInteger(value) || value < minimum)
@@ -49,24 +49,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
49
49
  return value;
50
50
  }, "integer");
51
51
  var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
52
- const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
52
+ const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
53
53
  if (reference2.transcriptId !== void 0)
54
- parts.push(integer2(reference2.transcriptId));
54
+ parts2.push(integer2(reference2.transcriptId));
55
55
  if (reference2.cuePosition !== void 0) {
56
56
  if (reference2.transcriptId === void 0)
57
57
  throw invalid();
58
- parts.push(integer2(reference2.cuePosition, 0));
58
+ parts2.push(integer2(reference2.cuePosition, 0));
59
59
  }
60
- return `meeting:${parts.join("/")}`;
60
+ return `meeting:${parts2.join("/")}`;
61
61
  }, "formatMeetingReference");
62
62
  var parseMeetingReference = /* @__PURE__ */ __name((text5) => {
63
63
  const value = text5.trim();
64
64
  if (!value.startsWith("meeting:"))
65
65
  throw invalid();
66
- const parts = value.slice(8).split("/");
67
- if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
66
+ const parts2 = value.slice(8).split("/");
67
+ if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
68
68
  throw invalid();
69
- const ids2 = parts.map(Number);
69
+ const ids2 = parts2.map(Number);
70
70
  const reference2 = {
71
71
  type: "meeting",
72
72
  accountId: integer2(ids2[0]),
@@ -78,7 +78,7 @@ var parseMeetingReference = /* @__PURE__ */ __name((text5) => {
78
78
  }, "parseMeetingReference");
79
79
  var canonicalMeetingReference = /* @__PURE__ */ __name((text5) => formatMeetingReference(parseMeetingReference(text5)), "canonicalMeetingReference");
80
80
 
81
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/payment.js
81
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/payment.js
82
82
  var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
83
83
  var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
84
84
  var PAYMENT_STATES = ["expected", "paid", "cancelled"];
@@ -172,7 +172,7 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
172
172
  return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
173
173
  }, "paymentTitle");
174
174
 
175
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
175
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
176
176
  var QUERY_LIMITS = {
177
177
  bytes: 8192,
178
178
  depth: 32,
@@ -216,7 +216,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
216
216
  __name(queryError, "queryError");
217
217
  var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
218
218
 
219
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
219
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
220
220
  var timezoneOf = /* @__PURE__ */ __name((given) => {
221
221
  const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
222
222
  try {
@@ -250,9 +250,9 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
250
250
  era: "short"
251
251
  });
252
252
  const dayAt = /* @__PURE__ */ __name((time) => {
253
- const parts = formatter.formatToParts(time);
254
- const value2 = /* @__PURE__ */ __name((name) => Number(parts.find((p) => p.type === name)?.value), "value");
255
- const year = parts.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
253
+ const parts2 = formatter.formatToParts(time);
254
+ const value2 = /* @__PURE__ */ __name((name) => Number(parts2.find((p) => p.type === name)?.value), "value");
255
+ const year = parts2.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
256
256
  return year * 1e4 + value2("month") * 100 + value2("day");
257
257
  }, "dayAt");
258
258
  let lo = date.getTime() - 2 * 864e5, hi = date.getTime() + 2 * 864e5;
@@ -287,8 +287,8 @@ var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
287
287
  hourCycle: "h23"
288
288
  });
289
289
  const shown = /* @__PURE__ */ __name((instant) => {
290
- const parts = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
291
- return Date.UTC(parts.year ?? 0, (parts.month ?? 1) - 1, parts.day, parts.hour, parts.minute, parts.second) + (instant % 1e3 + 1e3) % 1e3;
290
+ const parts2 = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
291
+ return Date.UTC(parts2.year ?? 0, (parts2.month ?? 1) - 1, parts2.day, parts2.hour, parts2.minute, parts2.second) + (instant % 1e3 + 1e3) % 1e3;
292
292
  }, "shown");
293
293
  const found = /* @__PURE__ */ new Set();
294
294
  for (const probe of [wanted - 864e5, wanted, wanted + 864e5]) {
@@ -361,7 +361,7 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
361
361
  };
362
362
  }, "dateRange");
363
363
 
364
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
364
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
365
365
  var wordsOf = /* @__PURE__ */ __name((text5) => text5.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
366
366
  var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
367
367
  var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
@@ -416,7 +416,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
416
416
  }, "matches");
417
417
  var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
418
418
 
419
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
419
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
420
420
  var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
421
421
  var OPERATORS_BY_TYPE = {
422
422
  kw: ["term", "phrase", "wildcard"],
@@ -495,8 +495,8 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
495
495
  return [...own, ...relations, ...states];
496
496
  }, "queryFieldsOf");
497
497
 
498
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
499
- var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
498
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
499
+ var shownOf = /* @__PURE__ */ __name((registry2) => registry2.backend === "native" ? registry2.fields.filter((field) => field.native) : registry2.fields, "shownOf");
500
500
  var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
501
501
  var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
502
502
  var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
@@ -507,32 +507,32 @@ var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
507
507
  ...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
508
508
  ].join(" \xB7 "), "syntaxOf");
509
509
  var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
510
- var fieldsHelp = /* @__PURE__ */ __name((registry, guide) => {
511
- const shown = shownOf(registry);
510
+ var fieldsHelp = /* @__PURE__ */ __name((registry2, guide) => {
511
+ const shown = shownOf(registry2);
512
512
  const negatable = leftOut(shown);
513
513
  const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
514
514
  const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
515
515
  return [
516
516
  "Fields:",
517
- ...rows.map(([name = "", kind = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
518
- ...registry.defaults && registry.defaults.length > 0 ? [`Defaults: ${registry.defaults.join(" ")} \u2014 name the field to change it`] : [],
517
+ ...rows.map(([name = "", kind2 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind2.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
518
+ ...registry2.defaults && registry2.defaults.length > 0 ? [`Defaults: ${registry2.defaults.join(" ")} \u2014 name the field to change it`] : [],
519
519
  ...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
520
- `Syntax: ${syntaxOf(shown, registry.backend)}`,
520
+ `Syntax: ${syntaxOf(shown, registry2.backend)}`,
521
521
  ...guide ? [`Guide: ${guide}`] : []
522
522
  ].join("\n");
523
523
  }, "fieldsHelp");
524
- var queryDescription = /* @__PURE__ */ __name((registry) => {
525
- const shown = shownOf(registry);
524
+ var queryDescription = /* @__PURE__ */ __name((registry2) => {
525
+ const shown = shownOf(registry2);
526
526
  if (shown.length === 0)
527
527
  return "field:value terms; this list filters by none yet, so any term is refused";
528
528
  const negatable = leftOut(shown);
529
- 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], > <" : ""})`;
529
+ 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], > <" : ""})`;
530
530
  const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
531
- const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
531
+ const defaults = registry2.defaults?.length ? `; unless named: ${registry2.defaults.join(" ")}` : "";
532
532
  return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
533
533
  }, "queryDescription");
534
534
 
535
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
535
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
536
536
  var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
537
537
  var reserved = /* @__PURE__ */ new Set([
538
538
  "+",
@@ -586,7 +586,7 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
586
586
  at++;
587
587
  continue;
588
588
  }
589
- let kind = c;
589
+ let kind2 = c;
590
590
  if (c === '"' || !range && c === "/") {
591
591
  at++;
592
592
  while (at < text5.length && text5[at] !== c) {
@@ -599,22 +599,22 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
599
599
  at++;
600
600
  if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text5.slice(at)))
601
601
  fail("query.unsupported-regex-flags", { start: at, end: at + 1 }, "Lucene regex does not take JavaScript flags");
602
- kind = c === '"' ? "quoted" : "regex";
602
+ kind2 = c === '"' ? "quoted" : "regex";
603
603
  } else if (range && c !== "]" && c !== "}") {
604
604
  while (at < text5.length && !whitespace(text5[at] ?? "") && !["]", "}"].includes(text5[at] ?? ""))
605
605
  at++;
606
- kind = "rangeValue";
606
+ kind2 = "rangeValue";
607
607
  } else if (reserved.has(c)) {
608
608
  if (c === "\\") {
609
609
  at += 2;
610
610
  while (at < text5.length && !whitespace(text5[at] ?? "") && (!reserved.has(text5[at] ?? "") || ["+", "-"].includes(text5[at] ?? "")))
611
611
  at++;
612
- kind = "term";
612
+ kind2 = "term";
613
613
  } else {
614
614
  at++;
615
615
  if ((c === "<" || c === ">") && text5[at] === "=") {
616
616
  at++;
617
- kind += "=";
617
+ kind2 += "=";
618
618
  }
619
619
  if (c === "[" || c === "{")
620
620
  range = true;
@@ -644,9 +644,9 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
644
644
  while (at < text5.length && !whitespace(text5[at] ?? "") && !["(", ")", '"'].includes(text5[at] ?? ""))
645
645
  at++;
646
646
  const raw = text5.slice(start, at);
647
- kind = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
647
+ kind2 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
648
648
  }
649
- tokens.push({ kind, raw: text5.slice(start, at), span: { start, end: at } });
649
+ tokens.push({ kind: kind2, raw: text5.slice(start, at), span: { start, end: at } });
650
650
  }
651
651
  tokens.push({ kind: "EOF", raw: "", span: { start: at, end: at } });
652
652
  return tokens;
@@ -674,8 +674,8 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
674
674
  let depth = 0;
675
675
  const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
676
676
  const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
677
- const expect = /* @__PURE__ */ __name((kind) => {
678
- if (peek().kind !== kind)
677
+ const expect = /* @__PURE__ */ __name((kind2) => {
678
+ if (peek().kind !== kind2)
679
679
  fail("query.invalid-syntax", peek().span);
680
680
  return take();
681
681
  }, "expect");
@@ -812,10 +812,10 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
812
812
  }
813
813
  if (proximity && peek().kind === "~" && node.kind === "predicate" && node.operator === "phrase") {
814
814
  take();
815
- const distance = take();
816
- if (distance.kind !== "number" || !/^\d+$/u.test(distance.raw))
817
- fail("query.invalid-syntax", distance.span, 'write the distance as a whole number: "a b"~3');
818
- node = { ...node, slop: Number(distance.raw), span: { start: node.span.start, end: distance.span.end } };
815
+ const distance2 = take();
816
+ if (distance2.kind !== "number" || !/^\d+$/u.test(distance2.raw))
817
+ fail("query.invalid-syntax", distance2.span, 'write the distance as a whole number: "a b"~3');
818
+ node = { ...node, slop: Number(distance2.raw), span: { start: node.span.start, end: distance2.span.end } };
819
819
  }
820
820
  if (peek().kind === "~")
821
821
  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");
@@ -836,12 +836,12 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
836
836
  }, "parseLucene");
837
837
  var implicitTextTerms = /* @__PURE__ */ __name((text5) => {
838
838
  const tokens = tokensOf(text5);
839
- if (tokens.some(({ kind }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind)))
839
+ if (tokens.some(({ kind: kind2 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind2)))
840
840
  return /* @__PURE__ */ new Set();
841
841
  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] : []));
842
842
  }, "implicitTextTerms");
843
843
 
844
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
844
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
845
845
  var inContext = /* @__PURE__ */ __name((context3, run2) => {
846
846
  try {
847
847
  run2();
@@ -883,8 +883,8 @@ var checkValue = /* @__PURE__ */ __name((field, node, options) => {
883
883
  return;
884
884
  }
885
885
  }, "checkValue");
886
- var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
887
- const byName = new Map(registry.fields.map((field) => [field.name, field]));
886
+ var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
887
+ const byName = new Map(registry2.fields.map((field) => [field.name, field]));
888
888
  const visit = /* @__PURE__ */ __name((node, required) => {
889
889
  if (node.kind === "boolean") {
890
890
  for (const clause of node.clauses)
@@ -894,11 +894,11 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
894
894
  const field = byName.get(node.field);
895
895
  if (!field)
896
896
  queryError("query.unknown-field", node.span, `no field "${node.field}"`, options, {
897
- fields: registry.fields.map((one) => one.name)
897
+ fields: registry2.fields.map((one) => one.name)
898
898
  });
899
- if (registry.backend === "native" && !field.native)
899
+ if (registry2.backend === "native" && !field.native)
900
900
  queryError("query.unsupported-field", node.span, `the source cannot filter by ${field.name}`, options, {
901
- supported: registry.fields.filter((one) => one.native).map((one) => one.name)
901
+ supported: registry2.fields.filter((one) => one.native).map((one) => one.name)
902
902
  });
903
903
  const presence = node.operator === "wildcard" && node.value === "*";
904
904
  if (!presence && !field.operators.includes(node.operator))
@@ -916,15 +916,15 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
916
916
  }, "validateQuery");
917
917
  var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
918
918
 
919
- // node_modules/.pnpm/@wirecat+cli-base@0.80.7_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
920
- var describeQuery = /* @__PURE__ */ __name((registry) => ({
921
- entity: registry.entity,
922
- backend: registry.backend,
923
- fields: registry.fields.map(({ validate: _, ...field }) => field),
924
- ...registry.defaults && registry.defaults.length > 0 ? { defaults: [...registry.defaults] } : {}
919
+ // node_modules/.pnpm/@wirecat+cli-base@0.93.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
920
+ var describeQuery = /* @__PURE__ */ __name((registry2) => ({
921
+ entity: registry2.entity,
922
+ backend: registry2.backend,
923
+ fields: registry2.fields.map(({ validate: _, ...field }) => field),
924
+ ...registry2.defaults && registry2.defaults.length > 0 ? { defaults: [...registry2.defaults] } : {}
925
925
  }), "describeQuery");
926
- var exampleProblems = /* @__PURE__ */ __name((registry) => {
927
- const syntaxOnly = { ...registry, backend: "sql" };
926
+ var exampleProblems = /* @__PURE__ */ __name((registry2) => {
927
+ const syntaxOnly = { ...registry2, backend: "sql" };
928
928
  const problem = /* @__PURE__ */ __name((text5, field) => {
929
929
  try {
930
930
  const named = walkQuery(validateQuery(parseLucene(text5, { defaultField: "none" }), syntaxOnly).root);
@@ -935,29 +935,29 @@ var exampleProblems = /* @__PURE__ */ __name((registry) => {
935
935
  return `"${text5}": ${failure.message}`;
936
936
  }
937
937
  }, "problem");
938
- const defaults = (registry.defaults ?? []).map((term) => {
938
+ const defaults = (registry2.defaults ?? []).map((term) => {
939
939
  const field = term.replace(/^-/, "").split(/[:<>=]/)[0] ?? "";
940
940
  return { field, problem: problem(term.replace(/^-/, ""), field) };
941
941
  });
942
942
  return [
943
- ...registry.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
943
+ ...registry2.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
944
944
  ...defaults
945
945
  ].filter((entry) => entry.problem !== void 0);
946
946
  }, "exampleProblems");
947
947
  var checked = /* @__PURE__ */ new WeakSet();
948
- var defineQuery = /* @__PURE__ */ __name((registry) => {
949
- if (checked.has(registry))
950
- return registry;
951
- const names = registry.fields.map((field) => field.name);
948
+ var defineQuery = /* @__PURE__ */ __name((registry2) => {
949
+ if (checked.has(registry2))
950
+ return registry2;
951
+ const names = registry2.fields.map((field) => field.name);
952
952
  const problems = [
953
953
  ...duplicates(names).map((name) => `"${name}" is listed twice`),
954
954
  ...names.filter((name) => !SNAKE_CASE.test(name)).map((name) => `"${name}" is not snake_case`),
955
- ...exampleProblems(registry).map(({ field, problem }) => `${field}: ${problem}`)
955
+ ...exampleProblems(registry2).map(({ field, problem }) => `${field}: ${problem}`)
956
956
  ];
957
957
  if (problems.length > 0)
958
- throw new RegistryError(`${registry.entity} query`, problems);
959
- checked.add(registry);
960
- return registry;
958
+ throw new RegistryError(`${registry2.entity} query`, problems);
959
+ checked.add(registry2);
960
+ return registry2;
961
961
  }, "defineQuery");
962
962
  var SPAN = ["span", "alternative", "guide"];
963
963
  var QUERY_REASONS = defineReasons([
@@ -987,7 +987,7 @@ var QUERY_REASONS = defineReasons([
987
987
  details: [...SPAN, ...details]
988
988
  })));
989
989
 
990
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/item.js
990
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/item.js
991
991
  var text = string();
992
992
  var count = pipe(number(), integer(), minValue(0));
993
993
  var MEETING_ISSUES = ["time_without_zone"];
@@ -1052,7 +1052,7 @@ var MEETING_QUERY = {
1052
1052
  })
1053
1053
  };
1054
1054
 
1055
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/answers.js
1055
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/answers.js
1056
1056
  var text2 = string();
1057
1057
  var count2 = pipe(number(), integer(), minValue(0));
1058
1058
  var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
@@ -1287,7 +1287,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
1287
1287
  };
1288
1288
  }, "meetingHitsList");
1289
1289
 
1290
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1290
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
1291
1291
  var joinKeyOf = /* @__PURE__ */ __name((url) => {
1292
1292
  const parsed = urlOf(url);
1293
1293
  if (!parsed)
@@ -1321,7 +1321,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
1321
1321
  }
1322
1322
  }, "urlOf");
1323
1323
 
1324
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1324
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
1325
1325
  var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
1326
1326
  var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
1327
1327
  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");
@@ -1330,8 +1330,8 @@ var calendarText = /* @__PURE__ */ __name((text5, { dropSecretLines = true } = {
1330
1330
  if (!text5)
1331
1331
  return null;
1332
1332
  const kept = htmlToText(text5).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
1333
- const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1334
- return joined || null;
1333
+ const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
1334
+ return joined2 || null;
1335
1335
  }, "calendarText");
1336
1336
  var ENTRY_METADATA_KEYS = [
1337
1337
  "colorId",
@@ -1358,7 +1358,7 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
1358
1358
  return kept;
1359
1359
  }, "entryMetadata");
1360
1360
 
1361
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1361
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
1362
1362
  import { createHash } from "node:crypto";
1363
1363
  var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
1364
1364
  reference: cue2.reference,
@@ -1372,7 +1372,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
1372
1372
  text: cue2.text
1373
1373
  })).digest("hex"), "meetingCueFingerprint");
1374
1374
 
1375
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1375
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
1376
1376
  var EVENT_QUERY = defineQuery({
1377
1377
  entity: "event",
1378
1378
  backend: "sql",
@@ -1388,7 +1388,7 @@ var EVENT_QUERY = defineQuery({
1388
1388
  ]
1389
1389
  });
1390
1390
 
1391
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1391
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
1392
1392
  var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
1393
1393
  var seriesEnd = /* @__PURE__ */ __name((entry) => {
1394
1394
  if (entry.recurrenceEndsAt !== null)
@@ -1411,7 +1411,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
1411
1411
  return Math.max(entry.endsAt ?? start, start + 1) > window.from;
1412
1412
  }, "entryInWindow");
1413
1413
 
1414
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/events.js
1414
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/events.js
1415
1415
  var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
1416
1416
  const current = await store.meeting(details.meeting.id);
1417
1417
  if (!current)
@@ -1454,7 +1454,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
1454
1454
  return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
1455
1455
  }, "linkEvent");
1456
1456
 
1457
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1457
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
1458
1458
  var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text5) => text5.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
1459
1459
  var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
1460
1460
  if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
@@ -1478,7 +1478,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
1478
1478
  };
1479
1479
  }, "validateMeetingParticipantSearch");
1480
1480
 
1481
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1481
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/reads.js
1482
1482
  var MeetingError = class extends CliError {
1483
1483
  static {
1484
1484
  __name(this, "MeetingError");
@@ -1610,7 +1610,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id3, accountId)
1610
1610
  return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
1611
1611
  }, "meetingSummaryAnswer");
1612
1612
 
1613
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/export.js
1613
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/export.js
1614
1614
  var timestamp = /* @__PURE__ */ __name((milliseconds) => {
1615
1615
  if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
1616
1616
  throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
@@ -1672,30 +1672,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id3, options) => {
1672
1672
  text: row.text
1673
1673
  })));
1674
1674
  } else {
1675
- const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1675
+ const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
1676
1676
  if (details.meeting.description !== null)
1677
- parts.push("## Description", quote(details.meeting.description));
1677
+ parts2.push("## Description", quote(details.meeting.description));
1678
1678
  for (const summary of details.summaries) {
1679
- parts.push(`## ${heading(summary.title ?? "Summary")}`);
1679
+ parts2.push(`## ${heading(summary.title ?? "Summary")}`);
1680
1680
  if (summary.content !== null)
1681
- parts.push(quote(summary.content));
1681
+ parts2.push(quote(summary.content));
1682
1682
  else {
1683
1683
  if (summary.overview !== null)
1684
- parts.push(quote(summary.overview));
1684
+ parts2.push(quote(summary.overview));
1685
1685
  for (const section of summary.sections)
1686
- parts.push(`### ${heading(section.label)}`, quote(section.text));
1686
+ parts2.push(`### ${heading(section.label)}`, quote(section.text));
1687
1687
  if (summary.nextSteps.length > 0)
1688
- parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
1688
+ parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
1689
1689
  }
1690
1690
  }
1691
1691
  for (const part of transcripts) {
1692
- parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
1692
+ parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
1693
1693
  if (part.transcript.supersededAt !== null)
1694
- parts.push("Version: superseded");
1694
+ parts2.push("Version: superseded");
1695
1695
  for (const row of [...part.rows].sort((a, b) => a.position - b.position))
1696
- parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
1696
+ parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
1697
1697
  }
1698
- content = `${parts.join("\n\n")}
1698
+ content = `${parts2.join("\n\n")}
1699
1699
  `;
1700
1700
  }
1701
1701
  return {
@@ -1706,10 +1706,10 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id3, options) => {
1706
1706
  };
1707
1707
  }, "exportMeeting");
1708
1708
 
1709
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1709
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1710
1710
  import { createHash as createHash2 } from "node:crypto";
1711
1711
 
1712
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
1712
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
1713
1713
  var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
1714
1714
  if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
1715
1715
  throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
@@ -1720,7 +1720,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
1720
1720
  return new Date(value).toISOString();
1721
1721
  }, "meetingTimestamp");
1722
1722
 
1723
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1723
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
1724
1724
  var TASK_TYPES = ["bug", "feature", "chore"];
1725
1725
  var invalid3 = /* @__PURE__ */ __name((message) => {
1726
1726
  throw new CliError("validation_error", message);
@@ -1734,10 +1734,10 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
1734
1734
  var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
1735
1735
  var findingWhere = /* @__PURE__ */ __name((of) => {
1736
1736
  const id3 = typeof of.id === "string" ? of.id : null;
1737
- const kind = typeof of.kind === "string" ? of.kind : null;
1737
+ const kind2 = typeof of.kind === "string" ? of.kind : null;
1738
1738
  return {
1739
- where: id3 || kind ? ` in ${[id3, kind && `(${kind})`].filter(Boolean).join(" ")}` : "",
1740
- named: { ...id3 ? { finding: id3 } : {}, ...kind ? { kind } : {} }
1739
+ where: id3 || kind2 ? ` in ${[id3, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
1740
+ named: { ...id3 ? { finding: id3 } : {}, ...kind2 ? { kind: kind2 } : {} }
1741
1741
  };
1742
1742
  }, "findingWhere");
1743
1743
  var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
@@ -1765,13 +1765,15 @@ var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
1765
1765
  const evidence = raw.map((item) => {
1766
1766
  if (!item || typeof item !== "object")
1767
1767
  return invalid3("finding evidence is a reference and fingerprint");
1768
- findingFields(item, ["reference", "fingerprint"], rules.singular);
1768
+ findingFields(item, rules.quotes ? ["reference", "fingerprint", "quote"] : ["reference", "fingerprint"], rules.singular);
1769
1769
  if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
1770
1770
  return invalid3("evidence requires a reference and fingerprint");
1771
1771
  const reference2 = rules.reference(item.reference);
1772
1772
  if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
1773
1773
  return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
1774
- return { reference: reference2, fingerprint: item.fingerprint };
1774
+ if (item.quote === void 0)
1775
+ return { reference: reference2, fingerprint: item.fingerprint };
1776
+ return { reference: reference2, fingerprint: item.fingerprint, quote: findingText(item.quote, rules.quotes ?? 0) };
1775
1777
  }).sort((a, b) => a.reference.localeCompare(b.reference));
1776
1778
  if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
1777
1779
  return invalid3(`duplicate evidence ${rules.cited}`);
@@ -1893,7 +1895,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
1893
1895
  var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
1894
1896
  var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
1895
1897
 
1896
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/findings.js
1898
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/findings.js
1897
1899
  var MEETING_FINDINGS_KIND = "meeting_findings";
1898
1900
  var cue = /* @__PURE__ */ __name((raw) => {
1899
1901
  const reference2 = canonicalMeetingReference(raw);
@@ -1904,7 +1906,7 @@ var cue = /* @__PURE__ */ __name((raw) => {
1904
1906
  var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
1905
1907
  var meetingFindingFingerprint = findingFingerprint;
1906
1908
 
1907
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1909
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
1908
1910
  var context = {
1909
1911
  command: "search meetings",
1910
1912
  guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
@@ -1965,10 +1967,56 @@ var MEETING_FIELDS = defineQuery({
1965
1967
  }))
1966
1968
  ]
1967
1969
  });
1970
+ var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
1968
1971
  var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
1972
+ var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
1973
+ let ast;
1974
+ try {
1975
+ ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
1976
+ } catch (error) {
1977
+ if (error instanceof CliError)
1978
+ return { query, request };
1979
+ throw error;
1980
+ }
1981
+ const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
1982
+ const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
1983
+ 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");
1984
+ const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
1985
+ if (wrong)
1986
+ queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
1987
+ if (!lifted.length)
1988
+ return { query, request };
1989
+ const next = { ...request };
1990
+ const once = /* @__PURE__ */ __name((name, flag2) => {
1991
+ if (next[name] !== void 0)
1992
+ throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
1993
+ }, "once");
1994
+ for (const { node } of lifted) {
1995
+ if (node.field === "date") {
1996
+ once("since", "--since-time");
1997
+ once("until", "--until-time");
1998
+ 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);
1999
+ if (range.lower !== void 0)
2000
+ next.since = range.lower + (range.lower_inclusive ? 0 : 1);
2001
+ if (range.upper !== void 0)
2002
+ next.until = range.upper - (range.upper_inclusive ? 0 : 1);
2003
+ } else {
2004
+ const field = node.field;
2005
+ once(field, `--${field}`);
2006
+ next[field] = node.value;
2007
+ }
2008
+ }
2009
+ let rest = query;
2010
+ for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
2011
+ rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
2012
+ rest = rest.replace(/^(?:\s*AND\b)+|(?:\bAND\s*)+$/g, "").replace(/\bAND(\s+AND\b)+/g, "AND").trim();
2013
+ if (!rest)
2014
+ throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
2015
+ return { query: rest, request: next };
2016
+ }, "liftMeetingFields");
1969
2017
  var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
1970
2018
 
1971
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/language.js
2019
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/language.js
1972
2020
  var LATIN_WORDS = {
1973
2021
  en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
1974
2022
  es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
@@ -2017,7 +2065,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
2017
2065
  return null;
2018
2066
  }, "transcriptLanguage");
2019
2067
 
2020
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2068
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
2021
2069
  var contentHash = /* @__PURE__ */ __name(async (text5) => {
2022
2070
  const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text5));
2023
2071
  return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
@@ -2054,7 +2102,7 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
2054
2102
  return time;
2055
2103
  }, "timestamp");
2056
2104
 
2057
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2105
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
2058
2106
  var TranscriptTextError = class extends Error {
2059
2107
  static {
2060
2108
  __name(this, "TranscriptTextError");
@@ -2109,7 +2157,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
2109
2157
  return { header, lines };
2110
2158
  }, "parseTranscriptText");
2111
2159
 
2112
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2160
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
2113
2161
  var VttError = class extends Error {
2114
2162
  static {
2115
2163
  __name(this, "VttError");
@@ -2161,7 +2209,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
2161
2209
  return cues;
2162
2210
  }, "parseVtt");
2163
2211
 
2164
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/import.js
2212
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/import.js
2165
2213
  var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
2166
2214
  const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
2167
2215
  for (const file of files) {
@@ -2194,10 +2242,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
2194
2242
  return report;
2195
2243
  }, "importFiles");
2196
2244
 
2197
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/links.js
2245
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/links.js
2198
2246
  var CHAT_MESSAGES_READ = 1e5;
2199
2247
 
2200
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2248
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
2201
2249
  var nonempty = /* @__PURE__ */ __name((value, name) => {
2202
2250
  if (typeof value !== "string" || !value.trim())
2203
2251
  throw new CliError("validation_error", `${name} must be nonempty`);
@@ -2248,7 +2296,7 @@ var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
2248
2296
  return Object.freeze(result);
2249
2297
  }, "validateMeetingChange");
2250
2298
 
2251
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/passage.js
2299
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/passage.js
2252
2300
  var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
2253
2301
  const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
2254
2302
  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)))
@@ -2261,7 +2309,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
2261
2309
  throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
2262
2310
  }, "validateMeetingPassage");
2263
2311
 
2264
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2312
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
2265
2313
  var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2266
2314
  if (!original || typeof original !== "object" || Array.isArray(original))
2267
2315
  throw new CliError("validation_error", "meeting preparation context is required");
@@ -2286,7 +2334,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
2286
2334
  return { ...input, limit, maxReadBytes };
2287
2335
  }, "validateMeetingPreparationContext");
2288
2336
 
2289
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2337
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
2290
2338
  var count3 = pipe(number(), integer(), minValue(0));
2291
2339
  var id = pipe(string(), minLength(1));
2292
2340
  var meetingProjectEvidence = strictObject({
@@ -2407,7 +2455,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
2407
2455
  };
2408
2456
  }, "meetingProjectEvidenceAnswer");
2409
2457
 
2410
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2458
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
2411
2459
  var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
2412
2460
  const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
2413
2461
  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) || [
@@ -2427,7 +2475,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
2427
2475
  throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
2428
2476
  }, "validateMeetingHitSearch");
2429
2477
 
2430
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2478
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
2431
2479
  var ids = {
2432
2480
  meeting_id: "meetingId",
2433
2481
  identity_id: "participantIdentityId",
@@ -2518,7 +2566,7 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {
2518
2566
  return { project: project.trim(), options, query: frozen.join(" AND ") };
2519
2567
  }, "prepareMeetingProjectEvidence");
2520
2568
 
2521
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2569
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
2522
2570
  var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
2523
2571
  const prepared = prepareMeetingProjectEvidence(project, request, now);
2524
2572
  const page = await read(prepared.project, prepared.options);
@@ -2526,7 +2574,7 @@ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, re
2526
2574
  return meetingProjectEvidenceAnswer(page, prepared);
2527
2575
  }, "readMeetingProjectEvidence");
2528
2576
 
2529
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2577
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/pull.js
2530
2578
  var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
2531
2579
  const { identityExternalId, ...fields } = p;
2532
2580
  const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
@@ -2688,7 +2736,7 @@ unlinked`, format)],
2688
2736
  return report;
2689
2737
  }, "pull");
2690
2738
 
2691
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2739
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
2692
2740
  var text3 = string();
2693
2741
  var count4 = pipe(number(), integer(), minValue(0));
2694
2742
  var id2 = pipe(number(), integer(), minValue(1));
@@ -2882,10 +2930,10 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
2882
2930
  updated_at: new Date(one.updatedAt).toISOString()
2883
2931
  }), "eventItem");
2884
2932
 
2885
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
2933
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
2886
2934
  var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
2887
2935
 
2888
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
2936
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
2889
2937
  var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
2890
2938
  if (!original || typeof original !== "object" || Array.isArray(original))
2891
2939
  throw new CliError("validation_error", "related history request is required");
@@ -2915,7 +2963,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
2915
2963
  return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
2916
2964
  }, "validateMeetingRelatedHistory");
2917
2965
 
2918
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
2966
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
2919
2967
  var text4 = string();
2920
2968
  var identifier = pipe(text4, minLength(1));
2921
2969
  var nullableText = nullable(text4);
@@ -2957,7 +3005,8 @@ var personResult = strictObject({
2957
3005
  participant_id: identifier,
2958
3006
  person_uid: text4,
2959
3007
  previous_person_uid: nullableText,
2960
- changed: flag
3008
+ changed: flag,
3009
+ proposal: optional(text4)
2961
3010
  });
2962
3011
  var meetingChange = strictObject({
2963
3012
  scope,
@@ -3048,14 +3097,14 @@ var MEETING_RESULT_ENTITIES = {
3048
3097
  meeting_repair: repair
3049
3098
  };
3050
3099
 
3051
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/review.js
3100
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/review.js
3052
3101
  var REVIEW_LIMIT = { default: 50, most: 200 };
3053
3102
 
3054
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3103
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
3055
3104
  var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
3056
3105
  \`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
3057
3106
 
3058
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3107
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
3059
3108
  var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3060
3109
  input.signal?.throwIfAborted();
3061
3110
  if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
@@ -3076,10 +3125,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
3076
3125
  return { ...input, limit, maxReadBytes };
3077
3126
  }, "validateMeetingSeriesHistory");
3078
3127
 
3079
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3128
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
3080
3129
  var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
3081
3130
 
3082
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3131
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
3083
3132
  function invalid4(field, response = false) {
3084
3133
  throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
3085
3134
  }
@@ -3108,7 +3157,7 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
3108
3157
  cursorDetails(value);
3109
3158
  }, "validateMeetingSeriesInventoryCursor");
3110
3159
 
3111
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/meetings/stats.js
3160
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/stats.js
3112
3161
  var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
3113
3162
  var zoneOf = /* @__PURE__ */ __name((timeZone) => {
3114
3163
  const zone = timeZone ?? "UTC";
@@ -3121,13 +3170,13 @@ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
3121
3170
  }, "zoneOf");
3122
3171
  var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
3123
3172
  var weekStart = /* @__PURE__ */ __name((at, format) => {
3124
- const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3125
- const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
3126
- return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
3173
+ const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3174
+ const day = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
3175
+ return new Date(day - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
3127
3176
  }, "weekStart");
3128
3177
  var dayKey = /* @__PURE__ */ __name((at, format) => {
3129
- const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3130
- return `${parts.year}-${parts.month}-${parts.day}`;
3178
+ const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
3179
+ return `${parts2.year}-${parts2.month}-${parts2.day}`;
3131
3180
  }, "dayKey");
3132
3181
  var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
3133
3182
  timeZone: zone,
@@ -3243,7 +3292,347 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
3243
3292
  };
3244
3293
  }, "aggregateMeetingStats");
3245
3294
 
3246
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/money.js
3295
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/meetings/store.js
3296
+ var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
3297
+
3298
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/locator.js
3299
+ var SCHEME = "msg:";
3300
+ var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
3301
+ var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
3302
+ var parseLocator = /* @__PURE__ */ __name((reference2) => {
3303
+ const trimmed = reference2.trim();
3304
+ const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
3305
+ if (parts2.length !== 4 || parts2.some((part) => part === "")) {
3306
+ throw new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
3307
+ }
3308
+ const [provider, account, chat, message] = parts2.map(decodeURIComponent);
3309
+ return { provider, account, chat, message };
3310
+ }, "parseLocator");
3311
+
3312
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/references.js
3313
+ var SIMPLE_REFERENCES = [
3314
+ "note",
3315
+ "document",
3316
+ "person",
3317
+ "organization",
3318
+ "project",
3319
+ "task",
3320
+ "memory",
3321
+ "fact",
3322
+ "bot",
3323
+ "event",
3324
+ "invoice",
3325
+ "payment",
3326
+ "order",
3327
+ "deal",
3328
+ "lead",
3329
+ "pipeline",
3330
+ "product",
3331
+ "contract",
3332
+ "subscription",
3333
+ "wallet",
3334
+ "transaction",
3335
+ "entity"
3336
+ ];
3337
+ var malformed = /* @__PURE__ */ __name((text5, shape) => new CliError("validation_error", `"${singleLine(text5)}" is not a reference \u2014 expected ${shape}`, {
3338
+ reason: "ref.malformed"
3339
+ }), "malformed");
3340
+ var parts = /* @__PURE__ */ __name((rest, count6, text5, shape) => {
3341
+ const split = rest.split("/");
3342
+ if (split.length !== count6 || split.some((part) => part === ""))
3343
+ throw malformed(text5, shape);
3344
+ return split.map(decodeURIComponent);
3345
+ }, "parts");
3346
+ var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
3347
+ var folderPath = /* @__PURE__ */ __name((path) => {
3348
+ const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
3349
+ return clean === "" ? path.trim() === "" ? "" : null : clean;
3350
+ }, "folderPath");
3351
+ var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
3352
+ var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
3353
+ var simple = /* @__PURE__ */ __name((prefix) => kind({
3354
+ prefix,
3355
+ type: prefix,
3356
+ shape: `${prefix}:<id>`,
3357
+ parse: /* @__PURE__ */ __name((rest, text5) => {
3358
+ if (!rest.trim())
3359
+ throw new CliError("validation_error", `"${singleLine(text5)}" names no ${prefix}`, {
3360
+ reason: "ref.malformed"
3361
+ });
3362
+ return { type: prefix, id: rest };
3363
+ }, "parse"),
3364
+ format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
3365
+ }), "simple");
3366
+ var REF_KINDS = [
3367
+ kind({
3368
+ prefix: "msg",
3369
+ type: "message",
3370
+ shape: "msg:<provider>/<account>/<chat>/<message>",
3371
+ parse: /* @__PURE__ */ __name((_, text5) => {
3372
+ try {
3373
+ return { type: "message", ...parseLocator(text5) };
3374
+ } catch {
3375
+ throw malformed(text5, "msg:<provider>/<account>/<chat>/<message>");
3376
+ }
3377
+ }, "parse"),
3378
+ format: formatLocator
3379
+ }),
3380
+ kind({
3381
+ prefix: "chat",
3382
+ type: "chat",
3383
+ shape: "chat:<provider>/<account>/<chat>",
3384
+ parse: /* @__PURE__ */ __name((rest, text5) => {
3385
+ const [provider, account, chat] = parts(rest, 3, text5, "chat:<provider>/<account>/<chat>");
3386
+ return { type: "chat", provider, account, chat };
3387
+ }, "parse"),
3388
+ format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
3389
+ }),
3390
+ kind({
3391
+ prefix: "contact",
3392
+ type: "contact",
3393
+ shape: "contact:<provider>/<id>",
3394
+ parse: /* @__PURE__ */ __name((rest, text5) => {
3395
+ const [provider, id3] = parts(rest, 2, text5, "contact:<provider>/<id>");
3396
+ return { type: "contact", provider, id: id3 };
3397
+ }, "parse"),
3398
+ format: /* @__PURE__ */ __name(({ provider, id: id3 }) => `contact:${encoded(provider, id3)}`, "format")
3399
+ }),
3400
+ kind({
3401
+ prefix: "folder",
3402
+ type: "folder",
3403
+ shape: "folder:<id>[/<path>]",
3404
+ parse: /* @__PURE__ */ __name((rest, text5) => {
3405
+ const slash = rest.indexOf("/");
3406
+ const id3 = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
3407
+ const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
3408
+ if (!id3.trim() || path === "")
3409
+ throw malformed(text5, "folder:<id>[/<path>]");
3410
+ return { type: "folder", id: id3, path };
3411
+ }, "parse"),
3412
+ format: /* @__PURE__ */ __name(({ id: id3, path }) => path === null ? `folder:${encodeURIComponent(id3)}` : `folder:${encoded(id3, path)}`, "format")
3413
+ }),
3414
+ kind({
3415
+ prefix: "meeting",
3416
+ type: "meeting",
3417
+ shape: MEETING_SHAPE,
3418
+ parse: /* @__PURE__ */ __name((_, text5) => {
3419
+ try {
3420
+ return parseMeetingReference(text5);
3421
+ } catch {
3422
+ throw malformed(text5, MEETING_SHAPE);
3423
+ }
3424
+ }, "parse"),
3425
+ format: formatMeetingReference
3426
+ }),
3427
+ ...SIMPLE_REFERENCES.map(simple)
3428
+ ];
3429
+ var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
3430
+ var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
3431
+ var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
3432
+ var distance = /* @__PURE__ */ __name((a, b) => {
3433
+ let row = Array.from({ length: b.length + 1 }, (_, at) => at);
3434
+ for (const [i, x] of [...a].entries()) {
3435
+ const next = [i + 1];
3436
+ for (const [j, y] of [...b].entries())
3437
+ next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
3438
+ row = next;
3439
+ }
3440
+ return row[b.length];
3441
+ }, "distance");
3442
+ 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");
3443
+ var unknownKind = /* @__PURE__ */ __name((text5, prefix, rest) => {
3444
+ const near2 = prefix === "" ? void 0 : nearest(prefix);
3445
+ const kinds = offered.map((one) => `${one}:`).join(", ");
3446
+ const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
3447
+ return new CliError("validation_error", `"${singleLine(text5)}" is no kind of reference${hint}`, {
3448
+ reason: "ref.unknown-kind"
3449
+ });
3450
+ }, "unknownKind");
3451
+ var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
3452
+ var parseReference = /* @__PURE__ */ __name((text5) => {
3453
+ const reference2 = text5.trim();
3454
+ const colon = reference2.indexOf(":");
3455
+ const prefix = colon < 0 ? "" : reference2.slice(0, colon);
3456
+ const rest = reference2.slice(colon + 1);
3457
+ const spec = byPrefix.get(prefix);
3458
+ if (!spec)
3459
+ throw unknownKind(reference2, prefix, rest);
3460
+ return spec.parse(rest, reference2);
3461
+ }, "parseReference");
3462
+ var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
3463
+ var looksLikeReference = /* @__PURE__ */ __name((text5) => {
3464
+ const match = /^([a-z]+):\S+$/.exec(text5.trim());
3465
+ return match !== null && byPrefix.has(match[1]);
3466
+ }, "looksLikeReference");
3467
+
3468
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/providers.js
3469
+ var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
3470
+ var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
3471
+ var CRM_OPENS = { deal: "deals show", lead: "leads show", pipeline: "pipelines show" };
3472
+ var PROVIDERS = [
3473
+ { name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
3474
+ { name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
3475
+ { name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
3476
+ { name: "max-bot", kind: "messages", aliases: [] },
3477
+ { name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
3478
+ { name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
3479
+ { name: "email", kind: "mail", aliases: [] },
3480
+ { name: "notes", kind: "notes", aliases: [] },
3481
+ { name: "local", kind: "notes", aliases: [] },
3482
+ { name: "obsidian", kind: "notes", aliases: [] },
3483
+ { name: "added", kind: "notes", aliases: [] },
3484
+ { name: "zoom", kind: "meetings", aliases: [] },
3485
+ // A phone export's records: its SMS and its calls in the one account the import names.
3486
+ { name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true }
3487
+ ];
3488
+ var LABELS = {
3489
+ telegram: "Telegram",
3490
+ "telegram-bot": "Telegram bot",
3491
+ max: "MAX",
3492
+ "max-bot": "MAX bot",
3493
+ whatsapp: "WhatsApp",
3494
+ "whatsapp-bot": "WhatsApp bot",
3495
+ "google-drive": "Google Drive",
3496
+ added: "added by hand",
3497
+ email: "mail"
3498
+ };
3499
+ var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
3500
+ var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
3501
+ var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
3502
+ var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
3503
+ var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
3504
+ var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
3505
+ var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
3506
+ var ADDED_PROVIDER = "added";
3507
+ var ADDED_ACCOUNT = "owner";
3508
+ var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
3509
+ var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
3510
+ var INTERNAL_NOTES = "internal";
3511
+ var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
3512
+ var WORD = /^[a-z0-9][a-z0-9_-]*$/;
3513
+ var invalid5 = /* @__PURE__ */ __name((message) => {
3514
+ throw new CliError("validation_error", message);
3515
+ }, "invalid");
3516
+ 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");
3517
+ var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
3518
+ var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
3519
+ var opensOf = /* @__PURE__ */ __name((value, named) => {
3520
+ if (typeof value !== "object" || value === null || Array.isArray(value))
3521
+ return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
3522
+ const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
3523
+ for (const [kind2, command] of known)
3524
+ if (typeof command !== "string" || !COMMAND_WORDS.test(command))
3525
+ invalid5(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
3526
+ return Object.fromEntries(known);
3527
+ }, "opensOf");
3528
+ var providerEntryOf = /* @__PURE__ */ __name((value) => {
3529
+ if (typeof value !== "object" || value === null || Array.isArray(value))
3530
+ return invalid5("a provider entry is an object");
3531
+ const { name, kind: kind2, kinds, aliases = [], command, opens, imported } = value;
3532
+ const named = wordOf(name, "a provider's name");
3533
+ const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
3534
+ const given = kinds === void 0 ? [kind2] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
3535
+ for (const one of given)
3536
+ if (!isKindWord(one))
3537
+ invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
3538
+ const list = [...new Set(given)];
3539
+ if (kind2 !== void 0 && kind2 !== list[0])
3540
+ invalid5(`provider ${named}'s kind is the first of its kinds`);
3541
+ if (!Array.isArray(aliases))
3542
+ invalid5(`provider ${named}'s aliases are a list`);
3543
+ if (imported !== void 0 && typeof imported !== "boolean")
3544
+ invalid5(`provider ${named}'s imported is true or false`);
3545
+ return {
3546
+ name: named,
3547
+ kind: list[0],
3548
+ ...list.length > 1 ? { kinds: list } : {},
3549
+ ...imported === true ? { imported: true } : {},
3550
+ aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
3551
+ ...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
3552
+ ...opens === void 0 ? {} : { opens: opensOf(opens, named) }
3553
+ };
3554
+ }, "providerEntryOf");
3555
+ var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
3556
+ var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
3557
+ var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
3558
+ .../* @__PURE__ */ new Set([...known, ...entry])
3559
+ ], "unitedKinds");
3560
+ var wordsOf2 = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
3561
+ var joined = /* @__PURE__ */ __name((known, entry) => {
3562
+ const same = known.find(({ name }) => name === entry.name);
3563
+ const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
3564
+ if (same && same.kind !== entry.kind)
3565
+ invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
3566
+ if (same && entry.imported === true && same.imported !== true)
3567
+ invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
3568
+ const merged = same ? {
3569
+ ...same,
3570
+ ...kinds.length > 1 ? { kinds } : {},
3571
+ aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
3572
+ ...entry.command ? { command: entry.command } : {},
3573
+ ...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
3574
+ } : entry;
3575
+ const others = known.filter((one) => one !== same);
3576
+ for (const word of wordsOf2(merged)) {
3577
+ const owner = others.find((one) => wordsOf2(one).includes(word));
3578
+ if (owner)
3579
+ invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
3580
+ }
3581
+ return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
3582
+ }, "joined");
3583
+ var registry = PROVIDERS;
3584
+ var providers = /* @__PURE__ */ __name(() => registry, "providers");
3585
+ var useProviders = /* @__PURE__ */ __name((entries) => {
3586
+ registry = entries.map(providerEntryOf).reduce(joined, PROVIDERS);
3587
+ }, "useProviders");
3588
+ var useStoredProviders = /* @__PURE__ */ __name((entries) => {
3589
+ const left = [];
3590
+ registry = entries.reduce((known, entry) => {
3591
+ try {
3592
+ return joined(known, providerEntryOf(entry));
3593
+ } catch (error) {
3594
+ if (!(error instanceof CliError))
3595
+ throw error;
3596
+ left.push(entry);
3597
+ return known;
3598
+ }
3599
+ }, PROVIDERS);
3600
+ return left;
3601
+ }, "useStoredProviders");
3602
+ var addProvider = /* @__PURE__ */ __name((entry) => {
3603
+ registry = joined(registry, providerEntryOf(entry));
3604
+ }, "addProvider");
3605
+ var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
3606
+ var providerNamed = /* @__PURE__ */ __name((word) => {
3607
+ const wanted = word.toLowerCase();
3608
+ return registry.find((entry) => wordsOf2(entry).includes(wanted));
3609
+ }, "providerNamed");
3610
+ var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
3611
+ var kindsIn = /* @__PURE__ */ __name((provider) => {
3612
+ if (isFolderProvider(provider))
3613
+ return ["notes"];
3614
+ const entry = registry.find(({ name }) => name === provider);
3615
+ return entry ? kindsOfEntry(entry) : [];
3616
+ }, "kindsIn");
3617
+ var importedOf = /* @__PURE__ */ __name((entry, held) => {
3618
+ const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
3619
+ if (builtIn) {
3620
+ if (entry.imported === true && builtIn.imported !== true)
3621
+ invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
3622
+ return builtIn.imported === true;
3623
+ }
3624
+ if (held === void 0)
3625
+ return entry.imported === true;
3626
+ if (entry.imported === true && held.imported !== true)
3627
+ invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
3628
+ return held.imported === true;
3629
+ }, "importedOf");
3630
+ var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
3631
+ var holdsKind = /* @__PURE__ */ __name((provider, kind2) => kindsIn(provider).includes(kind2), "holdsKind");
3632
+ var holdsKindOf = /* @__PURE__ */ __name((provider, kind2) => kindIn(provider) === void 0 ? kind2 === "messages" : holdsKind(provider, kind2), "holdsKindOf");
3633
+ var kindOf2 = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
3634
+
3635
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/money.js
3247
3636
  var CURRENCY_SCALES = {
3248
3637
  AED: 2,
3249
3638
  AMD: 2,
@@ -3337,7 +3726,17 @@ var quantityOf = /* @__PURE__ */ __name((text5) => {
3337
3726
  }, "quantityOf");
3338
3727
  var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
3339
3728
 
3340
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/finance.js
3729
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/deals.js
3730
+ var DEAL_KINDS = ["deal", "lead"];
3731
+ var DEAL_STATUSES = ["open", "won", "lost"];
3732
+ var STAGE_OUTCOMES = DEAL_STATUSES;
3733
+ var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
3734
+ var dealLine = /* @__PURE__ */ __name((deal) => {
3735
+ const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
3736
+ return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
3737
+ }, "dealLine");
3738
+
3739
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/finance.js
3341
3740
  var INVOICE_DIRECTIONS = ["receivable", "payable"];
3342
3741
  var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
3343
3742
  var MONEY_DIRECTIONS = ["in", "out"];
@@ -3366,56 +3765,18 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
3366
3765
  var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
3367
3766
  var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
3368
3767
 
3369
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/orders.js
3768
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/orders.js
3370
3769
  var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
3371
3770
  var ORDER_PURPOSES = ["personal", "business", "client", "other"];
3372
3771
  var orderLine = /* @__PURE__ */ __name((order) => {
3772
+ const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
3373
3773
  const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
3374
3774
  const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
3375
- return `${order.number ?? `#${order.id}`} \xB7 ${order.supplierName}${money} (${notes2})`;
3775
+ return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
3376
3776
  }, "orderLine");
3377
3777
  var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
3378
3778
 
3379
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/deals.js
3380
- var DEAL_KINDS = ["deal", "lead"];
3381
- var DEAL_STATUSES = ["open", "won", "lost"];
3382
- var STAGE_OUTCOMES = DEAL_STATUSES;
3383
- var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
3384
- var dealLine = /* @__PURE__ */ __name((deal) => {
3385
- const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
3386
- return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
3387
- }, "dealLine");
3388
-
3389
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/business.js
3390
- var CATALOG_KINDS = ["product", "service"];
3391
- var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
3392
- var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
3393
- var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
3394
- var PERIOD_UNITS = ["day", "week", "month", "year"];
3395
- var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
3396
- var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
3397
- var TRANSACTION_STATUSES = ["pending", "booked"];
3398
- var ORDER_DIRECTIONS = ["purchase", "sale"];
3399
- var intervalOf = /* @__PURE__ */ __name((text5, reason = "subscription.interval") => {
3400
- const match = typeof text5 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text5.trim()) : null;
3401
- if (!match)
3402
- throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
3403
- return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
3404
- }, "intervalOf");
3405
- var intervalText = /* @__PURE__ */ __name(({ count: count6, unit }) => `${count6}-${unit}`, "intervalText");
3406
- var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
3407
- var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
3408
- var productLine = /* @__PURE__ */ __name((product) => {
3409
- const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
3410
- const per = price && product.unit !== null ? ` per ${product.unit}` : "";
3411
- return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
3412
- }, "productLine");
3413
- var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
3414
- var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
3415
- var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
3416
- 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");
3417
-
3418
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/relations.js
3779
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/relations.js
3419
3780
  var ORGANIZATION_ROLES = [
3420
3781
  "employee",
3421
3782
  "contractor",
@@ -3426,10 +3787,11 @@ var ORGANIZATION_ROLES = [
3426
3787
  "contact"
3427
3788
  ];
3428
3789
  var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
3790
+ var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
3429
3791
  var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
3430
3792
  var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
3431
- var checkEngagement = /* @__PURE__ */ __name((kind, from, to, level) => {
3432
- if (kind !== "member-of" || from !== "person" || to !== "project")
3793
+ var checkEngagement = /* @__PURE__ */ __name((kind2, from, to, level) => {
3794
+ if (kind2 !== "member-of" || from !== "person" || to !== "project")
3433
3795
  throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
3434
3796
  reason: "relationship.engagement-ends"
3435
3797
  });
@@ -3452,46 +3814,54 @@ var RELATIONS = {
3452
3814
  "customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
3453
3815
  "partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
3454
3816
  "related-to": {
3455
- from: ["person", "organization", "project", "task", "deal", "lead"],
3817
+ from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
3456
3818
  to: ["person", "organization", "project", "task"],
3457
- roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES } }
3819
+ roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
3458
3820
  }
3459
3821
  };
3460
3822
  var RELATION_KINDS = Object.keys(RELATIONS);
3461
- var specOf = /* @__PURE__ */ __name((kind) => Object.hasOwn(RELATIONS, kind) ? RELATIONS[kind] : void 0, "specOf");
3462
- var isRelationKind = /* @__PURE__ */ __name((kind) => specOf(kind) !== void 0, "isRelationKind");
3823
+ var specOf = /* @__PURE__ */ __name((kind2) => Object.hasOwn(RELATIONS, kind2) ? RELATIONS[kind2] : void 0, "specOf");
3824
+ var isRelationKind = /* @__PURE__ */ __name((kind2) => specOf(kind2) !== void 0, "isRelationKind");
3463
3825
  var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
3464
- var checkEnds = /* @__PURE__ */ __name((kind, from, to) => {
3465
- const spec = specOf(kind);
3826
+ var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
3827
+ var checkEnds = /* @__PURE__ */ __name((kind2, from, to) => {
3828
+ const spec = specOf(kind2);
3466
3829
  if (!spec)
3467
3830
  throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
3468
- if (memberOnly(from) && (kind !== "member-of" || to !== "project"))
3831
+ if (memberOnly(from) && (kind2 !== "member-of" || to !== "project"))
3469
3832
  throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
3833
+ if (partyOnly(from, to))
3834
+ throw new CliError("validation_error", "a contract is related only to a person or an organization");
3470
3835
  if (!spec.from.includes(from) || !spec.to.includes(to))
3471
- throw new CliError("validation_error", `${kind} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
3836
+ throw new CliError("validation_error", `${kind2} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
3472
3837
  return spec;
3473
3838
  }, "checkEnds");
3474
- var rolesOf = /* @__PURE__ */ __name((kind, from, to) => {
3475
- const spec = specOf(kind);
3476
- if (kind === "member-of" && from !== "person")
3839
+ var rolesOf = /* @__PURE__ */ __name((kind2, from, to) => {
3840
+ const spec = specOf(kind2);
3841
+ if (kind2 === "member-of" && from !== "person")
3477
3842
  return void 0;
3478
3843
  return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
3479
3844
  }, "rolesOf");
3480
- var ROLE_LISTS = { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES, deal: DEAL_ROLES };
3481
- var roleListOf = /* @__PURE__ */ __name((kind, from, to) => {
3482
- const roles = rolesOf(kind, from, to);
3845
+ var ROLE_LISTS = {
3846
+ organization: ORGANIZATION_ROLES,
3847
+ project: PROJECT_ROLES,
3848
+ deal: DEAL_ROLES,
3849
+ contract: CONTRACT_ROLES
3850
+ };
3851
+ var roleListOf = /* @__PURE__ */ __name((kind2, from, to) => {
3852
+ const roles = rolesOf(kind2, from, to);
3483
3853
  return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
3484
3854
  }, "roleListOf");
3485
- var checkRole = /* @__PURE__ */ __name((kind, from, to, role, extra = []) => {
3486
- const roles = rolesOf(kind, from, to)?.concat(extra);
3855
+ var checkRole = /* @__PURE__ */ __name((kind2, from, to, role, extra = []) => {
3856
+ const roles = rolesOf(kind2, from, to)?.concat(extra);
3487
3857
  if (roles && !roles.includes(role))
3488
- throw new CliError("validation_error", `a ${from}'s role on ${kind} ${to} is one of ${roles.join(", ")}`, {
3858
+ throw new CliError("validation_error", `a ${from}'s role on ${kind2} ${to} is one of ${roles.join(", ")}`, {
3489
3859
  reason: "relationship.role-unknown"
3490
3860
  });
3491
3861
  return role;
3492
3862
  }, "checkRole");
3493
- var isSymmetric = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric === true, "isSymmetric");
3494
- var inverseOf = /* @__PURE__ */ __name((kind) => specOf(kind)?.symmetric ? kind : specOf(kind)?.inverse ?? null, "inverseOf");
3863
+ var isSymmetric = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric === true, "isSymmetric");
3864
+ var inverseOf = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric ? kind2 : specOf(kind2)?.inverse ?? null, "inverseOf");
3495
3865
  var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
3496
3866
  var standingOf = /* @__PURE__ */ __name((link, now) => {
3497
3867
  if (link.endsAt != null && link.endsAt <= now)
@@ -3504,10 +3874,40 @@ var standingOf = /* @__PURE__ */ __name((link, now) => {
3504
3874
  }, "standingOf");
3505
3875
  var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
3506
3876
  var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
3507
- var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE 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");
3877
+ var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
3878
+ 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");
3508
3879
  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");
3509
3880
 
3510
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@wirecat+cli-base@0.80.7_commander@15.0.0_esbuild@0.28.2_type_89df442a19027064da492ef27322716d/node_modules/@wirecat/cli-core/dist/domain/tags.js
3881
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/business.js
3882
+ var CATALOG_KINDS = ["product", "service"];
3883
+ var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
3884
+ var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
3885
+ var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
3886
+ var PERIOD_UNITS = ["day", "week", "month", "year"];
3887
+ var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
3888
+ var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
3889
+ var TRANSACTION_STATUSES = ["pending", "booked"];
3890
+ var ORDER_DIRECTIONS = ["purchase", "sale"];
3891
+ var intervalOf = /* @__PURE__ */ __name((text5, reason = "subscription.interval") => {
3892
+ const match = typeof text5 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text5.trim()) : null;
3893
+ if (!match)
3894
+ throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
3895
+ return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
3896
+ }, "intervalOf");
3897
+ var intervalText = /* @__PURE__ */ __name(({ count: count6, unit }) => `${count6}-${unit}`, "intervalText");
3898
+ var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
3899
+ var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
3900
+ var productLine = /* @__PURE__ */ __name((product) => {
3901
+ const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
3902
+ const per = price && product.unit !== null ? ` per ${product.unit}` : "";
3903
+ return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
3904
+ }, "productLine");
3905
+ var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
3906
+ var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
3907
+ var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
3908
+ 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");
3909
+
3910
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/tags.js
3511
3911
  var TAG_TYPES = ["chat", "contact", "message", "task"];
3512
3912
  var TAG = /^[a-z0-9-]{1,32}$/;
3513
3913
  var tagOf = /* @__PURE__ */ __name((value) => {
@@ -3593,6 +3993,7 @@ export {
3593
3993
  validateMeetingFindings,
3594
3994
  meetingFindingFingerprint,
3595
3995
  MEETING_FIELD_NAMES,
3996
+ liftMeetingFields,
3596
3997
  parseMeetingQuery,
3597
3998
  transcriptLanguage,
3598
3999
  importFiles,
@@ -3625,6 +4026,48 @@ export {
3625
4026
  validateMeetingSeriesInventoryCursor,
3626
4027
  aggregateMeetingCounts,
3627
4028
  aggregateMeetingStats,
4029
+ READ_BUDGET_EXCEEDED,
4030
+ formatLocator,
4031
+ isLocator,
4032
+ parseLocator,
4033
+ SIMPLE_REFERENCES,
4034
+ REF_KINDS,
4035
+ formatReference,
4036
+ parseReference,
4037
+ canonicalReference,
4038
+ looksLikeReference,
4039
+ KINDS,
4040
+ CRM_OPENS,
4041
+ PROVIDERS,
4042
+ providerLabel,
4043
+ FOLDER_PROVIDERS,
4044
+ isFolderProvider,
4045
+ folderProviderSql,
4046
+ folderProviderOf,
4047
+ DOCUMENT_ACCOUNT_PROVIDERS,
4048
+ isDocumentAccountProvider,
4049
+ ADDED_PROVIDER,
4050
+ ADDED_ACCOUNT,
4051
+ notAdded,
4052
+ filesAccountSql,
4053
+ INTERNAL_NOTES,
4054
+ UNKNOWN_PROVIDER,
4055
+ providerEntryOf,
4056
+ kindsOfEntry,
4057
+ unitedKinds,
4058
+ providers,
4059
+ useProviders,
4060
+ useStoredProviders,
4061
+ addProvider,
4062
+ isKind,
4063
+ providerNamed,
4064
+ kindIn,
4065
+ kindsIn,
4066
+ importedOf,
4067
+ isImportedProvider,
4068
+ holdsKind,
4069
+ holdsKindOf,
4070
+ kindOf2 as kindOf,
3628
4071
  CURRENCY_SCALES,
3629
4072
  parseDecimal,
3630
4073
  formatDecimal,
@@ -3636,6 +4079,11 @@ export {
3636
4079
  moneyLabel,
3637
4080
  quantityOf,
3638
4081
  lineUnits,
4082
+ DEAL_KINDS,
4083
+ DEAL_STATUSES,
4084
+ STAGE_OUTCOMES,
4085
+ DEAL_ROLES,
4086
+ dealLine,
3639
4087
  INVOICE_DIRECTIONS,
3640
4088
  INVOICE_STATUSES,
3641
4089
  MONEY_DIRECTIONS,
@@ -3649,29 +4097,9 @@ export {
3649
4097
  ORDER_PURPOSES,
3650
4098
  orderLine,
3651
4099
  orderTitle,
3652
- DEAL_KINDS,
3653
- DEAL_STATUSES,
3654
- STAGE_OUTCOMES,
3655
- DEAL_ROLES,
3656
- dealLine,
3657
- CATALOG_KINDS,
3658
- BUSINESS_KINDS,
3659
- CONTRACT_KINDS,
3660
- CONTRACT_STATUSES,
3661
- PERIOD_UNITS,
3662
- SUBSCRIPTION_STATUSES,
3663
- WALLET_KINDS,
3664
- TRANSACTION_STATUSES,
3665
- ORDER_DIRECTIONS,
3666
- intervalOf,
3667
- intervalText,
3668
- productLine,
3669
- contractLine,
3670
- subscriptionLine,
3671
- walletLine,
3672
- transactionLine,
3673
4100
  ORGANIZATION_ROLES,
3674
4101
  PROJECT_ROLES,
4102
+ CONTRACT_ROLES,
3675
4103
  ENGAGEMENT_LEVELS,
3676
4104
  isEngagement,
3677
4105
  checkEngagement,
@@ -3691,8 +4119,25 @@ export {
3691
4119
  standingOf,
3692
4120
  isUsable,
3693
4121
  usableLink,
4122
+ KEYED,
3694
4123
  notOverriddenSql,
3695
4124
  usableLinkSql,
4125
+ CATALOG_KINDS,
4126
+ BUSINESS_KINDS,
4127
+ CONTRACT_KINDS,
4128
+ CONTRACT_STATUSES,
4129
+ PERIOD_UNITS,
4130
+ SUBSCRIPTION_STATUSES,
4131
+ WALLET_KINDS,
4132
+ TRANSACTION_STATUSES,
4133
+ ORDER_DIRECTIONS,
4134
+ intervalOf,
4135
+ intervalText,
4136
+ productLine,
4137
+ contractLine,
4138
+ subscriptionLine,
4139
+ walletLine,
4140
+ transactionLine,
3696
4141
  TAG_TYPES,
3697
4142
  tagOf,
3698
4143
  normalizeTag