@wirecat/mail-cli 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-7WILOT5E.js → all-profiles-52LCOKSL.js} +5 -5
  4. package/dist/bundle/{anthropic-NHWLIMEZ.js → anthropic-HPW7PLTT.js} +3 -3
  5. package/dist/bundle/{app-server-XDMYCJLV.js → app-server-Y7XSPVHJ.js} +39 -39
  6. package/dist/bundle/{bun-GTG5IYLQ.js → bun-B7YXDIMT.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-KGH5F33G.js → bun-sqlite-TTTKY7H2.js} +2 -2
  8. package/dist/bundle/{chunk-MABCR67K.js → chunk-37MSU5O6.js} +1 -1
  9. package/dist/bundle/{chunk-CT7NG7BI.js → chunk-3RDTVH3H.js} +3 -3
  10. package/dist/bundle/{chunk-TMVIQJCG.js → chunk-4PXWXI2U.js} +2 -2
  11. package/dist/bundle/{chunk-4I3YT5KK.js → chunk-4UOEUEZZ.js} +4 -4
  12. package/dist/bundle/{chunk-7LKJDJNS.js → chunk-5LY3OS7U.js} +1 -1
  13. package/dist/bundle/{chunk-H5BW7454.js → chunk-5SSFYIFF.js} +4 -4
  14. package/dist/bundle/{chunk-MDVXIPA3.js → chunk-732GKOLO.js} +10 -10
  15. package/dist/bundle/{chunk-ZNYJG4AY.js → chunk-C2THROZU.js} +42 -42
  16. package/dist/bundle/{chunk-DDMJ3RVO.js → chunk-C6E3VFUX.js} +2 -2
  17. package/dist/bundle/{chunk-QJHCKFFC.js → chunk-DKKCQMDM.js} +16 -16
  18. package/dist/bundle/{chunk-7REG25RM.js → chunk-FGNTGLWA.js} +3 -3
  19. package/dist/bundle/{chunk-GQKYSGIA.js → chunk-FUXSKWWJ.js} +46 -46
  20. package/dist/bundle/{chunk-EKE3R36Y.js → chunk-FX77WAQL.js} +6 -6
  21. package/dist/bundle/{chunk-H7NUGJPV.js → chunk-GX2M3AOO.js} +2 -2
  22. package/dist/bundle/{chunk-QUSZWBZF.js → chunk-H2JVXO5V.js} +32 -22
  23. package/dist/bundle/{chunk-77VHMI3A.js → chunk-HS25KDT3.js} +1 -1
  24. package/dist/bundle/{chunk-H66ZMBDD.js → chunk-I2ARI6FI.js} +1 -1
  25. package/dist/bundle/{chunk-D7UZXUSB.js → chunk-IXHLMSHV.js} +2 -2
  26. package/dist/bundle/{chunk-BUOSCMCD.js → chunk-JDOOPGKW.js} +2 -2
  27. package/dist/bundle/{chunk-VWO3XXSF.js → chunk-JHNLU42I.js} +1 -1
  28. package/dist/bundle/{chunk-6HIW7IJL.js → chunk-JXYFIUVX.js} +4 -4
  29. package/dist/bundle/{chunk-HJRUFT5Y.js → chunk-K6SIGXRS.js} +5 -5
  30. package/dist/bundle/{chunk-WJ3LUWRN.js → chunk-KALDYMKJ.js} +3 -3
  31. package/dist/bundle/{chunk-BKZEYTLU.js → chunk-KXVZ373I.js} +358 -303
  32. package/dist/bundle/{chunk-VRQRBVKT.js → chunk-LCA5KC34.js} +43 -43
  33. package/dist/bundle/{chunk-76IKLP2M.js → chunk-LJDOPCPW.js} +96 -91
  34. package/dist/bundle/{chunk-GPAAQ6LY.js → chunk-MHNEMDH3.js} +13 -13
  35. package/dist/bundle/{chunk-5FLW25US.js → chunk-MXUUQXMA.js} +5 -5
  36. package/dist/bundle/{chunk-ETPT7TPW.js → chunk-N5WIUNOT.js} +1 -1
  37. package/dist/bundle/{chunk-UZR3IKS7.js → chunk-O2F54PUO.js} +1 -1
  38. package/dist/bundle/{chunk-H7XOHNRY.js → chunk-O3DRPTWF.js} +1 -1
  39. package/dist/bundle/{chunk-5JOKRFWE.js → chunk-PL6UPJIL.js} +1 -1
  40. package/dist/bundle/{chunk-SVNTRF5O.js → chunk-PYIJCWCH.js} +11 -11
  41. package/dist/bundle/{chunk-THVLMTH7.js → chunk-QTWIZKUI.js} +26 -26
  42. package/dist/bundle/{chunk-QUGFBY7O.js → chunk-RMYYKBFW.js} +7 -7
  43. package/dist/bundle/{chunk-2X4WYZPA.js → chunk-RORC2FW7.js} +2 -2
  44. package/dist/bundle/{chunk-S2GSU4MT.js → chunk-RVIMMCHF.js} +9 -9
  45. package/dist/bundle/{chunk-STC45HZX.js → chunk-RZCFEASJ.js} +196 -196
  46. package/dist/bundle/{chunk-QLYHLW54.js → chunk-SRMJ6LLC.js} +5 -5
  47. package/dist/bundle/{chunk-AJIT2T3F.js → chunk-TL7PE6JU.js} +6 -6
  48. package/dist/bundle/{chunk-BPF7IXJT.js → chunk-TLZWUADZ.js} +5 -5
  49. package/dist/bundle/{chunk-Y5WA7AOA.js → chunk-TNQOKGJS.js} +21 -21
  50. package/dist/bundle/{chunk-Z6F7EXT2.js → chunk-V7NZTJKU.js} +7 -7
  51. package/dist/bundle/{chunk-Y6KUKIQZ.js → chunk-VTJDEWMB.js} +2 -2
  52. package/dist/bundle/{chunk-YQAUH3PN.js → chunk-X7TFD5SX.js} +1 -1
  53. package/dist/bundle/{chunk-R5JD4GMA.js → chunk-XD3TL4BK.js} +1 -1
  54. package/dist/bundle/{chunk-7QEE5I7H.js → chunk-XQVGIW4R.js} +2 -2
  55. package/dist/bundle/{chunk-AROBJF5P.js → chunk-Y2HGQK7A.js} +1 -1
  56. package/dist/bundle/{chunk-ZKH5CHGI.js → chunk-YVIX7FHL.js} +5 -5
  57. package/dist/bundle/{chunk-VBLFQJY3.js → chunk-ZIJJNH47.js} +1 -1
  58. package/dist/bundle/{command-contract-Y42ULKE5.js → command-contract-3HA7CZEQ.js} +13 -13
  59. package/dist/bundle/{decode-L4X542L3.js → decode-VLI3MAXE.js} +2 -2
  60. package/dist/bundle/{dist-WKIRHOLK.js → dist-C7LAAMNF.js} +14 -14
  61. package/dist/bundle/{echarts-G6QLXR4X.js → echarts-POTU3SHN.js} +2 -2
  62. package/dist/bundle/{embed-E33ZBHQR.js → embed-J2DEEEUF.js} +3 -3
  63. package/dist/bundle/{embedder-EMBCIVGF.js → embedder-5N56V7YJ.js} +6 -6
  64. package/dist/bundle/{first-run-WF2HF5FI.js → first-run-XILZE4PI.js} +5 -5
  65. package/dist/bundle/{first-screen-DZFOUUZC.js → first-screen-43VLEDWZ.js} +14 -14
  66. package/dist/bundle/{instructions-DUH7265J.js → instructions-B7AUZXPL.js} +1 -1
  67. package/dist/bundle/mail.js +2 -2
  68. package/dist/bundle/{node-73PKCCE7.js → node-SZAO6HTA.js} +2 -2
  69. package/dist/bundle/{node-sqlite-FDD5N6GC.js → node-sqlite-O34FFLRV.js} +2 -2
  70. package/dist/bundle/{oauth-ND3K2F7B.js → oauth-YYTLIPJT.js} +4 -4
  71. package/dist/bundle/{open-FZYY6TKE.js → open-SWJGI6H4.js} +1 -1
  72. package/dist/bundle/{openai-BXOF6XIM.js → openai-GYXWCQOV.js} +10 -10
  73. package/dist/bundle/{process-TXIK4VJP.js → process-GLVWCUMK.js} +1 -1
  74. package/dist/bundle/{program-2SUR4WOS.js → program-HW73TGIF.js} +306 -289
  75. package/dist/bundle/{prompt-I5GCP73M.js → prompt-OZLHHGCD.js} +2 -2
  76. package/dist/bundle/{recognize-ILYEKXVB.js → recognize-RDQSGHC5.js} +1 -1
  77. package/dist/bundle/{remote-SSPZEAJ7.js → remote-BKU5P3GK.js} +4 -4
  78. package/dist/bundle/{rerank-NAO5RMGB.js → rerank-EQIXYHKB.js} +4 -4
  79. package/dist/bundle/{serve-UDXIEQKC.js → serve-S6K5HKWG.js} +6 -6
  80. package/dist/bundle/{server-KTPELKAN.js → server-4VRVHPQC.js} +31 -31
  81. package/dist/bundle/server-WK6DRJX2.js +63 -0
  82. package/dist/bundle/{sqlite-runtime-AONFLND6.js → sqlite-runtime-OOE455YM.js} +2 -2
  83. package/dist/bundle/{state-I4PLX3UB.js → state-OLPOJ2TY.js} +3 -3
  84. package/dist/bundle/{store-ZPPRXGPY.js → store-6AVCPLH4.js} +9 -9
  85. package/dist/bundle/{store-OHQH3MGN.js → store-WFV26CWY.js} +11 -11
  86. package/dist/bundle/store-maintenance-command-S6235I3W.js +52 -0
  87. package/dist/program.d.ts.map +1 -1
  88. package/dist/program.js +8 -1
  89. package/dist/program.js.map +1 -1
  90. package/dist/version.d.ts +1 -1
  91. package/dist/version.js +1 -1
  92. package/package.json +2 -2
  93. package/dist/bundle/server-UZFSEKNJ.js +0 -63
  94. package/dist/bundle/store-maintenance-command-QOYXEBT6.js +0 -52
@@ -31,7 +31,7 @@ import {
31
31
  rankingWords,
32
32
  useStoredProviders,
33
33
  validCounter
34
- } from "./chunk-BPF7IXJT.js";
34
+ } from "./chunk-TLZWUADZ.js";
35
35
  import {
36
36
  FACT_STATUSES,
37
37
  FACT_TYPES,
@@ -54,7 +54,7 @@ import {
54
54
  matches,
55
55
  priorityBand,
56
56
  priorityLabel
57
- } from "./chunk-EKE3R36Y.js";
57
+ } from "./chunk-FX77WAQL.js";
58
58
  import {
59
59
  CHAT_MESSAGES_READ,
60
60
  MEETING_FINDINGS_KIND,
@@ -93,7 +93,7 @@ import {
93
93
  validateQuery,
94
94
  walkQuery,
95
95
  zonedMoment
96
- } from "./chunk-ZNYJG4AY.js";
96
+ } from "./chunk-C2THROZU.js";
97
97
  import {
98
98
  DEFAULT_STEMMERS,
99
99
  DEFAULT_STEMMERS_VERSION,
@@ -106,18 +106,18 @@ import {
106
106
  fold,
107
107
  normalize,
108
108
  parseStemmers
109
- } from "./chunk-Z6F7EXT2.js";
109
+ } from "./chunk-V7NZTJKU.js";
110
110
  import {
111
111
  DEFAULT_TASK_CATEGORIES,
112
112
  sharedConfigPath,
113
113
  storedTaskCategories,
114
114
  taskCategoriesReader
115
- } from "./chunk-6HIW7IJL.js";
115
+ } from "./chunk-JXYFIUVX.js";
116
116
  import {
117
117
  PRAGMAS,
118
118
  quietSqliteWarning,
119
119
  storeCapable
120
- } from "./chunk-HJRUFT5Y.js";
120
+ } from "./chunk-K6SIGXRS.js";
121
121
  import {
122
122
  SQLiteTable,
123
123
  TableAliasProxyHandler,
@@ -142,10 +142,10 @@ import {
142
142
  sql,
143
143
  sqliteTable,
144
144
  text
145
- } from "./chunk-UZR3IKS7.js";
145
+ } from "./chunk-O2F54PUO.js";
146
146
  import {
147
147
  storePath
148
- } from "./chunk-5JOKRFWE.js";
148
+ } from "./chunk-PL6UPJIL.js";
149
149
  import {
150
150
  array,
151
151
  boolean,
@@ -174,7 +174,7 @@ import {
174
174
  __name
175
175
  } from "./chunk-ZVVMGPBJ.js";
176
176
 
177
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/account-store.js
177
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/account-store.js
178
178
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
179
179
  const methods = whole;
180
180
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -302,7 +302,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
302
302
  };
303
303
  }, "bindAccount");
304
304
 
305
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/query.js
305
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/query.js
306
306
  var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
307
307
  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");
308
308
  var fail = /* @__PURE__ */ __name((message2) => {
@@ -325,7 +325,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
325
325
  return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
326
326
  }, "sourceOf");
327
327
 
328
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/account-list.js
328
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/account-list.js
329
329
  var ACCOUNT_GROUPS = "accountGroups";
330
330
  var ACCOUNT_GROUPS_SETTING = "account_groups";
331
331
  var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
@@ -512,7 +512,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
512
512
  return { accounts: [...chosen.values()], skipped };
513
513
  }, "fitting");
514
514
 
515
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
515
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
516
516
  var IndexBuilderOn = class {
517
517
  static {
518
518
  __name(this, "IndexBuilderOn");
@@ -707,7 +707,7 @@ function alias(table, alias2) {
707
707
  }
708
708
  __name(alias, "alias");
709
709
 
710
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
710
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
711
711
  var ENTITY_TABLES = {
712
712
  account: "accounts",
713
713
  attachment: "attachments",
@@ -747,7 +747,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
747
747
  return { table, pointer, type, count, known: known2 };
748
748
  }).filter(({ count }) => count > 0)), "orphanPointers");
749
749
 
750
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
750
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
751
751
  var canonicalTags = sqliteTable("canonical_tags", {
752
752
  id: integer("id").primaryKey(),
753
753
  name: text("name").notNull().unique(),
@@ -756,7 +756,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
756
756
  updatedAt: integer("updated_at").notNull()
757
757
  });
758
758
 
759
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
759
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
760
760
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
761
761
  sourceKey: text("source_key").notNull(),
762
762
  collection: text("collection").notNull(),
@@ -766,13 +766,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
766
766
  createdAt: integer("created_at").notNull()
767
767
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
768
768
 
769
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
769
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
770
770
  var documentIndexPending = sqliteTable("document_index_pending", {
771
771
  id: integer("id").notNull(),
772
772
  indexableType: text("indexable_type").notNull()
773
773
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
774
774
 
775
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
775
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
776
776
  var tagRedirects = sqliteTable("tag_redirects", {
777
777
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
778
778
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -798,7 +798,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
798
798
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
799
799
  ]);
800
800
 
801
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
801
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
802
802
  var accounts = sqliteTable("accounts", {
803
803
  id: integer("id").primaryKey(),
804
804
  provider: text("provider").notNull(),
@@ -1512,11 +1512,13 @@ var memories = sqliteTable("memories", {
1512
1512
  scope: text("scope").notNull(),
1513
1513
  createdAt: integer("created_at").notNull(),
1514
1514
  updatedAt: integer("updated_at").notNull(),
1515
- deletedAt: integer("deleted_at")
1515
+ deletedAt: integer("deleted_at"),
1516
+ projectId: integer("project_id").references(() => projects.id)
1516
1517
  }, (table) => [
1517
1518
  index("memories_by_subject_type_subject_id").on(table.subjectType, table.subjectId),
1518
1519
  index("memories_by_author_type_author_id").on(table.authorType, table.authorId),
1519
- index("memories_by_supersedes_id").on(table.supersedesId)
1520
+ index("memories_by_supersedes_id").on(table.supersedesId),
1521
+ index("memories_by_project_id").on(table.projectId)
1520
1522
  ]);
1521
1523
  var memoryIndexPending = sqliteTable("memory_index_pending", {
1522
1524
  id: integer("id").notNull(),
@@ -2297,7 +2299,7 @@ var storeSettings = sqliteTable("store_settings", {
2297
2299
  at: integer("at").notNull()
2298
2300
  });
2299
2301
 
2300
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2302
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2301
2303
  var ARMS = [
2302
2304
  [
2303
2305
  "message",
@@ -2424,7 +2426,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
2424
2426
  return recomputed;
2425
2427
  }, "drainInvolvementQueue");
2426
2428
 
2427
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2429
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2428
2430
  import { domainToUnicode } from "node:url";
2429
2431
 
2430
2432
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -12446,7 +12448,7 @@ var oa = /* @__PURE__ */ __name((e) => {
12446
12448
  }, "oa");
12447
12449
  var na = { parse: O, get: aa, isValid: oa };
12448
12450
 
12449
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12451
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12450
12452
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
12451
12453
  var ID = /^[\w-]{10,}$/;
12452
12454
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -12487,7 +12489,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
12487
12489
  return { url, documentId: googleDocumentId(url) };
12488
12490
  }), "googleDocumentLinks");
12489
12491
 
12490
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12492
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12491
12493
  var PHONE_PLANS = [
12492
12494
  {
12493
12495
  country: "us",
@@ -12867,7 +12869,7 @@ var PHONE_PLANS = [
12867
12869
  }
12868
12870
  ];
12869
12871
 
12870
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/phones.js
12872
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/phones.js
12871
12873
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
12872
12874
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
12873
12875
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -12908,7 +12910,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
12908
12910
  return void 0;
12909
12911
  }, "nationalPhone");
12910
12912
 
12911
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/places.js
12913
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/places.js
12912
12914
  var BEFORE = [
12913
12915
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
12914
12916
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -13168,7 +13170,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
13168
13170
  return found2.sort((a, b) => a.start - b.start);
13169
13171
  }, "findPlaces");
13170
13172
 
13171
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13173
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13172
13174
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
13173
13175
  var MENTION_VERSIONS = {
13174
13176
  phone: 1,
@@ -13358,7 +13360,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
13358
13360
  };
13359
13361
  }, "typedPhone");
13360
13362
 
13361
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13363
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13362
13364
  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";
13363
13365
  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";
13364
13366
  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";
@@ -13366,7 +13368,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
13366
13368
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
13367
13369
  var NAME_WORDS = WORDS.split(" ");
13368
13370
 
13369
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13371
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13370
13372
  var LATIN_TO_CYRILLIC = {
13371
13373
  shch: "\u0449",
13372
13374
  sch: "\u0449",
@@ -13574,7 +13576,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
13574
13576
  return found2;
13575
13577
  }, "findUnknownNames");
13576
13578
 
13577
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13579
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13578
13580
  var NOT_FILES = /* @__PURE__ */ new Set([
13579
13581
  "webpage",
13580
13582
  "share",
@@ -13606,7 +13608,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
13606
13608
  });
13607
13609
  }, "matchDownloads");
13608
13610
 
13609
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
13611
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
13610
13612
  var QUERY_VERSION = 1;
13611
13613
  var QUERY_LIMITS2 = {
13612
13614
  ...QUERY_LIMITS,
@@ -13637,7 +13639,7 @@ function exhausted(budget) {
13637
13639
  }
13638
13640
  __name(exhausted, "exhausted");
13639
13641
 
13640
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
13642
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
13641
13643
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
13642
13644
  var literal2 = /* @__PURE__ */ __name((c) => ({
13643
13645
  kind: "char",
@@ -14037,7 +14039,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
14037
14039
  return out;
14038
14040
  }, "foldRegex");
14039
14041
 
14040
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14042
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14041
14043
  var PRESET_VERSION = 1;
14042
14044
  var PRESETS = {
14043
14045
  password: {
@@ -14091,7 +14093,7 @@ var PRESETS = {
14091
14093
  }
14092
14094
  };
14093
14095
 
14094
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14096
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14095
14097
  var FIELD_VERSION = 2;
14096
14098
  var UNITS = {
14097
14099
  "": 1,
@@ -14540,12 +14542,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
14540
14542
  return validateFields(parsed2.output);
14541
14543
  }, "validateAst");
14542
14544
 
14543
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
14545
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
14544
14546
  var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
14545
14547
  var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
14546
14548
  var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
14547
14549
 
14548
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
14550
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
14549
14551
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
14550
14552
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
14551
14553
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -14569,7 +14571,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
14569
14571
  };
14570
14572
  }, "linkMatch");
14571
14573
 
14572
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
14574
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
14573
14575
  var SETTING = "phoneCountries";
14574
14576
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
14575
14577
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -14600,7 +14602,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
14600
14602
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
14601
14603
  }, "valueMatch");
14602
14604
 
14603
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
14605
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
14604
14606
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
14605
14607
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
14606
14608
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -14628,7 +14630,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
14628
14630
  return 2 * intersection2 / (aa2.size + bb.size);
14629
14631
  }, "vocabularySimilarity");
14630
14632
 
14631
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
14633
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
14632
14634
  import { createHash } from "node:crypto";
14633
14635
  var folded2 = /* @__PURE__ */ __name((name) => {
14634
14636
  try {
@@ -14694,7 +14696,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
14694
14696
  });
14695
14697
  }, "guardTagCreation");
14696
14698
 
14697
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
14699
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
14698
14700
  var invalid = /* @__PURE__ */ __name((message2) => {
14699
14701
  throw new CliError("validation_error", message2);
14700
14702
  }, "invalid");
@@ -14771,7 +14773,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
14771
14773
  };
14772
14774
  }, "createTagRedirectIndex");
14773
14775
 
14774
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
14776
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
14775
14777
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
14776
14778
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
14777
14779
  if (!row2)
@@ -14799,7 +14801,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
14799
14801
  return snapshot2;
14800
14802
  }, "tagRedirectSnapshot");
14801
14803
 
14802
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
14804
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
14803
14805
  import { createHash as createHash2 } from "node:crypto";
14804
14806
  var TASK_KEY_PREFIXES = {
14805
14807
  question: "Q",
@@ -14827,7 +14829,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
14827
14829
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
14828
14830
  }, "taskAccountOf");
14829
14831
 
14830
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
14832
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
14831
14833
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
14832
14834
  var REFERABLE = {
14833
14835
  note: { tombstone: true },
@@ -14985,7 +14987,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
14985
14987
  }, "taskIdOf");
14986
14988
  var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
14987
14989
 
14988
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
14990
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
14989
14991
  var toMs = /* @__PURE__ */ __name((iso11) => {
14990
14992
  if (iso11 === null || iso11 === void 0)
14991
14993
  return null;
@@ -14999,7 +15001,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
14999
15001
  var DELIVERY = { delivered: 1, read: 2 };
15000
15002
  var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
15001
15003
 
15002
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15004
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15003
15005
  var TAG_KINDS = ["tag", "topic"];
15004
15006
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
15005
15007
  var TAG_TYPE = {
@@ -15202,7 +15204,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
15202
15204
  return result;
15203
15205
  }, "tagsOf");
15204
15206
 
15205
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15207
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15206
15208
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
15207
15209
  var SPEECH = speech("att");
15208
15210
  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");
@@ -15557,7 +15559,7 @@ var FIELD_COMPILERS = {
15557
15559
  subject
15558
15560
  };
15559
15561
 
15560
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
15562
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
15561
15563
  var placeOf = /* @__PURE__ */ __name((database) => {
15562
15564
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
15563
15565
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -15573,7 +15575,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
15573
15575
  };
15574
15576
  }, "placeOf");
15575
15577
 
15576
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
15578
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
15577
15579
  var DRAIN_ON_WRITE = 500;
15578
15580
  var METHOD = "rules";
15579
15581
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -15736,7 +15738,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
15736
15738
  return queued.length;
15737
15739
  }, "drainMentions");
15738
15740
 
15739
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
15741
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
15740
15742
  var indexRow = /* @__PURE__ */ __name((database, name) => {
15741
15743
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
15742
15744
  if (!exists2)
@@ -15744,7 +15746,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
15744
15746
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
15745
15747
  }, "indexRow");
15746
15748
 
15747
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
15749
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
15748
15750
  var INDEX = "message_stems";
15749
15751
  var SETTING2 = "searchStemmers";
15750
15752
  var DRAIN_ON_WRITE2 = 500;
@@ -15866,7 +15868,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
15866
15868
  };
15867
15869
  }, "stemmerCache");
15868
15870
 
15869
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
15871
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
15870
15872
  var SQLITE_BUSY = 5;
15871
15873
  var pause = new Int32Array(new SharedArrayBuffer(4));
15872
15874
  var isBusy = /* @__PURE__ */ __name((error) => {
@@ -15961,7 +15963,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
15961
15963
  }
15962
15964
  }, "read");
15963
15965
 
15964
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
15966
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
15965
15967
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
15966
15968
  coalesce(CASE k.chunkable_type
15967
15969
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -16103,7 +16105,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
16103
16105
  }, "dropUnusedVectors");
16104
16106
  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");
16105
16107
 
16106
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16108
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16107
16109
  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({
16108
16110
  target: [accounts.provider, accounts.externalId],
16109
16111
  set: {
@@ -16209,7 +16211,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
16209
16211
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
16210
16212
  }, "dropOrphanPeople");
16211
16213
 
16212
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16214
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16213
16215
  var FOLDED = [
16214
16216
  { table: "tasks", column: "title" },
16215
16217
  { table: "tasks", column: "close_reason" },
@@ -16246,7 +16248,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
16246
16248
  return filled2;
16247
16249
  }, "fillFolded");
16248
16250
 
16249
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16251
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16250
16252
  import { createHash as createHash3 } from "node:crypto";
16251
16253
  var CHUNK_CHARS = 1200;
16252
16254
  var CHUNK_OVERLAP = 150;
@@ -16351,7 +16353,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
16351
16353
  return chunks2;
16352
16354
  }, "cutChunks");
16353
16355
 
16354
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16356
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16355
16357
  var DAY = 864e5;
16356
16358
  var CURRENCY = [
16357
16359
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -16468,7 +16470,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
16468
16470
  return best?.day ?? null;
16469
16471
  }, "dueDayOf");
16470
16472
 
16471
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
16473
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
16472
16474
  var DAY2 = 864e5;
16473
16475
  var STOP_WORDS = new Set([
16474
16476
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -16623,7 +16625,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
16623
16625
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
16624
16626
  })).sort((a, b) => b.score - a.score), "rankCandidates");
16625
16627
 
16626
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
16628
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
16627
16629
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
16628
16630
  r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
16629
16631
  JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
@@ -16754,7 +16756,7 @@ var dot = /* @__PURE__ */ __name((query, blob2) => {
16754
16756
  }, "dot");
16755
16757
  var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
16756
16758
  const { orm } = context;
16757
- const { chatKey, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId, before: before2, personId } = filter;
16759
+ const { chatKey, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, before: before2, personId } = filter;
16758
16760
  const rows = /* @__PURE__ */ __name((page3) => orm.all(
16759
16761
  // CROSS JOIN keeps the chunks first, so each page walks their key; led by the vectors, SQLite re-read and
16760
16762
  // sorted every one of them per page — 1.3 s against 140 ms at 42k chunks (bench/embeddings/README.md).
@@ -16767,7 +16769,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
16767
16769
  JOIN embeddings v ON v.model = ${model} AND v.content_hash = k.content_hash
16768
16770
  WHERE k.chunkable_type = 'conversation' AND ch.account_id = ${accountPk2}
16769
16771
  ${scope3 === void 0 ? sql`` : sql`AND k.scope=${scope3}`}
16770
- ${projectId === void 0 ? sql`` : sql`AND k.project_id=${projectId}`}
16772
+ ${projectId2 === void 0 ? sql`` : sql`AND k.project_id=${projectId2}`}
16771
16773
  ${before2 === void 0 ? sql`` : sql`AND k.occurred_at < ${before2}`}
16772
16774
  ${personId === void 0 ? sql`` : sql`AND EXISTS (SELECT 1 FROM conversation_messages pcm JOIN messages pm ON pm.id=pcm.message_id JOIN identity_links pil ON pil.identity_id=pm.sender_identity_id WHERE pcm.conversation_id=c.id AND pil.person_id=${personId})`}
16773
16775
  ${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}
@@ -16796,7 +16798,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
16796
16798
  }, "keepBest");
16797
16799
  const ranked = /* @__PURE__ */ __name((found2) => found2.sort((a, b) => b.score - a.score).slice(0, limit), "ranked");
16798
16800
  const plain2 = /* @__PURE__ */ __name((found2) => found2.map(({ id: _, ...chunk }) => chunk), "plain");
16799
- const indexable = personId === void 0 && projectId === void 0 && scope3 === void 0 && conversations2 === void 0;
16801
+ const indexable = personId === void 0 && projectId2 === void 0 && scope3 === void 0 && conversations2 === void 0;
16800
16802
  const indexed = indexable && searchIndex(context.database, model, {
16801
16803
  kind: "conversation",
16802
16804
  account: accountPk2,
@@ -16894,7 +16896,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
16894
16896
  };
16895
16897
  }, "readiness");
16896
16898
 
16897
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
16899
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
16898
16900
  var DOCUMENT_PICTURE = "document_picture";
16899
16901
  var SCAN_PAGE2 = 5e3;
16900
16902
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -16957,7 +16959,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
16957
16959
  }, "nearestPictures")
16958
16960
  }), "documentPicturesOver");
16959
16961
 
16960
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
16962
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
16961
16963
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
16962
16964
  const literal4 = escaped2 ?? plain2 ?? "";
16963
16965
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -17022,7 +17024,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
17022
17024
  var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
17023
17025
  var bound2 = /* @__PURE__ */ __name(({ sql: text5, params }) => sql.join(text5.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
17024
17026
 
17025
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17027
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17026
17028
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
17027
17029
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
17028
17030
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -17112,7 +17114,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
17112
17114
  });
17113
17115
  }, "linkMeeting");
17114
17116
 
17115
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17117
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17116
17118
  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), ''))";
17117
17119
  var UNSEARCHED_EVENT_TYPES = [
17118
17120
  "working-location",
@@ -17342,7 +17344,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
17342
17344
  return true;
17343
17345
  }, "resetNoteIndex");
17344
17346
 
17345
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17347
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17346
17348
  var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
17347
17349
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17348
17350
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
@@ -17361,7 +17363,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17361
17363
  }
17362
17364
  }, "resolvePersonLinks");
17363
17365
 
17364
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17366
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17365
17367
  var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
17366
17368
  var prepare = /* @__PURE__ */ __name((orm) => ({
17367
17369
  find: orm.select({
@@ -17586,7 +17588,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
17586
17588
  }, "meetingIdentityPk");
17587
17589
  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");
17588
17590
 
17589
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
17591
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
17590
17592
  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");
17591
17593
  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");
17592
17594
  var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
@@ -17866,7 +17868,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
17866
17868
  }
17867
17869
  }, "replaceAutoTags");
17868
17870
 
17869
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
17871
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
17870
17872
  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");
17871
17873
  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;
17872
17874
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -17947,7 +17949,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
17947
17949
  return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
17948
17950
  }, "mailCore");
17949
17951
 
17950
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
17952
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
17951
17953
  var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
17952
17954
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
17953
17955
  k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
@@ -18057,7 +18059,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
18057
18059
  return emails3 + threads;
18058
18060
  }, "drainEmailIndex");
18059
18061
 
18060
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18062
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18061
18063
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
18062
18064
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
18063
18065
  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,
@@ -18103,7 +18105,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
18103
18105
  leave.run(emailId, Number(box.id), emailId, Number(box.id));
18104
18106
  }, "forgetLocations");
18105
18107
 
18106
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18108
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18107
18109
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
18108
18110
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
18109
18111
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -18153,7 +18155,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
18153
18155
  return threads.length;
18154
18156
  }, "markEmailsRestored");
18155
18157
 
18156
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
18158
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
18157
18159
  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");
18158
18160
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
18159
18161
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -18220,7 +18222,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
18220
18222
  }
18221
18223
  }), "mailRulesOver");
18222
18224
 
18223
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
18225
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
18224
18226
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
18225
18227
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
18226
18228
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -18228,7 +18230,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
18228
18230
  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);
18229
18231
  }, "reviewLink");
18230
18232
 
18231
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
18233
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
18232
18234
  function checkMeetingCancelled(signal) {
18233
18235
  if (!signal?.aborted)
18234
18236
  return;
@@ -18239,7 +18241,7 @@ function checkMeetingCancelled(signal) {
18239
18241
  }
18240
18242
  __name(checkMeetingCancelled, "checkMeetingCancelled");
18241
18243
 
18242
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
18244
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
18243
18245
  var meetingOf = /* @__PURE__ */ __name((row2) => ({
18244
18246
  id: Number(row2.id),
18245
18247
  accountId: Number(row2.account_id),
@@ -18289,7 +18291,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
18289
18291
  createdAt: Number(row2.created_at)
18290
18292
  }), "transcriptRowOf");
18291
18293
 
18292
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
18294
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
18293
18295
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
18294
18296
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
18295
18297
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -18456,7 +18458,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
18456
18458
  }
18457
18459
  }), "meetingReadsOver");
18458
18460
 
18459
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
18461
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
18460
18462
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
18461
18463
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
18462
18464
  const params = [input.accountId];
@@ -18499,7 +18501,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
18499
18501
  return { clauses, params };
18500
18502
  }, "meetingSelectionSql");
18501
18503
 
18502
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
18504
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
18503
18505
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
18504
18506
  async meetingChatLines(input) {
18505
18507
  checkMeetingCancelled(input.signal);
@@ -18527,7 +18529,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
18527
18529
  }
18528
18530
  }), "meetingChatLinesOver");
18529
18531
 
18530
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
18532
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
18531
18533
  var MESSAGE_FIELDS = {
18532
18534
  pk: messages.id,
18533
18535
  nativeId: messages.externalId,
@@ -18694,7 +18696,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
18694
18696
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
18695
18697
  }), "chatActivity");
18696
18698
 
18697
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
18699
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
18698
18700
  var HIT_FIELDS = {
18699
18701
  ...MESSAGE_FIELDS,
18700
18702
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -18793,7 +18795,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
18793
18795
  };
18794
18796
  }, "directReplies");
18795
18797
 
18796
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
18798
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
18797
18799
  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");
18798
18800
  var required = /* @__PURE__ */ __name((context, ref3) => {
18799
18801
  const found2 = identityRow(context, ref3);
@@ -18924,7 +18926,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
18924
18926
  }, "mentioning");
18925
18927
  var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
18926
18928
 
18927
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
18929
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
18928
18930
  var missing2 = /* @__PURE__ */ __name(() => {
18929
18931
  throw new CliError("not_found", "Meeting, participant or selected target not found");
18930
18932
  }, "missing");
@@ -19046,7 +19048,7 @@ function meetingContextLinksOver(context) {
19046
19048
  }
19047
19049
  __name(meetingContextLinksOver, "meetingContextLinksOver");
19048
19050
 
19049
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19051
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19050
19052
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
19051
19053
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
19052
19054
  var summaryOf = /* @__PURE__ */ __name((row2) => ({
@@ -19075,7 +19077,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
19075
19077
  return row2 ? summaryText(summaryOf(row2)) : null;
19076
19078
  }, "indexedText");
19077
19079
 
19078
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19080
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19079
19081
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
19080
19082
  var meetingCurrentIndexRows = `
19081
19083
  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
@@ -19106,7 +19108,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
19106
19108
  }, "invalidateMeetingStems");
19107
19109
  var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
19108
19110
 
19109
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19111
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19110
19112
  function meetingHitIndexOver({ database, now: now2 }) {
19111
19113
  return {
19112
19114
  async indexSearch(original) {
@@ -19174,10 +19176,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
19174
19176
  }
19175
19177
  __name(meetingHitIndexOver, "meetingHitIndexOver");
19176
19178
 
19177
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19179
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19178
19180
  import { createHash as createHash4 } from "node:crypto";
19179
19181
 
19180
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/trigrams.js
19182
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/trigrams.js
19181
19183
  var trigrams = /* @__PURE__ */ __name((term) => {
19182
19184
  const padded = ` ${term} `;
19183
19185
  const pieces = /* @__PURE__ */ new Set();
@@ -19186,7 +19188,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
19186
19188
  return [...pieces];
19187
19189
  }, "trigrams");
19188
19190
 
19189
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/correct.js
19191
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/correct.js
19190
19192
  var SHORTEST_CORRECTION = 3;
19191
19193
  var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
19192
19194
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -19233,7 +19235,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
19233
19235
  return corrections;
19234
19236
  }, "correctWords");
19235
19237
 
19236
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/garbled.js
19238
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/garbled.js
19237
19239
  var SHORTEST_GARBLED = 4;
19238
19240
  var MOST_WIDENED = 64;
19239
19241
  var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
@@ -19325,7 +19327,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
19325
19327
  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((word) => word.term));
19326
19328
  }, "widenWords");
19327
19329
 
19328
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
19330
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
19329
19331
  import { readFileSync } from "node:fs";
19330
19332
  var loaded;
19331
19333
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -19384,7 +19386,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
19384
19386
  return false;
19385
19387
  }, "knownRussianWord");
19386
19388
 
19387
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
19389
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
19388
19390
  var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
19389
19391
  var MOST_WORDS = 128;
19390
19392
  var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
@@ -19611,7 +19613,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
19611
19613
  return check3(tree);
19612
19614
  }, "matchMeetingText");
19613
19615
 
19614
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19616
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19615
19617
  var fail3 = /* @__PURE__ */ __name((message2) => {
19616
19618
  throw new CliError("validation_error", message2);
19617
19619
  }, "fail");
@@ -19788,7 +19790,7 @@ function meetingHitSearchOver({ database }) {
19788
19790
  }
19789
19791
  __name(meetingHitSearchOver, "meetingHitSearchOver");
19790
19792
 
19791
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
19793
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
19792
19794
  import { createHash as createHash5 } from "node:crypto";
19793
19795
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
19794
19796
  if (value === void 0)
@@ -19878,7 +19880,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
19878
19880
  }
19879
19881
  }), "meetingParticipantSearchOver");
19880
19882
 
19881
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
19883
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
19882
19884
  var preparationQueries = {
19883
19885
  participants: {
19884
19886
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -19928,7 +19930,7 @@ var preparationQueries = {
19928
19930
  }
19929
19931
  };
19930
19932
 
19931
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
19933
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
19932
19934
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
19933
19935
  async preparationContext(original) {
19934
19936
  const input = validateMeetingPreparationContext(original);
@@ -19969,7 +19971,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
19969
19971
  }
19970
19972
  }), "meetingPreparationContextOver");
19971
19973
 
19972
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
19974
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
19973
19975
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
19974
19976
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
19975
19977
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -19983,7 +19985,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
19983
19985
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
19984
19986
  )`, "preparationSubjects");
19985
19987
 
19986
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
19988
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
19987
19989
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
19988
19990
  async preparationKnowledge(original) {
19989
19991
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20028,7 +20030,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
20028
20030
  }
20029
20031
  }), "meetingPreparationKnowledgeOver");
20030
20032
 
20031
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20033
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20032
20034
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20033
20035
  async preparationNotes(original) {
20034
20036
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20081,7 +20083,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20081
20083
  }
20082
20084
  }), "meetingPreparationNotesOver");
20083
20085
 
20084
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20086
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20085
20087
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20086
20088
  async relatedHistory(original) {
20087
20089
  const input = validateMeetingRelatedHistory(original);
@@ -20152,7 +20154,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20152
20154
  }
20153
20155
  }), "meetingRelatedHistoryOver");
20154
20156
 
20155
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
20157
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
20156
20158
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
20157
20159
  var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
20158
20160
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -20233,7 +20235,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
20233
20235
  }
20234
20236
  }), "meetingReviewOver");
20235
20237
 
20236
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
20238
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
20237
20239
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
20238
20240
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
20239
20241
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -20287,7 +20289,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20287
20289
  }
20288
20290
  }), "meetingSeriesHistoryOver");
20289
20291
 
20290
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
20292
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
20291
20293
  var MOST_ROWS = 5e5;
20292
20294
  var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
20293
20295
  async meetingStats(input) {
@@ -20334,7 +20336,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
20334
20336
  }
20335
20337
  }), "meetingStatsOver");
20336
20338
 
20337
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
20339
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
20338
20340
  var CURSOR_KEY = "meetings";
20339
20341
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
20340
20342
  id: Number(row2.id),
@@ -20886,7 +20888,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
20886
20888
  };
20887
20889
  }, "meetingStoreOver");
20888
20890
 
20889
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
20891
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
20890
20892
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
20891
20893
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
20892
20894
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -20912,7 +20914,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
20912
20914
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
20913
20915
  }, "release");
20914
20916
 
20915
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
20917
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
20916
20918
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
20917
20919
  id: `email:${place.emailId}`,
20918
20920
  chatId: place.threadExternalId,
@@ -21469,7 +21471,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
21469
21471
  }
21470
21472
  }), "mailStoreOver");
21471
21473
 
21472
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/search/dictionary.js
21474
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/search/dictionary.js
21473
21475
  import { readFileSync as readFileSync2 } from "node:fs";
21474
21476
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
21475
21477
  var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
@@ -21559,7 +21561,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
21559
21561
  }, "knownWord");
21560
21562
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
21561
21563
 
21562
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
21564
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
21563
21565
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
21564
21566
  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");
21565
21567
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -21645,7 +21647,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
21645
21647
  return found2;
21646
21648
  }, "spokenTranscripts");
21647
21649
 
21648
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
21650
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
21649
21651
  var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
21650
21652
  const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
21651
21653
  if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
@@ -21692,7 +21694,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
21692
21694
  });
21693
21695
  }, "placeHits");
21694
21696
 
21695
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
21697
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
21696
21698
  var MESSAGES2 = {
21697
21699
  rows: "messages",
21698
21700
  threads: "chats",
@@ -22166,7 +22168,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
22166
22168
  };
22167
22169
  }, "runQuery");
22168
22170
 
22169
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
22171
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
22170
22172
  function invalidMetadata() {
22171
22173
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
22172
22174
  }
@@ -22268,7 +22270,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
22268
22270
  };
22269
22271
  }), "counterTargets");
22270
22272
 
22271
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
22273
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
22272
22274
  var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
22273
22275
  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,
22274
22276
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -22387,7 +22389,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
22387
22389
  }));
22388
22390
  }, "attachmentViews");
22389
22391
 
22390
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
22392
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
22391
22393
  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");
22392
22394
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
22393
22395
  const { orm, database, now: now2 } = context;
@@ -22425,7 +22427,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
22425
22427
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
22426
22428
  }, "intoVoiceAttachment");
22427
22429
 
22428
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
22430
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
22429
22431
  var FIELDS = [
22430
22432
  "threadExternalId",
22431
22433
  "senderIdentityId",
@@ -22742,7 +22744,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
22742
22744
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
22743
22745
  }, "writeDerivedReactions");
22744
22746
 
22745
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/keys.js
22747
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/keys.js
22746
22748
  var keysOver = /* @__PURE__ */ __name((context) => {
22747
22749
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
22748
22750
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -22763,7 +22765,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
22763
22765
  };
22764
22766
  }, "keysOver");
22765
22767
 
22766
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
22768
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
22767
22769
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
22768
22770
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
22769
22771
  if (!row2)
@@ -22798,7 +22800,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
22798
22800
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
22799
22801
  }, "saveProfile");
22800
22802
 
22801
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
22803
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
22802
22804
  var BOT_KINDS = ["agent", "script", "integration"];
22803
22805
  var ownerPerson = /* @__PURE__ */ __name((database) => {
22804
22806
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -22834,7 +22836,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
22834
22836
  return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
22835
22837
  }, "originOfActor");
22836
22838
 
22837
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
22839
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
22838
22840
  var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
22839
22841
  const owner = ownerPerson(context.database).id;
22840
22842
  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);
@@ -22855,7 +22857,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
22855
22857
  return personOf(context, ref3);
22856
22858
  }, "linkToOwner");
22857
22859
 
22858
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
22860
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
22859
22861
  var PROVIDERS_SETTING = "providers";
22860
22862
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
22861
22863
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -22890,7 +22892,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
22890
22892
  });
22891
22893
  }, "registerProvider");
22892
22894
 
22893
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
22895
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
22894
22896
  var DAY3 = 864e5;
22895
22897
  var RECENTLY_CLOSED_MS = 14 * DAY3;
22896
22898
  var TEXT_LIMIT = 20;
@@ -22914,7 +22916,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
22914
22916
  ...own || row2.person == null ? {} : { person: `person:${row2.person}` }
22915
22917
  };
22916
22918
  }, "messageOf");
22917
- const sourceOf3 = /* @__PURE__ */ __name((locator2) => {
22919
+ const sourceOf4 = /* @__PURE__ */ __name((locator2) => {
22918
22920
  if (typeof locator2 !== "string" || !isLocator(locator2))
22919
22921
  return void 0;
22920
22922
  let thing;
@@ -22935,7 +22937,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
22935
22937
  return { ...side, linked };
22936
22938
  }, "linkedOf");
22937
22939
  const sideOf = /* @__PURE__ */ __name((row2) => {
22938
- const source2 = sourceOf3(row2.source_locator);
22940
+ const source2 = sourceOf4(row2.source_locator);
22939
22941
  const person2 = source2?.person;
22940
22942
  return {
22941
22943
  row: Number(row2.id),
@@ -22990,7 +22992,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
22990
22992
  if (!project)
22991
22993
  return void 0;
22992
22994
  const { draft } = subject2;
22993
- const source2 = draft.source === void 0 ? void 0 : sourceOf3(draft.source);
22995
+ const source2 = draft.source === void 0 ? void 0 : sourceOf4(draft.source);
22994
22996
  const person2 = draft.person ?? source2?.person;
22995
22997
  return {
22996
22998
  project: Number(project.id),
@@ -23089,7 +23091,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
23089
23091
  };
23090
23092
  }, "taskSimilarityOver");
23091
23093
 
23092
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
23094
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
23093
23095
  var SETTING3 = "taskCategories";
23094
23096
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
23095
23097
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -23108,7 +23110,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
23108
23110
  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);
23109
23111
  }, "saveTaskCategories");
23110
23112
 
23111
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
23113
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
23112
23114
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
23113
23115
  var ALLOWED = "taskAgentClose";
23114
23116
  var MIN = "taskAgentCloseMin";
@@ -23164,7 +23166,7 @@ var SUGGESTION_COLUMNS = [
23164
23166
  ];
23165
23167
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
23166
23168
 
23167
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
23169
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
23168
23170
  var EXCERPT_CHARS = 280;
23169
23171
  var excerptOf = /* @__PURE__ */ __name((text5) => {
23170
23172
  if (text5 == null)
@@ -23189,8 +23191,7 @@ var KIND = {
23189
23191
  meeting_transcript: "meeting",
23190
23192
  meeting_transcript_row: "meeting"
23191
23193
  };
23192
- var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).map((link3) => {
23193
- const thing = storedThing(link3.to_type, link3.to_id);
23194
+ var sourceOf3 = /* @__PURE__ */ __name((database, thing) => {
23194
23195
  const state = stateOfThing(database, thing);
23195
23196
  const read2 = READS2[thing.type];
23196
23197
  const row2 = read2 === void 0 || state === "unavailable" ? void 0 : database.prepare(read2).get(thing.id);
@@ -23205,9 +23206,32 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.pre
23205
23206
  tool: textOf(row2?.tool),
23206
23207
  missing: gone
23207
23208
  };
23208
- }), "evidenceSourcesOf");
23209
+ }, "sourceOf");
23210
+ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).map((link3) => sourceOf3(database, storedThing(link3.to_type, link3.to_id))), "evidenceSourcesOf");
23211
+ var thingNamed = /* @__PURE__ */ __name((database, reference2) => {
23212
+ try {
23213
+ return thingOf(database, canonicalThingReference(reference2));
23214
+ } catch {
23215
+ return void 0;
23216
+ }
23217
+ }, "thingNamed");
23218
+ var sourcesOfReferences = /* @__PURE__ */ __name((database, references) => [...new Set(references)].map((reference2) => {
23219
+ const thing = thingNamed(database, reference2);
23220
+ if (thing)
23221
+ return { ...sourceOf3(database, thing), ref: reference2 };
23222
+ return {
23223
+ ref: reference2,
23224
+ kind: reference2.startsWith("msg:") ? "message" : reference2.split(":")[0] || "unknown",
23225
+ title: null,
23226
+ sender: null,
23227
+ at: null,
23228
+ excerpt: null,
23229
+ tool: null,
23230
+ missing: true
23231
+ };
23232
+ }), "sourcesOfReferences");
23209
23233
 
23210
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/attachments/limits.js
23234
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/attachments/limits.js
23211
23235
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
23212
23236
  var MAX_TEXT_CHARS = 2e6;
23213
23237
  var ATTACHMENT_LIMIT_ENV = [
@@ -23233,7 +23257,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
23233
23257
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
23234
23258
  }, "pdfPreviewLimits");
23235
23259
 
23236
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/ulid.js
23260
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/ulid.js
23237
23261
  import { randomBytes } from "node:crypto";
23238
23262
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
23239
23263
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -23246,7 +23270,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
23246
23270
  return time3 + random;
23247
23271
  }, "ulid");
23248
23272
 
23249
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
23273
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
23250
23274
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
23251
23275
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
23252
23276
  if (!meta && !sections?.length)
@@ -23267,7 +23291,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
23267
23291
  return typeof language === "string" && language !== "" ? language : null;
23268
23292
  }, "languageOf");
23269
23293
 
23270
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
23294
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
23271
23295
  var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
23272
23296
  var objectOf = /* @__PURE__ */ __name((value) => {
23273
23297
  if (isObject(value))
@@ -23510,7 +23534,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
23510
23534
  };
23511
23535
  }, "filesStoreOver");
23512
23536
 
23513
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
23537
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
23514
23538
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
23515
23539
  entity: "document",
23516
23540
  backend: "sql",
@@ -23556,7 +23580,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
23556
23580
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
23557
23581
  }, "importedDocumentWhere");
23558
23582
 
23559
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
23583
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
23560
23584
  var NOTE_FORMATS = ["obsidian", "markdown"];
23561
23585
  var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
23562
23586
  var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
@@ -24066,7 +24090,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
24066
24090
  };
24067
24091
  }, "notesStoreOver");
24068
24092
 
24069
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
24093
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
24070
24094
  var NAMED = "SELECT m.*, b.name AS author_name FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
24071
24095
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
24072
24096
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -24113,6 +24137,18 @@ var subjectOf = /* @__PURE__ */ __name((database, row2) => {
24113
24137
  subjectIsOwner: Number(named2?.owner) === 1
24114
24138
  };
24115
24139
  }, "subjectOf");
24140
+ var projectOf = /* @__PURE__ */ __name((database, row2) => {
24141
+ if (row2.project_id == null)
24142
+ return { project: null, projectName: null };
24143
+ const named2 = database.prepare(SUBJECT_NAMES.project).get(Number(row2.project_id));
24144
+ return { project: `project:${row2.project_id}`, projectName: named2?.name == null ? null : String(named2.name) };
24145
+ }, "projectOf");
24146
+ var projectId = /* @__PURE__ */ __name((database, reference2) => {
24147
+ const project = requiredThing(database, reference2, "the project");
24148
+ if (project.type !== "project")
24149
+ throw new CliError("validation_error", `${reference2} is not a project`);
24150
+ return project.id;
24151
+ }, "projectId");
24116
24152
  var highestKey = /* @__PURE__ */ __name((table) => `ids.${table}.highest`, "highestKey");
24117
24153
  var nextId = /* @__PURE__ */ __name((database, table) => {
24118
24154
  const kept = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(highestKey(table));
@@ -24152,6 +24188,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
24152
24188
  kind: row2.kind,
24153
24189
  body: String(row2.body),
24154
24190
  ...subjectOf(database, row2),
24191
+ ...projectOf(database, row2),
24155
24192
  author: authorOf(row2),
24156
24193
  model: row2.model == null ? null : String(row2.model),
24157
24194
  confidence: row2.confidence == null ? null : Number(row2.confidence),
@@ -24199,9 +24236,10 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
24199
24236
  const id2 = write(database, () => {
24200
24237
  const { actor, model } = authorActor(context, input.author);
24201
24238
  const subject2 = input.subject === void 0 ? void 0 : requiredThing(database, input.subject, "the subject");
24239
+ const project = input.project === void 0 ? null : projectId(database, input.project);
24202
24240
  const replaced = input.supersedes === void 0 ? void 0 : Number(rowOf(input.supersedes).id);
24203
24241
  const at = now2();
24204
- const made = Number(database.prepare("INSERT INTO memories (id, kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "memories"), kind3, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3, at, at)?.id);
24242
+ const made = Number(database.prepare("INSERT INTO memories (id, kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, project_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "memories"), kind3, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3, project, at, at)?.id);
24205
24243
  linkEvidence(context, { type: "memory", id: made }, input.evidence, input.author === "owner" ? "owner" : "agent");
24206
24244
  if (replaced !== void 0)
24207
24245
  database.prepare("UPDATE memories SET status = 'superseded', updated_at = ? WHERE id = ?").run(at, replaced);
@@ -24212,8 +24250,15 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
24212
24250
  get: /* @__PURE__ */ __name(async (reference2) => memoryOf(rowOf(reference2)), "get"),
24213
24251
  list: /* @__PURE__ */ __name(async (options = {}) => {
24214
24252
  const subject2 = options.subject === void 0 ? void 0 : requiredThing(database, options.subject);
24215
- return database.prepare(`${NAMED} WHERE m.deleted_at IS NULL AND (? IS NULL OR (m.subject_type = ? AND m.subject_id = ?)) AND (? IS NULL OR m.kind = ?) AND (? IS NULL OR m.status = ?) AND (? IS NULL OR m.scope = ?) ORDER BY m.created_at DESC, m.id DESC LIMIT ?`).all(subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null, options.kind ?? null, options.kind ?? null, options.status ?? null, options.status ?? null, options.scope ?? null, options.scope ?? null, Math.min(Math.max(options.limit ?? 100, 1), 500)).map(memoryOf);
24253
+ const project = options.project === void 0 ? null : projectId(database, options.project);
24254
+ return database.prepare(`${NAMED} WHERE m.deleted_at IS NULL AND (? IS NULL OR (m.subject_type = ? AND m.subject_id = ?)) AND (? IS NULL OR m.project_id = ?) AND (? IS NULL OR m.kind = ?) AND (? IS NULL OR m.status = ?) AND (? IS NULL OR m.scope = ?) ORDER BY m.created_at DESC, m.id DESC LIMIT ?`).all(subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null, project, project, options.kind ?? null, options.kind ?? null, options.status ?? null, options.status ?? null, options.scope ?? null, options.scope ?? null, Math.min(Math.max(options.limit ?? 100, 1), 500)).map(memoryOf);
24216
24255
  }, "list"),
24256
+ update: /* @__PURE__ */ __name(async (reference2, change) => write(database, () => {
24257
+ const id2 = Number(rowOf(reference2).id);
24258
+ const project = change.project === null ? null : projectId(database, change.project);
24259
+ database.prepare("UPDATE memories SET project_id = ?, updated_at = ? WHERE id = ?").run(project, now2(), id2);
24260
+ return memoryOf(rowOf(`memory:${id2}`));
24261
+ }), "update"),
24217
24262
  confirm: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "confirmed", true), "confirm"),
24218
24263
  markStale: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "stale", false), "markStale"),
24219
24264
  remove: /* @__PURE__ */ __name(async (reference2) => {
@@ -24241,7 +24286,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
24241
24286
  };
24242
24287
  }, "memoriesStoreOver");
24243
24288
 
24244
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
24289
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
24245
24290
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
24246
24291
  var KEY = "taskFirstPassPerChat";
24247
24292
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -24261,7 +24306,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
24261
24306
  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);
24262
24307
  }, "saveFirstPassPerChat");
24263
24308
 
24264
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
24309
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
24265
24310
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
24266
24311
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
24267
24312
  name,
@@ -24435,7 +24480,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
24435
24480
  return root === void 0 ? void 0 : { ...query, root };
24436
24481
  }, "withoutField");
24437
24482
 
24438
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
24483
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
24439
24484
  var TASK_RELATION_KINDS = [
24440
24485
  "blocked-by",
24441
24486
  "follow-up-of",
@@ -24565,7 +24610,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
24565
24610
  };
24566
24611
  }, "taskRelationsStoreOver");
24567
24612
 
24568
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
24613
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
24569
24614
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
24570
24615
  var TASK_EVENT_KINDS = [
24571
24616
  "created",
@@ -24615,7 +24660,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
24615
24660
  throw new CliError("not_found", `no task ${id2}`);
24616
24661
  return row2;
24617
24662
  }, "required");
24618
- const projectOf = /* @__PURE__ */ __name((reference2) => {
24663
+ const projectOf2 = /* @__PURE__ */ __name((reference2) => {
24619
24664
  if (reference2.startsWith("project:")) {
24620
24665
  const thing = requiredThing(database, reference2, "the project");
24621
24666
  if (thing.type !== "project")
@@ -24830,7 +24875,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
24830
24875
  if (!WORK_TASK_TYPES.includes(input.type))
24831
24876
  throw new CliError("validation_error", `a task made here is one of ${WORK_TASK_TYPES.join(", ")}`);
24832
24877
  const made = write(database, () => {
24833
- const project = projectOf(input.project);
24878
+ const project = projectOf2(input.project);
24834
24879
  const { actor } = authorActor(context, by);
24835
24880
  const at = now2();
24836
24881
  const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, project);
@@ -24921,9 +24966,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
24921
24966
  find: /* @__PURE__ */ __name(async ({ project, type, status, assignee, where, limit = 100 }) => {
24922
24967
  if (type !== void 0 && !TASK_TYPES.includes(type))
24923
24968
  throw new CliError("validation_error", `a task's type is one of ${TASK_TYPES.join(", ")}`);
24924
- const projectId = project === void 0 ? null : projectOf(project);
24969
+ const projectId2 = project === void 0 ? null : projectOf2(project);
24925
24970
  const person2 = assignee === void 0 ? null : personOf2(assignee);
24926
- return database.prepare(`SELECT * FROM tasks t WHERE deleted_at IS NULL AND (? IS NULL OR project_id = ?) AND (? IS NULL OR type = ?) AND (? IS NULL OR status = ?) AND (? IS NULL OR EXISTS (SELECT 1 FROM task_assignments a WHERE a.task_id = t.id AND a.assignee_type = 'person' AND a.assignee_id = ?)) AND (${where?.sql || "1"}) ORDER BY priority_score IS NULL, priority_score DESC, created_at, id LIMIT ?`).all(projectId, projectId, type ?? null, type ?? null, status ?? null, status ?? null, person2, person2, ...where?.params ?? [], Math.min(Math.max(limit, 1), 500)).map(detailsOf);
24971
+ return database.prepare(`SELECT * FROM tasks t WHERE deleted_at IS NULL AND (? IS NULL OR project_id = ?) AND (? IS NULL OR type = ?) AND (? IS NULL OR status = ?) AND (? IS NULL OR EXISTS (SELECT 1 FROM task_assignments a WHERE a.task_id = t.id AND a.assignee_type = 'person' AND a.assignee_id = ?)) AND (${where?.sql || "1"}) ORDER BY priority_score IS NULL, priority_score DESC, created_at, id LIMIT ?`).all(projectId2, projectId2, type ?? null, type ?? null, status ?? null, status ?? null, person2, person2, ...where?.params ?? [], Math.min(Math.max(limit, 1), 500)).map(detailsOf);
24927
24972
  }, "find"),
24928
24973
  claim: /* @__PURE__ */ __name(async (id2, holder, until) => {
24929
24974
  const task = required3(id2);
@@ -25026,7 +25071,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
25026
25071
  };
25027
25072
  }, "workTasksOver");
25028
25073
 
25029
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
25074
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
25030
25075
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
25031
25076
  const { database, now: now2 } = context;
25032
25077
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -25075,7 +25120,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
25075
25120
  };
25076
25121
  }, "taskCloseOver");
25077
25122
 
25078
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
25123
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
25079
25124
  var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
25080
25125
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
25081
25126
  const { database, now: now2 } = context;
@@ -25294,7 +25339,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
25294
25339
  };
25295
25340
  }, "taskPairsOver");
25296
25341
 
25297
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
25342
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
25298
25343
  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";
25299
25344
  var taskStoreOver = /* @__PURE__ */ __name((context) => {
25300
25345
  const { database, now: now2 } = context;
@@ -25499,7 +25544,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
25499
25544
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
25500
25545
  }, "oneOf");
25501
25546
 
25502
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/accounts.js
25547
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/accounts.js
25503
25548
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
25504
25549
  const { database } = context;
25505
25550
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -25544,7 +25589,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
25544
25589
  };
25545
25590
  }, "accountsStoreOver");
25546
25591
 
25547
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
25592
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
25548
25593
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
25549
25594
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
25550
25595
  const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -25568,7 +25613,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
25568
25613
  })), "keepDownloads");
25569
25614
  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");
25570
25615
 
25571
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/attachments.js
25616
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/attachments.js
25572
25617
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
25573
25618
  const { database } = context;
25574
25619
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -25625,7 +25670,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
25625
25670
  }, "keepAttachmentText")
25626
25671
  }), "attachmentsStoreOver");
25627
25672
 
25628
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
25673
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
25629
25674
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
25630
25675
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
25631
25676
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -25805,7 +25850,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
25805
25850
  return done;
25806
25851
  }, "rekeyChats");
25807
25852
 
25808
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
25853
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
25809
25854
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
25810
25855
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
25811
25856
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -25837,7 +25882,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
25837
25882
  });
25838
25883
  }, "chatCompleteness");
25839
25884
 
25840
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/chats.js
25885
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/chats.js
25841
25886
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
25842
25887
  const { database } = context;
25843
25888
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -25944,7 +25989,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
25944
25989
  };
25945
25990
  }, "chatsStoreOver");
25946
25991
 
25947
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
25992
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
25948
25993
  import { createHash as createHash6 } from "node:crypto";
25949
25994
  var BATCH_CONTEXT = 50;
25950
25995
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -26082,7 +26127,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
26082
26127
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
26083
26128
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
26084
26129
 
26085
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
26130
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
26086
26131
  import { setTimeout } from "node:timers/promises";
26087
26132
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
26088
26133
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -26394,7 +26439,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
26394
26439
  AND NOT EXISTS (SELECT 1 FROM messages d
26395
26440
  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");
26396
26441
 
26397
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/conversations.js
26442
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/conversations.js
26398
26443
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
26399
26444
  const { database } = context;
26400
26445
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -26501,7 +26546,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
26501
26546
  };
26502
26547
  }, "conversationsStoreOver");
26503
26548
 
26504
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/counters.js
26549
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/counters.js
26505
26550
  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";
26506
26551
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
26507
26552
  const { database } = context;
@@ -26526,7 +26571,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
26526
26571
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
26527
26572
  }), "countersStoreOver");
26528
26573
 
26529
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
26574
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
26530
26575
  var MENTION_STATUSES = ["found", "linked", "dismissed"];
26531
26576
  var MENTION_QUERY = defineQuery({
26532
26577
  entity: "mention",
@@ -26742,7 +26787,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
26742
26787
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
26743
26788
  }, "listPlaces");
26744
26789
 
26745
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/mentions.js
26790
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/mentions.js
26746
26791
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
26747
26792
  const { database } = context;
26748
26793
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -26777,7 +26822,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
26777
26822
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
26778
26823
  }), "mentionsStoreOver");
26779
26824
 
26780
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
26825
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
26781
26826
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
26782
26827
  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");
26783
26828
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -26792,7 +26837,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
26792
26837
  }));
26793
26838
  }, "documentLinkMessages");
26794
26839
 
26795
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
26840
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
26796
26841
  var stemmerFor = stemmerCache();
26797
26842
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
26798
26843
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -26836,7 +26881,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
26836
26881
  });
26837
26882
  }, "laterSharingRare");
26838
26883
 
26839
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/messages.js
26884
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/messages.js
26840
26885
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
26841
26886
  const { database } = context;
26842
26887
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -26971,7 +27016,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
26971
27016
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
26972
27017
  }), "messagesStoreOver");
26973
27018
 
26974
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
27019
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
26975
27020
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
26976
27021
  var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
26977
27022
  var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
@@ -27028,7 +27073,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
27028
27073
  });
27029
27074
  }, "personPreparation");
27030
27075
 
27031
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
27076
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
27032
27077
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
27033
27078
  const id2 = Number(uid);
27034
27079
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -27036,7 +27081,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
27036
27081
  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)));
27037
27082
  }, "personSeenInAccounts");
27038
27083
 
27039
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
27084
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
27040
27085
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
27041
27086
  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);
27042
27087
  if (!row2)
@@ -27102,7 +27147,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
27102
27147
  return { id: id2, personId, removed: true };
27103
27148
  }, "removeNote");
27104
27149
 
27105
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/people.js
27150
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/people.js
27106
27151
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
27107
27152
  const { database } = context;
27108
27153
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -27177,13 +27222,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
27177
27222
  };
27178
27223
  }, "peopleStoreOver");
27179
27224
 
27180
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
27225
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
27181
27226
  import { createHash as createHash8 } from "node:crypto";
27182
27227
 
27183
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
27228
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
27184
27229
  import { createHash as createHash7 } from "node:crypto";
27185
27230
 
27186
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
27231
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
27187
27232
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
27188
27233
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
27189
27234
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -27405,7 +27450,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
27405
27450
  };
27406
27451
  }, "rankReplyGraph");
27407
27452
 
27408
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
27453
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
27409
27454
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
27410
27455
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
27411
27456
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
@@ -27579,7 +27624,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
27579
27624
  return { items, evidence, summary, graph: graph.quality };
27580
27625
  }, "calculateAdminStatistics");
27581
27626
 
27582
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
27627
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
27583
27628
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
27584
27629
  const dates = [];
27585
27630
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -27601,7 +27646,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
27601
27646
  return dates[0].node.resolution.date;
27602
27647
  }, "rankingContextRange");
27603
27648
 
27604
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
27649
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
27605
27650
  var reactionCounts = /* @__PURE__ */ __name((stored3) => {
27606
27651
  let counts;
27607
27652
  try {
@@ -27896,7 +27941,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
27896
27941
  });
27897
27942
  }, "rankQuery");
27898
27943
 
27899
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
27944
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
27900
27945
  function fail4(message2, reason = "query.too-large") {
27901
27946
  throw new CliError("validation_error", message2, { reason, complete: false });
27902
27947
  }
@@ -28073,7 +28118,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
28073
28118
  return result;
28074
28119
  }), "adminStatisticsQuery");
28075
28120
 
28076
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
28121
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
28077
28122
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
28078
28123
  if (!execution.accounts.length)
28079
28124
  return { conversations: [], chats: [] };
@@ -28091,7 +28136,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
28091
28136
  return { conversations: conversations2, chats: chats2 };
28092
28137
  }, "conversationEligibility");
28093
28138
 
28094
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
28139
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
28095
28140
  import { createHash as createHash9 } from "node:crypto";
28096
28141
  var EVIDENCE_BYTES = 64 * 1024;
28097
28142
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -28241,7 +28286,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
28241
28286
  return result;
28242
28287
  }, "rankingEvidence");
28243
28288
 
28244
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/queries.js
28289
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/queries.js
28245
28290
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
28246
28291
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
28247
28292
  if (execution.corpus === "mail")
@@ -28260,7 +28305,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
28260
28305
  };
28261
28306
  }, "queriesStoreOver");
28262
28307
 
28263
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
28308
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
28264
28309
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
28265
28310
  const { database, now: now2 } = context;
28266
28311
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -28299,10 +28344,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
28299
28344
  }));
28300
28345
  }, "chatEventsOf");
28301
28346
 
28302
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
28347
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
28303
28348
  import { createHash as createHash10 } from "node:crypto";
28304
28349
 
28305
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/calendar.js
28350
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/calendar.js
28306
28351
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
28307
28352
  const format = new Intl.DateTimeFormat("en-CA", {
28308
28353
  timeZone: zone,
@@ -28317,7 +28362,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
28317
28362
  };
28318
28363
  }, "calendarKey");
28319
28364
 
28320
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/retention.js
28365
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/retention.js
28321
28366
  var RETENTION_TOLERANCE = 864e5;
28322
28367
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
28323
28368
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -28371,7 +28416,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
28371
28416
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
28372
28417
  }, "retentionCohorts");
28373
28418
 
28374
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
28419
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
28375
28420
  var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
28376
28421
  var week = /* @__PURE__ */ __name((day) => {
28377
28422
  const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
@@ -28507,7 +28552,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
28507
28552
  };
28508
28553
  }, "retentionQuery");
28509
28554
 
28510
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
28555
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
28511
28556
  var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
28512
28557
  var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
28513
28558
  ...isBot === void 0 ? {} : { bot: isBot },
@@ -28638,7 +28683,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
28638
28683
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
28639
28684
  })), "trackedChats");
28640
28685
 
28641
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/roster.js
28686
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/roster.js
28642
28687
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
28643
28688
  const { database } = context;
28644
28689
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -28694,7 +28739,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
28694
28739
  };
28695
28740
  }, "rosterStoreOver");
28696
28741
 
28697
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
28742
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
28698
28743
  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");
28699
28744
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
28700
28745
  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 ?`);
@@ -28718,7 +28763,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
28718
28763
  }
28719
28764
  }, "backfillNormalized");
28720
28765
 
28721
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
28766
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
28722
28767
  var INDEX2 = "message_words";
28723
28768
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
28724
28769
  const row2 = indexRow(database, INDEX2);
@@ -28845,7 +28890,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
28845
28890
  });
28846
28891
  }, "resetSearchIndex");
28847
28892
 
28848
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
28893
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
28849
28894
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
28850
28895
  const filled2 = { stemmed: 0, drained: 0 };
28851
28896
  const before2 = stemsState(database);
@@ -28940,7 +28985,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
28940
28985
  return resetStems(database, { now: now2 });
28941
28986
  }, "followDefaultStemmers");
28942
28987
 
28943
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
28988
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
28944
28989
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
28945
28990
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
28946
28991
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -28962,7 +29007,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
28962
29007
  });
28963
29008
  }, "termCandidates");
28964
29009
 
28965
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/search-index.js
29010
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/search-index.js
28966
29011
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
28967
29012
  const { database } = context;
28968
29013
  const stemmerFor2 = stemmerCache();
@@ -28984,7 +29029,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
28984
29029
  };
28985
29030
  }, "searchIndexStoreOver");
28986
29031
 
28987
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
29032
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
28988
29033
  var HISTORY_KEPT = 1e3;
28989
29034
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
28990
29035
  var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -29053,7 +29098,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
29053
29098
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
29054
29099
  }, "clearHistory");
29055
29100
 
29056
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/searches.js
29101
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/searches.js
29057
29102
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
29058
29103
  const { database } = context;
29059
29104
  return {
@@ -29077,7 +29122,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
29077
29122
  };
29078
29123
  }, "searchesStoreOver");
29079
29124
 
29080
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
29125
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
29081
29126
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
29082
29127
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
29083
29128
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -29120,7 +29165,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
29120
29165
  };
29121
29166
  }, "agentActionsStoreOver");
29122
29167
 
29123
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
29168
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
29124
29169
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
29125
29170
  }) => {
29126
29171
  const { database, now: now2 } = context;
@@ -29179,7 +29224,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
29179
29224
  };
29180
29225
  }, "botUpdateStoreOver");
29181
29226
 
29182
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
29227
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
29183
29228
  var DAY4 = 864e5;
29184
29229
  var listEvents = /* @__PURE__ */ __name((database, filter) => {
29185
29230
  const clauses = ["e.deleted_at IS NULL"];
@@ -29264,7 +29309,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
29264
29309
  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);
29265
29310
  }, "listEvents");
29266
29311
 
29267
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
29312
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
29268
29313
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
29269
29314
  id: Number(row2.id),
29270
29315
  accountId: Number(row2.account_id),
@@ -29844,7 +29889,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
29844
29889
  };
29845
29890
  }, "eventStoreOver");
29846
29891
 
29847
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
29892
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
29848
29893
  var CATALOG_QUERY = defineQuery({
29849
29894
  entity: "document",
29850
29895
  backend: "sql",
@@ -30086,7 +30131,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
30086
30131
  };
30087
30132
  }, "catalogStoreOver");
30088
30133
 
30089
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/context/evidence.js
30134
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/context/evidence.js
30090
30135
  import { createHash as createHash11 } from "node:crypto";
30091
30136
  var CONTEXT_MAX_READ_BYTES = 262144;
30092
30137
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -30184,7 +30229,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
30184
30229
  return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
30185
30230
  }, "contextEvidenceRequest");
30186
30231
 
30187
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
30232
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
30188
30233
  var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
30189
30234
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
30190
30235
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -30197,7 +30242,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
30197
30242
  THEN 'source-modified' ELSE 'stored-update' END`;
30198
30243
  var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
30199
30244
 
30200
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
30245
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
30201
30246
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
30202
30247
  const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
30203
30248
  signal?.throwIfAborted();
@@ -30296,7 +30341,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
30296
30341
  });
30297
30342
  }, "readMeetingContextEvidence");
30298
30343
 
30299
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
30344
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
30300
30345
  var corpora = {
30301
30346
  message: {
30302
30347
  table: "messages",
@@ -30525,7 +30570,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
30525
30570
  }
30526
30571
  }), "contextRecordsOver");
30527
30572
 
30528
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
30573
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
30529
30574
  var NOTE_FIELDS = [
30530
30575
  "text",
30531
30576
  "exact",
@@ -30955,7 +31000,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
30955
31000
  };
30956
31001
  }, "noteSearchOver");
30957
31002
 
30958
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
31003
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
30959
31004
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
30960
31005
  var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
30961
31006
  var EVENT_CORPUS = {
@@ -31087,7 +31132,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
31087
31132
  };
31088
31133
  }, "eventSearchOver");
31089
31134
 
31090
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
31135
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
31091
31136
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
31092
31137
  var reference = /* @__PURE__ */ __name((raw) => {
31093
31138
  if (/^document:[1-9]\d*$/.test(raw))
@@ -31100,7 +31145,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
31100
31145
  }, "reference");
31101
31146
  var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
31102
31147
 
31103
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/domain/moment.js
31148
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/domain/moment.js
31104
31149
  var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
31105
31150
  try {
31106
31151
  return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
@@ -31112,7 +31157,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
31112
31157
  }
31113
31158
  }, "calendarMoment");
31114
31159
 
31115
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
31160
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
31116
31161
  var NAMED3 = "SELECT f.*, b.name AS author_name FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
31117
31162
  var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
31118
31163
  var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -31128,7 +31173,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
31128
31173
  type: row2.type,
31129
31174
  statement: String(row2.statement),
31130
31175
  status: row2.status,
31131
- project: row2.project_id == null ? null : `project:${row2.project_id}`,
31176
+ ...projectOf(database, row2),
31132
31177
  ...subjectOf(database, row2),
31133
31178
  occurredAt: row2.occurred_at == null ? null : iso8(row2.occurred_at),
31134
31179
  supersedes: row2.supersedes_id == null ? null : `fact:${row2.supersedes_id}`,
@@ -31261,7 +31306,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
31261
31306
  };
31262
31307
  }, "factsStoreOver");
31263
31308
 
31264
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
31309
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
31265
31310
  var invalid2 = /* @__PURE__ */ __name((message2) => {
31266
31311
  throw new CliError("validation_error", message2);
31267
31312
  }, "invalid");
@@ -31351,12 +31396,13 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
31351
31396
  return { snapshot: snapshot2, snapshotParts, previous, outcomes };
31352
31397
  }, "findingsCoreOver");
31353
31398
 
31354
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
31399
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
31355
31400
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
31356
31401
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
31357
31402
  var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
31358
- var NAMED4 = "SELECT p.*, b.name AS proposer_name FROM proposed_actions p LEFT JOIN bots b ON p.proposed_by_type = 'bot' AND b.id = p.proposed_by_id";
31359
31403
  var json2 = /* @__PURE__ */ __name((value) => value == null ? null : JSON.parse(String(value)), "json");
31404
+ var STATUS = `CASE WHEN p.status = 'approved' AND p.kind IN ('${MEETING_FINDINGS_KIND}', '${EVIDENCE_FINDINGS_KIND}') AND json_array_length(p.result, '$.accepted') = 0 THEN 'rejected' ELSE p.status END`;
31405
+ var NAMED4 = `SELECT p.*, ${STATUS} AS shown_status, b.name AS proposer_name FROM proposed_actions p LEFT JOIN bots b ON p.proposed_by_type = 'bot' AND b.id = p.proposed_by_id`;
31360
31406
  var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
31361
31407
  const { database, now: now2 } = context;
31362
31408
  const actionOf = /* @__PURE__ */ __name((row2) => {
@@ -31368,7 +31414,7 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
31368
31414
  target: row2.target_type == null ? null : referenceOfThing(database, storedThing(row2.target_type, row2.target_id)) ?? null,
31369
31415
  payload: json2(row2.payload),
31370
31416
  reason: row2.reason == null ? null : String(row2.reason),
31371
- status: row2.status,
31417
+ status: row2.shown_status,
31372
31418
  proposedBy: {
31373
31419
  type: row2.proposed_by_type,
31374
31420
  id: String(row2.proposed_by_id),
@@ -31432,7 +31478,7 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
31432
31478
  list: /* @__PURE__ */ __name(({ status, limit = 100 } = {}) => {
31433
31479
  if (status !== void 0 && !PROPOSAL_STATUSES.includes(status))
31434
31480
  throw new CliError("validation_error", `a status is one of ${PROPOSAL_STATUSES.join(", ")}`);
31435
- return database.prepare(`${NAMED4} WHERE (? IS NULL OR p.status = ?) ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(status ?? null, status ?? null, Math.min(Math.max(limit, 1), 500)).map(actionOf);
31481
+ return database.prepare(`${NAMED4} WHERE (? IS NULL OR ${STATUS} = ?) ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(status ?? null, status ?? null, Math.min(Math.max(limit, 1), 500)).map(actionOf);
31436
31482
  }, "list"),
31437
31483
  approve: /* @__PURE__ */ __name((id2, result, by) => decide2(id2, "approved", result, by), "approve"),
31438
31484
  reject: /* @__PURE__ */ __name((id2) => decide2(id2, "rejected"), "reject"),
@@ -31497,7 +31543,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
31497
31543
  };
31498
31544
  }, "proposedActionsStoreOver");
31499
31545
 
31500
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
31546
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
31501
31547
  var stale = /* @__PURE__ */ __name(() => {
31502
31548
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
31503
31549
  reason: "evidence-findings.stale"
@@ -31523,7 +31569,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
31523
31569
  }, "load");
31524
31570
  const view = /* @__PURE__ */ __name((proposal) => {
31525
31571
  const input = proposal.payload;
31526
- if (!input || !proposal.target || !["proposed", "approved"].includes(proposal.status))
31572
+ if (!input || !proposal.target || !["proposed", "approved", "rejected"].includes(proposal.status))
31527
31573
  return invalid3("invalid stored findings batch");
31528
31574
  return {
31529
31575
  id: proposal.id,
@@ -31608,15 +31654,16 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
31608
31654
  });
31609
31655
  }, "stage"),
31610
31656
  get: /* @__PURE__ */ __name(async (id2) => view(load(id2)), "get"),
31657
+ sources: /* @__PURE__ */ __name(async (id2) => sourcesOfReferences(database, view(load(id2)).input.findings.flatMap((finding) => finding.evidence.map((one) => one.reference))), "sources"),
31611
31658
  list: /* @__PURE__ */ __name(async ({ project, limit = 20, offset = 0, status } = {}) => {
31612
31659
  if (status !== void 0 && status !== "proposed" && status !== "reviewed")
31613
31660
  return invalid3("finding status is proposed or reviewed");
31614
31661
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 50 || !Number.isSafeInteger(offset) || offset < 0)
31615
31662
  return invalid3("findings lists take 1\u201350 items and a nonnegative offset");
31616
- const projectId = project === void 0 ? null : /^project:([1-9]\d*)$/.exec(project)?.[1];
31617
- if (projectId === void 0)
31663
+ const projectId2 = project === void 0 ? null : /^project:([1-9]\d*)$/.exec(project)?.[1];
31664
+ if (projectId2 === void 0)
31618
31665
  return invalid3("a findings list filters by a project reference");
31619
- const ids = database.prepare("SELECT id FROM proposed_actions WHERE account_id IS NULL AND kind=? AND (? IS NULL OR (target_type='project' AND target_id=?)) AND (? IS NULL OR status=?) ORDER BY id DESC LIMIT ? OFFSET ?").all(EVIDENCE_FINDINGS_KIND, projectId, projectId === null ? null : Number(projectId), status ?? null, status === "reviewed" ? "approved" : status ?? null, limit + 1, offset);
31666
+ const ids = database.prepare("SELECT id FROM proposed_actions WHERE account_id IS NULL AND kind=? AND (? IS NULL OR (target_type='project' AND target_id=?)) AND (? IS NULL OR status=?) ORDER BY id DESC LIMIT ? OFFSET ?").all(EVIDENCE_FINDINGS_KIND, projectId2, projectId2 === null ? null : Number(projectId2), status ?? null, status === "reviewed" ? "approved" : status ?? null, limit + 1, offset);
31620
31667
  return { items: ids.slice(0, limit).map((row2) => view(load(String(row2.id)))), hasMore: ids.length > limit };
31621
31668
  }, "list"),
31622
31669
  review: /* @__PURE__ */ __name(async (id2, decision) => write(database, () => {
@@ -31663,7 +31710,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
31663
31710
  };
31664
31711
  }, "evidenceFindingsStoreOver");
31665
31712
 
31666
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
31713
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
31667
31714
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
31668
31715
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
31669
31716
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -31716,7 +31763,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
31716
31763
  }, "forPerson")
31717
31764
  }), "involvementStoreOver");
31718
31765
 
31719
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
31766
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
31720
31767
  import { createHash as createHash12 } from "node:crypto";
31721
31768
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
31722
31769
  var id = /* @__PURE__ */ __name((value) => {
@@ -31750,10 +31797,10 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
31750
31797
  };
31751
31798
  }, "linkOf");
31752
31799
  return {
31753
- linkMeetingProject: /* @__PURE__ */ __name(async (key2, meetingId, projectId, options = {}) => {
31800
+ linkMeetingProject: /* @__PURE__ */ __name(async (key2, meetingId, projectId2, options = {}) => {
31754
31801
  check2(options.signal);
31755
31802
  const meeting = id(meetingId);
31756
- const project = id(projectId);
31803
+ const project = id(projectId2);
31757
31804
  const by = options.by ?? "owner";
31758
31805
  if (by !== "owner" && by !== "agent")
31759
31806
  throw new CliError("validation_error", "choose owner or agent provenance");
@@ -31802,16 +31849,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
31802
31849
  };
31803
31850
  }, "meetingProjectsStoreOver");
31804
31851
 
31805
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
31852
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
31806
31853
  import { createHash as createHash15 } from "node:crypto";
31807
31854
 
31808
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
31855
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
31809
31856
  import { createHash as createHash14 } from "node:crypto";
31810
31857
 
31811
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
31858
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
31812
31859
  import { createHash as createHash13 } from "node:crypto";
31813
31860
 
31814
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
31861
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
31815
31862
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
31816
31863
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
31817
31864
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -31862,7 +31909,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
31862
31909
  return input;
31863
31910
  }, "consolidationApplyInput");
31864
31911
 
31865
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
31912
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
31866
31913
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
31867
31914
  id: String(row2.id),
31868
31915
  sourceId: String(row2.source_id),
@@ -31937,7 +31984,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
31937
31984
  }, { beforeCommit: check3 });
31938
31985
  }, "applyTagConsolidation");
31939
31986
 
31940
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
31987
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
31941
31988
  var selections = [
31942
31989
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
31943
31990
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -32081,7 +32128,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
32081
32128
  };
32082
32129
  }, "previewRows");
32083
32130
 
32084
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
32131
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
32085
32132
  var kinds = ["project", "tag", "topic"];
32086
32133
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
32087
32134
  if (signal?.aborted)
@@ -32345,7 +32392,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
32345
32392
  };
32346
32393
  }, "vocabularyStoreOver");
32347
32394
 
32348
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
32395
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
32349
32396
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
32350
32397
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
32351
32398
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -32504,7 +32551,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
32504
32551
  scope: row2.scope,
32505
32552
  createdAt: iso10(row2.created_at)
32506
32553
  }), "organizationOf");
32507
- const projectOf = /* @__PURE__ */ __name((row2) => ({
32554
+ const projectOf2 = /* @__PURE__ */ __name((row2) => ({
32508
32555
  id: String(row2.id),
32509
32556
  ref: `project:${row2.id}`,
32510
32557
  key: String(row2.key),
@@ -32739,7 +32786,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
32739
32786
  }
32740
32787
  const at = now2();
32741
32788
  const row2 = database.prepare("INSERT INTO projects (key, name, name_folded, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, fold(title), description === void 0 ? null : textOf4(description, 2e3), oneOf5(type, PROJECT_TYPES, "a project's type"), organizationId, oneOf5(scope3, SCOPES, "a scope"), at, at);
32742
- return projectOf(row2);
32789
+ return projectOf2(row2);
32743
32790
  }), "addProject"),
32744
32791
  projects: /* @__PURE__ */ __name(async (query) => {
32745
32792
  const asksKind = query !== void 0 && walkQuery(query.root).some((node) => node.field === "kind");
@@ -32753,7 +32800,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
32753
32800
  scope: { type: "enum", sql: "scope" },
32754
32801
  created_at: { type: "time", sql: "created_at" }
32755
32802
  });
32756
- return database.prepare(`SELECT * FROM projects WHERE deleted_at IS NULL${asksKind ? "" : ` AND length(key) <> ${INBOX_KEY_LENGTH}`}${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(projectOf);
32803
+ return database.prepare(`SELECT * FROM projects WHERE deleted_at IS NULL${asksKind ? "" : ` AND length(key) <> ${INBOX_KEY_LENGTH}`}${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(projectOf2);
32757
32804
  }, "projects"),
32758
32805
  relate: /* @__PURE__ */ __name(async (key2, input) => {
32759
32806
  const from2 = related(key2, input.from, true);
@@ -32867,7 +32914,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
32867
32914
  return key2.padEnd(3, "X");
32868
32915
  }, "projectKey");
32869
32916
 
32870
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
32917
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
32871
32918
  var DAY5 = 864e5;
32872
32919
  var SETTING4 = "logs_pruned_at";
32873
32920
  var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
@@ -32894,7 +32941,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
32894
32941
  };
32895
32942
  }, "logPruner");
32896
32943
 
32897
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
32944
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
32898
32945
  var stale2 = /* @__PURE__ */ __name(() => {
32899
32946
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
32900
32947
  reason: "meeting-findings.stale"
@@ -32926,7 +32973,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
32926
32973
  }, "load");
32927
32974
  const view = /* @__PURE__ */ __name((proposal) => {
32928
32975
  const input = proposal.payload;
32929
- if (!input || !proposal.account || !["proposed", "approved"].includes(proposal.status))
32976
+ if (!input || !proposal.account || !["proposed", "approved", "rejected"].includes(proposal.status))
32930
32977
  return invalid4("invalid stored findings batch");
32931
32978
  return {
32932
32979
  id: proposal.id,
@@ -32947,11 +32994,11 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
32947
32994
  const core = findingsCoreOver(context, MEETING_FINDINGS_KIND);
32948
32995
  const snapshot2 = /* @__PURE__ */ __name((account, input) => {
32949
32996
  let readBytes = 0;
32950
- return core.snapshot(input, (evidence, finding, projectId, seen) => {
32997
+ return core.snapshot(input, (evidence, finding, projectId2, seen) => {
32951
32998
  const parsed2 = parseMeetingReference(evidence.reference);
32952
32999
  if (parsed2.accountId !== account)
32953
33000
  throw new CliError("not_found", "the cited cue belongs to another account");
32954
- const membership = database.prepare("SELECT id,updated_at,confirmed,source FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL AND confirmed=1").get(parsed2.meetingId, projectId);
33001
+ const membership = database.prepare("SELECT id,updated_at,confirmed,source FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL AND confirmed=1").get(parsed2.meetingId, projectId2);
32955
33002
  if (!membership)
32956
33003
  return invalid4("each cited meeting needs confirmed membership in the finding's project");
32957
33004
  seen.set(`${finding.project}/${parsed2.meetingId}`, membership);
@@ -33063,7 +33110,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
33063
33110
  };
33064
33111
  }, "meetingFindingsStoreOver");
33065
33112
 
33066
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
33113
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
33067
33114
  var RANK_BATCH = 512;
33068
33115
  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";
33069
33116
  var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -33334,7 +33381,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
33334
33381
  }
33335
33382
  }), "meetingVectorsOver");
33336
33383
 
33337
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
33384
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
33338
33385
  var OTHER_SOURCES = ["document", "note", "email"];
33339
33386
  var TEXTS = {
33340
33387
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -33435,11 +33482,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
33435
33482
  };
33436
33483
  }, "sourceMentionStoreOver");
33437
33484
 
33438
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
33485
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
33439
33486
  import { mkdirSync, statSync, writeFileSync } from "node:fs";
33440
33487
  import { dirname } from "node:path";
33441
33488
 
33442
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
33489
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
33443
33490
  import { readFileSync as readFileSync3 } from "node:fs";
33444
33491
  var CLIENTS_SETTING = "clients";
33445
33492
  var coreVersion = (() => {
@@ -33497,7 +33544,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
33497
33544
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
33498
33545
  }, "refusalAdvice");
33499
33546
 
33500
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
33547
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
33501
33548
  var GENERATED = [
33502
33549
  {
33503
33550
  "name": "20261010184427_initial",
@@ -34383,10 +34430,17 @@ WHERE json_type(params, '$.selection') = 'object';`
34383
34430
  "CREATE TRIGGER tasks_revision_tagging_ai AFTER INSERT ON taggings WHEN new.taggable_type = 'task' BEGIN\n UPDATE tasks SET revision = revision + 1 WHERE id = new.taggable_id;\nEND;",
34384
34431
  "CREATE TRIGGER tasks_revision_tagging_ad AFTER DELETE ON taggings WHEN old.taggable_type = 'task' BEGIN\n UPDATE tasks SET revision = revision + 1 WHERE id = old.taggable_id;\nEND;"
34385
34432
  ]
34433
+ },
34434
+ {
34435
+ "name": "20261101011859_version-43-memory-project",
34436
+ "statements": [
34437
+ "ALTER TABLE `memories` ADD `project_id` integer REFERENCES projects(id);",
34438
+ "CREATE INDEX `memories_by_project_id` ON `memories` (`project_id`);"
34439
+ ]
34386
34440
  }
34387
34441
  ];
34388
34442
 
34389
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
34443
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
34390
34444
  var MANIFEST = [
34391
34445
  { name: "20261010184427_initial", version: 1, minCompatible: 1 },
34392
34446
  { name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
@@ -34442,7 +34496,8 @@ var MANIFEST = [
34442
34496
  { name: "20261030114008_version-39-email-locations", version: 39, minCompatible: 34 },
34443
34497
  { name: "20261030225520_version-40-note-trigrams", version: 40, minCompatible: 34 },
34444
34498
  { name: "20261031230945_version-41-task-fields", version: 41, minCompatible: 34 },
34445
- { name: "20261101002523_version-42-task-revision", version: 42, minCompatible: 34 }
34499
+ { name: "20261101002523_version-42-task-revision", version: 42, minCompatible: 34 },
34500
+ { name: "20261101011859_version-43-memory-project", version: 43, minCompatible: 34 }
34446
34501
  ];
34447
34502
  var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
34448
34503
  const migrations = [];
@@ -34466,7 +34521,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
34466
34521
  return migrations;
34467
34522
  }, "generatedMigrations");
34468
34523
 
34469
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/migrations.js
34524
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/migrations.js
34470
34525
  var MIGRATIONS = generatedMigrations();
34471
34526
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
34472
34527
  version INTEGER PRIMARY KEY,
@@ -34519,7 +34574,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
34519
34574
  }
34520
34575
  }, "migrate");
34521
34576
 
34522
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
34577
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
34523
34578
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
34524
34579
  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 ?");
34525
34580
  if (pending.get(0, 1) === void 0)
@@ -34541,7 +34596,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
34541
34596
  }
34542
34597
  }, "fillJoinKeys");
34543
34598
 
34544
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
34599
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
34545
34600
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
34546
34601
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
34547
34602
  try {
@@ -34554,8 +34609,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
34554
34609
  }, "openSqlite");
34555
34610
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
34556
34611
  quietSqliteWarning();
34557
- const { drizzle } = await import("./node-73PKCCE7.js");
34558
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-FDD5N6GC.js");
34612
+ const { drizzle } = await import("./node-SZAO6HTA.js");
34613
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-O34FFLRV.js");
34559
34614
  const client = await nodeClient(path, { readOnly });
34560
34615
  try {
34561
34616
  return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
@@ -34565,8 +34620,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
34565
34620
  }
34566
34621
  }, "openUnderNode");
34567
34622
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
34568
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KGH5F33G.js");
34569
- const { drizzle } = await import("./bun-GTG5IYLQ.js");
34623
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-TTTKY7H2.js");
34624
+ const { drizzle } = await import("./bun-B7YXDIMT.js");
34570
34625
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
34571
34626
  try {
34572
34627
  return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
@@ -34576,7 +34631,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
34576
34631
  }
34577
34632
  }, "openUnderBun");
34578
34633
 
34579
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
34634
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
34580
34635
  var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
34581
34636
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
34582
34637
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -34591,7 +34646,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
34591
34646
  throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
34592
34647
  }, "assertReadCompatible");
34593
34648
 
34594
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
34649
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
34595
34650
  var BACKFILL_ON_OPEN = 5e3;
34596
34651
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
34597
34652
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -34647,13 +34702,13 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
34647
34702
  }
34648
34703
  }, "openStoreContext");
34649
34704
 
34650
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
34705
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
34651
34706
  import { createHash as createHash17 } from "node:crypto";
34652
34707
 
34653
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
34708
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
34654
34709
  import { createHash as createHash16 } from "node:crypto";
34655
34710
 
34656
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
34711
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
34657
34712
  var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
34658
34713
  var ref = text3(2048);
34659
34714
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -34719,7 +34774,7 @@ var projectAnnotationsSchema = strictObject({
34719
34774
  }))
34720
34775
  });
34721
34776
 
34722
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
34777
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
34723
34778
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
34724
34779
  var invalid5 = /* @__PURE__ */ __name((field4) => {
34725
34780
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -34852,7 +34907,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
34852
34907
  return createHash16("sha256").update(JSON.stringify(normalized)).digest("hex");
34853
34908
  }, "projectAnnotationsFingerprint");
34854
34909
 
34855
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
34910
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
34856
34911
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
34857
34912
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
34858
34913
  var targetSchema = strictObject({
@@ -34959,7 +35014,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
34959
35014
  }, "planBoundProjectAnnotations");
34960
35015
  var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
34961
35016
 
34962
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
35017
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
34963
35018
  import { createHash as createHash18 } from "node:crypto";
34964
35019
  var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
34965
35020
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -35053,7 +35108,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
35053
35108
  })).digest("hex");
35054
35109
  }, "projectAnnotationSnapshotFingerprint");
35055
35110
 
35056
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
35111
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
35057
35112
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
35058
35113
  if (!request || typeof request !== "object" || Array.isArray(request))
35059
35114
  throw new CliError("validation_error", "project annotation request is required");
@@ -35070,7 +35125,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
35070
35125
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
35071
35126
  }, "projectAnnotationRequest");
35072
35127
 
35073
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
35128
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
35074
35129
  var SnapshotBudget = class {
35075
35130
  static {
35076
35131
  __name(this, "SnapshotBudget");
@@ -35096,13 +35151,13 @@ var SnapshotBudget = class {
35096
35151
  }
35097
35152
  };
35098
35153
 
35099
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
35154
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
35100
35155
  import { createHash as createHash20 } from "node:crypto";
35101
35156
 
35102
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
35157
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
35103
35158
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
35104
35159
 
35105
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
35160
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
35106
35161
  import { createHash as createHash19 } from "node:crypto";
35107
35162
  var invalid7 = /* @__PURE__ */ __name(() => {
35108
35163
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -35245,7 +35300,7 @@ var ProjectSnapshotSources = class {
35245
35300
  }
35246
35301
  };
35247
35302
 
35248
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
35303
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
35249
35304
  var unsupported = /* @__PURE__ */ __name(() => {
35250
35305
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
35251
35306
  }, "unsupported");
@@ -35271,7 +35326,7 @@ var provenance = /* @__PURE__ */ __name((raw) => {
35271
35326
  return unsupported();
35272
35327
  return text5 ?? null;
35273
35328
  }, "provenance");
35274
- var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, budget) => read(database, () => {
35329
+ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, budget) => read(database, () => {
35275
35330
  if (database.prepare("SELECT max(version) AS version FROM schema_migrations").get()?.version !== MIGRATIONS.at(-1)?.version)
35276
35331
  throw new CliError("configuration_error", "project snapshots require the SDK's current store schema without source migration");
35277
35332
  const sources = new ProjectSnapshotSources(database, budget);
@@ -35279,7 +35334,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
35279
35334
  budget.rows(database, from2, fields4, params);
35280
35335
  return database.prepare(`SELECT ${fields4.join(",")} ${from2} LIMIT 1001`).all(...params);
35281
35336
  }, "rows");
35282
- const descriptor = database.prepare("SELECT account_id,deleted_at FROM projects WHERE id=?").get(projectId);
35337
+ const descriptor = database.prepare("SELECT account_id,deleted_at FROM projects WHERE id=?").get(projectId2);
35283
35338
  if (!descriptor)
35284
35339
  throw new CliError("not_found", "the source project does not exist");
35285
35340
  if (descriptor.account_id !== null || descriptor.deleted_at !== null)
@@ -35297,13 +35352,13 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
35297
35352
  "status",
35298
35353
  "created_at",
35299
35354
  "updated_at"
35300
- ], [projectId])[0];
35355
+ ], [projectId2])[0];
35301
35356
  if (!project)
35302
35357
  throw new CliError("not_found", "the source project does not exist");
35303
- const aliases2 = rows("FROM aliases WHERE aliasable_type='project' AND aliasable_id=? ORDER BY id", ["name", "source", "display", "account_id", "created_at", "updated_at"], [projectId]);
35358
+ const aliases2 = rows("FROM aliases WHERE aliasable_type='project' AND aliasable_id=? ORDER BY id", ["name", "source", "display", "account_id", "created_at", "updated_at"], [projectId2]);
35304
35359
  if (aliases2.some((alias2) => alias2.account_id !== null))
35305
35360
  return unsupported();
35306
- if (database.prepare("SELECT 1 FROM facts WHERE project_id=? AND (metadata IS NOT NULL OR deleted_at IS NOT NULL) LIMIT 1").get(projectId))
35361
+ if (database.prepare("SELECT 1 FROM facts WHERE project_id=? AND (metadata IS NOT NULL OR deleted_at IS NOT NULL) LIMIT 1").get(projectId2))
35307
35362
  return unsupported();
35308
35363
  const facts2 = rows("FROM facts WHERE project_id=? ORDER BY id", [
35309
35364
  "id",
@@ -35323,7 +35378,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
35323
35378
  "source",
35324
35379
  "created_at",
35325
35380
  "updated_at"
35326
- ], [projectId]);
35381
+ ], [projectId2]);
35327
35382
  const links2 = rows("FROM links WHERE (from_type='project' AND from_id=?) OR (to_type='project' AND to_id=?) OR (from_type='fact' AND from_id IN (SELECT id FROM facts WHERE project_id=?)) OR (to_type='fact' AND to_id IN (SELECT id FROM facts WHERE project_id=?)) ORDER BY id", [
35328
35383
  "id",
35329
35384
  "from_type",
@@ -35341,8 +35396,8 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
35341
35396
  "author",
35342
35397
  "created_at",
35343
35398
  "updated_at"
35344
- ], [projectId, projectId, projectId, projectId]);
35345
- const projectRef = `project:${projectId}`;
35399
+ ], [projectId2, projectId2, projectId2, projectId2]);
35400
+ const projectRef = `project:${projectId2}`;
35346
35401
  const owned = /* @__PURE__ */ new Set([projectRef, ...facts2.map((row2) => `fact:${row2.id}`)]);
35347
35402
  const data = {
35348
35403
  format: "wirecat.project-annotations",
@@ -35416,9 +35471,9 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
35416
35471
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
35417
35472
  }), "projectAnnotationSnapshot");
35418
35473
 
35419
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
35420
- var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
35421
- const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
35474
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
35475
+ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
35476
+ const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
35422
35477
  const sources = new ProjectSnapshotSources(database, budget);
35423
35478
  for (const ref3 of new Set(Object.values(bindings))) {
35424
35479
  if (ref3 === current.project.ref)
@@ -35439,7 +35494,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
35439
35494
  const names = new Set([manifest.project.key, manifest.project.name, ...manifest.aliases.map((a) => a.name)].map(normalizeVocabularyName));
35440
35495
  const namespace = /* @__PURE__ */ new Set();
35441
35496
  for (const project of projects2) {
35442
- if (project.id === projectId)
35497
+ if (project.id === projectId2)
35443
35498
  continue;
35444
35499
  const keyMatches = names.has(normalizeVocabularyName(String(project.key)));
35445
35500
  const nameMatches = project.account_id === null && project.deleted_at === null && names.has(normalizeVocabularyName(String(project.name)));
@@ -35447,7 +35502,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
35447
35502
  namespace.add(`project:${project.id}`);
35448
35503
  }
35449
35504
  for (const alias2 of aliases2) {
35450
- if (alias2.aliasable_id === projectId || alias2.account_id !== null)
35505
+ if (alias2.aliasable_id === projectId2 || alias2.account_id !== null)
35451
35506
  continue;
35452
35507
  const project = projects2.find((p) => p.id === alias2.aliasable_id && p.account_id === null && p.deleted_at === null);
35453
35508
  if (project && names.has(normalizeVocabularyName(String(alias2.name))))
@@ -35478,8 +35533,8 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
35478
35533
  };
35479
35534
  }), "previewAnnotationSnapshot");
35480
35535
 
35481
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
35482
- var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
35536
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
35537
+ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
35483
35538
  const mappings = { ...bindings };
35484
35539
  const resolve = /* @__PURE__ */ __name((ref3) => {
35485
35540
  if (ref3 === null)
@@ -35490,14 +35545,14 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
35490
35545
  return thing;
35491
35546
  }, "resolve");
35492
35547
  const organization = resolve(snapshot2.project.organization), owner = resolve(snapshot2.project.owner);
35493
- database.prepare("UPDATE projects SET description=?,type=?,scope=?,organization_id=?,owner_type=?,owner_id=?,status=?,created_at=?,updated_at=? WHERE id=?").run(snapshot2.project.description, snapshot2.project.type, snapshot2.project.scope, organization?.id ?? null, owner?.type ?? null, owner?.id ?? null, snapshot2.project.status, snapshot2.project.created_at, snapshot2.project.updated_at, projectId);
35548
+ database.prepare("UPDATE projects SET description=?,type=?,scope=?,organization_id=?,owner_type=?,owner_id=?,status=?,created_at=?,updated_at=? WHERE id=?").run(snapshot2.project.description, snapshot2.project.type, snapshot2.project.scope, organization?.id ?? null, owner?.type ?? null, owner?.id ?? null, snapshot2.project.status, snapshot2.project.created_at, snapshot2.project.updated_at, projectId2);
35494
35549
  for (const alias2 of snapshot2.aliases)
35495
- database.prepare("INSERT INTO aliases(aliasable_type,aliasable_id,account_id,name,name_folded,display,source,created_at,updated_at) VALUES('project',?,NULL,?,?,?,?,?,?)").run(projectId, alias2.name, fold(alias2.name), Number(alias2.display), alias2.source, alias2.created_at, alias2.updated_at);
35550
+ database.prepare("INSERT INTO aliases(aliasable_type,aliasable_id,account_id,name,name_folded,display,source,created_at,updated_at) VALUES('project',?,NULL,?,?,?,?,?,?)").run(projectId2, alias2.name, fold(alias2.name), Number(alias2.display), alias2.source, alias2.created_at, alias2.updated_at);
35496
35551
  for (const fact of snapshot2.facts) {
35497
35552
  const author = resolve(fact.author), confirmed = resolve(fact.confirmed_by);
35498
35553
  if (!author)
35499
35554
  throw new CliError("validation_error", "project annotation author is required");
35500
- const row2 = database.prepare("INSERT INTO facts(id,type,statement,status,project_id,subject_type,subject_id,occurred_at,supersedes_id,author_type,author_id,model,confirmed_by_type,confirmed_by_id,scope,source,created_at,updated_at) VALUES(?,?,?,?,?,NULL,NULL,?,NULL,?,?,?,?,?,?,?,?,?) RETURNING id").get(nextId(database, "facts"), fact.type, fact.statement, fact.status, projectId, fact.occurred_at, author.type, author.id, fact.model, confirmed?.type ?? null, confirmed?.id ?? null, fact.scope, fact.source, fact.created_at, fact.updated_at);
35555
+ const row2 = database.prepare("INSERT INTO facts(id,type,statement,status,project_id,subject_type,subject_id,occurred_at,supersedes_id,author_type,author_id,model,confirmed_by_type,confirmed_by_id,scope,source,created_at,updated_at) VALUES(?,?,?,?,?,NULL,NULL,?,NULL,?,?,?,?,?,?,?,?,?) RETURNING id").get(nextId(database, "facts"), fact.type, fact.statement, fact.status, projectId2, fact.occurred_at, author.type, author.id, fact.model, confirmed?.type ?? null, confirmed?.id ?? null, fact.scope, fact.source, fact.created_at, fact.updated_at);
35501
35556
  if (!row2)
35502
35557
  throw new CliError("configuration_error", "project annotation fact insertion failed");
35503
35558
  mappings[fact.ref] = `fact:${row2.id}`;
@@ -35520,21 +35575,21 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
35520
35575
  return mappings;
35521
35576
  }, "restoreAnnotationRecords");
35522
35577
 
35523
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
35578
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
35524
35579
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
35525
35580
  async preview(request) {
35526
- const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
35527
- return previewAnnotationSnapshot(database, projectId, snapshot2, request.bindings, new SnapshotBudget(request.maxReadBytes ?? 4 * 1024 * 1024));
35581
+ const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
35582
+ return previewAnnotationSnapshot(database, projectId2, snapshot2, request.bindings, new SnapshotBudget(request.maxReadBytes ?? 4 * 1024 * 1024));
35528
35583
  },
35529
35584
  async restore(request) {
35530
- const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request, true);
35585
+ const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request, true);
35531
35586
  const budget = new SnapshotBudget(request.maxReadBytes ?? 4 * 1024 * 1024);
35532
35587
  try {
35533
35588
  return write(database, () => {
35534
- const preview = previewAnnotationSnapshot(database, projectId, snapshot2, request.bindings, budget);
35589
+ const preview = previewAnnotationSnapshot(database, projectId2, snapshot2, request.bindings, budget);
35535
35590
  if (!preview.ready || preview.fingerprint !== request.fingerprint)
35536
35591
  throw new CliError("validation_error", "project annotation preview is stale or has conflicts; preview again");
35537
- const mappings = restoreAnnotationRecords(database, projectId, snapshot2, request.bindings);
35592
+ const mappings = restoreAnnotationRecords(database, projectId2, snapshot2, request.bindings);
35538
35593
  return {
35539
35594
  project: request.project,
35540
35595
  fingerprint: preview.fingerprint,
@@ -35550,7 +35605,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
35550
35605
  }
35551
35606
  }), "projectAnnotationStoreOver");
35552
35607
 
35553
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
35608
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
35554
35609
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
35555
35610
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
35556
35611
  let merged = { from: from2, to };
@@ -35563,7 +35618,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
35563
35618
  }, "markRange");
35564
35619
  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");
35565
35620
 
35566
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
35621
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
35567
35622
  var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
35568
35623
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
35569
35624
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
@@ -35573,7 +35628,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
35573
35628
  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);
35574
35629
  }, "setTaskRulesStop");
35575
35630
 
35576
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sync.js
35631
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sync.js
35577
35632
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
35578
35633
  const { database } = context;
35579
35634
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -35629,7 +35684,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
35629
35684
  };
35630
35685
  }, "syncStoreOver");
35631
35686
 
35632
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/tags.js
35687
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/tags.js
35633
35688
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
35634
35689
  const { database } = context;
35635
35690
  return {
@@ -35651,7 +35706,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
35651
35706
  };
35652
35707
  }, "tagsStoreOver");
35653
35708
 
35654
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
35709
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
35655
35710
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
35656
35711
  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
35657
35712
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -35778,7 +35833,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
35778
35833
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
35779
35834
  }, "savePictureChunks");
35780
35835
 
35781
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
35836
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
35782
35837
  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,
35783
35838
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
35784
35839
  FROM messages m
@@ -35867,7 +35922,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
35867
35922
  return plain2(best(found2));
35868
35923
  }, "nearestMessages");
35869
35924
 
35870
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/vectors.js
35925
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/vectors.js
35871
35926
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
35872
35927
  const { database } = context;
35873
35928
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -36026,12 +36081,12 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
36026
36081
  });
36027
36082
  return cleared;
36028
36083
  }, "clearVectors"),
36029
- nearestConversations: /* @__PURE__ */ __name(async (key2, { chatId, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId, personId, before: before2 }) => {
36084
+ nearestConversations: /* @__PURE__ */ __name(async (key2, { chatId, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, personId, before: before2 }) => {
36030
36085
  const accountPk2 = findAccountPk2(key2);
36031
36086
  if (accountPk2 === void 0)
36032
36087
  return [];
36033
36088
  const chatKey = chatId === void 0 ? void 0 : chatKeyOf(key2, chatId);
36034
- const mailToo = key2.provider === "email" && conversations2 === void 0 && scope3 === void 0 && projectId === void 0 && personId === void 0 && before2 === void 0;
36089
+ const mailToo = key2.provider === "email" && conversations2 === void 0 && scope3 === void 0 && projectId2 === void 0 && personId === void 0 && before2 === void 0;
36035
36090
  const mailHits = /* @__PURE__ */ __name(async () => mailToo ? (await mail().nearest(model, query, {
36036
36091
  accountId: accountPk2,
36037
36092
  limit,
@@ -36054,7 +36109,7 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
36054
36109
  query,
36055
36110
  ...conversations2 === void 0 ? {} : { conversations: conversations2 },
36056
36111
  ...scope3 === void 0 ? {} : { scope: scope3 },
36057
- ...projectId === void 0 ? {} : { projectId: Number(projectId) },
36112
+ ...projectId2 === void 0 ? {} : { projectId: Number(projectId2) },
36058
36113
  ...personId === void 0 ? {} : { personId: Number(personId) },
36059
36114
  ...before2 === void 0 ? {} : { before: Date.parse(before2) }
36060
36115
  });
@@ -36125,7 +36180,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
36125
36180
  embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
36126
36181
  }), "vectorsStoreOver");
36127
36182
 
36128
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
36183
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
36129
36184
  import { existsSync, readFileSync as readFileSync4 } from "node:fs";
36130
36185
  import { dirname as dirname2, join as join2 } from "node:path";
36131
36186
  var BOOKKEEPING = ["schema_migrations", "store_settings"];
@@ -36213,10 +36268,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
36213
36268
  }
36214
36269
  }, "lastBackup");
36215
36270
 
36216
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/providers.js
36271
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/providers.js
36217
36272
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
36218
36273
 
36219
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
36274
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
36220
36275
  var COUNTED_TABLES = [
36221
36276
  "accounts",
36222
36277
  "chats",
@@ -36301,7 +36356,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
36301
36356
  };
36302
36357
  }, "storeContents");
36303
36358
 
36304
- // node_modules/.pnpm/@wirecat+cli-core@0.516.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_25c347a01b8fd53eda94896ae0eba94d/node_modules/@wirecat/cli-core/dist/store/store.js
36359
+ // node_modules/.pnpm/@wirecat+cli-core@0.519.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_3a77a7242330d89656a32c8be893f1d1/node_modules/@wirecat/cli-core/dist/store/store.js
36305
36360
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
36306
36361
  const context = await openStoreContext(options);
36307
36362
  try {