@wirecat/tg-cli 0.105.0 → 0.107.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.
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-WWYRCTPE.js → adapter-PN5AXCJ7.js} +115 -55
- package/dist/bundle/{all-profiles-IJYM6NIJ.js → all-profiles-SDHNKZQQ.js} +5 -5
- package/dist/bundle/{anthropic-EDRWOXB5.js → anthropic-F3BXQLYB.js} +3 -3
- package/dist/bundle/{app-server-2NF7ZH3C.js → app-server-XDKMWVCD.js} +34 -34
- package/dist/bundle/{bot-api-XCDLL6M2.js → bot-api-YXJL4CEV.js} +38 -38
- package/dist/bundle/{bot-history-37WSQX3U.js → bot-history-SDLHR7PV.js} +10 -10
- package/dist/bundle/{bun-ZX34DXTI.js → bun-SMH7PKUS.js} +2 -2
- package/dist/bundle/{bun-sqlite-7TZ73UKO.js → bun-sqlite-KB6PSTWH.js} +2 -2
- package/dist/bundle/{chunk-NBXUNS6Q.js → chunk-3UEFJ75D.js} +1 -1
- package/dist/bundle/{chunk-ETVQH5AL.js → chunk-44UANKAI.js} +11 -9
- package/dist/bundle/{chunk-RI7H2VVU.js → chunk-465FPHSG.js} +7 -7
- package/dist/bundle/{chunk-SJIHZA4K.js → chunk-53QVFV34.js} +1 -1
- package/dist/bundle/{chunk-NEPB2EI6.js → chunk-53RW4KLL.js} +1 -1
- package/dist/bundle/{chunk-VIGQIMGM.js → chunk-5QBTHR57.js} +2 -2
- package/dist/bundle/{chunk-AQGW6OHU.js → chunk-6FSG6QZH.js} +1 -1
- package/dist/bundle/{chunk-HJSWUHHP.js → chunk-A4DS5ANQ.js} +1 -1
- package/dist/bundle/{chunk-MAV5ODPN.js → chunk-AWBJSYX6.js} +1 -1
- package/dist/bundle/{chunk-56JDML7T.js → chunk-BGVODG6P.js} +2 -2
- package/dist/bundle/{chunk-SLFDNASB.js → chunk-BMXGEQDA.js} +4 -4
- package/dist/bundle/{chunk-QPE72FCE.js → chunk-BYDDYOF4.js} +7 -7
- package/dist/bundle/{chunk-XP4JEE47.js → chunk-CJJVFGFX.js} +1 -1
- package/dist/bundle/{chunk-QWPVSWQE.js → chunk-DBZVF73F.js} +2 -2
- package/dist/bundle/{chunk-2A2KXY5G.js → chunk-DFZBGU4G.js} +4 -4
- package/dist/bundle/{chunk-J6B5DQ3I.js → chunk-GGAG3G7B.js} +55 -47
- package/dist/bundle/{chunk-S3C2L3IE.js → chunk-GJS26XEB.js} +4 -4
- package/dist/bundle/{chunk-LOIFBJBA.js → chunk-H4LIQVPN.js} +9 -9
- package/dist/bundle/{chunk-OOBCCVYM.js → chunk-IY7IEM56.js} +4 -4
- package/dist/bundle/{chunk-RDO66SBI.js → chunk-JAWXJILO.js} +2 -2
- package/dist/bundle/{chunk-MHS2LEZA.js → chunk-JZOXKRDG.js} +11 -6
- package/dist/bundle/{chunk-4UZE26T6.js → chunk-KROO42KC.js} +5 -5
- package/dist/bundle/{chunk-QAW5QNOY.js → chunk-LA2OUJK5.js} +9 -8
- package/dist/bundle/{chunk-J5OIB3OW.js → chunk-MOZX3JX3.js} +2 -2
- package/dist/bundle/{chunk-5PDGRPTS.js → chunk-NCWB3KXP.js} +1 -1
- package/dist/bundle/{chunk-N5BGV5YZ.js → chunk-NMTFZNFU.js} +26 -26
- package/dist/bundle/{chunk-73OWDRGK.js → chunk-NSQL3YRD.js} +25 -21
- package/dist/bundle/{chunk-S7FO7OU2.js → chunk-NUVHRCUK.js} +344 -297
- package/dist/bundle/{chunk-YGYQY5AG.js → chunk-O7VQHFMZ.js} +1 -1
- package/dist/bundle/{chunk-2J2G3ELT.js → chunk-OIHAM73W.js} +1 -1
- package/dist/bundle/{chunk-ZI7THBWF.js → chunk-P4A27ETD.js} +46 -46
- package/dist/bundle/{chunk-WD7Q2H4J.js → chunk-P5KMLJQR.js} +2930 -2853
- package/dist/bundle/{chunk-Q6NALH2X.js → chunk-P5UG655O.js} +2 -2
- package/dist/bundle/{recognize-54LQOU24.js → chunk-PYRJO6B3.js} +6 -6
- package/dist/bundle/{chunk-YSIC5B32.js → chunk-REJM262E.js} +10 -10
- package/dist/bundle/{chunk-4VFRP2T2.js → chunk-RGNKRI5T.js} +26 -22
- package/dist/bundle/{chunk-ZIG4WIVN.js → chunk-STGY3EAZ.js} +1 -1
- package/dist/bundle/{chunk-4N53GVUI.js → chunk-TEHAIU6I.js} +56 -46
- package/dist/bundle/{chunk-Z6SXT5DV.js → chunk-TFV4UPQZ.js} +3 -3
- package/dist/bundle/{chunk-ZM2AI3E5.js → chunk-TKCZYJAT.js} +431 -319
- package/dist/bundle/{chunk-QVXMOHHN.js → chunk-VMKPRAIB.js} +4 -4
- package/dist/bundle/{chunk-443D2OY7.js → chunk-WFG7KFM4.js} +1 -1
- package/dist/bundle/{chunk-6MQ3DEXF.js → chunk-WS3S7DXT.js} +18 -1
- package/dist/bundle/{chunk-FNASJIAI.js → chunk-WXIGT6FY.js} +11 -11
- package/dist/bundle/{chunk-L23IJ3IZ.js → chunk-X7M7YZPF.js} +5 -5
- package/dist/bundle/{chunk-PFL3CCP2.js → chunk-YA44IPCS.js} +1 -1
- package/dist/bundle/{chunk-GGIDY5KC.js → chunk-YSDA3EWT.js} +154 -142
- package/dist/bundle/{command-contract-OF6TUQ5B.js → command-contract-B4DA4MXP.js} +12 -12
- package/dist/bundle/decode-WEP3HD56.js +159 -0
- package/dist/bundle/{echarts-WFLEME5I.js → echarts-MRMILSAF.js} +2 -2
- package/dist/bundle/{embed-ESTG27RK.js → embed-LCLTUVUD.js} +3 -3
- package/dist/bundle/{embedder-P3W76VOZ.js → embedder-O4WNEXUC.js} +6 -6
- package/dist/bundle/{entry-SNRZGNRA.js → entry-7HDX6BDR.js} +3 -3
- package/dist/bundle/{first-run-JS24HORG.js → first-run-M7YVVQJS.js} +5 -5
- package/dist/bundle/{first-screen-U63BJPXI.js → first-screen-MXW3UZFB.js} +13 -13
- package/dist/bundle/{identity-TYE57SHY.js → identity-EEMHQOTN.js} +1 -1
- package/dist/bundle/{instructions-ERMZPVS4.js → instructions-YIH3J4TI.js} +1 -1
- package/dist/bundle/{node-KDZSMKIC.js → node-YWT7RFN6.js} +2 -2
- package/dist/bundle/{node-sqlite-FR64YDYV.js → node-sqlite-LVHTONMA.js} +2 -2
- package/dist/bundle/{oauth-SPE76ZIY.js → oauth-CADZB7TT.js} +4 -4
- package/dist/bundle/{open-UEFCMPLC.js → open-AMRU27KK.js} +1 -1
- package/dist/bundle/{process-7MD6MEGB.js → process-JC76J5UD.js} +1 -1
- package/dist/bundle/{program-NFFSOGUY.js → program-FI6MTY2V.js} +40 -40
- package/dist/bundle/{prompt-3PI4H66U.js → prompt-SPYTHKHN.js} +2 -2
- package/dist/bundle/recognize-G5VVM6MU.js +22 -0
- package/dist/bundle/{remote-JQ74NVUK.js → remote-Z3HW42CH.js} +4 -4
- package/dist/bundle/{rerank-66YCEORD.js → rerank-QJ5NLZUU.js} +4 -4
- package/dist/bundle/{serve-5SP2TCGV.js → serve-3I4C6Y5X.js} +6 -6
- package/dist/bundle/{server-GFICDJ6J.js → server-2L4BONHN.js} +26 -26
- package/dist/bundle/server-7TJ337SR.js +55 -0
- package/dist/bundle/{state-U7HXQB6I.js → state-IXZYPH46.js} +3 -3
- package/dist/bundle/{store-O4QVYHFL.js → store-KS4XIA2R.js} +7 -7
- package/dist/bundle/store-maintenance-command-I3L24P22.js +44 -0
- package/dist/bundle/tg.js +2 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +1 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/telegram/adapter.d.ts +7 -0
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +3 -0
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/contacts.d.ts +3 -1
- package/dist/telegram/contacts.d.ts.map +1 -1
- package/dist/telegram/contacts.js +4 -1
- package/dist/telegram/contacts.js.map +1 -1
- package/dist/telegram/map.d.ts.map +1 -1
- package/dist/telegram/map.js +17 -0
- package/dist/telegram/map.js.map +1 -1
- package/dist/telegram/messages.d.ts +7 -0
- package/dist/telegram/messages.d.ts.map +1 -1
- package/dist/telegram/messages.js +5 -0
- package/dist/telegram/messages.js.map +1 -1
- package/dist/telegram/reactors.d.ts +16 -0
- package/dist/telegram/reactors.d.ts.map +1 -0
- package/dist/telegram/reactors.js +58 -0
- package/dist/telegram/reactors.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/skills/tg-cli/SKILL.md +3 -2
- package/dist/bundle/server-KMKRKOZP.js +0 -55
- package/dist/bundle/store-maintenance-command-BNRZ5IJD.js +0 -44
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
validateQuery,
|
|
52
52
|
walkQuery,
|
|
53
53
|
zonedMoment
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-P4A27ETD.js";
|
|
55
55
|
import {
|
|
56
56
|
DEFAULT_STEMMERS,
|
|
57
57
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -64,21 +64,21 @@ import {
|
|
|
64
64
|
fold,
|
|
65
65
|
normalize,
|
|
66
66
|
parseStemmers
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-465FPHSG.js";
|
|
68
68
|
import {
|
|
69
69
|
DEFAULT_TASK_CATEGORIES,
|
|
70
70
|
sharedConfigPath,
|
|
71
71
|
storedTaskCategories,
|
|
72
72
|
taskCategoriesReader
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-IY7IEM56.js";
|
|
74
74
|
import {
|
|
75
75
|
storePath
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-53RW4KLL.js";
|
|
77
77
|
import {
|
|
78
78
|
PRAGMAS,
|
|
79
79
|
quietSqliteWarning,
|
|
80
80
|
storeCapable
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-KROO42KC.js";
|
|
82
82
|
import {
|
|
83
83
|
SQLiteTable,
|
|
84
84
|
TableAliasProxyHandler,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
sql,
|
|
104
104
|
sqliteTable,
|
|
105
105
|
text
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-6FSG6QZH.js";
|
|
107
107
|
import {
|
|
108
108
|
singleLine
|
|
109
109
|
} from "./chunk-T4SDOYPY.js";
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
__name
|
|
133
133
|
} from "./chunk-ZVVMGPBJ.js";
|
|
134
134
|
|
|
135
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
135
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
136
136
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
137
137
|
const methods = whole;
|
|
138
138
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -260,7 +260,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
260
260
|
};
|
|
261
261
|
}, "bindAccount");
|
|
262
262
|
|
|
263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
264
264
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
265
265
|
var PROVIDERS = [
|
|
266
266
|
{ name: "telegram", kind: "messages", aliases: ["tg"] },
|
|
@@ -351,7 +351,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
|
351
351
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
352
352
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
353
353
|
|
|
354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
355
355
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
356
356
|
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");
|
|
357
357
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -374,7 +374,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
374
374
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
375
375
|
}, "sourceOf");
|
|
376
376
|
|
|
377
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
378
378
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
379
379
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
380
380
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -561,7 +561,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
|
|
|
561
561
|
return { accounts: [...chosen.values()], skipped };
|
|
562
562
|
}, "fitting");
|
|
563
563
|
|
|
564
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
564
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
565
565
|
var IndexBuilderOn = class {
|
|
566
566
|
static {
|
|
567
567
|
__name(this, "IndexBuilderOn");
|
|
@@ -756,7 +756,7 @@ function alias(table, alias2) {
|
|
|
756
756
|
}
|
|
757
757
|
__name(alias, "alias");
|
|
758
758
|
|
|
759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
759
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
760
760
|
var ENTITY_TABLES = {
|
|
761
761
|
account: "accounts",
|
|
762
762
|
attachment: "attachments",
|
|
@@ -796,7 +796,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
796
796
|
return { table, pointer, type, count, known: known2 };
|
|
797
797
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
798
798
|
|
|
799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
800
800
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
801
801
|
id: integer("id").primaryKey(),
|
|
802
802
|
name: text("name").notNull().unique(),
|
|
@@ -805,7 +805,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
805
805
|
updatedAt: integer("updated_at").notNull()
|
|
806
806
|
});
|
|
807
807
|
|
|
808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
809
809
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
810
810
|
sourceKey: text("source_key").notNull(),
|
|
811
811
|
collection: text("collection").notNull(),
|
|
@@ -815,13 +815,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
815
815
|
createdAt: integer("created_at").notNull()
|
|
816
816
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
817
817
|
|
|
818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
819
819
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
820
820
|
id: integer("id").notNull(),
|
|
821
821
|
indexableType: text("indexable_type").notNull()
|
|
822
822
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
823
823
|
|
|
824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
824
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
825
825
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
826
826
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
827
827
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -847,7 +847,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
847
847
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
848
848
|
]);
|
|
849
849
|
|
|
850
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
851
851
|
var accounts = sqliteTable("accounts", {
|
|
852
852
|
id: integer("id").primaryKey(),
|
|
853
853
|
provider: text("provider").notNull(),
|
|
@@ -929,10 +929,13 @@ var identities = sqliteTable("identities", {
|
|
|
929
929
|
createdAt: integer("created_at").notNull(),
|
|
930
930
|
updatedAt: integer("updated_at").notNull(),
|
|
931
931
|
description: text("description"),
|
|
932
|
-
email: text("email")
|
|
932
|
+
email: text("email"),
|
|
933
|
+
phone: text("phone"),
|
|
934
|
+
nameFolded: text("name_folded")
|
|
933
935
|
}, (table) => [
|
|
934
936
|
unique().on(table.provider, table.externalId),
|
|
935
|
-
index("identities_by_email").on(table.email).where(sql`email IS NOT NULL`)
|
|
937
|
+
index("identities_by_email").on(table.email).where(sql`email IS NOT NULL`),
|
|
938
|
+
index("identities_name_to_fold").on(table.id).where(sql`name IS NOT NULL AND name_folded IS NULL`)
|
|
936
939
|
]);
|
|
937
940
|
var identityLinks = sqliteTable("identity_links", {
|
|
938
941
|
identityId: integer("identity_id").primaryKey().references(() => identities.id),
|
|
@@ -1073,10 +1076,12 @@ var chats = sqliteTable("chats", {
|
|
|
1073
1076
|
mutedUntil: integer("muted_until"),
|
|
1074
1077
|
archived: integer("archived"),
|
|
1075
1078
|
markedUnread: integer("marked_unread"),
|
|
1076
|
-
unreadCountedAt: integer("unread_counted_at")
|
|
1079
|
+
unreadCountedAt: integer("unread_counted_at"),
|
|
1080
|
+
titleFolded: text("title_folded")
|
|
1077
1081
|
}, (table) => [
|
|
1078
1082
|
unique().on(table.accountId, table.externalId),
|
|
1079
1083
|
index("chats_by_recency").on(table.accountId, desc(table.lastMessageAt)),
|
|
1084
|
+
index("chats_title_to_fold").on(table.id).where(sql`title IS NOT NULL AND title_folded IS NULL`),
|
|
1080
1085
|
index("chats_by_parent_chat_id").on(table.parentChatId)
|
|
1081
1086
|
]);
|
|
1082
1087
|
var chatMembers = sqliteTable("chat_members", {
|
|
@@ -1307,8 +1312,12 @@ var emailThreads = sqliteTable("email_threads", {
|
|
|
1307
1312
|
metadata: text("metadata"),
|
|
1308
1313
|
createdAt: integer("created_at").notNull(),
|
|
1309
1314
|
updatedAt: integer("updated_at").notNull(),
|
|
1310
|
-
deletedAt: integer("deleted_at")
|
|
1311
|
-
|
|
1315
|
+
deletedAt: integer("deleted_at"),
|
|
1316
|
+
subjectFolded: text("subject_folded")
|
|
1317
|
+
}, (table) => [
|
|
1318
|
+
unique().on(table.accountId, table.externalId),
|
|
1319
|
+
index("email_threads_subject_to_fold").on(table.id).where(sql`subject IS NOT NULL AND subject_folded IS NULL`)
|
|
1320
|
+
]);
|
|
1312
1321
|
var emails = sqliteTable("emails", {
|
|
1313
1322
|
id: integer("id").primaryKey(),
|
|
1314
1323
|
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
@@ -1377,8 +1386,13 @@ var mailboxes = sqliteTable("mailboxes", {
|
|
|
1377
1386
|
name: text("name").notNull(),
|
|
1378
1387
|
kind: text("kind"),
|
|
1379
1388
|
createdAt: integer("created_at").notNull(),
|
|
1380
|
-
updatedAt: integer("updated_at").notNull()
|
|
1381
|
-
|
|
1389
|
+
updatedAt: integer("updated_at").notNull(),
|
|
1390
|
+
nameFolded: text("name_folded")
|
|
1391
|
+
}, (table) => [
|
|
1392
|
+
unique().on(table.accountId, table.externalId),
|
|
1393
|
+
index("mailboxes_by_name_folded").on(table.nameFolded),
|
|
1394
|
+
index("mailboxes_name_to_fold").on(table.id).where(sql`name_folded IS NULL`)
|
|
1395
|
+
]);
|
|
1382
1396
|
var emailMailboxes = sqliteTable("email_mailboxes", {
|
|
1383
1397
|
emailId: integer("email_id").notNull().references(() => emails.id),
|
|
1384
1398
|
mailboxId: integer("mailbox_id").notNull().references(() => mailboxes.id),
|
|
@@ -1418,7 +1432,8 @@ var attachments = sqliteTable("attachments", {
|
|
|
1418
1432
|
updatedAt: integer("updated_at").notNull(),
|
|
1419
1433
|
/** `fold(name)`, `fold(local_path)`: SQLite's lower() folds ASCII only, so filters compare these. */
|
|
1420
1434
|
nameFolded: text("name_folded"),
|
|
1421
|
-
localPathFolded: text("local_path_folded")
|
|
1435
|
+
localPathFolded: text("local_path_folded"),
|
|
1436
|
+
contact: text("contact")
|
|
1422
1437
|
}, (table) => [
|
|
1423
1438
|
unique().on(table.attachableType, table.attachableId, table.position),
|
|
1424
1439
|
index("attachments_by_name_folded").on(table.nameFolded),
|
|
@@ -1844,8 +1859,11 @@ var projects = sqliteTable("projects", {
|
|
|
1844
1859
|
status: text("status"),
|
|
1845
1860
|
createdAt: integer("created_at").notNull(),
|
|
1846
1861
|
updatedAt: integer("updated_at").notNull(),
|
|
1847
|
-
deletedAt: integer("deleted_at")
|
|
1862
|
+
deletedAt: integer("deleted_at"),
|
|
1863
|
+
nameFolded: text("name_folded")
|
|
1848
1864
|
}, (table) => [
|
|
1865
|
+
index("projects_by_name_folded").on(table.nameFolded),
|
|
1866
|
+
index("projects_name_to_fold").on(table.id).where(sql`name_folded IS NULL`),
|
|
1849
1867
|
index("projects_by_organization_id").on(table.organizationId),
|
|
1850
1868
|
index("projects_by_account_id").on(table.accountId),
|
|
1851
1869
|
index("projects_by_owner_type_owner_id").on(table.ownerType, table.ownerId)
|
|
@@ -2316,7 +2334,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2316
2334
|
at: integer("at").notNull()
|
|
2317
2335
|
});
|
|
2318
2336
|
|
|
2319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2320
2338
|
var ARMS = [
|
|
2321
2339
|
[
|
|
2322
2340
|
"message",
|
|
@@ -2443,7 +2461,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2443
2461
|
return recomputed;
|
|
2444
2462
|
}, "drainInvolvementQueue");
|
|
2445
2463
|
|
|
2446
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2464
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2447
2465
|
import { domainToUnicode } from "node:url";
|
|
2448
2466
|
|
|
2449
2467
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12465,7 +12483,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12465
12483
|
}, "oa");
|
|
12466
12484
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12467
12485
|
|
|
12468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12469
12487
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12470
12488
|
var ID = /^[\w-]{10,}$/;
|
|
12471
12489
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12506,7 +12524,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12506
12524
|
return { url, documentId: googleDocumentId(url) };
|
|
12507
12525
|
}), "googleDocumentLinks");
|
|
12508
12526
|
|
|
12509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12527
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12510
12528
|
var PHONE_PLANS = [
|
|
12511
12529
|
{
|
|
12512
12530
|
country: "us",
|
|
@@ -12886,7 +12904,7 @@ var PHONE_PLANS = [
|
|
|
12886
12904
|
}
|
|
12887
12905
|
];
|
|
12888
12906
|
|
|
12889
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
12890
12908
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12891
12909
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12892
12910
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12927,7 +12945,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12927
12945
|
return void 0;
|
|
12928
12946
|
}, "nationalPhone");
|
|
12929
12947
|
|
|
12930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
12931
12949
|
var BEFORE = [
|
|
12932
12950
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12933
12951
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13187,7 +13205,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13187
13205
|
return found2.sort((a, b) => a.start - b.start);
|
|
13188
13206
|
}, "findPlaces");
|
|
13189
13207
|
|
|
13190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13208
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13191
13209
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13192
13210
|
var MENTION_VERSIONS = {
|
|
13193
13211
|
phone: 1,
|
|
@@ -13377,7 +13395,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13377
13395
|
};
|
|
13378
13396
|
}, "typedPhone");
|
|
13379
13397
|
|
|
13380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13381
13399
|
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";
|
|
13382
13400
|
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";
|
|
13383
13401
|
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";
|
|
@@ -13385,7 +13403,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13385
13403
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13386
13404
|
var NAME_WORDS = WORDS.split(" ");
|
|
13387
13405
|
|
|
13388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13389
13407
|
var LATIN_TO_CYRILLIC = {
|
|
13390
13408
|
shch: "\u0449",
|
|
13391
13409
|
sch: "\u0449",
|
|
@@ -13593,7 +13611,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13593
13611
|
return found2;
|
|
13594
13612
|
}, "findUnknownNames");
|
|
13595
13613
|
|
|
13596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13597
13615
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13598
13616
|
"webpage",
|
|
13599
13617
|
"share",
|
|
@@ -13625,7 +13643,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13625
13643
|
});
|
|
13626
13644
|
}, "matchDownloads");
|
|
13627
13645
|
|
|
13628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13646
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
13629
13647
|
var QUERY_VERSION = 1;
|
|
13630
13648
|
var QUERY_LIMITS2 = {
|
|
13631
13649
|
...QUERY_LIMITS,
|
|
@@ -13656,7 +13674,7 @@ function exhausted(budget) {
|
|
|
13656
13674
|
}
|
|
13657
13675
|
__name(exhausted, "exhausted");
|
|
13658
13676
|
|
|
13659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
13660
13678
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13661
13679
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13662
13680
|
kind: "char",
|
|
@@ -14056,7 +14074,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14056
14074
|
return out;
|
|
14057
14075
|
}, "foldRegex");
|
|
14058
14076
|
|
|
14059
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14077
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14060
14078
|
var PRESET_VERSION = 1;
|
|
14061
14079
|
var PRESETS = {
|
|
14062
14080
|
password: {
|
|
@@ -14110,7 +14128,7 @@ var PRESETS = {
|
|
|
14110
14128
|
}
|
|
14111
14129
|
};
|
|
14112
14130
|
|
|
14113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14114
14132
|
var FIELD_VERSION = 2;
|
|
14115
14133
|
var UNITS = {
|
|
14116
14134
|
"": 1,
|
|
@@ -14220,7 +14238,7 @@ var QUERY_FIELDS = [
|
|
|
14220
14238
|
aliases: [],
|
|
14221
14239
|
type: "kw",
|
|
14222
14240
|
operators: terms,
|
|
14223
|
-
normalization: "a folder or label by its id or name
|
|
14241
|
+
normalization: "a folder or label by its id (ASCII case folded) or name (case folded in any script); mail only",
|
|
14224
14242
|
support: "A1"
|
|
14225
14243
|
},
|
|
14226
14244
|
{
|
|
@@ -14559,12 +14577,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
14559
14577
|
return validateFields(parsed2.output);
|
|
14560
14578
|
}, "validateAst");
|
|
14561
14579
|
|
|
14562
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14563
14581
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14564
14582
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14565
14583
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14566
14584
|
|
|
14567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14568
14586
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14569
14587
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14570
14588
|
var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
@@ -14588,7 +14606,7 @@ var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
|
14588
14606
|
};
|
|
14589
14607
|
}, "linkMatch");
|
|
14590
14608
|
|
|
14591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14592
14610
|
var SETTING = "phoneCountries";
|
|
14593
14611
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14594
14612
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14619,7 +14637,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14619
14637
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14620
14638
|
}, "valueMatch");
|
|
14621
14639
|
|
|
14622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
14623
14641
|
var SCHEME = "msg:";
|
|
14624
14642
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
14625
14643
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -14633,7 +14651,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
14633
14651
|
return { provider, account, chat: chat2, message: message2 };
|
|
14634
14652
|
}, "parseLocator");
|
|
14635
14653
|
|
|
14636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
14637
14655
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14638
14656
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14639
14657
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14661,7 +14679,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14661
14679
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14662
14680
|
}, "vocabularySimilarity");
|
|
14663
14681
|
|
|
14664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
14665
14683
|
import { createHash } from "node:crypto";
|
|
14666
14684
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14667
14685
|
try {
|
|
@@ -14727,7 +14745,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14727
14745
|
});
|
|
14728
14746
|
}, "guardTagCreation");
|
|
14729
14747
|
|
|
14730
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
14731
14749
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
14732
14750
|
throw new CliError("validation_error", message2);
|
|
14733
14751
|
}, "invalid");
|
|
@@ -14804,7 +14822,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14804
14822
|
};
|
|
14805
14823
|
}, "createTagRedirectIndex");
|
|
14806
14824
|
|
|
14807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
14808
14826
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14809
14827
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14810
14828
|
if (!row2)
|
|
@@ -14832,7 +14850,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14832
14850
|
return snapshot2;
|
|
14833
14851
|
}, "tagRedirectSnapshot");
|
|
14834
14852
|
|
|
14835
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
14836
14854
|
import { createHash as createHash2 } from "node:crypto";
|
|
14837
14855
|
var TASK_KEY_PREFIXES = {
|
|
14838
14856
|
question: "Q",
|
|
@@ -14860,7 +14878,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14860
14878
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14861
14879
|
}, "taskAccountOf");
|
|
14862
14880
|
|
|
14863
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
14864
14882
|
var SIMPLE_REFERENCES = [
|
|
14865
14883
|
"note",
|
|
14866
14884
|
"document",
|
|
@@ -14932,7 +14950,7 @@ var folderPath = /* @__PURE__ */ __name((path) => {
|
|
|
14932
14950
|
}, "folderPath");
|
|
14933
14951
|
var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
|
|
14934
14952
|
|
|
14935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
14936
14954
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14937
14955
|
var REFERABLE = {
|
|
14938
14956
|
note: { tombstone: true },
|
|
@@ -15090,7 +15108,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15090
15108
|
}, "taskIdOf");
|
|
15091
15109
|
var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
|
|
15092
15110
|
|
|
15093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15094
15112
|
var toMs = /* @__PURE__ */ __name((iso10) => {
|
|
15095
15113
|
if (iso10 === null || iso10 === void 0)
|
|
15096
15114
|
return null;
|
|
@@ -15104,7 +15122,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15104
15122
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15105
15123
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15106
15124
|
|
|
15107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15108
15126
|
var TAG_KINDS = ["tag", "topic"];
|
|
15109
15127
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15110
15128
|
var TAG_TYPE = {
|
|
@@ -15241,32 +15259,32 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15241
15259
|
const parts2 = [
|
|
15242
15260
|
{
|
|
15243
15261
|
type: "chat",
|
|
15244
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, c.external_id AS chat_id, c.title AS chat_title, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN chats c ON c.id=g.taggable_id JOIN accounts a ON a.id=c.account_id WHERE g.taggable_type='chat' AND a.provider=? AND a.external_id=?",
|
|
15262
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, c.external_id AS chat_id, c.title AS chat_title, c.title_folded AS name_folded, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN chats c ON c.id=g.taggable_id JOIN accounts a ON a.id=c.account_id WHERE g.taggable_type='chat' AND a.provider=? AND a.external_id=?",
|
|
15245
15263
|
params: [key2.provider, key2.account]
|
|
15246
15264
|
},
|
|
15247
15265
|
{
|
|
15248
15266
|
type: "contact",
|
|
15249
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, NULL AS chat_id, NULL AS chat_title, i.external_id AS person_id, i.name AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN identities i ON i.id=g.taggable_id WHERE g.taggable_type='identity' AND i.provider=?",
|
|
15267
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, NULL AS chat_id, NULL AS chat_title, i.name_folded AS name_folded, i.external_id AS person_id, i.name AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN identities i ON i.id=g.taggable_id WHERE g.taggable_type='identity' AND i.provider=?",
|
|
15250
15268
|
params: [key2.provider]
|
|
15251
15269
|
},
|
|
15252
15270
|
{
|
|
15253
15271
|
type: "message",
|
|
15254
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, c.external_id AS chat_id, c.title AS chat_title, NULL AS person_id, NULL AS name, m.external_id AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN messages m ON m.id=g.taggable_id JOIN chats c ON c.id=m.chat_id JOIN accounts a ON a.id=c.account_id WHERE g.taggable_type='message' AND a.provider=? AND a.external_id=?",
|
|
15272
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, c.external_id AS chat_id, c.title AS chat_title, c.title_folded AS name_folded, NULL AS person_id, NULL AS name, m.external_id AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN messages m ON m.id=g.taggable_id JOIN chats c ON c.id=m.chat_id JOIN accounts a ON a.id=c.account_id WHERE g.taggable_type='message' AND a.provider=? AND a.external_id=?",
|
|
15255
15273
|
params: [key2.provider, key2.account]
|
|
15256
15274
|
},
|
|
15257
15275
|
{
|
|
15258
15276
|
type: "chat",
|
|
15259
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, th.external_id AS chat_id, th.subject AS chat_title, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN email_threads th ON th.id=g.taggable_id JOIN accounts a ON a.id=th.account_id WHERE g.taggable_type='email_thread' AND a.provider=? AND a.external_id=?",
|
|
15277
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, th.external_id AS chat_id, th.subject AS chat_title, th.subject_folded AS name_folded, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN email_threads th ON th.id=g.taggable_id JOIN accounts a ON a.id=th.account_id WHERE g.taggable_type='email_thread' AND a.provider=? AND a.external_id=?",
|
|
15260
15278
|
params: [key2.provider, key2.account]
|
|
15261
15279
|
},
|
|
15262
15280
|
{
|
|
15263
15281
|
type: "message",
|
|
15264
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, th.external_id AS chat_id, th.subject AS chat_title, NULL AS person_id, NULL AS name, e.external_id AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN emails e ON e.id=g.taggable_id JOIN email_threads th ON th.id=e.email_thread_id JOIN accounts a ON a.id=e.account_id WHERE g.taggable_type='email' AND e.deleted_at IS NULL AND a.provider=? AND a.external_id=?",
|
|
15282
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, th.external_id AS chat_id, th.subject AS chat_title, th.subject_folded AS name_folded, NULL AS person_id, NULL AS name, e.external_id AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, NULL AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN emails e ON e.id=g.taggable_id JOIN email_threads th ON th.id=e.email_thread_id JOIN accounts a ON a.id=e.account_id WHERE g.taggable_type='email' AND e.deleted_at IS NULL AND a.provider=? AND a.external_id=?",
|
|
15265
15283
|
params: [key2.provider, key2.account]
|
|
15266
15284
|
},
|
|
15267
15285
|
{
|
|
15268
15286
|
type: "task",
|
|
15269
|
-
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, NULL AS chat_id, k.title AS chat_title, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, COALESCE(k.package_id, k.key) AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN tasks k ON k.id=g.taggable_id JOIN projects p ON p.id=k.project_id WHERE g.taggable_type='task' AND k.deleted_at IS NULL AND p.key=?",
|
|
15287
|
+
sql: "SELECT t.name AS tag, g.taggable_type AS type, g.created_at, NULL AS chat_id, k.title AS chat_title, k.title_folded AS name_folded, NULL AS person_id, NULL AS name, NULL AS message_id, g.source, g.taggable_id AS target_id, t.canonical_id AS tag_id, COALESCE(k.package_id, k.key) AS task_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id JOIN tasks k ON k.id=g.taggable_id JOIN projects p ON p.id=k.project_id WHERE g.taggable_type='task' AND k.deleted_at IS NULL AND p.key=?",
|
|
15270
15288
|
params: [inboxKey(`${key2.provider}:${key2.account}`)]
|
|
15271
15289
|
}
|
|
15272
15290
|
];
|
|
@@ -15276,7 +15294,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15276
15294
|
...filter.where ? [filter.where] : [],
|
|
15277
15295
|
...filter.source === void 0 ? [] : [{ sql: filter.source === "auto" ? "x.auto = 1" : "(x.auto = 0 OR x.source = 'owner')", params: [] }]
|
|
15278
15296
|
];
|
|
15279
|
-
const rows = database.prepare(`SELECT * FROM (SELECT tag,type,min(created_at) AS created_at,chat_id,chat_title,person_id,name,message_id,CASE WHEN max(source='owner') THEN 'owner' ELSE min(source) END AS source,target_id,tag_id,task_id,tag_type,max(auto) AS auto FROM (SELECT u.*, CASE u.type WHEN 'identity' THEN 'contact' WHEN 'email_thread' THEN 'chat' WHEN 'email' THEN 'message' ELSE u.type END AS tag_type, (u.type = 'chat' AND EXISTS (SELECT 1 FROM canonical_auto_tag_claims ac JOIN resolved_tags rt ON rt.id=ac.tag_id WHERE ac.chat_id = u.target_id AND rt.canonical_id = u.tag_id)) AS auto FROM (${union}) u) GROUP BY tag,type,target_id) x WHERE ${where.length === 0 ? "1" : where.map(({ sql: sql2 }) => `(${sql2})`).join(" AND ")} ORDER BY x.tag, x.type, x.created_at, x.chat_id, x.person_id, x.message_id` + (filter.window ? " LIMIT ? OFFSET ?" : "")).all(...chosen.flatMap(({ params }) => selectedTag === void 0 ? params : [...params, selectedTag]), ...where.flatMap(({ params }) => params), ...filter.window ? [filter.window.limit, filter.window.offset] : []);
|
|
15297
|
+
const rows = database.prepare(`SELECT * FROM (SELECT tag,type,min(created_at) AS created_at,chat_id,chat_title,person_id,name,name_folded,message_id,CASE WHEN max(source='owner') THEN 'owner' ELSE min(source) END AS source,target_id,tag_id,task_id,tag_type,max(auto) AS auto FROM (SELECT u.*, CASE u.type WHEN 'identity' THEN 'contact' WHEN 'email_thread' THEN 'chat' WHEN 'email' THEN 'message' ELSE u.type END AS tag_type, (u.type = 'chat' AND EXISTS (SELECT 1 FROM canonical_auto_tag_claims ac JOIN resolved_tags rt ON rt.id=ac.tag_id WHERE ac.chat_id = u.target_id AND rt.canonical_id = u.tag_id)) AS auto FROM (${union}) u) GROUP BY tag,type,target_id) x WHERE ${where.length === 0 ? "1" : where.map(({ sql: sql2 }) => `(${sql2})`).join(" AND ")} ORDER BY x.tag, x.type, x.created_at, x.chat_id, x.person_id, x.message_id` + (filter.window ? " LIMIT ? OFFSET ?" : "")).all(...chosen.flatMap(({ params }) => selectedTag === void 0 ? params : [...params, selectedTag]), ...where.flatMap(({ params }) => params), ...filter.window ? [filter.window.limit, filter.window.offset] : []);
|
|
15280
15298
|
const result = rows.map((row2) => {
|
|
15281
15299
|
const type = TAG_TYPE[String(row2.type)];
|
|
15282
15300
|
const chatId = row2.chat_id == null ? void 0 : String(row2.chat_id);
|
|
@@ -15295,9 +15313,11 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15295
15313
|
return result;
|
|
15296
15314
|
}, "tagsOf");
|
|
15297
15315
|
|
|
15298
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15299
15317
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15300
15318
|
var SPEECH = speech("att");
|
|
15319
|
+
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");
|
|
15320
|
+
var mentionField = /* @__PURE__ */ __name((alias2) => `CASE WHEN coalesce(json_extract(${alias2}.contact, '$.phone'), '') <> '' THEN 'contact' WHEN ${speech(alias2)} THEN 'transcript' ELSE 'file_text' END`, "mentionField");
|
|
15301
15321
|
var quoted = /* @__PURE__ */ __name((value) => `"${value.replaceAll('"', '""')}"`, "quoted");
|
|
15302
15322
|
var ftsMatch = /* @__PURE__ */ __name((node) => {
|
|
15303
15323
|
const text5 = normalize(node.value);
|
|
@@ -15588,9 +15608,9 @@ var mailbox = /* @__PURE__ */ __name(({ value }, { mail }) => always(mail ? boun
|
|
|
15588
15608
|
// Not tied to m.account_id: a correlated subquery re-reads every mailbox link for each email (minutes on
|
|
15589
15609
|
// 880k links), and an email only ever links to its own account's mailboxes anyway.
|
|
15590
15610
|
`m.id IN (SELECT em.email_id FROM email_mailboxes em WHERE em.mailbox_id IN
|
|
15591
|
-
(SELECT b.id FROM mailboxes b WHERE lower(b.external_id) = lower(?) OR
|
|
15611
|
+
(SELECT b.id FROM mailboxes b WHERE lower(b.external_id) = lower(?) OR b.name_folded = ?))`,
|
|
15592
15612
|
value,
|
|
15593
|
-
value
|
|
15613
|
+
fold(value)
|
|
15594
15614
|
) : bound("0")), "mailbox");
|
|
15595
15615
|
var is2 = /* @__PURE__ */ __name(({ value }, { mail }) => {
|
|
15596
15616
|
const state = value.toLowerCase();
|
|
@@ -15648,7 +15668,7 @@ var FIELD_COMPILERS = {
|
|
|
15648
15668
|
subject
|
|
15649
15669
|
};
|
|
15650
15670
|
|
|
15651
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15652
15672
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15653
15673
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15654
15674
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15664,7 +15684,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15664
15684
|
};
|
|
15665
15685
|
}, "placeOf");
|
|
15666
15686
|
|
|
15667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
15668
15688
|
var DRAIN_ON_WRITE = 500;
|
|
15669
15689
|
var METHOD = "rules";
|
|
15670
15690
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15724,9 +15744,9 @@ var SOURCES = {
|
|
|
15724
15744
|
one: "SELECT text, 'text' AS field, chat_id FROM messages WHERE id = ? AND deleted_at IS NULL"
|
|
15725
15745
|
},
|
|
15726
15746
|
attachment: {
|
|
15727
|
-
count:
|
|
15728
|
-
page: `SELECT a.id, a
|
|
15729
|
-
one: `SELECT a
|
|
15747
|
+
count: `SELECT count(*) AS n FROM attachments a JOIN messages m ON m.id = a.attachable_id WHERE a.attachable_type = 'message' AND coalesce(${mentionText("a")}, '') <> '' AND m.deleted_at IS NULL`,
|
|
15748
|
+
page: `SELECT a.id, ${mentionText("a")} AS text, ${mentionField("a")} AS field, m.chat_id FROM attachments a JOIN messages m ON m.id = a.attachable_id WHERE a.id > ? AND a.attachable_type = 'message' AND coalesce(${mentionText("a")}, '') <> '' AND m.deleted_at IS NULL ORDER BY a.id LIMIT ?`,
|
|
15749
|
+
one: `SELECT ${mentionText("a")} AS text, ${mentionField("a")} AS field, m.chat_id FROM attachments a JOIN messages m ON m.id = a.attachable_id WHERE a.id = ? AND a.attachable_type = 'message' AND ${mentionText("a")} IS NOT NULL AND m.deleted_at IS NULL`
|
|
15730
15750
|
},
|
|
15731
15751
|
// Texts outside a chat: no one wrote them in a chat, so a name in them is never linked by rule.
|
|
15732
15752
|
document: {
|
|
@@ -15827,7 +15847,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15827
15847
|
return queued.length;
|
|
15828
15848
|
}, "drainMentions");
|
|
15829
15849
|
|
|
15830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
15831
15851
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15832
15852
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15833
15853
|
if (!exists2)
|
|
@@ -15835,7 +15855,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15835
15855
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15836
15856
|
}, "indexRow");
|
|
15837
15857
|
|
|
15838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
15839
15859
|
var INDEX = "message_stems";
|
|
15840
15860
|
var SETTING2 = "searchStemmers";
|
|
15841
15861
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15957,7 +15977,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15957
15977
|
};
|
|
15958
15978
|
}, "stemmerCache");
|
|
15959
15979
|
|
|
15960
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
15961
15981
|
var connections = /* @__PURE__ */ new WeakMap();
|
|
15962
15982
|
var connectionOf = /* @__PURE__ */ __name((database) => {
|
|
15963
15983
|
let connection = connections.get(database);
|
|
@@ -16016,7 +16036,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
16016
16036
|
}
|
|
16017
16037
|
}, "read");
|
|
16018
16038
|
|
|
16019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
16020
16040
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16021
16041
|
coalesce(CASE k.chunkable_type
|
|
16022
16042
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16158,7 +16178,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16158
16178
|
}, "dropUnusedVectors");
|
|
16159
16179
|
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");
|
|
16160
16180
|
|
|
16161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16162
16182
|
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({
|
|
16163
16183
|
target: [accounts.provider, accounts.externalId],
|
|
16164
16184
|
set: {
|
|
@@ -16263,7 +16283,44 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16263
16283
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16264
16284
|
}, "dropOrphanPeople");
|
|
16265
16285
|
|
|
16266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16287
|
+
var FOLDED = [
|
|
16288
|
+
{ table: "tasks", column: "title" },
|
|
16289
|
+
{ table: "tasks", column: "close_reason" },
|
|
16290
|
+
{ table: "attachments", column: "name" },
|
|
16291
|
+
{ table: "attachments", column: "local_path" },
|
|
16292
|
+
{ table: "meetings", column: "title" },
|
|
16293
|
+
{ table: "files", column: "path" },
|
|
16294
|
+
{ table: "projects", column: "name" },
|
|
16295
|
+
{ table: "chats", column: "title" },
|
|
16296
|
+
{ table: "identities", column: "name" },
|
|
16297
|
+
{ table: "email_threads", column: "subject" },
|
|
16298
|
+
{ table: "mailboxes", column: "name" }
|
|
16299
|
+
];
|
|
16300
|
+
var folded3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : fold(value), "folded");
|
|
16301
|
+
var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
16302
|
+
let filled2 = 0;
|
|
16303
|
+
for (const { table, column: column2 } of FOLDED) {
|
|
16304
|
+
const pending = database.prepare(`SELECT id, ${column2} AS value FROM ${table} WHERE ${column2} IS NOT NULL AND ${column2}_folded IS NULL LIMIT ?`);
|
|
16305
|
+
if (pending.get(1) === void 0)
|
|
16306
|
+
continue;
|
|
16307
|
+
const fill = database.prepare(`UPDATE ${table} SET ${column2}_folded = ? WHERE id = ?`);
|
|
16308
|
+
for (; ; ) {
|
|
16309
|
+
const count = writeBatch(database, () => {
|
|
16310
|
+
const rows = pending.all(batch);
|
|
16311
|
+
for (const row2 of rows)
|
|
16312
|
+
fill.run(fold(String(row2.value)), Number(row2.id));
|
|
16313
|
+
return rows.length;
|
|
16314
|
+
});
|
|
16315
|
+
filled2 += count;
|
|
16316
|
+
if (count < batch)
|
|
16317
|
+
break;
|
|
16318
|
+
}
|
|
16319
|
+
}
|
|
16320
|
+
return filled2;
|
|
16321
|
+
}, "fillFolded");
|
|
16322
|
+
|
|
16323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
16267
16324
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
16268
16325
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
16269
16326
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -16282,7 +16339,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
16282
16339
|
}
|
|
16283
16340
|
}, "resolvePersonLinks");
|
|
16284
16341
|
|
|
16285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
16286
16343
|
var flag = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
16287
16344
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
16288
16345
|
find: orm.select({
|
|
@@ -16291,6 +16348,7 @@ var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
|
16291
16348
|
username: identities.username,
|
|
16292
16349
|
isBot: identities.bot,
|
|
16293
16350
|
description: identities.description,
|
|
16351
|
+
phone: identities.phone,
|
|
16294
16352
|
updatedAt: identities.updatedAt,
|
|
16295
16353
|
personId: identityLinks.personId
|
|
16296
16354
|
}).from(identities).leftJoin(identityLinks, eq(identityLinks.identityId, identities.id)).where(and(eq(identities.provider, sql.placeholder("provider")), eq(identities.externalId, sql.placeholder("externalId")))).prepare(),
|
|
@@ -16363,10 +16421,11 @@ var saveIdentity = /* @__PURE__ */ __name(({ orm, now: now2, database }, provide
|
|
|
16363
16421
|
name: name ?? found2.name,
|
|
16364
16422
|
username: facts2.username ?? found2.username,
|
|
16365
16423
|
bot: flag(facts2.isBot) ?? found2.isBot,
|
|
16366
|
-
description: facts2.description ?? found2.description
|
|
16424
|
+
description: facts2.description ?? found2.description,
|
|
16425
|
+
phone: facts2.phone ?? found2.phone
|
|
16367
16426
|
};
|
|
16368
|
-
if (changed.name !== found2.name || changed.username !== found2.username || changed.bot !== found2.isBot || changed.description !== found2.description) {
|
|
16369
|
-
orm.update(identities).set({ ...changed, updatedAt: now2() }).where(eq(identities.id, found2.pk)).run();
|
|
16427
|
+
if (changed.name !== found2.name || changed.username !== found2.username || changed.bot !== found2.isBot || changed.description !== found2.description || changed.phone !== found2.phone) {
|
|
16428
|
+
orm.update(identities).set({ ...changed, nameFolded: folded3(changed.name), updatedAt: now2() }).where(eq(identities.id, found2.pk)).run();
|
|
16370
16429
|
}
|
|
16371
16430
|
const renamed = changed.name !== found2.name || changed.username !== found2.username;
|
|
16372
16431
|
if (renamed && resolveLinks)
|
|
@@ -16382,10 +16441,12 @@ var saveIdentity = /* @__PURE__ */ __name(({ orm, now: now2, database }, provide
|
|
|
16382
16441
|
provider,
|
|
16383
16442
|
externalId: nativeId,
|
|
16384
16443
|
name,
|
|
16444
|
+
nameFolded: folded3(name),
|
|
16385
16445
|
metadata: facts2.metadata == null ? null : JSON.stringify(facts2.metadata),
|
|
16386
16446
|
username: facts2.username ?? null,
|
|
16387
16447
|
bot: flag(facts2.isBot),
|
|
16388
16448
|
description: facts2.description ?? null,
|
|
16449
|
+
phone: facts2.phone ?? null,
|
|
16389
16450
|
createdAt: at,
|
|
16390
16451
|
updatedAt: at
|
|
16391
16452
|
}).returning({ pk: identities.id }).get()?.pk);
|
|
@@ -16500,8 +16561,9 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
16500
16561
|
statementsOf(context.orm).seen.run({ accountId, identityId: saved.pk, createdAt: context.now() });
|
|
16501
16562
|
return saved.pk;
|
|
16502
16563
|
}, "meetingIdentityPk");
|
|
16564
|
+
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");
|
|
16503
16565
|
|
|
16504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
16505
16567
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
16506
16568
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
16507
16569
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -16566,7 +16628,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
16566
16628
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
16567
16629
|
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");
|
|
16568
16630
|
|
|
16569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
16570
16632
|
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");
|
|
16571
16633
|
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");
|
|
16572
16634
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -16616,7 +16678,14 @@ var answeredChatPk = /* @__PURE__ */ __name((context, accountKey, chatId, typed)
|
|
|
16616
16678
|
revisedBy(context, "send", () => orm.update(chats).set({ ...strict, updatedAt: now2() }).where(eq(chats.id, found2.pk)).run());
|
|
16617
16679
|
return found2.pk;
|
|
16618
16680
|
}
|
|
16619
|
-
return Number(orm.insert(chats).values({
|
|
16681
|
+
return Number(orm.insert(chats).values({
|
|
16682
|
+
accountId: accountKey,
|
|
16683
|
+
externalId: chatId,
|
|
16684
|
+
...like2,
|
|
16685
|
+
titleFolded: folded3(like2.title),
|
|
16686
|
+
createdAt: now2(),
|
|
16687
|
+
updatedAt: now2()
|
|
16688
|
+
}).returning({ pk: chats.id }).get()?.pk);
|
|
16620
16689
|
}, "answeredChatPk");
|
|
16621
16690
|
var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
16622
16691
|
const { orm, now: now2 } = context;
|
|
@@ -16629,6 +16698,7 @@ var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
|
16629
16698
|
parentChatId: parent2,
|
|
16630
16699
|
scope: chat2.scope ?? null,
|
|
16631
16700
|
title: chat2.title ?? null,
|
|
16701
|
+
titleFolded: folded3(chat2.title),
|
|
16632
16702
|
unreadCount: chat2.unreadCount ?? null,
|
|
16633
16703
|
lastMessageAt: toMs(chat2.lastMessageAt),
|
|
16634
16704
|
participantsCount: chat2.participantsCount ?? null,
|
|
@@ -16643,7 +16713,7 @@ var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
|
16643
16713
|
kind: sql`excluded.kind`,
|
|
16644
16714
|
...chat2.parentChatId === void 0 ? {} : { parentChatId: sql`excluded.parent_chat_id` },
|
|
16645
16715
|
scope: sql`coalesce(excluded.scope, ${chats.scope})`,
|
|
16646
|
-
...chat2.title === void 0 ? {} : { title: sql`excluded.title` },
|
|
16716
|
+
...chat2.title === void 0 ? {} : { title: sql`excluded.title`, titleFolded: sql`excluded.title_folded` },
|
|
16647
16717
|
...chat2.unreadCount === void 0 ? {} : { unreadCount: sql`excluded.unread_count`, unreadCountedAt: sql`excluded.unread_counted_at` },
|
|
16648
16718
|
...chat2.lastMessageAt === void 0 ? {} : { lastMessageAt: sql`excluded.last_message_at` },
|
|
16649
16719
|
...chat2.participantsCount === void 0 ? {} : { participantsCount: sql`excluded.participants_count` },
|
|
@@ -16815,7 +16885,7 @@ var metadata = /* @__PURE__ */ __name((context, key2, chatId) => {
|
|
|
16815
16885
|
} : void 0;
|
|
16816
16886
|
}, "metadata");
|
|
16817
16887
|
var saveMetadata = /* @__PURE__ */ __name((context, key2, entry2) => {
|
|
16818
|
-
revisedBy(context, "details", () => context.database.prepare("UPDATE chats SET title=?, username=?, description=?, details_fetched_at=?, updated_at=? WHERE id=?").run(entry2.title, entry2.username, entry2.description, context.now(), context.now(), metadataChatPk(context, key2, entry2.chatId)));
|
|
16888
|
+
revisedBy(context, "details", () => context.database.prepare("UPDATE chats SET title=?, title_folded=?, username=?, description=?, details_fetched_at=?, updated_at=? WHERE id=?").run(entry2.title, folded3(entry2.title), entry2.username, entry2.description, context.now(), context.now(), metadataChatPk(context, key2, entry2.chatId)));
|
|
16819
16889
|
return metadata(context, key2, entry2.chatId);
|
|
16820
16890
|
}, "saveMetadata");
|
|
16821
16891
|
var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm, matches2) => {
|
|
@@ -16838,7 +16908,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
16838
16908
|
}
|
|
16839
16909
|
}, "replaceAutoTags");
|
|
16840
16910
|
|
|
16841
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
16842
16912
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
16843
16913
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
16844
16914
|
var counterValue = /* @__PURE__ */ __name((message2, field3) => {
|
|
@@ -16875,7 +16945,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
16875
16945
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
16876
16946
|
}, "counterFreshness");
|
|
16877
16947
|
|
|
16878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16879
16949
|
import { createHash as createHash3 } from "node:crypto";
|
|
16880
16950
|
var CHUNK_CHARS = 1200;
|
|
16881
16951
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16980,7 +17050,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16980
17050
|
return chunks2;
|
|
16981
17051
|
}, "cutChunks");
|
|
16982
17052
|
|
|
16983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
16984
17054
|
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");
|
|
16985
17055
|
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;
|
|
16986
17056
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -17061,7 +17131,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
17061
17131
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
17062
17132
|
}, "mailCore");
|
|
17063
17133
|
|
|
17064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17065
17135
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17066
17136
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17067
17137
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17151,7 +17221,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17151
17221
|
});
|
|
17152
17222
|
}, "linkMeeting");
|
|
17153
17223
|
|
|
17154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
17155
17225
|
var DAY = 864e5;
|
|
17156
17226
|
var CURRENCY = [
|
|
17157
17227
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -17268,7 +17338,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
17268
17338
|
return best?.day ?? null;
|
|
17269
17339
|
}, "dueDayOf");
|
|
17270
17340
|
|
|
17271
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17341
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
17272
17342
|
var DAY2 = 864e5;
|
|
17273
17343
|
var STOP_WORDS = new Set([
|
|
17274
17344
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -17423,7 +17493,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
17423
17493
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
17424
17494
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
17425
17495
|
|
|
17426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
17427
17497
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
17428
17498
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
17429
17499
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17694,7 +17764,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17694
17764
|
};
|
|
17695
17765
|
}, "readiness");
|
|
17696
17766
|
|
|
17697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
17698
17768
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17699
17769
|
var SCAN_PAGE2 = 5e3;
|
|
17700
17770
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17757,7 +17827,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17757
17827
|
}, "nearestPictures")
|
|
17758
17828
|
}), "documentPicturesOver");
|
|
17759
17829
|
|
|
17760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17761
17831
|
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), ''))";
|
|
17762
17832
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17763
17833
|
"working-location",
|
|
@@ -17939,7 +18009,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17939
18009
|
return true;
|
|
17940
18010
|
}, "resetNoteIndex");
|
|
17941
18011
|
|
|
17942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18012
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
17943
18013
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
17944
18014
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
17945
18015
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18049,7 +18119,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18049
18119
|
return emails3 + threads;
|
|
18050
18120
|
}, "drainEmailIndex");
|
|
18051
18121
|
|
|
18052
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18053
18123
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18054
18124
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18055
18125
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18073,7 +18143,7 @@ var setEmailFlags = /* @__PURE__ */ __name((database, accountId, flags, now2) =>
|
|
|
18073
18143
|
return changed;
|
|
18074
18144
|
}, "setEmailFlags");
|
|
18075
18145
|
|
|
18076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18077
18147
|
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");
|
|
18078
18148
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18079
18149
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18140,39 +18210,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18140
18210
|
}
|
|
18141
18211
|
}), "mailRulesOver");
|
|
18142
18212
|
|
|
18143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18144
|
-
var FOLDED = [
|
|
18145
|
-
{ table: "tasks", column: "title" },
|
|
18146
|
-
{ table: "tasks", column: "close_reason" },
|
|
18147
|
-
{ table: "attachments", column: "name" },
|
|
18148
|
-
{ table: "attachments", column: "local_path" },
|
|
18149
|
-
{ table: "meetings", column: "title" },
|
|
18150
|
-
{ table: "files", column: "path" }
|
|
18151
|
-
];
|
|
18152
|
-
var folded3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : fold(value), "folded");
|
|
18153
|
-
var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
18154
|
-
let filled2 = 0;
|
|
18155
|
-
for (const { table, column: column2 } of FOLDED) {
|
|
18156
|
-
const pending = database.prepare(`SELECT id, ${column2} AS value FROM ${table} WHERE ${column2} IS NOT NULL AND ${column2}_folded IS NULL LIMIT ?`);
|
|
18157
|
-
if (pending.get(1) === void 0)
|
|
18158
|
-
continue;
|
|
18159
|
-
const fill = database.prepare(`UPDATE ${table} SET ${column2}_folded = ? WHERE id = ?`);
|
|
18160
|
-
for (; ; ) {
|
|
18161
|
-
const count = writeBatch(database, () => {
|
|
18162
|
-
const rows = pending.all(batch);
|
|
18163
|
-
for (const row2 of rows)
|
|
18164
|
-
fill.run(fold(String(row2.value)), Number(row2.id));
|
|
18165
|
-
return rows.length;
|
|
18166
|
-
});
|
|
18167
|
-
filled2 += count;
|
|
18168
|
-
if (count < batch)
|
|
18169
|
-
break;
|
|
18170
|
-
}
|
|
18171
|
-
}
|
|
18172
|
-
return filled2;
|
|
18173
|
-
}, "fillFolded");
|
|
18174
|
-
|
|
18175
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.475.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._3c883a06c0d971d0c61f8bf4c28bc453/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18176
18214
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18177
18215
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18178
18216
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18180,7 +18218,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18180
18218
|
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);
|
|
18181
18219
|
}, "reviewLink");
|
|
18182
18220
|
|
|
18183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
18184
18222
|
function checkMeetingCancelled(signal) {
|
|
18185
18223
|
if (!signal?.aborted)
|
|
18186
18224
|
return;
|
|
@@ -18191,7 +18229,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18191
18229
|
}
|
|
18192
18230
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18193
18231
|
|
|
18194
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
18195
18233
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18196
18234
|
id: Number(row2.id),
|
|
18197
18235
|
accountId: Number(row2.account_id),
|
|
@@ -18241,7 +18279,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18241
18279
|
createdAt: Number(row2.created_at)
|
|
18242
18280
|
}), "transcriptRowOf");
|
|
18243
18281
|
|
|
18244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
18245
18283
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18246
18284
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18247
18285
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18408,7 +18446,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18408
18446
|
}
|
|
18409
18447
|
}), "meetingReadsOver");
|
|
18410
18448
|
|
|
18411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
18412
18450
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18413
18451
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18414
18452
|
const params = [input.accountId];
|
|
@@ -18451,7 +18489,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18451
18489
|
return { clauses, params };
|
|
18452
18490
|
}, "meetingSelectionSql");
|
|
18453
18491
|
|
|
18454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
18455
18493
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18456
18494
|
async meetingChatLines(input) {
|
|
18457
18495
|
checkMeetingCancelled(input.signal);
|
|
@@ -18479,7 +18517,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18479
18517
|
}
|
|
18480
18518
|
}), "meetingChatLinesOver");
|
|
18481
18519
|
|
|
18482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
18483
18521
|
var MESSAGE_FIELDS = {
|
|
18484
18522
|
pk: messages.id,
|
|
18485
18523
|
nativeId: messages.externalId,
|
|
@@ -18601,7 +18639,8 @@ var toAttachment = /* @__PURE__ */ __name((row2) => ({
|
|
|
18601
18639
|
size: row2.size,
|
|
18602
18640
|
mime: row2.mime,
|
|
18603
18641
|
duration: row2.duration,
|
|
18604
|
-
providerRef: parsed(row2.providerRef)
|
|
18642
|
+
providerRef: parsed(row2.providerRef),
|
|
18643
|
+
contact: parsed(row2.contact)
|
|
18605
18644
|
})
|
|
18606
18645
|
}), "toAttachment");
|
|
18607
18646
|
var toMessage = /* @__PURE__ */ __name((row2, attachments2) => {
|
|
@@ -18645,7 +18684,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18645
18684
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18646
18685
|
}), "chatActivity");
|
|
18647
18686
|
|
|
18648
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
18649
18688
|
var HIT_FIELDS = {
|
|
18650
18689
|
...MESSAGE_FIELDS,
|
|
18651
18690
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18744,7 +18783,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18744
18783
|
};
|
|
18745
18784
|
}, "directReplies");
|
|
18746
18785
|
|
|
18747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
18748
18787
|
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");
|
|
18749
18788
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18750
18789
|
const found2 = identityRow(context, ref3);
|
|
@@ -18875,7 +18914,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
18875
18914
|
}, "mentioning");
|
|
18876
18915
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
18877
18916
|
|
|
18878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
18879
18918
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
18880
18919
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
18881
18920
|
}, "missing");
|
|
@@ -18997,7 +19036,7 @@ function meetingContextLinksOver(context) {
|
|
|
18997
19036
|
}
|
|
18998
19037
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
18999
19038
|
|
|
19000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19001
19040
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19002
19041
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19003
19042
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19026,7 +19065,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19026
19065
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19027
19066
|
}, "indexedText");
|
|
19028
19067
|
|
|
19029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19030
19069
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19031
19070
|
var meetingCurrentIndexRows = `
|
|
19032
19071
|
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
|
|
@@ -19057,7 +19096,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19057
19096
|
}, "invalidateMeetingStems");
|
|
19058
19097
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19059
19098
|
|
|
19060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19061
19100
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19062
19101
|
return {
|
|
19063
19102
|
async indexSearch(original) {
|
|
@@ -19125,10 +19164,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19125
19164
|
}
|
|
19126
19165
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19127
19166
|
|
|
19128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19129
19168
|
import { createHash as createHash4 } from "node:crypto";
|
|
19130
19169
|
|
|
19131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19132
19171
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19133
19172
|
const padded = ` ${term} `;
|
|
19134
19173
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19137,7 +19176,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19137
19176
|
return [...pieces];
|
|
19138
19177
|
}, "trigrams");
|
|
19139
19178
|
|
|
19140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19141
19180
|
var SHORTEST_CORRECTION = 3;
|
|
19142
19181
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19143
19182
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19184,7 +19223,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19184
19223
|
return corrections;
|
|
19185
19224
|
}, "correctWords");
|
|
19186
19225
|
|
|
19187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
19188
19227
|
var SHORTEST_GARBLED = 4;
|
|
19189
19228
|
var MOST_WIDENED = 64;
|
|
19190
19229
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19276,7 +19315,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19276
19315
|
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));
|
|
19277
19316
|
}, "widenWords");
|
|
19278
19317
|
|
|
19279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19318
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
19280
19319
|
import { readFileSync } from "node:fs";
|
|
19281
19320
|
var loaded;
|
|
19282
19321
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19335,7 +19374,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19335
19374
|
return false;
|
|
19336
19375
|
}, "knownRussianWord");
|
|
19337
19376
|
|
|
19338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
19339
19378
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19340
19379
|
var MOST_WORDS = 128;
|
|
19341
19380
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19562,7 +19601,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19562
19601
|
return check3(tree);
|
|
19563
19602
|
}, "matchMeetingText");
|
|
19564
19603
|
|
|
19565
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19566
19605
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19567
19606
|
throw new CliError("validation_error", message2);
|
|
19568
19607
|
}, "fail");
|
|
@@ -19739,7 +19778,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19739
19778
|
}
|
|
19740
19779
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19741
19780
|
|
|
19742
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
19743
19782
|
import { createHash as createHash5 } from "node:crypto";
|
|
19744
19783
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19745
19784
|
if (value === void 0)
|
|
@@ -19829,7 +19868,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
19829
19868
|
}
|
|
19830
19869
|
}), "meetingParticipantSearchOver");
|
|
19831
19870
|
|
|
19832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19871
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
19833
19872
|
var preparationQueries = {
|
|
19834
19873
|
participants: {
|
|
19835
19874
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -19879,7 +19918,7 @@ var preparationQueries = {
|
|
|
19879
19918
|
}
|
|
19880
19919
|
};
|
|
19881
19920
|
|
|
19882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
19883
19922
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19884
19923
|
async preparationContext(original) {
|
|
19885
19924
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -19920,7 +19959,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19920
19959
|
}
|
|
19921
19960
|
}), "meetingPreparationContextOver");
|
|
19922
19961
|
|
|
19923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
19924
19963
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
19925
19964
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
19926
19965
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -19934,7 +19973,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
19934
19973
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
19935
19974
|
)`, "preparationSubjects");
|
|
19936
19975
|
|
|
19937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
19938
19977
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19939
19978
|
async preparationKnowledge(original) {
|
|
19940
19979
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -19979,7 +20018,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
19979
20018
|
}
|
|
19980
20019
|
}), "meetingPreparationKnowledgeOver");
|
|
19981
20020
|
|
|
19982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20021
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
19983
20022
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19984
20023
|
async preparationNotes(original) {
|
|
19985
20024
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20032,7 +20071,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20032
20071
|
}
|
|
20033
20072
|
}), "meetingPreparationNotesOver");
|
|
20034
20073
|
|
|
20035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20036
20075
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20037
20076
|
async relatedHistory(original) {
|
|
20038
20077
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20103,7 +20142,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20103
20142
|
}
|
|
20104
20143
|
}), "meetingRelatedHistoryOver");
|
|
20105
20144
|
|
|
20106
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20107
20146
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20108
20147
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20109
20148
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20184,7 +20223,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20184
20223
|
}
|
|
20185
20224
|
}), "meetingReviewOver");
|
|
20186
20225
|
|
|
20187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
20188
20227
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20189
20228
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20190
20229
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20238,7 +20277,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20238
20277
|
}
|
|
20239
20278
|
}), "meetingSeriesHistoryOver");
|
|
20240
20279
|
|
|
20241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
20242
20281
|
var MOST_ROWS = 5e5;
|
|
20243
20282
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20244
20283
|
async meetingStats(input) {
|
|
@@ -20285,7 +20324,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20285
20324
|
}
|
|
20286
20325
|
}), "meetingStatsOver");
|
|
20287
20326
|
|
|
20288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
20289
20328
|
var CURSOR_KEY = "meetings";
|
|
20290
20329
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20291
20330
|
id: Number(row2.id),
|
|
@@ -20837,7 +20876,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
20837
20876
|
};
|
|
20838
20877
|
}, "meetingStoreOver");
|
|
20839
20878
|
|
|
20840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
20841
20880
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
20842
20881
|
id: `email:${place.emailId}`,
|
|
20843
20882
|
chatId: place.threadExternalId,
|
|
@@ -20948,18 +20987,18 @@ var identityOf2 = /* @__PURE__ */ __name((database, { address, name }, now2) =>
|
|
|
20948
20987
|
const found2 = database.prepare("SELECT id, name FROM identities WHERE provider = 'email' AND external_id = ?").get(key2);
|
|
20949
20988
|
if (found2) {
|
|
20950
20989
|
if (found2.name === null && name)
|
|
20951
|
-
database.prepare("UPDATE identities SET name = ?, updated_at = ? WHERE id = ?").run(name, now2, Number(found2.id));
|
|
20990
|
+
database.prepare("UPDATE identities SET name = ?, name_folded = ?, updated_at = ? WHERE id = ?").run(name, fold(name), now2, Number(found2.id));
|
|
20952
20991
|
return Number(found2.id);
|
|
20953
20992
|
}
|
|
20954
|
-
return Number(database.prepare("INSERT INTO identities (provider, external_id, name, created_at, updated_at) VALUES ('email', ?, ?, ?, ?) RETURNING id").get(key2, name, now2, now2)?.id);
|
|
20993
|
+
return Number(database.prepare("INSERT INTO identities (provider, external_id, name, name_folded, created_at, updated_at) VALUES ('email', ?, ?, ?, ?, ?) RETURNING id").get(key2, name, folded3(name), now2, now2)?.id);
|
|
20955
20994
|
}, "identityOf");
|
|
20956
20995
|
var mailboxPk = /* @__PURE__ */ __name((database, accountId, box, now2) => {
|
|
20957
20996
|
if (!box.externalId)
|
|
20958
20997
|
throw new Error("Invalid mailbox key");
|
|
20959
|
-
return Number(database.prepare(`INSERT INTO mailboxes (account_id, external_id, name, kind, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)
|
|
20960
|
-
ON CONFLICT (account_id, external_id) DO UPDATE SET name = excluded.name,
|
|
20998
|
+
return Number(database.prepare(`INSERT INTO mailboxes (account_id, external_id, name, name_folded, kind, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
20999
|
+
ON CONFLICT (account_id, external_id) DO UPDATE SET name = excluded.name, name_folded = excluded.name_folded,
|
|
20961
21000
|
kind = coalesce(excluded.kind, kind), updated_at = excluded.updated_at
|
|
20962
|
-
RETURNING id`).get(accountId, box.externalId, box.name, box.kind, now2, now2)?.id);
|
|
21001
|
+
RETURNING id`).get(accountId, box.externalId, box.name, fold(box.name), box.kind, now2, now2)?.id);
|
|
20963
21002
|
}, "mailboxPk");
|
|
20964
21003
|
var join = /* @__PURE__ */ __name((database, emailId, mailboxId, now2) => database.prepare("INSERT OR IGNORE INTO email_mailboxes (email_id, mailbox_id, created_at) VALUES (?, ?, ?)").run(emailId, mailboxId, now2), "join");
|
|
20965
21004
|
var saveEmail = /* @__PURE__ */ __name((database, orm, accountId, threadId, mail, now2) => {
|
|
@@ -21036,7 +21075,7 @@ var saveThread = /* @__PURE__ */ __name((database, orm, input) => {
|
|
|
21036
21075
|
const threadId = found2 ? Number(found2.id) : Number(database.prepare(`INSERT INTO email_threads (account_id, external_id, created_at, updated_at) VALUES (?, ?, ?, ?)
|
|
21037
21076
|
RETURNING id`).get(accountId, externalId, now2, now2)?.id);
|
|
21038
21077
|
if (input.subject !== void 0)
|
|
21039
|
-
database.prepare("UPDATE email_threads SET subject = ? WHERE id = ?").run(input.subject, threadId);
|
|
21078
|
+
database.prepare("UPDATE email_threads SET subject = ?, subject_folded = ? WHERE id = ?").run(input.subject, folded3(input.subject), threadId);
|
|
21040
21079
|
if (input.metadata !== void 0)
|
|
21041
21080
|
database.prepare("UPDATE email_threads SET metadata = ? WHERE id = ?").run(toJson(input.metadata), threadId);
|
|
21042
21081
|
const moved = /* @__PURE__ */ new Set();
|
|
@@ -21046,7 +21085,8 @@ var saveThread = /* @__PURE__ */ __name((database, orm, input) => {
|
|
|
21046
21085
|
moved.add(before2);
|
|
21047
21086
|
}
|
|
21048
21087
|
const first = database.prepare("SELECT subject FROM emails WHERE email_thread_id = ? ORDER BY coalesce(sent_at, received_at), id LIMIT 1").get(threadId);
|
|
21049
|
-
|
|
21088
|
+
const subject2 = titleOf(str(first?.subject));
|
|
21089
|
+
database.prepare("UPDATE email_threads SET subject = ?, subject_folded = ? WHERE id = ? AND subject IS NULL").run(subject2, folded3(subject2), threadId);
|
|
21050
21090
|
for (const id2 of [threadId, ...moved])
|
|
21051
21091
|
recountEmailThread(database, id2, now2);
|
|
21052
21092
|
queueThreads(database, moved);
|
|
@@ -21405,7 +21445,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21405
21445
|
}
|
|
21406
21446
|
}), "mailStoreOver");
|
|
21407
21447
|
|
|
21408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
21409
21449
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21410
21450
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21411
21451
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21495,7 +21535,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21495
21535
|
}, "knownWord");
|
|
21496
21536
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21497
21537
|
|
|
21498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
21499
21539
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21500
21540
|
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");
|
|
21501
21541
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -21581,7 +21621,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21581
21621
|
return found2;
|
|
21582
21622
|
}, "spokenTranscripts");
|
|
21583
21623
|
|
|
21584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
21585
21625
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21586
21626
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21587
21627
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21628,7 +21668,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21628
21668
|
});
|
|
21629
21669
|
}, "placeHits");
|
|
21630
21670
|
|
|
21631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
21632
21672
|
var MESSAGES2 = {
|
|
21633
21673
|
rows: "messages",
|
|
21634
21674
|
threads: "chats",
|
|
@@ -22090,7 +22130,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22090
22130
|
};
|
|
22091
22131
|
}, "runQuery");
|
|
22092
22132
|
|
|
22093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
22094
22134
|
function invalidMetadata() {
|
|
22095
22135
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22096
22136
|
}
|
|
@@ -22192,7 +22232,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22192
22232
|
};
|
|
22193
22233
|
}), "counterTargets");
|
|
22194
22234
|
|
|
22195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
22196
22236
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22197
22237
|
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,
|
|
22198
22238
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22248,7 +22288,7 @@ var resetAttachmentWords = /* @__PURE__ */ __name((database) => {
|
|
|
22248
22288
|
extraction_error = NULL, extracted_at = t.heard_at, updated_at = t.updated_at
|
|
22249
22289
|
FROM message_transcripts t
|
|
22250
22290
|
WHERE attachments.attachable_type = 'message' AND attachments.attachable_id = t.message_id
|
|
22251
|
-
AND (attachments.kind
|
|
22291
|
+
AND (attachments.kind IN ('voice', 'audio') OR attachments.mime LIKE 'audio/%')
|
|
22252
22292
|
AND coalesce(attachments.text, '') = '' AND coalesce(attachments.extraction, '') <> 'agent'`).run();
|
|
22253
22293
|
const update = database.prepare("UPDATE attachments SET normalized_text = ? WHERE id = ?");
|
|
22254
22294
|
for (const row2 of database.prepare("SELECT id AS attachment_id, text, normalized_text FROM attachments WHERE text IS NOT NULL").all()) {
|
|
@@ -22311,7 +22351,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22311
22351
|
}));
|
|
22312
22352
|
}, "attachmentViews");
|
|
22313
22353
|
|
|
22314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
22315
22355
|
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");
|
|
22316
22356
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22317
22357
|
const { orm, database, now: now2 } = context;
|
|
@@ -22343,13 +22383,13 @@ var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5,
|
|
|
22343
22383
|
var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
22344
22384
|
const row2 = context.database.prepare(`SELECT a.id, t.text, t.source FROM message_transcripts t
|
|
22345
22385
|
JOIN attachments a ON a.attachable_type = 'message' AND a.attachable_id = t.message_id
|
|
22346
|
-
WHERE t.message_id = ? AND (a.kind
|
|
22386
|
+
WHERE t.message_id = ? AND (a.kind IN ('voice', 'audio') OR a.mime LIKE 'audio/%') ORDER BY a.position LIMIT 1`).get(messagePk);
|
|
22347
22387
|
if (!row2)
|
|
22348
22388
|
return;
|
|
22349
22389
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22350
22390
|
}, "intoVoiceAttachment");
|
|
22351
22391
|
|
|
22352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
22353
22393
|
var FIELDS = [
|
|
22354
22394
|
"threadExternalId",
|
|
22355
22395
|
"senderIdentityId",
|
|
@@ -22378,7 +22418,8 @@ var ATTACHMENT_FIELDS = [
|
|
|
22378
22418
|
"height",
|
|
22379
22419
|
"duration",
|
|
22380
22420
|
"providerRef",
|
|
22381
|
-
"nameFolded"
|
|
22421
|
+
"nameFolded",
|
|
22422
|
+
"contact"
|
|
22382
22423
|
];
|
|
22383
22424
|
var placeholders = /* @__PURE__ */ __name((names) => Object.fromEntries(names.map((name) => [name, sql.placeholder(name)])), "placeholders");
|
|
22384
22425
|
var prepare2 = /* @__PURE__ */ __name((orm) => ({
|
|
@@ -22404,7 +22445,7 @@ var prepare2 = /* @__PURE__ */ __name((orm) => ({
|
|
|
22404
22445
|
const column2 = attachments[name].name;
|
|
22405
22446
|
return [
|
|
22406
22447
|
name,
|
|
22407
|
-
sql.raw(name === "providerRef" ? `coalesce(excluded.${column2}, ${column2})` : `excluded.${column2}`)
|
|
22448
|
+
sql.raw(name === "providerRef" || name === "contact" ? `coalesce(excluded.${column2}, ${column2})` : `excluded.${column2}`)
|
|
22408
22449
|
];
|
|
22409
22450
|
}))
|
|
22410
22451
|
}).prepare()
|
|
@@ -22517,7 +22558,8 @@ var upsertMessage = /* @__PURE__ */ __name((context, key2, accountKey, chatKey,
|
|
|
22517
22558
|
width: attachment.width ?? null,
|
|
22518
22559
|
height: attachment.height ?? null,
|
|
22519
22560
|
duration: attachment.duration ?? null,
|
|
22520
|
-
providerRef: refOf(attachment.providerRef)
|
|
22561
|
+
providerRef: refOf(attachment.providerRef),
|
|
22562
|
+
contact: attachment.contact ? JSON.stringify(attachment.contact) : null
|
|
22521
22563
|
});
|
|
22522
22564
|
});
|
|
22523
22565
|
if (Number(heardFirst) > 0)
|
|
@@ -22640,6 +22682,14 @@ var derivedReactions = /* @__PURE__ */ __name(({ database }, chatKey, messageId)
|
|
|
22640
22682
|
total: sorted2.reduce((sum, [, { count }]) => sum + count, 0)
|
|
22641
22683
|
};
|
|
22642
22684
|
}, "derivedReactions");
|
|
22685
|
+
var reactors = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => database.prepare(`SELECT i.external_id AS id, i.name, i.username, r.reaction, r.reacted_at AS reactedAt
|
|
22686
|
+
FROM message_reactions r JOIN identities i ON i.id = r.identity_id
|
|
22687
|
+
WHERE r.chat_id = ? AND r.message_external_id = ? AND r.reaction IS NOT NULL
|
|
22688
|
+
ORDER BY r.reacted_at DESC, r.id DESC`).all(chatKey, messageId).map(({ id: id2, name, username, reaction, reactedAt }) => ({
|
|
22689
|
+
person: { id: id2, name, username },
|
|
22690
|
+
reaction,
|
|
22691
|
+
reactedAt: new Date(reactedAt).toISOString()
|
|
22692
|
+
})), "reactors");
|
|
22643
22693
|
var saveReaction = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, messageId, { person: person2, own, reaction, reactedAt }) => {
|
|
22644
22694
|
const { database, now: now2 } = context;
|
|
22645
22695
|
const statements = reactionStatementsOf(database);
|
|
@@ -22656,7 +22706,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22656
22706
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22657
22707
|
}, "writeDerivedReactions");
|
|
22658
22708
|
|
|
22659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
22660
22710
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22661
22711
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22662
22712
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -22682,7 +22732,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
22682
22732
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22683
22733
|
}, "release");
|
|
22684
22734
|
|
|
22685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22735
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22686
22736
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22687
22737
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22688
22738
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22703,7 +22753,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22703
22753
|
};
|
|
22704
22754
|
}, "keysOver");
|
|
22705
22755
|
|
|
22706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22756
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
22707
22757
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22708
22758
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22709
22759
|
if (!row2)
|
|
@@ -22738,7 +22788,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22738
22788
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22739
22789
|
}, "saveProfile");
|
|
22740
22790
|
|
|
22741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
22742
22792
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22743
22793
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22744
22794
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22774,7 +22824,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22774
22824
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22775
22825
|
}, "originOfActor");
|
|
22776
22826
|
|
|
22777
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
22778
22828
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22779
22829
|
const owner = ownerPerson(context.database).id;
|
|
22780
22830
|
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);
|
|
@@ -22795,7 +22845,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22795
22845
|
return personOf(context, ref3);
|
|
22796
22846
|
}, "linkToOwner");
|
|
22797
22847
|
|
|
22798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
22799
22849
|
var PROVIDERS_SETTING = "providers";
|
|
22800
22850
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
22801
22851
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -22830,7 +22880,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
22830
22880
|
});
|
|
22831
22881
|
}, "registerProvider");
|
|
22832
22882
|
|
|
22833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
22834
22884
|
var DAY3 = 864e5;
|
|
22835
22885
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
22836
22886
|
var TEXT_LIMIT = 20;
|
|
@@ -23029,7 +23079,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23029
23079
|
};
|
|
23030
23080
|
}, "taskSimilarityOver");
|
|
23031
23081
|
|
|
23032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23033
23083
|
var SETTING3 = "taskCategories";
|
|
23034
23084
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23035
23085
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23048,7 +23098,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23048
23098
|
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);
|
|
23049
23099
|
}, "saveTaskCategories");
|
|
23050
23100
|
|
|
23051
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
23052
23102
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23053
23103
|
var ALLOWED = "taskAgentClose";
|
|
23054
23104
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23104,7 +23154,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
23104
23154
|
];
|
|
23105
23155
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23106
23156
|
|
|
23107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
23108
23158
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23109
23159
|
var MAX_TEXT_CHARS = 2e6;
|
|
23110
23160
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23130,7 +23180,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23130
23180
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23131
23181
|
}, "pdfPreviewLimits");
|
|
23132
23182
|
|
|
23133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
23134
23184
|
import { randomBytes } from "node:crypto";
|
|
23135
23185
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23136
23186
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23143,7 +23193,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23143
23193
|
return time3 + random;
|
|
23144
23194
|
}, "ulid");
|
|
23145
23195
|
|
|
23146
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
23147
23197
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23148
23198
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23149
23199
|
if (!meta && !sections?.length)
|
|
@@ -23164,7 +23214,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23164
23214
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23165
23215
|
}, "languageOf");
|
|
23166
23216
|
|
|
23167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
23168
23218
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23169
23219
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23170
23220
|
if (isObject(value))
|
|
@@ -23407,7 +23457,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23407
23457
|
};
|
|
23408
23458
|
}, "filesStoreOver");
|
|
23409
23459
|
|
|
23410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
23411
23461
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23412
23462
|
entity: "document",
|
|
23413
23463
|
backend: "sql",
|
|
@@ -23453,7 +23503,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23453
23503
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23454
23504
|
}, "importedDocumentWhere");
|
|
23455
23505
|
|
|
23456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
23457
23507
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23458
23508
|
var iso = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23459
23509
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso(value), "optionalIso");
|
|
@@ -23962,7 +24012,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23962
24012
|
};
|
|
23963
24013
|
}, "notesStoreOver");
|
|
23964
24014
|
|
|
23965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24015
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
23966
24016
|
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";
|
|
23967
24017
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23968
24018
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -24078,7 +24128,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24078
24128
|
};
|
|
24079
24129
|
}, "memoriesStoreOver");
|
|
24080
24130
|
|
|
24081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
24082
24132
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24083
24133
|
var KEY = "taskFirstPassPerChat";
|
|
24084
24134
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24098,7 +24148,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24098
24148
|
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);
|
|
24099
24149
|
}, "saveFirstPassPerChat");
|
|
24100
24150
|
|
|
24101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
24102
24152
|
var TASK_RELATION_KINDS = [
|
|
24103
24153
|
"blocked-by",
|
|
24104
24154
|
"follow-up-of",
|
|
@@ -24228,7 +24278,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24228
24278
|
};
|
|
24229
24279
|
}, "taskRelationsStoreOver");
|
|
24230
24280
|
|
|
24231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
24232
24282
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24233
24283
|
var iso3 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24234
24284
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
@@ -24500,7 +24550,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24500
24550
|
};
|
|
24501
24551
|
}, "workTasksOver");
|
|
24502
24552
|
|
|
24503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
24504
24554
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24505
24555
|
const { database, now: now2 } = context;
|
|
24506
24556
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24546,7 +24596,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24546
24596
|
};
|
|
24547
24597
|
}, "taskCloseOver");
|
|
24548
24598
|
|
|
24549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24599
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
24550
24600
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24551
24601
|
const { database, now: now2 } = context;
|
|
24552
24602
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24764,7 +24814,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
24764
24814
|
};
|
|
24765
24815
|
}, "taskPairsOver");
|
|
24766
24816
|
|
|
24767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24817
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
24768
24818
|
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";
|
|
24769
24819
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24770
24820
|
const { database, now: now2 } = context;
|
|
@@ -24782,7 +24832,7 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24782
24832
|
return Number(found2.id);
|
|
24783
24833
|
}
|
|
24784
24834
|
const at = now2();
|
|
24785
|
-
return Number(database.prepare("INSERT INTO projects (key, name, description, type, account_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, 'personal', ?, 'personal', 0, 'active', ?, ?) RETURNING id").get(key2, account, `What waits on the owner in ${account}`, accountId, at, at)?.id);
|
|
24835
|
+
return Number(database.prepare("INSERT INTO projects (key, name, name_folded, description, type, account_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, 'personal', ?, 'personal', 0, 'active', ?, ?) RETURNING id").get(key2, account, folded3(account), `What waits on the owner in ${account}`, accountId, at, at)?.id);
|
|
24786
24836
|
}, "inbox");
|
|
24787
24837
|
const select2 = /* @__PURE__ */ __name((where) => database.prepare(`SELECT ${COLUMNS3} FROM tasks t JOIN projects p ON p.id = t.project_id WHERE t.package_id IS NOT NULL AND ${where}`), "select");
|
|
24788
24838
|
const toTask = /* @__PURE__ */ __name((row2) => {
|
|
@@ -24959,7 +25009,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
24959
25009
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
24960
25010
|
}, "oneOf");
|
|
24961
25011
|
|
|
24962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25012
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
24963
25013
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
24964
25014
|
const { database } = context;
|
|
24965
25015
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25001,7 +25051,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25001
25051
|
};
|
|
25002
25052
|
}, "accountsStoreOver");
|
|
25003
25053
|
|
|
25004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
25005
25055
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25006
25056
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25007
25057
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25025,7 +25075,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25025
25075
|
})), "keepDownloads");
|
|
25026
25076
|
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");
|
|
25027
25077
|
|
|
25028
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
25029
25079
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25030
25080
|
const { database } = context;
|
|
25031
25081
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25082,7 +25132,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25082
25132
|
}, "keepAttachmentText")
|
|
25083
25133
|
}), "attachmentsStoreOver");
|
|
25084
25134
|
|
|
25085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25135
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
25086
25136
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25087
25137
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25088
25138
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25262,7 +25312,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25262
25312
|
return done;
|
|
25263
25313
|
}, "rekeyChats");
|
|
25264
25314
|
|
|
25265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
25266
25316
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25267
25317
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25268
25318
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25294,7 +25344,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25294
25344
|
});
|
|
25295
25345
|
}, "chatCompleteness");
|
|
25296
25346
|
|
|
25297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
25298
25348
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25299
25349
|
const { database } = context;
|
|
25300
25350
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25394,7 +25444,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25394
25444
|
};
|
|
25395
25445
|
}, "chatsStoreOver");
|
|
25396
25446
|
|
|
25397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
25398
25448
|
import { createHash as createHash6 } from "node:crypto";
|
|
25399
25449
|
var BATCH_CONTEXT = 50;
|
|
25400
25450
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25532,7 +25582,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25532
25582
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25533
25583
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25534
25584
|
|
|
25535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
25536
25586
|
import { setTimeout } from "node:timers/promises";
|
|
25537
25587
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25538
25588
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -25844,7 +25894,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
25844
25894
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
25845
25895
|
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");
|
|
25846
25896
|
|
|
25847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
25848
25898
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25849
25899
|
const { database } = context;
|
|
25850
25900
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25951,7 +26001,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25951
26001
|
};
|
|
25952
26002
|
}, "conversationsStoreOver");
|
|
25953
26003
|
|
|
25954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
25955
26005
|
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";
|
|
25956
26006
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
25957
26007
|
const { database } = context;
|
|
@@ -25976,7 +26026,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25976
26026
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
25977
26027
|
}), "countersStoreOver");
|
|
25978
26028
|
|
|
25979
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
25980
26030
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
25981
26031
|
var MENTION_QUERY = defineQuery({
|
|
25982
26032
|
entity: "mention",
|
|
@@ -26050,7 +26100,7 @@ var mentionsState = /* @__PURE__ */ __name((database) => {
|
|
|
26050
26100
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(REBUILT_AT);
|
|
26051
26101
|
return { pending, rebuiltAt: row2 ? JSON.parse(String(row2.value)) : null };
|
|
26052
26102
|
}, "mentionsState");
|
|
26053
|
-
var SELECT = "SELECT mn.id, mn.kind, mn.value, mn.domain, mn.confidence, mn.status, mn.author, mn.source_field, mn.target_type, mn.target_id, mn.created_at, mn.start_offset, mn.end_offset, CASE WHEN mn.source_type = 'attachment' THEN att
|
|
26103
|
+
var SELECT = "SELECT mn.id, mn.kind, mn.value, mn.domain, mn.confidence, mn.status, mn.author, mn.source_field, mn.target_type, mn.target_id, mn.created_at, mn.start_offset, mn.end_offset, CASE WHEN mn.source_type = 'attachment' THEN " + mentionText("att") + " ELSE m.text END AS text, m.external_id AS message_id, m.sent_at, m.chat_id AS chat_pk, c.external_id AS chat_id FROM mentions mn LEFT JOIN attachments att ON mn.source_type = 'attachment' AND att.id = mn.source_id AND att.attachable_type = 'message' JOIN messages m ON mn.source_type IN ('message', 'attachment') AND m.id = CASE WHEN mn.source_type = 'attachment' THEN att.attachable_id ELSE mn.source_id END AND m.deleted_at IS NULL JOIN chats c ON c.id = m.chat_id ";
|
|
26054
26104
|
var stored = /* @__PURE__ */ __name((row2) => ({
|
|
26055
26105
|
id: Number(row2.id),
|
|
26056
26106
|
kind: String(row2.kind),
|
|
@@ -26192,7 +26242,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26192
26242
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26193
26243
|
}, "listPlaces");
|
|
26194
26244
|
|
|
26195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26245
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
26196
26246
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26197
26247
|
const { database } = context;
|
|
26198
26248
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26227,7 +26277,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26227
26277
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26228
26278
|
}), "mentionsStoreOver");
|
|
26229
26279
|
|
|
26230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
26231
26281
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26232
26282
|
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");
|
|
26233
26283
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26242,7 +26292,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26242
26292
|
}));
|
|
26243
26293
|
}, "documentLinkMessages");
|
|
26244
26294
|
|
|
26245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
26246
26296
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26247
26297
|
const { database } = context;
|
|
26248
26298
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26342,6 +26392,10 @@ var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
26342
26392
|
const chatKey = chatKeyOf(key2, chatId);
|
|
26343
26393
|
return chatKey === void 0 ? [] : pollVotes2(context, chatKey, messageId);
|
|
26344
26394
|
}, "pollVotes"),
|
|
26395
|
+
reactors: /* @__PURE__ */ __name(async (key2, chatId, messageId) => {
|
|
26396
|
+
const chatKey = chatKeyOf(key2, chatId);
|
|
26397
|
+
return chatKey === void 0 ? [] : reactors(context, chatKey, messageId);
|
|
26398
|
+
}, "reactors"),
|
|
26345
26399
|
senderStats: /* @__PURE__ */ __name(async (key2, senderId) => {
|
|
26346
26400
|
const accountKey = findAccountPk2(key2);
|
|
26347
26401
|
return accountKey === void 0 ? [] : senderStats(context, accountKey, key2.provider, senderId);
|
|
@@ -26372,7 +26426,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26372
26426
|
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies")
|
|
26373
26427
|
}), "messagesStoreOver");
|
|
26374
26428
|
|
|
26375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26429
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
26376
26430
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26377
26431
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26378
26432
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -26429,7 +26483,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26429
26483
|
});
|
|
26430
26484
|
}, "personPreparation");
|
|
26431
26485
|
|
|
26432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
26433
26487
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26434
26488
|
const id2 = Number(uid);
|
|
26435
26489
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26437,7 +26491,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26437
26491
|
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)));
|
|
26438
26492
|
}, "personSeenInAccounts");
|
|
26439
26493
|
|
|
26440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26494
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
26441
26495
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26442
26496
|
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);
|
|
26443
26497
|
if (!row2)
|
|
@@ -26503,7 +26557,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26503
26557
|
return { id: id2, personId, removed: true };
|
|
26504
26558
|
}, "removeNote");
|
|
26505
26559
|
|
|
26506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
26507
26561
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26508
26562
|
const { database } = context;
|
|
26509
26563
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26535,6 +26589,7 @@ var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
|
26535
26589
|
const accountKey = findAccountPk2(key2);
|
|
26536
26590
|
return accountKey === void 0 ? [] : namesOf(context, accountKey, key2.provider, personId);
|
|
26537
26591
|
}, "personNames"),
|
|
26592
|
+
phoneOf: /* @__PURE__ */ __name(async (key2, personId) => phoneOf(context, key2.provider, personId), "phoneOf"),
|
|
26538
26593
|
privateContact: /* @__PURE__ */ __name(async (key2, person2) => privateContact(context, key2, person2), "privateContact"),
|
|
26539
26594
|
setContactAlias: /* @__PURE__ */ __name(async (key2, person2, alias2) => {
|
|
26540
26595
|
return write(database, () => setAlias(context, key2, person2, alias2));
|
|
@@ -26577,13 +26632,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26577
26632
|
};
|
|
26578
26633
|
}, "peopleStoreOver");
|
|
26579
26634
|
|
|
26580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
26581
26636
|
import { createHash as createHash8 } from "node:crypto";
|
|
26582
26637
|
|
|
26583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26584
26639
|
import { createHash as createHash7 } from "node:crypto";
|
|
26585
26640
|
|
|
26586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
26587
26642
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
26588
26643
|
var AUTHOR_MEASURES = [
|
|
26589
26644
|
"messages",
|
|
@@ -26723,7 +26778,7 @@ var withoutUrls = /* @__PURE__ */ __name((text5) => text5.replace(/\S+/gu, (toke
|
|
|
26723
26778
|
var rankingWords = /* @__PURE__ */ __name((text5) => withoutUrls(text5).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
26724
26779
|
var rankingQuestion = /* @__PURE__ */ __name((text5) => withoutUrls(text5).includes("?"), "rankingQuestion");
|
|
26725
26780
|
|
|
26726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
26727
26782
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
26728
26783
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
26729
26784
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -26945,7 +27000,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
26945
27000
|
};
|
|
26946
27001
|
}, "rankReplyGraph");
|
|
26947
27002
|
|
|
26948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26949
27004
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
26950
27005
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
26951
27006
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27119,7 +27174,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27119
27174
|
return { items, evidence, summary, graph: graph.quality };
|
|
27120
27175
|
}, "calculateAdminStatistics");
|
|
27121
27176
|
|
|
27122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27177
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
27123
27178
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27124
27179
|
const dates = [];
|
|
27125
27180
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27141,7 +27196,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27141
27196
|
return dates[0].node.resolution.date;
|
|
27142
27197
|
}, "rankingContextRange");
|
|
27143
27198
|
|
|
27144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
27145
27200
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27146
27201
|
let counts;
|
|
27147
27202
|
try {
|
|
@@ -27436,7 +27491,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27436
27491
|
});
|
|
27437
27492
|
}, "rankQuery");
|
|
27438
27493
|
|
|
27439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27494
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
27440
27495
|
function fail4(message2, reason = "query.too-large") {
|
|
27441
27496
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27442
27497
|
}
|
|
@@ -27613,7 +27668,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27613
27668
|
return result;
|
|
27614
27669
|
}), "adminStatisticsQuery");
|
|
27615
27670
|
|
|
27616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
27617
27672
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27618
27673
|
if (!execution.accounts.length)
|
|
27619
27674
|
return { conversations: [], chats: [] };
|
|
@@ -27631,7 +27686,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27631
27686
|
return { conversations: conversations2, chats: chats2 };
|
|
27632
27687
|
}, "conversationEligibility");
|
|
27633
27688
|
|
|
27634
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27689
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
27635
27690
|
import { createHash as createHash9 } from "node:crypto";
|
|
27636
27691
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27637
27692
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -27781,7 +27836,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
27781
27836
|
return result;
|
|
27782
27837
|
}, "rankingEvidence");
|
|
27783
27838
|
|
|
27784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
27785
27840
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
27786
27841
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
27787
27842
|
if (execution.corpus === "mail")
|
|
@@ -27798,7 +27853,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
|
27798
27853
|
};
|
|
27799
27854
|
}, "queriesStoreOver");
|
|
27800
27855
|
|
|
27801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
27802
27857
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
27803
27858
|
const { database, now: now2 } = context;
|
|
27804
27859
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -27837,10 +27892,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
27837
27892
|
}));
|
|
27838
27893
|
}, "chatEventsOf");
|
|
27839
27894
|
|
|
27840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27895
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
27841
27896
|
import { createHash as createHash10 } from "node:crypto";
|
|
27842
27897
|
|
|
27843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
27844
27899
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
27845
27900
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
27846
27901
|
timeZone: zone,
|
|
@@ -27855,7 +27910,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
27855
27910
|
};
|
|
27856
27911
|
}, "calendarKey");
|
|
27857
27912
|
|
|
27858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
27859
27914
|
var RETENTION_TOLERANCE = 864e5;
|
|
27860
27915
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
27861
27916
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -27909,7 +27964,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
27909
27964
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
27910
27965
|
}, "retentionCohorts");
|
|
27911
27966
|
|
|
27912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
27913
27968
|
var iso5 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
27914
27969
|
var week = /* @__PURE__ */ __name((day) => {
|
|
27915
27970
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
@@ -28045,7 +28100,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28045
28100
|
};
|
|
28046
28101
|
}, "retentionQuery");
|
|
28047
28102
|
|
|
28048
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28103
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
28049
28104
|
var iso6 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
28050
28105
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
28051
28106
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -28176,7 +28231,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
28176
28231
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28177
28232
|
})), "trackedChats");
|
|
28178
28233
|
|
|
28179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
28180
28235
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28181
28236
|
const { database } = context;
|
|
28182
28237
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28232,7 +28287,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28232
28287
|
};
|
|
28233
28288
|
}, "rosterStoreOver");
|
|
28234
28289
|
|
|
28235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
28236
28291
|
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");
|
|
28237
28292
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28238
28293
|
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 ?`);
|
|
@@ -28256,7 +28311,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28256
28311
|
}
|
|
28257
28312
|
}, "backfillNormalized");
|
|
28258
28313
|
|
|
28259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
28260
28315
|
var INDEX2 = "message_words";
|
|
28261
28316
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28262
28317
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28383,7 +28438,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28383
28438
|
});
|
|
28384
28439
|
}, "resetSearchIndex");
|
|
28385
28440
|
|
|
28386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
28387
28442
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28388
28443
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28389
28444
|
const before2 = stemsState(database);
|
|
@@ -28478,7 +28533,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28478
28533
|
return resetStems(database, { now: now2 });
|
|
28479
28534
|
}, "followDefaultStemmers");
|
|
28480
28535
|
|
|
28481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
28482
28537
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28483
28538
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28484
28539
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28500,7 +28555,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28500
28555
|
});
|
|
28501
28556
|
}, "termCandidates");
|
|
28502
28557
|
|
|
28503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28558
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
28504
28559
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28505
28560
|
const { database } = context;
|
|
28506
28561
|
const stemmerFor = stemmerCache();
|
|
@@ -28522,7 +28577,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28522
28577
|
};
|
|
28523
28578
|
}, "searchIndexStoreOver");
|
|
28524
28579
|
|
|
28525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
28526
28581
|
var HISTORY_KEPT = 1e3;
|
|
28527
28582
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28528
28583
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28591,7 +28646,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28591
28646
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28592
28647
|
}, "clearHistory");
|
|
28593
28648
|
|
|
28594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
28595
28650
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28596
28651
|
const { database } = context;
|
|
28597
28652
|
return {
|
|
@@ -28615,7 +28670,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28615
28670
|
};
|
|
28616
28671
|
}, "searchesStoreOver");
|
|
28617
28672
|
|
|
28618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28673
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
28619
28674
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28620
28675
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28621
28676
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -28658,7 +28713,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
28658
28713
|
};
|
|
28659
28714
|
}, "agentActionsStoreOver");
|
|
28660
28715
|
|
|
28661
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
28662
28717
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
28663
28718
|
}) => {
|
|
28664
28719
|
const { database, now: now2 } = context;
|
|
@@ -28717,7 +28772,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
28717
28772
|
};
|
|
28718
28773
|
}, "botUpdateStoreOver");
|
|
28719
28774
|
|
|
28720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
28721
28776
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
28722
28777
|
id: Number(row2.id),
|
|
28723
28778
|
accountId: Number(row2.account_id),
|
|
@@ -29281,7 +29336,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29281
29336
|
};
|
|
29282
29337
|
}, "eventStoreOver");
|
|
29283
29338
|
|
|
29284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
29285
29340
|
var CATALOG_QUERY = defineQuery({
|
|
29286
29341
|
entity: "document",
|
|
29287
29342
|
backend: "sql",
|
|
@@ -29523,7 +29578,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29523
29578
|
};
|
|
29524
29579
|
}, "catalogStoreOver");
|
|
29525
29580
|
|
|
29526
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
29527
29582
|
import { createHash as createHash11 } from "node:crypto";
|
|
29528
29583
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29529
29584
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29621,7 +29676,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29621
29676
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29622
29677
|
}, "contextEvidenceRequest");
|
|
29623
29678
|
|
|
29624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
29625
29680
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
29626
29681
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
29627
29682
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -29634,7 +29689,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
29634
29689
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
29635
29690
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
29636
29691
|
|
|
29637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
29638
29693
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
29639
29694
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
29640
29695
|
signal?.throwIfAborted();
|
|
@@ -29733,7 +29788,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
29733
29788
|
});
|
|
29734
29789
|
}, "readMeetingContextEvidence");
|
|
29735
29790
|
|
|
29736
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
29737
29792
|
var corpora = {
|
|
29738
29793
|
message: {
|
|
29739
29794
|
table: "messages",
|
|
@@ -29962,7 +30017,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29962
30017
|
}
|
|
29963
30018
|
}), "contextRecordsOver");
|
|
29964
30019
|
|
|
29965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
29966
30021
|
var NOTE_FIELDS = [
|
|
29967
30022
|
"text",
|
|
29968
30023
|
"exact",
|
|
@@ -30351,7 +30406,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30351
30406
|
};
|
|
30352
30407
|
}, "noteSearchOver");
|
|
30353
30408
|
|
|
30354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
30355
30410
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30356
30411
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30357
30412
|
var EVENT_CORPUS = {
|
|
@@ -30483,7 +30538,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30483
30538
|
};
|
|
30484
30539
|
}, "eventSearchOver");
|
|
30485
30540
|
|
|
30486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
30487
30542
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30488
30543
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30489
30544
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30496,7 +30551,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30496
30551
|
}, "reference");
|
|
30497
30552
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30498
30553
|
|
|
30499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
30500
30555
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30501
30556
|
try {
|
|
30502
30557
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -30508,7 +30563,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
30508
30563
|
}
|
|
30509
30564
|
}, "calendarMoment");
|
|
30510
30565
|
|
|
30511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
30512
30567
|
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";
|
|
30513
30568
|
var iso7 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30514
30569
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -30621,7 +30676,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30621
30676
|
};
|
|
30622
30677
|
}, "factsStoreOver");
|
|
30623
30678
|
|
|
30624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
30625
30680
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
30626
30681
|
throw new CliError("validation_error", message2);
|
|
30627
30682
|
}, "invalid");
|
|
@@ -30711,7 +30766,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
30711
30766
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
30712
30767
|
}, "findingsCoreOver");
|
|
30713
30768
|
|
|
30714
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
30715
30770
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30716
30771
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30717
30772
|
var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -30857,7 +30912,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30857
30912
|
};
|
|
30858
30913
|
}, "proposedActionsStoreOver");
|
|
30859
30914
|
|
|
30860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
30861
30916
|
var stale = /* @__PURE__ */ __name(() => {
|
|
30862
30917
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
30863
30918
|
reason: "evidence-findings.stale"
|
|
@@ -31023,7 +31078,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31023
31078
|
};
|
|
31024
31079
|
}, "evidenceFindingsStoreOver");
|
|
31025
31080
|
|
|
31026
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
31027
31082
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31028
31083
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31029
31084
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31076,7 +31131,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31076
31131
|
}, "forPerson")
|
|
31077
31132
|
}), "involvementStoreOver");
|
|
31078
31133
|
|
|
31079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
31080
31135
|
import { createHash as createHash12 } from "node:crypto";
|
|
31081
31136
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31082
31137
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31162,16 +31217,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31162
31217
|
};
|
|
31163
31218
|
}, "meetingProjectsStoreOver");
|
|
31164
31219
|
|
|
31165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31166
31221
|
import { createHash as createHash15 } from "node:crypto";
|
|
31167
31222
|
|
|
31168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31169
31224
|
import { createHash as createHash14 } from "node:crypto";
|
|
31170
31225
|
|
|
31171
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31172
31227
|
import { createHash as createHash13 } from "node:crypto";
|
|
31173
31228
|
|
|
31174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
31175
31230
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31176
31231
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31177
31232
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31222,7 +31277,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31222
31277
|
return input;
|
|
31223
31278
|
}, "consolidationApplyInput");
|
|
31224
31279
|
|
|
31225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31226
31281
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31227
31282
|
id: String(row2.id),
|
|
31228
31283
|
sourceId: String(row2.source_id),
|
|
@@ -31297,7 +31352,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31297
31352
|
}, { beforeCommit: check3 });
|
|
31298
31353
|
}, "applyTagConsolidation");
|
|
31299
31354
|
|
|
31300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31301
31356
|
var selections = [
|
|
31302
31357
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31303
31358
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31441,7 +31496,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31441
31496
|
};
|
|
31442
31497
|
}, "previewRows");
|
|
31443
31498
|
|
|
31444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31445
31500
|
var kinds = ["project", "tag", "topic"];
|
|
31446
31501
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31447
31502
|
if (signal?.aborted)
|
|
@@ -31705,7 +31760,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31705
31760
|
};
|
|
31706
31761
|
}, "vocabularyStoreOver");
|
|
31707
31762
|
|
|
31708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
31709
31764
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
31710
31765
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
31711
31766
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -32097,7 +32152,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32097
32152
|
chosen = `${wanted.slice(0, 4 - suffix.length)}${suffix}`;
|
|
32098
32153
|
}
|
|
32099
32154
|
const at = now2();
|
|
32100
|
-
const row2 = database.prepare("INSERT INTO projects (key, name, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, description === void 0 ? null : textOf3(description, 2e3), oneOf5(type, PROJECT_TYPES, "a project's type"), organizationId, oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32155
|
+
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 : textOf3(description, 2e3), oneOf5(type, PROJECT_TYPES, "a project's type"), organizationId, oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32101
32156
|
return projectOf(row2);
|
|
32102
32157
|
}), "addProject"),
|
|
32103
32158
|
projects: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32105,7 +32160,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32105
32160
|
const where = query && queryFilter(query, {
|
|
32106
32161
|
id: { type: "kw", sql: "CAST(id AS TEXT)" },
|
|
32107
32162
|
key: { type: "kw", sql: "key" },
|
|
32108
|
-
name: { type: "kw", sql: "
|
|
32163
|
+
name: { type: "kw", sql: "name_folded", folded: true },
|
|
32109
32164
|
kind: { type: "enum", sql: `CASE WHEN length(key) = ${INBOX_KEY_LENGTH} THEN 'inbox' ELSE 'project' END` },
|
|
32110
32165
|
type: { type: "enum", sql: "type" },
|
|
32111
32166
|
organization_id: { type: "kw", sql: "CAST(organization_id AS TEXT)" },
|
|
@@ -32226,7 +32281,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32226
32281
|
return key2.padEnd(3, "X");
|
|
32227
32282
|
}, "projectKey");
|
|
32228
32283
|
|
|
32229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
32230
32285
|
var DAY4 = 864e5;
|
|
32231
32286
|
var SETTING4 = "logs_pruned_at";
|
|
32232
32287
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY4, botUpdatePayloadsMs: 30 * DAY4 };
|
|
@@ -32253,7 +32308,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32253
32308
|
};
|
|
32254
32309
|
}, "logPruner");
|
|
32255
32310
|
|
|
32256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32311
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
32257
32312
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32258
32313
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32259
32314
|
reason: "meeting-findings.stale"
|
|
@@ -32422,7 +32477,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32422
32477
|
};
|
|
32423
32478
|
}, "meetingFindingsStoreOver");
|
|
32424
32479
|
|
|
32425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
32426
32481
|
var RANK_BATCH = 512;
|
|
32427
32482
|
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";
|
|
32428
32483
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -32693,7 +32748,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
32693
32748
|
}
|
|
32694
32749
|
}), "meetingVectorsOver");
|
|
32695
32750
|
|
|
32696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
32697
32752
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
32698
32753
|
var TEXTS = {
|
|
32699
32754
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -32794,11 +32849,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32794
32849
|
};
|
|
32795
32850
|
}, "sourceMentionStoreOver");
|
|
32796
32851
|
|
|
32797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
32798
32853
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
32799
32854
|
import { dirname } from "node:path";
|
|
32800
32855
|
|
|
32801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
32802
32857
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
32803
32858
|
var CLIENTS_SETTING = "clients";
|
|
32804
32859
|
var coreVersion = (() => {
|
|
@@ -32856,7 +32911,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
32856
32911
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
32857
32912
|
}, "refusalAdvice");
|
|
32858
32913
|
|
|
32859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
32860
32915
|
var GENERATED = [
|
|
32861
32916
|
{
|
|
32862
32917
|
"name": "20261010184427_initial",
|
|
@@ -33650,10 +33705,62 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
33650
33705
|
"UPDATE calendar_entry_participants SET response = 'needs-action' WHERE response = 'needsAction';",
|
|
33651
33706
|
"UPDATE calendars SET access_role = 'free-busy' WHERE access_role = 'freeBusyReader';"
|
|
33652
33707
|
]
|
|
33708
|
+
},
|
|
33709
|
+
{
|
|
33710
|
+
"name": "20261029162435_version-36-attachment-contact",
|
|
33711
|
+
"statements": [
|
|
33712
|
+
"ALTER TABLE `attachments` ADD `contact` text;"
|
|
33713
|
+
]
|
|
33714
|
+
},
|
|
33715
|
+
{
|
|
33716
|
+
"name": "20261029180959_version-37-identity-phone",
|
|
33717
|
+
"statements": [
|
|
33718
|
+
"ALTER TABLE `identities` ADD `phone` text;"
|
|
33719
|
+
]
|
|
33720
|
+
},
|
|
33721
|
+
{
|
|
33722
|
+
"name": "20261029181000_version-37-contact-mention-triggers",
|
|
33723
|
+
"statements": [
|
|
33724
|
+
"-- A shared contact card has no text, only a phone: queue it for mentions like an attachment's text.\n-- Cards stored before version 37 wait for `mentions rebuild`.\nCREATE TRIGGER mention_pending_attachment_contact_ai AFTER INSERT ON attachments\n WHEN new.attachable_type = 'message' AND new.contact IS NOT NULL BEGIN\n INSERT OR IGNORE INTO mention_pending (source_type, source_id) VALUES ('attachment', new.id);\nEND;",
|
|
33725
|
+
"CREATE TRIGGER mention_pending_attachment_contact_au AFTER UPDATE OF contact ON attachments\n WHEN new.attachable_type = 'message' AND old.contact IS NOT new.contact BEGIN\n INSERT OR IGNORE INTO mention_pending (source_type, source_id) VALUES ('attachment', new.id);\nEND;"
|
|
33726
|
+
]
|
|
33727
|
+
},
|
|
33728
|
+
{
|
|
33729
|
+
"name": "20261029224106_version-38-folded-names",
|
|
33730
|
+
"statements": [
|
|
33731
|
+
"ALTER TABLE `chats` ADD `title_folded` text;",
|
|
33732
|
+
"ALTER TABLE `email_threads` ADD `subject_folded` text;",
|
|
33733
|
+
"ALTER TABLE `identities` ADD `name_folded` text;",
|
|
33734
|
+
"ALTER TABLE `mailboxes` ADD `name_folded` text;",
|
|
33735
|
+
"ALTER TABLE `projects` ADD `name_folded` text;",
|
|
33736
|
+
"CREATE INDEX `chats_title_to_fold` ON `chats` (`id`) WHERE title IS NOT NULL AND title_folded IS NULL;",
|
|
33737
|
+
"CREATE INDEX `email_threads_subject_to_fold` ON `email_threads` (`id`) WHERE subject IS NOT NULL AND subject_folded IS NULL;",
|
|
33738
|
+
"CREATE INDEX `identities_name_to_fold` ON `identities` (`id`) WHERE name IS NOT NULL AND name_folded IS NULL;",
|
|
33739
|
+
"CREATE INDEX `mailboxes_by_name_folded` ON `mailboxes` (`name_folded`);",
|
|
33740
|
+
"CREATE INDEX `mailboxes_name_to_fold` ON `mailboxes` (`id`) WHERE name_folded IS NULL;",
|
|
33741
|
+
"CREATE INDEX `projects_by_name_folded` ON `projects` (`name_folded`);",
|
|
33742
|
+
"CREATE INDEX `projects_name_to_fold` ON `projects` (`id`) WHERE name_folded IS NULL;"
|
|
33743
|
+
]
|
|
33744
|
+
},
|
|
33745
|
+
{
|
|
33746
|
+
"name": "20261029224107_version-38-folded-triggers",
|
|
33747
|
+
"statements": [
|
|
33748
|
+
"-- A build older than 38, or a write that forgets the copy, changes a name without its folded copy: empty the copy\n-- so the next open refills it (fillFolded) rather than leave a stale one that filters would trust.\nCREATE TRIGGER tasks_title_folded_au AFTER UPDATE OF title ON tasks\n WHEN new.title IS NOT old.title AND new.title_folded IS old.title_folded BEGIN\n UPDATE tasks SET title_folded = NULL WHERE id = new.id;\nEND;",
|
|
33749
|
+
"CREATE TRIGGER tasks_close_reason_folded_au AFTER UPDATE OF close_reason ON tasks\n WHEN new.close_reason IS NOT old.close_reason AND new.close_reason_folded IS old.close_reason_folded BEGIN\n UPDATE tasks SET close_reason_folded = NULL WHERE id = new.id;\nEND;",
|
|
33750
|
+
"CREATE TRIGGER attachments_name_folded_au AFTER UPDATE OF name ON attachments\n WHEN new.name IS NOT old.name AND new.name_folded IS old.name_folded BEGIN\n UPDATE attachments SET name_folded = NULL WHERE id = new.id;\nEND;",
|
|
33751
|
+
"CREATE TRIGGER attachments_local_path_folded_au AFTER UPDATE OF local_path ON attachments\n WHEN new.local_path IS NOT old.local_path AND new.local_path_folded IS old.local_path_folded BEGIN\n UPDATE attachments SET local_path_folded = NULL WHERE id = new.id;\nEND;",
|
|
33752
|
+
"CREATE TRIGGER meetings_title_folded_au AFTER UPDATE OF title ON meetings\n WHEN new.title IS NOT old.title AND new.title_folded IS old.title_folded BEGIN\n UPDATE meetings SET title_folded = NULL WHERE id = new.id;\nEND;",
|
|
33753
|
+
"CREATE TRIGGER files_path_folded_au AFTER UPDATE OF path ON files\n WHEN new.path IS NOT old.path AND new.path_folded IS old.path_folded BEGIN\n UPDATE files SET path_folded = NULL WHERE id = new.id;\nEND;",
|
|
33754
|
+
"CREATE TRIGGER projects_name_folded_au AFTER UPDATE OF name ON projects\n WHEN new.name IS NOT old.name AND new.name_folded IS old.name_folded BEGIN\n UPDATE projects SET name_folded = NULL WHERE id = new.id;\nEND;",
|
|
33755
|
+
"CREATE TRIGGER chats_title_folded_au AFTER UPDATE OF title ON chats\n WHEN new.title IS NOT old.title AND new.title_folded IS old.title_folded BEGIN\n UPDATE chats SET title_folded = NULL WHERE id = new.id;\nEND;",
|
|
33756
|
+
"CREATE TRIGGER identities_name_folded_au AFTER UPDATE OF name ON identities\n WHEN new.name IS NOT old.name AND new.name_folded IS old.name_folded BEGIN\n UPDATE identities SET name_folded = NULL WHERE id = new.id;\nEND;",
|
|
33757
|
+
"CREATE TRIGGER email_threads_subject_folded_au AFTER UPDATE OF subject ON email_threads\n WHEN new.subject IS NOT old.subject AND new.subject_folded IS old.subject_folded BEGIN\n UPDATE email_threads SET subject_folded = NULL WHERE id = new.id;\nEND;",
|
|
33758
|
+
"CREATE TRIGGER mailboxes_name_folded_au AFTER UPDATE OF name ON mailboxes\n WHEN new.name IS NOT old.name AND new.name_folded IS old.name_folded BEGIN\n UPDATE mailboxes SET name_folded = NULL WHERE id = new.id;\nEND;"
|
|
33759
|
+
]
|
|
33653
33760
|
}
|
|
33654
33761
|
];
|
|
33655
33762
|
|
|
33656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
33657
33764
|
var MANIFEST = [
|
|
33658
33765
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
33659
33766
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -33700,7 +33807,12 @@ var MANIFEST = [
|
|
|
33700
33807
|
{ name: "20261025182500_version-34-vector-index", version: 34, minCompatible: 34 },
|
|
33701
33808
|
{ name: "20261025182501_version-34-vector-index-triggers", version: 34, minCompatible: 34 },
|
|
33702
33809
|
{ name: "20261027102259_version-35-calendar-neutral", version: 35, minCompatible: 34 },
|
|
33703
|
-
{ name: "20261027102302_version-35-calendar-neutral-data", version: 35, minCompatible: 34 }
|
|
33810
|
+
{ name: "20261027102302_version-35-calendar-neutral-data", version: 35, minCompatible: 34 },
|
|
33811
|
+
{ name: "20261029162435_version-36-attachment-contact", version: 36, minCompatible: 34 },
|
|
33812
|
+
{ name: "20261029180959_version-37-identity-phone", version: 37, minCompatible: 34 },
|
|
33813
|
+
{ name: "20261029181000_version-37-contact-mention-triggers", version: 37, minCompatible: 34 },
|
|
33814
|
+
{ name: "20261029224106_version-38-folded-names", version: 38, minCompatible: 34 },
|
|
33815
|
+
{ name: "20261029224107_version-38-folded-triggers", version: 38, minCompatible: 34 }
|
|
33704
33816
|
];
|
|
33705
33817
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
33706
33818
|
const migrations = [];
|
|
@@ -33724,7 +33836,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
33724
33836
|
return migrations;
|
|
33725
33837
|
}, "generatedMigrations");
|
|
33726
33838
|
|
|
33727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
33728
33840
|
var MIGRATIONS = generatedMigrations();
|
|
33729
33841
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
33730
33842
|
version INTEGER PRIMARY KEY,
|
|
@@ -33777,7 +33889,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
33777
33889
|
}
|
|
33778
33890
|
}, "migrate");
|
|
33779
33891
|
|
|
33780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
33781
33893
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
33782
33894
|
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 ?");
|
|
33783
33895
|
if (pending.get(0, 1) === void 0)
|
|
@@ -33799,7 +33911,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
33799
33911
|
}
|
|
33800
33912
|
}, "fillJoinKeys");
|
|
33801
33913
|
|
|
33802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
33803
33915
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
33804
33916
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
33805
33917
|
try {
|
|
@@ -33812,8 +33924,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
33812
33924
|
}, "openSqlite");
|
|
33813
33925
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33814
33926
|
quietSqliteWarning();
|
|
33815
|
-
const { drizzle } = await import("./node-
|
|
33816
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
33927
|
+
const { drizzle } = await import("./node-YWT7RFN6.js");
|
|
33928
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-LVHTONMA.js");
|
|
33817
33929
|
const client = await nodeClient(path, { readOnly });
|
|
33818
33930
|
try {
|
|
33819
33931
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33823,8 +33935,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33823
33935
|
}
|
|
33824
33936
|
}, "openUnderNode");
|
|
33825
33937
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33826
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
33827
|
-
const { drizzle } = await import("./bun-
|
|
33938
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KB6PSTWH.js");
|
|
33939
|
+
const { drizzle } = await import("./bun-SMH7PKUS.js");
|
|
33828
33940
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
33829
33941
|
try {
|
|
33830
33942
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33834,7 +33946,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33834
33946
|
}
|
|
33835
33947
|
}, "openUnderBun");
|
|
33836
33948
|
|
|
33837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
33838
33950
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
33839
33951
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
33840
33952
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -33849,7 +33961,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
33849
33961
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
33850
33962
|
}, "assertReadCompatible");
|
|
33851
33963
|
|
|
33852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
33853
33965
|
var BACKFILL_ON_OPEN = 5e3;
|
|
33854
33966
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
33855
33967
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -33905,10 +34017,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
33905
34017
|
}
|
|
33906
34018
|
}, "openStoreContext");
|
|
33907
34019
|
|
|
33908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
33909
34021
|
import { createHash as createHash16 } from "node:crypto";
|
|
33910
34022
|
|
|
33911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
33912
34024
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
33913
34025
|
var ref = text3(2048);
|
|
33914
34026
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -33974,7 +34086,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
33974
34086
|
}))
|
|
33975
34087
|
});
|
|
33976
34088
|
|
|
33977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34089
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
33978
34090
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
33979
34091
|
var invalid7 = /* @__PURE__ */ __name((field3) => {
|
|
33980
34092
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34078,7 +34190,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
34078
34190
|
invalid7("external.unused");
|
|
34079
34191
|
}, "validateProjectAnnotationsGraph");
|
|
34080
34192
|
|
|
34081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34193
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34082
34194
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34083
34195
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34084
34196
|
var targetSchema = strictObject({
|
|
@@ -34184,7 +34296,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34184
34296
|
};
|
|
34185
34297
|
}, "planBoundProjectAnnotations");
|
|
34186
34298
|
|
|
34187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34299
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
34188
34300
|
import { createHash as createHash17 } from "node:crypto";
|
|
34189
34301
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34190
34302
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34278,7 +34390,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34278
34390
|
})).digest("hex");
|
|
34279
34391
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34280
34392
|
|
|
34281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
34282
34394
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34283
34395
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34284
34396
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34295,7 +34407,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34295
34407
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34296
34408
|
}, "projectAnnotationRequest");
|
|
34297
34409
|
|
|
34298
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
34299
34411
|
var SnapshotBudget = class {
|
|
34300
34412
|
static {
|
|
34301
34413
|
__name(this, "SnapshotBudget");
|
|
@@ -34321,13 +34433,13 @@ var SnapshotBudget = class {
|
|
|
34321
34433
|
}
|
|
34322
34434
|
};
|
|
34323
34435
|
|
|
34324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34325
34437
|
import { createHash as createHash19 } from "node:crypto";
|
|
34326
34438
|
|
|
34327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
34328
34440
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34329
34441
|
|
|
34330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
34331
34443
|
import { createHash as createHash18 } from "node:crypto";
|
|
34332
34444
|
var invalid9 = /* @__PURE__ */ __name(() => {
|
|
34333
34445
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -34470,7 +34582,7 @@ var ProjectSnapshotSources = class {
|
|
|
34470
34582
|
}
|
|
34471
34583
|
};
|
|
34472
34584
|
|
|
34473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
34474
34586
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
34475
34587
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
34476
34588
|
}, "unsupported");
|
|
@@ -34641,7 +34753,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
34641
34753
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
34642
34754
|
}), "projectAnnotationSnapshot");
|
|
34643
34755
|
|
|
34644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34756
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34645
34757
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
34646
34758
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
34647
34759
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -34703,7 +34815,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
34703
34815
|
};
|
|
34704
34816
|
}), "previewAnnotationSnapshot");
|
|
34705
34817
|
|
|
34706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
34707
34819
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
34708
34820
|
const mappings = { ...bindings };
|
|
34709
34821
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -34745,7 +34857,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
34745
34857
|
return mappings;
|
|
34746
34858
|
}, "restoreAnnotationRecords");
|
|
34747
34859
|
|
|
34748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
34749
34861
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34750
34862
|
async preview(request) {
|
|
34751
34863
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -34775,7 +34887,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34775
34887
|
}
|
|
34776
34888
|
}), "projectAnnotationStoreOver");
|
|
34777
34889
|
|
|
34778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
34779
34891
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
34780
34892
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
34781
34893
|
let merged = { from: from2, to };
|
|
@@ -34788,7 +34900,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
34788
34900
|
}, "markRange");
|
|
34789
34901
|
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");
|
|
34790
34902
|
|
|
34791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
34792
34904
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
34793
34905
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
34794
34906
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -34798,7 +34910,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
34798
34910
|
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);
|
|
34799
34911
|
}, "setTaskRulesStop");
|
|
34800
34912
|
|
|
34801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
34802
34914
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34803
34915
|
const { database } = context;
|
|
34804
34916
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -34854,7 +34966,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34854
34966
|
};
|
|
34855
34967
|
}, "syncStoreOver");
|
|
34856
34968
|
|
|
34857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34969
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
34858
34970
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34859
34971
|
const { database } = context;
|
|
34860
34972
|
return {
|
|
@@ -34876,7 +34988,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34876
34988
|
};
|
|
34877
34989
|
}, "tagsStoreOver");
|
|
34878
34990
|
|
|
34879
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
34880
34992
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
34881
34993
|
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
|
|
34882
34994
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35003,7 +35115,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35003
35115
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35004
35116
|
}, "savePictureChunks");
|
|
35005
35117
|
|
|
35006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
35007
35119
|
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,
|
|
35008
35120
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35009
35121
|
FROM messages m
|
|
@@ -35086,7 +35198,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35086
35198
|
return plain2(best(found2));
|
|
35087
35199
|
}, "nearestMessages");
|
|
35088
35200
|
|
|
35089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
35090
35202
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35091
35203
|
const { database } = context;
|
|
35092
35204
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35340,7 +35452,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35340
35452
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35341
35453
|
}), "vectorsStoreOver");
|
|
35342
35454
|
|
|
35343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
35344
35456
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35345
35457
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35346
35458
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -35428,10 +35540,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
35428
35540
|
}
|
|
35429
35541
|
}, "lastBackup");
|
|
35430
35542
|
|
|
35431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35543
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
35432
35544
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
35433
35545
|
|
|
35434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35546
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
35435
35547
|
var COUNTED_TABLES = [
|
|
35436
35548
|
"accounts",
|
|
35437
35549
|
"chats",
|
|
@@ -35516,7 +35628,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
35516
35628
|
};
|
|
35517
35629
|
}, "storeContents");
|
|
35518
35630
|
|
|
35519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.484.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._745f5d1ffb248c61bc3ef77928e0c2a2/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
35520
35632
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
35521
35633
|
const context = await openStoreContext(options);
|
|
35522
35634
|
try {
|