@wirecat/tg-cli 0.109.0 → 0.110.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-6JLFYFL5.js → adapter-JWUCHTXU.js} +45 -45
- package/dist/bundle/{all-profiles-X7Y3T5S4.js → all-profiles-OMRCKP54.js} +8 -8
- package/dist/bundle/{anthropic-LGVXAADT.js → anthropic-WXFHH74P.js} +5 -5
- package/dist/bundle/{app-server-UI3AFSJX.js → app-server-ILIPNO6T.js} +40 -40
- package/dist/bundle/{bot-api-TQYRNYJQ.js → bot-api-KV765AZK.js} +46 -46
- package/dist/bundle/{bot-history-DDNTNMNB.js → bot-history-3P6EIM5L.js} +15 -15
- package/dist/bundle/{bun-WXGS6HML.js → bun-MJOYPPEN.js} +2 -2
- package/dist/bundle/{bun-sqlite-M6JEXKRT.js → bun-sqlite-GFRVRRDZ.js} +4 -4
- package/dist/bundle/{chunk-C3RX3UOE.js → chunk-2YWQEG2P.js} +11 -11
- package/dist/bundle/{chunk-UIPBAT2T.js → chunk-32HEOKI2.js} +15 -14
- package/dist/bundle/{chunk-BZIZLEJN.js → chunk-3KOF5T4N.js} +4 -4
- package/dist/bundle/{chunk-WHYS6OSG.js → chunk-3L2JTAVD.js} +2 -2
- package/dist/bundle/{chunk-XJVGCCQE.js → chunk-3XTMVGTS.js} +1904 -624
- package/dist/bundle/{chunk-P5ILJ7MN.js → chunk-4BMXELWN.js} +5 -5
- package/dist/bundle/{chunk-ZMZKZL3Y.js → chunk-4GOF43MW.js} +1 -1
- package/dist/bundle/{chunk-7AJ2IESO.js → chunk-4I6HTOCM.js} +1 -1
- package/dist/bundle/{chunk-4R4AH6FM.js → chunk-4YOPRYEY.js} +94 -94
- package/dist/bundle/{chunk-AGVKIJB7.js → chunk-54CWOD7V.js} +6 -6
- package/dist/bundle/{chunk-76C5SSMR.js → chunk-5ASW5BNM.js} +12 -12
- package/dist/bundle/{chunk-P57R2P75.js → chunk-5CMOXHQS.js} +7 -7
- package/dist/bundle/{chunk-N56WXUCW.js → chunk-6KESAYMZ.js} +2 -2
- package/dist/bundle/{chunk-YYOIULA2.js → chunk-6WTLP2SI.js} +8 -8
- package/dist/bundle/{chunk-TMXNMO66.js → chunk-7ABA4EXC.js} +3 -3
- package/dist/bundle/{chunk-RD2NLJSU.js → chunk-7LZBMZQM.js} +4 -4
- package/dist/bundle/{chunk-VFVMB3NV.js → chunk-ABVHA4K6.js} +5 -5
- package/dist/bundle/{chunk-BESIMQ5U.js → chunk-AXNBGLO5.js} +1 -1
- package/dist/bundle/{chunk-INYO2QFW.js → chunk-AZYVTDAE.js} +3 -3
- package/dist/bundle/{chunk-N5FSRC6H.js → chunk-BWRCPMMC.js} +41 -31
- package/dist/bundle/{chunk-2ILQYCBY.js → chunk-BYOEVYY2.js} +553 -291
- package/dist/bundle/{chunk-NAVNCM5K.js → chunk-EB44Z44U.js} +1 -1
- package/dist/bundle/{chunk-XMMWKHNY.js → chunk-EO563SUX.js} +7 -7
- package/dist/bundle/{chunk-OHLMHBDI.js → chunk-F24EAGOU.js} +32 -31
- package/dist/bundle/{chunk-WNTXIQMB.js → chunk-F7RWNBC2.js} +2 -2
- package/dist/bundle/{chunk-IGIPIO4J.js → chunk-FYAHTTOB.js} +11 -11
- package/dist/bundle/{chunk-SH63Q4QR.js → chunk-GPIORQAD.js} +22 -22
- package/dist/bundle/{chunk-BHPCZCX7.js → chunk-HCAYTAJN.js} +2 -2
- package/dist/bundle/{chunk-P55L4S6N.js → chunk-JDOSIWPN.js} +3 -3
- package/dist/bundle/{chunk-MF6NKU3Z.js → chunk-KLOFBUXA.js} +22 -22
- package/dist/bundle/{chunk-IV2QWSPG.js → chunk-L3YDXUDK.js} +12 -3
- package/dist/bundle/{chunk-QQF7RDLR.js → chunk-M3XIME74.js} +4 -4
- package/dist/bundle/{chunk-CHI6D4D6.js → chunk-MXIBRT6W.js} +4 -4
- package/dist/bundle/{chunk-ZHP44EML.js → chunk-MZRD776E.js} +3 -3
- package/dist/bundle/{chunk-KHKC236O.js → chunk-NDT22GBK.js} +2 -2
- package/dist/bundle/{chunk-IULYECPC.js → chunk-NFBOZT7H.js} +4 -4
- package/dist/bundle/{chunk-GUFM5RLW.js → chunk-ONHHBPV3.js} +2 -2
- package/dist/bundle/{chunk-CVLDXFRP.js → chunk-Q35J5LCO.js} +8 -8
- package/dist/bundle/{chunk-DZVYGBZB.js → chunk-QRH2AWBZ.js} +55 -54
- package/dist/bundle/{chunk-25VC6U3A.js → chunk-RARYRHQA.js} +1 -1
- package/dist/bundle/{chunk-AD3QPYI3.js → chunk-RSZEEWOW.js} +2 -2
- package/dist/bundle/{chunk-M62LF3QE.js → chunk-RXWG7OWT.js} +348 -300
- package/dist/bundle/{chunk-ZUOS7QUB.js → chunk-SD5J5T7M.js} +11 -11
- package/dist/bundle/{chunk-S7B6MTXX.js → chunk-SLAPUEMZ.js} +6 -6
- package/dist/bundle/{chunk-CH2ESVV5.js → chunk-TDQVVXPF.js} +42 -24
- package/dist/bundle/{chunk-YXCQ4DLZ.js → chunk-TJA3BWY3.js} +1 -1
- package/dist/bundle/{chunk-DLAFGSTN.js → chunk-UIPT6IAU.js} +1 -1
- package/dist/bundle/{chunk-UUQ3BH2Z.js → chunk-VM7I5VKX.js} +2 -2
- package/dist/bundle/{chunk-5SUFMBU5.js → chunk-VOBMR7E5.js} +45 -45
- package/dist/bundle/{chunk-VYR2IIWW.js → chunk-W3B6EEZU.js} +1 -1
- package/dist/bundle/{chunk-7T7ILNCU.js → chunk-XLNYDJKG.js} +2 -2
- package/dist/bundle/{chunk-ZFMS5G4H.js → chunk-YPEAEEHF.js} +2 -2
- package/dist/bundle/{chunk-DO33KAMM.js → chunk-YPLL3Q3M.js} +57 -57
- package/dist/bundle/{chunk-3PEZWXKO.js → chunk-YWSNUUW5.js} +6 -6
- package/dist/bundle/command-contract-TNSW7W6G.js +32 -0
- package/dist/bundle/{decode-RKPOGPBE.js → decode-3KBXZCFM.js} +4 -4
- package/dist/bundle/{echarts-H5QQRBHI.js → echarts-24TVPFGC.js} +2 -2
- package/dist/bundle/{embed-7TVAPNP7.js → embed-3BDPZ4Q7.js} +5 -5
- package/dist/bundle/{embedder-YOOHWWN6.js → embedder-EMVDEZFR.js} +8 -8
- package/dist/bundle/{entry-SAKW5HEZ.js → entry-NQD6Z2BM.js} +5 -5
- package/dist/bundle/{first-run-C744N572.js → first-run-ZBIO6C67.js} +9 -9
- package/dist/bundle/first-screen-4HRCG7OX.js +30 -0
- package/dist/bundle/{identity-NRWTZIQ4.js → identity-EDGOOTOM.js} +3 -3
- package/dist/bundle/{instructions-6LWRAW47.js → instructions-N2WVMNFZ.js} +1 -1
- package/dist/bundle/{mcp-WSGVVZWI.js → mcp-EMNFFY4N.js} +2 -2
- package/dist/bundle/{node-XN4PIVWW.js → node-VBZAZHUS.js} +2 -2
- package/dist/bundle/{node-sqlite-PCBGROGQ.js → node-sqlite-C3V64OAL.js} +4 -4
- package/dist/bundle/{oauth-PX6NGHUV.js → oauth-NZXELYDA.js} +6 -6
- package/dist/bundle/{open-BKJGJ6GX.js → open-2XRUGMV7.js} +3 -3
- package/dist/bundle/{openai-MJP7CZXP.js → openai-OLGTN3ZB.js} +13 -13
- package/dist/bundle/{process-4PRR3MLT.js → process-CASPZ2DH.js} +1 -1
- package/dist/bundle/{program-7YZUO42B.js → program-QPQDSGYA.js} +50 -48
- package/dist/bundle/{prompt-CILSZC2R.js → prompt-ESZL7SGX.js} +4 -4
- package/dist/bundle/{proxy-transport-FWGKTYBL.js → proxy-transport-OROEVBCG.js} +4 -4
- package/dist/bundle/{recognize-AVFDJAIL.js → recognize-LQ7QOG4T.js} +3 -3
- package/dist/bundle/{remote-2VYXGOM4.js → remote-34XP4EDN.js} +6 -6
- package/dist/bundle/{rerank-6FU2JPCD.js → rerank-7F6NLBCW.js} +6 -6
- package/dist/bundle/{serve-3YQOHBR6.js → serve-M6TTKXI4.js} +8 -8
- package/dist/bundle/{server-TPK3LNEX.js → server-GLZ5M7PE.js} +32 -32
- package/dist/bundle/server-KOW7OKE2.js +56 -0
- package/dist/bundle/{state-LLUNBLZE.js → state-UKKPLMHS.js} +5 -5
- package/dist/bundle/{store-27FQ743G.js → store-J2MBIDJK.js} +10 -10
- package/dist/bundle/store-maintenance-command-64B57C3U.js +45 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +2 -1
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-E2MWR3T3.js +0 -32
- package/dist/bundle/first-screen-7GKUEIWS.js +0 -30
- package/dist/bundle/server-S2K4YDDG.js +0 -56
- package/dist/bundle/store-maintenance-command-AFJMKEBK.js +0 -45
- /package/dist/bundle/{chunk-62EDJKGP.js → chunk-NPGVOZVK.js} +0 -0
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
validateQuery,
|
|
53
53
|
walkQuery,
|
|
54
54
|
zonedMoment
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-YPLL3Q3M.js";
|
|
56
56
|
import {
|
|
57
57
|
DEFAULT_STEMMERS,
|
|
58
58
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -65,21 +65,21 @@ import {
|
|
|
65
65
|
fold,
|
|
66
66
|
normalize,
|
|
67
67
|
parseStemmers
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6WTLP2SI.js";
|
|
69
69
|
import {
|
|
70
70
|
DEFAULT_TASK_CATEGORIES,
|
|
71
71
|
sharedConfigPath,
|
|
72
72
|
storedTaskCategories,
|
|
73
73
|
taskCategoriesReader
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-54CWOD7V.js";
|
|
75
75
|
import {
|
|
76
76
|
storePath
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-VM7I5VKX.js";
|
|
78
78
|
import {
|
|
79
79
|
PRAGMAS,
|
|
80
80
|
quietSqliteWarning,
|
|
81
81
|
storeCapable
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-SLAPUEMZ.js";
|
|
83
83
|
import {
|
|
84
84
|
SQLiteTable,
|
|
85
85
|
TableAliasProxyHandler,
|
|
@@ -104,10 +104,10 @@ import {
|
|
|
104
104
|
sql,
|
|
105
105
|
sqliteTable,
|
|
106
106
|
text
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-4GOF43MW.js";
|
|
108
108
|
import {
|
|
109
109
|
singleLine
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-BWRCPMMC.js";
|
|
111
111
|
import {
|
|
112
112
|
CliError,
|
|
113
113
|
array,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
safeParse,
|
|
126
126
|
strictObject,
|
|
127
127
|
string
|
|
128
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-EO563SUX.js";
|
|
129
129
|
import {
|
|
130
130
|
resolveFrom
|
|
131
131
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
__name
|
|
134
134
|
} from "./chunk-ZVVMGPBJ.js";
|
|
135
135
|
|
|
136
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
137
137
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
138
138
|
const methods = whole;
|
|
139
139
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -261,7 +261,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
261
261
|
};
|
|
262
262
|
}, "bindAccount");
|
|
263
263
|
|
|
264
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
265
265
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
266
266
|
var PROVIDERS = [
|
|
267
267
|
{ name: "telegram", kind: "messages", aliases: ["tg"] },
|
|
@@ -352,7 +352,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
|
352
352
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
353
353
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
354
354
|
|
|
355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
356
356
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
357
357
|
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");
|
|
358
358
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -375,7 +375,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
375
375
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
376
376
|
}, "sourceOf");
|
|
377
377
|
|
|
378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
379
379
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
380
380
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
381
381
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -562,7 +562,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
|
|
|
562
562
|
return { accounts: [...chosen.values()], skipped };
|
|
563
563
|
}, "fitting");
|
|
564
564
|
|
|
565
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
566
566
|
var IndexBuilderOn = class {
|
|
567
567
|
static {
|
|
568
568
|
__name(this, "IndexBuilderOn");
|
|
@@ -757,7 +757,7 @@ function alias(table, alias2) {
|
|
|
757
757
|
}
|
|
758
758
|
__name(alias, "alias");
|
|
759
759
|
|
|
760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
761
761
|
var ENTITY_TABLES = {
|
|
762
762
|
account: "accounts",
|
|
763
763
|
attachment: "attachments",
|
|
@@ -797,7 +797,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
797
797
|
return { table, pointer, type, count, known: known2 };
|
|
798
798
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
799
799
|
|
|
800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
801
801
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
802
802
|
id: integer("id").primaryKey(),
|
|
803
803
|
name: text("name").notNull().unique(),
|
|
@@ -806,7 +806,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
806
806
|
updatedAt: integer("updated_at").notNull()
|
|
807
807
|
});
|
|
808
808
|
|
|
809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
809
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
810
810
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
811
811
|
sourceKey: text("source_key").notNull(),
|
|
812
812
|
collection: text("collection").notNull(),
|
|
@@ -816,13 +816,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
816
816
|
createdAt: integer("created_at").notNull()
|
|
817
817
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
818
818
|
|
|
819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
819
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
820
820
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
821
821
|
id: integer("id").notNull(),
|
|
822
822
|
indexableType: text("indexable_type").notNull()
|
|
823
823
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
824
824
|
|
|
825
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
826
826
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
827
827
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
828
828
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -848,7 +848,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
848
848
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
849
849
|
]);
|
|
850
850
|
|
|
851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
852
852
|
var accounts = sqliteTable("accounts", {
|
|
853
853
|
id: integer("id").primaryKey(),
|
|
854
854
|
provider: text("provider").notNull(),
|
|
@@ -2344,7 +2344,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2344
2344
|
at: integer("at").notNull()
|
|
2345
2345
|
});
|
|
2346
2346
|
|
|
2347
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2348
2348
|
var ARMS = [
|
|
2349
2349
|
[
|
|
2350
2350
|
"message",
|
|
@@ -2471,7 +2471,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2471
2471
|
return recomputed;
|
|
2472
2472
|
}, "drainInvolvementQueue");
|
|
2473
2473
|
|
|
2474
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2474
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2475
2475
|
import { domainToUnicode } from "node:url";
|
|
2476
2476
|
|
|
2477
2477
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12493,7 +12493,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12493
12493
|
}, "oa");
|
|
12494
12494
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12495
12495
|
|
|
12496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12497
12497
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12498
12498
|
var ID = /^[\w-]{10,}$/;
|
|
12499
12499
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12534,7 +12534,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12534
12534
|
return { url, documentId: googleDocumentId(url) };
|
|
12535
12535
|
}), "googleDocumentLinks");
|
|
12536
12536
|
|
|
12537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12538
12538
|
var PHONE_PLANS = [
|
|
12539
12539
|
{
|
|
12540
12540
|
country: "us",
|
|
@@ -12914,7 +12914,7 @@ var PHONE_PLANS = [
|
|
|
12914
12914
|
}
|
|
12915
12915
|
];
|
|
12916
12916
|
|
|
12917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
12918
12918
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12919
12919
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12920
12920
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12955,7 +12955,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12955
12955
|
return void 0;
|
|
12956
12956
|
}, "nationalPhone");
|
|
12957
12957
|
|
|
12958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
12959
12959
|
var BEFORE = [
|
|
12960
12960
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12961
12961
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13215,7 +13215,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13215
13215
|
return found2.sort((a, b) => a.start - b.start);
|
|
13216
13216
|
}, "findPlaces");
|
|
13217
13217
|
|
|
13218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13219
13219
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13220
13220
|
var MENTION_VERSIONS = {
|
|
13221
13221
|
phone: 1,
|
|
@@ -13405,7 +13405,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13405
13405
|
};
|
|
13406
13406
|
}, "typedPhone");
|
|
13407
13407
|
|
|
13408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13409
13409
|
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";
|
|
13410
13410
|
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";
|
|
13411
13411
|
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";
|
|
@@ -13413,7 +13413,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13413
13413
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13414
13414
|
var NAME_WORDS = WORDS.split(" ");
|
|
13415
13415
|
|
|
13416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13417
13417
|
var LATIN_TO_CYRILLIC = {
|
|
13418
13418
|
shch: "\u0449",
|
|
13419
13419
|
sch: "\u0449",
|
|
@@ -13621,7 +13621,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13621
13621
|
return found2;
|
|
13622
13622
|
}, "findUnknownNames");
|
|
13623
13623
|
|
|
13624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13625
13625
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13626
13626
|
"webpage",
|
|
13627
13627
|
"share",
|
|
@@ -13653,7 +13653,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13653
13653
|
});
|
|
13654
13654
|
}, "matchDownloads");
|
|
13655
13655
|
|
|
13656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
13657
13657
|
var QUERY_VERSION = 1;
|
|
13658
13658
|
var QUERY_LIMITS2 = {
|
|
13659
13659
|
...QUERY_LIMITS,
|
|
@@ -13684,7 +13684,7 @@ function exhausted(budget) {
|
|
|
13684
13684
|
}
|
|
13685
13685
|
__name(exhausted, "exhausted");
|
|
13686
13686
|
|
|
13687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
13688
13688
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13689
13689
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13690
13690
|
kind: "char",
|
|
@@ -14084,7 +14084,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14084
14084
|
return out;
|
|
14085
14085
|
}, "foldRegex");
|
|
14086
14086
|
|
|
14087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14088
14088
|
var PRESET_VERSION = 1;
|
|
14089
14089
|
var PRESETS = {
|
|
14090
14090
|
password: {
|
|
@@ -14138,7 +14138,7 @@ var PRESETS = {
|
|
|
14138
14138
|
}
|
|
14139
14139
|
};
|
|
14140
14140
|
|
|
14141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14142
14142
|
var FIELD_VERSION = 2;
|
|
14143
14143
|
var UNITS = {
|
|
14144
14144
|
"": 1,
|
|
@@ -14587,12 +14587,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
14587
14587
|
return validateFields(parsed2.output);
|
|
14588
14588
|
}, "validateAst");
|
|
14589
14589
|
|
|
14590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14590
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14591
14591
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14592
14592
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14593
14593
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14594
14594
|
|
|
14595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14595
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14596
14596
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14597
14597
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14598
14598
|
var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
@@ -14616,7 +14616,7 @@ var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
|
14616
14616
|
};
|
|
14617
14617
|
}, "linkMatch");
|
|
14618
14618
|
|
|
14619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14619
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14620
14620
|
var SETTING = "phoneCountries";
|
|
14621
14621
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14622
14622
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14647,7 +14647,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14647
14647
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14648
14648
|
}, "valueMatch");
|
|
14649
14649
|
|
|
14650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14650
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
14651
14651
|
var SCHEME = "msg:";
|
|
14652
14652
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
14653
14653
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -14661,7 +14661,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
14661
14661
|
return { provider, account, chat: chat2, message: message2 };
|
|
14662
14662
|
}, "parseLocator");
|
|
14663
14663
|
|
|
14664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
14665
14665
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14666
14666
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14667
14667
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14689,7 +14689,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14689
14689
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14690
14690
|
}, "vocabularySimilarity");
|
|
14691
14691
|
|
|
14692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
14693
14693
|
import { createHash } from "node:crypto";
|
|
14694
14694
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14695
14695
|
try {
|
|
@@ -14755,7 +14755,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14755
14755
|
});
|
|
14756
14756
|
}, "guardTagCreation");
|
|
14757
14757
|
|
|
14758
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
14759
14759
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
14760
14760
|
throw new CliError("validation_error", message2);
|
|
14761
14761
|
}, "invalid");
|
|
@@ -14832,7 +14832,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14832
14832
|
};
|
|
14833
14833
|
}, "createTagRedirectIndex");
|
|
14834
14834
|
|
|
14835
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
14836
14836
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14837
14837
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14838
14838
|
if (!row2)
|
|
@@ -14860,7 +14860,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14860
14860
|
return snapshot2;
|
|
14861
14861
|
}, "tagRedirectSnapshot");
|
|
14862
14862
|
|
|
14863
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14863
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
14864
14864
|
import { createHash as createHash2 } from "node:crypto";
|
|
14865
14865
|
var TASK_KEY_PREFIXES = {
|
|
14866
14866
|
question: "Q",
|
|
@@ -14888,7 +14888,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14888
14888
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14889
14889
|
}, "taskAccountOf");
|
|
14890
14890
|
|
|
14891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14891
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
14892
14892
|
var SIMPLE_REFERENCES = [
|
|
14893
14893
|
"note",
|
|
14894
14894
|
"document",
|
|
@@ -14960,7 +14960,7 @@ var folderPath = /* @__PURE__ */ __name((path) => {
|
|
|
14960
14960
|
}, "folderPath");
|
|
14961
14961
|
var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
|
|
14962
14962
|
|
|
14963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14963
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
14964
14964
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14965
14965
|
var REFERABLE = {
|
|
14966
14966
|
note: { tombstone: true },
|
|
@@ -15118,7 +15118,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15118
15118
|
}, "taskIdOf");
|
|
15119
15119
|
var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
|
|
15120
15120
|
|
|
15121
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15122
15122
|
var toMs = /* @__PURE__ */ __name((iso11) => {
|
|
15123
15123
|
if (iso11 === null || iso11 === void 0)
|
|
15124
15124
|
return null;
|
|
@@ -15132,7 +15132,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15132
15132
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15133
15133
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15134
15134
|
|
|
15135
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15135
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15136
15136
|
var TAG_KINDS = ["tag", "topic"];
|
|
15137
15137
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15138
15138
|
var TAG_TYPE = {
|
|
@@ -15323,7 +15323,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15323
15323
|
return result;
|
|
15324
15324
|
}, "tagsOf");
|
|
15325
15325
|
|
|
15326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15327
15327
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15328
15328
|
var SPEECH = speech("att");
|
|
15329
15329
|
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");
|
|
@@ -15678,7 +15678,7 @@ var FIELD_COMPILERS = {
|
|
|
15678
15678
|
subject
|
|
15679
15679
|
};
|
|
15680
15680
|
|
|
15681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15682
15682
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15683
15683
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15684
15684
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15694,7 +15694,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15694
15694
|
};
|
|
15695
15695
|
}, "placeOf");
|
|
15696
15696
|
|
|
15697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15697
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
15698
15698
|
var DRAIN_ON_WRITE = 500;
|
|
15699
15699
|
var METHOD = "rules";
|
|
15700
15700
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15857,7 +15857,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15857
15857
|
return queued.length;
|
|
15858
15858
|
}, "drainMentions");
|
|
15859
15859
|
|
|
15860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
15861
15861
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15862
15862
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15863
15863
|
if (!exists2)
|
|
@@ -15865,7 +15865,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15865
15865
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15866
15866
|
}, "indexRow");
|
|
15867
15867
|
|
|
15868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
15869
15869
|
var INDEX = "message_stems";
|
|
15870
15870
|
var SETTING2 = "searchStemmers";
|
|
15871
15871
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15987,7 +15987,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15987
15987
|
};
|
|
15988
15988
|
}, "stemmerCache");
|
|
15989
15989
|
|
|
15990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
15991
15991
|
var SQLITE_BUSY = 5;
|
|
15992
15992
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
15993
15993
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -16024,7 +16024,14 @@ var connectionOf = /* @__PURE__ */ __name((database) => {
|
|
|
16024
16024
|
return connection;
|
|
16025
16025
|
}, "connectionOf");
|
|
16026
16026
|
var write = /* @__PURE__ */ __name((database, body2, { beforeCommit } = {}) => transact(database, body2, true, beforeCommit), "write");
|
|
16027
|
-
var writeBatch = /* @__PURE__ */ __name((database, body2) =>
|
|
16027
|
+
var writeBatch = /* @__PURE__ */ __name((database, body2) => {
|
|
16028
|
+
const outer = connectionOf(database).depth === 0;
|
|
16029
|
+
const result = transact(database, body2, false);
|
|
16030
|
+
if (outer)
|
|
16031
|
+
Atomics.wait(pause, 0, 0, BATCH_PAUSE_MS);
|
|
16032
|
+
return result;
|
|
16033
|
+
}, "writeBatch");
|
|
16034
|
+
var BATCH_PAUSE_MS = 2;
|
|
16028
16035
|
var transact = /* @__PURE__ */ __name((database, body2, drain, beforeCommit) => {
|
|
16029
16036
|
const connection = connectionOf(database);
|
|
16030
16037
|
if (connection.reading)
|
|
@@ -16075,7 +16082,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
16075
16082
|
}
|
|
16076
16083
|
}, "read");
|
|
16077
16084
|
|
|
16078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
16079
16086
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16080
16087
|
coalesce(CASE k.chunkable_type
|
|
16081
16088
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16217,7 +16224,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16217
16224
|
}, "dropUnusedVectors");
|
|
16218
16225
|
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");
|
|
16219
16226
|
|
|
16220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16221
16228
|
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({
|
|
16222
16229
|
target: [accounts.provider, accounts.externalId],
|
|
16223
16230
|
set: {
|
|
@@ -16323,7 +16330,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16323
16330
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16324
16331
|
}, "dropOrphanPeople");
|
|
16325
16332
|
|
|
16326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16327
16334
|
var FOLDED = [
|
|
16328
16335
|
{ table: "tasks", column: "title" },
|
|
16329
16336
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16360,7 +16367,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16360
16367
|
return filled2;
|
|
16361
16368
|
}, "fillFolded");
|
|
16362
16369
|
|
|
16363
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16364
16371
|
import { createHash as createHash3 } from "node:crypto";
|
|
16365
16372
|
var CHUNK_CHARS = 1200;
|
|
16366
16373
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16465,7 +16472,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16465
16472
|
return chunks2;
|
|
16466
16473
|
}, "cutChunks");
|
|
16467
16474
|
|
|
16468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
16469
16476
|
var DAY = 864e5;
|
|
16470
16477
|
var CURRENCY = [
|
|
16471
16478
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16582,7 +16589,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
16582
16589
|
return best?.day ?? null;
|
|
16583
16590
|
}, "dueDayOf");
|
|
16584
16591
|
|
|
16585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
16586
16593
|
var DAY2 = 864e5;
|
|
16587
16594
|
var STOP_WORDS = new Set([
|
|
16588
16595
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -16737,7 +16744,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
16737
16744
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
16738
16745
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
16739
16746
|
|
|
16740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
16741
16748
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
16742
16749
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
16743
16750
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17008,7 +17015,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17008
17015
|
};
|
|
17009
17016
|
}, "readiness");
|
|
17010
17017
|
|
|
17011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
17012
17019
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17013
17020
|
var SCAN_PAGE2 = 5e3;
|
|
17014
17021
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17071,7 +17078,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17071
17078
|
}, "nearestPictures")
|
|
17072
17079
|
}), "documentPicturesOver");
|
|
17073
17080
|
|
|
17074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
17075
17082
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
17076
17083
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
17077
17084
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17136,7 +17143,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17136
17143
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17137
17144
|
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");
|
|
17138
17145
|
|
|
17139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17140
17147
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17141
17148
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17142
17149
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17226,7 +17233,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17226
17233
|
});
|
|
17227
17234
|
}, "linkMeeting");
|
|
17228
17235
|
|
|
17229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17230
17237
|
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), ''))";
|
|
17231
17238
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17232
17239
|
"working-location",
|
|
@@ -17456,7 +17463,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17456
17463
|
return true;
|
|
17457
17464
|
}, "resetNoteIndex");
|
|
17458
17465
|
|
|
17459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17466
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
17460
17467
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17461
17468
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17462
17469
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17475,7 +17482,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17475
17482
|
}
|
|
17476
17483
|
}, "resolvePersonLinks");
|
|
17477
17484
|
|
|
17478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
17479
17486
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17480
17487
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17481
17488
|
find: orm.select({
|
|
@@ -17700,7 +17707,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
17700
17707
|
}, "meetingIdentityPk");
|
|
17701
17708
|
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");
|
|
17702
17709
|
|
|
17703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
17704
17711
|
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");
|
|
17705
17712
|
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");
|
|
17706
17713
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -17980,7 +17987,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
17980
17987
|
}
|
|
17981
17988
|
}, "replaceAutoTags");
|
|
17982
17989
|
|
|
17983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
17984
17991
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
17985
17992
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
17986
17993
|
var counterValue = /* @__PURE__ */ __name((message2, field3) => {
|
|
@@ -18017,7 +18024,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
18017
18024
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
18018
18025
|
}, "counterFreshness");
|
|
18019
18026
|
|
|
18020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
18021
18028
|
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");
|
|
18022
18029
|
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;
|
|
18023
18030
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -18098,7 +18105,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
18098
18105
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
18099
18106
|
}, "mailCore");
|
|
18100
18107
|
|
|
18101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
18102
18109
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
18103
18110
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
18104
18111
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18208,7 +18215,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
18208
18215
|
return emails3 + threads;
|
|
18209
18216
|
}, "drainEmailIndex");
|
|
18210
18217
|
|
|
18211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
18212
18219
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18213
18220
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18214
18221
|
var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalidity) => database.prepare(`SELECT l.uid, e.external_id, coalesce(e.received_at, e.sent_at) AS at, e.read, e.flagged,
|
|
@@ -18254,7 +18261,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18254
18261
|
leave.run(emailId, Number(box.id), emailId, Number(box.id));
|
|
18255
18262
|
}, "forgetLocations");
|
|
18256
18263
|
|
|
18257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18258
18265
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18259
18266
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18260
18267
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18304,7 +18311,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18304
18311
|
return threads.length;
|
|
18305
18312
|
}, "markEmailsRestored");
|
|
18306
18313
|
|
|
18307
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18308
18315
|
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");
|
|
18309
18316
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18310
18317
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18371,7 +18378,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18371
18378
|
}
|
|
18372
18379
|
}), "mailRulesOver");
|
|
18373
18380
|
|
|
18374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18375
18382
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18376
18383
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18377
18384
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18379,7 +18386,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18379
18386
|
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);
|
|
18380
18387
|
}, "reviewLink");
|
|
18381
18388
|
|
|
18382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
18383
18390
|
function checkMeetingCancelled(signal) {
|
|
18384
18391
|
if (!signal?.aborted)
|
|
18385
18392
|
return;
|
|
@@ -18390,7 +18397,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18390
18397
|
}
|
|
18391
18398
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18392
18399
|
|
|
18393
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18400
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
18394
18401
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18395
18402
|
id: Number(row2.id),
|
|
18396
18403
|
accountId: Number(row2.account_id),
|
|
@@ -18440,7 +18447,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18440
18447
|
createdAt: Number(row2.created_at)
|
|
18441
18448
|
}), "transcriptRowOf");
|
|
18442
18449
|
|
|
18443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
18444
18451
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18445
18452
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18446
18453
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18607,7 +18614,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18607
18614
|
}
|
|
18608
18615
|
}), "meetingReadsOver");
|
|
18609
18616
|
|
|
18610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
18611
18618
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18612
18619
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18613
18620
|
const params = [input.accountId];
|
|
@@ -18650,7 +18657,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18650
18657
|
return { clauses, params };
|
|
18651
18658
|
}, "meetingSelectionSql");
|
|
18652
18659
|
|
|
18653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
18654
18661
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18655
18662
|
async meetingChatLines(input) {
|
|
18656
18663
|
checkMeetingCancelled(input.signal);
|
|
@@ -18678,7 +18685,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18678
18685
|
}
|
|
18679
18686
|
}), "meetingChatLinesOver");
|
|
18680
18687
|
|
|
18681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
18682
18689
|
var MESSAGE_FIELDS = {
|
|
18683
18690
|
pk: messages.id,
|
|
18684
18691
|
nativeId: messages.externalId,
|
|
@@ -18845,7 +18852,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18845
18852
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18846
18853
|
}), "chatActivity");
|
|
18847
18854
|
|
|
18848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
18849
18856
|
var HIT_FIELDS = {
|
|
18850
18857
|
...MESSAGE_FIELDS,
|
|
18851
18858
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18944,7 +18951,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18944
18951
|
};
|
|
18945
18952
|
}, "directReplies");
|
|
18946
18953
|
|
|
18947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
18948
18955
|
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");
|
|
18949
18956
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18950
18957
|
const found2 = identityRow(context, ref3);
|
|
@@ -19075,7 +19082,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
19075
19082
|
}, "mentioning");
|
|
19076
19083
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
19077
19084
|
|
|
19078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
19079
19086
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
19080
19087
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
19081
19088
|
}, "missing");
|
|
@@ -19197,7 +19204,7 @@ function meetingContextLinksOver(context) {
|
|
|
19197
19204
|
}
|
|
19198
19205
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19199
19206
|
|
|
19200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19201
19208
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19202
19209
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19203
19210
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19226,7 +19233,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19226
19233
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19227
19234
|
}, "indexedText");
|
|
19228
19235
|
|
|
19229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19230
19237
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19231
19238
|
var meetingCurrentIndexRows = `
|
|
19232
19239
|
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
|
|
@@ -19257,7 +19264,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19257
19264
|
}, "invalidateMeetingStems");
|
|
19258
19265
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19259
19266
|
|
|
19260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19267
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19261
19268
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19262
19269
|
return {
|
|
19263
19270
|
async indexSearch(original) {
|
|
@@ -19325,10 +19332,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19325
19332
|
}
|
|
19326
19333
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19327
19334
|
|
|
19328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19329
19336
|
import { createHash as createHash4 } from "node:crypto";
|
|
19330
19337
|
|
|
19331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19332
19339
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19333
19340
|
const padded = ` ${term} `;
|
|
19334
19341
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19337,7 +19344,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19337
19344
|
return [...pieces];
|
|
19338
19345
|
}, "trigrams");
|
|
19339
19346
|
|
|
19340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19341
19348
|
var SHORTEST_CORRECTION = 3;
|
|
19342
19349
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19343
19350
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19384,7 +19391,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19384
19391
|
return corrections;
|
|
19385
19392
|
}, "correctWords");
|
|
19386
19393
|
|
|
19387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
19388
19395
|
var SHORTEST_GARBLED = 4;
|
|
19389
19396
|
var MOST_WIDENED = 64;
|
|
19390
19397
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19476,7 +19483,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19476
19483
|
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));
|
|
19477
19484
|
}, "widenWords");
|
|
19478
19485
|
|
|
19479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
19480
19487
|
import { readFileSync } from "node:fs";
|
|
19481
19488
|
var loaded;
|
|
19482
19489
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19535,7 +19542,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19535
19542
|
return false;
|
|
19536
19543
|
}, "knownRussianWord");
|
|
19537
19544
|
|
|
19538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
19539
19546
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19540
19547
|
var MOST_WORDS = 128;
|
|
19541
19548
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19762,7 +19769,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19762
19769
|
return check3(tree);
|
|
19763
19770
|
}, "matchMeetingText");
|
|
19764
19771
|
|
|
19765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19766
19773
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19767
19774
|
throw new CliError("validation_error", message2);
|
|
19768
19775
|
}, "fail");
|
|
@@ -19939,7 +19946,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19939
19946
|
}
|
|
19940
19947
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19941
19948
|
|
|
19942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
19943
19950
|
import { createHash as createHash5 } from "node:crypto";
|
|
19944
19951
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19945
19952
|
if (value === void 0)
|
|
@@ -20029,7 +20036,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
20029
20036
|
}
|
|
20030
20037
|
}), "meetingParticipantSearchOver");
|
|
20031
20038
|
|
|
20032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
20033
20040
|
var preparationQueries = {
|
|
20034
20041
|
participants: {
|
|
20035
20042
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -20079,7 +20086,7 @@ var preparationQueries = {
|
|
|
20079
20086
|
}
|
|
20080
20087
|
};
|
|
20081
20088
|
|
|
20082
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20089
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
20083
20090
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20084
20091
|
async preparationContext(original) {
|
|
20085
20092
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -20120,7 +20127,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20120
20127
|
}
|
|
20121
20128
|
}), "meetingPreparationContextOver");
|
|
20122
20129
|
|
|
20123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
20124
20131
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
20125
20132
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
20126
20133
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20134,7 +20141,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20134
20141
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20135
20142
|
)`, "preparationSubjects");
|
|
20136
20143
|
|
|
20137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
20138
20145
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20139
20146
|
async preparationKnowledge(original) {
|
|
20140
20147
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20179,7 +20186,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20179
20186
|
}
|
|
20180
20187
|
}), "meetingPreparationKnowledgeOver");
|
|
20181
20188
|
|
|
20182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
20183
20190
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20184
20191
|
async preparationNotes(original) {
|
|
20185
20192
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20232,7 +20239,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20232
20239
|
}
|
|
20233
20240
|
}), "meetingPreparationNotesOver");
|
|
20234
20241
|
|
|
20235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20242
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20236
20243
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20237
20244
|
async relatedHistory(original) {
|
|
20238
20245
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20303,7 +20310,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20303
20310
|
}
|
|
20304
20311
|
}), "meetingRelatedHistoryOver");
|
|
20305
20312
|
|
|
20306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20307
20314
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20308
20315
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20309
20316
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20384,7 +20391,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20384
20391
|
}
|
|
20385
20392
|
}), "meetingReviewOver");
|
|
20386
20393
|
|
|
20387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
20388
20395
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20389
20396
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20390
20397
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20438,7 +20445,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20438
20445
|
}
|
|
20439
20446
|
}), "meetingSeriesHistoryOver");
|
|
20440
20447
|
|
|
20441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
20442
20449
|
var MOST_ROWS = 5e5;
|
|
20443
20450
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20444
20451
|
async meetingStats(input) {
|
|
@@ -20485,7 +20492,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20485
20492
|
}
|
|
20486
20493
|
}), "meetingStatsOver");
|
|
20487
20494
|
|
|
20488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
20489
20496
|
var CURSOR_KEY = "meetings";
|
|
20490
20497
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20491
20498
|
id: Number(row2.id),
|
|
@@ -21037,7 +21044,33 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
21037
21044
|
};
|
|
21038
21045
|
}, "meetingStoreOver");
|
|
21039
21046
|
|
|
21040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21047
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
21048
|
+
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
21049
|
+
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
21050
|
+
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
21051
|
+
}, "syncStateOf");
|
|
21052
|
+
var writeState = /* @__PURE__ */ __name(({ orm, now: now2 }, accountKey, name, value) => {
|
|
21053
|
+
orm.insert(syncCursors).values({ accountId: accountKey, key: name, value, createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
|
|
21054
|
+
target: [syncCursors.accountId, syncCursors.key],
|
|
21055
|
+
set: { value: sql`excluded.value`, updatedAt: sql`excluded.updated_at` }
|
|
21056
|
+
}).run();
|
|
21057
|
+
}, "writeState");
|
|
21058
|
+
var clearState = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
21059
|
+
orm.delete(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).run();
|
|
21060
|
+
}, "clearState");
|
|
21061
|
+
var claim2 = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, anchor, holder, forMs) => {
|
|
21062
|
+
const at = now2();
|
|
21063
|
+
return orm.insert(fetchLeases).values({ chatId: chatKey, anchor, holder, expiresAt: at + forMs }).onConflictDoUpdate({
|
|
21064
|
+
target: [fetchLeases.chatId, fetchLeases.anchor],
|
|
21065
|
+
set: { holder: sql`excluded.holder`, expiresAt: sql`excluded.expires_at` },
|
|
21066
|
+
setWhere: or(eq(fetchLeases.holder, sql`excluded.holder`), lte(fetchLeases.expiresAt, at))
|
|
21067
|
+
}).returning({ chatId: fetchLeases.chatId }).all().length > 0;
|
|
21068
|
+
}, "claim");
|
|
21069
|
+
var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
21070
|
+
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
21071
|
+
}, "release");
|
|
21072
|
+
|
|
21073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
21041
21074
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
21042
21075
|
id: `email:${place.emailId}`,
|
|
21043
21076
|
chatId: place.threadExternalId,
|
|
@@ -21370,12 +21403,21 @@ var emailHitsByPk = /* @__PURE__ */ __name((database, pks) => {
|
|
|
21370
21403
|
];
|
|
21371
21404
|
});
|
|
21372
21405
|
}, "emailHitsByPk");
|
|
21373
|
-
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = stemmerCache()) => ({
|
|
21406
|
+
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemmerFor2 = stemmerCache()) => ({
|
|
21374
21407
|
rules: mailRulesOver(database),
|
|
21375
21408
|
async saveThread(input) {
|
|
21376
21409
|
const id2 = write(database, () => saveThread(database, orm, input));
|
|
21377
21410
|
return threadDetails(database, id2);
|
|
21378
21411
|
},
|
|
21412
|
+
async saveThreads(inputs, states = []) {
|
|
21413
|
+
const ids = write(database, () => {
|
|
21414
|
+
const saved = inputs.map((input) => saveThread(database, orm, input));
|
|
21415
|
+
for (const { accountId, name, value } of states)
|
|
21416
|
+
writeState({ orm, now: now2 }, accountId, name, value);
|
|
21417
|
+
return saved;
|
|
21418
|
+
});
|
|
21419
|
+
return ids.map((id2) => threadDetails(database, id2));
|
|
21420
|
+
},
|
|
21379
21421
|
async threads(filter = {}) {
|
|
21380
21422
|
const [limit, offset] = page(filter);
|
|
21381
21423
|
return database.prepare(`SELECT * FROM email_threads WHERE (? IS NULL OR account_id = ?) AND (? OR deleted_at IS NULL)
|
|
@@ -21434,7 +21476,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21434
21476
|
dmarc: str(row2.dmarc)
|
|
21435
21477
|
}));
|
|
21436
21478
|
},
|
|
21437
|
-
async setSenderScores(accountId, scores,
|
|
21479
|
+
async setSenderScores(accountId, scores, now3) {
|
|
21438
21480
|
return write(database, () => {
|
|
21439
21481
|
const link3 = database.prepare(`INSERT INTO account_identities
|
|
21440
21482
|
(account_id, identity_id, created_at, updated_at, mail_score, mail_signals, mail_scored_at, mail_demoted)
|
|
@@ -21443,7 +21485,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21443
21485
|
mail_signals = excluded.mail_signals, mail_scored_at = excluded.mail_scored_at,
|
|
21444
21486
|
mail_demoted = excluded.mail_demoted`);
|
|
21445
21487
|
for (const { address, score, signals, demoted } of scores)
|
|
21446
|
-
link3.run(accountId, identityOf2(database, { address, name: null },
|
|
21488
|
+
link3.run(accountId, identityOf2(database, { address, name: null }, now3), now3, now3, score, JSON.stringify(signals), now3, demoted ? 1 : null);
|
|
21447
21489
|
return scores.length;
|
|
21448
21490
|
});
|
|
21449
21491
|
},
|
|
@@ -21456,9 +21498,9 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21456
21498
|
kind: str(b.kind)
|
|
21457
21499
|
}));
|
|
21458
21500
|
},
|
|
21459
|
-
async setMailboxes(accountId, scanned, found2,
|
|
21501
|
+
async setMailboxes(accountId, scanned, found2, now3) {
|
|
21460
21502
|
return write(database, () => {
|
|
21461
|
-
const boxes = new Map(scanned.map((box) => [box.externalId, mailboxPk(database, accountId, box,
|
|
21503
|
+
const boxes = new Map(scanned.map((box) => [box.externalId, mailboxPk(database, accountId, box, now3)]));
|
|
21462
21504
|
const lookup = database.prepare("SELECT id FROM emails WHERE account_id = ? AND external_id = ?");
|
|
21463
21505
|
const leave = database.prepare(`DELETE FROM email_mailboxes WHERE email_id = ? AND mailbox_id IN (SELECT value FROM json_each(?))
|
|
21464
21506
|
AND mailbox_id NOT IN (SELECT value FROM json_each(?))`);
|
|
@@ -21475,22 +21517,22 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21475
21517
|
});
|
|
21476
21518
|
leave.run(Number(row2.id), JSON.stringify([...boxes.values()]), JSON.stringify(kept));
|
|
21477
21519
|
for (const pk of kept)
|
|
21478
|
-
join(database, Number(row2.id), pk,
|
|
21520
|
+
join(database, Number(row2.id), pk, now3);
|
|
21479
21521
|
count++;
|
|
21480
21522
|
}
|
|
21481
21523
|
return count;
|
|
21482
21524
|
});
|
|
21483
21525
|
},
|
|
21484
|
-
async setFlags(accountId, flags,
|
|
21526
|
+
async setFlags(accountId, flags, now3) {
|
|
21485
21527
|
return write(database, () => {
|
|
21486
|
-
return setEmailFlags(database, accountId, flags,
|
|
21528
|
+
return setEmailFlags(database, accountId, flags, now3);
|
|
21487
21529
|
});
|
|
21488
21530
|
},
|
|
21489
21531
|
folderEmails: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity) => folderEmails(database, accountId, folder, uidvalidity), "folderEmails"),
|
|
21490
21532
|
setLocations: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity, found2) => write(database, () => setLocations(database, accountId, folder, uidvalidity, found2)), "setLocations"),
|
|
21491
21533
|
forgetLocations: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity, uids) => write(database, () => forgetLocations(database, accountId, folder, uidvalidity, uids)), "forgetLocations"),
|
|
21492
|
-
markDeleted: /* @__PURE__ */ __name(async (accountId, externalIds,
|
|
21493
|
-
markRestored: /* @__PURE__ */ __name(async (accountId, externalIds,
|
|
21534
|
+
markDeleted: /* @__PURE__ */ __name(async (accountId, externalIds, now3) => write(database, () => markEmailsDeleted(database, accountId, externalIds, now3)), "markDeleted"),
|
|
21535
|
+
markRestored: /* @__PURE__ */ __name(async (accountId, externalIds, now3) => write(database, () => markEmailsRestored(database, accountId, externalIds, now3)), "markRestored"),
|
|
21494
21536
|
async chunksToEmbed(model, { after: after2, limit }) {
|
|
21495
21537
|
drainEmailIndex(database, stemmerFor2);
|
|
21496
21538
|
const file = database.prepare("SELECT text FROM attachments WHERE id = ?");
|
|
@@ -21585,7 +21627,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21585
21627
|
}
|
|
21586
21628
|
}), "mailStoreOver");
|
|
21587
21629
|
|
|
21588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
21589
21631
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21590
21632
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21591
21633
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21675,7 +21717,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21675
21717
|
}, "knownWord");
|
|
21676
21718
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21677
21719
|
|
|
21678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
21679
21721
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21680
21722
|
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");
|
|
21681
21723
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -21761,7 +21803,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21761
21803
|
return found2;
|
|
21762
21804
|
}, "spokenTranscripts");
|
|
21763
21805
|
|
|
21764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
21765
21807
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21766
21808
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21767
21809
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21808,7 +21850,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21808
21850
|
});
|
|
21809
21851
|
}, "placeHits");
|
|
21810
21852
|
|
|
21811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
21812
21854
|
var MESSAGES2 = {
|
|
21813
21855
|
rows: "messages",
|
|
21814
21856
|
threads: "chats",
|
|
@@ -21844,17 +21886,18 @@ var GROUPS = {
|
|
|
21844
21886
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
21845
21887
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
21846
21888
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
21847
|
-
var countMatches = /* @__PURE__ */ __name((context, execution, cap) =>
|
|
21889
|
+
var countMatches = /* @__PURE__ */ __name((context, execution, cap) => matchingPks(context, execution, cap)?.length, "countMatches");
|
|
21890
|
+
var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
21848
21891
|
const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
|
|
21849
21892
|
...execution,
|
|
21850
21893
|
newest: true
|
|
21851
21894
|
});
|
|
21852
21895
|
if (leaves.some(({ test }) => test))
|
|
21853
21896
|
return void 0;
|
|
21854
|
-
const
|
|
21897
|
+
const rows = database.prepare(`${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?`).all(...ranked.params, ...where.params, cap + 1);
|
|
21855
21898
|
check3();
|
|
21856
|
-
return
|
|
21857
|
-
}, "
|
|
21899
|
+
return rows.map(({ id: id2 }) => Number(id2));
|
|
21900
|
+
}, "matchingPks");
|
|
21858
21901
|
var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachments = false) => {
|
|
21859
21902
|
const { database } = context;
|
|
21860
21903
|
const corpus = execution.corpus === "mail" ? MAIL : MESSAGES2;
|
|
@@ -22281,7 +22324,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22281
22324
|
};
|
|
22282
22325
|
}, "runQuery");
|
|
22283
22326
|
|
|
22284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
22285
22328
|
function invalidMetadata() {
|
|
22286
22329
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22287
22330
|
}
|
|
@@ -22383,7 +22426,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22383
22426
|
};
|
|
22384
22427
|
}), "counterTargets");
|
|
22385
22428
|
|
|
22386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22429
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
22387
22430
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22388
22431
|
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,
|
|
22389
22432
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22502,7 +22545,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22502
22545
|
}));
|
|
22503
22546
|
}, "attachmentViews");
|
|
22504
22547
|
|
|
22505
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
22506
22549
|
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");
|
|
22507
22550
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22508
22551
|
const { orm, database, now: now2 } = context;
|
|
@@ -22540,7 +22583,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
22540
22583
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22541
22584
|
}, "intoVoiceAttachment");
|
|
22542
22585
|
|
|
22543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
22544
22587
|
var FIELDS = [
|
|
22545
22588
|
"threadExternalId",
|
|
22546
22589
|
"senderIdentityId",
|
|
@@ -22857,33 +22900,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22857
22900
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22858
22901
|
}, "writeDerivedReactions");
|
|
22859
22902
|
|
|
22860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22861
|
-
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22862
|
-
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22863
|
-
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
22864
|
-
}, "syncStateOf");
|
|
22865
|
-
var writeState = /* @__PURE__ */ __name(({ orm, now: now2 }, accountKey, name, value) => {
|
|
22866
|
-
orm.insert(syncCursors).values({ accountId: accountKey, key: name, value, createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
|
|
22867
|
-
target: [syncCursors.accountId, syncCursors.key],
|
|
22868
|
-
set: { value: sql`excluded.value`, updatedAt: sql`excluded.updated_at` }
|
|
22869
|
-
}).run();
|
|
22870
|
-
}, "writeState");
|
|
22871
|
-
var clearState = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22872
|
-
orm.delete(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).run();
|
|
22873
|
-
}, "clearState");
|
|
22874
|
-
var claim2 = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, anchor, holder, forMs) => {
|
|
22875
|
-
const at = now2();
|
|
22876
|
-
return orm.insert(fetchLeases).values({ chatId: chatKey, anchor, holder, expiresAt: at + forMs }).onConflictDoUpdate({
|
|
22877
|
-
target: [fetchLeases.chatId, fetchLeases.anchor],
|
|
22878
|
-
set: { holder: sql`excluded.holder`, expiresAt: sql`excluded.expires_at` },
|
|
22879
|
-
setWhere: or(eq(fetchLeases.holder, sql`excluded.holder`), lte(fetchLeases.expiresAt, at))
|
|
22880
|
-
}).returning({ chatId: fetchLeases.chatId }).all().length > 0;
|
|
22881
|
-
}, "claim");
|
|
22882
|
-
var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
22883
|
-
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22884
|
-
}, "release");
|
|
22885
|
-
|
|
22886
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22887
22904
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22888
22905
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22889
22906
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22904,7 +22921,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22904
22921
|
};
|
|
22905
22922
|
}, "keysOver");
|
|
22906
22923
|
|
|
22907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
22908
22925
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22909
22926
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22910
22927
|
if (!row2)
|
|
@@ -22939,7 +22956,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22939
22956
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22940
22957
|
}, "saveProfile");
|
|
22941
22958
|
|
|
22942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
22943
22960
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22944
22961
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22945
22962
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22975,7 +22992,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22975
22992
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22976
22993
|
}, "originOfActor");
|
|
22977
22994
|
|
|
22978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
22979
22996
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22980
22997
|
const owner = ownerPerson(context.database).id;
|
|
22981
22998
|
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);
|
|
@@ -22996,7 +23013,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22996
23013
|
return personOf(context, ref3);
|
|
22997
23014
|
}, "linkToOwner");
|
|
22998
23015
|
|
|
22999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
23000
23017
|
var PROVIDERS_SETTING = "providers";
|
|
23001
23018
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
23002
23019
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -23031,7 +23048,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
23031
23048
|
});
|
|
23032
23049
|
}, "registerProvider");
|
|
23033
23050
|
|
|
23034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
23035
23052
|
var DAY3 = 864e5;
|
|
23036
23053
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
23037
23054
|
var TEXT_LIMIT = 20;
|
|
@@ -23230,7 +23247,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23230
23247
|
};
|
|
23231
23248
|
}, "taskSimilarityOver");
|
|
23232
23249
|
|
|
23233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23250
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23234
23251
|
var SETTING3 = "taskCategories";
|
|
23235
23252
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23236
23253
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23249,7 +23266,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23249
23266
|
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);
|
|
23250
23267
|
}, "saveTaskCategories");
|
|
23251
23268
|
|
|
23252
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
23253
23270
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23254
23271
|
var ALLOWED = "taskAgentClose";
|
|
23255
23272
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23305,7 +23322,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
23305
23322
|
];
|
|
23306
23323
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23307
23324
|
|
|
23308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23325
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
23309
23326
|
var EXCERPT_CHARS = 280;
|
|
23310
23327
|
var excerptOf = /* @__PURE__ */ __name((text5) => {
|
|
23311
23328
|
if (text5 == null)
|
|
@@ -23348,7 +23365,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.pre
|
|
|
23348
23365
|
};
|
|
23349
23366
|
}), "evidenceSourcesOf");
|
|
23350
23367
|
|
|
23351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
23352
23369
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23353
23370
|
var MAX_TEXT_CHARS = 2e6;
|
|
23354
23371
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23374,7 +23391,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23374
23391
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23375
23392
|
}, "pdfPreviewLimits");
|
|
23376
23393
|
|
|
23377
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
23378
23395
|
import { randomBytes } from "node:crypto";
|
|
23379
23396
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23380
23397
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23387,7 +23404,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23387
23404
|
return time3 + random;
|
|
23388
23405
|
}, "ulid");
|
|
23389
23406
|
|
|
23390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
23391
23408
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23392
23409
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23393
23410
|
if (!meta && !sections?.length)
|
|
@@ -23408,7 +23425,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23408
23425
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23409
23426
|
}, "languageOf");
|
|
23410
23427
|
|
|
23411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
23412
23429
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23413
23430
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23414
23431
|
if (isObject(value))
|
|
@@ -23651,7 +23668,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23651
23668
|
};
|
|
23652
23669
|
}, "filesStoreOver");
|
|
23653
23670
|
|
|
23654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
23655
23672
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23656
23673
|
entity: "document",
|
|
23657
23674
|
backend: "sql",
|
|
@@ -23697,7 +23714,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23697
23714
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23698
23715
|
}, "importedDocumentWhere");
|
|
23699
23716
|
|
|
23700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
23701
23718
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23702
23719
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23703
23720
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
@@ -24207,7 +24224,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24207
24224
|
};
|
|
24208
24225
|
}, "notesStoreOver");
|
|
24209
24226
|
|
|
24210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
24211
24228
|
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";
|
|
24212
24229
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24213
24230
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -24254,6 +24271,16 @@ var subjectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
24254
24271
|
subjectIsOwner: Number(named2?.owner) === 1
|
|
24255
24272
|
};
|
|
24256
24273
|
}, "subjectOf");
|
|
24274
|
+
var highestKey = /* @__PURE__ */ __name((table) => `ids.${table}.highest`, "highestKey");
|
|
24275
|
+
var nextId = /* @__PURE__ */ __name((database, table) => {
|
|
24276
|
+
const kept = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(highestKey(table));
|
|
24277
|
+
const highest = database.prepare(`SELECT max(id) AS id FROM ${table}`).get();
|
|
24278
|
+
return Math.max(Number(kept?.value ?? 0), Number(highest?.id ?? 0)) + 1;
|
|
24279
|
+
}, "nextId");
|
|
24280
|
+
var keepHighestId = /* @__PURE__ */ __name((database, table, at) => {
|
|
24281
|
+
const highest = nextId(database, table) - 1;
|
|
24282
|
+
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(highestKey(table), String(highest), at);
|
|
24283
|
+
}, "keepHighestId");
|
|
24257
24284
|
var dropLinksOf = /* @__PURE__ */ __name((database, thing) => {
|
|
24258
24285
|
const count = Number(database.prepare("SELECT count(*) AS n FROM links WHERE (from_type = ? AND from_id = ?) OR (to_type = ? AND to_id = ?)").get(thing.type, thing.id, thing.type, thing.id)?.n);
|
|
24259
24286
|
database.prepare("DELETE FROM links WHERE to_type = ? AND to_id = ?").run(thing.type, thing.id);
|
|
@@ -24332,7 +24359,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24332
24359
|
const subject2 = input.subject === void 0 ? void 0 : requiredThing(database, input.subject, "the subject");
|
|
24333
24360
|
const replaced = input.supersedes === void 0 ? void 0 : Number(rowOf(input.supersedes).id);
|
|
24334
24361
|
const at = now2();
|
|
24335
|
-
const made = Number(database.prepare("INSERT INTO memories (kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(kind3, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3, at, at)?.id);
|
|
24362
|
+
const made = Number(database.prepare("INSERT INTO memories (id, kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "memories"), kind3, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3, at, at)?.id);
|
|
24336
24363
|
linkEvidence(context, { type: "memory", id: made }, input.evidence, input.author === "owner" ? "owner" : "agent");
|
|
24337
24364
|
if (replaced !== void 0)
|
|
24338
24365
|
database.prepare("UPDATE memories SET status = 'superseded', updated_at = ? WHERE id = ?").run(at, replaced);
|
|
@@ -24350,6 +24377,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24350
24377
|
remove: /* @__PURE__ */ __name(async (reference2) => {
|
|
24351
24378
|
const id2 = Number(rowOf(reference2).id);
|
|
24352
24379
|
const links2 = erase(database, () => {
|
|
24380
|
+
keepHighestId(database, "memories", now2());
|
|
24353
24381
|
database.prepare("UPDATE memories SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
24354
24382
|
const count = dropLinksOf(database, { type: "memory", id: id2 });
|
|
24355
24383
|
database.prepare("DELETE FROM memories WHERE id = ?").run(id2);
|
|
@@ -24371,7 +24399,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24371
24399
|
};
|
|
24372
24400
|
}, "memoriesStoreOver");
|
|
24373
24401
|
|
|
24374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
24375
24403
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24376
24404
|
var KEY = "taskFirstPassPerChat";
|
|
24377
24405
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24391,7 +24419,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24391
24419
|
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);
|
|
24392
24420
|
}, "saveFirstPassPerChat");
|
|
24393
24421
|
|
|
24394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
24395
24423
|
var TASK_RELATION_KINDS = [
|
|
24396
24424
|
"blocked-by",
|
|
24397
24425
|
"follow-up-of",
|
|
@@ -24521,7 +24549,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24521
24549
|
};
|
|
24522
24550
|
}, "taskRelationsStoreOver");
|
|
24523
24551
|
|
|
24524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24552
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
24525
24553
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24526
24554
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24527
24555
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
@@ -24793,7 +24821,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24793
24821
|
};
|
|
24794
24822
|
}, "workTasksOver");
|
|
24795
24823
|
|
|
24796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24824
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
24797
24825
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24798
24826
|
const { database, now: now2 } = context;
|
|
24799
24827
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24839,7 +24867,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24839
24867
|
};
|
|
24840
24868
|
}, "taskCloseOver");
|
|
24841
24869
|
|
|
24842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
24843
24871
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24844
24872
|
const { database, now: now2 } = context;
|
|
24845
24873
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -25057,7 +25085,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
25057
25085
|
};
|
|
25058
25086
|
}, "taskPairsOver");
|
|
25059
25087
|
|
|
25060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
25061
25089
|
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";
|
|
25062
25090
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25063
25091
|
const { database, now: now2 } = context;
|
|
@@ -25252,7 +25280,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
25252
25280
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
25253
25281
|
}, "oneOf");
|
|
25254
25282
|
|
|
25255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
25256
25284
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
25257
25285
|
const { database } = context;
|
|
25258
25286
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25297,7 +25325,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25297
25325
|
};
|
|
25298
25326
|
}, "accountsStoreOver");
|
|
25299
25327
|
|
|
25300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
25301
25329
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25302
25330
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25303
25331
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25321,7 +25349,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25321
25349
|
})), "keepDownloads");
|
|
25322
25350
|
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");
|
|
25323
25351
|
|
|
25324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
25325
25353
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25326
25354
|
const { database } = context;
|
|
25327
25355
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25378,7 +25406,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25378
25406
|
}, "keepAttachmentText")
|
|
25379
25407
|
}), "attachmentsStoreOver");
|
|
25380
25408
|
|
|
25381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
25382
25410
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25383
25411
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25384
25412
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25558,7 +25586,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25558
25586
|
return done;
|
|
25559
25587
|
}, "rekeyChats");
|
|
25560
25588
|
|
|
25561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
25562
25590
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25563
25591
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25564
25592
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25590,7 +25618,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25590
25618
|
});
|
|
25591
25619
|
}, "chatCompleteness");
|
|
25592
25620
|
|
|
25593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
25594
25622
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25595
25623
|
const { database } = context;
|
|
25596
25624
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25697,7 +25725,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25697
25725
|
};
|
|
25698
25726
|
}, "chatsStoreOver");
|
|
25699
25727
|
|
|
25700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
25701
25729
|
import { createHash as createHash6 } from "node:crypto";
|
|
25702
25730
|
var BATCH_CONTEXT = 50;
|
|
25703
25731
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25835,7 +25863,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25835
25863
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25836
25864
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25837
25865
|
|
|
25838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
25839
25867
|
import { setTimeout } from "node:timers/promises";
|
|
25840
25868
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25841
25869
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -26147,7 +26175,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
26147
26175
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
26148
26176
|
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");
|
|
26149
26177
|
|
|
26150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
26151
26179
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
26152
26180
|
const { database } = context;
|
|
26153
26181
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -26254,7 +26282,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
26254
26282
|
};
|
|
26255
26283
|
}, "conversationsStoreOver");
|
|
26256
26284
|
|
|
26257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
26258
26286
|
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";
|
|
26259
26287
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
26260
26288
|
const { database } = context;
|
|
@@ -26279,7 +26307,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26279
26307
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
26280
26308
|
}), "countersStoreOver");
|
|
26281
26309
|
|
|
26282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
26283
26311
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
26284
26312
|
var MENTION_QUERY = defineQuery({
|
|
26285
26313
|
entity: "mention",
|
|
@@ -26495,7 +26523,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26495
26523
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26496
26524
|
}, "listPlaces");
|
|
26497
26525
|
|
|
26498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
26499
26527
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26500
26528
|
const { database } = context;
|
|
26501
26529
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26530,7 +26558,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26530
26558
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26531
26559
|
}), "mentionsStoreOver");
|
|
26532
26560
|
|
|
26533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
26534
26562
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26535
26563
|
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");
|
|
26536
26564
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26545,7 +26573,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26545
26573
|
}));
|
|
26546
26574
|
}, "documentLinkMessages");
|
|
26547
26575
|
|
|
26548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
26549
26577
|
var stemmerFor = stemmerCache();
|
|
26550
26578
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
26551
26579
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -26555,13 +26583,12 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
26555
26583
|
if (!wanted.length || !stemmers || !stemsState(database)?.ready)
|
|
26556
26584
|
return wanted.map(() => []);
|
|
26557
26585
|
const stemmer = stemmerFor(stemmers);
|
|
26558
|
-
database.
|
|
26559
|
-
const count = database.prepare("SELECT doc FROM temp.message_stem_counts WHERE term = ? AND col = 'stems'");
|
|
26586
|
+
const count = database.prepare("SELECT count(*) AS doc FROM (SELECT rowid FROM message_stems WHERE message_stems MATCH ? LIMIT ?)");
|
|
26560
26587
|
const counts = /* @__PURE__ */ new Map();
|
|
26561
26588
|
const countOf = /* @__PURE__ */ __name((stem) => {
|
|
26562
26589
|
let found2 = counts.get(stem);
|
|
26563
26590
|
if (found2 === void 0) {
|
|
26564
|
-
found2 = Number(count.get(stem)?.doc ?? 0);
|
|
26591
|
+
found2 = Number(count.get(`stems : "${stem.replaceAll('"', '""')}"`, rareAt + 1)?.doc ?? 0);
|
|
26565
26592
|
counts.set(stem, found2);
|
|
26566
26593
|
}
|
|
26567
26594
|
return found2;
|
|
@@ -26590,7 +26617,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
26590
26617
|
});
|
|
26591
26618
|
}, "laterSharingRare");
|
|
26592
26619
|
|
|
26593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
26594
26621
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26595
26622
|
const { database } = context;
|
|
26596
26623
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26725,7 +26752,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26725
26752
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
26726
26753
|
}), "messagesStoreOver");
|
|
26727
26754
|
|
|
26728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26755
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
26729
26756
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26730
26757
|
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26731
26758
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -26782,7 +26809,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26782
26809
|
});
|
|
26783
26810
|
}, "personPreparation");
|
|
26784
26811
|
|
|
26785
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
26786
26813
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26787
26814
|
const id2 = Number(uid);
|
|
26788
26815
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26790,7 +26817,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26790
26817
|
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)));
|
|
26791
26818
|
}, "personSeenInAccounts");
|
|
26792
26819
|
|
|
26793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
26794
26821
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26795
26822
|
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);
|
|
26796
26823
|
if (!row2)
|
|
@@ -26856,7 +26883,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26856
26883
|
return { id: id2, personId, removed: true };
|
|
26857
26884
|
}, "removeNote");
|
|
26858
26885
|
|
|
26859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
26860
26887
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26861
26888
|
const { database } = context;
|
|
26862
26889
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26931,13 +26958,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26931
26958
|
};
|
|
26932
26959
|
}, "peopleStoreOver");
|
|
26933
26960
|
|
|
26934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
26935
26962
|
import { createHash as createHash8 } from "node:crypto";
|
|
26936
26963
|
|
|
26937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26938
26965
|
import { createHash as createHash7 } from "node:crypto";
|
|
26939
26966
|
|
|
26940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
26941
26968
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
26942
26969
|
var AUTHOR_MEASURES = [
|
|
26943
26970
|
"messages",
|
|
@@ -27077,7 +27104,7 @@ var withoutUrls = /* @__PURE__ */ __name((text5) => text5.replace(/\S+/gu, (toke
|
|
|
27077
27104
|
var rankingWords = /* @__PURE__ */ __name((text5) => withoutUrls(text5).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
27078
27105
|
var rankingQuestion = /* @__PURE__ */ __name((text5) => withoutUrls(text5).includes("?"), "rankingQuestion");
|
|
27079
27106
|
|
|
27080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27107
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
27081
27108
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
27082
27109
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
27083
27110
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -27299,7 +27326,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
27299
27326
|
};
|
|
27300
27327
|
}, "rankReplyGraph");
|
|
27301
27328
|
|
|
27302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
27303
27330
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
27304
27331
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
27305
27332
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27473,7 +27500,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27473
27500
|
return { items, evidence, summary, graph: graph.quality };
|
|
27474
27501
|
}, "calculateAdminStatistics");
|
|
27475
27502
|
|
|
27476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
27477
27504
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27478
27505
|
const dates = [];
|
|
27479
27506
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27495,7 +27522,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27495
27522
|
return dates[0].node.resolution.date;
|
|
27496
27523
|
}, "rankingContextRange");
|
|
27497
27524
|
|
|
27498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
27499
27526
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27500
27527
|
let counts;
|
|
27501
27528
|
try {
|
|
@@ -27790,7 +27817,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27790
27817
|
});
|
|
27791
27818
|
}, "rankQuery");
|
|
27792
27819
|
|
|
27793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
27794
27821
|
function fail4(message2, reason = "query.too-large") {
|
|
27795
27822
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27796
27823
|
}
|
|
@@ -27967,7 +27994,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27967
27994
|
return result;
|
|
27968
27995
|
}), "adminStatisticsQuery");
|
|
27969
27996
|
|
|
27970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
27971
27998
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27972
27999
|
if (!execution.accounts.length)
|
|
27973
28000
|
return { conversations: [], chats: [] };
|
|
@@ -27985,7 +28012,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27985
28012
|
return { conversations: conversations2, chats: chats2 };
|
|
27986
28013
|
}, "conversationEligibility");
|
|
27987
28014
|
|
|
27988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28015
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
27989
28016
|
import { createHash as createHash9 } from "node:crypto";
|
|
27990
28017
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27991
28018
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -28135,7 +28162,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
28135
28162
|
return result;
|
|
28136
28163
|
}, "rankingEvidence");
|
|
28137
28164
|
|
|
28138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
28139
28166
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
28140
28167
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
28141
28168
|
if (execution.corpus === "mail")
|
|
@@ -28146,6 +28173,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
28146
28173
|
matchQuery: /* @__PURE__ */ __name(async (execution) => matchQuery(context, mailIndexed(execution)), "matchQuery"),
|
|
28147
28174
|
countQuery: /* @__PURE__ */ __name(async (execution, by) => countQuery(context, mailIndexed(execution), by), "countQuery"),
|
|
28148
28175
|
countMatches: /* @__PURE__ */ __name(async (execution, cap) => countMatches(context, mailIndexed(execution), cap), "countMatches"),
|
|
28176
|
+
matchingPks: /* @__PURE__ */ __name(async (execution, cap) => matchingPks(context, mailIndexed(execution), cap), "matchingPks"),
|
|
28149
28177
|
conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
|
|
28150
28178
|
rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
|
|
28151
28179
|
rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
|
|
@@ -28153,7 +28181,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
28153
28181
|
};
|
|
28154
28182
|
}, "queriesStoreOver");
|
|
28155
28183
|
|
|
28156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
28157
28185
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
28158
28186
|
const { database, now: now2 } = context;
|
|
28159
28187
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -28192,10 +28220,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
28192
28220
|
}));
|
|
28193
28221
|
}, "chatEventsOf");
|
|
28194
28222
|
|
|
28195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
28196
28224
|
import { createHash as createHash10 } from "node:crypto";
|
|
28197
28225
|
|
|
28198
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
28199
28227
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
28200
28228
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
28201
28229
|
timeZone: zone,
|
|
@@ -28210,7 +28238,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
28210
28238
|
};
|
|
28211
28239
|
}, "calendarKey");
|
|
28212
28240
|
|
|
28213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28241
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
28214
28242
|
var RETENTION_TOLERANCE = 864e5;
|
|
28215
28243
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
28216
28244
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -28264,7 +28292,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
28264
28292
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
28265
28293
|
}, "retentionCohorts");
|
|
28266
28294
|
|
|
28267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
28268
28296
|
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
28269
28297
|
var week = /* @__PURE__ */ __name((day) => {
|
|
28270
28298
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
@@ -28400,7 +28428,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28400
28428
|
};
|
|
28401
28429
|
}, "retentionQuery");
|
|
28402
28430
|
|
|
28403
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28431
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
28404
28432
|
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
28405
28433
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
28406
28434
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -28531,7 +28559,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
28531
28559
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28532
28560
|
})), "trackedChats");
|
|
28533
28561
|
|
|
28534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
28535
28563
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28536
28564
|
const { database } = context;
|
|
28537
28565
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28587,7 +28615,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28587
28615
|
};
|
|
28588
28616
|
}, "rosterStoreOver");
|
|
28589
28617
|
|
|
28590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
28591
28619
|
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");
|
|
28592
28620
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28593
28621
|
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 ?`);
|
|
@@ -28611,7 +28639,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28611
28639
|
}
|
|
28612
28640
|
}, "backfillNormalized");
|
|
28613
28641
|
|
|
28614
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
28615
28643
|
var INDEX2 = "message_words";
|
|
28616
28644
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28617
28645
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28738,7 +28766,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28738
28766
|
});
|
|
28739
28767
|
}, "resetSearchIndex");
|
|
28740
28768
|
|
|
28741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
28742
28770
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28743
28771
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28744
28772
|
const before2 = stemsState(database);
|
|
@@ -28833,7 +28861,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28833
28861
|
return resetStems(database, { now: now2 });
|
|
28834
28862
|
}, "followDefaultStemmers");
|
|
28835
28863
|
|
|
28836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
28837
28865
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28838
28866
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28839
28867
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28855,7 +28883,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28855
28883
|
});
|
|
28856
28884
|
}, "termCandidates");
|
|
28857
28885
|
|
|
28858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
28859
28887
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28860
28888
|
const { database } = context;
|
|
28861
28889
|
const stemmerFor2 = stemmerCache();
|
|
@@ -28877,7 +28905,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28877
28905
|
};
|
|
28878
28906
|
}, "searchIndexStoreOver");
|
|
28879
28907
|
|
|
28880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
28881
28909
|
var HISTORY_KEPT = 1e3;
|
|
28882
28910
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28883
28911
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28946,7 +28974,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28946
28974
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28947
28975
|
}, "clearHistory");
|
|
28948
28976
|
|
|
28949
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
28950
28978
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28951
28979
|
const { database } = context;
|
|
28952
28980
|
return {
|
|
@@ -28970,7 +28998,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28970
28998
|
};
|
|
28971
28999
|
}, "searchesStoreOver");
|
|
28972
29000
|
|
|
28973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
28974
29002
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28975
29003
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28976
29004
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -29013,7 +29041,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
29013
29041
|
};
|
|
29014
29042
|
}, "agentActionsStoreOver");
|
|
29015
29043
|
|
|
29016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
29017
29045
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
29018
29046
|
}) => {
|
|
29019
29047
|
const { database, now: now2 } = context;
|
|
@@ -29072,7 +29100,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
29072
29100
|
};
|
|
29073
29101
|
}, "botUpdateStoreOver");
|
|
29074
29102
|
|
|
29075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29103
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
29076
29104
|
var DAY4 = 864e5;
|
|
29077
29105
|
var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
29078
29106
|
const clauses = ["e.deleted_at IS NULL"];
|
|
@@ -29091,6 +29119,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
29091
29119
|
}, "dated");
|
|
29092
29120
|
dated("end_date > ?", filter.fromDate, "coalesce(e.ends_at, e.starts_at + 1) > ?", filter.from);
|
|
29093
29121
|
dated("start_date < ?", filter.toDate, "e.starts_at < ?", filter.to);
|
|
29122
|
+
dated("start_date >= ?", filter.startsFromDate, "e.starts_at >= ?", filter.startsFrom);
|
|
29094
29123
|
const longest = /* @__PURE__ */ __name(() => Number(database.prepare("SELECT coalesce(max(ends_at - starts_at), 0) AS ms FROM events WHERE deleted_at IS NULL").get()?.ms ?? 0), "longest");
|
|
29095
29124
|
if (filter.from !== void 0) {
|
|
29096
29125
|
clauses.push("e.starts_at >= ?");
|
|
@@ -29100,6 +29129,10 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
29100
29129
|
clauses.push("e.starts_at < ?");
|
|
29101
29130
|
params.push(filter.to + DAY4);
|
|
29102
29131
|
}
|
|
29132
|
+
if (filter.startsFrom !== void 0 && filter.startsFromDate !== void 0) {
|
|
29133
|
+
clauses.push("e.starts_at >= ?");
|
|
29134
|
+
params.push(filter.startsFrom - DAY4);
|
|
29135
|
+
}
|
|
29103
29136
|
if (filter.calendarId !== void 0) {
|
|
29104
29137
|
clauses.push(entries("ce.calendar_id = ?"));
|
|
29105
29138
|
params.push(filter.calendarId);
|
|
@@ -29152,7 +29185,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
29152
29185
|
return database.prepare(`SELECT e.* FROM events e WHERE ${clauses.join(" AND ")} ORDER BY ${filter.newest ? "e.starts_at DESC, e.id DESC" : "e.starts_at, e.id"} LIMIT ? OFFSET ?`).all(...params, limit, offset).map(eventOf);
|
|
29153
29186
|
}, "listEvents");
|
|
29154
29187
|
|
|
29155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
29156
29189
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
29157
29190
|
id: Number(row2.id),
|
|
29158
29191
|
accountId: Number(row2.account_id),
|
|
@@ -29732,7 +29765,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29732
29765
|
};
|
|
29733
29766
|
}, "eventStoreOver");
|
|
29734
29767
|
|
|
29735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29768
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
29736
29769
|
var CATALOG_QUERY = defineQuery({
|
|
29737
29770
|
entity: "document",
|
|
29738
29771
|
backend: "sql",
|
|
@@ -29974,7 +30007,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29974
30007
|
};
|
|
29975
30008
|
}, "catalogStoreOver");
|
|
29976
30009
|
|
|
29977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
29978
30011
|
import { createHash as createHash11 } from "node:crypto";
|
|
29979
30012
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29980
30013
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -30072,7 +30105,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
30072
30105
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
30073
30106
|
}, "contextEvidenceRequest");
|
|
30074
30107
|
|
|
30075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
30076
30109
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
30077
30110
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
30078
30111
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -30085,7 +30118,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
30085
30118
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
30086
30119
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
30087
30120
|
|
|
30088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
30089
30122
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
30090
30123
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
30091
30124
|
signal?.throwIfAborted();
|
|
@@ -30184,7 +30217,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
30184
30217
|
});
|
|
30185
30218
|
}, "readMeetingContextEvidence");
|
|
30186
30219
|
|
|
30187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
30188
30221
|
var corpora = {
|
|
30189
30222
|
message: {
|
|
30190
30223
|
table: "messages",
|
|
@@ -30413,7 +30446,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30413
30446
|
}
|
|
30414
30447
|
}), "contextRecordsOver");
|
|
30415
30448
|
|
|
30416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
30417
30450
|
var NOTE_FIELDS = [
|
|
30418
30451
|
"text",
|
|
30419
30452
|
"exact",
|
|
@@ -30843,7 +30876,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30843
30876
|
};
|
|
30844
30877
|
}, "noteSearchOver");
|
|
30845
30878
|
|
|
30846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
30847
30880
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30848
30881
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30849
30882
|
var EVENT_CORPUS = {
|
|
@@ -30975,7 +31008,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30975
31008
|
};
|
|
30976
31009
|
}, "eventSearchOver");
|
|
30977
31010
|
|
|
30978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
30979
31012
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30980
31013
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30981
31014
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30988,7 +31021,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30988
31021
|
}, "reference");
|
|
30989
31022
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30990
31023
|
|
|
30991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31024
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
30992
31025
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30993
31026
|
try {
|
|
30994
31027
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -31000,7 +31033,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
31000
31033
|
}
|
|
31001
31034
|
}, "calendarMoment");
|
|
31002
31035
|
|
|
31003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
31004
31037
|
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";
|
|
31005
31038
|
var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31006
31039
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31038,12 +31071,12 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31038
31071
|
const accept = /* @__PURE__ */ __name((id2) => {
|
|
31039
31072
|
const row2 = database.prepare("SELECT * FROM facts WHERE id = ?").get(id2);
|
|
31040
31073
|
if (row2.status !== "proposed" && row2.status !== "accepted")
|
|
31041
|
-
throw new CliError("validation_error", `a ${String(row2.status)}
|
|
31074
|
+
throw new CliError("validation_error", `a ${String(row2.status)} fact cannot be accepted`);
|
|
31042
31075
|
const { actor } = authorActor(context, "owner");
|
|
31043
31076
|
const at = now2();
|
|
31044
31077
|
database.prepare("UPDATE facts SET status = 'accepted', confirmed_by_type = ?, confirmed_by_id = ?, updated_at = ? WHERE id = ?").run(actor.type, actor.id, at, id2);
|
|
31045
31078
|
if (row2.supersedes_id != null)
|
|
31046
|
-
database.prepare("UPDATE facts SET status = 'superseded', updated_at = ? WHERE id = ? AND status
|
|
31079
|
+
database.prepare("UPDATE facts SET status = 'superseded', updated_at = ? WHERE id = ? AND status IN ('proposed', 'accepted')").run(at, Number(row2.supersedes_id));
|
|
31047
31080
|
}, "accept");
|
|
31048
31081
|
return {
|
|
31049
31082
|
add: /* @__PURE__ */ __name((input) => {
|
|
@@ -31055,20 +31088,18 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31055
31088
|
const occurredAt = input.occurredAt === void 0 ? null : calendarMoment(input.occurredAt, "occurredAt");
|
|
31056
31089
|
if (occurredAt !== null && !Number.isFinite(occurredAt))
|
|
31057
31090
|
throw new CliError("validation_error", "occurredAt takes an ISO timestamp");
|
|
31058
|
-
if (input.supersedes !== void 0 && type !== "decision")
|
|
31059
|
-
throw new CliError("validation_error", "only a decision supersedes another");
|
|
31060
31091
|
const id2 = write(database, () => {
|
|
31061
31092
|
const project = input.project === void 0 ? void 0 : requiredThing(database, input.project, "the project");
|
|
31062
31093
|
if (project && project.type !== "project")
|
|
31063
31094
|
throw new CliError("validation_error", `${input.project} is not a project`);
|
|
31064
31095
|
const subject2 = input.subject === void 0 ? void 0 : requiredThing(database, input.subject, "the subject");
|
|
31065
31096
|
const replaced = input.supersedes === void 0 ? void 0 : rowOf(input.supersedes);
|
|
31066
|
-
if (replaced && replaced.
|
|
31067
|
-
throw new CliError("validation_error", `${input.supersedes} is
|
|
31097
|
+
if (replaced && replaced.status !== "proposed" && replaced.status !== "accepted")
|
|
31098
|
+
throw new CliError("validation_error", `${input.supersedes} is ${String(replaced.status)}; only a proposed or accepted fact can be corrected`);
|
|
31068
31099
|
const owner = input.by === "owner";
|
|
31069
31100
|
const { actor, model } = authorActor(context, input.by);
|
|
31070
31101
|
const at = now2();
|
|
31071
|
-
const made = Number(database.prepare("INSERT INTO facts (type, statement, status, project_id, subject_type, subject_id, occurred_at, supersedes_id, author_type, author_id, model, scope, source, created_at, updated_at) VALUES (?, ?, 'proposed', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(type, statement, project?.id ?? null, subject2?.type ?? null, subject2?.id ?? null, occurredAt, replaced === void 0 ? null : Number(replaced.id), actor.type, actor.id, model, scope3, owner ? "owner" : "agent", at, at)?.id);
|
|
31102
|
+
const made = Number(database.prepare("INSERT INTO facts (id, type, statement, status, project_id, subject_type, subject_id, occurred_at, supersedes_id, author_type, author_id, model, scope, source, created_at, updated_at) VALUES (?, ?, ?, 'proposed', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "facts"), type, statement, project?.id ?? null, subject2?.type ?? null, subject2?.id ?? null, occurredAt, replaced === void 0 ? null : Number(replaced.id), actor.type, actor.id, model, scope3, owner ? "owner" : "agent", at, at)?.id);
|
|
31072
31103
|
linkEvidence(context, { type: "fact", id: made }, input.evidence ?? [], owner ? "owner" : "agent");
|
|
31073
31104
|
if (input.createdFrom !== void 0) {
|
|
31074
31105
|
const from2 = requiredThing(database, input.createdFrom, "the source");
|
|
@@ -31112,6 +31143,9 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31112
31143
|
const id2 = Number(row2.id);
|
|
31113
31144
|
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
31114
31145
|
const links2 = erase(database, () => {
|
|
31146
|
+
keepHighestId(database, "facts", now2());
|
|
31147
|
+
if (twin !== void 0)
|
|
31148
|
+
keepHighestId(database, "memories", now2());
|
|
31115
31149
|
database.prepare("UPDATE facts SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
31116
31150
|
const count = dropLinksOf(database, { type: "fact", id: id2 });
|
|
31117
31151
|
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
@@ -31148,7 +31182,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31148
31182
|
};
|
|
31149
31183
|
}, "factsStoreOver");
|
|
31150
31184
|
|
|
31151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
31152
31186
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
31153
31187
|
throw new CliError("validation_error", message2);
|
|
31154
31188
|
}, "invalid");
|
|
@@ -31238,7 +31272,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
31238
31272
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
31239
31273
|
}, "findingsCoreOver");
|
|
31240
31274
|
|
|
31241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
31242
31276
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
31243
31277
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
31244
31278
|
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31384,7 +31418,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31384
31418
|
};
|
|
31385
31419
|
}, "proposedActionsStoreOver");
|
|
31386
31420
|
|
|
31387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
31388
31422
|
var stale = /* @__PURE__ */ __name(() => {
|
|
31389
31423
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
31390
31424
|
reason: "evidence-findings.stale"
|
|
@@ -31550,7 +31584,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31550
31584
|
};
|
|
31551
31585
|
}, "evidenceFindingsStoreOver");
|
|
31552
31586
|
|
|
31553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
31554
31588
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31555
31589
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31556
31590
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31603,7 +31637,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31603
31637
|
}, "forPerson")
|
|
31604
31638
|
}), "involvementStoreOver");
|
|
31605
31639
|
|
|
31606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
31607
31641
|
import { createHash as createHash12 } from "node:crypto";
|
|
31608
31642
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31609
31643
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31689,16 +31723,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31689
31723
|
};
|
|
31690
31724
|
}, "meetingProjectsStoreOver");
|
|
31691
31725
|
|
|
31692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31693
31727
|
import { createHash as createHash15 } from "node:crypto";
|
|
31694
31728
|
|
|
31695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31696
31730
|
import { createHash as createHash14 } from "node:crypto";
|
|
31697
31731
|
|
|
31698
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31732
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31699
31733
|
import { createHash as createHash13 } from "node:crypto";
|
|
31700
31734
|
|
|
31701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31735
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
31702
31736
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31703
31737
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31704
31738
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31749,7 +31783,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31749
31783
|
return input;
|
|
31750
31784
|
}, "consolidationApplyInput");
|
|
31751
31785
|
|
|
31752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31753
31787
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31754
31788
|
id: String(row2.id),
|
|
31755
31789
|
sourceId: String(row2.source_id),
|
|
@@ -31824,7 +31858,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31824
31858
|
}, { beforeCommit: check3 });
|
|
31825
31859
|
}, "applyTagConsolidation");
|
|
31826
31860
|
|
|
31827
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31828
31862
|
var selections = [
|
|
31829
31863
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31830
31864
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31968,7 +32002,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31968
32002
|
};
|
|
31969
32003
|
}, "previewRows");
|
|
31970
32004
|
|
|
31971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31972
32006
|
var kinds = ["project", "tag", "topic"];
|
|
31973
32007
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31974
32008
|
if (signal?.aborted)
|
|
@@ -32232,7 +32266,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32232
32266
|
};
|
|
32233
32267
|
}, "vocabularyStoreOver");
|
|
32234
32268
|
|
|
32235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
32236
32270
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
32237
32271
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
32238
32272
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -32754,7 +32788,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32754
32788
|
return key2.padEnd(3, "X");
|
|
32755
32789
|
}, "projectKey");
|
|
32756
32790
|
|
|
32757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
32758
32792
|
var DAY5 = 864e5;
|
|
32759
32793
|
var SETTING4 = "logs_pruned_at";
|
|
32760
32794
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -32781,7 +32815,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32781
32815
|
};
|
|
32782
32816
|
}, "logPruner");
|
|
32783
32817
|
|
|
32784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
32785
32819
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32786
32820
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32787
32821
|
reason: "meeting-findings.stale"
|
|
@@ -32950,7 +32984,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32950
32984
|
};
|
|
32951
32985
|
}, "meetingFindingsStoreOver");
|
|
32952
32986
|
|
|
32953
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
32954
32988
|
var RANK_BATCH = 512;
|
|
32955
32989
|
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";
|
|
32956
32990
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -33221,7 +33255,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
33221
33255
|
}
|
|
33222
33256
|
}), "meetingVectorsOver");
|
|
33223
33257
|
|
|
33224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
33225
33259
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
33226
33260
|
var TEXTS = {
|
|
33227
33261
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -33322,11 +33356,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33322
33356
|
};
|
|
33323
33357
|
}, "sourceMentionStoreOver");
|
|
33324
33358
|
|
|
33325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
33326
33360
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
33327
33361
|
import { dirname } from "node:path";
|
|
33328
33362
|
|
|
33329
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
33330
33364
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
33331
33365
|
var CLIENTS_SETTING = "clients";
|
|
33332
33366
|
var coreVersion = (() => {
|
|
@@ -33384,7 +33418,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
33384
33418
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
33385
33419
|
}, "refusalAdvice");
|
|
33386
33420
|
|
|
33387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
33388
33422
|
var GENERATED = [
|
|
33389
33423
|
{
|
|
33390
33424
|
"name": "20261010184427_initial",
|
|
@@ -34250,7 +34284,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
34250
34284
|
}
|
|
34251
34285
|
];
|
|
34252
34286
|
|
|
34253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
34254
34288
|
var MANIFEST = [
|
|
34255
34289
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
34256
34290
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -34328,7 +34362,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
34328
34362
|
return migrations;
|
|
34329
34363
|
}, "generatedMigrations");
|
|
34330
34364
|
|
|
34331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34365
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
34332
34366
|
var MIGRATIONS = generatedMigrations();
|
|
34333
34367
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
34334
34368
|
version INTEGER PRIMARY KEY,
|
|
@@ -34381,7 +34415,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
34381
34415
|
}
|
|
34382
34416
|
}, "migrate");
|
|
34383
34417
|
|
|
34384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
34385
34419
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
34386
34420
|
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 ?");
|
|
34387
34421
|
if (pending.get(0, 1) === void 0)
|
|
@@ -34403,7 +34437,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
34403
34437
|
}
|
|
34404
34438
|
}, "fillJoinKeys");
|
|
34405
34439
|
|
|
34406
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
34407
34441
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
34408
34442
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
34409
34443
|
try {
|
|
@@ -34416,8 +34450,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
34416
34450
|
}, "openSqlite");
|
|
34417
34451
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
34418
34452
|
quietSqliteWarning();
|
|
34419
|
-
const { drizzle } = await import("./node-
|
|
34420
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
34453
|
+
const { drizzle } = await import("./node-VBZAZHUS.js");
|
|
34454
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-C3V64OAL.js");
|
|
34421
34455
|
const client = await nodeClient(path, { readOnly });
|
|
34422
34456
|
try {
|
|
34423
34457
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -34427,8 +34461,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
34427
34461
|
}
|
|
34428
34462
|
}, "openUnderNode");
|
|
34429
34463
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
34430
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
34431
|
-
const { drizzle } = await import("./bun-
|
|
34464
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-GFRVRRDZ.js");
|
|
34465
|
+
const { drizzle } = await import("./bun-MJOYPPEN.js");
|
|
34432
34466
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
34433
34467
|
try {
|
|
34434
34468
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -34438,7 +34472,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
34438
34472
|
}
|
|
34439
34473
|
}, "openUnderBun");
|
|
34440
34474
|
|
|
34441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
34442
34476
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
34443
34477
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
34444
34478
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -34453,7 +34487,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
34453
34487
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
34454
34488
|
}, "assertReadCompatible");
|
|
34455
34489
|
|
|
34456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
34457
34491
|
var BACKFILL_ON_OPEN = 5e3;
|
|
34458
34492
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
34459
34493
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -34509,10 +34543,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
34509
34543
|
}
|
|
34510
34544
|
}, "openStoreContext");
|
|
34511
34545
|
|
|
34512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34546
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34513
34547
|
import { createHash as createHash16 } from "node:crypto";
|
|
34514
34548
|
|
|
34515
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34549
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
34516
34550
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34517
34551
|
var ref = text3(2048);
|
|
34518
34552
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34578,7 +34612,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
34578
34612
|
}))
|
|
34579
34613
|
});
|
|
34580
34614
|
|
|
34581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
34582
34616
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
34583
34617
|
var invalid7 = /* @__PURE__ */ __name((field3) => {
|
|
34584
34618
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34682,7 +34716,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
34682
34716
|
invalid7("external.unused");
|
|
34683
34717
|
}, "validateProjectAnnotationsGraph");
|
|
34684
34718
|
|
|
34685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34686
34720
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34687
34721
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34688
34722
|
var targetSchema = strictObject({
|
|
@@ -34788,7 +34822,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34788
34822
|
};
|
|
34789
34823
|
}, "planBoundProjectAnnotations");
|
|
34790
34824
|
|
|
34791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
34792
34826
|
import { createHash as createHash17 } from "node:crypto";
|
|
34793
34827
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34794
34828
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34882,7 +34916,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34882
34916
|
})).digest("hex");
|
|
34883
34917
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34884
34918
|
|
|
34885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
34886
34920
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34887
34921
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34888
34922
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34899,7 +34933,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34899
34933
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34900
34934
|
}, "projectAnnotationRequest");
|
|
34901
34935
|
|
|
34902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
34903
34937
|
var SnapshotBudget = class {
|
|
34904
34938
|
static {
|
|
34905
34939
|
__name(this, "SnapshotBudget");
|
|
@@ -34925,13 +34959,13 @@ var SnapshotBudget = class {
|
|
|
34925
34959
|
}
|
|
34926
34960
|
};
|
|
34927
34961
|
|
|
34928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34929
34963
|
import { createHash as createHash19 } from "node:crypto";
|
|
34930
34964
|
|
|
34931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34965
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
34932
34966
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34933
34967
|
|
|
34934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
34935
34969
|
import { createHash as createHash18 } from "node:crypto";
|
|
34936
34970
|
var invalid9 = /* @__PURE__ */ __name(() => {
|
|
34937
34971
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -35074,7 +35108,7 @@ var ProjectSnapshotSources = class {
|
|
|
35074
35108
|
}
|
|
35075
35109
|
};
|
|
35076
35110
|
|
|
35077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
35078
35112
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
35079
35113
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
35080
35114
|
}, "unsupported");
|
|
@@ -35245,7 +35279,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
35245
35279
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
35246
35280
|
}), "projectAnnotationSnapshot");
|
|
35247
35281
|
|
|
35248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
35249
35283
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
35250
35284
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
35251
35285
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -35307,7 +35341,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
35307
35341
|
};
|
|
35308
35342
|
}), "previewAnnotationSnapshot");
|
|
35309
35343
|
|
|
35310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
35311
35345
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
35312
35346
|
const mappings = { ...bindings };
|
|
35313
35347
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -35326,7 +35360,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
35326
35360
|
const author = resolve(fact.author), confirmed = resolve(fact.confirmed_by);
|
|
35327
35361
|
if (!author)
|
|
35328
35362
|
throw new CliError("validation_error", "project annotation author is required");
|
|
35329
|
-
const row2 = database.prepare("INSERT INTO facts(type,statement,status,project_id,subject_type,subject_id,occurred_at,supersedes_id,author_type,author_id,model,confirmed_by_type,confirmed_by_id,scope,source,created_at,updated_at) VALUES(
|
|
35363
|
+
const row2 = database.prepare("INSERT INTO facts(id,type,statement,status,project_id,subject_type,subject_id,occurred_at,supersedes_id,author_type,author_id,model,confirmed_by_type,confirmed_by_id,scope,source,created_at,updated_at) VALUES(?,?,?,?,?,NULL,NULL,?,NULL,?,?,?,?,?,?,?,?,?) RETURNING id").get(nextId(database, "facts"), fact.type, fact.statement, fact.status, projectId, fact.occurred_at, author.type, author.id, fact.model, confirmed?.type ?? null, confirmed?.id ?? null, fact.scope, fact.source, fact.created_at, fact.updated_at);
|
|
35330
35364
|
if (!row2)
|
|
35331
35365
|
throw new CliError("configuration_error", "project annotation fact insertion failed");
|
|
35332
35366
|
mappings[fact.ref] = `fact:${row2.id}`;
|
|
@@ -35349,7 +35383,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
35349
35383
|
return mappings;
|
|
35350
35384
|
}, "restoreAnnotationRecords");
|
|
35351
35385
|
|
|
35352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
35353
35387
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35354
35388
|
async preview(request) {
|
|
35355
35389
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -35379,7 +35413,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35379
35413
|
}
|
|
35380
35414
|
}), "projectAnnotationStoreOver");
|
|
35381
35415
|
|
|
35382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
35383
35417
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
35384
35418
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
35385
35419
|
let merged = { from: from2, to };
|
|
@@ -35392,7 +35426,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
35392
35426
|
}, "markRange");
|
|
35393
35427
|
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");
|
|
35394
35428
|
|
|
35395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35429
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
35396
35430
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
35397
35431
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
35398
35432
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -35402,7 +35436,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
35402
35436
|
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);
|
|
35403
35437
|
}, "setTaskRulesStop");
|
|
35404
35438
|
|
|
35405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
35406
35440
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35407
35441
|
const { database } = context;
|
|
35408
35442
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -35458,7 +35492,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35458
35492
|
};
|
|
35459
35493
|
}, "syncStoreOver");
|
|
35460
35494
|
|
|
35461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
35462
35496
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35463
35497
|
const { database } = context;
|
|
35464
35498
|
return {
|
|
@@ -35480,7 +35514,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35480
35514
|
};
|
|
35481
35515
|
}, "tagsStoreOver");
|
|
35482
35516
|
|
|
35483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35517
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
35484
35518
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
35485
35519
|
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
|
|
35486
35520
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35607,7 +35641,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35607
35641
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35608
35642
|
}, "savePictureChunks");
|
|
35609
35643
|
|
|
35610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
35611
35645
|
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,
|
|
35612
35646
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35613
35647
|
FROM messages m
|
|
@@ -35654,6 +35688,12 @@ var messageRows = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model,
|
|
|
35654
35688
|
${since === void 0 ? sql`` : sql`AND m.sent_at >= ${since}`}
|
|
35655
35689
|
${before2 === void 0 ? sql`` : sql`AND m.sent_at < ${before2}`}
|
|
35656
35690
|
${"ids" in rows ? sql`AND k.id IN (SELECT value FROM json_each(${JSON.stringify(rows.ids)})) ORDER BY k.id` : sql`AND k.id > ${rows.after} ORDER BY k.id LIMIT ${SCAN_PAGE6}`}`), "messageRows");
|
|
35691
|
+
var scoreMessages = /* @__PURE__ */ __name(({ orm }, accountPk2, { model, query, pks }) => orm.all(sql`SELECT ch.external_id AS chatId, m.external_id AS messageId, v.vector
|
|
35692
|
+
FROM chunks k CROSS JOIN messages m ON m.id = k.chunkable_id AND m.deleted_at IS NULL
|
|
35693
|
+
JOIN chats ch ON ch.id = m.chat_id AND ch.searchable = 1
|
|
35694
|
+
JOIN embeddings v ON v.model = ${model} AND v.content_hash = k.content_hash
|
|
35695
|
+
WHERE k.chunkable_type = 'message' AND k.position = 0 AND k.account_id = ${accountPk2}
|
|
35696
|
+
AND k.chunkable_id IN (SELECT value FROM json_each(${JSON.stringify(pks)}))`).map(({ chatId, messageId, vector }) => ({ chatId, messageId, score: dot(query, vector) })).sort((a, b) => b.score - a.score), "scoreMessages");
|
|
35657
35697
|
var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, query, ...filter }) => {
|
|
35658
35698
|
const score = /* @__PURE__ */ __name((row2) => ({
|
|
35659
35699
|
id: row2.id,
|
|
@@ -35690,7 +35730,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35690
35730
|
return plain2(best(found2));
|
|
35691
35731
|
}, "nearestMessages");
|
|
35692
35732
|
|
|
35693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
35694
35734
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35695
35735
|
const { database } = context;
|
|
35696
35736
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35831,6 +35871,10 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
|
35831
35871
|
query
|
|
35832
35872
|
});
|
|
35833
35873
|
}, "nearestMessages"),
|
|
35874
|
+
scoreMessages: /* @__PURE__ */ __name(async (key2, options) => {
|
|
35875
|
+
const accountPk2 = findAccountPk2(key2);
|
|
35876
|
+
return accountPk2 === void 0 ? [] : scoreMessages(context, accountPk2, options);
|
|
35877
|
+
}, "scoreMessages"),
|
|
35834
35878
|
vectorStatus: /* @__PURE__ */ __name(async (key2, chatId, model) => {
|
|
35835
35879
|
const chatKey = chatKeyOf(key2, chatId);
|
|
35836
35880
|
return chatKey === void 0 ? { chunks: 0, embedded: 0 } : vectorStatus(context, chatKey, model);
|
|
@@ -35944,7 +35988,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35944
35988
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35945
35989
|
}), "vectorsStoreOver");
|
|
35946
35990
|
|
|
35947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
35948
35992
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35949
35993
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35950
35994
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -36032,10 +36076,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
36032
36076
|
}
|
|
36033
36077
|
}, "lastBackup");
|
|
36034
36078
|
|
|
36035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
36036
36080
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
36037
36081
|
|
|
36038
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
36039
36083
|
var COUNTED_TABLES = [
|
|
36040
36084
|
"accounts",
|
|
36041
36085
|
"chats",
|
|
@@ -36120,7 +36164,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
36120
36164
|
};
|
|
36121
36165
|
}, "storeContents");
|
|
36122
36166
|
|
|
36123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.511.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._5c8fd69a9fdf1e5f27f7a7a8cfa45e82/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
36124
36168
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
36125
36169
|
const context = await openStoreContext(options);
|
|
36126
36170
|
try {
|
|
@@ -36346,6 +36390,7 @@ export {
|
|
|
36346
36390
|
formatLocator,
|
|
36347
36391
|
isLocator,
|
|
36348
36392
|
parseLocator,
|
|
36393
|
+
normalizeVocabularyName,
|
|
36349
36394
|
inboxKey,
|
|
36350
36395
|
formatReference,
|
|
36351
36396
|
parseReference,
|
|
@@ -36408,7 +36453,10 @@ export {
|
|
|
36408
36453
|
resetSearchIndex,
|
|
36409
36454
|
fillStems,
|
|
36410
36455
|
resetStems,
|
|
36456
|
+
CONTEXT_MAX_READ_BYTES,
|
|
36457
|
+
contextEvidenceFingerprint,
|
|
36411
36458
|
contextSource,
|
|
36459
|
+
contextEvidenceRequest,
|
|
36412
36460
|
calendarMoment,
|
|
36413
36461
|
involvementStoreOver,
|
|
36414
36462
|
OTHER_SOURCES,
|