@wirecat/cli-memo 0.131.45 → 0.131.47

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 (126) hide show
  1. package/dist/bin/memo.js +2 -2
  2. package/dist/bundle/{all-profiles-ZBASDAVU.js → all-profiles-75EGCXK3.js} +5 -5
  3. package/dist/bundle/{anthropic-3ZS3RCUH.js → anthropic-PTAYBCPR.js} +3 -3
  4. package/dist/bundle/{app-server-PQF22PMD.js → app-server-YSUBXGGB.js} +41 -38
  5. package/dist/bundle/auto-GB35FRTV.js +86 -0
  6. package/dist/bundle/{bun-3CGVV3V2.js → bun-3AIG5ML4.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-D6T3ESTG.js → bun-sqlite-5FCGI6EO.js} +2 -2
  8. package/dist/bundle/{chunk-CAPDRDQU.js → chunk-25RDNYKZ.js} +5 -5
  9. package/dist/bundle/{chunk-L45FSDH3.js → chunk-32QM6X5H.js} +1 -1
  10. package/dist/bundle/{chunk-NB267XRJ.js → chunk-3HPFTKDH.js} +4 -4
  11. package/dist/bundle/{chunk-UP2K5XUA.js → chunk-4LWX2WOB.js} +3 -3
  12. package/dist/bundle/{chunk-TVZEELSS.js → chunk-5N6HWFXN.js} +508 -338
  13. package/dist/bundle/{chunk-SK3TPK5Y.js → chunk-6IVHND3S.js} +4 -4
  14. package/dist/bundle/{chunk-75EEQB2R.js → chunk-6QNPOBR5.js} +11 -11
  15. package/dist/bundle/{chunk-75RJJQ2Q.js → chunk-6TKWJKPS.js} +10 -10
  16. package/dist/bundle/{chunk-CH37NCAP.js → chunk-BNIWLVWG.js} +3 -3
  17. package/dist/bundle/{chunk-IQ2MW47B.js → chunk-CODD5SXC.js} +27 -27
  18. package/dist/bundle/{chunk-HAPE26JK.js → chunk-DDADFHR7.js} +12 -12
  19. package/dist/bundle/{chunk-CGJFYMVZ.js → chunk-DMTLG2GD.js} +7 -7
  20. package/dist/bundle/{chunk-GOJZ3FQY.js → chunk-DS4DOK75.js} +22 -21
  21. package/dist/bundle/{chunk-PMUAUR5S.js → chunk-DWBTCOF2.js} +4 -4
  22. package/dist/bundle/{chunk-5IYS3BWO.js → chunk-EFQCDCLY.js} +56 -56
  23. package/dist/bundle/{chunk-IYJGFBNN.js → chunk-ELKK5M66.js} +5 -5
  24. package/dist/bundle/{chunk-YDNM5KYV.js → chunk-EVZI54B5.js} +4 -4
  25. package/dist/bundle/{chunk-GTPWWGQI.js → chunk-F4HMPMET.js} +7 -7
  26. package/dist/bundle/{chunk-2OYB4PWV.js → chunk-FSAMZHIM.js} +5 -5
  27. package/dist/bundle/{chunk-G3FRUKAD.js → chunk-G3YSCD77.js} +182 -158
  28. package/dist/bundle/{chunk-NTFEJ52I.js → chunk-G4W42RGE.js} +1 -1
  29. package/dist/bundle/{chunk-7EA6M6RA.js → chunk-GA3KFYEZ.js} +4 -4
  30. package/dist/bundle/{chunk-CXRCADXS.js → chunk-GOFPCOEI.js} +9 -9
  31. package/dist/bundle/{chunk-65MK55RS.js → chunk-GQLSVXS2.js} +20 -20
  32. package/dist/bundle/{chunk-YWTWDX4F.js → chunk-HCZV537M.js} +1 -1
  33. package/dist/bundle/{chunk-OMBFF6Z6.js → chunk-HVTW2M6T.js} +1 -1
  34. package/dist/bundle/{chunk-EJ2PEYQU.js → chunk-HYEYRFWX.js} +1 -1
  35. package/dist/bundle/{chunk-AOSSO4YI.js → chunk-I2RDACUF.js} +6 -6
  36. package/dist/bundle/{chunk-KE3CYUON.js → chunk-ILK5BCBB.js} +1 -1
  37. package/dist/bundle/{chunk-U4J7TAOW.js → chunk-IPLPMD6H.js} +1 -1
  38. package/dist/bundle/{chunk-7WJEQ36E.js → chunk-IPMBB6W5.js} +2 -2
  39. package/dist/bundle/{chunk-ZJXAYYLF.js → chunk-J324GKJM.js} +1 -1
  40. package/dist/bundle/{chunk-PXSGUVZP.js → chunk-KLBZJZD2.js} +637 -119
  41. package/dist/bundle/{chunk-FMMIPFTU.js → chunk-KWM7HLAI.js} +4 -4
  42. package/dist/bundle/{chunk-CRLYBXV5.js → chunk-LE7NROV6.js} +43 -36
  43. package/dist/bundle/{chunk-25MS26SH.js → chunk-MCMEBL3C.js} +23 -10
  44. package/dist/bundle/{chunk-FRT7URL7.js → chunk-MMJDQQFX.js} +483 -282
  45. package/dist/bundle/{chunk-TKFG75MJ.js → chunk-MSBRZ5QD.js} +2 -2
  46. package/dist/bundle/{chunk-IJBJ47GI.js → chunk-N5QQFDNV.js} +2 -2
  47. package/dist/bundle/{chunk-B4PZQYGP.js → chunk-N63KZFH4.js} +8 -8
  48. package/dist/bundle/{chunk-NBA3GJBR.js → chunk-OSCRP52P.js} +805 -347
  49. package/dist/bundle/{chunk-GBRK3WXY.js → chunk-PGVADNDD.js} +2 -2
  50. package/dist/bundle/{chunk-HXCSD2XV.js → chunk-R44PUK7G.js} +1 -1
  51. package/dist/bundle/{chunk-F2VTAFIT.js → chunk-SYTYLLYO.js} +1 -1
  52. package/dist/bundle/{chunk-MKVUBQEG.js → chunk-U35N3EC7.js} +1 -1
  53. package/dist/bundle/{chunk-5ZHM6SZW.js → chunk-U75ANK5K.js} +1 -1
  54. package/dist/bundle/{chunk-7G7N3IUO.js → chunk-UE4GMPBY.js} +4 -2
  55. package/dist/bundle/{chunk-OTOKJAYR.js → chunk-UFVGAFID.js} +3 -3
  56. package/dist/bundle/{chunk-OT4CLMVF.js → chunk-V3B5COFP.js} +3 -3
  57. package/dist/bundle/{chunk-6NQTGFAL.js → chunk-V6OYLCCM.js} +2 -2
  58. package/dist/bundle/{chunk-IAPKZSC5.js → chunk-W2JVP7GK.js} +1 -1
  59. package/dist/bundle/{chunk-LL3Z6KA3.js → chunk-W3T45MMN.js} +5 -5
  60. package/dist/bundle/{chunk-EJ4X6XH2.js → chunk-XRRPQCTS.js} +1 -1
  61. package/dist/bundle/{chunk-G6TRTDHB.js → chunk-Y4ZXDJQF.js} +2 -2
  62. package/dist/bundle/{chunk-WGX73SAA.js → chunk-YMK35KVV.js} +2 -2
  63. package/dist/bundle/{chunk-7G63XPDR.js → chunk-ZKH6LC5P.js} +7 -7
  64. package/dist/bundle/{chunk-C6GSSMDG.js → chunk-ZLIARJU4.js} +1 -1
  65. package/dist/bundle/{command-contract-K3GJRRXT.js → command-contract-YYILWWYQ.js} +11 -11
  66. package/dist/bundle/{decode-TTMBMSGQ.js → decode-F2A2BLIA.js} +2 -2
  67. package/dist/bundle/{echarts-7XN2RLJT.js → echarts-JL55HJCM.js} +2 -2
  68. package/dist/bundle/{embed-UKTHDQH5.js → embed-74KVORNN.js} +3 -3
  69. package/dist/bundle/{embedder-SCKLAVKW.js → embedder-GACNPCZN.js} +6 -6
  70. package/dist/bundle/{entry-VQRYB2HE.js → entry-7FI2H4RQ.js} +4 -4
  71. package/dist/bundle/failure-AHPPXHAW.js +66 -0
  72. package/dist/bundle/{first-run-RL6ZRY3Y.js → first-run-D4VBIJ7H.js} +5 -5
  73. package/dist/bundle/{first-screen-CRURWNKP.js → first-screen-D7Q2U7VP.js} +12 -12
  74. package/dist/bundle/{instructions-KGU67SPR.js → instructions-QNPIVGKX.js} +1 -1
  75. package/dist/bundle/{mcp-CSN7BDNG.js → mcp-AFXHH33V.js} +35 -35
  76. package/dist/bundle/memo.js +6 -6
  77. package/dist/bundle/{node-S5LQLVMO.js → node-SPFML2D5.js} +2 -2
  78. package/dist/bundle/{node-sqlite-PFCIEDPX.js → node-sqlite-T3KILRCP.js} +3 -3
  79. package/dist/bundle/{oauth-KJOGYDPV.js → oauth-ZOGSHZF3.js} +4 -4
  80. package/dist/bundle/{open-TPBENKAD.js → open-XXFVCGCA.js} +2 -2
  81. package/dist/bundle/{openai-UOYTHO32.js → openai-JRHZLFKD.js} +7 -7
  82. package/dist/bundle/{process-JWKE7GPV.js → process-OGYYVVLG.js} +1 -1
  83. package/dist/bundle/{program-RJ6X4DXE.js → program-EFCQACPD.js} +138 -61
  84. package/dist/bundle/{prompt-5HQ3Z7ZS.js → prompt-53D5WVD3.js} +2 -2
  85. package/dist/bundle/{recognize-5ILXEPII.js → recognize-7GYZKJCD.js} +1 -1
  86. package/dist/bundle/{remote-WIN3HJII.js → remote-V5GUFZCG.js} +4 -4
  87. package/dist/bundle/{rerank-JKHDSEBI.js → rerank-FUNVBYFI.js} +4 -4
  88. package/dist/bundle/{serve-VMHFRDYH.js → serve-ZLUYFAXC.js} +6 -6
  89. package/dist/bundle/server-4OJC7ZWM.js +61 -0
  90. package/dist/bundle/server-CGUUZBLB.js +48 -0
  91. package/dist/bundle/{server-TKWVP4OJ.js → server-HJRMD3XD.js} +50 -50
  92. package/dist/bundle/{state-OWOLD7JI.js → state-4P7H6KBM.js} +3 -3
  93. package/dist/bundle/{store-6GFFSNRY.js → store-NILJK24C.js} +11 -9
  94. package/dist/bundle/store-maintenance-command-VP7CIBSS.js +48 -0
  95. package/dist/bundle/update-NPK4DT2E.js +69 -0
  96. package/dist/contract-overrides/doctor.d.ts.map +1 -1
  97. package/dist/contract-overrides/doctor.js +6 -0
  98. package/dist/contract-overrides/doctor.js.map +1 -1
  99. package/dist/doctor/command.d.ts +23 -2
  100. package/dist/doctor/command.d.ts.map +1 -1
  101. package/dist/doctor/command.js +13 -5
  102. package/dist/doctor/command.js.map +1 -1
  103. package/dist/examples.d.ts.map +1 -1
  104. package/dist/examples.js +2 -0
  105. package/dist/examples.js.map +1 -1
  106. package/dist/schedule/command.d.ts.map +1 -1
  107. package/dist/schedule/command.js +2 -0
  108. package/dist/schedule/command.js.map +1 -1
  109. package/dist/schedule/mail-triage-input.d.ts +24 -0
  110. package/dist/schedule/mail-triage-input.d.ts.map +1 -0
  111. package/dist/schedule/mail-triage-input.js +53 -0
  112. package/dist/schedule/mail-triage-input.js.map +1 -0
  113. package/dist/store/info-command.d.ts.map +1 -1
  114. package/dist/store/info-command.js +23 -1
  115. package/dist/store/info-command.js.map +1 -1
  116. package/dist/version.d.ts +1 -1
  117. package/dist/version.js +1 -1
  118. package/package.json +3 -3
  119. package/skills/mail-triage/SKILL.md +25 -27
  120. package/dist/bundle/auto-NW7IP4ST.js +0 -86
  121. package/dist/bundle/failure-JHW2U2OF.js +0 -66
  122. package/dist/bundle/server-IBJ23GCB.js +0 -48
  123. package/dist/bundle/server-SNWCFMJN.js +0 -61
  124. package/dist/bundle/store-maintenance-command-7DMPWFT4.js +0 -48
  125. package/dist/bundle/update-KSB7VYAW.js +0 -69
  126. /package/dist/bundle/{chunk-DL5LDAOS.js → chunk-JPGEFBRW.js} +0 -0
@@ -100,11 +100,11 @@ import {
100
100
  validateQuery,
101
101
  walkQuery,
102
102
  zonedMoment
103
- } from "./chunk-5IYS3BWO.js";
103
+ } from "./chunk-EFQCDCLY.js";
104
104
  import {
105
105
  holdsCredential,
106
106
  secretNamed
107
- } from "./chunk-EJ4X6XH2.js";
107
+ } from "./chunk-XRRPQCTS.js";
108
108
  import {
109
109
  DEFAULT_STEMMERS,
110
110
  DEFAULT_STEMMERS_VERSION,
@@ -117,26 +117,27 @@ import {
117
117
  fold,
118
118
  normalize,
119
119
  parseStemmers
120
- } from "./chunk-CGJFYMVZ.js";
120
+ } from "./chunk-DMTLG2GD.js";
121
121
  import {
122
122
  DEFAULT_TASK_CATEGORIES,
123
123
  sharedConfigPath,
124
124
  storedTaskCategories,
125
125
  taskCategoriesReader
126
- } from "./chunk-YDNM5KYV.js";
126
+ } from "./chunk-EVZI54B5.js";
127
127
  import {
128
128
  refuseOwnerStoreInTests,
129
129
  storePath
130
- } from "./chunk-U4J7TAOW.js";
130
+ } from "./chunk-IPLPMD6H.js";
131
131
  import {
132
132
  quietSqliteWarning,
133
133
  storeCapable
134
- } from "./chunk-CAPDRDQU.js";
134
+ } from "./chunk-25RDNYKZ.js";
135
135
  import {
136
136
  PRAGMAS,
137
137
  TIME_LIMIT_FUNCTION,
138
- TimeLimitReached
139
- } from "./chunk-7G7N3IUO.js";
138
+ TimeLimitReached,
139
+ isQueryOnly
140
+ } from "./chunk-UE4GMPBY.js";
140
141
  import {
141
142
  array,
142
143
  boolean,
@@ -186,7 +187,7 @@ import {
186
187
  sql,
187
188
  sqliteTable,
188
189
  text
189
- } from "./chunk-C6GSSMDG.js";
190
+ } from "./chunk-ZLIARJU4.js";
190
191
  import {
191
192
  __commonJS,
192
193
  __name,
@@ -9885,10 +9886,10 @@ var require_cjs = __commonJS({
9885
9886
  }
9886
9887
  __name(suffixLookup, "suffixLookup");
9887
9888
  var RESULT = getEmptyResult();
9888
- function parse(url, options) {
9889
+ function parse2(url, options) {
9889
9890
  return parseImpl(url, 5, suffixLookup, options, getEmptyResult());
9890
9891
  }
9891
- __name(parse, "parse");
9892
+ __name(parse2, "parse");
9892
9893
  function getHostname(url, options) {
9893
9894
  resetResult(RESULT);
9894
9895
  return parseImpl(url, 0, suffixLookup, options, RESULT).hostname;
@@ -9926,11 +9927,11 @@ var require_cjs = __commonJS({
9926
9927
  exports.getHostname = getHostname;
9927
9928
  exports.getPublicSuffix = getPublicSuffix;
9928
9929
  exports.getSubdomain = getSubdomain;
9929
- exports.parse = parse;
9930
+ exports.parse = parse2;
9930
9931
  }
9931
9932
  });
9932
9933
 
9933
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/account-store.js
9934
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/account-store.js
9934
9935
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
9935
9936
  const methods = whole;
9936
9937
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -10058,7 +10059,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
10058
10059
  };
10059
10060
  }, "bindAccount");
10060
10061
 
10061
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/locator.js
10062
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/locator.js
10062
10063
  var SCHEME = "msg:";
10063
10064
  var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
10064
10065
  var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
@@ -10072,7 +10073,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
10072
10073
  return { provider, account, chat: chat2, message: message2 };
10073
10074
  }, "parseLocator");
10074
10075
 
10075
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/references.js
10076
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/references.js
10076
10077
  var SIMPLE_REFERENCES = [
10077
10078
  "note",
10078
10079
  "document",
@@ -10223,7 +10224,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
10223
10224
  return match !== null && byPrefix.has(match[1]);
10224
10225
  }, "looksLikeReference");
10225
10226
 
10226
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/providers.js
10227
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/providers.js
10227
10228
  var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
10228
10229
  var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
10229
10230
  var PROVIDERS = [
@@ -10339,7 +10340,7 @@ var providerNamed = /* @__PURE__ */ __name((word2) => {
10339
10340
  var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
10340
10341
  var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
10341
10342
 
10342
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/query.js
10343
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/query.js
10343
10344
  var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
10344
10345
  var inSource = /* @__PURE__ */ __name((source2, provider) => source2 === "all" || source2 === "bots" && isBotProvider(provider) || source2 === "personal" && !isBotProvider(provider) || source2 === provider || providerNamed(source2)?.name === provider || isKind(source2) && kindOf(provider) === source2, "inSource");
10345
10346
  var fail = /* @__PURE__ */ __name((message2) => {
@@ -10362,7 +10363,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
10362
10363
  return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
10363
10364
  }, "sourceOf");
10364
10365
 
10365
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/account-list.js
10366
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/account-list.js
10366
10367
  var ACCOUNT_GROUPS = "accountGroups";
10367
10368
  var ACCOUNT_GROUPS_SETTING = "account_groups";
10368
10369
  var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
@@ -10550,7 +10551,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
10550
10551
  return { accounts: [...chosen.values()], skipped };
10551
10552
  }, "fitting");
10552
10553
 
10553
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10554
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10554
10555
  var IndexBuilderOn = class {
10555
10556
  static {
10556
10557
  __name(this, "IndexBuilderOn");
@@ -10745,7 +10746,7 @@ function alias(table, alias2) {
10745
10746
  }
10746
10747
  __name(alias, "alias");
10747
10748
 
10748
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10749
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10749
10750
  var ENTITY_TABLES = {
10750
10751
  account: "accounts",
10751
10752
  attachment: "attachments",
@@ -10791,7 +10792,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
10791
10792
  return { table, pointer, type, count, known: known2 };
10792
10793
  }).filter(({ count }) => count > 0)), "orphanPointers");
10793
10794
 
10794
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
10795
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
10795
10796
  var canonicalTags = sqliteTable("canonical_tags", {
10796
10797
  id: integer("id").primaryKey(),
10797
10798
  name: text("name").notNull().unique(),
@@ -10800,7 +10801,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
10800
10801
  updatedAt: integer("updated_at").notNull()
10801
10802
  });
10802
10803
 
10803
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
10804
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
10804
10805
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
10805
10806
  sourceKey: text("source_key").notNull(),
10806
10807
  collection: text("collection").notNull(),
@@ -10810,13 +10811,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
10810
10811
  createdAt: integer("created_at").notNull()
10811
10812
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
10812
10813
 
10813
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
10814
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
10814
10815
  var documentIndexPending = sqliteTable("document_index_pending", {
10815
10816
  id: integer("id").notNull(),
10816
10817
  indexableType: text("indexable_type").notNull()
10817
10818
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
10818
10819
 
10819
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
10820
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
10820
10821
  var tagRedirects = sqliteTable("tag_redirects", {
10821
10822
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
10822
10823
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -10842,7 +10843,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
10842
10843
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
10843
10844
  ]);
10844
10845
 
10845
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
10846
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
10846
10847
  var accounts = sqliteTable("accounts", {
10847
10848
  id: integer("id").primaryKey(),
10848
10849
  provider: text("provider").notNull(),
@@ -12176,9 +12177,10 @@ var pipelines = sqliteTable("pipelines", {
12176
12177
  name: text("name").notNull(),
12177
12178
  nameFolded: text("name_folded").notNull(),
12178
12179
  createdAt: integer("created_at").notNull(),
12179
- updatedAt: integer("updated_at").notNull()
12180
+ updatedAt: integer("updated_at").notNull(),
12181
+ deletedAt: integer("deleted_at")
12180
12182
  }, (table) => [
12181
- uniqueIndex("pipelines_by_account_id_external_id").on(table.accountId, table.externalId).where(sql`account_id IS NOT NULL AND external_id IS NOT NULL`),
12183
+ uniqueIndex("pipelines_by_account_id_kind_external_id").on(table.accountId, table.kind, table.externalId).where(sql`account_id IS NOT NULL AND external_id IS NOT NULL`),
12182
12184
  uniqueIndex("pipelines_by_name_folded_kind").on(table.nameFolded, table.kind).where(sql`account_id IS NULL`)
12183
12185
  ]);
12184
12186
  var pipelineStages = sqliteTable("pipeline_stages", {
@@ -12190,7 +12192,8 @@ var pipelineStages = sqliteTable("pipeline_stages", {
12190
12192
  outcome: text("outcome").notNull().default("open"),
12191
12193
  externalId: text("external_id"),
12192
12194
  createdAt: integer("created_at").notNull(),
12193
- updatedAt: integer("updated_at").notNull()
12195
+ updatedAt: integer("updated_at").notNull(),
12196
+ deletedAt: integer("deleted_at")
12194
12197
  }, (table) => [
12195
12198
  unique().on(table.pipelineId, table.nameFolded),
12196
12199
  uniqueIndex("pipeline_stages_by_pipeline_id_external_id").on(table.pipelineId, table.externalId).where(sql`external_id IS NOT NULL`),
@@ -12270,6 +12273,21 @@ var pipelineStageChanges = sqliteTable("pipeline_stage_changes", {
12270
12273
  index("pipeline_stage_changes_by_from_stage_id").on(table.fromStageId),
12271
12274
  index("pipeline_stage_changes_by_to_stage_id").on(table.toStageId)
12272
12275
  ]);
12276
+ var crmFields = sqliteTable("crm_fields", {
12277
+ id: integer("id").primaryKey(),
12278
+ accountId: integer("account_id").notNull().references(() => accounts.id),
12279
+ kind: text("kind").notNull(),
12280
+ code: text("code").notNull(),
12281
+ label: text("label"),
12282
+ type: text("type").notNull(),
12283
+ multiple: integer("multiple").notNull(),
12284
+ filterable: integer("filterable").notNull(),
12285
+ options: text("options"),
12286
+ position: integer("position").notNull(),
12287
+ createdAt: integer("created_at").notNull(),
12288
+ updatedAt: integer("updated_at").notNull(),
12289
+ deletedAt: integer("deleted_at")
12290
+ }, (table) => [unique().on(table.accountId, table.kind, table.code)]);
12273
12291
  var records = sqliteTable("records", {
12274
12292
  id: integer("id").primaryKey(),
12275
12293
  accountId: integer("account_id").notNull().references(() => accounts.id),
@@ -12611,7 +12629,7 @@ var storeSettings = sqliteTable("store_settings", {
12611
12629
  at: integer("at").notNull()
12612
12630
  });
12613
12631
 
12614
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
12632
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
12615
12633
  var ARMS = [
12616
12634
  [
12617
12635
  "message",
@@ -12738,7 +12756,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
12738
12756
  return recomputed;
12739
12757
  }, "drainInvolvementQueue");
12740
12758
 
12741
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/mentions.js
12759
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/mentions.js
12742
12760
  import { domainToUnicode } from "node:url";
12743
12761
 
12744
12762
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -22760,7 +22778,7 @@ var oa = /* @__PURE__ */ __name((e) => {
22760
22778
  }, "oa");
22761
22779
  var na = { parse: O, get: aa, isValid: oa };
22762
22780
 
22763
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
22781
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
22764
22782
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
22765
22783
  var ID = /^[\w-]{10,}$/;
22766
22784
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -22801,7 +22819,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
22801
22819
  return { url, documentId: googleDocumentId(url) };
22802
22820
  }), "googleDocumentLinks");
22803
22821
 
22804
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
22822
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
22805
22823
  var PHONE_PLANS = [
22806
22824
  {
22807
22825
  country: "us",
@@ -23181,7 +23199,7 @@ var PHONE_PLANS = [
23181
23199
  }
23182
23200
  ];
23183
23201
 
23184
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/phones.js
23202
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/phones.js
23185
23203
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
23186
23204
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
23187
23205
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -23222,7 +23240,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
23222
23240
  return void 0;
23223
23241
  }, "nationalPhone");
23224
23242
 
23225
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/places.js
23243
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/places.js
23226
23244
  var BEFORE = [
23227
23245
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
23228
23246
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -23482,7 +23500,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
23482
23500
  return found2.sort((a, b) => a.start - b.start);
23483
23501
  }, "findPlaces");
23484
23502
 
23485
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/mentions.js
23503
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/mentions.js
23486
23504
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
23487
23505
  var MENTION_VERSIONS = {
23488
23506
  phone: 1,
@@ -23672,7 +23690,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
23672
23690
  };
23673
23691
  }, "typedPhone");
23674
23692
 
23675
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/first-names.js
23693
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/first-names.js
23676
23694
  var RUSSIAN = "\u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0435\u0439 \u0410\u043D\u0430\u0442\u043E\u043B\u0438\u0439 \u0410\u043D\u0434\u0440\u0435\u0439 \u0410\u043D\u0442\u043E\u043D \u0410\u0440\u043A\u0430\u0434\u0438\u0439 \u0410\u0440\u0441\u0435\u043D\u0438\u0439 \u0410\u0440\u0442\u0451\u043C \u0410\u0440\u0442\u0435\u043C \u0410\u0440\u0442\u0443\u0440 \u0411\u043E\u0440\u0438\u0441 \u0412\u0430\u0434\u0438\u043C \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0412\u0430\u043B\u0435\u0440\u0438\u0439 \u0412\u0430\u0441\u0438\u043B\u0438\u0439 \u0412\u0438\u043A\u0442\u043E\u0440 \u0412\u0438\u0442\u0430\u043B\u0438\u0439 \u0412\u043B\u0430\u0434\u0438\u043C\u0438\u0440 \u0412\u043B\u0430\u0434\u0438\u0441\u043B\u0430\u0432 \u0412\u0441\u0435\u0432\u043E\u043B\u043E\u0434 \u0412\u044F\u0447\u0435\u0441\u043B\u0430\u0432 \u0413\u0435\u043D\u043D\u0430\u0434\u0438\u0439 \u0413\u0435\u043E\u0440\u0433\u0438\u0439 \u0413\u043B\u0435\u0431 \u0413\u0440\u0438\u0433\u043E\u0440\u0438\u0439 \u0414\u0430\u043D\u0438\u0438\u043B \u0414\u0430\u043D\u0438\u043B\u0430 \u0414\u0435\u043D\u0438\u0441 \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0415\u0432\u0433\u0435\u043D\u0438\u0439 \u0415\u0433\u043E\u0440 \u0418\u0432\u0430\u043D \u0418\u0433\u043E\u0440\u044C \u0418\u043B\u044C\u044F \u041A\u0438\u0440\u0438\u043B\u043B \u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u0438\u043D \u041B\u0435\u043E\u043D\u0438\u0434 \u041C\u0430\u043A\u0441\u0438\u043C \u041C\u0430\u0440\u0430\u0442 \u041C\u0430\u0442\u0432\u0435\u0439 \u041C\u0438\u0445\u0430\u0438\u043B \u041D\u0438\u043A\u0438\u0442\u0430 \u041D\u0438\u043A\u043E\u043B\u0430\u0439 \u041E\u043B\u0435\u0433 \u041F\u0430\u0432\u0435\u043B \u041F\u0451\u0442\u0440 \u041F\u0435\u0442\u0440 \u0420\u043E\u0434\u0438\u043E\u043D \u0420\u043E\u0441\u0442\u0438\u0441\u043B\u0430\u0432 \u0420\u0443\u0441\u043B\u0430\u043D \u0420\u0443\u0441\u0442\u0430\u043C \u0421\u0435\u043C\u0451\u043D \u0421\u0435\u043C\u0435\u043D \u0421\u0435\u0440\u0433\u0435\u0439 \u0421\u0442\u0430\u043D\u0438\u0441\u043B\u0430\u0432 \u0421\u0442\u0435\u043F\u0430\u043D \u0422\u0438\u043C\u043E\u0444\u0435\u0439 \u0422\u0438\u043C\u0443\u0440 \u0424\u0451\u0434\u043E\u0440 \u0424\u0435\u0434\u043E\u0440 \u0424\u0438\u043B\u0438\u043F\u043F \u042D\u0434\u0443\u0430\u0440\u0434 \u042E\u0440\u0438\u0439 \u042F\u0440\u043E\u0441\u043B\u0430\u0432 \u042F\u043A\u043E\u0432 \u042D\u043B\u044C\u0434\u0430\u0440 \u0414\u0430\u0432\u0438\u0434 \u0417\u0430\u0445\u0430\u0440 \u0421\u0430\u0432\u0435\u043B\u0438\u0439 \u041C\u0438\u0440\u043E\u043D \u041F\u043B\u0430\u0442\u043E\u043D \u0414\u0435\u043C\u0438\u0434 \u0410\u0440\u0441\u0435\u043D \u041D\u0443\u0440\u043B\u0430\u043D \u0410\u043D\u0437\u043E\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0430 \u0410\u043B\u0438\u043D\u0430 \u0410\u043B\u0438\u0441\u0430 \u0410\u043B\u043B\u0430 \u0410\u043D\u0430\u0441\u0442\u0430\u0441\u0438\u044F \u0410\u043D\u0433\u0435\u043B\u0438\u043D\u0430 \u0410\u043D\u043D\u0430 \u0410\u043D\u0442\u043E\u043D\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u0440\u0438\u044F \u0412\u0430\u0440\u0432\u0430\u0440\u0430 \u0412\u0435\u0440\u043E\u043D\u0438\u043A\u0430 \u0412\u0438\u043A\u0442\u043E\u0440\u0438\u044F \u0413\u0430\u043B\u0438\u043D\u0430 \u0414\u0430\u0440\u044C\u044F \u0414\u0438\u0430\u043D\u0430 \u0415\u0432\u0433\u0435\u043D\u0438\u044F \u0415\u043A\u0430\u0442\u0435\u0440\u0438\u043D\u0430 \u0415\u043B\u0435\u043D\u0430 \u0415\u043B\u0438\u0437\u0430\u0432\u0435\u0442\u0430 \u0416\u0430\u043D\u043D\u0430 \u0417\u0438\u043D\u0430\u0438\u0434\u0430 \u041A\u0430\u0440\u0438\u043D\u0430 \u041A\u0438\u0440\u0430 \u041A\u043B\u0430\u0432\u0434\u0438\u044F \u041A\u0440\u0438\u0441\u0442\u0438\u043D\u0430 \u041A\u0441\u0435\u043D\u0438\u044F \u041B\u0430\u0440\u0438\u0441\u0430 \u041B\u0438\u0434\u0438\u044F \u041B\u044E\u0434\u043C\u0438\u043B\u0430 \u041C\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430 \u041C\u0430\u0440\u0438\u043D\u0430 \u041C\u0430\u0440\u0438\u044F \u041C\u0438\u043B\u0430\u043D\u0430 \u041D\u0430\u0442\u0430\u043B\u044C\u044F \u041D\u0430\u0442\u0430\u043B\u0438\u044F \u041D\u0438\u043D\u0430 \u041E\u043A\u0441\u0430\u043D\u0430 \u041E\u043B\u0435\u0441\u044F \u041E\u043B\u044C\u0433\u0430 \u041F\u043E\u043B\u0438\u043D\u0430 \u0420\u0430\u0438\u0441\u0430 \u0421\u0432\u0435\u0442\u043B\u0430\u043D\u0430 \u0421\u043E\u0444\u0438\u044F \u0421\u043E\u0444\u044C\u044F \u0422\u0430\u0438\u0441\u0438\u044F \u0422\u0430\u043C\u0430\u0440\u0430 \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u0423\u043B\u044C\u044F\u043D\u0430 \u042E\u043B\u0438\u044F \u042D\u043B\u044C\u0432\u0438\u0440\u0430 \u0420\u0435\u0433\u0438\u043D\u0430 \u0421\u043D\u0435\u0436\u0430\u043D\u0430 \u0410\u043B\u0451\u043D\u0430 \u0410\u043B\u0435\u043D\u0430 \u0412\u0430\u0441\u0438\u043B\u0438\u0441\u0430 \u0410\u0440\u0438\u043D\u0430 \u0415\u0441\u0435\u043D\u0438\u044F \u042D\u0432\u0435\u043B\u0438\u043D\u0430 \u0421\u0430\u0448\u0430 \u0416\u0435\u043D\u044F \u0412\u0430\u043B\u044F \u0414\u0438\u043C\u0430 \u041C\u0438\u0448\u0430 \u041A\u043E\u043B\u044F \u041F\u0435\u0442\u044F \u0412\u0430\u0441\u044F \u0421\u0435\u0440\u0451\u0436\u0430 \u0421\u0435\u0440\u0435\u0436\u0430 \u041F\u0430\u0448\u0430 \u041B\u0451\u0448\u0430 \u041B\u0435\u0448\u0430 \u0412\u0438\u0442\u044F \u041A\u043E\u0441\u0442\u044F \u0412\u043E\u0432\u0430 \u0412\u043E\u043B\u043E\u0434\u044F \u0412\u0430\u043D\u044F \u0413\u043E\u0448\u0430 \u0413\u0440\u0438\u0448\u0430 \u0422\u043E\u043B\u044F \u0411\u043E\u0440\u044F \u0421\u0442\u0430\u0441 \u0422\u0451\u043C\u0430 \u0422\u0430\u043D\u044F \u041A\u0430\u0442\u044F \u041B\u0435\u043D\u0430 \u041D\u0430\u0442\u0430\u0448\u0430 \u0421\u0432\u0435\u0442\u0430 \u042E\u043B\u044F \u041D\u0430\u0441\u0442\u044F \u0414\u0430\u0448\u0430 \u041C\u0430\u0448\u0430 \u041B\u044E\u0434\u0430 \u0413\u0430\u043B\u044F \u0412\u0438\u043A\u0430 \u041A\u0441\u044E\u0448\u0430 \u041B\u0438\u0437\u0430 \u0421\u043E\u043D\u044F \u041D\u0430\u0434\u044F \u041B\u0435\u0440\u0430 \u0410\u043B\u0451\u0448\u0430 \u0410\u043B\u0435\u0448\u0430 \u041C\u0438\u0442\u044F \u0421\u0435\u043D\u044F \u0424\u0435\u0434\u044F \u0416\u0435\u043D\u0435\u0447\u043A\u0430 \u041E\u043B\u0435\u043D\u044C\u043A\u0430 \u0422\u0430\u043D\u0435\u0447\u043A\u0430";
23677
23695
  var EUROPEAN = "James John Robert Michael William David Richard Joseph Thomas Charles Christopher Daniel Matthew Anthony Donald Steven Paul Andrew Joshua Kenneth Kevin Brian George Timothy Ronald Edward Jason Jeffrey Ryan Jacob Gary Nicholas Eric Jonathan Stephen Larry Justin Scott Brandon Benjamin Samuel Gregory Alexander Patrick Raymond Dennis Jerry Tyler Aaron Nathan Henry Peter Zachary Douglas Harold Kyle Noah Ethan Oliver Harry Lucas Liam Mary Patricia Jennifer Linda Elizabeth Barbara Susan Jessica Sarah Karen Lisa Nancy Betty Margaret Sandra Ashley Kimberly Emily Donna Michelle Carol Amanda Dorothy Melissa Deborah Stephanie Rebecca Sharon Laura Cynthia Kathleen Angela Shirley Anna Brenda Pamela Emma Nicole Helen Samantha Katherine Christine Rachel Carolyn Janet Catherine Maria Heather Diane Ruth Julie Olivia Joyce Kelly Lauren Christina Joan Evelyn Judith Megan Andrea Cheryl Hannah Jacqueline Martha Teresa Sara Madison Frances Kathryn Janice Abigail Alice Julia Judy Sophia Denise Doris Marilyn Danielle Beverly Isabella Theresa Diana Natalie Charlotte Marie Kayla Alexis Javier Carlos Antonio Manuel Francisco Juan Pedro Alejandro Miguel Rafael Pablo Sergio Fernando Jorge Luis Alberto \xC1lvaro Diego Adri\xE1n Rub\xE9n Iv\xE1n \xD3scar Andr\xE9s Ra\xFAl Enrique Vicente Joaqu\xEDn Ignacio Gonzalo Marcos V\xEDctor Jaime Alfonso Guillermo Tom\xE1s Emilio Gabriel Nicol\xE1s Mart\xEDn Jordi Josep Xavier Luc\xEDa Carmen Isabel Cristina Marta Elena Raquel Silvia Beatriz Paula Nuria N\xFAria Sonia Alicia Irene Montserrat Inmaculada Noelia Lorena Sof\xEDa Valeria Claudia Natalia Sandra Ver\xF3nica Esther Yolanda Vanesa Laia Klaus J\xFCrgen Wolfgang Stefan Andreas Matthias Markus Tobias Florian Lukas Jonas Maximilian Sebastian Dirk Sabine Ursula Petra Monika Katrin Anja Pierre Michel Philippe Alain Fran\xE7ois Christophe Laurent Olivier Julien Mathieu S\xE9bastien Guillaume Antoine Camille Nathalie Isabelle Sylvie Sophie C\xE9line Aur\xE9lie Chlo\xE9 Manon Giuseppe Giovanni Marco Luca Francesco Alessandro Matteo Lorenzo Stefano Paolo Roberto Davide Simone Federico Giulia Francesca Chiara Valentina Alessia Martina Elisa Jo\xE3o Pedro Tiago Beatriz In\xEAs Mariana Piotr Krzysztof Tomasz Marcin Agnieszka Katarzyna Ma\u0142gorzata Magdalena";
23678
23696
  var WORDS = "\u0412\u0435\u0440\u0430 \u041D\u0430\u0434\u0435\u0436\u0434\u0430 \u041B\u044E\u0431\u043E\u0432\u044C \u0421\u043B\u0430\u0432\u0430 \u0420\u043E\u043C\u0430\u043D \u0420\u043E\u0437\u0430 \u041C\u0430\u0439\u044F \u041B\u0438\u043B\u0438\u044F \u0417\u043B\u0430\u0442\u0430 \u041C\u0438\u043B\u0430 \u041D\u0438\u043A\u0430 \u041B\u0435\u0432 \u0413\u043B\u043E\u0440\u0438\u044F Will Mark Rose Grace Hope Faith Bill Frank Jack June April Summer Amber Ruby Lily Daisy Victoria Virginia Georgia Florence Sydney Chelsea Jordan Austin Dallas Mercedes Dolores Rosa Pilar Marina Esperanza Gloria Amparo Consuelo Roc\xEDo Salvador Santiago Jes\xFAs \xC1ngeles Hugo Ram\xF3n Christian Felix F\xE9lix Mario Martin Victor Pierre Paz Merc\xE8 Estrella Aurora Concepci\xF3n Remedios Soledad Milagros Angel \xC1ngel Dawn Joy Holly Ivy Iris Violet Pearl";
@@ -23680,7 +23698,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
23680
23698
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
23681
23699
  var NAME_WORDS = WORDS.split(" ");
23682
23700
 
23683
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/person-names.js
23701
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/person-names.js
23684
23702
  var LATIN_TO_CYRILLIC = {
23685
23703
  shch: "\u0449",
23686
23704
  sch: "\u0449",
@@ -23888,7 +23906,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
23888
23906
  return found2;
23889
23907
  }, "findUnknownNames");
23890
23908
 
23891
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/attachments.js
23909
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/attachments.js
23892
23910
  var NOT_FILES = /* @__PURE__ */ new Set([
23893
23911
  "webpage",
23894
23912
  "share",
@@ -23928,7 +23946,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
23928
23946
  });
23929
23947
  }, "matchDownloads");
23930
23948
 
23931
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
23949
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
23932
23950
  var QUERY_VERSION = 1;
23933
23951
  var QUERY_LIMITS2 = {
23934
23952
  ...QUERY_LIMITS,
@@ -23964,7 +23982,7 @@ function exhausted(budget) {
23964
23982
  }
23965
23983
  __name(exhausted, "exhausted");
23966
23984
 
23967
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
23985
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
23968
23986
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
23969
23987
  var literal2 = /* @__PURE__ */ __name((c) => ({
23970
23988
  kind: "char",
@@ -24364,7 +24382,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
24364
24382
  return out;
24365
24383
  }, "foldRegex");
24366
24384
 
24367
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
24385
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
24368
24386
  var PRESET_VERSION = 1;
24369
24387
  var PRESETS = {
24370
24388
  password: {
@@ -24418,7 +24436,7 @@ var PRESETS = {
24418
24436
  }
24419
24437
  };
24420
24438
 
24421
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
24439
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
24422
24440
  var FIELD_VERSION = 2;
24423
24441
  var UNITS = {
24424
24442
  "": 1,
@@ -24879,12 +24897,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
24879
24897
  return validateFields(parsed3.output);
24880
24898
  }, "validateAst");
24881
24899
 
24882
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
24900
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
24883
24901
  var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
24884
24902
  var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
24885
24903
  var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
24886
24904
 
24887
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
24905
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
24888
24906
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
24889
24907
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
24890
24908
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -24908,7 +24926,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
24908
24926
  };
24909
24927
  }, "linkMatch");
24910
24928
 
24911
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
24929
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
24912
24930
  var SETTING = "phoneCountries";
24913
24931
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
24914
24932
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -24939,7 +24957,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
24939
24957
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
24940
24958
  }, "valueMatch");
24941
24959
 
24942
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
24960
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
24943
24961
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
24944
24962
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
24945
24963
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -24967,7 +24985,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
24967
24985
  return 2 * intersection2 / (aa2.size + bb.size);
24968
24986
  }, "vocabularySimilarity");
24969
24987
 
24970
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
24988
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
24971
24989
  import { createHash } from "node:crypto";
24972
24990
  var folded2 = /* @__PURE__ */ __name((name) => {
24973
24991
  try {
@@ -25033,7 +25051,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
25033
25051
  });
25034
25052
  }, "guardTagCreation");
25035
25053
 
25036
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
25054
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
25037
25055
  var invalid2 = /* @__PURE__ */ __name((message2) => {
25038
25056
  throw new CliError("validation_error", message2);
25039
25057
  }, "invalid");
@@ -25110,7 +25128,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
25110
25128
  };
25111
25129
  }, "createTagRedirectIndex");
25112
25130
 
25113
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
25131
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
25114
25132
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
25115
25133
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
25116
25134
  if (!row2)
@@ -25138,7 +25156,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
25138
25156
  return snapshot2;
25139
25157
  }, "tagRedirectSnapshot");
25140
25158
 
25141
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
25159
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
25142
25160
  import { createHash as createHash2 } from "node:crypto";
25143
25161
  var TASK_KEY_PREFIXES = {
25144
25162
  question: "Q",
@@ -25166,7 +25184,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
25166
25184
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
25167
25185
  }, "taskAccountOf");
25168
25186
 
25169
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
25187
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
25170
25188
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
25171
25189
  var REFERABLE = {
25172
25190
  note: { tombstone: true },
@@ -25249,9 +25267,9 @@ var emailThreadOf = /* @__PURE__ */ __name((database, account, thread) => {
25249
25267
  }, "emailThreadOf");
25250
25268
  var referenceOfThing = /* @__PURE__ */ __name((database, thing) => {
25251
25269
  if (["meeting", "meeting_transcript", "meeting_transcript_row"].includes(thing.type)) {
25252
- const join3 = thing.type === "meeting" ? "FROM meetings m WHERE m.id=?" : thing.type === "meeting_transcript" ? "FROM meeting_transcripts t JOIN meetings m ON m.id=t.meeting_id WHERE t.id=?" : "FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE r.id=?";
25270
+ const join4 = thing.type === "meeting" ? "FROM meetings m WHERE m.id=?" : thing.type === "meeting_transcript" ? "FROM meeting_transcripts t JOIN meetings m ON m.id=t.meeting_id WHERE t.id=?" : "FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE r.id=?";
25253
25271
  const columns = thing.type === "meeting" ? "m.account_id,m.id AS meeting_id,m.deleted_at AS meeting_deleted" : `m.account_id,m.id AS meeting_id,m.deleted_at AS meeting_deleted,t.id AS transcript_id,t.deleted_at AS transcript_deleted${thing.type === "meeting_transcript_row" ? ",r.position" : ""}`;
25254
- const row2 = database.prepare(`SELECT ${columns} ${join3}`).get(thing.id);
25272
+ const row2 = database.prepare(`SELECT ${columns} ${join4}`).get(thing.id);
25255
25273
  if (!row2)
25256
25274
  return void 0;
25257
25275
  return formatMeetingReference({
@@ -25334,7 +25352,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
25334
25352
  return row2 ? String(row2.id ?? row2.key) : void 0;
25335
25353
  }, "taskIdOf");
25336
25354
 
25337
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
25355
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
25338
25356
  var toMs = /* @__PURE__ */ __name((iso14) => {
25339
25357
  if (iso14 === null || iso14 === void 0)
25340
25358
  return null;
@@ -25348,7 +25366,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
25348
25366
  var DELIVERY = { delivered: 1, read: 2 };
25349
25367
  var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
25350
25368
 
25351
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
25369
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
25352
25370
  var TAG_KINDS = ["tag", "topic"];
25353
25371
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
25354
25372
  var TAG_TYPE = {
@@ -25551,7 +25569,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
25551
25569
  return result;
25552
25570
  }, "tagsOf");
25553
25571
 
25554
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
25572
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
25555
25573
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
25556
25574
  var SPEECH = speech("att");
25557
25575
  var mentionText = /* @__PURE__ */ __name((alias2) => `CASE WHEN coalesce(json_extract(${alias2}.contact, '$.phone'), '') <> '' THEN 'phone: ' || json_extract(${alias2}.contact, '$.phone') ELSE ${alias2}.text END`, "mentionText");
@@ -25915,7 +25933,7 @@ var FIELD_COMPILERS = {
25915
25933
  subject
25916
25934
  };
25917
25935
 
25918
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
25936
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
25919
25937
  var placeOf = /* @__PURE__ */ __name((database) => {
25920
25938
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
25921
25939
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -25931,7 +25949,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
25931
25949
  };
25932
25950
  }, "placeOf");
25933
25951
 
25934
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
25952
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
25935
25953
  var DRAIN_ON_WRITE = 500;
25936
25954
  var METHOD = "rules";
25937
25955
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -26094,7 +26112,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
26094
26112
  return queued.length;
26095
26113
  }, "drainMentions");
26096
26114
 
26097
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
26115
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
26098
26116
  var indexRow = /* @__PURE__ */ __name((database, name) => {
26099
26117
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
26100
26118
  if (!exists2)
@@ -26102,7 +26120,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
26102
26120
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
26103
26121
  }, "indexRow");
26104
26122
 
26105
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
26123
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
26106
26124
  var INDEX = "message_stems";
26107
26125
  var SETTING2 = "searchStemmers";
26108
26126
  var DRAIN_ON_WRITE2 = 500;
@@ -26224,7 +26242,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
26224
26242
  };
26225
26243
  }, "stemmerCache");
26226
26244
 
26227
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
26245
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
26228
26246
  var SQLITE_BUSY = 5;
26229
26247
  var pause = new Int32Array(new SharedArrayBuffer(4));
26230
26248
  var isBusy = /* @__PURE__ */ __name((error) => {
@@ -26319,7 +26337,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
26319
26337
  }
26320
26338
  }, "read");
26321
26339
 
26322
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
26340
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
26323
26341
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
26324
26342
  coalesce(CASE k.chunkable_type
26325
26343
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -26461,7 +26479,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
26461
26479
  }, "dropUnusedVectors");
26462
26480
  var dropAllUnusedVectors = /* @__PURE__ */ __name((database) => database.prepare("DELETE FROM embeddings WHERE NOT EXISTS (SELECT 1 FROM chunks k WHERE k.content_hash = embeddings.content_hash) RETURNING 1").all().length, "dropAllUnusedVectors");
26463
26481
 
26464
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
26482
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
26465
26483
  var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null) => Number(orm.insert(accounts).values({ provider, externalId: account, name, scope: scope3 ?? "personal", createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
26466
26484
  target: [accounts.provider, accounts.externalId],
26467
26485
  set: {
@@ -26533,6 +26551,7 @@ var purgeAccount = /* @__PURE__ */ __name(({ orm, database }, accountKey) => {
26533
26551
  orm.delete(accountIdentities).where(eq(accountIdentities.accountId, accountKey)).run();
26534
26552
  orm.update(projects).set({ accountId: null }).where(eq(projects.accountId, accountKey)).run();
26535
26553
  orm.run(sql`DELETE FROM files WHERE account_id = ${accountKey}`);
26554
+ orm.run(sql`DELETE FROM crm_fields WHERE account_id = ${accountKey}`);
26536
26555
  const recordsOf = sql`(SELECT id FROM records WHERE account_id = ${accountKey})`;
26537
26556
  orm.run(sql`DELETE FROM record_relations WHERE record_id IN ${recordsOf} OR target_id IN ${recordsOf}`);
26538
26557
  orm.run(sql`DELETE FROM records WHERE account_id = ${accountKey}`);
@@ -26570,7 +26589,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
26570
26589
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
26571
26590
  }, "dropOrphanPeople");
26572
26591
 
26573
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
26592
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
26574
26593
  var FOLDED = [
26575
26594
  { table: "tasks", column: "title" },
26576
26595
  { table: "tasks", column: "close_reason" },
@@ -26607,7 +26626,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
26607
26626
  return filled2;
26608
26627
  }, "fillFolded");
26609
26628
 
26610
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
26629
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
26611
26630
  var HISTORY_KEY = "$history";
26612
26631
  var objectOf = /* @__PURE__ */ __name((text6) => {
26613
26632
  if (typeof text6 !== "string")
@@ -26683,7 +26702,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
26683
26702
  return rest;
26684
26703
  }, "withoutHistory");
26685
26704
 
26686
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
26705
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
26687
26706
  import { createHash as createHash3 } from "node:crypto";
26688
26707
  var CHUNK_CHARS = 1200;
26689
26708
  var CHUNK_OVERLAP = 150;
@@ -26788,7 +26807,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
26788
26807
  return chunks2;
26789
26808
  }, "cutChunks");
26790
26809
 
26791
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/task-signature.js
26810
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/task-signature.js
26792
26811
  var DAY = 864e5;
26793
26812
  var CURRENCY = [
26794
26813
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -26914,7 +26933,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
26914
26933
  return best?.day ?? null;
26915
26934
  }, "dueDayOf");
26916
26935
 
26917
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
26936
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
26918
26937
  var DAY2 = 864e5;
26919
26938
  var STOP_WORDS = new Set([
26920
26939
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -27069,7 +27088,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
27069
27088
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
27070
27089
  })).sort((a, b) => b.score - a.score), "rankCandidates");
27071
27090
 
27072
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
27091
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
27073
27092
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
27074
27093
  r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
27075
27094
  JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
@@ -27340,7 +27359,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
27340
27359
  };
27341
27360
  }, "readiness");
27342
27361
 
27343
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
27362
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
27344
27363
  var DOCUMENT_PICTURE = "document_picture";
27345
27364
  var SCAN_PAGE2 = 5e3;
27346
27365
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -27403,7 +27422,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
27403
27422
  }, "nearestPictures")
27404
27423
  }), "documentPicturesOver");
27405
27424
 
27406
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
27425
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
27407
27426
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
27408
27427
  const literal4 = escaped2 ?? plain2 ?? "";
27409
27428
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -27468,7 +27487,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
27468
27487
  var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
27469
27488
  var bound2 = /* @__PURE__ */ __name(({ sql: text6, params }) => sql.join(text6.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
27470
27489
 
27471
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
27490
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
27472
27491
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
27473
27492
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
27474
27493
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -27558,7 +27577,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
27558
27577
  });
27559
27578
  }, "linkMeeting");
27560
27579
 
27561
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
27580
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
27562
27581
  var EVENT_TEXT = "trim(coalesce(e.description, '') || ' ' || coalesce(e.location, '') || ' ' || coalesce((SELECT group_concat(p.name, ' ') FROM calendar_entries ce JOIN calendar_entry_participants p ON p.entry_id = ce.id WHERE ce.event_id = e.id AND ce.deleted_at IS NULL AND p.resource = 0 AND p.name IS NOT NULL), ''))";
27563
27582
  var UNSEARCHED_EVENT_TYPES = [
27564
27583
  "working-location",
@@ -27743,6 +27762,8 @@ var writer2 = /* @__PURE__ */ __name((database, corpus, stemmer) => {
27743
27762
  };
27744
27763
  }, "writer");
27745
27764
  var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor2, { batch = 200, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
27765
+ if (isQueryOnly(database))
27766
+ return 0;
27746
27767
  if (corpus.type === "email" || corpus.type === "document")
27747
27768
  database.prepare(`UPDATE chunks SET account_id = (SELECT account_id FROM ${corpus.table} WHERE id = chunks.chunkable_id)
27748
27769
  WHERE chunkable_type = ? AND account_id IS NULL`).run(corpus.type);
@@ -27788,7 +27809,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
27788
27809
  return true;
27789
27810
  }, "resetNoteIndex");
27790
27811
 
27791
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
27812
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
27792
27813
  var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
27793
27814
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
27794
27815
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
@@ -27807,7 +27828,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
27807
27828
  }
27808
27829
  }, "resolvePersonLinks");
27809
27830
 
27810
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
27831
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
27811
27832
  var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
27812
27833
  var prepare = /* @__PURE__ */ __name((orm) => ({
27813
27834
  find: orm.select({
@@ -28032,7 +28053,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
28032
28053
  }, "meetingIdentityPk");
28033
28054
  var phoneOf = /* @__PURE__ */ __name(({ orm }, provider, nativeId) => orm.select({ phone: identities.phone }).from(identities).where(and(eq(identities.provider, provider), eq(identities.externalId, nativeId))).get()?.phone ?? null, "phoneOf");
28034
28055
 
28035
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
28056
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
28036
28057
  var chatOf = /* @__PURE__ */ __name(({ orm }, accountKey, chatKey) => orm.select({ id: chats.externalId }).from(chats).where(and(eq(chats.id, chatKey), eq(chats.accountId, accountKey))).get()?.id, "chatOf");
28037
28058
  var findChatPk = /* @__PURE__ */ __name(({ orm }, accountKey, chatId) => orm.select({ pk: chats.id }).from(chats).where(and(eq(chats.accountId, accountKey), eq(chats.externalId, chatId))).get()?.pk, "findChatPk");
28038
28059
  var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
@@ -28312,7 +28333,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
28312
28333
  }
28313
28334
  }, "replaceAutoTags");
28314
28335
 
28315
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/counters.js
28336
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/counters.js
28316
28337
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
28317
28338
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
28318
28339
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -28331,7 +28352,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
28331
28352
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
28332
28353
  }, "counterFreshness");
28333
28354
 
28334
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/context/evidence.js
28355
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/context/evidence.js
28335
28356
  import { createHash as createHash4 } from "node:crypto";
28336
28357
  var CONTEXT_MAX_READ_BYTES = 262144;
28337
28358
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -28429,7 +28450,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
28429
28450
  return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
28430
28451
  }, "contextEvidenceRequest");
28431
28452
 
28432
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
28453
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
28433
28454
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
28434
28455
  var ACTIVITY = `
28435
28456
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -28514,7 +28535,8 @@ var writtenTo = /* @__PURE__ */ __name((database, addresses) => {
28514
28535
  }, "writtenTo");
28515
28536
  var MARKED = `
28516
28537
  SELECT e.id, e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.created_at,
28517
- e.updated_at, coalesce(e.draft, 0) AS draft, json_extract(e.metadata, '$.partial') IS NOT NULL AS partial,
28538
+ e.updated_at, e.subject, e.from_address, coalesce(e.draft, 0) AS draft,
28539
+ coalesce(json_extract(e.headers, '$."list-id"'), json_extract(e.metadata, '$.listId')) IS NOT NULL AS listed, json_extract(e.metadata, '$.partial') IS NOT NULL AS partial,
28518
28540
  coalesce(json_extract(e.headers, '$."list-id"'), json_extract(e.metadata, '$.listId')) IS NOT NULL
28519
28541
  OR EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
28520
28542
  WHERE m.email_id = e.id AND b.kind = 'bulk') AS bulk,
@@ -28531,6 +28553,9 @@ var markedOf = /* @__PURE__ */ __name((row2) => ({
28531
28553
  storedAt: Number(row2.created_at),
28532
28554
  changedAt: Number(row2.updated_at),
28533
28555
  bulk: Boolean(row2.bulk),
28556
+ listed: Boolean(row2.listed),
28557
+ subject: row2.subject === null || row2.subject === void 0 ? null : String(row2.subject),
28558
+ from: row2.from_address === null || row2.from_address === void 0 ? null : String(row2.from_address),
28534
28559
  envelope: Boolean(row2.envelope),
28535
28560
  partial: Boolean(row2.partial),
28536
28561
  draft: Boolean(row2.draft),
@@ -28555,7 +28580,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
28555
28580
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
28556
28581
  }), "mailActivity");
28557
28582
 
28558
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
28583
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
28559
28584
  var GREETING = new RegExp("^(hi|hello|hey|dear|greetings|good (morning|afternoon|evening)|\u043F\u0440\u0438\u0432\u0435\u0442|\u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439(\u0442\u0435)?|\u0434\u043E\u0431\u0440(\u044B\u0439|\u043E\u0435|\u043E\u0433\u043E) (\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440|\u0443\u0442\u0440\u043E|\u0443\u0442\u0440\u0430|\u0434\u043D\u044F)|hola|buen(os|as) (d\xEDas|dias|tardes|noches)|estimad[oa]s?|querid[oa]s?)(?![\\p{L}\\p{N}])([\\s,]+\\p{L}[\\p{L}.'\u2019-]*){0,3}\\s*[,!.:]?$", "iu");
28560
28585
  var SIGN_OFF = /^(best|best regards|best wishes|kind regards|warm regards|regards|thanks|thanks again|thanks a lot|thank you|many thanks|cheers|sincerely|yours|yours truly|yours sincerely|br|с уважением|спасибо|заранее спасибо|всего доброго|всего хорошего|un saludo|saludos|saludos cordiales|atentamente|gracias|muchas gracias)[\s,.!]*$/iu;
28561
28586
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -28565,8 +28590,8 @@ var CONTENT = /^p\.?\s?s\b|\?|(\S+\s+){8}\S/iu;
28565
28590
  var unquoted = /* @__PURE__ */ __name((line) => line.replace(/^(\s*>)+\s?/, ""), "unquoted");
28566
28591
  var squash = /* @__PURE__ */ __name((text6) => text6.toLowerCase().replace(/\s+/g, " ").trim(), "squash");
28567
28592
  var flat = /* @__PURE__ */ __name((text6) => squash(text6.split("\n").map(unquoted).join("\n")), "flat");
28568
- var alreadyHeld = /* @__PURE__ */ __name((quote2, earlier) => {
28569
- const lines = quote2.map((line) => squash(unquoted(line))).filter((line) => line.length > 0);
28593
+ var alreadyHeld = /* @__PURE__ */ __name((quote3, earlier) => {
28594
+ const lines = quote3.map((line) => squash(unquoted(line))).filter((line) => line.length > 0);
28570
28595
  const total = lines.reduce((sum, line) => sum + line.length, 0);
28571
28596
  if (total === 0)
28572
28597
  return true;
@@ -28696,7 +28721,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
28696
28721
  return text6 || body2.trim();
28697
28722
  }, "mailOwnText");
28698
28723
 
28699
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
28724
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
28700
28725
  var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
28701
28726
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
28702
28727
  k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
@@ -28806,7 +28831,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
28806
28831
  return emails3 + threads;
28807
28832
  }, "drainEmailIndex");
28808
28833
 
28809
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
28834
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
28810
28835
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
28811
28836
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
28812
28837
  var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalidity) => database.prepare(`SELECT l.uid, e.external_id, coalesce(e.received_at, e.sent_at) AS at, e.read, e.flagged,
@@ -28904,7 +28929,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
28904
28929
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
28905
28930
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
28906
28931
 
28907
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
28932
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
28908
28933
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
28909
28934
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
28910
28935
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -28954,7 +28979,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
28954
28979
  return threads.length;
28955
28980
  }, "markEmailsRestored");
28956
28981
 
28957
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
28982
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
28958
28983
  var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
28959
28984
  FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
28960
28985
  WHERE p.account_id = ?
@@ -29014,7 +29039,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
29014
29039
  }, "indexedMailPieces");
29015
29040
  var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
29016
29041
 
29017
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
29042
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
29018
29043
  var sorted = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(sorted) : value !== null && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map((key2) => [key2, sorted(value[key2])])) : value, "sorted");
29019
29044
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
29020
29045
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -29081,7 +29106,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
29081
29106
  }
29082
29107
  }), "mailRulesOver");
29083
29108
 
29084
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
29109
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
29085
29110
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
29086
29111
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
29087
29112
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -29089,7 +29114,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
29089
29114
  reason = excluded.reason, updated_at = excluded.updated_at WHERE link_reviews.status = 'open'`).run(linkable.type, linkable.id, entity, JSON.stringify([...candidates].sort((a, b) => a - b)), reason, now2, now2);
29090
29115
  }, "reviewLink");
29091
29116
 
29092
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
29117
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
29093
29118
  function checkMeetingCancelled(signal) {
29094
29119
  if (!signal?.aborted)
29095
29120
  return;
@@ -29100,7 +29125,7 @@ function checkMeetingCancelled(signal) {
29100
29125
  }
29101
29126
  __name(checkMeetingCancelled, "checkMeetingCancelled");
29102
29127
 
29103
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
29128
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
29104
29129
  var meetingOf = /* @__PURE__ */ __name((row2) => ({
29105
29130
  id: Number(row2.id),
29106
29131
  accountId: Number(row2.account_id),
@@ -29150,7 +29175,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
29150
29175
  createdAt: Number(row2.created_at)
29151
29176
  }), "transcriptRowOf");
29152
29177
 
29153
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
29178
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
29154
29179
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
29155
29180
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
29156
29181
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -29317,7 +29342,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
29317
29342
  }
29318
29343
  }), "meetingReadsOver");
29319
29344
 
29320
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
29345
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
29321
29346
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
29322
29347
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
29323
29348
  const params = [input.accountId];
@@ -29360,7 +29385,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
29360
29385
  return { clauses, params };
29361
29386
  }, "meetingSelectionSql");
29362
29387
 
29363
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
29388
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
29364
29389
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
29365
29390
  async meetingChatLines(input) {
29366
29391
  checkMeetingCancelled(input.signal);
@@ -29388,7 +29413,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
29388
29413
  }
29389
29414
  }), "meetingChatLinesOver");
29390
29415
 
29391
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
29416
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
29392
29417
  var MESSAGE_FIELDS = {
29393
29418
  pk: messages.id,
29394
29419
  nativeId: messages.externalId,
@@ -29559,7 +29584,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
29559
29584
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
29560
29585
  }), "chatActivity");
29561
29586
 
29562
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
29587
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
29563
29588
  var HIT_FIELDS = {
29564
29589
  ...MESSAGE_FIELDS,
29565
29590
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -29658,7 +29683,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
29658
29683
  };
29659
29684
  }, "directReplies");
29660
29685
 
29661
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
29686
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
29662
29687
  var identityRow = /* @__PURE__ */ __name(({ orm }, { provider, id: id2 }) => orm.select({ pk: identities.id, personPk: identityLinks.personId }).from(identities).innerJoin(identityLinks, eq(identityLinks.identityId, identities.id)).where(and(eq(identities.provider, provider), eq(identities.externalId, id2))).get(), "identityRow");
29663
29688
  var required = /* @__PURE__ */ __name((context, ref3) => {
29664
29689
  const found2 = identityRow(context, ref3);
@@ -29789,7 +29814,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
29789
29814
  }, "mentioning");
29790
29815
  var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
29791
29816
 
29792
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
29817
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
29793
29818
  var missing2 = /* @__PURE__ */ __name(() => {
29794
29819
  throw new CliError("not_found", "Meeting, participant or selected target not found");
29795
29820
  }, "missing");
@@ -29911,7 +29936,7 @@ function meetingContextLinksOver(context) {
29911
29936
  }
29912
29937
  __name(meetingContextLinksOver, "meetingContextLinksOver");
29913
29938
 
29914
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
29939
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
29915
29940
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
29916
29941
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
29917
29942
  var summaryOf = /* @__PURE__ */ __name((row2) => ({
@@ -29940,7 +29965,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
29940
29965
  return row2 ? summaryText(summaryOf(row2)) : null;
29941
29966
  }, "indexedText");
29942
29967
 
29943
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
29968
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
29944
29969
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
29945
29970
  var meetingCurrentIndexRows = `
29946
29971
  SELECT 'meeting_transcript_row' AS indexable_type,r.id,r.id*4+1 AS rid,1 AS live,coalesce(length(CAST(r.text AS BLOB)),0) AS bytes FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL
@@ -29971,7 +29996,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
29971
29996
  }, "invalidateMeetingStems");
29972
29997
  var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
29973
29998
 
29974
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
29999
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
29975
30000
  function meetingHitIndexOver({ database, now: now2 }) {
29976
30001
  return {
29977
30002
  async indexSearch(original) {
@@ -30039,10 +30064,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
30039
30064
  }
30040
30065
  __name(meetingHitIndexOver, "meetingHitIndexOver");
30041
30066
 
30042
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
30067
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
30043
30068
  import { createHash as createHash5 } from "node:crypto";
30044
30069
 
30045
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/trigrams.js
30070
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/trigrams.js
30046
30071
  var trigrams = /* @__PURE__ */ __name((term) => {
30047
30072
  const padded = ` ${term} `;
30048
30073
  const pieces = /* @__PURE__ */ new Set();
@@ -30051,7 +30076,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
30051
30076
  return [...pieces];
30052
30077
  }, "trigrams");
30053
30078
 
30054
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/correct.js
30079
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/correct.js
30055
30080
  var SHORTEST_CORRECTION = 3;
30056
30081
  var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
30057
30082
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -30098,7 +30123,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
30098
30123
  return corrections;
30099
30124
  }, "correctWords");
30100
30125
 
30101
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/garbled.js
30126
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/garbled.js
30102
30127
  var SHORTEST_GARBLED = 4;
30103
30128
  var MOST_WIDENED = 64;
30104
30129
  var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
@@ -30190,7 +30215,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
30190
30215
  return found2.map((words3) => words3.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
30191
30216
  }, "widenWords");
30192
30217
 
30193
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
30218
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
30194
30219
  import { readFileSync } from "node:fs";
30195
30220
  var loaded;
30196
30221
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -30249,7 +30274,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
30249
30274
  return false;
30250
30275
  }, "knownRussianWord");
30251
30276
 
30252
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
30277
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
30253
30278
  var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
30254
30279
  var MOST_WORDS = 128;
30255
30280
  var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
@@ -30476,7 +30501,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
30476
30501
  return check3(tree);
30477
30502
  }, "matchMeetingText");
30478
30503
 
30479
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
30504
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
30480
30505
  var fail3 = /* @__PURE__ */ __name((message2) => {
30481
30506
  throw new CliError("validation_error", message2);
30482
30507
  }, "fail");
@@ -30658,7 +30683,7 @@ function meetingHitSearchOver({ database }) {
30658
30683
  }
30659
30684
  __name(meetingHitSearchOver, "meetingHitSearchOver");
30660
30685
 
30661
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
30686
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
30662
30687
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
30663
30688
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
30664
30689
  positiveReadInteger(accountId, "accountId");
@@ -30690,7 +30715,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
30690
30715
  }
30691
30716
  }), "meetingLanguagesOver");
30692
30717
 
30693
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
30718
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
30694
30719
  import { createHash as createHash6 } from "node:crypto";
30695
30720
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
30696
30721
  if (value === void 0)
@@ -30780,7 +30805,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
30780
30805
  }
30781
30806
  }), "meetingParticipantSearchOver");
30782
30807
 
30783
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
30808
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
30784
30809
  var preparationQueries = {
30785
30810
  participants: {
30786
30811
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -30830,7 +30855,7 @@ var preparationQueries = {
30830
30855
  }
30831
30856
  };
30832
30857
 
30833
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
30858
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
30834
30859
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
30835
30860
  async preparationContext(original) {
30836
30861
  const input = validateMeetingPreparationContext(original);
@@ -30871,7 +30896,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
30871
30896
  }
30872
30897
  }), "meetingPreparationContextOver");
30873
30898
 
30874
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
30899
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
30875
30900
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
30876
30901
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
30877
30902
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -30885,7 +30910,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
30885
30910
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
30886
30911
  )`, "preparationSubjects");
30887
30912
 
30888
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
30913
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
30889
30914
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
30890
30915
  async preparationKnowledge(original) {
30891
30916
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -30930,7 +30955,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
30930
30955
  }
30931
30956
  }), "meetingPreparationKnowledgeOver");
30932
30957
 
30933
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
30958
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
30934
30959
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
30935
30960
  async preparationNotes(original) {
30936
30961
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -30983,7 +31008,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
30983
31008
  }
30984
31009
  }), "meetingPreparationNotesOver");
30985
31010
 
30986
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
31011
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
30987
31012
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
30988
31013
  async relatedHistory(original) {
30989
31014
  const input = validateMeetingRelatedHistory(original);
@@ -31054,7 +31079,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
31054
31079
  }
31055
31080
  }), "meetingRelatedHistoryOver");
31056
31081
 
31057
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
31082
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
31058
31083
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
31059
31084
  var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
31060
31085
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -31135,7 +31160,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
31135
31160
  }
31136
31161
  }), "meetingReviewOver");
31137
31162
 
31138
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
31163
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
31139
31164
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
31140
31165
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
31141
31166
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -31189,7 +31214,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
31189
31214
  }
31190
31215
  }), "meetingSeriesHistoryOver");
31191
31216
 
31192
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
31217
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
31193
31218
  var MOST_ROWS = 5e5;
31194
31219
  var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
31195
31220
  EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
@@ -31258,7 +31283,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
31258
31283
  }
31259
31284
  }), "meetingStatsOver");
31260
31285
 
31261
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
31286
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
31262
31287
  var CURSOR_KEY = "meetings";
31263
31288
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
31264
31289
  id: Number(row2.id),
@@ -31827,7 +31852,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
31827
31852
  };
31828
31853
  }, "meetingStoreOver");
31829
31854
 
31830
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
31855
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
31831
31856
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
31832
31857
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
31833
31858
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -31853,7 +31878,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
31853
31878
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
31854
31879
  }, "release");
31855
31880
 
31856
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
31881
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
31857
31882
  var THREAD_COLUMNS = {
31858
31883
  subject: {
31859
31884
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -31870,7 +31895,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
31870
31895
  AND (${filter.where?.sql ?? "1"}) ORDER BY coalesce(last_email_at, 0) DESC, id DESC LIMIT ? OFFSET ?`).all(filter.accountId ?? null, filter.accountId ?? null, filter.includeDeleted ? 1 : 0, ...filter.where?.params ?? [], limit, offset);
31871
31896
  }, "threadRows");
31872
31897
 
31873
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
31898
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
31874
31899
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
31875
31900
  id: `email:${place.emailId}`,
31876
31901
  chatId: place.threadExternalId,
@@ -32408,7 +32433,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
32408
32433
  }
32409
32434
  }), "mailStoreOver");
32410
32435
 
32411
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/search/dictionary.js
32436
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/search/dictionary.js
32412
32437
  import { readFileSync as readFileSync2 } from "node:fs";
32413
32438
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
32414
32439
  var folded4 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
@@ -32498,7 +32523,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
32498
32523
  }, "knownWord");
32499
32524
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
32500
32525
 
32501
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
32526
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
32502
32527
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
32503
32528
  var readsTranscripts = /* @__PURE__ */ __name((node) => (node.operator === "term" || node.operator === "phrase") && /[\p{L}\p{N}]/u.test(normalize(node.value)) && (node.field === "transcript" || node.implicit === true && (node.field === "text" || node.field === "exact")), "readsTranscripts");
32504
32529
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -32584,7 +32609,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
32584
32609
  return found2;
32585
32610
  }, "spokenTranscripts");
32586
32611
 
32587
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
32612
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
32588
32613
  var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
32589
32614
  const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
32590
32615
  if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
@@ -32631,7 +32656,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
32631
32656
  });
32632
32657
  }, "placeHits");
32633
32658
 
32634
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
32659
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
32635
32660
  var GROUPS = {
32636
32661
  chat: {
32637
32662
  key: "m.chat_id",
@@ -32653,7 +32678,7 @@ var GROUPS = {
32653
32678
  }
32654
32679
  };
32655
32680
 
32656
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
32681
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
32657
32682
  var MESSAGES2 = {
32658
32683
  rows: "messages",
32659
32684
  threads: "chats",
@@ -33136,7 +33161,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
33136
33161
  };
33137
33162
  }, "runCompiled");
33138
33163
 
33139
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
33164
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
33140
33165
  function invalidMetadata() {
33141
33166
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
33142
33167
  }
@@ -33145,7 +33170,7 @@ var counterStates = /* @__PURE__ */ __name(({ database }, messagePk, now2, maxAg
33145
33170
  const row2 = database.prepare("SELECT reactions,metadata FROM messages WHERE id=? AND deleted_at IS NULL").get(messagePk);
33146
33171
  if (!row2)
33147
33172
  return [];
33148
- const parse = /* @__PURE__ */ __name((raw) => {
33173
+ const parse2 = /* @__PURE__ */ __name((raw) => {
33149
33174
  try {
33150
33175
  const value = JSON.parse(String(raw ?? "{}"));
33151
33176
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -33153,7 +33178,7 @@ var counterStates = /* @__PURE__ */ __name(({ database }, messagePk, now2, maxAg
33153
33178
  return {};
33154
33179
  }
33155
33180
  }, "parse");
33156
- const metadata3 = parse(row2.metadata), reactions = parse(row2.reactions);
33181
+ const metadata3 = parse2(row2.metadata), reactions = parse2(row2.reactions);
33157
33182
  const records2 = database.prepare("SELECT counter,value,created_at,source FROM message_counter_observations WHERE message_id=?").all(messagePk);
33158
33183
  return COUNTER_FIELDS.map((counter) => {
33159
33184
  const raw = counter === "reactions" ? reactions.total : metadata3[counter];
@@ -33238,7 +33263,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
33238
33263
  };
33239
33264
  }), "counterTargets");
33240
33265
 
33241
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
33266
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
33242
33267
  var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
33243
33268
  var fileAttachments = /* @__PURE__ */ __name(({ database }, accountKey, { chatKey, messageId, beforePk, limit }) => database.prepare(`SELECT att.id AS pk, c.external_id AS chat_id, m.external_id AS message_id, att.position, att.kind, att.name, att.mime,
33244
33269
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -33357,7 +33382,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
33357
33382
  }));
33358
33383
  }, "attachmentViews");
33359
33384
 
33360
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
33385
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
33361
33386
  var transcript = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => orm.select({ text: messageTranscripts.text, source: messageTranscripts.source }).from(messageTranscripts).where(and(eq(messageTranscripts.chatId, chatKey), eq(messageTranscripts.messageExternalId, messageId))).get(), "transcript");
33362
33387
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
33363
33388
  const { orm, database, now: now2 } = context;
@@ -33395,7 +33420,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
33395
33420
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
33396
33421
  }, "intoVoiceAttachment");
33397
33422
 
33398
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
33423
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
33399
33424
  var FIELDS = [
33400
33425
  "threadExternalId",
33401
33426
  "senderIdentityId",
@@ -33712,7 +33737,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
33712
33737
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
33713
33738
  }, "writeDerivedReactions");
33714
33739
 
33715
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/keys.js
33740
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/keys.js
33716
33741
  var keysOver = /* @__PURE__ */ __name((context) => {
33717
33742
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
33718
33743
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -33733,7 +33758,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
33733
33758
  };
33734
33759
  }, "keysOver");
33735
33760
 
33736
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
33761
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
33737
33762
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
33738
33763
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
33739
33764
  if (!row2)
@@ -33768,7 +33793,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
33768
33793
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
33769
33794
  }, "saveProfile");
33770
33795
 
33771
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
33796
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
33772
33797
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
33773
33798
  var ownerPerson = /* @__PURE__ */ __name((database) => {
33774
33799
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -33825,7 +33850,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
33825
33850
  return { sql: bot("pb.name = ?"), params: [by.bot] };
33826
33851
  }, "proposedBySql");
33827
33852
 
33828
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
33853
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
33829
33854
  var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
33830
33855
  const owner = ownerPerson(context.database).id;
33831
33856
  const strays = context.database.prepare("SELECT DISTINCT l.person_id AS person FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN accounts a ON a.provider = i.provider AND a.external_id = i.external_id WHERE l.person_id <> ?").all(owner);
@@ -33846,7 +33871,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
33846
33871
  return personOf(context, ref3);
33847
33872
  }, "linkToOwner");
33848
33873
 
33849
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
33874
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
33850
33875
  var PROVIDERS_SETTING = "providers";
33851
33876
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
33852
33877
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -33881,7 +33906,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
33881
33906
  });
33882
33907
  }, "registerProvider");
33883
33908
 
33884
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
33909
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
33885
33910
  var DAY3 = 864e5;
33886
33911
  var RECENTLY_CLOSED_MS = 14 * DAY3;
33887
33912
  var TEXT_LIMIT = 20;
@@ -34080,7 +34105,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
34080
34105
  };
34081
34106
  }, "taskSimilarityOver");
34082
34107
 
34083
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
34108
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
34084
34109
  var SETTING3 = "taskCategories";
34085
34110
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
34086
34111
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -34099,7 +34124,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
34099
34124
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(SETTING3, JSON.stringify(categories), now2);
34100
34125
  }, "saveTaskCategories");
34101
34126
 
34102
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
34127
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
34103
34128
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
34104
34129
  var ALLOWED = "taskAgentClose";
34105
34130
  var MIN = "taskAgentCloseMin";
@@ -34155,10 +34180,10 @@ var SUGGESTION_COLUMNS = [
34155
34180
  ];
34156
34181
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
34157
34182
 
34158
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
34183
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
34159
34184
  var MAIL_FINDINGS_KIND = "mail_findings";
34160
34185
 
34161
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/decisions.js
34186
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/decisions.js
34162
34187
  var TASK_CLOSE_KIND = "task_close";
34163
34188
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
34164
34189
  var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND || kind4 === TASK_CLOSE_KIND, "isOwnerOnlyKind");
@@ -34206,7 +34231,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
34206
34231
  }, "assertMayDecide");
34207
34232
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
34208
34233
 
34209
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/deals.js
34234
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/deals.js
34210
34235
  var DEAL_KINDS = ["deal", "lead"];
34211
34236
  var DEAL_STATUSES = ["open", "won", "lost"];
34212
34237
  var STAGE_OUTCOMES = DEAL_STATUSES;
@@ -34216,7 +34241,7 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
34216
34241
  return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
34217
34242
  }, "dealLine");
34218
34243
 
34219
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
34244
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
34220
34245
  var PROFILE_PLACEHOLDER = "<profile>";
34221
34246
  var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
34222
34247
  var openKind = /* @__PURE__ */ __name((kind4) => kind4 === "email" ? "message" : kind4 === "email_thread" ? "chat" : kind4 === "unknown" ? void 0 : kind4, "openKind");
@@ -34272,7 +34297,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
34272
34297
  return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
34273
34298
  }, "refLabel");
34274
34299
 
34275
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
34300
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
34276
34301
  var EXCERPT_CHARS = 280;
34277
34302
  var TITLE_CHARS = 120;
34278
34303
  var MEMORY_TITLE_CHARS = 80;
@@ -34645,7 +34670,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
34645
34670
  var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
34646
34671
  var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read2]) => [text6, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
34647
34672
 
34648
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
34673
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
34649
34674
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
34650
34675
  ref: ref3,
34651
34676
  kind: read2.kind,
@@ -34681,7 +34706,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
34681
34706
  });
34682
34707
  }, "evidenceSourcesOf");
34683
34708
 
34684
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/attachments/limits.js
34709
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/attachments/limits.js
34685
34710
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
34686
34711
  var MAX_TEXT_CHARS = 2e6;
34687
34712
  var ATTACHMENT_LIMIT_ENV = [
@@ -34707,7 +34732,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
34707
34732
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
34708
34733
  }, "pdfPreviewLimits");
34709
34734
 
34710
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/ulid.js
34735
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/ulid.js
34711
34736
  import { randomBytes } from "node:crypto";
34712
34737
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
34713
34738
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -34720,7 +34745,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
34720
34745
  return time3 + random;
34721
34746
  }, "ulid");
34722
34747
 
34723
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
34748
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
34724
34749
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
34725
34750
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
34726
34751
  if (!meta && !sections?.length)
@@ -34741,7 +34766,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
34741
34766
  return typeof language === "string" && language !== "" ? language : null;
34742
34767
  }, "languageOf");
34743
34768
 
34744
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
34769
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
34745
34770
  var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
34746
34771
  var objectOf2 = /* @__PURE__ */ __name((value) => {
34747
34772
  if (isObject(value))
@@ -34984,7 +35009,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
34984
35009
  };
34985
35010
  }, "filesStoreOver");
34986
35011
 
34987
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
35012
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
34988
35013
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
34989
35014
  entity: "document",
34990
35015
  backend: "sql",
@@ -35030,7 +35055,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
35030
35055
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
35031
35056
  }, "importedDocumentWhere");
35032
35057
 
35033
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
35058
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
35034
35059
  var NOTE_FORMATS = ["obsidian", "markdown"];
35035
35060
  var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
35036
35061
  var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
@@ -35556,7 +35581,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
35556
35581
  };
35557
35582
  }, "notesStoreOver");
35558
35583
 
35559
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
35584
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
35560
35585
  var NAMED = "SELECT m.*, b.name AS author_name, b.kind AS author_kind FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
35561
35586
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
35562
35587
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -35778,7 +35803,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
35778
35803
  };
35779
35804
  }, "memoriesStoreOver");
35780
35805
 
35781
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
35806
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
35782
35807
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
35783
35808
  var KEY = "taskFirstPassPerChat";
35784
35809
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -35798,7 +35823,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
35798
35823
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY, String(value), now2);
35799
35824
  }, "saveFirstPassPerChat");
35800
35825
 
35801
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/external-links.js
35826
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/external-links.js
35802
35827
  var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
35803
35828
  var EXTERNAL_ID_CHARS = 200;
35804
35829
  var SOURCE_URL_CHARS = 2e3;
@@ -35825,7 +35850,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
35825
35850
  return text6;
35826
35851
  }, "sourceUrlOf");
35827
35852
 
35828
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
35853
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
35829
35854
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
35830
35855
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
35831
35856
  name,
@@ -36048,7 +36073,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
36048
36073
  return root === void 0 ? void 0 : { ...query, root };
36049
36074
  }, "withoutField");
36050
36075
 
36051
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
36076
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
36052
36077
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
36053
36078
  if (row2.author_type == null)
36054
36079
  return null;
@@ -36076,7 +36101,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
36076
36101
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
36077
36102
  }, "addComment");
36078
36103
 
36079
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
36104
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
36080
36105
  var TASK_RELATION_KINDS = [
36081
36106
  "blocked-by",
36082
36107
  "follow-up-of",
@@ -36206,7 +36231,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
36206
36231
  };
36207
36232
  }, "taskRelationsStoreOver");
36208
36233
 
36209
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
36234
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
36210
36235
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
36211
36236
  var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
36212
36237
  var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind4, changes, at) => {
@@ -36735,7 +36760,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
36735
36760
  };
36736
36761
  }, "workTasksOver");
36737
36762
 
36738
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
36763
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
36739
36764
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
36740
36765
  const { database, now: now2 } = context;
36741
36766
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -36784,7 +36809,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
36784
36809
  };
36785
36810
  }, "taskCloseOver");
36786
36811
 
36787
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
36812
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
36788
36813
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
36789
36814
  const { database, now: now2 } = context;
36790
36815
  const required3 = /* @__PURE__ */ __name((id2) => {
@@ -37002,7 +37027,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
37002
37027
  };
37003
37028
  }, "taskPairsOver");
37004
37029
 
37005
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
37030
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
37006
37031
  var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
37007
37032
  var TASK_STATS_SQL = {
37008
37033
  rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? BOARD_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
@@ -37041,7 +37066,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
37041
37066
  }, "statNames")
37042
37067
  }), "taskStatsOver");
37043
37068
 
37044
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
37069
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
37045
37070
  var COLUMNS3 = "t.id AS row_id, t.package_id, t.source_locator, t.source_kind, t.source_group, t.type, t.status, t.close_reason, t.source, t.created_at, t.due_at, t.closed_at, t.closed_by_type, t.closed_by_id, t.key, t.category, t.claimed_by, t.claimed_until, p.name AS account";
37046
37071
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
37047
37072
  const key2 = inboxKey(account);
@@ -37248,7 +37273,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
37248
37273
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
37249
37274
  }, "oneOf");
37250
37275
 
37251
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/accounts.js
37276
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/accounts.js
37252
37277
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
37253
37278
  const { database } = context;
37254
37279
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -37293,7 +37318,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
37293
37318
  };
37294
37319
  }, "accountsStoreOver");
37295
37320
 
37296
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
37321
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
37297
37322
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
37298
37323
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
37299
37324
  const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -37317,7 +37342,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
37317
37342
  })), "keepDownloads");
37318
37343
  var keepProviderRefs = /* @__PURE__ */ __name((context, chatKey, messageId, files2) => updatePlaced(context, chatKey, messageId, files2.filter((file) => Object.keys(file.providerRef).length > 0), (file) => refColumn(file.providerRef)), "keepProviderRefs");
37319
37344
 
37320
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/attachments.js
37345
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/attachments.js
37321
37346
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
37322
37347
  const { database } = context;
37323
37348
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -37374,7 +37399,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
37374
37399
  }, "keepAttachmentText")
37375
37400
  }), "attachmentsStoreOver");
37376
37401
 
37377
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
37402
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
37378
37403
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
37379
37404
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
37380
37405
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -37554,7 +37579,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
37554
37579
  return done;
37555
37580
  }, "rekeyChats");
37556
37581
 
37557
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
37582
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
37558
37583
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
37559
37584
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
37560
37585
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -37612,7 +37637,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
37612
37637
  return { ...coverage, oldestMessageAt: toIso(oldest) };
37613
37638
  }, "chatCoverage");
37614
37639
 
37615
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/chats.js
37640
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/chats.js
37616
37641
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
37617
37642
  const { database } = context;
37618
37643
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -37747,7 +37772,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
37747
37772
  };
37748
37773
  }, "chatsStoreOver");
37749
37774
 
37750
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
37775
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
37751
37776
  import { createHash as createHash7 } from "node:crypto";
37752
37777
  var BATCH_CONTEXT = 50;
37753
37778
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -37885,7 +37910,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
37885
37910
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
37886
37911
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
37887
37912
 
37888
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
37913
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
37889
37914
  import { setTimeout } from "node:timers/promises";
37890
37915
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
37891
37916
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -38197,7 +38222,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
38197
38222
  AND NOT EXISTS (SELECT 1 FROM messages d
38198
38223
  WHERE d.id IN (l.message_id, l.parent_id) AND d.deleted_at > l.created_at)`).map(({ id: id2, parent: parent2 }) => [id2, parent2])), "agentAnswers");
38199
38224
 
38200
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/conversations.js
38225
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/conversations.js
38201
38226
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
38202
38227
  const { database } = context;
38203
38228
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -38304,7 +38329,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
38304
38329
  };
38305
38330
  }, "conversationsStoreOver");
38306
38331
 
38307
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/counters.js
38332
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/counters.js
38308
38333
  var LIVE_MESSAGE = "SELECT m.id AS pk FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id WHERE ac.provider=? AND ac.external_id=? AND c.external_id=? AND m.external_id=? AND m.deleted_at IS NULL";
38309
38334
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
38310
38335
  const { database } = context;
@@ -38329,7 +38354,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
38329
38354
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
38330
38355
  }), "countersStoreOver");
38331
38356
 
38332
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
38357
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
38333
38358
  var MENTION_STATUSES = ["found", "linked", "dismissed"];
38334
38359
  var MENTION_QUERY = defineQuery({
38335
38360
  entity: "mention",
@@ -38545,7 +38570,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
38545
38570
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
38546
38571
  }, "listPlaces");
38547
38572
 
38548
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/mentions.js
38573
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/mentions.js
38549
38574
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
38550
38575
  const { database } = context;
38551
38576
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -38580,7 +38605,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
38580
38605
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
38581
38606
  }), "mentionsStoreOver");
38582
38607
 
38583
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
38608
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
38584
38609
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
38585
38610
  const read2 = database.prepare("SELECT m.id, m.external_id, m.text, m.sent_at, m.sender_name, coalesce(m.sender_chat_external_id, i.external_id) AS sender_id FROM messages m LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.chat_id = ? AND m.deleted_at IS NULL AND (m.text LIKE '%google.com%' OR m.text LIKE '%forms.gle%') " + (messageId === void 0 ? "" : "AND m.external_id = ? ") + "ORDER BY m.sent_at DESC, m.id DESC");
38586
38611
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -38595,7 +38620,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
38595
38620
  }));
38596
38621
  }, "documentLinkMessages");
38597
38622
 
38598
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
38623
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
38599
38624
  var stemmerFor = stemmerCache();
38600
38625
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
38601
38626
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -38639,7 +38664,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
38639
38664
  });
38640
38665
  }, "laterSharingRare");
38641
38666
 
38642
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/messages.js
38667
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/messages.js
38643
38668
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
38644
38669
  const { database } = context;
38645
38670
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -38774,7 +38799,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
38774
38799
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
38775
38800
  }), "messagesStoreOver");
38776
38801
 
38777
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
38802
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
38778
38803
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
38779
38804
  var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
38780
38805
  var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
@@ -38831,7 +38856,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
38831
38856
  });
38832
38857
  }, "personPreparation");
38833
38858
 
38834
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
38859
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
38835
38860
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
38836
38861
  const id2 = Number(uid);
38837
38862
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -38839,7 +38864,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
38839
38864
  return Boolean(database.prepare("SELECT 1 FROM persons p JOIN identity_links l ON l.person_id=p.id JOIN account_identities a ON a.identity_id=l.identity_id WHERE p.id=? AND a.account_id IN (SELECT value FROM json_each(?)) LIMIT 1").get(id2, JSON.stringify(accountIds)));
38840
38865
  }, "personSeenInAccounts");
38841
38866
 
38842
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
38867
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
38843
38868
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
38844
38869
  const row2 = database.prepare("SELECT a.id AS account_id, i.id AS identity_id FROM accounts a JOIN account_identities ai ON ai.account_id=a.id JOIN identities i ON i.id=ai.identity_id WHERE a.provider=? AND a.external_id=? AND i.provider=? AND i.external_id=?").get(key2.provider, key2.account, key2.provider, personId);
38845
38870
  if (!row2)
@@ -38905,7 +38930,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
38905
38930
  return { id: id2, personId, removed: true };
38906
38931
  }, "removeNote");
38907
38932
 
38908
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/people.js
38933
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/people.js
38909
38934
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
38910
38935
  const { database } = context;
38911
38936
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -38990,13 +39015,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
38990
39015
  };
38991
39016
  }, "peopleStoreOver");
38992
39017
 
38993
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
39018
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
38994
39019
  import { createHash as createHash9 } from "node:crypto";
38995
39020
 
38996
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
39021
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
38997
39022
  import { createHash as createHash8 } from "node:crypto";
38998
39023
 
38999
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
39024
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
39000
39025
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
39001
39026
  var AUTHOR_MEASURES = [
39002
39027
  "messages",
@@ -39136,7 +39161,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
39136
39161
  var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
39137
39162
  var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
39138
39163
 
39139
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
39164
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
39140
39165
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
39141
39166
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
39142
39167
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -39358,7 +39383,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
39358
39383
  };
39359
39384
  }, "rankReplyGraph");
39360
39385
 
39361
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
39386
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
39362
39387
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
39363
39388
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
39364
39389
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
@@ -39532,7 +39557,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
39532
39557
  return { items, evidence, summary, graph: graph.quality };
39533
39558
  }, "calculateAdminStatistics");
39534
39559
 
39535
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
39560
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
39536
39561
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
39537
39562
  const dates = [];
39538
39563
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -39554,7 +39579,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
39554
39579
  return dates[0].node.resolution.date;
39555
39580
  }, "rankingContextRange");
39556
39581
 
39557
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
39582
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
39558
39583
  var reactionCounts = /* @__PURE__ */ __name((stored3) => {
39559
39584
  let counts;
39560
39585
  try {
@@ -39849,7 +39874,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
39849
39874
  });
39850
39875
  }, "rankQuery");
39851
39876
 
39852
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
39877
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
39853
39878
  function fail4(message2, reason = "query.too-large") {
39854
39879
  throw new CliError("validation_error", message2, { reason, complete: false });
39855
39880
  }
@@ -40026,7 +40051,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
40026
40051
  return result;
40027
40052
  }), "adminStatisticsQuery");
40028
40053
 
40029
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
40054
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
40030
40055
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
40031
40056
  if (!execution.accounts.length)
40032
40057
  return { conversations: [], chats: [] };
@@ -40044,7 +40069,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
40044
40069
  return { conversations: conversations2, chats: chats2 };
40045
40070
  }, "conversationEligibility");
40046
40071
 
40047
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
40072
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
40048
40073
  import { createHash as createHash10 } from "node:crypto";
40049
40074
  var EVIDENCE_BYTES = 64 * 1024;
40050
40075
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -40194,7 +40219,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
40194
40219
  return result;
40195
40220
  }, "rankingEvidence");
40196
40221
 
40197
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
40222
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
40198
40223
  var FAR = Number.MAX_SAFE_INTEGER;
40199
40224
  var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
40200
40225
  const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
@@ -40288,7 +40313,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
40288
40313
  });
40289
40314
  }, "waitingChats");
40290
40315
 
40291
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/queries.js
40316
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/queries.js
40292
40317
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
40293
40318
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
40294
40319
  if (execution.corpus === "mail")
@@ -40309,7 +40334,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
40309
40334
  };
40310
40335
  }, "queriesStoreOver");
40311
40336
 
40312
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
40337
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
40313
40338
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
40314
40339
  const { database, now: now2 } = context;
40315
40340
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -40348,10 +40373,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
40348
40373
  }));
40349
40374
  }, "chatEventsOf");
40350
40375
 
40351
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
40376
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
40352
40377
  import { createHash as createHash11 } from "node:crypto";
40353
40378
 
40354
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/calendar.js
40379
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/calendar.js
40355
40380
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
40356
40381
  const format = new Intl.DateTimeFormat("en-CA", {
40357
40382
  timeZone: zone,
@@ -40371,7 +40396,7 @@ var weekKey = /* @__PURE__ */ __name((day2) => {
40371
40396
  return date3.toISOString().slice(0, 10);
40372
40397
  }, "weekKey");
40373
40398
 
40374
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/retention.js
40399
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/retention.js
40375
40400
  var RETENTION_TOLERANCE = 864e5;
40376
40401
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
40377
40402
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -40425,7 +40450,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
40425
40450
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
40426
40451
  }, "retentionCohorts");
40427
40452
 
40428
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
40453
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
40429
40454
  var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
40430
40455
  var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
40431
40456
  validateRetentionOptions(options);
@@ -40556,7 +40581,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
40556
40581
  };
40557
40582
  }, "retentionQuery");
40558
40583
 
40559
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
40584
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
40560
40585
  var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
40561
40586
  var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
40562
40587
  ...isBot === void 0 ? {} : { bot: isBot },
@@ -40687,7 +40712,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
40687
40712
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
40688
40713
  })), "trackedChats");
40689
40714
 
40690
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/roster.js
40715
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/roster.js
40691
40716
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
40692
40717
  const { database } = context;
40693
40718
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -40743,7 +40768,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
40743
40768
  };
40744
40769
  }, "rosterStoreOver");
40745
40770
 
40746
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
40771
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
40747
40772
  var pendingNormalization = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL").get()?.n), "pendingNormalization");
40748
40773
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
40749
40774
  const next = database.prepare(`SELECT id AS pk, text FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL AND id > ? ORDER BY id LIMIT ?`);
@@ -40767,7 +40792,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
40767
40792
  }
40768
40793
  }, "backfillNormalized");
40769
40794
 
40770
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
40795
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
40771
40796
  var INDEX2 = "message_words";
40772
40797
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
40773
40798
  const row2 = indexRow(database, INDEX2);
@@ -40894,7 +40919,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
40894
40919
  });
40895
40920
  }, "resetSearchIndex");
40896
40921
 
40897
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
40922
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
40898
40923
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
40899
40924
  const filled2 = { stemmed: 0, drained: 0 };
40900
40925
  const before2 = stemsState(database);
@@ -40989,7 +41014,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
40989
41014
  return resetStems(database, { now: now2 });
40990
41015
  }, "followDefaultStemmers");
40991
41016
 
40992
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
41017
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
40993
41018
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
40994
41019
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
40995
41020
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -41011,7 +41036,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
41011
41036
  });
41012
41037
  }, "termCandidates");
41013
41038
 
41014
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/search-index.js
41039
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/search-index.js
41015
41040
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
41016
41041
  const { database } = context;
41017
41042
  const stemmerFor2 = stemmerCache();
@@ -41019,9 +41044,11 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
41019
41044
  knownTerms: /* @__PURE__ */ __name(async (terms2) => knownTerms(context, terms2), "knownTerms"),
41020
41045
  termCandidates: /* @__PURE__ */ __name(async (trigrams2, lengths) => termCandidates(context, trigrams2, lengths), "termCandidates"),
41021
41046
  searchIndexState: /* @__PURE__ */ __name(async () => searchIndexState2(database), "searchIndexState"),
41022
- fillSearchIndex: /* @__PURE__ */ __name(async ({ until } = {}) => fillSearchIndex(database, { now: context.now, ...until ? { until } : {} }), "fillSearchIndex"),
41047
+ fillSearchIndex: /* @__PURE__ */ __name(async ({ until } = {}) => isQueryOnly(database) ? { normalized: 0, indexed: 0, terms: 0 } : fillSearchIndex(database, { now: context.now, ...until ? { until } : {} }), "fillSearchIndex"),
41023
41048
  stemsState: /* @__PURE__ */ __name(async () => stemsState(database), "stemsState"),
41024
41049
  fillStems: /* @__PURE__ */ __name(async ({ until } = {}) => {
41050
+ if (isQueryOnly(database))
41051
+ return { stemmed: 0, drained: 0 };
41025
41052
  const filled2 = fillStems(database, { now: context.now, ...until ? { until } : {} });
41026
41053
  const transcripts = corpusIndexState(database, CORPORA.transcript);
41027
41054
  if (transcripts.wanted !== null && (transcripts.pending > 0 || transcripts.built !== transcripts.wanted))
@@ -41033,7 +41060,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
41033
41060
  };
41034
41061
  }, "searchIndexStoreOver");
41035
41062
 
41036
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
41063
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
41037
41064
  var HISTORY_KEPT = 1e3;
41038
41065
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
41039
41066
  var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -41102,7 +41129,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
41102
41129
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
41103
41130
  }, "clearHistory");
41104
41131
 
41105
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/searches.js
41132
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/searches.js
41106
41133
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
41107
41134
  const { database } = context;
41108
41135
  return {
@@ -41126,7 +41153,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
41126
41153
  };
41127
41154
  }, "searchesStoreOver");
41128
41155
 
41129
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
41156
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
41130
41157
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
41131
41158
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
41132
41159
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -41169,7 +41196,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
41169
41196
  };
41170
41197
  }, "agentActionsStoreOver");
41171
41198
 
41172
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
41199
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
41173
41200
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
41174
41201
  }) => {
41175
41202
  const { database, now: now2 } = context;
@@ -41228,7 +41255,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
41228
41255
  };
41229
41256
  }, "botUpdateStoreOver");
41230
41257
 
41231
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
41258
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
41232
41259
  var DAY4 = 864e5;
41233
41260
  var accountsOf = /* @__PURE__ */ __name((filter) => {
41234
41261
  if (filter.accountIds !== void 0 && filter.accountId !== void 0)
@@ -41337,7 +41364,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
41337
41364
  return database.prepare(`SELECT e.* FROM events e WHERE ${clauses.join(" AND ")} ORDER BY ${filter.newest ? "e.starts_at DESC, e.id DESC" : "e.starts_at, e.id"} LIMIT ? OFFSET ?`).all(...params, limit, offset).map(eventOf);
41338
41365
  }, "listEvents");
41339
41366
 
41340
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
41367
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
41341
41368
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
41342
41369
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
41343
41370
  const unseenBefore = unreferenced(database, "identities");
@@ -41392,7 +41419,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
41392
41419
  return { entries: entryIds.length, events: goneEvents.length };
41393
41420
  }, "forgetCalendarRows");
41394
41421
 
41395
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
41422
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
41396
41423
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
41397
41424
  id: Number(row2.id),
41398
41425
  accountId: Number(row2.account_id),
@@ -41979,7 +42006,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
41979
42006
  };
41980
42007
  }, "eventStoreOver");
41981
42008
 
41982
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
42009
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
41983
42010
  var CATALOG_QUERY = defineQuery({
41984
42011
  entity: "document",
41985
42012
  backend: "sql",
@@ -42221,7 +42248,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
42221
42248
  };
42222
42249
  }, "catalogStoreOver");
42223
42250
 
42224
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
42251
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
42225
42252
  var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
42226
42253
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
42227
42254
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -42234,7 +42261,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
42234
42261
  THEN 'source-modified' ELSE 'stored-update' END`;
42235
42262
  var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
42236
42263
 
42237
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
42264
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
42238
42265
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
42239
42266
  const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
42240
42267
  signal?.throwIfAborted();
@@ -42333,7 +42360,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
42333
42360
  });
42334
42361
  }, "readMeetingContextEvidence");
42335
42362
 
42336
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
42363
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
42337
42364
  var corpora = {
42338
42365
  message: {
42339
42366
  table: "messages",
@@ -42572,7 +42599,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
42572
42599
  }
42573
42600
  }), "contextRecordsOver");
42574
42601
 
42575
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/records.js
42602
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/records.js
42576
42603
  import { createHash as createHash12 } from "node:crypto";
42577
42604
  var RECORDS_SCHEMA_VERSION = 1;
42578
42605
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -42787,24 +42814,24 @@ var envelopeOfJsonl = /* @__PURE__ */ __name((text6) => {
42787
42814
  const first = lines.findIndex((line) => line.trim() !== "");
42788
42815
  if (first < 0)
42789
42816
  return {};
42790
- const parse = /* @__PURE__ */ __name((line) => {
42817
+ const parse2 = /* @__PURE__ */ __name((line) => {
42791
42818
  try {
42792
42819
  return JSON.parse(line);
42793
42820
  } catch {
42794
42821
  return line;
42795
42822
  }
42796
42823
  }, "parse");
42797
- const header = parse(lines[first]);
42824
+ const header = parse2(lines[first]);
42798
42825
  const records2 = [];
42799
42826
  for (let at = first + 1; at < lines.length; at++) {
42800
42827
  const line = lines[at];
42801
42828
  if (line.trim() !== "")
42802
- records2.push(parse(line));
42829
+ records2.push(parse2(line));
42803
42830
  }
42804
42831
  return isObject2(header) ? { ...header, records: records2 } : header;
42805
42832
  }, "envelopeOfJsonl");
42806
42833
 
42807
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
42834
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
42808
42835
  var TABLES = { deal: "deals", lead: "leads" };
42809
42836
  var SOURCE = "crm";
42810
42837
  var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${key2.account}/${type}/${externalId}`, "crmIdentityId");
@@ -42827,28 +42854,25 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
42827
42854
  const author = /* @__PURE__ */ __name((key2) => authorActor(context, { bot: key2.provider, kind: "rule" }).actor, "author");
42828
42855
  const account = /* @__PURE__ */ __name((key2) => accountPk(context, key2), "account");
42829
42856
  const pipelineOf = /* @__PURE__ */ __name((accountId, kind4, externalId) => database.prepare("SELECT * FROM pipelines WHERE account_id = ? AND kind = ? AND external_id = ?").get(accountId, kind4, externalId), "pipelineOf");
42830
- const otherKindHolds = /* @__PURE__ */ __name((accountId, kind4, externalId) => database.prepare("SELECT 1 FROM pipelines WHERE account_id = ? AND kind <> ? AND external_id = ?").get(accountId, kind4, externalId) !== void 0, "otherKindHolds");
42831
42857
  const savePipelines = /* @__PURE__ */ __name((key2, kind4, pipelines2) => write(database, () => {
42832
42858
  const accountId = account(key2);
42833
42859
  const at = now2();
42834
- const skipped = [];
42835
42860
  for (const pipeline of pipelines2) {
42836
- if (otherKindHolds(accountId, kind4, pipeline.externalId)) {
42837
- skipped.push({
42838
- externalId: pipeline.externalId,
42839
- reason: "crm.pipeline-clash",
42840
- message: `${kind4} pipeline ${pipeline.externalId} has the id of a stored pipeline of the other kind`
42841
- });
42842
- continue;
42843
- }
42844
42861
  const name = textOf3(pipeline.name, 80) ?? pipeline.externalId;
42845
42862
  const held = pipelineOf(accountId, kind4, pipeline.externalId);
42846
42863
  const id2 = held ? Number(held.id) : Number(database.prepare("INSERT INTO pipelines (account_id, external_id, kind, name, name_folded, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING id").get(accountId, pipeline.externalId, kind4, name, fold(name), at, at)?.id);
42847
- if (held && held.name !== name)
42848
- database.prepare("UPDATE pipelines SET name = ?, name_folded = ?, updated_at = ? WHERE id = ?").run(name, fold(name), at, id2);
42864
+ if (held && (held.name !== name || held.deleted_at != null))
42865
+ database.prepare("UPDATE pipelines SET name = ?, name_folded = ?, updated_at = ?, deleted_at = NULL WHERE id = ?").run(name, fold(name), at, id2);
42849
42866
  saveStages(id2, pipeline, at);
42850
42867
  }
42851
- return { saved: pipelines2.length - skipped.length, skipped };
42868
+ if (pipelines2.length === 0)
42869
+ return { saved: 0, skipped: [] };
42870
+ const listed = new Set(pipelines2.map(({ externalId }) => externalId));
42871
+ const mark = database.prepare("UPDATE pipelines SET deleted_at = ?, updated_at = ? WHERE id = ?");
42872
+ for (const row2 of database.prepare("SELECT id, external_id FROM pipelines WHERE account_id = ? AND kind = ? AND deleted_at IS NULL").all(accountId, kind4))
42873
+ if (!listed.has(String(row2.external_id)))
42874
+ mark.run(at, at, Number(row2.id));
42875
+ return { saved: pipelines2.length, skipped: [] };
42852
42876
  }), "savePipelines");
42853
42877
  const saveStages = /* @__PURE__ */ __name((pipelineId, pipeline, at) => {
42854
42878
  const ordered = [...pipeline.stages].sort((a, b) => a.position - b.position);
@@ -42866,21 +42890,64 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
42866
42890
  const listed = new Set(wanted.map(({ externalId }) => externalId));
42867
42891
  const taken = new Set(wanted.map(({ folded: folded5 }) => folded5));
42868
42892
  const rename = database.prepare("UPDATE pipeline_stages SET name_folded = ? WHERE id = ?");
42893
+ const gone = database.prepare("UPDATE pipeline_stages SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL");
42869
42894
  for (const row2 of held) {
42870
- if (row2.external_id != null && listed.has(String(row2.external_id)))
42895
+ const kept = row2.external_id != null && listed.has(String(row2.external_id));
42896
+ if (kept)
42871
42897
  rename.run(`\0${row2.id}`, Number(row2.id));
42872
42898
  else if (taken.has(String(row2.name_folded)))
42873
42899
  rename.run(`${row2.name_folded} (${row2.external_id ?? row2.id})`, Number(row2.id));
42900
+ if (!kept)
42901
+ gone.run(at, Number(row2.id));
42874
42902
  }
42875
42903
  const byId2 = new Map(held.map((row2) => [String(row2.external_id), row2]));
42876
42904
  for (const stage of wanted) {
42877
42905
  const row2 = byId2.get(stage.externalId);
42878
42906
  if (row2)
42879
- database.prepare("UPDATE pipeline_stages SET name = ?, name_folded = ?, position = ?, outcome = ?, updated_at = ? WHERE id = ?").run(stage.name, stage.folded, stage.position, stage.outcome, at, Number(row2.id));
42907
+ database.prepare("UPDATE pipeline_stages SET name = ?, name_folded = ?, position = ?, outcome = ?, updated_at = ?, deleted_at = NULL WHERE id = ?").run(stage.name, stage.folded, stage.position, stage.outcome, at, Number(row2.id));
42880
42908
  else
42881
42909
  database.prepare("INSERT INTO pipeline_stages (pipeline_id, name, name_folded, position, outcome, external_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(pipelineId, stage.name, stage.folded, stage.position, stage.outcome, stage.externalId, at, at);
42882
42910
  }
42883
42911
  }, "saveStages");
42912
+ const saveFields = /* @__PURE__ */ __name((key2, kind4, fields4) => write(database, () => {
42913
+ const accountId = account(key2);
42914
+ const at = now2();
42915
+ const skipped = [];
42916
+ const listed = /* @__PURE__ */ new Set();
42917
+ const upsert2 = database.prepare("INSERT INTO crm_fields (account_id, kind, code, label, type, multiple, filterable, options, position, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (account_id, kind, code) DO UPDATE SET label = excluded.label, type = excluded.type, multiple = excluded.multiple, filterable = excluded.filterable, options = excluded.options, position = excluded.position, updated_at = excluded.updated_at, deleted_at = NULL");
42918
+ for (const field4 of fields4) {
42919
+ const code = typeof field4.code === "string" ? field4.code.trim() : "";
42920
+ if (!code || listed.has(code)) {
42921
+ skipped.push({
42922
+ externalId: code,
42923
+ reason: "crm.item-invalid",
42924
+ message: code ? `${kind4} field ${code} is listed twice` : `a ${kind4} field has no code`
42925
+ });
42926
+ continue;
42927
+ }
42928
+ listed.add(code);
42929
+ const options = field4.options?.map((option) => ({ id: String(option.id), label: String(option.label) }));
42930
+ upsert2.run(accountId, kind4, code, textOf3(field4.label, 200), textOf3(field4.type, 80) ?? "string", field4.multiple ? 1 : 0, field4.filterable ? 1 : 0, options ? JSON.stringify(options) : null, listed.size, at, at);
42931
+ }
42932
+ const mark = database.prepare("UPDATE crm_fields SET deleted_at = ?, updated_at = ? WHERE id = ?");
42933
+ for (const row2 of database.prepare("SELECT id, code FROM crm_fields WHERE account_id = ? AND kind = ? AND deleted_at IS NULL").all(accountId, kind4))
42934
+ if (!listed.has(String(row2.code)))
42935
+ mark.run(at, at, Number(row2.id));
42936
+ return { saved: listed.size, skipped };
42937
+ }), "saveFields");
42938
+ const fieldsOf3 = /* @__PURE__ */ __name((key2, kind4) => {
42939
+ const accountId = findAccountPk(context, key2);
42940
+ if (accountId === void 0)
42941
+ return [];
42942
+ return database.prepare("SELECT * FROM crm_fields WHERE account_id = ? AND kind = ? AND deleted_at IS NULL ORDER BY position, id").all(accountId, kind4).map((row2) => ({
42943
+ code: String(row2.code),
42944
+ label: row2.label == null ? null : String(row2.label),
42945
+ type: String(row2.type),
42946
+ multiple: Number(row2.multiple) === 1,
42947
+ filterable: Number(row2.filterable) === 1,
42948
+ ...row2.options == null ? {} : { options: JSON.parse(String(row2.options)) }
42949
+ }));
42950
+ }, "fieldsOf");
42884
42951
  const personIdOf = /* @__PURE__ */ __name((key2, externalId) => {
42885
42952
  const row2 = database.prepare("SELECT l.person_id FROM identities i JOIN identity_links l ON l.identity_id = i.id WHERE i.provider = ? AND i.external_id = ?").get(key2.provider, crmIdentityId(key2, externalId));
42886
42953
  return row2 ? Number(row2.person_id) : null;
@@ -42909,7 +42976,12 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
42909
42976
  const status = item.status ?? String(stage.outcome);
42910
42977
  const closed = status === "open" ? null : day(item.closedDate, "a closed day") ?? new Date(epoch(item.updatedAt, at)).toISOString().slice(0, 10);
42911
42978
  const deal = kind4 === "lead" && item.deal ? database.prepare("SELECT id FROM deals WHERE account_id = ? AND external_id = ?").get(accountId, item.deal) : void 0;
42912
- const metadata3 = { ...item.metadata ?? {}, ...item.url ? { url: item.url } : {} };
42979
+ const metadata3 = {
42980
+ ...item.metadata ?? {},
42981
+ ...item.url ? { url: item.url } : {},
42982
+ ...item.assignee ? { assignee: crmIdentityId(key2, item.assignee, "user") } : {},
42983
+ ...item.closedReason && status !== "open" ? { closed_reason: textOf3(item.closedReason, 2e3) } : {}
42984
+ };
42913
42985
  const values = {
42914
42986
  title,
42915
42987
  organization: item.organization ? organizationIdOf(accountId, item.organization) : null,
@@ -43014,6 +43086,8 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
43014
43086
  return { saved: contacts2.length, skipped: [] };
43015
43087
  }, "savePeople"),
43016
43088
  saveOrganizations: /* @__PURE__ */ __name(async (key2, organizations2) => saveOrganizations(key2, organizations2), "saveOrganizations"),
43089
+ saveFields: /* @__PURE__ */ __name(async (key2, kind4, fields4) => saveFields(key2, kind4, fields4), "saveFields"),
43090
+ fields: /* @__PURE__ */ __name(async (key2, kind4) => fieldsOf3(key2, kind4), "fields"),
43017
43091
  remove: /* @__PURE__ */ __name(async (key2, kind4, externalIds) => write(database, () => {
43018
43092
  const gone = new Set(externalIds);
43019
43093
  return markDeleted2(kind4, stored3(key2, kind4).filter((row2) => gone.has(String(row2.external_id))).map((row2) => Number(row2.id)));
@@ -43023,11 +43097,16 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
43023
43097
  const gone = stored3(key2, kind4).filter((row2) => !held.has(String(row2.external_id)) && Number(row2.updated_at) < before2).map((row2) => Number(row2.id));
43024
43098
  return dryRun ? gone.length : markDeleted2(kind4, gone);
43025
43099
  }), "removeUnlisted"),
43026
- count: /* @__PURE__ */ __name(async (key2, kind4) => kind4 === "person" ? Number(database.prepare("SELECT count(*) AS n FROM identities WHERE provider = ? AND substr(external_id, 1, ?) = ?").get(key2.provider, key2.account.length + 1, `${key2.account}/`)?.n) : stored3(key2, kind4).length, "count")
43100
+ count: /* @__PURE__ */ __name(async (key2, kind4) => kind4 === "person" ? Number(database.prepare("SELECT count(*) AS n FROM identities WHERE provider = ? AND substr(external_id, 1, ?) = ?").get(key2.provider, key2.account.length + 1, `${key2.account}/`)?.n) : stored3(key2, kind4).length, "count"),
43101
+ refOf: /* @__PURE__ */ __name(async (key2, kind4, externalId) => {
43102
+ const accountId = findAccountPk(context, key2);
43103
+ const row2 = accountId === void 0 ? void 0 : database.prepare(`SELECT id FROM ${TABLES[kind4]} WHERE account_id = ? AND external_id = ?`).get(accountId, externalId);
43104
+ return row2 ? `${kind4}:${row2.id}` : null;
43105
+ }, "refOf")
43027
43106
  };
43028
43107
  }, "crmCopiesOver");
43029
43108
 
43030
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
43109
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
43031
43110
  var refuse = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
43032
43111
  throw new CliError(code, message2, { reason });
43033
43112
  }, "refuse");
@@ -43488,7 +43567,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
43488
43567
  };
43489
43568
  }, "financeStoreOver");
43490
43569
 
43491
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
43570
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
43492
43571
  var TABLES2 = { deal: "deals", lead: "leads" };
43493
43572
  var itemsSql = /* @__PURE__ */ __name((kind4) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id FROM ${TABLES2[kind4]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id`, "itemsSql");
43494
43573
  var MAX_STAGES = 30;
@@ -43504,6 +43583,16 @@ var jsonField = /* @__PURE__ */ __name((metadata3, key2) => {
43504
43583
  return null;
43505
43584
  }
43506
43585
  }, "jsonField");
43586
+ var isValue = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value) && "label" in value && "value" in value, "isValue");
43587
+ var providerMetadataOf = /* @__PURE__ */ __name((metadata3) => {
43588
+ if (metadata3 == null)
43589
+ return {};
43590
+ try {
43591
+ return Object.fromEntries(Object.entries(JSON.parse(String(metadata3))).filter(([, value]) => isValue(value)));
43592
+ } catch {
43593
+ return {};
43594
+ }
43595
+ }, "providerMetadataOf");
43507
43596
  var accountOf3 = /* @__PURE__ */ __name((provider, external) => provider == null ? null : { provider: String(provider), account: String(external) }, "accountOf");
43508
43597
  var dealOperationsOver = /* @__PURE__ */ __name((context) => {
43509
43598
  const { database, now: now2 } = context;
@@ -43541,6 +43630,8 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
43541
43630
  deal: row2.deal_id == null ? null : `deal:${row2.deal_id}`,
43542
43631
  account: accountOf3(row2.account_provider, row2.account_external_id),
43543
43632
  externalId: row2.external_id == null ? null : String(row2.external_id),
43633
+ assignee: jsonField(row2.metadata, "assignee"),
43634
+ providerMetadata: providerMetadataOf(row2.metadata),
43544
43635
  people: peopleOf(kind4, fields4.id),
43545
43636
  author: authorOf(row2),
43546
43637
  model: row2.model == null ? null : String(row2.model),
@@ -43564,12 +43655,12 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
43564
43655
  }, "read");
43565
43656
  const inScope = /* @__PURE__ */ __name((scope3, row2) => scope3 === void 0 || (scope3 === "own" ? row2.account_id == null : row2.account_provider === scope3.provider && row2.account_external_id === scope3.account), "inScope");
43566
43657
  const kindOf4 = /* @__PURE__ */ __name((kind4) => kind4 === void 0 ? "deal" : oneOf4(kind4, DEAL_KINDS, "a kind"), "kindOf");
43567
- const pipelineRows = /* @__PURE__ */ __name((kind4, scope3) => database.prepare("SELECT p.*, a.provider AS account_provider, a.external_id AS account_external_id FROM pipelines p LEFT JOIN accounts a ON a.id = p.account_id WHERE (? IS NULL OR p.kind = ?) ORDER BY p.name_folded, p.id").all(kind4 ?? null, kind4 ?? null).filter((row2) => inScope(scope3, row2)), "pipelineRows");
43658
+ const pipelineRows = /* @__PURE__ */ __name((kind4, scope3, { deleted = false } = {}) => database.prepare(`SELECT p.*, a.provider AS account_provider, a.external_id AS account_external_id FROM pipelines p LEFT JOIN accounts a ON a.id = p.account_id WHERE (? IS NULL OR p.kind = ?) ${deleted ? "" : "AND p.deleted_at IS NULL "}ORDER BY p.name_folded, p.id`).all(kind4 ?? null, kind4 ?? null).filter((row2) => inScope(scope3, row2)), "pipelineRows");
43568
43659
  const label = /* @__PURE__ */ __name((row2) => `pipeline:${row2.id} (${row2.name}${row2.account_provider == null ? "" : `, ${row2.account_provider}:${row2.account_external_id}`})`, "label");
43569
43660
  const pipelineRow = /* @__PURE__ */ __name((reference2, kind4, scope3) => {
43570
43661
  const named3 = reference2.trim();
43571
43662
  if (/^pipeline:\d+$/.test(named3)) {
43572
- const row2 = pipelineRows(kind4, scope3).find((one2) => `pipeline:${one2.id}` === named3);
43663
+ const row2 = pipelineRows(kind4, scope3, { deleted: true }).find((one2) => `pipeline:${one2.id}` === named3);
43573
43664
  if (!row2)
43574
43665
  throw new CliError("not_found", `no ${kind4 ?? ""} pipeline ${named3}`, { reason: "pipeline.not-found" });
43575
43666
  return row2;
@@ -43695,7 +43786,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
43695
43786
  });
43696
43787
  return made;
43697
43788
  });
43698
- return pipelinesOf(pipelineRows(pipelineKind).filter((row2) => Number(row2.id) === id2))[0];
43789
+ return pipelinesOf(pipelineRows(pipelineKind, void 0, { deleted: true }).filter((row2) => Number(row2.id) === id2))[0];
43699
43790
  }, "addPipeline"),
43700
43791
  pipelines: /* @__PURE__ */ __name((filter = {}) => pipelinesOf(pipelineRows(filter.kind === void 0 ? void 0 : kindOf4(filter.kind), filter.account)), "pipelines"),
43701
43792
  pipeline: /* @__PURE__ */ __name((reference2, options = {}) => {
@@ -43816,7 +43907,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
43816
43907
  };
43817
43908
  }, "dealsStoreOver");
43818
43909
 
43819
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
43910
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
43820
43911
  var NOTE_FIELDS = [
43821
43912
  "text",
43822
43913
  "exact",
@@ -44246,7 +44337,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
44246
44337
  };
44247
44338
  }, "noteSearchOver");
44248
44339
 
44249
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
44340
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
44250
44341
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
44251
44342
  var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
44252
44343
  var EVENT_CORPUS = {
@@ -44378,7 +44469,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
44378
44469
  };
44379
44470
  }, "eventSearchOver");
44380
44471
 
44381
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
44472
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
44382
44473
  var refuse2 = /* @__PURE__ */ __name((message2, reason) => {
44383
44474
  throw new CliError("validation_error", message2, { reason });
44384
44475
  }, "refuse");
@@ -44456,7 +44547,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
44456
44547
  };
44457
44548
  }, "paymentEntriesOver");
44458
44549
 
44459
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
44550
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
44460
44551
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
44461
44552
  var reference = /* @__PURE__ */ __name((raw) => {
44462
44553
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -44482,7 +44573,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
44482
44573
  return valid;
44483
44574
  }, "validateEvidenceFindings");
44484
44575
 
44485
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/domain/moment.js
44576
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/domain/moment.js
44486
44577
  var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
44487
44578
  try {
44488
44579
  return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
@@ -44494,7 +44585,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
44494
44585
  }
44495
44586
  }, "calendarMoment");
44496
44587
 
44497
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
44588
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
44498
44589
  var NAMED3 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
44499
44590
  var iso10 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
44500
44591
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -44703,7 +44794,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
44703
44794
  };
44704
44795
  }, "factsStoreOver");
44705
44796
 
44706
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
44797
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
44707
44798
  var invalid5 = /* @__PURE__ */ __name((message2) => {
44708
44799
  throw new CliError("validation_error", message2);
44709
44800
  }, "invalid");
@@ -44807,7 +44898,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
44807
44898
  return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
44808
44899
  }, "findingsCoreOver");
44809
44900
 
44810
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
44901
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
44811
44902
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
44812
44903
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
44813
44904
  var iso11 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -44972,7 +45063,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
44972
45063
  };
44973
45064
  }, "proposedActionsStoreOver");
44974
45065
 
44975
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
45066
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
44976
45067
  var stale = /* @__PURE__ */ __name(() => {
44977
45068
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
44978
45069
  reason: "evidence-findings.stale"
@@ -45153,7 +45244,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
45153
45244
  };
45154
45245
  }, "evidenceFindingsStoreOver");
45155
45246
 
45156
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
45247
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
45157
45248
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
45158
45249
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
45159
45250
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -45206,7 +45297,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
45206
45297
  }, "forPerson")
45207
45298
  }), "involvementStoreOver");
45208
45299
 
45209
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
45300
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
45210
45301
  import { createHash as createHash13 } from "node:crypto";
45211
45302
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
45212
45303
  var id = /* @__PURE__ */ __name((value) => {
@@ -45292,7 +45383,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
45292
45383
  };
45293
45384
  }, "meetingProjectsStoreOver");
45294
45385
 
45295
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
45386
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
45296
45387
  var ORGANIZATIONS_QUERY = {
45297
45388
  entity: "organization",
45298
45389
  backend: "sql",
@@ -45333,7 +45424,7 @@ var REMINDERS_QUERY = {
45333
45424
  })
45334
45425
  };
45335
45426
 
45336
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
45427
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
45337
45428
  var organizationOf = /* @__PURE__ */ __name((row2) => ({
45338
45429
  id: String(row2.id),
45339
45430
  ref: `organization:${row2.id}`,
@@ -45366,7 +45457,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
45366
45457
  }), "updateOrganization")
45367
45458
  }), "organizationsStoreOver");
45368
45459
 
45369
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
45460
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
45370
45461
  var relationOf = /* @__PURE__ */ __name((link3) => ({
45371
45462
  id: link3.id,
45372
45463
  from: link3.from,
@@ -45592,16 +45683,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
45592
45683
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
45593
45684
  }, "decidedOrigin");
45594
45685
 
45595
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
45686
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
45596
45687
  import { createHash as createHash16 } from "node:crypto";
45597
45688
 
45598
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
45689
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
45599
45690
  import { createHash as createHash15 } from "node:crypto";
45600
45691
 
45601
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
45692
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
45602
45693
  import { createHash as createHash14 } from "node:crypto";
45603
45694
 
45604
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
45695
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
45605
45696
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
45606
45697
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
45607
45698
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -45652,7 +45743,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
45652
45743
  return input;
45653
45744
  }, "consolidationApplyInput");
45654
45745
 
45655
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
45746
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
45656
45747
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
45657
45748
  id: String(row2.id),
45658
45749
  sourceId: String(row2.source_id),
@@ -45727,7 +45818,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
45727
45818
  }, { beforeCommit: check3 });
45728
45819
  }, "applyTagConsolidation");
45729
45820
 
45730
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
45821
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
45731
45822
  var selections = [
45732
45823
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
45733
45824
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -45871,7 +45962,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
45871
45962
  };
45872
45963
  }, "previewRows");
45873
45964
 
45874
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
45965
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
45875
45966
  var kinds = ["project", "tag", "topic"];
45876
45967
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
45877
45968
  if (signal?.aborted)
@@ -46135,7 +46226,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
46135
46226
  };
46136
46227
  }, "vocabularyStoreOver");
46137
46228
 
46138
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
46229
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
46139
46230
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
46140
46231
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
46141
46232
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -46676,7 +46767,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
46676
46767
  return key2.padEnd(3, "X");
46677
46768
  }, "projectKey");
46678
46769
 
46679
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
46770
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
46680
46771
  var DAY5 = 864e5;
46681
46772
  var SETTING4 = "logs_pruned_at";
46682
46773
  var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
@@ -46703,7 +46794,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
46703
46794
  };
46704
46795
  }, "logPruner");
46705
46796
 
46706
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/mail/findings.js
46797
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/mail/findings.js
46707
46798
  var MAIL_FINDINGS_PER_RUN = 30;
46708
46799
  var MAIL_FINDINGS_PER_SENDER = 5;
46709
46800
  var invalid7 = /* @__PURE__ */ __name((message2) => {
@@ -47079,7 +47170,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
47079
47170
  }, "checkMailFindings");
47080
47171
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
47081
47172
 
47082
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/mail/score.js
47173
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/mail/score.js
47083
47174
  var import_disposable_email_domains_js = __toESM(require_dist(), 1);
47084
47175
  var import_tldts = __toESM(require_cjs(), 1);
47085
47176
  var WEIGHTS = {
@@ -47212,7 +47303,7 @@ var scoreGroup = /* @__PURE__ */ __name((items, context) => {
47212
47303
  return { score: kept.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept };
47213
47304
  }, "scoreGroup");
47214
47305
 
47215
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
47306
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
47216
47307
  var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
47217
47308
  var orderOperationsOver = /* @__PURE__ */ __name((context) => {
47218
47309
  const { database, now: now2 } = context;
@@ -47364,7 +47455,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
47364
47455
  };
47365
47456
  }, "ordersStoreOver");
47366
47457
 
47367
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
47458
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
47368
47459
  var stale2 = /* @__PURE__ */ __name(() => {
47369
47460
  throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
47370
47461
  reason: "mail-findings.stale"
@@ -47821,7 +47912,7 @@ ${evidence.join("\n")}`, agent);
47821
47912
  };
47822
47913
  }, "mailFindingsStoreOver");
47823
47914
 
47824
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
47915
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
47825
47916
  var stale3 = /* @__PURE__ */ __name(() => {
47826
47917
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
47827
47918
  reason: "meeting-findings.stale"
@@ -47989,7 +48080,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
47989
48080
  };
47990
48081
  }, "meetingFindingsStoreOver");
47991
48082
 
47992
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
48083
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
47993
48084
  var RANK_BATCH = 512;
47994
48085
  var LIVE3 = "FROM chunks k JOIN meeting_transcripts t ON k.chunkable_type = 'meeting_transcript' AND t.id = k.chunkable_id JOIN meetings m ON m.id = t.meeting_id WHERE m.account_id = ? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL";
47995
48086
  var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -48260,7 +48351,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
48260
48351
  }
48261
48352
  }), "meetingVectorsOver");
48262
48353
 
48263
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
48354
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
48264
48355
  var OTHER_SOURCES = ["document", "note", "email"];
48265
48356
  var TEXTS = {
48266
48357
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -48361,11 +48452,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
48361
48452
  };
48362
48453
  }, "sourceMentionStoreOver");
48363
48454
 
48364
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
48365
- import { mkdirSync, statSync, writeFileSync } from "node:fs";
48366
- import { dirname } from "node:path";
48455
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
48456
+ import { accessSync, constants, existsSync, mkdirSync as mkdirSync2, statSync, writeFileSync as writeFileSync2 } from "node:fs";
48457
+ import { dirname as dirname2 } from "node:path";
48367
48458
 
48368
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
48459
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
48369
48460
  import { readFileSync as readFileSync3 } from "node:fs";
48370
48461
  var CLIENTS_SETTING = "clients";
48371
48462
  var coreVersion = (() => {
@@ -48423,7 +48514,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
48423
48514
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
48424
48515
  }, "refusalAdvice");
48425
48516
 
48426
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
48517
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
48427
48518
  var GENERATED = [
48428
48519
  {
48429
48520
  "name": "20261010184427_initial",
@@ -49472,10 +49563,286 @@ WHERE json_type(params, '$.selection') = 'object';`
49472
49563
  "-- The default lead pipeline, so a lead can be recorded before the owner or an agent makes one.\nINSERT INTO pipelines (kind, name, name_folded, created_at, updated_at)\n VALUES ('lead', 'Leads', 'leads', CAST(strftime('%s', 'now') AS INTEGER) * 1000, CAST(strftime('%s', 'now') AS INTEGER) * 1000);",
49473
49564
  "INSERT INTO pipeline_stages (pipeline_id, name, name_folded, position, outcome, created_at, updated_at)\n SELECT p.id, v.name, v.name, v.position, v.outcome, p.created_at, p.created_at FROM pipelines p,\n (SELECT 'new' AS name, 1 AS position, 'open' AS outcome UNION ALL SELECT 'contacted', 2, 'open'\n UNION ALL SELECT 'qualified', 3, 'open' UNION ALL SELECT 'won', 4, 'won' UNION ALL SELECT 'lost', 5, 'lost') v\n WHERE p.kind = 'lead' AND p.name_folded = 'leads' AND p.account_id IS NULL;"
49474
49565
  ]
49566
+ },
49567
+ {
49568
+ "name": "20261106165009_version-53-crm-pipelines",
49569
+ "statements": [
49570
+ "ALTER TABLE `pipeline_stages` ADD `deleted_at` integer;",
49571
+ "ALTER TABLE `pipelines` ADD `deleted_at` integer;",
49572
+ "DROP INDEX IF EXISTS `pipelines_by_account_id_external_id`;",
49573
+ "CREATE UNIQUE INDEX `pipelines_by_account_id_kind_external_id` ON `pipelines` (`account_id`,`kind`,`external_id`) WHERE account_id IS NOT NULL AND external_id IS NOT NULL;"
49574
+ ]
49575
+ },
49576
+ {
49577
+ "name": "20261106225547_version-54-crm-fields",
49578
+ "statements": [
49579
+ "CREATE TABLE `crm_fields` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `kind` text NOT NULL,\n `code` text NOT NULL,\n `label` text,\n `type` text NOT NULL,\n `multiple` integer NOT NULL,\n `filterable` integer NOT NULL,\n `options` text,\n `position` integer NOT NULL,\n `created_at` integer NOT NULL,\n `updated_at` integer NOT NULL,\n `deleted_at` integer,\n CONSTRAINT `fk_crm_fields_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `crm_fields_account_id_kind_code_unique` UNIQUE(`account_id`,`kind`,`code`)\n);"
49580
+ ]
49475
49581
  }
49476
49582
  ];
49477
49583
 
49478
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
49584
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
49585
+ import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
49586
+ import { basename, dirname, join as join2, parse } from "node:path";
49587
+ var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
49588
+ var isDerivedTable = /* @__PURE__ */ __name((name) => DERIVED.test(name), "isDerivedTable");
49589
+ var BOOKKEEPING = ["store_settings", "search_index_state"];
49590
+ var KEY3 = "rollback_copy:";
49591
+ var SCHEMA = "rollback_copy";
49592
+ var ROWID = "__rollback_rowid";
49593
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
49594
+ var HEADROOM = 256 * 1024 * 1024;
49595
+ var quote2 = /* @__PURE__ */ __name((name) => `"${name.replaceAll('"', '""')}"`, "quote");
49596
+ var megabytes = /* @__PURE__ */ __name((bytes3) => `${Math.ceil(bytes3 / 1024 / 1024)} MB`, "megabytes");
49597
+ var freeBytesOf = /* @__PURE__ */ __name((dir) => {
49598
+ const { bavail, bsize } = statfsSync(dir);
49599
+ return Number(bavail) * Number(bsize);
49600
+ }, "freeBytesOf");
49601
+ var tableIn = /* @__PURE__ */ __name((database, schema, name) => database.prepare(`SELECT 1 FROM ${schema}.sqlite_master WHERE type = 'table' AND name = ?`).get(name) !== void 0, "tableIn");
49602
+ var keepsRowid = /* @__PURE__ */ __name((database, schema, table) => Number(database.prepare("SELECT wr FROM pragma_table_list WHERE schema = ? AND name = ?").get(schema, table)?.wr) === 0, "keepsRowid");
49603
+ var columnsOf2 = /* @__PURE__ */ __name((database, schema, table) => database.prepare("SELECT name FROM pragma_table_info(?, ?)").all(table, schema).map((row2) => String(row2.name)), "columnsOf");
49604
+ var versionOf = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT max(version) AS version FROM main.schema_migrations").get()?.version ?? 0), "versionOf");
49605
+ var tableBytes = /* @__PURE__ */ __name((database, tables) => {
49606
+ try {
49607
+ return Number(database.prepare(`SELECT coalesce(sum(pgsize), 0) AS bytes FROM dbstat
49608
+ WHERE schema = 'main' AND aggregate = 1 AND name IN (${tables.map(() => "?").join(", ")})`).get(...tables)?.bytes ?? 0);
49609
+ } catch {
49610
+ const pragma = /* @__PURE__ */ __name((name) => Number(database.prepare(`PRAGMA ${name}`).get()?.[name] ?? 0), "pragma");
49611
+ return pragma("page_count") * pragma("page_size");
49612
+ }
49613
+ }, "tableBytes");
49614
+ var stampOf = /* @__PURE__ */ __name((at) => new Date(at).toISOString().replace(/[:.]/g, "-"), "stampOf");
49615
+ var attach = /* @__PURE__ */ __name((database, path) => database.prepare(`ATTACH DATABASE ? AS ${SCHEMA}`).run(path), "attach");
49616
+ var takeRollbackCopy = /* @__PURE__ */ __name((database, { from: from2, to, tables, at }, { store, freeBytes = freeBytesOf, warn = /* @__PURE__ */ __name((line) => process.stderr.write(`${line}
49617
+ `), "warn") }) => {
49618
+ const dir = join2(dirname(store), "backups");
49619
+ const present2 = [.../* @__PURE__ */ new Set([...BOOKKEEPING, ...tables])].filter((table) => tableIn(database, "main", table));
49620
+ const afterwards = `going back to schema ${from2} then needs an empty store, and its data pulled again from the sources`;
49621
+ let path;
49622
+ try {
49623
+ mkdirSync(dir, { recursive: true, mode: 448 });
49624
+ const needed = tableBytes(database, present2);
49625
+ const free = freeBytes(dir);
49626
+ if (free < needed + HEADROOM) {
49627
+ warn(`not enough free disk space for a rollback copy before schema ${to} (about ${megabytes(needed + HEADROOM)} needed, ${megabytes(free)} free in ${dir}) \u2014 migrating without one; ${afterwards}`);
49628
+ return void 0;
49629
+ }
49630
+ path = join2(dir, `${parse(store).name}-rollback-schema-${from2}-${stampOf(at)}.db`);
49631
+ writeFileSync(path, "", { flag: "wx", mode: 384 });
49632
+ attach(database, path);
49633
+ try {
49634
+ database.exec("BEGIN IMMEDIATE");
49635
+ try {
49636
+ const copied = versionOf(database);
49637
+ database.exec(`CREATE TABLE ${SCHEMA}.rollback_meta (key TEXT PRIMARY KEY, value TEXT NOT NULL)`);
49638
+ database.exec(`CREATE TABLE ${SCHEMA}.rollback_schema AS
49639
+ SELECT m.type, m.name, m.tbl_name, m.sql, coalesce(l.type, m.type) AS kind
49640
+ FROM main.sqlite_master m LEFT JOIN pragma_table_list l ON l.schema = 'main' AND l.name = m.name
49641
+ ORDER BY m.rowid`);
49642
+ for (const table of present2) {
49643
+ const rowid = keepsRowid(database, "main", table) ? `rowid AS ${ROWID}, ` : "";
49644
+ database.exec(`CREATE TABLE ${SCHEMA}.${quote2(table)} AS SELECT ${rowid}* FROM main.${quote2(table)}`);
49645
+ }
49646
+ const meta = { from: copied, to, tables: present2, created_at: at };
49647
+ const insert = database.prepare(`INSERT INTO ${SCHEMA}.rollback_meta (key, value) VALUES (?, ?)`);
49648
+ for (const [key2, value] of Object.entries(meta))
49649
+ insert.run(key2, JSON.stringify(value));
49650
+ database.exec("COMMIT");
49651
+ return { path, from: copied, to };
49652
+ } catch (error) {
49653
+ database.exec("ROLLBACK");
49654
+ throw error;
49655
+ }
49656
+ } finally {
49657
+ database.exec(`DETACH DATABASE ${SCHEMA}`);
49658
+ }
49659
+ } catch (error) {
49660
+ if (path)
49661
+ rmSync(path, { force: true });
49662
+ warn(`the rollback copy before schema ${to} could not be written (${error instanceof Error ? error.message : String(error)}) \u2014 migrating without one; ${afterwards}`);
49663
+ return void 0;
49664
+ }
49665
+ }, "takeRollbackCopy");
49666
+ var recordRollbackCopy = /* @__PURE__ */ __name((database, copy, at) => {
49667
+ database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(`${KEY3}${basename(copy.path)}`, JSON.stringify({ path: copy.path, from: copy.from, to: copy.to, at }), at);
49668
+ }, "recordRollbackCopy");
49669
+ var discardRollbackCopy = /* @__PURE__ */ __name((copy) => rmSync(copy.path, { force: true }), "discardRollbackCopy");
49670
+ var pruneRollbackCopies = /* @__PURE__ */ __name((database, now2) => {
49671
+ const recorded = database.prepare("SELECT key, value FROM store_settings WHERE key LIKE 'rollback\\_copy:%' ESCAPE '\\'").all();
49672
+ if (recorded.length === 0)
49673
+ return;
49674
+ const version = versionOf(database);
49675
+ for (const { key: key2, value } of recorded) {
49676
+ let copy;
49677
+ try {
49678
+ copy = JSON.parse(String(value));
49679
+ } catch {
49680
+ continue;
49681
+ }
49682
+ if (typeof copy.path !== "string" || now2 - Number(copy.at) < DAY_MS2 || version < Number(copy.to))
49683
+ continue;
49684
+ if (!database.prepare("SELECT 1 FROM schema_migrations WHERE version = ?").get(Number(copy.to)))
49685
+ continue;
49686
+ rmSync(copy.path, { force: true });
49687
+ database.prepare("DELETE FROM store_settings WHERE key = ?").run(String(key2));
49688
+ }
49689
+ }, "pruneRollbackCopies");
49690
+ var objectsOf = /* @__PURE__ */ __name((database, sql2) => database.prepare(sql2).all().map((row2) => ({
49691
+ type: String(row2.type),
49692
+ name: String(row2.name),
49693
+ sql: row2.sql === null ? null : String(row2.sql),
49694
+ kind: String(row2.kind)
49695
+ })), "objectsOf");
49696
+ var currentObjects = /* @__PURE__ */ __name((database) => objectsOf(database, `SELECT m.type, m.name, m.sql, coalesce(l.type, m.type) AS kind
49697
+ FROM main.sqlite_master m LEFT JOIN pragma_table_list l ON l.schema = 'main' AND l.name = m.name`), "currentObjects");
49698
+ var internal = /* @__PURE__ */ __name(({ name, kind: kind4 }) => name.startsWith("sqlite_") || kind4 === "shadow", "internal");
49699
+ var metaOf = /* @__PURE__ */ __name((database) => {
49700
+ const values = new Map(database.prepare(`SELECT key, value FROM ${SCHEMA}.rollback_meta`).all().map((row2) => [String(row2.key), JSON.parse(String(row2.value))]));
49701
+ const tables = values.get("tables");
49702
+ return {
49703
+ from: Number(values.get("from")),
49704
+ to: Number(values.get("to")),
49705
+ tables: Array.isArray(tables) ? tables.map(String) : [],
49706
+ createdAt: Number(values.get("created_at"))
49707
+ };
49708
+ }, "metaOf");
49709
+ var contentOf = /* @__PURE__ */ __name((sql2) => /\bcontent\s*=\s*'([^']+)'/i.exec(sql2 ?? "")?.[1], "contentOf");
49710
+ var RANK = { table: 0, index: 1, view: 2, trigger: 3 };
49711
+ var rewind = /* @__PURE__ */ __name((database, saved, named3) => {
49712
+ const before2 = new Map(saved.map((object) => [object.name, object]));
49713
+ const same = /* @__PURE__ */ __name((object) => before2.get(object.name)?.type === object.type && before2.get(object.name)?.sql === object.sql, "same");
49714
+ const touched = new Set(named3);
49715
+ const rebuilt = [];
49716
+ for (const object of currentObjects(database)) {
49717
+ if (object.type === "trigger")
49718
+ database.exec(`DROP TRIGGER IF EXISTS ${quote2(object.name)}`);
49719
+ if (object.type === "view")
49720
+ database.exec(`DROP VIEW IF EXISTS ${quote2(object.name)}`);
49721
+ if (object.type === "index" && object.sql !== null && !same(object))
49722
+ database.exec(`DROP INDEX IF EXISTS ${quote2(object.name)}`);
49723
+ }
49724
+ for (const object of currentObjects(database)) {
49725
+ if (object.type !== "table" || internal(object))
49726
+ continue;
49727
+ const old = before2.get(object.name);
49728
+ if (named3.has(object.name) || !old || object.kind === "virtual" && !same(object)) {
49729
+ database.exec(`DROP TABLE ${quote2(object.name)}`);
49730
+ } else if (!same(object) && old.sql) {
49731
+ rebuild(database, object.name, old.sql);
49732
+ rebuilt.push(object.name);
49733
+ touched.add(object.name);
49734
+ }
49735
+ }
49736
+ const present2 = new Set(currentObjects(database).map(({ name }) => name));
49737
+ const missing4 = saved.filter((object) => !internal(object) && object.sql !== null && !present2.has(object.name)).sort((a, b) => (RANK[a.type] ?? 9) - (RANK[b.type] ?? 9));
49738
+ for (const object of missing4) {
49739
+ database.exec(object.sql);
49740
+ if (object.type === "table" && named3.has(object.name))
49741
+ restoreRows(database, object.name);
49742
+ if (object.kind === "virtual")
49743
+ touched.add(object.name);
49744
+ }
49745
+ for (const object of saved) {
49746
+ const content = contentOf(object.sql);
49747
+ if (object.kind !== "virtual" || !(content && (touched.has(content) || touched.has(object.name))))
49748
+ continue;
49749
+ database.exec(`INSERT INTO ${quote2(object.name)} (${quote2(object.name)}) VALUES ('rebuild')`);
49750
+ }
49751
+ return rebuilt;
49752
+ }, "rewind");
49753
+ var rebuild = /* @__PURE__ */ __name((database, table, sql2) => {
49754
+ const aside = `__rollback_${table}`;
49755
+ database.exec(`ALTER TABLE ${quote2(table)} RENAME TO ${quote2(aside)}`);
49756
+ database.exec(sql2);
49757
+ const kept = new Set(columnsOf2(database, "main", aside));
49758
+ const columns = columnsOf2(database, "main", table).filter((column2) => kept.has(column2));
49759
+ const rowid = keepsRowid(database, "main", table) ? ["rowid"] : [];
49760
+ const list2 = [...rowid, ...columns.map(quote2)].join(", ");
49761
+ database.exec(`INSERT INTO ${quote2(table)} (${list2}) SELECT ${list2} FROM ${quote2(aside)}`);
49762
+ database.exec(`DROP TABLE ${quote2(aside)}`);
49763
+ }, "rebuild");
49764
+ var restoreRows = /* @__PURE__ */ __name((database, table) => {
49765
+ const copied = new Set(columnsOf2(database, SCHEMA, table));
49766
+ const columns = columnsOf2(database, "main", table).filter((column2) => copied.has(column2));
49767
+ const rowid = keepsRowid(database, "main", table) && copied.has(ROWID);
49768
+ const into = [...rowid ? ["rowid"] : [], ...columns.map(quote2)].join(", ");
49769
+ const from2 = [...rowid ? [ROWID] : [], ...columns.map(quote2)].join(", ");
49770
+ database.exec(`INSERT INTO main.${quote2(table)} (${into}) SELECT ${from2} FROM ${SCHEMA}.${quote2(table)}`);
49771
+ }, "restoreRows");
49772
+ var rollBack = /* @__PURE__ */ __name((database, path) => {
49773
+ attach(database, path);
49774
+ let result;
49775
+ try {
49776
+ if (!tableIn(database, SCHEMA, "rollback_meta"))
49777
+ throw new CliError("validation_error", `${path} is not a rollback copy`);
49778
+ const meta = metaOf(database);
49779
+ const was = versionOf(database);
49780
+ if (!database.prepare("SELECT 1 FROM main.schema_migrations WHERE version = ?").get(meta.to)) {
49781
+ throw new CliError("validation_error", `the store is at schema ${was} and was never migrated to ${meta.to}, the schema this copy was taken before \u2014 nothing to roll back`);
49782
+ }
49783
+ const saved = objectsOf(database, `SELECT type, name, sql, kind FROM ${SCHEMA}.rollback_schema ORDER BY rowid`);
49784
+ database.exec("PRAGMA foreign_keys = OFF");
49785
+ database.exec("PRAGMA legacy_alter_table = ON");
49786
+ try {
49787
+ database.exec("BEGIN IMMEDIATE");
49788
+ try {
49789
+ const named3 = new Set(meta.tables);
49790
+ const rebuilt = rewind(database, saved, named3);
49791
+ database.prepare("DELETE FROM main.schema_migrations WHERE version > ?").run(meta.from);
49792
+ database.prepare("DELETE FROM main.store_settings WHERE key = ?").run(`${KEY3}${basename(path)}`);
49793
+ database.exec("COMMIT");
49794
+ const count = /* @__PURE__ */ __name((table) => Number(database.prepare(`SELECT count(*) AS n FROM main.${quote2(table)}`).get()?.n ?? 0), "count");
49795
+ result = {
49796
+ ...meta,
49797
+ was,
49798
+ restored: meta.tables.map((table) => ({ table, rows: count(table) })),
49799
+ rebuilt
49800
+ };
49801
+ } catch (error) {
49802
+ database.exec("ROLLBACK");
49803
+ throw error;
49804
+ }
49805
+ } finally {
49806
+ database.exec("PRAGMA legacy_alter_table = OFF");
49807
+ database.exec("PRAGMA foreign_keys = ON");
49808
+ }
49809
+ } finally {
49810
+ database.exec(`DETACH DATABASE ${SCHEMA}`);
49811
+ }
49812
+ const checked = [...result.restored.map(({ table }) => table), ...result.rebuilt];
49813
+ const foreignKeyViolations = checked.reduce((total, table) => total + database.prepare(`PRAGMA foreign_key_check(${quote2(table)})`).all().length, 0);
49814
+ return { ...result, foreignKeyViolations };
49815
+ }, "rollBack");
49816
+
49817
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
49818
+ var V31_TABLES = [
49819
+ "accounts",
49820
+ "account_identities",
49821
+ "agent_actions",
49822
+ "aliases",
49823
+ "attachments",
49824
+ "bot_updates",
49825
+ "chats",
49826
+ "documents",
49827
+ "email_threads",
49828
+ "emails",
49829
+ "facts",
49830
+ "links",
49831
+ "mail_rules",
49832
+ "mailboxes",
49833
+ "meeting_series",
49834
+ "meetings",
49835
+ "memories",
49836
+ "messages",
49837
+ "notes",
49838
+ "projects",
49839
+ "proposed_actions",
49840
+ "reminders",
49841
+ "store_settings",
49842
+ "sync_cursors",
49843
+ "syncs",
49844
+ "taggings"
49845
+ ];
49479
49846
  var MANIFEST = [
49480
49847
  { name: "20261010184427_initial", version: 1, minCompatible: 1 },
49481
49848
  { name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
@@ -49512,14 +49879,24 @@ var MANIFEST = [
49512
49879
  { name: "20261021224625_version-28-chat-state", version: 28, minCompatible: 1 },
49513
49880
  { name: "20261023105057_version-29-transcript-words", version: 29, minCompatible: 1 },
49514
49881
  { name: "20261023105101_version-29-transcript-words-triggers", version: 29, minCompatible: 1 },
49515
- { name: "20261025064253_version-30-reviewed-tag-consolidation", version: 30, minCompatible: 30 },
49882
+ {
49883
+ name: "20261025064253_version-30-reviewed-tag-consolidation",
49884
+ version: 30,
49885
+ minCompatible: 30,
49886
+ tables: ["tags", "auto_tag_claims"]
49887
+ },
49516
49888
  { name: "20261025064302_version-30-resolved-tag-view", version: 30, minCompatible: 30 },
49517
- { name: "20261025070402_version-31-drive-account", version: 31, minCompatible: 31 },
49518
- { name: "20261025071848_version-32-files", version: 32, minCompatible: 32 },
49889
+ { name: "20261025070402_version-31-drive-account", version: 31, minCompatible: 31, tables: V31_TABLES },
49890
+ {
49891
+ name: "20261025071848_version-32-files",
49892
+ version: 32,
49893
+ minCompatible: 32,
49894
+ tables: ["accounts", "documents", "identities", "store_settings"]
49895
+ },
49519
49896
  { name: "20261025071850_version-32-files-data", version: 32, minCompatible: 32 },
49520
49897
  { name: "20261025072643_version-33-calendars", version: 33, minCompatible: 32 },
49521
49898
  { name: "20261025072644_version-33-calendars-triggers", version: 33, minCompatible: 32 },
49522
- { name: "20261025182500_version-34-vector-index", version: 34, minCompatible: 34 },
49899
+ { name: "20261025182500_version-34-vector-index", version: 34, minCompatible: 34, tables: [] },
49523
49900
  { name: "20261025182501_version-34-vector-index-triggers", version: 34, minCompatible: 34 },
49524
49901
  { name: "20261027102259_version-35-calendar-neutral", version: 35, minCompatible: 34 },
49525
49902
  { name: "20261027102302_version-35-calendar-neutral-data", version: 35, minCompatible: 34 },
@@ -49545,7 +49922,9 @@ var MANIFEST = [
49545
49922
  { name: "20261105125315_version-50-orders-rules", version: 50, minCompatible: 34 },
49546
49923
  { name: "20261105144549_version-51-task-links", version: 51, minCompatible: 34 },
49547
49924
  { name: "20261106010504_version-52-deals", version: 52, minCompatible: 34 },
49548
- { name: "20261106010507_version-52-deals-rules", version: 52, minCompatible: 34 }
49925
+ { name: "20261106010507_version-52-deals-rules", version: 52, minCompatible: 34 },
49926
+ { name: "20261106165009_version-53-crm-pipelines", version: 53, minCompatible: 34 },
49927
+ { name: "20261106225547_version-54-crm-fields", version: 54, minCompatible: 34 }
49549
49928
  ];
49550
49929
  var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
49551
49930
  const migrations = [];
@@ -49558,10 +49937,22 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
49558
49937
  const last = migrations.at(-1);
49559
49938
  if (last && last.version !== entry2.version && entry2.minCompatible < last.minCompatible)
49560
49939
  throw new Error("migration minCompatible cannot decrease");
49940
+ const derived = entry2.tables?.filter(isDerivedTable) ?? [];
49941
+ if (derived.length > 0)
49942
+ throw new Error(`migration ${entry2.version} names derived tables (${derived.join(", ")}); they are rebuilt, never copied`);
49561
49943
  if (last?.version !== entry2.version) {
49562
- migrations.push({ version: entry2.version, minCompatible: entry2.minCompatible, statements: [...found2.statements] });
49944
+ if (last && entry2.minCompatible > last.minCompatible && entry2.tables === void 0)
49945
+ throw new Error(`migration ${entry2.version} raises minCompatible, so it names the base tables it changes (tables)`);
49946
+ migrations.push({
49947
+ version: entry2.version,
49948
+ minCompatible: entry2.minCompatible,
49949
+ statements: [...found2.statements],
49950
+ ...entry2.tables ? { tables: [...entry2.tables] } : {}
49951
+ });
49563
49952
  } else if (last.minCompatible !== entry2.minCompatible) {
49564
49953
  throw new Error(`the rows of version ${entry2.version} disagree on minCompatible`);
49954
+ } else if (entry2.tables && JSON.stringify(entry2.tables) !== JSON.stringify(last.tables)) {
49955
+ throw new Error(`the rows of version ${entry2.version} disagree on tables`);
49565
49956
  } else {
49566
49957
  last.statements.push(...found2.statements);
49567
49958
  }
@@ -49569,7 +49960,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
49569
49960
  return migrations;
49570
49961
  }, "generatedMigrations");
49571
49962
 
49572
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/migrations.js
49963
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/migrations.js
49573
49964
  var MIGRATIONS = generatedMigrations();
49574
49965
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
49575
49966
  version INTEGER PRIMARY KEY,
@@ -49583,12 +49974,36 @@ var fileState = /* @__PURE__ */ __name((database) => {
49583
49974
  const row2 = database.prepare("SELECT version, min_compatible FROM schema_migrations ORDER BY version DESC LIMIT 1").get();
49584
49975
  return { version: Number(row2?.version ?? 0), minCompatible: Number(row2?.min_compatible ?? 0) };
49585
49976
  }, "fileState");
49586
- var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now: now2 = Date.now, command, version, ownTable = OWN_TABLE } = {}) => {
49977
+ var copyBeforeBreaking = /* @__PURE__ */ __name((database, migrations, { ownTable, now: now2 }, options) => {
49978
+ if (!hasTable(database, "schema_migrations"))
49979
+ return void 0;
49980
+ const file = fileState(database);
49981
+ if (file.version === 0 || ownTable !== null && !hasTable(database, ownTable))
49982
+ return void 0;
49983
+ let floor = file.minCompatible;
49984
+ const tables = [];
49985
+ for (const migration of migrations) {
49986
+ if (migration.version <= file.version || migration.minCompatible <= floor)
49987
+ continue;
49988
+ floor = migration.minCompatible;
49989
+ for (const table of migration.tables ?? [])
49990
+ tables.push(table);
49991
+ }
49992
+ if (floor === file.minCompatible)
49993
+ return void 0;
49994
+ return takeRollbackCopy(database, { from: file.version, to: latest2(migrations), tables, at: now2() }, options);
49995
+ }, "copyBeforeBreaking");
49996
+ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now: now2 = Date.now, command, version, ownTable = OWN_TABLE, rollback } = {}) => {
49587
49997
  const ours = latest2(migrations);
49998
+ let copy = rollback ? copyBeforeBreaking(database, migrations, { ownTable, now: now2 }, rollback) : void 0;
49588
49999
  database.exec("BEGIN IMMEDIATE");
49589
50000
  try {
49590
50001
  database.exec(HISTORY);
49591
50002
  const file = fileState(database);
50003
+ if (copy && copy.from !== file.version) {
50004
+ discardRollbackCopy(copy);
50005
+ copy = void 0;
50006
+ }
49592
50007
  if (file.version > 0 && ownTable !== null && !hasTable(database, ownTable)) {
49593
50008
  throw new CliError("configuration_error", `the message store was written by another, incompatible tool (schema ${file.version} by its own numbering, with no meetings table) \u2014 this tool will not open or change it; move it aside to start a new store`);
49594
50009
  }
@@ -49611,6 +50026,8 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
49611
50026
  }
49612
50027
  if (command && version)
49613
50028
  recordClient(database, { command, version, speaks: ours }, now2());
50029
+ if (copy)
50030
+ recordRollbackCopy(database, copy, now2());
49614
50031
  database.exec("COMMIT");
49615
50032
  return notice;
49616
50033
  } catch (error) {
@@ -49622,7 +50039,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
49622
50039
  }
49623
50040
  }, "migrate");
49624
50041
 
49625
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
50042
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
49626
50043
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
49627
50044
  const pending = database.prepare("SELECT id, join_url FROM meetings WHERE join_url IS NOT NULL AND join_key IS NULL AND id > ? ORDER BY id LIMIT ?");
49628
50045
  if (pending.get(0, 1) === void 0)
@@ -49644,7 +50061,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
49644
50061
  }
49645
50062
  }, "fillJoinKeys");
49646
50063
 
49647
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
50064
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
49648
50065
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
49649
50066
  refuseOwnerStoreInTests(path);
49650
50067
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -49658,8 +50075,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
49658
50075
  }, "openSqlite");
49659
50076
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
49660
50077
  quietSqliteWarning();
49661
- const { drizzle } = await import("./node-S5LQLVMO.js");
49662
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-PFCIEDPX.js");
50078
+ const { drizzle } = await import("./node-SPFML2D5.js");
50079
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-T3KILRCP.js");
49663
50080
  const client = await nodeClient(path, { readOnly });
49664
50081
  try {
49665
50082
  return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
@@ -49669,8 +50086,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
49669
50086
  }
49670
50087
  }, "openUnderNode");
49671
50088
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
49672
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-D6T3ESTG.js");
49673
- const { drizzle } = await import("./bun-3CGVV3V2.js");
50089
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-5FCGI6EO.js");
50090
+ const { drizzle } = await import("./bun-3AIG5ML4.js");
49674
50091
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
49675
50092
  try {
49676
50093
  return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
@@ -49680,7 +50097,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
49680
50097
  }
49681
50098
  }, "openUnderBun");
49682
50099
 
49683
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
50100
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
49684
50101
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
49685
50102
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
49686
50103
  try {
@@ -49748,8 +50165,8 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
49748
50165
  });
49749
50166
  }, "movePaymentFacts");
49750
50167
 
49751
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
49752
- var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
50168
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
50169
+ var readCompatibility = /* @__PURE__ */ __name((database, command) => {
49753
50170
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
49754
50171
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
49755
50172
  throw new CliError("configuration_error", "The store has no schema history; initialize it explicitly before a read-only open");
@@ -49757,13 +50174,16 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
49757
50174
  const version = Number(row2?.version), minCompatible = Number(row2?.min_compatible);
49758
50175
  if (!Number.isSafeInteger(version) || !Number.isSafeInteger(minCompatible) || version < 1 || minCompatible < 1 || minCompatible > version)
49759
50176
  throw new CliError("configuration_error", "The store schema history is invalid; read-only opening cannot repair it");
49760
- if (version < ours)
49761
- throw new CliError("configuration_error", `The store needs schema ${ours} maintenance before a read-only open (found ${version})`);
49762
50177
  if (minCompatible > ours)
49763
50178
  throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
50179
+ return version < ours ? "older" : "current";
50180
+ }, "readCompatibility");
50181
+ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
50182
+ if (readCompatibility(database, command) === "older")
50183
+ throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
49764
50184
  }, "assertReadCompatible");
49765
50185
 
49766
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
50186
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
49767
50187
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
49768
50188
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
49769
50189
  if (provenance2?.startsWith("rule:"))
@@ -49809,7 +50229,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
49809
50229
  });
49810
50230
  }, "moveSuggestedLinks");
49811
50231
 
49812
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
50232
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
49813
50233
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
49814
50234
  var TEST_PROVIDER = "chat";
49815
50235
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -49830,21 +50250,48 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
49830
50250
  }
49831
50251
  }, "purgeTestAccounts");
49832
50252
 
49833
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
50253
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
49834
50254
  var BACKFILL_ON_OPEN = 5e3;
49835
50255
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
49836
50256
  var createWritable = /* @__PURE__ */ __name((file) => {
49837
50257
  try {
49838
- mkdirSync(dirname(file), { recursive: true, mode: 448 });
49839
- writeFileSync(file, "", { flag: "a", mode: 384 });
50258
+ mkdirSync2(dirname2(file), { recursive: true, mode: 448 });
50259
+ if (existsSync(file))
50260
+ accessSync(file, constants.W_OK);
50261
+ else
50262
+ writeFileSync2(file, "", { flag: "wx", mode: 384 });
49840
50263
  } catch (error) {
50264
+ if (error.code === "EEXIST")
50265
+ return;
49841
50266
  if (!NOT_WRITABLE.has(error.code ?? ""))
49842
50267
  throw error;
49843
50268
  throw new CliError("permission_error", "the message store cannot be written from here; run where it is writable, or set MESSAGING_STORE", { reason: "store.not-writable" });
49844
50269
  }
49845
50270
  }, "createWritable");
49846
- var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Date.now, command, version, warn = /* @__PURE__ */ __name((line) => process.stderr.write(`${line}
49847
- `), "warn"), readOnly = false, decisions: decisions2 = DEFAULT_DECISION_POLICY } = {}) => {
50271
+ var openReadable = /* @__PURE__ */ __name(async (file, options) => {
50272
+ const first = await openSqlite(file, { readOnly: true });
50273
+ try {
50274
+ if (readCompatibility(first.database, options.command) === "current")
50275
+ return first;
50276
+ } catch (error) {
50277
+ first.database.close();
50278
+ throw error;
50279
+ }
50280
+ first.database.close();
50281
+ const writable = await openStoreContext({ ...options, path: file, readOnly: false });
50282
+ writable.database.close();
50283
+ const migrated = await openSqlite(file, { readOnly: true });
50284
+ try {
50285
+ assertReadCompatible(migrated.database, options.command);
50286
+ return migrated;
50287
+ } catch (error) {
50288
+ migrated.database.close();
50289
+ throw error;
50290
+ }
50291
+ }, "openReadable");
50292
+ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
50293
+ const { path, env, now: now2 = Date.now, command, version, warn = /* @__PURE__ */ __name((line) => process.stderr.write(`${line}
50294
+ `), "warn"), readOnly = false, decisions: decisions2 = DEFAULT_DECISION_POLICY } = options;
49848
50295
  if (typeof readOnly !== "boolean")
49849
50296
  throw new CliError("validation_error", "readOnly must be a boolean");
49850
50297
  await storeCapable();
@@ -49855,15 +50302,19 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
49855
50302
  throw new CliError("not_found", "The store does not exist as a file; read-only opening does not create it");
49856
50303
  } else
49857
50304
  createWritable(file);
49858
- const opened = await openSqlite(file, { readOnly });
50305
+ const opened = readOnly ? await openReadable(file, options) : await openSqlite(file, { readOnly });
49859
50306
  const database = opened.database;
49860
50307
  try {
49861
- if (readOnly)
49862
- assertReadCompatible(database, command);
49863
- else {
49864
- const notice = migrate(database, { now: now2, command, ...version ? { version } : {} });
50308
+ if (!readOnly) {
50309
+ const notice = migrate(database, {
50310
+ now: now2,
50311
+ command,
50312
+ ...version ? { version } : {},
50313
+ rollback: { store: file, warn }
50314
+ });
49865
50315
  if (notice)
49866
50316
  warn(notice);
50317
+ pruneRollbackCopies(database, now2());
49867
50318
  fillFiles(database, now2);
49868
50319
  fillFolded(database);
49869
50320
  fillJoinKeys(database);
@@ -49895,10 +50346,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
49895
50346
  }
49896
50347
  }, "openStoreContext");
49897
50348
 
49898
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
50349
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
49899
50350
  import { createHash as createHash17 } from "node:crypto";
49900
50351
 
49901
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
50352
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
49902
50353
  var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
49903
50354
  var ref = text4(2048);
49904
50355
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -49964,7 +50415,7 @@ var projectAnnotationsSchema = strictObject({
49964
50415
  }))
49965
50416
  });
49966
50417
 
49967
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
50418
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
49968
50419
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
49969
50420
  var invalid10 = /* @__PURE__ */ __name((field4) => {
49970
50421
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -50068,7 +50519,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
50068
50519
  invalid10("external.unused");
50069
50520
  }, "validateProjectAnnotationsGraph");
50070
50521
 
50071
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
50522
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
50072
50523
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
50073
50524
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
50074
50525
  var targetSchema = strictObject({
@@ -50174,7 +50625,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
50174
50625
  };
50175
50626
  }, "planBoundProjectAnnotations");
50176
50627
 
50177
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
50628
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
50178
50629
  import { createHash as createHash18 } from "node:crypto";
50179
50630
  var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
50180
50631
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -50268,7 +50719,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
50268
50719
  })).digest("hex");
50269
50720
  }, "projectAnnotationSnapshotFingerprint");
50270
50721
 
50271
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
50722
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
50272
50723
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
50273
50724
  if (!request || typeof request !== "object" || Array.isArray(request))
50274
50725
  throw new CliError("validation_error", "project annotation request is required");
@@ -50285,7 +50736,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
50285
50736
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
50286
50737
  }, "projectAnnotationRequest");
50287
50738
 
50288
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
50739
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
50289
50740
  var SnapshotBudget = class {
50290
50741
  static {
50291
50742
  __name(this, "SnapshotBudget");
@@ -50311,13 +50762,13 @@ var SnapshotBudget = class {
50311
50762
  }
50312
50763
  };
50313
50764
 
50314
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
50765
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
50315
50766
  import { createHash as createHash20 } from "node:crypto";
50316
50767
 
50317
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
50768
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
50318
50769
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
50319
50770
 
50320
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
50771
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
50321
50772
  import { createHash as createHash19 } from "node:crypto";
50322
50773
  var invalid12 = /* @__PURE__ */ __name(() => {
50323
50774
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -50460,7 +50911,7 @@ var ProjectSnapshotSources = class {
50460
50911
  }
50461
50912
  };
50462
50913
 
50463
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
50914
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
50464
50915
  var unsupported = /* @__PURE__ */ __name(() => {
50465
50916
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
50466
50917
  }, "unsupported");
@@ -50631,7 +51082,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
50631
51082
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
50632
51083
  }), "projectAnnotationSnapshot");
50633
51084
 
50634
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
51085
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
50635
51086
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
50636
51087
  const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
50637
51088
  const sources = new ProjectSnapshotSources(database, budget);
@@ -50693,7 +51144,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
50693
51144
  };
50694
51145
  }), "previewAnnotationSnapshot");
50695
51146
 
50696
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
51147
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
50697
51148
  var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
50698
51149
  const mappings = { ...bindings };
50699
51150
  const resolve = /* @__PURE__ */ __name((ref3) => {
@@ -50735,7 +51186,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
50735
51186
  return mappings;
50736
51187
  }, "restoreAnnotationRecords");
50737
51188
 
50738
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
51189
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
50739
51190
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
50740
51191
  async preview(request) {
50741
51192
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -50765,7 +51216,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
50765
51216
  }
50766
51217
  }), "projectAnnotationStoreOver");
50767
51218
 
50768
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
51219
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
50769
51220
  var PROJECTED = {
50770
51221
  invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
50771
51222
  payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
@@ -51178,7 +51629,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
51178
51629
  };
51179
51630
  }, "recordStoreOver");
51180
51631
 
51181
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
51632
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
51182
51633
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
51183
51634
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
51184
51635
  let merged = { from: from2, to };
@@ -51191,7 +51642,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
51191
51642
  }, "markRange");
51192
51643
  var ranges = /* @__PURE__ */ __name(({ orm }, chatKey) => orm.select({ from: syncRanges.fromKey, to: syncRanges.toKey }).from(syncRanges).where(eq(syncRanges.chatId, chatKey)).orderBy(syncRanges.fromKey).all(), "ranges");
51193
51644
 
51194
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
51645
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
51195
51646
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
51196
51647
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
51197
51648
  chatId: String(row2.key).slice(prefix.length),
@@ -51212,7 +51663,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
51212
51663
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(prefixOf2(account) + chatId, JSON.stringify({ ...saved, checkedAt: checkedAt ?? new Date(now2).toISOString() }), now2);
51213
51664
  }, "setTaskAnalysisMark");
51214
51665
 
51215
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
51666
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
51216
51667
  var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
51217
51668
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
51218
51669
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
@@ -51222,7 +51673,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
51222
51673
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf4(account), JSON.stringify(until), now2);
51223
51674
  }, "setTaskRulesStop");
51224
51675
 
51225
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sync.js
51676
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sync.js
51226
51677
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
51227
51678
  const { database } = context;
51228
51679
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -51281,7 +51732,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
51281
51732
  };
51282
51733
  }, "syncStoreOver");
51283
51734
 
51284
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/tags.js
51735
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/tags.js
51285
51736
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
51286
51737
  const { database } = context;
51287
51738
  return {
@@ -51303,7 +51754,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
51303
51754
  };
51304
51755
  }, "tagsStoreOver");
51305
51756
 
51306
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
51757
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
51307
51758
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
51308
51759
  var neighbours = /* @__PURE__ */ __name(({ orm }, chatKey, messagePk, sentAt, { messages: messages2, withinMs }, side) => orm.all(sql`SELECT sender_name AS sender, text, sent_at AS sentAt FROM messages
51309
51760
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -51430,7 +51881,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
51430
51881
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
51431
51882
  }, "savePictureChunks");
51432
51883
 
51433
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
51884
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
51434
51885
  var messagesToEmbed = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, after: after2, limit }) => orm.all(sql`SELECT m.id AS messagePk, m.text, m.sent_at AS sentAt, k.content_hash AS hash,
51435
51886
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
51436
51887
  FROM messages m
@@ -51519,7 +51970,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
51519
51970
  return plain2(best(found2));
51520
51971
  }, "nearestMessages");
51521
51972
 
51522
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/vectors.js
51973
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/vectors.js
51523
51974
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
51524
51975
  const { database } = context;
51525
51976
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -51777,15 +52228,15 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
51777
52228
  embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
51778
52229
  }), "vectorsStoreOver");
51779
52230
 
51780
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
51781
- import { existsSync, readFileSync as readFileSync4 } from "node:fs";
51782
- import { dirname as dirname2, join as join2 } from "node:path";
51783
- var BOOKKEEPING = ["schema_migrations", "store_settings"];
52231
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
52232
+ import { existsSync as existsSync2, readFileSync as readFileSync4 } from "node:fs";
52233
+ import { dirname as dirname3, join as join3 } from "node:path";
52234
+ var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
51784
52235
  var LISTED = `
51785
52236
  SELECT name, CASE
51786
52237
  WHEN type = 'virtual' THEN 'search_index'
51787
52238
  WHEN type = 'shadow' THEN 'search_index_part'
51788
- WHEN name LIKE 'sqlite\\_%' ESCAPE '\\' OR name IN (${BOOKKEEPING.map((name) => `'${name}'`).join(", ")})
52239
+ WHEN name LIKE 'sqlite\\_%' ESCAPE '\\' OR name IN (${BOOKKEEPING2.map((name) => `'${name}'`).join(", ")})
51789
52240
  THEN 'internal'
51790
52241
  ELSE 'data'
51791
52242
  END AS kind
@@ -51847,8 +52298,8 @@ var fileFacts = /* @__PURE__ */ __name((database, path) => {
51847
52298
  };
51848
52299
  }, "fileFacts");
51849
52300
  var lastBackup = /* @__PURE__ */ __name((path) => {
51850
- const marker = join2(dirname2(path), "backups", "last.json");
51851
- if (!existsSync(marker))
52301
+ const marker = join3(dirname3(path), "backups", "last.json");
52302
+ if (!existsSync2(marker))
51852
52303
  return null;
51853
52304
  try {
51854
52305
  const { at, file, checked } = JSON.parse(readFileSync4(marker, "utf8"));
@@ -51865,10 +52316,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
51865
52316
  }
51866
52317
  }, "lastBackup");
51867
52318
 
51868
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/providers.js
52319
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/providers.js
51869
52320
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
51870
52321
 
51871
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
52322
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
51872
52323
  var COUNTED_TABLES = [
51873
52324
  "accounts",
51874
52325
  "chats",
@@ -51953,7 +52404,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
51953
52404
  };
51954
52405
  }, "storeContents");
51955
52406
 
51956
- // node_modules/.pnpm/@wirecat+cli-core@0.593.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_a38dc1e51ab7f561f21ddbf6a1611494/node_modules/@wirecat/cli-core/dist/store/store.js
52407
+ // node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/store.js
51957
52408
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
51958
52409
  const context = await openStoreContext(options);
51959
52410
  try {
@@ -52222,6 +52673,7 @@ export {
52222
52673
  stemsState,
52223
52674
  stemmerCache,
52224
52675
  isBusy,
52676
+ fillVectorIndexes,
52225
52677
  vectorIndexCounts,
52226
52678
  dropAllUnusedVectors,
52227
52679
  CHUNK_CHARS,
@@ -52231,7 +52683,10 @@ export {
52231
52683
  amountsOf,
52232
52684
  dueDayOf,
52233
52685
  queryFilter,
52686
+ CORPORA,
52687
+ fillTrigrams,
52234
52688
  noteIndexState,
52689
+ drainCorpus,
52235
52690
  drainNoteIndex,
52236
52691
  resetNoteIndex,
52237
52692
  CHAT_COLUMNS,
@@ -52248,6 +52703,7 @@ export {
52248
52703
  mailOwnText,
52249
52704
  AGENDA_COLUMNS,
52250
52705
  correctWords,
52706
+ drainMeetingIndex,
52251
52707
  THREAD_COLUMNS,
52252
52708
  threadConversation,
52253
52709
  messageOfEmail,
@@ -52289,6 +52745,7 @@ export {
52289
52745
  CONVERSATION_COLUMNS,
52290
52746
  MENTION_STATUSES,
52291
52747
  MENTION_QUERY,
52748
+ rebuildMentions,
52292
52749
  MESSAGE_MEASURES,
52293
52750
  AUTHOR_MEASURES,
52294
52751
  rankingOptions,
@@ -52326,6 +52783,7 @@ export {
52326
52783
  scoreGroup,
52327
52784
  OTHER_SOURCES,
52328
52785
  storeClients,
52786
+ rollBack,
52329
52787
  MIGRATIONS,
52330
52788
  migrate,
52331
52789
  openSqlite,