@wirecat/tg-cli 0.106.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-TIGHDHUK.js → adapter-PN5AXCJ7.js} +37 -37
- package/dist/bundle/{all-profiles-N4DLSGWY.js → all-profiles-SDHNKZQQ.js} +5 -5
- package/dist/bundle/{anthropic-D2T2QRLR.js → anthropic-F3BXQLYB.js} +3 -3
- package/dist/bundle/{app-server-FZTDNSPB.js → app-server-XDKMWVCD.js} +34 -34
- package/dist/bundle/{bot-api-OMUV6EIK.js → bot-api-YXJL4CEV.js} +38 -38
- package/dist/bundle/{bot-history-P2MWYLXW.js → bot-history-SDLHR7PV.js} +10 -10
- package/dist/bundle/{bun-UA5PRMLC.js → bun-SMH7PKUS.js} +2 -2
- package/dist/bundle/{bun-sqlite-XVRVJ7A2.js → bun-sqlite-KB6PSTWH.js} +2 -2
- package/dist/bundle/{chunk-T4UTTH3A.js → chunk-3UEFJ75D.js} +1 -1
- package/dist/bundle/{chunk-ID6TO5P5.js → chunk-44UANKAI.js} +9 -9
- package/dist/bundle/{chunk-R2F6U4F3.js → chunk-465FPHSG.js} +7 -7
- package/dist/bundle/{chunk-C2MKA7SX.js → chunk-53QVFV34.js} +1 -1
- package/dist/bundle/{chunk-PEIDCYF5.js → chunk-53RW4KLL.js} +1 -1
- package/dist/bundle/{chunk-7P6ZCUPN.js → chunk-5QBTHR57.js} +2 -2
- package/dist/bundle/{chunk-QQYM26DA.js → chunk-6FSG6QZH.js} +1 -1
- package/dist/bundle/{chunk-XFXTB522.js → chunk-A4DS5ANQ.js} +1 -1
- package/dist/bundle/{chunk-LGKLQE2I.js → chunk-AWBJSYX6.js} +1 -1
- package/dist/bundle/{chunk-ADLIUGL2.js → chunk-BGVODG6P.js} +2 -2
- package/dist/bundle/{chunk-T3ZLOMWW.js → chunk-BMXGEQDA.js} +4 -4
- package/dist/bundle/{chunk-AQSKZMBD.js → chunk-BYDDYOF4.js} +7 -7
- package/dist/bundle/{chunk-JOSUY2NX.js → chunk-CJJVFGFX.js} +1 -1
- package/dist/bundle/{chunk-WLGQTYIO.js → chunk-DBZVF73F.js} +2 -2
- package/dist/bundle/{chunk-XQV7EMAI.js → chunk-DFZBGU4G.js} +4 -4
- package/dist/bundle/{chunk-LSP2NCNL.js → chunk-GGAG3G7B.js} +47 -47
- package/dist/bundle/{chunk-QWTHUKS4.js → chunk-GJS26XEB.js} +4 -4
- package/dist/bundle/{chunk-EW3Y44NV.js → chunk-H4LIQVPN.js} +9 -9
- package/dist/bundle/{chunk-6BQUCCBD.js → chunk-IY7IEM56.js} +4 -4
- package/dist/bundle/{chunk-2J3TUUCO.js → chunk-JAWXJILO.js} +2 -2
- package/dist/bundle/{chunk-GD6BOLZP.js → chunk-JZOXKRDG.js} +11 -6
- package/dist/bundle/{chunk-T5OFRHDS.js → chunk-KROO42KC.js} +5 -5
- package/dist/bundle/{chunk-WPRLG5SL.js → chunk-LA2OUJK5.js} +8 -8
- package/dist/bundle/{chunk-BLWCHZCW.js → chunk-MOZX3JX3.js} +2 -2
- package/dist/bundle/{chunk-2GQCWNX5.js → chunk-NCWB3KXP.js} +1 -1
- package/dist/bundle/{chunk-QI75LME5.js → chunk-NMTFZNFU.js} +26 -26
- package/dist/bundle/{chunk-E5Z4FGRD.js → chunk-NSQL3YRD.js} +20 -20
- package/dist/bundle/{chunk-XMKKBDEW.js → chunk-NUVHRCUK.js} +276 -259
- package/dist/bundle/{chunk-BZUO2KFV.js → chunk-O7VQHFMZ.js} +1 -1
- package/dist/bundle/{chunk-6XXI3AHJ.js → chunk-OIHAM73W.js} +1 -1
- package/dist/bundle/{chunk-PAHBZPZN.js → chunk-P4A27ETD.js} +46 -46
- package/dist/bundle/{chunk-ELQ5ORY2.js → chunk-P5KMLJQR.js} +195 -195
- package/dist/bundle/{chunk-EUTOFAUT.js → chunk-P5UG655O.js} +2 -2
- package/dist/bundle/{recognize-T5TPTI6P.js → chunk-PYRJO6B3.js} +6 -6
- package/dist/bundle/{chunk-C6NTI37N.js → chunk-REJM262E.js} +10 -10
- package/dist/bundle/{chunk-EPKGNUOZ.js → chunk-RGNKRI5T.js} +20 -20
- package/dist/bundle/{chunk-XXLAGQDN.js → chunk-STGY3EAZ.js} +1 -1
- package/dist/bundle/{chunk-VYFKWPIS.js → chunk-TEHAIU6I.js} +42 -42
- package/dist/bundle/{chunk-V7OXTQBY.js → chunk-TFV4UPQZ.js} +3 -3
- package/dist/bundle/{chunk-PHPXTRMS.js → chunk-TKCZYJAT.js} +374 -308
- package/dist/bundle/{chunk-XX37LKXG.js → chunk-VMKPRAIB.js} +4 -4
- package/dist/bundle/{chunk-GHAQXUH3.js → chunk-WFG7KFM4.js} +1 -1
- package/dist/bundle/{chunk-ONK66VVG.js → chunk-WS3S7DXT.js} +1 -1
- package/dist/bundle/{chunk-DECFDUNW.js → chunk-WXIGT6FY.js} +11 -11
- package/dist/bundle/{chunk-FO33YFWF.js → chunk-X7M7YZPF.js} +5 -5
- package/dist/bundle/{chunk-DC7O7TVJ.js → chunk-YA44IPCS.js} +1 -1
- package/dist/bundle/{chunk-67GS5BZI.js → chunk-YSDA3EWT.js} +92 -92
- package/dist/bundle/{command-contract-N5FA573V.js → command-contract-B4DA4MXP.js} +12 -12
- package/dist/bundle/decode-WEP3HD56.js +159 -0
- package/dist/bundle/{echarts-WLPTUTMR.js → echarts-MRMILSAF.js} +2 -2
- package/dist/bundle/{embed-IALJOWZJ.js → embed-LCLTUVUD.js} +3 -3
- package/dist/bundle/{embedder-ZY2TS2XJ.js → embedder-O4WNEXUC.js} +6 -6
- package/dist/bundle/{entry-67RA75VS.js → entry-7HDX6BDR.js} +3 -3
- package/dist/bundle/{first-run-QN3UUBJW.js → first-run-M7YVVQJS.js} +5 -5
- package/dist/bundle/{first-screen-FK4ZJQJY.js → first-screen-MXW3UZFB.js} +13 -13
- package/dist/bundle/{identity-X3YA364I.js → identity-EEMHQOTN.js} +1 -1
- package/dist/bundle/{instructions-355MU4CT.js → instructions-YIH3J4TI.js} +1 -1
- package/dist/bundle/{node-UGJWZLVB.js → node-YWT7RFN6.js} +2 -2
- package/dist/bundle/{node-sqlite-FJFIOC3K.js → node-sqlite-LVHTONMA.js} +2 -2
- package/dist/bundle/{oauth-EZGVL3PP.js → oauth-CADZB7TT.js} +4 -4
- package/dist/bundle/{open-ANYJ5AKD.js → open-AMRU27KK.js} +1 -1
- package/dist/bundle/{process-JVAQXITD.js → process-JC76J5UD.js} +1 -1
- package/dist/bundle/{program-QGSZY5SZ.js → program-FI6MTY2V.js} +40 -40
- package/dist/bundle/{prompt-EWF4ZSJO.js → prompt-SPYTHKHN.js} +2 -2
- package/dist/bundle/recognize-G5VVM6MU.js +22 -0
- package/dist/bundle/{remote-KOAALKIC.js → remote-Z3HW42CH.js} +4 -4
- package/dist/bundle/{rerank-MCXFZFRH.js → rerank-QJ5NLZUU.js} +4 -4
- package/dist/bundle/{serve-QEVXXJ2G.js → serve-3I4C6Y5X.js} +6 -6
- package/dist/bundle/{server-Y3ZLG44J.js → server-2L4BONHN.js} +26 -26
- package/dist/bundle/server-7TJ337SR.js +55 -0
- package/dist/bundle/{state-F2ZJV2VP.js → state-IXZYPH46.js} +3 -3
- package/dist/bundle/{store-QX7HBTOW.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/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/server-6QM3GFZX.js +0 -55
- package/dist/bundle/store-maintenance-command-ZBOQSTHY.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(),
|
|
@@ -930,10 +930,12 @@ var identities = sqliteTable("identities", {
|
|
|
930
930
|
updatedAt: integer("updated_at").notNull(),
|
|
931
931
|
description: text("description"),
|
|
932
932
|
email: text("email"),
|
|
933
|
-
phone: text("phone")
|
|
933
|
+
phone: text("phone"),
|
|
934
|
+
nameFolded: text("name_folded")
|
|
934
935
|
}, (table) => [
|
|
935
936
|
unique().on(table.provider, table.externalId),
|
|
936
|
-
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`)
|
|
937
939
|
]);
|
|
938
940
|
var identityLinks = sqliteTable("identity_links", {
|
|
939
941
|
identityId: integer("identity_id").primaryKey().references(() => identities.id),
|
|
@@ -1074,10 +1076,12 @@ var chats = sqliteTable("chats", {
|
|
|
1074
1076
|
mutedUntil: integer("muted_until"),
|
|
1075
1077
|
archived: integer("archived"),
|
|
1076
1078
|
markedUnread: integer("marked_unread"),
|
|
1077
|
-
unreadCountedAt: integer("unread_counted_at")
|
|
1079
|
+
unreadCountedAt: integer("unread_counted_at"),
|
|
1080
|
+
titleFolded: text("title_folded")
|
|
1078
1081
|
}, (table) => [
|
|
1079
1082
|
unique().on(table.accountId, table.externalId),
|
|
1080
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`),
|
|
1081
1085
|
index("chats_by_parent_chat_id").on(table.parentChatId)
|
|
1082
1086
|
]);
|
|
1083
1087
|
var chatMembers = sqliteTable("chat_members", {
|
|
@@ -1308,8 +1312,12 @@ var emailThreads = sqliteTable("email_threads", {
|
|
|
1308
1312
|
metadata: text("metadata"),
|
|
1309
1313
|
createdAt: integer("created_at").notNull(),
|
|
1310
1314
|
updatedAt: integer("updated_at").notNull(),
|
|
1311
|
-
deletedAt: integer("deleted_at")
|
|
1312
|
-
|
|
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
|
+
]);
|
|
1313
1321
|
var emails = sqliteTable("emails", {
|
|
1314
1322
|
id: integer("id").primaryKey(),
|
|
1315
1323
|
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
@@ -1378,8 +1386,13 @@ var mailboxes = sqliteTable("mailboxes", {
|
|
|
1378
1386
|
name: text("name").notNull(),
|
|
1379
1387
|
kind: text("kind"),
|
|
1380
1388
|
createdAt: integer("created_at").notNull(),
|
|
1381
|
-
updatedAt: integer("updated_at").notNull()
|
|
1382
|
-
|
|
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
|
+
]);
|
|
1383
1396
|
var emailMailboxes = sqliteTable("email_mailboxes", {
|
|
1384
1397
|
emailId: integer("email_id").notNull().references(() => emails.id),
|
|
1385
1398
|
mailboxId: integer("mailbox_id").notNull().references(() => mailboxes.id),
|
|
@@ -1846,8 +1859,11 @@ var projects = sqliteTable("projects", {
|
|
|
1846
1859
|
status: text("status"),
|
|
1847
1860
|
createdAt: integer("created_at").notNull(),
|
|
1848
1861
|
updatedAt: integer("updated_at").notNull(),
|
|
1849
|
-
deletedAt: integer("deleted_at")
|
|
1862
|
+
deletedAt: integer("deleted_at"),
|
|
1863
|
+
nameFolded: text("name_folded")
|
|
1850
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`),
|
|
1851
1867
|
index("projects_by_organization_id").on(table.organizationId),
|
|
1852
1868
|
index("projects_by_account_id").on(table.accountId),
|
|
1853
1869
|
index("projects_by_owner_type_owner_id").on(table.ownerType, table.ownerId)
|
|
@@ -2318,7 +2334,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2318
2334
|
at: integer("at").notNull()
|
|
2319
2335
|
});
|
|
2320
2336
|
|
|
2321
|
-
// 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
|
|
2322
2338
|
var ARMS = [
|
|
2323
2339
|
[
|
|
2324
2340
|
"message",
|
|
@@ -2445,7 +2461,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2445
2461
|
return recomputed;
|
|
2446
2462
|
}, "drainInvolvementQueue");
|
|
2447
2463
|
|
|
2448
|
-
// 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
|
|
2449
2465
|
import { domainToUnicode } from "node:url";
|
|
2450
2466
|
|
|
2451
2467
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12467,7 +12483,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12467
12483
|
}, "oa");
|
|
12468
12484
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12469
12485
|
|
|
12470
|
-
// 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
|
|
12471
12487
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12472
12488
|
var ID = /^[\w-]{10,}$/;
|
|
12473
12489
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12508,7 +12524,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12508
12524
|
return { url, documentId: googleDocumentId(url) };
|
|
12509
12525
|
}), "googleDocumentLinks");
|
|
12510
12526
|
|
|
12511
|
-
// 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
|
|
12512
12528
|
var PHONE_PLANS = [
|
|
12513
12529
|
{
|
|
12514
12530
|
country: "us",
|
|
@@ -12888,7 +12904,7 @@ var PHONE_PLANS = [
|
|
|
12888
12904
|
}
|
|
12889
12905
|
];
|
|
12890
12906
|
|
|
12891
|
-
// 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
|
|
12892
12908
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12893
12909
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12894
12910
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12929,7 +12945,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12929
12945
|
return void 0;
|
|
12930
12946
|
}, "nationalPhone");
|
|
12931
12947
|
|
|
12932
|
-
// 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
|
|
12933
12949
|
var BEFORE = [
|
|
12934
12950
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12935
12951
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13189,7 +13205,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13189
13205
|
return found2.sort((a, b) => a.start - b.start);
|
|
13190
13206
|
}, "findPlaces");
|
|
13191
13207
|
|
|
13192
|
-
// 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
|
|
13193
13209
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13194
13210
|
var MENTION_VERSIONS = {
|
|
13195
13211
|
phone: 1,
|
|
@@ -13379,7 +13395,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13379
13395
|
};
|
|
13380
13396
|
}, "typedPhone");
|
|
13381
13397
|
|
|
13382
|
-
// 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
|
|
13383
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";
|
|
13384
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";
|
|
13385
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";
|
|
@@ -13387,7 +13403,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13387
13403
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13388
13404
|
var NAME_WORDS = WORDS.split(" ");
|
|
13389
13405
|
|
|
13390
|
-
// 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
|
|
13391
13407
|
var LATIN_TO_CYRILLIC = {
|
|
13392
13408
|
shch: "\u0449",
|
|
13393
13409
|
sch: "\u0449",
|
|
@@ -13595,7 +13611,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13595
13611
|
return found2;
|
|
13596
13612
|
}, "findUnknownNames");
|
|
13597
13613
|
|
|
13598
|
-
// 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
|
|
13599
13615
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13600
13616
|
"webpage",
|
|
13601
13617
|
"share",
|
|
@@ -13627,7 +13643,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13627
13643
|
});
|
|
13628
13644
|
}, "matchDownloads");
|
|
13629
13645
|
|
|
13630
|
-
// 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
|
|
13631
13647
|
var QUERY_VERSION = 1;
|
|
13632
13648
|
var QUERY_LIMITS2 = {
|
|
13633
13649
|
...QUERY_LIMITS,
|
|
@@ -13658,7 +13674,7 @@ function exhausted(budget) {
|
|
|
13658
13674
|
}
|
|
13659
13675
|
__name(exhausted, "exhausted");
|
|
13660
13676
|
|
|
13661
|
-
// 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
|
|
13662
13678
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13663
13679
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13664
13680
|
kind: "char",
|
|
@@ -14058,7 +14074,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14058
14074
|
return out;
|
|
14059
14075
|
}, "foldRegex");
|
|
14060
14076
|
|
|
14061
|
-
// 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
|
|
14062
14078
|
var PRESET_VERSION = 1;
|
|
14063
14079
|
var PRESETS = {
|
|
14064
14080
|
password: {
|
|
@@ -14112,7 +14128,7 @@ var PRESETS = {
|
|
|
14112
14128
|
}
|
|
14113
14129
|
};
|
|
14114
14130
|
|
|
14115
|
-
// 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
|
|
14116
14132
|
var FIELD_VERSION = 2;
|
|
14117
14133
|
var UNITS = {
|
|
14118
14134
|
"": 1,
|
|
@@ -14222,7 +14238,7 @@ var QUERY_FIELDS = [
|
|
|
14222
14238
|
aliases: [],
|
|
14223
14239
|
type: "kw",
|
|
14224
14240
|
operators: terms,
|
|
14225
|
-
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",
|
|
14226
14242
|
support: "A1"
|
|
14227
14243
|
},
|
|
14228
14244
|
{
|
|
@@ -14561,12 +14577,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
14561
14577
|
return validateFields(parsed2.output);
|
|
14562
14578
|
}, "validateAst");
|
|
14563
14579
|
|
|
14564
|
-
// 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
|
|
14565
14581
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14566
14582
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14567
14583
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14568
14584
|
|
|
14569
|
-
// 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
|
|
14570
14586
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14571
14587
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14572
14588
|
var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
@@ -14590,7 +14606,7 @@ var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
|
14590
14606
|
};
|
|
14591
14607
|
}, "linkMatch");
|
|
14592
14608
|
|
|
14593
|
-
// 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
|
|
14594
14610
|
var SETTING = "phoneCountries";
|
|
14595
14611
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14596
14612
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14621,7 +14637,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14621
14637
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14622
14638
|
}, "valueMatch");
|
|
14623
14639
|
|
|
14624
|
-
// 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
|
|
14625
14641
|
var SCHEME = "msg:";
|
|
14626
14642
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
14627
14643
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -14635,7 +14651,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
14635
14651
|
return { provider, account, chat: chat2, message: message2 };
|
|
14636
14652
|
}, "parseLocator");
|
|
14637
14653
|
|
|
14638
|
-
// 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
|
|
14639
14655
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14640
14656
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14641
14657
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14663,7 +14679,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14663
14679
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14664
14680
|
}, "vocabularySimilarity");
|
|
14665
14681
|
|
|
14666
|
-
// 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
|
|
14667
14683
|
import { createHash } from "node:crypto";
|
|
14668
14684
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14669
14685
|
try {
|
|
@@ -14729,7 +14745,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14729
14745
|
});
|
|
14730
14746
|
}, "guardTagCreation");
|
|
14731
14747
|
|
|
14732
|
-
// 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
|
|
14733
14749
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
14734
14750
|
throw new CliError("validation_error", message2);
|
|
14735
14751
|
}, "invalid");
|
|
@@ -14806,7 +14822,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14806
14822
|
};
|
|
14807
14823
|
}, "createTagRedirectIndex");
|
|
14808
14824
|
|
|
14809
|
-
// 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
|
|
14810
14826
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14811
14827
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14812
14828
|
if (!row2)
|
|
@@ -14834,7 +14850,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14834
14850
|
return snapshot2;
|
|
14835
14851
|
}, "tagRedirectSnapshot");
|
|
14836
14852
|
|
|
14837
|
-
// 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
|
|
14838
14854
|
import { createHash as createHash2 } from "node:crypto";
|
|
14839
14855
|
var TASK_KEY_PREFIXES = {
|
|
14840
14856
|
question: "Q",
|
|
@@ -14862,7 +14878,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14862
14878
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14863
14879
|
}, "taskAccountOf");
|
|
14864
14880
|
|
|
14865
|
-
// 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
|
|
14866
14882
|
var SIMPLE_REFERENCES = [
|
|
14867
14883
|
"note",
|
|
14868
14884
|
"document",
|
|
@@ -14934,7 +14950,7 @@ var folderPath = /* @__PURE__ */ __name((path) => {
|
|
|
14934
14950
|
}, "folderPath");
|
|
14935
14951
|
var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
|
|
14936
14952
|
|
|
14937
|
-
// 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
|
|
14938
14954
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14939
14955
|
var REFERABLE = {
|
|
14940
14956
|
note: { tombstone: true },
|
|
@@ -15092,7 +15108,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15092
15108
|
}, "taskIdOf");
|
|
15093
15109
|
var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
|
|
15094
15110
|
|
|
15095
|
-
// 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
|
|
15096
15112
|
var toMs = /* @__PURE__ */ __name((iso10) => {
|
|
15097
15113
|
if (iso10 === null || iso10 === void 0)
|
|
15098
15114
|
return null;
|
|
@@ -15106,7 +15122,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15106
15122
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15107
15123
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15108
15124
|
|
|
15109
|
-
// 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
|
|
15110
15126
|
var TAG_KINDS = ["tag", "topic"];
|
|
15111
15127
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15112
15128
|
var TAG_TYPE = {
|
|
@@ -15243,32 +15259,32 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15243
15259
|
const parts2 = [
|
|
15244
15260
|
{
|
|
15245
15261
|
type: "chat",
|
|
15246
|
-
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=?",
|
|
15247
15263
|
params: [key2.provider, key2.account]
|
|
15248
15264
|
},
|
|
15249
15265
|
{
|
|
15250
15266
|
type: "contact",
|
|
15251
|
-
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=?",
|
|
15252
15268
|
params: [key2.provider]
|
|
15253
15269
|
},
|
|
15254
15270
|
{
|
|
15255
15271
|
type: "message",
|
|
15256
|
-
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=?",
|
|
15257
15273
|
params: [key2.provider, key2.account]
|
|
15258
15274
|
},
|
|
15259
15275
|
{
|
|
15260
15276
|
type: "chat",
|
|
15261
|
-
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=?",
|
|
15262
15278
|
params: [key2.provider, key2.account]
|
|
15263
15279
|
},
|
|
15264
15280
|
{
|
|
15265
15281
|
type: "message",
|
|
15266
|
-
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=?",
|
|
15267
15283
|
params: [key2.provider, key2.account]
|
|
15268
15284
|
},
|
|
15269
15285
|
{
|
|
15270
15286
|
type: "task",
|
|
15271
|
-
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=?",
|
|
15272
15288
|
params: [inboxKey(`${key2.provider}:${key2.account}`)]
|
|
15273
15289
|
}
|
|
15274
15290
|
];
|
|
@@ -15278,7 +15294,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15278
15294
|
...filter.where ? [filter.where] : [],
|
|
15279
15295
|
...filter.source === void 0 ? [] : [{ sql: filter.source === "auto" ? "x.auto = 1" : "(x.auto = 0 OR x.source = 'owner')", params: [] }]
|
|
15280
15296
|
];
|
|
15281
|
-
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] : []);
|
|
15282
15298
|
const result = rows.map((row2) => {
|
|
15283
15299
|
const type = TAG_TYPE[String(row2.type)];
|
|
15284
15300
|
const chatId = row2.chat_id == null ? void 0 : String(row2.chat_id);
|
|
@@ -15297,7 +15313,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15297
15313
|
return result;
|
|
15298
15314
|
}, "tagsOf");
|
|
15299
15315
|
|
|
15300
|
-
// 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
|
|
15301
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");
|
|
15302
15318
|
var SPEECH = speech("att");
|
|
15303
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");
|
|
@@ -15592,9 +15608,9 @@ var mailbox = /* @__PURE__ */ __name(({ value }, { mail }) => always(mail ? boun
|
|
|
15592
15608
|
// Not tied to m.account_id: a correlated subquery re-reads every mailbox link for each email (minutes on
|
|
15593
15609
|
// 880k links), and an email only ever links to its own account's mailboxes anyway.
|
|
15594
15610
|
`m.id IN (SELECT em.email_id FROM email_mailboxes em WHERE em.mailbox_id IN
|
|
15595
|
-
(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 = ?))`,
|
|
15596
15612
|
value,
|
|
15597
|
-
value
|
|
15613
|
+
fold(value)
|
|
15598
15614
|
) : bound("0")), "mailbox");
|
|
15599
15615
|
var is2 = /* @__PURE__ */ __name(({ value }, { mail }) => {
|
|
15600
15616
|
const state = value.toLowerCase();
|
|
@@ -15652,7 +15668,7 @@ var FIELD_COMPILERS = {
|
|
|
15652
15668
|
subject
|
|
15653
15669
|
};
|
|
15654
15670
|
|
|
15655
|
-
// 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
|
|
15656
15672
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15657
15673
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15658
15674
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15668,7 +15684,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15668
15684
|
};
|
|
15669
15685
|
}, "placeOf");
|
|
15670
15686
|
|
|
15671
|
-
// 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
|
|
15672
15688
|
var DRAIN_ON_WRITE = 500;
|
|
15673
15689
|
var METHOD = "rules";
|
|
15674
15690
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15831,7 +15847,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15831
15847
|
return queued.length;
|
|
15832
15848
|
}, "drainMentions");
|
|
15833
15849
|
|
|
15834
|
-
// 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
|
|
15835
15851
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15836
15852
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15837
15853
|
if (!exists2)
|
|
@@ -15839,7 +15855,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15839
15855
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15840
15856
|
}, "indexRow");
|
|
15841
15857
|
|
|
15842
|
-
// 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
|
|
15843
15859
|
var INDEX = "message_stems";
|
|
15844
15860
|
var SETTING2 = "searchStemmers";
|
|
15845
15861
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15961,7 +15977,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15961
15977
|
};
|
|
15962
15978
|
}, "stemmerCache");
|
|
15963
15979
|
|
|
15964
|
-
// 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
|
|
15965
15981
|
var connections = /* @__PURE__ */ new WeakMap();
|
|
15966
15982
|
var connectionOf = /* @__PURE__ */ __name((database) => {
|
|
15967
15983
|
let connection = connections.get(database);
|
|
@@ -16020,7 +16036,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
16020
16036
|
}
|
|
16021
16037
|
}, "read");
|
|
16022
16038
|
|
|
16023
|
-
// 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
|
|
16024
16040
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16025
16041
|
coalesce(CASE k.chunkable_type
|
|
16026
16042
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16162,7 +16178,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16162
16178
|
}, "dropUnusedVectors");
|
|
16163
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");
|
|
16164
16180
|
|
|
16165
|
-
// 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
|
|
16166
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({
|
|
16167
16183
|
target: [accounts.provider, accounts.externalId],
|
|
16168
16184
|
set: {
|
|
@@ -16267,7 +16283,44 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16267
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));
|
|
16268
16284
|
}, "dropOrphanPeople");
|
|
16269
16285
|
|
|
16270
|
-
// 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
|
|
16271
16324
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
16272
16325
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
16273
16326
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -16286,7 +16339,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
16286
16339
|
}
|
|
16287
16340
|
}, "resolvePersonLinks");
|
|
16288
16341
|
|
|
16289
|
-
// 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
|
|
16290
16343
|
var flag = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
16291
16344
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
16292
16345
|
find: orm.select({
|
|
@@ -16372,7 +16425,7 @@ var saveIdentity = /* @__PURE__ */ __name(({ orm, now: now2, database }, provide
|
|
|
16372
16425
|
phone: facts2.phone ?? found2.phone
|
|
16373
16426
|
};
|
|
16374
16427
|
if (changed.name !== found2.name || changed.username !== found2.username || changed.bot !== found2.isBot || changed.description !== found2.description || changed.phone !== found2.phone) {
|
|
16375
|
-
orm.update(identities).set({ ...changed, updatedAt: now2() }).where(eq(identities.id, found2.pk)).run();
|
|
16428
|
+
orm.update(identities).set({ ...changed, nameFolded: folded3(changed.name), updatedAt: now2() }).where(eq(identities.id, found2.pk)).run();
|
|
16376
16429
|
}
|
|
16377
16430
|
const renamed = changed.name !== found2.name || changed.username !== found2.username;
|
|
16378
16431
|
if (renamed && resolveLinks)
|
|
@@ -16388,6 +16441,7 @@ var saveIdentity = /* @__PURE__ */ __name(({ orm, now: now2, database }, provide
|
|
|
16388
16441
|
provider,
|
|
16389
16442
|
externalId: nativeId,
|
|
16390
16443
|
name,
|
|
16444
|
+
nameFolded: folded3(name),
|
|
16391
16445
|
metadata: facts2.metadata == null ? null : JSON.stringify(facts2.metadata),
|
|
16392
16446
|
username: facts2.username ?? null,
|
|
16393
16447
|
bot: flag(facts2.isBot),
|
|
@@ -16509,7 +16563,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
16509
16563
|
}, "meetingIdentityPk");
|
|
16510
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");
|
|
16511
16565
|
|
|
16512
|
-
// 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
|
|
16513
16567
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
16514
16568
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
16515
16569
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -16574,7 +16628,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
16574
16628
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
16575
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");
|
|
16576
16630
|
|
|
16577
|
-
// 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
|
|
16578
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");
|
|
16579
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");
|
|
16580
16634
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -16624,7 +16678,14 @@ var answeredChatPk = /* @__PURE__ */ __name((context, accountKey, chatId, typed)
|
|
|
16624
16678
|
revisedBy(context, "send", () => orm.update(chats).set({ ...strict, updatedAt: now2() }).where(eq(chats.id, found2.pk)).run());
|
|
16625
16679
|
return found2.pk;
|
|
16626
16680
|
}
|
|
16627
|
-
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);
|
|
16628
16689
|
}, "answeredChatPk");
|
|
16629
16690
|
var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
16630
16691
|
const { orm, now: now2 } = context;
|
|
@@ -16637,6 +16698,7 @@ var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
|
16637
16698
|
parentChatId: parent2,
|
|
16638
16699
|
scope: chat2.scope ?? null,
|
|
16639
16700
|
title: chat2.title ?? null,
|
|
16701
|
+
titleFolded: folded3(chat2.title),
|
|
16640
16702
|
unreadCount: chat2.unreadCount ?? null,
|
|
16641
16703
|
lastMessageAt: toMs(chat2.lastMessageAt),
|
|
16642
16704
|
participantsCount: chat2.participantsCount ?? null,
|
|
@@ -16651,7 +16713,7 @@ var upsertChat = /* @__PURE__ */ __name((context, accountKey, chat2) => {
|
|
|
16651
16713
|
kind: sql`excluded.kind`,
|
|
16652
16714
|
...chat2.parentChatId === void 0 ? {} : { parentChatId: sql`excluded.parent_chat_id` },
|
|
16653
16715
|
scope: sql`coalesce(excluded.scope, ${chats.scope})`,
|
|
16654
|
-
...chat2.title === void 0 ? {} : { title: sql`excluded.title` },
|
|
16716
|
+
...chat2.title === void 0 ? {} : { title: sql`excluded.title`, titleFolded: sql`excluded.title_folded` },
|
|
16655
16717
|
...chat2.unreadCount === void 0 ? {} : { unreadCount: sql`excluded.unread_count`, unreadCountedAt: sql`excluded.unread_counted_at` },
|
|
16656
16718
|
...chat2.lastMessageAt === void 0 ? {} : { lastMessageAt: sql`excluded.last_message_at` },
|
|
16657
16719
|
...chat2.participantsCount === void 0 ? {} : { participantsCount: sql`excluded.participants_count` },
|
|
@@ -16823,7 +16885,7 @@ var metadata = /* @__PURE__ */ __name((context, key2, chatId) => {
|
|
|
16823
16885
|
} : void 0;
|
|
16824
16886
|
}, "metadata");
|
|
16825
16887
|
var saveMetadata = /* @__PURE__ */ __name((context, key2, entry2) => {
|
|
16826
|
-
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)));
|
|
16827
16889
|
return metadata(context, key2, entry2.chatId);
|
|
16828
16890
|
}, "saveMetadata");
|
|
16829
16891
|
var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm, matches2) => {
|
|
@@ -16846,7 +16908,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
16846
16908
|
}
|
|
16847
16909
|
}, "replaceAutoTags");
|
|
16848
16910
|
|
|
16849
|
-
// 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
|
|
16850
16912
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
16851
16913
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
16852
16914
|
var counterValue = /* @__PURE__ */ __name((message2, field3) => {
|
|
@@ -16883,7 +16945,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
16883
16945
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
16884
16946
|
}, "counterFreshness");
|
|
16885
16947
|
|
|
16886
|
-
// 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
|
|
16887
16949
|
import { createHash as createHash3 } from "node:crypto";
|
|
16888
16950
|
var CHUNK_CHARS = 1200;
|
|
16889
16951
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16988,7 +17050,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16988
17050
|
return chunks2;
|
|
16989
17051
|
}, "cutChunks");
|
|
16990
17052
|
|
|
16991
|
-
// 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
|
|
16992
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");
|
|
16993
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;
|
|
16994
17056
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -17069,7 +17131,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
17069
17131
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
17070
17132
|
}, "mailCore");
|
|
17071
17133
|
|
|
17072
|
-
// 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
|
|
17073
17135
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17074
17136
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17075
17137
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17159,7 +17221,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17159
17221
|
});
|
|
17160
17222
|
}, "linkMeeting");
|
|
17161
17223
|
|
|
17162
|
-
// 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
|
|
17163
17225
|
var DAY = 864e5;
|
|
17164
17226
|
var CURRENCY = [
|
|
17165
17227
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -17276,7 +17338,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
17276
17338
|
return best?.day ?? null;
|
|
17277
17339
|
}, "dueDayOf");
|
|
17278
17340
|
|
|
17279
|
-
// 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
|
|
17280
17342
|
var DAY2 = 864e5;
|
|
17281
17343
|
var STOP_WORDS = new Set([
|
|
17282
17344
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -17431,7 +17493,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
17431
17493
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
17432
17494
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
17433
17495
|
|
|
17434
|
-
// 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
|
|
17435
17497
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
17436
17498
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
17437
17499
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17702,7 +17764,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17702
17764
|
};
|
|
17703
17765
|
}, "readiness");
|
|
17704
17766
|
|
|
17705
|
-
// 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
|
|
17706
17768
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17707
17769
|
var SCAN_PAGE2 = 5e3;
|
|
17708
17770
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17765,7 +17827,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17765
17827
|
}, "nearestPictures")
|
|
17766
17828
|
}), "documentPicturesOver");
|
|
17767
17829
|
|
|
17768
|
-
// 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
|
|
17769
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), ''))";
|
|
17770
17832
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17771
17833
|
"working-location",
|
|
@@ -17947,7 +18009,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17947
18009
|
return true;
|
|
17948
18010
|
}, "resetNoteIndex");
|
|
17949
18011
|
|
|
17950
|
-
// 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
|
|
17951
18013
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
17952
18014
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
17953
18015
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18057,7 +18119,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18057
18119
|
return emails3 + threads;
|
|
18058
18120
|
}, "drainEmailIndex");
|
|
18059
18121
|
|
|
18060
|
-
// 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
|
|
18061
18123
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18062
18124
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18063
18125
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18081,7 +18143,7 @@ var setEmailFlags = /* @__PURE__ */ __name((database, accountId, flags, now2) =>
|
|
|
18081
18143
|
return changed;
|
|
18082
18144
|
}, "setEmailFlags");
|
|
18083
18145
|
|
|
18084
|
-
// 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
|
|
18085
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");
|
|
18086
18148
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18087
18149
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18148,39 +18210,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18148
18210
|
}
|
|
18149
18211
|
}), "mailRulesOver");
|
|
18150
18212
|
|
|
18151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18152
|
-
var FOLDED = [
|
|
18153
|
-
{ table: "tasks", column: "title" },
|
|
18154
|
-
{ table: "tasks", column: "close_reason" },
|
|
18155
|
-
{ table: "attachments", column: "name" },
|
|
18156
|
-
{ table: "attachments", column: "local_path" },
|
|
18157
|
-
{ table: "meetings", column: "title" },
|
|
18158
|
-
{ table: "files", column: "path" }
|
|
18159
|
-
];
|
|
18160
|
-
var folded3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : fold(value), "folded");
|
|
18161
|
-
var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
18162
|
-
let filled2 = 0;
|
|
18163
|
-
for (const { table, column: column2 } of FOLDED) {
|
|
18164
|
-
const pending = database.prepare(`SELECT id, ${column2} AS value FROM ${table} WHERE ${column2} IS NOT NULL AND ${column2}_folded IS NULL LIMIT ?`);
|
|
18165
|
-
if (pending.get(1) === void 0)
|
|
18166
|
-
continue;
|
|
18167
|
-
const fill = database.prepare(`UPDATE ${table} SET ${column2}_folded = ? WHERE id = ?`);
|
|
18168
|
-
for (; ; ) {
|
|
18169
|
-
const count = writeBatch(database, () => {
|
|
18170
|
-
const rows = pending.all(batch);
|
|
18171
|
-
for (const row2 of rows)
|
|
18172
|
-
fill.run(fold(String(row2.value)), Number(row2.id));
|
|
18173
|
-
return rows.length;
|
|
18174
|
-
});
|
|
18175
|
-
filled2 += count;
|
|
18176
|
-
if (count < batch)
|
|
18177
|
-
break;
|
|
18178
|
-
}
|
|
18179
|
-
}
|
|
18180
|
-
return filled2;
|
|
18181
|
-
}, "fillFolded");
|
|
18182
|
-
|
|
18183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/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
|
|
18184
18214
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18185
18215
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18186
18216
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18188,7 +18218,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18188
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);
|
|
18189
18219
|
}, "reviewLink");
|
|
18190
18220
|
|
|
18191
|
-
// 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
|
|
18192
18222
|
function checkMeetingCancelled(signal) {
|
|
18193
18223
|
if (!signal?.aborted)
|
|
18194
18224
|
return;
|
|
@@ -18199,7 +18229,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18199
18229
|
}
|
|
18200
18230
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18201
18231
|
|
|
18202
|
-
// 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
|
|
18203
18233
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18204
18234
|
id: Number(row2.id),
|
|
18205
18235
|
accountId: Number(row2.account_id),
|
|
@@ -18249,7 +18279,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18249
18279
|
createdAt: Number(row2.created_at)
|
|
18250
18280
|
}), "transcriptRowOf");
|
|
18251
18281
|
|
|
18252
|
-
// 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
|
|
18253
18283
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18254
18284
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18255
18285
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18416,7 +18446,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18416
18446
|
}
|
|
18417
18447
|
}), "meetingReadsOver");
|
|
18418
18448
|
|
|
18419
|
-
// 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
|
|
18420
18450
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18421
18451
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18422
18452
|
const params = [input.accountId];
|
|
@@ -18459,7 +18489,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18459
18489
|
return { clauses, params };
|
|
18460
18490
|
}, "meetingSelectionSql");
|
|
18461
18491
|
|
|
18462
|
-
// 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
|
|
18463
18493
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18464
18494
|
async meetingChatLines(input) {
|
|
18465
18495
|
checkMeetingCancelled(input.signal);
|
|
@@ -18487,7 +18517,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18487
18517
|
}
|
|
18488
18518
|
}), "meetingChatLinesOver");
|
|
18489
18519
|
|
|
18490
|
-
// 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
|
|
18491
18521
|
var MESSAGE_FIELDS = {
|
|
18492
18522
|
pk: messages.id,
|
|
18493
18523
|
nativeId: messages.externalId,
|
|
@@ -18654,7 +18684,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18654
18684
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18655
18685
|
}), "chatActivity");
|
|
18656
18686
|
|
|
18657
|
-
// 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
|
|
18658
18688
|
var HIT_FIELDS = {
|
|
18659
18689
|
...MESSAGE_FIELDS,
|
|
18660
18690
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18753,7 +18783,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18753
18783
|
};
|
|
18754
18784
|
}, "directReplies");
|
|
18755
18785
|
|
|
18756
|
-
// 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
|
|
18757
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");
|
|
18758
18788
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18759
18789
|
const found2 = identityRow(context, ref3);
|
|
@@ -18884,7 +18914,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
18884
18914
|
}, "mentioning");
|
|
18885
18915
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
18886
18916
|
|
|
18887
|
-
// 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
|
|
18888
18918
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
18889
18919
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
18890
18920
|
}, "missing");
|
|
@@ -19006,7 +19036,7 @@ function meetingContextLinksOver(context) {
|
|
|
19006
19036
|
}
|
|
19007
19037
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19008
19038
|
|
|
19009
|
-
// 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
|
|
19010
19040
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19011
19041
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19012
19042
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19035,7 +19065,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19035
19065
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19036
19066
|
}, "indexedText");
|
|
19037
19067
|
|
|
19038
|
-
// 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
|
|
19039
19069
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19040
19070
|
var meetingCurrentIndexRows = `
|
|
19041
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
|
|
@@ -19066,7 +19096,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19066
19096
|
}, "invalidateMeetingStems");
|
|
19067
19097
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19068
19098
|
|
|
19069
|
-
// 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
|
|
19070
19100
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19071
19101
|
return {
|
|
19072
19102
|
async indexSearch(original) {
|
|
@@ -19134,10 +19164,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19134
19164
|
}
|
|
19135
19165
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19136
19166
|
|
|
19137
|
-
// 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
|
|
19138
19168
|
import { createHash as createHash4 } from "node:crypto";
|
|
19139
19169
|
|
|
19140
|
-
// 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
|
|
19141
19171
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19142
19172
|
const padded = ` ${term} `;
|
|
19143
19173
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19146,7 +19176,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19146
19176
|
return [...pieces];
|
|
19147
19177
|
}, "trigrams");
|
|
19148
19178
|
|
|
19149
|
-
// 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
|
|
19150
19180
|
var SHORTEST_CORRECTION = 3;
|
|
19151
19181
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19152
19182
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19193,7 +19223,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19193
19223
|
return corrections;
|
|
19194
19224
|
}, "correctWords");
|
|
19195
19225
|
|
|
19196
|
-
// 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
|
|
19197
19227
|
var SHORTEST_GARBLED = 4;
|
|
19198
19228
|
var MOST_WIDENED = 64;
|
|
19199
19229
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19285,7 +19315,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19285
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));
|
|
19286
19316
|
}, "widenWords");
|
|
19287
19317
|
|
|
19288
|
-
// 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
|
|
19289
19319
|
import { readFileSync } from "node:fs";
|
|
19290
19320
|
var loaded;
|
|
19291
19321
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19344,7 +19374,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19344
19374
|
return false;
|
|
19345
19375
|
}, "knownRussianWord");
|
|
19346
19376
|
|
|
19347
|
-
// 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
|
|
19348
19378
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19349
19379
|
var MOST_WORDS = 128;
|
|
19350
19380
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19571,7 +19601,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19571
19601
|
return check3(tree);
|
|
19572
19602
|
}, "matchMeetingText");
|
|
19573
19603
|
|
|
19574
|
-
// 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
|
|
19575
19605
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19576
19606
|
throw new CliError("validation_error", message2);
|
|
19577
19607
|
}, "fail");
|
|
@@ -19748,7 +19778,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19748
19778
|
}
|
|
19749
19779
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19750
19780
|
|
|
19751
|
-
// 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
|
|
19752
19782
|
import { createHash as createHash5 } from "node:crypto";
|
|
19753
19783
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19754
19784
|
if (value === void 0)
|
|
@@ -19838,7 +19868,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
19838
19868
|
}
|
|
19839
19869
|
}), "meetingParticipantSearchOver");
|
|
19840
19870
|
|
|
19841
|
-
// 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
|
|
19842
19872
|
var preparationQueries = {
|
|
19843
19873
|
participants: {
|
|
19844
19874
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -19888,7 +19918,7 @@ var preparationQueries = {
|
|
|
19888
19918
|
}
|
|
19889
19919
|
};
|
|
19890
19920
|
|
|
19891
|
-
// 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
|
|
19892
19922
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19893
19923
|
async preparationContext(original) {
|
|
19894
19924
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -19929,7 +19959,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19929
19959
|
}
|
|
19930
19960
|
}), "meetingPreparationContextOver");
|
|
19931
19961
|
|
|
19932
|
-
// 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
|
|
19933
19963
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
19934
19964
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
19935
19965
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -19943,7 +19973,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
19943
19973
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
19944
19974
|
)`, "preparationSubjects");
|
|
19945
19975
|
|
|
19946
|
-
// 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
|
|
19947
19977
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19948
19978
|
async preparationKnowledge(original) {
|
|
19949
19979
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -19988,7 +20018,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
19988
20018
|
}
|
|
19989
20019
|
}), "meetingPreparationKnowledgeOver");
|
|
19990
20020
|
|
|
19991
|
-
// 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
|
|
19992
20022
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19993
20023
|
async preparationNotes(original) {
|
|
19994
20024
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20041,7 +20071,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20041
20071
|
}
|
|
20042
20072
|
}), "meetingPreparationNotesOver");
|
|
20043
20073
|
|
|
20044
|
-
// 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
|
|
20045
20075
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20046
20076
|
async relatedHistory(original) {
|
|
20047
20077
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20112,7 +20142,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20112
20142
|
}
|
|
20113
20143
|
}), "meetingRelatedHistoryOver");
|
|
20114
20144
|
|
|
20115
|
-
// 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
|
|
20116
20146
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20117
20147
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20118
20148
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20193,7 +20223,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20193
20223
|
}
|
|
20194
20224
|
}), "meetingReviewOver");
|
|
20195
20225
|
|
|
20196
|
-
// 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
|
|
20197
20227
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20198
20228
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20199
20229
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20247,7 +20277,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20247
20277
|
}
|
|
20248
20278
|
}), "meetingSeriesHistoryOver");
|
|
20249
20279
|
|
|
20250
|
-
// 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
|
|
20251
20281
|
var MOST_ROWS = 5e5;
|
|
20252
20282
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20253
20283
|
async meetingStats(input) {
|
|
@@ -20294,7 +20324,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20294
20324
|
}
|
|
20295
20325
|
}), "meetingStatsOver");
|
|
20296
20326
|
|
|
20297
|
-
// 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
|
|
20298
20328
|
var CURSOR_KEY = "meetings";
|
|
20299
20329
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20300
20330
|
id: Number(row2.id),
|
|
@@ -20846,7 +20876,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
20846
20876
|
};
|
|
20847
20877
|
}, "meetingStoreOver");
|
|
20848
20878
|
|
|
20849
|
-
// 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
|
|
20850
20880
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
20851
20881
|
id: `email:${place.emailId}`,
|
|
20852
20882
|
chatId: place.threadExternalId,
|
|
@@ -20957,18 +20987,18 @@ var identityOf2 = /* @__PURE__ */ __name((database, { address, name }, now2) =>
|
|
|
20957
20987
|
const found2 = database.prepare("SELECT id, name FROM identities WHERE provider = 'email' AND external_id = ?").get(key2);
|
|
20958
20988
|
if (found2) {
|
|
20959
20989
|
if (found2.name === null && name)
|
|
20960
|
-
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));
|
|
20961
20991
|
return Number(found2.id);
|
|
20962
20992
|
}
|
|
20963
|
-
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);
|
|
20964
20994
|
}, "identityOf");
|
|
20965
20995
|
var mailboxPk = /* @__PURE__ */ __name((database, accountId, box, now2) => {
|
|
20966
20996
|
if (!box.externalId)
|
|
20967
20997
|
throw new Error("Invalid mailbox key");
|
|
20968
|
-
return Number(database.prepare(`INSERT INTO mailboxes (account_id, external_id, name, kind, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)
|
|
20969
|
-
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,
|
|
20970
21000
|
kind = coalesce(excluded.kind, kind), updated_at = excluded.updated_at
|
|
20971
|
-
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);
|
|
20972
21002
|
}, "mailboxPk");
|
|
20973
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");
|
|
20974
21004
|
var saveEmail = /* @__PURE__ */ __name((database, orm, accountId, threadId, mail, now2) => {
|
|
@@ -21045,7 +21075,7 @@ var saveThread = /* @__PURE__ */ __name((database, orm, input) => {
|
|
|
21045
21075
|
const threadId = found2 ? Number(found2.id) : Number(database.prepare(`INSERT INTO email_threads (account_id, external_id, created_at, updated_at) VALUES (?, ?, ?, ?)
|
|
21046
21076
|
RETURNING id`).get(accountId, externalId, now2, now2)?.id);
|
|
21047
21077
|
if (input.subject !== void 0)
|
|
21048
|
-
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);
|
|
21049
21079
|
if (input.metadata !== void 0)
|
|
21050
21080
|
database.prepare("UPDATE email_threads SET metadata = ? WHERE id = ?").run(toJson(input.metadata), threadId);
|
|
21051
21081
|
const moved = /* @__PURE__ */ new Set();
|
|
@@ -21055,7 +21085,8 @@ var saveThread = /* @__PURE__ */ __name((database, orm, input) => {
|
|
|
21055
21085
|
moved.add(before2);
|
|
21056
21086
|
}
|
|
21057
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);
|
|
21058
|
-
|
|
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);
|
|
21059
21090
|
for (const id2 of [threadId, ...moved])
|
|
21060
21091
|
recountEmailThread(database, id2, now2);
|
|
21061
21092
|
queueThreads(database, moved);
|
|
@@ -21414,7 +21445,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21414
21445
|
}
|
|
21415
21446
|
}), "mailStoreOver");
|
|
21416
21447
|
|
|
21417
|
-
// 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
|
|
21418
21449
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21419
21450
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21420
21451
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21504,7 +21535,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21504
21535
|
}, "knownWord");
|
|
21505
21536
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21506
21537
|
|
|
21507
|
-
// 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
|
|
21508
21539
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21509
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");
|
|
21510
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
|
|
@@ -21590,7 +21621,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21590
21621
|
return found2;
|
|
21591
21622
|
}, "spokenTranscripts");
|
|
21592
21623
|
|
|
21593
|
-
// 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
|
|
21594
21625
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21595
21626
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21596
21627
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21637,7 +21668,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21637
21668
|
});
|
|
21638
21669
|
}, "placeHits");
|
|
21639
21670
|
|
|
21640
|
-
// 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
|
|
21641
21672
|
var MESSAGES2 = {
|
|
21642
21673
|
rows: "messages",
|
|
21643
21674
|
threads: "chats",
|
|
@@ -22099,7 +22130,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22099
22130
|
};
|
|
22100
22131
|
}, "runQuery");
|
|
22101
22132
|
|
|
22102
|
-
// 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
|
|
22103
22134
|
function invalidMetadata() {
|
|
22104
22135
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22105
22136
|
}
|
|
@@ -22201,7 +22232,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22201
22232
|
};
|
|
22202
22233
|
}), "counterTargets");
|
|
22203
22234
|
|
|
22204
|
-
// 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
|
|
22205
22236
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22206
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,
|
|
22207
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
|
|
@@ -22257,7 +22288,7 @@ var resetAttachmentWords = /* @__PURE__ */ __name((database) => {
|
|
|
22257
22288
|
extraction_error = NULL, extracted_at = t.heard_at, updated_at = t.updated_at
|
|
22258
22289
|
FROM message_transcripts t
|
|
22259
22290
|
WHERE attachments.attachable_type = 'message' AND attachments.attachable_id = t.message_id
|
|
22260
|
-
AND (attachments.kind
|
|
22291
|
+
AND (attachments.kind IN ('voice', 'audio') OR attachments.mime LIKE 'audio/%')
|
|
22261
22292
|
AND coalesce(attachments.text, '') = '' AND coalesce(attachments.extraction, '') <> 'agent'`).run();
|
|
22262
22293
|
const update = database.prepare("UPDATE attachments SET normalized_text = ? WHERE id = ?");
|
|
22263
22294
|
for (const row2 of database.prepare("SELECT id AS attachment_id, text, normalized_text FROM attachments WHERE text IS NOT NULL").all()) {
|
|
@@ -22320,7 +22351,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22320
22351
|
}));
|
|
22321
22352
|
}, "attachmentViews");
|
|
22322
22353
|
|
|
22323
|
-
// 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
|
|
22324
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");
|
|
22325
22356
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22326
22357
|
const { orm, database, now: now2 } = context;
|
|
@@ -22352,13 +22383,13 @@ var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5,
|
|
|
22352
22383
|
var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
22353
22384
|
const row2 = context.database.prepare(`SELECT a.id, t.text, t.source FROM message_transcripts t
|
|
22354
22385
|
JOIN attachments a ON a.attachable_type = 'message' AND a.attachable_id = t.message_id
|
|
22355
|
-
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);
|
|
22356
22387
|
if (!row2)
|
|
22357
22388
|
return;
|
|
22358
22389
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22359
22390
|
}, "intoVoiceAttachment");
|
|
22360
22391
|
|
|
22361
|
-
// 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
|
|
22362
22393
|
var FIELDS = [
|
|
22363
22394
|
"threadExternalId",
|
|
22364
22395
|
"senderIdentityId",
|
|
@@ -22675,7 +22706,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22675
22706
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22676
22707
|
}, "writeDerivedReactions");
|
|
22677
22708
|
|
|
22678
|
-
// 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
|
|
22679
22710
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22680
22711
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22681
22712
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -22701,7 +22732,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
22701
22732
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22702
22733
|
}, "release");
|
|
22703
22734
|
|
|
22704
|
-
// 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
|
|
22705
22736
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22706
22737
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22707
22738
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22722,7 +22753,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22722
22753
|
};
|
|
22723
22754
|
}, "keysOver");
|
|
22724
22755
|
|
|
22725
|
-
// 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
|
|
22726
22757
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22727
22758
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22728
22759
|
if (!row2)
|
|
@@ -22757,7 +22788,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22757
22788
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22758
22789
|
}, "saveProfile");
|
|
22759
22790
|
|
|
22760
|
-
// 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
|
|
22761
22792
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22762
22793
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22763
22794
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22793,7 +22824,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22793
22824
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22794
22825
|
}, "originOfActor");
|
|
22795
22826
|
|
|
22796
|
-
// 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
|
|
22797
22828
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22798
22829
|
const owner = ownerPerson(context.database).id;
|
|
22799
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);
|
|
@@ -22814,7 +22845,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22814
22845
|
return personOf(context, ref3);
|
|
22815
22846
|
}, "linkToOwner");
|
|
22816
22847
|
|
|
22817
|
-
// 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
|
|
22818
22849
|
var PROVIDERS_SETTING = "providers";
|
|
22819
22850
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
22820
22851
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -22849,7 +22880,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
22849
22880
|
});
|
|
22850
22881
|
}, "registerProvider");
|
|
22851
22882
|
|
|
22852
|
-
// 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
|
|
22853
22884
|
var DAY3 = 864e5;
|
|
22854
22885
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
22855
22886
|
var TEXT_LIMIT = 20;
|
|
@@ -23048,7 +23079,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23048
23079
|
};
|
|
23049
23080
|
}, "taskSimilarityOver");
|
|
23050
23081
|
|
|
23051
|
-
// 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
|
|
23052
23083
|
var SETTING3 = "taskCategories";
|
|
23053
23084
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23054
23085
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23067,7 +23098,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23067
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);
|
|
23068
23099
|
}, "saveTaskCategories");
|
|
23069
23100
|
|
|
23070
|
-
// 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
|
|
23071
23102
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23072
23103
|
var ALLOWED = "taskAgentClose";
|
|
23073
23104
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23123,7 +23154,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
23123
23154
|
];
|
|
23124
23155
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23125
23156
|
|
|
23126
|
-
// 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
|
|
23127
23158
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23128
23159
|
var MAX_TEXT_CHARS = 2e6;
|
|
23129
23160
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23149,7 +23180,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23149
23180
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23150
23181
|
}, "pdfPreviewLimits");
|
|
23151
23182
|
|
|
23152
|
-
// 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
|
|
23153
23184
|
import { randomBytes } from "node:crypto";
|
|
23154
23185
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23155
23186
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23162,7 +23193,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23162
23193
|
return time3 + random;
|
|
23163
23194
|
}, "ulid");
|
|
23164
23195
|
|
|
23165
|
-
// 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
|
|
23166
23197
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23167
23198
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23168
23199
|
if (!meta && !sections?.length)
|
|
@@ -23183,7 +23214,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23183
23214
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23184
23215
|
}, "languageOf");
|
|
23185
23216
|
|
|
23186
|
-
// 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
|
|
23187
23218
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23188
23219
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23189
23220
|
if (isObject(value))
|
|
@@ -23426,7 +23457,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23426
23457
|
};
|
|
23427
23458
|
}, "filesStoreOver");
|
|
23428
23459
|
|
|
23429
|
-
// 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
|
|
23430
23461
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23431
23462
|
entity: "document",
|
|
23432
23463
|
backend: "sql",
|
|
@@ -23472,7 +23503,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23472
23503
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23473
23504
|
}, "importedDocumentWhere");
|
|
23474
23505
|
|
|
23475
|
-
// 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
|
|
23476
23507
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23477
23508
|
var iso = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23478
23509
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso(value), "optionalIso");
|
|
@@ -23981,7 +24012,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23981
24012
|
};
|
|
23982
24013
|
}, "notesStoreOver");
|
|
23983
24014
|
|
|
23984
|
-
// 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
|
|
23985
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";
|
|
23986
24017
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23987
24018
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -24097,7 +24128,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24097
24128
|
};
|
|
24098
24129
|
}, "memoriesStoreOver");
|
|
24099
24130
|
|
|
24100
|
-
// 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
|
|
24101
24132
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24102
24133
|
var KEY = "taskFirstPassPerChat";
|
|
24103
24134
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24117,7 +24148,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24117
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);
|
|
24118
24149
|
}, "saveFirstPassPerChat");
|
|
24119
24150
|
|
|
24120
|
-
// 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
|
|
24121
24152
|
var TASK_RELATION_KINDS = [
|
|
24122
24153
|
"blocked-by",
|
|
24123
24154
|
"follow-up-of",
|
|
@@ -24247,7 +24278,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24247
24278
|
};
|
|
24248
24279
|
}, "taskRelationsStoreOver");
|
|
24249
24280
|
|
|
24250
|
-
// 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
|
|
24251
24282
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24252
24283
|
var iso3 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24253
24284
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
@@ -24519,7 +24550,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24519
24550
|
};
|
|
24520
24551
|
}, "workTasksOver");
|
|
24521
24552
|
|
|
24522
|
-
// 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
|
|
24523
24554
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24524
24555
|
const { database, now: now2 } = context;
|
|
24525
24556
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24565,7 +24596,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24565
24596
|
};
|
|
24566
24597
|
}, "taskCloseOver");
|
|
24567
24598
|
|
|
24568
|
-
// 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
|
|
24569
24600
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24570
24601
|
const { database, now: now2 } = context;
|
|
24571
24602
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24783,7 +24814,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
24783
24814
|
};
|
|
24784
24815
|
}, "taskPairsOver");
|
|
24785
24816
|
|
|
24786
|
-
// 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
|
|
24787
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";
|
|
24788
24819
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24789
24820
|
const { database, now: now2 } = context;
|
|
@@ -24801,7 +24832,7 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24801
24832
|
return Number(found2.id);
|
|
24802
24833
|
}
|
|
24803
24834
|
const at = now2();
|
|
24804
|
-
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);
|
|
24805
24836
|
}, "inbox");
|
|
24806
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");
|
|
24807
24838
|
const toTask = /* @__PURE__ */ __name((row2) => {
|
|
@@ -24978,7 +25009,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
24978
25009
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
24979
25010
|
}, "oneOf");
|
|
24980
25011
|
|
|
24981
|
-
// 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
|
|
24982
25013
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
24983
25014
|
const { database } = context;
|
|
24984
25015
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25020,7 +25051,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25020
25051
|
};
|
|
25021
25052
|
}, "accountsStoreOver");
|
|
25022
25053
|
|
|
25023
|
-
// 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
|
|
25024
25055
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25025
25056
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25026
25057
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25044,7 +25075,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25044
25075
|
})), "keepDownloads");
|
|
25045
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");
|
|
25046
25077
|
|
|
25047
|
-
// 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
|
|
25048
25079
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25049
25080
|
const { database } = context;
|
|
25050
25081
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25101,7 +25132,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25101
25132
|
}, "keepAttachmentText")
|
|
25102
25133
|
}), "attachmentsStoreOver");
|
|
25103
25134
|
|
|
25104
|
-
// 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
|
|
25105
25136
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25106
25137
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25107
25138
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25281,7 +25312,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25281
25312
|
return done;
|
|
25282
25313
|
}, "rekeyChats");
|
|
25283
25314
|
|
|
25284
|
-
// 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
|
|
25285
25316
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25286
25317
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25287
25318
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25313,7 +25344,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25313
25344
|
});
|
|
25314
25345
|
}, "chatCompleteness");
|
|
25315
25346
|
|
|
25316
|
-
// 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
|
|
25317
25348
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25318
25349
|
const { database } = context;
|
|
25319
25350
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25413,7 +25444,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25413
25444
|
};
|
|
25414
25445
|
}, "chatsStoreOver");
|
|
25415
25446
|
|
|
25416
|
-
// 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
|
|
25417
25448
|
import { createHash as createHash6 } from "node:crypto";
|
|
25418
25449
|
var BATCH_CONTEXT = 50;
|
|
25419
25450
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25551,7 +25582,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25551
25582
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25552
25583
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25553
25584
|
|
|
25554
|
-
// 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
|
|
25555
25586
|
import { setTimeout } from "node:timers/promises";
|
|
25556
25587
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25557
25588
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -25863,7 +25894,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
25863
25894
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
25864
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");
|
|
25865
25896
|
|
|
25866
|
-
// 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
|
|
25867
25898
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25868
25899
|
const { database } = context;
|
|
25869
25900
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25970,7 +26001,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25970
26001
|
};
|
|
25971
26002
|
}, "conversationsStoreOver");
|
|
25972
26003
|
|
|
25973
|
-
// 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
|
|
25974
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";
|
|
25975
26006
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
25976
26007
|
const { database } = context;
|
|
@@ -25995,7 +26026,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25995
26026
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
25996
26027
|
}), "countersStoreOver");
|
|
25997
26028
|
|
|
25998
|
-
// 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
|
|
25999
26030
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
26000
26031
|
var MENTION_QUERY = defineQuery({
|
|
26001
26032
|
entity: "mention",
|
|
@@ -26211,7 +26242,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26211
26242
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26212
26243
|
}, "listPlaces");
|
|
26213
26244
|
|
|
26214
|
-
// 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
|
|
26215
26246
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26216
26247
|
const { database } = context;
|
|
26217
26248
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26246,7 +26277,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26246
26277
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26247
26278
|
}), "mentionsStoreOver");
|
|
26248
26279
|
|
|
26249
|
-
// 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
|
|
26250
26281
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26251
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");
|
|
26252
26283
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26261,7 +26292,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26261
26292
|
}));
|
|
26262
26293
|
}, "documentLinkMessages");
|
|
26263
26294
|
|
|
26264
|
-
// 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
|
|
26265
26296
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26266
26297
|
const { database } = context;
|
|
26267
26298
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26395,7 +26426,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26395
26426
|
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies")
|
|
26396
26427
|
}), "messagesStoreOver");
|
|
26397
26428
|
|
|
26398
|
-
// 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
|
|
26399
26430
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26400
26431
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26401
26432
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -26452,7 +26483,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26452
26483
|
});
|
|
26453
26484
|
}, "personPreparation");
|
|
26454
26485
|
|
|
26455
|
-
// 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
|
|
26456
26487
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26457
26488
|
const id2 = Number(uid);
|
|
26458
26489
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26460,7 +26491,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26460
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)));
|
|
26461
26492
|
}, "personSeenInAccounts");
|
|
26462
26493
|
|
|
26463
|
-
// 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
|
|
26464
26495
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26465
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);
|
|
26466
26497
|
if (!row2)
|
|
@@ -26526,7 +26557,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26526
26557
|
return { id: id2, personId, removed: true };
|
|
26527
26558
|
}, "removeNote");
|
|
26528
26559
|
|
|
26529
|
-
// 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
|
|
26530
26561
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26531
26562
|
const { database } = context;
|
|
26532
26563
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26601,13 +26632,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26601
26632
|
};
|
|
26602
26633
|
}, "peopleStoreOver");
|
|
26603
26634
|
|
|
26604
|
-
// 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
|
|
26605
26636
|
import { createHash as createHash8 } from "node:crypto";
|
|
26606
26637
|
|
|
26607
|
-
// 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
|
|
26608
26639
|
import { createHash as createHash7 } from "node:crypto";
|
|
26609
26640
|
|
|
26610
|
-
// 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
|
|
26611
26642
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
26612
26643
|
var AUTHOR_MEASURES = [
|
|
26613
26644
|
"messages",
|
|
@@ -26747,7 +26778,7 @@ var withoutUrls = /* @__PURE__ */ __name((text5) => text5.replace(/\S+/gu, (toke
|
|
|
26747
26778
|
var rankingWords = /* @__PURE__ */ __name((text5) => withoutUrls(text5).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
26748
26779
|
var rankingQuestion = /* @__PURE__ */ __name((text5) => withoutUrls(text5).includes("?"), "rankingQuestion");
|
|
26749
26780
|
|
|
26750
|
-
// 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
|
|
26751
26782
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
26752
26783
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
26753
26784
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -26969,7 +27000,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
26969
27000
|
};
|
|
26970
27001
|
}, "rankReplyGraph");
|
|
26971
27002
|
|
|
26972
|
-
// 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
|
|
26973
27004
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
26974
27005
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
26975
27006
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27143,7 +27174,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27143
27174
|
return { items, evidence, summary, graph: graph.quality };
|
|
27144
27175
|
}, "calculateAdminStatistics");
|
|
27145
27176
|
|
|
27146
|
-
// 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
|
|
27147
27178
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27148
27179
|
const dates = [];
|
|
27149
27180
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27165,7 +27196,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27165
27196
|
return dates[0].node.resolution.date;
|
|
27166
27197
|
}, "rankingContextRange");
|
|
27167
27198
|
|
|
27168
|
-
// 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
|
|
27169
27200
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27170
27201
|
let counts;
|
|
27171
27202
|
try {
|
|
@@ -27460,7 +27491,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27460
27491
|
});
|
|
27461
27492
|
}, "rankQuery");
|
|
27462
27493
|
|
|
27463
|
-
// 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
|
|
27464
27495
|
function fail4(message2, reason = "query.too-large") {
|
|
27465
27496
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27466
27497
|
}
|
|
@@ -27637,7 +27668,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27637
27668
|
return result;
|
|
27638
27669
|
}), "adminStatisticsQuery");
|
|
27639
27670
|
|
|
27640
|
-
// 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
|
|
27641
27672
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27642
27673
|
if (!execution.accounts.length)
|
|
27643
27674
|
return { conversations: [], chats: [] };
|
|
@@ -27655,7 +27686,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27655
27686
|
return { conversations: conversations2, chats: chats2 };
|
|
27656
27687
|
}, "conversationEligibility");
|
|
27657
27688
|
|
|
27658
|
-
// 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
|
|
27659
27690
|
import { createHash as createHash9 } from "node:crypto";
|
|
27660
27691
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27661
27692
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -27805,7 +27836,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
27805
27836
|
return result;
|
|
27806
27837
|
}, "rankingEvidence");
|
|
27807
27838
|
|
|
27808
|
-
// 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
|
|
27809
27840
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
27810
27841
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
27811
27842
|
if (execution.corpus === "mail")
|
|
@@ -27822,7 +27853,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
|
27822
27853
|
};
|
|
27823
27854
|
}, "queriesStoreOver");
|
|
27824
27855
|
|
|
27825
|
-
// 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
|
|
27826
27857
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
27827
27858
|
const { database, now: now2 } = context;
|
|
27828
27859
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -27861,10 +27892,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
27861
27892
|
}));
|
|
27862
27893
|
}, "chatEventsOf");
|
|
27863
27894
|
|
|
27864
|
-
// 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
|
|
27865
27896
|
import { createHash as createHash10 } from "node:crypto";
|
|
27866
27897
|
|
|
27867
|
-
// 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
|
|
27868
27899
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
27869
27900
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
27870
27901
|
timeZone: zone,
|
|
@@ -27879,7 +27910,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
27879
27910
|
};
|
|
27880
27911
|
}, "calendarKey");
|
|
27881
27912
|
|
|
27882
|
-
// 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
|
|
27883
27914
|
var RETENTION_TOLERANCE = 864e5;
|
|
27884
27915
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
27885
27916
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -27933,7 +27964,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
27933
27964
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
27934
27965
|
}, "retentionCohorts");
|
|
27935
27966
|
|
|
27936
|
-
// 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
|
|
27937
27968
|
var iso5 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
27938
27969
|
var week = /* @__PURE__ */ __name((day) => {
|
|
27939
27970
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
@@ -28069,7 +28100,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28069
28100
|
};
|
|
28070
28101
|
}, "retentionQuery");
|
|
28071
28102
|
|
|
28072
|
-
// 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
|
|
28073
28104
|
var iso6 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
28074
28105
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
28075
28106
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -28200,7 +28231,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
28200
28231
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28201
28232
|
})), "trackedChats");
|
|
28202
28233
|
|
|
28203
|
-
// 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
|
|
28204
28235
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28205
28236
|
const { database } = context;
|
|
28206
28237
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28256,7 +28287,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28256
28287
|
};
|
|
28257
28288
|
}, "rosterStoreOver");
|
|
28258
28289
|
|
|
28259
|
-
// 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
|
|
28260
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");
|
|
28261
28292
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28262
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 ?`);
|
|
@@ -28280,7 +28311,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28280
28311
|
}
|
|
28281
28312
|
}, "backfillNormalized");
|
|
28282
28313
|
|
|
28283
|
-
// 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
|
|
28284
28315
|
var INDEX2 = "message_words";
|
|
28285
28316
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28286
28317
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28407,7 +28438,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28407
28438
|
});
|
|
28408
28439
|
}, "resetSearchIndex");
|
|
28409
28440
|
|
|
28410
|
-
// 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
|
|
28411
28442
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28412
28443
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28413
28444
|
const before2 = stemsState(database);
|
|
@@ -28502,7 +28533,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28502
28533
|
return resetStems(database, { now: now2 });
|
|
28503
28534
|
}, "followDefaultStemmers");
|
|
28504
28535
|
|
|
28505
|
-
// 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
|
|
28506
28537
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28507
28538
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28508
28539
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28524,7 +28555,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28524
28555
|
});
|
|
28525
28556
|
}, "termCandidates");
|
|
28526
28557
|
|
|
28527
|
-
// 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
|
|
28528
28559
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28529
28560
|
const { database } = context;
|
|
28530
28561
|
const stemmerFor = stemmerCache();
|
|
@@ -28546,7 +28577,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28546
28577
|
};
|
|
28547
28578
|
}, "searchIndexStoreOver");
|
|
28548
28579
|
|
|
28549
|
-
// 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
|
|
28550
28581
|
var HISTORY_KEPT = 1e3;
|
|
28551
28582
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28552
28583
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28615,7 +28646,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28615
28646
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28616
28647
|
}, "clearHistory");
|
|
28617
28648
|
|
|
28618
|
-
// 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
|
|
28619
28650
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28620
28651
|
const { database } = context;
|
|
28621
28652
|
return {
|
|
@@ -28639,7 +28670,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28639
28670
|
};
|
|
28640
28671
|
}, "searchesStoreOver");
|
|
28641
28672
|
|
|
28642
|
-
// 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
|
|
28643
28674
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28644
28675
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28645
28676
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -28682,7 +28713,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
28682
28713
|
};
|
|
28683
28714
|
}, "agentActionsStoreOver");
|
|
28684
28715
|
|
|
28685
|
-
// 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
|
|
28686
28717
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
28687
28718
|
}) => {
|
|
28688
28719
|
const { database, now: now2 } = context;
|
|
@@ -28741,7 +28772,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
28741
28772
|
};
|
|
28742
28773
|
}, "botUpdateStoreOver");
|
|
28743
28774
|
|
|
28744
|
-
// 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
|
|
28745
28776
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
28746
28777
|
id: Number(row2.id),
|
|
28747
28778
|
accountId: Number(row2.account_id),
|
|
@@ -29305,7 +29336,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29305
29336
|
};
|
|
29306
29337
|
}, "eventStoreOver");
|
|
29307
29338
|
|
|
29308
|
-
// 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
|
|
29309
29340
|
var CATALOG_QUERY = defineQuery({
|
|
29310
29341
|
entity: "document",
|
|
29311
29342
|
backend: "sql",
|
|
@@ -29547,7 +29578,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29547
29578
|
};
|
|
29548
29579
|
}, "catalogStoreOver");
|
|
29549
29580
|
|
|
29550
|
-
// 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
|
|
29551
29582
|
import { createHash as createHash11 } from "node:crypto";
|
|
29552
29583
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29553
29584
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29645,7 +29676,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29645
29676
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29646
29677
|
}, "contextEvidenceRequest");
|
|
29647
29678
|
|
|
29648
|
-
// 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
|
|
29649
29680
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
29650
29681
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
29651
29682
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -29658,7 +29689,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
29658
29689
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
29659
29690
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
29660
29691
|
|
|
29661
|
-
// 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
|
|
29662
29693
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
29663
29694
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
29664
29695
|
signal?.throwIfAborted();
|
|
@@ -29757,7 +29788,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
29757
29788
|
});
|
|
29758
29789
|
}, "readMeetingContextEvidence");
|
|
29759
29790
|
|
|
29760
|
-
// 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
|
|
29761
29792
|
var corpora = {
|
|
29762
29793
|
message: {
|
|
29763
29794
|
table: "messages",
|
|
@@ -29986,7 +30017,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29986
30017
|
}
|
|
29987
30018
|
}), "contextRecordsOver");
|
|
29988
30019
|
|
|
29989
|
-
// 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
|
|
29990
30021
|
var NOTE_FIELDS = [
|
|
29991
30022
|
"text",
|
|
29992
30023
|
"exact",
|
|
@@ -30375,7 +30406,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30375
30406
|
};
|
|
30376
30407
|
}, "noteSearchOver");
|
|
30377
30408
|
|
|
30378
|
-
// 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
|
|
30379
30410
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30380
30411
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30381
30412
|
var EVENT_CORPUS = {
|
|
@@ -30507,7 +30538,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30507
30538
|
};
|
|
30508
30539
|
}, "eventSearchOver");
|
|
30509
30540
|
|
|
30510
|
-
// 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
|
|
30511
30542
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30512
30543
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30513
30544
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30520,7 +30551,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30520
30551
|
}, "reference");
|
|
30521
30552
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30522
30553
|
|
|
30523
|
-
// 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
|
|
30524
30555
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30525
30556
|
try {
|
|
30526
30557
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -30532,7 +30563,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
30532
30563
|
}
|
|
30533
30564
|
}, "calendarMoment");
|
|
30534
30565
|
|
|
30535
|
-
// 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
|
|
30536
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";
|
|
30537
30568
|
var iso7 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30538
30569
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -30645,7 +30676,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30645
30676
|
};
|
|
30646
30677
|
}, "factsStoreOver");
|
|
30647
30678
|
|
|
30648
|
-
// 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
|
|
30649
30680
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
30650
30681
|
throw new CliError("validation_error", message2);
|
|
30651
30682
|
}, "invalid");
|
|
@@ -30735,7 +30766,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
30735
30766
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
30736
30767
|
}, "findingsCoreOver");
|
|
30737
30768
|
|
|
30738
|
-
// 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
|
|
30739
30770
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30740
30771
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30741
30772
|
var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -30881,7 +30912,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30881
30912
|
};
|
|
30882
30913
|
}, "proposedActionsStoreOver");
|
|
30883
30914
|
|
|
30884
|
-
// 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
|
|
30885
30916
|
var stale = /* @__PURE__ */ __name(() => {
|
|
30886
30917
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
30887
30918
|
reason: "evidence-findings.stale"
|
|
@@ -31047,7 +31078,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31047
31078
|
};
|
|
31048
31079
|
}, "evidenceFindingsStoreOver");
|
|
31049
31080
|
|
|
31050
|
-
// 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
|
|
31051
31082
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31052
31083
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31053
31084
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31100,7 +31131,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31100
31131
|
}, "forPerson")
|
|
31101
31132
|
}), "involvementStoreOver");
|
|
31102
31133
|
|
|
31103
|
-
// 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
|
|
31104
31135
|
import { createHash as createHash12 } from "node:crypto";
|
|
31105
31136
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31106
31137
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31186,16 +31217,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31186
31217
|
};
|
|
31187
31218
|
}, "meetingProjectsStoreOver");
|
|
31188
31219
|
|
|
31189
|
-
// 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
|
|
31190
31221
|
import { createHash as createHash15 } from "node:crypto";
|
|
31191
31222
|
|
|
31192
|
-
// 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
|
|
31193
31224
|
import { createHash as createHash14 } from "node:crypto";
|
|
31194
31225
|
|
|
31195
|
-
// 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
|
|
31196
31227
|
import { createHash as createHash13 } from "node:crypto";
|
|
31197
31228
|
|
|
31198
|
-
// 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
|
|
31199
31230
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31200
31231
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31201
31232
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31246,7 +31277,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31246
31277
|
return input;
|
|
31247
31278
|
}, "consolidationApplyInput");
|
|
31248
31279
|
|
|
31249
|
-
// 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
|
|
31250
31281
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31251
31282
|
id: String(row2.id),
|
|
31252
31283
|
sourceId: String(row2.source_id),
|
|
@@ -31321,7 +31352,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31321
31352
|
}, { beforeCommit: check3 });
|
|
31322
31353
|
}, "applyTagConsolidation");
|
|
31323
31354
|
|
|
31324
|
-
// 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
|
|
31325
31356
|
var selections = [
|
|
31326
31357
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31327
31358
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31465,7 +31496,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31465
31496
|
};
|
|
31466
31497
|
}, "previewRows");
|
|
31467
31498
|
|
|
31468
|
-
// 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
|
|
31469
31500
|
var kinds = ["project", "tag", "topic"];
|
|
31470
31501
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31471
31502
|
if (signal?.aborted)
|
|
@@ -31729,7 +31760,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31729
31760
|
};
|
|
31730
31761
|
}, "vocabularyStoreOver");
|
|
31731
31762
|
|
|
31732
|
-
// 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
|
|
31733
31764
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
31734
31765
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
31735
31766
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -32121,7 +32152,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32121
32152
|
chosen = `${wanted.slice(0, 4 - suffix.length)}${suffix}`;
|
|
32122
32153
|
}
|
|
32123
32154
|
const at = now2();
|
|
32124
|
-
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);
|
|
32125
32156
|
return projectOf(row2);
|
|
32126
32157
|
}), "addProject"),
|
|
32127
32158
|
projects: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32129,7 +32160,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32129
32160
|
const where = query && queryFilter(query, {
|
|
32130
32161
|
id: { type: "kw", sql: "CAST(id AS TEXT)" },
|
|
32131
32162
|
key: { type: "kw", sql: "key" },
|
|
32132
|
-
name: { type: "kw", sql: "
|
|
32163
|
+
name: { type: "kw", sql: "name_folded", folded: true },
|
|
32133
32164
|
kind: { type: "enum", sql: `CASE WHEN length(key) = ${INBOX_KEY_LENGTH} THEN 'inbox' ELSE 'project' END` },
|
|
32134
32165
|
type: { type: "enum", sql: "type" },
|
|
32135
32166
|
organization_id: { type: "kw", sql: "CAST(organization_id AS TEXT)" },
|
|
@@ -32250,7 +32281,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32250
32281
|
return key2.padEnd(3, "X");
|
|
32251
32282
|
}, "projectKey");
|
|
32252
32283
|
|
|
32253
|
-
// 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
|
|
32254
32285
|
var DAY4 = 864e5;
|
|
32255
32286
|
var SETTING4 = "logs_pruned_at";
|
|
32256
32287
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY4, botUpdatePayloadsMs: 30 * DAY4 };
|
|
@@ -32277,7 +32308,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32277
32308
|
};
|
|
32278
32309
|
}, "logPruner");
|
|
32279
32310
|
|
|
32280
|
-
// 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
|
|
32281
32312
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32282
32313
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32283
32314
|
reason: "meeting-findings.stale"
|
|
@@ -32446,7 +32477,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32446
32477
|
};
|
|
32447
32478
|
}, "meetingFindingsStoreOver");
|
|
32448
32479
|
|
|
32449
|
-
// 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
|
|
32450
32481
|
var RANK_BATCH = 512;
|
|
32451
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";
|
|
32452
32483
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -32717,7 +32748,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
32717
32748
|
}
|
|
32718
32749
|
}), "meetingVectorsOver");
|
|
32719
32750
|
|
|
32720
|
-
// 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
|
|
32721
32752
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
32722
32753
|
var TEXTS = {
|
|
32723
32754
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -32818,11 +32849,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32818
32849
|
};
|
|
32819
32850
|
}, "sourceMentionStoreOver");
|
|
32820
32851
|
|
|
32821
|
-
// 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
|
|
32822
32853
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
32823
32854
|
import { dirname } from "node:path";
|
|
32824
32855
|
|
|
32825
|
-
// 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
|
|
32826
32857
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
32827
32858
|
var CLIENTS_SETTING = "clients";
|
|
32828
32859
|
var coreVersion = (() => {
|
|
@@ -32880,7 +32911,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
32880
32911
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
32881
32912
|
}, "refusalAdvice");
|
|
32882
32913
|
|
|
32883
|
-
// 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
|
|
32884
32915
|
var GENERATED = [
|
|
32885
32916
|
{
|
|
32886
32917
|
"name": "20261010184427_initial",
|
|
@@ -33693,10 +33724,43 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
33693
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;",
|
|
33694
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;"
|
|
33695
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
|
+
]
|
|
33696
33760
|
}
|
|
33697
33761
|
];
|
|
33698
33762
|
|
|
33699
|
-
// 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
|
|
33700
33764
|
var MANIFEST = [
|
|
33701
33765
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
33702
33766
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -33746,7 +33810,9 @@ var MANIFEST = [
|
|
|
33746
33810
|
{ name: "20261027102302_version-35-calendar-neutral-data", version: 35, minCompatible: 34 },
|
|
33747
33811
|
{ name: "20261029162435_version-36-attachment-contact", version: 36, minCompatible: 34 },
|
|
33748
33812
|
{ name: "20261029180959_version-37-identity-phone", version: 37, minCompatible: 34 },
|
|
33749
|
-
{ name: "20261029181000_version-37-contact-mention-triggers", 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 }
|
|
33750
33816
|
];
|
|
33751
33817
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
33752
33818
|
const migrations = [];
|
|
@@ -33770,7 +33836,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
33770
33836
|
return migrations;
|
|
33771
33837
|
}, "generatedMigrations");
|
|
33772
33838
|
|
|
33773
|
-
// 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
|
|
33774
33840
|
var MIGRATIONS = generatedMigrations();
|
|
33775
33841
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
33776
33842
|
version INTEGER PRIMARY KEY,
|
|
@@ -33823,7 +33889,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
33823
33889
|
}
|
|
33824
33890
|
}, "migrate");
|
|
33825
33891
|
|
|
33826
|
-
// 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
|
|
33827
33893
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
33828
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 ?");
|
|
33829
33895
|
if (pending.get(0, 1) === void 0)
|
|
@@ -33845,7 +33911,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
33845
33911
|
}
|
|
33846
33912
|
}, "fillJoinKeys");
|
|
33847
33913
|
|
|
33848
|
-
// 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
|
|
33849
33915
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
33850
33916
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
33851
33917
|
try {
|
|
@@ -33858,8 +33924,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
33858
33924
|
}, "openSqlite");
|
|
33859
33925
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33860
33926
|
quietSqliteWarning();
|
|
33861
|
-
const { drizzle } = await import("./node-
|
|
33862
|
-
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");
|
|
33863
33929
|
const client = await nodeClient(path, { readOnly });
|
|
33864
33930
|
try {
|
|
33865
33931
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33869,8 +33935,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33869
33935
|
}
|
|
33870
33936
|
}, "openUnderNode");
|
|
33871
33937
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33872
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
33873
|
-
const { drizzle } = await import("./bun-
|
|
33938
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KB6PSTWH.js");
|
|
33939
|
+
const { drizzle } = await import("./bun-SMH7PKUS.js");
|
|
33874
33940
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
33875
33941
|
try {
|
|
33876
33942
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33880,7 +33946,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33880
33946
|
}
|
|
33881
33947
|
}, "openUnderBun");
|
|
33882
33948
|
|
|
33883
|
-
// 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
|
|
33884
33950
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
33885
33951
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
33886
33952
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -33895,7 +33961,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
33895
33961
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
33896
33962
|
}, "assertReadCompatible");
|
|
33897
33963
|
|
|
33898
|
-
// 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
|
|
33899
33965
|
var BACKFILL_ON_OPEN = 5e3;
|
|
33900
33966
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
33901
33967
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -33951,10 +34017,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
33951
34017
|
}
|
|
33952
34018
|
}, "openStoreContext");
|
|
33953
34019
|
|
|
33954
|
-
// 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
|
|
33955
34021
|
import { createHash as createHash16 } from "node:crypto";
|
|
33956
34022
|
|
|
33957
|
-
// 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
|
|
33958
34024
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
33959
34025
|
var ref = text3(2048);
|
|
33960
34026
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34020,7 +34086,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
34020
34086
|
}))
|
|
34021
34087
|
});
|
|
34022
34088
|
|
|
34023
|
-
// 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
|
|
34024
34090
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
34025
34091
|
var invalid7 = /* @__PURE__ */ __name((field3) => {
|
|
34026
34092
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34124,7 +34190,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
34124
34190
|
invalid7("external.unused");
|
|
34125
34191
|
}, "validateProjectAnnotationsGraph");
|
|
34126
34192
|
|
|
34127
|
-
// 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
|
|
34128
34194
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34129
34195
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34130
34196
|
var targetSchema = strictObject({
|
|
@@ -34230,7 +34296,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34230
34296
|
};
|
|
34231
34297
|
}, "planBoundProjectAnnotations");
|
|
34232
34298
|
|
|
34233
|
-
// 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
|
|
34234
34300
|
import { createHash as createHash17 } from "node:crypto";
|
|
34235
34301
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34236
34302
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34324,7 +34390,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34324
34390
|
})).digest("hex");
|
|
34325
34391
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34326
34392
|
|
|
34327
|
-
// 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
|
|
34328
34394
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34329
34395
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34330
34396
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34341,7 +34407,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34341
34407
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34342
34408
|
}, "projectAnnotationRequest");
|
|
34343
34409
|
|
|
34344
|
-
// 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
|
|
34345
34411
|
var SnapshotBudget = class {
|
|
34346
34412
|
static {
|
|
34347
34413
|
__name(this, "SnapshotBudget");
|
|
@@ -34367,13 +34433,13 @@ var SnapshotBudget = class {
|
|
|
34367
34433
|
}
|
|
34368
34434
|
};
|
|
34369
34435
|
|
|
34370
|
-
// 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
|
|
34371
34437
|
import { createHash as createHash19 } from "node:crypto";
|
|
34372
34438
|
|
|
34373
|
-
// 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
|
|
34374
34440
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34375
34441
|
|
|
34376
|
-
// 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
|
|
34377
34443
|
import { createHash as createHash18 } from "node:crypto";
|
|
34378
34444
|
var invalid9 = /* @__PURE__ */ __name(() => {
|
|
34379
34445
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -34516,7 +34582,7 @@ var ProjectSnapshotSources = class {
|
|
|
34516
34582
|
}
|
|
34517
34583
|
};
|
|
34518
34584
|
|
|
34519
|
-
// 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
|
|
34520
34586
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
34521
34587
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
34522
34588
|
}, "unsupported");
|
|
@@ -34687,7 +34753,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
34687
34753
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
34688
34754
|
}), "projectAnnotationSnapshot");
|
|
34689
34755
|
|
|
34690
|
-
// 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
|
|
34691
34757
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
34692
34758
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
34693
34759
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -34749,7 +34815,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
34749
34815
|
};
|
|
34750
34816
|
}), "previewAnnotationSnapshot");
|
|
34751
34817
|
|
|
34752
|
-
// 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
|
|
34753
34819
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
34754
34820
|
const mappings = { ...bindings };
|
|
34755
34821
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -34791,7 +34857,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
34791
34857
|
return mappings;
|
|
34792
34858
|
}, "restoreAnnotationRecords");
|
|
34793
34859
|
|
|
34794
|
-
// 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
|
|
34795
34861
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34796
34862
|
async preview(request) {
|
|
34797
34863
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -34821,7 +34887,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34821
34887
|
}
|
|
34822
34888
|
}), "projectAnnotationStoreOver");
|
|
34823
34889
|
|
|
34824
|
-
// 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
|
|
34825
34891
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
34826
34892
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
34827
34893
|
let merged = { from: from2, to };
|
|
@@ -34834,7 +34900,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
34834
34900
|
}, "markRange");
|
|
34835
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");
|
|
34836
34902
|
|
|
34837
|
-
// 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
|
|
34838
34904
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
34839
34905
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
34840
34906
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -34844,7 +34910,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
34844
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);
|
|
34845
34911
|
}, "setTaskRulesStop");
|
|
34846
34912
|
|
|
34847
|
-
// 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
|
|
34848
34914
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34849
34915
|
const { database } = context;
|
|
34850
34916
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -34900,7 +34966,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34900
34966
|
};
|
|
34901
34967
|
}, "syncStoreOver");
|
|
34902
34968
|
|
|
34903
|
-
// 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
|
|
34904
34970
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34905
34971
|
const { database } = context;
|
|
34906
34972
|
return {
|
|
@@ -34922,7 +34988,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34922
34988
|
};
|
|
34923
34989
|
}, "tagsStoreOver");
|
|
34924
34990
|
|
|
34925
|
-
// 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
|
|
34926
34992
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
34927
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
|
|
34928
34994
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35049,7 +35115,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35049
35115
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35050
35116
|
}, "savePictureChunks");
|
|
35051
35117
|
|
|
35052
|
-
// 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
|
|
35053
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,
|
|
35054
35120
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35055
35121
|
FROM messages m
|
|
@@ -35132,7 +35198,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35132
35198
|
return plain2(best(found2));
|
|
35133
35199
|
}, "nearestMessages");
|
|
35134
35200
|
|
|
35135
|
-
// 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
|
|
35136
35202
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35137
35203
|
const { database } = context;
|
|
35138
35204
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35386,7 +35452,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35386
35452
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35387
35453
|
}), "vectorsStoreOver");
|
|
35388
35454
|
|
|
35389
|
-
// 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
|
|
35390
35456
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35391
35457
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35392
35458
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -35474,10 +35540,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
35474
35540
|
}
|
|
35475
35541
|
}, "lastBackup");
|
|
35476
35542
|
|
|
35477
|
-
// 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
|
|
35478
35544
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
35479
35545
|
|
|
35480
|
-
// 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
|
|
35481
35547
|
var COUNTED_TABLES = [
|
|
35482
35548
|
"accounts",
|
|
35483
35549
|
"chats",
|
|
@@ -35562,7 +35628,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
35562
35628
|
};
|
|
35563
35629
|
}, "storeContents");
|
|
35564
35630
|
|
|
35565
|
-
// 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
|
|
35566
35632
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
35567
35633
|
const context = await openStoreContext(options);
|
|
35568
35634
|
try {
|